yamchart 0.9.0 → 0.9.1
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/{advisor-Z7TKPPBR.js → advisor-HVD4FJ56.js} +3 -3
- package/dist/{chunk-FZFBBB7K.js → chunk-LQANFANB.js} +2 -2
- package/dist/{chunk-E2QN2M7S.js → chunk-LQN2HNQZ.js} +11 -3
- package/dist/chunk-LQN2HNQZ.js.map +1 -0
- package/dist/{chunk-AMHCOB4D.js → chunk-R22XWFKX.js} +3 -3
- package/dist/{chunk-G57J2WQM.js → chunk-XDDBDJQL.js} +2 -2
- package/dist/{connection-utils-CTPN7PV3.js → connection-utils-WVQGWJ7H.js} +3 -3
- package/dist/{describe-4NME6RCB.js → describe-UETE5XYO.js} +4 -4
- package/dist/{dev-6QGAB4ZH.js → dev-2WLFE37D.js} +4 -4
- package/dist/{dist-4GUE24QV.js → dist-OAKQOG6H.js} +2 -2
- package/dist/index.js +20 -20
- package/dist/public/assets/{EventManagement-MMsAkJKj.js → EventManagement-CWrv68To.js} +1 -1
- package/dist/public/assets/{ExplorePage-BSkSNgLT.js → ExplorePage-2wblm-7t.js} +1 -1
- package/dist/public/assets/{LoginPage-vaI1dnyL.js → LoginPage-J48L4t6I.js} +1 -1
- package/dist/public/assets/{PublicViewer-B-OKj2cg.js → PublicViewer-BrjKKW5m.js} +1 -1
- package/dist/public/assets/{SetupWizard-DvlVX2O6.js → SetupWizard-fRVi5bF4.js} +1 -1
- package/dist/public/assets/{ShareManagement-ulvPrOAQ.js → ShareManagement-DUdL-Diq.js} +1 -1
- package/dist/public/assets/{UserManagement-CvmpNy3o.js → UserManagement-BlwTHdH4.js} +1 -1
- package/dist/public/assets/index-CJ01RqZ2.js +195 -0
- package/dist/public/assets/{index.es-BeTaRWIv.js → index.es-BtmplkrJ.js} +1 -1
- package/dist/public/assets/{jspdf.es.min-9haD1GSE.js → jspdf.es.min-D0I_3frr.js} +3 -3
- package/dist/public/index.html +1 -1
- package/dist/{query-Z75RKTHV.js → query-E6NFXKV6.js} +3 -3
- package/dist/{sample-OIJNXQNC.js → sample-YLJC5H5X.js} +3 -3
- package/dist/{search-YDCPIDZX.js → search-QDOSNM2R.js} +4 -4
- package/dist/{source-resolver-4SUWXUGW.js → source-resolver-VAXDVSDF.js} +4 -4
- package/dist/{sync-warehouse-NZFDS6WK.js → sync-warehouse-5HEGZJHG.js} +3 -3
- package/dist/{tables-WJS2VI4L.js → tables-6TODJHM5.js} +4 -4
- package/dist/templates/default/docs/yamchart-reference.md +10 -2
- package/dist/{test-I4XOF7TZ.js → test-MXNBCQ3G.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-E2QN2M7S.js.map +0 -1
- package/dist/public/assets/index-DD59fsOk.js +0 -195
- /package/dist/{advisor-Z7TKPPBR.js.map → advisor-HVD4FJ56.js.map} +0 -0
- /package/dist/{chunk-FZFBBB7K.js.map → chunk-LQANFANB.js.map} +0 -0
- /package/dist/{chunk-AMHCOB4D.js.map → chunk-R22XWFKX.js.map} +0 -0
- /package/dist/{chunk-G57J2WQM.js.map → chunk-XDDBDJQL.js.map} +0 -0
- /package/dist/{connection-utils-CTPN7PV3.js.map → connection-utils-WVQGWJ7H.js.map} +0 -0
- /package/dist/{describe-4NME6RCB.js.map → describe-UETE5XYO.js.map} +0 -0
- /package/dist/{dev-6QGAB4ZH.js.map → dev-2WLFE37D.js.map} +0 -0
- /package/dist/{dist-4GUE24QV.js.map → dist-OAKQOG6H.js.map} +0 -0
- /package/dist/{query-Z75RKTHV.js.map → query-E6NFXKV6.js.map} +0 -0
- /package/dist/{sample-OIJNXQNC.js.map → sample-YLJC5H5X.js.map} +0 -0
- /package/dist/{search-YDCPIDZX.js.map → search-QDOSNM2R.js.map} +0 -0
- /package/dist/{source-resolver-4SUWXUGW.js.map → source-resolver-VAXDVSDF.js.map} +0 -0
- /package/dist/{sync-warehouse-NZFDS6WK.js.map → sync-warehouse-5HEGZJHG.js.map} +0 -0
- /package/dist/{tables-WJS2VI4L.js.map → tables-6TODJHM5.js.map} +0 -0
- /package/dist/{test-I4XOF7TZ.js.map → test-MXNBCQ3G.js.map} +0 -0
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginPage-vaI1dnyL.js","assets/echarts-DtOYsfLX.js","assets/SetupWizard-DvlVX2O6.js","assets/UserManagement-CvmpNy3o.js","assets/ShareManagement-ulvPrOAQ.js","assets/PublicViewer-B-OKj2cg.js","assets/EventManagement-MMsAkJKj.js","assets/ExplorePage-BSkSNgLT.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var nk=Object.defineProperty;var $g=e=>{throw TypeError(e)};var rk=(e,t,n)=>t in e?nk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var qe=(e,t,n)=>rk(e,typeof t!="symbol"?t+"":t,n),Ph=(e,t,n)=>t.has(e)||$g("Cannot "+n);var $=(e,t,n)=>(Ph(e,t,"read from private field"),n?n.call(e):t.get(e)),Ve=(e,t,n)=>t.has(e)?$g("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Me=(e,t,n,r)=>(Ph(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),dt=(e,t,n)=>(Ph(e,t,"access private method"),n);var Sc=(e,t,n,r)=>({set _(s){Me(e,t,s,n)},get _(){return $(e,t,r)}});import{r as ma,a as N,R as Le,g as Ab,E as sk}from"./echarts-DtOYsfLX.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var jh={exports:{}},pl={};/**
|
|
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 qg;function ok(){if(qg)return pl;qg=1;var e=ma(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(u,f,h){var p,y={},g=null,b=null;h!==void 0&&(g=""+h),f.key!==void 0&&(g=""+f.key),f.ref!==void 0&&(b=f.ref);for(p in f)r.call(f,p)&&!i.hasOwnProperty(p)&&(y[p]=f[p]);if(u&&u.defaultProps)for(p in f=u.defaultProps,f)y[p]===void 0&&(y[p]=f[p]);return{$$typeof:t,type:u,key:g,ref:b,props:y,_owner:s.current}}return pl.Fragment=n,pl.jsx=l,pl.jsxs=l,pl}var Vg;function ak(){return Vg||(Vg=1,jh.exports=ok()),jh.exports}var d=ak(),Cc={},Fh={exports:{}},Zn={},Bh={exports:{}},Hh={};/**
|
|
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 ik(){return Qg||(Qg=1,(function(e){function t(G,fe){var P=G.length;G.push(fe);e:for(;0<P;){var K=P-1>>>1,ee=G[K];if(0<s(ee,fe))G[K]=fe,G[P]=ee,P=K;else break e}}function n(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var fe=G[0],P=G.pop();if(P!==fe){G[0]=P;e:for(var K=0,ee=G.length,R=ee>>>1;K<R;){var ie=2*(K+1)-1,ae=G[ie],J=ie+1,be=G[J];if(0>s(ae,P))J<ee&&0>s(be,ae)?(G[K]=be,G[J]=P,K=J):(G[K]=ae,G[ie]=P,K=ie);else if(J<ee&&0>s(be,P))G[K]=be,G[J]=P,K=J;else break e}}return fe}function s(G,fe){var P=G.sortIndex-fe.sortIndex;return P!==0?P:G.id-fe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var f=[],h=[],p=1,y=null,g=3,b=!1,O=!1,w=!1,T=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(G){for(var fe=n(h);fe!==null;){if(fe.callback===null)r(h);else if(fe.startTime<=G)r(h),fe.sortIndex=fe.expirationTime,t(f,fe);else break;fe=n(h)}}function A(G){if(w=!1,S(G),!O)if(n(f)!==null)O=!0,re(M);else{var fe=n(h);fe!==null&&ye(A,fe.startTime-G)}}function M(G,fe){O=!1,w&&(w=!1,E(D),D=-1),b=!0;var P=g;try{for(S(fe),y=n(f);y!==null&&(!(y.expirationTime>fe)||G&&!B());){var K=y.callback;if(typeof K=="function"){y.callback=null,g=y.priorityLevel;var ee=K(y.expirationTime<=fe);fe=e.unstable_now(),typeof ee=="function"?y.callback=ee:y===n(f)&&r(f),S(fe)}else r(f);y=n(f)}if(y!==null)var R=!0;else{var ie=n(h);ie!==null&&ye(A,ie.startTime-fe),R=!1}return R}finally{y=null,g=P,b=!1}}var C=!1,I=null,D=-1,j=5,F=-1;function B(){return!(e.unstable_now()-F<j)}function U(){if(I!==null){var G=e.unstable_now();F=G;var fe=!0;try{fe=I(!0,G)}finally{fe?W():(C=!1,I=null)}}else C=!1}var W;if(typeof _=="function")W=function(){_(U)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,Q=Y.port2;Y.port1.onmessage=U,W=function(){Q.postMessage(null)}}else W=function(){T(U,0)};function re(G){I=G,C||(C=!0,W())}function ye(G,fe){D=T(function(){G(e.unstable_now())},fe)}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(G){G.callback=null},e.unstable_continueExecution=function(){O||b||(O=!0,re(M))},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(G){switch(g){case 1:case 2:case 3:var fe=3;break;default:fe=g}var P=g;g=fe;try{return G()}finally{g=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(G,fe){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var P=g;g=G;try{return fe()}finally{g=P}},e.unstable_scheduleCallback=function(G,fe,P){var K=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?K+P:K):P=K,G){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=P+ee,G={id:p++,callback:fe,priorityLevel:G,startTime:P,expirationTime:ee,sortIndex:-1},P>K?(G.sortIndex=P,t(h,G),n(f)===null&&G===n(h)&&(w?(E(D),D=-1):w=!0,ye(A,P-K))):(G.sortIndex=ee,t(f,G),O||b||(O=!0,re(M))),G},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(G){var fe=g;return function(){var P=g;g=fe;try{return G.apply(this,arguments)}finally{g=P}}}})(Hh)),Hh}var Gg;function lk(){return Gg||(Gg=1,Bh.exports=ik()),Bh.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 Kg;function uk(){if(Kg)return Zn;Kg=1;var e=ma(),t=lk();function n(o){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+o,c=1;c<arguments.length;c++)a+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+o+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function i(o,a){l(o,a),l(o+"Capture",a)}function l(o,a){for(s[o]=a,o=0;o<a.length;o++)r.add(a[o])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=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]*$/,p={},y={};function g(o){return f.call(y,o)?!0:f.call(p,o)?!1:h.test(o)?y[o]=!0:(p[o]=!0,!1)}function b(o,a,c,m){if(c!==null&&c.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return m?!1:c!==null?!c.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function O(o,a,c,m){if(a===null||typeof a>"u"||b(o,a,c,m))return!0;if(m)return!1;if(c!==null)switch(c.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function w(o,a,c,m,v,k,L){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=m,this.attributeNamespace=v,this.mustUseProperty=c,this.propertyName=o,this.type=a,this.sanitizeURL=k,this.removeEmptyString=L}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){T[o]=new w(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var a=o[0];T[a]=new w(a,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){T[o]=new w(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){T[o]=new w(o,2,!1,o,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(o){T[o]=new w(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){T[o]=new w(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){T[o]=new w(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){T[o]=new w(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){T[o]=new w(o,5,!1,o.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function _(o){return o[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(o){var a=o.replace(E,_);T[a]=new w(a,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var a=o.replace(E,_);T[a]=new w(a,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var a=o.replace(E,_);T[a]=new w(a,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){T[o]=new w(o,1,!1,o.toLowerCase(),null,!1,!1)}),T.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){T[o]=new w(o,1,!1,o.toLowerCase(),null,!0,!0)});function S(o,a,c,m){var v=T.hasOwnProperty(a)?T[a]:null;(v!==null?v.type!==0:m||!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(O(a,c,v,m)&&(c=null),m||v===null?g(a)&&(c===null?o.removeAttribute(a):o.setAttribute(a,""+c)):v.mustUseProperty?o[v.propertyName]=c===null?v.type===3?!1:"":c:(a=v.attributeName,m=v.attributeNamespace,c===null?o.removeAttribute(a):(v=v.type,c=v===3||v===4&&c===!0?"":""+c,m?o.setAttributeNS(m,a,c):o.setAttribute(a,c))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,M=Symbol.for("react.element"),C=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),B=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),ye=Symbol.for("react.offscreen"),G=Symbol.iterator;function fe(o){return o===null||typeof o!="object"?null:(o=G&&o[G]||o["@@iterator"],typeof o=="function"?o:null)}var P=Object.assign,K;function ee(o){if(K===void 0)try{throw Error()}catch(c){var a=c.stack.trim().match(/\n( *(at )?)/);K=a&&a[1]||""}return`
|
|
27
|
-
`+K+o}var R=!1;function ie(o,a){if(!o||R)return"";R=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(he){var m=he}Reflect.construct(o,[],a)}else{try{a.call()}catch(he){m=he}o.call(a.prototype)}else{try{throw Error()}catch(he){m=he}o()}}catch(he){if(he&&m&&typeof he.stack=="string"){for(var v=he.stack.split(`
|
|
28
|
-
`),k=m.stack.split(`
|
|
29
|
-
`),L=v.length-1,q=k.length-1;1<=L&&0<=q&&v[L]!==k[q];)q--;for(;1<=L&&0<=q;L--,q--)if(v[L]!==k[q]){if(L!==1||q!==1)do if(L--,q--,0>q||v[L]!==k[q]){var X=`
|
|
30
|
-
`+v[L].replace(" at new "," at ");return o.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",o.displayName)),X}while(1<=L&&0<=q);break}}}finally{R=!1,Error.prepareStackTrace=c}return(o=o?o.displayName||o.name:"")?ee(o):""}function ae(o){switch(o.tag){case 5:return ee(o.type);case 16:return ee("Lazy");case 13:return ee("Suspense");case 19:return ee("SuspenseList");case 0:case 2:case 15:return o=ie(o.type,!1),o;case 11:return o=ie(o.type.render,!1),o;case 1:return o=ie(o.type,!0),o;default:return""}}function J(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case I:return"Fragment";case C:return"Portal";case j:return"Profiler";case D:return"StrictMode";case W:return"Suspense";case Y:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case B:return(o.displayName||"Context")+".Consumer";case F:return(o._context.displayName||"Context")+".Provider";case U:var a=o.render;return o=o.displayName,o||(o=a.displayName||a.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case Q:return a=o.displayName||null,a!==null?a:J(o.type)||"Memo";case re:a=o._payload,o=o._init;try{return J(o(a))}catch{}}return null}function be(o){var a=o.type;switch(o.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=a.render,o=o.displayName||o.name||"",a.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return J(a);case 8:return a===D?"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 a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function te(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function le(o){var a=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function ge(o){var a=le(o)?"checked":"value",c=Object.getOwnPropertyDescriptor(o.constructor.prototype,a),m=""+o[a];if(!o.hasOwnProperty(a)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var v=c.get,k=c.set;return Object.defineProperty(o,a,{configurable:!0,get:function(){return v.call(this)},set:function(L){m=""+L,k.call(this,L)}}),Object.defineProperty(o,a,{enumerable:c.enumerable}),{getValue:function(){return m},setValue:function(L){m=""+L},stopTracking:function(){o._valueTracker=null,delete o[a]}}}}function ve(o){o._valueTracker||(o._valueTracker=ge(o))}function je(o){if(!o)return!1;var a=o._valueTracker;if(!a)return!0;var c=a.getValue(),m="";return o&&(m=le(o)?o.checked?"true":"false":o.value),o=m,o!==c?(a.setValue(o),!0):!1}function Ye(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function nt(o,a){var c=a.checked;return P({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:c??o._wrapperState.initialChecked})}function tt(o,a){var c=a.defaultValue==null?"":a.defaultValue,m=a.checked!=null?a.checked:a.defaultChecked;c=te(a.value!=null?a.value:c),o._wrapperState={initialChecked:m,initialValue:c,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function Je(o,a){a=a.checked,a!=null&&S(o,"checked",a,!1)}function rt(o,a){Je(o,a);var c=te(a.value),m=a.type;if(c!=null)m==="number"?(c===0&&o.value===""||o.value!=c)&&(o.value=""+c):o.value!==""+c&&(o.value=""+c);else if(m==="submit"||m==="reset"){o.removeAttribute("value");return}a.hasOwnProperty("value")?pe(o,a.type,c):a.hasOwnProperty("defaultValue")&&pe(o,a.type,te(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(o.defaultChecked=!!a.defaultChecked)}function ut(o,a,c){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var m=a.type;if(!(m!=="submit"&&m!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+o._wrapperState.initialValue,c||a===o.value||(o.value=a),o.defaultValue=a}c=o.name,c!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,c!==""&&(o.name=c)}function pe(o,a,c){(a!=="number"||Ye(o.ownerDocument)!==o)&&(c==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+c&&(o.defaultValue=""+c))}var me=Array.isArray;function Ae(o,a,c,m){if(o=o.options,a){a={};for(var v=0;v<c.length;v++)a["$"+c[v]]=!0;for(c=0;c<o.length;c++)v=a.hasOwnProperty("$"+o[c].value),o[c].selected!==v&&(o[c].selected=v),v&&m&&(o[c].defaultSelected=!0)}else{for(c=""+te(c),a=null,v=0;v<o.length;v++){if(o[v].value===c){o[v].selected=!0,m&&(o[v].defaultSelected=!0);return}a!==null||o[v].disabled||(a=o[v])}a!==null&&(a.selected=!0)}}function Pe(o,a){if(a.dangerouslySetInnerHTML!=null)throw Error(n(91));return P({},a,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function ct(o,a){var c=a.value;if(c==null){if(c=a.children,a=a.defaultValue,c!=null){if(a!=null)throw Error(n(92));if(me(c)){if(1<c.length)throw Error(n(93));c=c[0]}a=c}a==null&&(a=""),c=a}o._wrapperState={initialValue:te(c)}}function kt(o,a){var c=te(a.value),m=te(a.defaultValue);c!=null&&(c=""+c,c!==o.value&&(o.value=c),a.defaultValue==null&&o.defaultValue!==c&&(o.defaultValue=c)),m!=null&&(o.defaultValue=""+m)}function bt(o){var a=o.textContent;a===o._wrapperState.initialValue&&a!==""&&a!==null&&(o.value=a)}function ue(o){switch(o){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 ne(o,a){return o==null||o==="http://www.w3.org/1999/xhtml"?ue(a):o==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Te,Re=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(a,c,m,v){MSApp.execUnsafeLocalFunction(function(){return o(a,c,m,v)})}:o})(function(o,a){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=a;else{for(Te=Te||document.createElement("div"),Te.innerHTML="<svg>"+a.valueOf().toString()+"</svg>",a=Te.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;a.firstChild;)o.appendChild(a.firstChild)}});function Fe(o,a){if(a){var c=o.firstChild;if(c&&c===o.lastChild&&c.nodeType===3){c.nodeValue=a;return}}o.textContent=a}var Be={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},pt=["Webkit","ms","Moz","O"];Object.keys(Be).forEach(function(o){pt.forEach(function(a){a=a+o.charAt(0).toUpperCase()+o.substring(1),Be[a]=Be[o]})});function de(o,a,c){return a==null||typeof a=="boolean"||a===""?"":c||typeof a!="number"||a===0||Be.hasOwnProperty(o)&&Be[o]?(""+a).trim():a+"px"}function _e(o,a){o=o.style;for(var c in a)if(a.hasOwnProperty(c)){var m=c.indexOf("--")===0,v=de(c,a[c],m);c==="float"&&(c="cssFloat"),m?o.setProperty(c,v):o[c]=v}}var Ee=P({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 He(o,a){if(a){if(Ee[o]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(n(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(n(61))}if(a.style!=null&&typeof a.style!="object")throw Error(n(62))}}function Ue(o,a){if(o.indexOf("-")===-1)return typeof a.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var vt=null;function jt(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var $e=null,ft=null,De=null;function We(o){if(o=el(o)){if(typeof $e!="function")throw Error(n(280));var a=o.stateNode;a&&(a=Hu(a),$e(o.stateNode,o.type,a))}}function gt(o){ft?De?De.push(o):De=[o]:ft=o}function Ge(){if(ft){var o=ft,a=De;if(De=ft=null,We(o),a)for(o=0;o<a.length;o++)We(a[o])}}function Kt(o,a){return o(a)}function on(){}var an=!1;function Xt(o,a,c){if(an)return o(a,c);an=!0;try{return Kt(o,a,c)}finally{an=!1,(ft!==null||De!==null)&&(on(),Ge())}}function ln(o,a){var c=o.stateNode;if(c===null)return null;var m=Hu(c);if(m===null)return null;c=m[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(o=o.type,m=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!m;break e;default:o=!1}if(o)return null;if(c&&typeof c!="function")throw Error(n(231,a,typeof c));return c}var In=!1;if(u)try{var Vn={};Object.defineProperty(Vn,"passive",{get:function(){In=!0}}),window.addEventListener("test",Vn,Vn),window.removeEventListener("test",Vn,Vn)}catch{In=!1}function Vr(o,a,c,m,v,k,L,q,X){var he=Array.prototype.slice.call(arguments,3);try{a.apply(c,he)}catch(Se){this.onError(Se)}}var Ke=!1,yt=null,at=!1,St=null,Lt={onError:function(o){Ke=!0,yt=o}};function Ot(o,a,c,m,v,k,L,q,X){Ke=!1,yt=null,Vr.apply(Lt,arguments)}function Ut(o,a,c,m,v,k,L,q,X){if(Ot.apply(this,arguments),Ke){if(Ke){var he=yt;Ke=!1,yt=null}else throw Error(n(198));at||(at=!0,St=he)}}function zt(o){var a=o,c=o;if(o.alternate)for(;a.return;)a=a.return;else{o=a;do a=o,(a.flags&4098)!==0&&(c=a.return),o=a.return;while(o)}return a.tag===3?c:null}function Ht(o){if(o.tag===13){var a=o.memoizedState;if(a===null&&(o=o.alternate,o!==null&&(a=o.memoizedState)),a!==null)return a.dehydrated}return null}function vn(o){if(zt(o)!==o)throw Error(n(188))}function Ta(o){var a=o.alternate;if(!a){if(a=zt(o),a===null)throw Error(n(188));return a!==o?null:o}for(var c=o,m=a;;){var v=c.return;if(v===null)break;var k=v.alternate;if(k===null){if(m=v.return,m!==null){c=m;continue}break}if(v.child===k.child){for(k=v.child;k;){if(k===c)return vn(v),o;if(k===m)return vn(v),a;k=k.sibling}throw Error(n(188))}if(c.return!==m.return)c=v,m=k;else{for(var L=!1,q=v.child;q;){if(q===c){L=!0,c=v,m=k;break}if(q===m){L=!0,m=v,c=k;break}q=q.sibling}if(!L){for(q=k.child;q;){if(q===c){L=!0,c=k,m=v;break}if(q===m){L=!0,m=k,c=v;break}q=q.sibling}if(!L)throw Error(n(189))}}if(c.alternate!==m)throw Error(n(190))}if(c.tag!==3)throw Error(n(188));return c.stateNode.current===c?o:a}function gr(o){return o=Ta(o),o!==null?js(o):null}function js(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var a=js(o);if(a!==null)return a;o=o.sibling}return null}var Do=t.unstable_scheduleCallback,Wt=t.unstable_cancelCallback,Ri=t.unstable_shouldYield,wa=t.unstable_requestPaint,Yt=t.unstable_now,bu=t.unstable_getCurrentPriorityLevel,Oo=t.unstable_ImmediatePriority,vp=t.unstable_UserBlockingPriority,vu=t.unstable_NormalPriority,yT=t.unstable_LowPriority,Ep=t.unstable_IdlePriority,Eu=null,Qr=null;function gT(o){if(Qr&&typeof Qr.onCommitFiberRoot=="function")try{Qr.onCommitFiberRoot(Eu,o,void 0,(o.current.flags&128)===128)}catch{}}var Ir=Math.clz32?Math.clz32:vT,xT=Math.log,bT=Math.LN2;function vT(o){return o>>>=0,o===0?32:31-(xT(o)/bT|0)|0}var Tu=64,wu=4194304;function Pi(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function ku(o,a){var c=o.pendingLanes;if(c===0)return 0;var m=0,v=o.suspendedLanes,k=o.pingedLanes,L=c&268435455;if(L!==0){var q=L&~v;q!==0?m=Pi(q):(k&=L,k!==0&&(m=Pi(k)))}else L=c&~v,L!==0?m=Pi(L):k!==0&&(m=Pi(k));if(m===0)return 0;if(a!==0&&a!==m&&(a&v)===0&&(v=m&-m,k=a&-a,v>=k||v===16&&(k&4194240)!==0))return a;if((m&4)!==0&&(m|=c&16),a=o.entangledLanes,a!==0)for(o=o.entanglements,a&=m;0<a;)c=31-Ir(a),v=1<<c,m|=o[c],a&=~v;return m}function ET(o,a){switch(o){case 1:case 2:case 4:return a+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 a+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 TT(o,a){for(var c=o.suspendedLanes,m=o.pingedLanes,v=o.expirationTimes,k=o.pendingLanes;0<k;){var L=31-Ir(k),q=1<<L,X=v[L];X===-1?((q&c)===0||(q&m)!==0)&&(v[L]=ET(q,a)):X<=a&&(o.expiredLanes|=q),k&=~q}}function nf(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Tp(){var o=Tu;return Tu<<=1,(Tu&4194240)===0&&(Tu=64),o}function rf(o){for(var a=[],c=0;31>c;c++)a.push(o);return a}function ji(o,a,c){o.pendingLanes|=a,a!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,a=31-Ir(a),o[a]=c}function wT(o,a){var c=o.pendingLanes&~a;o.pendingLanes=a,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=a,o.mutableReadLanes&=a,o.entangledLanes&=a,a=o.entanglements;var m=o.eventTimes;for(o=o.expirationTimes;0<c;){var v=31-Ir(c),k=1<<v;a[v]=0,m[v]=-1,o[v]=-1,c&=~k}}function sf(o,a){var c=o.entangledLanes|=a;for(o=o.entanglements;c;){var m=31-Ir(c),v=1<<m;v&a|o[m]&a&&(o[m]|=a),c&=~v}}var Ft=0;function wp(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var kp,of,Sp,Cp,Np,af=!1,Su=[],Fs=null,Bs=null,Hs=null,Fi=new Map,Bi=new Map,Us=[],kT="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 _p(o,a){switch(o){case"focusin":case"focusout":Fs=null;break;case"dragenter":case"dragleave":Bs=null;break;case"mouseover":case"mouseout":Hs=null;break;case"pointerover":case"pointerout":Fi.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bi.delete(a.pointerId)}}function Hi(o,a,c,m,v,k){return o===null||o.nativeEvent!==k?(o={blockedOn:a,domEventName:c,eventSystemFlags:m,nativeEvent:k,targetContainers:[v]},a!==null&&(a=el(a),a!==null&&of(a)),o):(o.eventSystemFlags|=m,a=o.targetContainers,v!==null&&a.indexOf(v)===-1&&a.push(v),o)}function ST(o,a,c,m,v){switch(a){case"focusin":return Fs=Hi(Fs,o,a,c,m,v),!0;case"dragenter":return Bs=Hi(Bs,o,a,c,m,v),!0;case"mouseover":return Hs=Hi(Hs,o,a,c,m,v),!0;case"pointerover":var k=v.pointerId;return Fi.set(k,Hi(Fi.get(k)||null,o,a,c,m,v)),!0;case"gotpointercapture":return k=v.pointerId,Bi.set(k,Hi(Bi.get(k)||null,o,a,c,m,v)),!0}return!1}function Dp(o){var a=Ao(o.target);if(a!==null){var c=zt(a);if(c!==null){if(a=c.tag,a===13){if(a=Ht(c),a!==null){o.blockedOn=a,Np(o.priority,function(){Sp(c)});return}}else if(a===3&&c.stateNode.current.memoizedState.isDehydrated){o.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Cu(o){if(o.blockedOn!==null)return!1;for(var a=o.targetContainers;0<a.length;){var c=uf(o.domEventName,o.eventSystemFlags,a[0],o.nativeEvent);if(c===null){c=o.nativeEvent;var m=new c.constructor(c.type,c);vt=m,c.target.dispatchEvent(m),vt=null}else return a=el(c),a!==null&&of(a),o.blockedOn=c,!1;a.shift()}return!0}function Op(o,a,c){Cu(o)&&c.delete(a)}function CT(){af=!1,Fs!==null&&Cu(Fs)&&(Fs=null),Bs!==null&&Cu(Bs)&&(Bs=null),Hs!==null&&Cu(Hs)&&(Hs=null),Fi.forEach(Op),Bi.forEach(Op)}function Ui(o,a){o.blockedOn===a&&(o.blockedOn=null,af||(af=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,CT)))}function zi(o){function a(v){return Ui(v,o)}if(0<Su.length){Ui(Su[0],o);for(var c=1;c<Su.length;c++){var m=Su[c];m.blockedOn===o&&(m.blockedOn=null)}}for(Fs!==null&&Ui(Fs,o),Bs!==null&&Ui(Bs,o),Hs!==null&&Ui(Hs,o),Fi.forEach(a),Bi.forEach(a),c=0;c<Us.length;c++)m=Us[c],m.blockedOn===o&&(m.blockedOn=null);for(;0<Us.length&&(c=Us[0],c.blockedOn===null);)Dp(c),c.blockedOn===null&&Us.shift()}var ka=A.ReactCurrentBatchConfig,Nu=!0;function NT(o,a,c,m){var v=Ft,k=ka.transition;ka.transition=null;try{Ft=1,lf(o,a,c,m)}finally{Ft=v,ka.transition=k}}function _T(o,a,c,m){var v=Ft,k=ka.transition;ka.transition=null;try{Ft=4,lf(o,a,c,m)}finally{Ft=v,ka.transition=k}}function lf(o,a,c,m){if(Nu){var v=uf(o,a,c,m);if(v===null)Cf(o,a,m,_u,c),_p(o,m);else if(ST(v,o,a,c,m))m.stopPropagation();else if(_p(o,m),a&4&&-1<kT.indexOf(o)){for(;v!==null;){var k=el(v);if(k!==null&&kp(k),k=uf(o,a,c,m),k===null&&Cf(o,a,m,_u,c),k===v)break;v=k}v!==null&&m.stopPropagation()}else Cf(o,a,m,null,c)}}var _u=null;function uf(o,a,c,m){if(_u=null,o=jt(m),o=Ao(o),o!==null)if(a=zt(o),a===null)o=null;else if(c=a.tag,c===13){if(o=Ht(a),o!==null)return o;o=null}else if(c===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;o=null}else a!==o&&(o=null);return _u=o,null}function Ap(o){switch(o){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(bu()){case Oo:return 1;case vp:return 4;case vu:case yT:return 16;case Ep:return 536870912;default:return 16}default:return 16}}var zs=null,cf=null,Du=null;function Ip(){if(Du)return Du;var o,a=cf,c=a.length,m,v="value"in zs?zs.value:zs.textContent,k=v.length;for(o=0;o<c&&a[o]===v[o];o++);var L=c-o;for(m=1;m<=L&&a[c-m]===v[k-m];m++);return Du=v.slice(o,1<m?1-m:void 0)}function Ou(o){var a=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&a===13&&(o=13)):o=a,o===10&&(o=13),32<=o||o===13?o:0}function Au(){return!0}function Mp(){return!1}function ir(o){function a(c,m,v,k,L){this._reactName=c,this._targetInst=v,this.type=m,this.nativeEvent=k,this.target=L,this.currentTarget=null;for(var q in o)o.hasOwnProperty(q)&&(c=o[q],this[q]=c?c(k):k[q]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?Au:Mp,this.isPropagationStopped=Mp,this}return P(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Au)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Au)},persist:function(){},isPersistent:Au}),a}var Sa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},df=ir(Sa),Wi=P({},Sa,{view:0,detail:0}),DT=ir(Wi),ff,hf,Yi,Iu=P({},Wi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pf,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Yi&&(Yi&&o.type==="mousemove"?(ff=o.screenX-Yi.screenX,hf=o.screenY-Yi.screenY):hf=ff=0,Yi=o),ff)},movementY:function(o){return"movementY"in o?o.movementY:hf}}),Lp=ir(Iu),OT=P({},Iu,{dataTransfer:0}),AT=ir(OT),IT=P({},Wi,{relatedTarget:0}),mf=ir(IT),MT=P({},Sa,{animationName:0,elapsedTime:0,pseudoElement:0}),LT=ir(MT),RT=P({},Sa,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),PT=ir(RT),jT=P({},Sa,{data:0}),Rp=ir(jT),FT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},BT={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"},HT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function UT(o){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(o):(o=HT[o])?!!a[o]:!1}function pf(){return UT}var zT=P({},Wi,{key:function(o){if(o.key){var a=FT[o.key]||o.key;if(a!=="Unidentified")return a}return o.type==="keypress"?(o=Ou(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?BT[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pf,charCode:function(o){return o.type==="keypress"?Ou(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Ou(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),WT=ir(zT),YT=P({},Iu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pp=ir(YT),$T=P({},Wi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pf}),qT=ir($T),VT=P({},Sa,{propertyName:0,elapsedTime:0,pseudoElement:0}),QT=ir(VT),GT=P({},Iu,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),KT=ir(GT),XT=[9,13,27,32],yf=u&&"CompositionEvent"in window,$i=null;u&&"documentMode"in document&&($i=document.documentMode);var JT=u&&"TextEvent"in window&&!$i,jp=u&&(!yf||$i&&8<$i&&11>=$i),Fp=" ",Bp=!1;function Hp(o,a){switch(o){case"keyup":return XT.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Up(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Ca=!1;function ZT(o,a){switch(o){case"compositionend":return Up(a);case"keypress":return a.which!==32?null:(Bp=!0,Fp);case"textInput":return o=a.data,o===Fp&&Bp?null:o;default:return null}}function ew(o,a){if(Ca)return o==="compositionend"||!yf&&Hp(o,a)?(o=Ip(),Du=cf=zs=null,Ca=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return jp&&a.locale!=="ko"?null:a.data;default:return null}}var tw={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(o){var a=o&&o.nodeName&&o.nodeName.toLowerCase();return a==="input"?!!tw[o.type]:a==="textarea"}function Wp(o,a,c,m){gt(m),a=ju(a,"onChange"),0<a.length&&(c=new df("onChange","change",null,c,m),o.push({event:c,listeners:a}))}var qi=null,Vi=null;function nw(o){iy(o,0)}function Mu(o){var a=Aa(o);if(je(a))return o}function rw(o,a){if(o==="change")return a}var Yp=!1;if(u){var gf;if(u){var xf="oninput"in document;if(!xf){var $p=document.createElement("div");$p.setAttribute("oninput","return;"),xf=typeof $p.oninput=="function"}gf=xf}else gf=!1;Yp=gf&&(!document.documentMode||9<document.documentMode)}function qp(){qi&&(qi.detachEvent("onpropertychange",Vp),Vi=qi=null)}function Vp(o){if(o.propertyName==="value"&&Mu(Vi)){var a=[];Wp(a,Vi,o,jt(o)),Xt(nw,a)}}function sw(o,a,c){o==="focusin"?(qp(),qi=a,Vi=c,qi.attachEvent("onpropertychange",Vp)):o==="focusout"&&qp()}function ow(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Mu(Vi)}function aw(o,a){if(o==="click")return Mu(a)}function iw(o,a){if(o==="input"||o==="change")return Mu(a)}function lw(o,a){return o===a&&(o!==0||1/o===1/a)||o!==o&&a!==a}var Mr=typeof Object.is=="function"?Object.is:lw;function Qi(o,a){if(Mr(o,a))return!0;if(typeof o!="object"||o===null||typeof a!="object"||a===null)return!1;var c=Object.keys(o),m=Object.keys(a);if(c.length!==m.length)return!1;for(m=0;m<c.length;m++){var v=c[m];if(!f.call(a,v)||!Mr(o[v],a[v]))return!1}return!0}function Qp(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function Gp(o,a){var c=Qp(o);o=0;for(var m;c;){if(c.nodeType===3){if(m=o+c.textContent.length,o<=a&&m>=a)return{node:c,offset:a-o};o=m}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Qp(c)}}function Kp(o,a){return o&&a?o===a?!0:o&&o.nodeType===3?!1:a&&a.nodeType===3?Kp(o,a.parentNode):"contains"in o?o.contains(a):o.compareDocumentPosition?!!(o.compareDocumentPosition(a)&16):!1:!1}function Xp(){for(var o=window,a=Ye();a instanceof o.HTMLIFrameElement;){try{var c=typeof a.contentWindow.location.href=="string"}catch{c=!1}if(c)o=a.contentWindow;else break;a=Ye(o.document)}return a}function bf(o){var a=o&&o.nodeName&&o.nodeName.toLowerCase();return a&&(a==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||a==="textarea"||o.contentEditable==="true")}function uw(o){var a=Xp(),c=o.focusedElem,m=o.selectionRange;if(a!==c&&c&&c.ownerDocument&&Kp(c.ownerDocument.documentElement,c)){if(m!==null&&bf(c)){if(a=m.start,o=m.end,o===void 0&&(o=a),"selectionStart"in c)c.selectionStart=a,c.selectionEnd=Math.min(o,c.value.length);else if(o=(a=c.ownerDocument||document)&&a.defaultView||window,o.getSelection){o=o.getSelection();var v=c.textContent.length,k=Math.min(m.start,v);m=m.end===void 0?k:Math.min(m.end,v),!o.extend&&k>m&&(v=m,m=k,k=v),v=Gp(c,k);var L=Gp(c,m);v&&L&&(o.rangeCount!==1||o.anchorNode!==v.node||o.anchorOffset!==v.offset||o.focusNode!==L.node||o.focusOffset!==L.offset)&&(a=a.createRange(),a.setStart(v.node,v.offset),o.removeAllRanges(),k>m?(o.addRange(a),o.extend(L.node,L.offset)):(a.setEnd(L.node,L.offset),o.addRange(a)))}}for(a=[],o=c;o=o.parentNode;)o.nodeType===1&&a.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;c<a.length;c++)o=a[c],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var cw=u&&"documentMode"in document&&11>=document.documentMode,Na=null,vf=null,Gi=null,Ef=!1;function Jp(o,a,c){var m=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Ef||Na==null||Na!==Ye(m)||(m=Na,"selectionStart"in m&&bf(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Gi&&Qi(Gi,m)||(Gi=m,m=ju(vf,"onSelect"),0<m.length&&(a=new df("onSelect","select",null,a,c),o.push({event:a,listeners:m}),a.target=Na)))}function Lu(o,a){var c={};return c[o.toLowerCase()]=a.toLowerCase(),c["Webkit"+o]="webkit"+a,c["Moz"+o]="moz"+a,c}var _a={animationend:Lu("Animation","AnimationEnd"),animationiteration:Lu("Animation","AnimationIteration"),animationstart:Lu("Animation","AnimationStart"),transitionend:Lu("Transition","TransitionEnd")},Tf={},Zp={};u&&(Zp=document.createElement("div").style,"AnimationEvent"in window||(delete _a.animationend.animation,delete _a.animationiteration.animation,delete _a.animationstart.animation),"TransitionEvent"in window||delete _a.transitionend.transition);function Ru(o){if(Tf[o])return Tf[o];if(!_a[o])return o;var a=_a[o],c;for(c in a)if(a.hasOwnProperty(c)&&c in Zp)return Tf[o]=a[c];return o}var ey=Ru("animationend"),ty=Ru("animationiteration"),ny=Ru("animationstart"),ry=Ru("transitionend"),sy=new Map,oy="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 Ws(o,a){sy.set(o,a),i(a,[o])}for(var wf=0;wf<oy.length;wf++){var kf=oy[wf],dw=kf.toLowerCase(),fw=kf[0].toUpperCase()+kf.slice(1);Ws(dw,"on"+fw)}Ws(ey,"onAnimationEnd"),Ws(ty,"onAnimationIteration"),Ws(ny,"onAnimationStart"),Ws("dblclick","onDoubleClick"),Ws("focusin","onFocus"),Ws("focusout","onBlur"),Ws(ry,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ki="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(" "),hw=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ki));function ay(o,a,c){var m=o.type||"unknown-event";o.currentTarget=c,Ut(m,a,void 0,o),o.currentTarget=null}function iy(o,a){a=(a&4)!==0;for(var c=0;c<o.length;c++){var m=o[c],v=m.event;m=m.listeners;e:{var k=void 0;if(a)for(var L=m.length-1;0<=L;L--){var q=m[L],X=q.instance,he=q.currentTarget;if(q=q.listener,X!==k&&v.isPropagationStopped())break e;ay(v,q,he),k=X}else for(L=0;L<m.length;L++){if(q=m[L],X=q.instance,he=q.currentTarget,q=q.listener,X!==k&&v.isPropagationStopped())break e;ay(v,q,he),k=X}}}if(at)throw o=St,at=!1,St=null,o}function Qt(o,a){var c=a[If];c===void 0&&(c=a[If]=new Set);var m=o+"__bubble";c.has(m)||(ly(a,o,2,!1),c.add(m))}function Sf(o,a,c){var m=0;a&&(m|=4),ly(c,o,m,a)}var Pu="_reactListening"+Math.random().toString(36).slice(2);function Xi(o){if(!o[Pu]){o[Pu]=!0,r.forEach(function(c){c!=="selectionchange"&&(hw.has(c)||Sf(c,!1,o),Sf(c,!0,o))});var a=o.nodeType===9?o:o.ownerDocument;a===null||a[Pu]||(a[Pu]=!0,Sf("selectionchange",!1,a))}}function ly(o,a,c,m){switch(Ap(a)){case 1:var v=NT;break;case 4:v=_T;break;default:v=lf}c=v.bind(null,a,c,o),v=void 0,!In||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(v=!0),m?v!==void 0?o.addEventListener(a,c,{capture:!0,passive:v}):o.addEventListener(a,c,!0):v!==void 0?o.addEventListener(a,c,{passive:v}):o.addEventListener(a,c,!1)}function Cf(o,a,c,m,v){var k=m;if((a&1)===0&&(a&2)===0&&m!==null)e:for(;;){if(m===null)return;var L=m.tag;if(L===3||L===4){var q=m.stateNode.containerInfo;if(q===v||q.nodeType===8&&q.parentNode===v)break;if(L===4)for(L=m.return;L!==null;){var X=L.tag;if((X===3||X===4)&&(X=L.stateNode.containerInfo,X===v||X.nodeType===8&&X.parentNode===v))return;L=L.return}for(;q!==null;){if(L=Ao(q),L===null)return;if(X=L.tag,X===5||X===6){m=k=L;continue e}q=q.parentNode}}m=m.return}Xt(function(){var he=k,Se=jt(c),Ce=[];e:{var we=sy.get(o);if(we!==void 0){var ze=df,Xe=o;switch(o){case"keypress":if(Ou(c)===0)break e;case"keydown":case"keyup":ze=WT;break;case"focusin":Xe="focus",ze=mf;break;case"focusout":Xe="blur",ze=mf;break;case"beforeblur":case"afterblur":ze=mf;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ze=Lp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ze=AT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ze=qT;break;case ey:case ty:case ny:ze=LT;break;case ry:ze=QT;break;case"scroll":ze=DT;break;case"wheel":ze=KT;break;case"copy":case"cut":case"paste":ze=PT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ze=Pp}var Ze=(a&4)!==0,hn=!Ze&&o==="scroll",se=Ze?we!==null?we+"Capture":null:we;Ze=[];for(var Z=he,ce;Z!==null;){ce=Z;var Ie=ce.stateNode;if(ce.tag===5&&Ie!==null&&(ce=Ie,se!==null&&(Ie=ln(Z,se),Ie!=null&&Ze.push(Ji(Z,Ie,ce)))),hn)break;Z=Z.return}0<Ze.length&&(we=new ze(we,Xe,null,c,Se),Ce.push({event:we,listeners:Ze}))}}if((a&7)===0){e:{if(we=o==="mouseover"||o==="pointerover",ze=o==="mouseout"||o==="pointerout",we&&c!==vt&&(Xe=c.relatedTarget||c.fromElement)&&(Ao(Xe)||Xe[ms]))break e;if((ze||we)&&(we=Se.window===Se?Se:(we=Se.ownerDocument)?we.defaultView||we.parentWindow:window,ze?(Xe=c.relatedTarget||c.toElement,ze=he,Xe=Xe?Ao(Xe):null,Xe!==null&&(hn=zt(Xe),Xe!==hn||Xe.tag!==5&&Xe.tag!==6)&&(Xe=null)):(ze=null,Xe=he),ze!==Xe)){if(Ze=Lp,Ie="onMouseLeave",se="onMouseEnter",Z="mouse",(o==="pointerout"||o==="pointerover")&&(Ze=Pp,Ie="onPointerLeave",se="onPointerEnter",Z="pointer"),hn=ze==null?we:Aa(ze),ce=Xe==null?we:Aa(Xe),we=new Ze(Ie,Z+"leave",ze,c,Se),we.target=hn,we.relatedTarget=ce,Ie=null,Ao(Se)===he&&(Ze=new Ze(se,Z+"enter",Xe,c,Se),Ze.target=ce,Ze.relatedTarget=hn,Ie=Ze),hn=Ie,ze&&Xe)t:{for(Ze=ze,se=Xe,Z=0,ce=Ze;ce;ce=Da(ce))Z++;for(ce=0,Ie=se;Ie;Ie=Da(Ie))ce++;for(;0<Z-ce;)Ze=Da(Ze),Z--;for(;0<ce-Z;)se=Da(se),ce--;for(;Z--;){if(Ze===se||se!==null&&Ze===se.alternate)break t;Ze=Da(Ze),se=Da(se)}Ze=null}else Ze=null;ze!==null&&uy(Ce,we,ze,Ze,!1),Xe!==null&&hn!==null&&uy(Ce,hn,Xe,Ze,!0)}}e:{if(we=he?Aa(he):window,ze=we.nodeName&&we.nodeName.toLowerCase(),ze==="select"||ze==="input"&&we.type==="file")var et=rw;else if(zp(we))if(Yp)et=iw;else{et=ow;var it=sw}else(ze=we.nodeName)&&ze.toLowerCase()==="input"&&(we.type==="checkbox"||we.type==="radio")&&(et=aw);if(et&&(et=et(o,he))){Wp(Ce,et,c,Se);break e}it&&it(o,we,he),o==="focusout"&&(it=we._wrapperState)&&it.controlled&&we.type==="number"&&pe(we,"number",we.value)}switch(it=he?Aa(he):window,o){case"focusin":(zp(it)||it.contentEditable==="true")&&(Na=it,vf=he,Gi=null);break;case"focusout":Gi=vf=Na=null;break;case"mousedown":Ef=!0;break;case"contextmenu":case"mouseup":case"dragend":Ef=!1,Jp(Ce,c,Se);break;case"selectionchange":if(cw)break;case"keydown":case"keyup":Jp(Ce,c,Se)}var lt;if(yf)e:{switch(o){case"compositionstart":var ht="onCompositionStart";break e;case"compositionend":ht="onCompositionEnd";break e;case"compositionupdate":ht="onCompositionUpdate";break e}ht=void 0}else Ca?Hp(o,c)&&(ht="onCompositionEnd"):o==="keydown"&&c.keyCode===229&&(ht="onCompositionStart");ht&&(jp&&c.locale!=="ko"&&(Ca||ht!=="onCompositionStart"?ht==="onCompositionEnd"&&Ca&&(lt=Ip()):(zs=Se,cf="value"in zs?zs.value:zs.textContent,Ca=!0)),it=ju(he,ht),0<it.length&&(ht=new Rp(ht,o,null,c,Se),Ce.push({event:ht,listeners:it}),lt?ht.data=lt:(lt=Up(c),lt!==null&&(ht.data=lt)))),(lt=JT?ZT(o,c):ew(o,c))&&(he=ju(he,"onBeforeInput"),0<he.length&&(Se=new Rp("onBeforeInput","beforeinput",null,c,Se),Ce.push({event:Se,listeners:he}),Se.data=lt))}iy(Ce,a)})}function Ji(o,a,c){return{instance:o,listener:a,currentTarget:c}}function ju(o,a){for(var c=a+"Capture",m=[];o!==null;){var v=o,k=v.stateNode;v.tag===5&&k!==null&&(v=k,k=ln(o,c),k!=null&&m.unshift(Ji(o,k,v)),k=ln(o,a),k!=null&&m.push(Ji(o,k,v))),o=o.return}return m}function Da(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function uy(o,a,c,m,v){for(var k=a._reactName,L=[];c!==null&&c!==m;){var q=c,X=q.alternate,he=q.stateNode;if(X!==null&&X===m)break;q.tag===5&&he!==null&&(q=he,v?(X=ln(c,k),X!=null&&L.unshift(Ji(c,X,q))):v||(X=ln(c,k),X!=null&&L.push(Ji(c,X,q)))),c=c.return}L.length!==0&&o.push({event:a,listeners:L})}var mw=/\r\n?/g,pw=/\u0000|\uFFFD/g;function cy(o){return(typeof o=="string"?o:""+o).replace(mw,`
|
|
31
|
-
`).replace(pw,"")}function Fu(o,a,c){if(a=cy(a),cy(o)!==a&&c)throw Error(n(425))}function Bu(){}var Nf=null,_f=null;function Df(o,a){return o==="textarea"||o==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Of=typeof setTimeout=="function"?setTimeout:void 0,yw=typeof clearTimeout=="function"?clearTimeout:void 0,dy=typeof Promise=="function"?Promise:void 0,gw=typeof queueMicrotask=="function"?queueMicrotask:typeof dy<"u"?function(o){return dy.resolve(null).then(o).catch(xw)}:Of;function xw(o){setTimeout(function(){throw o})}function Af(o,a){var c=a,m=0;do{var v=c.nextSibling;if(o.removeChild(c),v&&v.nodeType===8)if(c=v.data,c==="/$"){if(m===0){o.removeChild(v),zi(a);return}m--}else c!=="$"&&c!=="$?"&&c!=="$!"||m++;c=v}while(c);zi(a)}function Ys(o){for(;o!=null;o=o.nextSibling){var a=o.nodeType;if(a===1||a===3)break;if(a===8){if(a=o.data,a==="$"||a==="$!"||a==="$?")break;if(a==="/$")return null}}return o}function fy(o){o=o.previousSibling;for(var a=0;o;){if(o.nodeType===8){var c=o.data;if(c==="$"||c==="$!"||c==="$?"){if(a===0)return o;a--}else c==="/$"&&a++}o=o.previousSibling}return null}var Oa=Math.random().toString(36).slice(2),Gr="__reactFiber$"+Oa,Zi="__reactProps$"+Oa,ms="__reactContainer$"+Oa,If="__reactEvents$"+Oa,bw="__reactListeners$"+Oa,vw="__reactHandles$"+Oa;function Ao(o){var a=o[Gr];if(a)return a;for(var c=o.parentNode;c;){if(a=c[ms]||c[Gr]){if(c=a.alternate,a.child!==null||c!==null&&c.child!==null)for(o=fy(o);o!==null;){if(c=o[Gr])return c;o=fy(o)}return a}o=c,c=o.parentNode}return null}function el(o){return o=o[Gr]||o[ms],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function Aa(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function Hu(o){return o[Zi]||null}var Mf=[],Ia=-1;function $s(o){return{current:o}}function Gt(o){0>Ia||(o.current=Mf[Ia],Mf[Ia]=null,Ia--)}function $t(o,a){Ia++,Mf[Ia]=o.current,o.current=a}var qs={},Mn=$s(qs),Qn=$s(!1),Io=qs;function Ma(o,a){var c=o.type.contextTypes;if(!c)return qs;var m=o.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===a)return m.__reactInternalMemoizedMaskedChildContext;var v={},k;for(k in c)v[k]=a[k];return m&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=a,o.__reactInternalMemoizedMaskedChildContext=v),v}function Gn(o){return o=o.childContextTypes,o!=null}function Uu(){Gt(Qn),Gt(Mn)}function hy(o,a,c){if(Mn.current!==qs)throw Error(n(168));$t(Mn,a),$t(Qn,c)}function my(o,a,c){var m=o.stateNode;if(a=a.childContextTypes,typeof m.getChildContext!="function")return c;m=m.getChildContext();for(var v in m)if(!(v in a))throw Error(n(108,be(o)||"Unknown",v));return P({},c,m)}function zu(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||qs,Io=Mn.current,$t(Mn,o),$t(Qn,Qn.current),!0}function py(o,a,c){var m=o.stateNode;if(!m)throw Error(n(169));c?(o=my(o,a,Io),m.__reactInternalMemoizedMergedChildContext=o,Gt(Qn),Gt(Mn),$t(Mn,o)):Gt(Qn),$t(Qn,c)}var ps=null,Wu=!1,Lf=!1;function yy(o){ps===null?ps=[o]:ps.push(o)}function Ew(o){Wu=!0,yy(o)}function Vs(){if(!Lf&&ps!==null){Lf=!0;var o=0,a=Ft;try{var c=ps;for(Ft=1;o<c.length;o++){var m=c[o];do m=m(!0);while(m!==null)}ps=null,Wu=!1}catch(v){throw ps!==null&&(ps=ps.slice(o+1)),Do(Oo,Vs),v}finally{Ft=a,Lf=!1}}return null}var La=[],Ra=0,Yu=null,$u=0,xr=[],br=0,Mo=null,ys=1,gs="";function Lo(o,a){La[Ra++]=$u,La[Ra++]=Yu,Yu=o,$u=a}function gy(o,a,c){xr[br++]=ys,xr[br++]=gs,xr[br++]=Mo,Mo=o;var m=ys;o=gs;var v=32-Ir(m)-1;m&=~(1<<v),c+=1;var k=32-Ir(a)+v;if(30<k){var L=v-v%5;k=(m&(1<<L)-1).toString(32),m>>=L,v-=L,ys=1<<32-Ir(a)+v|c<<v|m,gs=k+o}else ys=1<<k|c<<v|m,gs=o}function Rf(o){o.return!==null&&(Lo(o,1),gy(o,1,0))}function Pf(o){for(;o===Yu;)Yu=La[--Ra],La[Ra]=null,$u=La[--Ra],La[Ra]=null;for(;o===Mo;)Mo=xr[--br],xr[br]=null,gs=xr[--br],xr[br]=null,ys=xr[--br],xr[br]=null}var lr=null,ur=null,Jt=!1,Lr=null;function xy(o,a){var c=wr(5,null,null,0);c.elementType="DELETED",c.stateNode=a,c.return=o,a=o.deletions,a===null?(o.deletions=[c],o.flags|=16):a.push(c)}function by(o,a){switch(o.tag){case 5:var c=o.type;return a=a.nodeType!==1||c.toLowerCase()!==a.nodeName.toLowerCase()?null:a,a!==null?(o.stateNode=a,lr=o,ur=Ys(a.firstChild),!0):!1;case 6:return a=o.pendingProps===""||a.nodeType!==3?null:a,a!==null?(o.stateNode=a,lr=o,ur=null,!0):!1;case 13:return a=a.nodeType!==8?null:a,a!==null?(c=Mo!==null?{id:ys,overflow:gs}:null,o.memoizedState={dehydrated:a,treeContext:c,retryLane:1073741824},c=wr(18,null,null,0),c.stateNode=a,c.return=o,o.child=c,lr=o,ur=null,!0):!1;default:return!1}}function jf(o){return(o.mode&1)!==0&&(o.flags&128)===0}function Ff(o){if(Jt){var a=ur;if(a){var c=a;if(!by(o,a)){if(jf(o))throw Error(n(418));a=Ys(c.nextSibling);var m=lr;a&&by(o,a)?xy(m,c):(o.flags=o.flags&-4097|2,Jt=!1,lr=o)}}else{if(jf(o))throw Error(n(418));o.flags=o.flags&-4097|2,Jt=!1,lr=o}}}function vy(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;lr=o}function qu(o){if(o!==lr)return!1;if(!Jt)return vy(o),Jt=!0,!1;var a;if((a=o.tag!==3)&&!(a=o.tag!==5)&&(a=o.type,a=a!=="head"&&a!=="body"&&!Df(o.type,o.memoizedProps)),a&&(a=ur)){if(jf(o))throw Ey(),Error(n(418));for(;a;)xy(o,a),a=Ys(a.nextSibling)}if(vy(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));e:{for(o=o.nextSibling,a=0;o;){if(o.nodeType===8){var c=o.data;if(c==="/$"){if(a===0){ur=Ys(o.nextSibling);break e}a--}else c!=="$"&&c!=="$!"&&c!=="$?"||a++}o=o.nextSibling}ur=null}}else ur=lr?Ys(o.stateNode.nextSibling):null;return!0}function Ey(){for(var o=ur;o;)o=Ys(o.nextSibling)}function Pa(){ur=lr=null,Jt=!1}function Bf(o){Lr===null?Lr=[o]:Lr.push(o)}var Tw=A.ReactCurrentBatchConfig;function tl(o,a,c){if(o=c.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(c._owner){if(c=c._owner,c){if(c.tag!==1)throw Error(n(309));var m=c.stateNode}if(!m)throw Error(n(147,o));var v=m,k=""+o;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===k?a.ref:(a=function(L){var q=v.refs;L===null?delete q[k]:q[k]=L},a._stringRef=k,a)}if(typeof o!="string")throw Error(n(284));if(!c._owner)throw Error(n(290,o))}return o}function Vu(o,a){throw o=Object.prototype.toString.call(a),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":o))}function Ty(o){var a=o._init;return a(o._payload)}function wy(o){function a(se,Z){if(o){var ce=se.deletions;ce===null?(se.deletions=[Z],se.flags|=16):ce.push(Z)}}function c(se,Z){if(!o)return null;for(;Z!==null;)a(se,Z),Z=Z.sibling;return null}function m(se,Z){for(se=new Map;Z!==null;)Z.key!==null?se.set(Z.key,Z):se.set(Z.index,Z),Z=Z.sibling;return se}function v(se,Z){return se=to(se,Z),se.index=0,se.sibling=null,se}function k(se,Z,ce){return se.index=ce,o?(ce=se.alternate,ce!==null?(ce=ce.index,ce<Z?(se.flags|=2,Z):ce):(se.flags|=2,Z)):(se.flags|=1048576,Z)}function L(se){return o&&se.alternate===null&&(se.flags|=2),se}function q(se,Z,ce,Ie){return Z===null||Z.tag!==6?(Z=Oh(ce,se.mode,Ie),Z.return=se,Z):(Z=v(Z,ce),Z.return=se,Z)}function X(se,Z,ce,Ie){var et=ce.type;return et===I?Se(se,Z,ce.props.children,Ie,ce.key):Z!==null&&(Z.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===re&&Ty(et)===Z.type)?(Ie=v(Z,ce.props),Ie.ref=tl(se,Z,ce),Ie.return=se,Ie):(Ie=gc(ce.type,ce.key,ce.props,null,se.mode,Ie),Ie.ref=tl(se,Z,ce),Ie.return=se,Ie)}function he(se,Z,ce,Ie){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ce.containerInfo||Z.stateNode.implementation!==ce.implementation?(Z=Ah(ce,se.mode,Ie),Z.return=se,Z):(Z=v(Z,ce.children||[]),Z.return=se,Z)}function Se(se,Z,ce,Ie,et){return Z===null||Z.tag!==7?(Z=zo(ce,se.mode,Ie,et),Z.return=se,Z):(Z=v(Z,ce),Z.return=se,Z)}function Ce(se,Z,ce){if(typeof Z=="string"&&Z!==""||typeof Z=="number")return Z=Oh(""+Z,se.mode,ce),Z.return=se,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case M:return ce=gc(Z.type,Z.key,Z.props,null,se.mode,ce),ce.ref=tl(se,null,Z),ce.return=se,ce;case C:return Z=Ah(Z,se.mode,ce),Z.return=se,Z;case re:var Ie=Z._init;return Ce(se,Ie(Z._payload),ce)}if(me(Z)||fe(Z))return Z=zo(Z,se.mode,ce,null),Z.return=se,Z;Vu(se,Z)}return null}function we(se,Z,ce,Ie){var et=Z!==null?Z.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number")return et!==null?null:q(se,Z,""+ce,Ie);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case M:return ce.key===et?X(se,Z,ce,Ie):null;case C:return ce.key===et?he(se,Z,ce,Ie):null;case re:return et=ce._init,we(se,Z,et(ce._payload),Ie)}if(me(ce)||fe(ce))return et!==null?null:Se(se,Z,ce,Ie,null);Vu(se,ce)}return null}function ze(se,Z,ce,Ie,et){if(typeof Ie=="string"&&Ie!==""||typeof Ie=="number")return se=se.get(ce)||null,q(Z,se,""+Ie,et);if(typeof Ie=="object"&&Ie!==null){switch(Ie.$$typeof){case M:return se=se.get(Ie.key===null?ce:Ie.key)||null,X(Z,se,Ie,et);case C:return se=se.get(Ie.key===null?ce:Ie.key)||null,he(Z,se,Ie,et);case re:var it=Ie._init;return ze(se,Z,ce,it(Ie._payload),et)}if(me(Ie)||fe(Ie))return se=se.get(ce)||null,Se(Z,se,Ie,et,null);Vu(Z,Ie)}return null}function Xe(se,Z,ce,Ie){for(var et=null,it=null,lt=Z,ht=Z=0,Sn=null;lt!==null&&ht<ce.length;ht++){lt.index>ht?(Sn=lt,lt=null):Sn=lt.sibling;var At=we(se,lt,ce[ht],Ie);if(At===null){lt===null&&(lt=Sn);break}o&<&&At.alternate===null&&a(se,lt),Z=k(At,Z,ht),it===null?et=At:it.sibling=At,it=At,lt=Sn}if(ht===ce.length)return c(se,lt),Jt&&Lo(se,ht),et;if(lt===null){for(;ht<ce.length;ht++)lt=Ce(se,ce[ht],Ie),lt!==null&&(Z=k(lt,Z,ht),it===null?et=lt:it.sibling=lt,it=lt);return Jt&&Lo(se,ht),et}for(lt=m(se,lt);ht<ce.length;ht++)Sn=ze(lt,se,ht,ce[ht],Ie),Sn!==null&&(o&&Sn.alternate!==null&<.delete(Sn.key===null?ht:Sn.key),Z=k(Sn,Z,ht),it===null?et=Sn:it.sibling=Sn,it=Sn);return o&<.forEach(function(no){return a(se,no)}),Jt&&Lo(se,ht),et}function Ze(se,Z,ce,Ie){var et=fe(ce);if(typeof et!="function")throw Error(n(150));if(ce=et.call(ce),ce==null)throw Error(n(151));for(var it=et=null,lt=Z,ht=Z=0,Sn=null,At=ce.next();lt!==null&&!At.done;ht++,At=ce.next()){lt.index>ht?(Sn=lt,lt=null):Sn=lt.sibling;var no=we(se,lt,At.value,Ie);if(no===null){lt===null&&(lt=Sn);break}o&<&&no.alternate===null&&a(se,lt),Z=k(no,Z,ht),it===null?et=no:it.sibling=no,it=no,lt=Sn}if(At.done)return c(se,lt),Jt&&Lo(se,ht),et;if(lt===null){for(;!At.done;ht++,At=ce.next())At=Ce(se,At.value,Ie),At!==null&&(Z=k(At,Z,ht),it===null?et=At:it.sibling=At,it=At);return Jt&&Lo(se,ht),et}for(lt=m(se,lt);!At.done;ht++,At=ce.next())At=ze(lt,se,ht,At.value,Ie),At!==null&&(o&&At.alternate!==null&<.delete(At.key===null?ht:At.key),Z=k(At,Z,ht),it===null?et=At:it.sibling=At,it=At);return o&<.forEach(function(tk){return a(se,tk)}),Jt&&Lo(se,ht),et}function hn(se,Z,ce,Ie){if(typeof ce=="object"&&ce!==null&&ce.type===I&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case M:e:{for(var et=ce.key,it=Z;it!==null;){if(it.key===et){if(et=ce.type,et===I){if(it.tag===7){c(se,it.sibling),Z=v(it,ce.props.children),Z.return=se,se=Z;break e}}else if(it.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===re&&Ty(et)===it.type){c(se,it.sibling),Z=v(it,ce.props),Z.ref=tl(se,it,ce),Z.return=se,se=Z;break e}c(se,it);break}else a(se,it);it=it.sibling}ce.type===I?(Z=zo(ce.props.children,se.mode,Ie,ce.key),Z.return=se,se=Z):(Ie=gc(ce.type,ce.key,ce.props,null,se.mode,Ie),Ie.ref=tl(se,Z,ce),Ie.return=se,se=Ie)}return L(se);case C:e:{for(it=ce.key;Z!==null;){if(Z.key===it)if(Z.tag===4&&Z.stateNode.containerInfo===ce.containerInfo&&Z.stateNode.implementation===ce.implementation){c(se,Z.sibling),Z=v(Z,ce.children||[]),Z.return=se,se=Z;break e}else{c(se,Z);break}else a(se,Z);Z=Z.sibling}Z=Ah(ce,se.mode,Ie),Z.return=se,se=Z}return L(se);case re:return it=ce._init,hn(se,Z,it(ce._payload),Ie)}if(me(ce))return Xe(se,Z,ce,Ie);if(fe(ce))return Ze(se,Z,ce,Ie);Vu(se,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"?(ce=""+ce,Z!==null&&Z.tag===6?(c(se,Z.sibling),Z=v(Z,ce),Z.return=se,se=Z):(c(se,Z),Z=Oh(ce,se.mode,Ie),Z.return=se,se=Z),L(se)):c(se,Z)}return hn}var ja=wy(!0),ky=wy(!1),Qu=$s(null),Gu=null,Fa=null,Hf=null;function Uf(){Hf=Fa=Gu=null}function zf(o){var a=Qu.current;Gt(Qu),o._currentValue=a}function Wf(o,a,c){for(;o!==null;){var m=o.alternate;if((o.childLanes&a)!==a?(o.childLanes|=a,m!==null&&(m.childLanes|=a)):m!==null&&(m.childLanes&a)!==a&&(m.childLanes|=a),o===c)break;o=o.return}}function Ba(o,a){Gu=o,Hf=Fa=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&a)!==0&&(Kn=!0),o.firstContext=null)}function vr(o){var a=o._currentValue;if(Hf!==o)if(o={context:o,memoizedValue:a,next:null},Fa===null){if(Gu===null)throw Error(n(308));Fa=o,Gu.dependencies={lanes:0,firstContext:o}}else Fa=Fa.next=o;return a}var Ro=null;function Yf(o){Ro===null?Ro=[o]:Ro.push(o)}function Sy(o,a,c,m){var v=a.interleaved;return v===null?(c.next=c,Yf(a)):(c.next=v.next,v.next=c),a.interleaved=c,xs(o,m)}function xs(o,a){o.lanes|=a;var c=o.alternate;for(c!==null&&(c.lanes|=a),c=o,o=o.return;o!==null;)o.childLanes|=a,c=o.alternate,c!==null&&(c.childLanes|=a),c=o,o=o.return;return c.tag===3?c.stateNode:null}var Qs=!1;function $f(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Cy(o,a){o=o.updateQueue,a.updateQueue===o&&(a.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function bs(o,a){return{eventTime:o,lane:a,tag:0,payload:null,callback:null,next:null}}function Gs(o,a,c){var m=o.updateQueue;if(m===null)return null;if(m=m.shared,(_t&2)!==0){var v=m.pending;return v===null?a.next=a:(a.next=v.next,v.next=a),m.pending=a,xs(o,c)}return v=m.interleaved,v===null?(a.next=a,Yf(m)):(a.next=v.next,v.next=a),m.interleaved=a,xs(o,c)}function Ku(o,a,c){if(a=a.updateQueue,a!==null&&(a=a.shared,(c&4194240)!==0)){var m=a.lanes;m&=o.pendingLanes,c|=m,a.lanes=c,sf(o,c)}}function Ny(o,a){var c=o.updateQueue,m=o.alternate;if(m!==null&&(m=m.updateQueue,c===m)){var v=null,k=null;if(c=c.firstBaseUpdate,c!==null){do{var L={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};k===null?v=k=L:k=k.next=L,c=c.next}while(c!==null);k===null?v=k=a:k=k.next=a}else v=k=a;c={baseState:m.baseState,firstBaseUpdate:v,lastBaseUpdate:k,shared:m.shared,effects:m.effects},o.updateQueue=c;return}o=c.lastBaseUpdate,o===null?c.firstBaseUpdate=a:o.next=a,c.lastBaseUpdate=a}function Xu(o,a,c,m){var v=o.updateQueue;Qs=!1;var k=v.firstBaseUpdate,L=v.lastBaseUpdate,q=v.shared.pending;if(q!==null){v.shared.pending=null;var X=q,he=X.next;X.next=null,L===null?k=he:L.next=he,L=X;var Se=o.alternate;Se!==null&&(Se=Se.updateQueue,q=Se.lastBaseUpdate,q!==L&&(q===null?Se.firstBaseUpdate=he:q.next=he,Se.lastBaseUpdate=X))}if(k!==null){var Ce=v.baseState;L=0,Se=he=X=null,q=k;do{var we=q.lane,ze=q.eventTime;if((m&we)===we){Se!==null&&(Se=Se.next={eventTime:ze,lane:0,tag:q.tag,payload:q.payload,callback:q.callback,next:null});e:{var Xe=o,Ze=q;switch(we=a,ze=c,Ze.tag){case 1:if(Xe=Ze.payload,typeof Xe=="function"){Ce=Xe.call(ze,Ce,we);break e}Ce=Xe;break e;case 3:Xe.flags=Xe.flags&-65537|128;case 0:if(Xe=Ze.payload,we=typeof Xe=="function"?Xe.call(ze,Ce,we):Xe,we==null)break e;Ce=P({},Ce,we);break e;case 2:Qs=!0}}q.callback!==null&&q.lane!==0&&(o.flags|=64,we=v.effects,we===null?v.effects=[q]:we.push(q))}else ze={eventTime:ze,lane:we,tag:q.tag,payload:q.payload,callback:q.callback,next:null},Se===null?(he=Se=ze,X=Ce):Se=Se.next=ze,L|=we;if(q=q.next,q===null){if(q=v.shared.pending,q===null)break;we=q,q=we.next,we.next=null,v.lastBaseUpdate=we,v.shared.pending=null}}while(!0);if(Se===null&&(X=Ce),v.baseState=X,v.firstBaseUpdate=he,v.lastBaseUpdate=Se,a=v.shared.interleaved,a!==null){v=a;do L|=v.lane,v=v.next;while(v!==a)}else k===null&&(v.shared.lanes=0);Fo|=L,o.lanes=L,o.memoizedState=Ce}}function _y(o,a,c){if(o=a.effects,a.effects=null,o!==null)for(a=0;a<o.length;a++){var m=o[a],v=m.callback;if(v!==null){if(m.callback=null,m=c,typeof v!="function")throw Error(n(191,v));v.call(m)}}}var nl={},Kr=$s(nl),rl=$s(nl),sl=$s(nl);function Po(o){if(o===nl)throw Error(n(174));return o}function qf(o,a){switch($t(sl,a),$t(rl,o),$t(Kr,nl),o=a.nodeType,o){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:ne(null,"");break;default:o=o===8?a.parentNode:a,a=o.namespaceURI||null,o=o.tagName,a=ne(a,o)}Gt(Kr),$t(Kr,a)}function Ha(){Gt(Kr),Gt(rl),Gt(sl)}function Dy(o){Po(sl.current);var a=Po(Kr.current),c=ne(a,o.type);a!==c&&($t(rl,o),$t(Kr,c))}function Vf(o){rl.current===o&&(Gt(Kr),Gt(rl))}var en=$s(0);function Ju(o){for(var a=o;a!==null;){if(a.tag===13){var c=a.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||c.data==="$?"||c.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Qf=[];function Gf(){for(var o=0;o<Qf.length;o++)Qf[o]._workInProgressVersionPrimary=null;Qf.length=0}var Zu=A.ReactCurrentDispatcher,Kf=A.ReactCurrentBatchConfig,jo=0,tn=null,En=null,wn=null,ec=!1,ol=!1,al=0,ww=0;function Ln(){throw Error(n(321))}function Xf(o,a){if(a===null)return!1;for(var c=0;c<a.length&&c<o.length;c++)if(!Mr(o[c],a[c]))return!1;return!0}function Jf(o,a,c,m,v,k){if(jo=k,tn=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Zu.current=o===null||o.memoizedState===null?Nw:_w,o=c(m,v),ol){k=0;do{if(ol=!1,al=0,25<=k)throw Error(n(301));k+=1,wn=En=null,a.updateQueue=null,Zu.current=Dw,o=c(m,v)}while(ol)}if(Zu.current=rc,a=En!==null&&En.next!==null,jo=0,wn=En=tn=null,ec=!1,a)throw Error(n(300));return o}function Zf(){var o=al!==0;return al=0,o}function Xr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wn===null?tn.memoizedState=wn=o:wn=wn.next=o,wn}function Er(){if(En===null){var o=tn.alternate;o=o!==null?o.memoizedState:null}else o=En.next;var a=wn===null?tn.memoizedState:wn.next;if(a!==null)wn=a,En=o;else{if(o===null)throw Error(n(310));En=o,o={memoizedState:En.memoizedState,baseState:En.baseState,baseQueue:En.baseQueue,queue:En.queue,next:null},wn===null?tn.memoizedState=wn=o:wn=wn.next=o}return wn}function il(o,a){return typeof a=="function"?a(o):a}function eh(o){var a=Er(),c=a.queue;if(c===null)throw Error(n(311));c.lastRenderedReducer=o;var m=En,v=m.baseQueue,k=c.pending;if(k!==null){if(v!==null){var L=v.next;v.next=k.next,k.next=L}m.baseQueue=v=k,c.pending=null}if(v!==null){k=v.next,m=m.baseState;var q=L=null,X=null,he=k;do{var Se=he.lane;if((jo&Se)===Se)X!==null&&(X=X.next={lane:0,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null}),m=he.hasEagerState?he.eagerState:o(m,he.action);else{var Ce={lane:Se,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null};X===null?(q=X=Ce,L=m):X=X.next=Ce,tn.lanes|=Se,Fo|=Se}he=he.next}while(he!==null&&he!==k);X===null?L=m:X.next=q,Mr(m,a.memoizedState)||(Kn=!0),a.memoizedState=m,a.baseState=L,a.baseQueue=X,c.lastRenderedState=m}if(o=c.interleaved,o!==null){v=o;do k=v.lane,tn.lanes|=k,Fo|=k,v=v.next;while(v!==o)}else v===null&&(c.lanes=0);return[a.memoizedState,c.dispatch]}function th(o){var a=Er(),c=a.queue;if(c===null)throw Error(n(311));c.lastRenderedReducer=o;var m=c.dispatch,v=c.pending,k=a.memoizedState;if(v!==null){c.pending=null;var L=v=v.next;do k=o(k,L.action),L=L.next;while(L!==v);Mr(k,a.memoizedState)||(Kn=!0),a.memoizedState=k,a.baseQueue===null&&(a.baseState=k),c.lastRenderedState=k}return[k,m]}function Oy(){}function Ay(o,a){var c=tn,m=Er(),v=a(),k=!Mr(m.memoizedState,v);if(k&&(m.memoizedState=v,Kn=!0),m=m.queue,nh(Ly.bind(null,c,m,o),[o]),m.getSnapshot!==a||k||wn!==null&&wn.memoizedState.tag&1){if(c.flags|=2048,ll(9,My.bind(null,c,m,v,a),void 0,null),kn===null)throw Error(n(349));(jo&30)!==0||Iy(c,a,v)}return v}function Iy(o,a,c){o.flags|=16384,o={getSnapshot:a,value:c},a=tn.updateQueue,a===null?(a={lastEffect:null,stores:null},tn.updateQueue=a,a.stores=[o]):(c=a.stores,c===null?a.stores=[o]:c.push(o))}function My(o,a,c,m){a.value=c,a.getSnapshot=m,Ry(a)&&Py(o)}function Ly(o,a,c){return c(function(){Ry(a)&&Py(o)})}function Ry(o){var a=o.getSnapshot;o=o.value;try{var c=a();return!Mr(o,c)}catch{return!0}}function Py(o){var a=xs(o,1);a!==null&&Fr(a,o,1,-1)}function jy(o){var a=Xr();return typeof o=="function"&&(o=o()),a.memoizedState=a.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:il,lastRenderedState:o},a.queue=o,o=o.dispatch=Cw.bind(null,tn,o),[a.memoizedState,o]}function ll(o,a,c,m){return o={tag:o,create:a,destroy:c,deps:m,next:null},a=tn.updateQueue,a===null?(a={lastEffect:null,stores:null},tn.updateQueue=a,a.lastEffect=o.next=o):(c=a.lastEffect,c===null?a.lastEffect=o.next=o:(m=c.next,c.next=o,o.next=m,a.lastEffect=o)),o}function Fy(){return Er().memoizedState}function tc(o,a,c,m){var v=Xr();tn.flags|=o,v.memoizedState=ll(1|a,c,void 0,m===void 0?null:m)}function nc(o,a,c,m){var v=Er();m=m===void 0?null:m;var k=void 0;if(En!==null){var L=En.memoizedState;if(k=L.destroy,m!==null&&Xf(m,L.deps)){v.memoizedState=ll(a,c,k,m);return}}tn.flags|=o,v.memoizedState=ll(1|a,c,k,m)}function By(o,a){return tc(8390656,8,o,a)}function nh(o,a){return nc(2048,8,o,a)}function Hy(o,a){return nc(4,2,o,a)}function Uy(o,a){return nc(4,4,o,a)}function zy(o,a){if(typeof a=="function")return o=o(),a(o),function(){a(null)};if(a!=null)return o=o(),a.current=o,function(){a.current=null}}function Wy(o,a,c){return c=c!=null?c.concat([o]):null,nc(4,4,zy.bind(null,a,o),c)}function rh(){}function Yy(o,a){var c=Er();a=a===void 0?null:a;var m=c.memoizedState;return m!==null&&a!==null&&Xf(a,m[1])?m[0]:(c.memoizedState=[o,a],o)}function $y(o,a){var c=Er();a=a===void 0?null:a;var m=c.memoizedState;return m!==null&&a!==null&&Xf(a,m[1])?m[0]:(o=o(),c.memoizedState=[o,a],o)}function qy(o,a,c){return(jo&21)===0?(o.baseState&&(o.baseState=!1,Kn=!0),o.memoizedState=c):(Mr(c,a)||(c=Tp(),tn.lanes|=c,Fo|=c,o.baseState=!0),a)}function kw(o,a){var c=Ft;Ft=c!==0&&4>c?c:4,o(!0);var m=Kf.transition;Kf.transition={};try{o(!1),a()}finally{Ft=c,Kf.transition=m}}function Vy(){return Er().memoizedState}function Sw(o,a,c){var m=Zs(o);if(c={lane:m,action:c,hasEagerState:!1,eagerState:null,next:null},Qy(o))Gy(a,c);else if(c=Sy(o,a,c,m),c!==null){var v=Wn();Fr(c,o,m,v),Ky(c,a,m)}}function Cw(o,a,c){var m=Zs(o),v={lane:m,action:c,hasEagerState:!1,eagerState:null,next:null};if(Qy(o))Gy(a,v);else{var k=o.alternate;if(o.lanes===0&&(k===null||k.lanes===0)&&(k=a.lastRenderedReducer,k!==null))try{var L=a.lastRenderedState,q=k(L,c);if(v.hasEagerState=!0,v.eagerState=q,Mr(q,L)){var X=a.interleaved;X===null?(v.next=v,Yf(a)):(v.next=X.next,X.next=v),a.interleaved=v;return}}catch{}finally{}c=Sy(o,a,v,m),c!==null&&(v=Wn(),Fr(c,o,m,v),Ky(c,a,m))}}function Qy(o){var a=o.alternate;return o===tn||a!==null&&a===tn}function Gy(o,a){ol=ec=!0;var c=o.pending;c===null?a.next=a:(a.next=c.next,c.next=a),o.pending=a}function Ky(o,a,c){if((c&4194240)!==0){var m=a.lanes;m&=o.pendingLanes,c|=m,a.lanes=c,sf(o,c)}}var rc={readContext:vr,useCallback:Ln,useContext:Ln,useEffect:Ln,useImperativeHandle:Ln,useInsertionEffect:Ln,useLayoutEffect:Ln,useMemo:Ln,useReducer:Ln,useRef:Ln,useState:Ln,useDebugValue:Ln,useDeferredValue:Ln,useTransition:Ln,useMutableSource:Ln,useSyncExternalStore:Ln,useId:Ln,unstable_isNewReconciler:!1},Nw={readContext:vr,useCallback:function(o,a){return Xr().memoizedState=[o,a===void 0?null:a],o},useContext:vr,useEffect:By,useImperativeHandle:function(o,a,c){return c=c!=null?c.concat([o]):null,tc(4194308,4,zy.bind(null,a,o),c)},useLayoutEffect:function(o,a){return tc(4194308,4,o,a)},useInsertionEffect:function(o,a){return tc(4,2,o,a)},useMemo:function(o,a){var c=Xr();return a=a===void 0?null:a,o=o(),c.memoizedState=[o,a],o},useReducer:function(o,a,c){var m=Xr();return a=c!==void 0?c(a):a,m.memoizedState=m.baseState=a,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:a},m.queue=o,o=o.dispatch=Sw.bind(null,tn,o),[m.memoizedState,o]},useRef:function(o){var a=Xr();return o={current:o},a.memoizedState=o},useState:jy,useDebugValue:rh,useDeferredValue:function(o){return Xr().memoizedState=o},useTransition:function(){var o=jy(!1),a=o[0];return o=kw.bind(null,o[1]),Xr().memoizedState=o,[a,o]},useMutableSource:function(){},useSyncExternalStore:function(o,a,c){var m=tn,v=Xr();if(Jt){if(c===void 0)throw Error(n(407));c=c()}else{if(c=a(),kn===null)throw Error(n(349));(jo&30)!==0||Iy(m,a,c)}v.memoizedState=c;var k={value:c,getSnapshot:a};return v.queue=k,By(Ly.bind(null,m,k,o),[o]),m.flags|=2048,ll(9,My.bind(null,m,k,c,a),void 0,null),c},useId:function(){var o=Xr(),a=kn.identifierPrefix;if(Jt){var c=gs,m=ys;c=(m&~(1<<32-Ir(m)-1)).toString(32)+c,a=":"+a+"R"+c,c=al++,0<c&&(a+="H"+c.toString(32)),a+=":"}else c=ww++,a=":"+a+"r"+c.toString(32)+":";return o.memoizedState=a},unstable_isNewReconciler:!1},_w={readContext:vr,useCallback:Yy,useContext:vr,useEffect:nh,useImperativeHandle:Wy,useInsertionEffect:Hy,useLayoutEffect:Uy,useMemo:$y,useReducer:eh,useRef:Fy,useState:function(){return eh(il)},useDebugValue:rh,useDeferredValue:function(o){var a=Er();return qy(a,En.memoizedState,o)},useTransition:function(){var o=eh(il)[0],a=Er().memoizedState;return[o,a]},useMutableSource:Oy,useSyncExternalStore:Ay,useId:Vy,unstable_isNewReconciler:!1},Dw={readContext:vr,useCallback:Yy,useContext:vr,useEffect:nh,useImperativeHandle:Wy,useInsertionEffect:Hy,useLayoutEffect:Uy,useMemo:$y,useReducer:th,useRef:Fy,useState:function(){return th(il)},useDebugValue:rh,useDeferredValue:function(o){var a=Er();return En===null?a.memoizedState=o:qy(a,En.memoizedState,o)},useTransition:function(){var o=th(il)[0],a=Er().memoizedState;return[o,a]},useMutableSource:Oy,useSyncExternalStore:Ay,useId:Vy,unstable_isNewReconciler:!1};function Rr(o,a){if(o&&o.defaultProps){a=P({},a),o=o.defaultProps;for(var c in o)a[c]===void 0&&(a[c]=o[c]);return a}return a}function sh(o,a,c,m){a=o.memoizedState,c=c(m,a),c=c==null?a:P({},a,c),o.memoizedState=c,o.lanes===0&&(o.updateQueue.baseState=c)}var sc={isMounted:function(o){return(o=o._reactInternals)?zt(o)===o:!1},enqueueSetState:function(o,a,c){o=o._reactInternals;var m=Wn(),v=Zs(o),k=bs(m,v);k.payload=a,c!=null&&(k.callback=c),a=Gs(o,k,v),a!==null&&(Fr(a,o,v,m),Ku(a,o,v))},enqueueReplaceState:function(o,a,c){o=o._reactInternals;var m=Wn(),v=Zs(o),k=bs(m,v);k.tag=1,k.payload=a,c!=null&&(k.callback=c),a=Gs(o,k,v),a!==null&&(Fr(a,o,v,m),Ku(a,o,v))},enqueueForceUpdate:function(o,a){o=o._reactInternals;var c=Wn(),m=Zs(o),v=bs(c,m);v.tag=2,a!=null&&(v.callback=a),a=Gs(o,v,m),a!==null&&(Fr(a,o,m,c),Ku(a,o,m))}};function Xy(o,a,c,m,v,k,L){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(m,k,L):a.prototype&&a.prototype.isPureReactComponent?!Qi(c,m)||!Qi(v,k):!0}function Jy(o,a,c){var m=!1,v=qs,k=a.contextType;return typeof k=="object"&&k!==null?k=vr(k):(v=Gn(a)?Io:Mn.current,m=a.contextTypes,k=(m=m!=null)?Ma(o,v):qs),a=new a(c,k),o.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=sc,o.stateNode=a,a._reactInternals=o,m&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=v,o.__reactInternalMemoizedMaskedChildContext=k),a}function Zy(o,a,c,m){o=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(c,m),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(c,m),a.state!==o&&sc.enqueueReplaceState(a,a.state,null)}function oh(o,a,c,m){var v=o.stateNode;v.props=c,v.state=o.memoizedState,v.refs={},$f(o);var k=a.contextType;typeof k=="object"&&k!==null?v.context=vr(k):(k=Gn(a)?Io:Mn.current,v.context=Ma(o,k)),v.state=o.memoizedState,k=a.getDerivedStateFromProps,typeof k=="function"&&(sh(o,a,k,c),v.state=o.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(a=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),a!==v.state&&sc.enqueueReplaceState(v,v.state,null),Xu(o,c,v,m),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308)}function Ua(o,a){try{var c="",m=a;do c+=ae(m),m=m.return;while(m);var v=c}catch(k){v=`
|
|
32
|
-
Error generating stack: `+k.message+`
|
|
33
|
-
`+k.stack}return{value:o,source:a,stack:v,digest:null}}function ah(o,a,c){return{value:o,source:null,stack:c??null,digest:a??null}}function ih(o,a){try{console.error(a.value)}catch(c){setTimeout(function(){throw c})}}var Ow=typeof WeakMap=="function"?WeakMap:Map;function eg(o,a,c){c=bs(-1,c),c.tag=3,c.payload={element:null};var m=a.value;return c.callback=function(){dc||(dc=!0,Th=m),ih(o,a)},c}function tg(o,a,c){c=bs(-1,c),c.tag=3;var m=o.type.getDerivedStateFromError;if(typeof m=="function"){var v=a.value;c.payload=function(){return m(v)},c.callback=function(){ih(o,a)}}var k=o.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(c.callback=function(){ih(o,a),typeof m!="function"&&(Xs===null?Xs=new Set([this]):Xs.add(this));var L=a.stack;this.componentDidCatch(a.value,{componentStack:L!==null?L:""})}),c}function ng(o,a,c){var m=o.pingCache;if(m===null){m=o.pingCache=new Ow;var v=new Set;m.set(a,v)}else v=m.get(a),v===void 0&&(v=new Set,m.set(a,v));v.has(c)||(v.add(c),o=Yw.bind(null,o,a,c),a.then(o,o))}function rg(o){do{var a;if((a=o.tag===13)&&(a=o.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return o;o=o.return}while(o!==null);return null}function sg(o,a,c,m,v){return(o.mode&1)===0?(o===a?o.flags|=65536:(o.flags|=128,c.flags|=131072,c.flags&=-52805,c.tag===1&&(c.alternate===null?c.tag=17:(a=bs(-1,1),a.tag=2,Gs(c,a,1))),c.lanes|=1),o):(o.flags|=65536,o.lanes=v,o)}var Aw=A.ReactCurrentOwner,Kn=!1;function zn(o,a,c,m){a.child=o===null?ky(a,null,c,m):ja(a,o.child,c,m)}function og(o,a,c,m,v){c=c.render;var k=a.ref;return Ba(a,v),m=Jf(o,a,c,m,k,v),c=Zf(),o!==null&&!Kn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~v,vs(o,a,v)):(Jt&&c&&Rf(a),a.flags|=1,zn(o,a,m,v),a.child)}function ag(o,a,c,m,v){if(o===null){var k=c.type;return typeof k=="function"&&!Dh(k)&&k.defaultProps===void 0&&c.compare===null&&c.defaultProps===void 0?(a.tag=15,a.type=k,ig(o,a,k,m,v)):(o=gc(c.type,null,m,a,a.mode,v),o.ref=a.ref,o.return=a,a.child=o)}if(k=o.child,(o.lanes&v)===0){var L=k.memoizedProps;if(c=c.compare,c=c!==null?c:Qi,c(L,m)&&o.ref===a.ref)return vs(o,a,v)}return a.flags|=1,o=to(k,m),o.ref=a.ref,o.return=a,a.child=o}function ig(o,a,c,m,v){if(o!==null){var k=o.memoizedProps;if(Qi(k,m)&&o.ref===a.ref)if(Kn=!1,a.pendingProps=m=k,(o.lanes&v)!==0)(o.flags&131072)!==0&&(Kn=!0);else return a.lanes=o.lanes,vs(o,a,v)}return lh(o,a,c,m,v)}function lg(o,a,c){var m=a.pendingProps,v=m.children,k=o!==null?o.memoizedState:null;if(m.mode==="hidden")if((a.mode&1)===0)a.memoizedState={baseLanes:0,cachePool:null,transitions:null},$t(Wa,cr),cr|=c;else{if((c&1073741824)===0)return o=k!==null?k.baseLanes|c:c,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:o,cachePool:null,transitions:null},a.updateQueue=null,$t(Wa,cr),cr|=o,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=k!==null?k.baseLanes:c,$t(Wa,cr),cr|=m}else k!==null?(m=k.baseLanes|c,a.memoizedState=null):m=c,$t(Wa,cr),cr|=m;return zn(o,a,v,c),a.child}function ug(o,a){var c=a.ref;(o===null&&c!==null||o!==null&&o.ref!==c)&&(a.flags|=512,a.flags|=2097152)}function lh(o,a,c,m,v){var k=Gn(c)?Io:Mn.current;return k=Ma(a,k),Ba(a,v),c=Jf(o,a,c,m,k,v),m=Zf(),o!==null&&!Kn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~v,vs(o,a,v)):(Jt&&m&&Rf(a),a.flags|=1,zn(o,a,c,v),a.child)}function cg(o,a,c,m,v){if(Gn(c)){var k=!0;zu(a)}else k=!1;if(Ba(a,v),a.stateNode===null)ac(o,a),Jy(a,c,m),oh(a,c,m,v),m=!0;else if(o===null){var L=a.stateNode,q=a.memoizedProps;L.props=q;var X=L.context,he=c.contextType;typeof he=="object"&&he!==null?he=vr(he):(he=Gn(c)?Io:Mn.current,he=Ma(a,he));var Se=c.getDerivedStateFromProps,Ce=typeof Se=="function"||typeof L.getSnapshotBeforeUpdate=="function";Ce||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(q!==m||X!==he)&&Zy(a,L,m,he),Qs=!1;var we=a.memoizedState;L.state=we,Xu(a,m,L,v),X=a.memoizedState,q!==m||we!==X||Qn.current||Qs?(typeof Se=="function"&&(sh(a,c,Se,m),X=a.memoizedState),(q=Qs||Xy(a,c,q,m,we,X,he))?(Ce||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(a.flags|=4194308)):(typeof L.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=m,a.memoizedState=X),L.props=m,L.state=X,L.context=he,m=q):(typeof L.componentDidMount=="function"&&(a.flags|=4194308),m=!1)}else{L=a.stateNode,Cy(o,a),q=a.memoizedProps,he=a.type===a.elementType?q:Rr(a.type,q),L.props=he,Ce=a.pendingProps,we=L.context,X=c.contextType,typeof X=="object"&&X!==null?X=vr(X):(X=Gn(c)?Io:Mn.current,X=Ma(a,X));var ze=c.getDerivedStateFromProps;(Se=typeof ze=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(q!==Ce||we!==X)&&Zy(a,L,m,X),Qs=!1,we=a.memoizedState,L.state=we,Xu(a,m,L,v);var Xe=a.memoizedState;q!==Ce||we!==Xe||Qn.current||Qs?(typeof ze=="function"&&(sh(a,c,ze,m),Xe=a.memoizedState),(he=Qs||Xy(a,c,he,m,we,Xe,X)||!1)?(Se||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(m,Xe,X),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(m,Xe,X)),typeof L.componentDidUpdate=="function"&&(a.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof L.componentDidUpdate!="function"||q===o.memoizedProps&&we===o.memoizedState||(a.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||q===o.memoizedProps&&we===o.memoizedState||(a.flags|=1024),a.memoizedProps=m,a.memoizedState=Xe),L.props=m,L.state=Xe,L.context=X,m=he):(typeof L.componentDidUpdate!="function"||q===o.memoizedProps&&we===o.memoizedState||(a.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||q===o.memoizedProps&&we===o.memoizedState||(a.flags|=1024),m=!1)}return uh(o,a,c,m,k,v)}function uh(o,a,c,m,v,k){ug(o,a);var L=(a.flags&128)!==0;if(!m&&!L)return v&&py(a,c,!1),vs(o,a,k);m=a.stateNode,Aw.current=a;var q=L&&typeof c.getDerivedStateFromError!="function"?null:m.render();return a.flags|=1,o!==null&&L?(a.child=ja(a,o.child,null,k),a.child=ja(a,null,q,k)):zn(o,a,q,k),a.memoizedState=m.state,v&&py(a,c,!0),a.child}function dg(o){var a=o.stateNode;a.pendingContext?hy(o,a.pendingContext,a.pendingContext!==a.context):a.context&&hy(o,a.context,!1),qf(o,a.containerInfo)}function fg(o,a,c,m,v){return Pa(),Bf(v),a.flags|=256,zn(o,a,c,m),a.child}var ch={dehydrated:null,treeContext:null,retryLane:0};function dh(o){return{baseLanes:o,cachePool:null,transitions:null}}function hg(o,a,c){var m=a.pendingProps,v=en.current,k=!1,L=(a.flags&128)!==0,q;if((q=L)||(q=o!==null&&o.memoizedState===null?!1:(v&2)!==0),q?(k=!0,a.flags&=-129):(o===null||o.memoizedState!==null)&&(v|=1),$t(en,v&1),o===null)return Ff(a),o=a.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((a.mode&1)===0?a.lanes=1:o.data==="$!"?a.lanes=8:a.lanes=1073741824,null):(L=m.children,o=m.fallback,k?(m=a.mode,k=a.child,L={mode:"hidden",children:L},(m&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=L):k=xc(L,m,0,null),o=zo(o,m,c,null),k.return=a,o.return=a,k.sibling=o,a.child=k,a.child.memoizedState=dh(c),a.memoizedState=ch,o):fh(a,L));if(v=o.memoizedState,v!==null&&(q=v.dehydrated,q!==null))return Iw(o,a,L,m,q,v,c);if(k){k=m.fallback,L=a.mode,v=o.child,q=v.sibling;var X={mode:"hidden",children:m.children};return(L&1)===0&&a.child!==v?(m=a.child,m.childLanes=0,m.pendingProps=X,a.deletions=null):(m=to(v,X),m.subtreeFlags=v.subtreeFlags&14680064),q!==null?k=to(q,k):(k=zo(k,L,c,null),k.flags|=2),k.return=a,m.return=a,m.sibling=k,a.child=m,m=k,k=a.child,L=o.child.memoizedState,L=L===null?dh(c):{baseLanes:L.baseLanes|c,cachePool:null,transitions:L.transitions},k.memoizedState=L,k.childLanes=o.childLanes&~c,a.memoizedState=ch,m}return k=o.child,o=k.sibling,m=to(k,{mode:"visible",children:m.children}),(a.mode&1)===0&&(m.lanes=c),m.return=a,m.sibling=null,o!==null&&(c=a.deletions,c===null?(a.deletions=[o],a.flags|=16):c.push(o)),a.child=m,a.memoizedState=null,m}function fh(o,a){return a=xc({mode:"visible",children:a},o.mode,0,null),a.return=o,o.child=a}function oc(o,a,c,m){return m!==null&&Bf(m),ja(a,o.child,null,c),o=fh(a,a.pendingProps.children),o.flags|=2,a.memoizedState=null,o}function Iw(o,a,c,m,v,k,L){if(c)return a.flags&256?(a.flags&=-257,m=ah(Error(n(422))),oc(o,a,L,m)):a.memoizedState!==null?(a.child=o.child,a.flags|=128,null):(k=m.fallback,v=a.mode,m=xc({mode:"visible",children:m.children},v,0,null),k=zo(k,v,L,null),k.flags|=2,m.return=a,k.return=a,m.sibling=k,a.child=m,(a.mode&1)!==0&&ja(a,o.child,null,L),a.child.memoizedState=dh(L),a.memoizedState=ch,k);if((a.mode&1)===0)return oc(o,a,L,null);if(v.data==="$!"){if(m=v.nextSibling&&v.nextSibling.dataset,m)var q=m.dgst;return m=q,k=Error(n(419)),m=ah(k,m,void 0),oc(o,a,L,m)}if(q=(L&o.childLanes)!==0,Kn||q){if(m=kn,m!==null){switch(L&-L){case 4:v=2;break;case 16:v=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:v=32;break;case 536870912:v=268435456;break;default:v=0}v=(v&(m.suspendedLanes|L))!==0?0:v,v!==0&&v!==k.retryLane&&(k.retryLane=v,xs(o,v),Fr(m,o,v,-1))}return _h(),m=ah(Error(n(421))),oc(o,a,L,m)}return v.data==="$?"?(a.flags|=128,a.child=o.child,a=$w.bind(null,o),v._reactRetry=a,null):(o=k.treeContext,ur=Ys(v.nextSibling),lr=a,Jt=!0,Lr=null,o!==null&&(xr[br++]=ys,xr[br++]=gs,xr[br++]=Mo,ys=o.id,gs=o.overflow,Mo=a),a=fh(a,m.children),a.flags|=4096,a)}function mg(o,a,c){o.lanes|=a;var m=o.alternate;m!==null&&(m.lanes|=a),Wf(o.return,a,c)}function hh(o,a,c,m,v){var k=o.memoizedState;k===null?o.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:m,tail:c,tailMode:v}:(k.isBackwards=a,k.rendering=null,k.renderingStartTime=0,k.last=m,k.tail=c,k.tailMode=v)}function pg(o,a,c){var m=a.pendingProps,v=m.revealOrder,k=m.tail;if(zn(o,a,m.children,c),m=en.current,(m&2)!==0)m=m&1|2,a.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=a.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&mg(o,c,a);else if(o.tag===19)mg(o,c,a);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}m&=1}if($t(en,m),(a.mode&1)===0)a.memoizedState=null;else switch(v){case"forwards":for(c=a.child,v=null;c!==null;)o=c.alternate,o!==null&&Ju(o)===null&&(v=c),c=c.sibling;c=v,c===null?(v=a.child,a.child=null):(v=c.sibling,c.sibling=null),hh(a,!1,v,c,k);break;case"backwards":for(c=null,v=a.child,a.child=null;v!==null;){if(o=v.alternate,o!==null&&Ju(o)===null){a.child=v;break}o=v.sibling,v.sibling=c,c=v,v=o}hh(a,!0,c,null,k);break;case"together":hh(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function ac(o,a){(a.mode&1)===0&&o!==null&&(o.alternate=null,a.alternate=null,a.flags|=2)}function vs(o,a,c){if(o!==null&&(a.dependencies=o.dependencies),Fo|=a.lanes,(c&a.childLanes)===0)return null;if(o!==null&&a.child!==o.child)throw Error(n(153));if(a.child!==null){for(o=a.child,c=to(o,o.pendingProps),a.child=c,c.return=a;o.sibling!==null;)o=o.sibling,c=c.sibling=to(o,o.pendingProps),c.return=a;c.sibling=null}return a.child}function Mw(o,a,c){switch(a.tag){case 3:dg(a),Pa();break;case 5:Dy(a);break;case 1:Gn(a.type)&&zu(a);break;case 4:qf(a,a.stateNode.containerInfo);break;case 10:var m=a.type._context,v=a.memoizedProps.value;$t(Qu,m._currentValue),m._currentValue=v;break;case 13:if(m=a.memoizedState,m!==null)return m.dehydrated!==null?($t(en,en.current&1),a.flags|=128,null):(c&a.child.childLanes)!==0?hg(o,a,c):($t(en,en.current&1),o=vs(o,a,c),o!==null?o.sibling:null);$t(en,en.current&1);break;case 19:if(m=(c&a.childLanes)!==0,(o.flags&128)!==0){if(m)return pg(o,a,c);a.flags|=128}if(v=a.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),$t(en,en.current),m)break;return null;case 22:case 23:return a.lanes=0,lg(o,a,c)}return vs(o,a,c)}var yg,mh,gg,xg;yg=function(o,a){for(var c=a.child;c!==null;){if(c.tag===5||c.tag===6)o.appendChild(c.stateNode);else if(c.tag!==4&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return;c=c.return}c.sibling.return=c.return,c=c.sibling}},mh=function(){},gg=function(o,a,c,m){var v=o.memoizedProps;if(v!==m){o=a.stateNode,Po(Kr.current);var k=null;switch(c){case"input":v=nt(o,v),m=nt(o,m),k=[];break;case"select":v=P({},v,{value:void 0}),m=P({},m,{value:void 0}),k=[];break;case"textarea":v=Pe(o,v),m=Pe(o,m),k=[];break;default:typeof v.onClick!="function"&&typeof m.onClick=="function"&&(o.onclick=Bu)}He(c,m);var L;c=null;for(he in v)if(!m.hasOwnProperty(he)&&v.hasOwnProperty(he)&&v[he]!=null)if(he==="style"){var q=v[he];for(L in q)q.hasOwnProperty(L)&&(c||(c={}),c[L]="")}else he!=="dangerouslySetInnerHTML"&&he!=="children"&&he!=="suppressContentEditableWarning"&&he!=="suppressHydrationWarning"&&he!=="autoFocus"&&(s.hasOwnProperty(he)?k||(k=[]):(k=k||[]).push(he,null));for(he in m){var X=m[he];if(q=v!=null?v[he]:void 0,m.hasOwnProperty(he)&&X!==q&&(X!=null||q!=null))if(he==="style")if(q){for(L in q)!q.hasOwnProperty(L)||X&&X.hasOwnProperty(L)||(c||(c={}),c[L]="");for(L in X)X.hasOwnProperty(L)&&q[L]!==X[L]&&(c||(c={}),c[L]=X[L])}else c||(k||(k=[]),k.push(he,c)),c=X;else he==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,q=q?q.__html:void 0,X!=null&&q!==X&&(k=k||[]).push(he,X)):he==="children"?typeof X!="string"&&typeof X!="number"||(k=k||[]).push(he,""+X):he!=="suppressContentEditableWarning"&&he!=="suppressHydrationWarning"&&(s.hasOwnProperty(he)?(X!=null&&he==="onScroll"&&Qt("scroll",o),k||q===X||(k=[])):(k=k||[]).push(he,X))}c&&(k=k||[]).push("style",c);var he=k;(a.updateQueue=he)&&(a.flags|=4)}},xg=function(o,a,c,m){c!==m&&(a.flags|=4)};function ul(o,a){if(!Jt)switch(o.tailMode){case"hidden":a=o.tail;for(var c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?o.tail=null:c.sibling=null;break;case"collapsed":c=o.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?a||o.tail===null?o.tail=null:o.tail.sibling=null:m.sibling=null}}function Rn(o){var a=o.alternate!==null&&o.alternate.child===o.child,c=0,m=0;if(a)for(var v=o.child;v!==null;)c|=v.lanes|v.childLanes,m|=v.subtreeFlags&14680064,m|=v.flags&14680064,v.return=o,v=v.sibling;else for(v=o.child;v!==null;)c|=v.lanes|v.childLanes,m|=v.subtreeFlags,m|=v.flags,v.return=o,v=v.sibling;return o.subtreeFlags|=m,o.childLanes=c,a}function Lw(o,a,c){var m=a.pendingProps;switch(Pf(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rn(a),null;case 1:return Gn(a.type)&&Uu(),Rn(a),null;case 3:return m=a.stateNode,Ha(),Gt(Qn),Gt(Mn),Gf(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(o===null||o.child===null)&&(qu(a)?a.flags|=4:o===null||o.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Lr!==null&&(Sh(Lr),Lr=null))),mh(o,a),Rn(a),null;case 5:Vf(a);var v=Po(sl.current);if(c=a.type,o!==null&&a.stateNode!=null)gg(o,a,c,m,v),o.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!m){if(a.stateNode===null)throw Error(n(166));return Rn(a),null}if(o=Po(Kr.current),qu(a)){m=a.stateNode,c=a.type;var k=a.memoizedProps;switch(m[Gr]=a,m[Zi]=k,o=(a.mode&1)!==0,c){case"dialog":Qt("cancel",m),Qt("close",m);break;case"iframe":case"object":case"embed":Qt("load",m);break;case"video":case"audio":for(v=0;v<Ki.length;v++)Qt(Ki[v],m);break;case"source":Qt("error",m);break;case"img":case"image":case"link":Qt("error",m),Qt("load",m);break;case"details":Qt("toggle",m);break;case"input":tt(m,k),Qt("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!k.multiple},Qt("invalid",m);break;case"textarea":ct(m,k),Qt("invalid",m)}He(c,k),v=null;for(var L in k)if(k.hasOwnProperty(L)){var q=k[L];L==="children"?typeof q=="string"?m.textContent!==q&&(k.suppressHydrationWarning!==!0&&Fu(m.textContent,q,o),v=["children",q]):typeof q=="number"&&m.textContent!==""+q&&(k.suppressHydrationWarning!==!0&&Fu(m.textContent,q,o),v=["children",""+q]):s.hasOwnProperty(L)&&q!=null&&L==="onScroll"&&Qt("scroll",m)}switch(c){case"input":ve(m),ut(m,k,!0);break;case"textarea":ve(m),bt(m);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(m.onclick=Bu)}m=v,a.updateQueue=m,m!==null&&(a.flags|=4)}else{L=v.nodeType===9?v:v.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=ue(c)),o==="http://www.w3.org/1999/xhtml"?c==="script"?(o=L.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof m.is=="string"?o=L.createElement(c,{is:m.is}):(o=L.createElement(c),c==="select"&&(L=o,m.multiple?L.multiple=!0:m.size&&(L.size=m.size))):o=L.createElementNS(o,c),o[Gr]=a,o[Zi]=m,yg(o,a,!1,!1),a.stateNode=o;e:{switch(L=Ue(c,m),c){case"dialog":Qt("cancel",o),Qt("close",o),v=m;break;case"iframe":case"object":case"embed":Qt("load",o),v=m;break;case"video":case"audio":for(v=0;v<Ki.length;v++)Qt(Ki[v],o);v=m;break;case"source":Qt("error",o),v=m;break;case"img":case"image":case"link":Qt("error",o),Qt("load",o),v=m;break;case"details":Qt("toggle",o),v=m;break;case"input":tt(o,m),v=nt(o,m),Qt("invalid",o);break;case"option":v=m;break;case"select":o._wrapperState={wasMultiple:!!m.multiple},v=P({},m,{value:void 0}),Qt("invalid",o);break;case"textarea":ct(o,m),v=Pe(o,m),Qt("invalid",o);break;default:v=m}He(c,v),q=v;for(k in q)if(q.hasOwnProperty(k)){var X=q[k];k==="style"?_e(o,X):k==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,X!=null&&Re(o,X)):k==="children"?typeof X=="string"?(c!=="textarea"||X!=="")&&Fe(o,X):typeof X=="number"&&Fe(o,""+X):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(s.hasOwnProperty(k)?X!=null&&k==="onScroll"&&Qt("scroll",o):X!=null&&S(o,k,X,L))}switch(c){case"input":ve(o),ut(o,m,!1);break;case"textarea":ve(o),bt(o);break;case"option":m.value!=null&&o.setAttribute("value",""+te(m.value));break;case"select":o.multiple=!!m.multiple,k=m.value,k!=null?Ae(o,!!m.multiple,k,!1):m.defaultValue!=null&&Ae(o,!!m.multiple,m.defaultValue,!0);break;default:typeof v.onClick=="function"&&(o.onclick=Bu)}switch(c){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}}m&&(a.flags|=4)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return Rn(a),null;case 6:if(o&&a.stateNode!=null)xg(o,a,o.memoizedProps,m);else{if(typeof m!="string"&&a.stateNode===null)throw Error(n(166));if(c=Po(sl.current),Po(Kr.current),qu(a)){if(m=a.stateNode,c=a.memoizedProps,m[Gr]=a,(k=m.nodeValue!==c)&&(o=lr,o!==null))switch(o.tag){case 3:Fu(m.nodeValue,c,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&Fu(m.nodeValue,c,(o.mode&1)!==0)}k&&(a.flags|=4)}else m=(c.nodeType===9?c:c.ownerDocument).createTextNode(m),m[Gr]=a,a.stateNode=m}return Rn(a),null;case 13:if(Gt(en),m=a.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Jt&&ur!==null&&(a.mode&1)!==0&&(a.flags&128)===0)Ey(),Pa(),a.flags|=98560,k=!1;else if(k=qu(a),m!==null&&m.dehydrated!==null){if(o===null){if(!k)throw Error(n(318));if(k=a.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[Gr]=a}else Pa(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Rn(a),k=!1}else Lr!==null&&(Sh(Lr),Lr=null),k=!0;if(!k)return a.flags&65536?a:null}return(a.flags&128)!==0?(a.lanes=c,a):(m=m!==null,m!==(o!==null&&o.memoizedState!==null)&&m&&(a.child.flags|=8192,(a.mode&1)!==0&&(o===null||(en.current&1)!==0?Tn===0&&(Tn=3):_h())),a.updateQueue!==null&&(a.flags|=4),Rn(a),null);case 4:return Ha(),mh(o,a),o===null&&Xi(a.stateNode.containerInfo),Rn(a),null;case 10:return zf(a.type._context),Rn(a),null;case 17:return Gn(a.type)&&Uu(),Rn(a),null;case 19:if(Gt(en),k=a.memoizedState,k===null)return Rn(a),null;if(m=(a.flags&128)!==0,L=k.rendering,L===null)if(m)ul(k,!1);else{if(Tn!==0||o!==null&&(o.flags&128)!==0)for(o=a.child;o!==null;){if(L=Ju(o),L!==null){for(a.flags|=128,ul(k,!1),m=L.updateQueue,m!==null&&(a.updateQueue=m,a.flags|=4),a.subtreeFlags=0,m=c,c=a.child;c!==null;)k=c,o=m,k.flags&=14680066,L=k.alternate,L===null?(k.childLanes=0,k.lanes=o,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=L.childLanes,k.lanes=L.lanes,k.child=L.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=L.memoizedProps,k.memoizedState=L.memoizedState,k.updateQueue=L.updateQueue,k.type=L.type,o=L.dependencies,k.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),c=c.sibling;return $t(en,en.current&1|2),a.child}o=o.sibling}k.tail!==null&&Yt()>Ya&&(a.flags|=128,m=!0,ul(k,!1),a.lanes=4194304)}else{if(!m)if(o=Ju(L),o!==null){if(a.flags|=128,m=!0,c=o.updateQueue,c!==null&&(a.updateQueue=c,a.flags|=4),ul(k,!0),k.tail===null&&k.tailMode==="hidden"&&!L.alternate&&!Jt)return Rn(a),null}else 2*Yt()-k.renderingStartTime>Ya&&c!==1073741824&&(a.flags|=128,m=!0,ul(k,!1),a.lanes=4194304);k.isBackwards?(L.sibling=a.child,a.child=L):(c=k.last,c!==null?c.sibling=L:a.child=L,k.last=L)}return k.tail!==null?(a=k.tail,k.rendering=a,k.tail=a.sibling,k.renderingStartTime=Yt(),a.sibling=null,c=en.current,$t(en,m?c&1|2:c&1),a):(Rn(a),null);case 22:case 23:return Nh(),m=a.memoizedState!==null,o!==null&&o.memoizedState!==null!==m&&(a.flags|=8192),m&&(a.mode&1)!==0?(cr&1073741824)!==0&&(Rn(a),a.subtreeFlags&6&&(a.flags|=8192)):Rn(a),null;case 24:return null;case 25:return null}throw Error(n(156,a.tag))}function Rw(o,a){switch(Pf(a),a.tag){case 1:return Gn(a.type)&&Uu(),o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 3:return Ha(),Gt(Qn),Gt(Mn),Gf(),o=a.flags,(o&65536)!==0&&(o&128)===0?(a.flags=o&-65537|128,a):null;case 5:return Vf(a),null;case 13:if(Gt(en),o=a.memoizedState,o!==null&&o.dehydrated!==null){if(a.alternate===null)throw Error(n(340));Pa()}return o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 19:return Gt(en),null;case 4:return Ha(),null;case 10:return zf(a.type._context),null;case 22:case 23:return Nh(),null;case 24:return null;default:return null}}var ic=!1,Pn=!1,Pw=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function za(o,a){var c=o.ref;if(c!==null)if(typeof c=="function")try{c(null)}catch(m){un(o,a,m)}else c.current=null}function ph(o,a,c){try{c()}catch(m){un(o,a,m)}}var bg=!1;function jw(o,a){if(Nf=Nu,o=Xp(),bf(o)){if("selectionStart"in o)var c={start:o.selectionStart,end:o.selectionEnd};else e:{c=(c=o.ownerDocument)&&c.defaultView||window;var m=c.getSelection&&c.getSelection();if(m&&m.rangeCount!==0){c=m.anchorNode;var v=m.anchorOffset,k=m.focusNode;m=m.focusOffset;try{c.nodeType,k.nodeType}catch{c=null;break e}var L=0,q=-1,X=-1,he=0,Se=0,Ce=o,we=null;t:for(;;){for(var ze;Ce!==c||v!==0&&Ce.nodeType!==3||(q=L+v),Ce!==k||m!==0&&Ce.nodeType!==3||(X=L+m),Ce.nodeType===3&&(L+=Ce.nodeValue.length),(ze=Ce.firstChild)!==null;)we=Ce,Ce=ze;for(;;){if(Ce===o)break t;if(we===c&&++he===v&&(q=L),we===k&&++Se===m&&(X=L),(ze=Ce.nextSibling)!==null)break;Ce=we,we=Ce.parentNode}Ce=ze}c=q===-1||X===-1?null:{start:q,end:X}}else c=null}c=c||{start:0,end:0}}else c=null;for(_f={focusedElem:o,selectionRange:c},Nu=!1,Qe=a;Qe!==null;)if(a=Qe,o=a.child,(a.subtreeFlags&1028)!==0&&o!==null)o.return=a,Qe=o;else for(;Qe!==null;){a=Qe;try{var Xe=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if(Xe!==null){var Ze=Xe.memoizedProps,hn=Xe.memoizedState,se=a.stateNode,Z=se.getSnapshotBeforeUpdate(a.elementType===a.type?Ze:Rr(a.type,Ze),hn);se.__reactInternalSnapshotBeforeUpdate=Z}break;case 3:var ce=a.stateNode.containerInfo;ce.nodeType===1?ce.textContent="":ce.nodeType===9&&ce.documentElement&&ce.removeChild(ce.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ie){un(a,a.return,Ie)}if(o=a.sibling,o!==null){o.return=a.return,Qe=o;break}Qe=a.return}return Xe=bg,bg=!1,Xe}function cl(o,a,c){var m=a.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var v=m=m.next;do{if((v.tag&o)===o){var k=v.destroy;v.destroy=void 0,k!==void 0&&ph(a,c,k)}v=v.next}while(v!==m)}}function lc(o,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var c=a=a.next;do{if((c.tag&o)===o){var m=c.create;c.destroy=m()}c=c.next}while(c!==a)}}function yh(o){var a=o.ref;if(a!==null){var c=o.stateNode;switch(o.tag){case 5:o=c;break;default:o=c}typeof a=="function"?a(o):a.current=o}}function vg(o){var a=o.alternate;a!==null&&(o.alternate=null,vg(a)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(a=o.stateNode,a!==null&&(delete a[Gr],delete a[Zi],delete a[If],delete a[bw],delete a[vw])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Eg(o){return o.tag===5||o.tag===3||o.tag===4}function Tg(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Eg(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function gh(o,a,c){var m=o.tag;if(m===5||m===6)o=o.stateNode,a?c.nodeType===8?c.parentNode.insertBefore(o,a):c.insertBefore(o,a):(c.nodeType===8?(a=c.parentNode,a.insertBefore(o,c)):(a=c,a.appendChild(o)),c=c._reactRootContainer,c!=null||a.onclick!==null||(a.onclick=Bu));else if(m!==4&&(o=o.child,o!==null))for(gh(o,a,c),o=o.sibling;o!==null;)gh(o,a,c),o=o.sibling}function xh(o,a,c){var m=o.tag;if(m===5||m===6)o=o.stateNode,a?c.insertBefore(o,a):c.appendChild(o);else if(m!==4&&(o=o.child,o!==null))for(xh(o,a,c),o=o.sibling;o!==null;)xh(o,a,c),o=o.sibling}var Dn=null,Pr=!1;function Ks(o,a,c){for(c=c.child;c!==null;)wg(o,a,c),c=c.sibling}function wg(o,a,c){if(Qr&&typeof Qr.onCommitFiberUnmount=="function")try{Qr.onCommitFiberUnmount(Eu,c)}catch{}switch(c.tag){case 5:Pn||za(c,a);case 6:var m=Dn,v=Pr;Dn=null,Ks(o,a,c),Dn=m,Pr=v,Dn!==null&&(Pr?(o=Dn,c=c.stateNode,o.nodeType===8?o.parentNode.removeChild(c):o.removeChild(c)):Dn.removeChild(c.stateNode));break;case 18:Dn!==null&&(Pr?(o=Dn,c=c.stateNode,o.nodeType===8?Af(o.parentNode,c):o.nodeType===1&&Af(o,c),zi(o)):Af(Dn,c.stateNode));break;case 4:m=Dn,v=Pr,Dn=c.stateNode.containerInfo,Pr=!0,Ks(o,a,c),Dn=m,Pr=v;break;case 0:case 11:case 14:case 15:if(!Pn&&(m=c.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){v=m=m.next;do{var k=v,L=k.destroy;k=k.tag,L!==void 0&&((k&2)!==0||(k&4)!==0)&&ph(c,a,L),v=v.next}while(v!==m)}Ks(o,a,c);break;case 1:if(!Pn&&(za(c,a),m=c.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=c.memoizedProps,m.state=c.memoizedState,m.componentWillUnmount()}catch(q){un(c,a,q)}Ks(o,a,c);break;case 21:Ks(o,a,c);break;case 22:c.mode&1?(Pn=(m=Pn)||c.memoizedState!==null,Ks(o,a,c),Pn=m):Ks(o,a,c);break;default:Ks(o,a,c)}}function kg(o){var a=o.updateQueue;if(a!==null){o.updateQueue=null;var c=o.stateNode;c===null&&(c=o.stateNode=new Pw),a.forEach(function(m){var v=qw.bind(null,o,m);c.has(m)||(c.add(m),m.then(v,v))})}}function jr(o,a){var c=a.deletions;if(c!==null)for(var m=0;m<c.length;m++){var v=c[m];try{var k=o,L=a,q=L;e:for(;q!==null;){switch(q.tag){case 5:Dn=q.stateNode,Pr=!1;break e;case 3:Dn=q.stateNode.containerInfo,Pr=!0;break e;case 4:Dn=q.stateNode.containerInfo,Pr=!0;break e}q=q.return}if(Dn===null)throw Error(n(160));wg(k,L,v),Dn=null,Pr=!1;var X=v.alternate;X!==null&&(X.return=null),v.return=null}catch(he){un(v,a,he)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)Sg(a,o),a=a.sibling}function Sg(o,a){var c=o.alternate,m=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(jr(a,o),Jr(o),m&4){try{cl(3,o,o.return),lc(3,o)}catch(Ze){un(o,o.return,Ze)}try{cl(5,o,o.return)}catch(Ze){un(o,o.return,Ze)}}break;case 1:jr(a,o),Jr(o),m&512&&c!==null&&za(c,c.return);break;case 5:if(jr(a,o),Jr(o),m&512&&c!==null&&za(c,c.return),o.flags&32){var v=o.stateNode;try{Fe(v,"")}catch(Ze){un(o,o.return,Ze)}}if(m&4&&(v=o.stateNode,v!=null)){var k=o.memoizedProps,L=c!==null?c.memoizedProps:k,q=o.type,X=o.updateQueue;if(o.updateQueue=null,X!==null)try{q==="input"&&k.type==="radio"&&k.name!=null&&Je(v,k),Ue(q,L);var he=Ue(q,k);for(L=0;L<X.length;L+=2){var Se=X[L],Ce=X[L+1];Se==="style"?_e(v,Ce):Se==="dangerouslySetInnerHTML"?Re(v,Ce):Se==="children"?Fe(v,Ce):S(v,Se,Ce,he)}switch(q){case"input":rt(v,k);break;case"textarea":kt(v,k);break;case"select":var we=v._wrapperState.wasMultiple;v._wrapperState.wasMultiple=!!k.multiple;var ze=k.value;ze!=null?Ae(v,!!k.multiple,ze,!1):we!==!!k.multiple&&(k.defaultValue!=null?Ae(v,!!k.multiple,k.defaultValue,!0):Ae(v,!!k.multiple,k.multiple?[]:"",!1))}v[Zi]=k}catch(Ze){un(o,o.return,Ze)}}break;case 6:if(jr(a,o),Jr(o),m&4){if(o.stateNode===null)throw Error(n(162));v=o.stateNode,k=o.memoizedProps;try{v.nodeValue=k}catch(Ze){un(o,o.return,Ze)}}break;case 3:if(jr(a,o),Jr(o),m&4&&c!==null&&c.memoizedState.isDehydrated)try{zi(a.containerInfo)}catch(Ze){un(o,o.return,Ze)}break;case 4:jr(a,o),Jr(o);break;case 13:jr(a,o),Jr(o),v=o.child,v.flags&8192&&(k=v.memoizedState!==null,v.stateNode.isHidden=k,!k||v.alternate!==null&&v.alternate.memoizedState!==null||(Eh=Yt())),m&4&&kg(o);break;case 22:if(Se=c!==null&&c.memoizedState!==null,o.mode&1?(Pn=(he=Pn)||Se,jr(a,o),Pn=he):jr(a,o),Jr(o),m&8192){if(he=o.memoizedState!==null,(o.stateNode.isHidden=he)&&!Se&&(o.mode&1)!==0)for(Qe=o,Se=o.child;Se!==null;){for(Ce=Qe=Se;Qe!==null;){switch(we=Qe,ze=we.child,we.tag){case 0:case 11:case 14:case 15:cl(4,we,we.return);break;case 1:za(we,we.return);var Xe=we.stateNode;if(typeof Xe.componentWillUnmount=="function"){m=we,c=we.return;try{a=m,Xe.props=a.memoizedProps,Xe.state=a.memoizedState,Xe.componentWillUnmount()}catch(Ze){un(m,c,Ze)}}break;case 5:za(we,we.return);break;case 22:if(we.memoizedState!==null){_g(Ce);continue}}ze!==null?(ze.return=we,Qe=ze):_g(Ce)}Se=Se.sibling}e:for(Se=null,Ce=o;;){if(Ce.tag===5){if(Se===null){Se=Ce;try{v=Ce.stateNode,he?(k=v.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(q=Ce.stateNode,X=Ce.memoizedProps.style,L=X!=null&&X.hasOwnProperty("display")?X.display:null,q.style.display=de("display",L))}catch(Ze){un(o,o.return,Ze)}}}else if(Ce.tag===6){if(Se===null)try{Ce.stateNode.nodeValue=he?"":Ce.memoizedProps}catch(Ze){un(o,o.return,Ze)}}else if((Ce.tag!==22&&Ce.tag!==23||Ce.memoizedState===null||Ce===o)&&Ce.child!==null){Ce.child.return=Ce,Ce=Ce.child;continue}if(Ce===o)break e;for(;Ce.sibling===null;){if(Ce.return===null||Ce.return===o)break e;Se===Ce&&(Se=null),Ce=Ce.return}Se===Ce&&(Se=null),Ce.sibling.return=Ce.return,Ce=Ce.sibling}}break;case 19:jr(a,o),Jr(o),m&4&&kg(o);break;case 21:break;default:jr(a,o),Jr(o)}}function Jr(o){var a=o.flags;if(a&2){try{e:{for(var c=o.return;c!==null;){if(Eg(c)){var m=c;break e}c=c.return}throw Error(n(160))}switch(m.tag){case 5:var v=m.stateNode;m.flags&32&&(Fe(v,""),m.flags&=-33);var k=Tg(o);xh(o,k,v);break;case 3:case 4:var L=m.stateNode.containerInfo,q=Tg(o);gh(o,q,L);break;default:throw Error(n(161))}}catch(X){un(o,o.return,X)}o.flags&=-3}a&4096&&(o.flags&=-4097)}function Fw(o,a,c){Qe=o,Cg(o)}function Cg(o,a,c){for(var m=(o.mode&1)!==0;Qe!==null;){var v=Qe,k=v.child;if(v.tag===22&&m){var L=v.memoizedState!==null||ic;if(!L){var q=v.alternate,X=q!==null&&q.memoizedState!==null||Pn;q=ic;var he=Pn;if(ic=L,(Pn=X)&&!he)for(Qe=v;Qe!==null;)L=Qe,X=L.child,L.tag===22&&L.memoizedState!==null?Dg(v):X!==null?(X.return=L,Qe=X):Dg(v);for(;k!==null;)Qe=k,Cg(k),k=k.sibling;Qe=v,ic=q,Pn=he}Ng(o)}else(v.subtreeFlags&8772)!==0&&k!==null?(k.return=v,Qe=k):Ng(o)}}function Ng(o){for(;Qe!==null;){var a=Qe;if((a.flags&8772)!==0){var c=a.alternate;try{if((a.flags&8772)!==0)switch(a.tag){case 0:case 11:case 15:Pn||lc(5,a);break;case 1:var m=a.stateNode;if(a.flags&4&&!Pn)if(c===null)m.componentDidMount();else{var v=a.elementType===a.type?c.memoizedProps:Rr(a.type,c.memoizedProps);m.componentDidUpdate(v,c.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var k=a.updateQueue;k!==null&&_y(a,k,m);break;case 3:var L=a.updateQueue;if(L!==null){if(c=null,a.child!==null)switch(a.child.tag){case 5:c=a.child.stateNode;break;case 1:c=a.child.stateNode}_y(a,L,c)}break;case 5:var q=a.stateNode;if(c===null&&a.flags&4){c=q;var X=a.memoizedProps;switch(a.type){case"button":case"input":case"select":case"textarea":X.autoFocus&&c.focus();break;case"img":X.src&&(c.src=X.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(a.memoizedState===null){var he=a.alternate;if(he!==null){var Se=he.memoizedState;if(Se!==null){var Ce=Se.dehydrated;Ce!==null&&zi(Ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Pn||a.flags&512&&yh(a)}catch(we){un(a,a.return,we)}}if(a===o){Qe=null;break}if(c=a.sibling,c!==null){c.return=a.return,Qe=c;break}Qe=a.return}}function _g(o){for(;Qe!==null;){var a=Qe;if(a===o){Qe=null;break}var c=a.sibling;if(c!==null){c.return=a.return,Qe=c;break}Qe=a.return}}function Dg(o){for(;Qe!==null;){var a=Qe;try{switch(a.tag){case 0:case 11:case 15:var c=a.return;try{lc(4,a)}catch(X){un(a,c,X)}break;case 1:var m=a.stateNode;if(typeof m.componentDidMount=="function"){var v=a.return;try{m.componentDidMount()}catch(X){un(a,v,X)}}var k=a.return;try{yh(a)}catch(X){un(a,k,X)}break;case 5:var L=a.return;try{yh(a)}catch(X){un(a,L,X)}}}catch(X){un(a,a.return,X)}if(a===o){Qe=null;break}var q=a.sibling;if(q!==null){q.return=a.return,Qe=q;break}Qe=a.return}}var Bw=Math.ceil,uc=A.ReactCurrentDispatcher,bh=A.ReactCurrentOwner,Tr=A.ReactCurrentBatchConfig,_t=0,kn=null,xn=null,On=0,cr=0,Wa=$s(0),Tn=0,dl=null,Fo=0,cc=0,vh=0,fl=null,Xn=null,Eh=0,Ya=1/0,Es=null,dc=!1,Th=null,Xs=null,fc=!1,Js=null,hc=0,hl=0,wh=null,mc=-1,pc=0;function Wn(){return(_t&6)!==0?Yt():mc!==-1?mc:mc=Yt()}function Zs(o){return(o.mode&1)===0?1:(_t&2)!==0&&On!==0?On&-On:Tw.transition!==null?(pc===0&&(pc=Tp()),pc):(o=Ft,o!==0||(o=window.event,o=o===void 0?16:Ap(o.type)),o)}function Fr(o,a,c,m){if(50<hl)throw hl=0,wh=null,Error(n(185));ji(o,c,m),((_t&2)===0||o!==kn)&&(o===kn&&((_t&2)===0&&(cc|=c),Tn===4&&eo(o,On)),Jn(o,m),c===1&&_t===0&&(a.mode&1)===0&&(Ya=Yt()+500,Wu&&Vs()))}function Jn(o,a){var c=o.callbackNode;TT(o,a);var m=ku(o,o===kn?On:0);if(m===0)c!==null&&Wt(c),o.callbackNode=null,o.callbackPriority=0;else if(a=m&-m,o.callbackPriority!==a){if(c!=null&&Wt(c),a===1)o.tag===0?Ew(Ag.bind(null,o)):yy(Ag.bind(null,o)),gw(function(){(_t&6)===0&&Vs()}),c=null;else{switch(wp(m)){case 1:c=Oo;break;case 4:c=vp;break;case 16:c=vu;break;case 536870912:c=Ep;break;default:c=vu}c=Bg(c,Og.bind(null,o))}o.callbackPriority=a,o.callbackNode=c}}function Og(o,a){if(mc=-1,pc=0,(_t&6)!==0)throw Error(n(327));var c=o.callbackNode;if($a()&&o.callbackNode!==c)return null;var m=ku(o,o===kn?On:0);if(m===0)return null;if((m&30)!==0||(m&o.expiredLanes)!==0||a)a=yc(o,m);else{a=m;var v=_t;_t|=2;var k=Mg();(kn!==o||On!==a)&&(Es=null,Ya=Yt()+500,Ho(o,a));do try{zw();break}catch(q){Ig(o,q)}while(!0);Uf(),uc.current=k,_t=v,xn!==null?a=0:(kn=null,On=0,a=Tn)}if(a!==0){if(a===2&&(v=nf(o),v!==0&&(m=v,a=kh(o,v))),a===1)throw c=dl,Ho(o,0),eo(o,m),Jn(o,Yt()),c;if(a===6)eo(o,m);else{if(v=o.current.alternate,(m&30)===0&&!Hw(v)&&(a=yc(o,m),a===2&&(k=nf(o),k!==0&&(m=k,a=kh(o,k))),a===1))throw c=dl,Ho(o,0),eo(o,m),Jn(o,Yt()),c;switch(o.finishedWork=v,o.finishedLanes=m,a){case 0:case 1:throw Error(n(345));case 2:Uo(o,Xn,Es);break;case 3:if(eo(o,m),(m&130023424)===m&&(a=Eh+500-Yt(),10<a)){if(ku(o,0)!==0)break;if(v=o.suspendedLanes,(v&m)!==m){Wn(),o.pingedLanes|=o.suspendedLanes&v;break}o.timeoutHandle=Of(Uo.bind(null,o,Xn,Es),a);break}Uo(o,Xn,Es);break;case 4:if(eo(o,m),(m&4194240)===m)break;for(a=o.eventTimes,v=-1;0<m;){var L=31-Ir(m);k=1<<L,L=a[L],L>v&&(v=L),m&=~k}if(m=v,m=Yt()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*Bw(m/1960))-m,10<m){o.timeoutHandle=Of(Uo.bind(null,o,Xn,Es),m);break}Uo(o,Xn,Es);break;case 5:Uo(o,Xn,Es);break;default:throw Error(n(329))}}}return Jn(o,Yt()),o.callbackNode===c?Og.bind(null,o):null}function kh(o,a){var c=fl;return o.current.memoizedState.isDehydrated&&(Ho(o,a).flags|=256),o=yc(o,a),o!==2&&(a=Xn,Xn=c,a!==null&&Sh(a)),o}function Sh(o){Xn===null?Xn=o:Xn.push.apply(Xn,o)}function Hw(o){for(var a=o;;){if(a.flags&16384){var c=a.updateQueue;if(c!==null&&(c=c.stores,c!==null))for(var m=0;m<c.length;m++){var v=c[m],k=v.getSnapshot;v=v.value;try{if(!Mr(k(),v))return!1}catch{return!1}}}if(c=a.child,a.subtreeFlags&16384&&c!==null)c.return=a,a=c;else{if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function eo(o,a){for(a&=~vh,a&=~cc,o.suspendedLanes|=a,o.pingedLanes&=~a,o=o.expirationTimes;0<a;){var c=31-Ir(a),m=1<<c;o[c]=-1,a&=~m}}function Ag(o){if((_t&6)!==0)throw Error(n(327));$a();var a=ku(o,0);if((a&1)===0)return Jn(o,Yt()),null;var c=yc(o,a);if(o.tag!==0&&c===2){var m=nf(o);m!==0&&(a=m,c=kh(o,m))}if(c===1)throw c=dl,Ho(o,0),eo(o,a),Jn(o,Yt()),c;if(c===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=a,Uo(o,Xn,Es),Jn(o,Yt()),null}function Ch(o,a){var c=_t;_t|=1;try{return o(a)}finally{_t=c,_t===0&&(Ya=Yt()+500,Wu&&Vs())}}function Bo(o){Js!==null&&Js.tag===0&&(_t&6)===0&&$a();var a=_t;_t|=1;var c=Tr.transition,m=Ft;try{if(Tr.transition=null,Ft=1,o)return o()}finally{Ft=m,Tr.transition=c,_t=a,(_t&6)===0&&Vs()}}function Nh(){cr=Wa.current,Gt(Wa)}function Ho(o,a){o.finishedWork=null,o.finishedLanes=0;var c=o.timeoutHandle;if(c!==-1&&(o.timeoutHandle=-1,yw(c)),xn!==null)for(c=xn.return;c!==null;){var m=c;switch(Pf(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&Uu();break;case 3:Ha(),Gt(Qn),Gt(Mn),Gf();break;case 5:Vf(m);break;case 4:Ha();break;case 13:Gt(en);break;case 19:Gt(en);break;case 10:zf(m.type._context);break;case 22:case 23:Nh()}c=c.return}if(kn=o,xn=o=to(o.current,null),On=cr=a,Tn=0,dl=null,vh=cc=Fo=0,Xn=fl=null,Ro!==null){for(a=0;a<Ro.length;a++)if(c=Ro[a],m=c.interleaved,m!==null){c.interleaved=null;var v=m.next,k=c.pending;if(k!==null){var L=k.next;k.next=v,m.next=L}c.pending=m}Ro=null}return o}function Ig(o,a){do{var c=xn;try{if(Uf(),Zu.current=rc,ec){for(var m=tn.memoizedState;m!==null;){var v=m.queue;v!==null&&(v.pending=null),m=m.next}ec=!1}if(jo=0,wn=En=tn=null,ol=!1,al=0,bh.current=null,c===null||c.return===null){Tn=1,dl=a,xn=null;break}e:{var k=o,L=c.return,q=c,X=a;if(a=On,q.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var he=X,Se=q,Ce=Se.tag;if((Se.mode&1)===0&&(Ce===0||Ce===11||Ce===15)){var we=Se.alternate;we?(Se.updateQueue=we.updateQueue,Se.memoizedState=we.memoizedState,Se.lanes=we.lanes):(Se.updateQueue=null,Se.memoizedState=null)}var ze=rg(L);if(ze!==null){ze.flags&=-257,sg(ze,L,q,k,a),ze.mode&1&&ng(k,he,a),a=ze,X=he;var Xe=a.updateQueue;if(Xe===null){var Ze=new Set;Ze.add(X),a.updateQueue=Ze}else Xe.add(X);break e}else{if((a&1)===0){ng(k,he,a),_h();break e}X=Error(n(426))}}else if(Jt&&q.mode&1){var hn=rg(L);if(hn!==null){(hn.flags&65536)===0&&(hn.flags|=256),sg(hn,L,q,k,a),Bf(Ua(X,q));break e}}k=X=Ua(X,q),Tn!==4&&(Tn=2),fl===null?fl=[k]:fl.push(k),k=L;do{switch(k.tag){case 3:k.flags|=65536,a&=-a,k.lanes|=a;var se=eg(k,X,a);Ny(k,se);break e;case 1:q=X;var Z=k.type,ce=k.stateNode;if((k.flags&128)===0&&(typeof Z.getDerivedStateFromError=="function"||ce!==null&&typeof ce.componentDidCatch=="function"&&(Xs===null||!Xs.has(ce)))){k.flags|=65536,a&=-a,k.lanes|=a;var Ie=tg(k,q,a);Ny(k,Ie);break e}}k=k.return}while(k!==null)}Rg(c)}catch(et){a=et,xn===c&&c!==null&&(xn=c=c.return);continue}break}while(!0)}function Mg(){var o=uc.current;return uc.current=rc,o===null?rc:o}function _h(){(Tn===0||Tn===3||Tn===2)&&(Tn=4),kn===null||(Fo&268435455)===0&&(cc&268435455)===0||eo(kn,On)}function yc(o,a){var c=_t;_t|=2;var m=Mg();(kn!==o||On!==a)&&(Es=null,Ho(o,a));do try{Uw();break}catch(v){Ig(o,v)}while(!0);if(Uf(),_t=c,uc.current=m,xn!==null)throw Error(n(261));return kn=null,On=0,Tn}function Uw(){for(;xn!==null;)Lg(xn)}function zw(){for(;xn!==null&&!Ri();)Lg(xn)}function Lg(o){var a=Fg(o.alternate,o,cr);o.memoizedProps=o.pendingProps,a===null?Rg(o):xn=a,bh.current=null}function Rg(o){var a=o;do{var c=a.alternate;if(o=a.return,(a.flags&32768)===0){if(c=Lw(c,a,cr),c!==null){xn=c;return}}else{if(c=Rw(c,a),c!==null){c.flags&=32767,xn=c;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{Tn=6,xn=null;return}}if(a=a.sibling,a!==null){xn=a;return}xn=a=o}while(a!==null);Tn===0&&(Tn=5)}function Uo(o,a,c){var m=Ft,v=Tr.transition;try{Tr.transition=null,Ft=1,Ww(o,a,c,m)}finally{Tr.transition=v,Ft=m}return null}function Ww(o,a,c,m){do $a();while(Js!==null);if((_t&6)!==0)throw Error(n(327));c=o.finishedWork;var v=o.finishedLanes;if(c===null)return null;if(o.finishedWork=null,o.finishedLanes=0,c===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var k=c.lanes|c.childLanes;if(wT(o,k),o===kn&&(xn=kn=null,On=0),(c.subtreeFlags&2064)===0&&(c.flags&2064)===0||fc||(fc=!0,Bg(vu,function(){return $a(),null})),k=(c.flags&15990)!==0,(c.subtreeFlags&15990)!==0||k){k=Tr.transition,Tr.transition=null;var L=Ft;Ft=1;var q=_t;_t|=4,bh.current=null,jw(o,c),Sg(c,o),uw(_f),Nu=!!Nf,_f=Nf=null,o.current=c,Fw(c),wa(),_t=q,Ft=L,Tr.transition=k}else o.current=c;if(fc&&(fc=!1,Js=o,hc=v),k=o.pendingLanes,k===0&&(Xs=null),gT(c.stateNode),Jn(o,Yt()),a!==null)for(m=o.onRecoverableError,c=0;c<a.length;c++)v=a[c],m(v.value,{componentStack:v.stack,digest:v.digest});if(dc)throw dc=!1,o=Th,Th=null,o;return(hc&1)!==0&&o.tag!==0&&$a(),k=o.pendingLanes,(k&1)!==0?o===wh?hl++:(hl=0,wh=o):hl=0,Vs(),null}function $a(){if(Js!==null){var o=wp(hc),a=Tr.transition,c=Ft;try{if(Tr.transition=null,Ft=16>o?16:o,Js===null)var m=!1;else{if(o=Js,Js=null,hc=0,(_t&6)!==0)throw Error(n(331));var v=_t;for(_t|=4,Qe=o.current;Qe!==null;){var k=Qe,L=k.child;if((Qe.flags&16)!==0){var q=k.deletions;if(q!==null){for(var X=0;X<q.length;X++){var he=q[X];for(Qe=he;Qe!==null;){var Se=Qe;switch(Se.tag){case 0:case 11:case 15:cl(8,Se,k)}var Ce=Se.child;if(Ce!==null)Ce.return=Se,Qe=Ce;else for(;Qe!==null;){Se=Qe;var we=Se.sibling,ze=Se.return;if(vg(Se),Se===he){Qe=null;break}if(we!==null){we.return=ze,Qe=we;break}Qe=ze}}}var Xe=k.alternate;if(Xe!==null){var Ze=Xe.child;if(Ze!==null){Xe.child=null;do{var hn=Ze.sibling;Ze.sibling=null,Ze=hn}while(Ze!==null)}}Qe=k}}if((k.subtreeFlags&2064)!==0&&L!==null)L.return=k,Qe=L;else e:for(;Qe!==null;){if(k=Qe,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:cl(9,k,k.return)}var se=k.sibling;if(se!==null){se.return=k.return,Qe=se;break e}Qe=k.return}}var Z=o.current;for(Qe=Z;Qe!==null;){L=Qe;var ce=L.child;if((L.subtreeFlags&2064)!==0&&ce!==null)ce.return=L,Qe=ce;else e:for(L=Z;Qe!==null;){if(q=Qe,(q.flags&2048)!==0)try{switch(q.tag){case 0:case 11:case 15:lc(9,q)}}catch(et){un(q,q.return,et)}if(q===L){Qe=null;break e}var Ie=q.sibling;if(Ie!==null){Ie.return=q.return,Qe=Ie;break e}Qe=q.return}}if(_t=v,Vs(),Qr&&typeof Qr.onPostCommitFiberRoot=="function")try{Qr.onPostCommitFiberRoot(Eu,o)}catch{}m=!0}return m}finally{Ft=c,Tr.transition=a}}return!1}function Pg(o,a,c){a=Ua(c,a),a=eg(o,a,1),o=Gs(o,a,1),a=Wn(),o!==null&&(ji(o,1,a),Jn(o,a))}function un(o,a,c){if(o.tag===3)Pg(o,o,c);else for(;a!==null;){if(a.tag===3){Pg(a,o,c);break}else if(a.tag===1){var m=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Xs===null||!Xs.has(m))){o=Ua(c,o),o=tg(a,o,1),a=Gs(a,o,1),o=Wn(),a!==null&&(ji(a,1,o),Jn(a,o));break}}a=a.return}}function Yw(o,a,c){var m=o.pingCache;m!==null&&m.delete(a),a=Wn(),o.pingedLanes|=o.suspendedLanes&c,kn===o&&(On&c)===c&&(Tn===4||Tn===3&&(On&130023424)===On&&500>Yt()-Eh?Ho(o,0):vh|=c),Jn(o,a)}function jg(o,a){a===0&&((o.mode&1)===0?a=1:(a=wu,wu<<=1,(wu&130023424)===0&&(wu=4194304)));var c=Wn();o=xs(o,a),o!==null&&(ji(o,a,c),Jn(o,c))}function $w(o){var a=o.memoizedState,c=0;a!==null&&(c=a.retryLane),jg(o,c)}function qw(o,a){var c=0;switch(o.tag){case 13:var m=o.stateNode,v=o.memoizedState;v!==null&&(c=v.retryLane);break;case 19:m=o.stateNode;break;default:throw Error(n(314))}m!==null&&m.delete(a),jg(o,c)}var Fg;Fg=function(o,a,c){if(o!==null)if(o.memoizedProps!==a.pendingProps||Qn.current)Kn=!0;else{if((o.lanes&c)===0&&(a.flags&128)===0)return Kn=!1,Mw(o,a,c);Kn=(o.flags&131072)!==0}else Kn=!1,Jt&&(a.flags&1048576)!==0&&gy(a,$u,a.index);switch(a.lanes=0,a.tag){case 2:var m=a.type;ac(o,a),o=a.pendingProps;var v=Ma(a,Mn.current);Ba(a,c),v=Jf(null,a,m,o,v,c);var k=Zf();return a.flags|=1,typeof v=="object"&&v!==null&&typeof v.render=="function"&&v.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,Gn(m)?(k=!0,zu(a)):k=!1,a.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,$f(a),v.updater=sc,a.stateNode=v,v._reactInternals=a,oh(a,m,o,c),a=uh(null,a,m,!0,k,c)):(a.tag=0,Jt&&k&&Rf(a),zn(null,a,v,c),a=a.child),a;case 16:m=a.elementType;e:{switch(ac(o,a),o=a.pendingProps,v=m._init,m=v(m._payload),a.type=m,v=a.tag=Qw(m),o=Rr(m,o),v){case 0:a=lh(null,a,m,o,c);break e;case 1:a=cg(null,a,m,o,c);break e;case 11:a=og(null,a,m,o,c);break e;case 14:a=ag(null,a,m,Rr(m.type,o),c);break e}throw Error(n(306,m,""))}return a;case 0:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:Rr(m,v),lh(o,a,m,v,c);case 1:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:Rr(m,v),cg(o,a,m,v,c);case 3:e:{if(dg(a),o===null)throw Error(n(387));m=a.pendingProps,k=a.memoizedState,v=k.element,Cy(o,a),Xu(a,m,null,c);var L=a.memoizedState;if(m=L.element,k.isDehydrated)if(k={element:m,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},a.updateQueue.baseState=k,a.memoizedState=k,a.flags&256){v=Ua(Error(n(423)),a),a=fg(o,a,m,c,v);break e}else if(m!==v){v=Ua(Error(n(424)),a),a=fg(o,a,m,c,v);break e}else for(ur=Ys(a.stateNode.containerInfo.firstChild),lr=a,Jt=!0,Lr=null,c=ky(a,null,m,c),a.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Pa(),m===v){a=vs(o,a,c);break e}zn(o,a,m,c)}a=a.child}return a;case 5:return Dy(a),o===null&&Ff(a),m=a.type,v=a.pendingProps,k=o!==null?o.memoizedProps:null,L=v.children,Df(m,v)?L=null:k!==null&&Df(m,k)&&(a.flags|=32),ug(o,a),zn(o,a,L,c),a.child;case 6:return o===null&&Ff(a),null;case 13:return hg(o,a,c);case 4:return qf(a,a.stateNode.containerInfo),m=a.pendingProps,o===null?a.child=ja(a,null,m,c):zn(o,a,m,c),a.child;case 11:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:Rr(m,v),og(o,a,m,v,c);case 7:return zn(o,a,a.pendingProps,c),a.child;case 8:return zn(o,a,a.pendingProps.children,c),a.child;case 12:return zn(o,a,a.pendingProps.children,c),a.child;case 10:e:{if(m=a.type._context,v=a.pendingProps,k=a.memoizedProps,L=v.value,$t(Qu,m._currentValue),m._currentValue=L,k!==null)if(Mr(k.value,L)){if(k.children===v.children&&!Qn.current){a=vs(o,a,c);break e}}else for(k=a.child,k!==null&&(k.return=a);k!==null;){var q=k.dependencies;if(q!==null){L=k.child;for(var X=q.firstContext;X!==null;){if(X.context===m){if(k.tag===1){X=bs(-1,c&-c),X.tag=2;var he=k.updateQueue;if(he!==null){he=he.shared;var Se=he.pending;Se===null?X.next=X:(X.next=Se.next,Se.next=X),he.pending=X}}k.lanes|=c,X=k.alternate,X!==null&&(X.lanes|=c),Wf(k.return,c,a),q.lanes|=c;break}X=X.next}}else if(k.tag===10)L=k.type===a.type?null:k.child;else if(k.tag===18){if(L=k.return,L===null)throw Error(n(341));L.lanes|=c,q=L.alternate,q!==null&&(q.lanes|=c),Wf(L,c,a),L=k.sibling}else L=k.child;if(L!==null)L.return=k;else for(L=k;L!==null;){if(L===a){L=null;break}if(k=L.sibling,k!==null){k.return=L.return,L=k;break}L=L.return}k=L}zn(o,a,v.children,c),a=a.child}return a;case 9:return v=a.type,m=a.pendingProps.children,Ba(a,c),v=vr(v),m=m(v),a.flags|=1,zn(o,a,m,c),a.child;case 14:return m=a.type,v=Rr(m,a.pendingProps),v=Rr(m.type,v),ag(o,a,m,v,c);case 15:return ig(o,a,a.type,a.pendingProps,c);case 17:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:Rr(m,v),ac(o,a),a.tag=1,Gn(m)?(o=!0,zu(a)):o=!1,Ba(a,c),Jy(a,m,v),oh(a,m,v,c),uh(null,a,m,!0,o,c);case 19:return pg(o,a,c);case 22:return lg(o,a,c)}throw Error(n(156,a.tag))};function Bg(o,a){return Do(o,a)}function Vw(o,a,c,m){this.tag=o,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wr(o,a,c,m){return new Vw(o,a,c,m)}function Dh(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Qw(o){if(typeof o=="function")return Dh(o)?1:0;if(o!=null){if(o=o.$$typeof,o===U)return 11;if(o===Q)return 14}return 2}function to(o,a){var c=o.alternate;return c===null?(c=wr(o.tag,a,o.key,o.mode),c.elementType=o.elementType,c.type=o.type,c.stateNode=o.stateNode,c.alternate=o,o.alternate=c):(c.pendingProps=a,c.type=o.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=o.flags&14680064,c.childLanes=o.childLanes,c.lanes=o.lanes,c.child=o.child,c.memoizedProps=o.memoizedProps,c.memoizedState=o.memoizedState,c.updateQueue=o.updateQueue,a=o.dependencies,c.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},c.sibling=o.sibling,c.index=o.index,c.ref=o.ref,c}function gc(o,a,c,m,v,k){var L=2;if(m=o,typeof o=="function")Dh(o)&&(L=1);else if(typeof o=="string")L=5;else e:switch(o){case I:return zo(c.children,v,k,a);case D:L=8,v|=8;break;case j:return o=wr(12,c,a,v|2),o.elementType=j,o.lanes=k,o;case W:return o=wr(13,c,a,v),o.elementType=W,o.lanes=k,o;case Y:return o=wr(19,c,a,v),o.elementType=Y,o.lanes=k,o;case ye:return xc(c,v,k,a);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case F:L=10;break e;case B:L=9;break e;case U:L=11;break e;case Q:L=14;break e;case re:L=16,m=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return a=wr(L,c,a,v),a.elementType=o,a.type=m,a.lanes=k,a}function zo(o,a,c,m){return o=wr(7,o,m,a),o.lanes=c,o}function xc(o,a,c,m){return o=wr(22,o,m,a),o.elementType=ye,o.lanes=c,o.stateNode={isHidden:!1},o}function Oh(o,a,c){return o=wr(6,o,null,a),o.lanes=c,o}function Ah(o,a,c){return a=wr(4,o.children!==null?o.children:[],o.key,a),a.lanes=c,a.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},a}function Gw(o,a,c,m,v){this.tag=a,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=rf(0),this.expirationTimes=rf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rf(0),this.identifierPrefix=m,this.onRecoverableError=v,this.mutableSourceEagerHydrationData=null}function Ih(o,a,c,m,v,k,L,q,X){return o=new Gw(o,a,c,q,X),a===1?(a=1,k===!0&&(a|=8)):a=0,k=wr(3,null,null,a),o.current=k,k.stateNode=o,k.memoizedState={element:m,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null},$f(k),o}function Kw(o,a,c){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:C,key:m==null?null:""+m,children:o,containerInfo:a,implementation:c}}function Hg(o){if(!o)return qs;o=o._reactInternals;e:{if(zt(o)!==o||o.tag!==1)throw Error(n(170));var a=o;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(Gn(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(n(171))}if(o.tag===1){var c=o.type;if(Gn(c))return my(o,c,a)}return a}function Ug(o,a,c,m,v,k,L,q,X){return o=Ih(c,m,!0,o,v,k,L,q,X),o.context=Hg(null),c=o.current,m=Wn(),v=Zs(c),k=bs(m,v),k.callback=a??null,Gs(c,k,v),o.current.lanes=v,ji(o,v,m),Jn(o,m),o}function bc(o,a,c,m){var v=a.current,k=Wn(),L=Zs(v);return c=Hg(c),a.context===null?a.context=c:a.pendingContext=c,a=bs(k,L),a.payload={element:o},m=m===void 0?null:m,m!==null&&(a.callback=m),o=Gs(v,a,L),o!==null&&(Fr(o,v,L,k),Ku(o,v,L)),L}function vc(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function zg(o,a){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var c=o.retryLane;o.retryLane=c!==0&&c<a?c:a}}function Mh(o,a){zg(o,a),(o=o.alternate)&&zg(o,a)}function Xw(){return null}var Wg=typeof reportError=="function"?reportError:function(o){console.error(o)};function Lh(o){this._internalRoot=o}Ec.prototype.render=Lh.prototype.render=function(o){var a=this._internalRoot;if(a===null)throw Error(n(409));bc(o,a,null,null)},Ec.prototype.unmount=Lh.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var a=o.containerInfo;Bo(function(){bc(null,o,null,null)}),a[ms]=null}};function Ec(o){this._internalRoot=o}Ec.prototype.unstable_scheduleHydration=function(o){if(o){var a=Cp();o={blockedOn:null,target:o,priority:a};for(var c=0;c<Us.length&&a!==0&&a<Us[c].priority;c++);Us.splice(c,0,o),c===0&&Dp(o)}};function Rh(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function Tc(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function Yg(){}function Jw(o,a,c,m,v){if(v){if(typeof m=="function"){var k=m;m=function(){var he=vc(L);k.call(he)}}var L=Ug(a,m,o,0,null,!1,!1,"",Yg);return o._reactRootContainer=L,o[ms]=L.current,Xi(o.nodeType===8?o.parentNode:o),Bo(),L}for(;v=o.lastChild;)o.removeChild(v);if(typeof m=="function"){var q=m;m=function(){var he=vc(X);q.call(he)}}var X=Ih(o,0,!1,null,null,!1,!1,"",Yg);return o._reactRootContainer=X,o[ms]=X.current,Xi(o.nodeType===8?o.parentNode:o),Bo(function(){bc(a,X,c,m)}),X}function wc(o,a,c,m,v){var k=c._reactRootContainer;if(k){var L=k;if(typeof v=="function"){var q=v;v=function(){var X=vc(L);q.call(X)}}bc(a,L,o,v)}else L=Jw(c,a,o,v,m);return vc(L)}kp=function(o){switch(o.tag){case 3:var a=o.stateNode;if(a.current.memoizedState.isDehydrated){var c=Pi(a.pendingLanes);c!==0&&(sf(a,c|1),Jn(a,Yt()),(_t&6)===0&&(Ya=Yt()+500,Vs()))}break;case 13:Bo(function(){var m=xs(o,1);if(m!==null){var v=Wn();Fr(m,o,1,v)}}),Mh(o,1)}},of=function(o){if(o.tag===13){var a=xs(o,134217728);if(a!==null){var c=Wn();Fr(a,o,134217728,c)}Mh(o,134217728)}},Sp=function(o){if(o.tag===13){var a=Zs(o),c=xs(o,a);if(c!==null){var m=Wn();Fr(c,o,a,m)}Mh(o,a)}},Cp=function(){return Ft},Np=function(o,a){var c=Ft;try{return Ft=o,a()}finally{Ft=c}},$e=function(o,a,c){switch(a){case"input":if(rt(o,c),a=c.name,c.type==="radio"&&a!=null){for(c=o;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),a=0;a<c.length;a++){var m=c[a];if(m!==o&&m.form===o.form){var v=Hu(m);if(!v)throw Error(n(90));je(m),rt(m,v)}}}break;case"textarea":kt(o,c);break;case"select":a=c.value,a!=null&&Ae(o,!!c.multiple,a,!1)}},Kt=Ch,on=Bo;var Zw={usingClientEntryPoint:!1,Events:[el,Aa,Hu,gt,Ge,Ch]},ml={findFiberByHostInstance:Ao,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ek={bundleType:ml.bundleType,version:ml.version,rendererPackageName:ml.rendererPackageName,rendererConfig:ml.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=gr(o),o===null?null:o.stateNode},findFiberByHostInstance:ml.findFiberByHostInstance||Xw,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 kc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kc.isDisabled&&kc.supportsFiber)try{Eu=kc.inject(ek),Qr=kc}catch{}}return Zn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Zw,Zn.createPortal=function(o,a){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Rh(a))throw Error(n(200));return Kw(o,a,null,c)},Zn.createRoot=function(o,a){if(!Rh(o))throw Error(n(299));var c=!1,m="",v=Wg;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onRecoverableError!==void 0&&(v=a.onRecoverableError)),a=Ih(o,1,!1,null,null,c,!1,m,v),o[ms]=a.current,Xi(o.nodeType===8?o.parentNode:o),new Lh(a)},Zn.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var a=o._reactInternals;if(a===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=gr(a),o=o===null?null:o.stateNode,o},Zn.flushSync=function(o){return Bo(o)},Zn.hydrate=function(o,a,c){if(!Tc(a))throw Error(n(200));return wc(null,o,a,!0,c)},Zn.hydrateRoot=function(o,a,c){if(!Rh(o))throw Error(n(405));var m=c!=null&&c.hydratedSources||null,v=!1,k="",L=Wg;if(c!=null&&(c.unstable_strictMode===!0&&(v=!0),c.identifierPrefix!==void 0&&(k=c.identifierPrefix),c.onRecoverableError!==void 0&&(L=c.onRecoverableError)),a=Ug(a,null,o,1,c??null,v,!1,k,L),o[ms]=a.current,Xi(o),m)for(o=0;o<m.length;o++)c=m[o],v=c._getVersion,v=v(c._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[c,v]:a.mutableSourceEagerHydrationData.push(c,v);return new Ec(a)},Zn.render=function(o,a,c){if(!Tc(a))throw Error(n(200));return wc(null,o,a,!1,c)},Zn.unmountComponentAtNode=function(o){if(!Tc(o))throw Error(n(40));return o._reactRootContainer?(Bo(function(){wc(null,null,o,!1,function(){o._reactRootContainer=null,o[ms]=null})}),!0):!1},Zn.unstable_batchedUpdates=Ch,Zn.unstable_renderSubtreeIntoContainer=function(o,a,c,m){if(!Tc(c))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return wc(o,a,c,!1,m)},Zn.version="18.3.1-next-f1338f8080-20240426",Zn}var Xg;function pd(){if(Xg)return Fh.exports;Xg=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(),Fh.exports=uk(),Fh.exports}var Jg;function ck(){if(Jg)return Cc;Jg=1;var e=pd();return Cc.createRoot=e.createRoot,Cc.hydrateRoot=e.hydrateRoot,Cc}var dk=ck(),pa=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(){}},fk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},co,mm,bb,hk=(bb=class{constructor(){Ve(this,co,fk);Ve(this,mm,!1)}setTimeoutProvider(e){Me(this,co,e)}setTimeout(e,t){return $(this,co).setTimeout(e,t)}clearTimeout(e){$(this,co).clearTimeout(e)}setInterval(e,t){return $(this,co).setInterval(e,t)}clearInterval(e){$(this,co).clearInterval(e)}},co=new WeakMap,mm=new WeakMap,bb),qo=new hk;function mk(e){setTimeout(e,0)}var ia=typeof window>"u"||"Deno"in globalThis;function Fn(){}function pk(e,t){return typeof e=="function"?e(t):e}function w0(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ib(e,t){return Math.max(e+(t||0)-Date.now(),0)}function wo(e,t){return typeof e=="function"?e(t):e}function _r(e,t){return typeof e=="function"?e(t):e}function Zg(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:l,stale:u}=e;if(l){if(r){if(t.queryHash!==pm(l,t.options))return!1}else if(!Gl(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||s&&s!==t.state.fetchStatus||i&&!i(t))}function e1(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(la(t.options.mutationKey)!==la(i))return!1}else if(!Gl(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function pm(e,t){return((t==null?void 0:t.queryKeyHashFn)||la)(e)}function la(e){return JSON.stringify(e,(t,n)=>k0(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Gl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Gl(e[n],t[n])):!1}var yk=Object.prototype.hasOwnProperty;function ym(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t1(e)&&t1(t);if(!r&&!(k0(e)&&k0(t)))return t;const i=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),u=l.length,f=r?new Array(u):{};let h=0;for(let p=0;p<u;p++){const y=r?p:l[p],g=e[y],b=t[y];if(g===b){f[y]=g,(r?p<i:yk.call(e,y))&&h++;continue}if(g===null||b===null||typeof g!="object"||typeof b!="object"){f[y]=b;continue}const O=ym(g,b,n+1);f[y]=O,O===g&&h++}return i===u&&h===i?e:f}function Kl(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 k0(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 gk(e){return new Promise(t=>{qo.setTimeout(t,e)})}function S0(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?ym(e,t):t}function xk(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function bk(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var gm=Symbol();function Mb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===gm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function xm(e,t){return typeof e=="function"?e(...t):!!e}function vk(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var Ko,fo,ni,vb,Ek=(vb=class extends pa{constructor(){super();Ve(this,Ko);Ve(this,fo);Ve(this,ni);Me(this,ni,t=>{if(!ia&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){$(this,fo)||this.setEventListener($(this,ni))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,fo))==null||t.call(this),Me(this,fo,void 0))}setEventListener(t){var n;Me(this,ni,t),(n=$(this,fo))==null||n.call(this),Me(this,fo,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){$(this,Ko)!==t&&(Me(this,Ko,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof $(this,Ko)=="boolean"?$(this,Ko):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ko=new WeakMap,fo=new WeakMap,ni=new WeakMap,vb),bm=new Ek;function C0(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var Tk=mk;function wk(){let e=[],t=0,n=u=>{u()},r=u=>{u()},s=Tk;const i=u=>{t?e.push(u):s(()=>{n(u)})},l=()=>{const u=e;e=[],u.length&&s(()=>{r(()=>{u.forEach(f=>{n(f)})})})};return{batch:u=>{let f;t++;try{f=u()}finally{t--,t||l()}return f},batchCalls:u=>(...f)=>{i(()=>{u(...f)})},schedule:i,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{s=u}}}var rn=wk(),ri,ho,si,Eb,kk=(Eb=class extends pa{constructor(){super();Ve(this,ri,!0);Ve(this,ho);Ve(this,si);Me(this,si,t=>{if(!ia&&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(){$(this,ho)||this.setEventListener($(this,si))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,ho))==null||t.call(this),Me(this,ho,void 0))}setEventListener(t){var n;Me(this,si,t),(n=$(this,ho))==null||n.call(this),Me(this,ho,t(this.setOnline.bind(this)))}setOnline(t){$(this,ri)!==t&&(Me(this,ri,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return $(this,ri)}},ri=new WeakMap,ho=new WeakMap,si=new WeakMap,Eb),Qc=new kk;function Sk(e){return Math.min(1e3*2**e,3e4)}function Lb(e){return(e??"online")==="online"?Qc.isOnline():!0}var N0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Rb(e){let t=!1,n=0,r;const s=C0(),i=()=>s.status!=="pending",l=w=>{var T;if(!i()){const E=new N0(w);g(E),(T=e.onCancel)==null||T.call(e,E)}},u=()=>{t=!0},f=()=>{t=!1},h=()=>bm.isFocused()&&(e.networkMode==="always"||Qc.isOnline())&&e.canRun(),p=()=>Lb(e.networkMode)&&e.canRun(),y=w=>{i()||(r==null||r(),s.resolve(w))},g=w=>{i()||(r==null||r(),s.reject(w))},b=()=>new Promise(w=>{var T;r=E=>{(i()||h())&&w(E)},(T=e.onPause)==null||T.call(e)}).then(()=>{var w;r=void 0,i()||(w=e.onContinue)==null||w.call(e)}),O=()=>{if(i())return;let w;const T=n===0?e.initialPromise:void 0;try{w=T??e.fn()}catch(E){w=Promise.reject(E)}Promise.resolve(w).then(y).catch(E=>{var C;if(i())return;const _=e.retry??(ia?0:3),S=e.retryDelay??Sk,A=typeof S=="function"?S(n,E):S,M=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,E);if(t||!M){g(E);return}n++,(C=e.onFail)==null||C.call(e,n,E),gk(A).then(()=>h()?void 0:b()).then(()=>{t?g(E):O()})})};return{promise:s,status:()=>s.status,cancel:l,continue:()=>(r==null||r(),s),cancelRetry:u,continueRetry:f,canStart:p,start:()=>(p()?O():b().then(O),s)}}var Xo,Tb,Pb=(Tb=class{constructor(){Ve(this,Xo)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),w0(this.gcTime)&&Me(this,Xo,qo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ia?1/0:300*1e3))}clearGcTimeout(){$(this,Xo)&&(qo.clearTimeout($(this,Xo)),Me(this,Xo,void 0))}},Xo=new WeakMap,Tb),Jo,oi,Sr,Zo,Nn,tu,ea,Ur,ws,wb,Ck=(wb=class extends Pb{constructor(t){super();Ve(this,Ur);Ve(this,Jo);Ve(this,oi);Ve(this,Sr);Ve(this,Zo);Ve(this,Nn);Ve(this,tu);Ve(this,ea);Me(this,ea,!1),Me(this,tu,t.defaultOptions),this.setOptions(t.options),this.observers=[],Me(this,Zo,t.client),Me(this,Sr,$(this,Zo).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Me(this,Jo,s1(this.options)),this.state=t.state??$(this,Jo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=$(this,Nn))==null?void 0:t.promise}setOptions(t){if(this.options={...$(this,tu),...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)),Me(this,Jo,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&$(this,Sr).remove(this)}setData(t,n){const r=S0(this.state.data,t,this.options);return dt(this,Ur,ws).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){dt(this,Ur,ws).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=$(this,Nn))==null?void 0:r.promise;return(s=$(this,Nn))==null||s.cancel(t),n?n.then(Fn).catch(Fn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState($(this,Jo))}isActive(){return this.observers.some(t=>_r(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===gm||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>wo(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:!Ib(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=$(this,Nn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=$(this,Nn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),$(this,Sr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||($(this,Nn)&&($(this,ea)?$(this,Nn).cancel({revert:!0}):$(this,Nn).cancelRetry()),this.scheduleGc()),$(this,Sr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||dt(this,Ur,ws).call(this,{type:"invalidate"})}async fetch(t,n){var f,h,p,y,g,b,O,w,T,E,_,S;if(this.state.fetchStatus!=="idle"&&((f=$(this,Nn))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if($(this,Nn))return $(this,Nn).continueRetry(),$(this,Nn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const A=this.observers.find(M=>M.options.queryFn);A&&this.setOptions(A.options)}const r=new AbortController,s=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(Me(this,ea,!0),r.signal)})},i=()=>{const A=Mb(this.options,n),C=(()=>{const I={client:$(this,Zo),queryKey:this.queryKey,meta:this.meta};return s(I),I})();return Me(this,ea,!1),this.options.persister?this.options.persister(A,C,this):A(C)},u=(()=>{const A={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:$(this,Zo),state:this.state,fetchFn:i};return s(A),A})();(h=this.options.behavior)==null||h.onFetch(u,this),Me(this,oi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=u.fetchOptions)==null?void 0:p.meta))&&dt(this,Ur,ws).call(this,{type:"fetch",meta:(y=u.fetchOptions)==null?void 0:y.meta}),Me(this,Nn,Rb({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:A=>{A instanceof N0&&A.revert&&this.setState({...$(this,oi),fetchStatus:"idle"}),r.abort()},onFail:(A,M)=>{dt(this,Ur,ws).call(this,{type:"failed",failureCount:A,error:M})},onPause:()=>{dt(this,Ur,ws).call(this,{type:"pause"})},onContinue:()=>{dt(this,Ur,ws).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const A=await $(this,Nn).start();if(A===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(A),(b=(g=$(this,Sr).config).onSuccess)==null||b.call(g,A,this),(w=(O=$(this,Sr).config).onSettled)==null||w.call(O,A,this.state.error,this),A}catch(A){if(A instanceof N0){if(A.silent)return $(this,Nn).promise;if(A.revert){if(this.state.data===void 0)throw A;return this.state.data}}throw dt(this,Ur,ws).call(this,{type:"error",error:A}),(E=(T=$(this,Sr).config).onError)==null||E.call(T,A,this),(S=(_=$(this,Sr).config).onSettled)==null||S.call(_,this.state.data,A,this),A}finally{this.scheduleGc()}}},Jo=new WeakMap,oi=new WeakMap,Sr=new WeakMap,Zo=new WeakMap,Nn=new WeakMap,tu=new WeakMap,ea=new WeakMap,Ur=new WeakSet,ws=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,...jb(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...r1(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Me(this,oi,t.manual?s:void 0),s;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),rn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),$(this,Sr).notify({query:this,type:"updated",action:t})})},wb);function jb(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Lb(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 nr,Nt,nu,Yn,ta,ai,Cs,mo,ru,ii,li,na,ra,po,ui,Rt,Pl,_0,D0,O0,A0,I0,M0,L0,Fb,kb,vm=(kb=class extends pa{constructor(t,n){super();Ve(this,Rt);Ve(this,nr);Ve(this,Nt);Ve(this,nu);Ve(this,Yn);Ve(this,ta);Ve(this,ai);Ve(this,Cs);Ve(this,mo);Ve(this,ru);Ve(this,ii);Ve(this,li);Ve(this,na);Ve(this,ra);Ve(this,po);Ve(this,ui,new Set);this.options=n,Me(this,nr,t),Me(this,mo,null),Me(this,Cs,C0()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&($(this,Nt).addObserver(this),o1($(this,Nt),this.options)?dt(this,Rt,Pl).call(this):this.updateResult(),dt(this,Rt,A0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return R0($(this,Nt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return R0($(this,Nt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,dt(this,Rt,I0).call(this),dt(this,Rt,M0).call(this),$(this,Nt).removeObserver(this)}setOptions(t){const n=this.options,r=$(this,Nt);if(this.options=$(this,nr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof _r(this.options.enabled,$(this,Nt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");dt(this,Rt,L0).call(this),$(this,Nt).setOptions(this.options),n._defaulted&&!Kl(this.options,n)&&$(this,nr).getQueryCache().notify({type:"observerOptionsUpdated",query:$(this,Nt),observer:this});const s=this.hasListeners();s&&a1($(this,Nt),r,this.options,n)&&dt(this,Rt,Pl).call(this),this.updateResult(),s&&($(this,Nt)!==r||_r(this.options.enabled,$(this,Nt))!==_r(n.enabled,$(this,Nt))||wo(this.options.staleTime,$(this,Nt))!==wo(n.staleTime,$(this,Nt)))&&dt(this,Rt,_0).call(this);const i=dt(this,Rt,D0).call(this);s&&($(this,Nt)!==r||_r(this.options.enabled,$(this,Nt))!==_r(n.enabled,$(this,Nt))||i!==$(this,po))&&dt(this,Rt,O0).call(this,i)}getOptimisticResult(t){const n=$(this,nr).getQueryCache().build($(this,nr),t),r=this.createResult(n,t);return _k(this,r)&&(Me(this,Yn,r),Me(this,ai,this.options),Me(this,ta,$(this,Nt).state)),r}getCurrentResult(){return $(this,Yn)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&$(this,Cs).status==="pending"&&$(this,Cs).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){$(this,ui).add(t)}getCurrentQuery(){return $(this,Nt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=$(this,nr).defaultQueryOptions(t),r=$(this,nr).getQueryCache().build($(this,nr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return dt(this,Rt,Pl).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),$(this,Yn)))}createResult(t,n){var j;const r=$(this,Nt),s=this.options,i=$(this,Yn),l=$(this,ta),u=$(this,ai),h=t!==r?t.state:$(this,nu),{state:p}=t;let y={...p},g=!1,b;if(n._optimisticResults){const F=this.hasListeners(),B=!F&&o1(t,n),U=F&&a1(t,r,n,s);(B||U)&&(y={...y,...jb(p.data,t.options)}),n._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:O,errorUpdatedAt:w,status:T}=y;b=y.data;let E=!1;if(n.placeholderData!==void 0&&b===void 0&&T==="pending"){let F;i!=null&&i.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(F=i.data,E=!0):F=typeof n.placeholderData=="function"?n.placeholderData((j=$(this,li))==null?void 0:j.state.data,$(this,li)):n.placeholderData,F!==void 0&&(T="success",b=S0(i==null?void 0:i.data,F,n),g=!0)}if(n.select&&b!==void 0&&!E)if(i&&b===(l==null?void 0:l.data)&&n.select===$(this,ru))b=$(this,ii);else try{Me(this,ru,n.select),b=n.select(b),b=S0(i==null?void 0:i.data,b,n),Me(this,ii,b),Me(this,mo,null)}catch(F){Me(this,mo,F)}$(this,mo)&&(O=$(this,mo),b=$(this,ii),w=Date.now(),T="error");const _=y.fetchStatus==="fetching",S=T==="pending",A=T==="error",M=S&&_,C=b!==void 0,D={status:T,fetchStatus:y.fetchStatus,isPending:S,isSuccess:T==="success",isError:A,isInitialLoading:M,isLoading:M,data:b,dataUpdatedAt:y.dataUpdatedAt,error:O,errorUpdatedAt:w,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>h.dataUpdateCount||y.errorUpdateCount>h.errorUpdateCount,isFetching:_,isRefetching:_&&!S,isLoadingError:A&&!C,isPaused:y.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:A&&C,isStale:Em(t,n),refetch:this.refetch,promise:$(this,Cs),isEnabled:_r(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=D.data!==void 0,B=D.status==="error"&&!F,U=Q=>{B?Q.reject(D.error):F&&Q.resolve(D.data)},W=()=>{const Q=Me(this,Cs,D.promise=C0());U(Q)},Y=$(this,Cs);switch(Y.status){case"pending":t.queryHash===r.queryHash&&U(Y);break;case"fulfilled":(B||D.data!==Y.value)&&W();break;case"rejected":(!B||D.error!==Y.reason)&&W();break}}return D}updateResult(){const t=$(this,Yn),n=this.createResult($(this,Nt),this.options);if(Me(this,ta,$(this,Nt).state),Me(this,ai,this.options),$(this,ta).data!==void 0&&Me(this,li,$(this,Nt)),Kl(n,t))return;Me(this,Yn,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!$(this,ui).size)return!0;const l=new Set(i??$(this,ui));return this.options.throwOnError&&l.add("error"),Object.keys($(this,Yn)).some(u=>{const f=u;return $(this,Yn)[f]!==t[f]&&l.has(f)})};dt(this,Rt,Fb).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&dt(this,Rt,A0).call(this)}},nr=new WeakMap,Nt=new WeakMap,nu=new WeakMap,Yn=new WeakMap,ta=new WeakMap,ai=new WeakMap,Cs=new WeakMap,mo=new WeakMap,ru=new WeakMap,ii=new WeakMap,li=new WeakMap,na=new WeakMap,ra=new WeakMap,po=new WeakMap,ui=new WeakMap,Rt=new WeakSet,Pl=function(t){dt(this,Rt,L0).call(this);let n=$(this,Nt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Fn)),n},_0=function(){dt(this,Rt,I0).call(this);const t=wo(this.options.staleTime,$(this,Nt));if(ia||$(this,Yn).isStale||!w0(t))return;const r=Ib($(this,Yn).dataUpdatedAt,t)+1;Me(this,na,qo.setTimeout(()=>{$(this,Yn).isStale||this.updateResult()},r))},D0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval($(this,Nt)):this.options.refetchInterval)??!1},O0=function(t){dt(this,Rt,M0).call(this),Me(this,po,t),!(ia||_r(this.options.enabled,$(this,Nt))===!1||!w0($(this,po))||$(this,po)===0)&&Me(this,ra,qo.setInterval(()=>{(this.options.refetchIntervalInBackground||bm.isFocused())&&dt(this,Rt,Pl).call(this)},$(this,po)))},A0=function(){dt(this,Rt,_0).call(this),dt(this,Rt,O0).call(this,dt(this,Rt,D0).call(this))},I0=function(){$(this,na)&&(qo.clearTimeout($(this,na)),Me(this,na,void 0))},M0=function(){$(this,ra)&&(qo.clearInterval($(this,ra)),Me(this,ra,void 0))},L0=function(){const t=$(this,nr).getQueryCache().build($(this,nr),this.options);if(t===$(this,Nt))return;const n=$(this,Nt);Me(this,Nt,t),Me(this,nu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Fb=function(t){rn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n($(this,Yn))}),$(this,nr).getQueryCache().notify({query:$(this,Nt),type:"observerResultsUpdated"})})},kb);function Nk(e,t){return _r(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function o1(e,t){return Nk(e,t)||e.state.data!==void 0&&R0(e,t,t.refetchOnMount)}function R0(e,t,n){if(_r(t.enabled,e)!==!1&&wo(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Em(e,t)}return!1}function a1(e,t,n,r){return(e!==t||_r(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Em(e,n)}function Em(e,t){return _r(t.enabled,e)!==!1&&e.isStaleByTime(wo(t.staleTime,e))}function _k(e,t){return!Kl(e.getCurrentResult(),t)}function i1(e){return{onFetch:(t,n)=>{var p,y,g,b,O;const r=t.options,s=(g=(y=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:y.fetchMore)==null?void 0:g.direction,i=((b=t.state.data)==null?void 0:b.pages)||[],l=((O=t.state.data)==null?void 0:O.pageParams)||[];let u={pages:[],pageParams:[]},f=0;const h=async()=>{let w=!1;const T=S=>{vk(S,()=>t.signal,()=>w=!0)},E=Mb(t.options,t.fetchOptions),_=async(S,A,M)=>{if(w)return Promise.reject();if(A==null&&S.pages.length)return Promise.resolve(S);const I=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:A,direction:M?"backward":"forward",meta:t.options.meta};return T(B),B})(),D=await E(I),{maxPages:j}=t.options,F=M?bk:xk;return{pages:F(S.pages,D,j),pageParams:F(S.pageParams,A,j)}};if(s&&i.length){const S=s==="backward",A=S?Dk:l1,M={pages:i,pageParams:l},C=A(r,M);u=await _(M,C,S)}else{const S=e??i.length;do{const A=f===0?l[0]??r.initialPageParam:l1(r,u);if(f>0&&A==null)break;u=await _(u,A),f++}while(f<S)}return u};t.options.persister?t.fetchFn=()=>{var w,T;return(T=(w=t.options).persister)==null?void 0:T.call(w,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function l1(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 Dk(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 su,ns,jn,sa,rs,io,Sb,Ok=(Sb=class extends Pb{constructor(t){super();Ve(this,rs);Ve(this,su);Ve(this,ns);Ve(this,jn);Ve(this,sa);Me(this,su,t.client),this.mutationId=t.mutationId,Me(this,jn,t.mutationCache),Me(this,ns,[]),this.state=t.state||Bb(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){$(this,ns).includes(t)||($(this,ns).push(t),this.clearGcTimeout(),$(this,jn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Me(this,ns,$(this,ns).filter(n=>n!==t)),this.scheduleGc(),$(this,jn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){$(this,ns).length||(this.state.status==="pending"?this.scheduleGc():$(this,jn).remove(this))}continue(){var t;return((t=$(this,sa))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,u,f,h,p,y,g,b,O,w,T,E,_,S,A,M,C,I;const n=()=>{dt(this,rs,io).call(this,{type:"continue"})},r={client:$(this,su),meta:this.options.meta,mutationKey:this.options.mutationKey};Me(this,sa,Rb({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(D,j)=>{dt(this,rs,io).call(this,{type:"failed",failureCount:D,error:j})},onPause:()=>{dt(this,rs,io).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>$(this,jn).canRun(this)}));const s=this.state.status==="pending",i=!$(this,sa).canStart();try{if(s)n();else{dt(this,rs,io).call(this,{type:"pending",variables:t,isPaused:i}),$(this,jn).config.onMutate&&await $(this,jn).config.onMutate(t,this,r);const j=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t,r));j!==this.state.context&&dt(this,rs,io).call(this,{type:"pending",context:j,variables:t,isPaused:i})}const D=await $(this,sa).start();return await((h=(f=$(this,jn).config).onSuccess)==null?void 0:h.call(f,D,t,this.state.context,this,r)),await((y=(p=this.options).onSuccess)==null?void 0:y.call(p,D,t,this.state.context,r)),await((b=(g=$(this,jn).config).onSettled)==null?void 0:b.call(g,D,null,this.state.variables,this.state.context,this,r)),await((w=(O=this.options).onSettled)==null?void 0:w.call(O,D,null,t,this.state.context,r)),dt(this,rs,io).call(this,{type:"success",data:D}),D}catch(D){try{await((E=(T=$(this,jn).config).onError)==null?void 0:E.call(T,D,t,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((S=(_=this.options).onError)==null?void 0:S.call(_,D,t,this.state.context,r))}catch(j){Promise.reject(j)}try{await((M=(A=$(this,jn).config).onSettled)==null?void 0:M.call(A,void 0,D,this.state.variables,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((I=(C=this.options).onSettled)==null?void 0:I.call(C,void 0,D,t,this.state.context,r))}catch(j){Promise.reject(j)}throw dt(this,rs,io).call(this,{type:"error",error:D}),D}finally{$(this,jn).runNext(this)}}},su=new WeakMap,ns=new WeakMap,jn=new WeakMap,sa=new WeakMap,rs=new WeakSet,io=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),rn.batch(()=>{$(this,ns).forEach(r=>{r.onMutationUpdate(t)}),$(this,jn).notify({mutation:this,type:"updated",action:t})})},Sb);function Bb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ns,zr,ou,Cb,Ak=(Cb=class extends pa{constructor(t={}){super();Ve(this,Ns);Ve(this,zr);Ve(this,ou);this.config=t,Me(this,Ns,new Set),Me(this,zr,new Map),Me(this,ou,0)}build(t,n,r){const s=new Ok({client:t,mutationCache:this,mutationId:++Sc(this,ou)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){$(this,Ns).add(t);const n=Nc(t);if(typeof n=="string"){const r=$(this,zr).get(n);r?r.push(t):$(this,zr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if($(this,Ns).delete(t)){const n=Nc(t);if(typeof n=="string"){const r=$(this,zr).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&$(this,zr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Nc(t);if(typeof n=="string"){const r=$(this,zr).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=Nc(t);if(typeof n=="string"){const s=(r=$(this,zr).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){rn.batch(()=>{$(this,Ns).forEach(t=>{this.notify({type:"removed",mutation:t})}),$(this,Ns).clear(),$(this,zr).clear()})}getAll(){return Array.from($(this,Ns))}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){rn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return rn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Fn))))}},Ns=new WeakMap,zr=new WeakMap,ou=new WeakMap,Cb);function Nc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var _s,yo,rr,Ds,Ms,Wc,P0,Nb,Ik=(Nb=class extends pa{constructor(n,r){super();Ve(this,Ms);Ve(this,_s);Ve(this,yo);Ve(this,rr);Ve(this,Ds);Me(this,_s,n),this.setOptions(r),this.bindMethods(),dt(this,Ms,Wc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=$(this,_s).defaultMutationOptions(n),Kl(this.options,r)||$(this,_s).getMutationCache().notify({type:"observerOptionsUpdated",mutation:$(this,rr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&la(r.mutationKey)!==la(this.options.mutationKey)?this.reset():((s=$(this,rr))==null?void 0:s.state.status)==="pending"&&$(this,rr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=$(this,rr))==null||n.removeObserver(this)}onMutationUpdate(n){dt(this,Ms,Wc).call(this),dt(this,Ms,P0).call(this,n)}getCurrentResult(){return $(this,yo)}reset(){var n;(n=$(this,rr))==null||n.removeObserver(this),Me(this,rr,void 0),dt(this,Ms,Wc).call(this),dt(this,Ms,P0).call(this)}mutate(n,r){var s;return Me(this,Ds,r),(s=$(this,rr))==null||s.removeObserver(this),Me(this,rr,$(this,_s).getMutationCache().build($(this,_s),this.options)),$(this,rr).addObserver(this),$(this,rr).execute(n)}},_s=new WeakMap,yo=new WeakMap,rr=new WeakMap,Ds=new WeakMap,Ms=new WeakSet,Wc=function(){var r;const n=((r=$(this,rr))==null?void 0:r.state)??Bb();Me(this,yo,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},P0=function(n){rn.batch(()=>{var r,s,i,l,u,f,h,p;if($(this,Ds)&&this.hasListeners()){const y=$(this,yo).variables,g=$(this,yo).context,b={client:$(this,_s),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=$(this,Ds)).onSuccess)==null||s.call(r,n.data,y,g,b)}catch(O){Promise.reject(O)}try{(l=(i=$(this,Ds)).onSettled)==null||l.call(i,n.data,null,y,g,b)}catch(O){Promise.reject(O)}}else if((n==null?void 0:n.type)==="error"){try{(f=(u=$(this,Ds)).onError)==null||f.call(u,n.error,y,g,b)}catch(O){Promise.reject(O)}try{(p=(h=$(this,Ds)).onSettled)==null||p.call(h,void 0,n.error,y,g,b)}catch(O){Promise.reject(O)}}}this.listeners.forEach(y=>{y($(this,yo))})})},Nb);function u1(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function Mk(e,t,n){const r=e.slice(0);return r[t]=n,r}var ci,fr,di,fi,Cr,go,au,iu,lu,uu,An,j0,F0,B0,H0,U0,_b,Lk=(_b=class extends pa{constructor(t,n,r){super();Ve(this,An);Ve(this,ci);Ve(this,fr);Ve(this,di);Ve(this,fi);Ve(this,Cr);Ve(this,go);Ve(this,au);Ve(this,iu);Ve(this,lu);Ve(this,uu,[]);Me(this,ci,t),Me(this,fi,r),Me(this,di,[]),Me(this,Cr,[]),Me(this,fr,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&$(this,Cr).forEach(t=>{t.subscribe(n=>{dt(this,An,H0).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,$(this,Cr).forEach(t=>{t.destroy()})}setQueries(t,n){Me(this,di,t),Me(this,fi,n),rn.batch(()=>{const r=$(this,Cr),s=dt(this,An,B0).call(this,$(this,di));s.forEach(y=>y.observer.setOptions(y.defaultedQueryOptions));const i=s.map(y=>y.observer),l=i.map(y=>y.getCurrentResult()),u=r.length!==i.length,f=i.some((y,g)=>y!==r[g]),h=u||f,p=h?!0:l.some((y,g)=>{const b=$(this,fr)[g];return!b||!Kl(y,b)});!h&&!p||(h&&(Me(this,uu,s),Me(this,Cr,i)),Me(this,fr,l),this.hasListeners()&&(h&&(u1(r,i).forEach(y=>{y.destroy()}),u1(i,r).forEach(y=>{y.subscribe(g=>{dt(this,An,H0).call(this,y,g)})})),dt(this,An,U0).call(this)))})}getCurrentResult(){return $(this,fr)}getQueries(){return $(this,Cr).map(t=>t.getCurrentQuery())}getObservers(){return $(this,Cr)}getOptimisticResult(t,n){const r=dt(this,An,B0).call(this,t),s=r.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),i=r.map(l=>l.defaultedQueryOptions.queryHash);return[s,l=>dt(this,An,F0).call(this,l??s,n,i),()=>dt(this,An,j0).call(this,s,r)]}},ci=new WeakMap,fr=new WeakMap,di=new WeakMap,fi=new WeakMap,Cr=new WeakMap,go=new WeakMap,au=new WeakMap,iu=new WeakMap,lu=new WeakMap,uu=new WeakMap,An=new WeakSet,j0=function(t,n){return n.map((r,s)=>{const i=t[s];return r.defaultedQueryOptions.notifyOnChangeProps?i:r.observer.trackResult(i,l=>{n.forEach(u=>{u.observer.trackProp(l)})})})},F0=function(t,n,r){if(n){const s=$(this,lu),i=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((l,u)=>l!==s[u]));return(!$(this,go)||$(this,fr)!==$(this,iu)||i||n!==$(this,au))&&(Me(this,au,n),Me(this,iu,$(this,fr)),r!==void 0&&Me(this,lu,r),Me(this,go,ym($(this,go),n(t)))),$(this,go)}return t},B0=function(t){const n=new Map;$(this,Cr).forEach(s=>{const i=s.options.queryHash;if(!i)return;const l=n.get(i);l?l.push(s):n.set(i,[s])});const r=[];return t.forEach(s=>{var f;const i=$(this,ci).defaultQueryOptions(s),u=((f=n.get(i.queryHash))==null?void 0:f.shift())??new vm($(this,ci),i);r.push({defaultedQueryOptions:i,observer:u})}),r},H0=function(t,n){const r=$(this,Cr).indexOf(t);r!==-1&&(Me(this,fr,Mk($(this,fr),r,n)),dt(this,An,U0).call(this))},U0=function(){var t;if(this.hasListeners()){const n=$(this,go),r=dt(this,An,j0).call(this,$(this,fr),$(this,uu)),s=dt(this,An,F0).call(this,r,(t=$(this,fi))==null?void 0:t.combine);n!==s&&rn.batch(()=>{this.listeners.forEach(i=>{i($(this,fr))})})}},_b),ss,Db,Rk=(Db=class extends pa{constructor(t={}){super();Ve(this,ss);this.config=t,Me(this,ss,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??pm(s,n);let l=this.get(i);return l||(l=new Ck({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){$(this,ss).has(t.queryHash)||($(this,ss).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=$(this,ss).get(t.queryHash);n&&(t.destroy(),n===t&&$(this,ss).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){rn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return $(this,ss).get(t)}getAll(){return[...$(this,ss).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){rn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){rn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){rn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ss=new WeakMap,Db),cn,xo,bo,hi,mi,vo,pi,yi,Ob,Pk=(Ob=class{constructor(e={}){Ve(this,cn);Ve(this,xo);Ve(this,bo);Ve(this,hi);Ve(this,mi);Ve(this,vo);Ve(this,pi);Ve(this,yi);Me(this,cn,e.queryCache||new Rk),Me(this,xo,e.mutationCache||new Ak),Me(this,bo,e.defaultOptions||{}),Me(this,hi,new Map),Me(this,mi,new Map),Me(this,vo,0)}mount(){Sc(this,vo)._++,$(this,vo)===1&&(Me(this,pi,bm.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,cn).onFocus())})),Me(this,yi,Qc.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,cn).onOnline())})))}unmount(){var e,t;Sc(this,vo)._--,$(this,vo)===0&&((e=$(this,pi))==null||e.call(this),Me(this,pi,void 0),(t=$(this,yi))==null||t.call(this),Me(this,yi,void 0))}isFetching(e){return $(this,cn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return $(this,xo).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=$(this,cn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=$(this,cn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(wo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return $(this,cn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=$(this,cn).get(r.queryHash),i=s==null?void 0:s.state.data,l=pk(t,i);if(l!==void 0)return $(this,cn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return rn.batch(()=>$(this,cn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=$(this,cn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=$(this,cn);rn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=$(this,cn);return rn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=rn.batch(()=>$(this,cn).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Fn).catch(Fn)}invalidateQueries(e,t={}){return rn.batch(()=>($(this,cn).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=rn.batch(()=>$(this,cn).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Fn)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Fn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=$(this,cn).build(this,t);return n.isStaleByTime(wo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Fn).catch(Fn)}fetchInfiniteQuery(e){return e.behavior=i1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Fn).catch(Fn)}ensureInfiniteQueryData(e){return e.behavior=i1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Qc.isOnline()?$(this,xo).resumePausedMutations():Promise.resolve()}getQueryCache(){return $(this,cn)}getMutationCache(){return $(this,xo)}getDefaultOptions(){return $(this,bo)}setDefaultOptions(e){Me(this,bo,e)}setQueryDefaults(e,t){$(this,hi).set(la(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...$(this,hi).values()],n={};return t.forEach(r=>{Gl(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){$(this,mi).set(la(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...$(this,mi).values()],n={};return t.forEach(r=>{Gl(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...$(this,bo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=pm(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===gm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...$(this,bo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){$(this,cn).clear(),$(this,xo).clear()}},cn=new WeakMap,xo=new WeakMap,bo=new WeakMap,hi=new WeakMap,mi=new WeakMap,vo=new WeakMap,pi=new WeakMap,yi=new WeakMap,Ob),Hb=N.createContext(void 0),qn=e=>{const t=N.useContext(Hb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},jk=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(Hb.Provider,{value:e,children:t})),Ub=N.createContext(!1),zb=()=>N.useContext(Ub);Ub.Provider;function Fk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Bk=N.createContext(Fk()),Wb=()=>N.useContext(Bk),Yb=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?xm(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},$b=e=>{N.useEffect(()=>{e.clearReset()},[e])},qb=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||xm(n,[e.error,r])),Vb=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Qb=(e,t)=>e.isLoading&&e.isFetching&&!t,z0=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Gc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function c1({queries:e,...t},n){const r=qn(),s=zb(),i=Wb(),l=N.useMemo(()=>e.map(w=>{const T=r.defaultQueryOptions(w);return T._optimisticResults=s?"isRestoring":"optimistic",T}),[e,r,s]);l.forEach(w=>{Vb(w);const T=r.getQueryCache().get(w.queryHash);Yb(w,i,T)}),$b(i);const[u]=N.useState(()=>new Lk(r,l,t)),[f,h,p]=u.getOptimisticResult(l,t.combine),y=!s&&t.subscribed!==!1;N.useSyncExternalStore(N.useCallback(w=>y?u.subscribe(rn.batchCalls(w)):Fn,[u,y]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),N.useEffect(()=>{u.setQueries(l,t)},[l,t,u]);const b=f.some((w,T)=>z0(l[T],w))?f.flatMap((w,T)=>{const E=l[T];if(E){const _=new vm(r,E);if(z0(E,w))return Gc(E,_,i);Qb(w,s)&&Gc(E,_,i)}return[]}):[];if(b.length>0)throw Promise.all(b);const O=f.find((w,T)=>{const E=l[T];return E&&qb({result:w,errorResetBoundary:i,throwOnError:E.throwOnError,query:r.getQueryCache().get(E.queryHash),suspense:E.suspense})});if(O!=null&&O.error)throw O.error;return h(p())}function Hk(e,t,n){var g,b,O,w;const r=zb(),s=Wb(),i=qn(),l=i.defaultQueryOptions(e);(b=(g=i.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||b.call(g,l);const u=i.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",Vb(l),Yb(l,s,u),$b(s);const f=!i.getQueryCache().get(l.queryHash),[h]=N.useState(()=>new t(i,l)),p=h.getOptimisticResult(l),y=!r&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(T=>{const E=y?h.subscribe(rn.batchCalls(T)):Fn;return h.updateResult(),E},[h,y]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),N.useEffect(()=>{h.setOptions(l)},[l,h]),z0(l,p))throw Gc(l,h,s);if(qb({result:p,errorResetBoundary:s,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw p.error;if((w=(O=i.getDefaultOptions().queries)==null?void 0:O._experimental_afterQuery)==null||w.call(O,l,p),l.experimental_prefetchInRender&&!ia&&Qb(p,r)){const T=f?Gc(l,h,s):u==null?void 0:u.promise;T==null||T.catch(Fn).finally(()=>{h.updateResult()})}return l.notifyOnChangeProps?p:h.trackResult(p)}function or(e,t){return Hk(e,vm)}function Uk(e,t){const n=qn(),r=n.getQueryCache();return N.useSyncExternalStore(N.useCallback(s=>r.subscribe(rn.batchCalls(s)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}function Za(e,t){const n=qn(),[r]=N.useState(()=>new Ik(n,e));N.useEffect(()=>{r.setOptions(e)},[r,e]);const s=N.useSyncExternalStore(N.useCallback(l=>r.subscribe(rn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=N.useCallback((l,u)=>{r.mutate(l,u).catch(Fn)},[r]);if(s.error&&xm(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}function zk({children:e}){const[t]=N.useState(()=>new Pk({defaultOptions:{queries:{staleTime:3e5,gcTime:18e5,refetchOnWindowFocus:!1,retry:1}}}));return d.jsx(jk,{client:t,children:e})}const Wk="modulepreload",Yk=function(e){return"/"+e},d1={},Yr=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));s=l(n.map(h=>{if(h=Yk(h),h in d1)return;d1[h]=!0;const p=h.endsWith(".css"),y=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${y}`))return;const g=document.createElement("link");if(g.rel=p?"stylesheet":Wk,p||(g.as="script"),g.crossOrigin="",g.href=h,f&&g.setAttribute("nonce",f),document.head.appendChild(g),p)return new Promise((b,O)=>{g.addEventListener("load",b),g.addEventListener("error",()=>O(new Error(`Unable to preload CSS for ${h}`)))})}))}function i(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return s.then(l=>{for(const u of l||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})},f1={md:768,lg:1024};function h1(e){return e>=f1.lg?"lg":e>=f1.md?"md":"sm"}function Tm(){const[e,t]=N.useState(()=>typeof window<"u"?h1(window.innerWidth):"lg");return N.useEffect(()=>{function n(){t(h1(window.innerWidth))}return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}const Kc="/api";class cu extends Error{constructor(t,n,r){super(n),this.status=t,this.errorType=r,this.name="ApiError"}}async function Ct(e,t){const n={...t==null?void 0:t.headers};t!=null&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${Kc}${e}`,{credentials:"include",...t,headers:n});if(!r.ok){const s=await r.json().catch(()=>({error:"Unknown error"}));throw new cu(r.status,s.error||`HTTP ${r.status}`,s.errorType)}return r.json()}async function yl(e,t){const n=await fetch(`${Kc}${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 cu(n.status,r.error||`HTTP ${n.status}`,r.errorType)}return n.json()}const xt={getHealth:()=>Ct("/health"),reconnect:()=>Ct("/connections/reconnect",{method:"POST",body:"{}"}),getConfig:()=>Ct("/config"),getChart:e=>Ct(`/charts/${encodeURIComponent(e)}`),queryChart:(e,t={},n={})=>Ct(`/charts/${encodeURIComponent(e)}/query${n.includeConfig?"?includeConfig=true":""}`,{method:"POST",body:JSON.stringify(t)}),queryChartsBatch:(e,t={})=>Ct("/charts/batch",{method:"POST",body:JSON.stringify({charts:e,includeConfig:t.includeConfig})}),queryChartDetail:(e,t={})=>Ct(`/charts/${encodeURIComponent(e)}/detail`,{method:"POST",body:JSON.stringify(t)}),invalidateChart:e=>Ct(`/charts/${encodeURIComponent(e)}/invalidate`,{method:"POST"}),getExportUrl:(e,t={})=>{const n=new URLSearchParams;for(const[s,i]of Object.entries(t))i!=null&&i!==""&&n.set(s,String(i));const r=n.toString();return`${Kc}/charts/${encodeURIComponent(e)}/export${r?`?${r}`:""}`},getChartEvents:()=>Ct("/chart-events"),createChartEvent:e=>Ct("/chart-events",{method:"POST",body:JSON.stringify(e)}),deleteChartEvent:e=>Ct(`/chart-events/${e}`,{method:"DELETE"}),updateChartEvent:(e,t)=>Ct(`/chart-events/${e}`,{method:"PUT",body:JSON.stringify(t)}),getParameterOptions:(e,t)=>Ct(`/charts/${encodeURIComponent(e)}/parameters/${encodeURIComponent(t)}/options`),getModelOptions:(e,t,n)=>Ct(`/models/${encodeURIComponent(e)}/options?value_field=${encodeURIComponent(t)}&label_field=${encodeURIComponent(n)}`),getDashboards:()=>Ct("/dashboards"),getDashboard:(e,t)=>{const n=t?`/dashboards/${encodeURIComponent(e)}?branch=${encodeURIComponent(t)}`:`/dashboards/${encodeURIComponent(e)}`;return Ct(n)},saveDashboard:(e,t,n,r,s,i)=>Ct(`/dashboards/${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify(r?{tab:r,tabLayout:t,message:n,title:s,description:i}:{layout:t,message:n,title:s,description:i})}),warmDashboardCache:(e,t={},n)=>Ct(`/dashboards/${encodeURIComponent(e)}/warm-cache`,{method:"POST",body:JSON.stringify({params:t,...n?{tab:n}:{}})}),getBranches:()=>Ct("/git/branches"),createBranch:(e,t)=>Ct("/git/branches",{method:"POST",body:JSON.stringify({name:e,from:t})}),checkoutBranch:e=>Ct("/git/checkout",{method:"POST",body:JSON.stringify({branch:e})}),getAuthMe:async()=>{const e=await fetch(`${Kc}/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 cu(e.status,`HTTP ${e.status}`);return e.json()},authSetup:e=>Ct("/auth/setup",{method:"POST",body:JSON.stringify(e)}),authLogin:e=>Ct("/auth/login",{method:"POST",body:JSON.stringify(e)}),authLogout:()=>Ct("/auth/logout",{method:"POST"}),authChangePassword:e=>Ct("/auth/me/password",{method:"PUT",body:JSON.stringify(e)}),authListUsers:()=>Ct("/auth/users"),authCreateUser:e=>Ct("/auth/users",{method:"POST",body:JSON.stringify(e)}),authUpdateUser:(e,t)=>Ct(`/auth/users/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),authDeleteUser:e=>Ct(`/auth/users/${encodeURIComponent(e)}`,{method:"DELETE"}),createShareLink:e=>Ct("/shares",{method:"POST",body:JSON.stringify(e)}),listShareLinks:()=>Ct("/shares"),revokeShareLink:e=>Ct(`/shares/${encodeURIComponent(e)}`,{method:"DELETE"}),getPublicConfig:e=>yl(`/public/config?share_token=${encodeURIComponent(e)}`),getPublicDashboard:(e,t)=>yl(`/public/dashboards/${encodeURIComponent(e)}?share_token=${encodeURIComponent(t)}`),getPublicChart:(e,t)=>yl(`/public/charts/${encodeURIComponent(e)}?share_token=${encodeURIComponent(t)}`),queryPublicChart:(e,t,n,r=!1)=>{const s=new URLSearchParams({share_token:n});return r&&s.set("includeConfig","true"),yl(`/public/charts/${encodeURIComponent(e)}/query?${s}`,{method:"POST",body:JSON.stringify(t)})},queryPublicChartBatch:(e,t,n=!1)=>yl(`/public/charts/batch?share_token=${encodeURIComponent(t)}`,{method:"POST",body:JSON.stringify({charts:e,includeConfig:n})}),getChatAgents:()=>Ct("/chat/agents"),getCatalogSummary:()=>Ct("/catalog/summary"),generateText:e=>Ct("/chat/generate-text",{method:"POST",body:JSON.stringify(e)})},Gb=N.createContext(null),yP=Gb.Provider;function ya(){return N.useContext(Gb)}function ga(){const e=ya();return or({queryKey:["config",e],queryFn:()=>e?xt.getPublicConfig(e):xt.getConfig(),staleTime:1/0})}function $k(){return or({queryKey:["health"],queryFn:xt.getHealth,refetchInterval:3e4})}function Kb(e){const t=ya();return or({queryKey:["chart",e,t],queryFn:()=>t?xt.getPublicChart(e,t):xt.getChart(e),enabled:!!e,staleTime:1e3*60*10})}const m1=e=>{let t;const n=new Set,r=(h,p)=>{const y=typeof h=="function"?h(t):h;if(!Object.is(y,t)){const g=t;t=p??(typeof y!="object"||y===null)?y:Object.assign({},t,y),n.forEach(b=>b(t,g))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h))},f=t=e(r,s,u);return u},qk=(e=>e?m1(e):m1),Vk=e=>e;function Qk(e,t=Vk){const n=Le.useSyncExternalStore(e.subscribe,Le.useCallback(()=>t(e.getState()),[e,t]),Le.useCallback(()=>t(e.getInitialState()),[e,t]));return Le.useDebugValue(n),n}const p1=e=>{const t=qk(e),n=r=>Qk(t,r);return Object.assign(n,t),n},wm=(e=>e?p1(e):p1),ot=wm((e,t)=>({globalFilters:{},chartFilters:{},crossFilters:{},setGlobalFilter:(n,r)=>e(s=>{if(r==null){const{[n]:i,...l}=s.globalFilters;return{globalFilters:l}}return{globalFilters:{...s.globalFilters,[n]:r}}}),setChartFilter:(n,r,s)=>e(i=>{if(s==null){const l=i.chartFilters[n];if(!l)return i;const{[r]:u,...f}=l;return{chartFilters:{...i.chartFilters,[n]:f}}}return{chartFilters:{...i.chartFilters,[n]:{...i.chartFilters[n],[r]:s}}}}),setCrossFilter:(n,r,s,i)=>e(l=>{const u=l.crossFilters[n];if(u&&u.value===r){const{[n]:f,...h}=l.crossFilters;return{crossFilters:h}}return{crossFilters:{...l.crossFilters,[n]:{field:n,value:r,sourceChart:s,temporal:i}}}}),clearCrossFilter:n=>e(r=>{const{[n]:s,...i}=r.crossFilters;return{crossFilters:i}}),clearAllCrossFilters:()=>e({crossFilters:{}}),getEffectiveFilters:n=>{const{globalFilters:r,crossFilters:s,chartFilters:i}=t(),l={};for(const u of Object.values(s))u.sourceChart!==n&&(l[u.field]=[u.value],u.temporal&&u.value&&(l.start_date=u.value,l.end_date=u.value));return{...r,...l,...i[n]}},resetFilters:()=>e({globalFilters:{},chartFilters:{},crossFilters:{}}),resetChartFilters:n=>e(r=>{const{[n]:s,...i}=r.chartFilters;return{chartFilters:i}})})),Xb=6048e5,Gk=864e5,km=6e4,Sm=36e5,Kk=1e3,y1=Symbol.for("constructDateFrom");function Pt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&y1 in e?e[y1](t):e instanceof Date?new e.constructor(t):new Date(t)}function Tt(e,t){return Pt(t||e,e)}function Ls(e,t,n){const r=Tt(e,n==null?void 0:n.in);return isNaN(t)?Pt((n==null?void 0:n.in)||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Ti(e,t,n){const r=Tt(e,n==null?void 0:n.in);if(isNaN(t))return Pt((n==null?void 0:n.in)||e,NaN);if(!t)return r;const s=r.getDate(),i=Pt((n==null?void 0:n.in)||e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const l=i.getDate();return s>=l?i:(r.setFullYear(i.getFullYear(),i.getMonth(),s),r)}let Xk={};function xa(){return Xk}function $r(e,t){var u,f,h,p;const n=xa(),r=(t==null?void 0:t.weekStartsOn)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??n.weekStartsOn??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,s=Tt(e,t==null?void 0:t.in),i=s.getDay(),l=(i<r?7:0)+i-r;return s.setDate(s.getDate()-l),s.setHours(0,0,0,0),s}function ua(e,t){return $r(e,{...t,weekStartsOn:1})}function Jb(e,t){const n=Tt(e,t==null?void 0:t.in),r=n.getFullYear(),s=Pt(n,0);s.setFullYear(r+1,0,4),s.setHours(0,0,0,0);const i=ua(s),l=Pt(n,0);l.setFullYear(r,0,4),l.setHours(0,0,0,0);const u=ua(l);return n.getTime()>=i.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function Xc(e){const t=Tt(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 wi(e,...t){const n=Pt.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function ca(e,t){const n=Tt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Cm(e,t,n){const[r,s]=wi(n==null?void 0:n.in,e,t),i=ca(r),l=ca(s),u=+i-Xc(i),f=+l-Xc(l);return Math.round((u-f)/Gk)}function Jk(e,t){const n=Jb(e,t),r=Pt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),ua(r)}function Nm(e,t,n){return Ti(e,t*3,n)}function yd(e,t,n){return Ls(e,t*7,n)}function gd(e,t,n){return Ti(e,t*12,n)}function Zk(e,t){let n,r=t==null?void 0:t.in;return e.forEach(s=>{!r&&typeof s=="object"&&(r=Pt.bind(null,s));const i=Tt(s,r);(!n||n<i||isNaN(+i))&&(n=i)}),Pt(r,n||NaN)}function eS(e,t){let n,r=t==null?void 0:t.in;return e.forEach(s=>{!r&&typeof s=="object"&&(r=Pt.bind(null,s));const i=Tt(s,r);(!n||n>i||isNaN(+i))&&(n=i)}),Pt(r,n||NaN)}function tS(e,t,n){const[r,s]=wi(n==null?void 0:n.in,e,t);return+ca(r)==+ca(s)}function Zb(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function nS(e){return!(!Zb(e)&&typeof e!="number"||isNaN(+Tt(e)))}function ev(e,t,n){const[r,s]=wi(n==null?void 0:n.in,e,t),i=r.getFullYear()-s.getFullYear(),l=r.getMonth()-s.getMonth();return i*12+l}function rS(e,t){const n=Tt(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function xd(e,t){const n=Tt(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 tv(e,t){const[n,r]=wi(e,t.start,t.end);return{start:n,end:r}}function sS(e,t){const{start:n,end:r}=tv(t==null?void 0:t.in,e);let s=+n>+r;const i=s?+n:+r,l=s?r:n;l.setHours(0,0,0,0),l.setDate(1);let u=1;const f=[];for(;+l<=i;)f.push(Pt(n,l)),l.setMonth(l.getMonth()+u);return s?f.reverse():f}function Jc(e,t){const n=Tt(e,t==null?void 0:t.in),r=n.getMonth(),s=r-r%3;return n.setMonth(s,1),n.setHours(0,0,0,0),n}function Xl(e,t){const n=Tt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function bd(e,t){const n=Tt(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 gi(e,t){const n=Tt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function oS(e,t){const{start:n,end:r}=tv(t==null?void 0:t.in,e);let s=+n>+r;const i=s?+n:+r,l=s?r:n;l.setHours(0,0,0,0),l.setMonth(0,1);let u=1;const f=[];for(;+l<=i;)f.push(Pt(n,l)),l.setFullYear(l.getFullYear()+u);return s?f.reverse():f}function vd(e,t){var u,f,h,p;const n=xa(),r=(t==null?void 0:t.weekStartsOn)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??n.weekStartsOn??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,s=Tt(e,t==null?void 0:t.in),i=s.getDay(),l=(i<r?-7:0)+6-(i-r);return s.setDate(s.getDate()+l),s.setHours(23,59,59,999),s}function aS(e,t){return vd(e,{...t,weekStartsOn:1})}function _m(e,t){const n=Tt(e,t==null?void 0:t.in),r=n.getMonth(),s=r-r%3+3;return n.setMonth(s,0),n.setHours(23,59,59,999),n}const iS={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"}},lS=(e,t,n)=>{let r;const s=iS[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Uh(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const uS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},cS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},fS={date:Uh({formats:uS,defaultWidth:"full"}),time:Uh({formats:cS,defaultWidth:"full"}),dateTime:Uh({formats:dS,defaultWidth:"full"})},hS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mS=(e,t,n,r)=>hS[e];function gl(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,u=n!=null&&n.width?String(n.width):l;s=e.formattingValues[u]||e.formattingValues[l]}else{const l=e.defaultWidth,u=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[u]||e.values[l]}const i=e.argumentCallback?e.argumentCallback(t):t;return s[i]}}const pS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gS={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"]},xS={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"]},bS={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"}},vS={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"}},ES=(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"},TS={ordinalNumber:ES,era:gl({values:pS,defaultWidth:"wide"}),quarter:gl({values:yS,defaultWidth:"wide",argumentCallback:e=>e-1}),month:gl({values:gS,defaultWidth:"wide"}),day:gl({values:xS,defaultWidth:"wide"}),dayPeriod:gl({values:bS,defaultWidth:"wide",formattingValues:vS,defaultFormattingWidth:"wide"})};function xl(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;const l=i[0],u=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],f=Array.isArray(u)?kS(u,y=>y.test(l)):wS(u,y=>y.test(l));let h;h=e.valueCallback?e.valueCallback(f):f,h=n.valueCallback?n.valueCallback(h):h;const p=t.slice(l.length);return{value:h,rest:p}}}function wS(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function kS(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function SS(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],i=t.match(e.parsePattern);if(!i)return null;let l=e.valueCallback?e.valueCallback(i[0]):i[0];l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(s.length);return{value:l,rest:u}}}const CS=/^(\d+)(th|st|nd|rd)?/i,NS=/\d+/i,_S={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},DS={any:[/^b/i,/^(a|c)/i]},OS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},AS={any:[/1/i,/2/i,/3/i,/4/i]},IS={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},MS={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]},LS={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},RS={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]},PS={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},jS={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}},FS={ordinalNumber:SS({matchPattern:CS,parsePattern:NS,valueCallback:e=>parseInt(e,10)}),era:xl({matchPatterns:_S,defaultMatchWidth:"wide",parsePatterns:DS,defaultParseWidth:"any"}),quarter:xl({matchPatterns:OS,defaultMatchWidth:"wide",parsePatterns:AS,defaultParseWidth:"any",valueCallback:e=>e+1}),month:xl({matchPatterns:IS,defaultMatchWidth:"wide",parsePatterns:MS,defaultParseWidth:"any"}),day:xl({matchPatterns:LS,defaultMatchWidth:"wide",parsePatterns:RS,defaultParseWidth:"any"}),dayPeriod:xl({matchPatterns:PS,defaultMatchWidth:"any",parsePatterns:jS,defaultParseWidth:"any"})},$o={code:"en-US",formatDistance:lS,formatLong:fS,formatRelative:mS,localize:TS,match:FS,options:{weekStartsOn:0,firstWeekContainsDate:1}};function BS(e,t){const n=Tt(e,t==null?void 0:t.in);return Cm(n,gi(n))+1}function Ed(e,t){const n=Tt(e,t==null?void 0:t.in),r=+ua(n)-+Jk(n);return Math.round(r/Xb)+1}function Dm(e,t){var p,y,g,b;const n=Tt(e,t==null?void 0:t.in),r=n.getFullYear(),s=xa(),i=(t==null?void 0:t.firstWeekContainsDate)??((y=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:y.firstWeekContainsDate)??s.firstWeekContainsDate??((b=(g=s.locale)==null?void 0:g.options)==null?void 0:b.firstWeekContainsDate)??1,l=Pt((t==null?void 0:t.in)||e,0);l.setFullYear(r+1,0,i),l.setHours(0,0,0,0);const u=$r(l,t),f=Pt((t==null?void 0:t.in)||e,0);f.setFullYear(r,0,i),f.setHours(0,0,0,0);const h=$r(f,t);return+n>=+u?r+1:+n>=+h?r:r-1}function HS(e,t){var u,f,h,p;const n=xa(),r=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=Dm(e,t),i=Pt((t==null?void 0:t.in)||e,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),$r(i,t)}function Td(e,t){const n=Tt(e,t==null?void 0:t.in),r=+$r(n,t)-+HS(n,t);return Math.round(r/Xb)+1}function Bt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ro={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Bt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Bt(n+1,2)},d(e,t){return Bt(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 Bt(e.getHours()%12||12,t.length)},H(e,t){return Bt(e.getHours(),t.length)},m(e,t){return Bt(e.getMinutes(),t.length)},s(e,t){return Bt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return Bt(s,t.length)}},qa={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},g1={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(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return ro.y(e,t)},Y:function(e,t,n,r){const s=Dm(e,r),i=s>0?s:1-s;if(t==="YY"){const l=i%100;return Bt(l,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Bt(i,t.length)},R:function(e,t){const n=Jb(e);return Bt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Bt(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 Bt(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 Bt(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 ro.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 Bt(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 s=Td(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):Bt(s,t.length)},I:function(e,t,n){const r=Ed(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Bt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ro.d(e,t)},D:function(e,t,n){const r=BS(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Bt(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 s=e.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Bt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const s=e.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Bt(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return Bt(s,t.length);case"io":return n.ordinalNumber(s,{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 s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let s;switch(r===12?s=qa.noon:r===0?s=qa.midnight:s=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let s;switch(r>=17?s=qa.evening:r>=12?s=qa.afternoon:r>=4?s=qa.morning:s=qa.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{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 ro.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ro.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Bt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Bt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ro.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ro.s(e,t)},S:function(e,t){return ro.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return b1(r);case"XXXX":case"XX":return Wo(r);case"XXXXX":case"XXX":default:return Wo(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return b1(r);case"xxxx":case"xx":return Wo(r);case"xxxxx":case"xxx":default:return Wo(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+x1(r,":");case"OOOO":default:return"GMT"+Wo(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+x1(r,":");case"zzzz":default:return"GMT"+Wo(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Bt(r,t.length)},T:function(e,t,n){return Bt(+e,t.length)}};function x1(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+t+Bt(i,2)}function b1(e,t){return e%60===0?(e>0?"-":"+")+Bt(Math.abs(e)/60,2):Wo(e,t)}function Wo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Bt(Math.trunc(r/60),2),i=Bt(r%60,2);return n+s+t+i}const v1=(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"})}},nv=(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"})}},US=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return v1(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",v1(r,t)).replace("{{time}}",nv(s,t))},W0={p:nv,P:US},zS=/^D+$/,WS=/^Y+$/,YS=["D","DD","YY","YYYY"];function rv(e){return zS.test(e)}function sv(e){return WS.test(e)}function Y0(e,t,n){const r=$S(e,t,n);if(console.warn(r),YS.includes(e))throw new RangeError(r)}function $S(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 qS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,VS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,QS=/^'([^]*?)'?$/,GS=/''/g,KS=/[a-zA-Z]/;function dn(e,t,n){var p,y,g,b,O,w,T,E;const r=xa(),s=(n==null?void 0:n.locale)??r.locale??$o,i=(n==null?void 0:n.firstWeekContainsDate)??((y=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:y.firstWeekContainsDate)??r.firstWeekContainsDate??((b=(g=r.locale)==null?void 0:g.options)==null?void 0:b.firstWeekContainsDate)??1,l=(n==null?void 0:n.weekStartsOn)??((w=(O=n==null?void 0:n.locale)==null?void 0:O.options)==null?void 0:w.weekStartsOn)??r.weekStartsOn??((E=(T=r.locale)==null?void 0:T.options)==null?void 0:E.weekStartsOn)??0,u=Tt(e,n==null?void 0:n.in);if(!nS(u))throw new RangeError("Invalid time value");let f=t.match(VS).map(_=>{const S=_[0];if(S==="p"||S==="P"){const A=W0[S];return A(_,s.formatLong)}return _}).join("").match(qS).map(_=>{if(_==="''")return{isToken:!1,value:"'"};const S=_[0];if(S==="'")return{isToken:!1,value:XS(_)};if(g1[S])return{isToken:!0,value:_};if(S.match(KS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:_}});s.localize.preprocessor&&(f=s.localize.preprocessor(u,f));const h={firstWeekContainsDate:i,weekStartsOn:l,locale:s};return f.map(_=>{if(!_.isToken)return _.value;const S=_.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&sv(S)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&rv(S))&&Y0(S,t,String(e));const A=g1[S[0]];return A(u,S,s.localize,h)}).join("")}function XS(e){const t=e.match(QS);return t?t[1].replace(GS,"'"):e}function JS(e,t){const n=Tt(e,t==null?void 0:t.in),r=n.getFullYear(),s=n.getMonth(),i=Pt(n,0);return i.setFullYear(r,s+1,0),i.setHours(0,0,0,0),i.getDate()}function ZS(){return Object.assign({},xa())}function eC(e,t){const n=Tt(e,t==null?void 0:t.in).getDay();return n===0?7:n}function tC(e,t){return Tt(e,t==null?void 0:t.in).getMonth()}function nC(e,t){return Tt(e,t==null?void 0:t.in).getFullYear()}function rC(e,t){return+Tt(e)>+Tt(t)}function sC(e,t){return+Tt(e)<+Tt(t)}function oC(e,t){const n=aC(t)?new t(0):Pt(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function aC(e){var t;return typeof e=="function"&&((t=e.prototype)==null?void 0:t.constructor)===e}const iC=10;class ov{constructor(){qe(this,"subPriority",0)}validate(t,n){return!0}}class lC extends ov{constructor(t,n,r,s,i){super(),this.value=t,this.validateValue=n,this.setValue=r,this.priority=s,i&&(this.subPriority=i)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,r){return this.setValue(t,n,this.value,r)}}class uC extends ov{constructor(n,r){super();qe(this,"priority",iC);qe(this,"subPriority",-1);this.context=n||(s=>Pt(r,s))}set(n,r){return r.timestampIsSet?n:Pt(n,oC(n,this.context))}}let Mt=class{run(t,n,r,s){const i=this.parse(t,n,r,s);return i?{setter:new lC(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(t,n,r){return!0}};class cC extends Mt{constructor(){super(...arguments);qe(this,"priority",140);qe(this,"incompatibleTokens",["R","u","t","T"])}parse(n,r,s){switch(r){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"})||s.era(n,{width:"narrow"});case"GGGGG":return s.era(n,{width:"narrow"});case"GGGG":default:return s.era(n,{width:"wide"})||s.era(n,{width:"abbreviated"})||s.era(n,{width:"narrow"})}}set(n,r,s){return r.era=s,n.setFullYear(s,0,1),n.setHours(0,0,0,0),n}}const yn={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}/},as={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 gn(e,t){return e&&{value:t(e.value),rest:e.rest}}function sn(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function is(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,s=n[2]?parseInt(n[2],10):0,i=n[3]?parseInt(n[3],10):0,l=n[5]?parseInt(n[5],10):0;return{value:r*(s*Sm+i*km+l*Kk),rest:t.slice(n[0].length)}}function av(e){return sn(yn.anyDigitsSigned,e)}function fn(e,t){switch(e){case 1:return sn(yn.singleDigit,t);case 2:return sn(yn.twoDigits,t);case 3:return sn(yn.threeDigits,t);case 4:return sn(yn.fourDigits,t);default:return sn(new RegExp("^\\d{1,"+e+"}"),t)}}function Zc(e,t){switch(e){case 1:return sn(yn.singleDigitSigned,t);case 2:return sn(yn.twoDigitsSigned,t);case 3:return sn(yn.threeDigitsSigned,t);case 4:return sn(yn.fourDigitsSigned,t);default:return sn(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Om(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 iv(e,t){const n=t>0,r=n?t:1-t;let s;if(r<=50)s=e||100;else{const i=r+50,l=Math.trunc(i/100)*100,u=e>=i%100;s=e+l-(u?100:0)}return n?s:1-s}function lv(e){return e%400===0||e%4===0&&e%100!==0}class dC extends Mt{constructor(){super(...arguments);qe(this,"priority",130);qe(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,r,s){const i=l=>({year:l,isTwoDigitYear:r==="yy"});switch(r){case"y":return gn(fn(4,n),i);case"yo":return gn(s.ordinalNumber(n,{unit:"year"}),i);default:return gn(fn(r.length,n),i)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,s){const i=n.getFullYear();if(s.isTwoDigitYear){const u=iv(s.year,i);return n.setFullYear(u,0,1),n.setHours(0,0,0,0),n}const l=!("era"in r)||r.era===1?s.year:1-s.year;return n.setFullYear(l,0,1),n.setHours(0,0,0,0),n}}class fC extends Mt{constructor(){super(...arguments);qe(this,"priority",130);qe(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,r,s){const i=l=>({year:l,isTwoDigitYear:r==="YY"});switch(r){case"Y":return gn(fn(4,n),i);case"Yo":return gn(s.ordinalNumber(n,{unit:"year"}),i);default:return gn(fn(r.length,n),i)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,s,i){const l=Dm(n,i);if(s.isTwoDigitYear){const f=iv(s.year,l);return n.setFullYear(f,0,i.firstWeekContainsDate),n.setHours(0,0,0,0),$r(n,i)}const u=!("era"in r)||r.era===1?s.year:1-s.year;return n.setFullYear(u,0,i.firstWeekContainsDate),n.setHours(0,0,0,0),$r(n,i)}}class hC extends Mt{constructor(){super(...arguments);qe(this,"priority",130);qe(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,r){return Zc(r==="R"?4:r.length,n)}set(n,r,s){const i=Pt(n,0);return i.setFullYear(s,0,4),i.setHours(0,0,0,0),ua(i)}}class mC extends Mt{constructor(){super(...arguments);qe(this,"priority",130);qe(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,r){return Zc(r==="u"?4:r.length,n)}set(n,r,s){return n.setFullYear(s,0,1),n.setHours(0,0,0,0),n}}class pC extends Mt{constructor(){super(...arguments);qe(this,"priority",120);qe(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,s){switch(r){case"Q":case"QQ":return fn(r.length,n);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"})||s.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(n,{width:"wide",context:"formatting"})||s.quarter(n,{width:"abbreviated",context:"formatting"})||s.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=1&&r<=4}set(n,r,s){return n.setMonth((s-1)*3,1),n.setHours(0,0,0,0),n}}class yC extends Mt{constructor(){super(...arguments);qe(this,"priority",120);qe(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,s){switch(r){case"q":case"qq":return fn(r.length,n);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"})||s.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(n,{width:"wide",context:"standalone"})||s.quarter(n,{width:"abbreviated",context:"standalone"})||s.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=1&&r<=4}set(n,r,s){return n.setMonth((s-1)*3,1),n.setHours(0,0,0,0),n}}class gC extends Mt{constructor(){super(...arguments);qe(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);qe(this,"priority",110)}parse(n,r,s){const i=l=>l-1;switch(r){case"M":return gn(sn(yn.month,n),i);case"MM":return gn(fn(2,n),i);case"Mo":return gn(s.ordinalNumber(n,{unit:"month"}),i);case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"})||s.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(n,{width:"wide",context:"formatting"})||s.month(n,{width:"abbreviated",context:"formatting"})||s.month(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=11}set(n,r,s){return n.setMonth(s,1),n.setHours(0,0,0,0),n}}class xC extends Mt{constructor(){super(...arguments);qe(this,"priority",110);qe(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,r,s){const i=l=>l-1;switch(r){case"L":return gn(sn(yn.month,n),i);case"LL":return gn(fn(2,n),i);case"Lo":return gn(s.ordinalNumber(n,{unit:"month"}),i);case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"})||s.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(n,{width:"wide",context:"standalone"})||s.month(n,{width:"abbreviated",context:"standalone"})||s.month(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=11}set(n,r,s){return n.setMonth(s,1),n.setHours(0,0,0,0),n}}function bC(e,t,n){const r=Tt(e,n==null?void 0:n.in),s=Td(r,n)-t;return r.setDate(r.getDate()-s*7),Tt(r,n==null?void 0:n.in)}class vC extends Mt{constructor(){super(...arguments);qe(this,"priority",100);qe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,r,s){switch(r){case"w":return sn(yn.week,n);case"wo":return s.ordinalNumber(n,{unit:"week"});default:return fn(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,s,i){return $r(bC(n,s,i),i)}}function EC(e,t,n){const r=Tt(e,n==null?void 0:n.in),s=Ed(r,n)-t;return r.setDate(r.getDate()-s*7),r}class TC extends Mt{constructor(){super(...arguments);qe(this,"priority",100);qe(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,r,s){switch(r){case"I":return sn(yn.week,n);case"Io":return s.ordinalNumber(n,{unit:"week"});default:return fn(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,s){return ua(EC(n,s))}}const wC=[31,28,31,30,31,30,31,31,30,31,30,31],kC=[31,29,31,30,31,30,31,31,30,31,30,31];class SC extends Mt{constructor(){super(...arguments);qe(this,"priority",90);qe(this,"subPriority",1);qe(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,r,s){switch(r){case"d":return sn(yn.date,n);case"do":return s.ordinalNumber(n,{unit:"date"});default:return fn(r.length,n)}}validate(n,r){const s=n.getFullYear(),i=lv(s),l=n.getMonth();return i?r>=1&&r<=kC[l]:r>=1&&r<=wC[l]}set(n,r,s){return n.setDate(s),n.setHours(0,0,0,0),n}}class CC extends Mt{constructor(){super(...arguments);qe(this,"priority",90);qe(this,"subpriority",1);qe(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,r,s){switch(r){case"D":case"DD":return sn(yn.dayOfYear,n);case"Do":return s.ordinalNumber(n,{unit:"date"});default:return fn(r.length,n)}}validate(n,r){const s=n.getFullYear();return lv(s)?r>=1&&r<=366:r>=1&&r<=365}set(n,r,s){return n.setMonth(0,s),n.setHours(0,0,0,0),n}}function Am(e,t,n){var y,g,b,O;const r=xa(),s=(n==null?void 0:n.weekStartsOn)??((g=(y=n==null?void 0:n.locale)==null?void 0:y.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((O=(b=r.locale)==null?void 0:b.options)==null?void 0:O.weekStartsOn)??0,i=Tt(e,n==null?void 0:n.in),l=i.getDay(),f=(t%7+7)%7,h=7-s,p=t<0||t>6?t-(l+h)%7:(f+h)%7-(l+h)%7;return Ls(i,p,n)}class NC extends Mt{constructor(){super(...arguments);qe(this,"priority",90);qe(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,r,s){switch(r){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"})||s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(n,{width:"wide",context:"formatting"})||s.day(n,{width:"abbreviated",context:"formatting"})||s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,s,i){return n=Am(n,s,i),n.setHours(0,0,0,0),n}}class _C extends Mt{constructor(){super(...arguments);qe(this,"priority",90);qe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,r,s,i){const l=u=>{const f=Math.floor((u-1)/7)*7;return(u+i.weekStartsOn+6)%7+f};switch(r){case"e":case"ee":return gn(fn(r.length,n),l);case"eo":return gn(s.ordinalNumber(n,{unit:"day"}),l);case"eee":return s.day(n,{width:"abbreviated",context:"formatting"})||s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"});case"eeeee":return s.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(n,{width:"wide",context:"formatting"})||s.day(n,{width:"abbreviated",context:"formatting"})||s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,s,i){return n=Am(n,s,i),n.setHours(0,0,0,0),n}}class DC extends Mt{constructor(){super(...arguments);qe(this,"priority",90);qe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,r,s,i){const l=u=>{const f=Math.floor((u-1)/7)*7;return(u+i.weekStartsOn+6)%7+f};switch(r){case"c":case"cc":return gn(fn(r.length,n),l);case"co":return gn(s.ordinalNumber(n,{unit:"day"}),l);case"ccc":return s.day(n,{width:"abbreviated",context:"standalone"})||s.day(n,{width:"short",context:"standalone"})||s.day(n,{width:"narrow",context:"standalone"});case"ccccc":return s.day(n,{width:"narrow",context:"standalone"});case"cccccc":return s.day(n,{width:"short",context:"standalone"})||s.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(n,{width:"wide",context:"standalone"})||s.day(n,{width:"abbreviated",context:"standalone"})||s.day(n,{width:"short",context:"standalone"})||s.day(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=6}set(n,r,s,i){return n=Am(n,s,i),n.setHours(0,0,0,0),n}}function OC(e,t,n){const r=Tt(e,n==null?void 0:n.in),s=eC(r,n),i=t-s;return Ls(r,i,n)}class AC extends Mt{constructor(){super(...arguments);qe(this,"priority",90);qe(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,r,s){const i=l=>l===0?7:l;switch(r){case"i":case"ii":return fn(r.length,n);case"io":return s.ordinalNumber(n,{unit:"day"});case"iii":return gn(s.day(n,{width:"abbreviated",context:"formatting"})||s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"}),i);case"iiiii":return gn(s.day(n,{width:"narrow",context:"formatting"}),i);case"iiiiii":return gn(s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"}),i);case"iiii":default:return gn(s.day(n,{width:"wide",context:"formatting"})||s.day(n,{width:"abbreviated",context:"formatting"})||s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"}),i)}}validate(n,r){return r>=1&&r<=7}set(n,r,s){return n=OC(n,s),n.setHours(0,0,0,0),n}}class IC extends Mt{constructor(){super(...arguments);qe(this,"priority",80);qe(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,r,s){switch(r){case"a":case"aa":case"aaa":return s.dayPeriod(n,{width:"abbreviated",context:"formatting"})||s.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(n,{width:"wide",context:"formatting"})||s.dayPeriod(n,{width:"abbreviated",context:"formatting"})||s.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,s){return n.setHours(Om(s),0,0,0),n}}class MC extends Mt{constructor(){super(...arguments);qe(this,"priority",80);qe(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,r,s){switch(r){case"b":case"bb":case"bbb":return s.dayPeriod(n,{width:"abbreviated",context:"formatting"})||s.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(n,{width:"wide",context:"formatting"})||s.dayPeriod(n,{width:"abbreviated",context:"formatting"})||s.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,s){return n.setHours(Om(s),0,0,0),n}}class LC extends Mt{constructor(){super(...arguments);qe(this,"priority",80);qe(this,"incompatibleTokens",["a","b","t","T"])}parse(n,r,s){switch(r){case"B":case"BB":case"BBB":return s.dayPeriod(n,{width:"abbreviated",context:"formatting"})||s.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(n,{width:"wide",context:"formatting"})||s.dayPeriod(n,{width:"abbreviated",context:"formatting"})||s.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,s){return n.setHours(Om(s),0,0,0),n}}class RC extends Mt{constructor(){super(...arguments);qe(this,"priority",70);qe(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,r,s){switch(r){case"h":return sn(yn.hour12h,n);case"ho":return s.ordinalNumber(n,{unit:"hour"});default:return fn(r.length,n)}}validate(n,r){return r>=1&&r<=12}set(n,r,s){const i=n.getHours()>=12;return i&&s<12?n.setHours(s+12,0,0,0):!i&&s===12?n.setHours(0,0,0,0):n.setHours(s,0,0,0),n}}class PC extends Mt{constructor(){super(...arguments);qe(this,"priority",70);qe(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,r,s){switch(r){case"H":return sn(yn.hour23h,n);case"Ho":return s.ordinalNumber(n,{unit:"hour"});default:return fn(r.length,n)}}validate(n,r){return r>=0&&r<=23}set(n,r,s){return n.setHours(s,0,0,0),n}}class jC extends Mt{constructor(){super(...arguments);qe(this,"priority",70);qe(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,r,s){switch(r){case"K":return sn(yn.hour11h,n);case"Ko":return s.ordinalNumber(n,{unit:"hour"});default:return fn(r.length,n)}}validate(n,r){return r>=0&&r<=11}set(n,r,s){return n.getHours()>=12&&s<12?n.setHours(s+12,0,0,0):n.setHours(s,0,0,0),n}}class FC extends Mt{constructor(){super(...arguments);qe(this,"priority",70);qe(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,r,s){switch(r){case"k":return sn(yn.hour24h,n);case"ko":return s.ordinalNumber(n,{unit:"hour"});default:return fn(r.length,n)}}validate(n,r){return r>=1&&r<=24}set(n,r,s){const i=s<=24?s%24:s;return n.setHours(i,0,0,0),n}}class BC extends Mt{constructor(){super(...arguments);qe(this,"priority",60);qe(this,"incompatibleTokens",["t","T"])}parse(n,r,s){switch(r){case"m":return sn(yn.minute,n);case"mo":return s.ordinalNumber(n,{unit:"minute"});default:return fn(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,s){return n.setMinutes(s,0,0),n}}class HC extends Mt{constructor(){super(...arguments);qe(this,"priority",50);qe(this,"incompatibleTokens",["t","T"])}parse(n,r,s){switch(r){case"s":return sn(yn.second,n);case"so":return s.ordinalNumber(n,{unit:"second"});default:return fn(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,s){return n.setSeconds(s,0),n}}class UC extends Mt{constructor(){super(...arguments);qe(this,"priority",30);qe(this,"incompatibleTokens",["t","T"])}parse(n,r){const s=i=>Math.trunc(i*Math.pow(10,-r.length+3));return gn(fn(r.length,n),s)}set(n,r,s){return n.setMilliseconds(s),n}}class zC extends Mt{constructor(){super(...arguments);qe(this,"priority",10);qe(this,"incompatibleTokens",["t","T","x"])}parse(n,r){switch(r){case"X":return is(as.basicOptionalMinutes,n);case"XX":return is(as.basic,n);case"XXXX":return is(as.basicOptionalSeconds,n);case"XXXXX":return is(as.extendedOptionalSeconds,n);case"XXX":default:return is(as.extended,n)}}set(n,r,s){return r.timestampIsSet?n:Pt(n,n.getTime()-Xc(n)-s)}}class WC extends Mt{constructor(){super(...arguments);qe(this,"priority",10);qe(this,"incompatibleTokens",["t","T","X"])}parse(n,r){switch(r){case"x":return is(as.basicOptionalMinutes,n);case"xx":return is(as.basic,n);case"xxxx":return is(as.basicOptionalSeconds,n);case"xxxxx":return is(as.extendedOptionalSeconds,n);case"xxx":default:return is(as.extended,n)}}set(n,r,s){return r.timestampIsSet?n:Pt(n,n.getTime()-Xc(n)-s)}}class YC extends Mt{constructor(){super(...arguments);qe(this,"priority",40);qe(this,"incompatibleTokens","*")}parse(n){return av(n)}set(n,r,s){return[Pt(n,s*1e3),{timestampIsSet:!0}]}}class $C extends Mt{constructor(){super(...arguments);qe(this,"priority",20);qe(this,"incompatibleTokens","*")}parse(n){return av(n)}set(n,r,s){return[Pt(n,s),{timestampIsSet:!0}]}}const qC={G:new cC,y:new dC,Y:new fC,R:new hC,u:new mC,Q:new pC,q:new yC,M:new gC,L:new xC,w:new vC,I:new TC,d:new SC,D:new CC,E:new NC,e:new _C,c:new DC,i:new AC,a:new IC,b:new MC,B:new LC,h:new RC,H:new PC,K:new jC,k:new FC,m:new BC,s:new HC,S:new UC,X:new zC,x:new WC,t:new YC,T:new $C},VC=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,QC=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,GC=/^'([^]*?)'?$/,KC=/''/g,XC=/\S/,JC=/[a-zA-Z]/;function ks(e,t,n,r){var T,E,_,S;const s=()=>Pt(n,NaN),i=ZS(),l=i.locale??$o,u=i.firstWeekContainsDate??((E=(T=i.locale)==null?void 0:T.options)==null?void 0:E.firstWeekContainsDate)??1,f=i.weekStartsOn??((S=(_=i.locale)==null?void 0:_.options)==null?void 0:S.weekStartsOn)??0,h={firstWeekContainsDate:u,weekStartsOn:f,locale:l},p=[new uC(r==null?void 0:r.in,n)],y=t.match(QC).map(A=>{const M=A[0];if(M in W0){const C=W0[M];return C(A,l.formatLong)}return A}).join("").match(VC),g=[];for(let A of y){sv(A)&&Y0(A,t,e),rv(A)&&Y0(A,t,e);const M=A[0],C=qC[M];if(C){const{incompatibleTokens:I}=C;if(Array.isArray(I)){const j=g.find(F=>I.includes(F.token)||F.token===M);if(j)throw new RangeError(`The format string mustn't contain \`${j.fullToken}\` and \`${A}\` at the same time`)}else if(C.incompatibleTokens==="*"&&g.length>0)throw new RangeError(`The format string mustn't contain \`${A}\` and any other token at the same time`);g.push({token:M,fullToken:A});const D=C.run(e,A,l.match,h);if(!D)return s();p.push(D.setter),e=D.rest}else{if(M.match(JC))throw new RangeError("Format string contains an unescaped latin alphabet character `"+M+"`");if(A==="''"?A="'":M==="'"&&(A=ZC(A)),e.indexOf(A)===0)e=e.slice(A.length);else return s()}}if(e.length>0&&XC.test(e))return s();const b=p.map(A=>A.priority).sort((A,M)=>M-A).filter((A,M,C)=>C.indexOf(A)===M).map(A=>p.filter(M=>M.priority===A).sort((M,C)=>C.subPriority-M.subPriority)).map(A=>A[0]);let O=Tt(n,r==null?void 0:r.in);if(isNaN(+O))return s();const w={};for(const A of b){if(!A.validate(O,h))return s();const M=A.set(O,w,h);Array.isArray(M)?(O=M[0],Object.assign(w,M[1])):O=M}return O}function ZC(e){return e.match(GC)[1].replace(KC,"'")}function eN(e,t,n){const[r,s]=wi(n==null?void 0:n.in,e,t);return r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()}function tN(e,t,n){const[r,s]=wi(n==null?void 0:n.in,e,t);return r.getFullYear()===s.getFullYear()}function Nr(e,t,n){return Ls(e,-t,n)}function E1(e,t){const n=()=>Pt(t==null?void 0:t.in,NaN),s=oN(e);let i;if(s.date){const h=aN(s.date,2);i=iN(h.restDateString,h.year)}if(!i||isNaN(+i))return n();const l=+i;let u=0,f;if(s.time&&(u=lN(s.time),isNaN(u)))return n();if(s.timezone){if(f=uN(s.timezone),isNaN(f))return n()}else{const h=new Date(l+u),p=Tt(0,t==null?void 0:t.in);return p.setFullYear(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()),p.setHours(h.getUTCHours(),h.getUTCMinutes(),h.getUTCSeconds(),h.getUTCMilliseconds()),p}return Tt(l+u+f,t==null?void 0:t.in)}const _c={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},nN=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,rN=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,sN=/^([+-])(\d{2})(?::?(\d{2}))?$/;function oN(e){const t={},n=e.split(_c.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],_c.timeZoneDelimiter.test(t.date)&&(t.date=e.split(_c.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const s=_c.timezone.exec(r);s?(t.time=r.replace(s[1],""),t.timezone=s[1]):t.time=r}return t}function aN(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 s=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?s:i*100,restDateString:e.slice((r[1]||r[2]).length)}}function iN(e,t){if(t===null)return new Date(NaN);const n=e.match(nN);if(!n)return new Date(NaN);const r=!!n[4],s=bl(n[1]),i=bl(n[2])-1,l=bl(n[3]),u=bl(n[4]),f=bl(n[5])-1;if(r)return mN(t,u,f)?cN(t,u,f):new Date(NaN);{const h=new Date(0);return!fN(t,i,l)||!hN(t,s)?new Date(NaN):(h.setUTCFullYear(t,i,Math.max(s,l)),h)}}function bl(e){return e?parseInt(e):1}function lN(e){const t=e.match(rN);if(!t)return NaN;const n=zh(t[1]),r=zh(t[2]),s=zh(t[3]);return pN(n,r,s)?n*Sm+r*km+s*1e3:NaN}function zh(e){return e&&parseFloat(e.replace(",","."))||0}function uN(e){if(e==="Z")return 0;const t=e.match(sN);if(!t)return 0;const n=t[1]==="+"?-1:1,r=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return yN(r,s)?n*(r*Sm+s*km):NaN}function cN(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const s=r.getUTCDay()||7,i=(t-1)*7+n+1-s;return r.setUTCDate(r.getUTCDate()+i),r}const dN=[31,null,31,30,31,30,31,31,30,31,30,31];function uv(e){return e%400===0||e%4===0&&e%100!==0}function fN(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(dN[t]||(uv(e)?29:28))}function hN(e,t){return t>=1&&t<=(uv(e)?366:365)}function mN(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function pN(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function yN(e,t){return t>=0&&t<=59}function gN(e,t,n){const r=Tt(e,n==null?void 0:n.in),s=r.getFullYear(),i=r.getDate(),l=Pt(e,0);l.setFullYear(s,t,15),l.setHours(0,0,0,0);const u=JS(l);return r.setMonth(t,Math.min(i,u)),r}function xN(e,t,n){const r=Tt(e,n==null?void 0:n.in);return isNaN(+r)?Pt(e,NaN):(r.setFullYear(t),r)}function Bl(e,t,n){return Ti(e,-t,n)}function cv(e,t,n){return Nm(e,-t,n)}function dv(e,t,n){return yd(e,-t,n)}function Im(e,t,n){return gd(e,-t,n)}const bN="yyyy-MM-dd";function Dt(e){return dn(e,bN)}function vN(e){const t=new Date,n=Dt(t);switch(e){case"today":return{start_date:n,end_date:n};case"yesterday":{const r=Dt(Nr(t,1));return{start_date:r,end_date:r}}case"last_7_days":{const r=Dt(Nr(t,1));return{start_date:Dt(Nr(t,7)),end_date:r}}case"last_30_days":{const r=Dt(Nr(t,1));return{start_date:Dt(Nr(t,30)),end_date:r}}case"last_90_days":{const r=Dt(Nr(t,1));return{start_date:Dt(Nr(t,90)),end_date:r}}case"last_12_months":{const r=Dt(Nr(t,1));return{start_date:Dt(Bl(t,12)),end_date:r}}case"year_to_date":return{start_date:Dt(gi(t)),end_date:n};case"month_to_date":return{start_date:Dt(Xl(t)),end_date:n};case"quarter_to_date":return{start_date:Dt(Jc(t)),end_date:n};case"previous_month":{const r=Bl(t,1);return{start_date:Dt(Xl(r)),end_date:Dt(xd(r))}}case"previous_quarter":{const r=Bl(t,3);return{start_date:Dt(Jc(r)),end_date:Dt(_m(r))}}case"previous_year":{const r=Im(t,1);return{start_date:Dt(gi(r)),end_date:Dt(bd(r))}}default:return null}}function EN(e){const n=ca(new Date);if(e.direction==="current")switch(e.unit){case"day":return{start_date:Dt(n),end_date:Dt(n)};case"week":return{start_date:Dt($r(n,{weekStartsOn:1})),end_date:Dt(vd(n,{weekStartsOn:1}))};case"month":return{start_date:Dt(Xl(n)),end_date:Dt(xd(n))};case"quarter":return{start_date:Dt(Jc(n)),end_date:Dt(_m(n))};case"year":return{start_date:Dt(gi(n)),end_date:Dt(bd(n))}}const r=e.value??1;if(e.direction==="previous"){const u=e.includeToday?n:Nr(n,1),h={day:Nr,week:dv,month:Bl,quarter:cv,year:Im}[e.unit]((e.includeToday,n),r);return{start_date:Dt(h<u?h:u),end_date:Dt(h<u?u:h)}}const s=e.includeToday?n:Ls(n,1),l={day:Ls,week:yd,month:Ti,quarter:Nm,year:gd}[e.unit](s,r);return{start_date:Dt(s<l?s:l),end_date:Dt(s<l?l:s)}}function xi(e){if(e.start_date&&e.end_date)return e;const t=e.date_range;if(t==null)return e;if(typeof t=="string"){const n=vN(t);return n?{...e,start_date:n.start_date,end_date:n.end_date}:e}if(typeof t=="object"){const n=t;if(n.type==="custom"&&typeof n.start=="string"&&typeof n.end=="string")return{...e,start_date:n.start,end_date:n.end};if(n.type==="relative"){const r=EN(n);return{...e,start_date:r.start_date,end_date:r.end_date}}}return e}function fv(e,t){const n=ya(),r=ot(h=>h.globalFilters),s=ot(h=>h.chartFilters),i=ot(h=>h.crossFilters),l=ot(h=>h.getEffectiveFilters),u=N.useMemo(()=>Object.fromEntries(Object.entries(l(e)).filter(([h,p])=>p!=null&&p!==""&&!(Array.isArray(p)&&p.length===0))),[r,s,i,e]),f=N.useMemo(()=>{const h=xi(u);return t?{...h,...t}:h},[u,t]);return or({queryKey:["chartData",e,f,n],queryFn:()=>n?xt.queryPublicChart(e,f,n):xt.queryChart(e,f),enabled:!!e})}function TN(e){const t=ya(),n=ot(f=>f.globalFilters),r=ot(f=>f.chartFilters),s=ot(f=>f.crossFilters),i=ot(f=>f.getEffectiveFilters),l=N.useMemo(()=>Object.fromEntries(Object.entries(i(e)).filter(([f,h])=>h!=null&&h!==""&&!(Array.isArray(h)&&h.length===0))),[n,r,s,e]),u=N.useMemo(()=>xi(l),[l]);return or({queryKey:["chartWithData",e,u,t],queryFn:()=>t?xt.queryPublicChart(e,u,t,!0):xt.queryChart(e,u,{includeConfig:!0}),enabled:!!e})}function Mm(){const e=qn();return t=>{e.invalidateQueries({queryKey:["chartData",t]}),e.invalidateQueries({queryKey:["chartWithData",t]})}}function hv(){return or({queryKey:["dashboards"],queryFn:()=>xt.getDashboards()})}function T1(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 wN(e){return e.tabs?e.tabs[0]?T1(e.tabs[0].layout):[]:e.layout?T1(e.layout):[]}function kN(e,t){var l,u,f;const n=qn(),r=ot(h=>h.globalFilters),s=ya(),i=or({queryKey:["dashboard",e,t,s],queryFn:()=>s?xt.getPublicDashboard(e,s):xt.getDashboard(e,t),enabled:!!e});return N.useEffect(()=>{var h,p,y;if((h=i.data)!=null&&h.name&&((p=i.data)!=null&&p.layout||(y=i.data)!=null&&y.tabs)){const g=wN(i.data),b=xi(Object.fromEntries(Object.entries(r).filter(([O,w])=>w!=null)));g.forEach(O=>{n.prefetchQuery({queryKey:["chartWithData",O,b,s],queryFn:()=>s?xt.queryPublicChart(O,b,s,!0):xt.queryChart(O,b,{includeConfig:!0}),staleTime:1e3*60*5})})}},[(l=i.data)==null?void 0:l.layout,(u=i.data)==null?void 0:u.tabs,(f=i.data)==null?void 0:f.name,r,n,s]),i}function SN(e){const t=qn();return Za({mutationFn:({layout:n,message:r,tab:s,title:i,description:l})=>xt.saveDashboard(e,n,r,s),onSuccess:()=>{t.invalidateQueries({queryKey:["dashboard",e]})}})}function CN(){const e=qn();return()=>{e.invalidateQueries({queryKey:["chartData"]}),e.invalidateQueries({queryKey:["chartWithData"]})}}const NN=[["config"],["dashboard"],["dashboards"],["chartData"],["chartWithData"],["chart"]];function _N(){const e=qn(),t=N.useRef(1e3);N.useEffect(()=>{let n=null,r=null,s=!1;function i(){s||(n=new EventSource("/api/events"),n.addEventListener("config-change",()=>{t.current=1e3;for(const l of NN)e.invalidateQueries({queryKey:l})}),n.onopen=()=>{t.current=1e3},n.onerror=()=>{n==null||n.close(),n=null,s||(r=setTimeout(i,t.current),t.current=Math.min(t.current*2,3e4))})}return i(),()=>{s=!0,n==null||n.close(),r&&clearTimeout(r)}},[e])}const Lm=N.createContext(null),Dc="yc-theme-mode";function DN(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ON({configMode:e,children:t}){const n=N.useCallback(()=>{const f=localStorage.getItem(Dc);return f==="light"||f==="dark"?f:e==="light"||e==="dark"?e:DN()},[e]),[r,s]=N.useState(n);N.useEffect(()=>{if(localStorage.getItem(Dc)||e&&e!=="auto")return;const h=window.matchMedia("(prefers-color-scheme: dark)"),p=y=>s(y.matches?"dark":"light");return h.addEventListener("change",p),()=>h.removeEventListener("change",p)},[e]),N.useEffect(()=>{document.documentElement.setAttribute("data-theme",r)},[r]);const i=N.useCallback(()=>{s(f=>{const h=f==="light"?"dark":"light";return localStorage.setItem(Dc,h),h})},[]),l=N.useCallback(()=>{localStorage.removeItem(Dc),s(n())},[n]),u=N.useMemo(()=>({mode:r,toggleMode:i,clearOverride:l}),[r,i,l]);return d.jsx(Lm.Provider,{value:u,children:t})}function mv(){const e=N.useContext(Lm);if(!e)throw new Error("useThemeMode must be used within ThemeModeProvider");return e}function AN(){return N.useContext(Lm)}const Oc={textColor:"#6b7280",borderColor:"#e5e7eb",surfaceColor:"#ffffff",splitLineColor:"#e5e7eb"};function Ar(){const e=AN(),t=(e==null?void 0:e.mode)??"light";return N.useMemo(()=>{const n=getComputedStyle(document.documentElement);return{textColor:n.getPropertyValue("--yc-color-text-secondary").trim()||Oc.textColor,borderColor:n.getPropertyValue("--yc-color-border").trim()||Oc.borderColor,surfaceColor:n.getPropertyValue("--yc-color-surface").trim()||Oc.surfaceColor,splitLineColor:n.getPropertyValue("--yc-color-border").trim()||Oc.splitLineColor}},[t])}function w1(e,t){var i;const n=t.trim();if(!n)return e;const r=n.toLowerCase(),s=[];for(const l of e){const u=l.title.toLowerCase(),f=((i=l.description)==null?void 0:i.toLowerCase())??"",h=u.startsWith(r),p=u.includes(r),y=f.includes(r);h?s.push({item:l,rank:0}):p?s.push({item:l,rank:1}):y&&s.push({item:l,rank:2})}return s.sort((l,u)=>l.rank!==u.rank?l.rank-u.rank:l.item.title.localeCompare(u.item.title)),s.map(l=>l.item)}function IN(e,t){const[n,r]=N.useState(""),[s,i]=N.useState(0),l=N.useMemo(()=>{const g=w1(e,n),b=w1(t,n);return{dashboards:g,charts:b,all:[...g,...b]}},[e,t,n]),u=N.useCallback(g=>{r(g),i(0)},[]),f=N.useCallback(()=>{i(g=>Math.min(g+1,Math.max(l.all.length-1,0)))},[l.all.length]),h=N.useCallback(()=>{i(g=>Math.max(g-1,0))},[]),p=N.useCallback(()=>{r(""),i(0)},[]),y=l.all.length>0?l.all[s]??null:null;return{query:n,activeIndex:s,results:l,setQuery:u,setActiveIndex:i,moveDown:f,moveUp:h,resetSearch:p,activeItem:y}}function MN(e,t){return e.filter(n=>!n.charts||n.charts.length===0?!0:t?n.charts.includes(t):!1)}function pv(e){const t=ya(),{data:n,...r}=or({queryKey:["chartEvents"],queryFn:()=>xt.getChartEvents(),staleTime:3e4,enabled:!t}),s=(n==null?void 0:n.events)??[];return{events:N.useMemo(()=>n!=null&&n.events?MN(n.events,e):[],[n==null?void 0:n.events,e]),allEvents:s,...r}}const yv=new Set(["system-ui","serif","sans-serif","monospace","ui-monospace","cursive"]),LN={compact:"13px",default:"14px",comfortable:"16px"},RN={modern:{colors:{primary:"#3B82F6",background:"#f1f5f9",surface:"#ffffff",sidebar:"#ffffff",text:"#111827"},modeColors:{light:{primary:"#3B82F6",background:"#f1f5f9",surface:"#ffffff",sidebar:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",surfaceHover:"#f1f5f9",textMuted:"#9ca3af",inputBg:"#f9fafb",danger:"#ef4444",success:"#10b981"},dark:{primary:"#60a5fa",background:"#0f172a",surface:"#1e293b",sidebar:"#0f172a",text:"#f1f5f9",textSecondary:"#94a3b8",border:"#334155",surfaceHover:"#334155",textMuted:"#64748b",inputBg:"#1e293b",danger:"#f87171",success:"#34d399"}},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"},modeColors:{light:{primary:"#0ea5e9",background:"#f8fafc",surface:"#ffffff",sidebar:"#1e293b",text:"#0f172a",textSecondary:"#6b7280",border:"#e5e7eb",surfaceHover:"#f1f5f9",textMuted:"#9ca3af",inputBg:"#f9fafb",danger:"#ef4444",success:"#10b981"},dark:{primary:"#38bdf8",background:"#0c1322",surface:"#1a2332",sidebar:"#0c1322",text:"#e2e8f0",textSecondary:"#94a3b8",border:"#2d3a4a",surfaceHover:"#2d3a4a",textMuted:"#64748b",inputBg:"#1a2332",danger:"#f87171",success:"#34d399"}},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"},modeColors:{light:{primary:"#6366f1",background:"#f8fafc",surface:"#ffffff",sidebar:"#f1f5f9",text:"#1e293b",textSecondary:"#6b7280",border:"#e5e7eb",surfaceHover:"#f1f5f9",textMuted:"#9ca3af",inputBg:"#f9fafb",danger:"#ef4444",success:"#10b981"},dark:{primary:"#818cf8",background:"#0f172a",surface:"#1e293b",sidebar:"#1e293b",text:"#f1f5f9",textSecondary:"#94a3b8",border:"#334155",surfaceHover:"#334155",textMuted:"#64748b",inputBg:"#1e293b",danger:"#f87171",success:"#34d399"}},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 PN(e){const t=parseInt(e.replace("#",""),16),n=(t>>16)/255,r=(t>>8&255)/255,s=(t&255)/255,i=l=>l<=.03928?l/12.92:((l+.055)/1.055)**2.4;return .2126*i(n)+.7152*i(r)+.0722*i(s)}function k1(e,t){const n=parseInt(e.replace("#",""),16),r=Math.min(255,Math.max(0,(n>>16)+Math.round(2.55*t))),s=Math.min(255,Math.max(0,(n>>8&255)+Math.round(2.55*t))),i=Math.min(255,Math.max(0,(n&255)+Math.round(2.55*t)));return`#${((1<<24)+(r<<16)+(s<<8)+i).toString(16).slice(1)}`}function Wh(e){return yv.has(e)?`${e}, sans-serif`:e.toLowerCase().includes("mono")?`'${e}', monospace`:`'${e}', system-ui, sans-serif`}function jN(e,t="light"){var C,I,D,j,F,B,U,W,Y,Q,re,ye;const n=e.base??"modern",r=RN[n],s=r.modeColors[t],i=((C=e.colors)==null?void 0:C.primary)??s.primary,l=((I=e.colors)==null?void 0:I.background)??s.background,u=((D=e.colors)==null?void 0:D.surface)??s.surface,f=((j=e.colors)==null?void 0:j.sidebar)??s.sidebar,h=((F=e.colors)==null?void 0:F.text)??s.text,p=((B=e.fonts)==null?void 0:B.heading)??r.fonts.heading,y=((U=e.fonts)==null?void 0:U.body)??r.fonts.body,g=((W=e.fonts)==null?void 0:W.mono)??r.fonts.mono,b=LN[((Y=e.fonts)==null?void 0:Y.size)??r.fonts.size]??"14px",O=e.palette??r.palette,w=new Set;for(const G of[p,y,g])!yv.has(G)&&G!=="ui-monospace"&&w.add(G);const T=w.size>0?`https://fonts.googleapis.com/css2?${[...w].map(G=>`family=${encodeURIComponent(G)}:wght@400;500;600;700`).join("&")}&display=swap`:null,E=PN(f)<.2,_=E?"#f1f5f9":h,S=E?"#94a3b8":s.textSecondary,A=E?"rgba(255,255,255,0.1)":s.border,M={"--yc-color-primary":i,"--yc-color-primary-light":k1(i,t==="dark"?15:20),"--yc-color-primary-dark":k1(i,t==="dark"?-10:-15),"--yc-color-background":l,"--yc-color-surface":u,"--yc-color-sidebar":f,"--yc-color-text":h,"--yc-color-text-secondary":s.textSecondary,"--yc-color-border":s.border,"--yc-color-surface-hover":s.surfaceHover,"--yc-color-text-muted":s.textMuted,"--yc-color-input-bg":s.inputBg,"--yc-color-danger":s.danger,"--yc-color-success":s.success,"--yc-color-sidebar-text":_,"--yc-color-sidebar-text-secondary":S,"--yc-color-sidebar-border":A,"--yc-font-heading":Wh(p),"--yc-font-body":Wh(y),"--yc-font-mono":Wh(g),"--yc-font-size-base":b,"--yc-radius":r.radius,"--yc-shadow":r.shadow,"--yc-card-padding":r.cardPadding,"--yc-card-border":r.cardBorder,"--yc-grid-gap":"16px","--yc-topbar-height":"40px"};return{base:n,mode:t,cssVars:M,palette:O,sidebarShow:((Q=e.sidebar)==null?void 0:Q.show)??r.sidebarShow,sidebarLinks:(re=e.sidebar)==null?void 0:re.links,sidebarSections:(ye=e.sidebar)==null?void 0:ye.sections,logo:e.logo,favicon:e.favicon,title:e.title,customCss:e.customCss,googleFontsUrl:T}}const gv=N.createContext(null);function FN({children:e}){const{data:t}=ga(),{mode:n}=mv(),r=N.useMemo(()=>jN((t==null?void 0:t.theme)??{},n),[t==null?void 0:t.theme,n]);return N.useEffect(()=>{const s=document.documentElement;for(const[i,l]of Object.entries(r.cssVars))s.style.setProperty(i,l);return()=>{for(const i of Object.keys(r.cssVars))s.style.removeProperty(i)}},[r.cssVars]),N.useEffect(()=>{if(!r.googleFontsUrl)return;const s="yc-google-fonts";let i=document.getElementById(s);return i||(i=document.createElement("link"),i.id=s,i.rel="stylesheet",document.head.appendChild(i)),i.href=r.googleFontsUrl,()=>{i==null||i.remove()}},[r.googleFontsUrl]),N.useEffect(()=>{if(!r.customCss)return;const s="yc-custom-css";let i=document.getElementById(s);return i||(i=document.createElement("link"),i.id=s,i.rel="stylesheet",document.head.appendChild(i)),i.href="/api/theme/custom.css",()=>{i==null||i.remove()}},[r.customCss]),N.useEffect(()=>{const s=r.title||(t==null?void 0:t.name)||"Yamchart";document.title=s},[r.title,t==null?void 0:t.name]),N.useEffect(()=>{if(!r.favicon)return;const s="yc-favicon";let i=document.querySelector(`link#${s}`);i||(i=document.createElement("link"),i.id=s,i.rel="icon",document.head.appendChild(i)),i.href=`/api/assets/${r.favicon.replace(/^\.\/assets\//,"")}`},[r.favicon]),d.jsx(gv.Provider,{value:r,children:e})}function S1({children:e}){var r;const{data:t}=ga(),n=(r=t==null?void 0:t.theme)==null?void 0:r.mode;return d.jsx(ON,{configMode:n,children:d.jsx(FN,{children:e})})}function Rm(){const e=N.useContext(gv);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function xv(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=xv(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function $n(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=xv(e))&&(r&&(r+=" "),r+=t);return r}function Yc({type:e,className:t,style:n}){const r={className:t,style:n,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},s={strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5};switch(e){case"bar":return d.jsx("svg",{...r,children:d.jsx("path",{...s,d:"M3 20h18M5 20V10h3v10M10 20V4h3v16M15 20v-8h3v8"})});case"line":return d.jsx("svg",{...r,children:d.jsx("path",{...s,d:"M3 20h18M4 16l4-6 4 4 4-8 4 6"})});case"area":return d.jsxs("svg",{...r,children:[d.jsx("path",{...s,d:"M3 20h18"}),d.jsx("path",{...s,d:"M4 16l4-6 4 4 4-8 4 6v8H4z",fill:"currentColor",opacity:.15}),d.jsx("path",{...s,d:"M4 16l4-6 4 4 4-8 4 6"})]});case"pie":return d.jsxs("svg",{...r,children:[d.jsx("path",{...s,d:"M12 2a10 10 0 110 20 10 10 0 010-20z"}),d.jsx("path",{...s,d:"M12 2v10l8.66 5"})]});case"donut":return d.jsxs("svg",{...r,children:[d.jsx("circle",{...s,cx:"12",cy:"12",r:"10"}),d.jsx("circle",{...s,cx:"12",cy:"12",r:"5"}),d.jsx("path",{...s,d:"M12 2v5M22 12h-5"})]});case"scatter":return d.jsxs("svg",{...r,children:[d.jsx("path",{...s,d:"M3 20h18M3 20V4"}),d.jsx("circle",{cx:"7",cy:"15",r:"1.5",fill:"currentColor"}),d.jsx("circle",{cx:"10",cy:"10",r:"1.5",fill:"currentColor"}),d.jsx("circle",{cx:"13",cy:"13",r:"1.5",fill:"currentColor"}),d.jsx("circle",{cx:"15",cy:"7",r:"1.5",fill:"currentColor"}),d.jsx("circle",{cx:"18",cy:"9",r:"1.5",fill:"currentColor"})]});case"combo":return d.jsxs("svg",{...r,children:[d.jsx("path",{...s,d:"M3 20h18"}),d.jsx("path",{...s,d:"M5 20v-6h3v6M10 20v-10h3v10"}),d.jsx("path",{...s,d:"M5 10l4-3 4 2 5-5"})]});case"heatmap":return d.jsxs("svg",{...r,children:[d.jsx("rect",{...s,x:"3",y:"3",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.2}),d.jsx("rect",{...s,x:"10",y:"3",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.6}),d.jsx("rect",{...s,x:"17",y:"3",width:"4",height:"5",rx:"1",fill:"currentColor",opacity:.4}),d.jsx("rect",{...s,x:"3",y:"10",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.8}),d.jsx("rect",{...s,x:"10",y:"10",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.3}),d.jsx("rect",{...s,x:"17",y:"10",width:"4",height:"5",rx:"1",fill:"currentColor",opacity:.9}),d.jsx("rect",{...s,x:"3",y:"17",width:"5",height:"4",rx:"1",fill:"currentColor",opacity:.5}),d.jsx("rect",{...s,x:"10",y:"17",width:"5",height:"4",rx:"1",fill:"currentColor",opacity:.7}),d.jsx("rect",{...s,x:"17",y:"17",width:"4",height:"4",rx:"1",fill:"currentColor",opacity:.1})]});case"funnel":return d.jsx("svg",{...r,children:d.jsx("path",{...s,d:"M3 4h18l-3 5H6L3 4zM6 9h12l-2 5H8L6 9zM8 14h8l-2 5h-4l-2-5z"})});case"waterfall":return d.jsxs("svg",{...r,children:[d.jsx("path",{...s,d:"M3 20h18"}),d.jsx("path",{...s,d:"M5 8h3v4H5zM9 6h3v2H9zM13 10h3v4h-3zM17 6h3v8h-3"}),d.jsx("path",{...s,d:"M8 10h1M12 8h1",strokeDasharray:"2 1"})]});case"gauge":return d.jsxs("svg",{...r,children:[d.jsx("path",{...s,d:"M4.93 17.07A10 10 0 0112 2a10 10 0 017.07 15.07"}),d.jsx("path",{...s,d:"M12 12l-3-6",strokeWidth:2}),d.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"})]});case"kpi":case"metric":return d.jsxs("svg",{...r,children:[d.jsx("path",{...s,d:"M4 6h16M4 6v12a2 2 0 002 2h12a2 2 0 002-2V6"}),d.jsx("path",{...s,d:"M9 11h6M12 11v5",strokeWidth:2})]});case"table":return d.jsx("svg",{...r,children:d.jsx("path",{...s,d:"M3 5h18M3 10h18M3 15h18M3 20h18M8 5v15M15 5v15"})});default:return d.jsx("svg",{...r,children:d.jsx("path",{...s,d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"})})}}const C1=380,Rs=wm((e,t)=>({messages:[],panelOpen:!1,panelWidth:Number(localStorage.getItem("chat:panel-width"))||C1,isStreaming:!1,context:null,activeAgent:null,prefillMessage:null,savedCharts:[],panelMode:"panel",openPanel:(n,r)=>e(s=>{var f,h;const i=n.name?`chat:${n.type}:${n.name}`:"chat:general",l=localStorage.getItem(i),u=((f=s.context)==null?void 0:f.type)!==n.type||((h=s.context)==null?void 0:h.name)!==n.name?l?JSON.parse(l):[]:s.messages;return{panelOpen:!0,context:n,prefillMessage:r??null,messages:u}}),closePanel:()=>e({panelOpen:!1}),addUserMessage:n=>e(r=>({messages:[...r.messages,{role:"user",content:n,timestamp:Date.now()}]})),startAssistantMessage:n=>e(r=>({isStreaming:!0,activeAgent:n,messages:[...r.messages,{role:"assistant",content:"",timestamp:Date.now(),agent:n,toolCalls:[]}]})),appendText:n=>e(r=>{const s=[...r.messages],i=s[s.length-1];return(i==null?void 0:i.role)==="assistant"&&(s[s.length-1]={...i,content:i.content+n}),{messages:s}}),addToolStart:(n,r,s,i)=>e(l=>{const u=[...l.messages],f=u[u.length-1];if((f==null?void 0:f.role)==="assistant"){const h={id:n,name:r,args:s,status:"running"};if(i){const p=(f.toolCalls??[]).map(y=>y.id===i?{...y,children:[...y.children??[],h]}:y);u[u.length-1]={...f,toolCalls:p}}else{const p=[...f.toolCalls??[],h];u[u.length-1]={...f,toolCalls:p}}}return{messages:u}}),addToolEnd:(n,r,s,i)=>e(l=>{const u=[...l.messages],f=u[u.length-1];if((f==null?void 0:f.role)==="assistant"){const h=y=>y.id===n?{...y,status:"completed",result:s,durationMs:i}:y.children?{...y,children:y.children.map(h)}:y,p=(f.toolCalls??[]).map(h);u[u.length-1]={...f,toolCalls:p}}return{messages:u}}),addSuggestions:n=>e(r=>{const s=[...r.messages],i=s[s.length-1];return(i==null?void 0:i.role)==="assistant"&&(s[s.length-1]={...i,suggestions:n}),{messages:s}}),completeAssistantMessage:()=>e(n=>{const r=n.context,s=r!=null&&r.name?`chat:${r.type}:${r.name}`:"chat:general";try{localStorage.setItem(s,JSON.stringify(n.messages))}catch{}return{isStreaming:!1,activeAgent:null}}),setError:n=>e(r=>({isStreaming:!1,activeAgent:null,messages:[...r.messages,{role:"assistant",content:`Error: ${n}`,timestamp:Date.now()}]})),setPanelWidth:n=>{localStorage.setItem("chat:panel-width",String(n)),e({panelWidth:n})},clearConversation:()=>e(n=>{const r=n.context,s=r!=null&&r.name?`chat:${r.type}:${r.name}`:"chat:general";try{localStorage.removeItem(s)}catch{}return{messages:[]}}),reset:()=>e({messages:[],panelOpen:!1,panelWidth:C1,isStreaming:!1,context:null,activeAgent:null,prefillMessage:null,savedCharts:[],panelMode:"panel"}),addSavedChart:n=>e(r=>({savedCharts:r.savedCharts.includes(n)?r.savedCharts:[...r.savedCharts,n]})),setPanelMode:n=>e({panelMode:n}),snapshotExploreHistory:n=>{const r=t(),s=`chat:dashboard:${n}`;localStorage.setItem(s,JSON.stringify(r.messages))}}));function wd(){const{data:e}=or({queryKey:["chat-agents"],queryFn:()=>xt.getChatAgents().catch(()=>null),retry:!1,staleTime:6e4});return Array.isArray(e)&&e.length>0}const N1="yamchart-sidebar-folders";function BN(e){return e?e.replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()):"Ungrouped"}function _1(e){const t=new Map;for(const r of e){const s=r.folder??"";t.has(s)||t.set(s,[]),t.get(s).push(r)}const n=[];for(const[r,s]of t)s.sort((i,l)=>{const u=i.title||i.name,f=l.title||l.name;return u.localeCompare(f)}),n.push({folder:r,label:BN(r),items:s});return n.sort((r,s)=>!r.folder&&!s.folder?0:r.folder?s.folder?r.label.localeCompare(s.label):-1:1),n}function D1({expanded:e,className:t,style:n}){return d.jsx("svg",{className:$n("w-3.5 h-3.5 transition-transform",e&&"rotate-90",t),style:n,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}function O1({dashboards:e,charts:t,currentPath:n,onNavigate:r,collapsed:s=!1}){var C,I;const i=Rm(),l=wd(),u=n.split("?")[0],f=D=>u===D,h=((C=i.sidebarSections)==null?void 0:C.dashboards)!==!1,p=((I=i.sidebarSections)==null?void 0:I.charts)!==!1,y={backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)",borderColor:"var(--yc-color-primary)"},g=N.useMemo(()=>_1(e),[e]),b=N.useMemo(()=>_1(t),[t]),O=N.useMemo(()=>{for(const D of e)if(f(`/dashboards/${D.name}`))return D.folder??"";return null},[e,u]),w=N.useMemo(()=>{for(const D of t)if(f(`/charts/${D.name}`))return D.folder??"";return null},[t,u]),[T,E]=N.useState(()=>{try{const D=localStorage.getItem(N1);return D?JSON.parse(D):{}}catch{return{}}});N.useEffect(()=>{try{localStorage.setItem(N1,JSON.stringify(T))}catch{}},[T]);const _=N.useCallback((D,j)=>{const F=`${D}:${j}`;return D==="dashboards"&&O===j||D==="charts"&&w===j?!0:T[F]??!1},[T,O,w]),S=N.useCallback((D,j)=>{const F=`${D}:${j}`,B=D==="dashboards"&&O===j||D==="charts"&&w===j;E(U=>{const W=U[F]??B;return{...U,[F]:!W}})},[O,w]),A=g.length>1||g.some(D=>D.folder!==""),M=b.length>1||b.some(D=>D.folder!=="");return d.jsx("aside",{className:$n("yc-sidebar border-r flex flex-col transition-all overflow-hidden",s?"w-16":"w-56"),style:{backgroundColor:"var(--yc-color-sidebar)",borderColor:"var(--yc-color-sidebar-border)"},children:s?d.jsxs("div",{className:"py-3 flex flex-col items-center gap-1 overflow-y-auto",children:[h&&e.map(D=>{const j=`/dashboards/${D.name}`,F=f(j);return d.jsx("button",{onClick:()=>r(j),className:"p-2 rounded transition-colors",title:D.title,style:F?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-sidebar-text-secondary)"},children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})},D.name)}),h&&p&&e.length>0&&t.length>0&&d.jsx("div",{className:"w-8 border-t my-1",style:{borderColor:"var(--yc-color-sidebar-border)"}}),p&&t.map(D=>{const j=`/charts/${D.name}`,F=f(j);return d.jsx("button",{onClick:()=>r(j),className:"p-2 rounded transition-colors",title:D.title,style:F?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-sidebar-text-secondary)"},children:d.jsx(Yc,{type:D.type,className:"w-5 h-5"})},D.name)}),d.jsx("div",{className:"w-8 border-t my-1",style:{borderColor:"var(--yc-color-sidebar-border)"}}),d.jsx("button",{onClick:()=>r("/events"),className:"p-2 rounded transition-colors",title:"Events",style:f("/events")?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-sidebar-text-secondary)"},children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5"})})})]}):d.jsxs(d.Fragment,{children:[h&&e.length>0&&d.jsxs("div",{className:"py-2",children:[d.jsx("div",{className:"px-4 py-2 text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:"Dashboards"}),A?g.map(D=>{const j=_("dashboards",D.folder);return d.jsxs("div",{children:[d.jsxs("button",{onClick:()=>S("dashboards",D.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:[d.jsx(D1,{expanded:j}),d.jsx("span",{className:"truncate",children:D.label}),d.jsx("span",{className:"ml-auto opacity-50",children:D.items.length})]}),j&&D.items.map(F=>{const B=`/dashboards/${F.name}`,U=f(B);return d.jsxs("button",{onClick:()=>r(B),className:$n("w-full flex items-center gap-3 pl-8 pr-4 py-2 text-sm transition-colors",U&&"border-r-2"),style:U?y:{color:"var(--yc-color-sidebar-text)"},title:F.title,children:[d.jsx("svg",{className:"w-5 h-5 flex-shrink-0",style:{color:U?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{className:"truncate",children:F.title})]},F.name)})]},D.folder)}):e.map(D=>{const j=`/dashboards/${D.name}`,F=f(j);return d.jsxs("button",{onClick:()=>r(j),className:$n("w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors",F&&"border-r-2"),style:F?y:{color:"var(--yc-color-sidebar-text)"},title:D.title,children:[d.jsx("svg",{className:"w-5 h-5 flex-shrink-0",style:{color:F?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{className:"truncate",children:D.title})]},D.name)})]}),h&&p&&e.length>0&&t.length>0&&d.jsx("div",{className:"mx-4 border-t",style:{borderColor:"var(--yc-color-sidebar-border)"}}),p&&t.length>0&&d.jsxs("div",{className:"py-2 flex-1 overflow-y-auto",children:[d.jsx("div",{className:"px-4 py-2 text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:"Charts"}),M?b.map(D=>{const j=_("charts",D.folder);return d.jsxs("div",{children:[d.jsxs("button",{onClick:()=>S("charts",D.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:[d.jsx(D1,{expanded:j}),d.jsx("span",{className:"truncate",children:D.label}),d.jsx("span",{className:"ml-auto opacity-50",children:D.items.length})]}),j&&D.items.map(F=>{const B=`/charts/${F.name}`,U=f(B);return d.jsxs("button",{onClick:()=>r(B),className:$n("w-full flex items-center gap-3 pl-8 pr-4 py-2 text-sm transition-colors",U&&"border-r-2"),style:U?y:{color:"var(--yc-color-sidebar-text)"},title:F.title,children:[d.jsx(Yc,{type:F.type,className:"w-5 h-5 flex-shrink-0",style:{color:U?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"}}),d.jsx("span",{className:"truncate",children:F.title})]},F.name)})]},D.folder)}):t.map(D=>{const j=`/charts/${D.name}`,F=f(j);return d.jsxs("button",{onClick:()=>r(j),className:$n("w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors",F&&"border-r-2"),style:F?y:{color:"var(--yc-color-sidebar-text)"},title:D.title,children:[d.jsx(Yc,{type:D.type,className:"w-5 h-5 flex-shrink-0",style:{color:F?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"}}),d.jsx("span",{className:"truncate",children:D.title})]},D.name)})]}),i.sidebarLinks&&i.sidebarLinks.length>0&&d.jsx("div",{className:"py-2 border-t",style:{borderColor:"var(--yc-color-sidebar-border)"},children:i.sidebarLinks.map(D=>d.jsxs("a",{href:D.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:[d.jsx("svg",{className:"w-5 h-5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{className:"truncate",children:D.label})]},D.url))}),l&&d.jsx("div",{className:"py-2 border-t",style:{borderColor:"var(--yc-color-sidebar-border)"},children:d.jsxs("button",{onClick:()=>r("/explore"),className:$n("w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors",f("/explore")&&"border-r-2"),style:f("/explore")?y:{color:"var(--yc-color-sidebar-text)"},children:[d.jsx("svg",{className:"w-5 h-5 flex-shrink-0",style:{color:f("/explore")?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 15.803a7.5 7.5 0 0010.607 10.607z"})}),d.jsx("span",{children:"Explore"})]})}),l&&d.jsx("div",{className:"py-2 border-t",style:{borderColor:"var(--yc-color-sidebar-border)"},children:d.jsxs("button",{onClick:()=>Rs.getState().openPanel({type:"general"}),className:"flex items-center gap-2 px-3 py-2 rounded-md hover:bg-white/10 text-sm w-full",style:{color:"var(--yc-sidebar-text, var(--yc-color-sidebar-text))"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),"Chat"]})}),d.jsx("div",{className:"py-2 border-t mt-auto",style:{borderColor:"var(--yc-color-sidebar-border)"},children:d.jsxs("button",{onClick:()=>r("/events"),className:$n("w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors",f("/events")&&"border-r-2"),style:f("/events")?y:{color:"var(--yc-color-sidebar-text)"},children:[d.jsx("svg",{className:"w-5 h-5 flex-shrink-0",style:{color:f("/events")?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5"})}),d.jsx("span",{children:"Events"})]})})]})})}function HN({connection:e}){return d.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:[d.jsx("div",{className:"absolute -top-1 right-4 w-2 h-2 bg-gray-900 rotate-45"}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex justify-between gap-4",children:[d.jsx("span",{className:"text-gray-400",children:"Name"}),d.jsx("span",{className:"font-medium",children:e.name})]}),d.jsxs("div",{className:"flex justify-between gap-4",children:[d.jsx("span",{className:"text-gray-400",children:"Type"}),d.jsx("span",{className:"font-medium capitalize",children:e.type})]}),(e.type==="duckdb"||e.type==="sqlite")&&e.path&&d.jsxs("div",{className:"flex justify-between gap-4",children:[d.jsx("span",{className:"text-gray-400",children:"Path"}),d.jsx("span",{className:"font-medium truncate max-w-[120px]",title:e.path,children:e.path})]}),(e.type==="postgres"||e.type==="mysql")&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex justify-between gap-4",children:[d.jsx("span",{className:"text-gray-400",children:"Host"}),d.jsxs("span",{className:"font-medium",children:[e.host,":",e.port]})]}),d.jsxs("div",{className:"flex justify-between gap-4",children:[d.jsx("span",{className:"text-gray-400",children:"Database"}),d.jsx("span",{className:"font-medium",children:e.database})]}),e.schema&&d.jsxs("div",{className:"flex justify-between gap-4",children:[d.jsx("span",{className:"text-gray-400",children:"Schema"}),d.jsx("span",{className:"font-medium",children:e.schema})]})]}),e.type==="snowflake"&&d.jsxs(d.Fragment,{children:[e.account&&d.jsxs("div",{className:"flex justify-between gap-4",children:[d.jsx("span",{className:"text-gray-400",children:"Account"}),d.jsx("span",{className:"font-medium truncate max-w-[120px]",title:e.account,children:e.account})]}),e.warehouse&&d.jsxs("div",{className:"flex justify-between gap-4",children:[d.jsx("span",{className:"text-gray-400",children:"Warehouse"}),d.jsx("span",{className:"font-medium",children:e.warehouse})]}),e.database&&d.jsxs("div",{className:"flex justify-between gap-4",children:[d.jsx("span",{className:"text-gray-400",children:"Database"}),d.jsx("span",{className:"font-medium",children:e.database})]}),e.schema&&d.jsxs("div",{className:"flex justify-between gap-4",children:[d.jsx("span",{className:"text-gray-400",children:"Schema"}),d.jsx("span",{className:"font-medium",children:e.schema})]}),e.role&&d.jsxs("div",{className:"flex justify-between gap-4",children:[d.jsx("span",{className:"text-gray-400",children:"Role"}),d.jsx("span",{className:"font-medium",children:e.role})]})]})]})]})}function UN({status:e,connection:t,connectionStatus:n,authType:r}){const s=qn(),[i,l]=N.useState(!1),[u,f]=N.useState(null),h=n==="disconnected",p=n?n==="connected":e==="ok",y=h&&r==="externalbrowser",g=async()=>{l(!0),f(null);try{await xt.reconnect(),await s.invalidateQueries()}catch(b){f(b instanceof Error?b.message:"Reconnection failed")}finally{l(!1)}};return d.jsxs("div",{className:"relative group",children:[d.jsxs("div",{className:"flex items-center gap-2 cursor-default",children:[i?d.jsx("span",{className:"w-2 h-2 rounded-full animate-pulse",style:{backgroundColor:"var(--yc-color-warning, #f59e0b)"}}):d.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:p?"var(--yc-color-success)":"var(--yc-color-danger)"}}),d.jsx("span",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:i?"Reconnecting...":p?"Connected":"Disconnected"}),y&&!i&&d.jsx("button",{onClick:g,className:"text-xs px-2 py-0.5 rounded border hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)",color:"var(--yc-color-text-secondary)"},children:"Re-authenticate"})]}),u&&d.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 text-xs px-2 py-1 rounded shadow-lg",style:{backgroundColor:"var(--yc-color-danger)",color:"white"},children:u}),t&&d.jsx(HN,{connection:t})]})}const So=wm(e=>({auth:{status:"loading"},providers:[],checkAuth:async()=>{try{const t=await xt.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 cu?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 xt.authLogin({email:t,password:n});e({auth:{status:"authenticated",user:r}})},setup:async(t,n,r)=>{const{user:s}=await xt.authSetup({email:t,name:n,password:r});e({auth:{status:"authenticated",user:s}})},logout:async()=>{await xt.authLogout(),e({auth:{status:"unauthenticated"}})}}));function zN({onClose:e}){const[t,n]=N.useState(""),[r,s]=N.useState(""),[i,l]=N.useState(""),[u,f]=N.useState(""),[h,p]=N.useState(!1),[y,g]=N.useState(!1),b=async O=>{if(O.preventDefault(),f(""),r!==i){f("New passwords do not match");return}if(r.length<8){f("Password must be at least 8 characters");return}g(!0);try{await xt.authChangePassword({current_password:t,new_password:r}),p(!0),setTimeout(e,1500)}catch(w){f(w instanceof cu?w.message:"An error occurred")}finally{g(!1)}};return d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:e,children:d.jsxs("div",{className:"rounded-lg shadow-lg p-6 w-full max-w-md",style:{backgroundColor:"var(--yc-color-surface)"},onClick:O=>O.stopPropagation(),children:[d.jsx("h2",{className:"text-lg font-semibold mb-4",style:{color:"var(--yc-color-text)"},children:"Change Password"}),h?d.jsx("div",{className:"text-sm rounded-md px-4 py-3",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-success) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--yc-color-success) 30%, transparent)",color:"var(--yc-color-success)"},children:"Password changed successfully."}):d.jsxs("form",{onSubmit:b,className:"space-y-4",children:[u&&d.jsx("div",{className:"text-sm rounded-md px-4 py-3",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-danger) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--yc-color-danger) 30%, transparent)",color:"var(--yc-color-danger)"},children:u}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium mb-1",style:{color:"var(--yc-color-text-secondary)"},children:"Current Password"}),d.jsx("input",{type:"password",value:t,onChange:O=>n(O.target.value),required:!0,className:"w-full px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",style:{backgroundColor:"var(--yc-color-input-bg)",color:"var(--yc-color-text)",borderColor:"var(--yc-color-border)"}})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium mb-1",style:{color:"var(--yc-color-text-secondary)"},children:"New Password"}),d.jsx("input",{type:"password",value:r,onChange:O=>s(O.target.value),required:!0,minLength:8,className:"w-full px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",style:{backgroundColor:"var(--yc-color-input-bg)",color:"var(--yc-color-text)",borderColor:"var(--yc-color-border)"}})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium mb-1",style:{color:"var(--yc-color-text-secondary)"},children:"Confirm New Password"}),d.jsx("input",{type:"password",value:i,onChange:O=>l(O.target.value),required:!0,className:"w-full px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",style:{backgroundColor:"var(--yc-color-input-bg)",color:"var(--yc-color-text)",borderColor:"var(--yc-color-border)"}})]}),d.jsxs("div",{className:"flex justify-end gap-3",children:[d.jsx("button",{type:"button",onClick:e,className:"px-4 py-2 text-sm hover:bg-black/5 rounded-md",style:{color:"var(--yc-color-text-secondary)"},children:"Cancel"}),d.jsx("button",{type:"submit",disabled:y,className:"px-4 py-2 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50",children:y?"Saving...":"Change Password"})]})]})]})})}function WN({onNavigateToUsers:e,onNavigateToShares:t}){const n=So(h=>h.auth),r=So(h=>h.logout),[s,i]=N.useState(!1),[l,u]=N.useState(!1),f=N.useRef(null);return N.useEffect(()=>{const h=p=>{f.current&&!f.current.contains(p.target)&&i(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]),n.status!=="authenticated"?null:d.jsxs("div",{className:"relative",ref:f,children:[d.jsxs("button",{onClick:()=>i(!s),className:"flex items-center gap-2 text-sm px-2 py-1 rounded-md hover:bg-black/5",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("span",{className:"w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"},children:n.user.name.charAt(0).toUpperCase()}),d.jsx("span",{children:n.user.name})]}),s&&d.jsxs("div",{className:"absolute right-0 mt-1 w-48 rounded-md shadow-lg py-1 z-50",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[d.jsx("div",{className:"px-4 py-2 text-xs border-b",style:{color:"var(--yc-color-text-secondary)",borderColor:"var(--yc-color-border)"},children:n.user.email}),n.user.role==="admin"&&d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:()=>{i(!1),e()},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5",style:{color:"var(--yc-color-text-secondary)"},children:"User Management"}),t&&d.jsx("button",{onClick:()=>{i(!1),t()},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5",style:{color:"var(--yc-color-text-secondary)"},children:"Shared Links"})]}),d.jsx("button",{onClick:()=>{i(!1),u(!0)},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5",style:{color:"var(--yc-color-text-secondary)"},children:"Change Password"}),d.jsx("button",{onClick:()=>{i(!1),r()},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5",style:{color:"var(--yc-color-danger)"},children:"Sign Out"})]}),l&&d.jsx(zN,{onClose:()=>u(!1)})]})}function YN({onToggleSidebar:e,onOpenSearch:t,currentPath:n,onNavigateToUsers:r,onNavigateToShares:s}){var g;const i=Rm(),{mode:l,toggleMode:u}=mv(),{data:f}=$k(),h=So(b=>b.auth),p=n.replace(/\?.*$/,"").replace(/^\//,"").split("/").filter(Boolean).map(b=>decodeURIComponent(b).replace(/-/g," ").replace(/\b\w/g,O=>O.toUpperCase())),y=typeof i.logo=="string"?`/api/assets/${i.logo.replace(/^\.\/assets\//,"")}`:i.logo?`/api/assets/${(l==="dark"&&i.logo.dark?i.logo.dark:i.logo.light).replace(/^\.\/assets\//,"")}`:null;return d.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:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:e,className:"p-1.5 rounded hover:bg-black/5 transition-colors",title:"Toggle sidebar",children:d.jsx("svg",{className:"w-5 h-5",style:{color:"var(--yc-color-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),y&&d.jsx("img",{src:y,alt:"",className:"h-6 w-auto"}),d.jsx("nav",{className:"flex items-center gap-1.5 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:p.map((b,O)=>d.jsxs("span",{className:"flex items-center gap-1.5",children:[O>0&&d.jsx("span",{children:"/"}),d.jsx("span",{className:O===p.length-1?"font-medium":"",style:O===p.length-1?{color:"var(--yc-color-text)"}:void 0,children:b})]},O))})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("button",{onClick:t,className:"hidden sm:flex items-center gap-1.5 p-1.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},title:"Search (⌘K)",children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),d.jsx("kbd",{className:"px-1 py-0.5 rounded text-xs font-mono border",style:{borderColor:"var(--yc-color-border)",color:"var(--yc-color-text-secondary)",fontSize:"0.6rem",lineHeight:1},children:typeof navigator<"u"&&((g=navigator.platform)!=null&&g.includes("Mac"))?"⌘K":"Ctrl+K"})]}),d.jsx(UN,{status:f==null?void 0:f.status,connection:f==null?void 0:f.connection,connectionStatus:f==null?void 0:f.connectionStatus,authType:f==null?void 0:f.authType}),d.jsx("button",{onClick:u,className:"p-1.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},title:l==="dark"?"Switch to light mode":"Switch to dark mode",children:l==="dark"?d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})}),d.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["v",f==null?void 0:f.version]}),h.status==="authenticated"&&r&&d.jsx(WN,{onNavigateToUsers:r,onNavigateToShares:s})]})]})}function $N({className:e,style:t}){return d.jsx("svg",{className:e,style:t,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}function A1(e,t){if(!t.trim())return e;const n=e.toLowerCase().indexOf(t.toLowerCase());if(n===-1)return e;const r=e.slice(0,n),s=e.slice(n,n+t.length),i=e.slice(n+t.length);return d.jsxs(d.Fragment,{children:[r,d.jsx("mark",{style:{color:"var(--yc-color-primary)",backgroundColor:"transparent",fontWeight:600},children:s}),i]})}function qN(e,t,n=80){if(e.length<=n)return e;if(!t.trim())return e.slice(0,n)+"...";const r=e.toLowerCase().indexOf(t.toLowerCase());if(r===-1)return e.slice(0,n)+"...";r+t.length;const s=Math.floor((n-t.length)/2);let i=Math.max(0,r-s),l=Math.min(e.length,i+n);l===e.length&&(i=Math.max(0,l-n));let u=e.slice(i,l);return i>0&&(u="..."+u),l<e.length&&(u=u+"..."),u}function Yh({item:e,query:t,isActive:n,onClick:r,onMouseEnter:s}){const i=t.trim().toLowerCase(),l=i&&e.title.toLowerCase().includes(i),u=e.description&&(!i||!l);return d.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2 text-left transition-colors cursor-pointer",style:{backgroundColor:n?"var(--yc-color-surface-hover)":"transparent",color:"var(--yc-color-text)"},onClick:r,onMouseEnter:s,"data-active":n||void 0,children:[d.jsx("div",{className:"flex-shrink-0",style:{color:"var(--yc-color-text-secondary)"},children:e.kind==="dashboard"?d.jsx($N,{className:"w-5 h-5"}):e.kind==="explore"?d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 15.803a7.5 7.5 0 0010.607 10.607z"})}):d.jsx(Yc,{type:e.type,className:"w-5 h-5"})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("div",{className:"text-sm truncate",children:A1(e.title,t)}),u&&d.jsx("div",{className:"text-xs truncate mt-0.5",style:{color:"var(--yc-color-text-secondary)"},children:i?A1(qN(e.description,t),t):e.description})]})]})}function VN({isOpen:e,onClose:t,onNavigate:n,dashboards:r,charts:s}){const i=N.useRef(null),l=wd(),u=N.useMemo(()=>r.map(B=>({kind:"dashboard",name:B.name,title:B.title,description:B.description})),[r]),f=N.useMemo(()=>s.map(B=>({kind:"chart",name:B.name,title:B.title,description:B.description,type:B.type})),[s]),h=N.useMemo(()=>l?{kind:"explore",name:"explore",title:"Explore Data",description:"AI-powered data exploration workspace"}:null,[l]),{query:p,activeIndex:y,results:g,setQuery:b,setActiveIndex:O,moveDown:w,moveUp:T,resetSearch:E,activeItem:_}=IN(u,f),S=N.useMemo(()=>h?[...g.all,h]:g.all,[g.all,h]);N.useEffect(()=>{if(e){const B=setTimeout(()=>{var U;return(U=i.current)==null?void 0:U.focus()},50);return()=>clearTimeout(B)}else E()},[e,E]),N.useEffect(()=>{if(!e)return;const B=document.querySelector('[data-active="true"]');B&&B.scrollIntoView({block:"nearest"})},[e,y]);const A=h?S.length-1:-1,M=y===A&&h?h:_;if(N.useEffect(()=>{if(!e)return;function B(U){switch(U.key){case"ArrowDown":U.preventDefault(),y<S.length-1&&O(y+1);break;case"Tab":U.preventDefault(),U.shiftKey?y>0&&O(y-1):y<S.length-1&&O(y+1);break;case"ArrowUp":U.preventDefault(),y>0&&O(y-1);break;case"Enter":if(U.preventDefault(),M){if(M.kind==="explore")n("/explore");else{const W=M.kind==="dashboard"?`/dashboards/${M.name}`:`/charts/${M.name}`;n(W)}t()}break;case"Escape":U.preventDefault(),t();break}}return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[e,M,y,S.length,O,w,T,n,t]),!e)return null;const C=p.trim().length>0,I=C&&g.all.length===0,D=g.dashboards.length,j=h?g.all.length:-1;function F(B){if(B.kind==="explore")n("/explore");else{const U=B.kind==="dashboard"?`/dashboards/${B.name}`:`/charts/${B.name}`;n(U)}t()}return d.jsx("div",{className:"fixed inset-0 z-50 flex justify-center",style:{backgroundColor:"rgba(0, 0, 0, 0.5)"},onClick:B=>{B.target===B.currentTarget&&t()},children:d.jsxs("div",{className:"w-full max-w-lg rounded-xl shadow-2xl overflow-hidden",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)",marginTop:"15vh",height:"fit-content",maxHeight:"70vh"},children:[d.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b",style:{borderColor:"var(--yc-color-border)"},children:[d.jsx("svg",{className:"w-4 h-4 flex-shrink-0",style:{color:"var(--yc-color-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),d.jsx("input",{ref:i,type:"text",value:p,onChange:B=>b(B.target.value),placeholder:"Search dashboards and charts...",className:"flex-1 bg-transparent outline-none text-sm",style:{color:"var(--yc-color-text)"}}),C&&d.jsx("button",{onClick:()=>b(""),className:"p-0.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("div",{className:"overflow-y-auto py-2",style:{maxHeight:"20rem"},children:[I?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"px-3 py-8 text-center text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["No results for “",p,"”"]}),l&&p.trim()&&d.jsx("button",{onClick:()=>{Rs.getState().openPanel({type:"general"},p),t()},className:"flex items-center gap-2 px-4 py-2 w-full text-left text-sm hover:bg-white/5",style:{color:"var(--yc-color-primary)"},children:d.jsxs("span",{children:["Ask AI: “",p,"”"]})})]}):d.jsxs(d.Fragment,{children:[g.dashboards.length>0&&d.jsxs("div",{children:[d.jsx("div",{className:"px-3 py-1.5 text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-text-secondary)"},children:"Dashboards"}),g.dashboards.map((B,U)=>d.jsx(Yh,{item:B,query:p,isActive:U===y,onClick:()=>F(B),onMouseEnter:()=>O(U)},`dashboard-${B.name}`))]}),g.charts.length>0&&d.jsxs("div",{children:[d.jsx("div",{className:"px-3 py-1.5 text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-text-secondary)"},children:"Charts"}),g.charts.map((B,U)=>d.jsx(Yh,{item:B,query:p,isActive:D+U===y,onClick:()=>F(B),onMouseEnter:()=>O(D+U)},`chart-${B.name}`))]}),l&&p.trim()&&d.jsx("button",{onClick:()=>{Rs.getState().openPanel({type:"general"},p),t()},className:"flex items-center gap-2 px-4 py-2 w-full text-left text-sm hover:bg-white/5",style:{color:"var(--yc-color-primary)"},children:d.jsxs("span",{children:["Ask AI: “",p,"”"]})})]}),h&&d.jsx("div",{className:g.all.length>0||I?"border-t mt-1 pt-1":"",style:{borderColor:"var(--yc-color-border)"},children:d.jsx(Yh,{item:h,query:p,isActive:j===y,onClick:()=>F(h),onMouseEnter:()=>O(j)})})]})]})})}function QN(e){const t=N.useRef(null),{addUserMessage:n,startAssistantMessage:r,appendText:s,addToolStart:i,addToolEnd:l,addSuggestions:u,completeAssistantMessage:f,setError:h,messages:p,context:y,isStreaming:g}=Rs(),b=ot(T=>T.setGlobalFilter),O=N.useCallback(async(T,E)=>{var A,M;if(g)return;n(T),(A=t.current)==null||A.abort();const _=new AbortController;t.current=_;const S=E??y;try{const C=await fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:T,context:S,history:p}),signal:_.signal});if(!C.ok){const B=await C.json().catch(()=>({error:"Chat request failed"}));h(B.error??`HTTP ${C.status}`);return}const I=(M=C.body)==null?void 0:M.getReader();if(!I){h("No response stream");return}const D=new TextDecoder;let j="",F=!1;for(;;){const{done:B,value:U}=await I.read();if(B)break;j+=D.decode(U,{stream:!0});const W=j.split(`
|
|
34
|
-
`);j=W.pop()??"";let Y="",Q="";for(const re of W)if(re.startsWith("event: "))Y=re.slice(7).trim();else if(re.startsWith("data: "))Q=re.slice(6);else if(re===""&&Y&&Q){try{const ye=JSON.parse(Q);switch(Y){case"agent_selected":F||(r(ye.name),F=!0);break;case"text_delta":F||(r("assistant"),F=!0),s(ye.text);break;case"tool_start":F||(r("assistant"),F=!0),i(ye.id,ye.name,ye.args,ye.parentToolId);break;case"tool_end":l(ye.id,ye.name,ye.result,ye.durationMs);break;case"suggestions":u(ye.suggestions);break;case"filter_update":if(ye.filters)for(const[G,fe]of Object.entries(ye.filters))b(G,fe);break;case"chart_saved":Rs.getState().addSavedChart(ye.name);break;case"navigate":e&&e(ye.target,ye.name,ye.edit);break;case"done":f();break;case"error":h(ye.message);break}}catch{}Y="",Q=""}}F&&f()}catch(C){C.name!=="AbortError"&&h(C instanceof Error?C.message:"Connection failed")}},[p,y,g,n,r,s,i,l,u,f,h,b,e]),w=N.useCallback(()=>{var T;(T=t.current)==null||T.abort(),f()},[f]);return{sendMessage:O,abort:w}}function I1(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const l=n.slice(s,r).trim();(l||!i)&&t.push(l),s=r+1,r=n.indexOf(",",s)}return t}function bv(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const GN=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,KN=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XN={};function M1(e,t){return(XN.jsx?KN:GN).test(e)}const JN=/[ \t\n\f\r]/g;function ZN(e){return typeof e=="object"?e.type==="text"?L1(e.value):!1:L1(e)}function L1(e){return e.replace(JN,"")===""}class du{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}du.prototype.normal={};du.prototype.property={};du.prototype.space=void 0;function vv(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new du(n,r,t)}function Jl(e){return e.toLowerCase()}class ar{constructor(t,n){this.attribute=n,this.property=t}}ar.prototype.attribute="";ar.prototype.booleanish=!1;ar.prototype.boolean=!1;ar.prototype.commaOrSpaceSeparated=!1;ar.prototype.commaSeparated=!1;ar.prototype.defined=!1;ar.prototype.mustUseProperty=!1;ar.prototype.number=!1;ar.prototype.overloadedBoolean=!1;ar.prototype.property="";ar.prototype.spaceSeparated=!1;ar.prototype.space=void 0;let e3=0;const Et=ba(),bn=ba(),$0=ba(),Oe=ba(),qt=ba(),ei=ba(),dr=ba();function ba(){return 2**++e3}const q0=Object.freeze(Object.defineProperty({__proto__:null,boolean:Et,booleanish:bn,commaOrSpaceSeparated:dr,commaSeparated:ei,number:Oe,overloadedBoolean:$0,spaceSeparated:qt},Symbol.toStringTag,{value:"Module"})),$h=Object.keys(q0);class Pm extends ar{constructor(t,n,r,s){let i=-1;if(super(t,n),R1(this,"space",s),typeof r=="number")for(;++i<$h.length;){const l=$h[i];R1(this,$h[i],(r&q0[l])===q0[l])}}}Pm.prototype.defined=!0;function R1(e,t,n){n&&(e[t]=n)}function ki(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new Pm(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Jl(r)]=r,n[Jl(i.attribute)]=r}return new du(t,n,e.space)}const Ev=ki({properties:{ariaActiveDescendant:null,ariaAtomic:bn,ariaAutoComplete:null,ariaBusy:bn,ariaChecked:bn,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:qt,ariaCurrent:null,ariaDescribedBy:qt,ariaDetails:null,ariaDisabled:bn,ariaDropEffect:qt,ariaErrorMessage:null,ariaExpanded:bn,ariaFlowTo:qt,ariaGrabbed:bn,ariaHasPopup:null,ariaHidden:bn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qt,ariaLevel:Oe,ariaLive:null,ariaModal:bn,ariaMultiLine:bn,ariaMultiSelectable:bn,ariaOrientation:null,ariaOwns:qt,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:bn,ariaReadOnly:bn,ariaRelevant:null,ariaRequired:bn,ariaRoleDescription:qt,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:bn,ariaSetSize:Oe,ariaSort:null,ariaValueMax:Oe,ariaValueMin:Oe,ariaValueNow:Oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Tv(e,t){return t in e?e[t]:t}function wv(e,t){return Tv(e,t.toLowerCase())}const t3=ki({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ei,acceptCharset:qt,accessKey:qt,action:null,allow:null,allowFullScreen:Et,allowPaymentRequest:Et,allowUserMedia:Et,alt:null,as:null,async:Et,autoCapitalize:null,autoComplete:qt,autoFocus:Et,autoPlay:Et,blocking:qt,capture:null,charSet:null,checked:Et,cite:null,className:qt,cols:Oe,colSpan:null,content:null,contentEditable:bn,controls:Et,controlsList:qt,coords:Oe|ei,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Et,defer:Et,dir:null,dirName:null,disabled:Et,download:$0,draggable:bn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Et,formTarget:null,headers:qt,height:Oe,hidden:$0,high:Oe,href:null,hrefLang:null,htmlFor:qt,httpEquiv:qt,id:null,imageSizes:null,imageSrcSet:null,inert:Et,inputMode:null,integrity:null,is:null,isMap:Et,itemId:null,itemProp:qt,itemRef:qt,itemScope:Et,itemType:qt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Et,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:Et,muted:Et,name:null,nonce:null,noModule:Et,noValidate:Et,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:Et,optimum:Oe,pattern:null,ping:qt,placeholder:null,playsInline:Et,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Et,referrerPolicy:null,rel:qt,required:Et,reversed:Et,rows:Oe,rowSpan:Oe,sandbox:qt,scope:null,scoped:Et,seamless:Et,selected:Et,shadowRootClonable:Et,shadowRootDelegatesFocus:Et,shadowRootMode:null,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:bn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oe,step:null,style:null,tabIndex:Oe,target:null,title:null,translate:null,type:null,typeMustMatch:Et,useMap:null,value:bn,width:Oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:qt,axis:null,background:null,bgColor:null,border:Oe,borderColor:null,bottomMargin:Oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Et,declare:Et,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:Et,noHref:Et,noShade:Et,noWrap:Et,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:bn,standby:null,summary:null,text:null,topMargin:Oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Et,disableRemotePlayback:Et,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:wv}),n3=ki({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:dr,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:qt,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:Oe,diffuseConstant:Oe,direction:null,display:null,dur:null,divisor:Oe,dominantBaseline:null,download:Et,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oe,enableBackground:null,end:null,event:null,exponent:Oe,externalResourcesRequired:null,fill:null,fillOpacity:Oe,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:ei,g2:ei,glyphName:ei,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:dr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,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:Oe,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:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:dr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:dr,rev:dr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:dr,requiredFeatures:dr,requiredFonts:dr,requiredFormats:dr,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:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:dr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:dr,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:dr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Tv}),kv=ki({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()}}),Sv=ki({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:wv}),Cv=ki({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),r3={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"},s3=/[A-Z]/g,P1=/-[a-z]/g,o3=/^data[-\w.:]+$/i;function kd(e,t){const n=Jl(t);let r=t,s=ar;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&o3.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(P1,i3);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!P1.test(i)){let l=i.replace(s3,a3);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=Pm}return new s(r,t)}function a3(e){return"-"+e.toLowerCase()}function i3(e){return e.charAt(1).toUpperCase()}const fu=vv([Ev,t3,kv,Sv,Cv],"html"),No=vv([Ev,n3,kv,Sv,Cv],"svg");function j1(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Nv(e){return e.join(" ").trim()}var Va={},qh,F1;function l3(){if(F1)return qh;F1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,f=`
|
|
35
|
-
`,h="/",p="*",y="",g="comment",b="declaration";function O(T,E){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];E=E||{};var _=1,S=1;function A(Y){var Q=Y.match(t);Q&&(_+=Q.length);var re=Y.lastIndexOf(f);S=~re?Y.length-re:S+Y.length}function M(){var Y={line:_,column:S};return function(Q){return Q.position=new C(Y),j(),Q}}function C(Y){this.start=Y,this.end={line:_,column:S},this.source=E.source}C.prototype.content=T;function I(Y){var Q=new Error(E.source+":"+_+":"+S+": "+Y);if(Q.reason=Y,Q.filename=E.source,Q.line=_,Q.column=S,Q.source=T,!E.silent)throw Q}function D(Y){var Q=Y.exec(T);if(Q){var re=Q[0];return A(re),T=T.slice(re.length),Q}}function j(){D(n)}function F(Y){var Q;for(Y=Y||[];Q=B();)Q!==!1&&Y.push(Q);return Y}function B(){var Y=M();if(!(h!=T.charAt(0)||p!=T.charAt(1))){for(var Q=2;y!=T.charAt(Q)&&(p!=T.charAt(Q)||h!=T.charAt(Q+1));)++Q;if(Q+=2,y===T.charAt(Q-1))return I("End of comment missing");var re=T.slice(2,Q-2);return S+=2,A(re),T=T.slice(Q),S+=2,Y({type:g,comment:re})}}function U(){var Y=M(),Q=D(r);if(Q){if(B(),!D(s))return I("property missing ':'");var re=D(i),ye=Y({type:b,property:w(Q[0].replace(e,y)),value:re?w(re[0].replace(e,y)):y});return D(l),ye}}function W(){var Y=[];F(Y);for(var Q;Q=U();)Q!==!1&&(Y.push(Q),F(Y));return Y}return j(),W()}function w(T){return T?T.replace(u,y):y}return qh=O,qh}var B1;function u3(){if(B1)return Va;B1=1;var e=Va&&Va.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Va,"__esModule",{value:!0}),Va.default=n;const t=e(l3());function n(r,s){let i=null;if(!r||typeof r!="string")return i;const l=(0,t.default)(r),u=typeof s=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:p}=f;u?s(h,p,f):p&&(i=i||{},i[h]=p)}),i}return Va}var vl={},H1;function c3(){if(H1)return vl;H1=1,Object.defineProperty(vl,"__esModule",{value:!0}),vl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(h){return!h||n.test(h)||e.test(h)},l=function(h,p){return p.toUpperCase()},u=function(h,p){return"".concat(p,"-")},f=function(h,p){return p===void 0&&(p={}),i(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(s,u):h=h.replace(r,u),h.replace(t,l))};return vl.camelCase=f,vl}var El,U1;function d3(){if(U1)return El;U1=1;var e=El&&El.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(u3()),n=c3();function r(s,i){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(u,f){u&&f&&(l[(0,n.camelCase)(u,i)]=f)}),l}return r.default=r,El=r,El}var f3=d3();const h3=Ab(f3),Sd=_v("end"),fs=_v("start");function _v(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 m3(e){const t=fs(e),n=Sd(e);if(t&&n)return{start:t,end:n}}function Hl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?z1(e.position):"start"in e||"end"in e?z1(e):"line"in e||"column"in e?V0(e):""}function V0(e){return W1(e&&e.line)+":"+W1(e&&e.column)}function z1(e){return V0(e&&e.start)+"-"+V0(e&&e.end)}function W1(e){return e&&typeof e=="number"?e:1}class Hn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},l=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?s=t:!i.cause&&t&&(l=!0,s=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?i.ruleId=r:(i.source=r.slice(0,f),i.ruleId=r.slice(f+1))}if(!i.place&&i.ancestors&&i.ancestors){const f=i.ancestors[i.ancestors.length-1];f&&(i.place=f.position)}const u=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=u?u.line:void 0,this.name=Hl(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Hn.prototype.file="";Hn.prototype.name="";Hn.prototype.reason="";Hn.prototype.message="";Hn.prototype.stack="";Hn.prototype.column=void 0;Hn.prototype.line=void 0;Hn.prototype.ancestors=void 0;Hn.prototype.cause=void 0;Hn.prototype.fatal=void 0;Hn.prototype.place=void 0;Hn.prototype.ruleId=void 0;Hn.prototype.source=void 0;const jm={}.hasOwnProperty,p3=new Map,y3=/[A-Z]/g,g3=new Set(["table","tbody","thead","tfoot","tr"]),x3=new Set(["td","th"]),Dv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function b3(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=N3(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=C3(n,t.jsx,t.jsxs)}const s={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"?No:fu,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Ov(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function Ov(e,t,n){if(t.type==="element")return v3(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return E3(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return w3(e,t,n);if(t.type==="mdxjsEsm")return T3(e,t);if(t.type==="root")return k3(e,t,n);if(t.type==="text")return S3(e,t)}function v3(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=No,e.schema=s),e.ancestors.push(t);const i=Iv(e,t.tagName,!1),l=_3(e,t);let u=Bm(e,t);return g3.has(t.tagName)&&(u=u.filter(function(f){return typeof f=="string"?!ZN(f):!0})),Av(e,l,i,t),Fm(l,u),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function E3(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)}Zl(e,t.position)}function T3(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Zl(e,t.position)}function w3(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=No,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:Iv(e,t.name,!0),l=D3(e,t),u=Bm(e,t);return Av(e,l,i,t),Fm(l,u),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function k3(e,t,n){const r={};return Fm(r,Bm(e,t)),e.create(t,e.Fragment,r,n)}function S3(e,t){return t.value}function Av(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Fm(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function C3(e,t,n){return r;function r(s,i,l,u){const h=Array.isArray(l.children)?n:t;return u?h(i,l,u):h(i,l)}}function N3(e,t){return n;function n(r,s,i,l){const u=Array.isArray(i.children),f=fs(r);return t(s,i,l,u,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function _3(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&jm.call(t.properties,s)){const i=O3(e,s,t.properties[s]);if(i){const[l,u]=i;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&x3.has(t.tagName)?r=u:n[l]=u}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function D3(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const l=i.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else Zl(e,t.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,i=e.evaluater.evaluateExpression(u.expression)}else Zl(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function Bm(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:p3;for(;++r<t.children.length;){const i=t.children[r];let l;if(e.passKeys){const f=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(f){const h=s.get(f)||0;l=f+"-"+h,s.set(f,h+1)}}const u=Ov(e,i,l);u!==void 0&&n.push(u)}return n}function O3(e,t,n){const r=kd(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?bv(n):Nv(n)),r.property==="style"){let s=typeof n=="object"?n:A3(e,String(n));return e.stylePropertyNameCase==="css"&&(s=I3(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?r3[r.property]||r.property:r.attribute,n]}}function A3(e,t){try{return h3(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new Hn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=Dv+"#cannot-parse-style-attribute",s}}function Iv(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let i=-1,l;for(;++i<s.length;){const u=M1(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(i&&u.type==="Literal"),optional:!1}:u}r=l}else r=M1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return jm.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Zl(e)}function Zl(e,t){const n=new Hn("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=Dv+"#cannot-handle-mdx-estrees-without-createevaluater",n}function I3(e){const t={};let n;for(n in e)jm.call(e,n)&&(t[M3(n)]=e[n]);return t}function M3(e){let t=e.replace(y3,L3);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function L3(e){return"-"+e.toLowerCase()}const Vh={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"]},R3={};function P3(e,t){const n=R3,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Mv(e,r,s)}function Mv(e,t,n){if(j3(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 Y1(e.children,t,n)}return Array.isArray(e)?Y1(e,t,n):""}function Y1(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=Mv(e[s],t,n);return r.join("")}function j3(e){return!!(e&&typeof e=="object")}const $1=document.createElement("i");function Hm(e){const t="&"+e+";";$1.innerHTML=t;const n=$1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ds(e,t,n,r){const s=e.length;let i=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);i<r.length;)l=r.slice(i,i+1e4),l.unshift(t,0),e.splice(...l),i+=1e4,t+=1e4}function Dr(e,t){return e.length>0?(ds(e,e.length,0,t),e):t}const q1={}.hasOwnProperty;function F3(e){const t={};let n=-1;for(;++n<e.length;)B3(t,e[n]);return t}function B3(e,t){let n;for(n in t){const s=(q1.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let l;if(i)for(l in i){q1.call(s,l)||(s[l]=[]);const u=i[l];H3(s[l],Array.isArray(u)?u:u?[u]:[])}}}function H3(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ds(e,0,0,r)}function Lv(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 ti(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ls=_o(/[A-Za-z]/),mr=_o(/[\dA-Za-z]/),U3=_o(/[#-'*+\--9=?A-Z^-~]/);function Q0(e){return e!==null&&(e<32||e===127)}const G0=_o(/\d/),z3=_o(/[\dA-Fa-f]/),W3=_o(/[!-/:-@[-`{-~]/);function mt(e){return e!==null&&e<-2}function sr(e){return e!==null&&(e<0||e===32)}function It(e){return e===-2||e===-1||e===32}const Y3=_o(new RegExp("\\p{P}|\\p{S}","u")),$3=_o(/\s/);function _o(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Si(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let l="";if(i===37&&mr(e.charCodeAt(n+1))&&mr(e.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(l=String.fromCharCode(i));else if(i>55295&&i<57344){const u=e.charCodeAt(n+1);i<56320&&u>56319&&u<57344?(l=String.fromCharCode(i,u),s=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function Vt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(f){return It(f)?(e.enter(n),u(f)):t(f)}function u(f){return It(f)&&i++<s?(e.consume(f),u):(e.exit(n),t(f))}}const q3={tokenize:V3};function V3(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Vt(e,t,"linePrefix")}function s(u){return e.enter("paragraph"),i(u)}function i(u){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return mt(u)?(e.consume(u),e.exit("chunkText"),i):(e.consume(u),l)}}const Q3={tokenize:G3},V1={tokenize:K3};function G3(e){const t=this,n=[];let r=0,s,i,l;return u;function u(S){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,f,h)(S)}return h(S)}function f(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&_();const A=t.events.length;let M=A,C;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){C=t.events[M][1].end;break}E(r);let I=A;for(;I<t.events.length;)t.events[I][1].end={...C},I++;return ds(t.events,M+1,0,t.events.slice(A)),t.events.length=I,h(S)}return u(S)}function h(S){if(r===n.length){if(!s)return g(S);if(s.currentConstruct&&s.currentConstruct.concrete)return O(S);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(V1,p,y)(S)}function p(S){return s&&_(),E(r),g(S)}function y(S){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,O(S)}function g(S){return t.containerState={},e.attempt(V1,b,O)(S)}function b(S){return r++,n.push([t.currentConstruct,t.containerState]),g(S)}function O(S){if(S===null){s&&_(),E(0),e.consume(S);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),w(S)}function w(S){if(S===null){T(e.exit("chunkFlow"),!0),E(0),e.consume(S);return}return mt(S)?(e.consume(S),T(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(S),w)}function T(S,A){const M=t.sliceStream(S);if(A&&M.push(null),S.previous=i,i&&(i.next=S),i=S,s.defineSkip(S.start),s.write(M),t.parser.lazy[S.start.line]){let C=s.events.length;for(;C--;)if(s.events[C][1].start.offset<l&&(!s.events[C][1].end||s.events[C][1].end.offset>l))return;const I=t.events.length;let D=I,j,F;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(j){F=t.events[D][1].end;break}j=!0}for(E(r),C=I;C<t.events.length;)t.events[C][1].end={...F},C++;ds(t.events,D+1,0,t.events.slice(I)),t.events.length=C}}function E(S){let A=n.length;for(;A-- >S;){const M=n[A];t.containerState=M[1],M[0].exit.call(t,e)}n.length=S}function _(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function K3(e,t,n){return Vt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Q1(e){if(e===null||sr(e)||$3(e))return 1;if(Y3(e))return 2}function Um(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const i=e[s].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const K0={name:"attention",resolveAll:X3,tokenize:J3};function X3(e,t){let n=-1,r,s,i,l,u,f,h,p;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;f=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 y={...e[r][1].end},g={...e[n][1].start};G1(y,-f),G1(g,f),l={type:f>1?"strongSequence":"emphasisSequence",start:y,end:{...e[r][1].end}},u={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},i={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:f>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=Dr(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=Dr(h,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",i,t]]),h=Dr(h,Um(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=Dr(h,[["exit",i,t],["enter",u,t],["exit",u,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,h=Dr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,ds(e,r-1,n-r+3,h),n=r+h.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function J3(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=Q1(r);let i;return l;function l(f){return i=f,e.enter("attentionSequence"),u(f)}function u(f){if(f===i)return e.consume(f),u;const h=e.exit("attentionSequence"),p=Q1(f),y=!p||p===2&&s||n.includes(f),g=!s||s===2&&p||n.includes(r);return h._open=!!(i===42?y:y&&(s||!g)),h._close=!!(i===42?g:g&&(p||!y)),t(f)}}function G1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Z3={name:"autolink",tokenize:e_};function e_(e,t,n){let r=0;return s;function s(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(b){return ls(b)?(e.consume(b),l):b===64?n(b):h(b)}function l(b){return b===43||b===45||b===46||mr(b)?(r=1,u(b)):h(b)}function u(b){return b===58?(e.consume(b),r=0,f):(b===43||b===45||b===46||mr(b))&&r++<32?(e.consume(b),u):(r=0,h(b))}function f(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||Q0(b)?n(b):(e.consume(b),f)}function h(b){return b===64?(e.consume(b),p):U3(b)?(e.consume(b),h):n(b)}function p(b){return mr(b)?y(b):n(b)}function y(b){return b===46?(e.consume(b),r=0,p):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):g(b)}function g(b){if((b===45||mr(b))&&r++<63){const O=b===45?g:y;return e.consume(b),O}return n(b)}}const Cd={partial:!0,tokenize:t_};function t_(e,t,n){return r;function r(i){return It(i)?Vt(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||mt(i)?t(i):n(i)}}const Rv={continuation:{tokenize:r_},exit:s_,name:"blockQuote",tokenize:n_};function n_(e,t,n){const r=this;return s;function s(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),i}return n(l)}function i(l){return It(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function r_(e,t,n){const r=this;return s;function s(l){return It(l)?Vt(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):i(l)}function i(l){return e.attempt(Rv,t,n)(l)}}function s_(e){e.exit("blockQuote")}const Pv={name:"characterEscape",tokenize:o_};function o_(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),s}function s(i){return W3(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const jv={name:"characterReference",tokenize:a_};function a_(e,t,n){const r=this;let s=0,i,l;return u;function u(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),f}function f(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),i=31,l=mr,p(y))}function h(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,l=z3,p):(e.enter("characterReferenceValue"),i=7,l=G0,p(y))}function p(y){if(y===59&&s){const g=e.exit("characterReferenceValue");return l===mr&&!Hm(r.sliceSerialize(g))?n(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(y)&&s++<i?(e.consume(y),p):n(y)}}const K1={partial:!0,tokenize:l_},X1={concrete:!0,name:"codeFenced",tokenize:i_};function i_(e,t,n){const r=this,s={partial:!0,tokenize:M};let i=0,l=0,u;return f;function f(C){return h(C)}function h(C){const I=r.events[r.events.length-1];return i=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,u=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(C)}function p(C){return C===u?(l++,e.consume(C),p):l<3?n(C):(e.exit("codeFencedFenceSequence"),It(C)?Vt(e,y,"whitespace")(C):y(C))}function y(C){return C===null||mt(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(K1,w,A)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===null||mt(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(C)):It(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Vt(e,b,"whitespace")(C)):C===96&&C===u?n(C):(e.consume(C),g)}function b(C){return C===null||mt(C)?y(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),O(C))}function O(C){return C===null||mt(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(C)):C===96&&C===u?n(C):(e.consume(C),O)}function w(C){return e.attempt(s,A,T)(C)}function T(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),E}function E(C){return i>0&&It(C)?Vt(e,_,"linePrefix",i+1)(C):_(C)}function _(C){return C===null||mt(C)?e.check(K1,w,A)(C):(e.enter("codeFlowValue"),S(C))}function S(C){return C===null||mt(C)?(e.exit("codeFlowValue"),_(C)):(e.consume(C),S)}function A(C){return e.exit("codeFenced"),t(C)}function M(C,I,D){let j=0;return F;function F(Q){return C.enter("lineEnding"),C.consume(Q),C.exit("lineEnding"),B}function B(Q){return C.enter("codeFencedFence"),It(Q)?Vt(C,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):U(Q)}function U(Q){return Q===u?(C.enter("codeFencedFenceSequence"),W(Q)):D(Q)}function W(Q){return Q===u?(j++,C.consume(Q),W):j>=l?(C.exit("codeFencedFenceSequence"),It(Q)?Vt(C,Y,"whitespace")(Q):Y(Q)):D(Q)}function Y(Q){return Q===null||mt(Q)?(C.exit("codeFencedFence"),I(Q)):D(Q)}}}function l_(e,t,n){const r=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Qh={name:"codeIndented",tokenize:c_},u_={partial:!0,tokenize:d_};function c_(e,t,n){const r=this;return s;function s(h){return e.enter("codeIndented"),Vt(e,i,"linePrefix",5)(h)}function i(h){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?f(h):mt(h)?e.attempt(u_,l,f)(h):(e.enter("codeFlowValue"),u(h))}function u(h){return h===null||mt(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),u)}function f(h){return e.exit("codeIndented"),t(h)}}function d_(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):mt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):Vt(e,i,"linePrefix",5)(l)}function i(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):mt(l)?s(l):n(l)}}const f_={name:"codeText",previous:m_,resolve:h_,tokenize:p_};function h_(e){let t=e.length-4,n=3,r,s;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;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function m_(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function p_(e,t,n){let r=0,s,i;return l;function l(y){return e.enter("codeText"),e.enter("codeTextSequence"),u(y)}function u(y){return y===96?(e.consume(y),r++,u):(e.exit("codeTextSequence"),f(y))}function f(y){return y===null?n(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),f):y===96?(i=e.enter("codeTextSequence"),s=0,p(y)):mt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),f):(e.enter("codeTextData"),h(y))}function h(y){return y===null||y===32||y===96||mt(y)?(e.exit("codeTextData"),f(y)):(e.consume(y),h)}function p(y){return y===96?(e.consume(y),s++,p):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(y)):(i.type="codeTextData",h(y))}}class y_{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 s=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Tl(this.left,r),i.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),Tl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Tl(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);Tl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Tl(this.left,n.reverse())}}}function Tl(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 Fv(e){const t={};let n=-1,r,s,i,l,u,f,h;const p=new y_(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,i=0,i<f.length&&f[i][1].type==="lineEndingBlank"&&(i+=2),i<f.length&&f[i][1].type==="content"))for(;++i<f.length&&f[i][1].type!=="content";)f[i][1].type==="chunkText"&&(f[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,g_(p,n)),n=t[n],h=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(l=p.get(i),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=i);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(r[1].end={...p.get(s)[1].start},u=p.slice(s,n),u.unshift(r),p.splice(s,n-s+1,u))}}return ds(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function g_(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const i=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,f=[],h={};let p,y,g=-1,b=n,O=0,w=0;const T=[w];for(;b;){for(;e.get(++s)[1]!==b;);i.push(s),b._tokenizer||(p=r.sliceStream(b),b.next||p.push(null),y&&l.defineSkip(b.start),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),y=b,b=b.next}for(b=n;++g<u.length;)u[g][0]==="exit"&&u[g-1][0]==="enter"&&u[g][1].type===u[g-1][1].type&&u[g][1].start.line!==u[g][1].end.line&&(w=g+1,T.push(w),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(l.events=[],b?(b._tokenizer=void 0,b.previous=void 0):T.pop(),g=T.length;g--;){const E=u.slice(T[g],T[g+1]),_=i.pop();f.push([_,_+E.length-1]),e.splice(_,2,E)}for(f.reverse(),g=-1;++g<f.length;)h[O+f[g][0]]=O+f[g][1],O+=f[g][1]-f[g][0]-1;return h}const x_={resolve:v_,tokenize:E_},b_={partial:!0,tokenize:T_};function v_(e){return Fv(e),e}function E_(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(u)}function s(u){return u===null?i(u):mt(u)?e.check(b_,l,i)(u):(e.consume(u),s)}function i(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function l(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function T_(e,t,n){const r=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Vt(e,i,"linePrefix")}function i(l){if(l===null||mt(l))return n(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Bv(e,t,n,r,s,i,l,u,f){const h=f||Number.POSITIVE_INFINITY;let p=0;return y;function y(E){return E===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(E),e.exit(i),g):E===null||E===32||E===41||Q0(E)?n(E):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),w(E))}function g(E){return E===62?(e.enter(i),e.consume(E),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===62?(e.exit("chunkString"),e.exit(u),g(E)):E===null||E===60||mt(E)?n(E):(e.consume(E),E===92?O:b)}function O(E){return E===60||E===62||E===92?(e.consume(E),b):b(E)}function w(E){return!p&&(E===null||E===41||sr(E))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(E)):p<h&&E===40?(e.consume(E),p++,w):E===41?(e.consume(E),p--,w):E===null||E===32||E===40||Q0(E)?n(E):(e.consume(E),E===92?T:w)}function T(E){return E===40||E===41||E===92?(e.consume(E),w):w(E)}}function Hv(e,t,n,r,s,i){const l=this;let u=0,f;return h;function h(b){return e.enter(r),e.enter(s),e.consume(b),e.exit(s),e.enter(i),p}function p(b){return u>999||b===null||b===91||b===93&&!f||b===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(b):b===93?(e.exit(i),e.enter(s),e.consume(b),e.exit(s),e.exit(r),t):mt(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===null||b===91||b===93||mt(b)||u++>999?(e.exit("chunkString"),p(b)):(e.consume(b),f||(f=!It(b)),b===92?g:y)}function g(b){return b===91||b===92||b===93?(e.consume(b),u++,y):y(b)}}function Uv(e,t,n,r,s,i){let l;return u;function u(g){return g===34||g===39||g===40?(e.enter(r),e.enter(s),e.consume(g),e.exit(s),l=g===40?41:g,f):n(g)}function f(g){return g===l?(e.enter(s),e.consume(g),e.exit(s),e.exit(r),t):(e.enter(i),h(g))}function h(g){return g===l?(e.exit(i),f(l)):g===null?n(g):mt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Vt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===l||g===null||mt(g)?(e.exit("chunkString"),h(g)):(e.consume(g),g===92?y:p)}function y(g){return g===l||g===92?(e.consume(g),p):p(g)}}function Ul(e,t){let n;return r;function r(s){return mt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):It(s)?Vt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const w_={name:"definition",tokenize:S_},k_={partial:!0,tokenize:C_};function S_(e,t,n){const r=this;let s;return i;function i(b){return e.enter("definition"),l(b)}function l(b){return Hv.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function u(b){return s=ti(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),f):n(b)}function f(b){return sr(b)?Ul(e,h)(b):h(b)}function h(b){return Bv(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function p(b){return e.attempt(k_,y,y)(b)}function y(b){return It(b)?Vt(e,g,"whitespace")(b):g(b)}function g(b){return b===null||mt(b)?(e.exit("definition"),r.parser.defined.push(s),t(b)):n(b)}}function C_(e,t,n){return r;function r(u){return sr(u)?Ul(e,s)(u):n(u)}function s(u){return Uv(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function i(u){return It(u)?Vt(e,l,"whitespace")(u):l(u)}function l(u){return u===null||mt(u)?t(u):n(u)}}const N_={name:"hardBreakEscape",tokenize:__};function __(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return mt(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const D_={name:"headingAtx",resolve:O_,tokenize:A_};function O_(e,t){let n=e.length-2,r=3,s,i;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&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ds(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function A_(e,t,n){let r=0;return s;function s(p){return e.enter("atxHeading"),i(p)}function i(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||sr(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||mt(p)?(e.exit("atxHeading"),t(p)):It(p)?Vt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),h(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),u(p))}function h(p){return p===null||p===35||sr(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),h)}}const I_=["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"],J1=["pre","script","style","textarea"],M_={concrete:!0,name:"htmlFlow",resolveTo:P_,tokenize:j_},L_={partial:!0,tokenize:B_},R_={partial:!0,tokenize:F_};function P_(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 j_(e,t,n){const r=this;let s,i,l,u,f;return h;function h(R){return p(R)}function p(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),y}function y(R){return R===33?(e.consume(R),g):R===47?(e.consume(R),i=!0,w):R===63?(e.consume(R),s=3,r.interrupt?t:P):ls(R)?(e.consume(R),l=String.fromCharCode(R),T):n(R)}function g(R){return R===45?(e.consume(R),s=2,b):R===91?(e.consume(R),s=5,u=0,O):ls(R)?(e.consume(R),s=4,r.interrupt?t:P):n(R)}function b(R){return R===45?(e.consume(R),r.interrupt?t:P):n(R)}function O(R){const ie="CDATA[";return R===ie.charCodeAt(u++)?(e.consume(R),u===ie.length?r.interrupt?t:U:O):n(R)}function w(R){return ls(R)?(e.consume(R),l=String.fromCharCode(R),T):n(R)}function T(R){if(R===null||R===47||R===62||sr(R)){const ie=R===47,ae=l.toLowerCase();return!ie&&!i&&J1.includes(ae)?(s=1,r.interrupt?t(R):U(R)):I_.includes(l.toLowerCase())?(s=6,ie?(e.consume(R),E):r.interrupt?t(R):U(R)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):i?_(R):S(R))}return R===45||mr(R)?(e.consume(R),l+=String.fromCharCode(R),T):n(R)}function E(R){return R===62?(e.consume(R),r.interrupt?t:U):n(R)}function _(R){return It(R)?(e.consume(R),_):F(R)}function S(R){return R===47?(e.consume(R),F):R===58||R===95||ls(R)?(e.consume(R),A):It(R)?(e.consume(R),S):F(R)}function A(R){return R===45||R===46||R===58||R===95||mr(R)?(e.consume(R),A):M(R)}function M(R){return R===61?(e.consume(R),C):It(R)?(e.consume(R),M):S(R)}function C(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),f=R,I):It(R)?(e.consume(R),C):D(R)}function I(R){return R===f?(e.consume(R),f=null,j):R===null||mt(R)?n(R):(e.consume(R),I)}function D(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||sr(R)?M(R):(e.consume(R),D)}function j(R){return R===47||R===62||It(R)?S(R):n(R)}function F(R){return R===62?(e.consume(R),B):n(R)}function B(R){return R===null||mt(R)?U(R):It(R)?(e.consume(R),B):n(R)}function U(R){return R===45&&s===2?(e.consume(R),re):R===60&&s===1?(e.consume(R),ye):R===62&&s===4?(e.consume(R),K):R===63&&s===3?(e.consume(R),P):R===93&&s===5?(e.consume(R),fe):mt(R)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(L_,ee,W)(R)):R===null||mt(R)?(e.exit("htmlFlowData"),W(R)):(e.consume(R),U)}function W(R){return e.check(R_,Y,ee)(R)}function Y(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),Q}function Q(R){return R===null||mt(R)?W(R):(e.enter("htmlFlowData"),U(R))}function re(R){return R===45?(e.consume(R),P):U(R)}function ye(R){return R===47?(e.consume(R),l="",G):U(R)}function G(R){if(R===62){const ie=l.toLowerCase();return J1.includes(ie)?(e.consume(R),K):U(R)}return ls(R)&&l.length<8?(e.consume(R),l+=String.fromCharCode(R),G):U(R)}function fe(R){return R===93?(e.consume(R),P):U(R)}function P(R){return R===62?(e.consume(R),K):R===45&&s===2?(e.consume(R),P):U(R)}function K(R){return R===null||mt(R)?(e.exit("htmlFlowData"),ee(R)):(e.consume(R),K)}function ee(R){return e.exit("htmlFlow"),t(R)}}function F_(e,t,n){const r=this;return s;function s(l){return mt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):n(l)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function B_(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Cd,t,n)}}const H_={name:"htmlText",tokenize:U_};function U_(e,t,n){const r=this;let s,i,l;return u;function u(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),f}function f(P){return P===33?(e.consume(P),h):P===47?(e.consume(P),M):P===63?(e.consume(P),S):ls(P)?(e.consume(P),D):n(P)}function h(P){return P===45?(e.consume(P),p):P===91?(e.consume(P),i=0,O):ls(P)?(e.consume(P),_):n(P)}function p(P){return P===45?(e.consume(P),b):n(P)}function y(P){return P===null?n(P):P===45?(e.consume(P),g):mt(P)?(l=y,ye(P)):(e.consume(P),y)}function g(P){return P===45?(e.consume(P),b):y(P)}function b(P){return P===62?re(P):P===45?g(P):y(P)}function O(P){const K="CDATA[";return P===K.charCodeAt(i++)?(e.consume(P),i===K.length?w:O):n(P)}function w(P){return P===null?n(P):P===93?(e.consume(P),T):mt(P)?(l=w,ye(P)):(e.consume(P),w)}function T(P){return P===93?(e.consume(P),E):w(P)}function E(P){return P===62?re(P):P===93?(e.consume(P),E):w(P)}function _(P){return P===null||P===62?re(P):mt(P)?(l=_,ye(P)):(e.consume(P),_)}function S(P){return P===null?n(P):P===63?(e.consume(P),A):mt(P)?(l=S,ye(P)):(e.consume(P),S)}function A(P){return P===62?re(P):S(P)}function M(P){return ls(P)?(e.consume(P),C):n(P)}function C(P){return P===45||mr(P)?(e.consume(P),C):I(P)}function I(P){return mt(P)?(l=I,ye(P)):It(P)?(e.consume(P),I):re(P)}function D(P){return P===45||mr(P)?(e.consume(P),D):P===47||P===62||sr(P)?j(P):n(P)}function j(P){return P===47?(e.consume(P),re):P===58||P===95||ls(P)?(e.consume(P),F):mt(P)?(l=j,ye(P)):It(P)?(e.consume(P),j):re(P)}function F(P){return P===45||P===46||P===58||P===95||mr(P)?(e.consume(P),F):B(P)}function B(P){return P===61?(e.consume(P),U):mt(P)?(l=B,ye(P)):It(P)?(e.consume(P),B):j(P)}function U(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),s=P,W):mt(P)?(l=U,ye(P)):It(P)?(e.consume(P),U):(e.consume(P),Y)}function W(P){return P===s?(e.consume(P),s=void 0,Q):P===null?n(P):mt(P)?(l=W,ye(P)):(e.consume(P),W)}function Y(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||sr(P)?j(P):(e.consume(P),Y)}function Q(P){return P===47||P===62||sr(P)?j(P):n(P)}function re(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function ye(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),G}function G(P){return It(P)?Vt(e,fe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):fe(P)}function fe(P){return e.enter("htmlTextData"),l(P)}}const zm={name:"labelEnd",resolveAll:$_,resolveTo:q_,tokenize:V_},z_={tokenize:Q_},W_={tokenize:G_},Y_={tokenize:K_};function $_(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 s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&ds(e,0,e.length,n),e}function q_(e,t){let n=e.length,r=0,s,i,l,u;for(;n--;)if(s=e[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(l=n);const f={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[i][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",f,t],["enter",h,t]],u=Dr(u,e.slice(i+1,i+r+3)),u=Dr(u,[["enter",p,t]]),u=Dr(u,Um(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),u=Dr(u,[["exit",p,t],e[l-2],e[l-1],["exit",h,t]]),u=Dr(u,e.slice(l+1)),u=Dr(u,[["exit",f,t]]),ds(e,i,e.length,u),e}function V_(e,t,n){const r=this;let s=r.events.length,i,l;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return u;function u(g){return i?i._inactive?y(g):(l=r.parser.defined.includes(ti(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),f):n(g)}function f(g){return g===40?e.attempt(z_,p,l?p:y)(g):g===91?e.attempt(W_,p,l?h:y)(g):l?p(g):y(g)}function h(g){return e.attempt(Y_,p,y)(g)}function p(g){return t(g)}function y(g){return i._balanced=!0,n(g)}}function Q_(e,t,n){return r;function r(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),s}function s(y){return sr(y)?Ul(e,i)(y):i(y)}function i(y){return y===41?p(y):Bv(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function l(y){return sr(y)?Ul(e,f)(y):p(y)}function u(y){return n(y)}function f(y){return y===34||y===39||y===40?Uv(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):p(y)}function h(y){return sr(y)?Ul(e,p)(y):p(y)}function p(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),t):n(y)}}function G_(e,t,n){const r=this;return s;function s(u){return Hv.call(r,e,i,l,"reference","referenceMarker","referenceString")(u)}function i(u){return r.parser.defined.includes(ti(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function K_(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),s}function s(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const X_={name:"labelStartImage",resolveAll:zm.resolveAll,tokenize:J_};function J_(e,t,n){const r=this;return s;function s(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),i}function i(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const Z_={name:"labelStartLink",resolveAll:zm.resolveAll,tokenize:e4};function e4(e,t,n){const r=this;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),i}function i(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Gh={name:"lineEnding",tokenize:t4};function t4(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Vt(e,t,"linePrefix")}}const $c={name:"thematicBreak",tokenize:n4};function n4(e,t,n){let r=0,s;return i;function i(h){return e.enter("thematicBreak"),l(h)}function l(h){return s=h,u(h)}function u(h){return h===s?(e.enter("thematicBreakSequence"),f(h)):r>=3&&(h===null||mt(h))?(e.exit("thematicBreak"),t(h)):n(h)}function f(h){return h===s?(e.consume(h),r++,f):(e.exit("thematicBreakSequence"),It(h)?Vt(e,u,"whitespace")(h):u(h))}}const tr={continuation:{tokenize:a4},exit:l4,name:"list",tokenize:o4},r4={partial:!0,tokenize:u4},s4={partial:!0,tokenize:i4};function o4(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return u;function u(b){const O=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(O==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:G0(b)){if(r.containerState.type||(r.containerState.type=O,e.enter(O,{_container:!0})),O==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check($c,n,h)(b):h(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(b)}return n(b)}function f(b){return G0(b)&&++l<10?(e.consume(b),f):(!r.interrupt||l<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),h(b)):n(b)}function h(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(Cd,r.interrupt?n:p,e.attempt(r4,g,y))}function p(b){return r.containerState.initialBlankLine=!0,i++,g(b)}function y(b){return It(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),g):n(b)}function g(b){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function a4(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Cd,s,i);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Vt(e,t,"listItemIndent",r.containerState.size+1)(u)}function i(u){return r.containerState.furtherBlankLines||!It(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(s4,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Vt(e,e.attempt(tr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function i4(e,t,n){const r=this;return Vt(e,s,"listItemIndent",r.containerState.size+1);function s(i){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(i):n(i)}}function l4(e){e.exit(this.containerState.type)}function u4(e,t,n){const r=this;return Vt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const l=r.events[r.events.length-1];return!It(i)&&l&&l[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const Z1={name:"setextUnderline",resolveTo:c4,tokenize:d4};function c4(e,t){let n=e.length,r,s,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",l,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function d4(e,t,n){const r=this;let s;return i;function i(h){let p=r.events.length,y;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){y=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||y)?(e.enter("setextHeadingLine"),s=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),u(h)}function u(h){return h===s?(e.consume(h),u):(e.exit("setextHeadingLineSequence"),It(h)?Vt(e,f,"lineSuffix")(h):f(h))}function f(h){return h===null||mt(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const f4={tokenize:h4};function h4(e){const t=this,n=e.attempt(Cd,r,e.attempt(this.parser.constructs.flowInitial,s,Vt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(x_,s)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const m4={resolveAll:Wv()},p4=zv("string"),y4=zv("text");function zv(e){return{resolveAll:Wv(e==="text"?g4:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,l,u);return l;function l(p){return h(p)?i(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return h(p)?(n.exit("data"),i(p)):(n.consume(p),f)}function h(p){if(p===null)return!0;const y=s[p];let g=-1;if(y)for(;++g<y.length;){const b=y[g];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function Wv(e){return t;function t(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return e?e(n,r):n}}function g4(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],s=t.sliceStream(r);let i=s.length,l=-1,u=0,f;for(;i--;){const h=s[i];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(h===-2)f=!0,u++;else if(h!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const h={type:n===e.length||f||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?l:r.start._bufferIndex+l,_index:r.start._index+i,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},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 x4={42:tr,43:tr,45:tr,48:tr,49:tr,50:tr,51:tr,52:tr,53:tr,54:tr,55:tr,56:tr,57:tr,62:Rv},b4={91:w_},v4={[-2]:Qh,[-1]:Qh,32:Qh},E4={35:D_,42:$c,45:[Z1,$c],60:M_,61:Z1,95:$c,96:X1,126:X1},T4={38:jv,92:Pv},w4={[-5]:Gh,[-4]:Gh,[-3]:Gh,33:X_,38:jv,42:K0,60:[Z3,H_],91:Z_,92:[N_,Pv],93:zm,95:K0,96:f_},k4={null:[K0,m4]},S4={null:[42,95]},C4={null:[]},N4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:S4,contentInitial:b4,disable:C4,document:x4,flow:E4,flowInitial:v4,insideSpan:k4,string:T4,text:w4},Symbol.toStringTag,{value:"Module"}));function _4(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 s={},i=[];let l=[],u=[];const f={attempt:I(M),check:I(C),consume:_,enter:S,exit:A,interrupt:I(C,{interrupt:!0})},h={code:null,containerState:{},defineSkip:w,events:[],now:O,parser:e,previous:null,sliceSerialize:g,sliceStream:b,write:y};let p=t.tokenize.call(h,f);return t.resolveAll&&i.push(t),h;function y(B){return l=Dr(l,B),T(),l[l.length-1]!==null?[]:(D(t,0),h.events=Um(i,h.events,h),h.events)}function g(B,U){return O4(b(B),U)}function b(B){return D4(l,B)}function O(){const{_bufferIndex:B,_index:U,line:W,column:Y,offset:Q}=r;return{_bufferIndex:B,_index:U,line:W,column:Y,offset:Q}}function w(B){s[B.line]=B.column,F()}function T(){let B;for(;r._index<l.length;){const U=l[r._index];if(typeof U=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<U.length;)E(U.charCodeAt(r._bufferIndex));else E(U)}}function E(B){p=p(B)}function _(B){mt(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,F()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=B}function S(B,U){const W=U||{};return W.type=B,W.start=O(),h.events.push(["enter",W,h]),u.push(W),W}function A(B){const U=u.pop();return U.end=O(),h.events.push(["exit",U,h]),U}function M(B,U){D(B,U.from)}function C(B,U){U.restore()}function I(B,U){return W;function W(Y,Q,re){let ye,G,fe,P;return Array.isArray(Y)?ee(Y):"tokenize"in Y?ee([Y]):K(Y);function K(J){return be;function be(te){const le=te!==null&&J[te],ge=te!==null&&J.null,ve=[...Array.isArray(le)?le:le?[le]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return ee(ve)(te)}}function ee(J){return ye=J,G=0,J.length===0?re:R(J[G])}function R(J){return be;function be(te){return P=j(),fe=J,J.partial||(h.currentConstruct=J),J.name&&h.parser.constructs.disable.null.includes(J.name)?ae():J.tokenize.call(U?Object.assign(Object.create(h),U):h,f,ie,ae)(te)}}function ie(J){return B(fe,P),Q}function ae(J){return P.restore(),++G<ye.length?R(ye[G]):re}}}function D(B,U){B.resolveAll&&!i.includes(B)&&i.push(B),B.resolve&&ds(h.events,U,h.events.length-U,B.resolve(h.events.slice(U),h)),B.resolveTo&&(h.events=B.resolveTo(h.events,h))}function j(){const B=O(),U=h.previous,W=h.currentConstruct,Y=h.events.length,Q=Array.from(u);return{from:Y,restore:re};function re(){r=B,h.previous=U,h.currentConstruct=W,h.events.length=Y,u=Q,F()}}function F(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function D4(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,i=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(r,i)];else{if(l=e.slice(n,s),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}i>0&&l.push(e[s].slice(0,i))}return l}function O4(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const i=e[n];let l;if(typeof i=="string")l=i;else switch(i){case-5:{l="\r";break}case-4:{l=`
|
|
36
|
-
`;break}case-3:{l=`\r
|
|
37
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(i)}s=i===-2,r.push(l)}return r.join("")}function A4(e){const r={constructs:F3([N4,...(e||{}).extensions||[]]),content:s(q3),defined:[],document:s(Q3),flow:s(f4),lazy:{},string:s(p4),text:s(y4)};return r;function s(i){return l;function l(u){return _4(r,i,u)}}}function I4(e){for(;!Fv(e););return e}const ex=/[\0\t\n\r]/g;function M4(){let e=1,t="",n=!0,r;return s;function s(i,l,u){const f=[];let h,p,y,g,b;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(l||void 0).decode(i)),y=0,t="",n&&(i.charCodeAt(0)===65279&&y++,n=void 0);y<i.length;){if(ex.lastIndex=y,h=ex.exec(i),g=h&&h.index!==void 0?h.index:i.length,b=i.charCodeAt(g),!h){t=i.slice(y);break}if(b===10&&y===g&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),y<g&&(f.push(i.slice(y,g)),e+=g-y),b){case 0:{f.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,f.push(-2);e++<p;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}y=g+1}return u&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const L4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function R4(e){return e.replace(L4,P4)}function P4(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return Lv(n.slice(i?2:1),i?16:10)}return Hm(n)||e}const Yv={}.hasOwnProperty;function j4(e,t,n){return typeof t!="string"&&(n=t,t=void 0),F4(n)(I4(A4(n).document().write(M4()(e,t,!0))))}function F4(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(pe),autolinkProtocol:j,autolinkEmail:j,atxHeading:i(tt),blockQuote:i(ge),characterEscape:j,characterReference:j,codeFenced:i(ve),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(ve,l),codeText:i(je,l),codeTextData:j,data:j,codeFlowValue:j,definition:i(Ye),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(nt),hardBreakEscape:i(Je),hardBreakTrailing:i(Je),htmlFlow:i(rt,l),htmlFlowData:j,htmlText:i(rt,l),htmlTextData:j,image:i(ut),label:l,link:i(pe),listItem:i(Ae),listItemValue:g,listOrdered:i(me,y),listUnordered:i(me),paragraph:i(Pe),reference:R,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(tt),strong:i(ct),thematicBreak:i(bt)},exit:{atxHeading:f(),atxHeadingSequence:M,autolink:f(),autolinkEmail:le,autolinkProtocol:te,blockQuote:f(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:J,characterReference:be,codeFenced:f(T),codeFencedFence:w,codeFencedFenceInfo:b,codeFencedFenceMeta:O,codeFlowValue:F,codeIndented:f(E),codeText:f(Q),codeTextData:F,data:F,definition:f(),definitionDestinationString:A,definitionLabelString:_,definitionTitleString:S,emphasis:f(),hardBreakEscape:f(U),hardBreakTrailing:f(U),htmlFlow:f(W),htmlFlowData:F,htmlText:f(Y),htmlTextData:F,image:f(ye),label:fe,labelText:G,lineEnding:B,link:f(re),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:ie,resourceDestinationString:P,resourceTitleString:K,resource:ee,setextHeading:f(D),setextHeadingLineSequence:I,setextHeadingText:C,strong:f(),thematicBreak:f()}};$v(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ue){let ne={type:"root",children:[]};const Te={stack:[ne],tokenStack:[],config:t,enter:u,exit:h,buffer:l,resume:p,data:n},Re=[];let Fe=-1;for(;++Fe<ue.length;)if(ue[Fe][1].type==="listOrdered"||ue[Fe][1].type==="listUnordered")if(ue[Fe][0]==="enter")Re.push(Fe);else{const Be=Re.pop();Fe=s(ue,Be,Fe)}for(Fe=-1;++Fe<ue.length;){const Be=t[ue[Fe][0]];Yv.call(Be,ue[Fe][1].type)&&Be[ue[Fe][1].type].call(Object.assign({sliceSerialize:ue[Fe][2].sliceSerialize},Te),ue[Fe][1])}if(Te.tokenStack.length>0){const Be=Te.tokenStack[Te.tokenStack.length-1];(Be[1]||tx).call(Te,void 0,Be[0])}for(ne.position={start:so(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:so(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},Fe=-1;++Fe<t.transforms.length;)ne=t.transforms[Fe](ne)||ne;return ne}function s(ue,ne,Te){let Re=ne-1,Fe=-1,Be=!1,pt,de,_e,Ee;for(;++Re<=Te;){const He=ue[Re];switch(He[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{He[0]==="enter"?Fe++:Fe--,Ee=void 0;break}case"lineEndingBlank":{He[0]==="enter"&&(pt&&!Ee&&!Fe&&!_e&&(_e=Re),Ee=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ee=void 0}if(!Fe&&He[0]==="enter"&&He[1].type==="listItemPrefix"||Fe===-1&&He[0]==="exit"&&(He[1].type==="listUnordered"||He[1].type==="listOrdered")){if(pt){let Ue=Re;for(de=void 0;Ue--;){const vt=ue[Ue];if(vt[1].type==="lineEnding"||vt[1].type==="lineEndingBlank"){if(vt[0]==="exit")continue;de&&(ue[de][1].type="lineEndingBlank",Be=!0),vt[1].type="lineEnding",de=Ue}else if(!(vt[1].type==="linePrefix"||vt[1].type==="blockQuotePrefix"||vt[1].type==="blockQuotePrefixWhitespace"||vt[1].type==="blockQuoteMarker"||vt[1].type==="listItemIndent"))break}_e&&(!de||_e<de)&&(pt._spread=!0),pt.end=Object.assign({},de?ue[de][1].start:He[1].end),ue.splice(de||Re,0,["exit",pt,He[2]]),Re++,Te++}if(He[1].type==="listItemPrefix"){const Ue={type:"listItem",_spread:!1,start:Object.assign({},He[1].start),end:void 0};pt=Ue,ue.splice(Re,0,["enter",Ue,He[2]]),Re++,Te++,_e=void 0,Ee=!0}}}return ue[ne][1]._spread=Be,Te}function i(ue,ne){return Te;function Te(Re){u.call(this,ue(Re),Re),ne&&ne.call(this,Re)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(ue,ne,Te){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([ne,Te||void 0]),ue.position={start:so(ne.start),end:void 0}}function f(ue){return ne;function ne(Te){ue&&ue.call(this,Te),h.call(this,Te)}}function h(ue,ne){const Te=this.stack.pop(),Re=this.tokenStack.pop();if(Re)Re[0].type!==ue.type&&(ne?ne.call(this,ue,Re[0]):(Re[1]||tx).call(this,ue,Re[0]));else throw new Error("Cannot close `"+ue.type+"` ("+Hl({start:ue.start,end:ue.end})+"): it’s not open");Te.position.end=so(ue.end)}function p(){return P3(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function g(ue){if(this.data.expectingFirstListItemValue){const ne=this.stack[this.stack.length-2];ne.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ue=this.resume(),ne=this.stack[this.stack.length-1];ne.lang=ue}function O(){const ue=this.resume(),ne=this.stack[this.stack.length-1];ne.meta=ue}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const ue=this.resume(),ne=this.stack[this.stack.length-1];ne.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const ue=this.resume(),ne=this.stack[this.stack.length-1];ne.value=ue.replace(/(\r?\n|\r)$/g,"")}function _(ue){const ne=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ne,Te.identifier=ti(this.sliceSerialize(ue)).toLowerCase()}function S(){const ue=this.resume(),ne=this.stack[this.stack.length-1];ne.title=ue}function A(){const ue=this.resume(),ne=this.stack[this.stack.length-1];ne.url=ue}function M(ue){const ne=this.stack[this.stack.length-1];if(!ne.depth){const Te=this.sliceSerialize(ue).length;ne.depth=Te}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function I(ue){const ne=this.stack[this.stack.length-1];ne.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function j(ue){const Te=this.stack[this.stack.length-1].children;let Re=Te[Te.length-1];(!Re||Re.type!=="text")&&(Re=kt(),Re.position={start:so(ue.start),end:void 0},Te.push(Re)),this.stack.push(Re)}function F(ue){const ne=this.stack.pop();ne.value+=this.sliceSerialize(ue),ne.position.end=so(ue.end)}function B(ue){const ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=ne.children[ne.children.length-1];Te.position.end=so(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ne.type)&&(j.call(this,ue),F.call(this,ue))}function U(){this.data.atHardBreak=!0}function W(){const ue=this.resume(),ne=this.stack[this.stack.length-1];ne.value=ue}function Y(){const ue=this.resume(),ne=this.stack[this.stack.length-1];ne.value=ue}function Q(){const ue=this.resume(),ne=this.stack[this.stack.length-1];ne.value=ue}function re(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ne,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function ye(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ne,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function G(ue){const ne=this.sliceSerialize(ue),Te=this.stack[this.stack.length-2];Te.label=R4(ne),Te.identifier=ti(ne).toLowerCase()}function fe(){const ue=this.stack[this.stack.length-1],ne=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const Re=ue.children;Te.children=Re}else Te.alt=ne}function P(){const ue=this.resume(),ne=this.stack[this.stack.length-1];ne.url=ue}function K(){const ue=this.resume(),ne=this.stack[this.stack.length-1];ne.title=ue}function ee(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function ie(ue){const ne=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ne,Te.identifier=ti(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function ae(ue){this.data.characterReferenceType=ue.type}function J(ue){const ne=this.sliceSerialize(ue),Te=this.data.characterReferenceType;let Re;Te?(Re=Lv(ne,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Re=Hm(ne);const Fe=this.stack[this.stack.length-1];Fe.value+=Re}function be(ue){const ne=this.stack.pop();ne.position.end=so(ue.end)}function te(ue){F.call(this,ue);const ne=this.stack[this.stack.length-1];ne.url=this.sliceSerialize(ue)}function le(ue){F.call(this,ue);const ne=this.stack[this.stack.length-1];ne.url="mailto:"+this.sliceSerialize(ue)}function ge(){return{type:"blockquote",children:[]}}function ve(){return{type:"code",lang:null,meta:null,value:""}}function je(){return{type:"inlineCode",value:""}}function Ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function nt(){return{type:"emphasis",children:[]}}function tt(){return{type:"heading",depth:0,children:[]}}function Je(){return{type:"break"}}function rt(){return{type:"html",value:""}}function ut(){return{type:"image",title:null,url:"",alt:null}}function pe(){return{type:"link",title:null,url:"",children:[]}}function me(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function Ae(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function Pe(){return{type:"paragraph",children:[]}}function ct(){return{type:"strong",children:[]}}function kt(){return{type:"text",value:""}}function bt(){return{type:"thematicBreak"}}}function so(e){return{line:e.line,column:e.column,offset:e.offset}}function $v(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?$v(e,r):B4(e,r)}}function B4(e,t){let n;for(n in t)if(Yv.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 tx(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Hl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Hl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Hl({start:t.start,end:t.end})+") is still open")}function H4(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 U4(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 z4(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
38
|
-
`}]}function W4(e,t){const n=t.value?t.value+`
|
|
39
|
-
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function Y4(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 q4(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Si(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=i+1,u+=1,e.footnoteCounts.set(r,u);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const h={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,h),e.applyData(t,h)}function V4(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 Q4(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function qv(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 s=e.all(t),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=r:s.push({type:"text",value:r}),s}function G4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return qv(e,t);const s={src:Si(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,i),e.applyData(t,i)}function K4(e,t){const n={src:Si(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 X4(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 J4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return qv(e,t);const s={href:Si(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Z4(e,t){const n={href:Si(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 eD(e,t,n){const r=e.all(t),s=n?tD(n):Vv(t),i={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let y;p&&p.type==="element"&&p.tagName==="p"?y=p:(y={type:"element",tagName:"p",properties:{},children:[]},r.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const p=r[u];(s||u!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
|
|
40
|
-
`}),p.type==="element"&&p.tagName==="p"&&!s?l.push(...p.children):l.push(p)}const f=r[r.length-1];f&&(s||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
|
|
41
|
-
`});const h={type:"element",tagName:"li",properties:i,children:l};return e.patch(t,h),e.applyData(t,h)}function tD(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=Vv(n[r])}return t}function Vv(e){const t=e.spread;return t??e.children.length>1}function nD(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const l=r[s];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function rD(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sD(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function oD(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aD(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=fs(t.children[1]),f=Sd(t.children[t.children.length-1]);u&&f&&(l.position={start:u,end:f}),s.push(l)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function iD(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:t.children.length;let f=-1;const h=[];for(;++f<u;){const y=t.children[f],g={},b=l?l[f]:void 0;b&&(g.align=b);let O={type:"element",tagName:i,properties:g,children:[]};y&&(O.children=e.all(y),e.patch(y,O),O=e.applyData(y,O)),h.push(O)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,p),e.applyData(t,p)}function lD(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const nx=9,rx=32;function uD(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(sx(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(sx(t.slice(s),s>0,!1)),i.join("")}function sx(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===nx||i===rx;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===nx||i===rx;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function cD(e,t){const n={type:"text",value:uD(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function dD(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const fD={blockquote:U4,break:z4,code:W4,delete:Y4,emphasis:$4,footnoteReference:q4,heading:V4,html:Q4,imageReference:G4,image:K4,inlineCode:X4,linkReference:J4,link:Z4,listItem:eD,list:nD,paragraph:rD,root:sD,strong:oD,table:aD,tableCell:lD,tableRow:iD,text:cD,thematicBreak:dD,toml:Ac,yaml:Ac,definition:Ac,footnoteDefinition:Ac};function Ac(){}const Qv=-1,Nd=0,zl=1,ed=2,Wm=3,Ym=4,$m=5,qm=6,Gv=7,Kv=8,ox=typeof self=="object"?self:globalThis,hD=(e,t)=>{const n=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,l]=t[s];switch(i){case Nd:case Qv:return n(l,s);case zl:{const u=n([],s);for(const f of l)u.push(r(f));return u}case ed:{const u=n({},s);for(const[f,h]of l)u[r(f)]=r(h);return u}case Wm:return n(new Date(l),s);case Ym:{const{source:u,flags:f}=l;return n(new RegExp(u,f),s)}case $m:{const u=n(new Map,s);for(const[f,h]of l)u.set(r(f),r(h));return u}case qm:{const u=n(new Set,s);for(const f of l)u.add(r(f));return u}case Gv:{const{name:u,message:f}=l;return n(new ox[u](f),s)}case Kv:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(new ox[i](l),s)};return r},ax=e=>hD(new Map,e)(0),Qa="",{toString:mD}={},{keys:pD}=Object,wl=e=>{const t=typeof e;if(t!=="object"||!e)return[Nd,t];const n=mD.call(e).slice(8,-1);switch(n){case"Array":return[zl,Qa];case"Object":return[ed,Qa];case"Date":return[Wm,Qa];case"RegExp":return[Ym,Qa];case"Map":return[$m,Qa];case"Set":return[qm,Qa];case"DataView":return[zl,n]}return n.includes("Array")?[zl,n]:n.includes("Error")?[Gv,n]:[ed,n]},Ic=([e,t])=>e===Nd&&(t==="function"||t==="symbol"),yD=(e,t,n,r)=>{const s=(l,u)=>{const f=r.push(l)-1;return n.set(u,f),f},i=l=>{if(n.has(l))return n.get(l);let[u,f]=wl(l);switch(u){case Nd:{let p=l;switch(f){case"bigint":u=Kv,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);p=null;break;case"undefined":return s([Qv],l)}return s([u,p],l)}case zl:{if(f){let g=l;return f==="DataView"?g=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(g=new Uint8Array(l)),s([f,[...g]],l)}const p=[],y=s([u,p],l);for(const g of l)p.push(i(g));return y}case ed:{if(f)switch(f){case"BigInt":return s([f,l.toString()],l);case"Boolean":case"Number":case"String":return s([f,l.valueOf()],l)}if(t&&"toJSON"in l)return i(l.toJSON());const p=[],y=s([u,p],l);for(const g of pD(l))(e||!Ic(wl(l[g])))&&p.push([i(g),i(l[g])]);return y}case Wm:return s([u,l.toISOString()],l);case Ym:{const{source:p,flags:y}=l;return s([u,{source:p,flags:y}],l)}case $m:{const p=[],y=s([u,p],l);for(const[g,b]of l)(e||!(Ic(wl(g))||Ic(wl(b))))&&p.push([i(g),i(b)]);return y}case qm:{const p=[],y=s([u,p],l);for(const g of l)(e||!Ic(wl(g)))&&p.push(i(g));return y}}const{message:h}=l;return s([u,{name:f,message:h}],l)};return i},ix=(e,{json:t,lossy:n}={})=>{const r=[];return yD(!(t||n),!!t,new Map,r)(e),r},bi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ax(ix(e,t)):structuredClone(e):(e,t)=>ax(ix(e,t));function gD(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 xD(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function bD(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||gD,r=e.options.footnoteBackLabel||xD,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let f=-1;for(;++f<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[f]);if(!h)continue;const p=e.all(h),y=String(h.identifier).toUpperCase(),g=Si(y.toLowerCase());let b=0;const O=[],w=e.footnoteCounts.get(y);for(;w!==void 0&&++b<=w;){O.length>0&&O.push({type:"text",value:" "});let _=typeof n=="string"?n:n(f,b);typeof _=="string"&&(_={type:"text",value:_}),O.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,b),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const T=p[p.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const _=T.children[T.children.length-1];_&&_.type==="text"?_.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...O)}else p.push(...O);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(p,!0)};e.patch(h,E),u.push(E)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...bi(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
42
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
43
|
-
`}]}}const Xv=(function(e){if(e==null)return wD;if(typeof e=="function")return _d(e);if(typeof e=="object")return Array.isArray(e)?vD(e):ED(e);if(typeof e=="string")return TD(e);throw new Error("Expected function, string, or object as test")});function vD(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Xv(e[n]);return _d(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function ED(e){const t=e;return _d(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function TD(e){return _d(t);function t(n){return n&&n.type===e}}function _d(e){return t;function t(n,r,s){return!!(kD(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function wD(){return!0}function kD(e){return e!==null&&typeof e=="object"&&"type"in e}const Jv=[],SD=!0,lx=!1,CD="skip";function ND(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=Xv(s),l=r?-1:1;u(e,void 0,[])();function u(f,h,p){const y=f&&typeof f=="object"?f:{};if(typeof y.type=="string"){const b=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(f.type+(b?"<"+b+">":""))+")"})}return g;function g(){let b=Jv,O,w,T;if((!t||i(f,h,p[p.length-1]||void 0))&&(b=_D(n(f,p)),b[0]===lx))return b;if("children"in f&&f.children){const E=f;if(E.children&&b[0]!==CD)for(w=(r?E.children.length:-1)+l,T=p.concat(E);w>-1&&w<E.children.length;){const _=E.children[w];if(O=u(_,w,T)(),O[0]===lx)return O;w=typeof O[1]=="number"?O[1]:w+l}}return b}}}function _D(e){return Array.isArray(e)?e:typeof e=="number"?[SD,e]:e==null?Jv:[e]}function Vm(e,t,n,r){let s,i,l;typeof t=="function"&&typeof n!="function"?(i=void 0,l=t,s=n):(i=t,l=n,s=r),ND(e,i,u,s);function u(f,h){const p=h[h.length-1],y=p?p.children.indexOf(f):void 0;return l(f,y,p)}}const X0={}.hasOwnProperty,DD={};function OD(e,t){const n=t||DD,r=new Map,s=new Map,i=new Map,l={...fD,...n.handlers},u={all:h,applyData:ID,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:l,one:f,options:n,patch:AD,wrap:LD};return Vm(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const y=p.type==="definition"?r:s,g=String(p.identifier).toUpperCase();y.has(g)||y.set(g,p)}}),u;function f(p,y){const g=p.type,b=u.handlers[g];if(X0.call(u.handlers,g)&&b)return b(u,p,y);if(u.options.passThrough&&u.options.passThrough.includes(g)){if("children"in p){const{children:w,...T}=p,E=bi(T);return E.children=u.all(p),E}return bi(p)}return(u.options.unknownHandler||MD)(u,p,y)}function h(p){const y=[];if("children"in p){const g=p.children;let b=-1;for(;++b<g.length;){const O=u.one(g[b],p);if(O){if(b&&g[b-1].type==="break"&&(!Array.isArray(O)&&O.type==="text"&&(O.value=ux(O.value)),!Array.isArray(O)&&O.type==="element")){const w=O.children[0];w&&w.type==="text"&&(w.value=ux(w.value))}Array.isArray(O)?y.push(...O):y.push(O)}}}return y}}function AD(e,t){e.position&&(t.position=m3(e))}function ID(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&i&&Object.assign(n.properties,bi(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function MD(e,t){const n=t.data||{},r="value"in t&&!(X0.call(n,"hProperties")||X0.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 LD(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
44
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
45
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
46
|
-
`}),n}function ux(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function cx(e,t){const n=OD(e,t),r=n.one(e,void 0),s=bD(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
|
|
47
|
-
`},s),i}function RD(e,t){return e&&"run"in e?async function(n,r){const s=cx(n,{file:r,...t});await e.run(s,r)}:function(n,r){return cx(n,{file:r,...e||t})}}function dx(e){if(e)throw e}var Kh,fx;function PD(){if(fx)return Kh;fx=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},i=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var p=e.call(h,"constructor"),y=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!p&&!y)return!1;var g;for(g in h);return typeof g>"u"||e.call(h,g)},l=function(h,p){n&&p.name==="__proto__"?n(h,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):h[p.name]=p.newValue},u=function(h,p){if(p==="__proto__")if(e.call(h,p)){if(r)return r(h,p).value}else return;return h[p]};return Kh=function f(){var h,p,y,g,b,O,w=arguments[0],T=1,E=arguments.length,_=!1;for(typeof w=="boolean"&&(_=w,w=arguments[1]||{},T=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});T<E;++T)if(h=arguments[T],h!=null)for(p in h)y=u(w,p),g=u(h,p),w!==g&&(_&&g&&(i(g)||(b=s(g)))?(b?(b=!1,O=y&&s(y)?y:[]):O=y&&i(y)?y:{},l(w,{name:p,newValue:f(_,O,g)})):typeof g<"u"&&l(w,{name:p,newValue:g}));return w},Kh}var jD=PD();const Xh=Ab(jD);function J0(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 FD(){const e=[],t={run:n,use:r};return t;function n(...s){let i=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...s);function u(f,...h){const p=e[++i];let y=-1;if(f){l(f);return}for(;++y<s.length;)(h[y]===null||h[y]===void 0)&&(h[y]=s[y]);s=h,p?BD(p,u)(...h):l(null,...h)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function BD(e,t){let n;return r;function r(...l){const u=e.length>l.length;let f;u&&l.push(s);try{f=e.apply(this,l)}catch(h){const p=h;if(u&&n)throw p;return s(p)}u||(f&&f.then&&typeof f.then=="function"?f.then(i,s):f instanceof Error?s(f):i(f))}function s(l,...u){n||(n=!0,t(l,...u))}function i(l){s(null,l)}}const es={basename:HD,dirname:UD,extname:zD,join:WD,sep:"/"};function HD(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');hu(e);let n=0,r=-1,s=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,u=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else l<0&&(i=!0,l=s+1),u>-1&&(e.codePointAt(s)===t.codePointAt(u--)?u<0&&(r=s):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function UD(e){if(hu(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 zD(e){hu(e);let t=e.length,n=-1,r=0,s=-1,i=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===46?s<0?s=t:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function WD(...e){let t=-1,n;for(;++t<e.length;)hu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":YD(n)}function YD(e){hu(e);const t=e.codePointAt(0)===47;let n=$D(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function $D(e,t){let n="",r=0,s=-1,i=0,l=-1,u,f;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(s===l-1||i===1))if(s!==l-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),s=l,i=0;continue}}else if(n.length>0){n="",r=0,s=l,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),r=l-s-1;s=l,i=0}else u===46&&i>-1?i++:i=-1}return n}function hu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const qD={cwd:VD};function VD(){return"/"}function Z0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function QD(e){if(typeof e=="string")e=new URL(e);else if(!Z0(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 GD(e)}function GD(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 s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Jh=["history","path","basename","stem","extname","dirname"];class Zv{constructor(t){let n;t?Z0(t)?n={path:t}:typeof t=="string"||KD(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":qD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Jh.length;){const i=Jh[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let s;for(s in n)Jh.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?es.basename(this.path):void 0}set basename(t){e0(t,"basename"),Zh(t,"basename"),this.path=es.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?es.dirname(this.path):void 0}set dirname(t){hx(this.basename,"dirname"),this.path=es.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?es.extname(this.path):void 0}set extname(t){if(Zh(t,"extname"),hx(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=es.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Z0(t)&&(t=QD(t)),e0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?es.basename(this.path,this.extname):void 0}set stem(t){e0(t,"stem"),Zh(t,"stem"),this.path=es.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new Hn(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Zh(e,t){if(e&&e.includes(es.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+es.sep+"`")}function e0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function hx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function KD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const XD=(function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),JD={}.hasOwnProperty;class Qm extends XD{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=FD()}copy(){const t=new Qm;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?(r0("data",this.frozen),this.namespace[t]=n,this):JD.call(this.namespace,t)&&this.namespace[t]||void 0:t?(r0("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 s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Mc(t),r=this.parser||this.Parser;return t0("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),t0("process",this.parser||this.Parser),n0("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,l){const u=Mc(t),f=r.parse(u);r.run(f,u,function(p,y,g){if(p||!y||!g)return h(p);const b=y,O=r.stringify(b,g);tO(O)?g.value=O:g.result=O,h(p,g)});function h(p,y){p||!y?l(p):i?i(y):n(void 0,y)}}}processSync(t){let n=!1,r;return this.freeze(),t0("processSync",this.parser||this.Parser),n0("processSync",this.compiler||this.Compiler),this.process(t,s),px("processSync","process",n),r;function s(i,l){n=!0,dx(i),r=l}}run(t,n,r){mx(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(l,u){const f=Mc(n);s.run(t,f,h);function h(p,y,g){const b=y||t;p?u(p):l?l(b):r(void 0,b,g)}}}runSync(t,n){let r=!1,s;return this.run(t,n,i),px("runSync","run",r),s;function i(l,u){dx(l),s=u,r=!0}}stringify(t,n){this.freeze();const r=Mc(n),s=this.compiler||this.Compiler;return n0("stringify",s),mx(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(r0("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(h){if(typeof h=="function")f(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[p,...y]=h;f(p,y)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(h.plugins),h.settings&&(s.settings=Xh(!0,s.settings,h.settings))}function u(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const y=h[p];i(y)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function f(h,p){let y=-1,g=-1;for(;++y<r.length;)if(r[y][0]===h){g=y;break}if(g===-1)r.push([h,...p]);else if(p.length>0){let[b,...O]=p;const w=r[g][1];J0(w)&&J0(b)&&(b=Xh(!0,w,b)),r[g]=[h,b,...O]}}}}const ZD=new Qm().freeze();function t0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function n0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function r0(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 mx(e){if(!J0(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function px(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Mc(e){return eO(e)?e:new Zv(e)}function eO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function tO(e){return typeof e=="string"||nO(e)}function nO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const rO="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",yx=[],gx={allowDangerousHtml:!0},sO=/^(https?|ircs?|mailto|xmpp)$/i,oO=[{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 e2(e){const t=aO(e),n=iO(e);return lO(t.runSync(t.parse(n),n),e)}function aO(e){const t=e.rehypePlugins||yx,n=e.remarkPlugins||yx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...gx}:gx;return ZD().use(H4).use(n).use(RD,r).use(t)}function iO(e){const t=e.children||"",n=new Zv;return typeof t=="string"&&(n.value=t),n}function lO(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,f=t.urlTransform||uO;for(const p of oO)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+rO+p.id,void 0);return Vm(e,h),b3(e,{Fragment:d.Fragment,components:s,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function h(p,y,g){if(p.type==="raw"&&g&&typeof y=="number")return l?g.children.splice(y,1):g.children[y]={type:"text",value:p.value},y;if(p.type==="element"){let b;for(b in Vh)if(Object.hasOwn(Vh,b)&&Object.hasOwn(p.properties,b)){const O=p.properties[b],w=Vh[b];(w===null||w.includes(p.tagName))&&(p.properties[b]=f(String(O||""),b,p))}}if(p.type==="element"){let b=n?!n.includes(p.tagName):i?i.includes(p.tagName):!1;if(!b&&r&&typeof y=="number"&&(b=!r(p,y,g)),b&&g&&typeof y=="number")return u&&p.children?g.children.splice(y,1,...p.children):g.children.splice(y,1),y}}}function uO(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||sO.test(e.slice(0,t))?e:""}function cO(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,r])=>`${n}: ${typeof r=="string"?r:JSON.stringify(r)}`).join(", ")}function dO(e,t=500){return e.length<=t?e:e.slice(0,t)+"…"}function t2({tc:e}){const[t,n]=N.useState(!1),r=e.args&&Object.keys(e.args).length>0||e.result||e.children&&e.children.length>0;return d.jsxs("div",{children:[d.jsxs("button",{className:`flex items-center gap-2 w-full text-left ${r?"cursor-pointer":"cursor-default"}`,style:{color:"var(--yc-color-text-secondary)"},onClick:()=>r&&n(!t),children:[e.status==="completed"?d.jsx("span",{className:"text-green-500 shrink-0",children:"✓"}):e.status==="running"?d.jsx("span",{className:"animate-pulse shrink-0",style:{color:"var(--yc-color-primary)"},children:"●"}):d.jsx("span",{className:"text-red-500 shrink-0",children:"✗"}),d.jsx("span",{className:"font-medium",style:{color:"var(--yc-color-text)"},children:e.name}),!t&&e.args&&Object.keys(e.args).length>0&&d.jsxs("span",{className:"truncate opacity-60 text-[11px]",children:["(",cO(e.args),")"]}),e.durationMs!=null&&d.jsxs("span",{className:"ml-auto opacity-50 shrink-0",children:[(e.durationMs/1e3).toFixed(1),"s"]}),r&&d.jsx("span",{className:"shrink-0 transition-transform text-[10px]",style:{color:"var(--yc-color-text-secondary)",transform:t?"rotate(180deg)":"rotate(0deg)"},children:"▾"})]}),t&&d.jsxs("div",{className:"mt-1 ml-5 rounded p-2 text-[11px] font-mono whitespace-pre-wrap break-all",style:{background:"var(--yc-color-bg)",color:"var(--yc-color-text-secondary)",border:"1px solid var(--yc-color-border)"},children:[e.args&&Object.keys(e.args).length>0&&d.jsxs("div",{children:[d.jsx("span",{className:"font-sans font-medium text-[10px] uppercase tracking-wide opacity-50",children:"Args"}),d.jsx("pre",{className:"mt-0.5 mb-1",children:JSON.stringify(e.args,null,2)})]}),e.result&&d.jsxs("div",{children:[d.jsx("span",{className:"font-sans font-medium text-[10px] uppercase tracking-wide opacity-50",children:"Result"}),d.jsx("pre",{className:"mt-0.5",children:dO(e.result)})]})]}),e.children&&e.children.length>0&&(t||e.status==="running")&&d.jsx("div",{className:"ml-5 pl-3 border-l mt-1 flex flex-col gap-1",style:{borderColor:"var(--yc-color-border)"},children:e.children.map(s=>d.jsx(t2,{tc:s},s.id))})]})}function fO({toolCalls:e}){const[t,n]=N.useState(!1),r=e.some(l=>l.status==="running"||l.status==="pending"),s=e.length,i=r?"Working...":`Analyzed ${s} data source${s!==1?"s":""}`;return d.jsxs("div",{className:"rounded-lg mb-2 text-xs",style:{background:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[d.jsxs("button",{className:"flex items-center gap-2 w-full px-3 py-2 cursor-pointer",onClick:()=>n(!t),children:[r?d.jsx("span",{className:"w-4 h-4 rounded-full border-2 animate-spin",style:{borderColor:"var(--yc-color-primary)",borderTopColor:"transparent"}}):d.jsx("span",{className:"w-4 h-4 rounded-full flex items-center justify-center text-green-500 bg-green-500/10 border border-green-500/30 text-[10px]",children:"✓"}),d.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:i}),d.jsx("span",{className:"ml-auto transition-transform",style:{color:"var(--yc-color-text-secondary)",transform:t?"rotate(180deg)":"rotate(90deg)"},children:"▸"})]}),t&&d.jsx("div",{className:"border-t px-3 pb-2",style:{borderColor:"var(--yc-color-border)"},children:d.jsx("div",{className:"ml-2 pl-3 border-l-2 mt-2 flex flex-col gap-1.5",style:{borderColor:"var(--yc-color-border)"},children:e.map(l=>d.jsx(t2,{tc:l},l.id))})})]})}function hO({suggestions:e,onSend:t,disabled:n}){return e.length===0?null:d.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:e.map((r,s)=>d.jsx("button",{className:"text-xs px-2.5 py-1 rounded-full transition-opacity hover:opacity-80 disabled:opacity-50",style:r.type==="save"?{color:"var(--yc-color-success, #16a34a)",background:"var(--yc-color-success-bg, rgba(22, 163, 74, 0.08))",border:"1px solid var(--yc-color-success-border, rgba(22, 163, 74, 0.25))"}:{color:"var(--yc-color-text-secondary)",background:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},disabled:n,onClick:()=>t(r.message),children:r.label},s))})}const yr=N.forwardRef(function({option:t,height:n=400,loading:r=!1,onEvents:s},i){const l=N.useRef(null),u=N.useRef(null);N.useImperativeHandle(i,()=>({getDataURL:_=>{var A;const S=(A=l.current)==null?void 0:A.getEchartsInstance();if(S)try{return S.getDataURL({type:_==="png"?"png":"svg",pixelRatio:2,backgroundColor:"#fff"})}catch{return S.getDataURL({type:"svg",pixelRatio:2,backgroundColor:"#fff"})}},getInstance:()=>{var _;return(_=l.current)==null?void 0:_.getEchartsInstance()}}));const f=N.useRef(!1);N.useEffect(()=>{let _;const S=()=>{f.current=!0,clearTimeout(_),_=setTimeout(()=>{f.current=!1},300)};return window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S),clearTimeout(_)}},[]),N.useEffect(()=>{const _=u.current;if(!_)return;let S;const A=new ResizeObserver(()=>{clearTimeout(S),S=setTimeout(()=>{var M,C;(C=(M=l.current)==null?void 0:M.getEchartsInstance())==null||C.resize()},150)});return A.observe(_),()=>{clearTimeout(S),A.disconnect()}},[]);const h=N.useMemo(()=>{const _=t.legend;if(!_||_.show===!1)return[];const S=Array.isArray(t.series)?t.series:[];return(_.data??S.filter(C=>C.name).map(C=>C.name)).map(C=>{var j,F;const I=S.find(B=>B.name===C),D=((j=I==null?void 0:I.itemStyle)==null?void 0:j.color)??((F=I==null?void 0:I.lineStyle)==null?void 0:F.color)??"#999";return{name:C,color:D}})},[t.legend,t.series]),p=h.length>0,y=N.useRef(""),g=N.useRef(t),b=N.useMemo(()=>{const _=JSON.stringify(t);return _!==y.current&&(y.current=_,g.current=t),g.current},[t]),O=N.useMemo(()=>{let _=b;return p&&(_={..._,legend:{..._.legend,show:!1}}),f.current&&(_={..._,animation:!1}),_},[b,p]),[w,T]=N.useState(new Set),E=N.useCallback(_=>{var A;const S=(A=l.current)==null?void 0:A.getEchartsInstance();S&&(S.dispatchAction({type:"legendToggleSelect",name:_}),T(M=>{const C=new Set(M);return C.has(_)?C.delete(_):C.add(_),C}),setTimeout(()=>{var W,Y,Q,re,ye;const M=S.getOption(),C=((Y=(W=M.legend)==null?void 0:W[0])==null?void 0:Y.selected)??{},I=M.series??[],D=I.filter(G=>G.name&&C[G.name]!==!1);if(I.every(G=>!G.name||C[G.name]!==!1)){S.setOption({yAxis:{max:void 0}});return}if(D.length===0)return;const F=G=>typeof G=="number"?G:(G==null?void 0:G.value)??0,B=D.some(G=>G.stack);let U=0;if(B){const G=((re=(Q=D[0])==null?void 0:Q.data)==null?void 0:re.length)??0;for(let fe=0;fe<G;fe++){let P=0;for(const K of D)P+=F((ye=K.data)==null?void 0:ye[fe]);U=Math.max(U,P)}}else for(const G of D)for(const fe of G.data??[])U=Math.max(U,F(fe));S.setOption({yAxis:{max:Math.ceil(U*1.1)||void 0}})},0))},[]);return N.useEffect(()=>{const _=u.current;if(!_||!(s!=null&&s.contextmenu))return;const S=A=>A.preventDefault();return _.addEventListener("contextmenu",S),()=>_.removeEventListener("contextmenu",S)},[s==null?void 0:s.contextmenu]),d.jsxs("div",{ref:u,style:{height:n,width:"100%",display:"flex",flexDirection:"column"},children:[d.jsx("div",{style:{flex:1,minHeight:0},children:d.jsx(sk,{ref:l,option:O,replaceMerge:["series"],lazyUpdate:!0,style:{height:"100%",width:"100%"},showLoading:r,onEvents:s,opts:{renderer:"canvas"}})}),p&&d.jsx("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:"4px 12px",padding:"6px 8px"},children:h.map(({name:_,color:S})=>d.jsxs("button",{onClick:()=>E(_),style:{display:"inline-flex",alignItems:"center",gap:4,background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:12,color:"var(--yc-color-text-secondary)",opacity:w.has(_)?.35:1},children:[d.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:w.has(_)?"#ccc":S,display:"inline-block",flexShrink:0}}),_]},_))})]})}),Gm=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#06B6D4","#F97316","#84CC16","#14B8A6"];function da(e,t,n){if(t)return t;const r=(n==null?void 0:n.palette)??Gm;return r[e%r.length]}function mO(e,t,n,r){return n!=null&&n[e]?n[e]:da(t,void 0,r)}function pO(e,t){const{type:n,data:r,x:s,y:i,title:l,series:u}=e,f=Array.isArray(i)?i:[i],h=f[0]??"value",p={color:Gm,title:l?{text:l,left:"center",textStyle:{fontSize:13,fontWeight:500,color:t.textColor}}:void 0,tooltip:{trigger:n==="pie"?"item":"axis",confine:!0},grid:{left:"3%",right:"4%",bottom:"10%",top:l?36:16,containLabel:!0}};if(n==="pie"){const w=r.map(T=>({name:String(T[s]??""),value:Number(T[h]??0)}));return{...p,series:[{type:"pie",radius:["40%","70%"],data:w,label:{color:t.textColor,fontSize:11}}]}}const y=u?[...new Set(r.map(w=>String(w[s]??"")))]:r.map(w=>String(w[s]??"")),g={type:"category",data:y,axisLabel:{color:t.textColor,fontSize:10},axisLine:{lineStyle:{color:t.splitLineColor}}},b={type:"value",axisLabel:{color:t.textColor,fontSize:10},splitLine:{lineStyle:{color:t.splitLineColor}}};let O;if(u){const w=new Map;for(const T of r){const E=String(T[u]??""),_=String(T[s]??"");w.has(E)||w.set(E,new Map),w.get(E).set(_,Number(T[h]??0))}O=[...w.entries()].map(([T,E])=>({name:T,type:n,smooth:n==="line",data:y.map(_=>E.get(_)??0)}))}else O=f.map(w=>({name:w,type:n,smooth:n==="line",data:r.map(T=>Number(T[w]??0))}));return{...p,xAxis:g,yAxis:b,legend:u||f.length>1?{show:!0,bottom:0,textStyle:{color:t.textColor,fontSize:10}}:void 0,series:O}}function yO({config:e}){const t=Ar(),n=N.useMemo(()=>pO(e,t),[e,t]);return d.jsx("div",{style:{borderRadius:"0.5rem",border:"1px solid var(--yc-color-border)",overflow:"hidden",marginBottom:"0.5rem"},children:d.jsx(yr,{option:n,height:200})})}const s0=10;function gO(e){if(!e)return!1;const t=e.toLowerCase();return["number","int","integer","float","double","decimal","bigint","numeric"].some(n=>t.includes(n))}function xO(e){return typeof e=="number"}function bO(e){return e==null?"—":typeof e=="number"?Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:4}):String(e)}function vO({columns:e,rows:t}){const n=t.slice(0,s0),r=t.length>s0,s=new Set(e.filter(i=>{if(gO(i.type))return!0;const l=t.find(u=>u[i.name]!==null&&u[i.name]!==void 0);return l?xO(l[i.name]):!1}).map(i=>i.name));return d.jsxs("div",{style:{borderRadius:"0.375rem",border:"1px solid var(--yc-color-border)",overflow:"auto",marginBottom:"0.5rem",fontSize:"0.7rem",lineHeight:"1.4"},children:[d.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[d.jsx("thead",{children:d.jsx("tr",{children:e.map(i=>d.jsx("th",{style:{padding:"0.3rem 0.5rem",borderBottom:"1px solid var(--yc-color-border)",background:"var(--yc-color-bg)",color:"var(--yc-color-text)",fontWeight:600,textAlign:s.has(i.name)?"right":"left",whiteSpace:"nowrap"},children:i.name},i.name))})}),d.jsx("tbody",{children:n.map((i,l)=>d.jsx("tr",{children:e.map(u=>{const f=s.has(u.name),h=i[u.name],p=h==null;return d.jsx("td",{style:{padding:"0.2rem 0.5rem",borderBottom:"1px solid var(--yc-color-border)",color:p?"var(--yc-color-text-muted)":"var(--yc-color-text-secondary)",textAlign:f?"right":"left",fontFamily:f?"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace":"inherit",whiteSpace:"nowrap"},children:bO(h)},u.name)})},l))})]}),r&&d.jsxs("div",{style:{padding:"0.25rem 0.5rem",color:"var(--yc-color-text-muted)",fontSize:"0.65rem",textAlign:"center",borderTop:"1px solid var(--yc-color-border)",background:"var(--yc-color-bg)"},children:["Showing ",s0," of ",t.length," rows"]})]})}const EO={strong:({children:e})=>d.jsx("strong",{style:{color:"var(--yc-color-text)",fontWeight:600},children:e}),em:({children:e})=>d.jsx("em",{style:{color:"var(--yc-color-text-secondary)",fontStyle:"italic"},children:e}),h1:({children:e})=>d.jsx("h1",{style:{color:"var(--yc-color-text)",fontWeight:600,fontSize:"1.1rem",marginBottom:"0.5rem",marginTop:"0.75rem"},children:e}),h2:({children:e})=>d.jsx("h2",{style:{color:"var(--yc-color-text)",fontWeight:600,fontSize:"1rem",marginBottom:"0.4rem",marginTop:"0.65rem"},children:e}),h3:({children:e})=>d.jsx("h3",{style:{color:"var(--yc-color-text)",fontWeight:600,fontSize:"0.9rem",marginBottom:"0.35rem",marginTop:"0.5rem"},children:e}),p:({children:e})=>d.jsx("p",{style:{color:"var(--yc-color-text)",marginBottom:"0.5rem",lineHeight:"1.6"},className:"last:mb-0",children:e}),ul:({children:e})=>d.jsx("ul",{style:{color:"var(--yc-color-text)",listStyleType:"disc",paddingLeft:"1.25rem",marginBottom:"0.5rem"},children:e}),ol:({children:e})=>d.jsx("ol",{style:{color:"var(--yc-color-text)",listStyleType:"decimal",paddingLeft:"1.25rem",marginBottom:"0.5rem"},children:e}),li:({children:e})=>d.jsx("li",{style:{color:"var(--yc-color-text)",marginBottom:"0.2rem",lineHeight:"1.5"},children:e}),a:({href:e,children:t})=>d.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--yc-color-primary)",textDecoration:"underline"},children:t}),code:({children:e,className:t})=>{if(t==null?void 0:t.startsWith("language-")){const r=String(e).replace(/\n$/,"");if(t==="language-chart")try{const s=JSON.parse(r);return d.jsx(yO,{config:s})}catch{}if(t==="language-data")try{const s=JSON.parse(r);return d.jsx(vO,{columns:s.columns,rows:s.rows})}catch{}return d.jsx("code",{style:{display:"block",background:"var(--yc-color-bg)",color:"var(--yc-color-text)",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:"0.78rem",padding:"0.75rem",borderRadius:"0.375rem",overflowX:"auto",whiteSpace:"pre"},children:e})}return d.jsx("code",{style:{background:"var(--yc-color-bg)",color:"var(--yc-color-text)",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:"0.78rem",padding:"0.1rem 0.3rem",borderRadius:"0.25rem",border:"1px solid var(--yc-color-border)"},children:e})},pre:({children:e})=>d.jsx("pre",{style:{background:"var(--yc-color-bg)",border:"1px solid var(--yc-color-border)",borderRadius:"0.375rem",padding:"0.75rem",overflowX:"auto",marginBottom:"0.5rem",fontSize:"0.78rem",lineHeight:"1.5"},children:e}),table:({children:e})=>d.jsx("div",{style:{overflowX:"auto",marginBottom:"0.5rem"},children:d.jsx("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.8rem",color:"var(--yc-color-text)"},children:e})}),th:({children:e})=>d.jsx("th",{style:{color:"var(--yc-color-text)",fontWeight:600,padding:"0.35rem 0.6rem",borderBottom:"1px solid var(--yc-color-border)",textAlign:"left"},children:e}),td:({children:e})=>d.jsx("td",{style:{color:"var(--yc-color-text-secondary)",padding:"0.3rem 0.6rem",borderBottom:"1px solid var(--yc-color-border)"},children:e}),blockquote:({children:e})=>d.jsx("blockquote",{style:{borderLeft:"3px solid var(--yc-color-border)",paddingLeft:"0.75rem",marginLeft:0,marginBottom:"0.5rem",color:"var(--yc-color-text-secondary)",fontStyle:"italic"},children:e}),hr:()=>d.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--yc-color-border)",marginTop:"0.5rem",marginBottom:"0.5rem"}})};function TO({message:e,isStreaming:t,onSendMessage:n}){return e.role==="user"?d.jsx("div",{className:"flex justify-end",children:d.jsx("div",{className:"rounded-xl rounded-br-sm px-3 py-2 text-sm max-w-[85%] text-white",style:{background:"var(--yc-color-primary)"},children:e.content})}):d.jsx("div",{className:"flex justify-start",children:d.jsxs("div",{className:"max-w-[90%]",children:[e.toolCalls&&e.toolCalls.length>0&&d.jsx(fO,{toolCalls:e.toolCalls}),e.content&&d.jsxs("div",{className:"rounded-xl rounded-bl-sm px-3 py-2 text-sm",style:{background:"var(--yc-color-surface)",color:"var(--yc-color-text)"},children:[d.jsx(e2,{components:EO,children:e.content}),t&&d.jsx("span",{className:"inline-block w-1.5 h-4 ml-0.5 animate-pulse",style:{background:"var(--yc-color-primary)"}})]}),e.suggestions&&e.suggestions.length>0&&!t&&n&&d.jsx(hO,{suggestions:e.suggestions,onSend:n})]})})}function wO({onSend:e,placeholder:t,disabled:n,initialValue:r}){const[s,i]=N.useState(r??"");N.useEffect(()=>{r&&i(r)},[r]);const l=N.useRef(null),u=N.useCallback(()=>{const h=s.trim();!h||n||(e(h),i(""),l.current&&(l.current.style.height="auto"))},[s,n,e]),f=N.useCallback(h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),u())},[u]);return d.jsxs("div",{className:"flex items-end gap-2 rounded-lg px-3 py-2",style:{background:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[d.jsx("textarea",{ref:l,value:s,onChange:h=>{i(h.target.value),h.target.style.height="auto",h.target.style.height=Math.min(h.target.scrollHeight,120)+"px"},onKeyDown:f,placeholder:t,disabled:n,rows:1,className:"flex-1 bg-transparent resize-none text-sm outline-none",style:{color:"var(--yc-color-text)",minHeight:"20px"}}),d.jsx("button",{onClick:u,disabled:n||!s.trim(),className:"rounded-md px-2 py-1 text-xs text-white disabled:opacity-40",style:{background:"var(--yc-color-primary)"},children:"↵"})]})}function kO({overlay:e}){const{messages:t,panelOpen:n,panelWidth:r,isStreaming:s,context:i,activeAgent:l,prefillMessage:u,closePanel:f,clearConversation:h,setPanelWidth:p}=Rs(),{sendMessage:y}=QN(),g=N.useRef(null),b=N.useRef(null);N.useEffect(()=>{var T;(T=g.current)==null||T.scrollIntoView({behavior:"smooth"})},[t]);const O=N.useCallback(T=>{T.preventDefault(),b.current={startX:T.clientX,startWidth:r};const E=S=>{if(!b.current)return;const A=b.current.startX-S.clientX,M=Math.max(300,Math.min(window.innerWidth*.5,b.current.startWidth+A));p(M)},_=()=>{b.current=null,document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",_)};document.addEventListener("mousemove",E),document.addEventListener("mouseup",_)},[r,p]);if(!n)return null;const w=(i==null?void 0:i.type)==="dashboard"?"Ask about this dashboard...":(i==null?void 0:i.type)==="chart"?"Ask about this chart...":"Ask a question...";return d.jsxs("div",{className:"flex h-full",style:{width:r,...e?{position:"fixed",right:0,top:"var(--topbar-height, 48px)",height:"calc(100vh - var(--topbar-height, 48px))",zIndex:40}:{}},children:[d.jsx("div",{className:"w-1.5 cursor-col-resize flex items-center justify-center hover:opacity-100 opacity-50 transition-opacity",style:{background:"var(--yc-color-border)"},onMouseDown:O,children:d.jsx("div",{className:"w-0.5 h-8 rounded",style:{background:"var(--yc-color-text-secondary)"}})}),d.jsxs("div",{className:"flex-1 flex flex-col h-full",style:{background:"var(--yc-color-bg)",borderLeft:"1px solid var(--yc-color-border)"},children:[d.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",style:{borderBottom:"1px solid var(--yc-color-border)"},children:[d.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"#a78bfa"}}),d.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--yc-color-text)"},children:"AI Assistant"}),l&&d.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["(",l,")"]}),d.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[t.length>0&&d.jsx("button",{className:"p-1 rounded hover:opacity-80 text-xs",style:{color:"var(--yc-color-text-secondary)"},onClick:h,title:"New chat",children:d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M12 20h9"}),d.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})}),d.jsx("button",{className:"p-1 rounded hover:opacity-80",style:{color:"var(--yc-color-text-secondary)"},onClick:f,children:"✕"})]})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 flex flex-col gap-3",children:[t.length===0&&d.jsx("div",{className:"flex-1 flex items-center justify-center",children:d.jsx("p",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"Ask anything about your data"})}),t.map((T,E)=>d.jsx(TO,{message:T,isStreaming:s&&E===t.length-1&&T.role==="assistant",onSendMessage:y},E)),d.jsx("div",{ref:g})]}),d.jsx("div",{className:"px-4 py-3",style:{borderTop:"1px solid var(--yc-color-border)"},children:d.jsx(wO,{onSend:T=>{y(T),u&&Rs.setState({prefillMessage:null})},placeholder:w,disabled:s,initialValue:u??void 0})})]})]})}const xx="yamchart-sidebar-hidden";function SO({children:e,currentPath:t,onNavigate:n,onNavigateToUsers:r,onNavigateToShares:s}){const{data:i}=ga(),{data:l}=hv(),u=Rm(),f=Tm(),h=Rs(M=>M.panelOpen),p=(i==null?void 0:i.charts)||[],y=l||[],[g,b]=N.useState(()=>u.sidebarShow?localStorage.getItem(xx)==="true":!0),[O,w]=N.useState(!1),[T,E]=N.useState(!1);N.useEffect(()=>{const M=C=>{(C.metaKey||C.ctrlKey)&&C.key==="k"&&(C.preventDefault(),E(!0))};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[]);const _=!g&&f==="lg",S=!1,A=N.useCallback(()=>{if(f==="sm"){w(M=>!M);return}b(M=>{const C=!M;return localStorage.setItem(xx,String(C)),C})},[f]);return d.jsxs("div",{className:"flex h-screen",style:{backgroundColor:"var(--yc-color-background)"},children:[_&&d.jsx(O1,{dashboards:y,charts:p,currentPath:t,onNavigate:n,collapsed:S}),f==="sm"&&O&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 transition-opacity",onClick:()=>w(!1)}),d.jsx("aside",{className:"fixed inset-y-0 left-0 z-50 w-64 shadow-xl",style:{backgroundColor:"var(--yc-color-sidebar)"},children:d.jsx(O1,{dashboards:y,charts:p,currentPath:t,onNavigate:M=>{n(M),w(!1)}})})]}),d.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[d.jsx(YN,{onToggleSidebar:A,onOpenSearch:()=>E(!0),currentPath:t,onNavigateToUsers:r,onNavigateToShares:s}),d.jsxs("div",{className:"flex-1 flex min-h-0",children:[d.jsx("main",{className:"flex-1 overflow-auto",children:e}),f!=="sm"&&h&&d.jsx(kO,{overlay:f==="md"})]})]}),d.jsx(VN,{isOpen:T,onClose:()=>E(!1),onNavigate:M=>{n(M),E(!1)},dashboards:y,charts:p})]})}function CO(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 o0={},jl={};function Vo(e,t){try{const r=(o0[e]||(o0[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in jl?jl[r]:bx(r,r.split(":"))}catch{if(e in jl)return jl[e];const n=e==null?void 0:e.match(NO);return n?bx(e,n.slice(1)):NaN}}const NO=/([+-]\d\d):?(\d\d)?/;function bx(e,t){const n=+(t[0]||0),r=+(t[1]||0),s=+(t[2]||0)/60;return jl[e]=n*60+r>0?n*60+r+s:n*60-r-s}class us extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Vo(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)),n2(this),em(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new us(...n,t):new us(Date.now(),t)}withTimeZone(t){return new us(+this,t)}getTimezoneOffset(){const t=-Vo(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),em(this),+this}[Symbol.for("constructDateFrom")](t){return new us(+new Date(t),this.timeZone)}}const vx=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!vx.test(e))return;const t=e.replace(vx,"$1UTC");us.prototype[t]&&(e.startsWith("get")?us.prototype[e]=function(){return this.internal[t]()}:(us.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),_O(this),+this},us.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),em(this),+this}))});function em(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Vo(e.timeZone,e)*60))}function _O(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()),n2(e)}function n2(e){const t=Vo(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const s=-new Date(+e).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),l=s-i,u=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();l&&u&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+l);const f=s-n;f&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+f);const h=new Date(+e);h.setUTCSeconds(0);const p=s>0?h.getSeconds():(h.getSeconds()-60)%60,y=Math.round(-(Vo(e.timeZone,e)*60))%60;(y||p)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+y),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+y+p));const g=Vo(e.timeZone,e),b=g>0?Math.floor(g):Math.ceil(g),w=-new Date(+e).getTimezoneOffset()-b,T=b!==n,E=w-f;if(T&&E){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+E);const _=Vo(e.timeZone,e),S=_>0?Math.floor(_):Math.ceil(_),A=b-S;A&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+A),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+A))}}class Bn extends us{static tz(t,...n){return n.length?new Bn(...n,t):new Bn(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),s=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+s}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,s]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${s}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,s]=this.tzComponents();return`${t} GMT${n}${r}${s} (${CO(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"),s=String(Math.abs(t)%60).padStart(2,"0");return[n,r,s]}withTimeZone(t){return new Bn(+this,t)}[Symbol.for("constructDateFrom")](t){return new Bn(+new Date(t),this.timeZone)}}const Ex=5,DO=4;function OO(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,s=t.addDays(e,-r+1),i=t.addDays(s,Ex*7-1);return t.getMonth(e)===t.getMonth(i)?Ex:DO}function r2(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 AO(e,t){const n=r2(e,t),r=OO(e,t);return t.addDays(n,r*7-1)}const s2={...$o,labels:{labelDayButton:(e,t,n,r)=>{let s;r&&typeof r.format=="function"?s=r.format.bind(r):s=(l,u)=>dn(l,u,{locale:$o,...n});let i=s(e,"PPPP");return t.today&&(i=`Today, ${i}`),t.selected&&(i=`${i}, selected`),i},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=(s,i)=>dn(s,i,{locale:$o,...t}),r(e,"LLLL yyyy")},labelGridcell:(e,t,n,r)=>{let s;r&&typeof r.format=="function"?s=r.format.bind(r):s=(l,u)=>dn(l,u,{locale:$o,...n});let i=s(e,"PPPP");return t!=null&&t.today&&(i=`Today, ${i}`),i},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(s,i)=>dn(s,i,{locale:$o,...t}),r(e,"cccc")}}};class pr{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?Bn.tz(this.options.timeZone):new this.Date},this.newDate=(r,s,i)=>{var l;return(l=this.overrides)!=null&&l.newDate?this.overrides.newDate(r,s,i):this.options.timeZone?new Bn(r,s,i,this.options.timeZone):new Date(r,s,i)},this.addDays=(r,s)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(r,s):Ls(r,s)},this.addMonths=(r,s)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(r,s):Ti(r,s)},this.addWeeks=(r,s)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(r,s):yd(r,s)},this.addYears=(r,s)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(r,s):gd(r,s)},this.differenceInCalendarDays=(r,s)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,s):Cm(r,s)},this.differenceInCalendarMonths=(r,s)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,s):ev(r,s)},this.eachMonthOfInterval=r=>{var s;return(s=this.overrides)!=null&&s.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):sS(r)},this.eachYearOfInterval=r=>{var u;const s=(u=this.overrides)!=null&&u.eachYearOfInterval?this.overrides.eachYearOfInterval(r):oS(r),i=new Set(s.map(f=>this.getYear(f)));if(i.size===s.length)return s;const l=[];return i.forEach(f=>{l.push(new Date(f,0,1))}),l},this.endOfBroadcastWeek=r=>{var s;return(s=this.overrides)!=null&&s.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):AO(r,this)},this.endOfISOWeek=r=>{var s;return(s=this.overrides)!=null&&s.endOfISOWeek?this.overrides.endOfISOWeek(r):aS(r)},this.endOfMonth=r=>{var s;return(s=this.overrides)!=null&&s.endOfMonth?this.overrides.endOfMonth(r):xd(r)},this.endOfWeek=(r,s)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(r,s):vd(r,this.options)},this.endOfYear=r=>{var s;return(s=this.overrides)!=null&&s.endOfYear?this.overrides.endOfYear(r):bd(r)},this.format=(r,s,i)=>{var u;const l=(u=this.overrides)!=null&&u.format?this.overrides.format(r,s,this.options):dn(r,s,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(l):l},this.getISOWeek=r=>{var s;return(s=this.overrides)!=null&&s.getISOWeek?this.overrides.getISOWeek(r):Ed(r)},this.getMonth=(r,s)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(r,this.options):tC(r,this.options)},this.getYear=(r,s)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(r,this.options):nC(r,this.options)},this.getWeek=(r,s)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(r,this.options):Td(r,this.options)},this.isAfter=(r,s)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(r,s):rC(r,s)},this.isBefore=(r,s)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(r,s):sC(r,s)},this.isDate=r=>{var s;return(s=this.overrides)!=null&&s.isDate?this.overrides.isDate(r):Zb(r)},this.isSameDay=(r,s)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(r,s):tS(r,s)},this.isSameMonth=(r,s)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(r,s):eN(r,s)},this.isSameYear=(r,s)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(r,s):tN(r,s)},this.max=r=>{var s;return(s=this.overrides)!=null&&s.max?this.overrides.max(r):Zk(r)},this.min=r=>{var s;return(s=this.overrides)!=null&&s.min?this.overrides.min(r):eS(r)},this.setMonth=(r,s)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(r,s):gN(r,s)},this.setYear=(r,s)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(r,s):xN(r,s)},this.startOfBroadcastWeek=(r,s)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):r2(r,this)},this.startOfDay=r=>{var s;return(s=this.overrides)!=null&&s.startOfDay?this.overrides.startOfDay(r):ca(r)},this.startOfISOWeek=r=>{var s;return(s=this.overrides)!=null&&s.startOfISOWeek?this.overrides.startOfISOWeek(r):ua(r)},this.startOfMonth=r=>{var s;return(s=this.overrides)!=null&&s.startOfMonth?this.overrides.startOfMonth(r):Xl(r)},this.startOfWeek=(r,s)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(r,this.options):$r(r,this.options)},this.startOfYear=r=>{var s;return(s=this.overrides)!=null&&s.startOfYear?this.overrides.startOfYear(r):gi(r)},this.options={locale:s2,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let s=0;s<10;s++)r[s.toString()]=n.format(s);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&&pr.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:s}=this.options,i=n==null?void 0:n.code;if(i&&pr.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:r,numberingSystem:s}).format(t)}catch{}const l=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,l)}}pr.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 hs=new pr;class o2{constructor(t,n,r=hs){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 IO{constructor(t,n){this.date=t,this.weeks=n}}class MO{constructor(t,n){this.days=n,this.weekNumber=t}}function LO(e){return Le.createElement("button",{...e})}function RO(e){return Le.createElement("span",{...e})}function PO(e){const{size:t=24,orientation:n="left",className:r}=e;return Le.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&Le.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&Le.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&Le.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&Le.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function jO(e){const{day:t,modifiers:n,...r}=e;return Le.createElement("td",{...r})}function FO(e){const{day:t,modifiers:n,...r}=e,s=Le.useRef(null);return Le.useEffect(()=>{var i;n.focused&&((i=s.current)==null||i.focus())},[n.focused]),Le.createElement("button",{ref:s,...r})}var st;(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"})(st||(st={}));var nn;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(nn||(nn={}));var Wr;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Wr||(Wr={}));var hr;(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"})(hr||(hr={}));function BO(e){const{options:t,className:n,components:r,classNames:s,...i}=e,l=[s[st.Dropdown],n].join(" "),u=t==null?void 0:t.find(({value:f})=>f===i.value);return Le.createElement("span",{"data-disabled":i.disabled,className:s[st.DropdownRoot]},Le.createElement(r.Select,{className:l,...i},t==null?void 0:t.map(({value:f,label:h,disabled:p})=>Le.createElement(r.Option,{key:f,value:f,disabled:p},h))),Le.createElement("span",{className:s[st.CaptionLabel],"aria-hidden":!0},u==null?void 0:u.label,Le.createElement(r.Chevron,{orientation:"down",size:18,className:s[st.Chevron]})))}function HO(e){return Le.createElement("div",{...e})}function UO(e){return Le.createElement("div",{...e})}function zO(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Le.createElement("div",{...r},e.children)}function WO(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Le.createElement("div",{...r})}function YO(e){return Le.createElement("table",{...e})}function $O(e){return Le.createElement("div",{...e})}const a2=N.createContext(void 0);function mu(){const e=N.useContext(a2);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function qO(e){const{components:t}=mu();return Le.createElement(t.Dropdown,{...e})}function VO(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:s,...i}=e,{components:l,classNames:u,labels:{labelPrevious:f,labelNext:h}}=mu(),p=N.useCallback(g=>{s&&(n==null||n(g))},[s,n]),y=N.useCallback(g=>{r&&(t==null||t(g))},[r,t]);return Le.createElement("nav",{...i},Le.createElement(l.PreviousMonthButton,{type:"button",className:u[st.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":f(r),onClick:y},Le.createElement(l.Chevron,{disabled:r?void 0:!0,className:u[st.Chevron],orientation:"left"})),Le.createElement(l.NextMonthButton,{type:"button",className:u[st.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":h(s),onClick:p},Le.createElement(l.Chevron,{disabled:s?void 0:!0,orientation:"right",className:u[st.Chevron]})))}function QO(e){const{components:t}=mu();return Le.createElement(t.Button,{...e})}function GO(e){return Le.createElement("option",{...e})}function KO(e){const{components:t}=mu();return Le.createElement(t.Button,{...e})}function XO(e){const{rootRef:t,...n}=e;return Le.createElement("div",{...n,ref:t})}function JO(e){return Le.createElement("select",{...e})}function ZO(e){const{week:t,...n}=e;return Le.createElement("tr",{...n})}function e5(e){return Le.createElement("th",{...e})}function t5(e){return Le.createElement("thead",{"aria-hidden":!0},Le.createElement("tr",{...e}))}function n5(e){const{week:t,...n}=e;return Le.createElement("th",{...n})}function r5(e){return Le.createElement("th",{...e})}function s5(e){return Le.createElement("tbody",{...e})}function o5(e){const{components:t}=mu();return Le.createElement(t.Dropdown,{...e})}const a5=Object.freeze(Object.defineProperty({__proto__:null,Button:LO,CaptionLabel:RO,Chevron:PO,Day:jO,DayButton:FO,Dropdown:BO,DropdownNav:HO,Footer:UO,Month:zO,MonthCaption:WO,MonthGrid:YO,Months:$O,MonthsDropdown:qO,Nav:VO,NextMonthButton:QO,Option:GO,PreviousMonthButton:KO,Root:XO,Select:JO,Week:ZO,WeekNumber:n5,WeekNumberHeader:r5,Weekday:e5,Weekdays:t5,Weeks:s5,YearsDropdown:o5},Symbol.toStringTag,{value:"Module"}));function As(e,t,n=!1,r=hs){let{from:s,to:i}=e;const{differenceInCalendarDays:l,isSameDay:u}=r;return s&&i?(l(i,s)<0&&([s,i]=[i,s]),l(t,s)>=(n?1:0)&&l(i,t)>=(n?1:0)):!n&&i?u(i,t):!n&&s?u(s,t):!1}function Km(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Dd(e){return!!(e&&typeof e=="object"&&"from"in e)}function Xm(e){return!!(e&&typeof e=="object"&&"after"in e)}function Jm(e){return!!(e&&typeof e=="object"&&"before"in e)}function i2(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function l2(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Is(e,t,n=hs){const r=Array.isArray(t)?t:[t],{isSameDay:s,differenceInCalendarDays:i,isAfter:l}=n;return r.some(u=>{if(typeof u=="boolean")return u;if(n.isDate(u))return s(e,u);if(l2(u,n))return u.some(f=>s(e,f));if(Dd(u))return As(u,e,!1,n);if(i2(u))return Array.isArray(u.dayOfWeek)?u.dayOfWeek.includes(e.getDay()):u.dayOfWeek===e.getDay();if(Km(u)){const f=i(u.before,e),h=i(u.after,e),p=f>0,y=h<0;return l(u.before,u.after)?y&&p:p||y}return Xm(u)?i(e,u.after)>0:Jm(u)?i(u.before,e)>0:typeof u=="function"?u(e):!1})}function i5(e,t,n,r,s){const{disabled:i,hidden:l,modifiers:u,showOutsideDays:f,broadcastCalendar:h,today:p=s.today()}=t,{isSameDay:y,isSameMonth:g,startOfMonth:b,isBefore:O,endOfMonth:w,isAfter:T}=s,E=n&&b(n),_=r&&w(r),S={[nn.focused]:[],[nn.outside]:[],[nn.disabled]:[],[nn.hidden]:[],[nn.today]:[]},A={};for(const M of e){const{date:C,displayMonth:I}=M,D=!!(I&&!g(C,I)),j=!!(E&&O(C,E)),F=!!(_&&T(C,_)),B=!!(i&&Is(C,i,s)),U=!!(l&&Is(C,l,s))||j||F||!h&&!f&&D||h&&f===!1&&D,W=y(C,p);D&&S.outside.push(M),B&&S.disabled.push(M),U&&S.hidden.push(M),W&&S.today.push(M),u&&Object.keys(u).forEach(Y=>{const Q=u==null?void 0:u[Y];Q&&Is(C,Q,s)&&(A[Y]?A[Y].push(M):A[Y]=[M])})}return M=>{const C={[nn.focused]:!1,[nn.disabled]:!1,[nn.hidden]:!1,[nn.outside]:!1,[nn.today]:!1},I={};for(const D in S){const j=S[D];C[D]=j.some(F=>F===M)}for(const D in A)I[D]=A[D].some(j=>j===M);return{...C,...I}}}function l5(e,t,n={}){return Object.entries(e).filter(([,s])=>s===!0).reduce((s,[i])=>(n[i]?s.push(n[i]):t[nn[i]]?s.push(t[nn[i]]):t[Wr[i]]&&s.push(t[Wr[i]]),s),[t[st.Day]])}function u5(e){return{...a5,...e}}function c5(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 d5(){const e={};for(const t in st)e[st[t]]=`rdp-${st[t]}`;for(const t in nn)e[nn[t]]=`rdp-${nn[t]}`;for(const t in Wr)e[Wr[t]]=`rdp-${Wr[t]}`;for(const t in hr)e[hr[t]]=`rdp-${hr[t]}`;return e}function u2(e,t,n){return(n??new pr(t)).formatMonthYear(e)}const f5=u2;function h5(e,t,n){return(n??new pr(t)).format(e,"d")}function m5(e,t=hs){return t.format(e,"LLLL")}function p5(e,t,n){return(n??new pr(t)).format(e,"cccccc")}function y5(e,t=hs){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function g5(){return""}function c2(e,t=hs){return t.format(e,"yyyy")}const x5=c2,b5=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:u2,formatDay:h5,formatMonthCaption:f5,formatMonthDropdown:m5,formatWeekNumber:y5,formatWeekNumberHeader:g5,formatWeekdayName:p5,formatYearCaption:x5,formatYearDropdown:c2},Symbol.toStringTag,{value:"Module"}));function v5(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...b5,...e}}function Zm(e,t,n,r){let s=(r??new pr(n)).format(e,"PPPP");return t.today&&(s=`Today, ${s}`),t.selected&&(s=`${s}, selected`),s}const E5=Zm;function ep(e,t,n){return(n??new pr(t)).formatMonthYear(e)}const T5=ep;function d2(e,t,n,r){let s=(r??new pr(n)).format(e,"PPPP");return t!=null&&t.today&&(s=`Today, ${s}`),s}function f2(e){return"Choose the Month"}function h2(){return""}const w5="Go to the Next Month";function m2(e,t){return w5}function p2(e){return"Go to the Previous Month"}function y2(e,t,n){return(n??new pr(t)).format(e,"cccc")}function g2(e,t){return`Week ${e}`}function x2(e){return"Week Number"}function b2(e){return"Choose the Year"}const k5=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:T5,labelDay:E5,labelDayButton:Zm,labelGrid:ep,labelGridcell:d2,labelMonthDropdown:f2,labelNav:h2,labelNext:m2,labelPrevious:p2,labelWeekNumber:g2,labelWeekNumberHeader:x2,labelWeekday:y2,labelYearDropdown:b2},Symbol.toStringTag,{value:"Module"})),Br=(e,t,n)=>t||(n?typeof n=="function"?n:(...r)=>n:e);function S5(e,t){var r;const n=((r=t.locale)==null?void 0:r.labels)??{};return{...k5,...e??{},labelDayButton:Br(Zm,e==null?void 0:e.labelDayButton,n.labelDayButton),labelMonthDropdown:Br(f2,e==null?void 0:e.labelMonthDropdown,n.labelMonthDropdown),labelNext:Br(m2,e==null?void 0:e.labelNext,n.labelNext),labelPrevious:Br(p2,e==null?void 0:e.labelPrevious,n.labelPrevious),labelWeekNumber:Br(g2,e==null?void 0:e.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:Br(b2,e==null?void 0:e.labelYearDropdown,n.labelYearDropdown),labelGrid:Br(ep,e==null?void 0:e.labelGrid,n.labelGrid),labelGridcell:Br(d2,e==null?void 0:e.labelGridcell,n.labelGridcell),labelNav:Br(h2,e==null?void 0:e.labelNav,n.labelNav),labelWeekNumberHeader:Br(x2,e==null?void 0:e.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:Br(y2,e==null?void 0:e.labelWeekday,n.labelWeekday)}}function C5(e,t,n,r,s){const{startOfMonth:i,startOfYear:l,endOfYear:u,eachMonthOfInterval:f,getMonth:h}=s;return f({start:l(e),end:u(e)}).map(g=>{const b=r.formatMonthDropdown(g,s),O=h(g),w=t&&g<i(t)||n&&g>i(n)||!1;return{value:O,label:b,disabled:w}})}function N5(e,t={},n={}){let r={...t==null?void 0:t[st.Day]};return Object.entries(e).filter(([,s])=>s===!0).forEach(([s])=>{r={...r,...n==null?void 0:n[s]}}),r}function _5(e,t,n,r){const s=r??e.today(),i=n?e.startOfBroadcastWeek(s,e):t?e.startOfISOWeek(s):e.startOfWeek(s),l=[];for(let u=0;u<7;u++){const f=e.addDays(i,u);l.push(f)}return l}function D5(e,t,n,r,s=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:l,eachYearOfInterval:u,getYear:f}=r,h=i(e),p=l(t),y=u({start:h,end:p});return s&&y.reverse(),y.map(g=>{const b=n.formatYearDropdown(g,r);return{value:f(g),label:b,disabled:!1}})}function O5(e,t={}){var u;const{weekStartsOn:n,locale:r}=t,s=n??((u=r==null?void 0:r.options)==null?void 0:u.weekStartsOn)??0,i=f=>{const h=typeof f=="number"||typeof f=="string"?new Date(f):f;return new Bn(h.getFullYear(),h.getMonth(),h.getDate(),12,0,0,e)},l=f=>{const h=i(f);return new Date(h.getFullYear(),h.getMonth(),h.getDate(),0,0,0,0)};return{today:()=>i(Bn.tz(e)),newDate:(f,h,p)=>new Bn(f,h,p,12,0,0,e),startOfDay:f=>i(f),startOfWeek:(f,h)=>{const p=i(f),y=(h==null?void 0:h.weekStartsOn)??s,g=(p.getDay()-y+7)%7;return p.setDate(p.getDate()-g),p},startOfISOWeek:f=>{const h=i(f),p=(h.getDay()-1+7)%7;return h.setDate(h.getDate()-p),h},startOfMonth:f=>{const h=i(f);return h.setDate(1),h},startOfYear:f=>{const h=i(f);return h.setMonth(0,1),h},endOfWeek:(f,h)=>{const p=i(f),b=((((h==null?void 0:h.weekStartsOn)??s)+6)%7-p.getDay()+7)%7;return p.setDate(p.getDate()+b),p},endOfISOWeek:f=>{const h=i(f),p=(7-h.getDay())%7;return h.setDate(h.getDate()+p),h},endOfMonth:f=>{const h=i(f);return h.setMonth(h.getMonth()+1,0),h},endOfYear:f=>{const h=i(f);return h.setMonth(11,31),h},eachMonthOfInterval:f=>{const h=i(f.start),p=i(f.end),y=[],g=new Bn(h.getFullYear(),h.getMonth(),1,12,0,0,e),b=p.getFullYear()*12+p.getMonth();for(;g.getFullYear()*12+g.getMonth()<=b;)y.push(new Bn(g,e)),g.setMonth(g.getMonth()+1,1);return y},addDays:(f,h)=>{const p=i(f);return p.setDate(p.getDate()+h),p},addWeeks:(f,h)=>{const p=i(f);return p.setDate(p.getDate()+h*7),p},addMonths:(f,h)=>{const p=i(f);return p.setMonth(p.getMonth()+h),p},addYears:(f,h)=>{const p=i(f);return p.setFullYear(p.getFullYear()+h),p},eachYearOfInterval:f=>{const h=i(f.start),p=i(f.end),y=[],g=new Bn(h.getFullYear(),0,1,12,0,0,e);for(;g.getFullYear()<=p.getFullYear();)y.push(new Bn(g,e)),g.setFullYear(g.getFullYear()+1,0,1);return y},getWeek:(f,h)=>{var y;const p=l(f);return Td(p,{weekStartsOn:(h==null?void 0:h.weekStartsOn)??s,firstWeekContainsDate:(h==null?void 0:h.firstWeekContainsDate)??((y=r==null?void 0:r.options)==null?void 0:y.firstWeekContainsDate)??1})},getISOWeek:f=>{const h=l(f);return Ed(h)},differenceInCalendarDays:(f,h)=>{const p=l(f),y=l(h);return Cm(p,y)},differenceInCalendarMonths:(f,h)=>{const p=l(f),y=l(h);return ev(p,y)}}}const pu=e=>e instanceof HTMLElement?e:null,a0=e=>[...e.querySelectorAll("[data-animated-month]")??[]],A5=e=>pu(e.querySelector("[data-animated-month]")),i0=e=>pu(e.querySelector("[data-animated-caption]")),l0=e=>pu(e.querySelector("[data-animated-weeks]")),I5=e=>pu(e.querySelector("[data-animated-nav]")),M5=e=>pu(e.querySelector("[data-animated-weekdays]"));function L5(e,t,{classNames:n,months:r,focused:s,dateLib:i}){const l=N.useRef(null),u=N.useRef(r),f=N.useRef(!1);N.useLayoutEffect(()=>{const h=u.current;if(u.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||h.length===0||r.length!==h.length)return;const p=i.isSameMonth(r[0].date,h[0].date),y=i.isAfter(r[0].date,h[0].date),g=y?n[hr.caption_after_enter]:n[hr.caption_before_enter],b=y?n[hr.weeks_after_enter]:n[hr.weeks_before_enter],O=l.current,w=e.current.cloneNode(!0);if(w instanceof HTMLElement?(a0(w).forEach(S=>{if(!(S instanceof HTMLElement))return;const A=A5(S);A&&S.contains(A)&&S.removeChild(A);const M=i0(S);M&&M.classList.remove(g);const C=l0(S);C&&C.classList.remove(b)}),l.current=w):l.current=null,f.current||p||s)return;const T=O instanceof HTMLElement?a0(O):[],E=a0(e.current);if(E!=null&&E.every(_=>_ instanceof HTMLElement)&&T&&T.every(_=>_ instanceof HTMLElement)){f.current=!0,e.current.style.isolation="isolate";const _=I5(e.current);_&&(_.style.zIndex="1"),E.forEach((S,A)=>{const M=T[A];if(!M)return;S.style.position="relative",S.style.overflow="hidden";const C=i0(S);C&&C.classList.add(g);const I=l0(S);I&&I.classList.add(b);const D=()=>{f.current=!1,e.current&&(e.current.style.isolation=""),_&&(_.style.zIndex=""),C&&C.classList.remove(g),I&&I.classList.remove(b),S.style.position="",S.style.overflow="",S.contains(M)&&S.removeChild(M)};M.style.pointerEvents="none",M.style.position="absolute",M.style.overflow="hidden",M.setAttribute("aria-hidden","true");const j=M5(M);j&&(j.style.opacity="0");const F=i0(M);F&&(F.classList.add(y?n[hr.caption_before_exit]:n[hr.caption_after_exit]),F.addEventListener("animationend",D));const B=l0(M);B&&B.classList.add(y?n[hr.weeks_before_exit]:n[hr.weeks_after_exit]),S.insertBefore(M,S.firstChild)})}})}function R5(e,t,n,r){const s=e[0],i=e[e.length-1],{ISOWeek:l,fixedWeeks:u,broadcastCalendar:f}=n??{},{addDays:h,differenceInCalendarDays:p,differenceInCalendarMonths:y,endOfBroadcastWeek:g,endOfISOWeek:b,endOfMonth:O,endOfWeek:w,isAfter:T,startOfBroadcastWeek:E,startOfISOWeek:_,startOfWeek:S}=r,A=f?E(s,r):l?_(s):S(s),M=f?g(i):l?b(O(i)):w(O(i)),C=t&&(f?g(t):l?b(t):w(t)),I=C&&T(M,C)?C:M,D=p(I,A),j=y(i,s)+1,F=[];for(let W=0;W<=D;W++){const Y=h(A,W);F.push(Y)}const U=(f?35:42)*j;if(u&&F.length<U){const W=U-F.length;for(let Y=0;Y<W;Y++){const Q=h(F[F.length-1],1);F.push(Q)}}return F}function P5(e){const t=[];return e.reduce((n,r)=>{const s=r.weeks.reduce((i,l)=>i.concat(l.days.slice()),t.slice());return n.concat(s.slice())},t.slice())}function j5(e,t,n,r){const{numberOfMonths:s=1}=n,i=[];for(let l=0;l<s;l++){const u=r.addMonths(e,l);if(t&&u>t)break;i.push(u)}return i}function Tx(e,t,n,r){const{month:s,defaultMonth:i,today:l=r.today(),numberOfMonths:u=1}=e;let f=s||i||l;const{differenceInCalendarMonths:h,addMonths:p,startOfMonth:y}=r;if(n&&h(n,f)<u-1){const g=-1*(u-1);f=p(n,g)}return t&&h(f,t)<0&&(f=t),y(f)}function F5(e,t,n,r){const{addDays:s,endOfBroadcastWeek:i,endOfISOWeek:l,endOfMonth:u,endOfWeek:f,getISOWeek:h,getWeek:p,startOfBroadcastWeek:y,startOfISOWeek:g,startOfWeek:b}=r,O=e.reduce((w,T)=>{const E=n.broadcastCalendar?y(T,r):n.ISOWeek?g(T):b(T),_=n.broadcastCalendar?i(T):n.ISOWeek?l(u(T)):f(u(T)),S=t.filter(I=>I>=E&&I<=_),A=n.broadcastCalendar?35:42;if(n.fixedWeeks&&S.length<A){const I=t.filter(D=>{const j=A-S.length;return D>_&&D<=s(_,j)});S.push(...I)}const M=S.reduce((I,D)=>{const j=n.ISOWeek?h(D):p(D),F=I.find(U=>U.weekNumber===j),B=new o2(D,T,r);return F?F.days.push(B):I.push(new MO(j,[B])),I},[]),C=new IO(T,M);return w.push(C),w},[]);return n.reverseMonths?O.reverse():O}function B5(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:s,startOfDay:i,startOfMonth:l,endOfMonth:u,addYears:f,endOfYear:h,newDate:p,today:y}=t,{fromYear:g,toYear:b,fromMonth:O,toMonth:w}=e;!n&&O&&(n=O),!n&&g&&(n=t.newDate(g,0,1)),!r&&w&&(r=w),!r&&b&&(r=p(b,11,31));const T=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=l(n):g?n=p(g,0,1):!n&&T&&(n=s(f(e.today??y(),-100))),r?r=u(r):b?r=p(b,11,31):!r&&T&&(r=h(e.today??y())),[n&&i(n),r&&i(r)]}function H5(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i=1}=n,{startOfMonth:l,addMonths:u,differenceInCalendarMonths:f}=r,h=s?i:1,p=l(e);if(!t)return u(p,h);if(!(f(t,e)<i))return u(p,h)}function U5(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i}=n,{startOfMonth:l,addMonths:u,differenceInCalendarMonths:f}=r,h=s?i??1:1,p=l(e);if(!t)return u(p,-h);if(!(f(p,t)<=0))return u(p,-h)}function z5(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function Od(e,t){const[n,r]=N.useState(e);return[t===void 0?n:t,r]}function W5(e,t){var A;const[n,r]=B5(e,t),{startOfMonth:s,endOfMonth:i}=t,l=Tx(e,n,r,t),[u,f]=Od(l,e.month?l:void 0);N.useEffect(()=>{const M=Tx(e,n,r,t);f(M)},[e.timeZone]);const{months:h,weeks:p,days:y,previousMonth:g,nextMonth:b}=N.useMemo(()=>{const M=j5(u,r,{numberOfMonths:e.numberOfMonths},t),C=R5(M,e.endMonth?i(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),I=F5(M,C,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),D=z5(I),j=P5(I),F=U5(u,n,e,t),B=H5(u,r,e,t);return{months:I,weeks:D,days:j,previousMonth:F,nextMonth:B}},[t,u.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:O,onMonthChange:w}=e,T=M=>p.some(C=>C.days.some(I=>I.isEqualTo(M))),E=M=>{if(O)return;let C=s(M);n&&C<s(n)&&(C=s(n)),r&&C>s(r)&&(C=s(r)),f(C),w==null||w(C)};return{months:h,weeks:p,days:y,navStart:n,navEnd:r,previousMonth:g,nextMonth:b,goToMonth:E,goToDay:M=>{T(M)||E(M.date)}}}var ts;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(ts||(ts={}));function wx(e){return!e[nn.disabled]&&!e[nn.hidden]&&!e[nn.outside]}function Y5(e,t,n,r){let s,i=-1;for(const l of e){const u=t(l);wx(u)&&(u[nn.focused]&&i<ts.FocusedModifier?(s=l,i=ts.FocusedModifier):r!=null&&r.isEqualTo(l)&&i<ts.LastFocused?(s=l,i=ts.LastFocused):n(l.date)&&i<ts.Selected?(s=l,i=ts.Selected):u[nn.today]&&i<ts.Today&&(s=l,i=ts.Today))}return s||(s=e.find(l=>wx(t(l)))),s}function $5(e,t,n,r,s,i,l){const{ISOWeek:u,broadcastCalendar:f}=i,{addDays:h,addMonths:p,addWeeks:y,addYears:g,endOfBroadcastWeek:b,endOfISOWeek:O,endOfWeek:w,max:T,min:E,startOfBroadcastWeek:_,startOfISOWeek:S,startOfWeek:A}=l;let C={day:h,week:y,month:p,year:g,startOfWeek:I=>f?_(I,l):u?S(I):A(I),endOfWeek:I=>f?b(I):u?O(I):w(I)}[e](n,t==="after"?1:-1);return t==="before"&&r?C=T([r,C]):t==="after"&&s&&(C=E([s,C])),C}function v2(e,t,n,r,s,i,l,u=0){if(u>365)return;const f=$5(e,t,n.date,r,s,i,l),h=!!(i.disabled&&Is(f,i.disabled,l)),p=!!(i.hidden&&Is(f,i.hidden,l)),y=f,g=new o2(f,y,l);return!h&&!p?g:v2(e,t,g,r,s,i,l,u+1)}function q5(e,t,n,r,s){const{autoFocus:i}=e,[l,u]=N.useState(),f=Y5(t.days,n,r||(()=>!1),l),[h,p]=N.useState(i?f:void 0);return{isFocusTarget:w=>!!(f!=null&&f.isEqualTo(w)),setFocused:p,focused:h,blur:()=>{u(h),p(void 0)},moveFocus:(w,T)=>{if(!h)return;const E=v2(w,T,h,t.navStart,t.navEnd,e,s);E&&(e.disableNavigation&&!t.days.some(S=>S.isEqualTo(E))||(t.goToDay(E),p(E)))}}}function V5(e,t){const{selected:n,required:r,onSelect:s}=e,[i,l]=Od(n,s?n:void 0),u=s?n:i,{isSameDay:f}=t,h=b=>(u==null?void 0:u.some(O=>f(O,b)))??!1,{min:p,max:y}=e;return{selected:u,select:(b,O,w)=>{let T=[...u??[]];if(h(b)){if((u==null?void 0:u.length)===p||r&&(u==null?void 0:u.length)===1)return;T=u==null?void 0:u.filter(E=>!f(E,b))}else(u==null?void 0:u.length)===y?T=[b]:T=[...T,b];return s||l(T),s==null||s(T,b,O,w),T},isSelected:h}}function Q5(e,t,n=0,r=0,s=!1,i=hs){const{from:l,to:u}=t||{},{isSameDay:f,isAfter:h,isBefore:p}=i;let y;if(!l&&!u)y={from:e,to:n>0?void 0:e};else if(l&&!u)f(l,e)?n===0?y={from:l,to:e}:s?y={from:l,to:void 0}:y=void 0:p(e,l)?y={from:e,to:l}:y={from:l,to:e};else if(l&&u)if(f(l,e)&&f(u,e))s?y={from:l,to:u}:y=void 0;else if(f(l,e))y={from:l,to:n>0?void 0:e};else if(f(u,e))y={from:e,to:n>0?void 0:e};else if(p(e,l))y={from:e,to:u};else if(h(e,l))y={from:l,to:e};else if(h(e,u))y={from:l,to:e};else throw new Error("Invalid range");if(y!=null&&y.from&&(y!=null&&y.to)){const g=i.differenceInCalendarDays(y.to,y.from);r>0&&g>r?y={from:e,to:void 0}:n>1&&g<n&&(y={from:e,to:void 0})}return y}function G5(e,t,n=hs){const r=Array.isArray(t)?t:[t];let s=e.from;const i=n.differenceInCalendarDays(e.to,e.from),l=Math.min(i,6);for(let u=0;u<=l;u++){if(r.includes(s.getDay()))return!0;s=n.addDays(s,1)}return!1}function kx(e,t,n=hs){return As(e,t.from,!1,n)||As(e,t.to,!1,n)||As(t,e.from,!1,n)||As(t,e.to,!1,n)}function K5(e,t,n=hs){const r=Array.isArray(t)?t:[t];if(r.filter(u=>typeof u!="function").some(u=>typeof u=="boolean"?u:n.isDate(u)?As(e,u,!1,n):l2(u,n)?u.some(f=>As(e,f,!1,n)):Dd(u)?u.from&&u.to?kx(e,{from:u.from,to:u.to},n):!1:i2(u)?G5(e,u.dayOfWeek,n):Km(u)?n.isAfter(u.before,u.after)?kx(e,{from:n.addDays(u.after,1),to:n.addDays(u.before,-1)},n):Is(e.from,u,n)||Is(e.to,u,n):Xm(u)||Jm(u)?Is(e.from,u,n)||Is(e.to,u,n):!1))return!0;const l=r.filter(u=>typeof u=="function");if(l.length){let u=e.from;const f=n.differenceInCalendarDays(e.to,e.from);for(let h=0;h<=f;h++){if(l.some(p=>p(u)))return!0;u=n.addDays(u,1)}}return!1}function X5(e,t){const{disabled:n,excludeDisabled:r,selected:s,required:i,onSelect:l}=e,[u,f]=Od(s,l?s:void 0),h=l?s:u;return{selected:h,select:(g,b,O)=>{const{min:w,max:T}=e,E=g?Q5(g,h,w,T,i,t):void 0;return r&&n&&(E!=null&&E.from)&&E.to&&K5({from:E.from,to:E.to},n,t)&&(E.from=g,E.to=void 0),l||f(E),l==null||l(E,g,b,O),E},isSelected:g=>h&&As(h,g,!1,t)}}function J5(e,t){const{selected:n,required:r,onSelect:s}=e,[i,l]=Od(n,s?n:void 0),u=s?n:i,{isSameDay:f}=t;return{selected:u,select:(y,g,b)=>{let O=y;return!r&&u&&u&&f(y,u)&&(O=void 0),s||l(O),s==null||s(O,y,g,b),O},isSelected:y=>u?f(u,y):!1}}function Z5(e,t){const n=J5(e,t),r=V5(e,t),s=X5(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return s;default:return}}function kr(e,t){return e instanceof Bn&&e.timeZone===t?e:new Bn(e,t)}function Ga(e,t,n){return kr(e,t)}function Sx(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?Ga(e,t):Array.isArray(e)?e.map(r=>r instanceof Date?Ga(r,t):r):Dd(e)?{...e,from:e.from?kr(e.from,t):e.from,to:e.to?kr(e.to,t):e.to}:Km(e)?{before:Ga(e.before,t),after:Ga(e.after,t)}:Xm(e)?{after:Ga(e.after,t)}:Jm(e)?{before:Ga(e.before,t)}:e}function u0(e,t,n){return e&&(Array.isArray(e)?e.map(r=>Sx(r,t)):Sx(e,t))}function Xa(e){var jt;let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=kr(t.today,n)),t.month&&(t.month=kr(t.month,n)),t.defaultMonth&&(t.defaultMonth=kr(t.defaultMonth,n)),t.startMonth&&(t.startMonth=kr(t.startMonth,n)),t.endMonth&&(t.endMonth=kr(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=kr(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=(jt=t.selected)==null?void 0:jt.map($e=>kr($e,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?kr(t.selected.from,n):t.selected.from,to:t.selected.to?kr(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=u0(t.disabled,n)),t.hidden!==void 0&&(t.hidden=u0(t.hidden,n)),t.modifiers)){const $e={};Object.keys(t.modifiers).forEach(ft=>{var De;$e[ft]=u0((De=t.modifiers)==null?void 0:De[ft],n)}),t.modifiers=$e}const{components:r,formatters:s,labels:i,dateLib:l,locale:u,classNames:f}=N.useMemo(()=>{const $e={...s2,...t.locale},ft=t.broadcastCalendar?1:t.weekStartsOn,De=t.noonSafe&&t.timeZone?O5(t.timeZone,{weekStartsOn:ft,locale:$e}):void 0,We=t.dateLib&&De?{...De,...t.dateLib}:t.dateLib??De,gt=new pr({locale:$e,weekStartsOn:ft,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},We);return{dateLib:gt,components:u5(t.components),formatters:v5(t.formatters),labels:S5(t.labels,gt.options),locale:$e,classNames:{...d5(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:l.today()});const{captionLayout:h,mode:p,navLayout:y,numberOfMonths:g=1,onDayBlur:b,onDayClick:O,onDayFocus:w,onDayKeyDown:T,onDayMouseEnter:E,onDayMouseLeave:_,onNextClick:S,onPrevClick:A,showWeekNumber:M,styles:C}=t,{formatCaption:I,formatDay:D,formatMonthDropdown:j,formatWeekNumber:F,formatWeekNumberHeader:B,formatWeekdayName:U,formatYearDropdown:W}=s,Y=W5(t,l),{days:Q,months:re,navStart:ye,navEnd:G,previousMonth:fe,nextMonth:P,goToMonth:K}=Y,ee=i5(Q,t,ye,G,l),{isSelected:R,select:ie,selected:ae}=Z5(t,l)??{},{blur:J,focused:be,isFocusTarget:te,moveFocus:le,setFocused:ge}=q5(t,Y,ee,R??(()=>!1),l),{labelDayButton:ve,labelGridcell:je,labelGrid:Ye,labelMonthDropdown:nt,labelNav:tt,labelPrevious:Je,labelNext:rt,labelWeekday:ut,labelWeekNumber:pe,labelWeekNumberHeader:me,labelYearDropdown:Ae}=i,Pe=N.useMemo(()=>_5(l,t.ISOWeek,t.broadcastCalendar,t.today),[l,t.ISOWeek,t.broadcastCalendar,t.today]),ct=p!==void 0||O!==void 0,kt=N.useCallback(()=>{fe&&(K(fe),A==null||A(fe))},[fe,K,A]),bt=N.useCallback(()=>{P&&(K(P),S==null||S(P))},[K,P,S]),ue=N.useCallback(($e,ft)=>De=>{De.preventDefault(),De.stopPropagation(),ge($e),!ft.disabled&&(ie==null||ie($e.date,ft,De),O==null||O($e.date,ft,De))},[ie,O,ge]),ne=N.useCallback(($e,ft)=>De=>{ge($e),w==null||w($e.date,ft,De)},[w,ge]),Te=N.useCallback(($e,ft)=>De=>{J(),b==null||b($e.date,ft,De)},[J,b]),Re=N.useCallback(($e,ft)=>De=>{const We={ArrowLeft:[De.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[De.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[De.shiftKey?"year":"week","after"],ArrowUp:[De.shiftKey?"year":"week","before"],PageUp:[De.shiftKey?"year":"month","before"],PageDown:[De.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(We[De.key]){De.preventDefault(),De.stopPropagation();const[gt,Ge]=We[De.key];le(gt,Ge)}T==null||T($e.date,ft,De)},[le,T,t.dir]),Fe=N.useCallback(($e,ft)=>De=>{E==null||E($e.date,ft,De)},[E]),Be=N.useCallback(($e,ft)=>De=>{_==null||_($e.date,ft,De)},[_]),pt=N.useCallback($e=>ft=>{const De=Number(ft.target.value),We=l.setMonth(l.startOfMonth($e),De);K(We)},[l,K]),de=N.useCallback($e=>ft=>{const De=Number(ft.target.value),We=l.setYear(l.startOfMonth($e),De);K(We)},[l,K]),{className:_e,style:Ee}=N.useMemo(()=>({className:[f[st.Root],t.className].filter(Boolean).join(" "),style:{...C==null?void 0:C[st.Root],...t.style}}),[f,t.className,t.style,C]),He=c5(t),Ue=N.useRef(null);L5(Ue,!!t.animate,{classNames:f,months:re,focused:be,dateLib:l});const vt={dayPickerProps:t,selected:ae,select:ie,isSelected:R,months:re,nextMonth:P,previousMonth:fe,goToMonth:K,getModifiers:ee,components:r,classNames:f,styles:C,labels:i,formatters:s};return Le.createElement(a2.Provider,{value:vt},Le.createElement(r.Root,{rootRef:t.animate?Ue:void 0,className:_e,style:Ee,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"],...He},Le.createElement(r.Months,{className:f[st.Months],style:C==null?void 0:C[st.Months]},!t.hideNavigation&&!y&&Le.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:f[st.Nav],style:C==null?void 0:C[st.Nav],"aria-label":tt(),onPreviousClick:kt,onNextClick:bt,previousMonth:fe,nextMonth:P}),re.map(($e,ft)=>Le.createElement(r.Month,{"data-animated-month":t.animate?"true":void 0,className:f[st.Month],style:C==null?void 0:C[st.Month],key:ft,displayIndex:ft,calendarMonth:$e},y==="around"&&!t.hideNavigation&&ft===0&&Le.createElement(r.PreviousMonthButton,{type:"button",className:f[st.PreviousMonthButton],tabIndex:fe?void 0:-1,"aria-disabled":fe?void 0:!0,"aria-label":Je(fe),onClick:kt,"data-animated-button":t.animate?"true":void 0},Le.createElement(r.Chevron,{disabled:fe?void 0:!0,className:f[st.Chevron],orientation:t.dir==="rtl"?"right":"left"})),Le.createElement(r.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:f[st.MonthCaption],style:C==null?void 0:C[st.MonthCaption],calendarMonth:$e,displayIndex:ft},h!=null&&h.startsWith("dropdown")?Le.createElement(r.DropdownNav,{className:f[st.Dropdowns],style:C==null?void 0:C[st.Dropdowns]},(()=>{const De=h==="dropdown"||h==="dropdown-months"?Le.createElement(r.MonthsDropdown,{key:"month",className:f[st.MonthsDropdown],"aria-label":nt(),classNames:f,components:r,disabled:!!t.disableNavigation,onChange:pt($e.date),options:C5($e.date,ye,G,s,l),style:C==null?void 0:C[st.Dropdown],value:l.getMonth($e.date)}):Le.createElement("span",{key:"month"},j($e.date,l)),We=h==="dropdown"||h==="dropdown-years"?Le.createElement(r.YearsDropdown,{key:"year",className:f[st.YearsDropdown],"aria-label":Ae(l.options),classNames:f,components:r,disabled:!!t.disableNavigation,onChange:de($e.date),options:D5(ye,G,s,l,!!t.reverseYears),style:C==null?void 0:C[st.Dropdown],value:l.getYear($e.date)}):Le.createElement("span",{key:"year"},W($e.date,l));return l.getMonthYearOrder()==="year-first"?[We,De]:[De,We]})(),Le.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"}},I($e.date,l.options,l))):Le.createElement(r.CaptionLabel,{className:f[st.CaptionLabel],role:"status","aria-live":"polite"},I($e.date,l.options,l))),y==="around"&&!t.hideNavigation&&ft===g-1&&Le.createElement(r.NextMonthButton,{type:"button",className:f[st.NextMonthButton],tabIndex:P?void 0:-1,"aria-disabled":P?void 0:!0,"aria-label":rt(P),onClick:bt,"data-animated-button":t.animate?"true":void 0},Le.createElement(r.Chevron,{disabled:P?void 0:!0,className:f[st.Chevron],orientation:t.dir==="rtl"?"left":"right"})),ft===g-1&&y==="after"&&!t.hideNavigation&&Le.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:f[st.Nav],style:C==null?void 0:C[st.Nav],"aria-label":tt(),onPreviousClick:kt,onNextClick:bt,previousMonth:fe,nextMonth:P}),Le.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":p==="multiple"||p==="range","aria-label":Ye($e.date,l.options,l)||void 0,className:f[st.MonthGrid],style:C==null?void 0:C[st.MonthGrid]},!t.hideWeekdays&&Le.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:f[st.Weekdays],style:C==null?void 0:C[st.Weekdays]},M&&Le.createElement(r.WeekNumberHeader,{"aria-label":me(l.options),className:f[st.WeekNumberHeader],style:C==null?void 0:C[st.WeekNumberHeader],scope:"col"},B()),Pe.map(De=>Le.createElement(r.Weekday,{"aria-label":ut(De,l.options,l),className:f[st.Weekday],key:String(De),style:C==null?void 0:C[st.Weekday],scope:"col"},U(De,l.options,l)))),Le.createElement(r.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:f[st.Weeks],style:C==null?void 0:C[st.Weeks]},$e.weeks.map(De=>Le.createElement(r.Week,{className:f[st.Week],key:De.weekNumber,style:C==null?void 0:C[st.Week],week:De},M&&Le.createElement(r.WeekNumber,{week:De,style:C==null?void 0:C[st.WeekNumber],"aria-label":pe(De.weekNumber,{locale:u}),className:f[st.WeekNumber],scope:"row",role:"rowheader"},F(De.weekNumber,l)),De.days.map(We=>{const{date:gt}=We,Ge=ee(We);if(Ge[nn.focused]=!Ge.hidden&&!!(be!=null&&be.isEqualTo(We)),Ge[Wr.selected]=(R==null?void 0:R(gt))||Ge.selected,Dd(ae)){const{from:Xt,to:ln}=ae;Ge[Wr.range_start]=!!(Xt&&ln&&l.isSameDay(gt,Xt)),Ge[Wr.range_end]=!!(Xt&&ln&&l.isSameDay(gt,ln)),Ge[Wr.range_middle]=As(ae,gt,!0,l)}const Kt=N5(Ge,C,t.modifiersStyles),on=l5(Ge,f,t.modifiersClassNames),an=!ct&&!Ge.hidden?je(gt,Ge,l.options,l):void 0;return Le.createElement(r.Day,{key:`${We.isoDate}_${We.displayMonthId}`,day:We,modifiers:Ge,className:on.join(" "),style:Kt,role:"gridcell","aria-selected":Ge.selected||void 0,"aria-label":an,"data-day":We.isoDate,"data-month":We.outside?We.dateMonthId:void 0,"data-selected":Ge.selected||void 0,"data-disabled":Ge.disabled||void 0,"data-hidden":Ge.hidden||void 0,"data-outside":We.outside||void 0,"data-focused":Ge.focused||void 0,"data-today":Ge.today||void 0},!Ge.hidden&&ct?Le.createElement(r.DayButton,{className:f[st.DayButton],style:C==null?void 0:C[st.DayButton],type:"button",day:We,modifiers:Ge,disabled:!Ge.focused&&Ge.disabled||void 0,"aria-disabled":Ge.focused&&Ge.disabled||void 0,tabIndex:te(We)?0:-1,"aria-label":ve(gt,Ge,l.options,l),onClick:ue(We,Ge),onBlur:Te(We,Ge),onFocus:ne(We,Ge),onKeyDown:Re(We,Ge),onMouseEnter:Fe(We,Ge),onMouseLeave:Be(We,Ge)},D(gt,l.options,l)):!Ge.hidden&&D(We.date,l.options,l))})))))))),t.footer&&Le.createElement(r.Footer,{className:f[st.Footer],style:C==null?void 0:C[st.Footer],role:"status","aria-live":"polite"},t.footer)))}function Ci({trigger:e,children:t,isOpen:n,onOpenChange:r,width:s=340}){const[i,l]=N.useState(!1),u=N.useRef(null),f=N.useRef(null),h=n!==void 0?n:i,p=N.useCallback(g=>{r?r(g):l(g)},[r]),y=N.useCallback(()=>p(!1),[p]);return N.useEffect(()=>{if(!h)return;function g(b){const O=b.target;u.current&&!u.current.contains(O)&&f.current&&!f.current.contains(O)&&y()}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[h,y]),N.useEffect(()=>{if(!h)return;function g(b){b.key==="Escape"&&y()}return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[h,y]),d.jsxs("div",{className:"relative",style:{display:"inline-flex"},children:[d.jsx("div",{ref:f,onClick:()=>p(!h),children:e}),h&&d.jsx("div",{ref:u,className:"absolute top-full left-0 mt-1 rounded-lg shadow-lg border z-50",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border, #e5e7eb)",width:s},children:t})]})}function Ni(){const[e,t]=N.useState(!1);return{isOpen:e,open:()=>t(!0),close:()=>t(!1),toggle:()=>t(n=>!n),onOpenChange:t}}function _i({label:e,value:t,active:n,icon:r,description:s,onClick:i,onClear:l}){return d.jsxs("button",{type:"button",onClick:i,title:s,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?"var(--yc-color-primary)":"var(--yc-color-border, #e5e7eb)",backgroundColor:n?"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)":"var(--yc-color-surface)"},children:[r&&d.jsx("span",{className:"flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},children:r}),t?d.jsxs("span",{className:"font-medium",children:[d.jsxs("span",{style:{color:"var(--yc-color-text-secondary)"},children:[e,": "]}),d.jsx("span",{style:{color:n?"var(--yc-color-primary)":"var(--yc-color-text, #111)"},children:t})]}):d.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:e}),n&&l?d.jsx("span",{role:"button",tabIndex:0,"aria-label":`Reset ${e} filter`,onClick:u=>{u.stopPropagation(),l()},onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.stopPropagation(),l())},className:"flex-shrink-0 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10 transition-colors",style:{color:"var(--yc-color-text-muted)"},children:d.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M3 3l6 6M9 3l-6 6"})})}):d.jsx("svg",{className:"w-3 h-3 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}function va({title:e,description:t,onBack:n}){return d.jsxs("div",{className:"px-4 py-3 border-b",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:[d.jsxs("div",{className:"flex items-center gap-2",children:[n&&d.jsx("button",{type:"button",onClick:n,className:"flex items-center justify-center w-6 h-6 rounded hover:bg-black/5",style:{color:"var(--yc-color-text-secondary)"},children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),d.jsx("span",{className:"text-sm font-medium",style:{color:"var(--yc-color-text, #111)"},children:e})]}),t&&d.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-secondary)"},children:t})]})}const E2=[{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"}],e6=`
|
|
48
|
-
.rdp-root {
|
|
49
|
-
--rdp-accent-color: var(--yc-color-primary, #2563eb);
|
|
50
|
-
--rdp-accent-background-color: color-mix(in srgb, var(--yc-color-primary, #2563eb) 15%, transparent);
|
|
51
|
-
--rdp-range_start-color: white;
|
|
52
|
-
--rdp-range_start-background: var(--yc-color-primary, #2563eb);
|
|
53
|
-
--rdp-range_end-color: white;
|
|
54
|
-
--rdp-range_end-background: var(--yc-color-primary, #2563eb);
|
|
55
|
-
--rdp-range_middle-background: color-mix(in srgb, var(--yc-color-primary, #2563eb) 15%, transparent);
|
|
56
|
-
--rdp-range_middle-color: var(--yc-color-primary, #1e40af);
|
|
57
|
-
--rdp-day_button-height: 36px;
|
|
58
|
-
--rdp-day_button-width: 36px;
|
|
59
|
-
color: var(--yc-color-text);
|
|
60
|
-
font-size: 14px;
|
|
61
|
-
}
|
|
62
|
-
.rdp-months { flex-wrap: nowrap; gap: 16px; }
|
|
63
|
-
.rdp-month_caption { font-size: 15px; font-weight: 600; }
|
|
64
|
-
.rdp-day { border-radius: 0; }
|
|
65
|
-
.rdp-selected .rdp-day_button { font-weight: 600; }
|
|
66
|
-
.rdp-range_start .rdp-day_button,
|
|
67
|
-
.rdp-range_end .rdp-day_button { font-weight: 600; }
|
|
68
|
-
.rdp-today .rdp-day_button {
|
|
69
|
-
font-weight: 700;
|
|
70
|
-
border: 2px solid var(--yc-color-primary, #2563eb);
|
|
71
|
-
}
|
|
72
|
-
.rdp-day_button:hover { background-color: var(--yc-color-surface-hover, #e5e7eb) !important; }
|
|
73
|
-
`;function td(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="custom"}function tp(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="relative"}const tm={last_7_days:{type:"relative",direction:"previous",value:7,unit:"day",includeToday:!1},last_30_days:{type:"relative",direction:"previous",value:30,unit:"day",includeToday:!1},last_90_days:{type:"relative",direction:"previous",value:90,unit:"day",includeToday:!1},last_12_months:{type:"relative",direction:"previous",value:12,unit:"month",includeToday:!1}};function t6(e){return!!(tp(e)||typeof e=="string"&&e in tm)}function n6(e){return tp(e)?e:typeof e=="string"&&e in tm?tm[e]:{type:"relative",direction:"previous",value:30,unit:"day",includeToday:!1}}function r6(e){const n=ca(new Date);if(e.direction==="current")switch(e.unit){case"day":return{start:n,end:rS(n)};case"week":return{start:$r(n,{weekStartsOn:1}),end:vd(n,{weekStartsOn:1})};case"month":return{start:Xl(n),end:xd(n)};case"quarter":return{start:Jc(n),end:_m(n)};case"year":return{start:gi(n),end:bd(n)}}const r=e.value??1,s=e.direction==="previous",l=(s?{day:Nr,week:dv,month:Bl,quarter:cv,year:Im}:{day:Ls,week:yd,month:Ti,quarter:Nm,year:gd})[e.unit];if(s){const u=e.includeToday?n:Nr(n,1),f=l((e.includeToday,n),r);return{start:f<u?f:u,end:f<u?u:f}}else{const u=e.includeToday?n:Ls(n,1),f=l(u,r);return{start:u<f?u:f,end:u<f?f:u}}}function s6(e){if(td(e))return`${e.start} to ${e.end}`;if(tp(e)){if(e.direction==="current")return`Current ${(e.unit.charAt(0).toUpperCase()+e.unit.slice(1)).toLowerCase()}`;const t=e.value??1,n=t===1?e.unit:`${e.unit}s`;return`${e.direction==="previous"?"Previous":"Next"} ${t} ${n}`}if(typeof e=="string"){const t=E2.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 o6=d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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 T2({name:e,label:t="Date",description:n,chartName:r,defaultValue:s="last_30_days"}){var w;const i=Ni(),l=ot(T=>T.globalFilters),u=ot(T=>T.chartFilters),f=ot(T=>T.setGlobalFilter),h=ot(T=>T.setChartFilter),p=r?((w=u[r])==null?void 0:w[e])??l[e]??s:l[e]??s;N.useEffect(()=>{var E;(r?((E=u[r])==null?void 0:E[e])??l[e]:l[e])===void 0&&s&&(r?h(r,e,s):f(e,s))},[r,e,s,l,u,f,h]);const y=T=>{const E=T;r?h(r,e,E):f(e,E),i.close()},g=typeof p=="string"?p!==s:!0,b=s6(p),O=()=>{r?h(r,e,s):f(e,s)};return d.jsx(Ci,{isOpen:i.isOpen,onOpenChange:i.onOpenChange,width:620,trigger:d.jsx(_i,{label:t,value:b,active:g,icon:o6,description:n,onClear:O}),children:d.jsx(a6,{currentValue:p,description:n,onApply:y,onClose:i.close})})}function a6({currentValue:e,description:t,onApply:n,onClose:r}){const[s,i]=N.useState(()=>t6(e)?"relative":td(e)?"fixed":"presets");return d.jsxs("div",{children:[t&&d.jsx("div",{className:"px-4 pt-3 pb-1",children:d.jsx("p",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:t})}),s==="presets"&&d.jsx(i6,{currentValue:e,onSelectPreset:l=>{n(l),r()},onNavigate:i}),s==="fixed"&&d.jsx(l6,{currentValue:e,onApply:n,onBack:()=>i("presets")}),s==="relative"&&d.jsx(u6,{currentValue:e,onApply:n,onBack:()=>i("presets")})]})}function i6({currentValue:e,onSelectPreset:t,onNavigate:n}){return d.jsxs("div",{className:"py-1",children:[E2.map((r,s)=>{if("divider"in r)return d.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border, #e5e7eb)"}},`divider-${s}`);const i=typeof e=="string"&&e===r.value;return d.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:i?"var(--yc-color-primary)":"var(--yc-color-text, #111)"},children:[d.jsx("span",{className:i?"font-medium":"",children:r.label}),i&&d.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-primary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]},r.value)}),d.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border, #e5e7eb)"}}),d.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:[d.jsx("span",{children:"Fixed date range..."}),d.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]}),d.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:[d.jsx("span",{children:"Relative date range..."}),d.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})}function l6({currentValue:e,onApply:t,onBack:n}){const[r,s]=N.useState("between"),[i,l]=N.useState(()=>{if(td(e)){const g=ks(e.start,"yyyy-MM-dd",new Date),b=ks(e.end,"yyyy-MM-dd",new Date);return{from:g,to:b}}}),[u,f]=N.useState(()=>{if(td(e)&&r!=="between")return ks(e.start,"yyyy-MM-dd",new Date)}),h=()=>{if(r==="between"&&(i!=null&&i.from)&&(i!=null&&i.to))t({type:"custom",start:dn(i.from,"yyyy-MM-dd"),end:dn(i.to,"yyyy-MM-dd")});else if(r==="on"&&u){const g=dn(u,"yyyy-MM-dd");t({type:"custom",start:g,end:g})}else r==="before"&&u?t({type:"custom",start:"1970-01-01",end:dn(u,"yyyy-MM-dd")}):r==="after"&&u&&t({type:"custom",start:dn(u,"yyyy-MM-dd"),end:dn(new Date(2099,11,31),"yyyy-MM-dd")})},p=r==="between"?!!(i!=null&&i.from&&(i!=null&&i.to)):!!u,y=[{key:"between",label:"Between"},{key:"before",label:"Before"},{key:"on",label:"On"},{key:"after",label:"After"}];return d.jsxs("div",{children:[d.jsx(va,{title:"Fixed date range",onBack:n}),d.jsx("div",{className:"px-4 pt-3",children:d.jsx("div",{className:"flex gap-1 mb-3",children:y.map(g=>d.jsx("button",{type:"button",onClick:()=>s(g.key),className:"px-3 py-1 text-xs rounded-full font-medium transition-colors",style:r===g.key?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-text-secondary)"},children:g.label},g.key))})}),d.jsxs("div",{className:"px-4 flex justify-center",children:[d.jsx("style",{children:e6}),r==="between"?d.jsx(Xa,{mode:"range",selected:i,onSelect:l,numberOfMonths:2,defaultMonth:(i==null?void 0:i.from)||new Date}):d.jsx(Xa,{mode:"single",selected:u,onSelect:f,numberOfMonths:2,defaultMonth:u||new Date})]}),d.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:d.jsx("button",{type:"button",onClick:h,disabled:!p,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 u6({currentValue:e,onApply:t,onBack:n}){const r=n6(e),[s,i]=N.useState(r.direction),[l,u]=N.useState(r.value??30),[f,h]=N.useState(r.unit),[p,y]=N.useState(r.includeToday??!1),g=N.useMemo(()=>{const _=r6({direction:s,value:s==="current"?void 0:l,unit:f,includeToday:p}),S=_.start.getFullYear(),A=_.end.getFullYear();return S===A?`${dn(_.start,"MMM d")} – ${dn(_.end,"MMM d, yyyy")}`:`${dn(_.start,"MMM d, yyyy")} – ${dn(_.end,"MMM d, yyyy")}`},[s,l,f,p]),b=()=>{t({type:"relative",direction:s,value:s==="current"?void 0:l,unit:f,includeToday:p})},O=[{key:"previous",label:"Previous"},{key:"current",label:"Current"},{key:"next",label:"Next"}],w=[{value:"day",label:"days"},{value:"week",label:"weeks"},{value:"month",label:"months"},{value:"quarter",label:"quarters"},{value:"year",label:"years"}],T=[{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"},{value:"quarter",label:"Quarter"},{value:"year",label:"Year"}];return d.jsxs("div",{children:[d.jsx(va,{title:"Relative date range",onBack:n}),d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsx("div",{className:"flex gap-1",children:O.map(E=>d.jsx("button",{type:"button",onClick:()=>i(E.key),className:"px-3 py-1 text-xs rounded-full font-medium transition-colors",style:s===E.key?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-text-secondary)"},children:E.label},E.key))}),s==="current"?d.jsx("div",{className:"flex gap-2",children:T.map(E=>d.jsx("button",{type:"button",onClick:()=>h(E.value),className:"px-3 py-1.5 text-sm rounded border transition-colors",style:f===E.value?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",borderColor:"var(--yc-color-primary)",color:"var(--yc-color-primary)",fontWeight:500}:{borderColor:"var(--yc-color-border)",color:"var(--yc-color-text-secondary)"},children:E.label},E.value))}):d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"number",min:1,value:l,onChange:E=>u(Math.max(1,parseInt(E.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)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"}}),d.jsx("select",{value:f,onChange:E=>h(E.target.value),className:"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)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},children:w.map(E=>d.jsx("option",{value:E.value,children:E.label},E.value))})]}),s!=="current"&&d.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("input",{type:"checkbox",checked:p,onChange:E=>y(E.target.checked),className:"rounded border-gray-300"}),"Include today"]}),d.jsxs("div",{className:"flex items-center gap-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{children:g})]})]}),d.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:d.jsx("button",{type:"button",onClick:b,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}function nd({name:e,label:t=e,description:n,options:r,chartName:s,defaultValue:i,source:l}){var F,B;const u=Ni(),f=ot(U=>U.globalFilters),h=ot(U=>U.chartFilters),p=ot(U=>U.setGlobalFilter),y=ot(U=>U.setChartFilter),g=!!l,{data:b,isLoading:O}=or({queryKey:g?s?["parameterOptions",s,e]:["modelOptions",l.model,l.value_field,l.label_field]:["noop"],queryFn:()=>s?xt.getParameterOptions(s,e):xt.getModelOptions(l.model,l.value_field,l.label_field),enabled:g,staleTime:300*1e3}),w=g?[{value:"",label:"All"},...(b==null?void 0:b.options)??[]]:[{value:"",label:"All"},...r??[]],T=s?((F=h[s])==null?void 0:F[e])??f[e]??i??"":f[e]??i??"",[E,_]=N.useState(T),[S,A]=N.useState("");N.useEffect(()=>{u.isOpen&&(_(T),A(""))},[u.isOpen,T]),N.useEffect(()=>{var W;(s?((W=h[s])==null?void 0:W[e])??f[e]:f[e])===void 0&&i&&(s?y(s,e,i):p(e,i))},[s,e,i,f,h,p,y]);const M=()=>{const U=E||null;s?y(s,e,U):p(e,U),u.close()},C=S?w.filter(U=>U.label.toLowerCase().includes(S.toLowerCase())):w,I=T?((B=w.find(U=>U.value===T))==null?void 0:B.label)||T:void 0,D=!!T&&T!==i,j=()=>{const U=i??null;s?y(s,e,U):p(e,U)};return g&&O?d.jsx("div",{className:"flex items-center border rounded-full px-3 py-1.5 text-sm gap-1.5",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-surface)"},children:d.jsx("span",{className:"text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Loading..."})}):d.jsxs(Ci,{isOpen:u.isOpen,onOpenChange:u.onOpenChange,trigger:d.jsx(_i,{label:t,value:I||t,active:D,description:n,onClear:j}),children:[d.jsx(va,{title:t,description:n}),d.jsxs("div",{className:"p-3",children:[w.length>6&&d.jsx("div",{className:"mb-2",children:d.jsx("input",{type:"text",placeholder:"Search...",value:S,onChange:U=>A(U.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)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},autoFocus:!0})}),d.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[C.map(U=>d.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm",children:[d.jsx("input",{type:"radio",name:`select-${e}`,checked:E===U.value,onChange:()=>_(U.value),className:"text-blue-600"}),d.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:U.label})]},U.value)),C.length===0&&d.jsx("div",{className:"text-sm px-2 py-3 text-center",style:{color:"var(--yc-color-text-muted)"},children:"No matches"})]})]}),d.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:d.jsx("button",{type:"button",onClick:M,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}function w2({name:e,label:t=e,description:n,options:r,chartName:s,defaultValue:i,source:l}){const u=Ni(),f=ot(W=>W.globalFilters),h=ot(W=>W.chartFilters),p=ot(W=>W.setGlobalFilter),y=ot(W=>W.setChartFilter),g=!!l,{data:b,isLoading:O}=or({queryKey:g?s?["parameterOptions",s,e]:["modelOptions",l.model,l.value_field,l.label_field]:["noop"],queryFn:()=>s?xt.getParameterOptions(s,e):xt.getModelOptions(l.model,l.value_field,l.label_field),enabled:g,staleTime:300*1e3}),w=g?(b==null?void 0:b.options)??[]:r??[],T=(()=>{var Y;const W=s?((Y=h[s])==null?void 0:Y[e])??f[e]??i??[]:f[e]??i??[];return Array.isArray(W)?W:[]})(),[E,_]=N.useState(T),[S,A]=N.useState("");N.useEffect(()=>{u.isOpen&&(_(T),A(""))},[u.isOpen]),N.useEffect(()=>{var Y;(s?((Y=h[s])==null?void 0:Y[e])??f[e]:f[e])===void 0&&i&&(s?y(s,e,i):p(e,i))},[s,e,i,f,h,p,y]);const M=W=>{_(Y=>Y.includes(W)?Y.filter(Q=>Q!==W):[...Y,W])},C=()=>{E.length===w.length?_([]):_(w.map(W=>W.value))},I=()=>{const W=E.length>0?E:null;s?y(s,e,W):p(e,W),u.close()},D=S?w.filter(W=>W.label.toLowerCase().includes(S.toLowerCase())):w,j=T.length===0?void 0:T.length<=2?T.map(W=>{var Y;return((Y=w.find(Q=>Q.value===W))==null?void 0:Y.label)||W}).join(", "):`${T.length} selected`,F=T.length>0,B=E.length===w.length&&w.length>0,U=()=>{const W=i??null;s?y(s,e,W):p(e,W)};return g&&O?d.jsx("div",{className:"flex items-center border rounded-full px-3 py-1.5 text-sm gap-1.5",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-surface)"},children:d.jsx("span",{className:"text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Loading..."})}):d.jsxs(Ci,{isOpen:u.isOpen,onOpenChange:u.onOpenChange,trigger:d.jsx(_i,{label:t,value:j||t,active:F,description:n,onClear:U}),children:[d.jsx(va,{title:t,description:n}),d.jsxs("div",{className:"p-3",children:[w.length>6&&d.jsx("div",{className:"mb-2",children:d.jsx("input",{type:"text",placeholder:"Search...",value:S,onChange:W=>A(W.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)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},autoFocus:!0})}),d.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[!S&&d.jsxs(d.Fragment,{children:[d.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:[d.jsx("input",{type:"checkbox",checked:B,onChange:C,className:"text-blue-600 rounded"}),d.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:"Select all"})]}),d.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border, #e5e7eb)"}})]}),D.map(W=>d.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm",children:[d.jsx("input",{type:"checkbox",checked:E.includes(W.value),onChange:()=>M(W.value),className:"text-blue-600 rounded"}),d.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:W.label})]},W.value)),D.length===0&&d.jsx("div",{className:"text-sm px-2 py-3 text-center",style:{color:"var(--yc-color-text-muted)"},children:"No matches"})]})]}),d.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:d.jsx("button",{type:"button",onClick:I,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}const nm=[{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"}],k2=["is_empty","is_not_empty"];function S2(e){return typeof e=="object"&&e!==null&&"operator"in e&&"value"in e}function c6(e){var t,n;if(S2(e))return k2.includes(e.operator)?(t=nm.find(s=>s.value===e.operator))==null?void 0:t.label:`${((n=nm.find(s=>s.value===e.operator))==null?void 0:n.label)||e.operator} "${e.value}"`;if(typeof e=="string"&&e)return e}function C2({name:e,label:t=e,description:n,chartName:r,defaultValue:s}){var M;const i=Ni(),l=ot(C=>C.globalFilters),u=ot(C=>C.chartFilters),f=ot(C=>C.setGlobalFilter),h=ot(C=>C.setChartFilter),p=r?((M=u[r])==null?void 0:M[e])??l[e]??s??null:l[e]??s??null,[y,g]=N.useState("contains"),[b,O]=N.useState("");N.useEffect(()=>{i.isOpen&&(S2(p)?(g(p.operator),O(p.value)):typeof p=="string"?(g("is"),O(p)):(g("contains"),O("")))},[i.isOpen]);const w=()=>{const C={operator:y,value:b};r?h(r,e,C):f(e,C),i.close()},T=!k2.includes(y),E=!T||b.trim().length>0,_=c6(p),S=!!_,A=()=>{const C=s??null;r?h(r,e,C):f(e,C)};return d.jsxs(Ci,{isOpen:i.isOpen,onOpenChange:i.onOpenChange,trigger:d.jsx(_i,{label:t,value:_||t,active:S,description:n,onClear:A}),children:[d.jsx(va,{title:t,description:n}),d.jsxs("div",{className:"p-4 space-y-3",children:[d.jsx("select",{value:y,onChange:C=>g(C.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)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},children:nm.map(C=>d.jsx("option",{value:C.value,children:C.label},C.value))}),T&&d.jsx("input",{type:"text",value:b,onChange:C=>O(C.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)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},autoFocus:!0,onKeyDown:C=>{C.key==="Enter"&&E&&w()}})]}),d.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:d.jsx("button",{type:"button",onClick:w,disabled:!E,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 rm=[{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"}],N2=["is_empty","is_not_empty"];function _2(e){return typeof e=="object"&&e!==null&&"operator"in e&&"value"in e&&typeof e.value=="number"}function d6(e){var t,n;if(_2(e)){if(N2.includes(e.operator))return(t=rm.find(s=>s.value===e.operator))==null?void 0:t.label;const r=((n=rm.find(s=>s.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 D2({name:e,label:t=e,description:n,chartName:r,defaultValue:s}){var j;const i=Ni(),l=ot(F=>F.globalFilters),u=ot(F=>F.chartFilters),f=ot(F=>F.setGlobalFilter),h=ot(F=>F.setChartFilter),p=r?((j=u[r])==null?void 0:j[e])??l[e]??s??null:l[e]??s??null,[y,g]=N.useState("equal"),[b,O]=N.useState(""),[w,T]=N.useState("");N.useEffect(()=>{i.isOpen&&(_2(p)?(g(p.operator),O(String(p.value)),T(p.value2!==void 0?String(p.value2):"")):typeof p=="number"?(g("equal"),O(String(p)),T("")):(g("equal"),O(""),T("")))},[i.isOpen]);const E=()=>{const F={operator:y,value:parseFloat(b)||0,...y==="between"?{value2:parseFloat(w)||0}:{}};r?h(r,e,F):f(e,F),i.close()},_=!N2.includes(y),S=y==="between",A=!_||b!==""&&(!S||w!==""),M=d6(p),C=p===s||typeof p=="number"&&p===s||p==null,I=!!M&&!C,D=()=>{const F=s??null;r?h(r,e,F):f(e,F)};return d.jsxs(Ci,{isOpen:i.isOpen,onOpenChange:i.onOpenChange,trigger:d.jsx(_i,{label:t,value:M||t,active:I,description:n,onClear:D}),children:[d.jsx(va,{title:t,description:n}),d.jsxs("div",{className:"p-4 space-y-3",children:[d.jsx("select",{value:y,onChange:F=>g(F.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)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},children:rm.map(F=>d.jsx("option",{value:F.value,children:F.label},F.value))}),_&&d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"number",value:b,onChange:F=>O(F.target.value),placeholder:S?"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)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},autoFocus:!0,onKeyDown:F=>{F.key==="Enter"&&A&&E()}}),S&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-sm self-center",style:{color:"var(--yc-color-text-muted)"},children:"and"}),d.jsx("input",{type:"number",value:w,onChange:F=>T(F.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:F=>{F.key==="Enter"&&A&&E()}})]})]})]}),d.jsxs("div",{className:"flex justify-between px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:[d.jsx("button",{type:"button",onClick:()=>{r?h(r,e,null):f(e,null),i.close()},className:"px-3 py-1.5 text-sm rounded hover:bg-gray-100 dark:hover:bg-gray-700",style:{color:"var(--yc-color-text-secondary)"},children:"Clear"}),d.jsx("button",{type:"button",onClick:E,disabled:!A,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 O2({name:e,label:t=e,description:n,chartName:r}){var T;const s=Ni(),i=ot(E=>E.globalFilters),l=ot(E=>E.chartFilters),u=ot(E=>E.setGlobalFilter),f=ot(E=>E.setChartFilter),h=r?((T=l[r])==null?void 0:T[e])??i[e]??null:i[e]??null,[p,y]=N.useState(typeof h=="boolean"?h:null);N.useEffect(()=>{s.isOpen&&y(typeof h=="boolean"?h:null)},[s.isOpen]);const g=()=>{r?f(r,e,p):u(e,p),s.close()},b=typeof h=="boolean"?h?"True":"False":void 0,O=typeof h=="boolean",w=()=>{r?f(r,e,null):u(e,null)};return d.jsxs(Ci,{isOpen:s.isOpen,onOpenChange:s.onOpenChange,width:240,trigger:d.jsx(_i,{label:t,value:b||t,active:O,description:n,onClear:w}),children:[d.jsx(va,{title:t,description:n}),d.jsxs("div",{className:"p-4 space-y-1",children:[[{value:!0,label:"True"},{value:!1,label:"False"}].map(E=>d.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm",children:[d.jsx("input",{type:"radio",name:`bool-${e}`,checked:p===E.value,onChange:()=>y(E.value),className:"text-blue-600"}),d.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:E.label})]},String(E.value))),d.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-black/5 cursor-pointer text-sm",style:{color:"var(--yc-color-text-muted)"},children:[d.jsx("input",{type:"radio",name:`bool-${e}`,checked:p===null,onChange:()=>y(null),className:"text-blue-600"}),d.jsx("span",{children:"Any"})]})]}),d.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:d.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 fa(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim()}function A2({parameters:e,chartName:t}){const n=ot(f=>f.globalFilters),r=ot(f=>f.chartFilters),s=ot(f=>f.resetFilters),i=ot(f=>f.resetChartFilters);if(e.length===0)return null;const l=e.some(f=>{var p;const h=t?((p=r[t])==null?void 0:p[f.name])??n[f.name]:n[f.name];return h==null?!1:JSON.stringify(h)!==JSON.stringify(f.default)}),u=()=>{t?i(t):s()};return d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.map(f=>{const h=f.label||fa(f.name),p=typeof f.default=="string"?f.default:void 0;switch(f.type){case"date_range":return d.jsx(T2,{name:f.name,label:h,description:f.description,chartName:t,defaultValue:p},f.name);case"select":{const y=(f.options||[]).map(g=>typeof g=="string"?{value:g,label:g}:g);return d.jsx(nd,{name:f.name,label:h,description:f.description,options:y,chartName:t,defaultValue:p},f.name)}case"dynamic_select":return!t&&!f.source?d.jsxs("div",{className:"text-sm text-gray-500",children:[h,": dynamic_select requires chartName or source"]},f.name):d.jsx(nd,{name:f.name,label:h,description:f.description,chartName:t,defaultValue:p,source:f.source},f.name);case"multi_select":{const y=(f.options||[]).map(g=>typeof g=="string"?{value:g,label:g}:g);return d.jsx(w2,{name:f.name,label:h,description:f.description,options:y,chartName:t,defaultValue:Array.isArray(f.default)?f.default:void 0,source:f.source},f.name)}case"text":return d.jsx(C2,{name:f.name,label:h,description:f.description,chartName:t,defaultValue:p},f.name);case"number":return d.jsx(D2,{name:f.name,label:h,description:f.description,chartName:t,defaultValue:typeof f.default=="number"?f.default:void 0},f.name);case"boolean":return d.jsx(O2,{name:f.name,label:h,description:f.description,chartName:t},f.name);default:return d.jsxs("div",{className:"text-sm text-gray-500",children:[h,": ",f.type," (not supported)"]},f.name)}}),l&&d.jsx("button",{type:"button",onClick:u,className:"text-sm px-2 py-1.5 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",style:{color:"var(--yc-color-text-muted)"},children:"Clear all"})]})}function I2({resourceType:e,resourceName:t}){const n=So(w=>w.auth),[r,s]=N.useState(!1),[i,l]=N.useState(null),[u,f]=N.useState(null),[h,p]=N.useState(!1),y=N.useRef(null);if(n.status!=="authenticated")return null;const g=n.user.role==="admin"||n.user.role==="editor";N.useEffect(()=>{if(!r)return;const w=T=>{y.current&&!y.current.contains(T.target)&&s(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[r]);const b=async()=>{const w=e==="dashboard"?`#/dashboards/${t}`:`#/charts/${t}`,T=`${window.location.origin}/${w}`;await navigator.clipboard.writeText(T),f("link"),setTimeout(()=>f(null),2e3)},O=async()=>{p(!0);try{const w=await xt.createShareLink({resourceType:e,resourceName:t}),T=e==="dashboard"?`#/public/dashboards/${t}?token=${w.token}`:`#/public/charts/${t}?token=${w.token}`,E=`${window.location.origin}/${T}`;l(E),await navigator.clipboard.writeText(E),f("public"),setTimeout(()=>f(null),2e3)}catch(w){console.error("Failed to create share link:",w)}finally{p(!1)}};return d.jsxs("div",{className:"relative",ref:y,children:[d.jsxs("button",{onClick:()=>s(!r),className:"text-sm flex items-center gap-1.5 px-2 py-1 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},title:"Share",children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.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"})}),d.jsx("span",{children:"Share"})]}),r&&d.jsxs("div",{className:"absolute right-0 top-full mt-1 border rounded-lg shadow-lg py-1 w-64 z-50",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[d.jsxs("button",{onClick:b,className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-muted)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.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"})}),u==="link"?d.jsx("span",{style:{color:"var(--yc-color-success)"},children:"Copied!"}):d.jsx("span",{children:"Copy link (requires login)"})]}),g&&d.jsxs("button",{onClick:O,disabled:h,className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-muted)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.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?d.jsx("span",{style:{color:"var(--yc-color-text-muted)"},children:"Creating..."}):u==="public"?d.jsx("span",{style:{color:"var(--yc-color-success)"},children:"Public link copied!"}):d.jsx("span",{children:"Create public link"})]}),i&&d.jsxs("div",{className:"px-3 py-2 border-t",style:{borderColor:"var(--yc-color-border)"},children:[d.jsx("div",{className:"text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"Public URL:"}),d.jsx("div",{className:"text-xs break-all font-mono p-1.5 rounded",style:{color:"var(--yc-color-text-secondary)",backgroundColor:"var(--yc-color-input-bg)"},children:i})]})]})]})}function f6({rowCount:e,durationMs:t,cached:n,view:r,onToggleView:s,onExportCSV:i,onExportPNG:l,onShowSql:u,onShowEvents:f,eventCount:h}){const[p,y]=N.useState(!1);return d.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:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{onClick:()=>s("chart"),className:`p-1.5 rounded transition-colors ${r==="chart"?"bg-black/5":"hover:bg-black/5"}`,title:"Chart view",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}),d.jsx("button",{onClick:()=>s("table"),className:`p-1.5 rounded transition-colors ${r==="table"?"bg-black/5":"hover:bg-black/5"}`,title:"Table view",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&d.jsxs("span",{children:[e.toLocaleString()," rows"]}),t!=null&&d.jsxs("span",{children:[n&&d.jsx("span",{className:"text-green-600 mr-1",title:"Served from cache",children:"cached"}),t,"ms"]}),f&&d.jsxs("button",{onClick:f,className:"px-2 py-0.5 rounded border hover:bg-black/5 transition-colors flex items-center gap-1.5",style:{borderColor:"var(--yc-color-border)"},children:["Events",(h??0)>0&&d.jsx("span",{className:"text-[10px] leading-none px-1 py-0.5 rounded-full",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"},children:h})]}),u&&d.jsx("button",{onClick:u,className:"px-2 py-0.5 rounded border hover:bg-black/5 transition-colors font-mono",style:{borderColor:"var(--yc-color-border)"},children:"SQL"}),(i||l)&&d.jsxs("div",{className:"relative",children:[d.jsx("button",{onClick:()=>y(!p),className:"px-2 py-0.5 rounded border hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)"},children:"Export"}),p&&d.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:[i&&d.jsx("button",{onClick:()=>{i(),y(!1)},className:"w-full text-left px-3 py-1.5 text-xs hover:bg-black/5",style:{color:"var(--yc-color-text)"},children:"Export CSV"}),l&&d.jsx("button",{onClick:()=>{l(),y(!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 h6=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"]),m6=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 Hr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function p6(e){const t=[];let n=0;const r=s=>e.charAt(s);for(;n<e.length;){if(r(n)==="-"&&r(n+1)==="-"){const s=e.indexOf(`
|
|
74
|
-
`,n),i=s===-1?e.slice(n):e.slice(n,s);t.push(`<span class="sql-comment">${Hr(i)}</span>`),n+=i.length;continue}if(r(n)==="/"&&r(n+1)==="*"){const s=e.indexOf("*/",n+2),i=s===-1?e.slice(n):e.slice(n,s+2);t.push(`<span class="sql-comment">${Hr(i)}</span>`),n+=i.length;continue}if(r(n)==="'"){let s=n+1;for(;s<e.length;)if(r(s)==="'"&&r(s+1)==="'")s+=2;else if(r(s)==="'"){s++;break}else s++;t.push(`<span class="sql-string">${Hr(e.slice(n,s))}</span>`),n=s;continue}if(r(n)==='"'){const s=e.indexOf('"',n+1),i=s===-1?e.slice(n):e.slice(n,s+1);t.push(`<span class="sql-identifier">${Hr(i)}</span>`),n+=i.length;continue}if(/\d/.test(r(n))&&(n===0||/[\s,=(]/.test(r(n-1)))){let s=n;for(;s<e.length&&/[\d.]/.test(r(s));)s++;t.push(`<span class="sql-number">${Hr(e.slice(n,s))}</span>`),n=s;continue}if(/[a-zA-Z_]/.test(r(n))){let s=n;for(;s<e.length&&/[a-zA-Z0-9_]/.test(r(s));)s++;const i=e.slice(n,s),l=i.toUpperCase(),u=e.slice(s);/^\s*\(/.test(u)&&m6.has(l)?t.push(`<span class="sql-function">${Hr(i)}</span>`):h6.has(l)?t.push(`<span class="sql-keyword">${Hr(i)}</span>`):t.push(Hr(i)),n=s;continue}if(r(n)===":"&&r(n+1)===":"){let s=n+2;for(;s<e.length&&/[a-zA-Z0-9_]/.test(r(s));)s++;t.push(`<span class="sql-type">${Hr(e.slice(n,s))}</span>`),n=s;continue}if("=<>!+-*/%".includes(r(n))){t.push(`<span class="sql-operator">${Hr(r(n))}</span>`),n++;continue}t.push(Hr(r(n))),n++}return t.join("")}function y6(e){return p6(e).split(`
|
|
75
|
-
`).map(r=>`<div class="sql-line">${r||" "}</div>`).join("")}function g6({isOpen:e,onClose:t,compiledSql:n,modelName:r,connection:s,durationMs:i,rowCount:l,cached:u}){const[f,h]=N.useState(!1),p=N.useMemo(()=>n?y6(n):"",[n]);if(!e)return null;const y=async()=>{if(n)try{await navigator.clipboard.writeText(n),h(!0),setTimeout(()=>h(!1),2e3)}catch{}};return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 bg-black/20 z-40",onClick:t}),d.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:[d.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b flex-shrink-0",style:{borderColor:"var(--yc-color-border)"},children:[d.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--yc-color-text)",fontFamily:"var(--yc-font-heading)"},children:"Query Details"}),d.jsx("button",{onClick:t,className:"p-1.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-text-secondary)"},children:"Metadata"}),d.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&&d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Model"}),d.jsx("span",{className:"font-mono text-xs",style:{color:"var(--yc-color-text)"},children:r})]}),s&&d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Connection"}),d.jsx("span",{style:{color:"var(--yc-color-text)"},children:s})]}),l!=null&&d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Rows"}),d.jsx("span",{style:{color:"var(--yc-color-text)"},children:l.toLocaleString()})]}),i!=null&&d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Duration"}),d.jsxs("span",{style:{color:"var(--yc-color-text)"},children:[i,"ms",u&&d.jsx("span",{className:"ml-2 text-green-600 text-xs",children:"(cached)"})]})]})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-text-secondary)"},children:"Compiled SQL"}),d.jsx("button",{onClick:y,className:"text-xs px-2 py-1 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-primary)"},children:f?"Copied!":"Copy"})]}),n?d.jsx("div",{className:"sql-viewer rounded overflow-x-auto",style:{fontFamily:"'Source Code Pro', 'Fira Code', 'JetBrains Mono', 'Cascadia Code', ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:"13px",lineHeight:"1.6",backgroundColor:"var(--yc-color-background)",color:"var(--yc-color-text)",border:"1px solid var(--yc-color-border)",counterReset:"line",padding:"12px 0"},dangerouslySetInnerHTML:{__html:p}}):d.jsx("p",{className:"text-sm italic",style:{color:"var(--yc-color-text-secondary)"},children:"No SQL available."})]})]})]})]})}const Cx=[{name:"Red",hex:"#ef4444"},{name:"Orange",hex:"#f97316"},{name:"Green",hex:"#10b981"},{name:"Blue",hex:"#3b82f6"},{name:"Purple",hex:"#8b5cf6"}];function sm({value:e,onChange:t,themePalette:n,compact:r}){const[s,i]=N.useState(!1),[l,u]=N.useState(""),f=N.useRef(null);N.useEffect(()=>{if(!s)return;function g(b){f.current&&!f.current.contains(b.target)&&i(!1)}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[s]),N.useEffect(()=>{if(s&&e){const g=Cx.some(b=>b.hex.toLowerCase()===e.toLowerCase())||h.some(b=>b.toLowerCase()===e.toLowerCase());u(g?"":e)}},[s]);const h=n??Gm;function p(g){t(g),i(!1)}function y(){const g=l.trim();g&&/^#[0-9a-fA-F]{3,8}$/.test(g)&&(t(g),i(!1))}return d.jsxs("div",{className:"relative",ref:f,children:[r?d.jsx("button",{type:"button",onClick:()=>i(!s),className:"w-3 h-3 rounded-full flex-shrink-0 cursor-pointer hover:scale-125 transition-transform",style:{backgroundColor:e||"#6366f1"},title:e||"Set color"}):d.jsxs("button",{type:"button",onClick:()=>i(!s),className:"flex items-center gap-1.5 px-2 py-1 text-sm rounded border box-border -my-1",style:{backgroundColor:"var(--yc-color-background)",borderColor:"var(--yc-color-border)",color:e?"var(--yc-color-text-secondary)":"var(--yc-color-text-muted)"},children:[d.jsx("span",{className:"w-4 h-4 rounded-full border flex-shrink-0",style:{backgroundColor:e||"transparent",borderColor:e?"var(--yc-color-border)":"var(--yc-color-text-muted)",borderStyle:e?"solid":"dashed"}}),d.jsx("span",{className:"truncate",children:e||"Color"})]}),s&&d.jsxs("div",{className:"absolute z-50 rounded-lg shadow-lg p-3 min-w-[200px]",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)",top:"100%",left:0,marginTop:4},children:[d.jsxs("div",{className:"mb-2",children:[d.jsx("div",{className:"text-[10px] font-medium uppercase tracking-wider mb-1.5",style:{color:"var(--yc-color-text-muted)"},children:"Standard"}),d.jsx("div",{className:"space-y-0.5",children:Cx.map(g=>d.jsxs("button",{type:"button",onClick:()=>p(g.hex),className:"flex items-center gap-2 w-full px-1.5 py-1 rounded text-sm hover:opacity-80 transition-opacity",style:{backgroundColor:(e==null?void 0:e.toLowerCase())===g.hex.toLowerCase()?"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)":"transparent",color:"var(--yc-color-text)"},children:[d.jsx("span",{className:"w-3.5 h-3.5 rounded-full flex-shrink-0",style:{backgroundColor:g.hex}}),g.name]},g.hex))})]}),d.jsxs("div",{className:"mb-2 pt-1",style:{borderTop:"1px solid var(--yc-color-border)"},children:[d.jsx("div",{className:"text-[10px] font-medium uppercase tracking-wider mb-1.5",style:{color:"var(--yc-color-text-muted)"},children:"Theme"}),d.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map((g,b)=>d.jsx("button",{type:"button",onClick:()=>p(g),className:"w-5 h-5 rounded-full flex-shrink-0 transition-transform hover:scale-110",style:{backgroundColor:g,outline:(e==null?void 0:e.toLowerCase())===g.toLowerCase()?"2px solid var(--yc-color-primary)":"none",outlineOffset:2},title:g},`${g}-${b}`))})]}),d.jsxs("div",{className:"pt-1",style:{borderTop:"1px solid var(--yc-color-border)"},children:[d.jsx("div",{className:"text-[10px] font-medium uppercase tracking-wider mb-1.5",style:{color:"var(--yc-color-text-muted)"},children:"Custom"}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"w-5 h-5 rounded flex-shrink-0 border",style:{backgroundColor:/^#[0-9a-fA-F]{3,8}$/.test(l.trim())?l.trim():"transparent",borderColor:"var(--yc-color-border)"}}),d.jsx("input",{type:"text",value:l,onChange:g=>u(g.target.value),onKeyDown:g=>{g.key==="Enter"&&y()},placeholder:"#hex",className:"flex-1 min-w-0 px-1.5 py-1 text-xs rounded border",style:{backgroundColor:"var(--yc-color-background)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text)"}}),d.jsx("button",{type:"button",onClick:y,disabled:!l.trim()||!/^#[0-9a-fA-F]{3,8}$/.test(l.trim()),className:"text-xs px-1.5 py-1 rounded text-white disabled:opacity-40",style:{backgroundColor:"var(--yc-color-primary, #3b82f6)"},children:"Apply"})]})]}),e&&d.jsx("div",{className:"pt-2 mt-1",style:{borderTop:"1px solid var(--yc-color-border)"},children:d.jsx("button",{type:"button",onClick:()=>{t(""),i(!1)},className:"text-xs hover:opacity-80",style:{color:"var(--yc-color-text-muted)"},children:"Clear color"})})]})]})}function x6({open:e,title:t,message:n,confirmLabel:r="Delete",cancelLabel:s="Cancel",variant:i="danger",onConfirm:l,onCancel:u}){const f=N.useRef(null);return N.useEffect(()=>{var h;e&&((h=f.current)==null||h.focus())},[e]),N.useEffect(()=>{if(!e)return;function h(p){p.key==="Escape"&&u()}return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,u]),e?d.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:u}),d.jsxs("div",{className:"relative rounded-lg shadow-xl p-5 w-[360px] max-w-[90vw]",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[d.jsx("h3",{className:"text-base font-semibold mb-1",style:{color:"var(--yc-color-text)"},children:t}),d.jsx("p",{className:"text-sm mb-5",style:{color:"var(--yc-color-text-secondary)"},children:n}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx("button",{onClick:u,className:"px-3 py-1.5 text-sm rounded border transition-colors hover:opacity-80",style:{borderColor:"var(--yc-color-border)",color:"var(--yc-color-text-secondary)",backgroundColor:"var(--yc-color-background)"},children:s}),d.jsx("button",{ref:f,onClick:l,className:"px-3 py-1.5 text-sm rounded text-white transition-colors hover:opacity-90",style:{backgroundColor:i==="danger"?"var(--yc-color-danger, #ef4444)":"var(--yc-color-primary, #3b82f6)"},children:r})]})]})]}):null}const Lc=`
|
|
76
|
-
.rdp-root {
|
|
77
|
-
--rdp-accent-color: var(--yc-color-primary, #2563eb);
|
|
78
|
-
--rdp-accent-background-color: color-mix(in srgb, var(--yc-color-primary, #2563eb) 15%, transparent);
|
|
79
|
-
--rdp-day_button-height: 32px;
|
|
80
|
-
--rdp-day_button-width: 32px;
|
|
81
|
-
color: var(--yc-color-text);
|
|
82
|
-
font-size: 13px;
|
|
83
|
-
}
|
|
84
|
-
.rdp-months { flex-wrap: nowrap; }
|
|
85
|
-
.rdp-month_caption { font-size: 14px; font-weight: 600; }
|
|
86
|
-
.rdp-selected .rdp-day_button { font-weight: 600; }
|
|
87
|
-
.rdp-today .rdp-day_button {
|
|
88
|
-
font-weight: 700;
|
|
89
|
-
border: 2px solid var(--yc-color-primary, #2563eb);
|
|
90
|
-
}
|
|
91
|
-
.rdp-day_button:hover { background-color: var(--yc-color-surface-hover, #e5e7eb) !important; }
|
|
92
|
-
`;function b6({isOpen:e,onClose:t,events:n,allEvents:r,chartName:s,canEdit:i,eventsVisible:l,onToggleVisible:u,themePalette:f}){const h=qn(),[p,y]=N.useState(!1),[g,b]=N.useState(""),[O,w]=N.useState(""),[T,E]=N.useState(""),[_,S]=N.useState(""),[A,M]=N.useState(!1),[C,I]=N.useState(""),[D,j]=N.useState(!1),[F,B]=N.useState(!1),U=N.useRef(null),W=N.useRef(null),Y=N.useRef(null),[Q,re]=N.useState(null),[ye,G]=N.useState(null),[fe,P]=N.useState(""),K=N.useRef(null),[ee,R]=N.useState(null),[ie,ae]=N.useState(null),J=N.useRef(null),be=N.useRef(null),[te,le]=N.useState(null);N.useEffect(()=>{var pe;p&&((pe=U.current)==null||pe.focus())},[p]),N.useEffect(()=>{var pe;ye&&((pe=K.current)==null||pe.focus())},[ye]),N.useEffect(()=>{if(!D)return;function pe(me){W.current&&!W.current.contains(me.target)&&j(!1)}return document.addEventListener("mousedown",pe),()=>document.removeEventListener("mousedown",pe)},[D]),N.useEffect(()=>{if(!F)return;function pe(me){Y.current&&!Y.current.contains(me.target)&&B(!1)}return document.addEventListener("mousedown",pe),()=>document.removeEventListener("mousedown",pe)},[F]),N.useEffect(()=>{if(ee===null)return;function pe(me){J.current&&!J.current.contains(me.target)&&R(null)}return document.addEventListener("mousedown",pe),()=>document.removeEventListener("mousedown",pe)},[ee]),N.useEffect(()=>{if(ie===null)return;function pe(me){be.current&&!be.current.contains(me.target)&&ae(null)}return document.addEventListener("mousedown",pe),()=>document.removeEventListener("mousedown",pe)},[ie]);const ge=Za({mutationFn:pe=>xt.createChartEvent(pe),onSuccess:()=>{h.invalidateQueries({queryKey:["chartEvents"]}),Ye()}}),ve=Za({mutationFn:pe=>xt.deleteChartEvent(pe),onSuccess:()=>h.invalidateQueries({queryKey:["chartEvents"]})}),je=Za({mutationFn:({index:pe,event:me})=>xt.updateChartEvent(pe,me),onSuccess:()=>{h.invalidateQueries({queryKey:["chartEvents"]}),re(null),G(null)}});function Ye(){y(!1),b(""),w(""),E(""),S(""),M(!1),I(""),j(!1),B(!1)}function nt(){!O.trim()||!g.trim()||ge.mutate({date:O.trim(),label:g.trim(),..._.trim()?{description:_.trim()}:{},...T.trim()?{color:T.trim()}:{},...A&&C.trim()?{endDate:C.trim()}:{},charts:[s]})}function tt(pe){return r.findIndex(me=>me.date===pe.date&&me.label===pe.label&&(me.description??"")===(pe.description??"")&&(me.endDate??"")===(pe.endDate??""))}function Je(pe){le(pe)}function rt(){if(!te)return;const pe=tt(te);pe!==-1&&(ve.mutate(pe),le(null))}function ut(pe){if(Q===null||!ye)return;const me=tt(pe);if(me===-1)return;const Ae=pe[ye]??"";if(fe===Ae){re(null),G(null);return}je.mutate({index:me,event:{...pe,[ye]:fe}})}return e?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 bg-black/20 z-40",onClick:t}),d.jsxs("div",{className:"fixed top-0 right-0 bottom-0 w-[400px] max-w-[90vw] z-50 flex flex-col shadow-xl border-l",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[d.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b flex-shrink-0",style:{borderColor:"var(--yc-color-border)"},children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--yc-color-text)",fontFamily:"var(--yc-font-heading)"},children:"Events"}),n.length>0&&d.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"},children:n.length})]}),d.jsx("button",{onClick:t,className:"p-1.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between p-3 rounded",style:{backgroundColor:"var(--yc-color-background)",border:"1px solid var(--yc-color-border)"},children:[d.jsxs("div",{children:[d.jsx("div",{className:"text-sm font-medium",style:{color:"var(--yc-color-text)"},children:"Show on chart"}),d.jsx("div",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:"Display event markers as dashed lines"})]}),d.jsx("button",{onClick:u,className:"relative w-10 h-5 rounded-full transition-colors flex-shrink-0",style:{backgroundColor:l?"var(--yc-color-primary, #3b82f6)":"var(--yc-color-border)"},children:d.jsx("span",{className:"absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform",style:{left:l?22:2}})})]}),i&&!p&&d.jsxs("button",{onClick:()=>y(!0),className:"w-full flex items-center justify-center gap-2 px-3 py-2 text-sm rounded border border-dashed transition-colors hover:opacity-80",style:{borderColor:"var(--yc-color-border)",color:"var(--yc-color-primary)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add event"]}),p&&d.jsxs("div",{className:"p-3 rounded space-y-2",style:{backgroundColor:"var(--yc-color-background)",border:"1px solid var(--yc-color-border)"},children:[d.jsx("div",{className:"text-xs font-medium mb-2",style:{color:"var(--yc-color-text-secondary)"},children:"New event"}),d.jsxs("div",{className:"relative",children:[d.jsx("button",{onClick:()=>j(!D),className:"w-full px-2 py-1.5 text-sm rounded border text-left",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:O?"var(--yc-color-text)":"var(--yc-color-text-muted)"},children:O||(A?"Start date":"Select date")}),D&&d.jsxs("div",{ref:W,className:"absolute z-50 rounded-lg shadow-lg p-2 mt-1",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[d.jsx("style",{children:Lc}),d.jsx(Xa,{mode:"single",numberOfMonths:1,selected:O?ks(O,"yyyy-MM-dd",new Date):void 0,onSelect:pe=>{pe&&(w(dn(pe,"yyyy-MM-dd")),j(!1))}})]})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:"Multi-day"}),d.jsx("button",{onClick:()=>{M(!A),A&&(I(""),B(!1))},className:"relative w-10 h-5 rounded-full transition-colors flex-shrink-0",style:{backgroundColor:A?"var(--yc-color-primary, #3b82f6)":"var(--yc-color-border)"},children:d.jsx("span",{className:"absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform",style:{left:A?22:2}})})]}),A&&d.jsxs("div",{className:"relative",children:[d.jsx("button",{onClick:()=>B(!F),className:"w-full px-2 py-1.5 text-sm rounded border text-left",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:C?"var(--yc-color-text)":"var(--yc-color-text-muted)"},children:C||"End date"}),F&&d.jsxs("div",{ref:Y,className:"absolute z-50 rounded-lg shadow-lg p-2 mt-1",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[d.jsx("style",{children:Lc}),d.jsx(Xa,{mode:"single",numberOfMonths:1,selected:C?ks(C,"yyyy-MM-dd",new Date):void 0,onSelect:pe=>{pe&&(I(dn(pe,"yyyy-MM-dd")),B(!1))}})]})]}),d.jsx("input",{ref:U,type:"text",value:g,onChange:pe=>b(pe.target.value),onKeyDown:pe=>{pe.key==="Enter"&&nt(),pe.key==="Escape"&&Ye()},placeholder:"Event label",className:"w-full px-2 py-1.5 text-sm rounded border",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text)"}}),d.jsxs("div",{children:[d.jsx("textarea",{value:_,onChange:pe=>S(pe.target.value),onKeyDown:pe=>{pe.key==="Escape"&&Ye()},placeholder:"Description (optional)",rows:2,className:"w-full px-2 py-1.5 text-sm rounded border resize-y",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text)"}}),d.jsxs("div",{className:"text-[10px] mt-0.5",style:{color:"var(--yc-color-text-muted)"},children:["Supports ",d.jsx("a",{href:"https://www.markdownguide.org/basic-syntax/",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--yc-color-primary)",textDecoration:"underline"},children:"Markdown"})]})]}),d.jsxs("div",{children:[d.jsx("div",{className:"text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"Color (optional)"}),d.jsx(sm,{value:T,onChange:E,themePalette:f})]}),d.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[d.jsx("button",{onClick:Ye,className:"px-2 py-1 text-xs rounded",style:{color:"var(--yc-color-text-muted)"},children:"Cancel"}),d.jsx("button",{onClick:nt,disabled:!O.trim()||!g.trim()||ge.isPending,className:"px-2 py-1 text-xs rounded text-white disabled:opacity-50",style:{backgroundColor:"var(--yc-color-primary, #3b82f6)"},children:ge.isPending?"Saving...":"Save"})]})]}),n.length===0?d.jsxs("div",{className:"text-center py-8",children:[d.jsx("div",{className:"text-sm",style:{color:"var(--yc-color-text-muted)"},children:"No events for this chart"}),d.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:"Events appear as dashed vertical lines on the chart"})]}):d.jsx("div",{className:"space-y-1",children:n.map((pe,me)=>d.jsxs("div",{className:"group flex items-start gap-3 p-3 rounded transition-colors hover:bg-black/[0.03]",style:{border:"1px solid transparent"},children:[i?d.jsx("div",{className:"flex-shrink-0 mt-0.5",children:d.jsx(sm,{value:pe.color??"",onChange:Ae=>{const Pe=tt(pe);Pe!==-1&&je.mutate({index:Pe,event:{...pe,...Ae?{color:Ae}:{color:void 0}}})},themePalette:f,compact:!0})}):d.jsx("span",{className:"w-3 h-3 rounded-full flex-shrink-0 mt-0.5",style:{backgroundColor:pe.color||"#6366f1"}}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"text-xs relative flex items-center gap-1",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("span",{style:{cursor:i?"pointer":"default"},onClick:Ae=>{i&&(Ae.stopPropagation(),R(ee===me?null:me),ae(null))},children:pe.date}),ee===me&&d.jsxs("div",{ref:J,className:"absolute z-50 rounded-lg shadow-lg p-2",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)",top:"100%",left:0},children:[d.jsx("style",{children:Lc}),d.jsx(Xa,{mode:"single",numberOfMonths:1,selected:(()=>{try{return ks(pe.date,"yyyy-MM-dd",new Date)}catch{return}})(),defaultMonth:(()=>{try{return ks(pe.date,"yyyy-MM-dd",new Date)}catch{return}})(),onSelect:Ae=>{if(!Ae)return;const Pe=dn(Ae,"yyyy-MM-dd");if(R(null),Pe===pe.date)return;const ct=tt(pe);ct!==-1&&je.mutate({index:ct,event:{...pe,date:Pe}})}})]}),pe.endDate&&d.jsxs(d.Fragment,{children:[d.jsx("span",{children:"→"}),d.jsx("span",{style:{cursor:i?"pointer":"default"},onClick:Ae=>{i&&(Ae.stopPropagation(),ae(ie===me?null:me),R(null))},children:pe.endDate}),ie===me&&d.jsxs("div",{ref:be,className:"absolute z-50 rounded-lg shadow-lg p-2",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)",top:"100%",left:0},children:[d.jsx("style",{children:Lc}),d.jsx(Xa,{mode:"single",numberOfMonths:1,selected:(()=>{try{return ks(pe.endDate,"yyyy-MM-dd",new Date)}catch{return}})(),defaultMonth:(()=>{try{return ks(pe.endDate,"yyyy-MM-dd",new Date)}catch{return}})(),onSelect:Ae=>{if(!Ae)return;const Pe=dn(Ae,"yyyy-MM-dd");if(ae(null),Pe===pe.endDate)return;const ct=tt(pe);ct!==-1&&je.mutate({index:ct,event:{...pe,endDate:Pe}})}})]})]})]}),Q===me&&ye==="label"?d.jsx("input",{ref:K,type:"text",value:fe,onChange:Ae=>P(Ae.target.value),onBlur:()=>ut(pe),onKeyDown:Ae=>{Ae.key==="Enter"&&ut(pe),Ae.key==="Escape"&&(re(null),G(null))},className:"w-full py-0 text-sm font-medium border-0 border-b outline-none",style:{backgroundColor:"transparent",borderColor:"var(--yc-color-primary, #3b82f6)",color:"var(--yc-color-text)",borderBottomWidth:1,borderBottomStyle:"solid"}}):d.jsx("div",{className:"text-sm font-medium truncate",style:{color:"var(--yc-color-text)",cursor:i?"pointer":"default"},onClick:()=>{i&&(re(me),G("label"),P(pe.label))},children:pe.label}),Q===me&&ye==="description"?d.jsx("input",{ref:K,type:"text",value:fe,onChange:Ae=>P(Ae.target.value),onBlur:()=>ut(pe),onKeyDown:Ae=>{Ae.key==="Enter"&&ut(pe),Ae.key==="Escape"&&(re(null),G(null))},placeholder:"Add description",className:"w-full py-0 text-xs border-0 border-b outline-none mt-0.5",style:{backgroundColor:"transparent",borderColor:"var(--yc-color-primary, #3b82f6)",color:"var(--yc-color-text)",borderBottomWidth:1,borderBottomStyle:"solid"}}):d.jsx("div",{className:"text-xs truncate mt-0.5",style:{color:pe.description?"var(--yc-color-text-secondary)":"var(--yc-color-text-muted)",cursor:i?"pointer":"default"},onClick:()=>{i&&(re(me),G("description"),P(pe.description??""))},children:pe.description||(i?"Add description":"")}),pe.charts&&pe.charts.length>0&&d.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:pe.charts.length===1&&pe.charts[0]===s?"This chart only":`${pe.charts.length} charts`})]}),i&&d.jsx("button",{onClick:()=>Je(pe),className:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-black/5 transition-all flex-shrink-0",style:{color:"var(--yc-color-danger, #ef4444)"},title:"Delete event",children:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})})})]},`${pe.date}-${pe.label}-${me}`))})]})]}),d.jsx(x6,{open:te!==null,title:"Delete event",message:`Delete "${te==null?void 0:te.label}"? This cannot be undone.`,onConfirm:rt,onCancel:()=>le(null)})]}):null}async function v6(e,t,n="png"){const{default:r}=await Yr(async()=>{const{default:l}=await import("./html2canvas.esm-QH1iLAAe.js");return{default:l}},[]),i=(await r(e,{backgroundColor:"#f9fafb",scale:2,useCORS:!0,logging:!1})).toDataURL(`image/${n}`,n==="jpeg"?.9:void 0);rd(i,`${t}.${n}`)}async function E6(e,t,n){const[{default:r},{jsPDF:s}]=await Promise.all([Yr(()=>import("./html2canvas.esm-QH1iLAAe.js"),[]),Yr(()=>import("./jspdf.es.min-9haD1GSE.js").then(A=>A.j),[])]),i=await r(e,{backgroundColor:"#f9fafb",scale:2,useCORS:!0,logging:!1}),l=i.toDataURL("image/png"),u=i.width,f=i.height,p=u/f>1,y=new s({orientation:p?"landscape":"portrait",unit:"mm"}),g=y.internal.pageSize.getWidth(),b=y.internal.pageSize.getHeight();let O=0;n&&(O=8,y.setFontSize(16),y.text(n,g/2,O,{align:"center"}),O=14);const w=g,T=b-O;let E=w,_=f/u*E;_>T&&(_=T,E=u/f*_);const S=(g-E)/2;y.addImage(l,"PNG",S,O,E,_),y.save(`${t}.pdf`)}async function T6(e,t,n){const{jsPDF:r}=await Yr(async()=>{const{jsPDF:T}=await import("./jspdf.es.min-9haD1GSE.js").then(E=>E.j);return{jsPDF:T}},[]),s=new Image;s.src=e,await new Promise(T=>{s.onload=T});const l=s.width/s.height>1.2,u=new r({orientation:l?"landscape":"portrait",unit:"mm"}),f=u.internal.pageSize.getWidth(),h=u.internal.pageSize.getHeight();let p=15;n&&(u.setFontSize(14),u.text(n,f/2,10,{align:"center"}));const y=f-20,g=h-p-15;let b=y,O=s.height/s.width*b;O>g&&(O=g,b=s.width/s.height*O);const w=(f-b)/2;u.addImage(e,"PNG",w,p,b,O),u.save(`${t}.pdf`)}function Ad(e,t,n){if(e.length===0)return;const r=t.map(l=>l.name),s=e.map(l=>t.map(u=>{const f=l[u.name];if(f==null)return"";const h=String(f);return h.includes(",")||h.includes('"')||h.includes(`
|
|
93
|
-
`)?`"${h.replace(/"/g,'""')}"`:h})),i=[r.join(","),...s.map(l=>l.join(","))].join(`
|
|
94
|
-
`);M2(i,`${n}.csv`,"text/csv;charset=utf-8;")}function w6(e,t){const n=JSON.stringify(e,null,2);M2(n,`${t}.json`,"application/json;charset=utf-8;")}function rd(e,t){const n=document.createElement("a");n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function M2(e,t,n){const r=new Blob([e],{type:n}),s=URL.createObjectURL(r),i=document.createElement("a");i.href=s,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(s)}const Ka=50;function L2({data:e,columns:t,drillDownColumns:n,filterDisplay:r,chartName:s}){const[i,l]=N.useState(null),[u,f]=N.useState(0),h=N.useMemo(()=>n&&n.length>0?n.map(_=>({field:_.field,label:_.label??_.field,format:_.format})):t.map(_=>({field:_.name,label:_.name,format:void 0})),[n,t]),p=N.useMemo(()=>{if(!i)return e;const{field:_,direction:S}=i;return[...e].sort((A,M)=>{const C=A[_],I=M[_];if(C==null&&I==null)return 0;if(C==null)return 1;if(I==null)return-1;if(typeof C=="number"&&typeof I=="number")return S==="asc"?C-I:I-C;const D=String(C),j=String(I);return S==="asc"?D.localeCompare(j):j.localeCompare(D)})},[e,i]),y=Math.ceil(p.length/Ka),g=p.slice(u*Ka,(u+1)*Ka),b=u*Ka+1,O=Math.min((u+1)*Ka,p.length),w=_=>{l(S=>!S||S.field!==_?{field:_,direction:"asc"}:S.direction==="asc"?{field:_,direction:"desc"}:null),f(0)},T=(_,S)=>_==null?"":S&&typeof _=="number"?S.includes("$")?`$${_.toLocaleString()}`:S.includes("%")?`${_.toFixed(1)}%`:_.toLocaleString():String(_),E=_=>!i||i.field!==_?"":i.direction==="asc"?" ↑":" ↓";return d.jsxs("div",{className:"border rounded-lg overflow-hidden",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-input-bg)"},children:[d.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["Showing ",p.length," rows filtered by ",r]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>Ad(e,t,`${s}-drill-down`),className:"text-sm px-3 py-1 border rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)",borderColor:"var(--yc-color-border)"},children:"Export CSV"}),d.jsx("button",{onClick:()=>w6(e,`${s}-drill-down`),className:"text-sm px-3 py-1 border rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)",borderColor:"var(--yc-color-border)"},children:"Export JSON"})]})]}),d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full text-sm yc-table",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-input-bg)"},children:[d.jsx("th",{className:"px-3 py-2 text-right font-medium select-none w-10",style:{color:"var(--yc-color-text-muted)"},children:"#"}),h.map(_=>d.jsxs("th",{className:"px-4 py-2 text-left font-medium cursor-pointer hover:bg-black/5 select-none",style:{color:"var(--yc-color-text)"},onClick:()=>w(_.field),children:[_.label,E(_.field)]},_.field))]})}),d.jsx("tbody",{children:g.map((_,S)=>d.jsxs("tr",{style:{backgroundColor:S%2===0?"var(--yc-color-surface)":"var(--yc-color-input-bg)"},children:[d.jsx("td",{className:"px-3 py-2 text-right yc-row-num w-10",style:{backgroundColor:S%2===0?"var(--yc-color-surface)":"var(--yc-color-input-bg)"},children:u*Ka+S+1}),h.map(A=>d.jsx("td",{className:"px-4 py-2",style:{color:"var(--yc-color-text-secondary)"},children:T(_[A.field],A.format)},A.field))]},S))})]})}),y>1&&d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-input-bg)"},children:[d.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["Showing ",b,"-",O," of ",p.length]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>f(_=>Math.max(0,_-1)),disabled:u===0,className:"text-sm px-3 py-1 border rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)"},children:"Previous"}),d.jsx("button",{onClick:()=>f(_=>Math.min(y-1,_+1)),disabled:u>=y-1,className:"text-sm px-3 py-1 border rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)"},children:"Next"})]})]})]})}class sd extends N.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}}function k6(e,t){return e.length<=t?e:e.slice(0,t)+"..."}function S6(e){return e.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(t,n,r)=>{const i=!r.startsWith("#")?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${r}" style="color: #6366f1; text-decoration: underline;"${i}>${n}</a>`})}function Id(e,t,n){const r=e.filter(s=>{if(s.date===t)return!0;if(s.endDate&&n&&n.length>0){let i=n.indexOf(s.date),l=n.indexOf(s.endDate);const u=n.indexOf(t);if(i===-1&&(i=0),l===-1&&(l=n.length-1),u!==-1)return u>=i&&u<=l}return!1});return r.length===0?"":r.map(s=>{const i=s.color??"#6366f1",l=s.endDate?`${s.date} → ${s.endDate}`:"",u=s.description?k6(s.description,100):"",f=u?`<div style="font-size: 11px; color: #888; margin-top: 2px;">${S6(u)}</div>`:"",h=l?`<div style="font-size: 10px; color: #999; margin-top: 1px;">${l}</div>`:"";return`<div style="margin-top: 6px; padding-top: 6px; border-top: 1px dashed #e5e7eb;"><span style="display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: ${i}; margin-right: 6px;"></span><span style="font-weight: 500;">${s.label}</span>${h}${f}</div>`}).join("")}function Md(e,t,n){let r=e.filter(s=>!s.endDate);if(n&&n.length>0&&(r=r.filter(s=>n.includes(s.date))),r.length!==0)return{silent:!0,symbol:"none",tooltip:{show:!1},data:r.map(s=>{const i=s.color??t;return{xAxis:s.date,label:{formatter:s.label,position:"insideEndTop",fontSize:11,color:i,backgroundColor:"rgba(99, 102, 241, 0.12)",padding:[2,6],borderRadius:3},lineStyle:{type:"dashed",color:i,width:1},emphasis:{disabled:!0}}})}}function Ld(e,t,n){const r=e.filter(l=>l.endDate);if(r.length===0)return[];const s=n==null?void 0:n[0],i=n==null?void 0:n[n.length-1];return r.flatMap(l=>{let u=l.date,f=l.endDate;if(n&&n.length>0&&s&&i){const p=n.indexOf(u),y=n.indexOf(f);p===-1&&(u=s),y===-1&&(f=i);const g=n.indexOf(u),b=n.indexOf(f);if(g>b)return[]}const h=l.color??t;return[[{xAxis:u,itemStyle:{color:h,opacity:.1},label:{show:!0,formatter:l.label,position:"insideTop",fontSize:11,color:h,padding:[2,6]}},{xAxis:f}]]})}const np="#22c55e",R2="dashed";function C6(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e.toLocaleString()}function P2(e){return e.type==="fixed"}function N6(e){return e.type==="cumulative"}function _6(e){return e.type==="model"}function Rd(e,t){const n=[];for(const r of e){const s=r.color??np,i=r.style??R2;if(P2(r)){const l=C6(r.value);n.push({yAxis:r.value,label:{formatter:r.label?`${r.label}: ${l}`:l,position:"insideEndTop",fontSize:11,color:s,backgroundColor:"rgba(255,255,255,0.85)",padding:[2,6],borderRadius:2},lineStyle:{color:s,type:i,width:2}})}if(N6(r)){const l=r.from?t.indexOf(r.from):0,u=r.by?t.indexOf(r.by):t.length-1,f=Math.max(0,l===-1?0:l),h=u===-1?t.length-1:u;n.push([{coord:[f,0],label:{formatter:r.label??"",position:"insideEndTop",fontSize:11,color:s},lineStyle:{color:s,type:i,width:2}},{coord:[h,r.value]}])}}return n}function Pd(e,t){const n=[];for(const r of e){if(!r.zone)continue;const s=r.color??np;if(P2(r)){const i=r.value*(1-r.zone.tolerance),l=r.value*(1+r.zone.tolerance);n.push([{yAxis:i,itemStyle:{color:s,opacity:.08}},{yAxis:l}])}}return n}function jd(e,t){const n=[];for(const r of e){if(!_6(r)||!t)continue;const s=r.color??np,i=r.style??R2,l=t.rows.map(u=>{const f=u[r.source.value_field];return typeof f=="number"?f:parseFloat(String(f))||0});n.push({name:r.label??"Goal",data:l,color:s,lineStyle:{type:i,width:2,color:s},showSymbol:!1,z:5})}return n}const od="#22c55e",ad="#ef4444";function j2(e){return e.type==="fixed"}function F2(e){return e.type==="cumulative"}function D6(e,t){const n=t.find(j2);return n?e>=n.value?od:ad:null}function O6(e,t,n,r){const s=r.find(F2);if(!s||n===0)return null;const i=s.value/n*(t+1);return e>=i?od:ad}function A6(e,t){const n=t.find(j2);if(n)return e.map(s=>({value:s,itemStyle:{color:s>=n.value?od:ad}}));const r=t.find(F2);if(r){const s=e.length;return e.map((i,l)=>{const u=r.value/s*(l+1);return{value:i,itemStyle:{color:i>=u?od:ad}}})}return e}function B2(e,t){if(e.length===0||t.length===0)return null;const n=e[e.length-1],r=D6(n,t);return r||O6(n,e.length-1,e.length,t)}function I6(e,t){return e.map((n,r)=>{const s=Math.max(0,r-t+1);let i=0,l=0;for(let u=s;u<=r;u++)e[u]!=null&&(i+=e[u],l++);return l>0?i/l:null})}function M6(e){return"field"in e}function L6(e){return"columns"in e}function c0(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 s of e)r+=s.data[n]??0;for(const s of e)s.data[n]!=null&&(s.data[n]=r===0?0:s.data[n]/r*100)}return e}function Fd(e,t,n){var s,i,l;const r=t.stacking?"total":void 0;if(!t.series){const u=((s=t.y)==null?void 0:s.field)??"",f=e.map(p=>{const y=p[u];return typeof y=="number"?y:parseFloat(String(y))||0}),h=[{name:u,data:f,color:da(0,void 0,n),stack:r}];return t.stacking==="percent"?c0(h):h}if(M6(t.series)){const u=t.series.field,f=t.series.colors,h=((i=t.y)==null?void 0:i.field)??"",p=(l=t.x)==null?void 0:l.field,y=[],g=new Map;if(p)for(const T of e){const E=T[p];g.has(E)||(g.set(E,y.length),y.push(E))}const b=[],O=new Map;e.forEach(T=>{const E=String(T[u]??"");O.has(E)||(b.push(E),O.set(E,p?new Array(y.length).fill(null):[]));const _=T[h],S=typeof _=="number"?_:parseFloat(String(_))||0;if(p){const A=g.get(T[p]);O.get(E)[A]=S}else O.get(E).push(S)});const w=b.map((T,E)=>({name:T,data:O.get(T),color:mO(T,E,f,n),stack:r}));return t.stacking==="percent"?c0(w):w}if(L6(t.series)){const u=t.series.columns.map((f,h)=>{var y;let p=e.map(g=>{const b=g[f.field];return typeof b=="number"?b:parseFloat(String(b))||0});return((y=f.transform)==null?void 0:y.type)==="rolling_average"&&f.transform.window>0&&(p=I6(p,f.transform.window)),{name:f.name??f.field,data:p,color:da(h,f.color,n),opacity:f.opacity,style:f.style,gradient:f.gradient,stack:r,chartType:f.type,yAxisIndex:f.axis==="right"?1:f.axis==="left"?0:void 0,band:f.band}});return t.stacking==="percent"?c0(u):u}return[]}function id(e){const t=e.match(/^(\d{4}-\d{2}-\d{2})[T ]00:00:00(?:\.0+)?(?:Z|[+-]\d{2}:?\d{2})?$/);return E1(t?t[1]:e)}function R6(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 H2(e){const t=Math.floor(e.getMonth()/3)+1,n=e.getFullYear().toString().slice(-2);return`Q${t} '${n}`}function P6(e){if(e.length<2)return"MMM dd, yyyy";const t=e.map(u=>u.getTime()).sort((u,f)=>u-f),n=t[0],r=t[t.length-1],s=(r-n)/(1e3*60*60*24);return s<2?"MMM dd, h:mm a":s<=90||(r-n)/(t.length-1)/(1e3*60*60*24)<28?"MMM dd":s<=730?"MMM yyyy":"yyyy"}function j6(e){if(e.length<2)return"MMM dd, yyyy";const t=e.map(r=>r.getTime()).sort((r,s)=>r-s),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 Bd(e,t){const n=new Set,r=e.filter(l=>{const u=l[t.field];return n.has(u)?!1:(n.add(u),!0)});if(t.type!=="temporal")return r.map(l=>String(l[t.field]??""));const s=[];for(const l of r){const u=l[t.field];if(typeof u=="string")try{s.push(id(u))}catch{}}const i=s.length>0?j6(s):"MMM dd, yyyy";return r.map(l=>{const u=l[t.field];if(typeof u=="string")try{const f=id(u);return t.format==="quarter"?H2(f):dn(f,i)}catch{return String(u??"")}return String(u??"")})}function Hd(e,t){const n=new Set,r=e.filter(s=>{const i=s[t.field];return n.has(i)?!1:(n.add(i),!0)});return Ps(r,t)}function Ps(e,t){let n;if(t.type==="temporal"&&!t.format){const r=[];for(const s of e){const i=s[t.field];if(typeof i=="string")try{r.push(id(i))}catch{}}r.length>0&&(n=P6(r))}return e.map(r=>{const s=r[t.field];if(t.type==="temporal"&&typeof s=="string")try{const i=id(s);if(t.format==="quarter")return H2(i);const l=t.format?R6(t.format):n??"MMM yyyy";return dn(i,l)}catch{return String(s??"")}return String(s??"")})}function ko(e,t){if(t){if(t.includes("$"))return`$${e.toLocaleString()}`;if(t.includes("%"))return`${e.toFixed(1)}%`}return e.toLocaleString()}function F6(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 Ud(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=F6(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 zd(){return 40}function cs(e){return((e==null?void 0:e.base)??"modern")==="modern"?{smooth:!0,barBorderRadius:[4,4,0,0],barBorderRadiusHorizontal:[0,4,4,0],pieBorderRadius:4}:{smooth:!1,barBorderRadius:[0,0,0,0],barBorderRadiusHorizontal:[0,0,0,0],pieBorderRadius:0}}function Wd(e,t){const n=[];for(const r of e)r.type==="line"?n.push({yAxis:r.value,label:{show:!!r.label,formatter:r.label??"",position:"insideEndTop",color:r.color??t,fontSize:11},lineStyle:{color:r.color??"#999",type:r.style??"dashed",width:1.5}}):r.type==="x_line"&&n.push({xAxis:r.x,label:{show:!!r.label,formatter:r.label??"",position:"insideEndTop",color:r.color??t,fontSize:11},lineStyle:{color:r.color??"#999",type:r.style??"dashed",width:1.5}});return n}function Yd(e){const t=[];for(const n of e)n.type==="band"&&t.push([{yAxis:n.from,itemStyle:{color:n.color??"rgba(150, 150, 150, 0.1)"},label:n.label?{show:!0,position:"insideTop",formatter:n.label,fontSize:11}:void 0},{yAxis:n.to}]);return t}const U2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:s,theme:i,height:l=400,loading:u=!1,onChartClick:f,events:h,goalData:p,compareData:y},g){var Y,Q,re,ye,G,fe,P,K;const b=Ar(),O=(s==null?void 0:s.series)&&"field"in s.series,w=O?Hd(t,n):Ps(t,n),T=n.type==="temporal"?Bd(t,n):w,E=N.useMemo(()=>{if(O){const ee=new Set;return t.filter(R=>{const ie=R[n.field];return ee.has(ie)?!1:(ee.add(ie),!0)}).map(R=>R[n.field])}return t.map(ee=>ee[n.field])},[t,n.field,O]),_=N.useMemo(()=>{if(f)return{contextmenu:ee=>{var te,le,ge,ve;const R=ee;if(R.componentType!=="series")return;const ie=R.dataIndex!=null?E[R.dataIndex]:void 0,ae=ie!=null?String(ie):R.name;if(ae==null||ae==="")return;const J=((le=(te=R.event)==null?void 0:te.event)==null?void 0:le.clientX)??0,be=((ve=(ge=R.event)==null?void 0:ge.event)==null?void 0:ve.clientY)??0;f(n.field,ae,{x:J,y:be},R.seriesName)}}},[f,n.field,E]);let S,A,M;if(s){const ee=Fd(t,{type:s.type,x:{field:n.field},y:r?{field:r.field,type:r.type}:void 0,series:s.series,stacking:s.stacking},i),R=cs(i),ie=new Set;for(const J of ee)J.band&&ie.add(J.name);const ae=[];for(const J of ee){const be=Ud(J.color,J.gradient??s.gradient);if(J.band){const te=ee.find(le=>le.name===J.band);if(te){const le=`_band_${J.name}`;ae.push({type:"line",name:`${J.name} (lower)`,data:J.data.map((ge,ve)=>{const je=ge??0,Ye=te.data[ve]??0;return Math.min(je,Ye)}),smooth:R.smooth,symbol:"none",lineStyle:{width:0,opacity:0},itemStyle:{color:"transparent"},areaStyle:{color:"transparent"},stack:le,silent:!0}),ae.push({type:"line",name:`${J.name} (band)`,data:J.data.map((ge,ve)=>{const je=ge??0,Ye=te.data[ve]??0;return Math.abs(Ye-je)}),smooth:R.smooth,symbol:"none",lineStyle:{width:0,opacity:0},itemStyle:{color:J.color},areaStyle:{color:J.color,opacity:.15},stack:le,silent:!0});continue}}ee.some(te=>te.band===J.name)||ae.push({type:"line",name:J.name,data:J.data,smooth:R.smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:J.color,type:J.style==="dashed"?"dashed":J.style==="dotted"?"dotted":"solid"},itemStyle:{color:J.color},areaStyle:be?{color:be}:void 0,stack:J.stack,...J.opacity!==void 0?{opacity:J.opacity}:{}})}S=ae,ee.length>1&&(A={show:((Y=s.legend)==null?void 0:Y.show)!==!1,...((Q=s.legend)==null?void 0:Q.position)==="top"?{top:0}:((re=s.legend)==null?void 0:re.position)==="left"?{left:0,orient:"vertical"}:((ye=s.legend)==null?void 0:ye.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:b.textColor,fontSize:12}}),(G=s.interactions)!=null&&G.zoom&&(M=[{type:"inside",start:0,end:100},{type:"slider",start:0,end:100,bottom:0}])}else{const ee=(r==null?void 0:r.field)??"";S=[{type:"line",data:t.map(ie=>{const ae=ie[ee];return typeof ae=="number"?ae:parseFloat(String(ae))||0}),smooth:cs(i).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=(s==null?void 0:s.goals)??[];if(C.length>0&&Array.isArray(S)){const ee=B2(((fe=S[0])==null?void 0:fe.data)??[],C);ee&&S[0]&&(S[0].lineStyle={...S[0].lineStyle,color:ee},S[0].itemStyle={color:ee});const R=Rd(C,w),ie=Pd(C);if(R.length>0&&S[0]){const J=S[0].markLine,be=(J==null?void 0:J.data)??[];S[0].markLine={...J,silent:!0,symbol:"none",data:[...be,...R]}}ie.length>0&&S[0]&&(S[0].markArea={silent:!0,data:ie});const ae=jd(C,p);for(const J of ae)S.push({type:"line",name:J.name,data:J.data,z:J.z,showSymbol:J.showSymbol,lineStyle:J.lineStyle,itemStyle:{color:J.color}})}const I=s==null?void 0:s.compare;if(y&&y.length>0&&I&&Array.isArray(S)){const ee=(r==null?void 0:r.field)??"",R=["#94A3B8","#CBD5E1","#E2E8F0"];for(let ie=0;ie<y.length;ie++){const ae=y[ie],J=I[ie],be=(J==null?void 0:J.color)??R[ie%R.length],te=ae.rows.map(le=>{const ge=le[ee];return typeof ge=="number"?ge:parseFloat(String(ge))||0});S.push({type:"line",name:ae.label,data:te,smooth:cs(i).smooth,symbol:"none",lineStyle:{width:1.5,color:be,type:(J==null?void 0:J.style)??"dashed"},itemStyle:{color:be},opacity:(J==null?void 0:J.opacity)??.5})}}const D=s==null?void 0:s.annotations;if(D&&D.length>0&&Array.isArray(S)&&S[0]){const ee=Wd(D,b.textColor),R=Yd(D);if(ee.length>0){const ie=S[0].markLine,ae=(ie==null?void 0:ie.data)??[];S[0].markLine={...ie,silent:!0,symbol:"none",data:[...ae,...ee]}}if(R.length>0){const ie=S[0].markArea,ae=(ie==null?void 0:ie.data)??[];S[0].markArea={silent:!0,data:[...ae,...R]}}}const j=N.useMemo(()=>{if(!(h!=null&&h.length))return[];const R=h.flatMap(be=>be.endDate?[be.date,be.endDate]:[be.date]).map(be=>({[n.field]:be})),ae=Ps([...t,...R],n).slice(t.length);let J=0;return h.map(be=>{const te={...be,date:ae[J++]??be.date};return be.endDate&&(te.endDate=ae[J++]??be.endDate),te})},[h,t,n]),F=Array.isArray(S)?S.map(ee=>ee.name).filter(Boolean):[],B=Md(j,b.textColor,w),U=Ld(j,b.textColor,w);if((B||U.length>0)&&Array.isArray(S)){const ee={type:"line",data:((P=S[0])==null?void 0:P.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};B&&(ee.markLine=B),U.length>0&&(ee.markArea={silent:!0,data:U}),S.push(ee)}const W={tooltip:{trigger:"axis",formatter:ee=>{const R=ee;if(!Array.isArray(R)||R.length===0)return"";let ae=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${T[R[0].dataIndex]??R[0].name}</div>`;for(const J of R)ae+=`<div>${J.marker} ${J.seriesName}: ${ko(J.value,r==null?void 0:r.format)}</div>`;return ae+=Id(j,R[0].name,w),ae+="</div>",ae}},legend:A?{...A,...F.length>0?{data:F}:{}}:void 0,grid:{left:"3%",right:"4%",bottom:zd(),top:"10%",containLabel:!0},xAxis:{type:"category",data:w,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:b.textColor,fontSize:12},axisLabel:{color:b.textColor,fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:b.borderColor}},axisTick:{show:!1}},yAxis:{type:((K=s==null?void 0:s.y)==null?void 0:K.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:b.textColor,fontSize:12},axisLabel:{color:b.textColor,fontSize:12,formatter:ee=>ko(ee,r==null?void 0:r.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:b.splitLineColor,type:"dashed"}}},series:S,...M?{dataZoom:M}:{},animation:!0,animationDuration:300};return d.jsx(yr,{ref:g,option:W,height:l,loading:u,onEvents:_})}),z2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:s,theme:i,height:l=400,loading:u=!1,horizontal:f=!1,onChartClick:h,activeCrossFilter:p,events:y,goalData:g},b){var G,fe,P,K,ee,R,ie;const O=Ar(),w=(s==null?void 0:s.series)&&"field"in s.series,T=w?Hd(t,n):Ps(t,n),E=n.type==="temporal"?Bd(t,n):T,_=(p==null?void 0:p.field)===n.field,S=f||(s==null?void 0:s.orientation)==="horizontal",A=N.useMemo(()=>{if(w){const ae=new Set;return t.filter(J=>{const be=J[n.field];return ae.has(be)?!1:(ae.add(be),!0)}).map(J=>J[n.field])}return t.map(ae=>ae[n.field])},[t,n.field,w]),M=N.useMemo(()=>{if(h)return{contextmenu:ae=>{var ve,je,Ye,nt;const J=ae;if(J.componentType!=="series")return;const be=J.dataIndex!=null?A[J.dataIndex]:void 0,te=be!=null?String(be):J.name;if(te==null||te==="")return;const le=((je=(ve=J.event)==null?void 0:ve.event)==null?void 0:je.clientX)??0,ge=((nt=(Ye=J.event)==null?void 0:Ye.event)==null?void 0:nt.clientY)??0;h(n.field,te,{x:le,y:ge},J.seriesName)}}},[h,n.field,A]),C=(s==null?void 0:s.stacking)==="percent",I=ae=>C?`${ae.toFixed(1)}%`:ko(ae,r==null?void 0:r.format);let D,j=!1;if(s){const ae=Fd(t,{type:s.type,x:{field:n.field},y:r?{field:r.field,type:r.type}:void 0,series:s.series,stacking:s.stacking},i),J=ae.length>1,be=!!s.stacking;j=J;const te=cs(i);D=ae.map((le,ge)=>{const ve=Ud(le.color,le.gradient??s.gradient),je=be&&ge===ae.length-1,Ye=S?te.barBorderRadiusHorizontal:te.barBorderRadius,nt=be?je?Ye:[0,0,0,0]:Ye;return{type:"bar",name:le.name,data:_?le.data.map((tt,Je)=>({value:tt??0,itemStyle:{opacity:String(A[Je])===(p==null?void 0:p.value)?1:.3}})):le.data,barWidth:J&&!be?void 0:"60%",barMinHeight:2,itemStyle:{color:ve??le.color,borderRadius:nt},stack:le.stack,...le.opacity!==void 0?{opacity:le.opacity}:{}}})}else{const ae=(r==null?void 0:r.field)??"",J=t.map(te=>{const le=te[ae];return typeof le=="number"?le:parseFloat(String(le))||0}),be=cs(i);D=[{type:"bar",data:_?J.map((te,le)=>({value:te,itemStyle:{opacity:String(A[le])===(p==null?void 0:p.value)?1:.3}})):J,barWidth:"60%",barMinHeight:2,itemStyle:{color:"#3B82F6",borderRadius:S?be.barBorderRadiusHorizontal:be.barBorderRadius},emphasis:{itemStyle:{color:"#2563EB"}}}]}const F=(s==null?void 0:s.goals)??[];if(F.length>0&&Array.isArray(D)&&!S){if(D[0]){const le=D[0].data.map(ve=>typeof ve=="number"?ve:ve.value),ge=A6(le,F);D[0].data=ge}const ae=Rd(F,T),J=Pd(F);ae.length>0&&D[0]&&(D[0].markLine={silent:!0,symbol:"none",data:ae}),J.length>0&&D[0]&&(D[0].markArea={silent:!0,data:J});const be=jd(F,g);for(const te of be)D.push({type:"line",name:te.name,data:te.data,z:te.z,showSymbol:te.showSymbol,lineStyle:te.lineStyle,itemStyle:{color:te.color}})}const B=s==null?void 0:s.annotations;if(B&&B.length>0&&Array.isArray(D)&&D[0]){const ae=Wd(B,O.textColor),J=Yd(B);if(ae.length>0){const be=D[0].markLine,te=(be==null?void 0:be.data)??[];D[0].markLine={...be,silent:!0,symbol:"none",data:[...te,...ae]}}if(J.length>0){const be=D[0].markArea,te=(be==null?void 0:be.data)??[];D[0].markArea={silent:!0,data:[...te,...J]}}}const U=N.useMemo(()=>{if(!(y!=null&&y.length))return[];const J=y.flatMap(ge=>ge.endDate?[ge.date,ge.endDate]:[ge.date]).map(ge=>({[n.field]:ge})),te=Ps([...t,...J],n).slice(t.length);let le=0;return y.map(ge=>{const ve={...ge,date:te[le++]??ge.date};return ge.endDate&&(ve.endDate=te[le++]??ge.endDate),ve})},[y,t,n]),W=Array.isArray(D)?D.map(ae=>ae.name).filter(Boolean):[],Y=Md(U,O.textColor,T),Q=Ld(U,O.textColor,T);if((Y||Q.length>0)&&Array.isArray(D)){const ae={type:"line",data:((G=D[0])==null?void 0:G.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};Y&&(ae.markLine=Y),Q.length>0&&(ae.markArea={silent:!0,data:Q}),D.push(ae)}const ye={tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:ae=>{const J=ae;if(!Array.isArray(J)||J.length===0)return"";const be=E[J[0].dataIndex]??J[0].name,te=Id(U,J[0].name,T);if(J.length===1){const ge=J[0];return`
|
|
95
|
-
<div style="padding: 8px;">
|
|
96
|
-
<div style="font-weight: 600; margin-bottom: 4px;">${be}</div>
|
|
97
|
-
<div>${ge.marker} ${(r==null?void 0:r.label)||(r==null?void 0:r.field)||ge.seriesName}: ${I(ge.value)}</div>
|
|
98
|
-
${te}
|
|
99
|
-
</div>
|
|
100
|
-
`}const le=J.map(ge=>`<div>${ge.marker} ${ge.seriesName}: ${I(ge.value)}</div>`).join("");return`
|
|
101
|
-
<div style="padding: 8px;">
|
|
102
|
-
<div style="font-weight: 600; margin-bottom: 4px;">${be}</div>
|
|
103
|
-
${le}
|
|
104
|
-
${te}
|
|
105
|
-
</div>
|
|
106
|
-
`}},legend:j?{show:((fe=s==null?void 0:s.legend)==null?void 0:fe.show)!==!1,...((P=s==null?void 0:s.legend)==null?void 0:P.position)==="top"?{top:0}:((K=s==null?void 0:s.legend)==null?void 0:K.position)==="left"?{left:0,orient:"vertical"}:((ee=s==null?void 0:s.legend)==null?void 0:ee.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:O.textColor,fontSize:12},...W.length>0?{data:W}:{}}:void 0,grid:{left:"3%",right:"4%",bottom:zd(),top:"10%",containLabel:!0},xAxis:S?{type:((R=s==null?void 0:s.y)==null?void 0:R.scale)==="log"?"log":"value",axisLabel:{color:O.textColor,fontSize:12,formatter:ae=>I(ae)},axisLine:{show:!1},splitLine:{lineStyle:{color:O.splitLineColor,type:"dashed"}}}:{type:"category",data:T,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:O.textColor,fontSize:12},axisLabel:{color:O.textColor,fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:O.borderColor}},axisTick:{show:!1}},yAxis:S?{type:"category",data:T,axisLabel:{color:O.textColor,fontSize:12},axisLine:{show:!1},axisTick:{show:!1}}:{type:((ie=s==null?void 0:s.y)==null?void 0:ie.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:O.textColor,fontSize:12},...C?{max:100}:{},axisLabel:{color:O.textColor,fontSize:12,formatter:ae=>I(ae)},axisLine:{show:!1},splitLine:{lineStyle:{color:O.splitLineColor,type:"dashed"}}},series:D,animation:!0,animationDuration:300};return d.jsx(yr,{ref:b,option:ye,height:l,loading:u,onEvents:M})}),W2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:s,theme:i,height:l=400,loading:u=!1,onChartClick:f,events:h,goalData:p},y){var W,Y,Q,re,ye,G,fe,P;const g=Ar(),b=(s==null?void 0:s.series)&&"field"in s.series,O=b?Hd(t,n):Ps(t,n),w=n.type==="temporal"?Bd(t,n):O,T=(s==null?void 0:s.stacking)==="percent",E=N.useMemo(()=>{if(b){const K=new Set;return t.filter(ee=>{const R=ee[n.field];return K.has(R)?!1:(K.add(R),!0)}).map(ee=>ee[n.field])}return t.map(K=>K[n.field])},[t,n.field,b]),_=N.useMemo(()=>{if(f)return{contextmenu:K=>{var be,te,le,ge;const ee=K;if(ee.componentType!=="series")return;const R=ee.dataIndex!=null?E[ee.dataIndex]:void 0,ie=R!=null?String(R):ee.name;if(ie==null||ie==="")return;const ae=((te=(be=ee.event)==null?void 0:be.event)==null?void 0:te.clientX)??0,J=((ge=(le=ee.event)==null?void 0:le.event)==null?void 0:ge.clientY)??0;f(n.field,ie,{x:ae,y:J},ee.seriesName)}}},[f,n.field,E]);let S,A,M;if(s){const K=Fd(t,{type:s.type,x:{field:n.field},y:r?{field:r.field,type:r.type}:void 0,series:s.series,stacking:s.stacking},i),ee=cs(i);S=K.map(R=>{const ie=Ud(R.color,R.gradient??s.gradient??!0);return{type:"line",name:R.name,data:R.data,smooth:ee.smooth,symbol:"none",lineStyle:{width:2,color:R.color,type:R.style==="dashed"?"dashed":R.style==="dotted"?"dotted":"solid"},itemStyle:{color:R.color},areaStyle:{color:ie??R.color},stack:R.stack,...R.opacity!==void 0?{opacity:R.opacity}:{}}}),K.length>1&&(A={show:((W=s.legend)==null?void 0:W.show)!==!1,...((Y=s.legend)==null?void 0:Y.position)==="top"?{top:0}:((Q=s.legend)==null?void 0:Q.position)==="left"?{left:0,orient:"vertical"}:((re=s.legend)==null?void 0:re.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:g.textColor,fontSize:12}}),(ye=s.interactions)!=null&&ye.zoom&&(M=[{type:"inside",start:0,end:100},{type:"slider",start:0,end:100,bottom:0}])}else{const K=(r==null?void 0:r.field)??"";S=[{type:"line",data:t.map(R=>{const ie=R[K];return typeof ie=="number"?ie:parseFloat(String(ie))||0}),smooth:cs(i).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 C=(s==null?void 0:s.goals)??[];if(C.length>0&&Array.isArray(S)){const K=B2(((G=S[0])==null?void 0:G.data)??[],C);K&&S[0]&&(S[0].lineStyle={...S[0].lineStyle,color:K},S[0].itemStyle={color:K});const ee=Rd(C,O),R=Pd(C);if(ee.length>0&&S[0]){const ae=S[0].markLine,J=(ae==null?void 0:ae.data)??[];S[0].markLine={...ae,silent:!0,symbol:"none",data:[...J,...ee]}}R.length>0&&S[0]&&(S[0].markArea={silent:!0,data:R});const ie=jd(C,p);for(const ae of ie)S.push({type:"line",name:ae.name,data:ae.data,z:ae.z,showSymbol:ae.showSymbol,lineStyle:ae.lineStyle,itemStyle:{color:ae.color}})}const I=s==null?void 0:s.annotations;if(I&&I.length>0&&Array.isArray(S)&&S[0]){const K=Wd(I,g.textColor),ee=Yd(I);if(K.length>0){const R=S[0].markLine,ie=(R==null?void 0:R.data)??[];S[0].markLine={...R,silent:!0,symbol:"none",data:[...ie,...K]}}if(ee.length>0){const R=S[0].markArea,ie=(R==null?void 0:R.data)??[];S[0].markArea={silent:!0,data:[...ie,...ee]}}}const D=N.useMemo(()=>{if(!(h!=null&&h.length))return[];const ee=h.flatMap(J=>J.endDate?[J.date,J.endDate]:[J.date]).map(J=>({[n.field]:J})),ie=Ps([...t,...ee],n).slice(t.length);let ae=0;return h.map(J=>{const be={...J,date:ie[ae++]??J.date};return J.endDate&&(be.endDate=ie[ae++]??J.endDate),be})},[h,t,n]),j=Array.isArray(S)?S.map(K=>K.name).filter(Boolean):[],F=Md(D,g.textColor,O),B=Ld(D,g.textColor,O);if((F||B.length>0)&&Array.isArray(S)){const K={type:"line",data:((fe=S[0])==null?void 0:fe.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};F&&(K.markLine=F),B.length>0&&(K.markArea={silent:!0,data:B}),S.push(K)}const U={tooltip:{trigger:"axis",formatter:K=>{const ee=K;if(!Array.isArray(ee)||ee.length===0)return"";let ie=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${w[ee[0].dataIndex]??ee[0].name}</div>`;for(const ae of ee){const J=T?`${ae.value.toFixed(1)}%`:ko(ae.value,r==null?void 0:r.format);ie+=`<div>${ae.marker} ${ae.seriesName}: ${J}</div>`}return ie+=Id(D,ee[0].name,O),ie+="</div>",ie}},legend:A?{...A,...j.length>0?{data:j}:{}}:void 0,grid:{left:"3%",right:"4%",bottom:zd(),top:"10%",containLabel:!0},xAxis:{type:"category",data:O,boundaryGap:!1,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:g.textColor,fontSize:12},axisLabel:{color:g.textColor,fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:g.borderColor}},axisTick:{show:!1}},yAxis:{type:((P=s==null?void 0:s.y)==null?void 0:P.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:g.textColor,fontSize:12},...T?{max:100}:{},axisLabel:{color:g.textColor,fontSize:12,formatter:K=>T?`${K}%`:ko(K,r==null?void 0:r.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:g.splitLineColor,type:"dashed"}}},series:S,...M?{dataZoom:M}:{},animation:!0,animationDuration:300};return d.jsx(yr,{ref:y,option:U,height:l,loading:u,onEvents:_})}),Y2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:s,theme:i,height:l=400,loading:u=!1,onChartClick:f,activeCrossFilter:h},p){var _,S,A,M;const y=Ar(),g=(h==null?void 0:h.field)===n.field,b=N.useMemo(()=>t.map(C=>C[n.field]),[t,n.field]),O=N.useMemo(()=>{if(f)return{contextmenu:C=>{var U,W,Y,Q;const I=C;if(I.componentType!=="series")return;const D=I.dataIndex!=null?b[I.dataIndex]:void 0,j=D!=null?String(D):I.name;if(j==null||j==="")return;const F=((W=(U=I.event)==null?void 0:U.event)==null?void 0:W.clientX)??0,B=((Q=(Y=I.event)==null?void 0:Y.event)==null?void 0:Q.clientY)??0;f(n.field,j,{x:F,y:B})}}},[f,n.field,b]),w=t.map((C,I)=>{const D=C[r.field],j=typeof D=="number"?D:parseFloat(String(D))||0;return{name:String(C[n.field]??""),value:j,itemStyle:{color:da(I,void 0,i)}}}),T=C=>{if(r.format){if(r.format.includes("$"))return`$${C.toLocaleString()}`;if(r.format.includes("%"))return`${C.toFixed(1)}%`}return C.toLocaleString()},E={tooltip:{trigger:"item",formatter:C=>{const I=C;return`
|
|
107
|
-
<div style="padding: 8px;">
|
|
108
|
-
<div style="font-weight: 600; margin-bottom: 4px;">${I.name}</div>
|
|
109
|
-
<div>${I.marker} ${r.label||r.field}: ${T(I.value)}</div>
|
|
110
|
-
<div style="color: ${y.textColor}; font-size: 12px;">${I.percent.toFixed(1)}%</div>
|
|
111
|
-
</div>
|
|
112
|
-
`}},legend:{show:((_=s==null?void 0:s.legend)==null?void 0:_.show)!==!1,type:"scroll",...((S=s==null?void 0:s.legend)==null?void 0:S.position)==="top"?{top:0,orient:"horizontal",left:"center"}:((A=s==null?void 0:s.legend)==null?void 0:A.position)==="bottom"?{bottom:0,orient:"horizontal",left:"center"}:((M=s==null?void 0:s.legend)==null?void 0:M.position)==="left"?{left:0,orient:"vertical",top:"center"}:{orient:"vertical",right:"3%",top:"center"},textStyle:{color:y.textColor,fontSize:12,width:120,overflow:"truncate"},pageTextStyle:{color:y.textColor}},series:[{type:"pie",radius:["40%","60%"],center:["35%","50%"],avoidLabelOverlap:!0,itemStyle:{borderRadius:cs(i).pieBorderRadius,borderColor:y.surfaceColor,borderWidth:2},label:{show:!1},emphasis:{label:{show:!0,fontSize:14,fontWeight:"bold"}},labelLine:{show:!1},data:w.map(C=>({...C,itemStyle:{...C.itemStyle,...g&&(h==null?void 0:h.value)!==C.name?{opacity:.3}:{}}}))}],animation:!0,animationDuration:300};return d.jsx(yr,{ref:p,option:E,height:l,loading:u,onEvents:O})}),$2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,centerValue:s,chartConfig:i,theme:l,height:u=400,loading:f=!1,onChartClick:h,activeCrossFilter:p},y){var M,C,I,D,j;const g=Ar(),b=(p==null?void 0:p.field)===n.field,O=N.useMemo(()=>t.map(F=>F[n.field]),[t,n.field]),w=N.useMemo(()=>{if(h)return{contextmenu:F=>{var re,ye,G,fe;const B=F;if(B.componentType!=="series")return;const U=B.dataIndex!=null?O[B.dataIndex]:void 0,W=U!=null?String(U):B.name;if(W==null||W==="")return;const Y=((ye=(re=B.event)==null?void 0:re.event)==null?void 0:ye.clientX)??0,Q=((fe=(G=B.event)==null?void 0:G.event)==null?void 0:fe.clientY)??0;h(n.field,W,{x:Y,y:Q})}}},[h,n.field,O]),T=t.map((F,B)=>{const U=F[r.field],W=typeof U=="number"?U:parseFloat(String(U))||0;return{name:String(F[n.field]??""),value:W,itemStyle:{color:da(B,void 0,l)}}});let E=null;if(s)if(s.field==="total"||!s.field)E=T.reduce((F,B)=>F+B.value,0);else{const F=(M=t[0])==null?void 0:M[s.field];E=typeof F=="number"?F:parseFloat(String(F))||null}const _=(F,B)=>{if(B){if(B.includes("$"))return`$${F.toLocaleString()}`;if(B.includes("%"))return`${F.toFixed(1)}%`}return F.toLocaleString()},S=E!==null?s!=null&&s.label?`{value|${_(E,(s==null?void 0:s.format)||r.format)}}
|
|
113
|
-
{label|${s.label}}`:`{value|${_(E,(s==null?void 0:s.format)||r.format)}}`:"",A={tooltip:{trigger:"item",formatter:F=>{const B=F;return`
|
|
114
|
-
<div style="padding: 8px;">
|
|
115
|
-
<div style="font-weight: 600; margin-bottom: 4px;">${B.name}</div>
|
|
116
|
-
<div>${B.marker} ${r.label||r.field}: ${_(B.value,r.format)}</div>
|
|
117
|
-
<div style="color: ${g.textColor}; font-size: 12px;">${B.percent.toFixed(1)}%</div>
|
|
118
|
-
</div>
|
|
119
|
-
`}},legend:{show:((C=i==null?void 0:i.legend)==null?void 0:C.show)!==!1,type:"scroll",...((I=i==null?void 0:i.legend)==null?void 0:I.position)==="top"?{top:0,orient:"horizontal",left:"center"}:((D=i==null?void 0:i.legend)==null?void 0:D.position)==="bottom"?{bottom:0,orient:"horizontal",left:"center"}:((j=i==null?void 0:i.legend)==null?void 0:j.position)==="left"?{left:0,orient:"vertical",top:"center"}:{orient:"vertical",right:"3%",top:"center"},textStyle:{color:g.textColor,fontSize:12,width:120,overflow:"truncate"},pageTextStyle:{color:g.textColor}},series:[{type:"pie",radius:["40%","60%"],center:["35%","50%"],avoidLabelOverlap:!0,itemStyle:{borderRadius:cs(l).pieBorderRadius,borderColor:g.surfaceColor,borderWidth:2},label:{show:E!==null,position:"center",formatter:S,rich:{value:{fontSize:22,fontWeight:"bold",color:g.textColor,lineHeight:30},label:{fontSize:12,color:g.textColor,lineHeight:20}}},emphasis:{label:{show:!0,fontSize:14,fontWeight:"bold"},scaleSize:5},labelLine:{show:!1},data:T.map(F=>({...F,itemStyle:{...F.itemStyle,...b&&(p==null?void 0:p.value)!==F.name?{opacity:.3}:{}}}))}],animation:!0,animationDuration:300};return d.jsx(yr,{ref:y,option:A,height:u,loading:f,onEvents:w})}),B6=5,H6=50;function d0(e){if(e==null)return null;const t=typeof e=="number"?e:parseFloat(String(e));return isNaN(t)?null:t}function U6(e,t,n,r,s){return n===t?(r+s)/2:r+(e-t)/(n-t)*(s-r)}function z6(e,t,n,r){const{size:s,group:i}=r,l=(s==null?void 0:s.min)??B6,u=(s==null?void 0:s.max)??H6,f=[];for(const b of e){const O=d0(b[t]),w=d0(b[n]);if(O===null||w===null)continue;let T=null;if(s&&(T=d0(b[s.field]),T===null))continue;const E=i?String(b[i.field]??"Other"):"data";f.push({x:O,y:w,sizeVal:T,groupVal:E})}let h=1/0,p=-1/0;if(s){for(const b of f)b.sizeVal!==null&&(h=Math.min(h,b.sizeVal),p=Math.max(p,b.sizeVal));isFinite(h)||(h=0,p=0)}const y=new Map;for(const b of f){const O=y.get(b.groupVal);O?O.push(b):y.set(b.groupVal,[b])}if(y.size===0)return{series:[{name:"data",data:[],symbolSizes:s?[]:void 0}]};const g=[];for(const[b,O]of y){const w=[],T=[];for(const E of O)s&&E.sizeVal!==null?(w.push([E.x,E.y,E.sizeVal]),T.push(U6(E.sizeVal,h,p,l,u))):w.push([E.x,E.y]);g.push({name:b,data:w,symbolSizes:s?T:void 0})}return{series:g}}function W6(e){const t=e.length;if(t<2)return null;let n=0,r=0,s=0,i=0;for(const[T,E]of e)n+=T,r+=E,s+=T*E,i+=T*T;const l=t*i-n*n;if(l===0)return null;const u=(t*s-n*r)/l,f=(r-u*n)/t,h=r/t;let p=0,y=0;for(const[T,E]of e){const _=u*T+f;p+=(E-_)**2,y+=(E-h)**2}const g=y===0?1:1-p/y,b=e.map(([T])=>T),O=Math.min(...b),w=Math.max(...b);return{slope:u,intercept:f,rSquared:g,line:[[O,u*O+f],[w,u*w+f]]}}const q2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:s,theme:i,height:l=400,loading:u=!1,onChartClick:f,activeCrossFilter:h},p){const y=Ar(),g=N.useMemo(()=>{var M,C,I;const O={size:s==null?void 0:s.size,group:s==null?void 0:s.group},{series:w}=z6(t,n.field,r.field,O),T=(D,j)=>{if(j.format){if(j.format.includes("$"))return`$${D.toLocaleString()}`;if(j.format.includes("%"))return`${D.toFixed(1)}%`}return D.toLocaleString()},E=[],_=[];w.forEach((D,j)=>{const F=da(j,w.length===1&&typeof(s==null?void 0:s.color)=="string"?s.color:void 0,i),B=D.symbolSizes;if(E.push({type:"scatter",name:D.name,data:D.data,symbolSize:B?(U,W)=>B[W.dataIndex]??10:10,itemStyle:{color:F},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.3)"}}}),s!=null&&s.regression&&D.data.length>=2){const U=D.data.map(Y=>[Y[0],Y[1]]),W=W6(U);if(W){E.push({type:"line",name:`${D.name} trend`,data:W.line,showSymbol:!1,lineStyle:{color:F,type:"dashed",opacity:.6,width:2},itemStyle:{color:F},tooltip:{show:!1},silent:!0});const Y=[];if(s.regression.show_equation){const Q=W.intercept>=0?"+":"-";Y.push(`y = ${W.slope.toFixed(2)}x ${Q} ${Math.abs(W.intercept).toFixed(2)}`)}if(s.regression.show_r_squared&&Y.push(`R² = ${W.rSquared.toFixed(3)}`),Y.length>0){const Q=j*20;_.push({type:"text",left:"70%",top:`${12+Q}%`,style:{text:Y.join(" "),fill:F,fontSize:11,fontFamily:"monospace"}})}}}});const S=((M=s==null?void 0:s.size)==null?void 0:M.label)??((C=s==null?void 0:s.size)==null?void 0:C.field);return{tooltip:{trigger:"item",formatter:D=>{const j=D,F=j.value[0]??0,B=j.value[1]??0,U=j.value[2];let W='<div style="padding: 8px;">';return w.length>1&&(W+=`<div style="font-weight: 600; margin-bottom: 4px;">${j.seriesName}</div>`),W+=`<div>${j.marker} ${n.label||n.field}: ${T(F,n)}</div>`,W+=`<div>${j.marker} ${r.label||r.field}: ${T(B,r)}</div>`,S&&U!=null&&(W+=`<div>${j.marker} ${S}: ${U.toLocaleString()}</div>`),W+="</div>",W}},legend:w.length>1?{show:((I=s==null?void 0:s.legend)==null?void 0:I.show)!==!1,top:0,data:w.map(D=>D.name)}:void 0,grid:{left:"3%",right:"4%",bottom:"3%",top:w.length>1?"15%":"10%",containLabel:!0},xAxis:{type:"value",name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:y.textColor,fontSize:12},axisLabel:{color:y.textColor,fontSize:12,formatter:D=>T(D,n)},axisLine:{lineStyle:{color:y.borderColor}},splitLine:{lineStyle:{color:y.splitLineColor,type:"dashed"}}},yAxis:{type:"value",name:r.label,nameLocation:"middle",nameGap:50,nameTextStyle:{color:y.textColor,fontSize:12},axisLabel:{color:y.textColor,fontSize:12,formatter:D=>T(D,r)},axisLine:{show:!1},splitLine:{lineStyle:{color:y.splitLineColor,type:"dashed"}}},series:E,graphic:_.length>0?_:void 0,animation:!0,animationDuration:300}},[t,n,r,s,i,y]),b=N.useMemo(()=>{if(f)return{contextmenu:O=>{var S,A,M,C,I;const w=O;if(w.componentType!=="series")return;const T=(S=w.value)==null?void 0:S[0];if(T==null)return;const E=((M=(A=w.event)==null?void 0:A.event)==null?void 0:M.clientX)??0,_=((I=(C=w.event)==null?void 0:C.event)==null?void 0:I.clientY)??0;f(n.field,String(T),{x:E,y:_},w.seriesName)}}},[f,n.field]);return d.jsx(yr,{ref:p,option:g,height:l,loading:u,onEvents:b})});var Di=pd();function f0(e,t){if(e.length===0)return 0;switch(t){case"sum":return e.reduce((n,r)=>n+r,0);case"avg":return e.reduce((n,r)=>n+r,0)/e.length;case"min":return e.reduce((n,r)=>n<r?n:r);case"max":return e.reduce((n,r)=>n>r?n:r);case"count":return e.length}}function Y6(e,t){return t.map(n=>String(e[n]??"")).join("\0")}function $6(e,t){if(e.length===0)return{columnValues:[],groups:[],grandTotals:{}};const{rows:n,columns:r,values:s}=t,i=n[0],l=n.slice(1),u=[...new Set(e.map(y=>String(y[r]??"")))].sort((y,g)=>y.localeCompare(g,void 0,{numeric:!0})),f=new Map;for(const y of e){const g=String(y[i]??"");f.has(g)||f.set(g,[]),f.get(g).push(y)}const h=[];for(const[y,g]of f){const b=new Map;for(const T of g){const E=l.length>0?Y6(T,l):"";b.has(E)||b.set(E,[]),b.get(E).push(T)}const O=[];for(const[,T]of b){const E={};for(const S of l)E[S]=String(T[0][S]??"");const _={};for(const S of s){const A=S.aggregate??"sum";for(const M of u){const C=`${S.field}:${M}`,D=T.filter(j=>String(j[r]??"")===M).map(j=>j[S.field]).filter(j=>typeof j=="number");_[C]=D.length>0?f0(D,A):null}}O.push({labels:E,values:_})}l.length>0&&O.sort((T,E)=>{const _=T.labels[l[0]]??"",S=E.labels[l[0]]??"";return _.localeCompare(S)});const w={};for(const T of s){const E=T.aggregate??"sum";for(const _ of u){const S=`${T.field}:${_}`,A=O.map(M=>M.values[S]).filter(M=>M!==null);A.length>0&&(w[S]=E==="avg"?A.reduce((M,C)=>M+C,0)/A.length:f0(A,E))}}h.push({key:y,rows:O,subtotals:w})}const p={};for(const y of s){const g=y.aggregate??"sum";for(const b of u){const O=`${y.field}:${b}`,w=h.map(T=>T.subtotals[O]).filter(T=>T!==void 0);w.length>0&&(p[O]=g==="avg"?w.reduce((T,E)=>T+E,0)/w.length:f0(w,g))}}return{columnValues:u,groups:h,grandTotals:p}}function q6(e,t,n,r="#4CAF50",s=.5){if(e===null||t===n)return"transparent";const i=(e-t)/(n-t);if(i<=0)return"transparent";const l=Math.round(i*s*100)/100,u=r.replace("#",""),f=parseInt(u.substring(0,2),16),h=parseInt(u.substring(2,4),16),p=parseInt(u.substring(4,6),16);return`rgba(${f}, ${h}, ${p}, ${l})`}const V6=50,Q6=[25,50,100];function G6({text:e,anchorRef:t,onClose:n}){const r=N.useRef(null),[s,i]=N.useState(null),[l,u]=N.useState(!1),f=async h=>{h.stopPropagation(),await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),1500)};return N.useLayoutEffect(()=>{if(t.current){const h=t.current.getBoundingClientRect();i({top:h.bottom+4,left:h.left})}},[t]),N.useEffect(()=>{const h=y=>{r.current&&!r.current.contains(y.target)&&n()},p=y=>{y.key==="Escape"&&n()};return document.addEventListener("mousedown",h),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",p)}},[n]),s?Di.createPortal(d.jsxs("div",{ref:r,className:"rounded-lg shadow-lg text-sm",style:{position:"fixed",top:s.top,left:s.left,zIndex:9999,background:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)",maxWidth:400,maxHeight:200,overflow:"auto",padding:"8px 12px",whiteSpace:"pre-wrap",wordBreak:"break-word",color:"var(--yc-color-text)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},children:[d.jsx("button",{onClick:f,style:{float:"right",background:"none",border:"none",cursor:"pointer",padding:"2px 4px",marginLeft:8,borderRadius:4,color:l?"var(--yc-color-primary)":"var(--yc-color-text-secondary)"},title:"Copy to clipboard",children:l?d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("polyline",{points:"20 6 9 17 4 12"})}):d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),d.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),e]}),document.body):null}function Wl(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 K6({data:e,pivotConfig:t,height:n}){var M,C;const[r,s]=N.useState(new Set),i=N.useMemo(()=>$6(e,t),[e,t]),l=t.rows,u=t.values,f=t.subtotals!==!1,h=t.grandTotals!==!1,p=((M=t.heatmap)==null?void 0:M.color)??"#4CAF50",y=((C=t.heatmap)==null?void 0:C.scope)??"column",g=N.useMemo(()=>new Set(u.filter(I=>I.heatmap).map(I=>I.field)),[u]),b=N.useMemo(()=>{if(g.size===0)return new Map;const I=new Map;if(y==="global"){let D=1/0,j=-1/0;for(const F of i.groups)for(const B of F.rows)for(const[U,W]of Object.entries(B.values)){const Y=U.split(":")[0];W!==null&&g.has(Y)&&(W<D&&(D=W),W>j&&(j=W))}if(D!==1/0){for(const F of u)if(g.has(F.field))for(const B of i.columnValues)I.set(`${F.field}:${B}`,{min:D,max:j})}}else for(const D of u)if(g.has(D.field))for(const j of i.columnValues){const F=`${D.field}:${j}`;let B=1/0,U=-1/0;for(const W of i.groups)for(const Y of W.rows){const Q=Y.values[F];Q!=null&&(Q<B&&(B=Q),Q>U&&(U=Q))}B!==1/0&&I.set(F,{min:B,max:U})}return I},[i,g,y,u]),O=N.useMemo(()=>{const I=new Map;for(const D of u)I.set(D.field,D.format);return I},[u]),w=I=>{s(D=>{const j=new Set(D);return j.has(I)?j.delete(I):j.add(I),j})},T=[];for(const I of i.columnValues)if(u.length===1)T.push({cellKey:`${u[0].field}:${I}`,label:I});else for(const D of u)T.push({cellKey:`${D.field}:${I}`,label:`${I} - ${fa(D.field)}`});const E=l.map(I=>fa(I)).join(" → "),_=l.length>1,S=_?2:1,A=(I,D)=>{const j=I.split(":")[0];if(!g.has(j))return"transparent";const F=b.get(I);return F?q6(D,F.min,F.max,p):"transparent"};return e.length===0?d.jsx("div",{className:"h-full overflow-auto",style:{maxHeight:n},children:d.jsx("div",{className:"text-center py-8",style:{color:"var(--yc-color-text-secondary)"},children:"No data"})}):d.jsx("div",{className:"h-full overflow-auto",style:{maxHeight:n},children:d.jsxs("table",{className:"min-w-full text-sm",style:{borderCollapse:"collapse"},children:[d.jsx("thead",{className:"sticky top-0 z-[2]",style:{background:"var(--yc-color-surface-hover)"},children:d.jsxs("tr",{children:[_?d.jsx("th",{colSpan:2,className:"px-4 py-3 text-left font-medium",style:{color:"var(--yc-color-text-secondary)",borderBottom:"1px solid var(--yc-color-border)"},children:E}):d.jsx("th",{className:"px-4 py-3 text-left font-medium",style:{color:"var(--yc-color-text-secondary)",borderBottom:"1px solid var(--yc-color-border)"},children:E}),T.map(I=>d.jsx("th",{className:"px-4 py-3 text-right font-medium",style:{color:"var(--yc-color-text-secondary)",borderBottom:"1px solid var(--yc-color-border)"},children:I.label},I.cellKey))]})}),d.jsx("tbody",{children:i.groups.map(I=>{const D=r.has(I.key),j=f&&I.rows.length>1;return d.jsxs(N.Fragment,{children:[d.jsxs("tr",{className:"cursor-pointer select-none",style:{background:"var(--yc-color-surface-hover)"},onClick:()=>w(I.key),children:[d.jsxs("td",{colSpan:S,className:"px-4 py-2 font-bold",style:{color:"var(--yc-color-text)",borderBottom:"1px solid var(--yc-color-border)"},children:[d.jsx("span",{className:"mr-1 inline-block w-4 text-center",style:{color:"var(--yc-color-text-muted)"},children:D?"▶":"▼"}),I.key]}),T.map(F=>d.jsx("td",{className:"px-4 py-2",style:{borderBottom:"1px solid var(--yc-color-border)"}},F.cellKey))]}),!D&&I.rows.map((F,B)=>d.jsxs("tr",{children:[_?d.jsxs(d.Fragment,{children:[d.jsx("td",{className:"px-4 py-2",style:{borderBottom:"1px solid var(--yc-color-border)"}}),d.jsx("td",{className:"px-4 py-2",style:{color:"var(--yc-color-text)",borderBottom:"1px solid var(--yc-color-border)"},children:Object.values(F.labels).join(", ")})]}):d.jsx("td",{className:"px-4 py-2",style:{color:"var(--yc-color-text)",borderBottom:"1px solid var(--yc-color-border)"}}),T.map(U=>{const W=F.values[U.cellKey]??null,Y=U.cellKey.split(":")[0];return d.jsx("td",{className:"px-4 py-2 text-right",style:{color:"var(--yc-color-text)",borderBottom:"1px solid var(--yc-color-border)",backgroundColor:A(U.cellKey,W)},children:Wl(W,O.get(Y))},U.cellKey)})]},B)),!D&&j&&d.jsxs("tr",{style:{background:"var(--yc-color-surface-hover)"},children:[d.jsxs("td",{colSpan:S,className:"px-4 py-2 font-medium italic",style:{color:"var(--yc-color-text-secondary)",borderBottom:"1px solid var(--yc-color-border)"},children:["Totals for ",I.key]}),T.map(F=>{const B=I.subtotals[F.cellKey]??null,U=F.cellKey.split(":")[0];return d.jsx("td",{className:"px-4 py-2 text-right font-medium",style:{color:"var(--yc-color-text)",borderBottom:"1px solid var(--yc-color-border)"},children:Wl(B,O.get(U))},F.cellKey)})]})]},I.key)})}),h&&d.jsx("tfoot",{className:"sticky bottom-0 z-[2]",style:{background:"var(--yc-color-surface-hover)"},children:d.jsxs("tr",{style:{borderTop:"2px solid var(--yc-color-border)"},children:[d.jsx("td",{colSpan:S,className:"px-4 py-3 font-bold",style:{color:"var(--yc-color-text)"},children:"Grand totals"}),T.map(I=>{const D=i.grandTotals[I.cellKey]??null,j=I.cellKey.split(":")[0];return d.jsx("td",{className:"px-4 py-3 text-right font-bold",style:{color:"var(--yc-color-text)"},children:Wl(D,O.get(j))},I.cellKey)})]})})]})})}function om({data:e,columns:t,chartConfig:n,height:r=400,loading:s=!1,onRowClick:i,serverPaginated:l=!1,totalCount:u,serverSummaryValues:f,onServerPageChange:h,exportUrl:p}){var Fe,Be,pt;const[y,g]=N.useState(null),b=N.useRef(null),O=N.useRef(null),[w,T]=N.useState({type:"none"}),[E,_]=N.useState({}),S=N.useRef(null),A=N.useRef(!1),M=N.useCallback((de,_e)=>{_e.preventDefault(),_e.stopPropagation();const Ee=_e.target.closest("th"),He=(Ee==null?void 0:Ee.offsetWidth)??150;S.current={field:de,startX:_e.clientX,startWidth:He};const Ue=jt=>{if(!S.current)return;const $e=jt.clientX-S.current.startX,ft=Math.max(60,S.current.startWidth+$e);_(De=>({...De,[S.current.field]:ft}))},vt=()=>{S.current=null,A.current=!0,setTimeout(()=>{A.current=!1},0),document.removeEventListener("mousemove",Ue),document.removeEventListener("mouseup",vt),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",Ue),document.addEventListener("mouseup",vt),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[]),C=N.useCallback((de,_e,Ee)=>{const He=Ue=>Ue==null?"":String(Ue);if(de.type==="all"){const Ue=_e.map(jt=>jt.label).join(" "),vt=Ee.map(jt=>_e.map($e=>He(jt[$e.field])).join(" ")).join(`
|
|
120
|
-
`);return`${Ue}
|
|
121
|
-
${vt}`}if(de.type==="column"&&de.column){const Ue=_e.find($e=>$e.field===de.column),vt=(Ue==null?void 0:Ue.label)??de.column,jt=Ee.map($e=>He($e[de.column])).join(`
|
|
122
|
-
`);return`${vt}
|
|
123
|
-
${jt}`}if(de.type==="row"&&de.rows){const Ue=_e.map(jt=>jt.label).join(" "),vt=Ee.filter((jt,$e)=>de.rows.has($e)).map(jt=>_e.map($e=>He(jt[$e.field])).join(" ")).join(`
|
|
124
|
-
`);return`${Ue}
|
|
125
|
-
${vt}`}return""},[]),I=N.useRef(w);I.current=w;const D=N.useCallback((de,_e)=>{A.current||(_e.shiftKey||_e.metaKey||_e.ctrlKey)&&(_e.preventDefault(),_e.stopPropagation(),T({type:"column",column:de}))},[]),j=N.useCallback((de,_e)=>{_e.stopPropagation(),T(Ee=>{const He=new Set(Ee.type==="row"&&(_e.shiftKey||_e.metaKey)?Ee.rows:void 0);return He.has(de)?(He.delete(de),He.size===0?{type:"none"}:{type:"row",rows:He}):(He.add(de),{type:"row",rows:He})})},[]),F=de=>{var _e;return!!(w.type==="all"||w.type==="row"&&((_e=w.rows)!=null&&_e.has(de)))},B=(de,_e)=>{var Ee;return!!(w.type==="all"||w.type==="column"&&w.column===_e||w.type==="row"&&((Ee=w.rows)!=null&&Ee.has(de)))},[U,W]=N.useState(((Fe=n==null?void 0:n.sort)==null?void 0:Fe.field)??null),[Y,Q]=N.useState(((Be=n==null?void 0:n.sort)==null?void 0:Be.direction)??(n!=null&&n.sort?"asc":null)),[re,ye]=N.useState([]),G=N.useRef([]),fe=n==null?void 0:n.pagination,P=(fe==null?void 0:fe.enabled)!==!1&&fe!=null,K=(fe==null?void 0:fe.mode)??"paginated",ee=(fe==null?void 0:fe.page_size)??V6,[R,ie]=N.useState(0),[ae,J]=N.useState(ee),[be,te]=N.useState(ee),le=N.useRef(null),ge=N.useMemo(()=>{let de;n!=null&&n.columns&&n.columns.length>0?de=n.columns.map(Ee=>({field:Ee.field,label:Ee.label??fa(Ee.field),format:Ee.format,sticky:Ee.sticky??!1,stickyIndex:-1,summary:Ee.summary,overflow:Ee.overflow,font:Ee.font})):de=t.map(Ee=>({field:Ee.name,label:fa(Ee.name),format:void 0,sticky:!1,stickyIndex:-1,summary:void 0}));let _e=0;return de.map(Ee=>Ee.sticky&&_e<3?{...Ee,stickyIndex:_e++}:{...Ee,sticky:!1,stickyIndex:-1})},[n==null?void 0:n.columns,t]),ve=N.useMemo(()=>ge.filter(de=>de.sticky).length,[ge]),je=N.useCallback(de=>_e=>{G.current[de]=_e},[]);N.useLayoutEffect(()=>{if(ve===0){ye([]);return}const de=()=>{var Ue;const Ee=[];let He=0;for(let vt=0;vt<ve;vt++)Ee.push(He),He+=((Ue=G.current[vt])==null?void 0:Ue.offsetWidth)??0;ye(Ee)};if(de(),typeof ResizeObserver>"u")return;const _e=new ResizeObserver(de);for(let Ee=0;Ee<ve;Ee++){const He=G.current[Ee];He&&_e.observe(He)}return()=>_e.disconnect()},[ve,ge,s]);const Ye=N.useCallback(de=>{A.current||(U===de?Y==="asc"?Q("desc"):Y==="desc"?(W(null),Q(null)):Q("asc"):(W(de),Q("asc")),l&&ie(0))},[U,Y,l]),nt=N.useRef(h);nt.current=h;const tt=N.useRef("");N.useEffect(()=>{if(!l||!nt.current)return;const de=`${R}:${ae}:${U}:${Y}`;de!==tt.current&&(tt.current=de,nt.current(R,ae,U??void 0,Y??void 0))},[l,R,ae,U,Y]);const Je=N.useMemo(()=>l||!U||!Y?e:[...e].sort((de,_e)=>{const Ee=de[U],He=_e[U];if(Ee==null)return 1;if(He==null)return-1;let Ue=0;return typeof Ee=="number"&&typeof He=="number"?Ue=Ee-He:Ue=String(Ee).localeCompare(String(He)),Y==="asc"?Ue:-Ue}),[e,U,Y,l]);N.useEffect(()=>{l||(ie(0),te(ae))},[e,U,Y,ae,l]);const rt=l?u??e.length:Je.length,ut=P?Math.ceil(rt/ae):1,pe=N.useMemo(()=>l?e:P?K==="infinite_scroll"?Je.slice(0,be):Je.slice(R*ae,(R+1)*ae):Je,[Je,P,K,R,ae,be,l,e]),me=N.useCallback(de=>{const _e=de.metaKey||de.ctrlKey;if(_e&&de.key==="a")de.preventDefault(),T({type:"all"});else if(_e&&de.key==="c"){if(I.current.type==="none")return;de.preventDefault();const Ee=C(I.current,ge,Je);Ee&&navigator.clipboard.writeText(Ee)}else de.key==="Escape"&&T({type:"none"})},[ge,Je,C]);N.useEffect(()=>{if(!P||K!=="infinite_scroll")return;const de=le.current;if(!de||typeof IntersectionObserver>"u")return;const _e=new IntersectionObserver(Ee=>{var He;(He=Ee[0])!=null&&He.isIntersecting&&be<rt&&te(Ue=>Math.min(Ue+ae,rt))},{rootMargin:"100px"});return _e.observe(de),()=>_e.disconnect()},[P,K,be,rt,ae]);const Ae=N.useMemo(()=>{const de=ge.filter(Ee=>Ee.summary);if(de.length===0)return null;if(l&&f){const Ee={};for(const He of de){const Ue=`${He.summary}:${He.field}`;Ee[He.field]=f[Ue]??null}return Ee}const _e={};for(const Ee of de){const He=e.map(Ue=>Ue[Ee.field]).filter(Ue=>typeof Ue=="number");if(Ee.summary==="count"){_e[Ee.field]=e.filter(Ue=>Ue[Ee.field]!=null).length;continue}if(He.length===0){_e[Ee.field]=null;continue}switch(Ee.summary){case"sum":_e[Ee.field]=He.reduce((Ue,vt)=>Ue+vt,0);break;case"avg":_e[Ee.field]=He.reduce((Ue,vt)=>Ue+vt,0)/He.length;break;case"min":_e[Ee.field]=Math.min(...He);break;case"max":_e[Ee.field]=Math.max(...He);break}}return _e},[e,ge,l,f]),Pe=((pt=n==null?void 0:n.summary)==null?void 0:pt.label)??"Total",ct=ge.findIndex(de=>!de.summary);if(s)return d.jsx("div",{className:"h-full flex items-center justify-center",children:d.jsx("div",{className:"animate-pulse bg-gray-100 w-full h-full rounded"})});if(n!=null&&n.pivot){const de=typeof r=="number"?`${r}px`:r;return d.jsx(K6,{data:e,pivotConfig:n.pivot,height:de})}const kt=typeof r=="number"?`${r}px`:r,bt=(de,_e)=>de.sticky?{position:"sticky",left:`${re[de.stickyIndex]??0}px`,zIndex:_e?3:1,backgroundColor:_e?"#f0f4f8":"#f8fafc"}:{},ue=de=>de.sticky&&de.stickyIndex===ve-1?"shadow-[2px_0_4px_rgba(0,0,0,0.08)]":"",ne=(P||l)&&K==="paginated"?R*ae:0,Te=ne+1,Re=Math.min(ne+pe.length,rt);return d.jsxs("div",{className:"h-full flex flex-col",style:{maxHeight:kt,outline:"none"},tabIndex:0,ref:O,onKeyDown:me,onClick:de=>{de.target.tagName==="DIV"&&T({type:"none"})},children:[l&&u!=null&&u>e.length&&!P&&d.jsxs("div",{className:"flex items-center justify-between px-4 py-2 text-sm border-b shrink-0",style:{borderColor:"var(--yc-color-border)",backgroundColor:"rgba(59, 130, 246, 0.05)",color:"var(--yc-color-text-secondary)"},children:[d.jsxs("span",{children:["Showing first ",e.length.toLocaleString()," of ",u.toLocaleString()," rows",p&&" — use Export for full data"]}),p&&d.jsx("a",{href:p,className:"text-blue-600 hover:text-blue-700 font-medium",download:!0,children:"Export CSV"})]}),d.jsxs("div",{className:"flex-1 overflow-auto min-h-0",children:[d.jsxs("table",{className:"min-w-full text-sm yc-table",style:{tableLayout:Object.keys(E).length>0?"fixed":"auto"},children:[d.jsx("thead",{className:"sticky top-0 z-[2] bg-gray-50 border-b border-gray-200",children:d.jsxs("tr",{children:[d.jsx("th",{className:"px-3 py-3 text-right font-medium text-gray-400 select-none bg-gray-50 w-10",children:"#"}),ge.map((de,_e)=>d.jsxs("th",{ref:de.sticky?je(de.stickyIndex):void 0,className:`px-4 py-3 text-left font-medium text-gray-600 cursor-pointer hover:bg-gray-100 select-none ${ue(de)}`,style:{...bt(de,!0),backgroundColor:w.type==="column"&&w.column===de.field||w.type==="all"?"rgba(59, 130, 246, 0.15)":de.sticky?"#f0f4f8":void 0,...E[de.field]?{width:E[de.field],minWidth:E[de.field]}:{},position:de.sticky?"sticky":"relative",borderRight:"1px solid rgba(0,0,0,0.06)"},onClick:Ee=>{D(de.field,Ee),!Ee.shiftKey&&!Ee.metaKey&&!Ee.ctrlKey&&Ye(de.field)},children:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("span",{children:de.label}),d.jsx("span",{className:`w-4 text-center text-gray-400 ${U===de.field?"visible":"invisible"}`,children:U===de.field&&Y==="asc"?"↑":"↓"})]}),d.jsx("div",{onMouseDown:Ee=>M(de.field,Ee),style:{position:"absolute",right:0,top:0,bottom:0,width:4,cursor:"col-resize"},className:"hover:bg-blue-400 hover:opacity-50"})]},de.field))]})}),d.jsx("tbody",{children:pe.map((de,_e)=>d.jsxs("tr",{className:"border-b border-gray-100",onContextMenu:i?Ee=>{Ee.preventDefault();const He=Ee.target.closest("td[data-field]"),Ue=(He==null?void 0:He.getAttribute("data-field"))??void 0;i(de,{x:Ee.clientX,y:Ee.clientY},Ue)}:void 0,children:[d.jsx("td",{className:"px-3 py-3 text-right yc-row-num bg-white w-10 cursor-pointer select-none hover:bg-blue-50",onClick:Ee=>j(_e,Ee),style:F(_e)?{backgroundColor:"rgba(59, 130, 246, 0.08)"}:void 0,children:ne+_e+1}),ge.map(Ee=>{const He=Wl(de[Ee.field],Ee.format),Ue=de[Ee.field],vt=Ue==null?void 0:String(Ue),jt=Ee.overflow??"ellipsis",$e=jt==="wrap"?{whiteSpace:"normal",wordBreak:"break-all"}:jt==="hidden"?{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"clip"}:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},ft=`${_e}:${Ee.field}`,De=jt!=="wrap"&&vt&&vt.length>20,We=y===ft;return d.jsxs("td",{"data-field":Ee.field,className:`px-4 py-3 text-gray-700 bg-white ${ue(Ee)}${Ee.font==="mono"?" font-mono text-[0.8125rem]":""}${De?" cursor-pointer":""}`,style:{maxWidth:E[Ee.field]??200,...$e,...bt(Ee,!1),borderRight:"1px solid rgba(0,0,0,0.06)",...B(_e,Ee.field)?{backgroundColor:"rgba(59, 130, 246, 0.08)"}:{}},title:jt!=="wrap"&&!We?vt:void 0,...De?{onClick:gt=>{gt.stopPropagation(),gt.preventDefault(),b.current=gt.currentTarget,g(We?null:ft)}}:{},children:[He,We&&vt&&d.jsx(G6,{text:He,anchorRef:b,onClose:()=>g(null)})]},Ee.field)})]},_e))}),Ae&&d.jsx("tfoot",{className:"sticky bottom-0 z-[2]",children:d.jsxs("tr",{className:"border-t-2 border-gray-300 bg-gray-50 font-medium",children:[d.jsx("td",{className:"px-3 py-3 bg-gray-50 w-10"}),ge.map((de,_e)=>{const Ee=Ae[de.field],He=ct>=0&&_e===ct;return d.jsx("td",{className:`px-4 py-3 text-gray-700 bg-gray-50 ${ue(de)}`,style:bt(de,!1),children:He?Pe:Ee!=null?Wl(Ee,de.format):""},de.field)})]})})]}),Je.length===0&&d.jsx("div",{className:"text-center py-8 text-gray-400",children:"No data"}),P&&K==="infinite_scroll"&&be<rt&&d.jsx("div",{ref:le,className:"flex justify-center py-4",children:d.jsx("span",{className:"text-sm text-gray-400",children:"Loading more..."})})]}),(P&&K==="paginated"||l)&&rt>0&&d.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-t shrink-0",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-input-bg)"},"data-testid":"pagination-controls",children:[d.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["Showing ",Te,"-",Re," of ",rt.toLocaleString()]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("select",{value:ae,onChange:de=>{const _e=Number(de.target.value);J(_e),ie(0)},className:"text-sm border rounded px-2 py-1",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},"aria-label":"Page size",children:[Q6.map(de=>d.jsxs("option",{value:de,children:[de," / page"]},de)),d.jsx("option",{value:rt,children:"All"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>ie(de=>Math.max(0,de-1)),disabled:R===0,className:"text-sm px-3 py-1 border rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)"},children:"Previous"}),d.jsxs("span",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[R+1," / ",ut]}),d.jsx("button",{onClick:()=>ie(de=>Math.min(ut-1,de+1)),disabled:R>=ut-1,className:"text-sm px-3 py-1 border rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)"},children:"Next"})]})]})]}),P&&K==="infinite_scroll"&&rt>0&&d.jsxs("div",{className:"text-sm px-4 py-2 border-t shrink-0",style:{borderColor:"var(--yc-color-border)",color:"var(--yc-color-text-secondary)",backgroundColor:"var(--yc-color-input-bg)"},"data-testid":"infinite-scroll-status",children:["Showing ",Math.min(be,rt).toLocaleString()," of ",rt.toLocaleString()]})]})}function X6(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 J6({data:e,yAxis:t,loading:n=!1,title:r}){if(n)return d.jsx("div",{className:"h-full flex items-center justify-center",children:d.jsx("div",{className:"animate-pulse bg-gray-200 h-16 w-32 rounded"})});if(!e||e.length===0)return d.jsx("div",{className:"h-full flex items-center justify-center text-gray-400",children:"No data"});const s=e[0],i=s==null?void 0:s[t.field],l=typeof i=="number"?i:parseFloat(String(i))||0,u=X6(l,t.format),f=t.label||t.field;return d.jsxs("div",{className:"h-full flex flex-col items-center justify-center p-4",children:[d.jsx("div",{className:"text-4xl font-bold text-gray-900 tabular-nums",children:u}),(r||f)&&d.jsx("div",{className:"text-sm text-gray-500 mt-2 text-center",children:r||f})]})}const V2=N.forwardRef(function({data:t,xAxis:n,chartConfig:r,theme:s,height:i=400,loading:l=!1,onChartClick:u,events:f,goalData:h},p){var Y,Q,re,ye,G,fe,P;const y=Ar(),g=(r==null?void 0:r.series)&&"field"in r.series,b=g?Hd(t,n):Ps(t,n),O=n.type==="temporal"?Bd(t,n):b,w=N.useMemo(()=>{if(g){const K=new Set;return t.filter(ee=>{const R=ee[n.field];return K.has(R)?!1:(K.add(R),!0)}).map(ee=>ee[n.field])}return t.map(K=>K[n.field])},[t,n.field,g]),T=N.useMemo(()=>{if(u)return{contextmenu:K=>{var be,te,le,ge;const ee=K;if(ee.componentType!=="series")return;const R=ee.dataIndex!=null?w[ee.dataIndex]:void 0,ie=R!=null?String(R):ee.name;if(ie==null||ie==="")return;const ae=((te=(be=ee.event)==null?void 0:be.event)==null?void 0:te.clientX)??0,J=((ge=(le=ee.event)==null?void 0:le.event)==null?void 0:ge.clientY)??0;u(n.field,ie,{x:ae,y:J},ee.seriesName)}}},[u,n.field,w]),E=Fd(t,{x:{field:n.field},series:r.series},s),_=(Y=r.axes)==null?void 0:Y.left,S=(Q=r.axes)==null?void 0:Q.right,A=[];A.push({type:(_==null?void 0:_.scale)==="log"?"log":"value",name:_==null?void 0:_.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:y.textColor,fontSize:12},axisLabel:{color:y.textColor,fontSize:12,formatter:K=>ko(K,_==null?void 0:_.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:y.splitLineColor,type:"dashed"}}}),S&&A.push({type:S.scale==="log"?"log":"value",name:S.label,nameLocation:"middle",nameGap:60,nameTextStyle:{color:y.textColor,fontSize:12},axisLabel:{color:y.textColor,fontSize:12,formatter:K=>ko(K,S.format)},axisLine:{show:!1},splitLine:{show:!1}});const M=cs(s),C=E.map(K=>{const ee=Ud(K.color,K.gradient??r.gradient),R=K.chartType??"bar",ie={name:K.name,data:K.data,yAxisIndex:K.yAxisIndex??0,itemStyle:{color:ee??K.color},...K.opacity!==void 0?{opacity:K.opacity}:{}};return R==="line"?{...ie,type:"line",smooth:M.smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:K.color,type:K.style==="dashed"?"dashed":K.style==="dotted"?"dotted":"solid"}}:R==="area"?{...ie,type:"line",smooth:M.smooth,symbol:"none",lineStyle:{width:2,color:K.color},areaStyle:{color:ee??K.color}}:{...ie,type:"bar",barWidth:"60%",itemStyle:{color:ee??K.color,borderRadius:M.barBorderRadius}}}),I=(r==null?void 0:r.goals)??[];if(I.length>0&&Array.isArray(C)){const K=Rd(I,b),ee=Pd(I);K.length>0&&C[0]&&(C[0].markLine={silent:!0,symbol:"none",data:K}),ee.length>0&&C[0]&&(C[0].markArea={silent:!0,data:ee});const R=jd(I,h);for(const ie of R)C.push({type:"line",name:ie.name,data:ie.data,yAxisIndex:0,z:ie.z,showSymbol:ie.showSymbol,lineStyle:ie.lineStyle,itemStyle:{color:ie.color}})}const D=r==null?void 0:r.annotations;if(D&&D.length>0&&Array.isArray(C)&&C[0]){const K=Wd(D,y.textColor),ee=Yd(D);if(K.length>0){const R=C[0].markLine,ie=(R==null?void 0:R.data)??[];C[0].markLine={...R,silent:!0,symbol:"none",data:[...ie,...K]}}if(ee.length>0){const R=C[0].markArea,ie=(R==null?void 0:R.data)??[];C[0].markArea={silent:!0,data:[...ie,...ee]}}}const j=N.useMemo(()=>{if(!(f!=null&&f.length))return[];const ee=f.flatMap(J=>J.endDate?[J.date,J.endDate]:[J.date]).map(J=>({[n.field]:J})),ie=Ps([...t,...ee],n).slice(t.length);let ae=0;return f.map(J=>{const be={...J,date:ie[ae++]??J.date};return J.endDate&&(be.endDate=ie[ae++]??J.endDate),be})},[f,t,n]),F=Array.isArray(C)?C.map(K=>K.name).filter(Boolean):[],B=Md(j,y.textColor,b),U=Ld(j,y.textColor,b);if((B||U.length>0)&&Array.isArray(C)){const K={type:"line",data:((re=C[0])==null?void 0:re.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};B&&(K.markLine=B),U.length>0&&(K.markArea={silent:!0,data:U}),C.push(K)}const W={tooltip:{trigger:"axis",axisPointer:{type:"cross"},formatter:K=>{const ee=K;if(!Array.isArray(ee)||ee.length===0)return"";let ie=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${O[ee[0].dataIndex]??ee[0].name}</div>`;for(const ae of ee){const J=E.find(te=>te.name===ae.seriesName),be=(J==null?void 0:J.yAxisIndex)===1?S:_;ie+=`<div>${ae.marker} ${ae.seriesName}: ${ko(ae.value,be==null?void 0:be.format)}</div>`}return ie+=Id(j,ee[0].name,b),ie+="</div>",ie}},legend:{show:((ye=r.legend)==null?void 0:ye.show)!==!1,...((G=r.legend)==null?void 0:G.position)==="top"?{top:0}:((fe=r.legend)==null?void 0:fe.position)==="left"?{left:0,orient:"vertical"}:((P=r.legend)==null?void 0:P.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:y.textColor,fontSize:12},...F.length>0?{data:F}:{}},grid:{left:"3%",right:S?"8%":"4%",bottom:zd(),top:"10%",containLabel:!0},xAxis:{type:"category",data:b,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:y.textColor,fontSize:12},axisLabel:{color:y.textColor,fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:y.borderColor}},axisTick:{show:!1}},yAxis:A,series:C,animation:!0,animationDuration:300};return d.jsx(yr,{ref:p,option:W,height:i,loading:l,onEvents:T})}),Q2=N.forwardRef(function({data:t,chartConfig:n,height:r=400,loading:s=!1},i){const l=N.useMemo(()=>{var _,S;const u=n.x.field,f=n.y.field,h=n.value.field,p=[...new Set(t.map(A=>String(A[u]??"")))],y=[...new Set(t.map(A=>String(A[f]??"")))],g=[];let b=1/0,O=-1/0;for(const A of t){const M=String(A[u]??""),C=String(A[f]??""),I=Number(A[h]??0),D=p.indexOf(M),j=y.indexOf(C);D>=0&&j>=0&&(g.push([D,j,I]),I<b&&(b=I),I>O&&(O=I))}b===1/0&&(b=0),O===-1/0&&(O=0);const w=((_=n.color_range)==null?void 0:_.min)??"#EBF5FB",T=((S=n.color_range)==null?void 0:S.max)??"#1A5276",E=n.show_values??!0;return{tooltip:{position:"top",formatter:A=>{const M=A,C=p[M.value[0]]??"",I=y[M.value[1]]??"",D=M.value[2],j=n.value.label??h;return`${C}, ${I}<br/>${j}: <b>${D}</b>`}},grid:{left:"3%",right:"8%",bottom:"10%",top:"6%",containLabel:!0},xAxis:{type:"category",data:p,name:n.x.label,splitArea:{show:!0}},yAxis:{type:"category",data:y,name:n.y.label,splitArea:{show:!0}},visualMap:{min:b,max:O,calculable:!0,orient:"horizontal",left:"center",bottom:"0%",inRange:{color:[w,T]}},series:[{type:"heatmap",data:g,label:{show:E},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}},[t,n]);return d.jsx(yr,{ref:i,option:l,height:r,loading:s})}),G2=N.forwardRef(function({data:t,chartConfig:n,theme:r,height:s=400,loading:i=!1},l){const u=Ar(),f=N.useMemo(()=>{var w;const h=n.stage.field,p=n.value.field,y=n.show_conversion??!0,g=t.map(T=>({name:String(T[h]??""),value:Number(T[p]??0)})),b={};for(let T=1;T<g.length;T++){const E=g[T-1],_=g[T];if(E&&_&&E.value>0){const S=(_.value/E.value*100).toFixed(1);b[_.name]=`${S}% of ${E.name}`}}const O=n.color??((w=r==null?void 0:r.palette)==null?void 0:w[0])??"#3B82F6";return{tooltip:{trigger:"item",formatter:T=>{const E=T;let _=`${E.name}: <b>${E.value.toLocaleString()}</b>`;return y&&b[E.name]&&(_+=`<br/><span style="color:${u.textColor}">${b[E.name]}</span>`),_}},series:[{type:"funnel",left:"10%",top:"10%",bottom:"10%",width:"80%",sort:"descending",gap:2,label:{show:!0,position:"inside",formatter:T=>{const E=T;return`${E.name}
|
|
126
|
-
${E.value.toLocaleString()}`}},itemStyle:{borderColor:u.surfaceColor,borderWidth:1,color:T=>{const _=1-T.dataIndex*.15;return`${O}${Math.round(Math.max(_,.3)*255).toString(16).padStart(2,"0")}`}},data:g}]}},[t,n,r,u]);return d.jsx(yr,{ref:l,option:f,height:s,loading:i})}),K2=N.forwardRef(function({data:t,chartConfig:n,height:r=400,loading:s=!1},i){const l=Ar(),u=N.useMemo(()=>{var S,A,M;const f=n.category.field,h=n.value.field,p=n.total_field,y=((S=n.colors)==null?void 0:S.increase)??"#22C55E",g=((A=n.colors)==null?void 0:A.decrease)??"#EF4444",b=((M=n.colors)==null?void 0:M.total)??"#3B82F6",O=[],w=[],T=[],E=[];let _=0;for(const C of t){const I=String(C[f]??""),D=Number(C[h]??0),j=p?!!C[p]:!1;O.push(I),j?(w.push(Math.min(0,D)),T.push(Math.abs(D)),E.push(b),_=D):(D>=0?(w.push(_),T.push(D),E.push(y)):(w.push(_+D),T.push(Math.abs(D)),E.push(g)),_+=D)}return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:C=>{var U,W;const I=C;if(!I[0])return"";const D=I[0].dataIndex,j=Number(((U=t[D])==null?void 0:U[h])??0),B=!(p?!!((W=t[D])!=null&&W[p]):!1)&&j>=0?"+":"";return`${I[0].name}<br/><b>${B}${j.toLocaleString()}</b>`}},grid:{left:"3%",right:"4%",bottom:"10%",containLabel:!0},xAxis:{type:"category",data:O,axisLabel:{color:l.textColor,rotate:O.length>6?30:0},axisLine:{lineStyle:{color:l.borderColor}}},yAxis:{type:"value",axisLabel:{color:l.textColor},splitLine:{lineStyle:{color:l.splitLineColor,type:"dashed"}}},series:[{type:"bar",stack:"waterfall",data:w,itemStyle:{color:"transparent",borderColor:"transparent"},emphasis:{itemStyle:{color:"transparent",borderColor:"transparent"}},tooltip:{show:!1}},{type:"bar",stack:"waterfall",data:T.map((C,I)=>({value:C,itemStyle:{color:E[I]}})),label:{show:!0,position:"top",formatter:C=>{var B,U;const I=C,D=Number(((B=t[I.dataIndex])==null?void 0:B[h])??0);return(p?!!((U=t[I.dataIndex])!=null&&U[p]):!1)?D.toLocaleString():`${D>=0?"+":""}${D.toLocaleString()}`}}}]}},[t,n,l]);return d.jsx(yr,{ref:i,option:u,height:r,loading:s})}),X2=N.forwardRef(function({data:t,chartConfig:n,theme:r,height:s=400,loading:i=!1},l){const u=Ar(),f=N.useMemo(()=>{var _;const h=n.value.field,p=n.min??0,y=n.max??100,g=n.format,b=t[0]?Number(t[0][h]??0):0,O=Math.min(Math.max(b,p),y);let w;if(n.thresholds&&n.thresholds.length>0){const S=y-p||1;w=n.thresholds.map(A=>[(A.value-p)/S,A.color])}else w=[[1,((_=r==null?void 0:r.palette)==null?void 0:_[0])??"#3B82F6"]];const E=[{type:"gauge",min:p,max:y,progress:{show:!0,width:18},axisLine:{lineStyle:{width:18,color:w}},axisTick:{show:!1},splitLine:{length:10,lineStyle:{width:2,color:u.textColor}},axisLabel:{distance:25,color:u.textColor,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:S=>{if(!g)return S.toLocaleString();if(g.includes("$"))return`$${S.toLocaleString()}`;if(g.includes("%"))return`${S.toFixed(1)}%`;const A=g.match(/\.(\d+)f/);return A?S.toFixed(Number(A[1])):S.toLocaleString()}},data:[{value:O}]}];if(n.goal){const S=Math.min(Math.max(n.goal.value,p),y);E.push({type:"gauge",min:p,max:y,pointer:{show:!0,length:"60%",width:4,itemStyle:{color:n.goal.color??"#22c55e"}},progress:{show:!1},axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:!1},title:{show:!!n.goal.label,offsetCenter:[0,"90%"],fontSize:12,color:u.textColor},detail:{show:!1},data:[{value:S,name:n.goal.label??"Goal"}]})}return{series:E}},[t,n,r,u]);return d.jsx(yr,{ref:l,option:f,height:s,loading:i})}),Z6=N.forwardRef(function({data:t,chartConfig:n,theme:r,height:s=400,loading:i=!1,onChartClick:l},u){const f=Ar(),h=N.useMemo(()=>{if(l)return{contextmenu:y=>{var w,T,E,_,S,A,M;const g=y,b=((T=(w=g.event)==null?void 0:w.event)==null?void 0:T.clientX)??0,O=((_=(E=g.event)==null?void 0:E.event)==null?void 0:_.clientY)??0;g.dataType==="node"&&((S=g.data)!=null&&S.name)?l(n.source.field,g.data.name,{x:b,y:O}):g.dataType==="edge"&&((A=g.data)!=null&&A.source)&&((M=g.data)!=null&&M.target)&&l(n.source.field,g.data.source,{x:b,y:O},g.data.target)}}},[l,n.source.field]),p=N.useMemo(()=>{const y=n.source.field,g=n.target.field,b=n.value.field,O=new Set,w=[];for(const M of t){const C=String(M[y]??""),I=String(M[g]??""),D=Number(M[b]??0);C&&I&&D>0&&(O.add(C),O.add(I),w.push({source:C,target:I,value:D}))}const T=Array.from(O),E=new Map;if(n.levels)for(let M=0;M<n.levels.length;M++)for(const C of n.levels[M])E.set(C,M);const _=T.map((M,C)=>({name:M,itemStyle:{color:da(C,void 0,r)},...E.has(M)?{depth:E.get(M)}:{}})),S=n.orient??"horizontal",A=S==="horizontal"?"right":"bottom";return{tooltip:{trigger:"item",triggerOn:"mousemove",formatter:M=>{var B,U,W,Y;const C=M;if(C.dataType==="edge")return`${(B=C.data)==null?void 0:B.source} → ${(U=C.data)==null?void 0:U.target}<br/><b>${(((W=C.data)==null?void 0:W.value)??0).toLocaleString()}</b>`;const I=((Y=C.data)==null?void 0:Y.name)??"",D=w.filter(Q=>Q.source===I).reduce((Q,re)=>Q+re.value,0),j=w.filter(Q=>Q.target===I).reduce((Q,re)=>Q+re.value,0);let F=`<b>${I}</b>`;return j>0&&(F+=`<br/>Inflow: ${j.toLocaleString()}`),D>0&&(F+=`<br/>Outflow: ${D.toLocaleString()}`),F}},series:[{type:"sankey",orient:S,layoutIterations:32,nodeWidth:n.node_width??20,nodeGap:n.node_gap??12,emphasis:{focus:"adjacency"},lineStyle:{color:"gradient",curveness:.5},label:{show:!0,position:n.label_position??A,color:f.textColor,fontSize:12},data:_,links:w}],animation:!0,animationDuration:300}},[t,n,r,f]);return d.jsx(yr,{ref:u,option:p,height:s,loading:i,onEvents:h})});function J2({onRefresh:e,onExportCSV:t,onExportPNG:n,onExportSVG:r,onExportPDF:s,onCopyTable:i,isRefreshing:l=!1,hideImageExport:u=!1}){const[f,h]=N.useState(!1),p=N.useRef(null);return N.useEffect(()=>{const y=g=>{p.current&&!p.current.contains(g.target)&&h(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[]),d.jsxs("div",{className:"relative",ref:p,children:[d.jsx("button",{onClick:()=>h(!f),className:"p-1.5 hover:bg-black/5 rounded transition-colors",style:{color:"var(--yc-color-text-muted)"},title:"Chart actions",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}),f&&d.jsxs("div",{className:"absolute right-0 top-full mt-1 w-40 rounded-md shadow-lg z-50 py-1",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[d.jsxs("button",{onClick:()=>{e(),h(!1)},disabled:l,className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2 disabled:opacity-50",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("svg",{className:`w-4 h-4 ${l?"animate-spin":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border)"}}),d.jsxs("button",{onClick:()=>{t(),h(!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),i&&d.jsxs("button",{onClick:()=>{i(),h(!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),"Copy Table"]}),!u&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:()=>{n(),h(!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.jsxs("button",{onClick:()=>{r(),h(!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),"Export SVG"]}),s&&d.jsxs("button",{onClick:()=>{s(),h(!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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 am(e){const t=e.match(/^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2}):(\d{2})/);if(!t)return e;const[,n,r,s,i]=t;if(r==="00"&&s==="00"&&i==="00")return n;const l=parseInt(r,10),u=l>=12?"PM":"AM",f=l%12||12,h=i==="00"?`${f}:${s} ${u}`:`${f}:${s}:${i} ${u}`;return`${n} ${h}`}function Z2({x:e,y:t,field:n,value:r,allFields:s,onFilter:i,onViewDetails:l,onGoToChart:u,onAddEvent:f,detailModel:h,targetChart:p,isTemporalChart:y,onClose:g}){const b=N.useRef(null);N.useEffect(()=>{const I=j=>{b.current&&!b.current.contains(j.target)&&g()},D=j=>{j.key==="Escape"&&g()};return document.addEventListener("mousedown",I),document.addEventListener("keydown",D),()=>{document.removeEventListener("mousedown",I),document.removeEventListener("keydown",D)}},[g]);const O=s?Object.entries(s).map(([I,D])=>`${I} = ${am(D)}`).join(", "):`${n} = ${am(r)}`;let w=0;i&&w++,h&&w++,p&&w++,f&&y&&w++;const T=280,E=w*36+8,_=Math.min(e,window.innerWidth-T-8),S=Math.min(t,window.innerHeight-E-8),A=()=>{i==null||i(),g()},M=()=>{l==null||l(),g()},C=()=>{u==null||u(),g()};return Di.createPortal(d.jsxs("div",{ref:b,className:"fixed z-[9999] rounded-lg shadow-lg py-1 min-w-[200px]",style:{left:_,top:S,maxWidth:T,backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[i&&d.jsxs("button",{className:"w-full text-left px-3 py-2 text-sm flex items-center gap-2 hover:bg-black/5 dark:hover:bg-white/5 transition-colors",style:{color:"var(--yc-color-text)"},onClick:A,children:[d.jsx("svg",{className:"w-4 h-4 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"})}),d.jsxs("span",{className:"truncate",children:["Filter: ",O]})]}),h&&d.jsxs("button",{className:"w-full text-left px-3 py-2 text-sm flex items-center gap-2 hover:bg-black/5 dark:hover:bg-white/5 transition-colors",style:{color:"var(--yc-color-text)"},onClick:M,children:[d.jsx("svg",{className:"w-4 h-4 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M12 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"})}),d.jsx("span",{children:"View details"})]}),p&&d.jsxs("button",{className:"w-full text-left px-3 py-2 text-sm flex items-center gap-2 hover:bg-black/5 dark:hover:bg-white/5 transition-colors",style:{color:"var(--yc-color-text)"},onClick:C,children:[d.jsx("svg",{className:"w-4 h-4 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})}),d.jsxs("span",{children:["Go to ",p]})]}),f&&y&&d.jsxs(d.Fragment,{children:[(i||h||p)&&d.jsx("div",{className:"my-1 border-t",style:{borderColor:"var(--yc-color-border)"}}),d.jsxs("button",{className:"w-full text-left px-3 py-2 text-sm flex items-center gap-2 hover:bg-black/5 dark:hover:bg-white/5 transition-colors",style:{color:"var(--yc-color-text)"},onClick:()=>{f(),g()},children:[d.jsx("svg",{className:"w-4 h-4 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),d.jsx("span",{children:"Add event"})]})]})]}),document.body)}function eE({date:e,onSave:t,onClose:n,saving:r=!1,themePalette:s}){const[i,l]=N.useState(""),[u,f]=N.useState(e),[h,p]=N.useState(""),[y,g]=N.useState(!1),[b,O]=N.useState(""),w=N.useRef(null);N.useEffect(()=>{var E;(E=w.current)==null||E.focus()},[]),N.useEffect(()=>{function E(_){_.key==="Escape"&&n()}return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[n]);function T(E){E.preventDefault(),i.trim()&&t({date:u,label:i.trim(),color:h,...y&&b?{endDate:b}:{}})}return Di.createPortal(d.jsxs("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:n}),d.jsxs("form",{onSubmit:T,className:"relative rounded-lg shadow-xl p-5 w-80",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[d.jsx("h3",{className:"text-sm font-semibold mb-3",style:{color:"var(--yc-color-text)"},children:"Add event"}),d.jsx("label",{className:"block text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:y?"Start date":"Date"}),d.jsx("input",{type:"text",value:u,onChange:E=>f(E.target.value),className:"w-full px-2 py-1.5 text-sm rounded border mb-3",style:{backgroundColor:"var(--yc-color-background)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text)"}}),d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:"Multi-day"}),d.jsx("button",{type:"button",onClick:()=>{g(!y),y&&O("")},className:"relative w-10 h-5 rounded-full transition-colors flex-shrink-0",style:{backgroundColor:y?"var(--yc-color-primary, #3b82f6)":"var(--yc-color-border)"},children:d.jsx("span",{className:"absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform",style:{left:y?22:2}})})]}),y&&d.jsxs(d.Fragment,{children:[d.jsx("label",{className:"block text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"End date"}),d.jsx("input",{type:"text",value:b,onChange:E=>O(E.target.value),placeholder:"YYYY-MM-DD",className:"w-full px-2 py-1.5 text-sm rounded border mb-3",style:{backgroundColor:"var(--yc-color-background)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text)"}})]}),d.jsx("label",{className:"block text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"Label"}),d.jsx("input",{ref:w,type:"text",value:i,onChange:E=>l(E.target.value),placeholder:"Event label",className:"w-full px-2 py-1.5 text-sm rounded border mb-3",style:{backgroundColor:"var(--yc-color-background)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text)"}}),d.jsx("label",{className:"block text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"Color (optional)"}),d.jsx("div",{className:"mb-4",children:d.jsx(sm,{value:h,onChange:p,themePalette:s})}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx("button",{type:"button",onClick:n,className:"px-3 py-1.5 text-sm rounded",style:{color:"var(--yc-color-text-muted)"},children:"Cancel"}),d.jsx("button",{type:"submit",disabled:!i.trim()||r,className:"px-3 py-1.5 text-sm rounded text-white disabled:opacity-50",style:{backgroundColor:"var(--yc-color-primary, #3b82f6)"},children:r?"Saving...":"Save"})]})]})]}),document.body)}const eA={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 ld({isLoading:e,error:t,data:n,hasActiveFilters:r,onRetry:s,children:i}){if(t){const l=t.errorType?eA[t.errorType]:void 0;return d.jsx("div",{className:"h-full flex items-center justify-center p-6",children:d.jsxs("div",{className:"text-center max-w-sm",children:[d.jsx("div",{className:"w-10 h-10 mx-auto mb-3 rounded-full flex items-center justify-center",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-danger) 10%, transparent)"},children:d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"var(--yc-color-danger)"},children:d.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"})})}),d.jsx("p",{className:"text-sm font-medium",style:{color:"var(--yc-color-text)"},children:(l==null?void 0:l.title)??"Failed to load chart"}),d.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-secondary)"},children:t.message}),(l==null?void 0:l.hint)&&d.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:l.hint}),s&&d.jsx("button",{onClick:s,className:"mt-3 px-3 py-1.5 text-xs font-medium rounded transition-colors hover:opacity-80",style:{color:"var(--yc-color-primary)"},"aria-label":"Retry",children:"Retry"})]})})}return e&&!n?d.jsx("div",{className:"h-full animate-pulse rounded",style:{backgroundColor:"var(--yc-color-surface-hover)"}}):n&&n.length===0?d.jsx("div",{className:"h-full flex items-center justify-center p-6",children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"w-10 h-10 mx-auto mb-3 rounded-full flex items-center justify-center",style:{backgroundColor:"var(--yc-color-surface-hover)"},children:d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"var(--yc-color-text-muted)"},children:d.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"})})}),d.jsx("p",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"No data matches your filters"}),r&&d.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:"Try adjusting your filters"})]})}):d.jsx(d.Fragment,{children:i})}const tA={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 h0(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 nA(e,t){const n=e>=0?"+":"";return t==="percent_change"?`${n}${e.toFixed(1)}%`:`${n}${e.toLocaleString()}`}function rA({chartName:e,drillParams:t}){var ve,je,Ye,nt,tt,Je,rt,ut,pe;const n=N.useMemo(()=>{if(!t)return;const me=Object.fromEntries(Object.entries(t).filter(([Ae])=>!Ae.startsWith("_")));return Object.keys(me).length>0?me:void 0},[t]),{data:r,isLoading:s}=Kb(e),{data:i,isLoading:l,error:u}=fv(e,n),{data:f}=ga(),h=Mm(),p=ot(me=>me.getEffectiveFilters),y=N.useRef(null),{events:g,allEvents:b}=pv(e),O=So(me=>me.auth),w=qn(),[T,E]=N.useState(null),_=O.status==="disabled"||O.status==="authenticated"&&(O.user.role==="admin"||O.user.role==="editor"),S=((je=(ve=r==null?void 0:r.chart)==null?void 0:ve.x)==null?void 0:je.type)==="temporal",A=Za({mutationFn:me=>xt.createChartEvent({date:me.date,label:me.label,...me.color?{color:me.color}:{},...me.endDate?{endDate:me.endDate}:{}}),onSuccess:()=>{w.invalidateQueries({queryKey:["chartEvents"]}),E(null)}}),[M,C]=N.useState("chart"),[I,D]=N.useState(!1),[j,F]=N.useState(!1),[B,U]=N.useState(()=>{const me=localStorage.getItem(`yamchart-events-visible-${e}`);return me===null?!0:me==="1"});function W(){U(me=>{const Ae=!me;return localStorage.setItem(`yamchart-events-visible-${e}`,Ae?"1":"0"),Ae})}const Y=(()=>{try{const me=sessionStorage.getItem("yamchart-last-dashboard");if(me)return JSON.parse(me)}catch{}return null})(),Q=t==null?void 0:t._from,re=!!n&&Object.keys(n).length>0,ye=n?Object.entries(n).map(([me,Ae])=>`${me}: ${Ae}`).join(", "):"",fe=p(e).granularity,P=fe?tA[fe]:void 0,[K,ee]=N.useState(null),R=N.useCallback((me,Ae,Pe,ct)=>{var bt;let kt;if(ct&&((bt=r==null?void 0:r.chart)!=null&&bt.series)&&"field"in r.chart.series){const ue=r.chart.series.field;ue&&ue!==me&&(kt={[me]:Ae,[ue]:ct})}ee({x:Pe.x,y:Pe.y,field:me,value:Ae,allFields:kt})},[r]),ie=N.useCallback(()=>{K&&E(K.value)},[K]),ae=N.useCallback(()=>{var ct,kt;if(!K||!((ct=r==null?void 0:r.drillDown)!=null&&ct.model))return;const me=r.drillDown,Ae=me.fields?typeof me.fields=="string"?me.fields:me.fields[0]:me.field??((kt=r.chart.x)==null?void 0:kt.field)??K.field,Pe=new URLSearchParams;if(K.allFields)for(const[bt,ue]of Object.entries(K.allFields))Pe.set(bt,ue);else Pe.set(Ae,K.value);Pe.set("_from",e),window.location.hash=`/charts/${e}/detail?${Pe.toString()}`,ee(null)},[K,r,e]),J=N.useCallback(()=>{var ct,kt;if(!K||!((ct=r==null?void 0:r.drillDown)!=null&&ct.chart))return;const me=r.drillDown,Ae=me.fields?typeof me.fields=="string"?me.fields:me.fields[0]:me.field??((kt=r.chart.x)==null?void 0:kt.field)??K.field,Pe=new URLSearchParams;if(K.allFields)for(const[bt,ue]of Object.entries(K.allFields))Pe.set(bt,ue);else Pe.set(Ae,K.value);Pe.set("_from",e),window.location.hash=`/charts/${r.drillDown.chart}?${Pe.toString()}`,ee(null)},[K,r,e]),be=()=>{!i||!r||Ad(i.rows,i.columns,r.name||e)},te=()=>{var Ae;const me=(Ae=y.current)==null?void 0:Ae.getDataURL("png");me&&r&&rd(me,`${r.name||e}.png`)};if(s)return d.jsx("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"Loading chart..."});if(!r)return d.jsxs("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:["Chart not found: ",e]});const le=P?{...r.chart.x,label:P.label,format:P.format}:r.chart.x,ge=()=>{var me,Ae;if(!i)return d.jsx("div",{className:"h-full animate-pulse",style:{background:"var(--yc-color-background)"}});if(M==="table"&&i)return d.jsx(om,{data:i.rows,columns:i.columns,height:"100%",loading:l});switch(r.chart.type){case"line":return r.chart.x&&(r.chart.y||r.chart.series)?d.jsx(U2,{ref:y,data:i.rows,columns:i.columns,xAxis:le,yAxis:r.chart.y,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l,onChartClick:R,events:B?g:[]}):null;case"bar":return r.chart.x&&(r.chart.y||r.chart.series)?d.jsx(z2,{ref:y,data:i.rows,xAxis:le,yAxis:r.chart.y,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l,onChartClick:R,events:B?g:[]}):null;case"area":return r.chart.x&&(r.chart.y||r.chart.series)?d.jsx(W2,{ref:y,data:i.rows,xAxis:le,yAxis:r.chart.y,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l,onChartClick:R,events:B?g:[]}):null;case"pie":return r.chart.x&&r.chart.y?d.jsx(Y2,{ref:y,data:i.rows,xAxis:r.chart.x,yAxis:r.chart.y,theme:f==null?void 0:f.theme,height:"100%",loading:l,onChartClick:R}):null;case"donut":return r.chart.x&&r.chart.y?d.jsx($2,{ref:y,data:i.rows,xAxis:r.chart.x,yAxis:r.chart.y,centerValue:r.chart.centerValue,theme:f==null?void 0:f.theme,height:"100%",loading:l,onChartClick:R}):null;case"scatter":return r.chart.x&&r.chart.y?d.jsx(q2,{ref:y,data:i.rows,xAxis:r.chart.x,yAxis:r.chart.y,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l,onChartClick:R}):null;case"combo":return r.chart.x?d.jsx(V2,{ref:y,data:i.rows,xAxis:le,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l,onChartClick:R,events:B?g:[]}):null;case"heatmap":return d.jsx(Q2,{ref:y,data:i.rows,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l});case"funnel":return d.jsx(G2,{ref:y,data:i.rows,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l});case"waterfall":return d.jsx(K2,{ref:y,data:i.rows,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l});case"gauge":return d.jsx(X2,{ref:y,data:i.rows,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l});case"table":return d.jsx(om,{data:i.rows,columns:i.columns,chartConfig:r.chart,height:"100%",loading:l,onRowClick:r.drillDown?(Pe,ct,kt)=>{const bt=r.drillDown,ue=bt.fields?typeof bt.fields=="string"?[bt.fields]:bt.fields:bt.field?[bt.field]:[];if(ue.length===0)return;const ne={};for(const Te of ue)Te in Pe?ne[Te]=String(Pe[Te]??""):kt?ne[Te]=kt:ne[Te]="";ee({x:ct.x,y:ct.y,field:ue[0],value:ne[ue[0]],allFields:ue.length>1?ne:void 0})}:void 0});case"kpi":{const Pe=r.chart;if(!((me=Pe.value)!=null&&me.field)||!i.rows[0])return d.jsx("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"No data available"});const ct=i.rows[0],kt=ct[Pe.value.field],bt=h0(kt,Pe.format);let ue=null,ne="percent_change",Te,Re,Fe;if(i.comparison)ue=i.comparison.change,ne=i.comparison.changeType,Te=i.comparison.currentPeriodLabel,Re=i.comparison.previousPeriodLabel,Fe=h0(i.comparison.previousValue,Pe.format);else if((Ae=Pe.comparison)!=null&&Ae.enabled&&Pe.comparison.field){const Be=ct[Pe.comparison.field];ne=Pe.comparison.type,Be&&Be!==0&&(ue=ne==="percent_change"?(kt-Be)/Be*100:kt-Be,Fe=h0(Be,Pe.format))}return d.jsxs("div",{className:"h-full flex flex-col items-center justify-center p-8",children:[d.jsxs("div",{className:"text-6xl font-bold tabular-nums",style:{color:"var(--yc-color-text)"},children:[bt,Pe.unit&&d.jsx("span",{className:"text-3xl font-normal ml-2",style:{color:"var(--yc-color-text-secondary)"},children:Pe.unit})]}),Te&&d.jsx("div",{className:"text-sm mt-2",style:{color:"var(--yc-color-text-secondary)"},children:Te}),ue!==null&&d.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[d.jsx("span",{className:"text-sm font-medium px-2 py-0.5 rounded",style:ue>=0?{backgroundColor:"color-mix(in srgb, var(--yc-color-success) 15%, transparent)",color:"var(--yc-color-success)"}:{backgroundColor:"color-mix(in srgb, var(--yc-color-danger) 15%, transparent)",color:"var(--yc-color-danger)"},children:nA(ue,ne)}),Fe&&d.jsxs("span",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["vs ",Fe]}),Re&&d.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["(",Re,")"]})]})]})}default:return d.jsxs("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:['Chart type "',r.chart.type,'" not yet implemented']})}};return d.jsx(sd,{fallback:(me,Ae)=>d.jsx("div",{className:"flex items-center justify-center h-full p-8",children:d.jsxs("div",{className:"text-center",children:[d.jsx("p",{className:"text-sm font-medium",style:{color:"var(--yc-color-danger)"},children:"Failed to render chart"}),d.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-secondary)"},children:me.message}),d.jsx("button",{onClick:Ae,className:"mt-2 text-xs hover:opacity-80",style:{color:"var(--yc-color-primary)"},children:"Retry"})]})}),resetKey:e,children:d.jsxs("div",{className:"h-full flex flex-col",children:[d.jsxs("div",{className:"px-6 pt-4 pb-3 space-y-3",children:[!Q&&Y&&d.jsxs("div",{className:"flex items-center gap-1.5 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),d.jsx("a",{href:`#/dashboards/${Y.name}`,className:"hover:underline",style:{color:"var(--yc-color-primary)"},children:Y.title})]}),Q&&d.jsxs("div",{className:"flex items-center gap-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("button",{onClick:()=>{window.location.hash=`/charts/${Q}`},className:"hover:underline",style:{color:"var(--yc-color-primary)"},children:Q}),d.jsx("span",{children:"/"}),d.jsx("span",{style:{color:"var(--yc-color-text)"},className:"font-medium",children:r.title}),ye&&d.jsxs("span",{children:["(",ye,")"]})]}),d.jsxs("div",{className:"flex items-start justify-between gap-4",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-xl font-semibold",style:{color:"var(--yc-color-text)",fontFamily:"var(--yc-font-heading)"},children:r.title}),r.description&&d.jsx("p",{className:"text-sm mt-1",style:{color:"var(--yc-color-text-secondary)"},children:r.description})]}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[d.jsx("button",{onClick:()=>h(e),className:"p-2 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},title:"Refresh",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}),d.jsx(I2,{resourceType:"chart",resourceName:e})]})]}),r.parameters.length>0&&d.jsx(A2,{parameters:r.parameters,chartName:e}),re&&d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx("span",{className:"text-xs font-medium",style:{color:"var(--yc-color-text-secondary)"},children:"Filtered:"}),Object.entries(n).map(([me,Ae])=>d.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:[me,": ",Ae]},me))]})]}),d.jsx("div",{className:"flex-1 min-h-0 px-6",children:d.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:d.jsx(ld,{isLoading:l,error:u,data:i==null?void 0:i.rows,onRetry:()=>h(e),children:ge()})})}),d.jsx("div",{className:"px-6 pb-2",children:d.jsx(f6,{rowCount:i==null?void 0:i.meta.rowCount,durationMs:i==null?void 0:i.meta.durationMs,cached:i==null?void 0:i.meta.cached,view:M,onToggleView:C,onExportCSV:be,onExportPNG:te,onShowSql:()=>D(!I),onShowEvents:S?()=>F(!j):void 0,eventCount:S?g.length:void 0})}),re&&i&&d.jsx("div",{className:"px-6 pb-4",children:d.jsx(L2,{data:i.rows,columns:i.columns,drillDownColumns:(Ye=r.drillDown)==null?void 0:Ye.columns,filterDisplay:ye,chartName:e})}),K&&d.jsx(Z2,{x:K.x,y:K.y,field:K.field,value:K.value,allFields:K.allFields,onViewDetails:(nt=r.drillDown)!=null&&nt.model?ae:void 0,onGoToChart:(tt=r.drillDown)!=null&&tt.chart?J:void 0,onAddEvent:_?ie:void 0,detailModel:(Je=r.drillDown)==null?void 0:Je.model,targetChart:(rt=r.drillDown)==null?void 0:rt.chart,isTemporalChart:S,onClose:()=>ee(null)}),T&&d.jsx(eE,{date:T,onSave:me=>A.mutate(me),onClose:()=>E(null),saving:A.isPending,themePalette:(ut=f==null?void 0:f.theme)==null?void 0:ut.palette}),d.jsx(g6,{isOpen:I,onClose:()=>D(!1),compiledSql:i==null?void 0:i.meta.compiledSql,modelName:e,durationMs:i==null?void 0:i.meta.durationMs,rowCount:i==null?void 0:i.meta.rowCount,cached:i==null?void 0:i.meta.cached}),d.jsx(b6,{isOpen:j,onClose:()=>F(!1),events:g,allEvents:b,chartName:e,canEdit:_,eventsVisible:B,onToggleVisible:W,themePalette:(pe=f==null?void 0:f.theme)==null?void 0:pe.palette})]})})}function sA({chartName:e,params:t}){var f;const n=Object.fromEntries(Object.entries(t).filter(([h])=>!h.startsWith("_"))),{data:r}=or({queryKey:["chart",e],queryFn:()=>xt.getChart(e)}),{data:s,isLoading:i,error:l}=or({queryKey:["chartDetail",e,n],queryFn:()=>xt.queryChartDetail(e,n),enabled:!!e}),u=Object.entries(n).map(([h,p])=>`${h}: ${p}`).join(", ");return i?d.jsx("div",{className:"flex items-center justify-center h-64",children:d.jsx("div",{style:{color:"var(--yc-color-text-secondary)"},children:"Loading details..."})}):l||!s?d.jsx("div",{className:"flex items-center justify-center h-64",children:d.jsxs("div",{style:{color:"var(--yc-color-danger)"},children:["Failed to load details: ",(l==null?void 0:l.message)||"Unknown error"]})}):d.jsxs("div",{className:"p-6",children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm mb-4",children:[d.jsx("button",{onClick:()=>{window.history.back()},className:"hover:underline",style:{color:"var(--yc-color-primary)"},children:"← Back"}),d.jsx("span",{style:{color:"var(--yc-color-text-muted)"},children:"/"}),d.jsxs("span",{className:"font-medium",style:{color:"var(--yc-color-text)"},children:[(r==null?void 0:r.title)??e," — Detail"]})]}),Object.keys(n).length>0&&d.jsx("div",{className:"flex items-center gap-2 mb-4 flex-wrap",children:Object.entries(n).map(([h,p])=>d.jsxs("span",{className:"inline-flex items-center px-2.5 py-1 text-xs rounded-full",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)",border:"1px solid color-mix(in srgb, var(--yc-color-primary) 30%, transparent)"},children:[h,": ",p]},h))}),d.jsx(L2,{data:s.rows,columns:s.columns,drillDownColumns:(f=r==null?void 0:r.drillDown)==null?void 0:f.columns,filterDisplay:u,chartName:e})]})}function oA(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 tE=N.createContext(null);function aA({children:e}){const[t,n]=N.useState(!1),[r,s]=N.useState(null),[i,l]=N.useState(null),[u,f]=N.useState(null),[h,p]=N.useState(null),[y,g]=N.useState(null),b=N.useRef(oA()),[O,w]=N.useState(!1),[T,E]=N.useState(!1),_=r!==null,S=N.useMemo(()=>r||i,[r,i]),A=N.useCallback(B=>{l(B)},[]),M=N.useCallback(B=>{if(B===null){s(null);return}const U=r||i;U&&b.current.push(U),s(B),w(b.current.canUndo()),E(b.current.canRedo())},[r,i]),C=N.useCallback(()=>{const B=b.current.undo();B&&(s(B),w(b.current.canUndo()),E(b.current.canRedo()))},[]),I=N.useCallback(()=>{const B=b.current.redo();B&&(s(B),w(b.current.canUndo()),E(b.current.canRedo()))},[]);N.useEffect(()=>{b.current.clear(),w(!1),E(!1),f(null)},[t]),N.useEffect(()=>{if(!t)return;const B=U=>{const W=U.metaKey||U.ctrlKey;W&&U.key==="z"&&!U.shiftKey&&(U.preventDefault(),C()),W&&U.key==="z"&&U.shiftKey&&(U.preventDefault(),I())};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[t,C,I]);const D=N.useCallback(B=>{var G;const U=r||i;if(!U)return;const Y=B.type==="chart"&&((G=B.ref)==null?void 0:G.toLowerCase().includes("kpi"))?3:6,re={height:100,widgets:[{...B,cols:Y}]},ye={...U,rows:[...U.rows,re]};M(ye)},[r,i,M]),j=N.useCallback((B,U)=>{const W=r||i;if(!W)return;const Y=W.rows.map((re,ye)=>{if(ye!==B)return re;const G=re.widgets.filter((fe,P)=>P!==U);return{...re,widgets:G}}).filter(re=>re.widgets.length>0),Q={...W,rows:Y};M(Q)},[r,i,M]),F=N.useCallback((B,U,W)=>{const Y=r||i;if(!Y)return;const Q=Y.rows.map((ye,G)=>{if(G!==B)return ye;const fe=ye.widgets.map((P,K)=>K!==U?P:{...P,...W});return{...ye,widgets:fe}}),re={...Y,rows:Q};M(re)},[r,i,M]);return d.jsx(tE.Provider,{value:{isEditing:t,setIsEditing:n,pendingLayout:r,setPendingLayout:M,hasChanges:_,originalLayout:i,setOriginalLayout:A,currentLayout:S,addWidget:D,removeWidget:j,updateWidget:F,pendingFilters:u,setPendingFilters:f,pendingTitle:h,setPendingTitle:p,pendingDescription:y,setPendingDescription:g,undo:C,redo:I,canUndo:O,canRedo:T},children:e})}function Oi(){const e=N.useContext(tE);if(!e)throw new Error("useEditMode must be used within EditModeProvider");return e}function Ai(e){const{margin:t,containerPadding:n,containerWidth:r,cols:s}=e;return(r-t[0]*(s-1)-n[0]*2)/s}function vi(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function kl(e,t,n,r,s,i,l){const{margin:u,containerPadding:f,rowHeight:h}=e,p=Ai(e);let y,g,b,O;if(l?(y=Math.round(l.width),g=Math.round(l.height)):(y=vi(r,p,u[0]),g=vi(s,h,u[1])),i?(b=Math.round(i.top),O=Math.round(i.left)):l?(b=Math.round(l.top),O=Math.round(l.left)):(b=Math.round((h+u[1])*n+f[1]),O=Math.round((p+u[0])*t+f[0])),!i&&!l){if(Number.isFinite(r)){const T=Math.round((p+u[0])*(t+r)+f[0])-O-y;T!==u[0]&&(y+=T-u[0])}if(Number.isFinite(s)){const T=Math.round((h+u[1])*(n+s)+f[1])-b-g;T!==u[1]&&(g+=T-u[1])}}return{top:b,left:O,width:y,height:g}}function iA(e,t,n,r,s){const{margin:i,containerPadding:l,cols:u,rowHeight:f,maxRows:h}=e,p=Ai(e);let y=Math.round((n-l[0])/(p+i[0])),g=Math.round((t-l[1])/(f+i[1]));return y=ud(y,0,u-r),g=ud(g,0,h-s),{x:y,y:g}}function Rc(e,t,n){const{margin:r,containerPadding:s,rowHeight:i}=e,l=Ai(e),u=Math.round((n-s[0])/(l+r[0])),f=Math.round((t-s[1])/(i+r[1]));return{x:u,y:f}}function lA(e,t,n){const{margin:r,rowHeight:s}=e,i=Ai(e),l=Math.max(1,Math.round((t+r[0])/(i+r[0]))),u=Math.max(1,Math.round((n+r[1])/(s+r[1])));return{w:l,h:u}}function ud(e,t,n){return Math.max(Math.min(e,n),t)}function rp(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 oa(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0&&rp(r,t))return r}}function nE(e,t){return e.filter(n=>rp(n,t))}function uA(e,t){return t==="horizontal"?rE(e):t==="vertical"||t==="wrap"?im(e):[...e]}function im(e){return[...e].sort((t,n)=>t.y!==n.y?t.y-n.y:t.x-n.x)}function rE(e){return[...e].sort((t,n)=>t.x!==n.x?t.x-n.x:t.y-n.y)}function $d(e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0){const s=r.y+r.h;s>t&&(t=s)}}return t}function Yo(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0&&r.i===t)return r}}function qd(e){return e.filter(t=>t.static===!0)}function ha(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 Co(e){const t=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];r!==void 0&&(t[n]=ha(r))}return t}function cA(e,t){const n=new Array(e.length);for(let r=0;r<e.length;r++){const s=e[r];s!==void 0&&(t.i===s.i?n[r]=t:n[r]=s)}return n}function dA(e,t,n){let r=Yo(e,t);return r?(r=n(ha(r)),[cA(e,r),r]):[[...e],null]}function sp(e,t){const n=qd(e);for(let r=0;r<e.length;r++){const s=e[r];if(s!==void 0)if(s.x+s.w>t.cols&&(s.x=t.cols-s.w),s.x<0&&(s.x=0,s.w=t.cols),!s.static)n.push(s);else for(;oa(n,s);)s.y++}return e}function Qo(e,t,n,r,s,i,l,u,f){if(t.static&&t.isDraggable!==!0)return[...e];if(t.y===r&&t.x===n)return[...e];const h=t.x,p=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let y=uA(e,l);(l==="vertical"&&typeof r=="number"?p>=r:l==="horizontal"&&typeof n=="number"?h>=n:!1)&&(y=y.reverse());const b=nE(y,t),O=b.length>0;if(O&&f)return Co(e);if(O&&i)return t.x=h,t.y=p,t.moved=!1,e;let w=[...e];for(let T=0;T<b.length;T++){const E=b[T];E!==void 0&&(E.moved||(E.static?w=Nx(w,E,t,s,l):w=Nx(w,t,E,s,l)))}return w}function Nx(e,t,n,r,s,i){const l=s==="horizontal",u=s==="vertical",f=t.static;if(r){r=!1;const y={x:l?Math.max(t.x-n.w,0):n.x,y:u?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},g=oa(e,y),b=g!==void 0&&g.y+g.h>t.y,O=g!==void 0&&t.x+t.w>g.x;if(!g)return Qo(e,n,l?y.x:void 0,u?y.y:void 0,r,f,s);if(b&&u)return Qo(e,n,void 0,n.y+1,r,f,s);if(b&&s===null)return t.y=n.y,n.y=n.y+n.h,[...e];if(O&&l)return Qo(e,t,n.x,void 0,r,f,s)}const h=l?n.x+1:void 0,p=u?n.y+1:void 0;return h===void 0&&p===void 0?[...e]:Qo(e,n,h,p,r,f,s)}function Eo(e,t,n){return Math.max(t,Math.min(n,e))}var fA={name:"gridBounds",constrainPosition(e,t,n,{cols:r,maxRows:s}){return{x:Eo(t,0,Math.max(0,r-e.w)),y:Eo(n,0,Math.max(0,s-e.h))}},constrainSize(e,t,n,r,{cols:s,maxRows:i}){const l=r==="w"||r==="nw"||r==="sw"?e.x+e.w:s-e.x,u=r==="n"||r==="nw"||r==="ne"?e.y+e.h:i-e.y;return{w:Eo(t,1,Math.max(1,l)),h:Eo(n,1,Math.max(1,u))}}},hA={name:"minMaxSize",constrainSize(e,t,n){return{w:Eo(t,e.minW??1,e.maxW??1/0),h:Eo(n,e.minH??1,e.maxH??1/0)}}},mA={name:"containerBounds",constrainPosition(e,t,n,{cols:r,maxRows:s,containerHeight:i,rowHeight:l,margin:u}){const f=i>0?Math.floor((i+u[1])/(l+u[1])):s;return{x:Eo(t,0,Math.max(0,r-e.w)),y:Eo(n,0,Math.max(0,f-e.h))}}},cd=[fA,hA];function Pc(e,t,n,r,s){let i={x:n,y:r};for(const l of e)l.constrainPosition&&(i=l.constrainPosition(t,i.x,i.y,s));if(t.constraints)for(const l of t.constraints)l.constrainPosition&&(i=l.constrainPosition(t,i.x,i.y,s));return i}function pA(e,t,n,r,s,i){let l={w:n,h:r};for(const u of e)u.constrainSize&&(l=u.constrainSize(t,l.w,l.h,s,i));if(t.constraints)for(const u of t.constraints)u.constrainSize&&(l=u.constrainSize(t,l.w,l.h,s,i));return l}function op({top:e,left:t,width:n,height:r}){const s=`translate(${t}px,${e}px)`;return{transform:s,WebkitTransform:s,MozTransform:s,msTransform:s,OTransform:s,width:`${n}px`,height:`${r}px`,position:"absolute"}}function sE({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:"absolute"}}function _x(e){return e*100+"%"}function yA(e,t,n,r){return e+n>r?t:n}function oE(e,t,n){return e<0?t:n}function gA(e){return Math.max(0,e)}function dd(e){return Math.max(0,e)}var ap=(e,t,n)=>{const{left:r,height:s,width:i}=t,l=e.top-(s-e.height);return{left:r,width:i,height:oE(l,e.height,s),top:dd(l)}},ip=(e,t,n)=>{const{top:r,left:s,height:i,width:l}=t;return{top:r,height:i,width:yA(e.left,e.width,l,n),left:gA(s)}},lp=(e,t,n)=>{const{top:r,height:s,width:i}=t,l=e.left+e.width-i;return l<0?{height:s,width:e.left+e.width,top:dd(r),left:0}:{height:s,width:i,top:dd(r),left:l}},up=(e,t,n)=>{const{top:r,left:s,height:i,width:l}=t;return{width:l,left:s,height:oE(r,e.height,i),top:dd(r)}},xA=(e,t,n)=>ap(e,ip(e,t,n)),bA=(e,t,n)=>ap(e,lp(e,t)),vA=(e,t,n)=>up(e,ip(e,t,n)),EA=(e,t,n)=>up(e,lp(e,t)),TA={n:ap,ne:xA,e:ip,se:vA,s:up,sw:EA,w:lp,nw:bA};function wA(e,t,n,r){const s=TA[e];return s?s(t,{...t,...n},r):n}var cp={type:"transform",scale:1,calcStyle(e){return op(e)}},aE={type:"absolute",scale:1,calcStyle(e){return sE(e)}};function iE(e){return{type:"transform",scale:e,calcStyle(t){return op(t)},calcDragPosition(t,n,r,s){return{left:(t-r)/e,top:(n-s)/e}}}}var kA=cp,SA={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},CA={enabled:!0,bounded:!1,threshold:3},NA={enabled:!0,handles:["se"]},_A={enabled:!1,defaultItem:{w:1,h:1}};function dp(e,t,n,r,s){const i=r==="x"?"w":"h";t[r]+=1;const l=e.findIndex(f=>f.i===t.i),u=s??qd(e).length>0;for(let f=l+1;f<e.length;f++){const h=e[f];if(h!==void 0&&!h.static){if(!u&&h.y>t.y+t.h)break;rp(t,h)&&dp(e,h,n+t[i],r,u)}}t[r]=n}function DA(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&&!oa(e,t);)t.y--;let s;for(;(s=oa(e,t))!==void 0;)dp(n,t,s.y+s.h,"y");return t.y=Math.max(t.y,0),t}function OA(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!oa(e,t);)t.x--;let s;for(;(s=oa(e,t))!==void 0;)if(dp(r,t,s.x+s.w,"x"),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!oa(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var lE={type:"vertical",allowOverlap:!1,compact(e,t){const n=qd(e);let r=$d(n);const s=im(e),i=new Array(e.length);for(let l=0;l<s.length;l++){const u=s[l];if(u===void 0)continue;let f=ha(u);f.static||(f=DA(n,f,s,r),r=Math.max(r,f.y+f.h),n.push(f));const h=e.indexOf(u);i[h]=f,f.moved=!1}return i}},uE={type:"horizontal",allowOverlap:!1,compact(e,t){const n=qd(e),r=rE(e),s=new Array(e.length);for(let i=0;i<r.length;i++){const l=r[i];if(l===void 0)continue;let u=ha(l);u.static||(u=OA(n,u,t,r),n.push(u));const f=e.indexOf(l);s[f]=u,u.moved=!1}return s}},cE={type:null,allowOverlap:!1,compact(e,t){return Co(e)}},AA={...lE,allowOverlap:!0,compact(e,t){return Co(e)}},IA={...uE,allowOverlap:!0,compact(e,t){return Co(e)}},MA={...cE,allowOverlap:!0};function yu(e,t=!1,n=!1){let r;return t?e==="vertical"?r=AA:e==="horizontal"?r=IA:r=MA:e==="vertical"?r=lE:e==="horizontal"?r=uE:r=cE,n?{...r,preventCollision:n}:r}function dE(e){return Object.keys(e).sort((n,r)=>e[n]-e[r])}function Dx(e,t){const n=dE(e);let r=n[0];if(r===void 0)throw new Error("No breakpoints defined");for(let s=1;s<n.length;s++){const i=n[s];if(i===void 0)continue;const l=e[i];t>l&&(r=i)}return r}function Ox(e,t){const n=t[e];if(n===void 0)throw new Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function m0(e,t,n,r,s,i){const l=e[n];if(l)return Co(l);let u=e[r];const f=dE(t),h=f.slice(f.indexOf(n));for(let b=0;b<h.length;b++){const O=h[b];if(O===void 0)continue;const w=e[O];if(w){u=w;break}}const p=Co(u||[]),y=sp(p,{cols:s});return(typeof i=="object"&&i!==null?i:yu(i)).compact(y,s)}function jc(e,t){if(Array.isArray(e))return e;const n=e,r=n[t];if(r!==void 0)return r;const s=Object.keys(n);for(const i of s){const l=n[i];if(l!==void 0)return l}return[10,10]}var Sl={exports:{}},p0={},y0={exports:{}},g0,Ax;function LA(){if(Ax)return g0;Ax=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return g0=e,g0}var x0,Ix;function RA(){if(Ix)return x0;Ix=1;var e=LA();function t(){}function n(){}return n.resetWarningCache=t,x0=function(){function r(l,u,f,h,p,y){if(y!==e){var g=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 g.name="Invariant Violation",g}}r.isRequired=r;function s(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},x0}var Mx;function Vd(){return Mx||(Mx=1,y0.exports=RA()()),y0.exports}var Fc={exports:{}},Lx;function PA(){if(Lx)return Fc.exports;Lx=1;function e(n){var r,s,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var l=n.length;for(r=0;r<l;r++)n[r]&&(s=e(n[r]))&&(i&&(i+=" "),i+=s)}else for(s in n)n[s]&&(i&&(i+=" "),i+=s);return i}function t(){for(var n,r,s=0,i="",l=arguments.length;s<l;s++)(n=arguments[s])&&(r=e(n))&&(i&&(i+=" "),i+=r);return i}return Fc.exports=t,Fc.exports.clsx=t,Fc.exports}var mn={},oo={},Rx;function Qd(){if(Rx)return oo;Rx=1,Object.defineProperty(oo,"__esModule",{value:!0}),oo.dontSetMe=s,oo.findInArray=e,oo.int=r,oo.isFunction=t,oo.isNum=n;function e(i,l){for(let u=0,f=i.length;u<f;u++)if(l.apply(l,[i[u],u,i]))return i[u]}function t(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Function]"}function n(i){return typeof i=="number"&&!isNaN(i)}function r(i){return parseInt(i,10)}function s(i,l,u){if(i[l])return new Error(`Invalid prop ${l} passed to ${u} - do not set this, set it on the child.`)}return oo}var ao={},Px;function jA(){if(Px)return ao;Px=1,Object.defineProperty(ao,"__esModule",{value:!0}),ao.browserPrefixToKey=n,ao.browserPrefixToStyle=r,ao.default=void 0,ao.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var u,f;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const l=(f=(u=window.document)==null?void 0:u.documentElement)==null?void 0:f.style;if(!l||i in l)return"";for(let h=0;h<e.length;h++)if(n(i,e[h])in l)return e[h];return""}function n(i,l){return l?`${l}${s(i)}`:i}function r(i,l){return l?`-${l.toLowerCase()}-${i}`:i}function s(i){let l="",u=!0;for(let f=0;f<i.length;f++)u?(l+=i[f].toUpperCase(),u=!1):i[f]==="-"?u=!0:l+=i[f];return l}return ao.default=t(),ao}var jx;function fp(){if(jx)return mn;jx=1,Object.defineProperty(mn,"__esModule",{value:!0}),mn.addClassName=M,mn.addEvent=l,mn.addUserSelectStyles=_,mn.createCSSTransform=b,mn.createSVGTransform=O,mn.getTouch=T,mn.getTouchIdentifier=E,mn.getTranslation=w,mn.innerHeight=p,mn.innerWidth=y,mn.matchesSelector=s,mn.matchesSelectorAndParentsTo=i,mn.offsetXYFromParent=g,mn.outerHeight=f,mn.outerWidth=h,mn.removeClassName=C,mn.removeEvent=u,mn.scheduleRemoveUserSelectStyles=S;var e=Qd(),t=n(jA());function n(I,D){if(typeof WeakMap=="function")var j=new WeakMap,F=new WeakMap;return(n=function(B,U){if(!U&&B&&B.__esModule)return B;var W,Y,Q={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return Q;if(W=U?F:j){if(W.has(B))return W.get(B);W.set(B,Q)}for(const re in B)re!=="default"&&{}.hasOwnProperty.call(B,re)&&((Y=(W=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,re))&&(Y.get||Y.set)?W(Q,re,Y):Q[re]=B[re]);return Q})(I,D)}let r="";function s(I,D){return r||(r=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(j){return(0,e.isFunction)(I[j])})),(0,e.isFunction)(I[r])?I[r](D):!1}function i(I,D,j){let F=I;do{if(s(F,D))return!0;if(F===j)return!1;F=F.parentNode}while(F);return!1}function l(I,D,j,F){if(!I)return;const B={capture:!0,...F};I.addEventListener?I.addEventListener(D,j,B):I.attachEvent?I.attachEvent("on"+D,j):I["on"+D]=j}function u(I,D,j,F){if(!I)return;const B={capture:!0,...F};I.removeEventListener?I.removeEventListener(D,j,B):I.detachEvent?I.detachEvent("on"+D,j):I["on"+D]=null}function f(I){let D=I.clientHeight;const j=I.ownerDocument.defaultView.getComputedStyle(I);return D+=(0,e.int)(j.borderTopWidth),D+=(0,e.int)(j.borderBottomWidth),D}function h(I){let D=I.clientWidth;const j=I.ownerDocument.defaultView.getComputedStyle(I);return D+=(0,e.int)(j.borderLeftWidth),D+=(0,e.int)(j.borderRightWidth),D}function p(I){let D=I.clientHeight;const j=I.ownerDocument.defaultView.getComputedStyle(I);return D-=(0,e.int)(j.paddingTop),D-=(0,e.int)(j.paddingBottom),D}function y(I){let D=I.clientWidth;const j=I.ownerDocument.defaultView.getComputedStyle(I);return D-=(0,e.int)(j.paddingLeft),D-=(0,e.int)(j.paddingRight),D}function g(I,D,j){const B=D===D.ownerDocument.body?{left:0,top:0}:D.getBoundingClientRect(),U=(I.clientX+D.scrollLeft-B.left)/j,W=(I.clientY+D.scrollTop-B.top)/j;return{x:U,y:W}}function b(I,D){const j=w(I,D,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:j}}function O(I,D){return w(I,D,"")}function w(I,D,j){let{x:F,y:B}=I,U=`translate(${F}${j},${B}${j})`;if(D){const W=`${typeof D.x=="string"?D.x:D.x+j}`,Y=`${typeof D.y=="string"?D.y:D.y+j}`;U=`translate(${W}, ${Y})`+U}return U}function T(I,D){return I.targetTouches&&(0,e.findInArray)(I.targetTouches,j=>D===j.identifier)||I.changedTouches&&(0,e.findInArray)(I.changedTouches,j=>D===j.identifier)}function E(I){if(I.targetTouches&&I.targetTouches[0])return I.targetTouches[0].identifier;if(I.changedTouches&&I.changedTouches[0])return I.changedTouches[0].identifier}function _(I){if(!I)return;let D=I.getElementById("react-draggable-style-el");D||(D=I.createElement("style"),D.type="text/css",D.id="react-draggable-style-el",D.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
127
|
-
`,D.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
128
|
-
`,I.getElementsByTagName("head")[0].appendChild(D)),I.body&&M(I.body,"react-draggable-transparent-selection")}function S(I){window.requestAnimationFrame?window.requestAnimationFrame(()=>{A(I)}):A(I)}function A(I){if(I)try{if(I.body&&C(I.body,"react-draggable-transparent-selection"),I.selection)I.selection.empty();else{const D=(I.defaultView||window).getSelection();D&&D.type!=="Caret"&&D.removeAllRanges()}}catch{}}function M(I,D){I.classList?I.classList.add(D):I.className.match(new RegExp(`(?:^|\\s)${D}(?!\\S)`))||(I.className+=` ${D}`)}function C(I,D){I.classList?I.classList.remove(D):I.className=I.className.replace(new RegExp(`(?:^|\\s)${D}(?!\\S)`,"g"),"")}return mn}var Zr={},Fx;function fE(){if(Fx)return Zr;Fx=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.canDragX=s,Zr.canDragY=i,Zr.createCoreData=u,Zr.createDraggableData=f,Zr.getBoundPosition=n,Zr.getControlPosition=l,Zr.snapToGrid=r;var e=Qd(),t=fp();function n(y,g,b){if(!y.props.bounds)return[g,b];let{bounds:O}=y.props;O=typeof O=="string"?O:h(O);const w=p(y);if(typeof O=="string"){const{ownerDocument:T}=w,E=T.defaultView;let _;if(O==="parent"?_=w.parentNode:_=w.getRootNode().querySelector(O),!(_ instanceof E.HTMLElement))throw new Error('Bounds selector "'+O+'" could not find an element.');const S=_,A=E.getComputedStyle(w),M=E.getComputedStyle(S);O={left:-w.offsetLeft+(0,e.int)(M.paddingLeft)+(0,e.int)(A.marginLeft),top:-w.offsetTop+(0,e.int)(M.paddingTop)+(0,e.int)(A.marginTop),right:(0,t.innerWidth)(S)-(0,t.outerWidth)(w)-w.offsetLeft+(0,e.int)(M.paddingRight)-(0,e.int)(A.marginRight),bottom:(0,t.innerHeight)(S)-(0,t.outerHeight)(w)-w.offsetTop+(0,e.int)(M.paddingBottom)-(0,e.int)(A.marginBottom)}}return(0,e.isNum)(O.right)&&(g=Math.min(g,O.right)),(0,e.isNum)(O.bottom)&&(b=Math.min(b,O.bottom)),(0,e.isNum)(O.left)&&(g=Math.max(g,O.left)),(0,e.isNum)(O.top)&&(b=Math.max(b,O.top)),[g,b]}function r(y,g,b){const O=Math.round(g/y[0])*y[0],w=Math.round(b/y[1])*y[1];return[O,w]}function s(y){return y.props.axis==="both"||y.props.axis==="x"}function i(y){return y.props.axis==="both"||y.props.axis==="y"}function l(y,g,b){const O=typeof g=="number"?(0,t.getTouch)(y,g):null;if(typeof g=="number"&&!O)return null;const w=p(b),T=b.props.offsetParent||w.offsetParent||w.ownerDocument.body;return(0,t.offsetXYFromParent)(O||y,T,b.props.scale)}function u(y,g,b){const O=!(0,e.isNum)(y.lastX),w=p(y);return O?{node:w,deltaX:0,deltaY:0,lastX:g,lastY:b,x:g,y:b}:{node:w,deltaX:g-y.lastX,deltaY:b-y.lastY,lastX:y.lastX,lastY:y.lastY,x:g,y:b}}function f(y,g){const b=y.props.scale;return{node:g.node,x:y.state.x+g.deltaX/b,y:y.state.y+g.deltaY/b,deltaX:g.deltaX/b,deltaY:g.deltaY/b,lastX:y.state.x,lastY:y.state.y}}function h(y){return{left:y.left,top:y.top,right:y.right,bottom:y.bottom}}function p(y){const g=y.findDOMNode();if(!g)throw new Error("<DraggableCore>: Unmounted during event!");return g}return Zr}var Cl={},Bc={},Bx;function hE(){if(Bx)return Bc;Bx=1,Object.defineProperty(Bc,"__esModule",{value:!0}),Bc.default=e;function e(){}return Bc}var Hx;function FA(){if(Hx)return Cl;Hx=1,Object.defineProperty(Cl,"__esModule",{value:!0}),Cl.default=void 0;var e=f(ma()),t=u(Vd()),n=u(pd()),r=fp(),s=fE(),i=Qd(),l=u(hE());function u(w){return w&&w.__esModule?w:{default:w}}function f(w,T){if(typeof WeakMap=="function")var E=new WeakMap,_=new WeakMap;return(f=function(S,A){if(!A&&S&&S.__esModule)return S;var M,C,I={__proto__:null,default:S};if(S===null||typeof S!="object"&&typeof S!="function")return I;if(M=A?_:E){if(M.has(S))return M.get(S);M.set(S,I)}for(const D in S)D!=="default"&&{}.hasOwnProperty.call(S,D)&&((C=(M=Object.defineProperty)&&Object.getOwnPropertyDescriptor(S,D))&&(C.get||C.set)?M(I,D,C):I[D]=S[D]);return I})(w,T)}function h(w,T,E){return(T=p(T))in w?Object.defineProperty(w,T,{value:E,enumerable:!0,configurable:!0,writable:!0}):w[T]=E,w}function p(w){var T=y(w,"string");return typeof T=="symbol"?T:T+""}function y(w,T){if(typeof w!="object"||!w)return w;var E=w[Symbol.toPrimitive];if(E!==void 0){var _=E.call(w,T);if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(w)}const g={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let b=g.mouse,O=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",T=>{if(this.props.onMouseDown(T),!this.props.allowAnyClick&&typeof T.button=="number"&&T.button!==0)return!1;const E=this.findDOMNode();if(!E||!E.ownerDocument||!E.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:_}=E;if(this.props.disabled||!(T.target instanceof _.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(T.target,this.props.handle,E)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(T.target,this.props.cancel,E))return;T.type==="touchstart"&&!this.props.allowMobileScroll&&T.preventDefault();const S=(0,r.getTouchIdentifier)(T);this.touchIdentifier=S;const A=(0,s.getControlPosition)(T,S,this);if(A==null)return;const{x:M,y:C}=A,I=(0,s.createCoreData)(this,M,C);(0,l.default)("DraggableCore: handleDragStart: %j",I),(0,l.default)("calling",this.props.onStart),!(this.props.onStart(T,I)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(_),this.dragging=!0,this.lastX=M,this.lastY=C,(0,r.addEvent)(_,b.move,this.handleDrag),(0,r.addEvent)(_,b.stop,this.handleDragStop))}),h(this,"handleDrag",T=>{const E=(0,s.getControlPosition)(T,this.touchIdentifier,this);if(E==null)return;let{x:_,y:S}=E;if(Array.isArray(this.props.grid)){let C=_-this.lastX,I=S-this.lastY;if([C,I]=(0,s.snapToGrid)(this.props.grid,C,I),!C&&!I)return;_=this.lastX+C,S=this.lastY+I}const A=(0,s.createCoreData)(this,_,S);if((0,l.default)("DraggableCore: handleDrag: %j",A),this.props.onDrag(T,A)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const I=document.createEvent("MouseEvents");I.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(I)}return}this.lastX=_,this.lastY=S}),h(this,"handleDragStop",T=>{if(!this.dragging)return;const E=(0,s.getControlPosition)(T,this.touchIdentifier,this);if(E==null)return;let{x:_,y:S}=E;if(Array.isArray(this.props.grid)){let I=_-this.lastX||0,D=S-this.lastY||0;[I,D]=(0,s.snapToGrid)(this.props.grid,I,D),_=this.lastX+I,S=this.lastY+D}const A=(0,s.createCoreData)(this,_,S);if(this.props.onStop(T,A)===!1||this.mounted===!1)return!1;const C=this.findDOMNode();C&&this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(C.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",A),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,C&&((0,l.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(C.ownerDocument,b.move,this.handleDrag),(0,r.removeEvent)(C.ownerDocument,b.stop,this.handleDragStop))}),h(this,"onMouseDown",T=>(b=g.mouse,this.handleDragStart(T))),h(this,"onMouseUp",T=>(b=g.mouse,this.handleDragStop(T))),h(this,"onTouchStart",T=>(b=g.touch,this.handleDragStart(T))),h(this,"onTouchEnd",T=>(b=g.touch,this.handleDragStop(T)))}componentDidMount(){this.mounted=!0;const T=this.findDOMNode();T&&(0,r.addEvent)(T,g.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const T=this.findDOMNode();if(T){const{ownerDocument:E}=T;(0,r.removeEvent)(E,g.mouse.move,this.handleDrag),(0,r.removeEvent)(E,g.touch.move,this.handleDrag),(0,r.removeEvent)(E,g.mouse.stop,this.handleDragStop),(0,r.removeEvent)(E,g.touch.stop,this.handleDragStop),(0,r.removeEvent)(T,g.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(E)}}findDOMNode(){var T,E,_;return(T=this.props)!=null&&T.nodeRef?(_=(E=this.props)==null?void 0:E.nodeRef)==null?void 0:_.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 Cl.default=O,h(O,"displayName","DraggableCore"),h(O,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(w,T){if(w[T]&&w[T].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:i.dontSetMe,style:i.dontSetMe,transform:i.dontSetMe}),h(O,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Cl}var Ux;function BA(){return Ux||(Ux=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return f.default}}),e.default=void 0;var t=y(ma()),n=p(Vd()),r=p(pd()),s=PA(),i=fp(),l=fE(),u=Qd(),f=p(FA()),h=p(hE());function p(E){return E&&E.__esModule?E:{default:E}}function y(E,_){if(typeof WeakMap=="function")var S=new WeakMap,A=new WeakMap;return(y=function(M,C){if(!C&&M&&M.__esModule)return M;var I,D,j={__proto__:null,default:M};if(M===null||typeof M!="object"&&typeof M!="function")return j;if(I=C?A:S){if(I.has(M))return I.get(M);I.set(M,j)}for(const F in M)F!=="default"&&{}.hasOwnProperty.call(M,F)&&((D=(I=Object.defineProperty)&&Object.getOwnPropertyDescriptor(M,F))&&(D.get||D.set)?I(j,F,D):j[F]=M[F]);return j})(E,_)}function g(){return g=Object.assign?Object.assign.bind():function(E){for(var _=1;_<arguments.length;_++){var S=arguments[_];for(var A in S)({}).hasOwnProperty.call(S,A)&&(E[A]=S[A])}return E},g.apply(null,arguments)}function b(E,_,S){return(_=O(_))in E?Object.defineProperty(E,_,{value:S,enumerable:!0,configurable:!0,writable:!0}):E[_]=S,E}function O(E){var _=w(E,"string");return typeof _=="symbol"?_:_+""}function w(E,_){if(typeof E!="object"||!E)return E;var S=E[Symbol.toPrimitive];if(S!==void 0){var A=S.call(E,_);if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(E)}class T extends t.Component{static getDerivedStateFromProps(_,S){let{position:A}=_,{prevPropsPosition:M}=S;return A&&(!M||A.x!==M.x||A.y!==M.y)?((0,h.default)("Draggable: getDerivedStateFromProps %j",{position:A,prevPropsPosition:M}),{x:A.x,y:A.y,prevPropsPosition:{...A}}):null}constructor(_){super(_),b(this,"onDragStart",(S,A)=>{if((0,h.default)("Draggable: onDragStart: %j",A),this.props.onStart(S,(0,l.createDraggableData)(this,A))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),b(this,"onDrag",(S,A)=>{if(!this.state.dragging)return!1;(0,h.default)("Draggable: onDrag: %j",A);const M=(0,l.createDraggableData)(this,A),C={x:M.x,y:M.y,slackX:0,slackY:0};if(this.props.bounds){const{x:D,y:j}=C;C.x+=this.state.slackX,C.y+=this.state.slackY;const[F,B]=(0,l.getBoundPosition)(this,C.x,C.y);C.x=F,C.y=B,C.slackX=this.state.slackX+(D-C.x),C.slackY=this.state.slackY+(j-C.y),M.x=C.x,M.y=C.y,M.deltaX=C.x-this.state.x,M.deltaY=C.y-this.state.y}if(this.props.onDrag(S,M)===!1)return!1;this.setState(C)}),b(this,"onDragStop",(S,A)=>{if(!this.state.dragging||this.props.onStop(S,(0,l.createDraggableData)(this,A))===!1)return!1;(0,h.default)("Draggable: onDragStop: %j",A);const C={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:D,y:j}=this.props.position;C.x=D,C.y=j}this.setState(C)}),this.state={dragging:!1,dragged:!1,x:_.position?_.position.x:_.defaultPosition.x,y:_.position?_.position.y:_.defaultPosition.y,prevPropsPosition:{..._.position},slackX:0,slackY:0,isElementSVG:!1},_.position&&!(_.onDrag||_.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 _,S;return((S=(_=this.props)==null?void 0:_.nodeRef)==null?void 0:S.current)??r.default.findDOMNode(this)}render(){const{axis:_,bounds:S,children:A,defaultPosition:M,defaultClassName:C,defaultClassNameDragging:I,defaultClassNameDragged:D,position:j,positionOffset:F,scale:B,...U}=this.props;let W={},Y=null;const re=!!!j||this.state.dragging,ye=j||M,G={x:(0,l.canDragX)(this)&&re?this.state.x:ye.x,y:(0,l.canDragY)(this)&&re?this.state.y:ye.y};this.state.isElementSVG?Y=(0,i.createSVGTransform)(G,F):W=(0,i.createCSSTransform)(G,F);const fe=(0,s.clsx)(A.props.className||"",C,{[I]:this.state.dragging,[D]:this.state.dragged});return t.createElement(f.default,g({},U,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(A),{className:fe,style:{...A.props.style,...W},transform:Y}))}}e.default=T,b(T,"displayName","Draggable"),b(T,"propTypes",{...f.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:u.dontSetMe,style:u.dontSetMe,transform:u.dontSetMe}),b(T,"defaultProps",{...f.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(p0)),p0}var zx;function hp(){if(zx)return Sl.exports;zx=1;const{default:e,DraggableCore:t}=BA();return Sl.exports=e,Sl.exports.default=e,Sl.exports.DraggableCore=t,Sl.exports}var HA=hp(),Nl={exports:{}},_l={},Hc={},Wx;function UA(){if(Wx)return Hc;Wx=1,Hc.__esModule=!0,Hc.cloneElement=u;var e=t(ma());function t(f){return f&&f.__esModule?f:{default:f}}function n(f,h){var p=Object.keys(f);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(f);h&&(y=y.filter(function(g){return Object.getOwnPropertyDescriptor(f,g).enumerable})),p.push.apply(p,y)}return p}function r(f){for(var h=1;h<arguments.length;h++){var p=arguments[h]!=null?arguments[h]:{};h%2?n(Object(p),!0).forEach(function(y){s(f,y,p[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(p)):n(Object(p)).forEach(function(y){Object.defineProperty(f,y,Object.getOwnPropertyDescriptor(p,y))})}return f}function s(f,h,p){return(h=i(h))in f?Object.defineProperty(f,h,{value:p,enumerable:!0,configurable:!0,writable:!0}):f[h]=p,f}function i(f){var h=l(f,"string");return typeof h=="symbol"?h:h+""}function l(f,h){if(typeof f!="object"||!f)return f;var p=f[Symbol.toPrimitive];if(p!==void 0){var y=p.call(f,h);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(f)}function u(f,h){return h.style&&f.props.style&&(h.style=r(r({},f.props.style),h.style)),h.className&&f.props.className&&(h.className=`${f.props.className} ${h.className}`),e.default.cloneElement(f,h)}return Hc}var Dl={},Yx;function mE(){if(Yx)return Dl;Yx=1,Dl.__esModule=!0,Dl.resizableProps=void 0;var e=t(Vd());hp();function t(n){return n&&n.__esModule?n:{default:n}}return Dl.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),s=0;s<n;s++)r[s]=arguments[s];const[i]=r;return i.axis==="both"||i.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),s=0;s<n;s++)r[s]=arguments[s];const[i]=r;return i.axis==="both"||i.axis==="x"?e.default.number.isRequired(...r):e.default.number(...r)}},Dl}var $x;function pE(){if($x)return _l;$x=1,_l.__esModule=!0,_l.default=void 0;var e=i(ma()),t=hp(),n=UA(),r=mE();const s=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function i(w,T){if(typeof WeakMap=="function")var E=new WeakMap,_=new WeakMap;return(i=function(S,A){if(!A&&S&&S.__esModule)return S;var M,C,I={__proto__:null,default:S};if(S===null||typeof S!="object"&&typeof S!="function")return I;if(M=A?_:E){if(M.has(S))return M.get(S);M.set(S,I)}for(const D in S)D!=="default"&&{}.hasOwnProperty.call(S,D)&&((C=(M=Object.defineProperty)&&Object.getOwnPropertyDescriptor(S,D))&&(C.get||C.set)?M(I,D,C):I[D]=S[D]);return I})(w,T)}function l(){return l=Object.assign?Object.assign.bind():function(w){for(var T=1;T<arguments.length;T++){var E=arguments[T];for(var _ in E)({}).hasOwnProperty.call(E,_)&&(w[_]=E[_])}return w},l.apply(null,arguments)}function u(w,T){if(w==null)return{};var E,_,S=f(w,T);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(w);for(_=0;_<A.length;_++)E=A[_],T.indexOf(E)===-1&&{}.propertyIsEnumerable.call(w,E)&&(S[E]=w[E])}return S}function f(w,T){if(w==null)return{};var E={};for(var _ in w)if({}.hasOwnProperty.call(w,_)){if(T.indexOf(_)!==-1)continue;E[_]=w[_]}return E}function h(w,T){var E=Object.keys(w);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(w);T&&(_=_.filter(function(S){return Object.getOwnPropertyDescriptor(w,S).enumerable})),E.push.apply(E,_)}return E}function p(w){for(var T=1;T<arguments.length;T++){var E=arguments[T]!=null?arguments[T]:{};T%2?h(Object(E),!0).forEach(function(_){y(w,_,E[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(E)):h(Object(E)).forEach(function(_){Object.defineProperty(w,_,Object.getOwnPropertyDescriptor(E,_))})}return w}function y(w,T,E){return(T=g(T))in w?Object.defineProperty(w,T,{value:E,enumerable:!0,configurable:!0,writable:!0}):w[T]=E,w}function g(w){var T=b(w,"string");return typeof T=="symbol"?T:T+""}function b(w,T){if(typeof w!="object"||!w)return w;var E=w[Symbol.toPrimitive];if(E!==void 0){var _=E.call(w,T);if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(w)}let O=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(T,E){const{minConstraints:_,maxConstraints:S,lockAspectRatio:A}=this.props;if(!_&&!S&&!A)return[T,E];if(A){const j=this.props.width/this.props.height,F=T-this.props.width,B=E-this.props.height;Math.abs(F)>Math.abs(B*j)?E=T/j:T=E*j}const[M,C]=[T,E];let[I,D]=this.slack||[0,0];return T+=I,E+=D,_&&(T=Math.max(_[0],T),E=Math.max(_[1],E)),S&&(T=Math.min(S[0],T),E=Math.min(S[1],E)),this.slack=[I+(M-T),D+(C-E)],[T,E]}resizeHandler(T,E){return(_,S)=>{var ye;let{node:A,deltaX:M,deltaY:C}=S;T==="onResizeStart"&&this.resetData();const I=(this.props.axis==="both"||this.props.axis==="x")&&E!=="n"&&E!=="s",D=(this.props.axis==="both"||this.props.axis==="y")&&E!=="e"&&E!=="w";if(!I&&!D)return;const j=E[0],F=E[E.length-1],B=A.getBoundingClientRect();if(this.lastHandleRect!=null){if(F==="w"){const G=B.left-this.lastHandleRect.left;M+=G}if(j==="n"){const G=B.top-this.lastHandleRect.top;C+=G}}this.lastHandleRect=B,F==="w"&&(M=-M),j==="n"&&(C=-C);let U=this.props.width+(I?M/this.props.transformScale:0),W=this.props.height+(D?C/this.props.transformScale:0);[U,W]=this.runConstraints(U,W),T==="onResizeStop"&&this.lastSize&&({width:U,height:W}=this.lastSize);const Y=U!==this.props.width||W!==this.props.height;T!=="onResizeStop"&&(this.lastSize={width:U,height:W});const Q=typeof this.props[T]=="function"?this.props[T]:null;Q&&!(T==="onResize"&&!Y)&&((ye=_.persist)==null||ye.call(_),Q(_,{node:A,size:{width:U,height:W},handle:E})),T==="onResizeStop"&&this.resetData()}}renderResizeHandle(T,E){const{handle:_}=this.props;if(!_)return e.createElement("span",{className:`react-resizable-handle react-resizable-handle-${T}`,ref:E});if(typeof _=="function")return _(T,E);const S=typeof _.type=="string",A=p({ref:E},S?{}:{handleAxis:T});return e.cloneElement(_,A)}render(){const T=this.props,{children:E,className:_,draggableOpts:S,width:A,height:M,handle:C,handleSize:I,lockAspectRatio:D,axis:j,minConstraints:F,maxConstraints:B,onResize:U,onResizeStop:W,onResizeStart:Y,resizeHandles:Q,transformScale:re}=T,ye=u(T,s);return(0,n.cloneElement)(E,p(p({},ye),{},{className:`${_?`${_} `:""}react-resizable`,children:[...e.Children.toArray(E.props.children),...Q.map(G=>{const fe=this.handleRefs[G]??(this.handleRefs[G]=e.createRef());return e.createElement(t.DraggableCore,l({},S,{nodeRef:fe,key:`resizableHandle-${G}`,onStop:this.resizeHandler("onResizeStop",G),onStart:this.resizeHandler("onResizeStart",G),onDrag:this.resizeHandler("onResize",G)}),this.renderResizeHandle(G,fe))})]}))}};return _l.default=O,O.propTypes=r.resizableProps,O.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},_l}var Ol={},qx;function zA(){if(qx)return Ol;qx=1,Ol.__esModule=!0,Ol.default=void 0;var e=l(ma()),t=i(Vd()),n=i(pE()),r=mE();const s=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function i(T){return T&&T.__esModule?T:{default:T}}function l(T,E){if(typeof WeakMap=="function")var _=new WeakMap,S=new WeakMap;return(l=function(A,M){if(!M&&A&&A.__esModule)return A;var C,I,D={__proto__:null,default:A};if(A===null||typeof A!="object"&&typeof A!="function")return D;if(C=M?S:_){if(C.has(A))return C.get(A);C.set(A,D)}for(const j in A)j!=="default"&&{}.hasOwnProperty.call(A,j)&&((I=(C=Object.defineProperty)&&Object.getOwnPropertyDescriptor(A,j))&&(I.get||I.set)?C(D,j,I):D[j]=A[j]);return D})(T,E)}function u(){return u=Object.assign?Object.assign.bind():function(T){for(var E=1;E<arguments.length;E++){var _=arguments[E];for(var S in _)({}).hasOwnProperty.call(_,S)&&(T[S]=_[S])}return T},u.apply(null,arguments)}function f(T,E){var _=Object.keys(T);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(T);E&&(S=S.filter(function(A){return Object.getOwnPropertyDescriptor(T,A).enumerable})),_.push.apply(_,S)}return _}function h(T){for(var E=1;E<arguments.length;E++){var _=arguments[E]!=null?arguments[E]:{};E%2?f(Object(_),!0).forEach(function(S){p(T,S,_[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(_)):f(Object(_)).forEach(function(S){Object.defineProperty(T,S,Object.getOwnPropertyDescriptor(_,S))})}return T}function p(T,E,_){return(E=y(E))in T?Object.defineProperty(T,E,{value:_,enumerable:!0,configurable:!0,writable:!0}):T[E]=_,T}function y(T){var E=g(T,"string");return typeof E=="symbol"?E:E+""}function g(T,E){if(typeof T!="object"||!T)return T;var _=T[Symbol.toPrimitive];if(_!==void 0){var S=_.call(T,E);if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(E==="string"?String:Number)(T)}function b(T,E){if(T==null)return{};var _,S,A=O(T,E);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(T);for(S=0;S<M.length;S++)_=M[S],E.indexOf(_)===-1&&{}.propertyIsEnumerable.call(T,_)&&(A[_]=T[_])}return A}function O(T,E){if(T==null)return{};var _={};for(var S in T)if({}.hasOwnProperty.call(T,S)){if(E.indexOf(S)!==-1)continue;_[S]=T[S]}return _}let w=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=(E,_)=>{var A;const{size:S}=_;this.props.onResize?((A=E.persist)==null||A.call(E),this.setState(S,()=>this.props.onResize&&this.props.onResize(E,_))):this.setState(S)}}static getDerivedStateFromProps(E,_){return _.propsWidth!==E.width||_.propsHeight!==E.height?{width:E.width,height:E.height,propsWidth:E.width,propsHeight:E.height}:null}render(){const E=this.props,{handle:_,handleSize:S,onResize:A,onResizeStart:M,onResizeStop:C,draggableOpts:I,minConstraints:D,maxConstraints:j,lockAspectRatio:F,axis:B,width:U,height:W,resizeHandles:Y,style:Q,transformScale:re}=E,ye=b(E,s);return e.createElement(n.default,{axis:B,draggableOpts:I,handle:_,handleSize:S,height:this.state.height,lockAspectRatio:F,maxConstraints:j,minConstraints:D,onResizeStart:M,onResize:this.onResize,onResizeStop:C,resizeHandles:Y,transformScale:re,width:this.state.width},e.createElement("div",u({},ye,{style:h(h({},Q),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return Ol.default=w,w.propTypes=h(h({},r.resizableProps),{},{children:t.default.element}),Ol}var Vx;function WA(){return Vx||(Vx=1,Nl.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Nl.exports.Resizable=pE().default,Nl.exports.ResizableBox=zA().default),Nl.exports}var YA=WA();function yE(e){return function(n,r,s,i,l,u,f){return e(n,r,f)}}function Gd(e){return function(n,r,s,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,s,i);var l=i.get(n),u=i.get(r);if(l&&u)return l===r&&u===n;i.set(n,r),i.set(r,n);var f=e(n,r,s,i);return i.delete(n),i.delete(r),f}}function gE(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 Qx(e){return e.constructor===Object||e.constructor==null}function Gx(e){return typeof e.then=="function"}function Kd(e,t){return e===t||e!==e&&t!==t}var $A="[object Arguments]",qA="[object Boolean]",VA="[object Date]",QA="[object RegExp]",GA="[object Map]",KA="[object Number]",XA="[object Object]",JA="[object Set]",ZA="[object String]",Kx=Object.prototype.toString;function Xd(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,s=e.areObjectsEqual,i=e.areRegExpsEqual,l=e.areSetsEqual,u=e.createIsNestedEqual,f=u(h);function h(p,y,g){if(p===y)return!0;if(!p||!y||typeof p!="object"||typeof y!="object")return p!==p&&y!==y;if(Qx(p)&&Qx(y))return s(p,y,f,g);var b=Array.isArray(p),O=Array.isArray(y);if(b||O)return b===O&&t(p,y,f,g);var w=Kx.call(p);return w!==Kx.call(y)?!1:w===VA?n(p,y,f,g):w===QA?i(p,y,f,g):w===GA?r(p,y,f,g):w===JA?l(p,y,f,g):w===XA||w===$A?Gx(p)||Gx(y)?!1:s(p,y,f,g):w===qA||w===KA||w===ZA?Kd(p.valueOf(),y.valueOf()):!1}return h}function xE(e,t,n,r){var s=e.length;if(t.length!==s)return!1;for(;s-- >0;)if(!n(e[s],t[s],s,s,e,t,r))return!1;return!0}var eI=Gd(xE);function bE(e,t){return Kd(e.valueOf(),t.valueOf())}function vE(e,t,n,r){var s=e.size===t.size;if(!s)return!1;if(!e.size)return!0;var i={},l=0;return e.forEach(function(u,f){if(s){var h=!1,p=0;t.forEach(function(y,g){!h&&!i[p]&&(h=n(f,g,l,p,e,t,r)&&n(u,y,f,g,e,t,r))&&(i[p]=!0),p++}),l++,s=h}}),s}var tI=Gd(vE),nI="_owner",rI=Object.prototype.hasOwnProperty;function EE(e,t,n,r){var s=Object.keys(e),i=s.length;if(Object.keys(t).length!==i)return!1;for(var l;i-- >0;){if(l=s[i],l===nI){var u=!!e.$$typeof,f=!!t.$$typeof;if((u||f)&&u!==f)return!1}if(!rI.call(t,l)||!n(e[l],t[l],l,l,e,t,r))return!1}return!0}var sI=Gd(EE);function TE(e,t){return e.source===t.source&&e.flags===t.flags}function wE(e,t,n,r){var s=e.size===t.size;if(!s)return!1;if(!e.size)return!0;var i={};return e.forEach(function(l,u){if(s){var f=!1,h=0;t.forEach(function(p,y){!f&&!i[h]&&(f=n(l,p,u,y,e,t,r))&&(i[h]=!0),h++}),s=f}}),s}var oI=Gd(wE),kE=Object.freeze({areArraysEqual:xE,areDatesEqual:bE,areMapsEqual:vE,areObjectsEqual:EE,areRegExpsEqual:TE,areSetsEqual:wE,createIsNestedEqual:yE}),SE=Object.freeze({areArraysEqual:eI,areDatesEqual:bE,areMapsEqual:tI,areObjectsEqual:sI,areRegExpsEqual:TE,areSetsEqual:oI,createIsNestedEqual:yE}),aI=Xd(kE);function Ss(e,t){return aI(e,t,void 0)}Xd(gE(kE,{createIsNestedEqual:function(){return Kd}}));Xd(SE);Xd(gE(SE,{createIsNestedEqual:function(){return Kd}}));function Xx(e){const{children:t,cols:n,containerWidth:r,margin:s,containerPadding:i,rowHeight:l,maxRows:u,isDraggable:f,isResizable:h,isBounded:p,static:y,useCSSTransforms:g=!0,usePercentages:b=!1,transformScale:O=1,positionStrategy:w,dragThreshold:T=0,droppingPosition:E,className:_="",style:S,handle:A="",cancel:M="",x:C,y:I,w:D,h:j,minW:F=1,maxW:B=1/0,minH:U=1,maxH:W=1/0,i:Y,resizeHandles:Q,resizeHandle:re,constraints:ye=cd,layoutItem:G,layout:fe=[],onDragStart:P,onDrag:K,onDragStop:ee,onResizeStart:R,onResize:ie,onResizeStop:ae}=e,[J,be]=N.useState(!1),[te,le]=N.useState(!1),ge=N.useRef(null),ve=N.useRef({left:0,top:0}),je=N.useRef({top:0,left:0,width:0,height:0}),Ye=N.useRef(void 0),nt=N.useRef(fe);nt.current=fe;const tt=N.useRef(null),Je=N.useRef(null),rt=N.useRef(!1),ut=N.useRef({x:0,y:0}),pe=N.useRef(!1),me=N.useMemo(()=>({cols:n,containerPadding:i,containerWidth:r,margin:s,maxRows:u,rowHeight:l}),[n,i,r,s,u,l]),Ae=N.useMemo(()=>({cols:n,maxRows:u,containerWidth:r,containerHeight:0,rowHeight:l,margin:s,layout:[]}),[n,u,r,l,s]),Pe=N.useCallback(()=>({...Ae,layout:nt.current}),[Ae]),ct=N.useMemo(()=>G??{i:Y,x:C,y:I,w:D,h:j,minW:F,maxW:B,minH:U,maxH:W},[G,Y,C,I,D,j,F,B,U,W]),kt=N.useCallback(De=>{if(w!=null&&w.calcStyle)return w.calcStyle(De);if(g)return op(De);const We=sE(De);return b?{...We,left:_x(De.left/r),width:_x(De.width/r)}:We},[w,g,b,r]),bt=N.useCallback((De,{node:We})=>{if(!P)return;const{offsetParent:gt}=We;if(!gt)return;const Ge=gt.getBoundingClientRect(),Kt=We.getBoundingClientRect(),on=Kt.left/O,an=Ge.left/O,Xt=Kt.top/O,ln=Ge.top/O;let In;if(w!=null&&w.calcDragPosition){const yt=De;In=w.calcDragPosition(yt.clientX,yt.clientY,yt.clientX-Kt.left,yt.clientY-Kt.top)}else In={left:on-an+gt.scrollLeft,top:Xt-ln+gt.scrollTop};if(ve.current=In,T>0){const yt=De;ut.current={x:yt.clientX,y:yt.clientY},rt.current=!0,pe.current=!1,be(!0);return}be(!0);const Vn=Rc(me,In.top,In.left),{x:Vr,y:Ke}=Pc(ye,ct,Vn.x,Vn.y,Pe());P(Y,Vr,Ke,{e:De,node:We,newPosition:In})},[P,O,me,w,T,ye,ct,Pe,Y]),ue=N.useCallback((De,{node:We,deltaX:gt,deltaY:Ge})=>{if(!K||!J)return;const Kt=De;if(rt.current&&!pe.current){const Vr=Kt.clientX-ut.current.x,Ke=Kt.clientY-ut.current.y;if(Math.hypot(Vr,Ke)<T)return;if(pe.current=!0,rt.current=!1,P){const at=Rc(me,ve.current.top,ve.current.left),{x:St,y:Lt}=Pc(ye,ct,at.x,at.y,Pe());P(Y,St,Lt,{e:De,node:We,newPosition:ve.current})}}let on=ve.current.top+Ge,an=ve.current.left+gt;if(p){const{offsetParent:Vr}=We;if(Vr){const Ke=Vr.clientHeight-vi(j,l,s[1]);on=ud(on,0,Ke);const yt=Ai(me),at=r-vi(D,yt,s[0]);an=ud(an,0,at)}}const Xt={top:on,left:an};ve.current=Xt;const ln=Rc(me,on,an),{x:In,y:Vn}=Pc(ye,ct,ln.x,ln.y,Pe());K(Y,In,Vn,{e:De,node:We,newPosition:Xt})},[K,P,J,T,p,j,l,s,me,r,D,Y,ye,ct,Pe]),ne=N.useCallback((De,{node:We})=>{if(!ee||!J)return;const gt=rt.current;if(rt.current=!1,pe.current=!1,ut.current={x:0,y:0},gt){be(!1),ve.current={left:0,top:0};return}const{left:Ge,top:Kt}=ve.current,on={top:Kt,left:Ge};be(!1),ve.current={left:0,top:0};const an=Rc(me,Kt,Ge),{x:Xt,y:ln}=Pc(ye,ct,an.x,an.y,Pe());ee(Y,Xt,ln,{e:De,node:We,newPosition:on})},[ee,J,me,ye,ct,Pe,Y]);tt.current=bt,Je.current=ue;const Te=N.useCallback((De,{node:We,size:gt,handle:Ge},Kt,on)=>{const an=on==="onResizeStart"?R:on==="onResize"?ie:ae;if(!an)return;let Xt;We?Xt=wA(Ge,Kt,gt,r):Xt={...gt,top:Kt.top,left:Kt.left},je.current=Xt;const ln=lA(me,Xt.width,Xt.height),{w:In,h:Vn}=pA(ye,ct,ln.w,ln.h,Ge,Pe());an(Y,In,Vn,{e:De.nativeEvent,node:We,size:Xt,handle:Ge})},[R,ie,ae,r,me,Y,ye,ct,Pe]),Re=N.useCallback((De,We)=>{le(!0);const gt=kl(me,C,I,D,j),Ge={...We,handle:We.handle};Te(De,Ge,gt,"onResizeStart")},[Te,me,C,I,D,j]),Fe=N.useCallback((De,We)=>{const gt=kl(me,C,I,D,j),Ge={...We,handle:We.handle};Te(De,Ge,gt,"onResize")},[Te,me,C,I,D,j]),Be=N.useCallback((De,We)=>{le(!1),je.current={top:0,left:0,width:0,height:0};const gt=kl(me,C,I,D,j),Ge={...We,handle:We.handle};Te(De,Ge,gt,"onResizeStop")},[Te,me,C,I,D,j]);N.useEffect(()=>{var Ge,Kt;if(!E)return;const De=ge.current;if(!De)return;const We=Ye.current||{left:0,top:0},gt=J&&(E.left!==We.left||E.top!==We.top);if(J){if(gt){const on=E.left-ve.current.left,an=E.top-ve.current.top,Xt={node:De,deltaX:on,deltaY:an,lastX:ve.current.left,lastY:ve.current.top,x:E.left,y:E.top};(Kt=Je.current)==null||Kt.call(Je,E.e,Xt)}}else{const on={node:De,deltaX:E.left,deltaY:E.top,lastX:0,lastY:0,x:E.left,y:E.top};(Ge=tt.current)==null||Ge.call(tt,E.e,on)}Ye.current=E},[E,J,Y]);const pt=kl(me,C,I,D,j,J?ve.current:null,te?je.current:null),de=Le.Children.only(t),_e=kl(me,0,0,1,1),Ee=[_e.width,_e.height],He=[1/0,1/0],Ue=de.props,vt=Ue.className,jt=Ue.style;let $e=Le.cloneElement(de,{ref:ge,className:$n("react-grid-item",vt,_,{static:y,resizing:te,"react-draggable":f,"react-draggable-dragging":J,dropping:!!E,cssTransforms:g}),style:{...S,...jt,...kt(pt)}});const ft=re;return $e=d.jsx(YA.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:pt.width,height:pt.height,minConstraints:Ee,maxConstraints:He,onResizeStart:Re,onResize:Fe,onResizeStop:Be,transformScale:O,resizeHandles:Q,handle:ft,children:$e}),$e=d.jsx(HA.DraggableCore,{disabled:!f,onStart:bt,onDrag:ue,onStop:ne,handle:A,cancel:".react-resizable-handle"+(M?","+M:""),scale:O,nodeRef:ge,children:$e}),$e}var Ts=()=>{},Jx="react-grid-layout",CE=!1;try{CE=/firefox/i.test(navigator.userAgent)}catch{}function iI(e,t){const n=Le.Children.toArray(e),r=Le.Children.toArray(t);if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++){const i=n[s],l=r[s];if((i==null?void 0:i.key)!==(l==null?void 0:l.key))return!1}return!0}function Zx(e,t,n,r){const s=[],i=new Set;Le.Children.forEach(t,u=>{if(!Le.isValidElement(u)||u.key===null)return;const f=String(u.key);i.add(f);const h=e.find(p=>p.i===f);if(h)s.push(ha(h));else{const y=u.props["data-grid"];y?s.push({i:f,x:y.x??0,y:y.y??0,w:y.w??1,h:y.h??1,minW:y.minW,maxW:y.maxW,minH:y.minH,maxH:y.maxH,static:y.static,isDraggable:y.isDraggable,isResizable:y.isResizable,resizeHandles:y.resizeHandles,isBounded:y.isBounded}):s.push({i:f,x:0,y:$d(s),w:1,h:1})}});const l=sp(s,{cols:n});return r.compact(l,n)}function NE(e){const{children:t,width:n,gridConfig:r,dragConfig:s,resizeConfig:i,dropConfig:l,positionStrategy:u=kA,compactor:f,constraints:h=cd,layout:p=[],droppingItem:y,autoSize:g=!0,className:b="",style:O={},innerRef:w,onLayoutChange:T=Ts,onDragStart:E=Ts,onDrag:_=Ts,onDragStop:S=Ts,onResizeStart:A=Ts,onResize:M=Ts,onResizeStop:C=Ts,onDrop:I=Ts,onDropDragOver:D=Ts}=e,j=N.useMemo(()=>({...SA,...r}),[r]),F=N.useMemo(()=>({...CA,...s}),[s]),B=N.useMemo(()=>({...NA,...i}),[i]),U=N.useMemo(()=>({..._A,...l}),[l]),{cols:W,rowHeight:Y,maxRows:Q,margin:re,containerPadding:ye}=j,{enabled:G,bounded:fe,handle:P,cancel:K,threshold:ee}=F,{enabled:R,handles:ie,handleComponent:ae}=B,{enabled:J,defaultItem:be,onDragOver:te}=U,le=f??yu("vertical"),ge=le.type,ve=le.allowOverlap,je=le.preventCollision??!1,Ye=N.useMemo(()=>y??{i:"__dropping-elem__",...be},[y,be]),nt=u.type==="transform",tt=u.scale,Je=ye??re,[rt,ut]=N.useState(!1),[pe,me]=N.useState(()=>Zx(p,t,W,le)),[Ae,Pe]=N.useState(null),[ct,kt]=N.useState(!1),[bt,ue]=N.useState(null),[ne,Te]=N.useState(),Re=N.useRef(null),Fe=N.useRef(null),Be=N.useRef(null),pt=N.useRef(0),de=N.useRef(pe),_e=N.useRef(p),Ee=N.useRef(t),He=N.useRef(ge),Ue=N.useRef(pe);Ue.current=pe,N.useEffect(()=>{ut(!0),Ss(pe,p)||T(pe)},[]),N.useEffect(()=>{if(Ae||bt)return;const Ke=!Ss(p,_e.current),yt=!iI(t,Ee.current),at=ge!==He.current;if(Ke||yt||at){const Lt=Zx(Ke?p:pe,t,W,le);Ss(Lt,pe)||me(Lt)}_e.current=p,Ee.current=t,He.current=ge},[p,t,W,ge,le,Ae,bt,pe]),N.useEffect(()=>{if(!Ae&&!Ss(pe,de.current)){de.current=pe;const Ke=pe.filter(yt=>yt.i!==Ye.i);T(Ke)}},[pe,Ae,T,Ye.i]);const vt=N.useMemo(()=>{if(!g)return;const Ke=$d(pe),yt=Je[1];return Ke*Y+(Ke-1)*re[1]+yt*2+"px"},[g,pe,Y,re,Je]),jt=N.useCallback((Ke,yt,at,St)=>{const Lt=Ue.current,Ot=Yo(Lt,Ke);if(!Ot)return;const Ut={w:Ot.w,h:Ot.h,x:Ot.x,y:Ot.y,i:Ke};Re.current=ha(Ot),Be.current=Lt,Pe(Ut),E(Lt,Ot,Ot,null,St.e,St.node)},[E]),$e=N.useCallback((Ke,yt,at,St)=>{const Lt=Ue.current,Ot=Re.current,Ut=Yo(Lt,Ke);if(!Ut)return;const zt={w:Ut.w,h:Ut.h,x:Ut.x,y:Ut.y,i:Ke},Ht=Qo(Lt,Ut,yt,at,!0,je,ge,W,ve);_(Ht,Ot,Ut,zt,St.e,St.node),me(le.compact(Ht,W)),Pe(zt)},[je,ge,W,ve,le,_]),ft=N.useCallback((Ke,yt,at,St)=>{if(!Ae)return;const Lt=Ue.current,Ot=Re.current,Ut=Yo(Lt,Ke);if(!Ut)return;const zt=Qo(Lt,Ut,yt,at,!0,je,ge,W,ve),Ht=le.compact(zt,W);S(Ht,Ot,Ut,null,St.e,St.node);const vn=Be.current;Re.current=null,Be.current=null,Pe(null),me(Ht),vn&&!Ss(vn,Ht)&&T(Ht)},[Ae,je,ge,W,ve,le,S,T]),De=N.useCallback((Ke,yt,at,St)=>{const Lt=Ue.current,Ot=Yo(Lt,Ke);Ot&&(Fe.current=ha(Ot),Be.current=Lt,kt(!0),A(Lt,Ot,Ot,null,St.e,St.node))},[A]),We=N.useCallback((Ke,yt,at,St)=>{const Lt=Ue.current,Ot=Fe.current,{handle:Ut}=St;let zt=!1,Ht,vn;const[Ta,gr]=dA(Lt,Ke,Wt=>(Ht=Wt.x,vn=Wt.y,["sw","w","nw","n","ne"].includes(Ut)&&(["sw","nw","w"].includes(Ut)&&(Ht=Wt.x+(Wt.w-yt),yt=Wt.x!==Ht&&Ht<0?Wt.w:yt,Ht=Ht<0?0:Ht),["ne","n","nw"].includes(Ut)&&(vn=Wt.y+(Wt.h-at),at=Wt.y!==vn&&vn<0?Wt.h:at,vn=vn<0?0:vn),zt=!0),je&&!ve&&nE(Lt,{...Wt,w:yt,h:at,x:Ht??Wt.x,y:vn??Wt.y}).filter(wa=>wa.i!==Wt.i).length>0&&(vn=Wt.y,at=Wt.h,Ht=Wt.x,yt=Wt.w,zt=!1),Wt.w=yt,Wt.h=at,Wt));if(!gr)return;let js=Ta;zt&&Ht!==void 0&&vn!==void 0&&(js=Qo(Ta,gr,Ht,vn,!0,je,ge,W,ve));const Do={w:gr.w,h:gr.h,x:gr.x,y:gr.y,i:Ke,static:!0};M(js,Ot,gr,Do,St.e,St.node),me(le.compact(js,W)),Pe(Do)},[je,ge,W,ve,le,M]),gt=N.useCallback((Ke,yt,at,St)=>{const Lt=Ue.current,Ot=Fe.current,Ut=Yo(Lt,Ke),zt=le.compact(Lt,W);C(zt,Ot,Ut??null,null,St.e,St.node);const Ht=Be.current;Fe.current=null,Be.current=null,Pe(null),kt(!1),me(zt),Ht&&!Ss(Ht,zt)&&T(zt)},[W,le,C,T]),Ge=N.useCallback(()=>{const Ke=Ue.current;if(!Ke.some(St=>St.i===Ye.i)){ue(null),Pe(null),Te(void 0);return}const at=le.compact(Ke.filter(St=>St.i!==Ye.i),W);me(at),ue(null),Pe(null),Te(void 0)},[Ye.i,W,le]),Kt=N.useCallback(Ke=>{var bu;if(Ke.preventDefault(),Ke.stopPropagation(),CE&&!((bu=Ke.nativeEvent.target)!=null&&bu.classList.contains(Jx)))return!1;const yt=te?te(Ke.nativeEvent):D(Ke);if(yt===!1)return bt&&Ge(),!1;const{dragOffsetX:at=0,dragOffsetY:St=0,...Lt}=yt??{},Ot={...Ye,...Lt},Ut=Ke.currentTarget.getBoundingClientRect(),zt={cols:W,margin:re,maxRows:Q,rowHeight:Y,containerWidth:n,containerPadding:Je},Ht=Ai(zt),vn=vi(Ot.w,Ht,re[0]),Ta=vi(Ot.h,Y,re[1]),gr=vn/2,js=Ta/2,Do=Ke.clientX-Ut.left+at-gr,Wt=Ke.clientY-Ut.top+St-js,Ri=Math.max(0,Do),wa=Math.max(0,Wt),Yt={left:Ri/tt,top:wa/tt,e:Ke.nativeEvent};if(bt)ne&&(ne.left!==Yt.left||ne.top!==Yt.top)&&Te(Yt);else{const Oo=iA(zt,wa,Ri,Ot.w,Ot.h);ue(d.jsx("div",{},Ot.i)),Te(Yt),me([...Ue.current,{...Ot,x:Oo.x,y:Oo.y,static:!1,isDraggable:!0}])}},[bt,ne,Ye,te,D,Ge,tt,W,re,Q,Y,n,Je]),on=N.useCallback(Ke=>{Ke.preventDefault(),Ke.stopPropagation(),pt.current--,pt.current<0&&(pt.current=0),pt.current===0&&Ge()},[Ge]),an=N.useCallback(Ke=>{Ke.preventDefault(),Ke.stopPropagation(),pt.current++},[]),Xt=N.useCallback(Ke=>{Ke.preventDefault(),Ke.stopPropagation();const yt=Ue.current,at=yt.find(St=>St.i===Ye.i);pt.current=0,Ge(),I(yt,at,Ke.nativeEvent)},[Ye.i,Ge,I]),ln=N.useCallback((Ke,yt)=>{if(!Ke||!Ke.key)return null;const at=Yo(pe,String(Ke.key));if(!at)return null;const St=typeof at.isDraggable=="boolean"?at.isDraggable:!at.static&&G,Lt=typeof at.isResizable=="boolean"?at.isResizable:!at.static&&R,Ot=at.resizeHandles||[...ie],Ut=St&&fe&&at.isBounded!==!1,zt=ae;return d.jsx(Xx,{containerWidth:n,cols:W,margin:re,containerPadding:Je,maxRows:Q,rowHeight:Y,cancel:K,handle:P,onDragStart:jt,onDrag:$e,onDragStop:ft,onResizeStart:De,onResize:We,onResizeStop:gt,isDraggable:St,isResizable:Lt,isBounded:Ut,useCSSTransforms:nt&&rt,usePercentages:!rt,transformScale:tt,positionStrategy:u,dragThreshold:ee,w:at.w,h:at.h,x:at.x,y:at.y,i:at.i,minH:at.minH,minW:at.minW,maxH:at.maxH,maxW:at.maxW,static:at.static,droppingPosition:yt?ne:void 0,resizeHandles:Ot,resizeHandle:zt,constraints:h,layoutItem:at,layout:pe,children:Ke},at.i)},[pe,n,W,re,Je,Q,Y,K,P,jt,$e,ft,De,We,gt,G,R,fe,nt,rt,tt,u,ee,ne,ie,ae,h]),In=()=>Ae?d.jsx(Xx,{w:Ae.w,h:Ae.h,x:Ae.x,y:Ae.y,i:Ae.i,className:`react-grid-placeholder ${ct?"placeholder-resizing":""}`,containerWidth:n,cols:W,margin:re,containerPadding:Je,maxRows:Q,rowHeight:Y,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:nt,transformScale:tt,constraints:h,layout:pe,children:d.jsx("div",{})}):null,Vn=$n(Jx,b),Vr={height:vt,...O};return d.jsxs("div",{ref:w,className:Vn,style:Vr,onDrop:J?Xt:void 0,onDragLeave:J?on:void 0,onDragEnter:J?an:void 0,onDragOver:J?Kt:void 0,children:[Le.Children.map(t,Ke=>Le.isValidElement(Ke)?ln(Ke):null),J&&bt&&ln(bt,!0),In()]})}var lI={lg:1200,md:996,sm:768,xs:480,xxs:0},uI={lg:12,md:10,sm:6,xs:4,xxs:2},b0=()=>{};function cI(e,t,n,r){const s=[];Le.Children.forEach(t,l=>{if(!Le.isValidElement(l)||l.key===null)return;const u=String(l.key),f=e.find(h=>h.i===u);if(f)s.push({...f,i:u});else{const p=l.props["data-grid"];p?s.push({i:u,x:p.x??0,y:p.y??0,w:p.w??1,h:p.h??1,minW:p.minW,maxW:p.maxW,minH:p.minH,maxH:p.maxH,static:p.static,isDraggable:p.isDraggable,isResizable:p.isResizable,resizeHandles:p.resizeHandles,isBounded:p.isBounded}):s.push({i:u,x:0,y:$d(s),w:1,h:1})}});const i=sp(s,{cols:n});return r.compact(i,n)}function dI(e){const{children:t,width:n,breakpoint:r,breakpoints:s=lI,cols:i=uI,layouts:l={},rowHeight:u=150,maxRows:f=1/0,margin:h=[10,10],containerPadding:p=null,compactor:y,onBreakpointChange:g=b0,onLayoutChange:b=b0,onWidthChange:O=b0,...w}=e,T=y??yu("vertical"),E=T.type,_=T.allowOverlap,S=N.useMemo(()=>r??Dx(s,n),[]),A=N.useMemo(()=>Ox(S,i),[S,i]),M=N.useMemo(()=>m0(l,s,S,S,A,E),[]),[C,I]=N.useState(S),[D,j]=N.useState(A),[F,B]=N.useState(M),[U,W]=N.useState(l),Y=N.useRef(n),Q=N.useRef(r),re=N.useRef(s),ye=N.useRef(i),G=N.useRef(l),fe=N.useRef(E),P=N.useRef(U);N.useEffect(()=>{P.current=U},[U]);const K=N.useMemo(()=>Ss(l,G.current)?null:m0(l,s,C,C,D,T),[l,s,C,D,T]),ee=K??F;N.useEffect(()=>{K!==null&&(B(K),W(l),P.current=l,G.current=l)},[K,l]),N.useEffect(()=>{if(E!==fe.current){const be=T.compact(Co(ee),D),te={...P.current,[C]:be};B(be),W(te),P.current=te,b(be,te),fe.current=E}},[E,T,ee,D,_,C,b]),N.useEffect(()=>{const be=n!==Y.current,te=r!==Q.current,le=!Ss(s,re.current),ge=!Ss(i,ye.current);if(be||te||le||ge){const ve=r??Dx(s,n),je=Ox(ve,i),Ye=C;if(Ye!==ve||le||ge){const Je={...P.current};Je[Ye]||(Je[Ye]=Co(F));let rt=m0(Je,s,ve,Ye,je,T);rt=cI(rt,t,je,T),Je[ve]=rt,I(ve),j(je),B(rt),W(Je),P.current=Je,g(ve,je),b(rt,Je)}const nt=jc(h,ve),tt=p?jc(p,ve):null;O(n,nt,je,tt),Y.current=n,Q.current=r,re.current=s,ye.current=i}},[n,r,s,i,C,D,F,t,T,E,_,h,p,g,b,O]);const R=N.useCallback(be=>{const le={...P.current,[C]:be};B(be),W(le),P.current=le,b(be,le)},[C,b]),ie=N.useMemo(()=>jc(h,C),[h,C]),ae=N.useMemo(()=>p===null?null:jc(p,C),[p,C]),J=N.useMemo(()=>({cols:D,rowHeight:u,maxRows:f,margin:ie,containerPadding:ae}),[D,u,f,ie,ae]);return d.jsx(NE,{...w,width:n,gridConfig:J,compactor:T,onLayoutChange:R,layout:ee,children:t})}function _E(e){const{children:t,width:n,cols:r=12,rowHeight:s=150,maxRows:i=1/0,margin:l=[10,10],containerPadding:u=null,layout:f,droppingItem:h,compactType:p,preventCollision:y=!1,allowOverlap:g=!1,verticalCompact:b,isDraggable:O=!0,isBounded:w=!1,draggableHandle:T,draggableCancel:E,isResizable:_=!0,resizeHandles:S=["se"],resizeHandle:A,isDroppable:M=!1,useCSSTransforms:C=!0,transformScale:I=1,autoSize:D,className:j,style:F,innerRef:B,onLayoutChange:U,onDragStart:W,onDrag:Y,onDragStop:Q,onResizeStart:re,onResize:ye,onResizeStop:G,onDrop:fe,onDropDragOver:P}=e;let K=p===void 0?"vertical":p;b===!1&&(K=null);const ee={cols:r,rowHeight:s,maxRows:i,margin:l,containerPadding:u},R={enabled:O,bounded:w,handle:T,cancel:E,threshold:0},ie={enabled:_,handles:S,handleComponent:A},ae={enabled:M};let J;C?I!==1?J=iE(I):J=cp:J=aE;const be=yu(K,g,y),te=w?[...cd,mA]:cd;return d.jsx(NE,{width:n,gridConfig:ee,dragConfig:R,resizeConfig:ie,dropConfig:ae,positionStrategy:J,compactor:be,constraints:te,layout:f,droppingItem:h,autoSize:D,className:j,style:F,innerRef:B,onLayoutChange:U,onDragStart:W,onDrag:Y,onDragStop:Q,onResizeStart:re,onResize:ye,onResizeStop:G,onDrop:fe,onDropDragOver:P,children:t})}_E.displayName="ReactGridLayout";var fI=_E;function DE(e){const{children:t,width:n,breakpoint:r,breakpoints:s,cols:i,layouts:l,onBreakpointChange:u,onLayoutChange:f,onWidthChange:h,rowHeight:p,maxRows:y,margin:g,containerPadding:b,droppingItem:O,compactType:w,preventCollision:T=!1,allowOverlap:E=!1,verticalCompact:_,isDraggable:S=!0,isBounded:A=!1,draggableHandle:M,draggableCancel:C,isResizable:I=!0,resizeHandles:D=["se"],resizeHandle:j,isDroppable:F=!1,useCSSTransforms:B=!0,transformScale:U=1,autoSize:W,className:Y,style:Q,innerRef:re,onDragStart:ye,onDrag:G,onDragStop:fe,onResizeStart:P,onResize:K,onResizeStop:ee,onDrop:R,onDropDragOver:ie}=e;let ae=w===void 0?"vertical":w;_===!1&&(ae=null);const J={enabled:S,bounded:A,handle:M,cancel:C},be={enabled:I,handles:D,handleComponent:j},te={enabled:F};let le;B?U!==1?le=iE(U):le=cp:le=aE;const ge=yu(ae,E,T);return d.jsx(dI,{width:n,breakpoint:r,breakpoints:s,cols:i,layouts:l,rowHeight:p,maxRows:y,margin:g,containerPadding:b,compactor:ge,dragConfig:J,resizeConfig:be,dropConfig:te,positionStrategy:le,droppingItem:O,autoSize:W,className:Y,style:Q,innerRef:re,onBreakpointChange:u,onLayoutChange:f,onWidthChange:h,onDragStart:ye,onDrag:G,onDragStop:fe,onResizeStart:P,onResize:K,onResizeStop:ee,onDrop:R,onDropDragOver:ie,children:t})}DE.displayName="ResponsiveReactGridLayout";var hI=DE;function mI(e){const t=e,n=[...e].sort((u,f)=>u.y-f.y||u.x-f.x),r=[];let s=0;for(const u of n)r.push({...u,x:0,y:s,w:6}),s+=u.h;const i=[];let l=0;for(const u of n)i.push({...u,x:0,y:l,w:1}),l+=u.h;return{lg:t,md:r,sm:i}}function pI(e,t,n,r){const s=Object.values(n);if(s.length===0)return e;let i=e,l=!1;for(const u of s){if(u.sourceChart===r||!t.some(h=>h.name===u.field))continue;const f=i.filter(h=>String(h[u.field])===u.value);f.length!==i.length&&(l=!0),i=f}return l?i:e}function OE(e,t,n,r){const s=Object.values(n).filter(i=>i.sourceChart!==r);return s.length===0?!1:s.every(i=>{const l=e.some(f=>f.name===i.field),u=t==null?void 0:t.some(f=>f.name===i.field);return!l&&!u})}function Al(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 yI(e,t){const n=e>=0?"+":"";return t==="percent_change"?`${n}${e.toFixed(1)}%`:`${n}${e.toLocaleString()}`}function gI({chartRef:e}){var F,B,U,W,Y,Q;const{data:t}=Kb(e),{data:n,isLoading:r,error:s,isFetching:i}=fv(e),l=Mm(),u=ot(re=>re.crossFilters),f=N.useMemo(()=>n!=null&&n.columns?OE(n.columns,t==null?void 0:t.parameters,u,e):!1,[n==null?void 0:n.columns,t==null?void 0:t.parameters,u,e]),h=()=>{l(e)},p=()=>{if(!n||!t)return;const re=t.name||e;Ad(n.rows,n.columns,re)};if(r)return d.jsx("div",{className:"h-full flex items-center justify-center",children:d.jsx("div",{className:"animate-pulse h-12 w-24 rounded",style:{backgroundColor:"var(--yc-color-surface-hover)"}})});if(s)return d.jsx(ld,{isLoading:!1,error:s,data:void 0,onRetry:h,children:d.jsx("div",{})});if(!((F=n==null?void 0:n.rows)!=null&&F[0]))return d.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"No data available"});const y=n.rows[0],g=t==null?void 0:t.chart;if(!((B=g==null?void 0:g.value)!=null&&B.field))return d.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Invalid KPI config"});const b=y[g.value.field],O=Al(b,g.format);let w=null,T="percent_change",E,_,S;if(n.comparison)w=n.comparison.change,T=n.comparison.changeType,E=n.comparison.currentPeriodLabel,_=n.comparison.previousPeriodLabel,S=Al(n.comparison.previousValue,g.format);else if((U=g.comparison)!=null&&U.enabled&&g.comparison.field){const re=y[g.comparison.field];T=g.comparison.type,re&&re!==0&&(T==="percent_change"?w=(b-re)/re*100:w=b-re,S=Al(re,g.format))}const A=g.goal,M=A&&A.value!==0?Math.max(0,Math.min(b/A.value*100,100)):null,C=A?b>=A.value?"var(--yc-color-success)":"var(--yc-color-danger)":void 0,I=t==null?void 0:t.drillDown,D=!!(I!=null&&I.chart||I!=null&&I.model),j=()=>{if(!I)return;const re=new URLSearchParams({_from:e});I.chart?window.location.hash=`/charts/${I.chart}?${re.toString()}`:I.model&&(window.location.hash=`/charts/${e}/detail?${re.toString()}`)};return d.jsxs("div",{className:"h-full flex flex-col p-4 group relative",style:{containerType:"size"},children:[d.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity z-10",children:d.jsx(J2,{onRefresh:h,onExportCSV:p,onExportPNG:p,onExportSVG:p,isRefreshing:i,hideImageExport:!0})}),d.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[d.jsx("a",{href:`#/charts/${e}`,className:"text-sm hover:underline line-clamp-2",style:{color:"var(--yc-color-text-secondary)"},children:t==null?void 0:t.title}),D&&d.jsxs("svg",{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[d.jsx("title",{children:"Click value to drill down"}),d.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"})]}),f&&d.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{backgroundColor:"var(--yc-color-surface-hover)",color:"var(--yc-color-text-muted)"},children:"Not filtered"})]}),d.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center min-h-0",children:[d.jsxs("div",{className:$n("font-bold leading-none text-center",D&&"cursor-pointer hover:opacity-75 transition-opacity"),style:{color:"var(--yc-color-text)",fontSize:"clamp(1.25rem, min(40cqh, 14cqw), 8rem)"},onClick:D?j:void 0,role:D?"button":void 0,tabIndex:D?0:void 0,onKeyDown:D?re=>{(re.key==="Enter"||re.key===" ")&&j()}:void 0,children:[O,g.unit&&d.jsx("span",{className:"font-normal ml-1",style:{fontSize:"0.5em",color:"var(--yc-color-text-muted)"},children:g.unit})]}),E&&d.jsx("div",{className:"text-xs mt-1.5 truncate",style:{color:"var(--yc-color-text-muted)"},children:E}),w!==null&&d.jsxs("div",{className:"mt-1.5 flex items-center gap-2 flex-wrap justify-center relative group/comparison kpi-comparison",children:[d.jsx("span",{className:"text-sm font-medium px-2 py-0.5 rounded",style:w>=0?{backgroundColor:"color-mix(in srgb, var(--yc-color-success) 15%, transparent)",color:"var(--yc-color-success)"}:{backgroundColor:"color-mix(in srgb, var(--yc-color-danger) 15%, transparent)",color:"var(--yc-color-danger)"},children:yI(w,T)}),S&&d.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:["vs ",S]}),!S&&((W=g.comparison)==null?void 0:W.label)&&d.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:g.comparison.label}),(_||S||((Y=g.comparison)==null?void 0:Y.label))&&d.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 mt-1.5 hidden group-hover/comparison:block z-50 pointer-events-none",children:d.jsxs("div",{className:"kpi-tooltip text-xs rounded-md px-3 py-2 shadow-lg whitespace-nowrap",children:[_&&d.jsx("div",{className:"font-medium",children:_}),!_&&((Q=g.comparison)==null?void 0:Q.label)&&d.jsx("div",{className:"font-medium",children:g.comparison.label}),S&&d.jsxs("div",{style:{opacity:.75},className:"mt-0.5",children:["Previous: ",S]})]})})]}),A&&M!==null&&d.jsxs("div",{className:"mt-2 w-full max-w-[200px]",children:[A.show_progress&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex justify-between text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:[d.jsxs("span",{children:[Al(b,g.format)," / ",Al(A.value,g.format)]}),d.jsxs("span",{children:[M.toFixed(0),"%"]})]}),d.jsx("div",{className:"w-full h-1.5 rounded-full",style:{backgroundColor:"var(--yc-color-surface-hover)"},children:d.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${M}%`,backgroundColor:C}})})]}),A.label&&d.jsx("div",{className:"text-xs mt-1 text-center",style:{color:"var(--yc-color-text-muted)"},children:A.label})]})]})]})}function xI({chartRef:e}){var tt,Je,rt,ut,pe,me,Ae,Pe,ct,kt,bt,ue;const{data:t,isLoading:n,isFetching:r,error:s}=TN(e),{data:i}=ga(),l=t==null?void 0:t.config,u=t,f=Mm(),h=N.useRef(null),[p,y]=N.useState(!1),g=ot(ne=>ne.chartFilters),b=ot(ne=>ne.resetChartFilters),O=ot(ne=>ne.crossFilters),w=ot(ne=>ne.setCrossFilter),{events:T}=pv(e),E=So(ne=>ne.auth),_=qn(),[S,A]=N.useState(null),M=E.status==="disabled"||E.status==="authenticated"&&(E.user.role==="admin"||E.user.role==="editor"),C=((Je=(tt=l==null?void 0:l.chart)==null?void 0:tt.x)==null?void 0:Je.type)==="temporal",I=Za({mutationFn:ne=>xt.createChartEvent({date:ne.date,label:ne.label,...ne.color?{color:ne.color}:{}}),onSuccess:()=>{_.invalidateQueries({queryKey:["chartEvents"]}),A(null)}}),D=g[e]&&Object.keys(g[e]).length>0,j=N.useMemo(()=>{for(const ne of Object.values(O))if(ne.sourceChart===e)return{field:ne.field,value:ne.value};return null},[O,e]),F=N.useMemo(()=>!(u!=null&&u.rows)||!(u!=null&&u.columns)?(u==null?void 0:u.rows)??[]:pI(u.rows,u.columns,O,e),[u==null?void 0:u.rows,u==null?void 0:u.columns,O,e]),B=((rt=u==null?void 0:u.meta)==null?void 0:rt.serverPaginated)===!0,[U,W]=N.useState(null);N.useEffect(()=>{W(null)},[(ut=u==null?void 0:u.meta)==null?void 0:ut.cacheKey]);const Y=N.useRef(!0);N.useEffect(()=>{Y.current=!0},[(pe=u==null?void 0:u.meta)==null?void 0:pe.cacheKey]);const Q=N.useCallback(async(ne,Te,Re,Fe)=>{if(Y.current&&ne===0&&!Re){Y.current=!1;return}Y.current=!1,W(Be=>({rows:(Be==null?void 0:Be.rows)??[],page:ne,loading:!0}));try{const Be=ot.getState().getEffectiveFilters(e),pt={...Object.fromEntries(Object.entries(Be).filter(([_e,Ee])=>Ee!=null&&Ee!=="")),_server_paginated:!0,_page:ne,_page_size:Te,...Re?{_sort_field:Re,_sort_dir:Fe??"asc"}:{}},de=await xt.queryChart(e,pt);W({rows:de.rows,summaryValues:de.summaryValues,page:ne,loading:!1})}catch{W(Be=>Be?{...Be,loading:!1}:null)}},[e]),re=N.useMemo(()=>{var Fe,Be;if(!u||((Fe=l==null?void 0:l.chart)==null?void 0:Fe.type)!=="table")return;const ne=l.chart;if(ne!=null&&ne.export&&((Be=ne.export)==null?void 0:Be.enabled)===!1)return;const Te=ot.getState().getEffectiveFilters(e),Re=Object.fromEntries(Object.entries(Te).filter(([pt,de])=>de!=null&&de!==""));return xt.getExportUrl(e,Re)},[u,l,e,g,O]),ye=N.useMemo(()=>u!=null&&u.columns?OE(u.columns,l==null?void 0:l.parameters,O,e):!1,[u==null?void 0:u.columns,l==null?void 0:l.parameters,O,e]),[G,fe]=N.useState(null),P=N.useCallback((ne,Te,Re,Fe)=>{var pt;let Be;if(Fe&&((pt=l==null?void 0:l.chart)!=null&&pt.series)&&"field"in l.chart.series){const de=l.chart.series.field;de&&de!==ne&&(Be={[ne]:Te,[de]:Fe})}fe({x:Re.x,y:Re.y,field:ne,value:Te,allFields:Be})},[l]),K=N.useCallback(()=>{var ne,Te,Re,Fe;if(G)if(G.allFields)for(const[Be,pt]of Object.entries(G.allFields)){const de=((Te=(ne=l==null?void 0:l.chart)==null?void 0:ne.x)==null?void 0:Te.type)==="temporal"&&Be===l.chart.x.field;w(Be,pt,e,de||void 0)}else{const Be=((Fe=(Re=l==null?void 0:l.chart)==null?void 0:Re.x)==null?void 0:Fe.type)==="temporal"&&G.field===l.chart.x.field;w(G.field,G.value,e,Be||void 0)}},[G,w,e,l]),ee=N.useCallback(()=>{G&&A(G.value)},[G]),R=N.useCallback(()=>{var Fe,Be,pt;if(!G||!((Fe=l==null?void 0:l.drillDown)!=null&&Fe.model))return;const ne=l.drillDown,Te=ne.fields?typeof ne.fields=="string"?ne.fields:ne.fields[0]:ne.field??((pt=(Be=l.chart)==null?void 0:Be.x)==null?void 0:pt.field)??G.field,Re=new URLSearchParams;if(G.allFields)for(const[de,_e]of Object.entries(G.allFields))Re.set(de,_e);else Re.set(Te,G.value);Re.set("_from",e),window.location.hash=`/charts/${e}/detail?${Re.toString()}`,fe(null)},[G,l,e]),ie=N.useCallback(()=>{var Fe,Be,pt;if(!G||!((Fe=l==null?void 0:l.drillDown)!=null&&Fe.chart))return;const ne=l.drillDown,Te=ne.fields?typeof ne.fields=="string"?ne.fields:ne.fields[0]:ne.field??((pt=(Be=l.chart)==null?void 0:Be.x)==null?void 0:pt.field)??G.field,Re=new URLSearchParams;if(G.allFields)for(const[de,_e]of Object.entries(G.allFields))Re.set(de,_e);else Re.set(Te,G.value);Re.set("_from",e),window.location.hash=`/charts/${l.drillDown.chart}?${Re.toString()}`,fe(null)},[G,l,e]),ae=()=>{f(e)},J=()=>{b(e),y(!1)},be=()=>{if(!u||!l)return;const ne=l.name||e;Ad(F,u.columns,ne)},te=N.useCallback(()=>{if(!(u!=null&&u.columns)||!F.length)return;const ne=u.columns.map(Fe=>Fe.name),Te=ne.join(" "),Re=F.map(Fe=>ne.map(Be=>String(Fe[Be]??"")).join(" "));navigator.clipboard.writeText([Te,...Re].join(`
|
|
129
|
-
`))},[u==null?void 0:u.columns,F]),le=()=>{var Te;const ne=(Te=h.current)==null?void 0:Te.getDataURL("png");ne&&l&&rd(ne,`${l.name||e}.png`)},ge=()=>{var Te;const ne=(Te=h.current)==null?void 0:Te.getDataURL("svg");ne&&l&&rd(ne,`${l.name||e}.svg`)},ve=async()=>{var Te;const ne=(Te=h.current)==null?void 0:Te.getDataURL("png");ne&&l&&await T6(ne,l.name||e,l.title)};if(!l&&s)return d.jsx(ld,{isLoading:!1,error:s,data:void 0,onRetry:()=>f(e),children:d.jsx("div",{})});if(!l||!u)return n?d.jsx("div",{className:"h-full flex items-center justify-center",children:d.jsx("div",{className:"animate-pulse w-full h-full rounded",style:{backgroundColor:"var(--yc-color-surface-hover)"}})}):d.jsxs("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:["Chart not found: ",e]});if(((me=l.chart)==null?void 0:me.type)==="kpi")return d.jsx(gI,{chartRef:e});const je=["line","bar","area","pie","donut","scatter","combo","heatmap","funnel","waterfall","gauge"].includes(l.chart.type),Ye=()=>{var ne;switch(l.chart.type){case"line":return!l.chart.x||!l.chart.y&&!l.chart.series?d.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):d.jsx(U2,{ref:h,data:F,columns:u.columns,xAxis:l.chart.x,yAxis:l.chart.y,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:P,activeCrossFilter:j,events:T,goalData:u.goalData,compareData:u.compareData});case"bar":return!l.chart.x||!l.chart.y&&!l.chart.series?d.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):d.jsx(z2,{ref:h,data:F,xAxis:l.chart.x,yAxis:l.chart.y,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:P,activeCrossFilter:j,events:T,goalData:u.goalData,compareData:u.compareData});case"area":return!l.chart.x||!l.chart.y&&!l.chart.series?d.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):d.jsx(W2,{ref:h,data:F,xAxis:l.chart.x,yAxis:l.chart.y,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:P,activeCrossFilter:j,events:T,goalData:u.goalData,compareData:u.compareData});case"pie":return!l.chart.x||!l.chart.y?d.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):d.jsx(Y2,{ref:h,data:F,xAxis:l.chart.x,yAxis:l.chart.y,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:P,activeCrossFilter:j});case"donut":return!l.chart.x||!l.chart.y?d.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):d.jsx($2,{ref:h,data:F,xAxis:l.chart.x,yAxis:l.chart.y,centerValue:l.chart.centerValue,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:P,activeCrossFilter:j});case"scatter":return!l.chart.x||!l.chart.y?d.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):d.jsx(q2,{ref:h,data:F,xAxis:l.chart.x,yAxis:l.chart.y,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:P,activeCrossFilter:j});case"table":return d.jsx(om,{data:(U==null?void 0:U.rows)??F,columns:u.columns,chartConfig:l.chart,height:"100%",loading:r||((U==null?void 0:U.loading)??!1),serverPaginated:B,totalCount:(ne=u.meta)==null?void 0:ne.totalCount,serverSummaryValues:(U==null?void 0:U.summaryValues)??u.summaryValues,onServerPageChange:B?Q:void 0,exportUrl:re,onRowClick:l!=null&&l.drillDown?(Te,Re,Fe)=>{const Be=l.drillDown,pt=Be.fields?typeof Be.fields=="string"?[Be.fields]:Be.fields:Be.field?[Be.field]:[];if(pt.length===0)return;const de={};for(const _e of pt)_e in Te?de[_e]=String(Te[_e]??""):Fe?de[_e]=Fe:de[_e]="";fe({x:Re.x,y:Re.y,field:pt[0],value:de[pt[0]],allFields:pt.length>1?de:void 0})}:void 0});case"metric":return l.chart.y?d.jsx(J6,{data:F,yAxis:l.chart.y,title:l.title,loading:r}):d.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing value configuration"});case"combo":return l.chart.x?d.jsx(V2,{ref:h,data:F,xAxis:l.chart.x,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:P,activeCrossFilter:j,events:T,goalData:u.goalData,compareData:u.compareData}):d.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"});case"heatmap":return!l.chart.x||!l.chart.y?d.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):d.jsx(Q2,{ref:h,data:F,chartConfig:l.chart,height:"100%",loading:r});case"funnel":return d.jsx(G2,{ref:h,data:F,chartConfig:l.chart,height:"100%",loading:r});case"sankey":return d.jsx(Z6,{ref:h,data:F,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:P});case"waterfall":return d.jsx(K2,{ref:h,data:F,chartConfig:l.chart,height:"100%",loading:r});case"gauge":return d.jsx(X2,{ref:h,data:F,chartConfig:l.chart,height:"100%",loading:r});default:return d.jsxs("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-secondary)"},children:['Chart type "',l.chart.type,'" not yet implemented']})}},nt=l.parameters&&l.parameters.length>0;return d.jsx(sd,{fallback:(ne,Te)=>d.jsx("div",{className:"h-full flex items-center justify-center p-4",children:d.jsxs("div",{className:"text-center",children:[d.jsx("p",{className:"text-sm font-medium",style:{color:"var(--yc-color-danger)"},children:"Failed to render chart"}),d.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-secondary)"},children:ne.message}),d.jsx("button",{onClick:Te,className:"mt-2 text-xs text-blue-600 hover:text-blue-700",children:"Retry"})]})}),resetKey:e,children:d.jsxs("div",{className:"h-full p-2 flex flex-col group",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2 px-2 flex-shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("a",{href:`#/charts/${e}`,className:"text-sm font-medium hover:underline",style:{color:"var(--yc-color-text)"},children:l.title}),(((Ae=l==null?void 0:l.drillDown)==null?void 0:Ae.chart)||((Pe=l==null?void 0:l.drillDown)==null?void 0:Pe.model))&&d.jsxs("svg",{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[d.jsx("title",{children:"Click chart to drill down"}),d.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"})]}),D&&d.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded",children:"Filtered"}),ye&&!D&&d.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{backgroundColor:"var(--yc-color-surface-hover)",color:"var(--yc-color-text-muted)"},children:"Not filtered"})]}),d.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[nt&&d.jsx("button",{onClick:()=>y(!p),className:`p-1.5 rounded hover:bg-black/5 ${p?"bg-black/5":""}`,title:p?"Hide filters":"Override filters",children:d.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-secondary)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.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"})})}),d.jsx(J2,{onRefresh:ae,onExportCSV:be,onExportPNG:je?le:be,onExportSVG:je?ge:be,onExportPDF:je?ve:void 0,onCopyTable:l.chart.type==="table"?te:void 0,isRefreshing:r})]})]}),p&&nt&&d.jsx("div",{className:"mb-2 px-2 flex-shrink-0",children:d.jsxs("div",{className:"flex items-end gap-2 flex-wrap",children:[d.jsx(A2,{parameters:l.parameters,chartName:e}),D&&d.jsx("button",{onClick:J,className:"px-2 py-1.5 text-xs hover:bg-black/5 rounded",style:{color:"var(--yc-color-text-secondary)"},children:"Reset to dashboard"})]})}),d.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:d.jsx(ld,{isLoading:n,error:s,data:F,onRetry:()=>f(e),children:Ye()})}),G&&d.jsx(Z2,{x:G.x,y:G.y,field:G.field,value:G.value,allFields:G.allFields,onFilter:K,onViewDetails:(ct=l==null?void 0:l.drillDown)!=null&&ct.model?R:void 0,onGoToChart:(kt=l==null?void 0:l.drillDown)!=null&&kt.chart?ie:void 0,onAddEvent:M?ee:void 0,detailModel:(bt=l==null?void 0:l.drillDown)==null?void 0:bt.model,targetChart:(ue=l==null?void 0:l.drillDown)==null?void 0:ue.chart,isTemporalChart:C,onClose:()=>fe(null)}),S&&d.jsx(eE,{date:S,onSave:ne=>I.mutate(ne),onClose:()=>A(null),saving:I.isPending})]})})}const eb=/[#.]/g;function bI(e,t){const n=e||"",r={};let s=0,i,l;for(;s<n.length;){eb.lastIndex=s;const u=eb.exec(n),f=n.slice(s,u?u.index:n.length);f&&(i?i==="#"?r.id=f:Array.isArray(r.className)?r.className.push(f):r.className=[f]:l=f,s+=f.length),u&&(i=u[0],s++)}return{type:"element",tagName:l||t||"div",properties:r,children:[]}}function AE(e,t,n){const r=n?wI(n):void 0;function s(i,l,...u){let f;if(i==null){f={type:"root",children:[]};const h=l;u.unshift(h)}else{f=bI(i,t);const h=f.tagName.toLowerCase(),p=r?r.get(h):void 0;if(f.tagName=p||h,vI(l))u.unshift(l);else for(const[y,g]of Object.entries(l))EI(e,f.properties,y,g)}for(const h of u)lm(f.children,h);return f.type==="element"&&f.tagName==="template"&&(f.content={type:"root",children:f.children},f.children=[]),f}return s}function vI(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 s=t[r];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const i=s;for(const l of i)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function EI(e,t,n,r){const s=kd(e,n);let i;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;i=r}else typeof r=="boolean"?i=r:typeof r=="string"?s.spaceSeparated?i=j1(r):s.commaSeparated?i=I1(r):s.commaOrSpaceSeparated?i=j1(I1(r).join(" ")):i=tb(s,s.property,r):Array.isArray(r)?i=[...r]:i=s.property==="style"?TI(r):String(r);if(Array.isArray(i)){const l=[];for(const u of i)l.push(tb(s,s.property,u));i=l}s.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[s.property]=i}}function lm(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)lm(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?lm(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function tb(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Jl(n)===Jl(t)))return!0}return n}function TI(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function wI(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const kI=["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"],SI=AE(fu,"div"),CI=AE(No,"g",kI);function NI(e){const t=String(e),n=[];return{toOffset:s,toPoint:r};function r(i){if(typeof i=="number"&&i>-1&&i<=t.length){let l=0;for(;;){let u=n[l];if(u===void 0){const f=nb(t,n[l-1]);u=f===-1?t.length+1:f+1,n[l]=u}if(u>i)return{line:l+1,column:i-(l>0?n[l-1]:0)+1,offset:i};l++}}}function s(i){if(i&&typeof i.line=="number"&&typeof i.column=="number"&&!Number.isNaN(i.line)&&!Number.isNaN(i.column)){for(;n.length<i.line;){const u=n[n.length-1],f=nb(t,u),h=f===-1?t.length+1:f+1;if(u===h)break;n.push(h)}const l=(i.line>1?n[i.line-2]:0)+i.column-1;if(l<n[i.line-1])return l}}}function nb(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
130
|
-
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Go={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/"},IE={}.hasOwnProperty,_I=Object.prototype;function DI(e,t){const n=t||{};return mp({file:n.file||void 0,location:!1,schema:n.space==="svg"?No:fu,verbose:n.verbose||!1},e)}function mp(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},qc(e,r,n),n}case"#document":case"#document-fragment":{const r=t,s="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:ME(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const i=String(e.file),l=NI(i),u=l.toPoint(0),f=l.toPoint(i.length);n.position={start:u,end:f}}return n}case"#documentType":{const r=t;return n={type:"doctype"},qc(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},qc(e,r,n),n}default:return n=OI(e,t),n}}function ME(e,t){let n=-1;const r=[];for(;++n<t.length;){const s=mp(e,t[n]);r.push(s)}return r}function OI(e,t){const n=e.schema;e.schema=t.namespaceURI===Go.svg?No:fu;let r=-1;const s={};for(;++r<t.attrs.length;){const u=t.attrs[r],f=(u.prefix?u.prefix+":":"")+u.name;IE.call(_I,f)||(s[f]=u.value)}const l=(e.schema.space==="svg"?CI:SI)(t.tagName,s,ME(e,t.childNodes));if(qc(e,t,l),l.tagName==="template"){const u=t,f=u.sourceCodeLocation,h=f&&f.startTag&&Ja(f.startTag),p=f&&f.endTag&&Ja(f.endTag),y=mp(e,u.content);h&&p&&e.file&&(y.position={start:h.end,end:p.start}),l.content=y}return e.schema=n,l}function qc(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=AI(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function AI(e,t,n){const r=Ja(n);if(t.type==="element"){const s=t.children[t.children.length-1];if(r&&!n.endTag&&s&&s.position&&s.position.end&&(r.end=Object.assign({},s.position.end)),e.verbose){const i={};let l;if(n.attrs)for(l in n.attrs)IE.call(n.attrs,l)&&(i[kd(e.schema,l).property]=Ja(n.attrs[l]));n.startTag;const u=Ja(n.startTag),f=n.endTag?Ja(n.endTag):void 0,h={opening:u};f&&(h.closing=f),h.properties=i,t.data={position:h}}}return r}function Ja(e){const t=rb({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=rb({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function rb(e){return e.line&&e.column?e:void 0}const sb={}.hasOwnProperty;function LE(e,t){const n=t||{};function r(s,...i){let l=r.invalid;const u=r.handlers;if(s&&sb.call(s,e)){const f=String(s[e]);l=sb.call(u,f)?u[f]:r.unknown}if(l)return l.call(this,s,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const II={},MI={}.hasOwnProperty,RE=LE("type",{handlers:{root:RI,element:HI,text:FI,comment:BI,doctype:jI}});function LI(e,t){const r=(t||II).space;return RE(e,r==="svg"?No:fu)}function RI(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=pp(e.children,n,t),Ii(e,n),n}function PI(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=pp(e.children,n,t),Ii(e,n),n}function jI(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ii(e,t),t}function FI(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ii(e,t),t}function BI(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ii(e,t),t}function HI(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=No);const s=[];let i;if(e.properties){for(i in e.properties)if(i!=="children"&&MI.call(e.properties,i)){const f=UI(r,i,e.properties[i]);f&&s.push(f)}}const l=r.space,u={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:Go[l],childNodes:[],parentNode:null};return u.childNodes=pp(e.children,u,r),Ii(e,u),e.tagName==="template"&&e.content&&(u.content=PI(e.content,r)),u}function UI(e,t,n){const r=kd(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?bv(n):Nv(n));const s={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const i=s.name.indexOf(":");i<0?s.prefix="":(s.name=s.name.slice(i+1),s.prefix=r.attribute.slice(0,i)),s.namespace=Go[r.space]}return s}function pp(e,t,n){let r=-1;const s=[];if(e)for(;++r<e.length;){const i=RE(e[r],n);i.parentNode=t,s.push(i)}return s}function Ii(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 zI=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],WI=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]),Zt="�";var H;(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"})(H||(H={}));const er={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function PE(e){return e>=55296&&e<=57343}function YI(e){return e>=56320&&e<=57343}function $I(e,t){return(e-55296)*1024+9216+t}function jE(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function FE(e){return e>=64976&&e<=65007||WI.has(e)}var xe;(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"})(xe||(xe={}));const qI=65536;class VI{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=qI,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:s,offset:i}=this,l=s+n,u=i+n;return{code:t,startLine:r,endLine:r,startCol:l,endCol:l,startOffset:u,endOffset:u}}_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(YI(n))return this.pos++,this._addGap(),$I(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,H.EOF;return this._err(xe.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,H.EOF;const r=this.html.charCodeAt(n);return r===H.CARRIAGE_RETURN?H.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,H.EOF;let t=this.html.charCodeAt(this.pos);return t===H.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,H.LINE_FEED):t===H.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,PE(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===H.LINE_FEED||t===H.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){jE(t)?this._err(xe.controlCharacterInInputStream):FE(t)&&this._err(xe.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var wt;(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"})(wt||(wt={}));function BE(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 QI=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))),GI=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 KI(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=GI.get(e))!==null&&t!==void 0?t:e}var _n;(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"})(_n||(_n={}));const XI=32;var To;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(To||(To={}));function um(e){return e>=_n.ZERO&&e<=_n.NINE}function JI(e){return e>=_n.UPPER_A&&e<=_n.UPPER_F||e>=_n.LOWER_A&&e<=_n.LOWER_F}function ZI(e){return e>=_n.UPPER_A&&e<=_n.UPPER_Z||e>=_n.LOWER_A&&e<=_n.LOWER_Z||um(e)}function eM(e){return e===_n.EQUALS||ZI(e)}var Cn;(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"})(Cn||(Cn={}));var Os;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Os||(Os={}));class tM{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Cn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Os.Strict}startEntity(t){this.decodeMode=t,this.state=Cn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Cn.EntityStart:return t.charCodeAt(n)===_n.NUM?(this.state=Cn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Cn.NamedEntity,this.stateNamedEntity(t,n));case Cn.NumericStart:return this.stateNumericStart(t,n);case Cn.NumericDecimal:return this.stateNumericDecimal(t,n);case Cn.NumericHex:return this.stateNumericHex(t,n);case Cn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|XI)===_n.LOWER_X?(this.state=Cn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Cn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,s){if(n!==r){const i=r-n;this.result=this.result*Math.pow(s,i)+Number.parseInt(t.substr(n,i),s),this.consumed+=i}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(um(s)||JI(s))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(um(s))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(s,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===_n.SEMI)this.consumed+=1;else if(this.decodeMode===Os.Strict)return 0;return this.emitCodePoint(KI(this.result),this.consumed),this.errors&&(t!==_n.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let s=r[this.treeIndex],i=(s&To.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const l=t.charCodeAt(n);if(this.treeIndex=nM(r,s,this.treeIndex+Math.max(1,i),l),this.treeIndex<0)return this.result===0||this.decodeMode===Os.Attribute&&(i===0||eM(l))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],i=(s&To.VALUE_LENGTH)>>14,i!==0){if(l===_n.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Os.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,s=(r[n]&To.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~To.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case Cn.NamedEntity:return this.result!==0&&(this.decodeMode!==Os.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Cn.NumericDecimal:return this.emitNumericEntity(0,2);case Cn.NumericHex:return this.emitNumericEntity(0,3);case Cn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Cn.EntityStart:return 0}}}function nM(e,t,n,r){const s=(t&To.BRANCH_LENGTH)>>7,i=t&To.JUMP_TABLE;if(s===0)return i!==0&&r===i?n:-1;if(i){const f=r-i;return f<0||f>=s?-1:e[n+f]-1}let l=n,u=l+s-1;for(;l<=u;){const f=l+u>>>1,h=e[f];if(h<r)l=f+1;else if(h>r)u=f-1;else return e[f+s]}return-1}var ke;(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/"})(ke||(ke={}));var aa;(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"})(aa||(aa={}));var Or;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Or||(Or={}));var oe;(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"})(oe||(oe={}));var x;(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"})(x||(x={}));const rM=new Map([[oe.A,x.A],[oe.ADDRESS,x.ADDRESS],[oe.ANNOTATION_XML,x.ANNOTATION_XML],[oe.APPLET,x.APPLET],[oe.AREA,x.AREA],[oe.ARTICLE,x.ARTICLE],[oe.ASIDE,x.ASIDE],[oe.B,x.B],[oe.BASE,x.BASE],[oe.BASEFONT,x.BASEFONT],[oe.BGSOUND,x.BGSOUND],[oe.BIG,x.BIG],[oe.BLOCKQUOTE,x.BLOCKQUOTE],[oe.BODY,x.BODY],[oe.BR,x.BR],[oe.BUTTON,x.BUTTON],[oe.CAPTION,x.CAPTION],[oe.CENTER,x.CENTER],[oe.CODE,x.CODE],[oe.COL,x.COL],[oe.COLGROUP,x.COLGROUP],[oe.DD,x.DD],[oe.DESC,x.DESC],[oe.DETAILS,x.DETAILS],[oe.DIALOG,x.DIALOG],[oe.DIR,x.DIR],[oe.DIV,x.DIV],[oe.DL,x.DL],[oe.DT,x.DT],[oe.EM,x.EM],[oe.EMBED,x.EMBED],[oe.FIELDSET,x.FIELDSET],[oe.FIGCAPTION,x.FIGCAPTION],[oe.FIGURE,x.FIGURE],[oe.FONT,x.FONT],[oe.FOOTER,x.FOOTER],[oe.FOREIGN_OBJECT,x.FOREIGN_OBJECT],[oe.FORM,x.FORM],[oe.FRAME,x.FRAME],[oe.FRAMESET,x.FRAMESET],[oe.H1,x.H1],[oe.H2,x.H2],[oe.H3,x.H3],[oe.H4,x.H4],[oe.H5,x.H5],[oe.H6,x.H6],[oe.HEAD,x.HEAD],[oe.HEADER,x.HEADER],[oe.HGROUP,x.HGROUP],[oe.HR,x.HR],[oe.HTML,x.HTML],[oe.I,x.I],[oe.IMG,x.IMG],[oe.IMAGE,x.IMAGE],[oe.INPUT,x.INPUT],[oe.IFRAME,x.IFRAME],[oe.KEYGEN,x.KEYGEN],[oe.LABEL,x.LABEL],[oe.LI,x.LI],[oe.LINK,x.LINK],[oe.LISTING,x.LISTING],[oe.MAIN,x.MAIN],[oe.MALIGNMARK,x.MALIGNMARK],[oe.MARQUEE,x.MARQUEE],[oe.MATH,x.MATH],[oe.MENU,x.MENU],[oe.META,x.META],[oe.MGLYPH,x.MGLYPH],[oe.MI,x.MI],[oe.MO,x.MO],[oe.MN,x.MN],[oe.MS,x.MS],[oe.MTEXT,x.MTEXT],[oe.NAV,x.NAV],[oe.NOBR,x.NOBR],[oe.NOFRAMES,x.NOFRAMES],[oe.NOEMBED,x.NOEMBED],[oe.NOSCRIPT,x.NOSCRIPT],[oe.OBJECT,x.OBJECT],[oe.OL,x.OL],[oe.OPTGROUP,x.OPTGROUP],[oe.OPTION,x.OPTION],[oe.P,x.P],[oe.PARAM,x.PARAM],[oe.PLAINTEXT,x.PLAINTEXT],[oe.PRE,x.PRE],[oe.RB,x.RB],[oe.RP,x.RP],[oe.RT,x.RT],[oe.RTC,x.RTC],[oe.RUBY,x.RUBY],[oe.S,x.S],[oe.SCRIPT,x.SCRIPT],[oe.SEARCH,x.SEARCH],[oe.SECTION,x.SECTION],[oe.SELECT,x.SELECT],[oe.SOURCE,x.SOURCE],[oe.SMALL,x.SMALL],[oe.SPAN,x.SPAN],[oe.STRIKE,x.STRIKE],[oe.STRONG,x.STRONG],[oe.STYLE,x.STYLE],[oe.SUB,x.SUB],[oe.SUMMARY,x.SUMMARY],[oe.SUP,x.SUP],[oe.TABLE,x.TABLE],[oe.TBODY,x.TBODY],[oe.TEMPLATE,x.TEMPLATE],[oe.TEXTAREA,x.TEXTAREA],[oe.TFOOT,x.TFOOT],[oe.TD,x.TD],[oe.TH,x.TH],[oe.THEAD,x.THEAD],[oe.TITLE,x.TITLE],[oe.TR,x.TR],[oe.TRACK,x.TRACK],[oe.TT,x.TT],[oe.U,x.U],[oe.UL,x.UL],[oe.SVG,x.SVG],[oe.VAR,x.VAR],[oe.WBR,x.WBR],[oe.XMP,x.XMP]]);function Mi(e){var t;return(t=rM.get(e))!==null&&t!==void 0?t:x.UNKNOWN}const Ne=x,sM={[ke.HTML]:new Set([Ne.ADDRESS,Ne.APPLET,Ne.AREA,Ne.ARTICLE,Ne.ASIDE,Ne.BASE,Ne.BASEFONT,Ne.BGSOUND,Ne.BLOCKQUOTE,Ne.BODY,Ne.BR,Ne.BUTTON,Ne.CAPTION,Ne.CENTER,Ne.COL,Ne.COLGROUP,Ne.DD,Ne.DETAILS,Ne.DIR,Ne.DIV,Ne.DL,Ne.DT,Ne.EMBED,Ne.FIELDSET,Ne.FIGCAPTION,Ne.FIGURE,Ne.FOOTER,Ne.FORM,Ne.FRAME,Ne.FRAMESET,Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6,Ne.HEAD,Ne.HEADER,Ne.HGROUP,Ne.HR,Ne.HTML,Ne.IFRAME,Ne.IMG,Ne.INPUT,Ne.LI,Ne.LINK,Ne.LISTING,Ne.MAIN,Ne.MARQUEE,Ne.MENU,Ne.META,Ne.NAV,Ne.NOEMBED,Ne.NOFRAMES,Ne.NOSCRIPT,Ne.OBJECT,Ne.OL,Ne.P,Ne.PARAM,Ne.PLAINTEXT,Ne.PRE,Ne.SCRIPT,Ne.SECTION,Ne.SELECT,Ne.SOURCE,Ne.STYLE,Ne.SUMMARY,Ne.TABLE,Ne.TBODY,Ne.TD,Ne.TEMPLATE,Ne.TEXTAREA,Ne.TFOOT,Ne.TH,Ne.THEAD,Ne.TITLE,Ne.TR,Ne.TRACK,Ne.UL,Ne.WBR,Ne.XMP]),[ke.MATHML]:new Set([Ne.MI,Ne.MO,Ne.MN,Ne.MS,Ne.MTEXT,Ne.ANNOTATION_XML]),[ke.SVG]:new Set([Ne.TITLE,Ne.FOREIGN_OBJECT,Ne.DESC]),[ke.XLINK]:new Set,[ke.XML]:new Set,[ke.XMLNS]:new Set},cm=new Set([Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6]);oe.STYLE,oe.SCRIPT,oe.XMP,oe.IFRAME,oe.NOEMBED,oe.NOFRAMES,oe.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 pn={DATA:z.DATA,RCDATA:z.RCDATA,RAWTEXT:z.RAWTEXT,SCRIPT_DATA:z.SCRIPT_DATA,PLAINTEXT:z.PLAINTEXT,CDATA_SECTION:z.CDATA_SECTION};function oM(e){return e>=H.DIGIT_0&&e<=H.DIGIT_9}function Fl(e){return e>=H.LATIN_CAPITAL_A&&e<=H.LATIN_CAPITAL_Z}function aM(e){return e>=H.LATIN_SMALL_A&&e<=H.LATIN_SMALL_Z}function lo(e){return aM(e)||Fl(e)}function ob(e){return lo(e)||oM(e)}function Uc(e){return e+32}function HE(e){return e===H.SPACE||e===H.LINE_FEED||e===H.TABULATION||e===H.FORM_FEED}function ab(e){return HE(e)||e===H.SOLIDUS||e===H.GREATER_THAN_SIGN}function iM(e){return e===H.NULL?xe.nullCharacterReference:e>1114111?xe.characterReferenceOutsideUnicodeRange:PE(e)?xe.surrogateCharacterReference:FE(e)?xe.noncharacterCharacterReference:jE(e)||e===H.CARRIAGE_RETURN?xe.controlCharacterReference:null}class lM{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 VI(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new tM(QI,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(xe.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(xe.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=iM(r);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.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:wt.START_TAG,tagName:"",tagID:x.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:wt.END_TAG,tagName:"",tagID:x.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:wt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:wt.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(BE(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(xe.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=Mi(t.tagName),t.type===wt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(xe.endTagWithAttributes),t.selfClosing&&this._err(xe.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 wt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case wt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case wt.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:wt.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=HE(t)?wt.WHITESPACE_CHARACTER:t===H.NULL?wt.NULL_CHARACTER:wt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(wt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=z.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Os.Attribute:Os.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 H.LESS_THAN_SIGN:{this.state=z.TAG_OPEN;break}case H.AMPERSAND:{this._startCharacterReference();break}case H.NULL:{this._err(xe.unexpectedNullCharacter),this._emitCodePoint(t);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case H.AMPERSAND:{this._startCharacterReference();break}case H.LESS_THAN_SIGN:{this.state=z.RCDATA_LESS_THAN_SIGN;break}case H.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(Zt);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case H.LESS_THAN_SIGN:{this.state=z.RAWTEXT_LESS_THAN_SIGN;break}case H.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(Zt);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case H.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_LESS_THAN_SIGN;break}case H.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(Zt);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case H.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(Zt);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(lo(t))this._createStartTagToken(),this.state=z.TAG_NAME,this._stateTagName(t);else switch(t){case H.EXCLAMATION_MARK:{this.state=z.MARKUP_DECLARATION_OPEN;break}case H.SOLIDUS:{this.state=z.END_TAG_OPEN;break}case H.QUESTION_MARK:{this._err(xe.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t);break}case H.EOF:{this._err(xe.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(xe.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=z.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(lo(t))this._createEndTagToken(),this.state=z.TAG_NAME,this._stateTagName(t);else switch(t){case H.GREATER_THAN_SIGN:{this._err(xe.missingEndTagName),this.state=z.DATA;break}case H.EOF:{this._err(xe.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(xe.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=z.BEFORE_ATTRIBUTE_NAME;break}case H.SOLIDUS:{this.state=z.SELF_CLOSING_START_TAG;break}case H.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentTagToken();break}case H.NULL:{this._err(xe.unexpectedNullCharacter),n.tagName+=Zt;break}case H.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Fl(t)?Uc(t):t)}}_stateRcdataLessThanSign(t){t===H.SOLIDUS?this.state=z.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=z.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){lo(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 H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=z.BEFORE_ATTRIBUTE_NAME,!1;case H.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=z.SELF_CLOSING_START_TAG,!1;case H.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===H.SOLIDUS?this.state=z.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=z.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){lo(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 H.SOLIDUS:{this.state=z.SCRIPT_DATA_END_TAG_OPEN;break}case H.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){lo(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===H.HYPHEN_MINUS?(this.state=z.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===H.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 H.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case H.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(Zt);break}case H.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case H.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case H.NULL:{this._err(xe.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_ESCAPED,this._emitChars(Zt);break}case H.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case H.HYPHEN_MINUS:{this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case H.GREATER_THAN_SIGN:{this.state=z.SCRIPT_DATA,this._emitChars(">");break}case H.NULL:{this._err(xe.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_ESCAPED,this._emitChars(Zt);break}case H.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===H.SOLIDUS?this.state=z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:lo(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){lo(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(er.SCRIPT,!1)&&ab(this.preprocessor.peek(er.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<er.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 H.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case H.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(Zt);break}case H.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case H.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case H.NULL:{this._err(xe.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Zt);break}case H.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case H.HYPHEN_MINUS:{this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case H.GREATER_THAN_SIGN:{this.state=z.SCRIPT_DATA,this._emitChars(">");break}case H.NULL:{this._err(xe.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Zt);break}case H.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===H.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(er.SCRIPT,!1)&&ab(this.preprocessor.peek(er.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<er.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 H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.SOLIDUS:case H.GREATER_THAN_SIGN:case H.EOF:{this.state=z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case H.EQUALS_SIGN:{this._err(xe.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 H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:case H.SOLIDUS:case H.GREATER_THAN_SIGN:case H.EOF:{this._leaveAttrName(),this.state=z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case H.EQUALS_SIGN:{this._leaveAttrName(),this.state=z.BEFORE_ATTRIBUTE_VALUE;break}case H.QUOTATION_MARK:case H.APOSTROPHE:case H.LESS_THAN_SIGN:{this._err(xe.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case H.NULL:{this._err(xe.unexpectedNullCharacter),this.currentAttr.name+=Zt;break}default:this.currentAttr.name+=String.fromCodePoint(Fl(t)?Uc(t):t)}}_stateAfterAttributeName(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.SOLIDUS:{this.state=z.SELF_CLOSING_START_TAG;break}case H.EQUALS_SIGN:{this.state=z.BEFORE_ATTRIBUTE_VALUE;break}case H.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentTagToken();break}case H.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=z.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.QUOTATION_MARK:{this.state=z.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case H.APOSTROPHE:{this.state=z.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case H.GREATER_THAN_SIGN:{this._err(xe.missingAttributeValue),this.state=z.DATA,this.emitCurrentTagToken();break}default:this.state=z.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case H.QUOTATION_MARK:{this.state=z.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case H.AMPERSAND:{this._startCharacterReference();break}case H.NULL:{this._err(xe.unexpectedNullCharacter),this.currentAttr.value+=Zt;break}case H.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case H.APOSTROPHE:{this.state=z.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case H.AMPERSAND:{this._startCharacterReference();break}case H.NULL:{this._err(xe.unexpectedNullCharacter),this.currentAttr.value+=Zt;break}case H.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this._leaveAttrValue(),this.state=z.BEFORE_ATTRIBUTE_NAME;break}case H.AMPERSAND:{this._startCharacterReference();break}case H.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=z.DATA,this.emitCurrentTagToken();break}case H.NULL:{this._err(xe.unexpectedNullCharacter),this.currentAttr.value+=Zt;break}case H.QUOTATION_MARK:case H.APOSTROPHE:case H.LESS_THAN_SIGN:case H.EQUALS_SIGN:case H.GRAVE_ACCENT:{this._err(xe.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case H.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this._leaveAttrValue(),this.state=z.BEFORE_ATTRIBUTE_NAME;break}case H.SOLIDUS:{this._leaveAttrValue(),this.state=z.SELF_CLOSING_START_TAG;break}case H.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=z.DATA,this.emitCurrentTagToken();break}case H.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this._err(xe.missingWhitespaceBetweenAttributes),this.state=z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case H.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=z.DATA,this.emitCurrentTagToken();break}case H.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this._err(xe.unexpectedSolidusInTag),this.state=z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case H.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentComment(n);break}case H.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case H.NULL:{this._err(xe.unexpectedNullCharacter),n.data+=Zt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(er.DASH_DASH,!0)?(this._createCommentToken(er.DASH_DASH.length+1),this.state=z.COMMENT_START):this._consumeSequenceIfMatch(er.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(er.DOCTYPE.length+1),this.state=z.DOCTYPE):this._consumeSequenceIfMatch(er.CDATA_START,!0)?this.inForeignNode?this.state=z.CDATA_SECTION:(this._err(xe.cdataInHtmlContent),this._createCommentToken(er.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=z.BOGUS_COMMENT):this._ensureHibernation()||(this._err(xe.incorrectlyOpenedComment),this._createCommentToken(2),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case H.HYPHEN_MINUS:{this.state=z.COMMENT_START_DASH;break}case H.GREATER_THAN_SIGN:{this._err(xe.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 H.HYPHEN_MINUS:{this.state=z.COMMENT_END;break}case H.GREATER_THAN_SIGN:{this._err(xe.abruptClosingOfEmptyComment),this.state=z.DATA,this.emitCurrentComment(n);break}case H.EOF:{this._err(xe.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 H.HYPHEN_MINUS:{this.state=z.COMMENT_END_DASH;break}case H.LESS_THAN_SIGN:{n.data+="<",this.state=z.COMMENT_LESS_THAN_SIGN;break}case H.NULL:{this._err(xe.unexpectedNullCharacter),n.data+=Zt;break}case H.EOF:{this._err(xe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case H.EXCLAMATION_MARK:{n.data+="!",this.state=z.COMMENT_LESS_THAN_SIGN_BANG;break}case H.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=z.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===H.HYPHEN_MINUS?this.state=z.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=z.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===H.HYPHEN_MINUS?this.state=z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=z.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==H.GREATER_THAN_SIGN&&t!==H.EOF&&this._err(xe.nestedComment),this.state=z.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case H.HYPHEN_MINUS:{this.state=z.COMMENT_END;break}case H.EOF:{this._err(xe.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 H.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentComment(n);break}case H.EXCLAMATION_MARK:{this.state=z.COMMENT_END_BANG;break}case H.HYPHEN_MINUS:{n.data+="-";break}case H.EOF:{this._err(xe.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 H.HYPHEN_MINUS:{n.data+="--!",this.state=z.COMMENT_END_DASH;break}case H.GREATER_THAN_SIGN:{this._err(xe.incorrectlyClosedComment),this.state=z.DATA,this.emitCurrentComment(n);break}case H.EOF:{this._err(xe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=z.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=z.BEFORE_DOCTYPE_NAME;break}case H.GREATER_THAN_SIGN:{this.state=z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case H.EOF:{this._err(xe.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingWhitespaceBeforeDoctypeName),this.state=z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Fl(t))this._createDoctypeToken(String.fromCharCode(Uc(t))),this.state=z.DOCTYPE_NAME;else switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.NULL:{this._err(xe.unexpectedNullCharacter),this._createDoctypeToken(Zt),this.state=z.DOCTYPE_NAME;break}case H.GREATER_THAN_SIGN:{this._err(xe.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case H.EOF:{this._err(xe.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 H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=z.AFTER_DOCTYPE_NAME;break}case H.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentDoctype(n);break}case H.NULL:{this._err(xe.unexpectedNullCharacter),n.name+=Zt;break}case H.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Fl(t)?Uc(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentDoctype(n);break}case H.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(er.PUBLIC,!1)?this.state=z.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(er.SYSTEM,!1)?this.state=z.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(xe.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case H.QUOTATION_MARK:{this._err(xe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{this._err(xe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case H.GREATER_THAN_SIGN:{this._err(xe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case H.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.QUOTATION_MARK:{n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case H.GREATER_THAN_SIGN:{this._err(xe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case H.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case H.QUOTATION_MARK:{this.state=z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case H.NULL:{this._err(xe.unexpectedNullCharacter),n.publicId+=Zt;break}case H.GREATER_THAN_SIGN:{this._err(xe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case H.EOF:{this._err(xe.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 H.APOSTROPHE:{this.state=z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case H.NULL:{this._err(xe.unexpectedNullCharacter),n.publicId+=Zt;break}case H.GREATER_THAN_SIGN:{this._err(xe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case H.EOF:{this._err(xe.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 H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case H.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentDoctype(n);break}case H.QUOTATION_MARK:{this._err(xe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{this._err(xe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case H.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=z.DATA;break}case H.QUOTATION_MARK:{n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case H.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case H.QUOTATION_MARK:{this._err(xe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{this._err(xe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case H.GREATER_THAN_SIGN:{this._err(xe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case H.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.QUOTATION_MARK:{n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case H.GREATER_THAN_SIGN:{this._err(xe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case H.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case H.QUOTATION_MARK:{this.state=z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case H.NULL:{this._err(xe.unexpectedNullCharacter),n.systemId+=Zt;break}case H.GREATER_THAN_SIGN:{this._err(xe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case H.EOF:{this._err(xe.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 H.APOSTROPHE:{this.state=z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case H.NULL:{this._err(xe.unexpectedNullCharacter),n.systemId+=Zt;break}case H.GREATER_THAN_SIGN:{this._err(xe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case H.EOF:{this._err(xe.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 H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=z.DATA;break}case H.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case H.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=z.DATA;break}case H.NULL:{this._err(xe.unexpectedNullCharacter);break}case H.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case H.RIGHT_SQUARE_BRACKET:{this.state=z.CDATA_SECTION_BRACKET;break}case H.EOF:{this._err(xe.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===H.RIGHT_SQUARE_BRACKET?this.state=z.CDATA_SECTION_END:(this._emitChars("]"),this.state=z.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case H.GREATER_THAN_SIGN:{this.state=z.DATA;break}case H.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(H.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&ob(this.preprocessor.peek(1))?z.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){ob(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===H.SEMICOLON&&this._err(xe.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const UE=new Set([x.DD,x.DT,x.LI,x.OPTGROUP,x.OPTION,x.P,x.RB,x.RP,x.RT,x.RTC]),ib=new Set([...UE,x.CAPTION,x.COLGROUP,x.TBODY,x.TD,x.TFOOT,x.TH,x.THEAD,x.TR]),fd=new Set([x.APPLET,x.CAPTION,x.HTML,x.MARQUEE,x.OBJECT,x.TABLE,x.TD,x.TEMPLATE,x.TH]),uM=new Set([...fd,x.OL,x.UL]),cM=new Set([...fd,x.BUTTON]),lb=new Set([x.ANNOTATION_XML,x.MI,x.MN,x.MO,x.MS,x.MTEXT]),ub=new Set([x.DESC,x.FOREIGN_OBJECT,x.TITLE]),dM=new Set([x.TR,x.TEMPLATE,x.HTML]),fM=new Set([x.TBODY,x.TFOOT,x.THEAD,x.TEMPLATE,x.HTML]),hM=new Set([x.TABLE,x.TEMPLATE,x.HTML]),mM=new Set([x.TD,x.TH]);class pM{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=x.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===x.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ke.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 s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===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])!==ke.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(cm,ke.HTML)}popUntilTableCellPopped(){this.popUntilPopped(mM,ke.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(hM,ke.HTML)}clearBackToTableBodyContext(){this.clearBackTo(fM,ke.HTML)}clearBackToTableRowContext(){this.clearBackTo(dM,ke.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]===x.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]===x.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ke.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case ke.SVG:{if(ub.has(s))return!1;break}case ke.MATHML:{if(lb.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,fd)}hasInListItemScope(t){return this.hasInDynamicScope(t,uM)}hasInButtonScope(t){return this.hasInDynamicScope(t,cM)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ke.HTML:{if(cm.has(n))return!0;if(fd.has(n))return!1;break}case ke.SVG:{if(ub.has(n))return!1;break}case ke.MATHML:{if(lb.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ke.HTML)switch(this.tagIDs[n]){case t:return!0;case x.TABLE:case x.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===ke.HTML)switch(this.tagIDs[t]){case x.TBODY:case x.THEAD:case x.TFOOT:return!0;case x.TABLE:case x.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ke.HTML)switch(this.tagIDs[n]){case t:return!0;case x.OPTION:case x.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&UE.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&ib.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&ib.has(this.currentTagId);)this.pop()}}const v0=3;var os;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(os||(os={}));const cb={type:os.Marker};class yM{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],s=n.length,i=this.treeAdapter.getTagName(t),l=this.treeAdapter.getNamespaceURI(t);for(let u=0;u<this.entries.length;u++){const f=this.entries[u];if(f.type===os.Marker)break;const{element:h}=f;if(this.treeAdapter.getTagName(h)===i&&this.treeAdapter.getNamespaceURI(h)===l){const p=this.treeAdapter.getAttrList(h);p.length===s&&r.push({idx:u,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<v0)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<v0)return;const s=new Map(n.map(l=>[l.name,l.value]));let i=0;for(let l=0;l<r.length;l++){const u=r[l];u.attrs.every(f=>s.get(f.name)===f.value)&&(i+=1,i>=v0&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(cb)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:os.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:os.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(cb);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===os.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===os.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===os.Element&&n.element===t)}}const uo={createDocument(){return{nodeName:"#document",mode:Or.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 s=e.childNodes.find(i=>i.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=r;else{const i={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};uo.appendChild(e,i)}},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(uo.isTextNode(n)){n.value+=t;return}}uo.appendChild(e,uo.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&uo.isTextNode(r)?r.value+=t:uo.insertBefore(e,uo.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}}},zE="html",gM="about:legacy-compat",xM="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",WE=["+//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//"],bM=[...WE,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],vM=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),YE=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],EM=[...YE,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function db(e,t){return t.some(n=>e.startsWith(n))}function TM(e){return e.name===zE&&e.publicId===null&&(e.systemId===null||e.systemId===gM)}function wM(e){if(e.name!==zE)return Or.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===xM)return Or.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),vM.has(n))return Or.QUIRKS;let r=t===null?bM:WE;if(db(n,r))return Or.QUIRKS;if(r=t===null?YE:EM,db(n,r))return Or.LIMITED_QUIRKS}return Or.NO_QUIRKS}const fb={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},kM="definitionurl",SM="definitionURL",CM=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])),NM=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ke.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ke.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ke.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ke.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ke.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ke.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ke.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ke.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ke.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ke.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ke.XMLNS}]]),_M=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])),DM=new Set([x.B,x.BIG,x.BLOCKQUOTE,x.BODY,x.BR,x.CENTER,x.CODE,x.DD,x.DIV,x.DL,x.DT,x.EM,x.EMBED,x.H1,x.H2,x.H3,x.H4,x.H5,x.H6,x.HEAD,x.HR,x.I,x.IMG,x.LI,x.LISTING,x.MENU,x.META,x.NOBR,x.OL,x.P,x.PRE,x.RUBY,x.S,x.SMALL,x.SPAN,x.STRONG,x.STRIKE,x.SUB,x.SUP,x.TABLE,x.TT,x.U,x.UL,x.VAR]);function OM(e){const t=e.tagID;return t===x.FONT&&e.attrs.some(({name:r})=>r===aa.COLOR||r===aa.SIZE||r===aa.FACE)||DM.has(t)}function $E(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===kM){e.attrs[t].name=SM;break}}function qE(e){for(let t=0;t<e.attrs.length;t++){const n=CM.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function yp(e){for(let t=0;t<e.attrs.length;t++){const n=NM.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 AM(e){const t=_M.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Mi(e.tagName))}function IM(e,t){return t===ke.MATHML&&(e===x.MI||e===x.MO||e===x.MN||e===x.MS||e===x.MTEXT)}function MM(e,t,n){if(t===ke.MATHML&&e===x.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===aa.ENCODING){const s=n[r].value.toLowerCase();return s===fb.TEXT_HTML||s===fb.APPLICATION_XML}}return t===ke.SVG&&(e===x.FOREIGN_OBJECT||e===x.DESC||e===x.TITLE)}function LM(e,t,n,r){return(!r||r===ke.HTML)&&MM(e,t,n)||(!r||r===ke.MATHML)&&IM(e,t)}const RM="hidden",PM=8,jM=3;var V;(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"})(V||(V={}));const FM={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},VE=new Set([x.TABLE,x.TBODY,x.TFOOT,x.THEAD,x.TR]),hb={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:uo,onParseError:null};class mb{constructor(t,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=V.INITIAL,this.originalInsertionMode=V.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={...hb,...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 lM(this.options,this),this.activeFormattingElements=new yM(this.treeAdapter),this.fragmentContextID=r?Mi(this.treeAdapter.getTagName(r)):x.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new pM(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={...hb,...n};t??(t=r.treeAdapter.createElement(oe.TEMPLATE,ke.HTML,[]));const s=r.treeAdapter.createElement("documentmock",ke.HTML,[]),i=new this(r,s,t);return i.fragmentContextID===x.TEMPLATE&&i.tmplInsertionModeStack.unshift(V.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var s;if(!this.onParseError)return;const i=(s=t.location)!==null&&s!==void 0?s:FM,l={code:n,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:r?i.startLine:i.endLine,endCol:r?i.startCol:i.endCol,endOffset:r?i.startOffset:i.endOffset};this.onParseError(l)}onItemPush(t,n,r){var s,i;(i=(s=this.treeAdapter).onItemPush)===null||i===void 0||i.call(s,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,t,this.openElements.current),n){let i,l;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,l=this.fragmentContextID):{current:i,currentTagId:l}=this.openElements,this._setContextModes(i,l)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===ke.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ke.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=V.TEXT}switchToPlaintextParsing(){this.insertionMode=V.TEXT,this.originalInsertionMode=V.IN_BODY,this.tokenizer.state=pn.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)===oe.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ke.HTML))switch(this.fragmentContextID){case x.TITLE:case x.TEXTAREA:{this.tokenizer.state=pn.RCDATA;break}case x.STYLE:case x.XMP:case x.IFRAME:case x.NOEMBED:case x.NOFRAMES:case x.NOSCRIPT:{this.tokenizer.state=pn.RAWTEXT;break}case x.SCRIPT:{this.tokenizer.state=pn.SCRIPT_DATA;break}case x.PLAINTEXT:{this.tokenizer.state=pn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),t.location){const l=this.treeAdapter.getChildNodes(this.document).find(u=>this.treeAdapter.isDocumentTypeNode(u));l&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,ke.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ke.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(oe.HTML,ke.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,x.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 s=this.treeAdapter.getChildNodes(n),i=r?s.lastIndexOf(r):s.length,l=s[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(l)){const{endLine:f,endCol:h,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:f,endCol:h,endOffset:p})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(t),i=n.type===wt.END_TAG&&s===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,i)}}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===x.SVG&&this.treeAdapter.getTagName(n)===oe.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ke.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===x.MGLYPH||t.tagID===x.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ke.HTML)}_processToken(t){switch(t.type){case wt.CHARACTER:{this.onCharacter(t);break}case wt.NULL_CHARACTER:{this.onNullCharacter(t);break}case wt.COMMENT:{this.onComment(t);break}case wt.DOCTYPE:{this.onDoctype(t);break}case wt.START_TAG:{this._processStartTag(t);break}case wt.END_TAG:{this.onEndTag(t);break}case wt.EOF:{this.onEof(t);break}case wt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return LM(t,s,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===os.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const i=this.activeFormattingElements.entries[s];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=V.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(x.P),this.openElements.popUntilTagNamePopped(x.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case x.TR:{this.insertionMode=V.IN_ROW;return}case x.TBODY:case x.THEAD:case x.TFOOT:{this.insertionMode=V.IN_TABLE_BODY;return}case x.CAPTION:{this.insertionMode=V.IN_CAPTION;return}case x.COLGROUP:{this.insertionMode=V.IN_COLUMN_GROUP;return}case x.TABLE:{this.insertionMode=V.IN_TABLE;return}case x.BODY:{this.insertionMode=V.IN_BODY;return}case x.FRAMESET:{this.insertionMode=V.IN_FRAMESET;return}case x.SELECT:{this._resetInsertionModeForSelect(t);return}case x.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case x.HTML:{this.insertionMode=this.headElement?V.AFTER_HEAD:V.BEFORE_HEAD;return}case x.TD:case x.TH:{if(t>0){this.insertionMode=V.IN_CELL;return}break}case x.HEAD:{if(t>0){this.insertionMode=V.IN_HEAD;return}break}}this.insertionMode=V.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===x.TEMPLATE)break;if(r===x.TABLE){this.insertionMode=V.IN_SELECT_IN_TABLE;return}}this.insertionMode=V.IN_SELECT}_isElementCausesFosterParenting(t){return VE.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 x.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===ke.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case x.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 sM[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){mR(this,t);return}switch(this.insertionMode){case V.INITIAL:{Il(this,t);break}case V.BEFORE_HTML:{Yl(this,t);break}case V.BEFORE_HEAD:{$l(this,t);break}case V.IN_HEAD:{ql(this,t);break}case V.IN_HEAD_NO_SCRIPT:{Vl(this,t);break}case V.AFTER_HEAD:{Ql(this,t);break}case V.IN_BODY:case V.IN_CAPTION:case V.IN_CELL:case V.IN_TEMPLATE:{GE(this,t);break}case V.TEXT:case V.IN_SELECT:case V.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case V.IN_TABLE:case V.IN_TABLE_BODY:case V.IN_ROW:{E0(this,t);break}case V.IN_TABLE_TEXT:{tT(this,t);break}case V.IN_COLUMN_GROUP:{hd(this,t);break}case V.AFTER_BODY:{md(this,t);break}case V.AFTER_AFTER_BODY:{Vc(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){hR(this,t);return}switch(this.insertionMode){case V.INITIAL:{Il(this,t);break}case V.BEFORE_HTML:{Yl(this,t);break}case V.BEFORE_HEAD:{$l(this,t);break}case V.IN_HEAD:{ql(this,t);break}case V.IN_HEAD_NO_SCRIPT:{Vl(this,t);break}case V.AFTER_HEAD:{Ql(this,t);break}case V.TEXT:{this._insertCharacters(t);break}case V.IN_TABLE:case V.IN_TABLE_BODY:case V.IN_ROW:{E0(this,t);break}case V.IN_COLUMN_GROUP:{hd(this,t);break}case V.AFTER_BODY:{md(this,t);break}case V.AFTER_AFTER_BODY:{Vc(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){dm(this,t);return}switch(this.insertionMode){case V.INITIAL:case V.BEFORE_HTML:case V.BEFORE_HEAD:case V.IN_HEAD:case V.IN_HEAD_NO_SCRIPT:case V.AFTER_HEAD:case V.IN_BODY:case V.IN_TABLE:case V.IN_CAPTION:case V.IN_COLUMN_GROUP:case V.IN_TABLE_BODY:case V.IN_ROW:case V.IN_CELL:case V.IN_SELECT:case V.IN_SELECT_IN_TABLE:case V.IN_TEMPLATE:case V.IN_FRAMESET:case V.AFTER_FRAMESET:{dm(this,t);break}case V.IN_TABLE_TEXT:{Ml(this,t);break}case V.AFTER_BODY:{$M(this,t);break}case V.AFTER_AFTER_BODY:case V.AFTER_AFTER_FRAMESET:{qM(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case V.INITIAL:{VM(this,t);break}case V.BEFORE_HEAD:case V.IN_HEAD:case V.IN_HEAD_NO_SCRIPT:case V.AFTER_HEAD:{this._err(t,xe.misplacedDoctype);break}case V.IN_TABLE_TEXT:{Ml(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,xe.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?pR(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case V.INITIAL:{Il(this,t);break}case V.BEFORE_HTML:{QM(this,t);break}case V.BEFORE_HEAD:{KM(this,t);break}case V.IN_HEAD:{qr(this,t);break}case V.IN_HEAD_NO_SCRIPT:{ZM(this,t);break}case V.AFTER_HEAD:{tL(this,t);break}case V.IN_BODY:{Un(this,t);break}case V.IN_TABLE:{Ei(this,t);break}case V.IN_TABLE_TEXT:{Ml(this,t);break}case V.IN_CAPTION:{XL(this,t);break}case V.IN_COLUMN_GROUP:{bp(this,t);break}case V.IN_TABLE_BODY:{ef(this,t);break}case V.IN_ROW:{tf(this,t);break}case V.IN_CELL:{eR(this,t);break}case V.IN_SELECT:{sT(this,t);break}case V.IN_SELECT_IN_TABLE:{nR(this,t);break}case V.IN_TEMPLATE:{sR(this,t);break}case V.AFTER_BODY:{aR(this,t);break}case V.IN_FRAMESET:{iR(this,t);break}case V.AFTER_FRAMESET:{uR(this,t);break}case V.AFTER_AFTER_BODY:{dR(this,t);break}case V.AFTER_AFTER_FRAMESET:{fR(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?yR(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case V.INITIAL:{Il(this,t);break}case V.BEFORE_HTML:{GM(this,t);break}case V.BEFORE_HEAD:{XM(this,t);break}case V.IN_HEAD:{JM(this,t);break}case V.IN_HEAD_NO_SCRIPT:{eL(this,t);break}case V.AFTER_HEAD:{nL(this,t);break}case V.IN_BODY:{Zd(this,t);break}case V.TEXT:{UL(this,t);break}case V.IN_TABLE:{eu(this,t);break}case V.IN_TABLE_TEXT:{Ml(this,t);break}case V.IN_CAPTION:{JL(this,t);break}case V.IN_COLUMN_GROUP:{ZL(this,t);break}case V.IN_TABLE_BODY:{fm(this,t);break}case V.IN_ROW:{rT(this,t);break}case V.IN_CELL:{tR(this,t);break}case V.IN_SELECT:{oT(this,t);break}case V.IN_SELECT_IN_TABLE:{rR(this,t);break}case V.IN_TEMPLATE:{oR(this,t);break}case V.AFTER_BODY:{iT(this,t);break}case V.IN_FRAMESET:{lR(this,t);break}case V.AFTER_FRAMESET:{cR(this,t);break}case V.AFTER_AFTER_BODY:{Vc(this,t);break}}}onEof(t){switch(this.insertionMode){case V.INITIAL:{Il(this,t);break}case V.BEFORE_HTML:{Yl(this,t);break}case V.BEFORE_HEAD:{$l(this,t);break}case V.IN_HEAD:{ql(this,t);break}case V.IN_HEAD_NO_SCRIPT:{Vl(this,t);break}case V.AFTER_HEAD:{Ql(this,t);break}case V.IN_BODY:case V.IN_TABLE:case V.IN_CAPTION:case V.IN_COLUMN_GROUP:case V.IN_TABLE_BODY:case V.IN_ROW:case V.IN_CELL:case V.IN_SELECT:case V.IN_SELECT_IN_TABLE:{ZE(this,t);break}case V.TEXT:{zL(this,t);break}case V.IN_TABLE_TEXT:{Ml(this,t);break}case V.IN_TEMPLATE:{aT(this,t);break}case V.AFTER_BODY:case V.IN_FRAMESET:case V.AFTER_FRAMESET:case V.AFTER_AFTER_BODY:case V.AFTER_AFTER_FRAMESET:{xp(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===H.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 V.IN_HEAD:case V.IN_HEAD_NO_SCRIPT:case V.AFTER_HEAD:case V.TEXT:case V.IN_COLUMN_GROUP:case V.IN_SELECT:case V.IN_SELECT_IN_TABLE:case V.IN_FRAMESET:case V.AFTER_FRAMESET:{this._insertCharacters(t);break}case V.IN_BODY:case V.IN_CAPTION:case V.IN_CELL:case V.IN_TEMPLATE:case V.AFTER_BODY:case V.AFTER_AFTER_BODY:case V.AFTER_AFTER_FRAMESET:{QE(this,t);break}case V.IN_TABLE:case V.IN_TABLE_BODY:case V.IN_ROW:{E0(this,t);break}case V.IN_TABLE_TEXT:{eT(this,t);break}}}}function BM(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):JE(e,t),n}function HM(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function UM(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let i=0,l=s;l!==n;i++,l=s){s=e.openElements.getCommonAncestor(l);const u=e.activeFormattingElements.getElementEntry(l),f=u&&i>=jM;!u||f?(f&&e.activeFormattingElements.removeEntry(u),e.openElements.remove(l)):(l=zM(e,u),r===t&&(e.activeFormattingElements.bookmark=u),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(l,r),r=l)}return r}function zM(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 WM(e,t,n){const r=e.treeAdapter.getTagName(t),s=Mi(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);s===x.TEMPLATE&&i===ke.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function YM(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,i=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i,s.tagID)}function gp(e,t){for(let n=0;n<PM;n++){const r=BM(e,t);if(!r)break;const s=HM(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const i=UM(e,s,r.element),l=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(i),l&&WM(e,l,i),YM(e,s,r)}}function dm(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function $M(e,t){e._appendCommentNode(t,e.openElements.items[0])}function qM(e,t){e._appendCommentNode(t,e.document)}function xp(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],s=e.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const i=e.openElements.items[1],l=e.treeAdapter.getNodeSourceCodeLocation(i);l&&!l.endTag&&e._setEndLocation(i,t)}}}}function VM(e,t){e._setDocumentType(t);const n=t.forceQuirks?Or.QUIRKS:wM(t);TM(t)||e._err(t,xe.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=V.BEFORE_HTML}function Il(e,t){e._err(t,xe.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Or.QUIRKS),e.insertionMode=V.BEFORE_HTML,e._processToken(t)}function QM(e,t){t.tagID===x.HTML?(e._insertElement(t,ke.HTML),e.insertionMode=V.BEFORE_HEAD):Yl(e,t)}function GM(e,t){const n=t.tagID;(n===x.HTML||n===x.HEAD||n===x.BODY||n===x.BR)&&Yl(e,t)}function Yl(e,t){e._insertFakeRootElement(),e.insertionMode=V.BEFORE_HEAD,e._processToken(t)}function KM(e,t){switch(t.tagID){case x.HTML:{Un(e,t);break}case x.HEAD:{e._insertElement(t,ke.HTML),e.headElement=e.openElements.current,e.insertionMode=V.IN_HEAD;break}default:$l(e,t)}}function XM(e,t){const n=t.tagID;n===x.HEAD||n===x.BODY||n===x.HTML||n===x.BR?$l(e,t):e._err(t,xe.endTagWithoutMatchingOpenElement)}function $l(e,t){e._insertFakeElement(oe.HEAD,x.HEAD),e.headElement=e.openElements.current,e.insertionMode=V.IN_HEAD,e._processToken(t)}function qr(e,t){switch(t.tagID){case x.HTML:{Un(e,t);break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:{e._appendElement(t,ke.HTML),t.ackSelfClosing=!0;break}case x.TITLE:{e._switchToTextParsing(t,pn.RCDATA);break}case x.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,pn.RAWTEXT):(e._insertElement(t,ke.HTML),e.insertionMode=V.IN_HEAD_NO_SCRIPT);break}case x.NOFRAMES:case x.STYLE:{e._switchToTextParsing(t,pn.RAWTEXT);break}case x.SCRIPT:{e._switchToTextParsing(t,pn.SCRIPT_DATA);break}case x.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=V.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(V.IN_TEMPLATE);break}case x.HEAD:{e._err(t,xe.misplacedStartTagForHeadElement);break}default:ql(e,t)}}function JM(e,t){switch(t.tagID){case x.HEAD:{e.openElements.pop(),e.insertionMode=V.AFTER_HEAD;break}case x.BODY:case x.BR:case x.HTML:{ql(e,t);break}case x.TEMPLATE:{Ea(e,t);break}default:e._err(t,xe.endTagWithoutMatchingOpenElement)}}function Ea(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==x.TEMPLATE&&e._err(t,xe.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(x.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,xe.endTagWithoutMatchingOpenElement)}function ql(e,t){e.openElements.pop(),e.insertionMode=V.AFTER_HEAD,e._processToken(t)}function ZM(e,t){switch(t.tagID){case x.HTML:{Un(e,t);break}case x.BASEFONT:case x.BGSOUND:case x.HEAD:case x.LINK:case x.META:case x.NOFRAMES:case x.STYLE:{qr(e,t);break}case x.NOSCRIPT:{e._err(t,xe.nestedNoscriptInHead);break}default:Vl(e,t)}}function eL(e,t){switch(t.tagID){case x.NOSCRIPT:{e.openElements.pop(),e.insertionMode=V.IN_HEAD;break}case x.BR:{Vl(e,t);break}default:e._err(t,xe.endTagWithoutMatchingOpenElement)}}function Vl(e,t){const n=t.type===wt.EOF?xe.openElementsLeftAfterEof:xe.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=V.IN_HEAD,e._processToken(t)}function tL(e,t){switch(t.tagID){case x.HTML:{Un(e,t);break}case x.BODY:{e._insertElement(t,ke.HTML),e.framesetOk=!1,e.insertionMode=V.IN_BODY;break}case x.FRAMESET:{e._insertElement(t,ke.HTML),e.insertionMode=V.IN_FRAMESET;break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:case x.NOFRAMES:case x.SCRIPT:case x.STYLE:case x.TEMPLATE:case x.TITLE:{e._err(t,xe.abandonedHeadElementChild),e.openElements.push(e.headElement,x.HEAD),qr(e,t),e.openElements.remove(e.headElement);break}case x.HEAD:{e._err(t,xe.misplacedStartTagForHeadElement);break}default:Ql(e,t)}}function nL(e,t){switch(t.tagID){case x.BODY:case x.HTML:case x.BR:{Ql(e,t);break}case x.TEMPLATE:{Ea(e,t);break}default:e._err(t,xe.endTagWithoutMatchingOpenElement)}}function Ql(e,t){e._insertFakeElement(oe.BODY,x.BODY),e.insertionMode=V.IN_BODY,Jd(e,t)}function Jd(e,t){switch(t.type){case wt.CHARACTER:{GE(e,t);break}case wt.WHITESPACE_CHARACTER:{QE(e,t);break}case wt.COMMENT:{dm(e,t);break}case wt.START_TAG:{Un(e,t);break}case wt.END_TAG:{Zd(e,t);break}case wt.EOF:{ZE(e,t);break}}}function QE(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function GE(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function rL(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function sL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function oL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ke.HTML),e.insertionMode=V.IN_FRAMESET)}function aL(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ke.HTML)}function iL(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&cm.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ke.HTML)}function lL(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ke.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function uL(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ke.HTML),n||(e.formElement=e.openElements.current))}function cL(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const s=e.openElements.tagIDs[r];if(n===x.LI&&s===x.LI||(n===x.DD||n===x.DT)&&(s===x.DD||s===x.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==x.ADDRESS&&s!==x.DIV&&s!==x.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ke.HTML)}function dL(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ke.HTML),e.tokenizer.state=pn.PLAINTEXT}function fL(e,t){e.openElements.hasInScope(x.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(x.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.framesetOk=!1}function hL(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(oe.A);n&&(gp(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function mL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function pL(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(x.NOBR)&&(gp(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ke.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function yL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function gL(e,t){e.treeAdapter.getDocumentMode(e.document)!==Or.QUIRKS&&e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ke.HTML),e.framesetOk=!1,e.insertionMode=V.IN_TABLE}function KE(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ke.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function XE(e){const t=BE(e,aa.TYPE);return t!=null&&t.toLowerCase()===RM}function xL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ke.HTML),XE(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function bL(e,t){e._appendElement(t,ke.HTML),t.ackSelfClosing=!0}function vL(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._appendElement(t,ke.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function EL(e,t){t.tagName=oe.IMG,t.tagID=x.IMG,KE(e,t)}function TL(e,t){e._insertElement(t,ke.HTML),e.skipNextNewLine=!0,e.tokenizer.state=pn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=V.TEXT}function wL(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,pn.RAWTEXT)}function kL(e,t){e.framesetOk=!1,e._switchToTextParsing(t,pn.RAWTEXT)}function pb(e,t){e._switchToTextParsing(t,pn.RAWTEXT)}function SL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===V.IN_TABLE||e.insertionMode===V.IN_CAPTION||e.insertionMode===V.IN_TABLE_BODY||e.insertionMode===V.IN_ROW||e.insertionMode===V.IN_CELL?V.IN_SELECT_IN_TABLE:V.IN_SELECT}function CL(e,t){e.openElements.currentTagId===x.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML)}function NL(e,t){e.openElements.hasInScope(x.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ke.HTML)}function _L(e,t){e.openElements.hasInScope(x.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(x.RTC),e._insertElement(t,ke.HTML)}function DL(e,t){e._reconstructActiveFormattingElements(),$E(t),yp(t),t.selfClosing?e._appendElement(t,ke.MATHML):e._insertElement(t,ke.MATHML),t.ackSelfClosing=!0}function OL(e,t){e._reconstructActiveFormattingElements(),qE(t),yp(t),t.selfClosing?e._appendElement(t,ke.SVG):e._insertElement(t,ke.SVG),t.ackSelfClosing=!0}function yb(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML)}function Un(e,t){switch(t.tagID){case x.I:case x.S:case x.B:case x.U:case x.EM:case x.TT:case x.BIG:case x.CODE:case x.FONT:case x.SMALL:case x.STRIKE:case x.STRONG:{mL(e,t);break}case x.A:{hL(e,t);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{iL(e,t);break}case x.P:case x.DL:case x.OL:case x.UL:case x.DIV:case x.DIR:case x.NAV:case x.MAIN:case x.MENU:case x.ASIDE:case x.CENTER:case x.FIGURE:case x.FOOTER:case x.HEADER:case x.HGROUP:case x.DIALOG:case x.DETAILS:case x.ADDRESS:case x.ARTICLE:case x.SEARCH:case x.SECTION:case x.SUMMARY:case x.FIELDSET:case x.BLOCKQUOTE:case x.FIGCAPTION:{aL(e,t);break}case x.LI:case x.DD:case x.DT:{cL(e,t);break}case x.BR:case x.IMG:case x.WBR:case x.AREA:case x.EMBED:case x.KEYGEN:{KE(e,t);break}case x.HR:{vL(e,t);break}case x.RB:case x.RTC:{NL(e,t);break}case x.RT:case x.RP:{_L(e,t);break}case x.PRE:case x.LISTING:{lL(e,t);break}case x.XMP:{wL(e,t);break}case x.SVG:{OL(e,t);break}case x.HTML:{rL(e,t);break}case x.BASE:case x.LINK:case x.META:case x.STYLE:case x.TITLE:case x.SCRIPT:case x.BGSOUND:case x.BASEFONT:case x.TEMPLATE:{qr(e,t);break}case x.BODY:{sL(e,t);break}case x.FORM:{uL(e,t);break}case x.NOBR:{pL(e,t);break}case x.MATH:{DL(e,t);break}case x.TABLE:{gL(e,t);break}case x.INPUT:{xL(e,t);break}case x.PARAM:case x.TRACK:case x.SOURCE:{bL(e,t);break}case x.IMAGE:{EL(e,t);break}case x.BUTTON:{fL(e,t);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{yL(e,t);break}case x.IFRAME:{kL(e,t);break}case x.SELECT:{SL(e,t);break}case x.OPTION:case x.OPTGROUP:{CL(e,t);break}case x.NOEMBED:case x.NOFRAMES:{pb(e,t);break}case x.FRAMESET:{oL(e,t);break}case x.TEXTAREA:{TL(e,t);break}case x.NOSCRIPT:{e.options.scriptingEnabled?pb(e,t):yb(e,t);break}case x.PLAINTEXT:{dL(e,t);break}case x.COL:case x.TH:case x.TD:case x.TR:case x.HEAD:case x.FRAME:case x.TBODY:case x.TFOOT:case x.THEAD:case x.CAPTION:case x.COLGROUP:break;default:yb(e,t)}}function AL(e,t){if(e.openElements.hasInScope(x.BODY)&&(e.insertionMode=V.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function IL(e,t){e.openElements.hasInScope(x.BODY)&&(e.insertionMode=V.AFTER_BODY,iT(e,t))}function ML(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function LL(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(x.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(x.FORM):n&&e.openElements.remove(n))}function RL(e){e.openElements.hasInButtonScope(x.P)||e._insertFakeElement(oe.P,x.P),e._closePElement()}function PL(e){e.openElements.hasInListItemScope(x.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(x.LI),e.openElements.popUntilTagNamePopped(x.LI))}function jL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function FL(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function BL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function HL(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(oe.BR,x.BR),e.openElements.pop(),e.framesetOk=!1}function JE(e,t){const n=t.tagName,r=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const i=e.openElements.items[s],l=e.openElements.tagIDs[s];if(r===l&&(r!==x.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(i,l))break}}function Zd(e,t){switch(t.tagID){case x.A:case x.B:case x.I:case x.S:case x.U:case x.EM:case x.TT:case x.BIG:case x.CODE:case x.FONT:case x.NOBR:case x.SMALL:case x.STRIKE:case x.STRONG:{gp(e,t);break}case x.P:{RL(e);break}case x.DL:case x.UL:case x.OL:case x.DIR:case x.DIV:case x.NAV:case x.PRE:case x.MAIN:case x.MENU:case x.ASIDE:case x.BUTTON:case x.CENTER:case x.FIGURE:case x.FOOTER:case x.HEADER:case x.HGROUP:case x.DIALOG:case x.ADDRESS:case x.ARTICLE:case x.DETAILS:case x.SEARCH:case x.SECTION:case x.SUMMARY:case x.LISTING:case x.FIELDSET:case x.BLOCKQUOTE:case x.FIGCAPTION:{ML(e,t);break}case x.LI:{PL(e);break}case x.DD:case x.DT:{jL(e,t);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{FL(e);break}case x.BR:{HL(e);break}case x.BODY:{AL(e,t);break}case x.HTML:{IL(e,t);break}case x.FORM:{LL(e);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{BL(e,t);break}case x.TEMPLATE:{Ea(e,t);break}default:JE(e,t)}}function ZE(e,t){e.tmplInsertionModeStack.length>0?aT(e,t):xp(e,t)}function UL(e,t){var n;t.tagID===x.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function zL(e,t){e._err(t,xe.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function E0(e,t){if(e.openElements.currentTagId!==void 0&&VE.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=V.IN_TABLE_TEXT,t.type){case wt.CHARACTER:{tT(e,t);break}case wt.WHITESPACE_CHARACTER:{eT(e,t);break}}else gu(e,t)}function WL(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ke.HTML),e.insertionMode=V.IN_CAPTION}function YL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ke.HTML),e.insertionMode=V.IN_COLUMN_GROUP}function $L(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(oe.COLGROUP,x.COLGROUP),e.insertionMode=V.IN_COLUMN_GROUP,bp(e,t)}function qL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ke.HTML),e.insertionMode=V.IN_TABLE_BODY}function VL(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(oe.TBODY,x.TBODY),e.insertionMode=V.IN_TABLE_BODY,ef(e,t)}function QL(e,t){e.openElements.hasInTableScope(x.TABLE)&&(e.openElements.popUntilTagNamePopped(x.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function GL(e,t){XE(t)?e._appendElement(t,ke.HTML):gu(e,t),t.ackSelfClosing=!0}function KL(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ke.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Ei(e,t){switch(t.tagID){case x.TD:case x.TH:case x.TR:{VL(e,t);break}case x.STYLE:case x.SCRIPT:case x.TEMPLATE:{qr(e,t);break}case x.COL:{$L(e,t);break}case x.FORM:{KL(e,t);break}case x.TABLE:{QL(e,t);break}case x.TBODY:case x.TFOOT:case x.THEAD:{qL(e,t);break}case x.INPUT:{GL(e,t);break}case x.CAPTION:{WL(e,t);break}case x.COLGROUP:{YL(e,t);break}default:gu(e,t)}}function eu(e,t){switch(t.tagID){case x.TABLE:{e.openElements.hasInTableScope(x.TABLE)&&(e.openElements.popUntilTagNamePopped(x.TABLE),e._resetInsertionMode());break}case x.TEMPLATE:{Ea(e,t);break}case x.BODY:case x.CAPTION:case x.COL:case x.COLGROUP:case x.HTML:case x.TBODY:case x.TD:case x.TFOOT:case x.TH:case x.THEAD:case x.TR:break;default:gu(e,t)}}function gu(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Jd(e,t),e.fosterParentingEnabled=n}function eT(e,t){e.pendingCharacterTokens.push(t)}function tT(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Ml(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)gu(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const nT=new Set([x.CAPTION,x.COL,x.COLGROUP,x.TBODY,x.TD,x.TFOOT,x.TH,x.THEAD,x.TR]);function XL(e,t){const n=t.tagID;nT.has(n)?e.openElements.hasInTableScope(x.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(x.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=V.IN_TABLE,Ei(e,t)):Un(e,t)}function JL(e,t){const n=t.tagID;switch(n){case x.CAPTION:case x.TABLE:{e.openElements.hasInTableScope(x.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(x.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=V.IN_TABLE,n===x.TABLE&&eu(e,t));break}case x.BODY:case x.COL:case x.COLGROUP:case x.HTML:case x.TBODY:case x.TD:case x.TFOOT:case x.TH:case x.THEAD:case x.TR:break;default:Zd(e,t)}}function bp(e,t){switch(t.tagID){case x.HTML:{Un(e,t);break}case x.COL:{e._appendElement(t,ke.HTML),t.ackSelfClosing=!0;break}case x.TEMPLATE:{qr(e,t);break}default:hd(e,t)}}function ZL(e,t){switch(t.tagID){case x.COLGROUP:{e.openElements.currentTagId===x.COLGROUP&&(e.openElements.pop(),e.insertionMode=V.IN_TABLE);break}case x.TEMPLATE:{Ea(e,t);break}case x.COL:break;default:hd(e,t)}}function hd(e,t){e.openElements.currentTagId===x.COLGROUP&&(e.openElements.pop(),e.insertionMode=V.IN_TABLE,e._processToken(t))}function ef(e,t){switch(t.tagID){case x.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,ke.HTML),e.insertionMode=V.IN_ROW;break}case x.TH:case x.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(oe.TR,x.TR),e.insertionMode=V.IN_ROW,tf(e,t);break}case x.CAPTION:case x.COL:case x.COLGROUP:case x.TBODY:case x.TFOOT:case x.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE,Ei(e,t));break}default:Ei(e,t)}}function fm(e,t){const n=t.tagID;switch(t.tagID){case x.TBODY:case x.TFOOT:case x.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE);break}case x.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE,eu(e,t));break}case x.BODY:case x.CAPTION:case x.COL:case x.COLGROUP:case x.HTML:case x.TD:case x.TH:case x.TR:break;default:eu(e,t)}}function tf(e,t){switch(t.tagID){case x.TH:case x.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,ke.HTML),e.insertionMode=V.IN_CELL,e.activeFormattingElements.insertMarker();break}case x.CAPTION:case x.COL:case x.COLGROUP:case x.TBODY:case x.TFOOT:case x.THEAD:case x.TR:{e.openElements.hasInTableScope(x.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY,ef(e,t));break}default:Ei(e,t)}}function rT(e,t){switch(t.tagID){case x.TR:{e.openElements.hasInTableScope(x.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY);break}case x.TABLE:{e.openElements.hasInTableScope(x.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY,fm(e,t));break}case x.TBODY:case x.TFOOT:case x.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(x.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY,fm(e,t));break}case x.BODY:case x.CAPTION:case x.COL:case x.COLGROUP:case x.HTML:case x.TD:case x.TH:break;default:eu(e,t)}}function eR(e,t){const n=t.tagID;nT.has(n)?(e.openElements.hasInTableScope(x.TD)||e.openElements.hasInTableScope(x.TH))&&(e._closeTableCell(),tf(e,t)):Un(e,t)}function tR(e,t){const n=t.tagID;switch(n){case x.TD:case x.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=V.IN_ROW);break}case x.TABLE:case x.TBODY:case x.TFOOT:case x.THEAD:case x.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),rT(e,t));break}case x.BODY:case x.CAPTION:case x.COL:case x.COLGROUP:case x.HTML:break;default:Zd(e,t)}}function sT(e,t){switch(t.tagID){case x.HTML:{Un(e,t);break}case x.OPTION:{e.openElements.currentTagId===x.OPTION&&e.openElements.pop(),e._insertElement(t,ke.HTML);break}case x.OPTGROUP:{e.openElements.currentTagId===x.OPTION&&e.openElements.pop(),e.openElements.currentTagId===x.OPTGROUP&&e.openElements.pop(),e._insertElement(t,ke.HTML);break}case x.HR:{e.openElements.currentTagId===x.OPTION&&e.openElements.pop(),e.openElements.currentTagId===x.OPTGROUP&&e.openElements.pop(),e._appendElement(t,ke.HTML),t.ackSelfClosing=!0;break}case x.INPUT:case x.KEYGEN:case x.TEXTAREA:case x.SELECT:{e.openElements.hasInSelectScope(x.SELECT)&&(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode(),t.tagID!==x.SELECT&&e._processStartTag(t));break}case x.SCRIPT:case x.TEMPLATE:{qr(e,t);break}}}function oT(e,t){switch(t.tagID){case x.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===x.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===x.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===x.OPTGROUP&&e.openElements.pop();break}case x.OPTION:{e.openElements.currentTagId===x.OPTION&&e.openElements.pop();break}case x.SELECT:{e.openElements.hasInSelectScope(x.SELECT)&&(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode());break}case x.TEMPLATE:{Ea(e,t);break}}}function nR(e,t){const n=t.tagID;n===x.CAPTION||n===x.TABLE||n===x.TBODY||n===x.TFOOT||n===x.THEAD||n===x.TR||n===x.TD||n===x.TH?(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode(),e._processStartTag(t)):sT(e,t)}function rR(e,t){const n=t.tagID;n===x.CAPTION||n===x.TABLE||n===x.TBODY||n===x.TFOOT||n===x.THEAD||n===x.TR||n===x.TD||n===x.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode(),e.onEndTag(t)):oT(e,t)}function sR(e,t){switch(t.tagID){case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:case x.NOFRAMES:case x.SCRIPT:case x.STYLE:case x.TEMPLATE:case x.TITLE:{qr(e,t);break}case x.CAPTION:case x.COLGROUP:case x.TBODY:case x.TFOOT:case x.THEAD:{e.tmplInsertionModeStack[0]=V.IN_TABLE,e.insertionMode=V.IN_TABLE,Ei(e,t);break}case x.COL:{e.tmplInsertionModeStack[0]=V.IN_COLUMN_GROUP,e.insertionMode=V.IN_COLUMN_GROUP,bp(e,t);break}case x.TR:{e.tmplInsertionModeStack[0]=V.IN_TABLE_BODY,e.insertionMode=V.IN_TABLE_BODY,ef(e,t);break}case x.TD:case x.TH:{e.tmplInsertionModeStack[0]=V.IN_ROW,e.insertionMode=V.IN_ROW,tf(e,t);break}default:e.tmplInsertionModeStack[0]=V.IN_BODY,e.insertionMode=V.IN_BODY,Un(e,t)}}function oR(e,t){t.tagID===x.TEMPLATE&&Ea(e,t)}function aT(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(x.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):xp(e,t)}function aR(e,t){t.tagID===x.HTML?Un(e,t):md(e,t)}function iT(e,t){var n;if(t.tagID===x.HTML){if(e.fragmentContext||(e.insertionMode=V.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===x.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 md(e,t)}function md(e,t){e.insertionMode=V.IN_BODY,Jd(e,t)}function iR(e,t){switch(t.tagID){case x.HTML:{Un(e,t);break}case x.FRAMESET:{e._insertElement(t,ke.HTML);break}case x.FRAME:{e._appendElement(t,ke.HTML),t.ackSelfClosing=!0;break}case x.NOFRAMES:{qr(e,t);break}}}function lR(e,t){t.tagID===x.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==x.FRAMESET&&(e.insertionMode=V.AFTER_FRAMESET))}function uR(e,t){switch(t.tagID){case x.HTML:{Un(e,t);break}case x.NOFRAMES:{qr(e,t);break}}}function cR(e,t){t.tagID===x.HTML&&(e.insertionMode=V.AFTER_AFTER_FRAMESET)}function dR(e,t){t.tagID===x.HTML?Un(e,t):Vc(e,t)}function Vc(e,t){e.insertionMode=V.IN_BODY,Jd(e,t)}function fR(e,t){switch(t.tagID){case x.HTML:{Un(e,t);break}case x.NOFRAMES:{qr(e,t);break}}}function hR(e,t){t.chars=Zt,e._insertCharacters(t)}function mR(e,t){e._insertCharacters(t),e.framesetOk=!1}function lT(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ke.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function pR(e,t){if(OM(t))lT(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ke.MATHML?$E(t):r===ke.SVG&&(AM(t),qE(t)),yp(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function yR(e,t){if(t.tagID===x.P||t.tagID===x.BR){lT(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)===ke.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}oe.AREA,oe.BASE,oe.BASEFONT,oe.BGSOUND,oe.BR,oe.COL,oe.EMBED,oe.FRAME,oe.HR,oe.IMG,oe.INPUT,oe.KEYGEN,oe.LINK,oe.META,oe.PARAM,oe.SOURCE,oe.TRACK,oe.WBR;const gR=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,xR=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),gb={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function uT(e,t){const n=_R(e),r=LE("type",{handlers:{root:bR,element:vR,text:ER,comment:dT,doctype:TR,raw:kR},unknown:SR}),s={parser:n?new mb(gb):mb.getFragmentParser(void 0,gb),handle(u){r(u,s)},stitches:!1,options:t||{}};r(e,s),Li(s,fs());const i=n?s.parser.document:s.parser.getFragment(),l=DI(i,{file:s.options.file});return s.stitches&&Vm(l,"comment",function(u,f,h){const p=u;if(p.value.stitch&&h&&f!==void 0){const y=h.children;return y[f]=p.value.stitch,f}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function cT(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function bR(e,t){cT(e.children,t)}function vR(e,t){CR(e,t),cT(e.children,t),NR(e,t)}function ER(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:wt.CHARACTER,chars:e.value,location:xu(e)};Li(t,fs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function TR(e,t){const n={type:wt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:xu(e)};Li(t,fs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function wR(e,t){t.stitches=!0;const n=DR(e);if("children"in e&&"children"in n){const r=uT({type:"root",children:e.children},t.options);n.children=r.children}dT({type:"comment",value:{stitch:n}},t)}function dT(e,t){const n=e.value,r={type:wt.COMMENT,data:n,location:xu(e)};Li(t,fs(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function kR(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,fT(t,fs(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(gR,"<$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 SR(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))wR(n,t);else{let r="";throw xR.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 Li(e,t){fT(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=pn.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 fT(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 CR(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===pn.PLAINTEXT)return;Li(t,fs(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Go.html;s===Go.html&&n==="svg"&&(s=Go.svg);const i=LI({...e,children:[]},{space:s===Go.svg?"svg":"html"}),l={type:wt.START_TAG,tagName:n,tagID:Mi(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:xu(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function NR(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&zI.includes(n)||t.parser.tokenizer.state===pn.PLAINTEXT)return;Li(t,Sd(e));const r={type:wt.END_TAG,tagName:n,tagID:Mi(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:xu(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===pn.RCDATA||t.parser.tokenizer.state===pn.RAWTEXT||t.parser.tokenizer.state===pn.SCRIPT_DATA)&&(t.parser.tokenizer.state=pn.DATA)}function _R(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function xu(e){const t=fs(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 DR(e){return"children"in e?bi({...e,children:[]}):bi(e)}function OR(e){return function(t,n){return uT(t,{...e,file:n})}}const hT=[{command:"/ai",description:"Generate text at this line"},{command:"/ai!",description:"Replace all widget content"}];function AR({filter:e,selectedIndex:t,position:n,onSelect:r,onClose:s}){const i=N.useRef(null),l=N.useMemo(()=>{const u=e.toLowerCase();return hT.filter(f=>f.command.toLowerCase().includes(u)||f.description.toLowerCase().includes(u))},[e]);return N.useEffect(()=>{function u(f){i.current&&!i.current.contains(f.target)&&s()}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[s]),N.useEffect(()=>{var f;const u=(f=i.current)==null?void 0:f.querySelector('[data-selected="true"]');u&&typeof u.scrollIntoView=="function"&&u.scrollIntoView({block:"nearest"})},[t]),l.length===0?null:Di.createPortal(d.jsx("div",{ref:i,className:"fixed z-[9999] rounded-lg shadow-xl py-1 min-w-[240px]",style:{top:n.top,left:n.left,backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:l.map((u,f)=>d.jsxs("button",{"data-selected":f===t,onMouseDown:h=>{h.preventDefault(),r(u.command)},className:"w-full text-left px-3 py-2 text-sm flex items-center gap-3",style:f===t?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("span",{className:"font-mono font-medium min-w-[3rem]",children:u.command}),d.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:u.description})]},u.command))}),document.body)}function IR(e){const t=e.trim(),n=t.match(/^\/ai!\s+(.+)$/);if(n!=null&&n[1])return{mode:"replace",prompt:n[1].trim()};const r=t.match(/^\/ai\s+(.+)$/);return r!=null&&r[1]?{mode:"insert",prompt:r[1].trim()}:null}function zc(e,t,n){const r=e.split(`
|
|
131
|
-
`),s=r.findIndex(i=>i.trim()===t.trim());return s===-1?e:(r[s]=n,r.join(`
|
|
132
|
-
`))}function MR({chartName:e,chartTitle:t,displayValue:n,field:r,change:s,previousValue:i,lockedPreset:l,lockedRange:u,format:f}){const[h,p]=N.useState(!1),[y,g]=N.useState({top:0,left:0,placement:"below"}),b=N.useRef(null),O=N.useRef(null);N.useEffect(()=>{if(!h||!O.current)return;const _=()=>{var W,Y;if(!O.current)return;const S=O.current.getBoundingClientRect(),A=((W=b.current)==null?void 0:W.offsetHeight)||180,C=window.innerHeight-S.bottom,I=S.top,D=8;let j="below",F;C<A+D&&I>C?(j="above",F=S.top+window.scrollY-A-D):F=S.bottom+window.scrollY+D;let B=S.left+window.scrollX;const U=((Y=b.current)==null?void 0:Y.offsetWidth)||220;B+U>window.innerWidth-D&&(B=window.innerWidth-U-D),B<D&&(B=D),g({top:F,left:B,placement:j})};_(),requestAnimationFrame(_)},[h]),N.useEffect(()=>{if(!h)return;function _(S){b.current&&!b.current.contains(S.target)&&O.current&&!O.current.contains(S.target)&&p(!1)}return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[h]),N.useEffect(()=>{if(!h)return;function _(S){S.key==="Escape"&&p(!1)}return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[h]);const w=l?l.replace(/_/g," ").replace(/\b\w/g,_=>_.toUpperCase()):u?u.replace(".."," to "):null,T=s!==void 0?`${s>=0?"+":""}${s.toFixed(1)}%`:null,E=s!==void 0?s>=0?"var(--yc-color-success)":"var(--yc-color-danger)":void 0;return d.jsxs(d.Fragment,{children:[d.jsx("span",{ref:O,onClick:()=>p(!h),className:"font-semibold border-b border-dashed cursor-pointer px-0.5 rounded transition-colors hover:opacity-80",style:{color:"var(--yc-color-primary)",borderColor:"color-mix(in srgb, var(--yc-color-primary) 50%, transparent)"},children:n}),h&&Di.createPortal(d.jsxs("div",{ref:b,className:"fixed z-[9999] rounded-lg shadow-xl p-3 min-w-[220px] text-sm",style:{top:y.top,left:y.left,backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[d.jsx("div",{className:"font-medium mb-2",style:{color:"var(--yc-color-text)"},children:t}),d.jsxs("div",{className:"flex items-baseline gap-2 mb-2",children:[d.jsx("span",{className:"text-2xl font-bold",style:{color:"var(--yc-color-text)"},children:n}),r&&r!=="value"&&r!=="formatted"&&d.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["(",r,")"]})]}),T&&d.jsxs("div",{className:"text-sm mb-2",style:E?{color:E}:void 0,children:[T," vs previous period",i!==void 0&&d.jsxs("span",{className:"ml-1",style:{color:"var(--yc-color-text-secondary)"},children:["(",(f==null?void 0:f.type)==="currency"?"$":"",i.toLocaleString(),")"]})]}),d.jsx("div",{className:"border-t my-2",style:{borderColor:"var(--yc-color-border)"}}),d.jsxs("div",{className:"flex items-center gap-2 text-xs",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),w?d.jsx("span",{children:w}):d.jsx("span",{className:"italic",children:"Follows dashboard filter"})]}),d.jsxs("div",{className:"flex items-center gap-2 text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})}),d.jsx("span",{children:e})]})]}),document.body)]})}function LR(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 s=r[1],i=r[2],l=r[3];if(!s)continue;let u;if(l){const h=l.match(/^(\d{4}-\d{2}-\d{2})\.\.(\d{4}-\d{2}-\d{2})$/);h?u={startDate:h[1],endDate:h[2]}:u={preset:l}}const f=`${s}:${i||""}:${l||""}`;n.has(f)||n.set(f,{chartName:s,field:i,locked:u})}return Array.from(n.values())}function RR(e){return Array.from(new Set(e.map(t=>t.chartName)))}function PR(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 jR(e,t){if(e.locked){if(e.locked.preset)return xi({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},start_date:e.locked.startDate,end_date:e.locked.endDate}}return xi(t)}function hm(e){const t=e.locked?e.locked.preset||`${e.locked.startDate}..${e.locked.endDate}`:"current";return`${e.chartName}:${e.field||"value"}:${t}`}function FR(e,t){const n=RR(e),r=N.useMemo(()=>{const p=new Map;return e.forEach(y=>{const g=jR(y,t),b=`${y.chartName}:${JSON.stringify(g)}`;p.has(b)||p.set(b,{chartName:y.chartName,params:g,refs:[]}),p.get(b).refs.push(y)}),Array.from(p.values())},[e,t]),s=c1({queries:r.map(p=>({queryKey:["chartData",p.chartName,p.params],queryFn:()=>xt.queryChart(p.chartName,p.params),enabled:r.length>0}))}),i=c1({queries:n.map(p=>({queryKey:["chart",p],queryFn:()=>xt.getChart(p),enabled:n.length>0}))}),l=N.useMemo(()=>{const p={};return n.forEach((y,g)=>{const b=i[g];b!=null&&b.data&&(p[y]=b.data)}),p},[n,i]),u=N.useMemo(()=>{const p={};return r.forEach((y,g)=>{var T,E,_;const b=s[g],O=(T=l[y.chartName])==null?void 0:T.chart;if(!((_=(E=b==null?void 0:b.data)==null?void 0:E.rows)!=null&&_[0])||!O)return;const w=b.data.rows[0];y.refs.forEach(S=>{var M,C;const A=hm(S);if(O.type==="kpi"&&((M=O.value)!=null&&M.field)){const I=O.value.field,D=w[I]??0,j={value:D,formatted:PR(D,O.format),fields:{}};if(Object.entries(w).forEach(([F,B])=>{typeof B=="number"&&(j.fields[F]=B)}),(C=O.comparison)!=null&&C.enabled&&O.comparison.field){const F=w[O.comparison.field];F&&F!==0&&(O.comparison.type==="percent_change"?j.change=(D-F)/F*100:j.change=D-F)}p[A]=j}})}),p},[r,s,l]),f=s.some(p=>p.isLoading)||i.some(p=>p.isLoading),h=N.useMemo(()=>{const p={};return n.forEach((y,g)=>{var O;const b=i[g];(O=b==null?void 0:b.data)!=null&&O.title&&(p[y]=b.data.title)}),p},[n,i]);return{values:u,isLoading:f,getRefKey:hm,chartTitles:h}}function BR(e,t,n){const r={};let s=0;return{content:e.replace(/\{\{([a-zA-Z0-9_-]+)(?:\.([a-zA-Z0-9_]+))?(?:@([a-zA-Z0-9_-]+|\d{4}-\d{2}-\d{2}\.\.\d{4}-\d{2}-\d{2}))?\}\}/g,(l,u,f,h)=>{let p,y,g;if(h){const _=h.match(/^(\d{4}-\d{2}-\d{2})\.\.(\d{4}-\d{2}-\d{2})$/);_?(p={startDate:_[1],endDate:_[2]},g=h):(p={preset:h},y=h)}const O=hm({chartName:u,field:f,locked:p}),w=t[O];if(!w)return l;let T;if(f)if(f==="formatted"||f==="value")T=w.formatted;else if(f==="change"&&w.change!==void 0)T=`${w.change>=0?"+":""}${w.change.toFixed(1)}%`;else if(w.fields[f]!==void 0)T=w.fields[f].toLocaleString();else return l;else T=w.formatted;const E=`kpi-ref-${s++}`;return r[E]={chartName:u,chartTitle:n[u]||u,displayValue:T,field:f,change:w.change,previousValue:w.fields.previous_value,lockedPreset:y,lockedRange:g},`<kpi-ref data-ref-id="${E}">${T}</kpi-ref>`}),refData:r}}function HR({filter:e,kpiCharts:t,selectedIndex:n,position:r,onSelect:s,onClose:i}){const l=N.useRef(null),u=N.useMemo(()=>{const f=e.toLowerCase();return t.filter(h=>h.name.toLowerCase().includes(f)||h.title.toLowerCase().includes(f))},[e,t]);return N.useEffect(()=>{function f(h){l.current&&!l.current.contains(h.target)&&i()}return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[i]),N.useEffect(()=>{var h;const f=(h=l.current)==null?void 0:h.querySelector('[data-selected="true"]');f==null||f.scrollIntoView({block:"nearest"})},[n]),u.length===0?null:Di.createPortal(d.jsx("div",{ref:l,className:"fixed z-[9999] rounded-lg shadow-xl py-1 max-h-48 overflow-y-auto min-w-[200px]",style:{top:r.top,left:r.left,backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:u.map((f,h)=>d.jsxs("button",{"data-selected":h===n,onMouseDown:p=>{p.preventDefault(),s(f.name)},className:"w-full text-left px-3 py-1.5 text-sm flex flex-col",style:h===n?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("span",{className:"font-medium truncate",children:f.title}),d.jsx("span",{className:"text-xs font-mono truncate",style:{color:"var(--yc-color-text-muted)"},children:`{{${f.name}}}`})]},f.name))}),document.body)}function UR({content:e,onUpdate:t,isContentEditing:n,onEditStart:r,onEditEnd:s,dashboardName:i}){const{isEditing:l}=Oi(),[u,f]=N.useState(e),h=N.useRef(null),[p,y]=N.useState(null),[g,b]=N.useState({top:0,left:0}),O=N.useRef(null),[w,T]=N.useState(!1),[E,_]=N.useState(null),[S,A]=N.useState(null),[M,C]=N.useState({top:0,left:0}),I=ot(te=>te.globalFilters),{data:D}=or({queryKey:["config"],queryFn:()=>xt.getConfig()}),j=N.useMemo(()=>(D==null?void 0:D.charts.filter(te=>te.type==="kpi"))||[],[D]),F=N.useMemo(()=>LR(e),[e]),{values:B,isLoading:U,chartTitles:W}=FR(F,I),{content:Y,refData:Q}=N.useMemo(()=>U||Object.keys(B).length===0?{content:e,refData:{}}:BR(e,B,W),[e,B,U,W]),re=N.useMemo(()=>({"kpi-ref":({children:te,...le})=>{const ge=le["data-ref-id"],ve=ge?Q[ge]:null;return ve?d.jsx(MR,{chartName:ve.chartName,chartTitle:ve.chartTitle,displayValue:ve.displayValue,field:ve.field,change:ve.change,previousValue:ve.previousValue,lockedPreset:ve.lockedPreset,lockedRange:ve.lockedRange}):d.jsx("span",{children:te})}}),[Q]);N.useEffect(()=>{n||f(e)},[e,n]),N.useEffect(()=>{n&&h.current&&h.current.focus()},[n]);const ye=()=>{t==null||t(u),y(null),s==null||s()},G=()=>{f(e),y(null),s==null||s()},fe=()=>{const te=h.current,le=O.current;if(!te||!le)return;const ge=te.selectionStart,ve=te.value.substring(0,ge);le.textContent=ve;const je=te.getBoundingClientRect(),Ye=le.offsetWidth,nt=parseFloat(getComputedStyle(te).lineHeight)||18,tt=te.clientWidth-16,Je=ve.split(`
|
|
133
|
-
`),rt=Je[Je.length-1]||"";le.textContent=rt;const ut=Math.min(le.offsetWidth,tt),me=(Je.length-1+Math.floor(Ye/tt))*nt;b({top:je.top+me+nt+4-te.scrollTop,left:je.left+ut+8})},P=()=>{const te=h.current,le=O.current;if(!te||!le)return;const ge=te.selectionStart,ve=te.value.substring(0,ge),je=te.getBoundingClientRect(),Ye=parseFloat(getComputedStyle(te).lineHeight)||18,nt=te.clientWidth-16,tt=ve.split(`
|
|
134
|
-
`),Je=tt[tt.length-1]||"";le.textContent=Je;const rt=Math.min(le.offsetWidth,nt);le.textContent=ve;const pe=(tt.length-1+Math.floor(le.offsetWidth/nt))*Ye;C({top:je.top+pe+Ye+4-te.scrollTop,left:je.left+rt+8})},K=N.useMemo(()=>{if(!(p!=null&&p.active))return[];const te=p.filter.toLowerCase();return j.filter(le=>le.name.toLowerCase().includes(te)||le.title.toLowerCase().includes(te))},[p,j]),ee=te=>{if(!p||!h.current)return;const le=h.current,ge=u.substring(0,p.startPos),ve=u.substring(le.selectionStart),je=`{{${te}}}`,Ye=ge+je+ve;f(Ye),y(null);const nt=ge.length+je.length;setTimeout(()=>{le.selectionStart=le.selectionEnd=nt,le.focus()},0)},R=te=>{if(!h.current)return;const le=h.current,ge=le.selectionStart,ve=u.lastIndexOf(`
|
|
135
|
-
`,ge-1)+1,je=u.indexOf(`
|
|
136
|
-
`,ge),Ye=je===-1?u.length:je,nt=u.substring(0,ve),tt=u.substring(Ye),Je=nt+te+" "+tt;f(Je),A(null);const rt=ve+te.length+1;setTimeout(()=>{le.selectionStart=le.selectionEnd=rt,le.focus()},0)},ie=async(te,le,ge)=>{T(!0),_(null);const ve=le==="replace"?"⏳ Generating...":zc(u,ge,"⏳ Generating...");f(ve);const je=zc(u,ge,"").replace(/\n\n\n+/g,`
|
|
137
|
-
|
|
138
|
-
`).trim();try{const Ye=await xt.generateText({prompt:te,mode:le,dashboard:i,existingContent:le==="insert"?je:void 0,filters:I});f(le==="replace"?Ye.content:zc(ve,"⏳ Generating...",Ye.content))}catch(Ye){const nt=Ye instanceof Error?Ye.message:"Generation failed";_(nt),f(le==="replace"?ge:zc(ve,"⏳ Generating...",ge))}finally{T(!1)}},ae=te=>{if(S!=null&&S.active){const ut=S.filter.toLowerCase(),pe=hT.filter(me=>me.command.toLowerCase().includes(ut)||me.description.toLowerCase().includes(ut));if(te.key==="ArrowDown"){te.preventDefault(),A(me=>me?{...me,selectedIndex:Math.min(me.selectedIndex+1,pe.length-1)}:null);return}if(te.key==="ArrowUp"){te.preventDefault(),A(me=>me?{...me,selectedIndex:Math.max(me.selectedIndex-1,0)}:null);return}if(te.key==="Enter"||te.key==="Tab"){te.preventDefault();const me=pe[S.selectedIndex];me&&R(me.command);return}if(te.key==="Escape"){te.preventDefault(),A(null);return}}if(p!=null&&p.active){if(te.key==="ArrowDown"){te.preventDefault(),y(ut=>ut?{...ut,selectedIndex:Math.min(ut.selectedIndex+1,K.length-1)}:null);return}if(te.key==="ArrowUp"){te.preventDefault(),y(ut=>ut?{...ut,selectedIndex:Math.max(ut.selectedIndex-1,0)}:null);return}if(te.key==="Enter"||te.key==="Tab"){te.preventDefault();const ut=K[p.selectedIndex];ut&&ee(ut.name);return}if(te.key==="Escape"){te.preventDefault(),y(null);return}}if(te.key==="Escape"){te.preventDefault(),G();return}if(te.key!=="Enter")return;const le=h.current;if(le){const ut=le.selectionStart,pe=u.substring(0,ut),me=pe.lastIndexOf(`
|
|
139
|
-
`)+1,Ae=pe.substring(me),Pe=IR(Ae);if(Pe&&i){te.preventDefault(),ie(Pe.prompt,Pe.mode,Ae);return}}const ge=te.currentTarget,{selectionStart:ve,value:je}=ge,Ye=je.substring(0,ve),nt=Ye.lastIndexOf(`
|
|
140
|
-
`)+1,tt=Ye.substring(nt),Je=tt.match(/^(\s*)([-*])\s(.*)$/);if(Je){const ut=Je[1]??"",pe=Je[2]??"-";if(!(Je[3]??"").trim()){te.preventDefault();const ct=je.substring(0,nt)+je.substring(ve);f(ct),setTimeout(()=>{ge.selectionStart=ge.selectionEnd=nt},0);return}te.preventDefault();const Ae=`
|
|
141
|
-
${ut}${pe} `,Pe=je.substring(0,ve)+Ae+je.substring(ve);f(Pe),setTimeout(()=>{ge.selectionStart=ge.selectionEnd=ve+Ae.length},0);return}const rt=tt.match(/^(\s*)(\d+)\.\s(.*)$/);if(rt){const ut=rt[1]??"",pe=rt[2]??"1";if(!(rt[3]??"").trim()){te.preventDefault();const kt=je.substring(0,nt)+je.substring(ve);f(kt),setTimeout(()=>{ge.selectionStart=ge.selectionEnd=nt},0);return}te.preventDefault();const Ae=parseInt(pe,10)+1,Pe=`
|
|
142
|
-
${ut}${Ae}. `,ct=je.substring(0,ve)+Pe+je.substring(ve);f(ct),setTimeout(()=>{ge.selectionStart=ge.selectionEnd=ve+Pe.length},0);return}},J=te=>{E&&_(null);const le=te.target.value,ge=te.target.selectionStart;f(le);const ve=le.substring(0,ge),je=ve.lastIndexOf("{");if(je>=0){const tt=ve.substring(je+1);if(!tt.includes("}")&&!tt.includes(`
|
|
143
|
-
`)){const Je=tt.replace(/^\{/,"");y({active:!0,startPos:je,filter:Je,selectedIndex:0}),setTimeout(fe,0);return}}y(null);const Ye=ve.lastIndexOf(`
|
|
144
|
-
`)+1,nt=ve.substring(Ye);if(nt.startsWith("/")&&!nt.includes(" ")){const tt=nt.substring(1);A({active:!0,filter:tt,selectedIndex:0}),setTimeout(P,0)}else S!=null&&S.active&&A(null)},be=te=>{const le=te.relatedTarget;le!=null&&le.closest("[data-kpi-autocomplete]")||w||ye()};return n?d.jsxs("div",{className:"h-full relative",children:[d.jsx("textarea",{ref:h,value:u,onChange:J,onKeyDown:ae,onBlur:be,disabled:w,className:"h-full w-full p-4 resize-none font-mono text-sm focus:outline-none bg-transparent",style:w?{opacity:.6}:void 0,placeholder:"Type markdown here... Use {{ to insert KPI references, / for AI commands"}),d.jsx("span",{ref:O,className:"invisible fixed top-0 left-0 font-mono text-sm whitespace-pre","aria-hidden":"true"}),(p==null?void 0:p.active)&&K.length>0&&d.jsx(HR,{filter:p.filter,kpiCharts:j,selectedIndex:p.selectedIndex,position:g,onSelect:ee,onClose:()=>y(null)}),(S==null?void 0:S.active)&&d.jsx(AR,{filter:S.filter,selectedIndex:S.selectedIndex,position:M,onSelect:R,onClose:()=>A(null)}),E&&d.jsx("div",{className:"absolute bottom-12 left-4 right-4 text-xs p-2 rounded",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-danger) 10%, transparent)",color:"var(--yc-color-danger)"},children:E})]}):d.jsxs("div",{className:"h-full p-4 overflow-auto flex flex-col",style:{containerType:"size"},children:[d.jsx("div",{className:"prose 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 my-auto",style:{fontSize:"clamp(0.875rem, min(5cqh, 2.5cqw), 1.5rem)"},children:d.jsx(e2,{rehypePlugins:[OR],components:re,children:Y})}),l&&t&&!e&&d.jsx("div",{className:"text-sm italic",style:{color:"var(--yc-color-text-muted)"},children:"Double-click to edit"})]})}function zR({children:e,onRemove:t,widgetType:n,onDoubleClick:r,isContentEditing:s}){const{isEditing:i}=Oi();return d.jsxs("div",{className:$n("h-full relative",i&&"ring-2 ring-blue-200",i&&!s&&"select-none"),style:{background:"var(--yc-color-surface)",borderRadius:"var(--yc-radius)",boxShadow:"var(--yc-shadow)",border:"var(--yc-card-border)"},children:[i&&d.jsxs(d.Fragment,{children:[!(n==="text"&&s)&&d.jsx("div",{className:"absolute inset-0 z-[5] cursor-grab active:cursor-grabbing",style:{pointerEvents:"all"},onMouseDown:l=>l.preventDefault(),onDoubleClick:l=>{r&&(l.stopPropagation(),r())}}),t&&d.jsx("div",{className:"absolute top-1 right-1 z-10",children:d.jsx("button",{onClick:l=>{l.stopPropagation(),t()},className:"w-5 h-5 bg-white/70 hover:bg-red-100 rounded flex items-center justify-center transition-colors",title:"Remove widget",children:d.jsx("svg",{className:"w-3 h-3 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})})]}),d.jsx("div",{className:"h-full",children:e})]})}const Ll=38,mT=12,WR={lg:768,md:480,sm:0},YR={lg:12,md:6,sm:1};function $R(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"}function qR(e){const t=[...e].sort((r,s)=>r.y-s.y||r.x-s.x),n=[];return t.map(r=>{let s=0;for(const l of n)r.x<l.x+l.w&&r.x+r.w>l.x&&(s=Math.max(s,l.y+l.h));const i={...r,y:s};return n.push(i),i})}const VR=40;function QR(e){const t=[];for(let n=0;n<e;n++)for(let r=0;r<mT;r++)t.push({i:`bg-${n}-${r}`,x:r,y:n,w:1,h:1,static:!0});return t}const pT=QR(VR),GR=pT.map(e=>d.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 KR({layout:e,onLayoutChange:t,dashboardName:n}){const{isEditing:r,setPendingLayout:s,setOriginalLayout:i,currentLayout:l,removeWidget:u,updateWidget:f}=Oi(),h=Tm(),p=N.useRef(""),y=N.useRef(""),g=N.useRef(null),[b,O]=N.useState(0),[w,T]=N.useState(null),E=N.useRef(0),_=N.useRef(!1);N.useEffect(()=>{const Y=g.current;if(!Y)return;const Q=new ResizeObserver(re=>{var G;const ye=(G=re[0])==null?void 0:G.contentRect.width;ye&&ye>0&&O(Math.floor(ye))});return Q.observe(Y),()=>Q.disconnect()},[]),N.useEffect(()=>{const Y=JSON.stringify(e);Y!==p.current&&(p.current=Y,i(e))},[e,i]),N.useEffect(()=>{r||T(null)},[r]);const S=l||e,A=S.gap??16,{gridLayout:M,widgetMap:C,widgetList:I}=N.useMemo(()=>{const Y=[],Q=new Map,re=[];let ye=0;const G=new Set;return S.rows.forEach((P,K)=>{let ee=0,R=0;P.widgets.forEach((ie,ae)=>{let J=$R(ie);if(G.has(J)){let ge=2;for(;G.has(`${J}-${ge}`);)ge++;J=`${J}-${ge}`}G.add(J);const be=ie.height??P.height,te=Math.ceil(be/Ll),le={i:J,x:ie.x??ee,y:ie.y??ye,w:ie.cols,h:te,minW:1,minH:1,static:!r||w===J};Y.push(le),Q.set(J,{widget:ie,rowIndex:K,widgetIndex:ae}),re.push({id:J,widget:ie,rowIndex:K,widgetIndex:ae}),ee+=ie.cols,R=Math.max(R,te)}),ye+=R}),{gridLayout:qR(Y),widgetMap:Q,widgetList:re}},[S,r,w]);N.useEffect(()=>{r&&I.length>E.current&&setTimeout(()=>{var Y;(Y=g.current)==null||Y.scrollIntoView({behavior:"smooth",block:"end"})},100),E.current=I.length},[I.length,r]);const D=N.useMemo(()=>mI(M),[M]),j=N.useCallback(Y=>{const re=[...Y.filter(K=>C.has(K.i))].sort((K,ee)=>K.y-ee.y||K.x-ee.x),ye=re.map(K=>`${K.i}:${K.x},${K.y},${K.w},${K.h}`).join("|");if(ye===y.current)return null;y.current=ye;const G=new Map;re.forEach(K=>{const ee=C.get(K.i);if(!ee)return;let R=G.get(K.y);R||(R={items:[]},G.set(K.y,R));const ie=K.h*Ll;R.items.push({item:K,widget:{...ee.widget,cols:K.w,height:ie,x:K.x,y:K.y}})});const fe=[],P=[...G.keys()].sort((K,ee)=>K-ee);for(const K of P){const ee=G.get(K),R=Math.max(...ee.items.map(ie=>ie.item.h));fe.push({height:R*Ll,widgets:ee.items.map(ie=>ie.widget)})}return{gap:S.gap,rows:fe}},[C,S.gap]),F=N.useCallback(Y=>{if(!r||_.current)return;const Q=j(Y);Q&&(s(Q),t==null||t(Q))},[r,j,s,t]),B=N.useCallback(Y=>{if(_.current=!1,!r)return;const Q=j(Y);Q&&(s(Q),t==null||t(Q))},[r,j,s,t]),U=N.useCallback((Y,Q)=>{u(Y,Q)},[u]),W=N.useCallback((Y,Q,re)=>{f(Y,Q,{content:re})},[f]);return d.jsxs(d.Fragment,{children:[!r&&d.jsx("style",{children:".react-resizable-handle { display: none !important; }"}),r&&d.jsx("style",{children:`
|
|
145
|
-
.react-grid-placeholder {
|
|
146
|
-
background: rgba(59, 130, 246, 0.15) !important;
|
|
147
|
-
border: 2px dashed rgba(59, 130, 246, 0.4) !important;
|
|
148
|
-
border-radius: var(--yc-radius) !important;
|
|
149
|
-
opacity: 1 !important;
|
|
150
|
-
}
|
|
151
|
-
.yc-edit-grid .react-grid-item {
|
|
152
|
-
transition: all 200ms ease !important;
|
|
153
|
-
}
|
|
154
|
-
.yc-edit-grid .react-grid-item.react-draggable-dragging {
|
|
155
|
-
transition: none !important;
|
|
156
|
-
z-index: 100;
|
|
157
|
-
box-shadow: 0 8px 25px rgba(0,0,0,0.15);
|
|
158
|
-
}
|
|
159
|
-
.yc-edit-grid .react-resizable-handle {
|
|
160
|
-
background: none !important;
|
|
161
|
-
width: 24px !important;
|
|
162
|
-
height: 24px !important;
|
|
163
|
-
z-index: 10 !important;
|
|
164
|
-
}
|
|
165
|
-
.yc-edit-grid .react-resizable-handle::after {
|
|
166
|
-
content: '' !important;
|
|
167
|
-
position: absolute !important;
|
|
168
|
-
right: 4px !important;
|
|
169
|
-
bottom: 4px !important;
|
|
170
|
-
width: 10px !important;
|
|
171
|
-
height: 10px !important;
|
|
172
|
-
border-right: 2px solid rgba(59,130,246,0.4) !important;
|
|
173
|
-
border-bottom: 2px solid rgba(59,130,246,0.4) !important;
|
|
174
|
-
border-radius: 0 0 2px 0 !important;
|
|
175
|
-
}
|
|
176
|
-
.yc-edit-grid .react-resizable-handle:hover::after {
|
|
177
|
-
border-color: rgba(59,130,246,0.8) !important;
|
|
178
|
-
}
|
|
179
|
-
.yc-bg-grid {
|
|
180
|
-
position: absolute !important;
|
|
181
|
-
inset: 0 !important;
|
|
182
|
-
pointer-events: none !important;
|
|
183
|
-
z-index: 0 !important;
|
|
184
|
-
overflow: hidden !important;
|
|
185
|
-
}
|
|
186
|
-
.yc-bg-grid .react-grid-item {
|
|
187
|
-
transition: none !important;
|
|
188
|
-
}
|
|
189
|
-
.yc-edit-grid {
|
|
190
|
-
position: relative;
|
|
191
|
-
}
|
|
192
|
-
.yc-edit-grid > .react-grid-item {
|
|
193
|
-
z-index: 1;
|
|
194
|
-
}
|
|
195
|
-
`}),d.jsxs("div",{ref:g,style:{position:"relative"},children:[b>0&&r&&h==="lg"&&d.jsx(fI,{className:"yc-bg-grid",layout:pT,cols:mT,rowHeight:Ll,width:b,margin:[A,A],useCSSTransforms:!0,compactType:null,isDraggable:!1,isResizable:!1,autoSize:!1,children:GR}),b>0&&d.jsx(hI,{className:r?"layout yc-edit-grid":"layout",layouts:D,breakpoints:WR,cols:YR,rowHeight:Ll,width:b,margin:[A,A],isDraggable:r&&h==="lg",isResizable:r&&h==="lg",onLayoutChange:(Y,Q)=>{Q.lg&&F(Q.lg)},onDragStart:()=>{_.current=!0},onResizeStart:()=>{_.current=!0},onDragStop:Y=>B([...Y]),onResizeStop:Y=>B([...Y]),compactType:"vertical",autoSize:!0,useCSSTransforms:!0,children:I.map(({id:Y,widget:Q,rowIndex:re,widgetIndex:ye})=>d.jsx("div",{className:"h-full",children:d.jsxs(zR,{onRemove:()=>U(re,ye),widgetType:Q.type,isContentEditing:w===Y,onDoubleClick:Q.type==="text"?()=>T(Y):void 0,children:[Q.type==="chart"&&Q.ref&&d.jsx(xI,{chartRef:Q.ref}),Q.type==="text"&&d.jsx(UR,{content:Q.content||"",onUpdate:G=>W(re,ye,G),isContentEditing:w===Y,onEditStart:()=>T(Y),onEditEnd:()=>T(null),dashboardName:n})]})},Y))})]})]})}function XR({isOpen:e,onClose:t,onAdd:n,existingCharts:r}){const{data:s}=ga(),[i,l]=N.useState(""),u=N.useRef(null);if(N.useEffect(()=>{const y=b=>{b.key==="Escape"&&t()},g=b=>{u.current&&!u.current.contains(b.target)&&t()};return e&&(document.addEventListener("keydown",y),document.addEventListener("mousedown",g)),()=>{document.removeEventListener("keydown",y),document.removeEventListener("mousedown",g)}},[e,t]),!e)return null;const h=((s==null?void 0:s.charts)||[]).filter(y=>y.title.toLowerCase().includes(i.toLowerCase())||y.name.toLowerCase().includes(i.toLowerCase())),p=y=>{n({type:"chart",ref:y,cols:6}),t()};return d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:d.jsxs("div",{ref:u,className:"rounded-lg shadow-xl w-full max-w-md mx-4",style:{backgroundColor:"var(--yc-color-surface)"},children:[d.jsxs("div",{className:"p-4 border-b",style:{borderColor:"var(--yc-color-border)"},children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsx("h2",{className:"text-lg font-semibold",style:{color:"var(--yc-color-text)"},children:"Add Chart"}),d.jsx("button",{onClick:t,className:"p-1 hover:opacity-80",style:{color:"var(--yc-color-text-muted)"},children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsx("input",{type:"text",placeholder:"Search charts...",value:i,onChange:y=>l(y.target.value),className:"w-full px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",style:{backgroundColor:"var(--yc-color-input-bg)",color:"var(--yc-color-text)",borderColor:"var(--yc-color-border)"},autoFocus:!0})]}),d.jsx("div",{className:"max-h-80 overflow-y-auto",children:h.length===0?d.jsx("div",{className:"p-4 text-center text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"No charts found"}):d.jsx("div",{className:"p-2",children:h.map(y=>{const g=r.includes(y.name);return d.jsxs("button",{onClick:()=>p(y.name),disabled:g,className:"w-full text-left px-3 py-3 rounded-md hover:bg-black/5 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-between group",children:[d.jsxs("div",{children:[d.jsx("div",{className:"font-medium",style:{color:"var(--yc-color-text)"},children:y.title}),d.jsx("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:y.name}),y.description&&d.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:y.description})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs px-2 py-1 rounded",style:{color:"var(--yc-color-text-muted)",backgroundColor:"var(--yc-color-surface-hover)"},children:y.type}),g?d.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-success)"},children:"Added"}):d.jsx("svg",{className:"w-5 h-5 opacity-0 group-hover:opacity-100",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})]})]},y.name)})})})]})})}function JR(e){const t=Math.floor((Date.now()-e)/1e3);if(t<10)return"Updated just now";if(t<60)return`Updated ${t}s ago`;const n=Math.floor(t/60);if(n<10)return`Updated ${n}m ago`;const r=new Date(e);return Math.floor(n/60)<24?`Last refresh ${r.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}`:`Last refresh ${r.toLocaleDateString([],{month:"short",day:"numeric"})} ${r.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}`}function ZR({dashboardId:e,title:t,description:n,contentRef:r,activeTab:s}){const{isEditing:i,setIsEditing:l,pendingLayout:u,setPendingLayout:f,setOriginalLayout:h,hasChanges:p,addWidget:y,currentLayout:g,undo:b,redo:O,canUndo:w,canRedo:T,pendingTitle:E,setPendingTitle:_,pendingDescription:S,setPendingDescription:A}=Oi(),M=Tm(),I=!!ya(),D=wd(),j=SN(e),F=CN(),B=Uk({queryKey:["chartData"]}),U=qn(),W=(()=>{const te=U.getQueryCache();let le=0;for(const ge of te.getAll()){const ve=ge.queryKey[0];(ve==="chartData"||ve==="chartWithData")&&ge.state.dataUpdatedAt>le&&(le=ge.state.dataUpdatedAt)}return le>0?le:null})(),[,Y]=N.useState(0);N.useEffect(()=>{const le=(W?Date.now()-W:1/0)<6e4?1e4:6e4,ge=setInterval(()=>Y(ve=>ve+1),le);return()=>clearInterval(ge)},[W]);const[Q,re]=N.useState(!1),[ye,G]=N.useState(!1),[fe,P]=N.useState(!1),[K,ee]=N.useState(!1),R=(g==null?void 0:g.rows.flatMap(te=>te.widgets.filter(le=>le.type==="chart"&&le.ref).map(le=>le.ref)))||[],ie=()=>{F()},ae=async te=>{if(r.current){ee(!0),re(!1);try{te==="pdf"?await E6(r.current,`${e}-dashboard`,t):await v6(r.current,`${e}-dashboard`,te)}finally{ee(!1)}}},J=async()=>{const te=u||g;if(te)try{await j.mutateAsync({layout:te,tab:s,title:E??void 0,description:S??void 0}),u&&h(u),f(null),l(!1)}catch(le){console.error("Failed to save:",le)}},be=()=>{f(null),l(!1)};return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"border-b",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-surface)"},children:[d.jsxs("div",{className:"flex items-center justify-between p-4",children:[d.jsx("div",{children:i?d.jsx("input",{type:"text",value:E??t,onChange:te=>_(te.target.value),className:"text-xl font-semibold bg-transparent border-b-2 border-dashed outline-none px-0 py-0",style:{color:"var(--yc-color-text)",borderColor:"var(--yc-color-primary)"},placeholder:"Dashboard title"}):d.jsx("h1",{className:"text-xl font-semibold",style:{color:"var(--yc-color-text)"},children:t})}),d.jsx("div",{className:"flex items-center gap-2",children:i?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"relative",children:[d.jsxs("button",{onClick:()=>P(!fe),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:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add Widget",d.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),fe&&d.jsxs("div",{className:"absolute left-0 top-full mt-1 w-40 rounded-md shadow-lg border z-50 py-1",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[d.jsxs("button",{onClick:()=>{P(!1),G(!0)},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.jsxs("button",{onClick:()=>{P(!1),y({type:"text",content:"",cols:6})},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h7"})}),"Text"]})]})]}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("button",{onClick:b,disabled:!w,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--yc-color-text-secondary)"},title:"Undo (Cmd+Z)",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h10a5 5 0 015 5v2M3 10l4-4m-4 4l4 4"})})}),d.jsx("button",{onClick:O,disabled:!T,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--yc-color-text-secondary)"},title:"Redo (Cmd+Shift+Z)",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 10H11a5 5 0 00-5 5v2m15-7l-4-4m4 4l-4 4"})})})]}),d.jsx("div",{className:"w-px h-6 mx-2",style:{backgroundColor:"var(--yc-color-border)"}}),d.jsx("button",{onClick:be,className:"px-4 py-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"Cancel"}),d.jsx("button",{onClick:J,disabled:!p||j.isPending,className:$n("px-4 py-2 text-sm font-medium rounded-md",p?"bg-blue-600 text-white hover:bg-blue-700":"cursor-not-allowed"),style:p?void 0:{backgroundColor:"var(--yc-color-surface-hover)",color:"var(--yc-color-text-muted)"},children:j.isPending?"Saving...":"Save & Push"})]}):d.jsxs(d.Fragment,{children:[W&&B===0&&d.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},title:new Date(W).toLocaleString(),children:JR(W)}),d.jsx("button",{onClick:ie,disabled:B>0,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-50",style:{color:"var(--yc-color-text-secondary)"},title:"Refresh all charts",children:d.jsx("svg",{className:$n("w-5 h-5",B>0&&"animate-spin"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}),d.jsxs("div",{className:"relative",children:[d.jsx("button",{onClick:()=>re(!Q),disabled:K,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-50",style:{color:"var(--yc-color-text-secondary)"},title:"Export dashboard",children:K?d.jsxs("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),d.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"})]}):d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}),Q&&d.jsxs("div",{className:"absolute right-0 top-full mt-1 w-40 rounded-md shadow-lg border z-50 py-1",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[d.jsxs("button",{onClick:()=>ae("png"),className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.jsxs("button",{onClick:()=>ae("jpeg"),className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]}),d.jsxs("button",{onClick:()=>ae("pdf"),className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"]})]})]}),!I&&d.jsx(I2,{resourceType:"dashboard",resourceName:e}),!I&&D&&d.jsxs("button",{onClick:()=>Rs.getState().openPanel({type:"dashboard",name:e}),className:"flex items-center gap-1 px-2 py-1 rounded text-xs",style:{color:"var(--yc-color-text-secondary)"},title:"Ask AI about this dashboard",children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),"Ask AI"]}),!I&&(M==="lg"?d.jsx("button",{onClick:()=>l(!0),className:"p-2 hover:bg-black/5 rounded-md",style:{color:"var(--yc-color-text-secondary)"},title:"Edit layout",children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}):d.jsx("button",{disabled:!0,className:"p-2 rounded-md",style:{opacity:.5,cursor:"not-allowed",color:"var(--yc-color-text-muted)"},title:"Editing requires a desktop browser",children:d.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.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"})})}))]})})]}),i?d.jsx("input",{type:"text",value:S??n??"",onChange:te=>A(te.target.value),className:"w-full px-4 pb-3 text-sm bg-transparent border-b border-dashed outline-none",style:{color:"var(--yc-color-text-secondary)",borderColor:"var(--yc-color-border)"},placeholder:"Add a description..."}):n?d.jsx("p",{className:"px-4 pb-3 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:n}):null]}),d.jsx(XR,{isOpen:ye,onClose:()=>G(!1),onAdd:y,existingCharts:R})]})}function eP({filters:e,isEditing:t,onReorder:n,onRename:r,showCrossFilters:s}){const[i,l]=N.useState(null),[u,f]=N.useState(null),h=ot(A=>A.globalFilters),p=ot(A=>A.resetFilters),y=ot(A=>A.crossFilters),g=ot(A=>A.clearCrossFilter),b=ot(A=>A.clearAllCrossFilters),O=s?Object.values(y):[];if(e.length===0&&O.length===0)return null;const w=e.some(A=>{const M=h[A.name];if(M==null||M===""||Array.isArray(M)&&M.length===0)return!1;const C=A.default??(A.type==="date_range"?"last_30_days":void 0);return JSON.stringify(M)!==JSON.stringify(C)});function T(A,M){l(M),A.dataTransfer.effectAllowed="move"}function E(A,M){A.preventDefault(),A.dataTransfer.dropEffect="move",f(M)}function _(A,M){if(A.preventDefault(),i===null||i===M)return;const C=[...e],I=C.splice(i,1)[0];C.splice(M,0,I),n==null||n(C),l(null),f(null)}function S(){l(null),f(null)}return t?d.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.map((A,M)=>{const C=A.label||fa(A.name),I=i===M?"opacity-50":"";return d.jsxs("div",{draggable:!0,onDragStart:D=>T(D,M),onDragOver:D=>E(D,M),onDrop:D=>_(D,M),onDragEnd:S,className:`flex items-center gap-1.5 border rounded-full px-3 py-1.5 text-sm cursor-grab active:cursor-grabbing transition-colors ${I}`,style:u===M?{borderColor:"var(--yc-color-primary)",backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)"}:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)"},children:[d.jsx("svg",{className:"w-2.5 h-2.5 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"currentColor",viewBox:"0 0 20 20",children:d.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"})}),d.jsx(tP,{value:C,onChange:D=>r==null?void 0:r(M,D)}),d.jsx("svg",{className:"w-3 h-3 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]},A.name)})}):d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.map(A=>{const M=A.label||fa(A.name),C=typeof A.default=="string"?A.default:void 0;switch(A.type){case"date_range":return d.jsx(T2,{name:A.name,label:M,description:A.description,defaultValue:C},A.name);case"select":{const I=(A.options||[]).map(D=>typeof D=="string"?{value:D,label:D}:D);return d.jsx(nd,{name:A.name,label:M,description:A.description,options:I,defaultValue:C},A.name)}case"dynamic_select":return A.source?d.jsx(nd,{name:A.name,label:M,description:A.description,source:A.source,defaultValue:C},A.name):d.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[M,": dynamic_select requires source"]},A.name);case"multi_select":{const I=(A.options||[]).map(D=>typeof D=="string"?{value:D,label:D}:D);return d.jsx(w2,{name:A.name,label:M,description:A.description,options:I,defaultValue:Array.isArray(A.default)?A.default:void 0,source:A.source},A.name)}case"text":return d.jsx(C2,{name:A.name,label:M,description:A.description,defaultValue:C},A.name);case"number":return d.jsx(D2,{name:A.name,label:M,description:A.description,defaultValue:typeof A.default=="number"?A.default:void 0},A.name);case"boolean":return d.jsx(O2,{name:A.name,label:M,description:A.description},A.name);default:return d.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[M,": ",A.type," (not supported)"]},A.name)}}),O.length>0&&e.length>0&&d.jsx("div",{className:"w-px h-6 mx-1",style:{backgroundColor:"var(--yc-color-border)"}}),O.map(A=>d.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 py-1.5 text-sm rounded-full",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)",border:"1px solid color-mix(in srgb, var(--yc-color-primary) 30%, transparent)"},children:[A.field,": ",am(A.value),d.jsx("button",{onClick:()=>g(A.field),className:"ml-0.5 hover:opacity-80","aria-label":`Clear ${A.field} filter`,children:d.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M3 3l6 6M9 3l-6 6"})})})]},`cf-${A.field}`)),(w||O.length>0)&&d.jsx("button",{type:"button",onClick:()=>{w&&p(),O.length>0&&b()},className:"text-sm px-2 py-1.5 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",style:{color:"var(--yc-color-text-muted)"},children:"Clear all"})]})}function tP({value:e,onChange:t}){const[n,r]=N.useState(!1),[s,i]=N.useState(e);if(!n)return d.jsx("span",{className:"text-sm font-medium cursor-text hover:text-blue-600 hover:underline",style:{color:"var(--yc-color-text)"},onClick:u=>{u.stopPropagation(),r(!0),i(e)},title:"Click to rename",children:e});function l(){s.trim()&&s!==e&&t(s.trim()),r(!1)}return d.jsx("input",{autoFocus:!0,value:s,onChange:u=>i(u.target.value),onBlur:l,onKeyDown:u=>{u.key==="Enter"&&l(),u.key==="Escape"&&r(!1)},className:"text-sm font-medium border border-blue-300 rounded px-1 py-0 outline-none w-32",style:{color:"var(--yc-color-text)",backgroundColor:"var(--yc-color-surface)"},onClick:u=>u.stopPropagation()})}function nP({tabs:e,activeTab:t,onTabChange:n}){const{isEditing:r}=Oi();return d.jsx("div",{className:"flex border-b mb-4 mt-2",style:{borderColor:"var(--yc-color-border)"},children:e.map(s=>d.jsx("button",{onClick:()=>n(s.name),disabled:r&&s.name!==t,className:$n("px-4 py-2 text-sm font-medium border-b-2 transition-colors",s.name===t?"border-blue-500 text-blue-600":"border-transparent hover:border-gray-300",r&&s.name!==t&&"opacity-50 cursor-not-allowed hover:border-transparent"),style:s.name!==t?{color:"var(--yc-color-text-secondary)"}:void 0,children:s.label},s.name))})}function rP({dashboardId:e,title:t,description:n,contentRef:r,tabs:s,activeTab:i,onTabChange:l,filters:u}){const{isEditing:f,pendingFilters:h,setPendingFilters:p}=Oi(),y=ot(b=>Object.keys(b.crossFilters).length>0);N.useEffect(()=>{f&&!h&&p([...u])},[f]);const g=f&&h?h:u;return d.jsxs(d.Fragment,{children:[d.jsx(ZR,{dashboardId:e,title:t,description:n,contentRef:r,activeTab:s?i:void 0}),s&&i&&l&&d.jsx(nP,{tabs:s,activeTab:i,onTabChange:l}),(g.length>0||!f&&y)&&d.jsx("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:d.jsx(eP,{filters:g,isEditing:f,onReorder:b=>p(b),onRename:(b,O)=>{const w=[...g];w[b]={...w[b],label:O},p(w)},showCrossFilters:!f})})]})}function sP({dashboardId:e,branch:t,initialTab:n}){const{data:r,isLoading:s,error:i}=kN(e,t),l=N.useRef(null),u=qn(),f=ot(w=>w.globalFilters),[h,p]=N.useState(n||"");N.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]),N.useEffect(()=>{if(!(r!=null&&r.tabs))return;const w=r.tabs.map(E=>E.name);if(h&&w.includes(h))return;const T=n&&w.includes(n)?n:w[0];T&&p(T)},[r==null?void 0:r.tabs,n]);const y=ot(w=>w.clearAllCrossFilters),g=N.useCallback(w=>{var E;p(w),y();const T=`#/dashboards/${e}`;if(window.history.replaceState(null,"",`${T}?tab=${encodeURIComponent(w)}`),r!=null&&r.name){const _=xi(Object.fromEntries(Object.entries(f).filter(([A,M])=>M!=null)));xt.warmDashboardCache(r.name,_,w).catch(()=>{});const S=(E=r.tabs)==null?void 0:E.find(A=>A.name===w);if(S)for(const A of S.layout.rows)for(const M of A.widgets)M.type==="chart"&&M.ref&&u.prefetchQuery({queryKey:["chartWithData",M.ref,_],queryFn:()=>xt.queryChart(M.ref,_,{includeConfig:!0}),staleTime:1e3*60*5})}},[e,r==null?void 0:r.name,r==null?void 0:r.tabs,f,u,y]),b=N.useMemo(()=>{if(r){if(r.tabs){const w=r.tabs.find(T=>T.name===h);return w==null?void 0:w.layout}return r.layout}},[r,h]),O=N.useMemo(()=>{if(!r)return[];const w=r.filters||[];if(r.tabs){const T=r.tabs.find(_=>_.name===h),E=(T==null?void 0:T.filters)||[];return[...w,...E]}return w},[r,h]);return s?d.jsx("div",{className:"flex items-center justify-center h-64",children:d.jsx("div",{style:{color:"var(--yc-color-text-secondary)"},children:"Loading dashboard..."})}):i||!r?d.jsx("div",{className:"flex items-center justify-center h-64",children:d.jsxs("div",{style:{color:"var(--yc-color-danger)"},children:["Failed to load dashboard: ",(i==null?void 0:i.message)||"Unknown error"]})}):b?d.jsx(aA,{children:d.jsxs("div",{style:{backgroundColor:"var(--yc-color-background)"},children:[d.jsx(rP,{dashboardId:e,title:r.title,description:r.description,contentRef:l,tabs:r.tabs,activeTab:h,onTabChange:r.tabs?g:void 0,filters:O}),d.jsx("div",{ref:l,className:"p-6",children:d.jsx(KR,{layout:b,dashboardName:r.name})})]})}):d.jsx("div",{className:"flex items-center justify-center h-64",children:d.jsx("div",{style:{color:"var(--yc-color-text-secondary)"},children:"No layout available"})})}const oP=N.lazy(()=>Yr(()=>import("./LoginPage-vaI1dnyL.js"),__vite__mapDeps([0,1])).then(e=>({default:e.LoginPage}))),aP=N.lazy(()=>Yr(()=>import("./SetupWizard-DvlVX2O6.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SetupWizard}))),iP=N.lazy(()=>Yr(()=>import("./UserManagement-CvmpNy3o.js"),__vite__mapDeps([3,1])).then(e=>({default:e.UserManagement}))),lP=N.lazy(()=>Yr(()=>import("./ShareManagement-ulvPrOAQ.js"),__vite__mapDeps([4,1])).then(e=>({default:e.ShareManagement}))),uP=N.lazy(()=>Yr(()=>import("./PublicViewer-B-OKj2cg.js"),__vite__mapDeps([5,1])).then(e=>({default:e.PublicViewer}))),cP=N.lazy(()=>Yr(()=>import("./EventManagement-MMsAkJKj.js"),__vite__mapDeps([6,1])).then(e=>({default:e.EventManagement}))),dP=N.lazy(()=>Yr(()=>import("./ExplorePage-BSkSNgLT.js"),__vite__mapDeps([7,1]))),Rl=()=>d.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:d.jsx("div",{className:"text-gray-500",children:"Loading..."})});function T0(e){const t=e.replace(/^#?/,"");if(t==="/explore")return{type:"explore",name:"",params:{}};const n=t.match(/^\/settings\/(.+)$/);if(n&&n[1])return{type:"settings",name:n[1],params:{}};if(t==="/events")return{type:"events",name:"",params:{}};const[r,s]=t.split("?"),i=r==null?void 0:r.match(/^\/public\/(charts|dashboards)\/(.+)$/);if(i&&i[1]&&i[2]){const y={};if(s)for(const[g,b]of new URLSearchParams(s).entries())y[g]=b;return{type:i[1]==="dashboards"?"public_dashboard":"public_chart",name:decodeURIComponent(i[2]),params:y}}const[l,u]=t.split("?"),f=l==null?void 0:l.match(/^\/(charts)\/(.+)\/detail$/);if(f&&f[2]){const y={};if(u)for(const[g,b]of new URLSearchParams(u).entries())y[g]=b;return{type:"chart_detail",name:decodeURIComponent(f[2]),params:y}}const h=l==null?void 0:l.match(/^\/(dashboards|charts)\/(.+)$/);if(!h||!h[1]||!h[2])return null;const p={};if(u)for(const[y,g]of new URLSearchParams(u).entries())p[y]=g;return{type:h[1]==="dashboards"?"dashboard":"chart",name:decodeURIComponent(h[2]),params:p}}function xb(e,t){return d.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:d.jsxs("div",{className:"text-center max-w-md p-8",children:[d.jsx("div",{className:"w-12 h-12 mx-auto mb-4 rounded-full bg-red-50 flex items-center justify-center",children:d.jsx("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.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"})})}),d.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:"Something went wrong"}),d.jsx("p",{className:"text-sm text-gray-500 mt-2",children:e.message}),d.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 fP(){_N();const e=So(w=>w.auth),t=So(w=>w.checkAuth),n=wd();N.useEffect(()=>{t()},[t]);const{data:r,isLoading:s}=ga(),{data:i,isLoading:l}=hv(),u=ot(w=>w.resetFilters),[f,h]=N.useState(()=>window.location.hash.replace(/^#/,"")||"");N.useEffect(()=>{const w=()=>{h(window.location.hash.replace(/^#/,"")||""),u()};return window.addEventListener("hashchange",w),()=>window.removeEventListener("hashchange",w)},[u]);const p=N.useCallback(w=>{window.location.hash=w,h(w),u()},[u]);N.useEffect(()=>{s||l||f||(i&&i.length>0&&i[0]?p(`/dashboards/${i[0].name}`):r!=null&&r.charts&&r.charts.length>0&&r.charts[0]&&p(`/charts/${r.charts[0].name}`))},[s,l,i,r,f,p]);const y=T0(f);if(y&&(y.type==="public_chart"||y.type==="public_dashboard"))return d.jsx(N.Suspense,{fallback:d.jsx(Rl,{}),children:d.jsx(uP,{parsed:{type:y.type,name:y.name,params:y.params}})});if(e.status==="loading")return d.jsx(Rl,{});if(e.status==="needs_setup")return d.jsx(N.Suspense,{fallback:d.jsx(Rl,{}),children:d.jsx(aP,{})});if(e.status==="unauthenticated")return d.jsx(N.Suspense,{fallback:d.jsx(Rl,{}),children:d.jsx(oP,{})});const g=T0(f);if((g==null?void 0:g.type)==="explore")return d.jsx(sd,{fallback:xb,children:d.jsx(S1,{children:d.jsx(N.Suspense,{fallback:d.jsx(Rl,{}),children:d.jsx(dP,{})})})});if(s||l)return d.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:d.jsx("div",{className:"text-gray-500",children:"Loading..."})});const b=T0(f),O=()=>b?b.type==="settings"&&b.name==="users"?d.jsx(N.Suspense,{fallback:d.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:d.jsx(iP,{})}):b.type==="settings"&&b.name==="shares"?d.jsx(N.Suspense,{fallback:d.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:d.jsx(lP,{})}):b.type==="events"?d.jsx(N.Suspense,{fallback:d.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:d.jsx(cP,{})}):b.type==="dashboard"?d.jsx(sP,{dashboardId:b.name,initialTab:b.params.tab}):b.type==="chart_detail"?d.jsx(sA,{chartName:b.name,params:b.params}):d.jsx(rA,{chartName:b.name,drillParams:b.params}):d.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",style:{color:"var(--yc-color-text-secondary)"},children:[d.jsx("span",{className:"text-sm",children:"Select a dashboard or chart from the sidebar"}),n&&d.jsxs("a",{href:"#/explore",className:"flex items-center gap-1.5 text-sm hover:underline",style:{color:"var(--yc-color-primary)"},onClick:w=>{w.preventDefault(),p("/explore")},children:[d.jsx("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 15.803a7.5 7.5 0 0010.607 10.607z"})}),"Explore your data"]})]});return d.jsx(sd,{fallback:xb,children:d.jsx(S1,{children:d.jsx(SO,{currentPath:f,onNavigate:p,onNavigateToUsers:()=>p("/settings/users"),onNavigateToShares:()=>p("/settings/shares"),children:O()})})})}dk.createRoot(document.getElementById("root")).render(d.jsx(N.StrictMode,{children:d.jsx(zk,{children:d.jsx(fP,{})})}));export{cu as A,z2 as B,ld as C,L2 as D,sm as E,A2 as F,X2 as G,Q2 as H,dn as I,Tm as J,QN as K,U2 as L,e2 as M,TO as N,wO as O,Y2 as P,I2 as S,om as T,K2 as W,Yr as _,xt as a,Kb as b,$n as c,fv as d,ga as e,Mm as f,ot as g,wd as h,Rs as i,d as j,Z2 as k,Z6 as l,G2 as m,V2 as n,q2 as o,$2 as p,W2 as q,yP as r,sP as s,qn as t,So as u,or as v,Za as w,ks as x,x6 as y,Xa as z};
|