yamchart 0.8.8 → 0.9.0
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-IJBW56F5.js → advisor-Z7TKPPBR.js} +10 -10
- package/dist/{agent-2DFNL2UB.js → agent-KWKPAYT2.js} +2 -2
- package/dist/{chunk-34ZVFILD.js → chunk-AMHCOB4D.js} +4 -4
- package/dist/{chunk-5N3FYFBV.js → chunk-CWAWATL4.js} +34 -7
- package/dist/chunk-CWAWATL4.js.map +1 -0
- package/dist/{chunk-D3ELUYYE.js → chunk-E2QN2M7S.js} +52 -5
- package/dist/chunk-E2QN2M7S.js.map +1 -0
- package/dist/{chunk-B5ZLCKNF.js → chunk-FZFBBB7K.js} +2 -2
- package/dist/{chunk-232AMQ5T.js → chunk-G57J2WQM.js} +4 -4
- package/dist/{chunk-77U26A7F.js → chunk-ZA6AOQVZ.js} +4 -4
- package/dist/chunk-ZA6AOQVZ.js.map +1 -0
- package/dist/{connection-utils-ZLSV5OLQ.js → connection-utils-CTPN7PV3.js} +4 -4
- package/dist/{describe-VO4CEYL2.js → describe-4NME6RCB.js} +5 -5
- package/dist/{dev-JUA73B6D.js → dev-6QGAB4ZH.js} +316 -29
- package/dist/dev-6QGAB4ZH.js.map +1 -0
- package/dist/{dist-PINRLZVT.js → dist-4GUE24QV.js} +2 -2
- package/dist/{dist-GVNWQXFR.js → dist-7CRX2GIR.js} +2 -2
- package/dist/{dist-E2PVGIPT.js → dist-VNX77VV5.js} +4 -2
- package/dist/index.js +21 -21
- package/dist/public/assets/{EventManagement-DQY1Sic0.js → EventManagement-MMsAkJKj.js} +2 -2
- package/dist/public/assets/{ExplorePage-C9M-fQ3Y.js → ExplorePage-BSkSNgLT.js} +1 -1
- package/dist/public/assets/{LoginPage-XYLwfbfw.js → LoginPage-vaI1dnyL.js} +1 -1
- package/dist/public/assets/PublicViewer-B-OKj2cg.js +1 -0
- package/dist/public/assets/{SetupWizard-fle7FC4b.js → SetupWizard-DvlVX2O6.js} +1 -1
- package/dist/public/assets/{ShareManagement-b3j4jzn3.js → ShareManagement-ulvPrOAQ.js} +1 -1
- package/dist/public/assets/{UserManagement-DwZ-AaqI.js → UserManagement-CvmpNy3o.js} +1 -1
- package/dist/public/assets/{index-CRcgti3B.css → index-CfyF2Wf-.css} +1 -1
- package/dist/public/assets/index-DD59fsOk.js +195 -0
- package/dist/public/assets/{index.es-Bd2YVqtj.js → index.es-BeTaRWIv.js} +1 -1
- package/dist/public/assets/{jspdf.es.min-CpRfbJ_H.js → jspdf.es.min-9haD1GSE.js} +3 -3
- package/dist/public/index.html +2 -2
- package/dist/{query-PXJMSDKR.js → query-Z75RKTHV.js} +4 -4
- package/dist/{sample-M24H3M73.js → sample-OIJNXQNC.js} +4 -4
- package/dist/{search-UCJS7X5D.js → search-YDCPIDZX.js} +5 -5
- package/dist/{source-resolver-RXNB7A64.js → source-resolver-4SUWXUGW.js} +5 -5
- package/dist/{sync-warehouse-S75DWVTG.js → sync-warehouse-NZFDS6WK.js} +4 -4
- package/dist/{tables-W3M3JDJO.js → tables-WJS2VI4L.js} +5 -5
- package/dist/templates/default/CLAUDE.md +1 -1
- package/dist/templates/default/docs/yamchart-reference.md +108 -2
- package/dist/{test-67AXD5PI.js → test-I4XOF7TZ.js} +5 -17
- package/dist/test-I4XOF7TZ.js.map +1 -0
- package/package.json +3 -3
- package/dist/chunk-5N3FYFBV.js.map +0 -1
- package/dist/chunk-77U26A7F.js.map +0 -1
- package/dist/chunk-D3ELUYYE.js.map +0 -1
- package/dist/dev-JUA73B6D.js.map +0 -1
- package/dist/public/assets/PublicViewer-CZJYS0wF.js +0 -1
- package/dist/public/assets/index-m_Jm3sB1.js +0 -188
- package/dist/test-67AXD5PI.js.map +0 -1
- /package/dist/{advisor-IJBW56F5.js.map → advisor-Z7TKPPBR.js.map} +0 -0
- /package/dist/{agent-2DFNL2UB.js.map → agent-KWKPAYT2.js.map} +0 -0
- /package/dist/{chunk-34ZVFILD.js.map → chunk-AMHCOB4D.js.map} +0 -0
- /package/dist/{chunk-B5ZLCKNF.js.map → chunk-FZFBBB7K.js.map} +0 -0
- /package/dist/{chunk-232AMQ5T.js.map → chunk-G57J2WQM.js.map} +0 -0
- /package/dist/{connection-utils-ZLSV5OLQ.js.map → connection-utils-CTPN7PV3.js.map} +0 -0
- /package/dist/{describe-VO4CEYL2.js.map → describe-4NME6RCB.js.map} +0 -0
- /package/dist/{dist-E2PVGIPT.js.map → dist-4GUE24QV.js.map} +0 -0
- /package/dist/{dist-GVNWQXFR.js.map → dist-7CRX2GIR.js.map} +0 -0
- /package/dist/{dist-PINRLZVT.js.map → dist-VNX77VV5.js.map} +0 -0
- /package/dist/{query-PXJMSDKR.js.map → query-Z75RKTHV.js.map} +0 -0
- /package/dist/{sample-M24H3M73.js.map → sample-OIJNXQNC.js.map} +0 -0
- /package/dist/{search-UCJS7X5D.js.map → search-YDCPIDZX.js.map} +0 -0
- /package/dist/{source-resolver-RXNB7A64.js.map → source-resolver-4SUWXUGW.js.map} +0 -0
- /package/dist/{sync-warehouse-S75DWVTG.js.map → sync-warehouse-NZFDS6WK.js.map} +0 -0
- /package/dist/{tables-W3M3JDJO.js.map → tables-WJS2VI4L.js.map} +0 -0
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginPage-XYLwfbfw.js","assets/echarts-DtOYsfLX.js","assets/SetupWizard-fle7FC4b.js","assets/UserManagement-DwZ-AaqI.js","assets/ShareManagement-b3j4jzn3.js","assets/PublicViewer-CZJYS0wF.js","assets/EventManagement-DQY1Sic0.js","assets/ExplorePage-C9M-fQ3Y.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var Zw=Object.defineProperty;var zg=e=>{throw TypeError(e)};var ek=(e,t,n)=>t in e?Zw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fe=(e,t,n)=>ek(e,typeof t!="symbol"?t+"":t,n),Ih=(e,t,n)=>t.has(e)||zg("Cannot "+n);var W=(e,t,n)=>(Ih(e,t,"read from private field"),n?n.call(e):t.get(e)),Be=(e,t,n)=>t.has(e)?zg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ie=(e,t,n,r)=>(Ih(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),st=(e,t,n)=>(Ih(e,t,"access private method"),n);var Sc=(e,t,n,r)=>({set _(s){Ie(e,t,s,n)},get _(){return W(e,t,r)}});import{r as ha,a as C,R as Le,g as _b,E as tk}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 Mh={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 Wg;function nk(){if(Wg)return pl;Wg=1;var e=ha(),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(c,f,h){var p,y={},g=null,v=null;h!==void 0&&(g=""+h),f.key!==void 0&&(g=""+f.key),f.ref!==void 0&&(v=f.ref);for(p in f)r.call(f,p)&&!i.hasOwnProperty(p)&&(y[p]=f[p]);if(c&&c.defaultProps)for(p in f=c.defaultProps,f)y[p]===void 0&&(y[p]=f[p]);return{$$typeof:t,type:c,key:g,ref:v,props:y,_owner:s.current}}return pl.Fragment=n,pl.jsx=l,pl.jsxs=l,pl}var Yg;function rk(){return Yg||(Yg=1,Mh.exports=nk()),Mh.exports}var d=rk(),Cc={},Lh={exports:{}},Jn={},Rh={exports:{}},Ph={};/**
|
|
11
|
-
* @license React
|
|
12
|
-
* scheduler.production.min.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var $g;function sk(){return $g||($g=1,(function(e){function t(te,ue){var M=te.length;te.push(ue);e:for(;0<M;){var Q=M-1>>>1,le=te[Q];if(0<s(le,ue))te[Q]=ue,te[M]=le,M=Q;else break e}}function n(te){return te.length===0?null:te[0]}function r(te){if(te.length===0)return null;var ue=te[0],M=te.pop();if(M!==ue){te[0]=M;e:for(var Q=0,le=te.length,j=le>>>1;Q<j;){var se=2*(Q+1)-1,ye=te[se],xe=se+1,Oe=te[xe];if(0>s(ye,M))xe<le&&0>s(Oe,ye)?(te[Q]=Oe,te[xe]=M,Q=xe):(te[Q]=ye,te[se]=M,Q=se);else if(xe<le&&0>s(Oe,M))te[Q]=Oe,te[xe]=M,Q=xe;else break e}}return ue}function s(te,ue){var M=te.sortIndex-ue.sortIndex;return M!==0?M:te.id-ue.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],h=[],p=1,y=null,g=3,v=!1,D=!1,k=!1,T=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(te){for(var ue=n(h);ue!==null;){if(ue.callback===null)r(h);else if(ue.startTime<=te)r(h),ue.sortIndex=ue.expirationTime,t(f,ue);else break;ue=n(h)}}function A(te){if(k=!1,O(te),!D)if(n(f)!==null)D=!0,ee(R);else{var ue=n(h);ue!==null&&he(A,ue.startTime-te)}}function R(te,ue){D=!1,k&&(k=!1,E(_),_=-1),v=!0;var M=g;try{for(O(ue),y=n(f);y!==null&&(!(y.expirationTime>ue)||te&&!H());){var Q=y.callback;if(typeof Q=="function"){y.callback=null,g=y.priorityLevel;var le=Q(y.expirationTime<=ue);ue=e.unstable_now(),typeof le=="function"?y.callback=le:y===n(f)&&r(f),O(ue)}else r(f);y=n(f)}if(y!==null)var j=!0;else{var se=n(h);se!==null&&he(A,se.startTime-ue),j=!1}return j}finally{y=null,g=M,v=!1}}var S=!1,I=null,_=-1,P=5,F=-1;function H(){return!(e.unstable_now()-F<P)}function U(){if(I!==null){var te=e.unstable_now();F=te;var ue=!0;try{ue=I(!0,te)}finally{ue?Y():(S=!1,I=null)}}else S=!1}var Y;if(typeof N=="function")Y=function(){N(U)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,G=q.port2;q.port1.onmessage=U,Y=function(){G.postMessage(null)}}else Y=function(){T(U,0)};function ee(te){I=te,S||(S=!0,Y())}function he(te,ue){_=T(function(){te(e.unstable_now())},ue)}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(te){te.callback=null},e.unstable_continueExecution=function(){D||v||(D=!0,ee(R))},e.unstable_forceFrameRate=function(te){0>te||125<te?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<te?Math.floor(1e3/te):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(te){switch(g){case 1:case 2:case 3:var ue=3;break;default:ue=g}var M=g;g=ue;try{return te()}finally{g=M}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(te,ue){switch(te){case 1:case 2:case 3:case 4:case 5:break;default:te=3}var M=g;g=te;try{return ue()}finally{g=M}},e.unstable_scheduleCallback=function(te,ue,M){var Q=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?Q+M:Q):M=Q,te){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=M+le,te={id:p++,callback:ue,priorityLevel:te,startTime:M,expirationTime:le,sortIndex:-1},M>Q?(te.sortIndex=M,t(h,te),n(f)===null&&te===n(h)&&(k?(E(_),_=-1):k=!0,he(A,M-Q))):(te.sortIndex=le,t(f,te),D||v||(D=!0,ee(R))),te},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(te){var ue=g;return function(){var M=g;g=ue;try{return te.apply(this,arguments)}finally{g=M}}}})(Ph)),Ph}var qg;function ok(){return qg||(qg=1,Rh.exports=sk()),Rh.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 Vg;function ak(){if(Vg)return Jn;Vg=1;var e=ha(),t=ok();function n(o){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+o,u=1;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u]);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 c=!(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 v(o,a,u,m){if(u!==null&&u.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return m?!1:u!==null?!u.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function D(o,a,u,m){if(a===null||typeof a>"u"||v(o,a,u,m))return!0;if(m)return!1;if(u!==null)switch(u.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 k(o,a,u,m,b,w,L){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=m,this.attributeNamespace=b,this.mustUseProperty=u,this.propertyName=o,this.type=a,this.sanitizeURL=w,this.removeEmptyString=L}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){T[o]=new k(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 k(a,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){T[o]=new k(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){T[o]=new k(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 k(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){T[o]=new k(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){T[o]=new k(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){T[o]=new k(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){T[o]=new k(o,5,!1,o.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function N(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,N);T[a]=new k(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,N);T[a]=new k(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,N);T[a]=new k(a,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){T[o]=new k(o,1,!1,o.toLowerCase(),null,!1,!1)}),T.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){T[o]=new k(o,1,!1,o.toLowerCase(),null,!0,!0)});function O(o,a,u,m){var b=T.hasOwnProperty(a)?T[a]:null;(b!==null?b.type!==0:m||!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(D(a,u,b,m)&&(u=null),m||b===null?g(a)&&(u===null?o.removeAttribute(a):o.setAttribute(a,""+u)):b.mustUseProperty?o[b.propertyName]=u===null?b.type===3?!1:"":u:(a=b.attributeName,m=b.attributeNamespace,u===null?o.removeAttribute(a):(b=b.type,u=b===3||b===4&&u===!0?"":""+u,m?o.setAttributeNS(m,a,u):o.setAttribute(a,u))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),S=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),H=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),he=Symbol.for("react.offscreen"),te=Symbol.iterator;function ue(o){return o===null||typeof o!="object"?null:(o=te&&o[te]||o["@@iterator"],typeof o=="function"?o:null)}var M=Object.assign,Q;function le(o){if(Q===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);Q=a&&a[1]||""}return`
|
|
27
|
-
`+Q+o}var j=!1;function se(o,a){if(!o||j)return"";j=!0;var u=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(ce){var m=ce}Reflect.construct(o,[],a)}else{try{a.call()}catch(ce){m=ce}o.call(a.prototype)}else{try{throw Error()}catch(ce){m=ce}o()}}catch(ce){if(ce&&m&&typeof ce.stack=="string"){for(var b=ce.stack.split(`
|
|
28
|
-
`),w=m.stack.split(`
|
|
29
|
-
`),L=b.length-1,$=w.length-1;1<=L&&0<=$&&b[L]!==w[$];)$--;for(;1<=L&&0<=$;L--,$--)if(b[L]!==w[$]){if(L!==1||$!==1)do if(L--,$--,0>$||b[L]!==w[$]){var K=`
|
|
30
|
-
`+b[L].replace(" at new "," at ");return o.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",o.displayName)),K}while(1<=L&&0<=$);break}}}finally{j=!1,Error.prepareStackTrace=u}return(o=o?o.displayName||o.name:"")?le(o):""}function ye(o){switch(o.tag){case 5:return le(o.type);case 16:return le("Lazy");case 13:return le("Suspense");case 19:return le("SuspenseList");case 0:case 2:case 15:return o=se(o.type,!1),o;case 11:return o=se(o.type.render,!1),o;case 1:return o=se(o.type,!0),o;default:return""}}function xe(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 S:return"Portal";case P:return"Profiler";case _:return"StrictMode";case Y:return"Suspense";case q:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case H: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 G:return a=o.displayName||null,a!==null?a:xe(o.type)||"Memo";case ee:a=o._payload,o=o._init;try{return xe(o(a))}catch{}}return null}function Oe(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 xe(a);case 8:return a===_?"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 ae(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function de(o){var a=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function _e(o){var a=de(o)?"checked":"value",u=Object.getOwnPropertyDescriptor(o.constructor.prototype,a),m=""+o[a];if(!o.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var b=u.get,w=u.set;return Object.defineProperty(o,a,{configurable:!0,get:function(){return b.call(this)},set:function(L){m=""+L,w.call(this,L)}}),Object.defineProperty(o,a,{enumerable:u.enumerable}),{getValue:function(){return m},setValue:function(L){m=""+L},stopTracking:function(){o._valueTracker=null,delete o[a]}}}}function ke(o){o._valueTracker||(o._valueTracker=_e(o))}function Pe(o){if(!o)return!1;var a=o._valueTracker;if(!a)return!0;var u=a.getValue(),m="";return o&&(m=de(o)?o.checked?"true":"false":o.value),o=m,o!==u?(a.setValue(o),!0):!1}function Ue(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 et(o,a){var u=a.checked;return M({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??o._wrapperState.initialChecked})}function Ke(o,a){var u=a.defaultValue==null?"":a.defaultValue,m=a.checked!=null?a.checked:a.defaultChecked;u=ae(a.value!=null?a.value:u),o._wrapperState={initialChecked:m,initialValue:u,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function ge(o,a){a=a.checked,a!=null&&O(o,"checked",a,!1)}function me(o,a){ge(o,a);var u=ae(a.value),m=a.type;if(u!=null)m==="number"?(u===0&&o.value===""||o.value!=u)&&(o.value=""+u):o.value!==""+u&&(o.value=""+u);else if(m==="submit"||m==="reset"){o.removeAttribute("value");return}a.hasOwnProperty("value")?J(o,a.type,u):a.hasOwnProperty("defaultValue")&&J(o,a.type,ae(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(o.defaultChecked=!!a.defaultChecked)}function fe(o,a,u){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,u||a===o.value||(o.value=a),o.defaultValue=a}u=o.name,u!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,u!==""&&(o.name=u)}function J(o,a,u){(a!=="number"||Ue(o.ownerDocument)!==o)&&(u==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+u&&(o.defaultValue=""+u))}var Z=Array.isArray;function be(o,a,u,m){if(o=o.options,a){a={};for(var b=0;b<u.length;b++)a["$"+u[b]]=!0;for(u=0;u<o.length;u++)b=a.hasOwnProperty("$"+o[u].value),o[u].selected!==b&&(o[u].selected=b),b&&m&&(o[u].defaultSelected=!0)}else{for(u=""+ae(u),a=null,b=0;b<o.length;b++){if(o[b].value===u){o[b].selected=!0,m&&(o[b].defaultSelected=!0);return}a!==null||o[b].disabled||(a=o[b])}a!==null&&(a.selected=!0)}}function Ne(o,a){if(a.dangerouslySetInnerHTML!=null)throw Error(n(91));return M({},a,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function $e(o,a){var u=a.value;if(u==null){if(u=a.children,a=a.defaultValue,u!=null){if(a!=null)throw Error(n(92));if(Z(u)){if(1<u.length)throw Error(n(93));u=u[0]}a=u}a==null&&(a=""),u=a}o._wrapperState={initialValue:ae(u)}}function ct(o,a){var u=ae(a.value),m=ae(a.defaultValue);u!=null&&(u=""+u,u!==o.value&&(o.value=u),a.defaultValue==null&&o.defaultValue!==u&&(o.defaultValue=u)),m!=null&&(o.defaultValue=""+m)}function ht(o){var a=o.textContent;a===o._wrapperState.initialValue&&a!==""&&a!==null&&(o.value=a)}function ie(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 ve(o,a){return o==null||o==="http://www.w3.org/1999/xhtml"?ie(a):o==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Re,rt=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(a,u,m,b){MSApp.execUnsafeLocalFunction(function(){return o(a,u,m,b)})}:o})(function(o,a){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=a;else{for(Re=Re||document.createElement("div"),Re.innerHTML="<svg>"+a.valueOf().toString()+"</svg>",a=Re.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;a.firstChild;)o.appendChild(a.firstChild)}});function ot(o,a){if(a){var u=o.firstChild;if(u&&u===o.lastChild&&u.nodeType===3){u.nodeValue=a;return}}o.textContent=a}var xt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Zt=["Webkit","ms","Moz","O"];Object.keys(xt).forEach(function(o){Zt.forEach(function(a){a=a+o.charAt(0).toUpperCase()+o.substring(1),xt[a]=xt[o]})});function hn(o,a,u){return a==null||typeof a=="boolean"||a===""?"":u||typeof a!="number"||a===0||xt.hasOwnProperty(o)&&xt[o]?(""+a).trim():a+"px"}function Dn(o,a){o=o.style;for(var u in a)if(a.hasOwnProperty(u)){var m=u.indexOf("--")===0,b=hn(u,a[u],m);u==="float"&&(u="cssFloat"),m?o.setProperty(u,b):o[u]=b}}var $n=M({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 Wt(o,a){if(a){if($n[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 It(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 yn=null;function Or(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Xe=null,ut=null,Me=null;function ze(o){if(o=el(o)){if(typeof Xe!="function")throw Error(n(280));var a=o.stateNode;a&&(a=Hu(a),Xe(o.stateNode,o.type,a))}}function pt(o){ut?Me?Me.push(o):Me=[o]:ut=o}function We(){if(ut){var o=ut,a=Me;if(Me=ut=null,ze(o),a)for(o=0;o<a.length;o++)ze(a[o])}}function Yt(o,a){return o(a)}function en(){}var tn=!1;function $t(o,a,u){if(tn)return o(a,u);tn=!0;try{return Yt(o,a,u)}finally{tn=!1,(ut!==null||Me!==null)&&(en(),We())}}function nn(o,a){var u=o.stateNode;if(u===null)return null;var m=Hu(u);if(m===null)return null;u=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(u&&typeof u!="function")throw Error(n(231,a,typeof u));return u}var On=!1;if(c)try{var qn={};Object.defineProperty(qn,"passive",{get:function(){On=!0}}),window.addEventListener("test",qn,qn),window.removeEventListener("test",qn,qn)}catch{On=!1}function Vr(o,a,u,m,b,w,L,$,K){var ce=Array.prototype.slice.call(arguments,3);try{a.apply(u,ce)}catch(we){this.onError(we)}}var Ye=!1,lt=null,Ze=!1,gt=null,Nt={onError:function(o){Ye=!0,lt=o}};function wt(o,a,u,m,b,w,L,$,K){Ye=!1,lt=null,Vr.apply(Nt,arguments)}function Lt(o,a,u,m,b,w,L,$,K){if(wt.apply(this,arguments),Ye){if(Ye){var ce=lt;Ye=!1,lt=null}else throw Error(n(198));Ze||(Ze=!0,gt=ce)}}function Rt(o){var a=o,u=o;if(o.alternate)for(;a.return;)a=a.return;else{o=a;do a=o,(a.flags&4098)!==0&&(u=a.return),o=a.return;while(o)}return a.tag===3?u:null}function Mt(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 gn(o){if(Rt(o)!==o)throw Error(n(188))}function Ea(o){var a=o.alternate;if(!a){if(a=Rt(o),a===null)throw Error(n(188));return a!==o?null:o}for(var u=o,m=a;;){var b=u.return;if(b===null)break;var w=b.alternate;if(w===null){if(m=b.return,m!==null){u=m;continue}break}if(b.child===w.child){for(w=b.child;w;){if(w===u)return gn(b),o;if(w===m)return gn(b),a;w=w.sibling}throw Error(n(188))}if(u.return!==m.return)u=b,m=w;else{for(var L=!1,$=b.child;$;){if($===u){L=!0,u=b,m=w;break}if($===m){L=!0,m=b,u=w;break}$=$.sibling}if(!L){for($=w.child;$;){if($===u){L=!0,u=w,m=b;break}if($===m){L=!0,m=w,u=b;break}$=$.sibling}if(!L)throw Error(n(189))}}if(u.alternate!==m)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?o:a}function pr(o){return o=Ea(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,Pt=t.unstable_cancelCallback,Ri=t.unstable_shouldYield,Ta=t.unstable_requestPaint,jt=t.unstable_now,bu=t.unstable_getCurrentPriorityLevel,Oo=t.unstable_ImmediatePriority,gp=t.unstable_UserBlockingPriority,vu=t.unstable_NormalPriority,hT=t.unstable_LowPriority,xp=t.unstable_IdlePriority,Eu=null,Qr=null;function mT(o){if(Qr&&typeof Qr.onCommitFiberRoot=="function")try{Qr.onCommitFiberRoot(Eu,o,void 0,(o.current.flags&128)===128)}catch{}}var Ar=Math.clz32?Math.clz32:gT,pT=Math.log,yT=Math.LN2;function gT(o){return o>>>=0,o===0?32:31-(pT(o)/yT|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 u=o.pendingLanes;if(u===0)return 0;var m=0,b=o.suspendedLanes,w=o.pingedLanes,L=u&268435455;if(L!==0){var $=L&~b;$!==0?m=Pi($):(w&=L,w!==0&&(m=Pi(w)))}else L=u&~b,L!==0?m=Pi(L):w!==0&&(m=Pi(w));if(m===0)return 0;if(a!==0&&a!==m&&(a&b)===0&&(b=m&-m,w=a&-a,b>=w||b===16&&(w&4194240)!==0))return a;if((m&4)!==0&&(m|=u&16),a=o.entangledLanes,a!==0)for(o=o.entanglements,a&=m;0<a;)u=31-Ar(a),b=1<<u,m|=o[u],a&=~b;return m}function xT(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 bT(o,a){for(var u=o.suspendedLanes,m=o.pingedLanes,b=o.expirationTimes,w=o.pendingLanes;0<w;){var L=31-Ar(w),$=1<<L,K=b[L];K===-1?(($&u)===0||($&m)!==0)&&(b[L]=xT($,a)):K<=a&&(o.expiredLanes|=$),w&=~$}}function Jd(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function bp(){var o=Tu;return Tu<<=1,(Tu&4194240)===0&&(Tu=64),o}function Zd(o){for(var a=[],u=0;31>u;u++)a.push(o);return a}function ji(o,a,u){o.pendingLanes|=a,a!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,a=31-Ar(a),o[a]=u}function vT(o,a){var u=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<u;){var b=31-Ar(u),w=1<<b;a[b]=0,m[b]=-1,o[b]=-1,u&=~w}}function ef(o,a){var u=o.entangledLanes|=a;for(o=o.entanglements;u;){var m=31-Ar(u),b=1<<m;b&a|o[m]&a&&(o[m]|=a),u&=~b}}var Ot=0;function vp(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var Ep,tf,Tp,wp,kp,nf=!1,Su=[],Fs=null,Bs=null,Hs=null,Fi=new Map,Bi=new Map,Us=[],ET="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 Sp(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,u,m,b,w){return o===null||o.nativeEvent!==w?(o={blockedOn:a,domEventName:u,eventSystemFlags:m,nativeEvent:w,targetContainers:[b]},a!==null&&(a=el(a),a!==null&&tf(a)),o):(o.eventSystemFlags|=m,a=o.targetContainers,b!==null&&a.indexOf(b)===-1&&a.push(b),o)}function TT(o,a,u,m,b){switch(a){case"focusin":return Fs=Hi(Fs,o,a,u,m,b),!0;case"dragenter":return Bs=Hi(Bs,o,a,u,m,b),!0;case"mouseover":return Hs=Hi(Hs,o,a,u,m,b),!0;case"pointerover":var w=b.pointerId;return Fi.set(w,Hi(Fi.get(w)||null,o,a,u,m,b)),!0;case"gotpointercapture":return w=b.pointerId,Bi.set(w,Hi(Bi.get(w)||null,o,a,u,m,b)),!0}return!1}function Cp(o){var a=Ao(o.target);if(a!==null){var u=Rt(a);if(u!==null){if(a=u.tag,a===13){if(a=Mt(u),a!==null){o.blockedOn=a,kp(o.priority,function(){Tp(u)});return}}else if(a===3&&u.stateNode.current.memoizedState.isDehydrated){o.blockedOn=u.tag===3?u.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 u=sf(o.domEventName,o.eventSystemFlags,a[0],o.nativeEvent);if(u===null){u=o.nativeEvent;var m=new u.constructor(u.type,u);yn=m,u.target.dispatchEvent(m),yn=null}else return a=el(u),a!==null&&tf(a),o.blockedOn=u,!1;a.shift()}return!0}function Np(o,a,u){Cu(o)&&u.delete(a)}function wT(){nf=!1,Fs!==null&&Cu(Fs)&&(Fs=null),Bs!==null&&Cu(Bs)&&(Bs=null),Hs!==null&&Cu(Hs)&&(Hs=null),Fi.forEach(Np),Bi.forEach(Np)}function Ui(o,a){o.blockedOn===a&&(o.blockedOn=null,nf||(nf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,wT)))}function zi(o){function a(b){return Ui(b,o)}if(0<Su.length){Ui(Su[0],o);for(var u=1;u<Su.length;u++){var m=Su[u];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),u=0;u<Us.length;u++)m=Us[u],m.blockedOn===o&&(m.blockedOn=null);for(;0<Us.length&&(u=Us[0],u.blockedOn===null);)Cp(u),u.blockedOn===null&&Us.shift()}var wa=A.ReactCurrentBatchConfig,Nu=!0;function kT(o,a,u,m){var b=Ot,w=wa.transition;wa.transition=null;try{Ot=1,rf(o,a,u,m)}finally{Ot=b,wa.transition=w}}function ST(o,a,u,m){var b=Ot,w=wa.transition;wa.transition=null;try{Ot=4,rf(o,a,u,m)}finally{Ot=b,wa.transition=w}}function rf(o,a,u,m){if(Nu){var b=sf(o,a,u,m);if(b===null)Tf(o,a,m,_u,u),Sp(o,m);else if(TT(b,o,a,u,m))m.stopPropagation();else if(Sp(o,m),a&4&&-1<ET.indexOf(o)){for(;b!==null;){var w=el(b);if(w!==null&&Ep(w),w=sf(o,a,u,m),w===null&&Tf(o,a,m,_u,u),w===b)break;b=w}b!==null&&m.stopPropagation()}else Tf(o,a,m,null,u)}}var _u=null;function sf(o,a,u,m){if(_u=null,o=Or(m),o=Ao(o),o!==null)if(a=Rt(o),a===null)o=null;else if(u=a.tag,u===13){if(o=Mt(a),o!==null)return o;o=null}else if(u===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 _p(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 gp:return 4;case vu:case hT:return 16;case xp:return 536870912;default:return 16}default:return 16}}var zs=null,of=null,Du=null;function Dp(){if(Du)return Du;var o,a=of,u=a.length,m,b="value"in zs?zs.value:zs.textContent,w=b.length;for(o=0;o<u&&a[o]===b[o];o++);var L=u-o;for(m=1;m<=L&&a[u-m]===b[w-m];m++);return Du=b.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 Op(){return!1}function ar(o){function a(u,m,b,w,L){this._reactName=u,this._targetInst=b,this.type=m,this.nativeEvent=w,this.target=L,this.currentTarget=null;for(var $ in o)o.hasOwnProperty($)&&(u=o[$],this[$]=u?u(w):w[$]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Au:Op,this.isPropagationStopped=Op,this}return M(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Au)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Au)},persist:function(){},isPersistent:Au}),a}var ka={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},af=ar(ka),Wi=M({},ka,{view:0,detail:0}),CT=ar(Wi),lf,uf,Yi,Iu=M({},Wi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:df,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"?(lf=o.screenX-Yi.screenX,uf=o.screenY-Yi.screenY):uf=lf=0,Yi=o),lf)},movementY:function(o){return"movementY"in o?o.movementY:uf}}),Ap=ar(Iu),NT=M({},Iu,{dataTransfer:0}),_T=ar(NT),DT=M({},Wi,{relatedTarget:0}),cf=ar(DT),OT=M({},ka,{animationName:0,elapsedTime:0,pseudoElement:0}),AT=ar(OT),IT=M({},ka,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),MT=ar(IT),LT=M({},ka,{data:0}),Ip=ar(LT),RT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},PT={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"},jT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function FT(o){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(o):(o=jT[o])?!!a[o]:!1}function df(){return FT}var BT=M({},Wi,{key:function(o){if(o.key){var a=RT[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"?PT[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:df,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}}),HT=ar(BT),UT=M({},Iu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mp=ar(UT),zT=M({},Wi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:df}),WT=ar(zT),YT=M({},ka,{propertyName:0,elapsedTime:0,pseudoElement:0}),$T=ar(YT),qT=M({},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}),VT=ar(qT),QT=[9,13,27,32],ff=c&&"CompositionEvent"in window,$i=null;c&&"documentMode"in document&&($i=document.documentMode);var GT=c&&"TextEvent"in window&&!$i,Lp=c&&(!ff||$i&&8<$i&&11>=$i),Rp=" ",Pp=!1;function jp(o,a){switch(o){case"keyup":return QT.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fp(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Sa=!1;function KT(o,a){switch(o){case"compositionend":return Fp(a);case"keypress":return a.which!==32?null:(Pp=!0,Rp);case"textInput":return o=a.data,o===Rp&&Pp?null:o;default:return null}}function XT(o,a){if(Sa)return o==="compositionend"||!ff&&jp(o,a)?(o=Dp(),Du=of=zs=null,Sa=!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 Lp&&a.locale!=="ko"?null:a.data;default:return null}}var JT={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 Bp(o){var a=o&&o.nodeName&&o.nodeName.toLowerCase();return a==="input"?!!JT[o.type]:a==="textarea"}function Hp(o,a,u,m){pt(m),a=ju(a,"onChange"),0<a.length&&(u=new af("onChange","change",null,u,m),o.push({event:u,listeners:a}))}var qi=null,Vi=null;function ZT(o){sy(o,0)}function Mu(o){var a=Oa(o);if(Pe(a))return o}function ew(o,a){if(o==="change")return a}var Up=!1;if(c){var hf;if(c){var mf="oninput"in document;if(!mf){var zp=document.createElement("div");zp.setAttribute("oninput","return;"),mf=typeof zp.oninput=="function"}hf=mf}else hf=!1;Up=hf&&(!document.documentMode||9<document.documentMode)}function Wp(){qi&&(qi.detachEvent("onpropertychange",Yp),Vi=qi=null)}function Yp(o){if(o.propertyName==="value"&&Mu(Vi)){var a=[];Hp(a,Vi,o,Or(o)),$t(ZT,a)}}function tw(o,a,u){o==="focusin"?(Wp(),qi=a,Vi=u,qi.attachEvent("onpropertychange",Yp)):o==="focusout"&&Wp()}function nw(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Mu(Vi)}function rw(o,a){if(o==="click")return Mu(a)}function sw(o,a){if(o==="input"||o==="change")return Mu(a)}function ow(o,a){return o===a&&(o!==0||1/o===1/a)||o!==o&&a!==a}var Ir=typeof Object.is=="function"?Object.is:ow;function Qi(o,a){if(Ir(o,a))return!0;if(typeof o!="object"||o===null||typeof a!="object"||a===null)return!1;var u=Object.keys(o),m=Object.keys(a);if(u.length!==m.length)return!1;for(m=0;m<u.length;m++){var b=u[m];if(!f.call(a,b)||!Ir(o[b],a[b]))return!1}return!0}function $p(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function qp(o,a){var u=$p(o);o=0;for(var m;u;){if(u.nodeType===3){if(m=o+u.textContent.length,o<=a&&m>=a)return{node:u,offset:a-o};o=m}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=$p(u)}}function Vp(o,a){return o&&a?o===a?!0:o&&o.nodeType===3?!1:a&&a.nodeType===3?Vp(o,a.parentNode):"contains"in o?o.contains(a):o.compareDocumentPosition?!!(o.compareDocumentPosition(a)&16):!1:!1}function Qp(){for(var o=window,a=Ue();a instanceof o.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)o=a.contentWindow;else break;a=Ue(o.document)}return a}function pf(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 aw(o){var a=Qp(),u=o.focusedElem,m=o.selectionRange;if(a!==u&&u&&u.ownerDocument&&Vp(u.ownerDocument.documentElement,u)){if(m!==null&&pf(u)){if(a=m.start,o=m.end,o===void 0&&(o=a),"selectionStart"in u)u.selectionStart=a,u.selectionEnd=Math.min(o,u.value.length);else if(o=(a=u.ownerDocument||document)&&a.defaultView||window,o.getSelection){o=o.getSelection();var b=u.textContent.length,w=Math.min(m.start,b);m=m.end===void 0?w:Math.min(m.end,b),!o.extend&&w>m&&(b=m,m=w,w=b),b=qp(u,w);var L=qp(u,m);b&&L&&(o.rangeCount!==1||o.anchorNode!==b.node||o.anchorOffset!==b.offset||o.focusNode!==L.node||o.focusOffset!==L.offset)&&(a=a.createRange(),a.setStart(b.node,b.offset),o.removeAllRanges(),w>m?(o.addRange(a),o.extend(L.node,L.offset)):(a.setEnd(L.node,L.offset),o.addRange(a)))}}for(a=[],o=u;o=o.parentNode;)o.nodeType===1&&a.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<a.length;u++)o=a[u],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var iw=c&&"documentMode"in document&&11>=document.documentMode,Ca=null,yf=null,Gi=null,gf=!1;function Gp(o,a,u){var m=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;gf||Ca==null||Ca!==Ue(m)||(m=Ca,"selectionStart"in m&&pf(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(yf,"onSelect"),0<m.length&&(a=new af("onSelect","select",null,a,u),o.push({event:a,listeners:m}),a.target=Ca)))}function Lu(o,a){var u={};return u[o.toLowerCase()]=a.toLowerCase(),u["Webkit"+o]="webkit"+a,u["Moz"+o]="moz"+a,u}var Na={animationend:Lu("Animation","AnimationEnd"),animationiteration:Lu("Animation","AnimationIteration"),animationstart:Lu("Animation","AnimationStart"),transitionend:Lu("Transition","TransitionEnd")},xf={},Kp={};c&&(Kp=document.createElement("div").style,"AnimationEvent"in window||(delete Na.animationend.animation,delete Na.animationiteration.animation,delete Na.animationstart.animation),"TransitionEvent"in window||delete Na.transitionend.transition);function Ru(o){if(xf[o])return xf[o];if(!Na[o])return o;var a=Na[o],u;for(u in a)if(a.hasOwnProperty(u)&&u in Kp)return xf[o]=a[u];return o}var Xp=Ru("animationend"),Jp=Ru("animationiteration"),Zp=Ru("animationstart"),ey=Ru("transitionend"),ty=new Map,ny="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){ty.set(o,a),i(a,[o])}for(var bf=0;bf<ny.length;bf++){var vf=ny[bf],lw=vf.toLowerCase(),uw=vf[0].toUpperCase()+vf.slice(1);Ws(lw,"on"+uw)}Ws(Xp,"onAnimationEnd"),Ws(Jp,"onAnimationIteration"),Ws(Zp,"onAnimationStart"),Ws("dblclick","onDoubleClick"),Ws("focusin","onFocus"),Ws("focusout","onBlur"),Ws(ey,"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(" "),cw=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ki));function ry(o,a,u){var m=o.type||"unknown-event";o.currentTarget=u,Lt(m,a,void 0,o),o.currentTarget=null}function sy(o,a){a=(a&4)!==0;for(var u=0;u<o.length;u++){var m=o[u],b=m.event;m=m.listeners;e:{var w=void 0;if(a)for(var L=m.length-1;0<=L;L--){var $=m[L],K=$.instance,ce=$.currentTarget;if($=$.listener,K!==w&&b.isPropagationStopped())break e;ry(b,$,ce),w=K}else for(L=0;L<m.length;L++){if($=m[L],K=$.instance,ce=$.currentTarget,$=$.listener,K!==w&&b.isPropagationStopped())break e;ry(b,$,ce),w=K}}}if(Ze)throw o=gt,Ze=!1,gt=null,o}function Ut(o,a){var u=a[_f];u===void 0&&(u=a[_f]=new Set);var m=o+"__bubble";u.has(m)||(oy(a,o,2,!1),u.add(m))}function Ef(o,a,u){var m=0;a&&(m|=4),oy(u,o,m,a)}var Pu="_reactListening"+Math.random().toString(36).slice(2);function Xi(o){if(!o[Pu]){o[Pu]=!0,r.forEach(function(u){u!=="selectionchange"&&(cw.has(u)||Ef(u,!1,o),Ef(u,!0,o))});var a=o.nodeType===9?o:o.ownerDocument;a===null||a[Pu]||(a[Pu]=!0,Ef("selectionchange",!1,a))}}function oy(o,a,u,m){switch(_p(a)){case 1:var b=kT;break;case 4:b=ST;break;default:b=rf}u=b.bind(null,a,u,o),b=void 0,!On||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(b=!0),m?b!==void 0?o.addEventListener(a,u,{capture:!0,passive:b}):o.addEventListener(a,u,!0):b!==void 0?o.addEventListener(a,u,{passive:b}):o.addEventListener(a,u,!1)}function Tf(o,a,u,m,b){var w=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 $=m.stateNode.containerInfo;if($===b||$.nodeType===8&&$.parentNode===b)break;if(L===4)for(L=m.return;L!==null;){var K=L.tag;if((K===3||K===4)&&(K=L.stateNode.containerInfo,K===b||K.nodeType===8&&K.parentNode===b))return;L=L.return}for(;$!==null;){if(L=Ao($),L===null)return;if(K=L.tag,K===5||K===6){m=w=L;continue e}$=$.parentNode}}m=m.return}$t(function(){var ce=w,we=Or(u),Se=[];e:{var Ee=ty.get(o);if(Ee!==void 0){var je=af,qe=o;switch(o){case"keypress":if(Ou(u)===0)break e;case"keydown":case"keyup":je=HT;break;case"focusin":qe="focus",je=cf;break;case"focusout":qe="blur",je=cf;break;case"beforeblur":case"afterblur":je=cf;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":je=Ap;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":je=_T;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":je=WT;break;case Xp:case Jp:case Zp:je=AT;break;case ey:je=$T;break;case"scroll":je=CT;break;case"wheel":je=VT;break;case"copy":case"cut":case"paste":je=MT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":je=Mp}var Ve=(a&4)!==0,ln=!Ve&&o==="scroll",ne=Ve?Ee!==null?Ee+"Capture":null:Ee;Ve=[];for(var X=ce,oe;X!==null;){oe=X;var Ae=oe.stateNode;if(oe.tag===5&&Ae!==null&&(oe=Ae,ne!==null&&(Ae=nn(X,ne),Ae!=null&&Ve.push(Ji(X,Ae,oe)))),ln)break;X=X.return}0<Ve.length&&(Ee=new je(Ee,qe,null,u,we),Se.push({event:Ee,listeners:Ve}))}}if((a&7)===0){e:{if(Ee=o==="mouseover"||o==="pointerover",je=o==="mouseout"||o==="pointerout",Ee&&u!==yn&&(qe=u.relatedTarget||u.fromElement)&&(Ao(qe)||qe[hs]))break e;if((je||Ee)&&(Ee=we.window===we?we:(Ee=we.ownerDocument)?Ee.defaultView||Ee.parentWindow:window,je?(qe=u.relatedTarget||u.toElement,je=ce,qe=qe?Ao(qe):null,qe!==null&&(ln=Rt(qe),qe!==ln||qe.tag!==5&&qe.tag!==6)&&(qe=null)):(je=null,qe=ce),je!==qe)){if(Ve=Ap,Ae="onMouseLeave",ne="onMouseEnter",X="mouse",(o==="pointerout"||o==="pointerover")&&(Ve=Mp,Ae="onPointerLeave",ne="onPointerEnter",X="pointer"),ln=je==null?Ee:Oa(je),oe=qe==null?Ee:Oa(qe),Ee=new Ve(Ae,X+"leave",je,u,we),Ee.target=ln,Ee.relatedTarget=oe,Ae=null,Ao(we)===ce&&(Ve=new Ve(ne,X+"enter",qe,u,we),Ve.target=oe,Ve.relatedTarget=ln,Ae=Ve),ln=Ae,je&&qe)t:{for(Ve=je,ne=qe,X=0,oe=Ve;oe;oe=_a(oe))X++;for(oe=0,Ae=ne;Ae;Ae=_a(Ae))oe++;for(;0<X-oe;)Ve=_a(Ve),X--;for(;0<oe-X;)ne=_a(ne),oe--;for(;X--;){if(Ve===ne||ne!==null&&Ve===ne.alternate)break t;Ve=_a(Ve),ne=_a(ne)}Ve=null}else Ve=null;je!==null&&ay(Se,Ee,je,Ve,!1),qe!==null&&ln!==null&&ay(Se,ln,qe,Ve,!0)}}e:{if(Ee=ce?Oa(ce):window,je=Ee.nodeName&&Ee.nodeName.toLowerCase(),je==="select"||je==="input"&&Ee.type==="file")var Qe=ew;else if(Bp(Ee))if(Up)Qe=sw;else{Qe=nw;var tt=tw}else(je=Ee.nodeName)&&je.toLowerCase()==="input"&&(Ee.type==="checkbox"||Ee.type==="radio")&&(Qe=rw);if(Qe&&(Qe=Qe(o,ce))){Hp(Se,Qe,u,we);break e}tt&&tt(o,Ee,ce),o==="focusout"&&(tt=Ee._wrapperState)&&tt.controlled&&Ee.type==="number"&&J(Ee,"number",Ee.value)}switch(tt=ce?Oa(ce):window,o){case"focusin":(Bp(tt)||tt.contentEditable==="true")&&(Ca=tt,yf=ce,Gi=null);break;case"focusout":Gi=yf=Ca=null;break;case"mousedown":gf=!0;break;case"contextmenu":case"mouseup":case"dragend":gf=!1,Gp(Se,u,we);break;case"selectionchange":if(iw)break;case"keydown":case"keyup":Gp(Se,u,we)}var nt;if(ff)e:{switch(o){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else Sa?jp(o,u)&&(at="onCompositionEnd"):o==="keydown"&&u.keyCode===229&&(at="onCompositionStart");at&&(Lp&&u.locale!=="ko"&&(Sa||at!=="onCompositionStart"?at==="onCompositionEnd"&&Sa&&(nt=Dp()):(zs=we,of="value"in zs?zs.value:zs.textContent,Sa=!0)),tt=ju(ce,at),0<tt.length&&(at=new Ip(at,o,null,u,we),Se.push({event:at,listeners:tt}),nt?at.data=nt:(nt=Fp(u),nt!==null&&(at.data=nt)))),(nt=GT?KT(o,u):XT(o,u))&&(ce=ju(ce,"onBeforeInput"),0<ce.length&&(we=new Ip("onBeforeInput","beforeinput",null,u,we),Se.push({event:we,listeners:ce}),we.data=nt))}sy(Se,a)})}function Ji(o,a,u){return{instance:o,listener:a,currentTarget:u}}function ju(o,a){for(var u=a+"Capture",m=[];o!==null;){var b=o,w=b.stateNode;b.tag===5&&w!==null&&(b=w,w=nn(o,u),w!=null&&m.unshift(Ji(o,w,b)),w=nn(o,a),w!=null&&m.push(Ji(o,w,b))),o=o.return}return m}function _a(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function ay(o,a,u,m,b){for(var w=a._reactName,L=[];u!==null&&u!==m;){var $=u,K=$.alternate,ce=$.stateNode;if(K!==null&&K===m)break;$.tag===5&&ce!==null&&($=ce,b?(K=nn(u,w),K!=null&&L.unshift(Ji(u,K,$))):b||(K=nn(u,w),K!=null&&L.push(Ji(u,K,$)))),u=u.return}L.length!==0&&o.push({event:a,listeners:L})}var dw=/\r\n?/g,fw=/\u0000|\uFFFD/g;function iy(o){return(typeof o=="string"?o:""+o).replace(dw,`
|
|
31
|
-
`).replace(fw,"")}function Fu(o,a,u){if(a=iy(a),iy(o)!==a&&u)throw Error(n(425))}function Bu(){}var wf=null,kf=null;function Sf(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 Cf=typeof setTimeout=="function"?setTimeout:void 0,hw=typeof clearTimeout=="function"?clearTimeout:void 0,ly=typeof Promise=="function"?Promise:void 0,mw=typeof queueMicrotask=="function"?queueMicrotask:typeof ly<"u"?function(o){return ly.resolve(null).then(o).catch(pw)}:Cf;function pw(o){setTimeout(function(){throw o})}function Nf(o,a){var u=a,m=0;do{var b=u.nextSibling;if(o.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"){if(m===0){o.removeChild(b),zi(a);return}m--}else u!=="$"&&u!=="$?"&&u!=="$!"||m++;u=b}while(u);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 uy(o){o=o.previousSibling;for(var a=0;o;){if(o.nodeType===8){var u=o.data;if(u==="$"||u==="$!"||u==="$?"){if(a===0)return o;a--}else u==="/$"&&a++}o=o.previousSibling}return null}var Da=Math.random().toString(36).slice(2),Gr="__reactFiber$"+Da,Zi="__reactProps$"+Da,hs="__reactContainer$"+Da,_f="__reactEvents$"+Da,yw="__reactListeners$"+Da,gw="__reactHandles$"+Da;function Ao(o){var a=o[Gr];if(a)return a;for(var u=o.parentNode;u;){if(a=u[hs]||u[Gr]){if(u=a.alternate,a.child!==null||u!==null&&u.child!==null)for(o=uy(o);o!==null;){if(u=o[Gr])return u;o=uy(o)}return a}o=u,u=o.parentNode}return null}function el(o){return o=o[Gr]||o[hs],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function Oa(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function Hu(o){return o[Zi]||null}var Df=[],Aa=-1;function $s(o){return{current:o}}function zt(o){0>Aa||(o.current=Df[Aa],Df[Aa]=null,Aa--)}function Ft(o,a){Aa++,Df[Aa]=o.current,o.current=a}var qs={},An=$s(qs),Vn=$s(!1),Io=qs;function Ia(o,a){var u=o.type.contextTypes;if(!u)return qs;var m=o.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===a)return m.__reactInternalMemoizedMaskedChildContext;var b={},w;for(w in u)b[w]=a[w];return m&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=a,o.__reactInternalMemoizedMaskedChildContext=b),b}function Qn(o){return o=o.childContextTypes,o!=null}function Uu(){zt(Vn),zt(An)}function cy(o,a,u){if(An.current!==qs)throw Error(n(168));Ft(An,a),Ft(Vn,u)}function dy(o,a,u){var m=o.stateNode;if(a=a.childContextTypes,typeof m.getChildContext!="function")return u;m=m.getChildContext();for(var b in m)if(!(b in a))throw Error(n(108,Oe(o)||"Unknown",b));return M({},u,m)}function zu(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||qs,Io=An.current,Ft(An,o),Ft(Vn,Vn.current),!0}function fy(o,a,u){var m=o.stateNode;if(!m)throw Error(n(169));u?(o=dy(o,a,Io),m.__reactInternalMemoizedMergedChildContext=o,zt(Vn),zt(An),Ft(An,o)):zt(Vn),Ft(Vn,u)}var ms=null,Wu=!1,Of=!1;function hy(o){ms===null?ms=[o]:ms.push(o)}function xw(o){Wu=!0,hy(o)}function Vs(){if(!Of&&ms!==null){Of=!0;var o=0,a=Ot;try{var u=ms;for(Ot=1;o<u.length;o++){var m=u[o];do m=m(!0);while(m!==null)}ms=null,Wu=!1}catch(b){throw ms!==null&&(ms=ms.slice(o+1)),Do(Oo,Vs),b}finally{Ot=a,Of=!1}}return null}var Ma=[],La=0,Yu=null,$u=0,yr=[],gr=0,Mo=null,ps=1,ys="";function Lo(o,a){Ma[La++]=$u,Ma[La++]=Yu,Yu=o,$u=a}function my(o,a,u){yr[gr++]=ps,yr[gr++]=ys,yr[gr++]=Mo,Mo=o;var m=ps;o=ys;var b=32-Ar(m)-1;m&=~(1<<b),u+=1;var w=32-Ar(a)+b;if(30<w){var L=b-b%5;w=(m&(1<<L)-1).toString(32),m>>=L,b-=L,ps=1<<32-Ar(a)+b|u<<b|m,ys=w+o}else ps=1<<w|u<<b|m,ys=o}function Af(o){o.return!==null&&(Lo(o,1),my(o,1,0))}function If(o){for(;o===Yu;)Yu=Ma[--La],Ma[La]=null,$u=Ma[--La],Ma[La]=null;for(;o===Mo;)Mo=yr[--gr],yr[gr]=null,ys=yr[--gr],yr[gr]=null,ps=yr[--gr],yr[gr]=null}var ir=null,lr=null,qt=!1,Mr=null;function py(o,a){var u=Er(5,null,null,0);u.elementType="DELETED",u.stateNode=a,u.return=o,a=o.deletions,a===null?(o.deletions=[u],o.flags|=16):a.push(u)}function yy(o,a){switch(o.tag){case 5:var u=o.type;return a=a.nodeType!==1||u.toLowerCase()!==a.nodeName.toLowerCase()?null:a,a!==null?(o.stateNode=a,ir=o,lr=Ys(a.firstChild),!0):!1;case 6:return a=o.pendingProps===""||a.nodeType!==3?null:a,a!==null?(o.stateNode=a,ir=o,lr=null,!0):!1;case 13:return a=a.nodeType!==8?null:a,a!==null?(u=Mo!==null?{id:ps,overflow:ys}:null,o.memoizedState={dehydrated:a,treeContext:u,retryLane:1073741824},u=Er(18,null,null,0),u.stateNode=a,u.return=o,o.child=u,ir=o,lr=null,!0):!1;default:return!1}}function Mf(o){return(o.mode&1)!==0&&(o.flags&128)===0}function Lf(o){if(qt){var a=lr;if(a){var u=a;if(!yy(o,a)){if(Mf(o))throw Error(n(418));a=Ys(u.nextSibling);var m=ir;a&&yy(o,a)?py(m,u):(o.flags=o.flags&-4097|2,qt=!1,ir=o)}}else{if(Mf(o))throw Error(n(418));o.flags=o.flags&-4097|2,qt=!1,ir=o}}}function gy(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;ir=o}function qu(o){if(o!==ir)return!1;if(!qt)return gy(o),qt=!0,!1;var a;if((a=o.tag!==3)&&!(a=o.tag!==5)&&(a=o.type,a=a!=="head"&&a!=="body"&&!Sf(o.type,o.memoizedProps)),a&&(a=lr)){if(Mf(o))throw xy(),Error(n(418));for(;a;)py(o,a),a=Ys(a.nextSibling)}if(gy(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 u=o.data;if(u==="/$"){if(a===0){lr=Ys(o.nextSibling);break e}a--}else u!=="$"&&u!=="$!"&&u!=="$?"||a++}o=o.nextSibling}lr=null}}else lr=ir?Ys(o.stateNode.nextSibling):null;return!0}function xy(){for(var o=lr;o;)o=Ys(o.nextSibling)}function Ra(){lr=ir=null,qt=!1}function Rf(o){Mr===null?Mr=[o]:Mr.push(o)}var bw=A.ReactCurrentBatchConfig;function tl(o,a,u){if(o=u.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var m=u.stateNode}if(!m)throw Error(n(147,o));var b=m,w=""+o;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===w?a.ref:(a=function(L){var $=b.refs;L===null?delete $[w]:$[w]=L},a._stringRef=w,a)}if(typeof o!="string")throw Error(n(284));if(!u._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 by(o){var a=o._init;return a(o._payload)}function vy(o){function a(ne,X){if(o){var oe=ne.deletions;oe===null?(ne.deletions=[X],ne.flags|=16):oe.push(X)}}function u(ne,X){if(!o)return null;for(;X!==null;)a(ne,X),X=X.sibling;return null}function m(ne,X){for(ne=new Map;X!==null;)X.key!==null?ne.set(X.key,X):ne.set(X.index,X),X=X.sibling;return ne}function b(ne,X){return ne=to(ne,X),ne.index=0,ne.sibling=null,ne}function w(ne,X,oe){return ne.index=oe,o?(oe=ne.alternate,oe!==null?(oe=oe.index,oe<X?(ne.flags|=2,X):oe):(ne.flags|=2,X)):(ne.flags|=1048576,X)}function L(ne){return o&&ne.alternate===null&&(ne.flags|=2),ne}function $(ne,X,oe,Ae){return X===null||X.tag!==6?(X=Ch(oe,ne.mode,Ae),X.return=ne,X):(X=b(X,oe),X.return=ne,X)}function K(ne,X,oe,Ae){var Qe=oe.type;return Qe===I?we(ne,X,oe.props.children,Ae,oe.key):X!==null&&(X.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===ee&&by(Qe)===X.type)?(Ae=b(X,oe.props),Ae.ref=tl(ne,X,oe),Ae.return=ne,Ae):(Ae=gc(oe.type,oe.key,oe.props,null,ne.mode,Ae),Ae.ref=tl(ne,X,oe),Ae.return=ne,Ae)}function ce(ne,X,oe,Ae){return X===null||X.tag!==4||X.stateNode.containerInfo!==oe.containerInfo||X.stateNode.implementation!==oe.implementation?(X=Nh(oe,ne.mode,Ae),X.return=ne,X):(X=b(X,oe.children||[]),X.return=ne,X)}function we(ne,X,oe,Ae,Qe){return X===null||X.tag!==7?(X=zo(oe,ne.mode,Ae,Qe),X.return=ne,X):(X=b(X,oe),X.return=ne,X)}function Se(ne,X,oe){if(typeof X=="string"&&X!==""||typeof X=="number")return X=Ch(""+X,ne.mode,oe),X.return=ne,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case R:return oe=gc(X.type,X.key,X.props,null,ne.mode,oe),oe.ref=tl(ne,null,X),oe.return=ne,oe;case S:return X=Nh(X,ne.mode,oe),X.return=ne,X;case ee:var Ae=X._init;return Se(ne,Ae(X._payload),oe)}if(Z(X)||ue(X))return X=zo(X,ne.mode,oe,null),X.return=ne,X;Vu(ne,X)}return null}function Ee(ne,X,oe,Ae){var Qe=X!==null?X.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number")return Qe!==null?null:$(ne,X,""+oe,Ae);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case R:return oe.key===Qe?K(ne,X,oe,Ae):null;case S:return oe.key===Qe?ce(ne,X,oe,Ae):null;case ee:return Qe=oe._init,Ee(ne,X,Qe(oe._payload),Ae)}if(Z(oe)||ue(oe))return Qe!==null?null:we(ne,X,oe,Ae,null);Vu(ne,oe)}return null}function je(ne,X,oe,Ae,Qe){if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number")return ne=ne.get(oe)||null,$(X,ne,""+Ae,Qe);if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case R:return ne=ne.get(Ae.key===null?oe:Ae.key)||null,K(X,ne,Ae,Qe);case S:return ne=ne.get(Ae.key===null?oe:Ae.key)||null,ce(X,ne,Ae,Qe);case ee:var tt=Ae._init;return je(ne,X,oe,tt(Ae._payload),Qe)}if(Z(Ae)||ue(Ae))return ne=ne.get(oe)||null,we(X,ne,Ae,Qe,null);Vu(X,Ae)}return null}function qe(ne,X,oe,Ae){for(var Qe=null,tt=null,nt=X,at=X=0,Tn=null;nt!==null&&at<oe.length;at++){nt.index>at?(Tn=nt,nt=null):Tn=nt.sibling;var kt=Ee(ne,nt,oe[at],Ae);if(kt===null){nt===null&&(nt=Tn);break}o&&nt&&kt.alternate===null&&a(ne,nt),X=w(kt,X,at),tt===null?Qe=kt:tt.sibling=kt,tt=kt,nt=Tn}if(at===oe.length)return u(ne,nt),qt&&Lo(ne,at),Qe;if(nt===null){for(;at<oe.length;at++)nt=Se(ne,oe[at],Ae),nt!==null&&(X=w(nt,X,at),tt===null?Qe=nt:tt.sibling=nt,tt=nt);return qt&&Lo(ne,at),Qe}for(nt=m(ne,nt);at<oe.length;at++)Tn=je(nt,ne,at,oe[at],Ae),Tn!==null&&(o&&Tn.alternate!==null&&nt.delete(Tn.key===null?at:Tn.key),X=w(Tn,X,at),tt===null?Qe=Tn:tt.sibling=Tn,tt=Tn);return o&&nt.forEach(function(no){return a(ne,no)}),qt&&Lo(ne,at),Qe}function Ve(ne,X,oe,Ae){var Qe=ue(oe);if(typeof Qe!="function")throw Error(n(150));if(oe=Qe.call(oe),oe==null)throw Error(n(151));for(var tt=Qe=null,nt=X,at=X=0,Tn=null,kt=oe.next();nt!==null&&!kt.done;at++,kt=oe.next()){nt.index>at?(Tn=nt,nt=null):Tn=nt.sibling;var no=Ee(ne,nt,kt.value,Ae);if(no===null){nt===null&&(nt=Tn);break}o&&nt&&no.alternate===null&&a(ne,nt),X=w(no,X,at),tt===null?Qe=no:tt.sibling=no,tt=no,nt=Tn}if(kt.done)return u(ne,nt),qt&&Lo(ne,at),Qe;if(nt===null){for(;!kt.done;at++,kt=oe.next())kt=Se(ne,kt.value,Ae),kt!==null&&(X=w(kt,X,at),tt===null?Qe=kt:tt.sibling=kt,tt=kt);return qt&&Lo(ne,at),Qe}for(nt=m(ne,nt);!kt.done;at++,kt=oe.next())kt=je(nt,ne,at,kt.value,Ae),kt!==null&&(o&&kt.alternate!==null&&nt.delete(kt.key===null?at:kt.key),X=w(kt,X,at),tt===null?Qe=kt:tt.sibling=kt,tt=kt);return o&&nt.forEach(function(Jw){return a(ne,Jw)}),qt&&Lo(ne,at),Qe}function ln(ne,X,oe,Ae){if(typeof oe=="object"&&oe!==null&&oe.type===I&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case R:e:{for(var Qe=oe.key,tt=X;tt!==null;){if(tt.key===Qe){if(Qe=oe.type,Qe===I){if(tt.tag===7){u(ne,tt.sibling),X=b(tt,oe.props.children),X.return=ne,ne=X;break e}}else if(tt.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===ee&&by(Qe)===tt.type){u(ne,tt.sibling),X=b(tt,oe.props),X.ref=tl(ne,tt,oe),X.return=ne,ne=X;break e}u(ne,tt);break}else a(ne,tt);tt=tt.sibling}oe.type===I?(X=zo(oe.props.children,ne.mode,Ae,oe.key),X.return=ne,ne=X):(Ae=gc(oe.type,oe.key,oe.props,null,ne.mode,Ae),Ae.ref=tl(ne,X,oe),Ae.return=ne,ne=Ae)}return L(ne);case S:e:{for(tt=oe.key;X!==null;){if(X.key===tt)if(X.tag===4&&X.stateNode.containerInfo===oe.containerInfo&&X.stateNode.implementation===oe.implementation){u(ne,X.sibling),X=b(X,oe.children||[]),X.return=ne,ne=X;break e}else{u(ne,X);break}else a(ne,X);X=X.sibling}X=Nh(oe,ne.mode,Ae),X.return=ne,ne=X}return L(ne);case ee:return tt=oe._init,ln(ne,X,tt(oe._payload),Ae)}if(Z(oe))return qe(ne,X,oe,Ae);if(ue(oe))return Ve(ne,X,oe,Ae);Vu(ne,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"?(oe=""+oe,X!==null&&X.tag===6?(u(ne,X.sibling),X=b(X,oe),X.return=ne,ne=X):(u(ne,X),X=Ch(oe,ne.mode,Ae),X.return=ne,ne=X),L(ne)):u(ne,X)}return ln}var Pa=vy(!0),Ey=vy(!1),Qu=$s(null),Gu=null,ja=null,Pf=null;function jf(){Pf=ja=Gu=null}function Ff(o){var a=Qu.current;zt(Qu),o._currentValue=a}function Bf(o,a,u){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===u)break;o=o.return}}function Fa(o,a){Gu=o,Pf=ja=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&a)!==0&&(Gn=!0),o.firstContext=null)}function xr(o){var a=o._currentValue;if(Pf!==o)if(o={context:o,memoizedValue:a,next:null},ja===null){if(Gu===null)throw Error(n(308));ja=o,Gu.dependencies={lanes:0,firstContext:o}}else ja=ja.next=o;return a}var Ro=null;function Hf(o){Ro===null?Ro=[o]:Ro.push(o)}function Ty(o,a,u,m){var b=a.interleaved;return b===null?(u.next=u,Hf(a)):(u.next=b.next,b.next=u),a.interleaved=u,gs(o,m)}function gs(o,a){o.lanes|=a;var u=o.alternate;for(u!==null&&(u.lanes|=a),u=o,o=o.return;o!==null;)o.childLanes|=a,u=o.alternate,u!==null&&(u.childLanes|=a),u=o,o=o.return;return u.tag===3?u.stateNode:null}var Qs=!1;function Uf(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function wy(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 xs(o,a){return{eventTime:o,lane:a,tag:0,payload:null,callback:null,next:null}}function Gs(o,a,u){var m=o.updateQueue;if(m===null)return null;if(m=m.shared,(Et&2)!==0){var b=m.pending;return b===null?a.next=a:(a.next=b.next,b.next=a),m.pending=a,gs(o,u)}return b=m.interleaved,b===null?(a.next=a,Hf(m)):(a.next=b.next,b.next=a),m.interleaved=a,gs(o,u)}function Ku(o,a,u){if(a=a.updateQueue,a!==null&&(a=a.shared,(u&4194240)!==0)){var m=a.lanes;m&=o.pendingLanes,u|=m,a.lanes=u,ef(o,u)}}function ky(o,a){var u=o.updateQueue,m=o.alternate;if(m!==null&&(m=m.updateQueue,u===m)){var b=null,w=null;if(u=u.firstBaseUpdate,u!==null){do{var L={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};w===null?b=w=L:w=w.next=L,u=u.next}while(u!==null);w===null?b=w=a:w=w.next=a}else b=w=a;u={baseState:m.baseState,firstBaseUpdate:b,lastBaseUpdate:w,shared:m.shared,effects:m.effects},o.updateQueue=u;return}o=u.lastBaseUpdate,o===null?u.firstBaseUpdate=a:o.next=a,u.lastBaseUpdate=a}function Xu(o,a,u,m){var b=o.updateQueue;Qs=!1;var w=b.firstBaseUpdate,L=b.lastBaseUpdate,$=b.shared.pending;if($!==null){b.shared.pending=null;var K=$,ce=K.next;K.next=null,L===null?w=ce:L.next=ce,L=K;var we=o.alternate;we!==null&&(we=we.updateQueue,$=we.lastBaseUpdate,$!==L&&($===null?we.firstBaseUpdate=ce:$.next=ce,we.lastBaseUpdate=K))}if(w!==null){var Se=b.baseState;L=0,we=ce=K=null,$=w;do{var Ee=$.lane,je=$.eventTime;if((m&Ee)===Ee){we!==null&&(we=we.next={eventTime:je,lane:0,tag:$.tag,payload:$.payload,callback:$.callback,next:null});e:{var qe=o,Ve=$;switch(Ee=a,je=u,Ve.tag){case 1:if(qe=Ve.payload,typeof qe=="function"){Se=qe.call(je,Se,Ee);break e}Se=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=Ve.payload,Ee=typeof qe=="function"?qe.call(je,Se,Ee):qe,Ee==null)break e;Se=M({},Se,Ee);break e;case 2:Qs=!0}}$.callback!==null&&$.lane!==0&&(o.flags|=64,Ee=b.effects,Ee===null?b.effects=[$]:Ee.push($))}else je={eventTime:je,lane:Ee,tag:$.tag,payload:$.payload,callback:$.callback,next:null},we===null?(ce=we=je,K=Se):we=we.next=je,L|=Ee;if($=$.next,$===null){if($=b.shared.pending,$===null)break;Ee=$,$=Ee.next,Ee.next=null,b.lastBaseUpdate=Ee,b.shared.pending=null}}while(!0);if(we===null&&(K=Se),b.baseState=K,b.firstBaseUpdate=ce,b.lastBaseUpdate=we,a=b.shared.interleaved,a!==null){b=a;do L|=b.lane,b=b.next;while(b!==a)}else w===null&&(b.shared.lanes=0);Fo|=L,o.lanes=L,o.memoizedState=Se}}function Sy(o,a,u){if(o=a.effects,a.effects=null,o!==null)for(a=0;a<o.length;a++){var m=o[a],b=m.callback;if(b!==null){if(m.callback=null,m=u,typeof b!="function")throw Error(n(191,b));b.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 zf(o,a){switch(Ft(sl,a),Ft(rl,o),Ft(Kr,nl),o=a.nodeType,o){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:ve(null,"");break;default:o=o===8?a.parentNode:a,a=o.namespaceURI||null,o=o.tagName,a=ve(a,o)}zt(Kr),Ft(Kr,a)}function Ba(){zt(Kr),zt(rl),zt(sl)}function Cy(o){Po(sl.current);var a=Po(Kr.current),u=ve(a,o.type);a!==u&&(Ft(rl,o),Ft(Kr,u))}function Wf(o){rl.current===o&&(zt(Kr),zt(rl))}var Qt=$s(0);function Ju(o){for(var a=o;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.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 Yf=[];function $f(){for(var o=0;o<Yf.length;o++)Yf[o]._workInProgressVersionPrimary=null;Yf.length=0}var Zu=A.ReactCurrentDispatcher,qf=A.ReactCurrentBatchConfig,jo=0,Gt=null,xn=null,vn=null,ec=!1,ol=!1,al=0,vw=0;function In(){throw Error(n(321))}function Vf(o,a){if(a===null)return!1;for(var u=0;u<a.length&&u<o.length;u++)if(!Ir(o[u],a[u]))return!1;return!0}function Qf(o,a,u,m,b,w){if(jo=w,Gt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Zu.current=o===null||o.memoizedState===null?kw:Sw,o=u(m,b),ol){w=0;do{if(ol=!1,al=0,25<=w)throw Error(n(301));w+=1,vn=xn=null,a.updateQueue=null,Zu.current=Cw,o=u(m,b)}while(ol)}if(Zu.current=rc,a=xn!==null&&xn.next!==null,jo=0,vn=xn=Gt=null,ec=!1,a)throw Error(n(300));return o}function Gf(){var o=al!==0;return al=0,o}function Xr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vn===null?Gt.memoizedState=vn=o:vn=vn.next=o,vn}function br(){if(xn===null){var o=Gt.alternate;o=o!==null?o.memoizedState:null}else o=xn.next;var a=vn===null?Gt.memoizedState:vn.next;if(a!==null)vn=a,xn=o;else{if(o===null)throw Error(n(310));xn=o,o={memoizedState:xn.memoizedState,baseState:xn.baseState,baseQueue:xn.baseQueue,queue:xn.queue,next:null},vn===null?Gt.memoizedState=vn=o:vn=vn.next=o}return vn}function il(o,a){return typeof a=="function"?a(o):a}function Kf(o){var a=br(),u=a.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=o;var m=xn,b=m.baseQueue,w=u.pending;if(w!==null){if(b!==null){var L=b.next;b.next=w.next,w.next=L}m.baseQueue=b=w,u.pending=null}if(b!==null){w=b.next,m=m.baseState;var $=L=null,K=null,ce=w;do{var we=ce.lane;if((jo&we)===we)K!==null&&(K=K.next={lane:0,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),m=ce.hasEagerState?ce.eagerState:o(m,ce.action);else{var Se={lane:we,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null};K===null?($=K=Se,L=m):K=K.next=Se,Gt.lanes|=we,Fo|=we}ce=ce.next}while(ce!==null&&ce!==w);K===null?L=m:K.next=$,Ir(m,a.memoizedState)||(Gn=!0),a.memoizedState=m,a.baseState=L,a.baseQueue=K,u.lastRenderedState=m}if(o=u.interleaved,o!==null){b=o;do w=b.lane,Gt.lanes|=w,Fo|=w,b=b.next;while(b!==o)}else b===null&&(u.lanes=0);return[a.memoizedState,u.dispatch]}function Xf(o){var a=br(),u=a.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=o;var m=u.dispatch,b=u.pending,w=a.memoizedState;if(b!==null){u.pending=null;var L=b=b.next;do w=o(w,L.action),L=L.next;while(L!==b);Ir(w,a.memoizedState)||(Gn=!0),a.memoizedState=w,a.baseQueue===null&&(a.baseState=w),u.lastRenderedState=w}return[w,m]}function Ny(){}function _y(o,a){var u=Gt,m=br(),b=a(),w=!Ir(m.memoizedState,b);if(w&&(m.memoizedState=b,Gn=!0),m=m.queue,Jf(Ay.bind(null,u,m,o),[o]),m.getSnapshot!==a||w||vn!==null&&vn.memoizedState.tag&1){if(u.flags|=2048,ll(9,Oy.bind(null,u,m,b,a),void 0,null),En===null)throw Error(n(349));(jo&30)!==0||Dy(u,a,b)}return b}function Dy(o,a,u){o.flags|=16384,o={getSnapshot:a,value:u},a=Gt.updateQueue,a===null?(a={lastEffect:null,stores:null},Gt.updateQueue=a,a.stores=[o]):(u=a.stores,u===null?a.stores=[o]:u.push(o))}function Oy(o,a,u,m){a.value=u,a.getSnapshot=m,Iy(a)&&My(o)}function Ay(o,a,u){return u(function(){Iy(a)&&My(o)})}function Iy(o){var a=o.getSnapshot;o=o.value;try{var u=a();return!Ir(o,u)}catch{return!0}}function My(o){var a=gs(o,1);a!==null&&jr(a,o,1,-1)}function Ly(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=ww.bind(null,Gt,o),[a.memoizedState,o]}function ll(o,a,u,m){return o={tag:o,create:a,destroy:u,deps:m,next:null},a=Gt.updateQueue,a===null?(a={lastEffect:null,stores:null},Gt.updateQueue=a,a.lastEffect=o.next=o):(u=a.lastEffect,u===null?a.lastEffect=o.next=o:(m=u.next,u.next=o,o.next=m,a.lastEffect=o)),o}function Ry(){return br().memoizedState}function tc(o,a,u,m){var b=Xr();Gt.flags|=o,b.memoizedState=ll(1|a,u,void 0,m===void 0?null:m)}function nc(o,a,u,m){var b=br();m=m===void 0?null:m;var w=void 0;if(xn!==null){var L=xn.memoizedState;if(w=L.destroy,m!==null&&Vf(m,L.deps)){b.memoizedState=ll(a,u,w,m);return}}Gt.flags|=o,b.memoizedState=ll(1|a,u,w,m)}function Py(o,a){return tc(8390656,8,o,a)}function Jf(o,a){return nc(2048,8,o,a)}function jy(o,a){return nc(4,2,o,a)}function Fy(o,a){return nc(4,4,o,a)}function By(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 Hy(o,a,u){return u=u!=null?u.concat([o]):null,nc(4,4,By.bind(null,a,o),u)}function Zf(){}function Uy(o,a){var u=br();a=a===void 0?null:a;var m=u.memoizedState;return m!==null&&a!==null&&Vf(a,m[1])?m[0]:(u.memoizedState=[o,a],o)}function zy(o,a){var u=br();a=a===void 0?null:a;var m=u.memoizedState;return m!==null&&a!==null&&Vf(a,m[1])?m[0]:(o=o(),u.memoizedState=[o,a],o)}function Wy(o,a,u){return(jo&21)===0?(o.baseState&&(o.baseState=!1,Gn=!0),o.memoizedState=u):(Ir(u,a)||(u=bp(),Gt.lanes|=u,Fo|=u,o.baseState=!0),a)}function Ew(o,a){var u=Ot;Ot=u!==0&&4>u?u:4,o(!0);var m=qf.transition;qf.transition={};try{o(!1),a()}finally{Ot=u,qf.transition=m}}function Yy(){return br().memoizedState}function Tw(o,a,u){var m=Zs(o);if(u={lane:m,action:u,hasEagerState:!1,eagerState:null,next:null},$y(o))qy(a,u);else if(u=Ty(o,a,u,m),u!==null){var b=Un();jr(u,o,m,b),Vy(u,a,m)}}function ww(o,a,u){var m=Zs(o),b={lane:m,action:u,hasEagerState:!1,eagerState:null,next:null};if($y(o))qy(a,b);else{var w=o.alternate;if(o.lanes===0&&(w===null||w.lanes===0)&&(w=a.lastRenderedReducer,w!==null))try{var L=a.lastRenderedState,$=w(L,u);if(b.hasEagerState=!0,b.eagerState=$,Ir($,L)){var K=a.interleaved;K===null?(b.next=b,Hf(a)):(b.next=K.next,K.next=b),a.interleaved=b;return}}catch{}finally{}u=Ty(o,a,b,m),u!==null&&(b=Un(),jr(u,o,m,b),Vy(u,a,m))}}function $y(o){var a=o.alternate;return o===Gt||a!==null&&a===Gt}function qy(o,a){ol=ec=!0;var u=o.pending;u===null?a.next=a:(a.next=u.next,u.next=a),o.pending=a}function Vy(o,a,u){if((u&4194240)!==0){var m=a.lanes;m&=o.pendingLanes,u|=m,a.lanes=u,ef(o,u)}}var rc={readContext:xr,useCallback:In,useContext:In,useEffect:In,useImperativeHandle:In,useInsertionEffect:In,useLayoutEffect:In,useMemo:In,useReducer:In,useRef:In,useState:In,useDebugValue:In,useDeferredValue:In,useTransition:In,useMutableSource:In,useSyncExternalStore:In,useId:In,unstable_isNewReconciler:!1},kw={readContext:xr,useCallback:function(o,a){return Xr().memoizedState=[o,a===void 0?null:a],o},useContext:xr,useEffect:Py,useImperativeHandle:function(o,a,u){return u=u!=null?u.concat([o]):null,tc(4194308,4,By.bind(null,a,o),u)},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 u=Xr();return a=a===void 0?null:a,o=o(),u.memoizedState=[o,a],o},useReducer:function(o,a,u){var m=Xr();return a=u!==void 0?u(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=Tw.bind(null,Gt,o),[m.memoizedState,o]},useRef:function(o){var a=Xr();return o={current:o},a.memoizedState=o},useState:Ly,useDebugValue:Zf,useDeferredValue:function(o){return Xr().memoizedState=o},useTransition:function(){var o=Ly(!1),a=o[0];return o=Ew.bind(null,o[1]),Xr().memoizedState=o,[a,o]},useMutableSource:function(){},useSyncExternalStore:function(o,a,u){var m=Gt,b=Xr();if(qt){if(u===void 0)throw Error(n(407));u=u()}else{if(u=a(),En===null)throw Error(n(349));(jo&30)!==0||Dy(m,a,u)}b.memoizedState=u;var w={value:u,getSnapshot:a};return b.queue=w,Py(Ay.bind(null,m,w,o),[o]),m.flags|=2048,ll(9,Oy.bind(null,m,w,u,a),void 0,null),u},useId:function(){var o=Xr(),a=En.identifierPrefix;if(qt){var u=ys,m=ps;u=(m&~(1<<32-Ar(m)-1)).toString(32)+u,a=":"+a+"R"+u,u=al++,0<u&&(a+="H"+u.toString(32)),a+=":"}else u=vw++,a=":"+a+"r"+u.toString(32)+":";return o.memoizedState=a},unstable_isNewReconciler:!1},Sw={readContext:xr,useCallback:Uy,useContext:xr,useEffect:Jf,useImperativeHandle:Hy,useInsertionEffect:jy,useLayoutEffect:Fy,useMemo:zy,useReducer:Kf,useRef:Ry,useState:function(){return Kf(il)},useDebugValue:Zf,useDeferredValue:function(o){var a=br();return Wy(a,xn.memoizedState,o)},useTransition:function(){var o=Kf(il)[0],a=br().memoizedState;return[o,a]},useMutableSource:Ny,useSyncExternalStore:_y,useId:Yy,unstable_isNewReconciler:!1},Cw={readContext:xr,useCallback:Uy,useContext:xr,useEffect:Jf,useImperativeHandle:Hy,useInsertionEffect:jy,useLayoutEffect:Fy,useMemo:zy,useReducer:Xf,useRef:Ry,useState:function(){return Xf(il)},useDebugValue:Zf,useDeferredValue:function(o){var a=br();return xn===null?a.memoizedState=o:Wy(a,xn.memoizedState,o)},useTransition:function(){var o=Xf(il)[0],a=br().memoizedState;return[o,a]},useMutableSource:Ny,useSyncExternalStore:_y,useId:Yy,unstable_isNewReconciler:!1};function Lr(o,a){if(o&&o.defaultProps){a=M({},a),o=o.defaultProps;for(var u in o)a[u]===void 0&&(a[u]=o[u]);return a}return a}function eh(o,a,u,m){a=o.memoizedState,u=u(m,a),u=u==null?a:M({},a,u),o.memoizedState=u,o.lanes===0&&(o.updateQueue.baseState=u)}var sc={isMounted:function(o){return(o=o._reactInternals)?Rt(o)===o:!1},enqueueSetState:function(o,a,u){o=o._reactInternals;var m=Un(),b=Zs(o),w=xs(m,b);w.payload=a,u!=null&&(w.callback=u),a=Gs(o,w,b),a!==null&&(jr(a,o,b,m),Ku(a,o,b))},enqueueReplaceState:function(o,a,u){o=o._reactInternals;var m=Un(),b=Zs(o),w=xs(m,b);w.tag=1,w.payload=a,u!=null&&(w.callback=u),a=Gs(o,w,b),a!==null&&(jr(a,o,b,m),Ku(a,o,b))},enqueueForceUpdate:function(o,a){o=o._reactInternals;var u=Un(),m=Zs(o),b=xs(u,m);b.tag=2,a!=null&&(b.callback=a),a=Gs(o,b,m),a!==null&&(jr(a,o,m,u),Ku(a,o,m))}};function Qy(o,a,u,m,b,w,L){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(m,w,L):a.prototype&&a.prototype.isPureReactComponent?!Qi(u,m)||!Qi(b,w):!0}function Gy(o,a,u){var m=!1,b=qs,w=a.contextType;return typeof w=="object"&&w!==null?w=xr(w):(b=Qn(a)?Io:An.current,m=a.contextTypes,w=(m=m!=null)?Ia(o,b):qs),a=new a(u,w),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=b,o.__reactInternalMemoizedMaskedChildContext=w),a}function Ky(o,a,u,m){o=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,m),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,m),a.state!==o&&sc.enqueueReplaceState(a,a.state,null)}function th(o,a,u,m){var b=o.stateNode;b.props=u,b.state=o.memoizedState,b.refs={},Uf(o);var w=a.contextType;typeof w=="object"&&w!==null?b.context=xr(w):(w=Qn(a)?Io:An.current,b.context=Ia(o,w)),b.state=o.memoizedState,w=a.getDerivedStateFromProps,typeof w=="function"&&(eh(o,a,w,u),b.state=o.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(a=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),a!==b.state&&sc.enqueueReplaceState(b,b.state,null),Xu(o,u,b,m),b.state=o.memoizedState),typeof b.componentDidMount=="function"&&(o.flags|=4194308)}function Ha(o,a){try{var u="",m=a;do u+=ye(m),m=m.return;while(m);var b=u}catch(w){b=`
|
|
32
|
-
Error generating stack: `+w.message+`
|
|
33
|
-
`+w.stack}return{value:o,source:a,stack:b,digest:null}}function nh(o,a,u){return{value:o,source:null,stack:u??null,digest:a??null}}function rh(o,a){try{console.error(a.value)}catch(u){setTimeout(function(){throw u})}}var Nw=typeof WeakMap=="function"?WeakMap:Map;function Xy(o,a,u){u=xs(-1,u),u.tag=3,u.payload={element:null};var m=a.value;return u.callback=function(){dc||(dc=!0,xh=m),rh(o,a)},u}function Jy(o,a,u){u=xs(-1,u),u.tag=3;var m=o.type.getDerivedStateFromError;if(typeof m=="function"){var b=a.value;u.payload=function(){return m(b)},u.callback=function(){rh(o,a)}}var w=o.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(u.callback=function(){rh(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:""})}),u}function Zy(o,a,u){var m=o.pingCache;if(m===null){m=o.pingCache=new Nw;var b=new Set;m.set(a,b)}else b=m.get(a),b===void 0&&(b=new Set,m.set(a,b));b.has(u)||(b.add(u),o=Uw.bind(null,o,a,u),a.then(o,o))}function eg(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 tg(o,a,u,m,b){return(o.mode&1)===0?(o===a?o.flags|=65536:(o.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(a=xs(-1,1),a.tag=2,Gs(u,a,1))),u.lanes|=1),o):(o.flags|=65536,o.lanes=b,o)}var _w=A.ReactCurrentOwner,Gn=!1;function Hn(o,a,u,m){a.child=o===null?Ey(a,null,u,m):Pa(a,o.child,u,m)}function ng(o,a,u,m,b){u=u.render;var w=a.ref;return Fa(a,b),m=Qf(o,a,u,m,w,b),u=Gf(),o!==null&&!Gn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~b,bs(o,a,b)):(qt&&u&&Af(a),a.flags|=1,Hn(o,a,m,b),a.child)}function rg(o,a,u,m,b){if(o===null){var w=u.type;return typeof w=="function"&&!Sh(w)&&w.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(a.tag=15,a.type=w,sg(o,a,w,m,b)):(o=gc(u.type,null,m,a,a.mode,b),o.ref=a.ref,o.return=a,a.child=o)}if(w=o.child,(o.lanes&b)===0){var L=w.memoizedProps;if(u=u.compare,u=u!==null?u:Qi,u(L,m)&&o.ref===a.ref)return bs(o,a,b)}return a.flags|=1,o=to(w,m),o.ref=a.ref,o.return=a,a.child=o}function sg(o,a,u,m,b){if(o!==null){var w=o.memoizedProps;if(Qi(w,m)&&o.ref===a.ref)if(Gn=!1,a.pendingProps=m=w,(o.lanes&b)!==0)(o.flags&131072)!==0&&(Gn=!0);else return a.lanes=o.lanes,bs(o,a,b)}return sh(o,a,u,m,b)}function og(o,a,u){var m=a.pendingProps,b=m.children,w=o!==null?o.memoizedState:null;if(m.mode==="hidden")if((a.mode&1)===0)a.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ft(za,ur),ur|=u;else{if((u&1073741824)===0)return o=w!==null?w.baseLanes|u:u,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:o,cachePool:null,transitions:null},a.updateQueue=null,Ft(za,ur),ur|=o,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=w!==null?w.baseLanes:u,Ft(za,ur),ur|=m}else w!==null?(m=w.baseLanes|u,a.memoizedState=null):m=u,Ft(za,ur),ur|=m;return Hn(o,a,b,u),a.child}function ag(o,a){var u=a.ref;(o===null&&u!==null||o!==null&&o.ref!==u)&&(a.flags|=512,a.flags|=2097152)}function sh(o,a,u,m,b){var w=Qn(u)?Io:An.current;return w=Ia(a,w),Fa(a,b),u=Qf(o,a,u,m,w,b),m=Gf(),o!==null&&!Gn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~b,bs(o,a,b)):(qt&&m&&Af(a),a.flags|=1,Hn(o,a,u,b),a.child)}function ig(o,a,u,m,b){if(Qn(u)){var w=!0;zu(a)}else w=!1;if(Fa(a,b),a.stateNode===null)ac(o,a),Gy(a,u,m),th(a,u,m,b),m=!0;else if(o===null){var L=a.stateNode,$=a.memoizedProps;L.props=$;var K=L.context,ce=u.contextType;typeof ce=="object"&&ce!==null?ce=xr(ce):(ce=Qn(u)?Io:An.current,ce=Ia(a,ce));var we=u.getDerivedStateFromProps,Se=typeof we=="function"||typeof L.getSnapshotBeforeUpdate=="function";Se||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||($!==m||K!==ce)&&Ky(a,L,m,ce),Qs=!1;var Ee=a.memoizedState;L.state=Ee,Xu(a,m,L,b),K=a.memoizedState,$!==m||Ee!==K||Vn.current||Qs?(typeof we=="function"&&(eh(a,u,we,m),K=a.memoizedState),($=Qs||Qy(a,u,$,m,Ee,K,ce))?(Se||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=K),L.props=m,L.state=K,L.context=ce,m=$):(typeof L.componentDidMount=="function"&&(a.flags|=4194308),m=!1)}else{L=a.stateNode,wy(o,a),$=a.memoizedProps,ce=a.type===a.elementType?$:Lr(a.type,$),L.props=ce,Se=a.pendingProps,Ee=L.context,K=u.contextType,typeof K=="object"&&K!==null?K=xr(K):(K=Qn(u)?Io:An.current,K=Ia(a,K));var je=u.getDerivedStateFromProps;(we=typeof je=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||($!==Se||Ee!==K)&&Ky(a,L,m,K),Qs=!1,Ee=a.memoizedState,L.state=Ee,Xu(a,m,L,b);var qe=a.memoizedState;$!==Se||Ee!==qe||Vn.current||Qs?(typeof je=="function"&&(eh(a,u,je,m),qe=a.memoizedState),(ce=Qs||Qy(a,u,ce,m,Ee,qe,K)||!1)?(we||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(m,qe,K),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(m,qe,K)),typeof L.componentDidUpdate=="function"&&(a.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof L.componentDidUpdate!="function"||$===o.memoizedProps&&Ee===o.memoizedState||(a.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||$===o.memoizedProps&&Ee===o.memoizedState||(a.flags|=1024),a.memoizedProps=m,a.memoizedState=qe),L.props=m,L.state=qe,L.context=K,m=ce):(typeof L.componentDidUpdate!="function"||$===o.memoizedProps&&Ee===o.memoizedState||(a.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||$===o.memoizedProps&&Ee===o.memoizedState||(a.flags|=1024),m=!1)}return oh(o,a,u,m,w,b)}function oh(o,a,u,m,b,w){ag(o,a);var L=(a.flags&128)!==0;if(!m&&!L)return b&&fy(a,u,!1),bs(o,a,w);m=a.stateNode,_w.current=a;var $=L&&typeof u.getDerivedStateFromError!="function"?null:m.render();return a.flags|=1,o!==null&&L?(a.child=Pa(a,o.child,null,w),a.child=Pa(a,null,$,w)):Hn(o,a,$,w),a.memoizedState=m.state,b&&fy(a,u,!0),a.child}function lg(o){var a=o.stateNode;a.pendingContext?cy(o,a.pendingContext,a.pendingContext!==a.context):a.context&&cy(o,a.context,!1),zf(o,a.containerInfo)}function ug(o,a,u,m,b){return Ra(),Rf(b),a.flags|=256,Hn(o,a,u,m),a.child}var ah={dehydrated:null,treeContext:null,retryLane:0};function ih(o){return{baseLanes:o,cachePool:null,transitions:null}}function cg(o,a,u){var m=a.pendingProps,b=Qt.current,w=!1,L=(a.flags&128)!==0,$;if(($=L)||($=o!==null&&o.memoizedState===null?!1:(b&2)!==0),$?(w=!0,a.flags&=-129):(o===null||o.memoizedState!==null)&&(b|=1),Ft(Qt,b&1),o===null)return Lf(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,w?(m=a.mode,w=a.child,L={mode:"hidden",children:L},(m&1)===0&&w!==null?(w.childLanes=0,w.pendingProps=L):w=xc(L,m,0,null),o=zo(o,m,u,null),w.return=a,o.return=a,w.sibling=o,a.child=w,a.child.memoizedState=ih(u),a.memoizedState=ah,o):lh(a,L));if(b=o.memoizedState,b!==null&&($=b.dehydrated,$!==null))return Dw(o,a,L,m,$,b,u);if(w){w=m.fallback,L=a.mode,b=o.child,$=b.sibling;var K={mode:"hidden",children:m.children};return(L&1)===0&&a.child!==b?(m=a.child,m.childLanes=0,m.pendingProps=K,a.deletions=null):(m=to(b,K),m.subtreeFlags=b.subtreeFlags&14680064),$!==null?w=to($,w):(w=zo(w,L,u,null),w.flags|=2),w.return=a,m.return=a,m.sibling=w,a.child=m,m=w,w=a.child,L=o.child.memoizedState,L=L===null?ih(u):{baseLanes:L.baseLanes|u,cachePool:null,transitions:L.transitions},w.memoizedState=L,w.childLanes=o.childLanes&~u,a.memoizedState=ah,m}return w=o.child,o=w.sibling,m=to(w,{mode:"visible",children:m.children}),(a.mode&1)===0&&(m.lanes=u),m.return=a,m.sibling=null,o!==null&&(u=a.deletions,u===null?(a.deletions=[o],a.flags|=16):u.push(o)),a.child=m,a.memoizedState=null,m}function lh(o,a){return a=xc({mode:"visible",children:a},o.mode,0,null),a.return=o,o.child=a}function oc(o,a,u,m){return m!==null&&Rf(m),Pa(a,o.child,null,u),o=lh(a,a.pendingProps.children),o.flags|=2,a.memoizedState=null,o}function Dw(o,a,u,m,b,w,L){if(u)return a.flags&256?(a.flags&=-257,m=nh(Error(n(422))),oc(o,a,L,m)):a.memoizedState!==null?(a.child=o.child,a.flags|=128,null):(w=m.fallback,b=a.mode,m=xc({mode:"visible",children:m.children},b,0,null),w=zo(w,b,L,null),w.flags|=2,m.return=a,w.return=a,m.sibling=w,a.child=m,(a.mode&1)!==0&&Pa(a,o.child,null,L),a.child.memoizedState=ih(L),a.memoizedState=ah,w);if((a.mode&1)===0)return oc(o,a,L,null);if(b.data==="$!"){if(m=b.nextSibling&&b.nextSibling.dataset,m)var $=m.dgst;return m=$,w=Error(n(419)),m=nh(w,m,void 0),oc(o,a,L,m)}if($=(L&o.childLanes)!==0,Gn||$){if(m=En,m!==null){switch(L&-L){case 4:b=2;break;case 16:b=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(m.suspendedLanes|L))!==0?0:b,b!==0&&b!==w.retryLane&&(w.retryLane=b,gs(o,b),jr(m,o,b,-1))}return kh(),m=nh(Error(n(421))),oc(o,a,L,m)}return b.data==="$?"?(a.flags|=128,a.child=o.child,a=zw.bind(null,o),b._reactRetry=a,null):(o=w.treeContext,lr=Ys(b.nextSibling),ir=a,qt=!0,Mr=null,o!==null&&(yr[gr++]=ps,yr[gr++]=ys,yr[gr++]=Mo,ps=o.id,ys=o.overflow,Mo=a),a=lh(a,m.children),a.flags|=4096,a)}function dg(o,a,u){o.lanes|=a;var m=o.alternate;m!==null&&(m.lanes|=a),Bf(o.return,a,u)}function uh(o,a,u,m,b){var w=o.memoizedState;w===null?o.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:m,tail:u,tailMode:b}:(w.isBackwards=a,w.rendering=null,w.renderingStartTime=0,w.last=m,w.tail=u,w.tailMode=b)}function fg(o,a,u){var m=a.pendingProps,b=m.revealOrder,w=m.tail;if(Hn(o,a,m.children,u),m=Qt.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&&dg(o,u,a);else if(o.tag===19)dg(o,u,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(Ft(Qt,m),(a.mode&1)===0)a.memoizedState=null;else switch(b){case"forwards":for(u=a.child,b=null;u!==null;)o=u.alternate,o!==null&&Ju(o)===null&&(b=u),u=u.sibling;u=b,u===null?(b=a.child,a.child=null):(b=u.sibling,u.sibling=null),uh(a,!1,b,u,w);break;case"backwards":for(u=null,b=a.child,a.child=null;b!==null;){if(o=b.alternate,o!==null&&Ju(o)===null){a.child=b;break}o=b.sibling,b.sibling=u,u=b,b=o}uh(a,!0,u,null,w);break;case"together":uh(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 bs(o,a,u){if(o!==null&&(a.dependencies=o.dependencies),Fo|=a.lanes,(u&a.childLanes)===0)return null;if(o!==null&&a.child!==o.child)throw Error(n(153));if(a.child!==null){for(o=a.child,u=to(o,o.pendingProps),a.child=u,u.return=a;o.sibling!==null;)o=o.sibling,u=u.sibling=to(o,o.pendingProps),u.return=a;u.sibling=null}return a.child}function Ow(o,a,u){switch(a.tag){case 3:lg(a),Ra();break;case 5:Cy(a);break;case 1:Qn(a.type)&&zu(a);break;case 4:zf(a,a.stateNode.containerInfo);break;case 10:var m=a.type._context,b=a.memoizedProps.value;Ft(Qu,m._currentValue),m._currentValue=b;break;case 13:if(m=a.memoizedState,m!==null)return m.dehydrated!==null?(Ft(Qt,Qt.current&1),a.flags|=128,null):(u&a.child.childLanes)!==0?cg(o,a,u):(Ft(Qt,Qt.current&1),o=bs(o,a,u),o!==null?o.sibling:null);Ft(Qt,Qt.current&1);break;case 19:if(m=(u&a.childLanes)!==0,(o.flags&128)!==0){if(m)return fg(o,a,u);a.flags|=128}if(b=a.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),Ft(Qt,Qt.current),m)break;return null;case 22:case 23:return a.lanes=0,og(o,a,u)}return bs(o,a,u)}var hg,ch,mg,pg;hg=function(o,a){for(var u=a.child;u!==null;){if(u.tag===5||u.tag===6)o.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},ch=function(){},mg=function(o,a,u,m){var b=o.memoizedProps;if(b!==m){o=a.stateNode,Po(Kr.current);var w=null;switch(u){case"input":b=et(o,b),m=et(o,m),w=[];break;case"select":b=M({},b,{value:void 0}),m=M({},m,{value:void 0}),w=[];break;case"textarea":b=Ne(o,b),m=Ne(o,m),w=[];break;default:typeof b.onClick!="function"&&typeof m.onClick=="function"&&(o.onclick=Bu)}Wt(u,m);var L;u=null;for(ce in b)if(!m.hasOwnProperty(ce)&&b.hasOwnProperty(ce)&&b[ce]!=null)if(ce==="style"){var $=b[ce];for(L in $)$.hasOwnProperty(L)&&(u||(u={}),u[L]="")}else ce!=="dangerouslySetInnerHTML"&&ce!=="children"&&ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&ce!=="autoFocus"&&(s.hasOwnProperty(ce)?w||(w=[]):(w=w||[]).push(ce,null));for(ce in m){var K=m[ce];if($=b!=null?b[ce]:void 0,m.hasOwnProperty(ce)&&K!==$&&(K!=null||$!=null))if(ce==="style")if($){for(L in $)!$.hasOwnProperty(L)||K&&K.hasOwnProperty(L)||(u||(u={}),u[L]="");for(L in K)K.hasOwnProperty(L)&&$[L]!==K[L]&&(u||(u={}),u[L]=K[L])}else u||(w||(w=[]),w.push(ce,u)),u=K;else ce==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,$=$?$.__html:void 0,K!=null&&$!==K&&(w=w||[]).push(ce,K)):ce==="children"?typeof K!="string"&&typeof K!="number"||(w=w||[]).push(ce,""+K):ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&(s.hasOwnProperty(ce)?(K!=null&&ce==="onScroll"&&Ut("scroll",o),w||$===K||(w=[])):(w=w||[]).push(ce,K))}u&&(w=w||[]).push("style",u);var ce=w;(a.updateQueue=ce)&&(a.flags|=4)}},pg=function(o,a,u,m){u!==m&&(a.flags|=4)};function ul(o,a){if(!qt)switch(o.tailMode){case"hidden":a=o.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?o.tail=null:u.sibling=null;break;case"collapsed":u=o.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?a||o.tail===null?o.tail=null:o.tail.sibling=null:m.sibling=null}}function Mn(o){var a=o.alternate!==null&&o.alternate.child===o.child,u=0,m=0;if(a)for(var b=o.child;b!==null;)u|=b.lanes|b.childLanes,m|=b.subtreeFlags&14680064,m|=b.flags&14680064,b.return=o,b=b.sibling;else for(b=o.child;b!==null;)u|=b.lanes|b.childLanes,m|=b.subtreeFlags,m|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=m,o.childLanes=u,a}function Aw(o,a,u){var m=a.pendingProps;switch(If(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mn(a),null;case 1:return Qn(a.type)&&Uu(),Mn(a),null;case 3:return m=a.stateNode,Ba(),zt(Vn),zt(An),$f(),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,Mr!==null&&(Eh(Mr),Mr=null))),ch(o,a),Mn(a),null;case 5:Wf(a);var b=Po(sl.current);if(u=a.type,o!==null&&a.stateNode!=null)mg(o,a,u,m,b),o.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!m){if(a.stateNode===null)throw Error(n(166));return Mn(a),null}if(o=Po(Kr.current),qu(a)){m=a.stateNode,u=a.type;var w=a.memoizedProps;switch(m[Gr]=a,m[Zi]=w,o=(a.mode&1)!==0,u){case"dialog":Ut("cancel",m),Ut("close",m);break;case"iframe":case"object":case"embed":Ut("load",m);break;case"video":case"audio":for(b=0;b<Ki.length;b++)Ut(Ki[b],m);break;case"source":Ut("error",m);break;case"img":case"image":case"link":Ut("error",m),Ut("load",m);break;case"details":Ut("toggle",m);break;case"input":Ke(m,w),Ut("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!w.multiple},Ut("invalid",m);break;case"textarea":$e(m,w),Ut("invalid",m)}Wt(u,w),b=null;for(var L in w)if(w.hasOwnProperty(L)){var $=w[L];L==="children"?typeof $=="string"?m.textContent!==$&&(w.suppressHydrationWarning!==!0&&Fu(m.textContent,$,o),b=["children",$]):typeof $=="number"&&m.textContent!==""+$&&(w.suppressHydrationWarning!==!0&&Fu(m.textContent,$,o),b=["children",""+$]):s.hasOwnProperty(L)&&$!=null&&L==="onScroll"&&Ut("scroll",m)}switch(u){case"input":ke(m),fe(m,w,!0);break;case"textarea":ke(m),ht(m);break;case"select":case"option":break;default:typeof w.onClick=="function"&&(m.onclick=Bu)}m=b,a.updateQueue=m,m!==null&&(a.flags|=4)}else{L=b.nodeType===9?b:b.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=ie(u)),o==="http://www.w3.org/1999/xhtml"?u==="script"?(o=L.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof m.is=="string"?o=L.createElement(u,{is:m.is}):(o=L.createElement(u),u==="select"&&(L=o,m.multiple?L.multiple=!0:m.size&&(L.size=m.size))):o=L.createElementNS(o,u),o[Gr]=a,o[Zi]=m,hg(o,a,!1,!1),a.stateNode=o;e:{switch(L=It(u,m),u){case"dialog":Ut("cancel",o),Ut("close",o),b=m;break;case"iframe":case"object":case"embed":Ut("load",o),b=m;break;case"video":case"audio":for(b=0;b<Ki.length;b++)Ut(Ki[b],o);b=m;break;case"source":Ut("error",o),b=m;break;case"img":case"image":case"link":Ut("error",o),Ut("load",o),b=m;break;case"details":Ut("toggle",o),b=m;break;case"input":Ke(o,m),b=et(o,m),Ut("invalid",o);break;case"option":b=m;break;case"select":o._wrapperState={wasMultiple:!!m.multiple},b=M({},m,{value:void 0}),Ut("invalid",o);break;case"textarea":$e(o,m),b=Ne(o,m),Ut("invalid",o);break;default:b=m}Wt(u,b),$=b;for(w in $)if($.hasOwnProperty(w)){var K=$[w];w==="style"?Dn(o,K):w==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&rt(o,K)):w==="children"?typeof K=="string"?(u!=="textarea"||K!=="")&&ot(o,K):typeof K=="number"&&ot(o,""+K):w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&w!=="autoFocus"&&(s.hasOwnProperty(w)?K!=null&&w==="onScroll"&&Ut("scroll",o):K!=null&&O(o,w,K,L))}switch(u){case"input":ke(o),fe(o,m,!1);break;case"textarea":ke(o),ht(o);break;case"option":m.value!=null&&o.setAttribute("value",""+ae(m.value));break;case"select":o.multiple=!!m.multiple,w=m.value,w!=null?be(o,!!m.multiple,w,!1):m.defaultValue!=null&&be(o,!!m.multiple,m.defaultValue,!0);break;default:typeof b.onClick=="function"&&(o.onclick=Bu)}switch(u){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 Mn(a),null;case 6:if(o&&a.stateNode!=null)pg(o,a,o.memoizedProps,m);else{if(typeof m!="string"&&a.stateNode===null)throw Error(n(166));if(u=Po(sl.current),Po(Kr.current),qu(a)){if(m=a.stateNode,u=a.memoizedProps,m[Gr]=a,(w=m.nodeValue!==u)&&(o=ir,o!==null))switch(o.tag){case 3:Fu(m.nodeValue,u,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&Fu(m.nodeValue,u,(o.mode&1)!==0)}w&&(a.flags|=4)}else m=(u.nodeType===9?u:u.ownerDocument).createTextNode(m),m[Gr]=a,a.stateNode=m}return Mn(a),null;case 13:if(zt(Qt),m=a.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(qt&&lr!==null&&(a.mode&1)!==0&&(a.flags&128)===0)xy(),Ra(),a.flags|=98560,w=!1;else if(w=qu(a),m!==null&&m.dehydrated!==null){if(o===null){if(!w)throw Error(n(318));if(w=a.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(n(317));w[Gr]=a}else Ra(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Mn(a),w=!1}else Mr!==null&&(Eh(Mr),Mr=null),w=!0;if(!w)return a.flags&65536?a:null}return(a.flags&128)!==0?(a.lanes=u,a):(m=m!==null,m!==(o!==null&&o.memoizedState!==null)&&m&&(a.child.flags|=8192,(a.mode&1)!==0&&(o===null||(Qt.current&1)!==0?bn===0&&(bn=3):kh())),a.updateQueue!==null&&(a.flags|=4),Mn(a),null);case 4:return Ba(),ch(o,a),o===null&&Xi(a.stateNode.containerInfo),Mn(a),null;case 10:return Ff(a.type._context),Mn(a),null;case 17:return Qn(a.type)&&Uu(),Mn(a),null;case 19:if(zt(Qt),w=a.memoizedState,w===null)return Mn(a),null;if(m=(a.flags&128)!==0,L=w.rendering,L===null)if(m)ul(w,!1);else{if(bn!==0||o!==null&&(o.flags&128)!==0)for(o=a.child;o!==null;){if(L=Ju(o),L!==null){for(a.flags|=128,ul(w,!1),m=L.updateQueue,m!==null&&(a.updateQueue=m,a.flags|=4),a.subtreeFlags=0,m=u,u=a.child;u!==null;)w=u,o=m,w.flags&=14680066,L=w.alternate,L===null?(w.childLanes=0,w.lanes=o,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=L.childLanes,w.lanes=L.lanes,w.child=L.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=L.memoizedProps,w.memoizedState=L.memoizedState,w.updateQueue=L.updateQueue,w.type=L.type,o=L.dependencies,w.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),u=u.sibling;return Ft(Qt,Qt.current&1|2),a.child}o=o.sibling}w.tail!==null&&jt()>Wa&&(a.flags|=128,m=!0,ul(w,!1),a.lanes=4194304)}else{if(!m)if(o=Ju(L),o!==null){if(a.flags|=128,m=!0,u=o.updateQueue,u!==null&&(a.updateQueue=u,a.flags|=4),ul(w,!0),w.tail===null&&w.tailMode==="hidden"&&!L.alternate&&!qt)return Mn(a),null}else 2*jt()-w.renderingStartTime>Wa&&u!==1073741824&&(a.flags|=128,m=!0,ul(w,!1),a.lanes=4194304);w.isBackwards?(L.sibling=a.child,a.child=L):(u=w.last,u!==null?u.sibling=L:a.child=L,w.last=L)}return w.tail!==null?(a=w.tail,w.rendering=a,w.tail=a.sibling,w.renderingStartTime=jt(),a.sibling=null,u=Qt.current,Ft(Qt,m?u&1|2:u&1),a):(Mn(a),null);case 22:case 23:return wh(),m=a.memoizedState!==null,o!==null&&o.memoizedState!==null!==m&&(a.flags|=8192),m&&(a.mode&1)!==0?(ur&1073741824)!==0&&(Mn(a),a.subtreeFlags&6&&(a.flags|=8192)):Mn(a),null;case 24:return null;case 25:return null}throw Error(n(156,a.tag))}function Iw(o,a){switch(If(a),a.tag){case 1:return Qn(a.type)&&Uu(),o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 3:return Ba(),zt(Vn),zt(An),$f(),o=a.flags,(o&65536)!==0&&(o&128)===0?(a.flags=o&-65537|128,a):null;case 5:return Wf(a),null;case 13:if(zt(Qt),o=a.memoizedState,o!==null&&o.dehydrated!==null){if(a.alternate===null)throw Error(n(340));Ra()}return o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 19:return zt(Qt),null;case 4:return Ba(),null;case 10:return Ff(a.type._context),null;case 22:case 23:return wh(),null;case 24:return null;default:return null}}var ic=!1,Ln=!1,Mw=typeof WeakSet=="function"?WeakSet:Set,He=null;function Ua(o,a){var u=o.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(m){rn(o,a,m)}else u.current=null}function dh(o,a,u){try{u()}catch(m){rn(o,a,m)}}var yg=!1;function Lw(o,a){if(wf=Nu,o=Qp(),pf(o)){if("selectionStart"in o)var u={start:o.selectionStart,end:o.selectionEnd};else e:{u=(u=o.ownerDocument)&&u.defaultView||window;var m=u.getSelection&&u.getSelection();if(m&&m.rangeCount!==0){u=m.anchorNode;var b=m.anchorOffset,w=m.focusNode;m=m.focusOffset;try{u.nodeType,w.nodeType}catch{u=null;break e}var L=0,$=-1,K=-1,ce=0,we=0,Se=o,Ee=null;t:for(;;){for(var je;Se!==u||b!==0&&Se.nodeType!==3||($=L+b),Se!==w||m!==0&&Se.nodeType!==3||(K=L+m),Se.nodeType===3&&(L+=Se.nodeValue.length),(je=Se.firstChild)!==null;)Ee=Se,Se=je;for(;;){if(Se===o)break t;if(Ee===u&&++ce===b&&($=L),Ee===w&&++we===m&&(K=L),(je=Se.nextSibling)!==null)break;Se=Ee,Ee=Se.parentNode}Se=je}u=$===-1||K===-1?null:{start:$,end:K}}else u=null}u=u||{start:0,end:0}}else u=null;for(kf={focusedElem:o,selectionRange:u},Nu=!1,He=a;He!==null;)if(a=He,o=a.child,(a.subtreeFlags&1028)!==0&&o!==null)o.return=a,He=o;else for(;He!==null;){a=He;try{var qe=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if(qe!==null){var Ve=qe.memoizedProps,ln=qe.memoizedState,ne=a.stateNode,X=ne.getSnapshotBeforeUpdate(a.elementType===a.type?Ve:Lr(a.type,Ve),ln);ne.__reactInternalSnapshotBeforeUpdate=X}break;case 3:var oe=a.stateNode.containerInfo;oe.nodeType===1?oe.textContent="":oe.nodeType===9&&oe.documentElement&&oe.removeChild(oe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ae){rn(a,a.return,Ae)}if(o=a.sibling,o!==null){o.return=a.return,He=o;break}He=a.return}return qe=yg,yg=!1,qe}function cl(o,a,u){var m=a.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var b=m=m.next;do{if((b.tag&o)===o){var w=b.destroy;b.destroy=void 0,w!==void 0&&dh(a,u,w)}b=b.next}while(b!==m)}}function lc(o,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var u=a=a.next;do{if((u.tag&o)===o){var m=u.create;u.destroy=m()}u=u.next}while(u!==a)}}function fh(o){var a=o.ref;if(a!==null){var u=o.stateNode;switch(o.tag){case 5:o=u;break;default:o=u}typeof a=="function"?a(o):a.current=o}}function gg(o){var a=o.alternate;a!==null&&(o.alternate=null,gg(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[_f],delete a[yw],delete a[gw])),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 xg(o){return o.tag===5||o.tag===3||o.tag===4}function bg(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||xg(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 hh(o,a,u){var m=o.tag;if(m===5||m===6)o=o.stateNode,a?u.nodeType===8?u.parentNode.insertBefore(o,a):u.insertBefore(o,a):(u.nodeType===8?(a=u.parentNode,a.insertBefore(o,u)):(a=u,a.appendChild(o)),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=Bu));else if(m!==4&&(o=o.child,o!==null))for(hh(o,a,u),o=o.sibling;o!==null;)hh(o,a,u),o=o.sibling}function mh(o,a,u){var m=o.tag;if(m===5||m===6)o=o.stateNode,a?u.insertBefore(o,a):u.appendChild(o);else if(m!==4&&(o=o.child,o!==null))for(mh(o,a,u),o=o.sibling;o!==null;)mh(o,a,u),o=o.sibling}var Cn=null,Rr=!1;function Ks(o,a,u){for(u=u.child;u!==null;)vg(o,a,u),u=u.sibling}function vg(o,a,u){if(Qr&&typeof Qr.onCommitFiberUnmount=="function")try{Qr.onCommitFiberUnmount(Eu,u)}catch{}switch(u.tag){case 5:Ln||Ua(u,a);case 6:var m=Cn,b=Rr;Cn=null,Ks(o,a,u),Cn=m,Rr=b,Cn!==null&&(Rr?(o=Cn,u=u.stateNode,o.nodeType===8?o.parentNode.removeChild(u):o.removeChild(u)):Cn.removeChild(u.stateNode));break;case 18:Cn!==null&&(Rr?(o=Cn,u=u.stateNode,o.nodeType===8?Nf(o.parentNode,u):o.nodeType===1&&Nf(o,u),zi(o)):Nf(Cn,u.stateNode));break;case 4:m=Cn,b=Rr,Cn=u.stateNode.containerInfo,Rr=!0,Ks(o,a,u),Cn=m,Rr=b;break;case 0:case 11:case 14:case 15:if(!Ln&&(m=u.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){b=m=m.next;do{var w=b,L=w.destroy;w=w.tag,L!==void 0&&((w&2)!==0||(w&4)!==0)&&dh(u,a,L),b=b.next}while(b!==m)}Ks(o,a,u);break;case 1:if(!Ln&&(Ua(u,a),m=u.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=u.memoizedProps,m.state=u.memoizedState,m.componentWillUnmount()}catch($){rn(u,a,$)}Ks(o,a,u);break;case 21:Ks(o,a,u);break;case 22:u.mode&1?(Ln=(m=Ln)||u.memoizedState!==null,Ks(o,a,u),Ln=m):Ks(o,a,u);break;default:Ks(o,a,u)}}function Eg(o){var a=o.updateQueue;if(a!==null){o.updateQueue=null;var u=o.stateNode;u===null&&(u=o.stateNode=new Mw),a.forEach(function(m){var b=Ww.bind(null,o,m);u.has(m)||(u.add(m),m.then(b,b))})}}function Pr(o,a){var u=a.deletions;if(u!==null)for(var m=0;m<u.length;m++){var b=u[m];try{var w=o,L=a,$=L;e:for(;$!==null;){switch($.tag){case 5:Cn=$.stateNode,Rr=!1;break e;case 3:Cn=$.stateNode.containerInfo,Rr=!0;break e;case 4:Cn=$.stateNode.containerInfo,Rr=!0;break e}$=$.return}if(Cn===null)throw Error(n(160));vg(w,L,b),Cn=null,Rr=!1;var K=b.alternate;K!==null&&(K.return=null),b.return=null}catch(ce){rn(b,a,ce)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)Tg(a,o),a=a.sibling}function Tg(o,a){var u=o.alternate,m=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Pr(a,o),Jr(o),m&4){try{cl(3,o,o.return),lc(3,o)}catch(Ve){rn(o,o.return,Ve)}try{cl(5,o,o.return)}catch(Ve){rn(o,o.return,Ve)}}break;case 1:Pr(a,o),Jr(o),m&512&&u!==null&&Ua(u,u.return);break;case 5:if(Pr(a,o),Jr(o),m&512&&u!==null&&Ua(u,u.return),o.flags&32){var b=o.stateNode;try{ot(b,"")}catch(Ve){rn(o,o.return,Ve)}}if(m&4&&(b=o.stateNode,b!=null)){var w=o.memoizedProps,L=u!==null?u.memoizedProps:w,$=o.type,K=o.updateQueue;if(o.updateQueue=null,K!==null)try{$==="input"&&w.type==="radio"&&w.name!=null&&ge(b,w),It($,L);var ce=It($,w);for(L=0;L<K.length;L+=2){var we=K[L],Se=K[L+1];we==="style"?Dn(b,Se):we==="dangerouslySetInnerHTML"?rt(b,Se):we==="children"?ot(b,Se):O(b,we,Se,ce)}switch($){case"input":me(b,w);break;case"textarea":ct(b,w);break;case"select":var Ee=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!w.multiple;var je=w.value;je!=null?be(b,!!w.multiple,je,!1):Ee!==!!w.multiple&&(w.defaultValue!=null?be(b,!!w.multiple,w.defaultValue,!0):be(b,!!w.multiple,w.multiple?[]:"",!1))}b[Zi]=w}catch(Ve){rn(o,o.return,Ve)}}break;case 6:if(Pr(a,o),Jr(o),m&4){if(o.stateNode===null)throw Error(n(162));b=o.stateNode,w=o.memoizedProps;try{b.nodeValue=w}catch(Ve){rn(o,o.return,Ve)}}break;case 3:if(Pr(a,o),Jr(o),m&4&&u!==null&&u.memoizedState.isDehydrated)try{zi(a.containerInfo)}catch(Ve){rn(o,o.return,Ve)}break;case 4:Pr(a,o),Jr(o);break;case 13:Pr(a,o),Jr(o),b=o.child,b.flags&8192&&(w=b.memoizedState!==null,b.stateNode.isHidden=w,!w||b.alternate!==null&&b.alternate.memoizedState!==null||(gh=jt())),m&4&&Eg(o);break;case 22:if(we=u!==null&&u.memoizedState!==null,o.mode&1?(Ln=(ce=Ln)||we,Pr(a,o),Ln=ce):Pr(a,o),Jr(o),m&8192){if(ce=o.memoizedState!==null,(o.stateNode.isHidden=ce)&&!we&&(o.mode&1)!==0)for(He=o,we=o.child;we!==null;){for(Se=He=we;He!==null;){switch(Ee=He,je=Ee.child,Ee.tag){case 0:case 11:case 14:case 15:cl(4,Ee,Ee.return);break;case 1:Ua(Ee,Ee.return);var qe=Ee.stateNode;if(typeof qe.componentWillUnmount=="function"){m=Ee,u=Ee.return;try{a=m,qe.props=a.memoizedProps,qe.state=a.memoizedState,qe.componentWillUnmount()}catch(Ve){rn(m,u,Ve)}}break;case 5:Ua(Ee,Ee.return);break;case 22:if(Ee.memoizedState!==null){Sg(Se);continue}}je!==null?(je.return=Ee,He=je):Sg(Se)}we=we.sibling}e:for(we=null,Se=o;;){if(Se.tag===5){if(we===null){we=Se;try{b=Se.stateNode,ce?(w=b.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none"):($=Se.stateNode,K=Se.memoizedProps.style,L=K!=null&&K.hasOwnProperty("display")?K.display:null,$.style.display=hn("display",L))}catch(Ve){rn(o,o.return,Ve)}}}else if(Se.tag===6){if(we===null)try{Se.stateNode.nodeValue=ce?"":Se.memoizedProps}catch(Ve){rn(o,o.return,Ve)}}else if((Se.tag!==22&&Se.tag!==23||Se.memoizedState===null||Se===o)&&Se.child!==null){Se.child.return=Se,Se=Se.child;continue}if(Se===o)break e;for(;Se.sibling===null;){if(Se.return===null||Se.return===o)break e;we===Se&&(we=null),Se=Se.return}we===Se&&(we=null),Se.sibling.return=Se.return,Se=Se.sibling}}break;case 19:Pr(a,o),Jr(o),m&4&&Eg(o);break;case 21:break;default:Pr(a,o),Jr(o)}}function Jr(o){var a=o.flags;if(a&2){try{e:{for(var u=o.return;u!==null;){if(xg(u)){var m=u;break e}u=u.return}throw Error(n(160))}switch(m.tag){case 5:var b=m.stateNode;m.flags&32&&(ot(b,""),m.flags&=-33);var w=bg(o);mh(o,w,b);break;case 3:case 4:var L=m.stateNode.containerInfo,$=bg(o);hh(o,$,L);break;default:throw Error(n(161))}}catch(K){rn(o,o.return,K)}o.flags&=-3}a&4096&&(o.flags&=-4097)}function Rw(o,a,u){He=o,wg(o)}function wg(o,a,u){for(var m=(o.mode&1)!==0;He!==null;){var b=He,w=b.child;if(b.tag===22&&m){var L=b.memoizedState!==null||ic;if(!L){var $=b.alternate,K=$!==null&&$.memoizedState!==null||Ln;$=ic;var ce=Ln;if(ic=L,(Ln=K)&&!ce)for(He=b;He!==null;)L=He,K=L.child,L.tag===22&&L.memoizedState!==null?Cg(b):K!==null?(K.return=L,He=K):Cg(b);for(;w!==null;)He=w,wg(w),w=w.sibling;He=b,ic=$,Ln=ce}kg(o)}else(b.subtreeFlags&8772)!==0&&w!==null?(w.return=b,He=w):kg(o)}}function kg(o){for(;He!==null;){var a=He;if((a.flags&8772)!==0){var u=a.alternate;try{if((a.flags&8772)!==0)switch(a.tag){case 0:case 11:case 15:Ln||lc(5,a);break;case 1:var m=a.stateNode;if(a.flags&4&&!Ln)if(u===null)m.componentDidMount();else{var b=a.elementType===a.type?u.memoizedProps:Lr(a.type,u.memoizedProps);m.componentDidUpdate(b,u.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var w=a.updateQueue;w!==null&&Sy(a,w,m);break;case 3:var L=a.updateQueue;if(L!==null){if(u=null,a.child!==null)switch(a.child.tag){case 5:u=a.child.stateNode;break;case 1:u=a.child.stateNode}Sy(a,L,u)}break;case 5:var $=a.stateNode;if(u===null&&a.flags&4){u=$;var K=a.memoizedProps;switch(a.type){case"button":case"input":case"select":case"textarea":K.autoFocus&&u.focus();break;case"img":K.src&&(u.src=K.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(a.memoizedState===null){var ce=a.alternate;if(ce!==null){var we=ce.memoizedState;if(we!==null){var Se=we.dehydrated;Se!==null&&zi(Se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Ln||a.flags&512&&fh(a)}catch(Ee){rn(a,a.return,Ee)}}if(a===o){He=null;break}if(u=a.sibling,u!==null){u.return=a.return,He=u;break}He=a.return}}function Sg(o){for(;He!==null;){var a=He;if(a===o){He=null;break}var u=a.sibling;if(u!==null){u.return=a.return,He=u;break}He=a.return}}function Cg(o){for(;He!==null;){var a=He;try{switch(a.tag){case 0:case 11:case 15:var u=a.return;try{lc(4,a)}catch(K){rn(a,u,K)}break;case 1:var m=a.stateNode;if(typeof m.componentDidMount=="function"){var b=a.return;try{m.componentDidMount()}catch(K){rn(a,b,K)}}var w=a.return;try{fh(a)}catch(K){rn(a,w,K)}break;case 5:var L=a.return;try{fh(a)}catch(K){rn(a,L,K)}}}catch(K){rn(a,a.return,K)}if(a===o){He=null;break}var $=a.sibling;if($!==null){$.return=a.return,He=$;break}He=a.return}}var Pw=Math.ceil,uc=A.ReactCurrentDispatcher,ph=A.ReactCurrentOwner,vr=A.ReactCurrentBatchConfig,Et=0,En=null,mn=null,Nn=0,ur=0,za=$s(0),bn=0,dl=null,Fo=0,cc=0,yh=0,fl=null,Kn=null,gh=0,Wa=1/0,vs=null,dc=!1,xh=null,Xs=null,fc=!1,Js=null,hc=0,hl=0,bh=null,mc=-1,pc=0;function Un(){return(Et&6)!==0?jt():mc!==-1?mc:mc=jt()}function Zs(o){return(o.mode&1)===0?1:(Et&2)!==0&&Nn!==0?Nn&-Nn:bw.transition!==null?(pc===0&&(pc=bp()),pc):(o=Ot,o!==0||(o=window.event,o=o===void 0?16:_p(o.type)),o)}function jr(o,a,u,m){if(50<hl)throw hl=0,bh=null,Error(n(185));ji(o,u,m),((Et&2)===0||o!==En)&&(o===En&&((Et&2)===0&&(cc|=u),bn===4&&eo(o,Nn)),Xn(o,m),u===1&&Et===0&&(a.mode&1)===0&&(Wa=jt()+500,Wu&&Vs()))}function Xn(o,a){var u=o.callbackNode;bT(o,a);var m=ku(o,o===En?Nn:0);if(m===0)u!==null&&Pt(u),o.callbackNode=null,o.callbackPriority=0;else if(a=m&-m,o.callbackPriority!==a){if(u!=null&&Pt(u),a===1)o.tag===0?xw(_g.bind(null,o)):hy(_g.bind(null,o)),mw(function(){(Et&6)===0&&Vs()}),u=null;else{switch(vp(m)){case 1:u=Oo;break;case 4:u=gp;break;case 16:u=vu;break;case 536870912:u=xp;break;default:u=vu}u=Pg(u,Ng.bind(null,o))}o.callbackPriority=a,o.callbackNode=u}}function Ng(o,a){if(mc=-1,pc=0,(Et&6)!==0)throw Error(n(327));var u=o.callbackNode;if(Ya()&&o.callbackNode!==u)return null;var m=ku(o,o===En?Nn:0);if(m===0)return null;if((m&30)!==0||(m&o.expiredLanes)!==0||a)a=yc(o,m);else{a=m;var b=Et;Et|=2;var w=Og();(En!==o||Nn!==a)&&(vs=null,Wa=jt()+500,Ho(o,a));do try{Bw();break}catch($){Dg(o,$)}while(!0);jf(),uc.current=w,Et=b,mn!==null?a=0:(En=null,Nn=0,a=bn)}if(a!==0){if(a===2&&(b=Jd(o),b!==0&&(m=b,a=vh(o,b))),a===1)throw u=dl,Ho(o,0),eo(o,m),Xn(o,jt()),u;if(a===6)eo(o,m);else{if(b=o.current.alternate,(m&30)===0&&!jw(b)&&(a=yc(o,m),a===2&&(w=Jd(o),w!==0&&(m=w,a=vh(o,w))),a===1))throw u=dl,Ho(o,0),eo(o,m),Xn(o,jt()),u;switch(o.finishedWork=b,o.finishedLanes=m,a){case 0:case 1:throw Error(n(345));case 2:Uo(o,Kn,vs);break;case 3:if(eo(o,m),(m&130023424)===m&&(a=gh+500-jt(),10<a)){if(ku(o,0)!==0)break;if(b=o.suspendedLanes,(b&m)!==m){Un(),o.pingedLanes|=o.suspendedLanes&b;break}o.timeoutHandle=Cf(Uo.bind(null,o,Kn,vs),a);break}Uo(o,Kn,vs);break;case 4:if(eo(o,m),(m&4194240)===m)break;for(a=o.eventTimes,b=-1;0<m;){var L=31-Ar(m);w=1<<L,L=a[L],L>b&&(b=L),m&=~w}if(m=b,m=jt()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*Pw(m/1960))-m,10<m){o.timeoutHandle=Cf(Uo.bind(null,o,Kn,vs),m);break}Uo(o,Kn,vs);break;case 5:Uo(o,Kn,vs);break;default:throw Error(n(329))}}}return Xn(o,jt()),o.callbackNode===u?Ng.bind(null,o):null}function vh(o,a){var u=fl;return o.current.memoizedState.isDehydrated&&(Ho(o,a).flags|=256),o=yc(o,a),o!==2&&(a=Kn,Kn=u,a!==null&&Eh(a)),o}function Eh(o){Kn===null?Kn=o:Kn.push.apply(Kn,o)}function jw(o){for(var a=o;;){if(a.flags&16384){var u=a.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var m=0;m<u.length;m++){var b=u[m],w=b.getSnapshot;b=b.value;try{if(!Ir(w(),b))return!1}catch{return!1}}}if(u=a.child,a.subtreeFlags&16384&&u!==null)u.return=a,a=u;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&=~yh,a&=~cc,o.suspendedLanes|=a,o.pingedLanes&=~a,o=o.expirationTimes;0<a;){var u=31-Ar(a),m=1<<u;o[u]=-1,a&=~m}}function _g(o){if((Et&6)!==0)throw Error(n(327));Ya();var a=ku(o,0);if((a&1)===0)return Xn(o,jt()),null;var u=yc(o,a);if(o.tag!==0&&u===2){var m=Jd(o);m!==0&&(a=m,u=vh(o,m))}if(u===1)throw u=dl,Ho(o,0),eo(o,a),Xn(o,jt()),u;if(u===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=a,Uo(o,Kn,vs),Xn(o,jt()),null}function Th(o,a){var u=Et;Et|=1;try{return o(a)}finally{Et=u,Et===0&&(Wa=jt()+500,Wu&&Vs())}}function Bo(o){Js!==null&&Js.tag===0&&(Et&6)===0&&Ya();var a=Et;Et|=1;var u=vr.transition,m=Ot;try{if(vr.transition=null,Ot=1,o)return o()}finally{Ot=m,vr.transition=u,Et=a,(Et&6)===0&&Vs()}}function wh(){ur=za.current,zt(za)}function Ho(o,a){o.finishedWork=null,o.finishedLanes=0;var u=o.timeoutHandle;if(u!==-1&&(o.timeoutHandle=-1,hw(u)),mn!==null)for(u=mn.return;u!==null;){var m=u;switch(If(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&Uu();break;case 3:Ba(),zt(Vn),zt(An),$f();break;case 5:Wf(m);break;case 4:Ba();break;case 13:zt(Qt);break;case 19:zt(Qt);break;case 10:Ff(m.type._context);break;case 22:case 23:wh()}u=u.return}if(En=o,mn=o=to(o.current,null),Nn=ur=a,bn=0,dl=null,yh=cc=Fo=0,Kn=fl=null,Ro!==null){for(a=0;a<Ro.length;a++)if(u=Ro[a],m=u.interleaved,m!==null){u.interleaved=null;var b=m.next,w=u.pending;if(w!==null){var L=w.next;w.next=b,m.next=L}u.pending=m}Ro=null}return o}function Dg(o,a){do{var u=mn;try{if(jf(),Zu.current=rc,ec){for(var m=Gt.memoizedState;m!==null;){var b=m.queue;b!==null&&(b.pending=null),m=m.next}ec=!1}if(jo=0,vn=xn=Gt=null,ol=!1,al=0,ph.current=null,u===null||u.return===null){bn=1,dl=a,mn=null;break}e:{var w=o,L=u.return,$=u,K=a;if(a=Nn,$.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var ce=K,we=$,Se=we.tag;if((we.mode&1)===0&&(Se===0||Se===11||Se===15)){var Ee=we.alternate;Ee?(we.updateQueue=Ee.updateQueue,we.memoizedState=Ee.memoizedState,we.lanes=Ee.lanes):(we.updateQueue=null,we.memoizedState=null)}var je=eg(L);if(je!==null){je.flags&=-257,tg(je,L,$,w,a),je.mode&1&&Zy(w,ce,a),a=je,K=ce;var qe=a.updateQueue;if(qe===null){var Ve=new Set;Ve.add(K),a.updateQueue=Ve}else qe.add(K);break e}else{if((a&1)===0){Zy(w,ce,a),kh();break e}K=Error(n(426))}}else if(qt&&$.mode&1){var ln=eg(L);if(ln!==null){(ln.flags&65536)===0&&(ln.flags|=256),tg(ln,L,$,w,a),Rf(Ha(K,$));break e}}w=K=Ha(K,$),bn!==4&&(bn=2),fl===null?fl=[w]:fl.push(w),w=L;do{switch(w.tag){case 3:w.flags|=65536,a&=-a,w.lanes|=a;var ne=Xy(w,K,a);ky(w,ne);break e;case 1:$=K;var X=w.type,oe=w.stateNode;if((w.flags&128)===0&&(typeof X.getDerivedStateFromError=="function"||oe!==null&&typeof oe.componentDidCatch=="function"&&(Xs===null||!Xs.has(oe)))){w.flags|=65536,a&=-a,w.lanes|=a;var Ae=Jy(w,$,a);ky(w,Ae);break e}}w=w.return}while(w!==null)}Ig(u)}catch(Qe){a=Qe,mn===u&&u!==null&&(mn=u=u.return);continue}break}while(!0)}function Og(){var o=uc.current;return uc.current=rc,o===null?rc:o}function kh(){(bn===0||bn===3||bn===2)&&(bn=4),En===null||(Fo&268435455)===0&&(cc&268435455)===0||eo(En,Nn)}function yc(o,a){var u=Et;Et|=2;var m=Og();(En!==o||Nn!==a)&&(vs=null,Ho(o,a));do try{Fw();break}catch(b){Dg(o,b)}while(!0);if(jf(),Et=u,uc.current=m,mn!==null)throw Error(n(261));return En=null,Nn=0,bn}function Fw(){for(;mn!==null;)Ag(mn)}function Bw(){for(;mn!==null&&!Ri();)Ag(mn)}function Ag(o){var a=Rg(o.alternate,o,ur);o.memoizedProps=o.pendingProps,a===null?Ig(o):mn=a,ph.current=null}function Ig(o){var a=o;do{var u=a.alternate;if(o=a.return,(a.flags&32768)===0){if(u=Aw(u,a,ur),u!==null){mn=u;return}}else{if(u=Iw(u,a),u!==null){u.flags&=32767,mn=u;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{bn=6,mn=null;return}}if(a=a.sibling,a!==null){mn=a;return}mn=a=o}while(a!==null);bn===0&&(bn=5)}function Uo(o,a,u){var m=Ot,b=vr.transition;try{vr.transition=null,Ot=1,Hw(o,a,u,m)}finally{vr.transition=b,Ot=m}return null}function Hw(o,a,u,m){do Ya();while(Js!==null);if((Et&6)!==0)throw Error(n(327));u=o.finishedWork;var b=o.finishedLanes;if(u===null)return null;if(o.finishedWork=null,o.finishedLanes=0,u===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var w=u.lanes|u.childLanes;if(vT(o,w),o===En&&(mn=En=null,Nn=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||fc||(fc=!0,Pg(vu,function(){return Ya(),null})),w=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||w){w=vr.transition,vr.transition=null;var L=Ot;Ot=1;var $=Et;Et|=4,ph.current=null,Lw(o,u),Tg(u,o),aw(kf),Nu=!!wf,kf=wf=null,o.current=u,Rw(u),Ta(),Et=$,Ot=L,vr.transition=w}else o.current=u;if(fc&&(fc=!1,Js=o,hc=b),w=o.pendingLanes,w===0&&(Xs=null),mT(u.stateNode),Xn(o,jt()),a!==null)for(m=o.onRecoverableError,u=0;u<a.length;u++)b=a[u],m(b.value,{componentStack:b.stack,digest:b.digest});if(dc)throw dc=!1,o=xh,xh=null,o;return(hc&1)!==0&&o.tag!==0&&Ya(),w=o.pendingLanes,(w&1)!==0?o===bh?hl++:(hl=0,bh=o):hl=0,Vs(),null}function Ya(){if(Js!==null){var o=vp(hc),a=vr.transition,u=Ot;try{if(vr.transition=null,Ot=16>o?16:o,Js===null)var m=!1;else{if(o=Js,Js=null,hc=0,(Et&6)!==0)throw Error(n(331));var b=Et;for(Et|=4,He=o.current;He!==null;){var w=He,L=w.child;if((He.flags&16)!==0){var $=w.deletions;if($!==null){for(var K=0;K<$.length;K++){var ce=$[K];for(He=ce;He!==null;){var we=He;switch(we.tag){case 0:case 11:case 15:cl(8,we,w)}var Se=we.child;if(Se!==null)Se.return=we,He=Se;else for(;He!==null;){we=He;var Ee=we.sibling,je=we.return;if(gg(we),we===ce){He=null;break}if(Ee!==null){Ee.return=je,He=Ee;break}He=je}}}var qe=w.alternate;if(qe!==null){var Ve=qe.child;if(Ve!==null){qe.child=null;do{var ln=Ve.sibling;Ve.sibling=null,Ve=ln}while(Ve!==null)}}He=w}}if((w.subtreeFlags&2064)!==0&&L!==null)L.return=w,He=L;else e:for(;He!==null;){if(w=He,(w.flags&2048)!==0)switch(w.tag){case 0:case 11:case 15:cl(9,w,w.return)}var ne=w.sibling;if(ne!==null){ne.return=w.return,He=ne;break e}He=w.return}}var X=o.current;for(He=X;He!==null;){L=He;var oe=L.child;if((L.subtreeFlags&2064)!==0&&oe!==null)oe.return=L,He=oe;else e:for(L=X;He!==null;){if($=He,($.flags&2048)!==0)try{switch($.tag){case 0:case 11:case 15:lc(9,$)}}catch(Qe){rn($,$.return,Qe)}if($===L){He=null;break e}var Ae=$.sibling;if(Ae!==null){Ae.return=$.return,He=Ae;break e}He=$.return}}if(Et=b,Vs(),Qr&&typeof Qr.onPostCommitFiberRoot=="function")try{Qr.onPostCommitFiberRoot(Eu,o)}catch{}m=!0}return m}finally{Ot=u,vr.transition=a}}return!1}function Mg(o,a,u){a=Ha(u,a),a=Xy(o,a,1),o=Gs(o,a,1),a=Un(),o!==null&&(ji(o,1,a),Xn(o,a))}function rn(o,a,u){if(o.tag===3)Mg(o,o,u);else for(;a!==null;){if(a.tag===3){Mg(a,o,u);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=Ha(u,o),o=Jy(a,o,1),a=Gs(a,o,1),o=Un(),a!==null&&(ji(a,1,o),Xn(a,o));break}}a=a.return}}function Uw(o,a,u){var m=o.pingCache;m!==null&&m.delete(a),a=Un(),o.pingedLanes|=o.suspendedLanes&u,En===o&&(Nn&u)===u&&(bn===4||bn===3&&(Nn&130023424)===Nn&&500>jt()-gh?Ho(o,0):yh|=u),Xn(o,a)}function Lg(o,a){a===0&&((o.mode&1)===0?a=1:(a=wu,wu<<=1,(wu&130023424)===0&&(wu=4194304)));var u=Un();o=gs(o,a),o!==null&&(ji(o,a,u),Xn(o,u))}function zw(o){var a=o.memoizedState,u=0;a!==null&&(u=a.retryLane),Lg(o,u)}function Ww(o,a){var u=0;switch(o.tag){case 13:var m=o.stateNode,b=o.memoizedState;b!==null&&(u=b.retryLane);break;case 19:m=o.stateNode;break;default:throw Error(n(314))}m!==null&&m.delete(a),Lg(o,u)}var Rg;Rg=function(o,a,u){if(o!==null)if(o.memoizedProps!==a.pendingProps||Vn.current)Gn=!0;else{if((o.lanes&u)===0&&(a.flags&128)===0)return Gn=!1,Ow(o,a,u);Gn=(o.flags&131072)!==0}else Gn=!1,qt&&(a.flags&1048576)!==0&&my(a,$u,a.index);switch(a.lanes=0,a.tag){case 2:var m=a.type;ac(o,a),o=a.pendingProps;var b=Ia(a,An.current);Fa(a,u),b=Qf(null,a,m,o,b,u);var w=Gf();return a.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,Qn(m)?(w=!0,zu(a)):w=!1,a.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,Uf(a),b.updater=sc,a.stateNode=b,b._reactInternals=a,th(a,m,o,u),a=oh(null,a,m,!0,w,u)):(a.tag=0,qt&&w&&Af(a),Hn(null,a,b,u),a=a.child),a;case 16:m=a.elementType;e:{switch(ac(o,a),o=a.pendingProps,b=m._init,m=b(m._payload),a.type=m,b=a.tag=$w(m),o=Lr(m,o),b){case 0:a=sh(null,a,m,o,u);break e;case 1:a=ig(null,a,m,o,u);break e;case 11:a=ng(null,a,m,o,u);break e;case 14:a=rg(null,a,m,Lr(m.type,o),u);break e}throw Error(n(306,m,""))}return a;case 0:return m=a.type,b=a.pendingProps,b=a.elementType===m?b:Lr(m,b),sh(o,a,m,b,u);case 1:return m=a.type,b=a.pendingProps,b=a.elementType===m?b:Lr(m,b),ig(o,a,m,b,u);case 3:e:{if(lg(a),o===null)throw Error(n(387));m=a.pendingProps,w=a.memoizedState,b=w.element,wy(o,a),Xu(a,m,null,u);var L=a.memoizedState;if(m=L.element,w.isDehydrated)if(w={element:m,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},a.updateQueue.baseState=w,a.memoizedState=w,a.flags&256){b=Ha(Error(n(423)),a),a=ug(o,a,m,u,b);break e}else if(m!==b){b=Ha(Error(n(424)),a),a=ug(o,a,m,u,b);break e}else for(lr=Ys(a.stateNode.containerInfo.firstChild),ir=a,qt=!0,Mr=null,u=Ey(a,null,m,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Ra(),m===b){a=bs(o,a,u);break e}Hn(o,a,m,u)}a=a.child}return a;case 5:return Cy(a),o===null&&Lf(a),m=a.type,b=a.pendingProps,w=o!==null?o.memoizedProps:null,L=b.children,Sf(m,b)?L=null:w!==null&&Sf(m,w)&&(a.flags|=32),ag(o,a),Hn(o,a,L,u),a.child;case 6:return o===null&&Lf(a),null;case 13:return cg(o,a,u);case 4:return zf(a,a.stateNode.containerInfo),m=a.pendingProps,o===null?a.child=Pa(a,null,m,u):Hn(o,a,m,u),a.child;case 11:return m=a.type,b=a.pendingProps,b=a.elementType===m?b:Lr(m,b),ng(o,a,m,b,u);case 7:return Hn(o,a,a.pendingProps,u),a.child;case 8:return Hn(o,a,a.pendingProps.children,u),a.child;case 12:return Hn(o,a,a.pendingProps.children,u),a.child;case 10:e:{if(m=a.type._context,b=a.pendingProps,w=a.memoizedProps,L=b.value,Ft(Qu,m._currentValue),m._currentValue=L,w!==null)if(Ir(w.value,L)){if(w.children===b.children&&!Vn.current){a=bs(o,a,u);break e}}else for(w=a.child,w!==null&&(w.return=a);w!==null;){var $=w.dependencies;if($!==null){L=w.child;for(var K=$.firstContext;K!==null;){if(K.context===m){if(w.tag===1){K=xs(-1,u&-u),K.tag=2;var ce=w.updateQueue;if(ce!==null){ce=ce.shared;var we=ce.pending;we===null?K.next=K:(K.next=we.next,we.next=K),ce.pending=K}}w.lanes|=u,K=w.alternate,K!==null&&(K.lanes|=u),Bf(w.return,u,a),$.lanes|=u;break}K=K.next}}else if(w.tag===10)L=w.type===a.type?null:w.child;else if(w.tag===18){if(L=w.return,L===null)throw Error(n(341));L.lanes|=u,$=L.alternate,$!==null&&($.lanes|=u),Bf(L,u,a),L=w.sibling}else L=w.child;if(L!==null)L.return=w;else for(L=w;L!==null;){if(L===a){L=null;break}if(w=L.sibling,w!==null){w.return=L.return,L=w;break}L=L.return}w=L}Hn(o,a,b.children,u),a=a.child}return a;case 9:return b=a.type,m=a.pendingProps.children,Fa(a,u),b=xr(b),m=m(b),a.flags|=1,Hn(o,a,m,u),a.child;case 14:return m=a.type,b=Lr(m,a.pendingProps),b=Lr(m.type,b),rg(o,a,m,b,u);case 15:return sg(o,a,a.type,a.pendingProps,u);case 17:return m=a.type,b=a.pendingProps,b=a.elementType===m?b:Lr(m,b),ac(o,a),a.tag=1,Qn(m)?(o=!0,zu(a)):o=!1,Fa(a,u),Gy(a,m,b),th(a,m,b,u),oh(null,a,m,!0,o,u);case 19:return fg(o,a,u);case 22:return og(o,a,u)}throw Error(n(156,a.tag))};function Pg(o,a){return Do(o,a)}function Yw(o,a,u,m){this.tag=o,this.key=u,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 Er(o,a,u,m){return new Yw(o,a,u,m)}function Sh(o){return o=o.prototype,!(!o||!o.isReactComponent)}function $w(o){if(typeof o=="function")return Sh(o)?1:0;if(o!=null){if(o=o.$$typeof,o===U)return 11;if(o===G)return 14}return 2}function to(o,a){var u=o.alternate;return u===null?(u=Er(o.tag,a,o.key,o.mode),u.elementType=o.elementType,u.type=o.type,u.stateNode=o.stateNode,u.alternate=o,o.alternate=u):(u.pendingProps=a,u.type=o.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=o.flags&14680064,u.childLanes=o.childLanes,u.lanes=o.lanes,u.child=o.child,u.memoizedProps=o.memoizedProps,u.memoizedState=o.memoizedState,u.updateQueue=o.updateQueue,a=o.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=o.sibling,u.index=o.index,u.ref=o.ref,u}function gc(o,a,u,m,b,w){var L=2;if(m=o,typeof o=="function")Sh(o)&&(L=1);else if(typeof o=="string")L=5;else e:switch(o){case I:return zo(u.children,b,w,a);case _:L=8,b|=8;break;case P:return o=Er(12,u,a,b|2),o.elementType=P,o.lanes=w,o;case Y:return o=Er(13,u,a,b),o.elementType=Y,o.lanes=w,o;case q:return o=Er(19,u,a,b),o.elementType=q,o.lanes=w,o;case he:return xc(u,b,w,a);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case F:L=10;break e;case H:L=9;break e;case U:L=11;break e;case G:L=14;break e;case ee:L=16,m=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return a=Er(L,u,a,b),a.elementType=o,a.type=m,a.lanes=w,a}function zo(o,a,u,m){return o=Er(7,o,m,a),o.lanes=u,o}function xc(o,a,u,m){return o=Er(22,o,m,a),o.elementType=he,o.lanes=u,o.stateNode={isHidden:!1},o}function Ch(o,a,u){return o=Er(6,o,null,a),o.lanes=u,o}function Nh(o,a,u){return a=Er(4,o.children!==null?o.children:[],o.key,a),a.lanes=u,a.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},a}function qw(o,a,u,m,b){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=Zd(0),this.expirationTimes=Zd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zd(0),this.identifierPrefix=m,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function _h(o,a,u,m,b,w,L,$,K){return o=new qw(o,a,u,$,K),a===1?(a=1,w===!0&&(a|=8)):a=0,w=Er(3,null,null,a),o.current=w,w.stateNode=o,w.memoizedState={element:m,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Uf(w),o}function Vw(o,a,u){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:S,key:m==null?null:""+m,children:o,containerInfo:a,implementation:u}}function jg(o){if(!o)return qs;o=o._reactInternals;e:{if(Rt(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(Qn(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(n(171))}if(o.tag===1){var u=o.type;if(Qn(u))return dy(o,u,a)}return a}function Fg(o,a,u,m,b,w,L,$,K){return o=_h(u,m,!0,o,b,w,L,$,K),o.context=jg(null),u=o.current,m=Un(),b=Zs(u),w=xs(m,b),w.callback=a??null,Gs(u,w,b),o.current.lanes=b,ji(o,b,m),Xn(o,m),o}function bc(o,a,u,m){var b=a.current,w=Un(),L=Zs(b);return u=jg(u),a.context===null?a.context=u:a.pendingContext=u,a=xs(w,L),a.payload={element:o},m=m===void 0?null:m,m!==null&&(a.callback=m),o=Gs(b,a,L),o!==null&&(jr(o,b,L,w),Ku(o,b,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 Bg(o,a){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var u=o.retryLane;o.retryLane=u!==0&&u<a?u:a}}function Dh(o,a){Bg(o,a),(o=o.alternate)&&Bg(o,a)}function Qw(){return null}var Hg=typeof reportError=="function"?reportError:function(o){console.error(o)};function Oh(o){this._internalRoot=o}Ec.prototype.render=Oh.prototype.render=function(o){var a=this._internalRoot;if(a===null)throw Error(n(409));bc(o,a,null,null)},Ec.prototype.unmount=Oh.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[hs]=null}};function Ec(o){this._internalRoot=o}Ec.prototype.unstable_scheduleHydration=function(o){if(o){var a=wp();o={blockedOn:null,target:o,priority:a};for(var u=0;u<Us.length&&a!==0&&a<Us[u].priority;u++);Us.splice(u,0,o),u===0&&Cp(o)}};function Ah(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 Ug(){}function Gw(o,a,u,m,b){if(b){if(typeof m=="function"){var w=m;m=function(){var ce=vc(L);w.call(ce)}}var L=Fg(a,m,o,0,null,!1,!1,"",Ug);return o._reactRootContainer=L,o[hs]=L.current,Xi(o.nodeType===8?o.parentNode:o),Bo(),L}for(;b=o.lastChild;)o.removeChild(b);if(typeof m=="function"){var $=m;m=function(){var ce=vc(K);$.call(ce)}}var K=_h(o,0,!1,null,null,!1,!1,"",Ug);return o._reactRootContainer=K,o[hs]=K.current,Xi(o.nodeType===8?o.parentNode:o),Bo(function(){bc(a,K,u,m)}),K}function wc(o,a,u,m,b){var w=u._reactRootContainer;if(w){var L=w;if(typeof b=="function"){var $=b;b=function(){var K=vc(L);$.call(K)}}bc(a,L,o,b)}else L=Gw(u,a,o,b,m);return vc(L)}Ep=function(o){switch(o.tag){case 3:var a=o.stateNode;if(a.current.memoizedState.isDehydrated){var u=Pi(a.pendingLanes);u!==0&&(ef(a,u|1),Xn(a,jt()),(Et&6)===0&&(Wa=jt()+500,Vs()))}break;case 13:Bo(function(){var m=gs(o,1);if(m!==null){var b=Un();jr(m,o,1,b)}}),Dh(o,1)}},tf=function(o){if(o.tag===13){var a=gs(o,134217728);if(a!==null){var u=Un();jr(a,o,134217728,u)}Dh(o,134217728)}},Tp=function(o){if(o.tag===13){var a=Zs(o),u=gs(o,a);if(u!==null){var m=Un();jr(u,o,a,m)}Dh(o,a)}},wp=function(){return Ot},kp=function(o,a){var u=Ot;try{return Ot=o,a()}finally{Ot=u}},Xe=function(o,a,u){switch(a){case"input":if(me(o,u),a=u.name,u.type==="radio"&&a!=null){for(u=o;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),a=0;a<u.length;a++){var m=u[a];if(m!==o&&m.form===o.form){var b=Hu(m);if(!b)throw Error(n(90));Pe(m),me(m,b)}}}break;case"textarea":ct(o,u);break;case"select":a=u.value,a!=null&&be(o,!!u.multiple,a,!1)}},Yt=Th,en=Bo;var Kw={usingClientEntryPoint:!1,Events:[el,Oa,Hu,pt,We,Th]},ml={findFiberByHostInstance:Ao,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Xw={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=pr(o),o===null?null:o.stateNode},findFiberByHostInstance:ml.findFiberByHostInstance||Qw,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(Xw),Qr=kc}catch{}}return Jn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Kw,Jn.createPortal=function(o,a){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ah(a))throw Error(n(200));return Vw(o,a,null,u)},Jn.createRoot=function(o,a){if(!Ah(o))throw Error(n(299));var u=!1,m="",b=Hg;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onRecoverableError!==void 0&&(b=a.onRecoverableError)),a=_h(o,1,!1,null,null,u,!1,m,b),o[hs]=a.current,Xi(o.nodeType===8?o.parentNode:o),new Oh(a)},Jn.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=pr(a),o=o===null?null:o.stateNode,o},Jn.flushSync=function(o){return Bo(o)},Jn.hydrate=function(o,a,u){if(!Tc(a))throw Error(n(200));return wc(null,o,a,!0,u)},Jn.hydrateRoot=function(o,a,u){if(!Ah(o))throw Error(n(405));var m=u!=null&&u.hydratedSources||null,b=!1,w="",L=Hg;if(u!=null&&(u.unstable_strictMode===!0&&(b=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(L=u.onRecoverableError)),a=Fg(a,null,o,1,u??null,b,!1,w,L),o[hs]=a.current,Xi(o),m)for(o=0;o<m.length;o++)u=m[o],b=u._getVersion,b=b(u._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[u,b]:a.mutableSourceEagerHydrationData.push(u,b);return new Ec(a)},Jn.render=function(o,a,u){if(!Tc(a))throw Error(n(200));return wc(null,o,a,!1,u)},Jn.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[hs]=null})}),!0):!1},Jn.unstable_batchedUpdates=Th,Jn.unstable_renderSubtreeIntoContainer=function(o,a,u,m){if(!Tc(u))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return wc(o,a,u,!1,m)},Jn.version="18.3.1-next-f1338f8080-20240426",Jn}var Qg;function md(){if(Qg)return Lh.exports;Qg=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(),Lh.exports=ak(),Lh.exports}var Gg;function ik(){if(Gg)return Cc;Gg=1;var e=md();return Cc.createRoot=e.createRoot,Cc.hydrateRoot=e.hydrateRoot,Cc}var lk=ik(),ma=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(){}},uk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},co,cm,yb,ck=(yb=class{constructor(){Be(this,co,uk);Be(this,cm,!1)}setTimeoutProvider(e){Ie(this,co,e)}setTimeout(e,t){return W(this,co).setTimeout(e,t)}clearTimeout(e){W(this,co).clearTimeout(e)}setInterval(e,t){return W(this,co).setInterval(e,t)}clearInterval(e){W(this,co).clearInterval(e)}},co=new WeakMap,cm=new WeakMap,yb),qo=new ck;function dk(e){setTimeout(e,0)}var ia=typeof window>"u"||"Deno"in globalThis;function Pn(){}function fk(e,t){return typeof e=="function"?e(t):e}function b0(e){return typeof e=="number"&&e>=0&&e!==1/0}function Db(e,t){return Math.max(e+(t||0)-Date.now(),0)}function wo(e,t){return typeof e=="function"?e(t):e}function Cr(e,t){return typeof e=="function"?e(t):e}function Kg(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==dm(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 c=="boolean"&&t.isStale()!==c||s&&s!==t.state.fetchStatus||i&&!i(t))}function Xg(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 dm(e,t){return((t==null?void 0:t.queryKeyHashFn)||la)(e)}function la(e){return JSON.stringify(e,(t,n)=>v0(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 hk=Object.prototype.hasOwnProperty;function fm(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Jg(e)&&Jg(t);if(!r&&!(v0(e)&&v0(t)))return t;const i=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,f=r?new Array(c):{};let h=0;for(let p=0;p<c;p++){const y=r?p:l[p],g=e[y],v=t[y];if(g===v){f[y]=g,(r?p<i:hk.call(e,y))&&h++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){f[y]=v;continue}const D=fm(g,v,n+1);f[y]=D,D===g&&h++}return i===c&&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 Jg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function v0(e){if(!Zg(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Zg(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Zg(e){return Object.prototype.toString.call(e)==="[object Object]"}function mk(e){return new Promise(t=>{qo.setTimeout(t,e)})}function E0(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?fm(e,t):t}function pk(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function yk(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var hm=Symbol();function Ob(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===hm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function mm(e,t){return typeof e=="function"?e(...t):!!e}function gk(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,ti,gb,xk=(gb=class extends ma{constructor(){super();Be(this,Ko);Be(this,fo);Be(this,ti);Ie(this,ti,t=>{if(!ia&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,fo)||this.setEventListener(W(this,ti))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,fo))==null||t.call(this),Ie(this,fo,void 0))}setEventListener(t){var n;Ie(this,ti,t),(n=W(this,fo))==null||n.call(this),Ie(this,fo,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,Ko)!==t&&(Ie(this,Ko,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,Ko)=="boolean"?W(this,Ko):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ko=new WeakMap,fo=new WeakMap,ti=new WeakMap,gb),pm=new xk;function T0(){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 bk=dk;function vk(){let e=[],t=0,n=c=>{c()},r=c=>{c()},s=bk;const i=c=>{t?e.push(c):s(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&s(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},batchCalls:c=>(...f)=>{i(()=>{c(...f)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{s=c}}}var Xt=vk(),ni,ho,ri,xb,Ek=(xb=class extends ma{constructor(){super();Be(this,ni,!0);Be(this,ho);Be(this,ri);Ie(this,ri,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(){W(this,ho)||this.setEventListener(W(this,ri))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,ho))==null||t.call(this),Ie(this,ho,void 0))}setEventListener(t){var n;Ie(this,ri,t),(n=W(this,ho))==null||n.call(this),Ie(this,ho,t(this.setOnline.bind(this)))}setOnline(t){W(this,ni)!==t&&(Ie(this,ni,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,ni)}},ni=new WeakMap,ho=new WeakMap,ri=new WeakMap,xb),Qc=new Ek;function Tk(e){return Math.min(1e3*2**e,3e4)}function Ab(e){return(e??"online")==="online"?Qc.isOnline():!0}var w0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ib(e){let t=!1,n=0,r;const s=T0(),i=()=>s.status!=="pending",l=k=>{var T;if(!i()){const E=new w0(k);g(E),(T=e.onCancel)==null||T.call(e,E)}},c=()=>{t=!0},f=()=>{t=!1},h=()=>pm.isFocused()&&(e.networkMode==="always"||Qc.isOnline())&&e.canRun(),p=()=>Ab(e.networkMode)&&e.canRun(),y=k=>{i()||(r==null||r(),s.resolve(k))},g=k=>{i()||(r==null||r(),s.reject(k))},v=()=>new Promise(k=>{var T;r=E=>{(i()||h())&&k(E)},(T=e.onPause)==null||T.call(e)}).then(()=>{var k;r=void 0,i()||(k=e.onContinue)==null||k.call(e)}),D=()=>{if(i())return;let k;const T=n===0?e.initialPromise:void 0;try{k=T??e.fn()}catch(E){k=Promise.reject(E)}Promise.resolve(k).then(y).catch(E=>{var S;if(i())return;const N=e.retry??(ia?0:3),O=e.retryDelay??Tk,A=typeof O=="function"?O(n,E):O,R=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,E);if(t||!R){g(E);return}n++,(S=e.onFail)==null||S.call(e,n,E),mk(A).then(()=>h()?void 0:v()).then(()=>{t?g(E):D()})})};return{promise:s,status:()=>s.status,cancel:l,continue:()=>(r==null||r(),s),cancelRetry:c,continueRetry:f,canStart:p,start:()=>(p()?D():v().then(D),s)}}var Xo,bb,Mb=(bb=class{constructor(){Be(this,Xo)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),b0(this.gcTime)&&Ie(this,Xo,qo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ia?1/0:300*1e3))}clearGcTimeout(){W(this,Xo)&&(qo.clearTimeout(W(this,Xo)),Ie(this,Xo,void 0))}},Xo=new WeakMap,bb),Jo,si,wr,Zo,kn,tu,ea,Hr,Ts,vb,wk=(vb=class extends Mb{constructor(t){super();Be(this,Hr);Be(this,Jo);Be(this,si);Be(this,wr);Be(this,Zo);Be(this,kn);Be(this,tu);Be(this,ea);Ie(this,ea,!1),Ie(this,tu,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ie(this,Zo,t.client),Ie(this,wr,W(this,Zo).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ie(this,Jo,t1(this.options)),this.state=t.state??W(this,Jo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=W(this,kn))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,tu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=t1(this.options);n.data!==void 0&&(this.setState(e1(n.data,n.dataUpdatedAt)),Ie(this,Jo,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,wr).remove(this)}setData(t,n){const r=E0(this.state.data,t,this.options);return st(this,Hr,Ts).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){st(this,Hr,Ts).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=W(this,kn))==null?void 0:r.promise;return(s=W(this,kn))==null||s.cancel(t),n?n.then(Pn).catch(Pn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(W(this,Jo))}isActive(){return this.observers.some(t=>Cr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hm||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:!Db(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,kn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,kn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,wr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(W(this,kn)&&(W(this,ea)?W(this,kn).cancel({revert:!0}):W(this,kn).cancelRetry()),this.scheduleGc()),W(this,wr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||st(this,Hr,Ts).call(this,{type:"invalidate"})}async fetch(t,n){var f,h,p,y,g,v,D,k,T,E,N,O;if(this.state.fetchStatus!=="idle"&&((f=W(this,kn))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,kn))return W(this,kn).continueRetry(),W(this,kn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const A=this.observers.find(R=>R.options.queryFn);A&&this.setOptions(A.options)}const r=new AbortController,s=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(Ie(this,ea,!0),r.signal)})},i=()=>{const A=Ob(this.options,n),S=(()=>{const I={client:W(this,Zo),queryKey:this.queryKey,meta:this.meta};return s(I),I})();return Ie(this,ea,!1),this.options.persister?this.options.persister(A,S,this):A(S)},c=(()=>{const A={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,Zo),state:this.state,fetchFn:i};return s(A),A})();(h=this.options.behavior)==null||h.onFetch(c,this),Ie(this,si,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=c.fetchOptions)==null?void 0:p.meta))&&st(this,Hr,Ts).call(this,{type:"fetch",meta:(y=c.fetchOptions)==null?void 0:y.meta}),Ie(this,kn,Ib({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:A=>{A instanceof w0&&A.revert&&this.setState({...W(this,si),fetchStatus:"idle"}),r.abort()},onFail:(A,R)=>{st(this,Hr,Ts).call(this,{type:"failed",failureCount:A,error:R})},onPause:()=>{st(this,Hr,Ts).call(this,{type:"pause"})},onContinue:()=>{st(this,Hr,Ts).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const A=await W(this,kn).start();if(A===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(A),(v=(g=W(this,wr).config).onSuccess)==null||v.call(g,A,this),(k=(D=W(this,wr).config).onSettled)==null||k.call(D,A,this.state.error,this),A}catch(A){if(A instanceof w0){if(A.silent)return W(this,kn).promise;if(A.revert){if(this.state.data===void 0)throw A;return this.state.data}}throw st(this,Hr,Ts).call(this,{type:"error",error:A}),(E=(T=W(this,wr).config).onError)==null||E.call(T,A,this),(O=(N=W(this,wr).config).onSettled)==null||O.call(N,this.state.data,A,this),A}finally{this.scheduleGc()}}},Jo=new WeakMap,si=new WeakMap,wr=new WeakMap,Zo=new WeakMap,kn=new WeakMap,tu=new WeakMap,ea=new WeakMap,Hr=new WeakSet,Ts=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,...Lb(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...e1(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ie(this,si,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),Xt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,wr).notify({query:this,type:"updated",action:t})})},vb);function Lb(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ab(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function e1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function t1(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 tr,vt,nu,zn,ta,oi,Ss,mo,ru,ai,ii,na,ra,po,li,_t,Pl,k0,S0,C0,N0,_0,D0,O0,Rb,Eb,ym=(Eb=class extends ma{constructor(t,n){super();Be(this,_t);Be(this,tr);Be(this,vt);Be(this,nu);Be(this,zn);Be(this,ta);Be(this,oi);Be(this,Ss);Be(this,mo);Be(this,ru);Be(this,ai);Be(this,ii);Be(this,na);Be(this,ra);Be(this,po);Be(this,li,new Set);this.options=n,Ie(this,tr,t),Ie(this,mo,null),Ie(this,Ss,T0()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,vt).addObserver(this),n1(W(this,vt),this.options)?st(this,_t,Pl).call(this):this.updateResult(),st(this,_t,N0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return A0(W(this,vt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return A0(W(this,vt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,st(this,_t,_0).call(this),st(this,_t,D0).call(this),W(this,vt).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,vt);if(this.options=W(this,tr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Cr(this.options.enabled,W(this,vt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");st(this,_t,O0).call(this),W(this,vt).setOptions(this.options),n._defaulted&&!Kl(this.options,n)&&W(this,tr).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,vt),observer:this});const s=this.hasListeners();s&&r1(W(this,vt),r,this.options,n)&&st(this,_t,Pl).call(this),this.updateResult(),s&&(W(this,vt)!==r||Cr(this.options.enabled,W(this,vt))!==Cr(n.enabled,W(this,vt))||wo(this.options.staleTime,W(this,vt))!==wo(n.staleTime,W(this,vt)))&&st(this,_t,k0).call(this);const i=st(this,_t,S0).call(this);s&&(W(this,vt)!==r||Cr(this.options.enabled,W(this,vt))!==Cr(n.enabled,W(this,vt))||i!==W(this,po))&&st(this,_t,C0).call(this,i)}getOptimisticResult(t){const n=W(this,tr).getQueryCache().build(W(this,tr),t),r=this.createResult(n,t);return Sk(this,r)&&(Ie(this,zn,r),Ie(this,oi,this.options),Ie(this,ta,W(this,vt).state)),r}getCurrentResult(){return W(this,zn)}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&&W(this,Ss).status==="pending"&&W(this,Ss).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){W(this,li).add(t)}getCurrentQuery(){return W(this,vt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,tr).defaultQueryOptions(t),r=W(this,tr).getQueryCache().build(W(this,tr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return st(this,_t,Pl).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,zn)))}createResult(t,n){var P;const r=W(this,vt),s=this.options,i=W(this,zn),l=W(this,ta),c=W(this,oi),h=t!==r?t.state:W(this,nu),{state:p}=t;let y={...p},g=!1,v;if(n._optimisticResults){const F=this.hasListeners(),H=!F&&n1(t,n),U=F&&r1(t,r,n,s);(H||U)&&(y={...y,...Lb(p.data,t.options)}),n._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:D,errorUpdatedAt:k,status:T}=y;v=y.data;let E=!1;if(n.placeholderData!==void 0&&v===void 0&&T==="pending"){let F;i!=null&&i.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(F=i.data,E=!0):F=typeof n.placeholderData=="function"?n.placeholderData((P=W(this,ii))==null?void 0:P.state.data,W(this,ii)):n.placeholderData,F!==void 0&&(T="success",v=E0(i==null?void 0:i.data,F,n),g=!0)}if(n.select&&v!==void 0&&!E)if(i&&v===(l==null?void 0:l.data)&&n.select===W(this,ru))v=W(this,ai);else try{Ie(this,ru,n.select),v=n.select(v),v=E0(i==null?void 0:i.data,v,n),Ie(this,ai,v),Ie(this,mo,null)}catch(F){Ie(this,mo,F)}W(this,mo)&&(D=W(this,mo),v=W(this,ai),k=Date.now(),T="error");const N=y.fetchStatus==="fetching",O=T==="pending",A=T==="error",R=O&&N,S=v!==void 0,_={status:T,fetchStatus:y.fetchStatus,isPending:O,isSuccess:T==="success",isError:A,isInitialLoading:R,isLoading:R,data:v,dataUpdatedAt:y.dataUpdatedAt,error:D,errorUpdatedAt:k,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:N,isRefetching:N&&!O,isLoadingError:A&&!S,isPaused:y.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:A&&S,isStale:gm(t,n),refetch:this.refetch,promise:W(this,Ss),isEnabled:Cr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=_.data!==void 0,H=_.status==="error"&&!F,U=G=>{H?G.reject(_.error):F&&G.resolve(_.data)},Y=()=>{const G=Ie(this,Ss,_.promise=T0());U(G)},q=W(this,Ss);switch(q.status){case"pending":t.queryHash===r.queryHash&&U(q);break;case"fulfilled":(H||_.data!==q.value)&&Y();break;case"rejected":(!H||_.error!==q.reason)&&Y();break}}return _}updateResult(){const t=W(this,zn),n=this.createResult(W(this,vt),this.options);if(Ie(this,ta,W(this,vt).state),Ie(this,oi,this.options),W(this,ta).data!==void 0&&Ie(this,ii,W(this,vt)),Kl(n,t))return;Ie(this,zn,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!W(this,li).size)return!0;const l=new Set(i??W(this,li));return this.options.throwOnError&&l.add("error"),Object.keys(W(this,zn)).some(c=>{const f=c;return W(this,zn)[f]!==t[f]&&l.has(f)})};st(this,_t,Rb).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&st(this,_t,N0).call(this)}},tr=new WeakMap,vt=new WeakMap,nu=new WeakMap,zn=new WeakMap,ta=new WeakMap,oi=new WeakMap,Ss=new WeakMap,mo=new WeakMap,ru=new WeakMap,ai=new WeakMap,ii=new WeakMap,na=new WeakMap,ra=new WeakMap,po=new WeakMap,li=new WeakMap,_t=new WeakSet,Pl=function(t){st(this,_t,O0).call(this);let n=W(this,vt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Pn)),n},k0=function(){st(this,_t,_0).call(this);const t=wo(this.options.staleTime,W(this,vt));if(ia||W(this,zn).isStale||!b0(t))return;const r=Db(W(this,zn).dataUpdatedAt,t)+1;Ie(this,na,qo.setTimeout(()=>{W(this,zn).isStale||this.updateResult()},r))},S0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,vt)):this.options.refetchInterval)??!1},C0=function(t){st(this,_t,D0).call(this),Ie(this,po,t),!(ia||Cr(this.options.enabled,W(this,vt))===!1||!b0(W(this,po))||W(this,po)===0)&&Ie(this,ra,qo.setInterval(()=>{(this.options.refetchIntervalInBackground||pm.isFocused())&&st(this,_t,Pl).call(this)},W(this,po)))},N0=function(){st(this,_t,k0).call(this),st(this,_t,C0).call(this,st(this,_t,S0).call(this))},_0=function(){W(this,na)&&(qo.clearTimeout(W(this,na)),Ie(this,na,void 0))},D0=function(){W(this,ra)&&(qo.clearInterval(W(this,ra)),Ie(this,ra,void 0))},O0=function(){const t=W(this,tr).getQueryCache().build(W(this,tr),this.options);if(t===W(this,vt))return;const n=W(this,vt);Ie(this,vt,t),Ie(this,nu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Rb=function(t){Xt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,zn))}),W(this,tr).getQueryCache().notify({query:W(this,vt),type:"observerResultsUpdated"})})},Eb);function kk(e,t){return Cr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function n1(e,t){return kk(e,t)||e.state.data!==void 0&&A0(e,t,t.refetchOnMount)}function A0(e,t,n){if(Cr(t.enabled,e)!==!1&&wo(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&gm(e,t)}return!1}function r1(e,t,n,r){return(e!==t||Cr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&gm(e,n)}function gm(e,t){return Cr(t.enabled,e)!==!1&&e.isStaleByTime(wo(t.staleTime,e))}function Sk(e,t){return!Kl(e.getCurrentResult(),t)}function s1(e){return{onFetch:(t,n)=>{var p,y,g,v,D;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=((v=t.state.data)==null?void 0:v.pages)||[],l=((D=t.state.data)==null?void 0:D.pageParams)||[];let c={pages:[],pageParams:[]},f=0;const h=async()=>{let k=!1;const T=O=>{gk(O,()=>t.signal,()=>k=!0)},E=Ob(t.options,t.fetchOptions),N=async(O,A,R)=>{if(k)return Promise.reject();if(A==null&&O.pages.length)return Promise.resolve(O);const I=(()=>{const H={client:t.client,queryKey:t.queryKey,pageParam:A,direction:R?"backward":"forward",meta:t.options.meta};return T(H),H})(),_=await E(I),{maxPages:P}=t.options,F=R?yk:pk;return{pages:F(O.pages,_,P),pageParams:F(O.pageParams,A,P)}};if(s&&i.length){const O=s==="backward",A=O?Ck:o1,R={pages:i,pageParams:l},S=A(r,R);c=await N(R,S,O)}else{const O=e??i.length;do{const A=f===0?l[0]??r.initialPageParam:o1(r,c);if(f>0&&A==null)break;c=await N(c,A),f++}while(f<O)}return c};t.options.persister?t.fetchFn=()=>{var k,T;return(T=(k=t.options).persister)==null?void 0:T.call(k,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function o1(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 Ck(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,Rn,sa,rs,io,Tb,Nk=(Tb=class extends Mb{constructor(t){super();Be(this,rs);Be(this,su);Be(this,ns);Be(this,Rn);Be(this,sa);Ie(this,su,t.client),this.mutationId=t.mutationId,Ie(this,Rn,t.mutationCache),Ie(this,ns,[]),this.state=t.state||Pb(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){W(this,ns).includes(t)||(W(this,ns).push(t),this.clearGcTimeout(),W(this,Rn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ie(this,ns,W(this,ns).filter(n=>n!==t)),this.scheduleGc(),W(this,Rn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,ns).length||(this.state.status==="pending"?this.scheduleGc():W(this,Rn).remove(this))}continue(){var t;return((t=W(this,sa))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,c,f,h,p,y,g,v,D,k,T,E,N,O,A,R,S,I;const n=()=>{st(this,rs,io).call(this,{type:"continue"})},r={client:W(this,su),meta:this.options.meta,mutationKey:this.options.mutationKey};Ie(this,sa,Ib({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(_,P)=>{st(this,rs,io).call(this,{type:"failed",failureCount:_,error:P})},onPause:()=>{st(this,rs,io).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,Rn).canRun(this)}));const s=this.state.status==="pending",i=!W(this,sa).canStart();try{if(s)n();else{st(this,rs,io).call(this,{type:"pending",variables:t,isPaused:i}),W(this,Rn).config.onMutate&&await W(this,Rn).config.onMutate(t,this,r);const P=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));P!==this.state.context&&st(this,rs,io).call(this,{type:"pending",context:P,variables:t,isPaused:i})}const _=await W(this,sa).start();return await((h=(f=W(this,Rn).config).onSuccess)==null?void 0:h.call(f,_,t,this.state.context,this,r)),await((y=(p=this.options).onSuccess)==null?void 0:y.call(p,_,t,this.state.context,r)),await((v=(g=W(this,Rn).config).onSettled)==null?void 0:v.call(g,_,null,this.state.variables,this.state.context,this,r)),await((k=(D=this.options).onSettled)==null?void 0:k.call(D,_,null,t,this.state.context,r)),st(this,rs,io).call(this,{type:"success",data:_}),_}catch(_){try{await((E=(T=W(this,Rn).config).onError)==null?void 0:E.call(T,_,t,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((O=(N=this.options).onError)==null?void 0:O.call(N,_,t,this.state.context,r))}catch(P){Promise.reject(P)}try{await((R=(A=W(this,Rn).config).onSettled)==null?void 0:R.call(A,void 0,_,this.state.variables,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((I=(S=this.options).onSettled)==null?void 0:I.call(S,void 0,_,t,this.state.context,r))}catch(P){Promise.reject(P)}throw st(this,rs,io).call(this,{type:"error",error:_}),_}finally{W(this,Rn).runNext(this)}}},su=new WeakMap,ns=new WeakMap,Rn=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),Xt.batch(()=>{W(this,ns).forEach(r=>{r.onMutationUpdate(t)}),W(this,Rn).notify({mutation:this,type:"updated",action:t})})},Tb);function Pb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Cs,Ur,ou,wb,_k=(wb=class extends ma{constructor(t={}){super();Be(this,Cs);Be(this,Ur);Be(this,ou);this.config=t,Ie(this,Cs,new Set),Ie(this,Ur,new Map),Ie(this,ou,0)}build(t,n,r){const s=new Nk({client:t,mutationCache:this,mutationId:++Sc(this,ou)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){W(this,Cs).add(t);const n=Nc(t);if(typeof n=="string"){const r=W(this,Ur).get(n);r?r.push(t):W(this,Ur).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,Cs).delete(t)){const n=Nc(t);if(typeof n=="string"){const r=W(this,Ur).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&W(this,Ur).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Nc(t);if(typeof n=="string"){const r=W(this,Ur).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=W(this,Ur).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(){Xt.batch(()=>{W(this,Cs).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,Cs).clear(),W(this,Ur).clear()})}getAll(){return Array.from(W(this,Cs))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Xg(n,r))}findAll(t={}){return this.getAll().filter(n=>Xg(t,n))}notify(t){Xt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Xt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Pn))))}},Cs=new WeakMap,Ur=new WeakMap,ou=new WeakMap,wb);function Nc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ns,yo,nr,_s,Is,Wc,I0,kb,Dk=(kb=class extends ma{constructor(n,r){super();Be(this,Is);Be(this,Ns);Be(this,yo);Be(this,nr);Be(this,_s);Ie(this,Ns,n),this.setOptions(r),this.bindMethods(),st(this,Is,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=W(this,Ns).defaultMutationOptions(n),Kl(this.options,r)||W(this,Ns).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,nr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&la(r.mutationKey)!==la(this.options.mutationKey)?this.reset():((s=W(this,nr))==null?void 0:s.state.status)==="pending"&&W(this,nr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,nr))==null||n.removeObserver(this)}onMutationUpdate(n){st(this,Is,Wc).call(this),st(this,Is,I0).call(this,n)}getCurrentResult(){return W(this,yo)}reset(){var n;(n=W(this,nr))==null||n.removeObserver(this),Ie(this,nr,void 0),st(this,Is,Wc).call(this),st(this,Is,I0).call(this)}mutate(n,r){var s;return Ie(this,_s,r),(s=W(this,nr))==null||s.removeObserver(this),Ie(this,nr,W(this,Ns).getMutationCache().build(W(this,Ns),this.options)),W(this,nr).addObserver(this),W(this,nr).execute(n)}},Ns=new WeakMap,yo=new WeakMap,nr=new WeakMap,_s=new WeakMap,Is=new WeakSet,Wc=function(){var r;const n=((r=W(this,nr))==null?void 0:r.state)??Pb();Ie(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})},I0=function(n){Xt.batch(()=>{var r,s,i,l,c,f,h,p;if(W(this,_s)&&this.hasListeners()){const y=W(this,yo).variables,g=W(this,yo).context,v={client:W(this,Ns),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=W(this,_s)).onSuccess)==null||s.call(r,n.data,y,g,v)}catch(D){Promise.reject(D)}try{(l=(i=W(this,_s)).onSettled)==null||l.call(i,n.data,null,y,g,v)}catch(D){Promise.reject(D)}}else if((n==null?void 0:n.type)==="error"){try{(f=(c=W(this,_s)).onError)==null||f.call(c,n.error,y,g,v)}catch(D){Promise.reject(D)}try{(p=(h=W(this,_s)).onSettled)==null||p.call(h,void 0,n.error,y,g,v)}catch(D){Promise.reject(D)}}}this.listeners.forEach(y=>{y(W(this,yo))})})},kb);function a1(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function Ok(e,t,n){const r=e.slice(0);return r[t]=n,r}var ui,dr,ci,di,kr,go,au,iu,lu,uu,_n,M0,L0,R0,P0,j0,Sb,Ak=(Sb=class extends ma{constructor(t,n,r){super();Be(this,_n);Be(this,ui);Be(this,dr);Be(this,ci);Be(this,di);Be(this,kr);Be(this,go);Be(this,au);Be(this,iu);Be(this,lu);Be(this,uu,[]);Ie(this,ui,t),Ie(this,di,r),Ie(this,ci,[]),Ie(this,kr,[]),Ie(this,dr,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&W(this,kr).forEach(t=>{t.subscribe(n=>{st(this,_n,P0).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,W(this,kr).forEach(t=>{t.destroy()})}setQueries(t,n){Ie(this,ci,t),Ie(this,di,n),Xt.batch(()=>{const r=W(this,kr),s=st(this,_n,R0).call(this,W(this,ci));s.forEach(y=>y.observer.setOptions(y.defaultedQueryOptions));const i=s.map(y=>y.observer),l=i.map(y=>y.getCurrentResult()),c=r.length!==i.length,f=i.some((y,g)=>y!==r[g]),h=c||f,p=h?!0:l.some((y,g)=>{const v=W(this,dr)[g];return!v||!Kl(y,v)});!h&&!p||(h&&(Ie(this,uu,s),Ie(this,kr,i)),Ie(this,dr,l),this.hasListeners()&&(h&&(a1(r,i).forEach(y=>{y.destroy()}),a1(i,r).forEach(y=>{y.subscribe(g=>{st(this,_n,P0).call(this,y,g)})})),st(this,_n,j0).call(this)))})}getCurrentResult(){return W(this,dr)}getQueries(){return W(this,kr).map(t=>t.getCurrentQuery())}getObservers(){return W(this,kr)}getOptimisticResult(t,n){const r=st(this,_n,R0).call(this,t),s=r.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),i=r.map(l=>l.defaultedQueryOptions.queryHash);return[s,l=>st(this,_n,L0).call(this,l??s,n,i),()=>st(this,_n,M0).call(this,s,r)]}},ui=new WeakMap,dr=new WeakMap,ci=new WeakMap,di=new WeakMap,kr=new WeakMap,go=new WeakMap,au=new WeakMap,iu=new WeakMap,lu=new WeakMap,uu=new WeakMap,_n=new WeakSet,M0=function(t,n){return n.map((r,s)=>{const i=t[s];return r.defaultedQueryOptions.notifyOnChangeProps?i:r.observer.trackResult(i,l=>{n.forEach(c=>{c.observer.trackProp(l)})})})},L0=function(t,n,r){if(n){const s=W(this,lu),i=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((l,c)=>l!==s[c]));return(!W(this,go)||W(this,dr)!==W(this,iu)||i||n!==W(this,au))&&(Ie(this,au,n),Ie(this,iu,W(this,dr)),r!==void 0&&Ie(this,lu,r),Ie(this,go,fm(W(this,go),n(t)))),W(this,go)}return t},R0=function(t){const n=new Map;W(this,kr).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=W(this,ui).defaultQueryOptions(s),c=((f=n.get(i.queryHash))==null?void 0:f.shift())??new ym(W(this,ui),i);r.push({defaultedQueryOptions:i,observer:c})}),r},P0=function(t,n){const r=W(this,kr).indexOf(t);r!==-1&&(Ie(this,dr,Ok(W(this,dr),r,n)),st(this,_n,j0).call(this))},j0=function(){var t;if(this.hasListeners()){const n=W(this,go),r=st(this,_n,M0).call(this,W(this,dr),W(this,uu)),s=st(this,_n,L0).call(this,r,(t=W(this,di))==null?void 0:t.combine);n!==s&&Xt.batch(()=>{this.listeners.forEach(i=>{i(W(this,dr))})})}},Sb),ss,Cb,Ik=(Cb=class extends ma{constructor(t={}){super();Be(this,ss);this.config=t,Ie(this,ss,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??dm(s,n);let l=this.get(i);return l||(l=new wk({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){W(this,ss).has(t.queryHash)||(W(this,ss).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,ss).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,ss).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Xt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,ss).get(t)}getAll(){return[...W(this,ss).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Kg(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Kg(t,r)):n}notify(t){Xt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Xt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Xt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ss=new WeakMap,Cb),sn,xo,bo,fi,hi,vo,mi,pi,Nb,Mk=(Nb=class{constructor(e={}){Be(this,sn);Be(this,xo);Be(this,bo);Be(this,fi);Be(this,hi);Be(this,vo);Be(this,mi);Be(this,pi);Ie(this,sn,e.queryCache||new Ik),Ie(this,xo,e.mutationCache||new _k),Ie(this,bo,e.defaultOptions||{}),Ie(this,fi,new Map),Ie(this,hi,new Map),Ie(this,vo,0)}mount(){Sc(this,vo)._++,W(this,vo)===1&&(Ie(this,mi,pm.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,sn).onFocus())})),Ie(this,pi,Qc.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,sn).onOnline())})))}unmount(){var e,t;Sc(this,vo)._--,W(this,vo)===0&&((e=W(this,mi))==null||e.call(this),Ie(this,mi,void 0),(t=W(this,pi))==null||t.call(this),Ie(this,pi,void 0))}isFetching(e){return W(this,sn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,xo).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,sn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,sn).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 W(this,sn).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=W(this,sn).get(r.queryHash),i=s==null?void 0:s.state.data,l=fk(t,i);if(l!==void 0)return W(this,sn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Xt.batch(()=>W(this,sn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,sn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,sn);Xt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,sn);return Xt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Xt.batch(()=>W(this,sn).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Pn).catch(Pn)}invalidateQueries(e,t={}){return Xt.batch(()=>(W(this,sn).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=Xt.batch(()=>W(this,sn).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Pn)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Pn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=W(this,sn).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(Pn).catch(Pn)}fetchInfiniteQuery(e){return e.behavior=s1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pn).catch(Pn)}ensureInfiniteQueryData(e){return e.behavior=s1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Qc.isOnline()?W(this,xo).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,sn)}getMutationCache(){return W(this,xo)}getDefaultOptions(){return W(this,bo)}setDefaultOptions(e){Ie(this,bo,e)}setQueryDefaults(e,t){W(this,fi).set(la(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,fi).values()],n={};return t.forEach(r=>{Gl(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,hi).set(la(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,hi).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={...W(this,bo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=dm(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===hm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,bo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,sn).clear(),W(this,xo).clear()}},sn=new WeakMap,xo=new WeakMap,bo=new WeakMap,fi=new WeakMap,hi=new WeakMap,vo=new WeakMap,mi=new WeakMap,pi=new WeakMap,Nb),jb=C.createContext(void 0),Yn=e=>{const t=C.useContext(jb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Lk=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(jb.Provider,{value:e,children:t})),Fb=C.createContext(!1),Bb=()=>C.useContext(Fb);Fb.Provider;function Rk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Pk=C.createContext(Rk()),Hb=()=>C.useContext(Pk),Ub=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?mm(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},zb=e=>{C.useEffect(()=>{e.clearReset()},[e])},Wb=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||mm(n,[e.error,r])),Yb=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))}},$b=(e,t)=>e.isLoading&&e.isFetching&&!t,F0=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Gc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function i1({queries:e,...t},n){const r=Yn(),s=Bb(),i=Hb(),l=C.useMemo(()=>e.map(k=>{const T=r.defaultQueryOptions(k);return T._optimisticResults=s?"isRestoring":"optimistic",T}),[e,r,s]);l.forEach(k=>{Yb(k);const T=r.getQueryCache().get(k.queryHash);Ub(k,i,T)}),zb(i);const[c]=C.useState(()=>new Ak(r,l,t)),[f,h,p]=c.getOptimisticResult(l,t.combine),y=!s&&t.subscribed!==!1;C.useSyncExternalStore(C.useCallback(k=>y?c.subscribe(Xt.batchCalls(k)):Pn,[c,y]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),C.useEffect(()=>{c.setQueries(l,t)},[l,t,c]);const v=f.some((k,T)=>F0(l[T],k))?f.flatMap((k,T)=>{const E=l[T];if(E){const N=new ym(r,E);if(F0(E,k))return Gc(E,N,i);$b(k,s)&&Gc(E,N,i)}return[]}):[];if(v.length>0)throw Promise.all(v);const D=f.find((k,T)=>{const E=l[T];return E&&Wb({result:k,errorResetBoundary:i,throwOnError:E.throwOnError,query:r.getQueryCache().get(E.queryHash),suspense:E.suspense})});if(D!=null&&D.error)throw D.error;return h(p())}function jk(e,t,n){var g,v,D,k;const r=Bb(),s=Hb(),i=Yn(),l=i.defaultQueryOptions(e);(v=(g=i.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||v.call(g,l);const c=i.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",Yb(l),Ub(l,s,c),zb(s);const f=!i.getQueryCache().get(l.queryHash),[h]=C.useState(()=>new t(i,l)),p=h.getOptimisticResult(l),y=!r&&e.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(T=>{const E=y?h.subscribe(Xt.batchCalls(T)):Pn;return h.updateResult(),E},[h,y]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),C.useEffect(()=>{h.setOptions(l)},[l,h]),F0(l,p))throw Gc(l,h,s);if(Wb({result:p,errorResetBoundary:s,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw p.error;if((k=(D=i.getDefaultOptions().queries)==null?void 0:D._experimental_afterQuery)==null||k.call(D,l,p),l.experimental_prefetchInRender&&!ia&&$b(p,r)){const T=f?Gc(l,h,s):c==null?void 0:c.promise;T==null||T.catch(Pn).finally(()=>{h.updateResult()})}return l.notifyOnChangeProps?p:h.trackResult(p)}function sr(e,t){return jk(e,ym)}function Fk(e,t){const n=Yn(),r=n.getQueryCache();return C.useSyncExternalStore(C.useCallback(s=>r.subscribe(Xt.batchCalls(s)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}function Ja(e,t){const n=Yn(),[r]=C.useState(()=>new Dk(n,e));C.useEffect(()=>{r.setOptions(e)},[r,e]);const s=C.useSyncExternalStore(C.useCallback(l=>r.subscribe(Xt.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=C.useCallback((l,c)=>{r.mutate(l,c).catch(Pn)},[r]);if(s.error&&mm(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}function Bk({children:e}){const[t]=C.useState(()=>new Mk({defaultOptions:{queries:{staleTime:3e5,gcTime:18e5,refetchOnWindowFocus:!1,retry:1}}}));return d.jsx(Lk,{client:t,children:e})}const Hk="modulepreload",Uk=function(e){return"/"+e},l1={},Wr=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 c=document.querySelector("meta[property=csp-nonce]"),f=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));s=l(n.map(h=>{if(h=Uk(h),h in l1)return;l1[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":Hk,p||(g.as="script"),g.crossOrigin="",g.href=h,f&&g.setAttribute("nonce",f),document.head.appendChild(g),p)return new Promise((v,D)=>{g.addEventListener("load",v),g.addEventListener("error",()=>D(new Error(`Unable to preload CSS for ${h}`)))})}))}function i(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return s.then(l=>{for(const c of l||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})},u1={md:768,lg:1024};function c1(e){return e>=u1.lg?"lg":e>=u1.md?"md":"sm"}function xm(){const[e,t]=C.useState(()=>typeof window<"u"?c1(window.innerWidth):"lg");return C.useEffect(()=>{function n(){t(c1(window.innerWidth))}return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}const bm="/api";class cu extends Error{constructor(t,n,r){super(n),this.status=t,this.errorType=r,this.name="ApiError"}}async function bt(e,t){const n={...t==null?void 0:t.headers};t!=null&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${bm}${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(`${bm}${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 ft={getHealth:()=>bt("/health"),reconnect:()=>bt("/connections/reconnect",{method:"POST",body:"{}"}),getConfig:()=>bt("/config"),getChart:e=>bt(`/charts/${encodeURIComponent(e)}`),queryChart:(e,t={},n={})=>bt(`/charts/${encodeURIComponent(e)}/query${n.includeConfig?"?includeConfig=true":""}`,{method:"POST",body:JSON.stringify(t)}),queryChartsBatch:(e,t={})=>bt("/charts/batch",{method:"POST",body:JSON.stringify({charts:e,includeConfig:t.includeConfig})}),queryChartDetail:(e,t={})=>bt(`/charts/${encodeURIComponent(e)}/detail`,{method:"POST",body:JSON.stringify(t)}),invalidateChart:e=>bt(`/charts/${encodeURIComponent(e)}/invalidate`,{method:"POST"}),getChartEvents:()=>bt("/chart-events"),createChartEvent:e=>bt("/chart-events",{method:"POST",body:JSON.stringify(e)}),deleteChartEvent:e=>bt(`/chart-events/${e}`,{method:"DELETE"}),updateChartEvent:(e,t)=>bt(`/chart-events/${e}`,{method:"PUT",body:JSON.stringify(t)}),getParameterOptions:(e,t)=>bt(`/charts/${encodeURIComponent(e)}/parameters/${encodeURIComponent(t)}/options`),getModelOptions:(e,t,n)=>bt(`/models/${encodeURIComponent(e)}/options?value_field=${encodeURIComponent(t)}&label_field=${encodeURIComponent(n)}`),getDashboards:()=>bt("/dashboards"),getDashboard:(e,t)=>{const n=t?`/dashboards/${encodeURIComponent(e)}?branch=${encodeURIComponent(t)}`:`/dashboards/${encodeURIComponent(e)}`;return bt(n)},saveDashboard:(e,t,n,r)=>bt(`/dashboards/${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify(r?{tab:r,tabLayout:t,message:n}:{layout:t,message:n})}),warmDashboardCache:(e,t={},n)=>bt(`/dashboards/${encodeURIComponent(e)}/warm-cache`,{method:"POST",body:JSON.stringify({params:t,...n?{tab:n}:{}})}),getBranches:()=>bt("/git/branches"),createBranch:(e,t)=>bt("/git/branches",{method:"POST",body:JSON.stringify({name:e,from:t})}),checkoutBranch:e=>bt("/git/checkout",{method:"POST",body:JSON.stringify({branch:e})}),getAuthMe:async()=>{const e=await fetch(`${bm}/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=>bt("/auth/setup",{method:"POST",body:JSON.stringify(e)}),authLogin:e=>bt("/auth/login",{method:"POST",body:JSON.stringify(e)}),authLogout:()=>bt("/auth/logout",{method:"POST"}),authChangePassword:e=>bt("/auth/me/password",{method:"PUT",body:JSON.stringify(e)}),authListUsers:()=>bt("/auth/users"),authCreateUser:e=>bt("/auth/users",{method:"POST",body:JSON.stringify(e)}),authUpdateUser:(e,t)=>bt(`/auth/users/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),authDeleteUser:e=>bt(`/auth/users/${encodeURIComponent(e)}`,{method:"DELETE"}),createShareLink:e=>bt("/shares",{method:"POST",body:JSON.stringify(e)}),listShareLinks:()=>bt("/shares"),revokeShareLink:e=>bt(`/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:()=>bt("/chat/agents"),getCatalogSummary:()=>bt("/catalog/summary"),generateText:e=>bt("/chat/generate-text",{method:"POST",body:JSON.stringify(e)})},qb=C.createContext(null),dP=qb.Provider;function pa(){return C.useContext(qb)}function ya(){const e=pa();return sr({queryKey:["config",e],queryFn:()=>e?ft.getPublicConfig(e):ft.getConfig(),staleTime:1/0})}function zk(){return sr({queryKey:["health"],queryFn:ft.getHealth,refetchInterval:3e4})}function Vb(e){const t=pa();return sr({queryKey:["chart",e,t],queryFn:()=>t?ft.getPublicChart(e,t):ft.getChart(e),enabled:!!e,staleTime:1e3*60*10})}const d1=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(v=>v(t,g))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h))},f=t=e(r,s,c);return c},Wk=(e=>e?d1(e):d1),Yk=e=>e;function $k(e,t=Yk){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 f1=e=>{const t=Wk(e),n=r=>$k(t,r);return Object.assign(n,t),n},vm=(e=>e?f1(e):f1),Je=vm((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]:c,...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 c=l.crossFilters[n];if(c&&c.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 c of Object.values(s))c.sourceChart!==n&&(l[c.field]=[c.value],c.temporal&&c.value&&(l.start_date=c.value,l.end_date=c.value));return{...r,...l,...i[n]}},resetFilters:()=>e({globalFilters:{},chartFilters:{},crossFilters:{}}),resetChartFilters:n=>e(r=>{const{[n]:s,...i}=r.chartFilters;return{chartFilters:i}})})),Qb=6048e5,qk=864e5,Em=6e4,Tm=36e5,Vk=1e3,h1=Symbol.for("constructDateFrom");function Dt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&h1 in e?e[h1](t):e instanceof Date?new e.constructor(t):new Date(t)}function mt(e,t){return Dt(t||e,e)}function Ms(e,t,n){const r=mt(e,n==null?void 0:n.in);return isNaN(t)?Dt((n==null?void 0:n.in)||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Ti(e,t,n){const r=mt(e,n==null?void 0:n.in);if(isNaN(t))return Dt((n==null?void 0:n.in)||e,NaN);if(!t)return r;const s=r.getDate(),i=Dt((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 Qk={};function ga(){return Qk}function Yr(e,t){var c,f,h,p;const n=ga(),r=(t==null?void 0:t.weekStartsOn)??((f=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:f.weekStartsOn)??n.weekStartsOn??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,s=mt(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 Yr(e,{...t,weekStartsOn:1})}function Gb(e,t){const n=mt(e,t==null?void 0:t.in),r=n.getFullYear(),s=Dt(n,0);s.setFullYear(r+1,0,4),s.setHours(0,0,0,0);const i=ua(s),l=Dt(n,0);l.setFullYear(r,0,4),l.setHours(0,0,0,0);const c=ua(l);return n.getTime()>=i.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Kc(e){const t=mt(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=Dt.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function ca(e,t){const n=mt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function wm(e,t,n){const[r,s]=wi(n==null?void 0:n.in,e,t),i=ca(r),l=ca(s),c=+i-Kc(i),f=+l-Kc(l);return Math.round((c-f)/qk)}function Gk(e,t){const n=Gb(e,t),r=Dt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),ua(r)}function km(e,t,n){return Ti(e,t*3,n)}function pd(e,t,n){return Ms(e,t*7,n)}function yd(e,t,n){return Ti(e,t*12,n)}function Kk(e,t){let n,r=t==null?void 0:t.in;return e.forEach(s=>{!r&&typeof s=="object"&&(r=Dt.bind(null,s));const i=mt(s,r);(!n||n<i||isNaN(+i))&&(n=i)}),Dt(r,n||NaN)}function Xk(e,t){let n,r=t==null?void 0:t.in;return e.forEach(s=>{!r&&typeof s=="object"&&(r=Dt.bind(null,s));const i=mt(s,r);(!n||n>i||isNaN(+i))&&(n=i)}),Dt(r,n||NaN)}function Jk(e,t,n){const[r,s]=wi(n==null?void 0:n.in,e,t);return+ca(r)==+ca(s)}function Kb(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Zk(e){return!(!Kb(e)&&typeof e!="number"||isNaN(+mt(e)))}function Xb(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 eS(e,t){const n=mt(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function gd(e,t){const n=mt(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 Jb(e,t){const[n,r]=wi(e,t.start,t.end);return{start:n,end:r}}function tS(e,t){const{start:n,end:r}=Jb(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 c=1;const f=[];for(;+l<=i;)f.push(Dt(n,l)),l.setMonth(l.getMonth()+c);return s?f.reverse():f}function Xc(e,t){const n=mt(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=mt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function xd(e,t){const n=mt(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 yi(e,t){const n=mt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function nS(e,t){const{start:n,end:r}=Jb(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 c=1;const f=[];for(;+l<=i;)f.push(Dt(n,l)),l.setFullYear(l.getFullYear()+c);return s?f.reverse():f}function bd(e,t){var c,f,h,p;const n=ga(),r=(t==null?void 0:t.weekStartsOn)??((f=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:f.weekStartsOn)??n.weekStartsOn??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,s=mt(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 rS(e,t){return bd(e,{...t,weekStartsOn:1})}function Sm(e,t){const n=mt(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 sS={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"}},oS=(e,t,n)=>{let r;const s=sS[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 jh(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const aS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},iS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},uS={date:jh({formats:aS,defaultWidth:"full"}),time:jh({formats:iS,defaultWidth:"full"}),dateTime:jh({formats:lS,defaultWidth:"full"})},cS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},dS=(e,t,n,r)=>cS[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,c=n!=null&&n.width?String(n.width):l;s=e.formattingValues[c]||e.formattingValues[l]}else{const l=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[c]||e.values[l]}const i=e.argumentCallback?e.argumentCallback(t):t;return s[i]}}const fS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},hS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mS={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"]},pS={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"]},yS={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"}},gS={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"}},xS=(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"},bS={ordinalNumber:xS,era:gl({values:fS,defaultWidth:"wide"}),quarter:gl({values:hS,defaultWidth:"wide",argumentCallback:e=>e-1}),month:gl({values:mS,defaultWidth:"wide"}),day:gl({values:pS,defaultWidth:"wide"}),dayPeriod:gl({values:yS,defaultWidth:"wide",formattingValues:gS,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],c=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],f=Array.isArray(c)?ES(c,y=>y.test(l)):vS(c,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 vS(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ES(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function TS(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 c=t.slice(s.length);return{value:l,rest:c}}}const wS=/^(\d+)(th|st|nd|rd)?/i,kS=/\d+/i,SS={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},CS={any:[/^b/i,/^(a|c)/i]},NS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},_S={any:[/1/i,/2/i,/3/i,/4/i]},DS={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},OS={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]},AS={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},IS={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]},MS={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},LS={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}},RS={ordinalNumber:TS({matchPattern:wS,parsePattern:kS,valueCallback:e=>parseInt(e,10)}),era:xl({matchPatterns:SS,defaultMatchWidth:"wide",parsePatterns:CS,defaultParseWidth:"any"}),quarter:xl({matchPatterns:NS,defaultMatchWidth:"wide",parsePatterns:_S,defaultParseWidth:"any",valueCallback:e=>e+1}),month:xl({matchPatterns:DS,defaultMatchWidth:"wide",parsePatterns:OS,defaultParseWidth:"any"}),day:xl({matchPatterns:AS,defaultMatchWidth:"wide",parsePatterns:IS,defaultParseWidth:"any"}),dayPeriod:xl({matchPatterns:MS,defaultMatchWidth:"any",parsePatterns:LS,defaultParseWidth:"any"})},$o={code:"en-US",formatDistance:oS,formatLong:uS,formatRelative:dS,localize:bS,match:RS,options:{weekStartsOn:0,firstWeekContainsDate:1}};function PS(e,t){const n=mt(e,t==null?void 0:t.in);return wm(n,yi(n))+1}function vd(e,t){const n=mt(e,t==null?void 0:t.in),r=+ua(n)-+Gk(n);return Math.round(r/Qb)+1}function Cm(e,t){var p,y,g,v;const n=mt(e,t==null?void 0:t.in),r=n.getFullYear(),s=ga(),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??((v=(g=s.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)??1,l=Dt((t==null?void 0:t.in)||e,0);l.setFullYear(r+1,0,i),l.setHours(0,0,0,0);const c=Yr(l,t),f=Dt((t==null?void 0:t.in)||e,0);f.setFullYear(r,0,i),f.setHours(0,0,0,0);const h=Yr(f,t);return+n>=+c?r+1:+n>=+h?r:r-1}function jS(e,t){var c,f,h,p;const n=ga(),r=(t==null?void 0:t.firstWeekContainsDate)??((f=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:f.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=Cm(e,t),i=Dt((t==null?void 0:t.in)||e,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),Yr(i,t)}function Ed(e,t){const n=mt(e,t==null?void 0:t.in),r=+Yr(n,t)-+jS(n,t);return Math.round(r/Qb)+1}function At(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 At(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):At(n+1,2)},d(e,t){return At(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 At(e.getHours()%12||12,t.length)},H(e,t){return At(e.getHours(),t.length)},m(e,t){return At(e.getMinutes(),t.length)},s(e,t){return At(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return At(s,t.length)}},$a={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},m1={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=Cm(e,r),i=s>0?s:1-s;if(t==="YY"){const l=i%100;return At(l,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):At(i,t.length)},R:function(e,t){const n=Gb(e);return At(n,t.length)},u:function(e,t){const n=e.getFullYear();return At(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 At(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 At(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 At(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=Ed(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):At(s,t.length)},I:function(e,t,n){const r=vd(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):At(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=PS(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):At(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 At(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 At(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 At(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=$a.noon:r===0?s=$a.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=$a.evening:r>=12?s=$a.afternoon:r>=4?s=$a.morning:s=$a.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"}):At(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):At(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 y1(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 y1(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"+p1(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"+p1(r,":");case"zzzz":default:return"GMT"+Wo(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return At(r,t.length)},T:function(e,t,n){return At(+e,t.length)}};function p1(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+At(i,2)}function y1(e,t){return e%60===0?(e>0?"-":"+")+At(Math.abs(e)/60,2):Wo(e,t)}function Wo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=At(Math.trunc(r/60),2),i=At(r%60,2);return n+s+t+i}const g1=(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"})}},Zb=(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"})}},FS=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return g1(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}}",g1(r,t)).replace("{{time}}",Zb(s,t))},B0={p:Zb,P:FS},BS=/^D+$/,HS=/^Y+$/,US=["D","DD","YY","YYYY"];function ev(e){return BS.test(e)}function tv(e){return HS.test(e)}function H0(e,t,n){const r=zS(e,t,n);if(console.warn(r),US.includes(e))throw new RangeError(r)}function zS(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 WS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,YS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$S=/^'([^]*?)'?$/,qS=/''/g,VS=/[a-zA-Z]/;function on(e,t,n){var p,y,g,v,D,k,T,E;const r=ga(),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??((v=(g=r.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)??1,l=(n==null?void 0:n.weekStartsOn)??((k=(D=n==null?void 0:n.locale)==null?void 0:D.options)==null?void 0:k.weekStartsOn)??r.weekStartsOn??((E=(T=r.locale)==null?void 0:T.options)==null?void 0:E.weekStartsOn)??0,c=mt(e,n==null?void 0:n.in);if(!Zk(c))throw new RangeError("Invalid time value");let f=t.match(YS).map(N=>{const O=N[0];if(O==="p"||O==="P"){const A=B0[O];return A(N,s.formatLong)}return N}).join("").match(WS).map(N=>{if(N==="''")return{isToken:!1,value:"'"};const O=N[0];if(O==="'")return{isToken:!1,value:QS(N)};if(m1[O])return{isToken:!0,value:N};if(O.match(VS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");return{isToken:!1,value:N}});s.localize.preprocessor&&(f=s.localize.preprocessor(c,f));const h={firstWeekContainsDate:i,weekStartsOn:l,locale:s};return f.map(N=>{if(!N.isToken)return N.value;const O=N.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&tv(O)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&ev(O))&&H0(O,t,String(e));const A=m1[O[0]];return A(c,O,s.localize,h)}).join("")}function QS(e){const t=e.match($S);return t?t[1].replace(qS,"'"):e}function GS(e,t){const n=mt(e,t==null?void 0:t.in),r=n.getFullYear(),s=n.getMonth(),i=Dt(n,0);return i.setFullYear(r,s+1,0),i.setHours(0,0,0,0),i.getDate()}function KS(){return Object.assign({},ga())}function XS(e,t){const n=mt(e,t==null?void 0:t.in).getDay();return n===0?7:n}function JS(e,t){return mt(e,t==null?void 0:t.in).getMonth()}function ZS(e,t){return mt(e,t==null?void 0:t.in).getFullYear()}function eC(e,t){return+mt(e)>+mt(t)}function tC(e,t){return+mt(e)<+mt(t)}function nC(e,t){const n=rC(t)?new t(0):Dt(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function rC(e){var t;return typeof e=="function"&&((t=e.prototype)==null?void 0:t.constructor)===e}const sC=10;class nv{constructor(){Fe(this,"subPriority",0)}validate(t,n){return!0}}class oC extends nv{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 aC extends nv{constructor(n,r){super();Fe(this,"priority",sC);Fe(this,"subPriority",-1);this.context=n||(s=>Dt(r,s))}set(n,r){return r.timestampIsSet?n:Dt(n,nC(n,this.context))}}let Ct=class{run(t,n,r,s){const i=this.parse(t,n,r,s);return i?{setter:new oC(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(t,n,r){return!0}};class iC extends Ct{constructor(){super(...arguments);Fe(this,"priority",140);Fe(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 dn={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 fn(e,t){return e&&{value:t(e.value),rest:e.rest}}function Jt(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*Tm+i*Em+l*Vk),rest:t.slice(n[0].length)}}function rv(e){return Jt(dn.anyDigitsSigned,e)}function an(e,t){switch(e){case 1:return Jt(dn.singleDigit,t);case 2:return Jt(dn.twoDigits,t);case 3:return Jt(dn.threeDigits,t);case 4:return Jt(dn.fourDigits,t);default:return Jt(new RegExp("^\\d{1,"+e+"}"),t)}}function Jc(e,t){switch(e){case 1:return Jt(dn.singleDigitSigned,t);case 2:return Jt(dn.twoDigitsSigned,t);case 3:return Jt(dn.threeDigitsSigned,t);case 4:return Jt(dn.fourDigitsSigned,t);default:return Jt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Nm(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 sv(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,c=e>=i%100;s=e+l-(c?100:0)}return n?s:1-s}function ov(e){return e%400===0||e%4===0&&e%100!==0}class lC extends Ct{constructor(){super(...arguments);Fe(this,"priority",130);Fe(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 fn(an(4,n),i);case"yo":return fn(s.ordinalNumber(n,{unit:"year"}),i);default:return fn(an(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 c=sv(s.year,i);return n.setFullYear(c,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 uC extends Ct{constructor(){super(...arguments);Fe(this,"priority",130);Fe(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 fn(an(4,n),i);case"Yo":return fn(s.ordinalNumber(n,{unit:"year"}),i);default:return fn(an(r.length,n),i)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,s,i){const l=Cm(n,i);if(s.isTwoDigitYear){const f=sv(s.year,l);return n.setFullYear(f,0,i.firstWeekContainsDate),n.setHours(0,0,0,0),Yr(n,i)}const c=!("era"in r)||r.era===1?s.year:1-s.year;return n.setFullYear(c,0,i.firstWeekContainsDate),n.setHours(0,0,0,0),Yr(n,i)}}class cC extends Ct{constructor(){super(...arguments);Fe(this,"priority",130);Fe(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,r){return Jc(r==="R"?4:r.length,n)}set(n,r,s){const i=Dt(n,0);return i.setFullYear(s,0,4),i.setHours(0,0,0,0),ua(i)}}class dC extends Ct{constructor(){super(...arguments);Fe(this,"priority",130);Fe(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,r){return Jc(r==="u"?4:r.length,n)}set(n,r,s){return n.setFullYear(s,0,1),n.setHours(0,0,0,0),n}}class fC extends Ct{constructor(){super(...arguments);Fe(this,"priority",120);Fe(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 an(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 hC extends Ct{constructor(){super(...arguments);Fe(this,"priority",120);Fe(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 an(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 mC extends Ct{constructor(){super(...arguments);Fe(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);Fe(this,"priority",110)}parse(n,r,s){const i=l=>l-1;switch(r){case"M":return fn(Jt(dn.month,n),i);case"MM":return fn(an(2,n),i);case"Mo":return fn(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 pC extends Ct{constructor(){super(...arguments);Fe(this,"priority",110);Fe(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 fn(Jt(dn.month,n),i);case"LL":return fn(an(2,n),i);case"Lo":return fn(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 yC(e,t,n){const r=mt(e,n==null?void 0:n.in),s=Ed(r,n)-t;return r.setDate(r.getDate()-s*7),mt(r,n==null?void 0:n.in)}class gC extends Ct{constructor(){super(...arguments);Fe(this,"priority",100);Fe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,r,s){switch(r){case"w":return Jt(dn.week,n);case"wo":return s.ordinalNumber(n,{unit:"week"});default:return an(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,s,i){return Yr(yC(n,s,i),i)}}function xC(e,t,n){const r=mt(e,n==null?void 0:n.in),s=vd(r,n)-t;return r.setDate(r.getDate()-s*7),r}class bC extends Ct{constructor(){super(...arguments);Fe(this,"priority",100);Fe(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 Jt(dn.week,n);case"Io":return s.ordinalNumber(n,{unit:"week"});default:return an(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,s){return ua(xC(n,s))}}const vC=[31,28,31,30,31,30,31,31,30,31,30,31],EC=[31,29,31,30,31,30,31,31,30,31,30,31];class TC extends Ct{constructor(){super(...arguments);Fe(this,"priority",90);Fe(this,"subPriority",1);Fe(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,r,s){switch(r){case"d":return Jt(dn.date,n);case"do":return s.ordinalNumber(n,{unit:"date"});default:return an(r.length,n)}}validate(n,r){const s=n.getFullYear(),i=ov(s),l=n.getMonth();return i?r>=1&&r<=EC[l]:r>=1&&r<=vC[l]}set(n,r,s){return n.setDate(s),n.setHours(0,0,0,0),n}}class wC extends Ct{constructor(){super(...arguments);Fe(this,"priority",90);Fe(this,"subpriority",1);Fe(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 Jt(dn.dayOfYear,n);case"Do":return s.ordinalNumber(n,{unit:"date"});default:return an(r.length,n)}}validate(n,r){const s=n.getFullYear();return ov(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 _m(e,t,n){var y,g,v,D;const r=ga(),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??((D=(v=r.locale)==null?void 0:v.options)==null?void 0:D.weekStartsOn)??0,i=mt(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 Ms(i,p,n)}class kC extends Ct{constructor(){super(...arguments);Fe(this,"priority",90);Fe(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=_m(n,s,i),n.setHours(0,0,0,0),n}}class SC extends Ct{constructor(){super(...arguments);Fe(this,"priority",90);Fe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,r,s,i){const l=c=>{const f=Math.floor((c-1)/7)*7;return(c+i.weekStartsOn+6)%7+f};switch(r){case"e":case"ee":return fn(an(r.length,n),l);case"eo":return fn(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=_m(n,s,i),n.setHours(0,0,0,0),n}}class CC extends Ct{constructor(){super(...arguments);Fe(this,"priority",90);Fe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,r,s,i){const l=c=>{const f=Math.floor((c-1)/7)*7;return(c+i.weekStartsOn+6)%7+f};switch(r){case"c":case"cc":return fn(an(r.length,n),l);case"co":return fn(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=_m(n,s,i),n.setHours(0,0,0,0),n}}function NC(e,t,n){const r=mt(e,n==null?void 0:n.in),s=XS(r,n),i=t-s;return Ms(r,i,n)}class _C extends Ct{constructor(){super(...arguments);Fe(this,"priority",90);Fe(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 an(r.length,n);case"io":return s.ordinalNumber(n,{unit:"day"});case"iii":return fn(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 fn(s.day(n,{width:"narrow",context:"formatting"}),i);case"iiiiii":return fn(s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"}),i);case"iiii":default:return fn(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=NC(n,s),n.setHours(0,0,0,0),n}}class DC extends Ct{constructor(){super(...arguments);Fe(this,"priority",80);Fe(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(Nm(s),0,0,0),n}}class OC extends Ct{constructor(){super(...arguments);Fe(this,"priority",80);Fe(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(Nm(s),0,0,0),n}}class AC extends Ct{constructor(){super(...arguments);Fe(this,"priority",80);Fe(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(Nm(s),0,0,0),n}}class IC extends Ct{constructor(){super(...arguments);Fe(this,"priority",70);Fe(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,r,s){switch(r){case"h":return Jt(dn.hour12h,n);case"ho":return s.ordinalNumber(n,{unit:"hour"});default:return an(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 MC extends Ct{constructor(){super(...arguments);Fe(this,"priority",70);Fe(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,r,s){switch(r){case"H":return Jt(dn.hour23h,n);case"Ho":return s.ordinalNumber(n,{unit:"hour"});default:return an(r.length,n)}}validate(n,r){return r>=0&&r<=23}set(n,r,s){return n.setHours(s,0,0,0),n}}class LC extends Ct{constructor(){super(...arguments);Fe(this,"priority",70);Fe(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,r,s){switch(r){case"K":return Jt(dn.hour11h,n);case"Ko":return s.ordinalNumber(n,{unit:"hour"});default:return an(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 RC extends Ct{constructor(){super(...arguments);Fe(this,"priority",70);Fe(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,r,s){switch(r){case"k":return Jt(dn.hour24h,n);case"ko":return s.ordinalNumber(n,{unit:"hour"});default:return an(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 PC extends Ct{constructor(){super(...arguments);Fe(this,"priority",60);Fe(this,"incompatibleTokens",["t","T"])}parse(n,r,s){switch(r){case"m":return Jt(dn.minute,n);case"mo":return s.ordinalNumber(n,{unit:"minute"});default:return an(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,s){return n.setMinutes(s,0,0),n}}class jC extends Ct{constructor(){super(...arguments);Fe(this,"priority",50);Fe(this,"incompatibleTokens",["t","T"])}parse(n,r,s){switch(r){case"s":return Jt(dn.second,n);case"so":return s.ordinalNumber(n,{unit:"second"});default:return an(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,s){return n.setSeconds(s,0),n}}class FC extends Ct{constructor(){super(...arguments);Fe(this,"priority",30);Fe(this,"incompatibleTokens",["t","T"])}parse(n,r){const s=i=>Math.trunc(i*Math.pow(10,-r.length+3));return fn(an(r.length,n),s)}set(n,r,s){return n.setMilliseconds(s),n}}class BC extends Ct{constructor(){super(...arguments);Fe(this,"priority",10);Fe(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:Dt(n,n.getTime()-Kc(n)-s)}}class HC extends Ct{constructor(){super(...arguments);Fe(this,"priority",10);Fe(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:Dt(n,n.getTime()-Kc(n)-s)}}class UC extends Ct{constructor(){super(...arguments);Fe(this,"priority",40);Fe(this,"incompatibleTokens","*")}parse(n){return rv(n)}set(n,r,s){return[Dt(n,s*1e3),{timestampIsSet:!0}]}}class zC extends Ct{constructor(){super(...arguments);Fe(this,"priority",20);Fe(this,"incompatibleTokens","*")}parse(n){return rv(n)}set(n,r,s){return[Dt(n,s),{timestampIsSet:!0}]}}const WC={G:new iC,y:new lC,Y:new uC,R:new cC,u:new dC,Q:new fC,q:new hC,M:new mC,L:new pC,w:new gC,I:new bC,d:new TC,D:new wC,E:new kC,e:new SC,c:new CC,i:new _C,a:new DC,b:new OC,B:new AC,h:new IC,H:new MC,K:new LC,k:new RC,m:new PC,s:new jC,S:new FC,X:new BC,x:new HC,t:new UC,T:new zC},YC=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$C=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,qC=/^'([^]*?)'?$/,VC=/''/g,QC=/\S/,GC=/[a-zA-Z]/;function ws(e,t,n,r){var T,E,N,O;const s=()=>Dt(n,NaN),i=KS(),l=i.locale??$o,c=i.firstWeekContainsDate??((E=(T=i.locale)==null?void 0:T.options)==null?void 0:E.firstWeekContainsDate)??1,f=i.weekStartsOn??((O=(N=i.locale)==null?void 0:N.options)==null?void 0:O.weekStartsOn)??0,h={firstWeekContainsDate:c,weekStartsOn:f,locale:l},p=[new aC(r==null?void 0:r.in,n)],y=t.match($C).map(A=>{const R=A[0];if(R in B0){const S=B0[R];return S(A,l.formatLong)}return A}).join("").match(YC),g=[];for(let A of y){tv(A)&&H0(A,t,e),ev(A)&&H0(A,t,e);const R=A[0],S=WC[R];if(S){const{incompatibleTokens:I}=S;if(Array.isArray(I)){const P=g.find(F=>I.includes(F.token)||F.token===R);if(P)throw new RangeError(`The format string mustn't contain \`${P.fullToken}\` and \`${A}\` at the same time`)}else if(S.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:R,fullToken:A});const _=S.run(e,A,l.match,h);if(!_)return s();p.push(_.setter),e=_.rest}else{if(R.match(GC))throw new RangeError("Format string contains an unescaped latin alphabet character `"+R+"`");if(A==="''"?A="'":R==="'"&&(A=KC(A)),e.indexOf(A)===0)e=e.slice(A.length);else return s()}}if(e.length>0&&QC.test(e))return s();const v=p.map(A=>A.priority).sort((A,R)=>R-A).filter((A,R,S)=>S.indexOf(A)===R).map(A=>p.filter(R=>R.priority===A).sort((R,S)=>S.subPriority-R.subPriority)).map(A=>A[0]);let D=mt(n,r==null?void 0:r.in);if(isNaN(+D))return s();const k={};for(const A of v){if(!A.validate(D,h))return s();const R=A.set(D,k,h);Array.isArray(R)?(D=R[0],Object.assign(k,R[1])):D=R}return D}function KC(e){return e.match(qC)[1].replace(VC,"'")}function XC(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 JC(e,t,n){const[r,s]=wi(n==null?void 0:n.in,e,t);return r.getFullYear()===s.getFullYear()}function Sr(e,t,n){return Ms(e,-t,n)}function x1(e,t){const n=()=>Dt(t==null?void 0:t.in,NaN),s=nN(e);let i;if(s.date){const h=rN(s.date,2);i=sN(h.restDateString,h.year)}if(!i||isNaN(+i))return n();const l=+i;let c=0,f;if(s.time&&(c=oN(s.time),isNaN(c)))return n();if(s.timezone){if(f=aN(s.timezone),isNaN(f))return n()}else{const h=new Date(l+c),p=mt(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 mt(l+c+f,t==null?void 0:t.in)}const _c={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ZC=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,eN=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,tN=/^([+-])(\d{2})(?::?(\d{2}))?$/;function nN(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 rN(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 sN(e,t){if(t===null)return new Date(NaN);const n=e.match(ZC);if(!n)return new Date(NaN);const r=!!n[4],s=bl(n[1]),i=bl(n[2])-1,l=bl(n[3]),c=bl(n[4]),f=bl(n[5])-1;if(r)return dN(t,c,f)?iN(t,c,f):new Date(NaN);{const h=new Date(0);return!uN(t,i,l)||!cN(t,s)?new Date(NaN):(h.setUTCFullYear(t,i,Math.max(s,l)),h)}}function bl(e){return e?parseInt(e):1}function oN(e){const t=e.match(eN);if(!t)return NaN;const n=Fh(t[1]),r=Fh(t[2]),s=Fh(t[3]);return fN(n,r,s)?n*Tm+r*Em+s*1e3:NaN}function Fh(e){return e&&parseFloat(e.replace(",","."))||0}function aN(e){if(e==="Z")return 0;const t=e.match(tN);if(!t)return 0;const n=t[1]==="+"?-1:1,r=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return hN(r,s)?n*(r*Tm+s*Em):NaN}function iN(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 lN=[31,null,31,30,31,30,31,31,30,31,30,31];function av(e){return e%400===0||e%4===0&&e%100!==0}function uN(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(lN[t]||(av(e)?29:28))}function cN(e,t){return t>=1&&t<=(av(e)?366:365)}function dN(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function fN(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function hN(e,t){return t>=0&&t<=59}function mN(e,t,n){const r=mt(e,n==null?void 0:n.in),s=r.getFullYear(),i=r.getDate(),l=Dt(e,0);l.setFullYear(s,t,15),l.setHours(0,0,0,0);const c=GS(l);return r.setMonth(t,Math.min(i,c)),r}function pN(e,t,n){const r=mt(e,n==null?void 0:n.in);return isNaN(+r)?Dt(e,NaN):(r.setFullYear(t),r)}function Bl(e,t,n){return Ti(e,-t,n)}function iv(e,t,n){return km(e,-t,n)}function lv(e,t,n){return pd(e,-t,n)}function Dm(e,t,n){return yd(e,-t,n)}const yN="yyyy-MM-dd";function Tt(e){return on(e,yN)}function gN(e){const t=new Date,n=Tt(t);switch(e){case"today":return{start_date:n,end_date:n};case"yesterday":{const r=Tt(Sr(t,1));return{start_date:r,end_date:r}}case"last_7_days":{const r=Tt(Sr(t,1));return{start_date:Tt(Sr(t,7)),end_date:r}}case"last_30_days":{const r=Tt(Sr(t,1));return{start_date:Tt(Sr(t,30)),end_date:r}}case"last_90_days":{const r=Tt(Sr(t,1));return{start_date:Tt(Sr(t,90)),end_date:r}}case"last_12_months":{const r=Tt(Sr(t,1));return{start_date:Tt(Bl(t,12)),end_date:r}}case"year_to_date":return{start_date:Tt(yi(t)),end_date:n};case"month_to_date":return{start_date:Tt(Xl(t)),end_date:n};case"quarter_to_date":return{start_date:Tt(Xc(t)),end_date:n};case"previous_month":{const r=Bl(t,1);return{start_date:Tt(Xl(r)),end_date:Tt(gd(r))}}case"previous_quarter":{const r=Bl(t,3);return{start_date:Tt(Xc(r)),end_date:Tt(Sm(r))}}case"previous_year":{const r=Dm(t,1);return{start_date:Tt(yi(r)),end_date:Tt(xd(r))}}default:return null}}function xN(e){const n=ca(new Date);if(e.direction==="current")switch(e.unit){case"day":return{start_date:Tt(n),end_date:Tt(n)};case"week":return{start_date:Tt(Yr(n,{weekStartsOn:1})),end_date:Tt(bd(n,{weekStartsOn:1}))};case"month":return{start_date:Tt(Xl(n)),end_date:Tt(gd(n))};case"quarter":return{start_date:Tt(Xc(n)),end_date:Tt(Sm(n))};case"year":return{start_date:Tt(yi(n)),end_date:Tt(xd(n))}}const r=e.value??1;if(e.direction==="previous"){const c=e.includeToday?n:Sr(n,1),h={day:Sr,week:lv,month:Bl,quarter:iv,year:Dm}[e.unit]((e.includeToday,n),r);return{start_date:Tt(h<c?h:c),end_date:Tt(h<c?c:h)}}const s=e.includeToday?n:Ms(n,1),l={day:Ms,week:pd,month:Ti,quarter:km,year:yd}[e.unit](s,r);return{start_date:Tt(s<l?s:l),end_date:Tt(s<l?l:s)}}function gi(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=gN(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=xN(n);return{...e,start_date:r.start_date,end_date:r.end_date}}}return e}function uv(e,t){const n=pa(),r=Je(h=>h.globalFilters),s=Je(h=>h.chartFilters),i=Je(h=>h.crossFilters),l=Je(h=>h.getEffectiveFilters),c=C.useMemo(()=>Object.fromEntries(Object.entries(l(e)).filter(([h,p])=>p!=null&&p!==""&&!(Array.isArray(p)&&p.length===0))),[r,s,i,e]),f=C.useMemo(()=>{const h=gi(c);return t?{...h,...t}:h},[c,t]);return sr({queryKey:["chartData",e,f,n],queryFn:()=>n?ft.queryPublicChart(e,f,n):ft.queryChart(e,f),enabled:!!e})}function bN(e){const t=pa(),n=Je(f=>f.globalFilters),r=Je(f=>f.chartFilters),s=Je(f=>f.crossFilters),i=Je(f=>f.getEffectiveFilters),l=C.useMemo(()=>Object.fromEntries(Object.entries(i(e)).filter(([f,h])=>h!=null&&h!==""&&!(Array.isArray(h)&&h.length===0))),[n,r,s,e]),c=C.useMemo(()=>gi(l),[l]);return sr({queryKey:["chartWithData",e,c,t],queryFn:()=>t?ft.queryPublicChart(e,c,t,!0):ft.queryChart(e,c,{includeConfig:!0}),enabled:!!e})}function Om(){const e=Yn();return t=>{e.invalidateQueries({queryKey:["chartData",t]}),e.invalidateQueries({queryKey:["chartWithData",t]})}}function cv(){return sr({queryKey:["dashboards"],queryFn:()=>ft.getDashboards()})}function b1(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 vN(e){return e.tabs?e.tabs[0]?b1(e.tabs[0].layout):[]:e.layout?b1(e.layout):[]}function EN(e,t){var l,c,f;const n=Yn(),r=Je(h=>h.globalFilters),s=pa(),i=sr({queryKey:["dashboard",e,t,s],queryFn:()=>s?ft.getPublicDashboard(e,s):ft.getDashboard(e,t),enabled:!!e});return C.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=vN(i.data),v=gi(Object.fromEntries(Object.entries(r).filter(([D,k])=>k!=null)));g.forEach(D=>{n.prefetchQuery({queryKey:["chartWithData",D,v,s],queryFn:()=>s?ft.queryPublicChart(D,v,s,!0):ft.queryChart(D,v,{includeConfig:!0}),staleTime:1e3*60*5})})}},[(l=i.data)==null?void 0:l.layout,(c=i.data)==null?void 0:c.tabs,(f=i.data)==null?void 0:f.name,r,n,s]),i}function TN(e){const t=Yn();return Ja({mutationFn:({layout:n,message:r,tab:s})=>ft.saveDashboard(e,n,r,s),onSuccess:()=>{t.invalidateQueries({queryKey:["dashboard",e]})}})}function wN(){const e=Yn();return()=>{e.invalidateQueries({queryKey:["chartData"]}),e.invalidateQueries({queryKey:["chartWithData"]})}}const kN=[["config"],["dashboard"],["dashboards"],["chartData"],["chartWithData"],["chart"]];function SN(){const e=Yn(),t=C.useRef(1e3);C.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 kN)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 Am=C.createContext(null),Dc="yc-theme-mode";function CN(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function NN({configMode:e,children:t}){const n=C.useCallback(()=>{const f=localStorage.getItem(Dc);return f==="light"||f==="dark"?f:e==="light"||e==="dark"?e:CN()},[e]),[r,s]=C.useState(n);C.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]),C.useEffect(()=>{document.documentElement.setAttribute("data-theme",r)},[r]);const i=C.useCallback(()=>{s(f=>{const h=f==="light"?"dark":"light";return localStorage.setItem(Dc,h),h})},[]),l=C.useCallback(()=>{localStorage.removeItem(Dc),s(n())},[n]),c=C.useMemo(()=>({mode:r,toggleMode:i,clearOverride:l}),[r,i,l]);return d.jsx(Am.Provider,{value:c,children:t})}function dv(){const e=C.useContext(Am);if(!e)throw new Error("useThemeMode must be used within ThemeModeProvider");return e}function _N(){return C.useContext(Am)}const Oc={textColor:"#6b7280",borderColor:"#e5e7eb",surfaceColor:"#ffffff",splitLineColor:"#e5e7eb"};function $r(){const e=_N(),t=(e==null?void 0:e.mode)??"light";return C.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 v1(e,t){var i;const n=t.trim();if(!n)return e;const r=n.toLowerCase(),s=[];for(const l of e){const c=l.title.toLowerCase(),f=((i=l.description)==null?void 0:i.toLowerCase())??"",h=c.startsWith(r),p=c.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,c)=>l.rank!==c.rank?l.rank-c.rank:l.item.title.localeCompare(c.item.title)),s.map(l=>l.item)}function DN(e,t){const[n,r]=C.useState(""),[s,i]=C.useState(0),l=C.useMemo(()=>{const g=v1(e,n),v=v1(t,n);return{dashboards:g,charts:v,all:[...g,...v]}},[e,t,n]),c=C.useCallback(g=>{r(g),i(0)},[]),f=C.useCallback(()=>{i(g=>Math.min(g+1,Math.max(l.all.length-1,0)))},[l.all.length]),h=C.useCallback(()=>{i(g=>Math.max(g-1,0))},[]),p=C.useCallback(()=>{r(""),i(0)},[]),y=l.all.length>0?l.all[s]??null:null;return{query:n,activeIndex:s,results:l,setQuery:c,setActiveIndex:i,moveDown:f,moveUp:h,resetSearch:p,activeItem:y}}function ON(e,t){return e.filter(n=>!n.charts||n.charts.length===0?!0:t?n.charts.includes(t):!1)}function fv(e){const t=pa(),{data:n,...r}=sr({queryKey:["chartEvents"],queryFn:()=>ft.getChartEvents(),staleTime:3e4,enabled:!t}),s=(n==null?void 0:n.events)??[];return{events:C.useMemo(()=>n!=null&&n.events?ON(n.events,e):[],[n==null?void 0:n.events,e]),allEvents:s,...r}}const hv=new Set(["system-ui","serif","sans-serif","monospace","ui-monospace","cursive"]),AN={compact:"13px",default:"14px",comfortable:"16px"},IN={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 MN(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 E1(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 Bh(e){return hv.has(e)?`${e}, sans-serif`:e.toLowerCase().includes("mono")?`'${e}', monospace`:`'${e}', system-ui, sans-serif`}function LN(e,t="light"){var S,I,_,P,F,H,U,Y,q,G,ee,he;const n=e.base??"modern",r=IN[n],s=r.modeColors[t],i=((S=e.colors)==null?void 0:S.primary)??s.primary,l=((I=e.colors)==null?void 0:I.background)??s.background,c=((_=e.colors)==null?void 0:_.surface)??s.surface,f=((P=e.colors)==null?void 0:P.sidebar)??s.sidebar,h=((F=e.colors)==null?void 0:F.text)??s.text,p=((H=e.fonts)==null?void 0:H.heading)??r.fonts.heading,y=((U=e.fonts)==null?void 0:U.body)??r.fonts.body,g=((Y=e.fonts)==null?void 0:Y.mono)??r.fonts.mono,v=AN[((q=e.fonts)==null?void 0:q.size)??r.fonts.size]??"14px",D=e.palette??r.palette,k=new Set;for(const te of[p,y,g])!hv.has(te)&&te!=="ui-monospace"&&k.add(te);const T=k.size>0?`https://fonts.googleapis.com/css2?${[...k].map(te=>`family=${encodeURIComponent(te)}:wght@400;500;600;700`).join("&")}&display=swap`:null,E=MN(f)<.2,N=E?"#f1f5f9":h,O=E?"#94a3b8":s.textSecondary,A=E?"rgba(255,255,255,0.1)":s.border,R={"--yc-color-primary":i,"--yc-color-primary-light":E1(i,t==="dark"?15:20),"--yc-color-primary-dark":E1(i,t==="dark"?-10:-15),"--yc-color-background":l,"--yc-color-surface":c,"--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":N,"--yc-color-sidebar-text-secondary":O,"--yc-color-sidebar-border":A,"--yc-font-heading":Bh(p),"--yc-font-body":Bh(y),"--yc-font-mono":Bh(g),"--yc-font-size-base":v,"--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:R,palette:D,sidebarShow:((G=e.sidebar)==null?void 0:G.show)??r.sidebarShow,sidebarLinks:(ee=e.sidebar)==null?void 0:ee.links,sidebarSections:(he=e.sidebar)==null?void 0:he.sections,logo:e.logo,favicon:e.favicon,title:e.title,customCss:e.customCss,googleFontsUrl:T}}const mv=C.createContext(null);function RN({children:e}){const{data:t}=ya(),{mode:n}=dv(),r=C.useMemo(()=>LN((t==null?void 0:t.theme)??{},n),[t==null?void 0:t.theme,n]);return C.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]),C.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]),C.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]),C.useEffect(()=>{const s=r.title||(t==null?void 0:t.name)||"Yamchart";document.title=s},[r.title,t==null?void 0:t.name]),C.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(mv.Provider,{value:r,children:e})}function T1({children:e}){var r;const{data:t}=ya(),n=(r=t==null?void 0:t.theme)==null?void 0:r.mode;return d.jsx(NN,{configMode:n,children:d.jsx(RN,{children:e})})}function Im(){const e=C.useContext(mv);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function pv(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=pv(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Wn(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=pv(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 w1=380,Ls=vm((e,t)=>({messages:[],panelOpen:!1,panelWidth:Number(localStorage.getItem("chat:panel-width"))||w1,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),c=((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:c}}),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 c=[...l.messages],f=c[c.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);c[c.length-1]={...f,toolCalls:p}}else{const p=[...f.toolCalls??[],h];c[c.length-1]={...f,toolCalls:p}}}return{messages:c}}),addToolEnd:(n,r,s,i)=>e(l=>{const c=[...l.messages],f=c[c.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);c[c.length-1]={...f,toolCalls:p}}return{messages:c}}),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:w1,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 Td(){const{data:e}=sr({queryKey:["chat-agents"],queryFn:()=>ft.getChatAgents().catch(()=>null),retry:!1,staleTime:6e4});return Array.isArray(e)&&e.length>0}const k1="yamchart-sidebar-folders";function PN(e){return e?e.replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()):"Ungrouped"}function S1(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 c=i.title||i.name,f=l.title||l.name;return c.localeCompare(f)}),n.push({folder:r,label:PN(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 C1({expanded:e,className:t,style:n}){return d.jsx("svg",{className:Wn("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 N1({dashboards:e,charts:t,currentPath:n,onNavigate:r,collapsed:s=!1}){var S,I;const i=Im(),l=Td(),c=n.split("?")[0],f=_=>c===_,h=((S=i.sidebarSections)==null?void 0:S.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=C.useMemo(()=>S1(e),[e]),v=C.useMemo(()=>S1(t),[t]),D=C.useMemo(()=>{for(const _ of e)if(f(`/dashboards/${_.name}`))return _.folder??"";return null},[e,c]),k=C.useMemo(()=>{for(const _ of t)if(f(`/charts/${_.name}`))return _.folder??"";return null},[t,c]),[T,E]=C.useState(()=>{try{const _=localStorage.getItem(k1);return _?JSON.parse(_):{}}catch{return{}}});C.useEffect(()=>{try{localStorage.setItem(k1,JSON.stringify(T))}catch{}},[T]);const N=C.useCallback((_,P)=>{const F=`${_}:${P}`;return _==="dashboards"&&D===P||_==="charts"&&k===P?!0:T[F]??!1},[T,D,k]),O=C.useCallback((_,P)=>{const F=`${_}:${P}`,H=_==="dashboards"&&D===P||_==="charts"&&k===P;E(U=>{const Y=U[F]??H;return{...U,[F]:!Y}})},[D,k]),A=g.length>1||g.some(_=>_.folder!==""),R=v.length>1||v.some(_=>_.folder!=="");return d.jsx("aside",{className:Wn("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(_=>{const P=`/dashboards/${_.name}`,F=f(P);return d.jsx("button",{onClick:()=>r(P),className:"p-2 rounded transition-colors",title:_.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"})})},_.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(_=>{const P=`/charts/${_.name}`,F=f(P);return d.jsx("button",{onClick:()=>r(P),className:"p-2 rounded transition-colors",title:_.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:_.type,className:"w-5 h-5"})},_.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(_=>{const P=N("dashboards",_.folder);return d.jsxs("div",{children:[d.jsxs("button",{onClick:()=>O("dashboards",_.folder),className:"w-full flex items-center gap-2 px-4 py-1.5 text-xs font-medium hover:bg-white/5 transition-colors",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:[d.jsx(C1,{expanded:P}),d.jsx("span",{className:"truncate",children:_.label}),d.jsx("span",{className:"ml-auto opacity-50",children:_.items.length})]}),P&&_.items.map(F=>{const H=`/dashboards/${F.name}`,U=f(H);return d.jsxs("button",{onClick:()=>r(H),className:Wn("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)})]},_.folder)}):e.map(_=>{const P=`/dashboards/${_.name}`,F=f(P);return d.jsxs("button",{onClick:()=>r(P),className:Wn("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:_.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:_.title})]},_.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"}),R?v.map(_=>{const P=N("charts",_.folder);return d.jsxs("div",{children:[d.jsxs("button",{onClick:()=>O("charts",_.folder),className:"w-full flex items-center gap-2 px-4 py-1.5 text-xs font-medium hover:bg-white/5 transition-colors",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:[d.jsx(C1,{expanded:P}),d.jsx("span",{className:"truncate",children:_.label}),d.jsx("span",{className:"ml-auto opacity-50",children:_.items.length})]}),P&&_.items.map(F=>{const H=`/charts/${F.name}`,U=f(H);return d.jsxs("button",{onClick:()=>r(H),className:Wn("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)})]},_.folder)}):t.map(_=>{const P=`/charts/${_.name}`,F=f(P);return d.jsxs("button",{onClick:()=>r(P),className:Wn("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:_.title,children:[d.jsx(Yc,{type:_.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:_.title})]},_.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.jsxs("a",{href:_.url,target:"_blank",rel:"noopener noreferrer",className:"w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors hover:bg-white/10",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:[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:_.label})]},_.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:Wn("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:()=>Ls.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:Wn("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 jN({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 FN({status:e,connection:t,connectionStatus:n,authType:r}){const s=Yn(),[i,l]=C.useState(!1),[c,f]=C.useState(null),h=n==="disconnected",p=n?n==="connected":e==="ok",y=h&&r==="externalbrowser",g=async()=>{l(!0),f(null);try{await ft.reconnect(),await s.invalidateQueries()}catch(v){f(v instanceof Error?v.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"})]}),c&&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:c}),t&&d.jsx(jN,{connection:t})]})}const So=vm(e=>({auth:{status:"loading"},providers:[],checkAuth:async()=>{try{const t=await ft.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 ft.authLogin({email:t,password:n});e({auth:{status:"authenticated",user:r}})},setup:async(t,n,r)=>{const{user:s}=await ft.authSetup({email:t,name:n,password:r});e({auth:{status:"authenticated",user:s}})},logout:async()=>{await ft.authLogout(),e({auth:{status:"unauthenticated"}})}}));function BN({onClose:e}){const[t,n]=C.useState(""),[r,s]=C.useState(""),[i,l]=C.useState(""),[c,f]=C.useState(""),[h,p]=C.useState(!1),[y,g]=C.useState(!1),v=async D=>{if(D.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 ft.authChangePassword({current_password:t,new_password:r}),p(!0),setTimeout(e,1500)}catch(k){f(k instanceof cu?k.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:D=>D.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:v,className:"space-y-4",children:[c&&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:c}),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:D=>n(D.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:D=>s(D.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:D=>l(D.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 HN({onNavigateToUsers:e,onNavigateToShares:t}){const n=So(h=>h.auth),r=So(h=>h.logout),[s,i]=C.useState(!1),[l,c]=C.useState(!1),f=C.useRef(null);return C.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),c(!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(BN,{onClose:()=>c(!1)})]})}function UN({onToggleSidebar:e,onOpenSearch:t,currentPath:n,onNavigateToUsers:r,onNavigateToShares:s}){var g;const i=Im(),{mode:l,toggleMode:c}=dv(),{data:f}=zk(),h=So(v=>v.auth),p=n.replace(/\?.*$/,"").replace(/^\//,"").split("/").filter(Boolean).map(v=>decodeURIComponent(v).replace(/-/g," ").replace(/\b\w/g,D=>D.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((v,D)=>d.jsxs("span",{className:"flex items-center gap-1.5",children:[D>0&&d.jsx("span",{children:"/"}),d.jsx("span",{className:D===p.length-1?"font-medium":"",style:D===p.length-1?{color:"var(--yc-color-text)"}:void 0,children:v})]},D))})]}),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(FN,{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:c,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(HN,{onNavigateToUsers:r,onNavigateToShares:s})]})]})}function zN({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 _1(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 WN(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 c=e.slice(i,l);return i>0&&(c="..."+c),l<e.length&&(c=c+"..."),c}function Hh({item:e,query:t,isActive:n,onClick:r,onMouseEnter:s}){const i=t.trim().toLowerCase(),l=i&&e.title.toLowerCase().includes(i),c=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(zN,{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:_1(e.title,t)}),c&&d.jsx("div",{className:"text-xs truncate mt-0.5",style:{color:"var(--yc-color-text-secondary)"},children:i?_1(WN(e.description,t),t):e.description})]})]})}function YN({isOpen:e,onClose:t,onNavigate:n,dashboards:r,charts:s}){const i=C.useRef(null),l=Td(),c=C.useMemo(()=>r.map(H=>({kind:"dashboard",name:H.name,title:H.title,description:H.description})),[r]),f=C.useMemo(()=>s.map(H=>({kind:"chart",name:H.name,title:H.title,description:H.description,type:H.type})),[s]),h=C.useMemo(()=>l?{kind:"explore",name:"explore",title:"Explore Data",description:"AI-powered data exploration workspace"}:null,[l]),{query:p,activeIndex:y,results:g,setQuery:v,setActiveIndex:D,moveDown:k,moveUp:T,resetSearch:E,activeItem:N}=DN(c,f),O=C.useMemo(()=>h?[...g.all,h]:g.all,[g.all,h]);C.useEffect(()=>{if(e){const H=setTimeout(()=>{var U;return(U=i.current)==null?void 0:U.focus()},50);return()=>clearTimeout(H)}else E()},[e,E]),C.useEffect(()=>{if(!e)return;const H=document.querySelector('[data-active="true"]');H&&H.scrollIntoView({block:"nearest"})},[e,y]);const A=h?O.length-1:-1,R=y===A&&h?h:N;if(C.useEffect(()=>{if(!e)return;function H(U){switch(U.key){case"ArrowDown":U.preventDefault(),y<O.length-1&&D(y+1);break;case"Tab":U.preventDefault(),U.shiftKey?y>0&&D(y-1):y<O.length-1&&D(y+1);break;case"ArrowUp":U.preventDefault(),y>0&&D(y-1);break;case"Enter":if(U.preventDefault(),R){if(R.kind==="explore")n("/explore");else{const Y=R.kind==="dashboard"?`/dashboards/${R.name}`:`/charts/${R.name}`;n(Y)}t()}break;case"Escape":U.preventDefault(),t();break}}return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[e,R,y,O.length,D,k,T,n,t]),!e)return null;const S=p.trim().length>0,I=S&&g.all.length===0,_=g.dashboards.length,P=h?g.all.length:-1;function F(H){if(H.kind==="explore")n("/explore");else{const U=H.kind==="dashboard"?`/dashboards/${H.name}`:`/charts/${H.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:H=>{H.target===H.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:H=>v(H.target.value),placeholder:"Search dashboards and charts...",className:"flex-1 bg-transparent outline-none text-sm",style:{color:"var(--yc-color-text)"}}),S&&d.jsx("button",{onClick:()=>v(""),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:()=>{Ls.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((H,U)=>d.jsx(Hh,{item:H,query:p,isActive:U===y,onClick:()=>F(H),onMouseEnter:()=>D(U)},`dashboard-${H.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((H,U)=>d.jsx(Hh,{item:H,query:p,isActive:_+U===y,onClick:()=>F(H),onMouseEnter:()=>D(_+U)},`chart-${H.name}`))]}),l&&p.trim()&&d.jsx("button",{onClick:()=>{Ls.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(Hh,{item:h,query:p,isActive:P===y,onClick:()=>F(h),onMouseEnter:()=>D(P)})})]})]})})}function $N(e){const t=C.useRef(null),{addUserMessage:n,startAssistantMessage:r,appendText:s,addToolStart:i,addToolEnd:l,addSuggestions:c,completeAssistantMessage:f,setError:h,messages:p,context:y,isStreaming:g}=Ls(),v=Je(T=>T.setGlobalFilter),D=C.useCallback(async(T,E)=>{var A,R;if(g)return;n(T),(A=t.current)==null||A.abort();const N=new AbortController;t.current=N;const O=E??y;try{const S=await fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:T,context:O,history:p}),signal:N.signal});if(!S.ok){const H=await S.json().catch(()=>({error:"Chat request failed"}));h(H.error??`HTTP ${S.status}`);return}const I=(R=S.body)==null?void 0:R.getReader();if(!I){h("No response stream");return}const _=new TextDecoder;let P="",F=!1;for(;;){const{done:H,value:U}=await I.read();if(H)break;P+=_.decode(U,{stream:!0});const Y=P.split(`
|
|
34
|
-
`);P=Y.pop()??"";let q="",G="";for(const ee of Y)if(ee.startsWith("event: "))q=ee.slice(7).trim();else if(ee.startsWith("data: "))G=ee.slice(6);else if(ee===""&&q&&G){try{const he=JSON.parse(G);switch(q){case"agent_selected":F||(r(he.name),F=!0);break;case"text_delta":F||(r("assistant"),F=!0),s(he.text);break;case"tool_start":F||(r("assistant"),F=!0),i(he.id,he.name,he.args,he.parentToolId);break;case"tool_end":l(he.id,he.name,he.result,he.durationMs);break;case"suggestions":c(he.suggestions);break;case"filter_update":if(he.filters)for(const[te,ue]of Object.entries(he.filters))v(te,ue);break;case"chart_saved":Ls.getState().addSavedChart(he.name);break;case"navigate":e&&e(he.target,he.name,he.edit);break;case"done":f();break;case"error":h(he.message);break}}catch{}q="",G=""}}F&&f()}catch(S){S.name!=="AbortError"&&h(S instanceof Error?S.message:"Connection failed")}},[p,y,g,n,r,s,i,l,c,f,h,v,e]),k=C.useCallback(()=>{var T;(T=t.current)==null||T.abort(),f()},[f]);return{sendMessage:D,abort:k}}function D1(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 yv(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const qN=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,VN=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,QN={};function O1(e,t){return(QN.jsx?VN:qN).test(e)}const GN=/[ \t\n\f\r]/g;function KN(e){return typeof e=="object"?e.type==="text"?A1(e.value):!1:A1(e)}function A1(e){return e.replace(GN,"")===""}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 gv(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 or{constructor(t,n){this.attribute=n,this.property=t}}or.prototype.attribute="";or.prototype.booleanish=!1;or.prototype.boolean=!1;or.prototype.commaOrSpaceSeparated=!1;or.prototype.commaSeparated=!1;or.prototype.defined=!1;or.prototype.mustUseProperty=!1;or.prototype.number=!1;or.prototype.overloadedBoolean=!1;or.prototype.property="";or.prototype.spaceSeparated=!1;or.prototype.space=void 0;let XN=0;const dt=xa(),pn=xa(),U0=xa(),De=xa(),Bt=xa(),Za=xa(),cr=xa();function xa(){return 2**++XN}const z0=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:pn,commaOrSpaceSeparated:cr,commaSeparated:Za,number:De,overloadedBoolean:U0,spaceSeparated:Bt},Symbol.toStringTag,{value:"Module"})),Uh=Object.keys(z0);class Mm extends or{constructor(t,n,r,s){let i=-1;if(super(t,n),I1(this,"space",s),typeof r=="number")for(;++i<Uh.length;){const l=Uh[i];I1(this,Uh[i],(r&z0[l])===z0[l])}}}Mm.prototype.defined=!0;function I1(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 Mm(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 xv=ki({properties:{ariaActiveDescendant:null,ariaAtomic:pn,ariaAutoComplete:null,ariaBusy:pn,ariaChecked:pn,ariaColCount:De,ariaColIndex:De,ariaColSpan:De,ariaControls:Bt,ariaCurrent:null,ariaDescribedBy:Bt,ariaDetails:null,ariaDisabled:pn,ariaDropEffect:Bt,ariaErrorMessage:null,ariaExpanded:pn,ariaFlowTo:Bt,ariaGrabbed:pn,ariaHasPopup:null,ariaHidden:pn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Bt,ariaLevel:De,ariaLive:null,ariaModal:pn,ariaMultiLine:pn,ariaMultiSelectable:pn,ariaOrientation:null,ariaOwns:Bt,ariaPlaceholder:null,ariaPosInSet:De,ariaPressed:pn,ariaReadOnly:pn,ariaRelevant:null,ariaRequired:pn,ariaRoleDescription:Bt,ariaRowCount:De,ariaRowIndex:De,ariaRowSpan:De,ariaSelected:pn,ariaSetSize:De,ariaSort:null,ariaValueMax:De,ariaValueMin:De,ariaValueNow:De,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function bv(e,t){return t in e?e[t]:t}function vv(e,t){return bv(e,t.toLowerCase())}const JN=ki({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Za,acceptCharset:Bt,accessKey:Bt,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:Bt,autoFocus:dt,autoPlay:dt,blocking:Bt,capture:null,charSet:null,checked:dt,cite:null,className:Bt,cols:De,colSpan:null,content:null,contentEditable:pn,controls:dt,controlsList:Bt,coords:De|Za,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:U0,draggable:pn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:Bt,height:De,hidden:U0,high:De,href:null,hrefLang:null,htmlFor:Bt,httpEquiv:Bt,id:null,imageSizes:null,imageSrcSet:null,inert:dt,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:Bt,itemRef:Bt,itemScope:dt,itemType:Bt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:De,manifest:null,max:null,maxLength:De,media:null,method:null,min:null,minLength:De,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,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:dt,optimum:De,pattern:null,ping:Bt,placeholder:null,playsInline:dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:Bt,required:dt,reversed:dt,rows:De,rowSpan:De,sandbox:Bt,scope:null,scoped:dt,seamless:dt,selected:dt,shadowRootClonable:dt,shadowRootDelegatesFocus:dt,shadowRootMode:null,shape:null,size:De,sizes:null,slot:null,span:De,spellCheck:pn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:De,step:null,style:null,tabIndex:De,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:pn,width:De,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Bt,axis:null,background:null,bgColor:null,border:De,borderColor:null,bottomMargin:De,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:De,leftMargin:De,link:null,longDesc:null,lowSrc:null,marginHeight:De,marginWidth:De,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:De,rules:null,scheme:null,scrolling:pn,standby:null,summary:null,text:null,topMargin:De,valueType:null,version:null,vAlign:null,vLink:null,vSpace:De,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:De,security:null,unselectable:null},space:"html",transform:vv}),ZN=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:cr,accentHeight:De,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:De,amplitude:De,arabicForm:null,ascent:De,attributeName:null,attributeType:null,azimuth:De,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:De,by:null,calcMode:null,capHeight:De,className:Bt,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:De,diffuseConstant:De,direction:null,display:null,dur:null,divisor:De,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:De,enableBackground:null,end:null,event:null,exponent:De,externalResourcesRequired:null,fill:null,fillOpacity:De,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:Za,g2:Za,glyphName:Za,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:De,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:De,horizOriginX:De,horizOriginY:De,id:null,ideographic:De,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:De,k:De,k1:De,k2:De,k3:De,k4:De,kernelMatrix:cr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:De,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:De,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:De,overlineThickness:De,paintOrder:null,panose1:null,path:null,pathLength:De,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Bt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:De,pointsAtY:De,pointsAtZ:De,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:cr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:cr,rev:cr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:cr,requiredFeatures:cr,requiredFonts:cr,requiredFormats:cr,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:De,specularExponent:De,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:De,strikethroughThickness:De,string:null,stroke:null,strokeDashArray:cr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:De,strokeOpacity:De,strokeWidth:null,style:null,surfaceScale:De,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:cr,tabIndex:De,tableValues:null,target:null,targetX:De,targetY:De,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:cr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:De,underlineThickness:De,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:De,values:null,vAlphabetic:De,vMathematical:De,vectorEffect:null,vHanging:De,vIdeographic:De,version:null,vertAdvY:De,vertOriginX:De,vertOriginY:De,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:De,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:bv}),Ev=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()}}),Tv=ki({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:vv}),wv=ki({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),e3={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"},t3=/[A-Z]/g,M1=/-[a-z]/g,n3=/^data[-\w.:]+$/i;function wd(e,t){const n=Jl(t);let r=t,s=or;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&n3.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(M1,s3);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!M1.test(i)){let l=i.replace(t3,r3);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=Mm}return new s(r,t)}function r3(e){return"-"+e.toLowerCase()}function s3(e){return e.charAt(1).toUpperCase()}const fu=gv([xv,JN,Ev,Tv,wv],"html"),No=gv([xv,ZN,Ev,Tv,wv],"svg");function L1(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function kv(e){return e.join(" ").trim()}var qa={},zh,R1;function o3(){if(R1)return zh;R1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
|
|
35
|
-
`,h="/",p="*",y="",g="comment",v="declaration";function D(T,E){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];E=E||{};var N=1,O=1;function A(q){var G=q.match(t);G&&(N+=G.length);var ee=q.lastIndexOf(f);O=~ee?q.length-ee:O+q.length}function R(){var q={line:N,column:O};return function(G){return G.position=new S(q),P(),G}}function S(q){this.start=q,this.end={line:N,column:O},this.source=E.source}S.prototype.content=T;function I(q){var G=new Error(E.source+":"+N+":"+O+": "+q);if(G.reason=q,G.filename=E.source,G.line=N,G.column=O,G.source=T,!E.silent)throw G}function _(q){var G=q.exec(T);if(G){var ee=G[0];return A(ee),T=T.slice(ee.length),G}}function P(){_(n)}function F(q){var G;for(q=q||[];G=H();)G!==!1&&q.push(G);return q}function H(){var q=R();if(!(h!=T.charAt(0)||p!=T.charAt(1))){for(var G=2;y!=T.charAt(G)&&(p!=T.charAt(G)||h!=T.charAt(G+1));)++G;if(G+=2,y===T.charAt(G-1))return I("End of comment missing");var ee=T.slice(2,G-2);return O+=2,A(ee),T=T.slice(G),O+=2,q({type:g,comment:ee})}}function U(){var q=R(),G=_(r);if(G){if(H(),!_(s))return I("property missing ':'");var ee=_(i),he=q({type:v,property:k(G[0].replace(e,y)),value:ee?k(ee[0].replace(e,y)):y});return _(l),he}}function Y(){var q=[];F(q);for(var G;G=U();)G!==!1&&(q.push(G),F(q));return q}return P(),Y()}function k(T){return T?T.replace(c,y):y}return zh=D,zh}var P1;function a3(){if(P1)return qa;P1=1;var e=qa&&qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qa,"__esModule",{value:!0}),qa.default=n;const t=e(o3());function n(r,s){let i=null;if(!r||typeof r!="string")return i;const l=(0,t.default)(r),c=typeof s=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:p}=f;c?s(h,p,f):p&&(i=i||{},i[h]=p)}),i}return qa}var vl={},j1;function i3(){if(j1)return vl;j1=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()},c=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,c):h=h.replace(r,c),h.replace(t,l))};return vl.camelCase=f,vl}var El,F1;function l3(){if(F1)return El;F1=1;var e=El&&El.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(a3()),n=i3();function r(s,i){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(c,f){c&&f&&(l[(0,n.camelCase)(c,i)]=f)}),l}return r.default=r,El=r,El}var u3=l3();const c3=_b(u3),kd=Sv("end"),ds=Sv("start");function Sv(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 d3(e){const t=ds(e),n=kd(e);if(t&&n)return{start:t,end:n}}function Hl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?B1(e.position):"start"in e||"end"in e?B1(e):"line"in e||"column"in e?W0(e):""}function W0(e){return H1(e&&e.line)+":"+H1(e&&e.column)}function B1(e){return W0(e&&e.start)+"-"+W0(e&&e.end)}function H1(e){return e&&typeof e=="number"?e:1}class Fn 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 c=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=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=c?c.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}}Fn.prototype.file="";Fn.prototype.name="";Fn.prototype.reason="";Fn.prototype.message="";Fn.prototype.stack="";Fn.prototype.column=void 0;Fn.prototype.line=void 0;Fn.prototype.ancestors=void 0;Fn.prototype.cause=void 0;Fn.prototype.fatal=void 0;Fn.prototype.place=void 0;Fn.prototype.ruleId=void 0;Fn.prototype.source=void 0;const Lm={}.hasOwnProperty,f3=new Map,h3=/[A-Z]/g,m3=new Set(["table","tbody","thead","tfoot","tr"]),p3=new Set(["td","th"]),Cv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function y3(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=k3(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=w3(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=Nv(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function Nv(e,t,n){if(t.type==="element")return g3(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return x3(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return v3(e,t,n);if(t.type==="mdxjsEsm")return b3(e,t);if(t.type==="root")return E3(e,t,n);if(t.type==="text")return T3(e,t)}function g3(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=Dv(e,t.tagName,!1),l=S3(e,t);let c=Pm(e,t);return m3.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!KN(f):!0})),_v(e,l,i,t),Rm(l,c),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function x3(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 b3(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Zl(e,t.position)}function v3(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:Dv(e,t.name,!0),l=C3(e,t),c=Pm(e,t);return _v(e,l,i,t),Rm(l,c),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function E3(e,t,n){const r={};return Rm(r,Pm(e,t)),e.create(t,e.Fragment,r,n)}function T3(e,t){return t.value}function _v(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Rm(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function w3(e,t,n){return r;function r(s,i,l,c){const h=Array.isArray(l.children)?n:t;return c?h(i,l,c):h(i,l)}}function k3(e,t){return n;function n(r,s,i,l){const c=Array.isArray(i.children),f=ds(r);return t(s,i,l,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function S3(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Lm.call(t.properties,s)){const i=N3(e,s,t.properties[s]);if(i){const[l,c]=i;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&p3.has(t.tagName)?r=c:n[l]=c}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function C3(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 c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.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 c=r.value.data.estree.body[0];c.type,i=e.evaluater.evaluateExpression(c.expression)}else Zl(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function Pm(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:f3;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 c=Nv(e,i,l);c!==void 0&&n.push(c)}return n}function N3(e,t,n){const r=wd(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?yv(n):kv(n)),r.property==="style"){let s=typeof n=="object"?n:_3(e,String(n));return e.stylePropertyNameCase==="css"&&(s=D3(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?e3[r.property]||r.property:r.attribute,n]}}function _3(e,t){try{return c3(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new Fn("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=Cv+"#cannot-parse-style-attribute",s}}function Dv(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 c=O1(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(i&&c.type==="Literal"),optional:!1}:c}r=l}else r=O1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return Lm.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 Fn("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=Cv+"#cannot-handle-mdx-estrees-without-createevaluater",n}function D3(e){const t={};let n;for(n in e)Lm.call(e,n)&&(t[O3(n)]=e[n]);return t}function O3(e){let t=e.replace(h3,A3);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function A3(e){return"-"+e.toLowerCase()}const Wh={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"]},I3={};function M3(e,t){const n=I3,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ov(e,r,s)}function Ov(e,t,n){if(L3(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 U1(e.children,t,n)}return Array.isArray(e)?U1(e,t,n):""}function U1(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=Ov(e[s],t,n);return r.join("")}function L3(e){return!!(e&&typeof e=="object")}const z1=document.createElement("i");function jm(e){const t="&"+e+";";z1.innerHTML=t;const n=z1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function cs(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 Nr(e,t){return e.length>0?(cs(e,e.length,0,t),e):t}const W1={}.hasOwnProperty;function R3(e){const t={};let n=-1;for(;++n<e.length;)P3(t,e[n]);return t}function P3(e,t){let n;for(n in t){const s=(W1.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let l;if(i)for(l in i){W1.call(s,l)||(s[l]=[]);const c=i[l];j3(s[l],Array.isArray(c)?c:c?[c]:[])}}}function j3(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);cs(e,0,0,r)}function Av(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 ei(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ls=_o(/[A-Za-z]/),hr=_o(/[\dA-Za-z]/),F3=_o(/[#-'*+\--9=?A-Z^-~]/);function Y0(e){return e!==null&&(e<32||e===127)}const $0=_o(/\d/),B3=_o(/[\dA-Fa-f]/),H3=_o(/[!-/:-@[-`{-~]/);function it(e){return e!==null&&e<-2}function rr(e){return e!==null&&(e<0||e===32)}function St(e){return e===-2||e===-1||e===32}const U3=_o(new RegExp("\\p{P}|\\p{S}","u")),z3=_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&&hr(e.charCodeAt(n+1))&&hr(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 c=e.charCodeAt(n+1);i<56320&&c>56319&&c<57344?(l=String.fromCharCode(i,c),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 Ht(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(f){return St(f)?(e.enter(n),c(f)):t(f)}function c(f){return St(f)&&i++<s?(e.consume(f),c):(e.exit(n),t(f))}}const W3={tokenize:Y3};function Y3(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Ht(e,t,"linePrefix")}function s(c){return e.enter("paragraph"),i(c)}function i(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return it(c)?(e.consume(c),e.exit("chunkText"),i):(e.consume(c),l)}}const $3={tokenize:q3},Y1={tokenize:V3};function q3(e){const t=this,n=[];let r=0,s,i,l;return c;function c(O){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,f,h)(O)}return h(O)}function f(O){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&N();const A=t.events.length;let R=A,S;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){S=t.events[R][1].end;break}E(r);let I=A;for(;I<t.events.length;)t.events[I][1].end={...S},I++;return cs(t.events,R+1,0,t.events.slice(A)),t.events.length=I,h(O)}return c(O)}function h(O){if(r===n.length){if(!s)return g(O);if(s.currentConstruct&&s.currentConstruct.concrete)return D(O);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Y1,p,y)(O)}function p(O){return s&&N(),E(r),g(O)}function y(O){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,D(O)}function g(O){return t.containerState={},e.attempt(Y1,v,D)(O)}function v(O){return r++,n.push([t.currentConstruct,t.containerState]),g(O)}function D(O){if(O===null){s&&N(),E(0),e.consume(O);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),k(O)}function k(O){if(O===null){T(e.exit("chunkFlow"),!0),E(0),e.consume(O);return}return it(O)?(e.consume(O),T(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(O),k)}function T(O,A){const R=t.sliceStream(O);if(A&&R.push(null),O.previous=i,i&&(i.next=O),i=O,s.defineSkip(O.start),s.write(R),t.parser.lazy[O.start.line]){let S=s.events.length;for(;S--;)if(s.events[S][1].start.offset<l&&(!s.events[S][1].end||s.events[S][1].end.offset>l))return;const I=t.events.length;let _=I,P,F;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(P){F=t.events[_][1].end;break}P=!0}for(E(r),S=I;S<t.events.length;)t.events[S][1].end={...F},S++;cs(t.events,_+1,0,t.events.slice(I)),t.events.length=S}}function E(O){let A=n.length;for(;A-- >O;){const R=n[A];t.containerState=R[1],R[0].exit.call(t,e)}n.length=O}function N(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function V3(e,t,n){return Ht(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function $1(e){if(e===null||rr(e)||z3(e))return 1;if(U3(e))return 2}function Fm(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 q0={name:"attention",resolveAll:Q3,tokenize:G3};function Q3(e,t){let n=-1,r,s,i,l,c,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};q1(y,-f),q1(g,f),l={type:f>1?"strongSequence":"emphasisSequence",start:y,end:{...e[r][1].end}},c={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:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=Nr(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=Nr(h,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",i,t]]),h=Nr(h,Fm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=Nr(h,[["exit",i,t],["enter",c,t],["exit",c,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,h=Nr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,cs(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 G3(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=$1(r);let i;return l;function l(f){return i=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===i)return e.consume(f),c;const h=e.exit("attentionSequence"),p=$1(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 q1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const K3={name:"autolink",tokenize:X3};function X3(e,t,n){let r=0;return s;function s(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(v){return ls(v)?(e.consume(v),l):v===64?n(v):h(v)}function l(v){return v===43||v===45||v===46||hr(v)?(r=1,c(v)):h(v)}function c(v){return v===58?(e.consume(v),r=0,f):(v===43||v===45||v===46||hr(v))&&r++<32?(e.consume(v),c):(r=0,h(v))}function f(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Y0(v)?n(v):(e.consume(v),f)}function h(v){return v===64?(e.consume(v),p):F3(v)?(e.consume(v),h):n(v)}function p(v){return hr(v)?y(v):n(v)}function y(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):g(v)}function g(v){if((v===45||hr(v))&&r++<63){const D=v===45?g:y;return e.consume(v),D}return n(v)}}const Sd={partial:!0,tokenize:J3};function J3(e,t,n){return r;function r(i){return St(i)?Ht(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||it(i)?t(i):n(i)}}const Iv={continuation:{tokenize:e_},exit:t_,name:"blockQuote",tokenize:Z3};function Z3(e,t,n){const r=this;return s;function s(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),i}return n(l)}function i(l){return St(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function e_(e,t,n){const r=this;return s;function s(l){return St(l)?Ht(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):i(l)}function i(l){return e.attempt(Iv,t,n)(l)}}function t_(e){e.exit("blockQuote")}const Mv={name:"characterEscape",tokenize:n_};function n_(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 H3(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Lv={name:"characterReference",tokenize:r_};function r_(e,t,n){const r=this;let s=0,i,l;return c;function c(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=hr,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=B3,p):(e.enter("characterReferenceValue"),i=7,l=$0,p(y))}function p(y){if(y===59&&s){const g=e.exit("characterReferenceValue");return l===hr&&!jm(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 V1={partial:!0,tokenize:o_},Q1={concrete:!0,name:"codeFenced",tokenize:s_};function s_(e,t,n){const r=this,s={partial:!0,tokenize:R};let i=0,l=0,c;return f;function f(S){return h(S)}function h(S){const I=r.events[r.events.length-1];return i=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,c=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(S)}function p(S){return S===c?(l++,e.consume(S),p):l<3?n(S):(e.exit("codeFencedFenceSequence"),St(S)?Ht(e,y,"whitespace")(S):y(S))}function y(S){return S===null||it(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(V1,k,A)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||it(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(S)):St(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ht(e,v,"whitespace")(S)):S===96&&S===c?n(S):(e.consume(S),g)}function v(S){return S===null||it(S)?y(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),D(S))}function D(S){return S===null||it(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(S)):S===96&&S===c?n(S):(e.consume(S),D)}function k(S){return e.attempt(s,A,T)(S)}function T(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),E}function E(S){return i>0&&St(S)?Ht(e,N,"linePrefix",i+1)(S):N(S)}function N(S){return S===null||it(S)?e.check(V1,k,A)(S):(e.enter("codeFlowValue"),O(S))}function O(S){return S===null||it(S)?(e.exit("codeFlowValue"),N(S)):(e.consume(S),O)}function A(S){return e.exit("codeFenced"),t(S)}function R(S,I,_){let P=0;return F;function F(G){return S.enter("lineEnding"),S.consume(G),S.exit("lineEnding"),H}function H(G){return S.enter("codeFencedFence"),St(G)?Ht(S,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):U(G)}function U(G){return G===c?(S.enter("codeFencedFenceSequence"),Y(G)):_(G)}function Y(G){return G===c?(P++,S.consume(G),Y):P>=l?(S.exit("codeFencedFenceSequence"),St(G)?Ht(S,q,"whitespace")(G):q(G)):_(G)}function q(G){return G===null||it(G)?(S.exit("codeFencedFence"),I(G)):_(G)}}}function o_(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 Yh={name:"codeIndented",tokenize:i_},a_={partial:!0,tokenize:l_};function i_(e,t,n){const r=this;return s;function s(h){return e.enter("codeIndented"),Ht(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):it(h)?e.attempt(a_,l,f)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||it(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),c)}function f(h){return e.exit("codeIndented"),t(h)}}function l_(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):it(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):Ht(e,i,"linePrefix",5)(l)}function i(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):it(l)?s(l):n(l)}}const u_={name:"codeText",previous:d_,resolve:c_,tokenize:f_};function c_(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 d_(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function f_(e,t,n){let r=0,s,i;return l;function l(y){return e.enter("codeText"),e.enter("codeTextSequence"),c(y)}function c(y){return y===96?(e.consume(y),r++,c):(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)):it(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||it(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 h_{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 Rv(e){const t={};let n=-1,r,s,i,l,c,f,h;const p=new h_(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,m_(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},c=p.slice(s,n),c.unshift(r),p.splice(s,n-s+1,c))}}return cs(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function m_(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 c=l.events,f=[],h={};let p,y,g=-1,v=n,D=0,k=0;const T=[k];for(;v;){for(;e.get(++s)[1]!==v;);i.push(s),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),y&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),y=v,v=v.next}for(v=n;++g<c.length;)c[g][0]==="exit"&&c[g-1][0]==="enter"&&c[g][1].type===c[g-1][1].type&&c[g][1].start.line!==c[g][1].end.line&&(k=g+1,T.push(k),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):T.pop(),g=T.length;g--;){const E=c.slice(T[g],T[g+1]),N=i.pop();f.push([N,N+E.length-1]),e.splice(N,2,E)}for(f.reverse(),g=-1;++g<f.length;)h[D+f[g][0]]=D+f[g][1],D+=f[g][1]-f[g][0]-1;return h}const p_={resolve:g_,tokenize:x_},y_={partial:!0,tokenize:b_};function g_(e){return Rv(e),e}function x_(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(c)}function s(c){return c===null?i(c):it(c)?e.check(y_,l,i)(c):(e.consume(c),s)}function i(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function b_(e,t,n){const r=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Ht(e,i,"linePrefix")}function i(l){if(l===null||it(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Pv(e,t,n,r,s,i,l,c,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||Y0(E)?n(E):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),k(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(c),e.enter("chunkString",{contentType:"string"}),v(E))}function v(E){return E===62?(e.exit("chunkString"),e.exit(c),g(E)):E===null||E===60||it(E)?n(E):(e.consume(E),E===92?D:v)}function D(E){return E===60||E===62||E===92?(e.consume(E),v):v(E)}function k(E){return!p&&(E===null||E===41||rr(E))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(E)):p<h&&E===40?(e.consume(E),p++,k):E===41?(e.consume(E),p--,k):E===null||E===32||E===40||Y0(E)?n(E):(e.consume(E),E===92?T:k)}function T(E){return E===40||E===41||E===92?(e.consume(E),k):k(E)}}function jv(e,t,n,r,s,i){const l=this;let c=0,f;return h;function h(v){return e.enter(r),e.enter(s),e.consume(v),e.exit(s),e.enter(i),p}function p(v){return c>999||v===null||v===91||v===93&&!f||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(i),e.enter(s),e.consume(v),e.exit(s),e.exit(r),t):it(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===null||v===91||v===93||it(v)||c++>999?(e.exit("chunkString"),p(v)):(e.consume(v),f||(f=!St(v)),v===92?g:y)}function g(v){return v===91||v===92||v===93?(e.consume(v),c++,y):y(v)}}function Fv(e,t,n,r,s,i){let l;return c;function c(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):it(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Ht(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===l||g===null||it(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 it(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):St(s)?Ht(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const v_={name:"definition",tokenize:T_},E_={partial:!0,tokenize:w_};function T_(e,t,n){const r=this;let s;return i;function i(v){return e.enter("definition"),l(v)}function l(v){return jv.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return s=ei(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),f):n(v)}function f(v){return rr(v)?Ul(e,h)(v):h(v)}function h(v){return Pv(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(E_,y,y)(v)}function y(v){return St(v)?Ht(e,g,"whitespace")(v):g(v)}function g(v){return v===null||it(v)?(e.exit("definition"),r.parser.defined.push(s),t(v)):n(v)}}function w_(e,t,n){return r;function r(c){return rr(c)?Ul(e,s)(c):n(c)}function s(c){return Fv(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function i(c){return St(c)?Ht(e,l,"whitespace")(c):l(c)}function l(c){return c===null||it(c)?t(c):n(c)}}const k_={name:"hardBreakEscape",tokenize:S_};function S_(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return it(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const C_={name:"headingAtx",resolve:N_,tokenize:__};function N_(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"},cs(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function __(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||rr(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||it(p)?(e.exit("atxHeading"),t(p)):St(p)?Ht(e,c,"whitespace")(p):(e.enter("atxHeadingText"),h(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),c(p))}function h(p){return p===null||p===35||rr(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),h)}}const D_=["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"],G1=["pre","script","style","textarea"],O_={concrete:!0,name:"htmlFlow",resolveTo:M_,tokenize:L_},A_={partial:!0,tokenize:P_},I_={partial:!0,tokenize:R_};function M_(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 L_(e,t,n){const r=this;let s,i,l,c,f;return h;function h(j){return p(j)}function p(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),y}function y(j){return j===33?(e.consume(j),g):j===47?(e.consume(j),i=!0,k):j===63?(e.consume(j),s=3,r.interrupt?t:M):ls(j)?(e.consume(j),l=String.fromCharCode(j),T):n(j)}function g(j){return j===45?(e.consume(j),s=2,v):j===91?(e.consume(j),s=5,c=0,D):ls(j)?(e.consume(j),s=4,r.interrupt?t:M):n(j)}function v(j){return j===45?(e.consume(j),r.interrupt?t:M):n(j)}function D(j){const se="CDATA[";return j===se.charCodeAt(c++)?(e.consume(j),c===se.length?r.interrupt?t:U:D):n(j)}function k(j){return ls(j)?(e.consume(j),l=String.fromCharCode(j),T):n(j)}function T(j){if(j===null||j===47||j===62||rr(j)){const se=j===47,ye=l.toLowerCase();return!se&&!i&&G1.includes(ye)?(s=1,r.interrupt?t(j):U(j)):D_.includes(l.toLowerCase())?(s=6,se?(e.consume(j),E):r.interrupt?t(j):U(j)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):i?N(j):O(j))}return j===45||hr(j)?(e.consume(j),l+=String.fromCharCode(j),T):n(j)}function E(j){return j===62?(e.consume(j),r.interrupt?t:U):n(j)}function N(j){return St(j)?(e.consume(j),N):F(j)}function O(j){return j===47?(e.consume(j),F):j===58||j===95||ls(j)?(e.consume(j),A):St(j)?(e.consume(j),O):F(j)}function A(j){return j===45||j===46||j===58||j===95||hr(j)?(e.consume(j),A):R(j)}function R(j){return j===61?(e.consume(j),S):St(j)?(e.consume(j),R):O(j)}function S(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),f=j,I):St(j)?(e.consume(j),S):_(j)}function I(j){return j===f?(e.consume(j),f=null,P):j===null||it(j)?n(j):(e.consume(j),I)}function _(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||rr(j)?R(j):(e.consume(j),_)}function P(j){return j===47||j===62||St(j)?O(j):n(j)}function F(j){return j===62?(e.consume(j),H):n(j)}function H(j){return j===null||it(j)?U(j):St(j)?(e.consume(j),H):n(j)}function U(j){return j===45&&s===2?(e.consume(j),ee):j===60&&s===1?(e.consume(j),he):j===62&&s===4?(e.consume(j),Q):j===63&&s===3?(e.consume(j),M):j===93&&s===5?(e.consume(j),ue):it(j)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(A_,le,Y)(j)):j===null||it(j)?(e.exit("htmlFlowData"),Y(j)):(e.consume(j),U)}function Y(j){return e.check(I_,q,le)(j)}function q(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),G}function G(j){return j===null||it(j)?Y(j):(e.enter("htmlFlowData"),U(j))}function ee(j){return j===45?(e.consume(j),M):U(j)}function he(j){return j===47?(e.consume(j),l="",te):U(j)}function te(j){if(j===62){const se=l.toLowerCase();return G1.includes(se)?(e.consume(j),Q):U(j)}return ls(j)&&l.length<8?(e.consume(j),l+=String.fromCharCode(j),te):U(j)}function ue(j){return j===93?(e.consume(j),M):U(j)}function M(j){return j===62?(e.consume(j),Q):j===45&&s===2?(e.consume(j),M):U(j)}function Q(j){return j===null||it(j)?(e.exit("htmlFlowData"),le(j)):(e.consume(j),Q)}function le(j){return e.exit("htmlFlow"),t(j)}}function R_(e,t,n){const r=this;return s;function s(l){return it(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 P_(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Sd,t,n)}}const j_={name:"htmlText",tokenize:F_};function F_(e,t,n){const r=this;let s,i,l;return c;function c(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),f}function f(M){return M===33?(e.consume(M),h):M===47?(e.consume(M),R):M===63?(e.consume(M),O):ls(M)?(e.consume(M),_):n(M)}function h(M){return M===45?(e.consume(M),p):M===91?(e.consume(M),i=0,D):ls(M)?(e.consume(M),N):n(M)}function p(M){return M===45?(e.consume(M),v):n(M)}function y(M){return M===null?n(M):M===45?(e.consume(M),g):it(M)?(l=y,he(M)):(e.consume(M),y)}function g(M){return M===45?(e.consume(M),v):y(M)}function v(M){return M===62?ee(M):M===45?g(M):y(M)}function D(M){const Q="CDATA[";return M===Q.charCodeAt(i++)?(e.consume(M),i===Q.length?k:D):n(M)}function k(M){return M===null?n(M):M===93?(e.consume(M),T):it(M)?(l=k,he(M)):(e.consume(M),k)}function T(M){return M===93?(e.consume(M),E):k(M)}function E(M){return M===62?ee(M):M===93?(e.consume(M),E):k(M)}function N(M){return M===null||M===62?ee(M):it(M)?(l=N,he(M)):(e.consume(M),N)}function O(M){return M===null?n(M):M===63?(e.consume(M),A):it(M)?(l=O,he(M)):(e.consume(M),O)}function A(M){return M===62?ee(M):O(M)}function R(M){return ls(M)?(e.consume(M),S):n(M)}function S(M){return M===45||hr(M)?(e.consume(M),S):I(M)}function I(M){return it(M)?(l=I,he(M)):St(M)?(e.consume(M),I):ee(M)}function _(M){return M===45||hr(M)?(e.consume(M),_):M===47||M===62||rr(M)?P(M):n(M)}function P(M){return M===47?(e.consume(M),ee):M===58||M===95||ls(M)?(e.consume(M),F):it(M)?(l=P,he(M)):St(M)?(e.consume(M),P):ee(M)}function F(M){return M===45||M===46||M===58||M===95||hr(M)?(e.consume(M),F):H(M)}function H(M){return M===61?(e.consume(M),U):it(M)?(l=H,he(M)):St(M)?(e.consume(M),H):P(M)}function U(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),s=M,Y):it(M)?(l=U,he(M)):St(M)?(e.consume(M),U):(e.consume(M),q)}function Y(M){return M===s?(e.consume(M),s=void 0,G):M===null?n(M):it(M)?(l=Y,he(M)):(e.consume(M),Y)}function q(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||rr(M)?P(M):(e.consume(M),q)}function G(M){return M===47||M===62||rr(M)?P(M):n(M)}function ee(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function he(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),te}function te(M){return St(M)?Ht(e,ue,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):ue(M)}function ue(M){return e.enter("htmlTextData"),l(M)}}const Bm={name:"labelEnd",resolveAll:z_,resolveTo:W_,tokenize:Y_},B_={tokenize:$_},H_={tokenize:q_},U_={tokenize:V_};function z_(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&&cs(e,0,e.length,n),e}function W_(e,t){let n=e.length,r=0,s,i,l,c;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 c=[["enter",f,t],["enter",h,t]],c=Nr(c,e.slice(i+1,i+r+3)),c=Nr(c,[["enter",p,t]]),c=Nr(c,Fm(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),c=Nr(c,[["exit",p,t],e[l-2],e[l-1],["exit",h,t]]),c=Nr(c,e.slice(l+1)),c=Nr(c,[["exit",f,t]]),cs(e,i,e.length,c),e}function Y_(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 c;function c(g){return i?i._inactive?y(g):(l=r.parser.defined.includes(ei(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(B_,p,l?p:y)(g):g===91?e.attempt(H_,p,l?h:y)(g):l?p(g):y(g)}function h(g){return e.attempt(U_,p,y)(g)}function p(g){return t(g)}function y(g){return i._balanced=!0,n(g)}}function $_(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 rr(y)?Ul(e,i)(y):i(y)}function i(y){return y===41?p(y):Pv(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function l(y){return rr(y)?Ul(e,f)(y):p(y)}function c(y){return n(y)}function f(y){return y===34||y===39||y===40?Fv(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):p(y)}function h(y){return rr(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 q_(e,t,n){const r=this;return s;function s(c){return jv.call(r,e,i,l,"reference","referenceMarker","referenceString")(c)}function i(c){return r.parser.defined.includes(ei(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function V_(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 Q_={name:"labelStartImage",resolveAll:Bm.resolveAll,tokenize:G_};function G_(e,t,n){const r=this;return s;function s(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),i}function i(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const K_={name:"labelStartLink",resolveAll:Bm.resolveAll,tokenize:X_};function X_(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 $h={name:"lineEnding",tokenize:J_};function J_(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ht(e,t,"linePrefix")}}const $c={name:"thematicBreak",tokenize:Z_};function Z_(e,t,n){let r=0,s;return i;function i(h){return e.enter("thematicBreak"),l(h)}function l(h){return s=h,c(h)}function c(h){return h===s?(e.enter("thematicBreakSequence"),f(h)):r>=3&&(h===null||it(h))?(e.exit("thematicBreak"),t(h)):n(h)}function f(h){return h===s?(e.consume(h),r++,f):(e.exit("thematicBreakSequence"),St(h)?Ht(e,c,"whitespace")(h):c(h))}}const er={continuation:{tokenize:r4},exit:o4,name:"list",tokenize:n4},e4={partial:!0,tokenize:a4},t4={partial:!0,tokenize:s4};function n4(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 c;function c(v){const D=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(D==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:$0(v)){if(r.containerState.type||(r.containerState.type=D,e.enter(D,{_container:!0})),D==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check($c,n,h)(v):h(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(v)}return n(v)}function f(v){return $0(v)&&++l<10?(e.consume(v),f):(!r.interrupt||l<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),h(v)):n(v)}function h(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(Sd,r.interrupt?n:p,e.attempt(e4,g,y))}function p(v){return r.containerState.initialBlankLine=!0,i++,g(v)}function y(v){return St(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),g):n(v)}function g(v){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function r4(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Sd,s,i);function s(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ht(e,t,"listItemIndent",r.containerState.size+1)(c)}function i(c){return r.containerState.furtherBlankLines||!St(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(t4,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ht(e,e.attempt(er,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function s4(e,t,n){const r=this;return Ht(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 o4(e){e.exit(this.containerState.type)}function a4(e,t,n){const r=this;return Ht(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!St(i)&&l&&l[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const K1={name:"setextUnderline",resolveTo:i4,tokenize:l4};function i4(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 l4(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"),c(h)}function c(h){return h===s?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),St(h)?Ht(e,f,"lineSuffix")(h):f(h))}function f(h){return h===null||it(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const u4={tokenize:c4};function c4(e){const t=this,n=e.attempt(Sd,r,e.attempt(this.parser.constructs.flowInitial,s,Ht(e,e.attempt(this.parser.constructs.flow,s,e.attempt(p_,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 d4={resolveAll:Hv()},f4=Bv("string"),h4=Bv("text");function Bv(e){return{resolveAll:Hv(e==="text"?m4:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,l,c);return l;function l(p){return h(p)?i(p):c(p)}function c(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 v=y[g];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function Hv(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 m4(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let i=s.length,l=-1,c=0,f;for(;i--;){const h=s[i];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(h===-2)f=!0,c++;else if(h!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const h={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?l:r.start._bufferIndex+l,_index:r.start._index+i,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const p4={42:er,43:er,45:er,48:er,49:er,50:er,51:er,52:er,53:er,54:er,55:er,56:er,57:er,62:Iv},y4={91:v_},g4={[-2]:Yh,[-1]:Yh,32:Yh},x4={35:C_,42:$c,45:[K1,$c],60:O_,61:K1,95:$c,96:Q1,126:Q1},b4={38:Lv,92:Mv},v4={[-5]:$h,[-4]:$h,[-3]:$h,33:Q_,38:Lv,42:q0,60:[K3,j_],91:K_,92:[k_,Mv],93:Bm,95:q0,96:u_},E4={null:[q0,d4]},T4={null:[42,95]},w4={null:[]},k4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:T4,contentInitial:y4,disable:w4,document:p4,flow:x4,flowInitial:g4,insideSpan:E4,string:b4,text:v4},Symbol.toStringTag,{value:"Module"}));function S4(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=[],c=[];const f={attempt:I(R),check:I(S),consume:N,enter:O,exit:A,interrupt:I(S,{interrupt:!0})},h={code:null,containerState:{},defineSkip:k,events:[],now:D,parser:e,previous:null,sliceSerialize:g,sliceStream:v,write:y};let p=t.tokenize.call(h,f);return t.resolveAll&&i.push(t),h;function y(H){return l=Nr(l,H),T(),l[l.length-1]!==null?[]:(_(t,0),h.events=Fm(i,h.events,h),h.events)}function g(H,U){return N4(v(H),U)}function v(H){return C4(l,H)}function D(){const{_bufferIndex:H,_index:U,line:Y,column:q,offset:G}=r;return{_bufferIndex:H,_index:U,line:Y,column:q,offset:G}}function k(H){s[H.line]=H.column,F()}function T(){let H;for(;r._index<l.length;){const U=l[r._index];if(typeof U=="string")for(H=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===H&&r._bufferIndex<U.length;)E(U.charCodeAt(r._bufferIndex));else E(U)}}function E(H){p=p(H)}function N(H){it(H)?(r.line++,r.column=1,r.offset+=H===-3?2:1,F()):H!==-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=H}function O(H,U){const Y=U||{};return Y.type=H,Y.start=D(),h.events.push(["enter",Y,h]),c.push(Y),Y}function A(H){const U=c.pop();return U.end=D(),h.events.push(["exit",U,h]),U}function R(H,U){_(H,U.from)}function S(H,U){U.restore()}function I(H,U){return Y;function Y(q,G,ee){let he,te,ue,M;return Array.isArray(q)?le(q):"tokenize"in q?le([q]):Q(q);function Q(xe){return Oe;function Oe(ae){const de=ae!==null&&xe[ae],_e=ae!==null&&xe.null,ke=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(_e)?_e:_e?[_e]:[]];return le(ke)(ae)}}function le(xe){return he=xe,te=0,xe.length===0?ee:j(xe[te])}function j(xe){return Oe;function Oe(ae){return M=P(),ue=xe,xe.partial||(h.currentConstruct=xe),xe.name&&h.parser.constructs.disable.null.includes(xe.name)?ye():xe.tokenize.call(U?Object.assign(Object.create(h),U):h,f,se,ye)(ae)}}function se(xe){return H(ue,M),G}function ye(xe){return M.restore(),++te<he.length?j(he[te]):ee}}}function _(H,U){H.resolveAll&&!i.includes(H)&&i.push(H),H.resolve&&cs(h.events,U,h.events.length-U,H.resolve(h.events.slice(U),h)),H.resolveTo&&(h.events=H.resolveTo(h.events,h))}function P(){const H=D(),U=h.previous,Y=h.currentConstruct,q=h.events.length,G=Array.from(c);return{from:q,restore:ee};function ee(){r=H,h.previous=U,h.currentConstruct=Y,h.events.length=q,c=G,F()}}function F(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function C4(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 c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}i>0&&l.push(e[s].slice(0,i))}return l}function N4(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 _4(e){const r={constructs:R3([k4,...(e||{}).extensions||[]]),content:s(W3),defined:[],document:s($3),flow:s(u4),lazy:{},string:s(f4),text:s(h4)};return r;function s(i){return l;function l(c){return S4(r,i,c)}}}function D4(e){for(;!Rv(e););return e}const X1=/[\0\t\n\r]/g;function O4(){let e=1,t="",n=!0,r;return s;function s(i,l,c){const f=[];let h,p,y,g,v;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(X1.lastIndex=y,h=X1.exec(i),g=h&&h.index!==void 0?h.index:i.length,v=i.charCodeAt(g),!h){t=i.slice(y);break}if(v===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),v){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 c&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const A4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function I4(e){return e.replace(A4,M4)}function M4(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return Av(n.slice(i?2:1),i?16:10)}return jm(n)||e}const Uv={}.hasOwnProperty;function L4(e,t,n){return typeof t!="string"&&(n=t,t=void 0),R4(n)(D4(_4(n).document().write(O4()(e,t,!0))))}function R4(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(J),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(Ke),blockQuote:i(_e),characterEscape:P,characterReference:P,codeFenced:i(ke),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(ke,l),codeText:i(Pe,l),codeTextData:P,data:P,codeFlowValue:P,definition:i(Ue),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(et),hardBreakEscape:i(ge),hardBreakTrailing:i(ge),htmlFlow:i(me,l),htmlFlowData:P,htmlText:i(me,l),htmlTextData:P,image:i(fe),label:l,link:i(J),listItem:i(be),listItemValue:g,listOrdered:i(Z,y),listUnordered:i(Z),paragraph:i(Ne),reference:j,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(Ke),strong:i($e),thematicBreak:i(ht)},exit:{atxHeading:f(),atxHeadingSequence:R,autolink:f(),autolinkEmail:de,autolinkProtocol:ae,blockQuote:f(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:ye,characterReferenceMarkerNumeric:ye,characterReferenceValue:xe,characterReference:Oe,codeFenced:f(T),codeFencedFence:k,codeFencedFenceInfo:v,codeFencedFenceMeta:D,codeFlowValue:F,codeIndented:f(E),codeText:f(G),codeTextData:F,data:F,definition:f(),definitionDestinationString:A,definitionLabelString:N,definitionTitleString:O,emphasis:f(),hardBreakEscape:f(U),hardBreakTrailing:f(U),htmlFlow:f(Y),htmlFlowData:F,htmlText:f(q),htmlTextData:F,image:f(he),label:ue,labelText:te,lineEnding:H,link:f(ee),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:se,resourceDestinationString:M,resourceTitleString:Q,resource:le,setextHeading:f(_),setextHeadingLineSequence:I,setextHeadingText:S,strong:f(),thematicBreak:f()}};zv(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ie){let ve={type:"root",children:[]};const Re={stack:[ve],tokenStack:[],config:t,enter:c,exit:h,buffer:l,resume:p,data:n},rt=[];let ot=-1;for(;++ot<ie.length;)if(ie[ot][1].type==="listOrdered"||ie[ot][1].type==="listUnordered")if(ie[ot][0]==="enter")rt.push(ot);else{const xt=rt.pop();ot=s(ie,xt,ot)}for(ot=-1;++ot<ie.length;){const xt=t[ie[ot][0]];Uv.call(xt,ie[ot][1].type)&&xt[ie[ot][1].type].call(Object.assign({sliceSerialize:ie[ot][2].sliceSerialize},Re),ie[ot][1])}if(Re.tokenStack.length>0){const xt=Re.tokenStack[Re.tokenStack.length-1];(xt[1]||J1).call(Re,void 0,xt[0])}for(ve.position={start:so(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:so(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},ot=-1;++ot<t.transforms.length;)ve=t.transforms[ot](ve)||ve;return ve}function s(ie,ve,Re){let rt=ve-1,ot=-1,xt=!1,Zt,hn,Dn,$n;for(;++rt<=Re;){const Wt=ie[rt];switch(Wt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Wt[0]==="enter"?ot++:ot--,$n=void 0;break}case"lineEndingBlank":{Wt[0]==="enter"&&(Zt&&!$n&&!ot&&!Dn&&(Dn=rt),$n=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$n=void 0}if(!ot&&Wt[0]==="enter"&&Wt[1].type==="listItemPrefix"||ot===-1&&Wt[0]==="exit"&&(Wt[1].type==="listUnordered"||Wt[1].type==="listOrdered")){if(Zt){let It=rt;for(hn=void 0;It--;){const yn=ie[It];if(yn[1].type==="lineEnding"||yn[1].type==="lineEndingBlank"){if(yn[0]==="exit")continue;hn&&(ie[hn][1].type="lineEndingBlank",xt=!0),yn[1].type="lineEnding",hn=It}else if(!(yn[1].type==="linePrefix"||yn[1].type==="blockQuotePrefix"||yn[1].type==="blockQuotePrefixWhitespace"||yn[1].type==="blockQuoteMarker"||yn[1].type==="listItemIndent"))break}Dn&&(!hn||Dn<hn)&&(Zt._spread=!0),Zt.end=Object.assign({},hn?ie[hn][1].start:Wt[1].end),ie.splice(hn||rt,0,["exit",Zt,Wt[2]]),rt++,Re++}if(Wt[1].type==="listItemPrefix"){const It={type:"listItem",_spread:!1,start:Object.assign({},Wt[1].start),end:void 0};Zt=It,ie.splice(rt,0,["enter",It,Wt[2]]),rt++,Re++,Dn=void 0,$n=!0}}}return ie[ve][1]._spread=xt,Re}function i(ie,ve){return Re;function Re(rt){c.call(this,ie(rt),rt),ve&&ve.call(this,rt)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(ie,ve,Re){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([ve,Re||void 0]),ie.position={start:so(ve.start),end:void 0}}function f(ie){return ve;function ve(Re){ie&&ie.call(this,Re),h.call(this,Re)}}function h(ie,ve){const Re=this.stack.pop(),rt=this.tokenStack.pop();if(rt)rt[0].type!==ie.type&&(ve?ve.call(this,ie,rt[0]):(rt[1]||J1).call(this,ie,rt[0]));else throw new Error("Cannot close `"+ie.type+"` ("+Hl({start:ie.start,end:ie.end})+"): it’s not open");Re.position.end=so(ie.end)}function p(){return M3(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function g(ie){if(this.data.expectingFirstListItemValue){const ve=this.stack[this.stack.length-2];ve.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.lang=ie}function D(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.meta=ie}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ie.replace(/(\r?\n|\r)$/g,"")}function N(ie){const ve=this.resume(),Re=this.stack[this.stack.length-1];Re.label=ve,Re.identifier=ei(this.sliceSerialize(ie)).toLowerCase()}function O(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ie}function A(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ie}function R(ie){const ve=this.stack[this.stack.length-1];if(!ve.depth){const Re=this.sliceSerialize(ie).length;ve.depth=Re}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function I(ie){const ve=this.stack[this.stack.length-1];ve.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function P(ie){const Re=this.stack[this.stack.length-1].children;let rt=Re[Re.length-1];(!rt||rt.type!=="text")&&(rt=ct(),rt.position={start:so(ie.start),end:void 0},Re.push(rt)),this.stack.push(rt)}function F(ie){const ve=this.stack.pop();ve.value+=this.sliceSerialize(ie),ve.position.end=so(ie.end)}function H(ie){const ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Re=ve.children[ve.children.length-1];Re.position.end=so(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ve.type)&&(P.call(this,ie),F.call(this,ie))}function U(){this.data.atHardBreak=!0}function Y(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ie}function q(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ie}function G(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ie}function ee(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ve,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function he(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ve,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function te(ie){const ve=this.sliceSerialize(ie),Re=this.stack[this.stack.length-2];Re.label=I4(ve),Re.identifier=ei(ve).toLowerCase()}function ue(){const ie=this.stack[this.stack.length-1],ve=this.resume(),Re=this.stack[this.stack.length-1];if(this.data.inReference=!0,Re.type==="link"){const rt=ie.children;Re.children=rt}else Re.alt=ve}function M(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ie}function Q(){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ie}function le(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function se(ie){const ve=this.resume(),Re=this.stack[this.stack.length-1];Re.label=ve,Re.identifier=ei(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function ye(ie){this.data.characterReferenceType=ie.type}function xe(ie){const ve=this.sliceSerialize(ie),Re=this.data.characterReferenceType;let rt;Re?(rt=Av(ve,Re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):rt=jm(ve);const ot=this.stack[this.stack.length-1];ot.value+=rt}function Oe(ie){const ve=this.stack.pop();ve.position.end=so(ie.end)}function ae(ie){F.call(this,ie);const ve=this.stack[this.stack.length-1];ve.url=this.sliceSerialize(ie)}function de(ie){F.call(this,ie);const ve=this.stack[this.stack.length-1];ve.url="mailto:"+this.sliceSerialize(ie)}function _e(){return{type:"blockquote",children:[]}}function ke(){return{type:"code",lang:null,meta:null,value:""}}function Pe(){return{type:"inlineCode",value:""}}function Ue(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function et(){return{type:"emphasis",children:[]}}function Ke(){return{type:"heading",depth:0,children:[]}}function ge(){return{type:"break"}}function me(){return{type:"html",value:""}}function fe(){return{type:"image",title:null,url:"",alt:null}}function J(){return{type:"link",title:null,url:"",children:[]}}function Z(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function be(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function Ne(){return{type:"paragraph",children:[]}}function $e(){return{type:"strong",children:[]}}function ct(){return{type:"text",value:""}}function ht(){return{type:"thematicBreak"}}}function so(e){return{line:e.line,column:e.column,offset:e.offset}}function zv(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?zv(e,r):P4(e,r)}}function P4(e,t){let n;for(n in t)if(Uv.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 J1(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 j4(e){const t=this;t.parser=n;function n(r){return L4(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function F4(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 B4(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
38
|
-
`}]}function H4(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 U4(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function z4(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function W4(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,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=i+1,c+=1,e.footnoteCounts.set(r,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(c>1?"-"+c:""),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 Y4(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $4(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Wv(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 q4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Wv(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 V4(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 Q4(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 G4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Wv(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 K4(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 X4(e,t,n){const r=e.all(t),s=n?J4(n):Yv(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 c=-1;for(;++c<r.length;){const p=r[c];(s||c!==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 J4(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=Yv(n[r])}return t}function Yv(e){const t=e.spread;return t??e.children.length>1}function Z4(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 eD(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tD(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function nD(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rD(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)},c=ds(t.children[1]),f=kd(t.children[t.children.length-1]);c&&f&&(l.position={start:c,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 sD(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,c=l?l.length:t.children.length;let f=-1;const h=[];for(;++f<c;){const y=t.children[f],g={},v=l?l[f]:void 0;v&&(g.align=v);let D={type:"element",tagName:i,properties:g,children:[]};y&&(D.children=e.all(y),e.patch(y,D),D=e.applyData(y,D)),h.push(D)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,p),e.applyData(t,p)}function oD(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Z1=9,ex=32;function aD(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(tx(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(tx(t.slice(s),s>0,!1)),i.join("")}function tx(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===Z1||i===ex;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===Z1||i===ex;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function iD(e,t){const n={type:"text",value:aD(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function lD(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const uD={blockquote:F4,break:B4,code:H4,delete:U4,emphasis:z4,footnoteReference:W4,heading:Y4,html:$4,imageReference:q4,image:V4,inlineCode:Q4,linkReference:G4,link:K4,listItem:X4,list:Z4,paragraph:eD,root:tD,strong:nD,table:rD,tableCell:oD,tableRow:sD,text:iD,thematicBreak:lD,toml:Ac,yaml:Ac,definition:Ac,footnoteDefinition:Ac};function Ac(){}const $v=-1,Cd=0,zl=1,Zc=2,Hm=3,Um=4,zm=5,Wm=6,qv=7,Vv=8,nx=typeof self=="object"?self:globalThis,cD=(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 Cd:case $v:return n(l,s);case zl:{const c=n([],s);for(const f of l)c.push(r(f));return c}case Zc:{const c=n({},s);for(const[f,h]of l)c[r(f)]=r(h);return c}case Hm:return n(new Date(l),s);case Um:{const{source:c,flags:f}=l;return n(new RegExp(c,f),s)}case zm:{const c=n(new Map,s);for(const[f,h]of l)c.set(r(f),r(h));return c}case Wm:{const c=n(new Set,s);for(const f of l)c.add(r(f));return c}case qv:{const{name:c,message:f}=l;return n(new nx[c](f),s)}case Vv: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:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(new nx[i](l),s)};return r},rx=e=>cD(new Map,e)(0),Va="",{toString:dD}={},{keys:fD}=Object,wl=e=>{const t=typeof e;if(t!=="object"||!e)return[Cd,t];const n=dD.call(e).slice(8,-1);switch(n){case"Array":return[zl,Va];case"Object":return[Zc,Va];case"Date":return[Hm,Va];case"RegExp":return[Um,Va];case"Map":return[zm,Va];case"Set":return[Wm,Va];case"DataView":return[zl,n]}return n.includes("Array")?[zl,n]:n.includes("Error")?[qv,n]:[Zc,n]},Ic=([e,t])=>e===Cd&&(t==="function"||t==="symbol"),hD=(e,t,n,r)=>{const s=(l,c)=>{const f=r.push(l)-1;return n.set(c,f),f},i=l=>{if(n.has(l))return n.get(l);let[c,f]=wl(l);switch(c){case Cd:{let p=l;switch(f){case"bigint":c=Vv,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);p=null;break;case"undefined":return s([$v],l)}return s([c,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([c,p],l);for(const g of l)p.push(i(g));return y}case Zc:{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([c,p],l);for(const g of fD(l))(e||!Ic(wl(l[g])))&&p.push([i(g),i(l[g])]);return y}case Hm:return s([c,l.toISOString()],l);case Um:{const{source:p,flags:y}=l;return s([c,{source:p,flags:y}],l)}case zm:{const p=[],y=s([c,p],l);for(const[g,v]of l)(e||!(Ic(wl(g))||Ic(wl(v))))&&p.push([i(g),i(v)]);return y}case Wm:{const p=[],y=s([c,p],l);for(const g of l)(e||!Ic(wl(g)))&&p.push(i(g));return y}}const{message:h}=l;return s([c,{name:f,message:h}],l)};return i},sx=(e,{json:t,lossy:n}={})=>{const r=[];return hD(!(t||n),!!t,new Map,r)(e),r},xi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?rx(sx(e,t)):structuredClone(e):(e,t)=>rx(sx(e,t));function mD(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 pD(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function yD(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||mD,r=e.options.footnoteBackLabel||pD,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];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 v=0;const D=[],k=e.footnoteCounts.get(y);for(;k!==void 0&&++v<=k;){D.length>0&&D.push({type:"text",value:" "});let N=typeof n=="string"?n:n(f,v);typeof N=="string"&&(N={type:"text",value:N}),D.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,v),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const T=p[p.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const N=T.children[T.children.length-1];N&&N.type==="text"?N.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...D)}else p.push(...D);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(p,!0)};e.patch(h,E),c.push(E)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...xi(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
42
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
43
|
-
`}]}}const Qv=(function(e){if(e==null)return vD;if(typeof e=="function")return Nd(e);if(typeof e=="object")return Array.isArray(e)?gD(e):xD(e);if(typeof e=="string")return bD(e);throw new Error("Expected function, string, or object as test")});function gD(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Qv(e[n]);return Nd(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function xD(e){const t=e;return Nd(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function bD(e){return Nd(t);function t(n){return n&&n.type===e}}function Nd(e){return t;function t(n,r,s){return!!(ED(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function vD(){return!0}function ED(e){return e!==null&&typeof e=="object"&&"type"in e}const Gv=[],TD=!0,ox=!1,wD="skip";function kD(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=Qv(s),l=r?-1:1;c(e,void 0,[])();function c(f,h,p){const y=f&&typeof f=="object"?f:{};if(typeof y.type=="string"){const v=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(f.type+(v?"<"+v+">":""))+")"})}return g;function g(){let v=Gv,D,k,T;if((!t||i(f,h,p[p.length-1]||void 0))&&(v=SD(n(f,p)),v[0]===ox))return v;if("children"in f&&f.children){const E=f;if(E.children&&v[0]!==wD)for(k=(r?E.children.length:-1)+l,T=p.concat(E);k>-1&&k<E.children.length;){const N=E.children[k];if(D=c(N,k,T)(),D[0]===ox)return D;k=typeof D[1]=="number"?D[1]:k+l}}return v}}}function SD(e){return Array.isArray(e)?e:typeof e=="number"?[TD,e]:e==null?Gv:[e]}function Ym(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),kD(e,i,c,s);function c(f,h){const p=h[h.length-1],y=p?p.children.indexOf(f):void 0;return l(f,y,p)}}const V0={}.hasOwnProperty,CD={};function ND(e,t){const n=t||CD,r=new Map,s=new Map,i=new Map,l={...uD,...n.handlers},c={all:h,applyData:DD,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:l,one:f,options:n,patch:_D,wrap:AD};return Ym(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)}}),c;function f(p,y){const g=p.type,v=c.handlers[g];if(V0.call(c.handlers,g)&&v)return v(c,p,y);if(c.options.passThrough&&c.options.passThrough.includes(g)){if("children"in p){const{children:k,...T}=p,E=xi(T);return E.children=c.all(p),E}return xi(p)}return(c.options.unknownHandler||OD)(c,p,y)}function h(p){const y=[];if("children"in p){const g=p.children;let v=-1;for(;++v<g.length;){const D=c.one(g[v],p);if(D){if(v&&g[v-1].type==="break"&&(!Array.isArray(D)&&D.type==="text"&&(D.value=ax(D.value)),!Array.isArray(D)&&D.type==="element")){const k=D.children[0];k&&k.type==="text"&&(k.value=ax(k.value))}Array.isArray(D)?y.push(...D):y.push(D)}}}return y}}function _D(e,t){e.position&&(t.position=d3(e))}function DD(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,xi(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function OD(e,t){const n=t.data||{},r="value"in t&&!(V0.call(n,"hProperties")||V0.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 AD(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 ax(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ix(e,t){const n=ND(e,t),r=n.one(e,void 0),s=yD(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 ID(e,t){return e&&"run"in e?async function(n,r){const s=ix(n,{file:r,...t});await e.run(s,r)}:function(n,r){return ix(n,{file:r,...e||t})}}function lx(e){if(e)throw e}var qh,ux;function MD(){if(ux)return qh;ux=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},c=function(h,p){if(p==="__proto__")if(e.call(h,p)){if(r)return r(h,p).value}else return;return h[p]};return qh=function f(){var h,p,y,g,v,D,k=arguments[0],T=1,E=arguments.length,N=!1;for(typeof k=="boolean"&&(N=k,k=arguments[1]||{},T=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});T<E;++T)if(h=arguments[T],h!=null)for(p in h)y=c(k,p),g=c(h,p),k!==g&&(N&&g&&(i(g)||(v=s(g)))?(v?(v=!1,D=y&&s(y)?y:[]):D=y&&i(y)?y:{},l(k,{name:p,newValue:f(N,D,g)})):typeof g<"u"&&l(k,{name:p,newValue:g}));return k},qh}var LD=MD();const Vh=_b(LD);function Q0(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 RD(){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);c(null,...s);function c(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?PD(p,c)(...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 PD(e,t){let n;return r;function r(...l){const c=e.length>l.length;let f;c&&l.push(s);try{f=e.apply(this,l)}catch(h){const p=h;if(c&&n)throw p;return s(p)}c||(f&&f.then&&typeof f.then=="function"?f.then(i,s):f instanceof Error?s(f):i(f))}function s(l,...c){n||(n=!0,t(l,...c))}function i(l){s(null,l)}}const es={basename:jD,dirname:FD,extname:BD,join:HD,sep:"/"};function jD(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,c=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else l<0&&(i=!0,l=s+1),c>-1&&(e.codePointAt(s)===t.codePointAt(c--)?c<0&&(r=s):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function FD(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 BD(e){hu(e);let t=e.length,n=-1,r=0,s=-1,i=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?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 HD(...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?".":UD(n)}function UD(e){hu(e);const t=e.codePointAt(0)===47;let n=zD(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function zD(e,t){let n="",r=0,s=-1,i=0,l=-1,c,f;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===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 c===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 WD={cwd:YD};function YD(){return"/"}function G0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $D(e){if(typeof e=="string")e=new URL(e);else if(!G0(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 qD(e)}function qD(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 Qh=["history","path","basename","stem","extname","dirname"];class Kv{constructor(t){let n;t?G0(t)?n={path:t}:typeof t=="string"||VD(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":WD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Qh.length;){const i=Qh[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)Qh.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?es.basename(this.path):void 0}set basename(t){Kh(t,"basename"),Gh(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){cx(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(Gh(t,"extname"),cx(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){G0(t)&&(t=$D(t)),Kh(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){Kh(t,"stem"),Gh(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 Fn(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 Gh(e,t){if(e&&e.includes(es.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+es.sep+"`")}function Kh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function cx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function VD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const QD=(function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),GD={}.hasOwnProperty;class $m extends QD{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=RD()}copy(){const t=new $m;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Vh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Zh("data",this.frozen),this.namespace[t]=n,this):GD.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Zh("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 Xh("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Xh("process",this.parser||this.Parser),Jh("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,l){const c=Mc(t),f=r.parse(c);r.run(f,c,function(p,y,g){if(p||!y||!g)return h(p);const v=y,D=r.stringify(v,g);JD(D)?g.value=D:g.result=D,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(),Xh("processSync",this.parser||this.Parser),Jh("processSync",this.compiler||this.Compiler),this.process(t,s),fx("processSync","process",n),r;function s(i,l){n=!0,lx(i),r=l}}run(t,n,r){dx(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,c){const f=Mc(n);s.run(t,f,h);function h(p,y,g){const v=y||t;p?c(p):l?l(v):r(void 0,v,g)}}}runSync(t,n){let r=!1,s;return this.run(t,n,i),fx("runSync","run",r),s;function i(l,c){lx(l),s=c,r=!0}}stringify(t,n){this.freeze();const r=Mc(n),s=this.compiler||this.Compiler;return Jh("stringify",s),dx(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Zh("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function 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");c(h.plugins),h.settings&&(s.settings=Vh(!0,s.settings,h.settings))}function c(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[v,...D]=p;const k=r[g][1];Q0(k)&&Q0(v)&&(v=Vh(!0,k,v)),r[g]=[h,v,...D]}}}}const KD=new $m().freeze();function Xh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Jh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Zh(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 dx(e){if(!Q0(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function fx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Mc(e){return XD(e)?e:new Kv(e)}function XD(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function JD(e){return typeof e=="string"||ZD(e)}function ZD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eO="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",hx=[],mx={allowDangerousHtml:!0},tO=/^(https?|ircs?|mailto|xmpp)$/i,nO=[{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 Xv(e){const t=rO(e),n=sO(e);return oO(t.runSync(t.parse(n),n),e)}function rO(e){const t=e.rehypePlugins||hx,n=e.remarkPlugins||hx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...mx}:mx;return KD().use(j4).use(n).use(ID,r).use(t)}function sO(e){const t=e.children||"",n=new Kv;return typeof t=="string"&&(n.value=t),n}function oO(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||aO;for(const p of nO)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+eO+p.id,void 0);return Ym(e,h),y3(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 v;for(v in Wh)if(Object.hasOwn(Wh,v)&&Object.hasOwn(p.properties,v)){const D=p.properties[v],k=Wh[v];(k===null||k.includes(p.tagName))&&(p.properties[v]=f(String(D||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):i?i.includes(p.tagName):!1;if(!v&&r&&typeof y=="number"&&(v=!r(p,y,g)),v&&g&&typeof y=="number")return c&&p.children?g.children.splice(y,1,...p.children):g.children.splice(y,1),y}}}function aO(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||tO.test(e.slice(0,t))?e:""}function iO(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,r])=>`${n}: ${typeof r=="string"?r:JSON.stringify(r)}`).join(", ")}function lO(e,t=500){return e.length<=t?e:e.slice(0,t)+"…"}function Jv({tc:e}){const[t,n]=C.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:["(",iO(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:lO(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(Jv,{tc:s},s.id))})]})}function uO({toolCalls:e}){const[t,n]=C.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(Jv,{tc:l},l.id))})})]})}function cO({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 Dr=C.forwardRef(function({option:t,height:n=400,loading:r=!1,onEvents:s},i){const l=C.useRef(null),c=C.useRef(null);return C.useImperativeHandle(i,()=>({getDataURL:f=>{var p;const h=(p=l.current)==null?void 0:p.getEchartsInstance();if(h)try{return h.getDataURL({type:f==="png"?"png":"svg",pixelRatio:2,backgroundColor:"#fff"})}catch{return h.getDataURL({type:"svg",pixelRatio:2,backgroundColor:"#fff"})}},getInstance:()=>{var f;return(f=l.current)==null?void 0:f.getEchartsInstance()}})),C.useEffect(()=>{const f=c.current;if(!f)return;let h;const p=new ResizeObserver(()=>{clearTimeout(h),h=setTimeout(()=>{var y,g;(g=(y=l.current)==null?void 0:y.getEchartsInstance())==null||g.resize()},150)});return p.observe(f),()=>{clearTimeout(h),p.disconnect()}},[]),d.jsx("div",{ref:c,style:{height:n,width:"100%"},children:d.jsx(tk,{ref:l,option:t,notMerge:!0,style:{height:"100%",width:"100%"},showLoading:r,onEvents:s,opts:{renderer:"canvas"}})})}),qm=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#06B6D4","#F97316","#84CC16","#14B8A6"];function bi(e,t,n){if(t)return t;const r=(n==null?void 0:n.palette)??qm;return r[e%r.length]}function dO(e,t,n,r){return n!=null&&n[e]?n[e]:bi(t,void 0,r)}function fO(e,t){const{type:n,data:r,x:s,y:i,title:l,series:c}=e,f=Array.isArray(i)?i:[i],h=f[0]??"value",p={color:qm,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 k=r.map(T=>({name:String(T[s]??""),value:Number(T[h]??0)}));return{...p,series:[{type:"pie",radius:["40%","70%"],data:k,label:{color:t.textColor,fontSize:11}}]}}const y=c?[...new Set(r.map(k=>String(k[s]??"")))]:r.map(k=>String(k[s]??"")),g={type:"category",data:y,axisLabel:{color:t.textColor,fontSize:10},axisLine:{lineStyle:{color:t.splitLineColor}}},v={type:"value",axisLabel:{color:t.textColor,fontSize:10},splitLine:{lineStyle:{color:t.splitLineColor}}};let D;if(c){const k=new Map;for(const T of r){const E=String(T[c]??""),N=String(T[s]??"");k.has(E)||k.set(E,new Map),k.get(E).set(N,Number(T[h]??0))}D=[...k.entries()].map(([T,E])=>({name:T,type:n,smooth:n==="line",data:y.map(N=>E.get(N)??0)}))}else D=f.map(k=>({name:k,type:n,smooth:n==="line",data:r.map(T=>Number(T[k]??0))}));return{...p,xAxis:g,yAxis:v,legend:c||f.length>1?{show:!0,bottom:0,textStyle:{color:t.textColor,fontSize:10}}:void 0,series:D}}function hO({config:e}){const t=$r(),n=C.useMemo(()=>fO(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(Dr,{option:n,height:200})})}const e0=10;function mO(e){if(!e)return!1;const t=e.toLowerCase();return["number","int","integer","float","double","decimal","bigint","numeric"].some(n=>t.includes(n))}function pO(e){return typeof e=="number"}function yO(e){return e==null?"—":typeof e=="number"?Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:4}):String(e)}function gO({columns:e,rows:t}){const n=t.slice(0,e0),r=t.length>e0,s=new Set(e.filter(i=>{if(mO(i.type))return!0;const l=t.find(c=>c[i.name]!==null&&c[i.name]!==void 0);return l?pO(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(c=>{const f=s.has(c.name),h=i[c.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:yO(h)},c.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 ",e0," of ",t.length," rows"]})]})}const xO={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(hO,{config:s})}catch{}if(t==="language-data")try{const s=JSON.parse(r);return d.jsx(gO,{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 bO({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(uO,{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(Xv,{components:xO,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(cO,{suggestions:e.suggestions,onSend:n})]})})}function vO({onSend:e,placeholder:t,disabled:n,initialValue:r}){const[s,i]=C.useState(r??"");C.useEffect(()=>{r&&i(r)},[r]);const l=C.useRef(null),c=C.useCallback(()=>{const h=s.trim();!h||n||(e(h),i(""),l.current&&(l.current.style.height="auto"))},[s,n,e]),f=C.useCallback(h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),c())},[c]);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:c,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 EO({overlay:e}){const{messages:t,panelOpen:n,panelWidth:r,isStreaming:s,context:i,activeAgent:l,prefillMessage:c,closePanel:f,clearConversation:h,setPanelWidth:p}=Ls(),{sendMessage:y}=$N(),g=C.useRef(null),v=C.useRef(null);C.useEffect(()=>{var T;(T=g.current)==null||T.scrollIntoView({behavior:"smooth"})},[t]);const D=C.useCallback(T=>{T.preventDefault(),v.current={startX:T.clientX,startWidth:r};const E=O=>{if(!v.current)return;const A=v.current.startX-O.clientX,R=Math.max(300,Math.min(window.innerWidth*.5,v.current.startWidth+A));p(R)},N=()=>{v.current=null,document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",N)};document.addEventListener("mousemove",E),document.addEventListener("mouseup",N)},[r,p]);if(!n)return null;const k=(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:D,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(bO,{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(vO,{onSend:T=>{y(T),c&&Ls.setState({prefillMessage:null})},placeholder:k,disabled:s,initialValue:c??void 0})})]})]})}const px="yamchart-sidebar-hidden";function TO({children:e,currentPath:t,onNavigate:n,onNavigateToUsers:r,onNavigateToShares:s}){const{data:i}=ya(),{data:l}=cv(),c=Im(),f=xm(),h=Ls(R=>R.panelOpen),p=(i==null?void 0:i.charts)||[],y=l||[],[g,v]=C.useState(()=>c.sidebarShow?localStorage.getItem(px)==="true":!0),[D,k]=C.useState(!1),[T,E]=C.useState(!1);C.useEffect(()=>{const R=S=>{(S.metaKey||S.ctrlKey)&&S.key==="k"&&(S.preventDefault(),E(!0))};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[]);const N=!g&&f!=="sm",O=f==="md"&&!g,A=C.useCallback(()=>{if(f==="sm"){k(R=>!R);return}v(R=>{const S=!R;return localStorage.setItem(px,String(S)),S})},[f]);return d.jsxs("div",{className:"flex h-screen",style:{backgroundColor:"var(--yc-color-background)"},children:[N&&d.jsx(N1,{dashboards:y,charts:p,currentPath:t,onNavigate:n,collapsed:O}),f==="sm"&&D&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 transition-opacity",onClick:()=>k(!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(N1,{dashboards:y,charts:p,currentPath:t,onNavigate:R=>{n(R),k(!1)}})})]}),d.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[d.jsx(UN,{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(EO,{overlay:f==="md"})]})]}),d.jsx(YN,{isOpen:T,onClose:()=>E(!1),onNavigate:R=>{n(R),E(!1)},dashboards:y,charts:p})]})}function wO(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 t0={},jl={};function Vo(e,t){try{const r=(t0[e]||(t0[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in jl?jl[r]:yx(r,r.split(":"))}catch{if(e in jl)return jl[e];const n=e==null?void 0:e.match(kO);return n?yx(e,n.slice(1)):NaN}}const kO=/([+-]\d\d):?(\d\d)?/;function yx(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)),Zv(this),K0(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),K0(this),+this}[Symbol.for("constructDateFrom")](t){return new us(+new Date(t),this.timeZone)}}const gx=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!gx.test(e))return;const t=e.replace(gx,"$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),SO(this),+this},us.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),K0(this),+this}))});function K0(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Vo(e.timeZone,e)*60))}function SO(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()),Zv(e)}function Zv(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,c=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();l&&c&&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),v=g>0?Math.floor(g):Math.ceil(g),k=-new Date(+e).getTimezoneOffset()-v,T=v!==n,E=k-f;if(T&&E){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+E);const N=Vo(e.timeZone,e),O=N>0?Math.floor(N):Math.ceil(N),A=v-O;A&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+A),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+A))}}class jn extends us{static tz(t,...n){return n.length?new jn(...n,t):new jn(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} (${wO(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 jn(+this,t)}[Symbol.for("constructDateFrom")](t){return new jn(+new Date(t),this.timeZone)}}const xx=5,CO=4;function NO(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,s=t.addDays(e,-r+1),i=t.addDays(s,xx*7-1);return t.getMonth(e)===t.getMonth(i)?xx:CO}function e2(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 _O(e,t){const n=e2(e,t),r=NO(e,t);return t.addDays(n,r*7-1)}const t2={...$o,labels:{labelDayButton:(e,t,n,r)=>{let s;r&&typeof r.format=="function"?s=r.format.bind(r):s=(l,c)=>on(l,c,{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)=>on(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,c)=>on(l,c,{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)=>on(s,i,{locale:$o,...t}),r(e,"cccc")}}};class mr{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?jn.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 jn(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):Ms(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):pd(r,s)},this.addYears=(r,s)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(r,s):yd(r,s)},this.differenceInCalendarDays=(r,s)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,s):wm(r,s)},this.differenceInCalendarMonths=(r,s)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,s):Xb(r,s)},this.eachMonthOfInterval=r=>{var s;return(s=this.overrides)!=null&&s.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):tS(r)},this.eachYearOfInterval=r=>{var c;const s=(c=this.overrides)!=null&&c.eachYearOfInterval?this.overrides.eachYearOfInterval(r):nS(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):_O(r,this)},this.endOfISOWeek=r=>{var s;return(s=this.overrides)!=null&&s.endOfISOWeek?this.overrides.endOfISOWeek(r):rS(r)},this.endOfMonth=r=>{var s;return(s=this.overrides)!=null&&s.endOfMonth?this.overrides.endOfMonth(r):gd(r)},this.endOfWeek=(r,s)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(r,s):bd(r,this.options)},this.endOfYear=r=>{var s;return(s=this.overrides)!=null&&s.endOfYear?this.overrides.endOfYear(r):xd(r)},this.format=(r,s,i)=>{var c;const l=(c=this.overrides)!=null&&c.format?this.overrides.format(r,s,this.options):on(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):vd(r)},this.getMonth=(r,s)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(r,this.options):JS(r,this.options)},this.getYear=(r,s)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(r,this.options):ZS(r,this.options)},this.getWeek=(r,s)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(r,this.options):Ed(r,this.options)},this.isAfter=(r,s)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(r,s):eC(r,s)},this.isBefore=(r,s)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(r,s):tC(r,s)},this.isDate=r=>{var s;return(s=this.overrides)!=null&&s.isDate?this.overrides.isDate(r):Kb(r)},this.isSameDay=(r,s)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(r,s):Jk(r,s)},this.isSameMonth=(r,s)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(r,s):XC(r,s)},this.isSameYear=(r,s)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(r,s):JC(r,s)},this.max=r=>{var s;return(s=this.overrides)!=null&&s.max?this.overrides.max(r):Kk(r)},this.min=r=>{var s;return(s=this.overrides)!=null&&s.min?this.overrides.min(r):Xk(r)},this.setMonth=(r,s)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(r,s):mN(r,s)},this.setYear=(r,s)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(r,s):pN(r,s)},this.startOfBroadcastWeek=(r,s)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):e2(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):Yr(r,this.options)},this.startOfYear=r=>{var s;return(s=this.overrides)!=null&&s.startOfYear?this.overrides.startOfYear(r):yi(r)},this.options={locale:t2,...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&&mr.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&&mr.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)}}mr.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 fs=new mr;class n2{constructor(t,n,r=fs){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 DO{constructor(t,n){this.date=t,this.weeks=n}}class OO{constructor(t,n){this.days=n,this.weekNumber=t}}function AO(e){return Le.createElement("button",{...e})}function IO(e){return Le.createElement("span",{...e})}function MO(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 LO(e){const{day:t,modifiers:n,...r}=e;return Le.createElement("td",{...r})}function RO(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 Ge;(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"})(Ge||(Ge={}));var Kt;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Kt||(Kt={}));var zr;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(zr||(zr={}));var fr;(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"})(fr||(fr={}));function PO(e){const{options:t,className:n,components:r,classNames:s,...i}=e,l=[s[Ge.Dropdown],n].join(" "),c=t==null?void 0:t.find(({value:f})=>f===i.value);return Le.createElement("span",{"data-disabled":i.disabled,className:s[Ge.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[Ge.CaptionLabel],"aria-hidden":!0},c==null?void 0:c.label,Le.createElement(r.Chevron,{orientation:"down",size:18,className:s[Ge.Chevron]})))}function jO(e){return Le.createElement("div",{...e})}function FO(e){return Le.createElement("div",{...e})}function BO(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Le.createElement("div",{...r},e.children)}function HO(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Le.createElement("div",{...r})}function UO(e){return Le.createElement("table",{...e})}function zO(e){return Le.createElement("div",{...e})}const r2=C.createContext(void 0);function mu(){const e=C.useContext(r2);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function WO(e){const{components:t}=mu();return Le.createElement(t.Dropdown,{...e})}function YO(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:s,...i}=e,{components:l,classNames:c,labels:{labelPrevious:f,labelNext:h}}=mu(),p=C.useCallback(g=>{s&&(n==null||n(g))},[s,n]),y=C.useCallback(g=>{r&&(t==null||t(g))},[r,t]);return Le.createElement("nav",{...i},Le.createElement(l.PreviousMonthButton,{type:"button",className:c[Ge.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:c[Ge.Chevron],orientation:"left"})),Le.createElement(l.NextMonthButton,{type:"button",className:c[Ge.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:c[Ge.Chevron]})))}function $O(e){const{components:t}=mu();return Le.createElement(t.Button,{...e})}function qO(e){return Le.createElement("option",{...e})}function VO(e){const{components:t}=mu();return Le.createElement(t.Button,{...e})}function QO(e){const{rootRef:t,...n}=e;return Le.createElement("div",{...n,ref:t})}function GO(e){return Le.createElement("select",{...e})}function KO(e){const{week:t,...n}=e;return Le.createElement("tr",{...n})}function XO(e){return Le.createElement("th",{...e})}function JO(e){return Le.createElement("thead",{"aria-hidden":!0},Le.createElement("tr",{...e}))}function ZO(e){const{week:t,...n}=e;return Le.createElement("th",{...n})}function e5(e){return Le.createElement("th",{...e})}function t5(e){return Le.createElement("tbody",{...e})}function n5(e){const{components:t}=mu();return Le.createElement(t.Dropdown,{...e})}const r5=Object.freeze(Object.defineProperty({__proto__:null,Button:AO,CaptionLabel:IO,Chevron:MO,Day:LO,DayButton:RO,Dropdown:PO,DropdownNav:jO,Footer:FO,Month:BO,MonthCaption:HO,MonthGrid:UO,Months:zO,MonthsDropdown:WO,Nav:YO,NextMonthButton:$O,Option:qO,PreviousMonthButton:VO,Root:QO,Select:GO,Week:KO,WeekNumber:ZO,WeekNumberHeader:e5,Weekday:XO,Weekdays:JO,Weeks:t5,YearsDropdown:n5},Symbol.toStringTag,{value:"Module"}));function Os(e,t,n=!1,r=fs){let{from:s,to:i}=e;const{differenceInCalendarDays:l,isSameDay:c}=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?c(i,t):!n&&s?c(s,t):!1}function Vm(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function _d(e){return!!(e&&typeof e=="object"&&"from"in e)}function Qm(e){return!!(e&&typeof e=="object"&&"after"in e)}function Gm(e){return!!(e&&typeof e=="object"&&"before"in e)}function s2(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function o2(e,t){return Array.isArray(e)&&e.every(t.isDate)}function As(e,t,n=fs){const r=Array.isArray(t)?t:[t],{isSameDay:s,differenceInCalendarDays:i,isAfter:l}=n;return r.some(c=>{if(typeof c=="boolean")return c;if(n.isDate(c))return s(e,c);if(o2(c,n))return c.some(f=>s(e,f));if(_d(c))return Os(c,e,!1,n);if(s2(c))return Array.isArray(c.dayOfWeek)?c.dayOfWeek.includes(e.getDay()):c.dayOfWeek===e.getDay();if(Vm(c)){const f=i(c.before,e),h=i(c.after,e),p=f>0,y=h<0;return l(c.before,c.after)?y&&p:p||y}return Qm(c)?i(e,c.after)>0:Gm(c)?i(c.before,e)>0:typeof c=="function"?c(e):!1})}function s5(e,t,n,r,s){const{disabled:i,hidden:l,modifiers:c,showOutsideDays:f,broadcastCalendar:h,today:p=s.today()}=t,{isSameDay:y,isSameMonth:g,startOfMonth:v,isBefore:D,endOfMonth:k,isAfter:T}=s,E=n&&v(n),N=r&&k(r),O={[Kt.focused]:[],[Kt.outside]:[],[Kt.disabled]:[],[Kt.hidden]:[],[Kt.today]:[]},A={};for(const R of e){const{date:S,displayMonth:I}=R,_=!!(I&&!g(S,I)),P=!!(E&&D(S,E)),F=!!(N&&T(S,N)),H=!!(i&&As(S,i,s)),U=!!(l&&As(S,l,s))||P||F||!h&&!f&&_||h&&f===!1&&_,Y=y(S,p);_&&O.outside.push(R),H&&O.disabled.push(R),U&&O.hidden.push(R),Y&&O.today.push(R),c&&Object.keys(c).forEach(q=>{const G=c==null?void 0:c[q];G&&As(S,G,s)&&(A[q]?A[q].push(R):A[q]=[R])})}return R=>{const S={[Kt.focused]:!1,[Kt.disabled]:!1,[Kt.hidden]:!1,[Kt.outside]:!1,[Kt.today]:!1},I={};for(const _ in O){const P=O[_];S[_]=P.some(F=>F===R)}for(const _ in A)I[_]=A[_].some(P=>P===R);return{...S,...I}}}function o5(e,t,n={}){return Object.entries(e).filter(([,s])=>s===!0).reduce((s,[i])=>(n[i]?s.push(n[i]):t[Kt[i]]?s.push(t[Kt[i]]):t[zr[i]]&&s.push(t[zr[i]]),s),[t[Ge.Day]])}function a5(e){return{...r5,...e}}function i5(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 l5(){const e={};for(const t in Ge)e[Ge[t]]=`rdp-${Ge[t]}`;for(const t in Kt)e[Kt[t]]=`rdp-${Kt[t]}`;for(const t in zr)e[zr[t]]=`rdp-${zr[t]}`;for(const t in fr)e[fr[t]]=`rdp-${fr[t]}`;return e}function a2(e,t,n){return(n??new mr(t)).formatMonthYear(e)}const u5=a2;function c5(e,t,n){return(n??new mr(t)).format(e,"d")}function d5(e,t=fs){return t.format(e,"LLLL")}function f5(e,t,n){return(n??new mr(t)).format(e,"cccccc")}function h5(e,t=fs){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function m5(){return""}function i2(e,t=fs){return t.format(e,"yyyy")}const p5=i2,y5=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:a2,formatDay:c5,formatMonthCaption:u5,formatMonthDropdown:d5,formatWeekNumber:h5,formatWeekNumberHeader:m5,formatWeekdayName:f5,formatYearCaption:p5,formatYearDropdown:i2},Symbol.toStringTag,{value:"Module"}));function g5(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...y5,...e}}function Km(e,t,n,r){let s=(r??new mr(n)).format(e,"PPPP");return t.today&&(s=`Today, ${s}`),t.selected&&(s=`${s}, selected`),s}const x5=Km;function Xm(e,t,n){return(n??new mr(t)).formatMonthYear(e)}const b5=Xm;function l2(e,t,n,r){let s=(r??new mr(n)).format(e,"PPPP");return t!=null&&t.today&&(s=`Today, ${s}`),s}function u2(e){return"Choose the Month"}function c2(){return""}const v5="Go to the Next Month";function d2(e,t){return v5}function f2(e){return"Go to the Previous Month"}function h2(e,t,n){return(n??new mr(t)).format(e,"cccc")}function m2(e,t){return`Week ${e}`}function p2(e){return"Week Number"}function y2(e){return"Choose the Year"}const E5=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:b5,labelDay:x5,labelDayButton:Km,labelGrid:Xm,labelGridcell:l2,labelMonthDropdown:u2,labelNav:c2,labelNext:d2,labelPrevious:f2,labelWeekNumber:m2,labelWeekNumberHeader:p2,labelWeekday:h2,labelYearDropdown:y2},Symbol.toStringTag,{value:"Module"})),Fr=(e,t,n)=>t||(n?typeof n=="function"?n:(...r)=>n:e);function T5(e,t){var r;const n=((r=t.locale)==null?void 0:r.labels)??{};return{...E5,...e??{},labelDayButton:Fr(Km,e==null?void 0:e.labelDayButton,n.labelDayButton),labelMonthDropdown:Fr(u2,e==null?void 0:e.labelMonthDropdown,n.labelMonthDropdown),labelNext:Fr(d2,e==null?void 0:e.labelNext,n.labelNext),labelPrevious:Fr(f2,e==null?void 0:e.labelPrevious,n.labelPrevious),labelWeekNumber:Fr(m2,e==null?void 0:e.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:Fr(y2,e==null?void 0:e.labelYearDropdown,n.labelYearDropdown),labelGrid:Fr(Xm,e==null?void 0:e.labelGrid,n.labelGrid),labelGridcell:Fr(l2,e==null?void 0:e.labelGridcell,n.labelGridcell),labelNav:Fr(c2,e==null?void 0:e.labelNav,n.labelNav),labelWeekNumberHeader:Fr(p2,e==null?void 0:e.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:Fr(h2,e==null?void 0:e.labelWeekday,n.labelWeekday)}}function w5(e,t,n,r,s){const{startOfMonth:i,startOfYear:l,endOfYear:c,eachMonthOfInterval:f,getMonth:h}=s;return f({start:l(e),end:c(e)}).map(g=>{const v=r.formatMonthDropdown(g,s),D=h(g),k=t&&g<i(t)||n&&g>i(n)||!1;return{value:D,label:v,disabled:k}})}function k5(e,t={},n={}){let r={...t==null?void 0:t[Ge.Day]};return Object.entries(e).filter(([,s])=>s===!0).forEach(([s])=>{r={...r,...n==null?void 0:n[s]}}),r}function S5(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 c=0;c<7;c++){const f=e.addDays(i,c);l.push(f)}return l}function C5(e,t,n,r,s=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:l,eachYearOfInterval:c,getYear:f}=r,h=i(e),p=l(t),y=c({start:h,end:p});return s&&y.reverse(),y.map(g=>{const v=n.formatYearDropdown(g,r);return{value:f(g),label:v,disabled:!1}})}function N5(e,t={}){var c;const{weekStartsOn:n,locale:r}=t,s=n??((c=r==null?void 0:r.options)==null?void 0:c.weekStartsOn)??0,i=f=>{const h=typeof f=="number"||typeof f=="string"?new Date(f):f;return new jn(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(jn.tz(e)),newDate:(f,h,p)=>new jn(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),v=((((h==null?void 0:h.weekStartsOn)??s)+6)%7-p.getDay()+7)%7;return p.setDate(p.getDate()+v),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 jn(h.getFullYear(),h.getMonth(),1,12,0,0,e),v=p.getFullYear()*12+p.getMonth();for(;g.getFullYear()*12+g.getMonth()<=v;)y.push(new jn(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 jn(h.getFullYear(),0,1,12,0,0,e);for(;g.getFullYear()<=p.getFullYear();)y.push(new jn(g,e)),g.setFullYear(g.getFullYear()+1,0,1);return y},getWeek:(f,h)=>{var y;const p=l(f);return Ed(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 vd(h)},differenceInCalendarDays:(f,h)=>{const p=l(f),y=l(h);return wm(p,y)},differenceInCalendarMonths:(f,h)=>{const p=l(f),y=l(h);return Xb(p,y)}}}const pu=e=>e instanceof HTMLElement?e:null,n0=e=>[...e.querySelectorAll("[data-animated-month]")??[]],_5=e=>pu(e.querySelector("[data-animated-month]")),r0=e=>pu(e.querySelector("[data-animated-caption]")),s0=e=>pu(e.querySelector("[data-animated-weeks]")),D5=e=>pu(e.querySelector("[data-animated-nav]")),O5=e=>pu(e.querySelector("[data-animated-weekdays]"));function A5(e,t,{classNames:n,months:r,focused:s,dateLib:i}){const l=C.useRef(null),c=C.useRef(r),f=C.useRef(!1);C.useLayoutEffect(()=>{const h=c.current;if(c.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||h.length===0||r.length!==h.length)return;const p=i.isSameMonth(r[0].date,h[0].date),y=i.isAfter(r[0].date,h[0].date),g=y?n[fr.caption_after_enter]:n[fr.caption_before_enter],v=y?n[fr.weeks_after_enter]:n[fr.weeks_before_enter],D=l.current,k=e.current.cloneNode(!0);if(k instanceof HTMLElement?(n0(k).forEach(O=>{if(!(O instanceof HTMLElement))return;const A=_5(O);A&&O.contains(A)&&O.removeChild(A);const R=r0(O);R&&R.classList.remove(g);const S=s0(O);S&&S.classList.remove(v)}),l.current=k):l.current=null,f.current||p||s)return;const T=D instanceof HTMLElement?n0(D):[],E=n0(e.current);if(E!=null&&E.every(N=>N instanceof HTMLElement)&&T&&T.every(N=>N instanceof HTMLElement)){f.current=!0,e.current.style.isolation="isolate";const N=D5(e.current);N&&(N.style.zIndex="1"),E.forEach((O,A)=>{const R=T[A];if(!R)return;O.style.position="relative",O.style.overflow="hidden";const S=r0(O);S&&S.classList.add(g);const I=s0(O);I&&I.classList.add(v);const _=()=>{f.current=!1,e.current&&(e.current.style.isolation=""),N&&(N.style.zIndex=""),S&&S.classList.remove(g),I&&I.classList.remove(v),O.style.position="",O.style.overflow="",O.contains(R)&&O.removeChild(R)};R.style.pointerEvents="none",R.style.position="absolute",R.style.overflow="hidden",R.setAttribute("aria-hidden","true");const P=O5(R);P&&(P.style.opacity="0");const F=r0(R);F&&(F.classList.add(y?n[fr.caption_before_exit]:n[fr.caption_after_exit]),F.addEventListener("animationend",_));const H=s0(R);H&&H.classList.add(y?n[fr.weeks_before_exit]:n[fr.weeks_after_exit]),O.insertBefore(R,O.firstChild)})}})}function I5(e,t,n,r){const s=e[0],i=e[e.length-1],{ISOWeek:l,fixedWeeks:c,broadcastCalendar:f}=n??{},{addDays:h,differenceInCalendarDays:p,differenceInCalendarMonths:y,endOfBroadcastWeek:g,endOfISOWeek:v,endOfMonth:D,endOfWeek:k,isAfter:T,startOfBroadcastWeek:E,startOfISOWeek:N,startOfWeek:O}=r,A=f?E(s,r):l?N(s):O(s),R=f?g(i):l?v(D(i)):k(D(i)),S=t&&(f?g(t):l?v(t):k(t)),I=S&&T(R,S)?S:R,_=p(I,A),P=y(i,s)+1,F=[];for(let Y=0;Y<=_;Y++){const q=h(A,Y);F.push(q)}const U=(f?35:42)*P;if(c&&F.length<U){const Y=U-F.length;for(let q=0;q<Y;q++){const G=h(F[F.length-1],1);F.push(G)}}return F}function M5(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 L5(e,t,n,r){const{numberOfMonths:s=1}=n,i=[];for(let l=0;l<s;l++){const c=r.addMonths(e,l);if(t&&c>t)break;i.push(c)}return i}function bx(e,t,n,r){const{month:s,defaultMonth:i,today:l=r.today(),numberOfMonths:c=1}=e;let f=s||i||l;const{differenceInCalendarMonths:h,addMonths:p,startOfMonth:y}=r;if(n&&h(n,f)<c-1){const g=-1*(c-1);f=p(n,g)}return t&&h(f,t)<0&&(f=t),y(f)}function R5(e,t,n,r){const{addDays:s,endOfBroadcastWeek:i,endOfISOWeek:l,endOfMonth:c,endOfWeek:f,getISOWeek:h,getWeek:p,startOfBroadcastWeek:y,startOfISOWeek:g,startOfWeek:v}=r,D=e.reduce((k,T)=>{const E=n.broadcastCalendar?y(T,r):n.ISOWeek?g(T):v(T),N=n.broadcastCalendar?i(T):n.ISOWeek?l(c(T)):f(c(T)),O=t.filter(I=>I>=E&&I<=N),A=n.broadcastCalendar?35:42;if(n.fixedWeeks&&O.length<A){const I=t.filter(_=>{const P=A-O.length;return _>N&&_<=s(N,P)});O.push(...I)}const R=O.reduce((I,_)=>{const P=n.ISOWeek?h(_):p(_),F=I.find(U=>U.weekNumber===P),H=new n2(_,T,r);return F?F.days.push(H):I.push(new OO(P,[H])),I},[]),S=new DO(T,R);return k.push(S),k},[]);return n.reverseMonths?D.reverse():D}function P5(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:s,startOfDay:i,startOfMonth:l,endOfMonth:c,addYears:f,endOfYear:h,newDate:p,today:y}=t,{fromYear:g,toYear:v,fromMonth:D,toMonth:k}=e;!n&&D&&(n=D),!n&&g&&(n=t.newDate(g,0,1)),!r&&k&&(r=k),!r&&v&&(r=p(v,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=c(r):v?r=p(v,11,31):!r&&T&&(r=h(e.today??y())),[n&&i(n),r&&i(r)]}function j5(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i=1}=n,{startOfMonth:l,addMonths:c,differenceInCalendarMonths:f}=r,h=s?i:1,p=l(e);if(!t)return c(p,h);if(!(f(t,e)<i))return c(p,h)}function F5(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i}=n,{startOfMonth:l,addMonths:c,differenceInCalendarMonths:f}=r,h=s?i??1:1,p=l(e);if(!t)return c(p,-h);if(!(f(p,t)<=0))return c(p,-h)}function B5(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function Dd(e,t){const[n,r]=C.useState(e);return[t===void 0?n:t,r]}function H5(e,t){var A;const[n,r]=P5(e,t),{startOfMonth:s,endOfMonth:i}=t,l=bx(e,n,r,t),[c,f]=Dd(l,e.month?l:void 0);C.useEffect(()=>{const R=bx(e,n,r,t);f(R)},[e.timeZone]);const{months:h,weeks:p,days:y,previousMonth:g,nextMonth:v}=C.useMemo(()=>{const R=L5(c,r,{numberOfMonths:e.numberOfMonths},t),S=I5(R,e.endMonth?i(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),I=R5(R,S,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),_=B5(I),P=M5(I),F=F5(c,n,e,t),H=j5(c,r,e,t);return{months:I,weeks:_,days:P,previousMonth:F,nextMonth:H}},[t,c.getTime(),r==null?void 0:r.getTime(),n==null?void 0:n.getTime(),e.disableNavigation,e.broadcastCalendar,(A=e.endMonth)==null?void 0:A.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:D,onMonthChange:k}=e,T=R=>p.some(S=>S.days.some(I=>I.isEqualTo(R))),E=R=>{if(D)return;let S=s(R);n&&S<s(n)&&(S=s(n)),r&&S>s(r)&&(S=s(r)),f(S),k==null||k(S)};return{months:h,weeks:p,days:y,navStart:n,navEnd:r,previousMonth:g,nextMonth:v,goToMonth:E,goToDay:R=>{T(R)||E(R.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 vx(e){return!e[Kt.disabled]&&!e[Kt.hidden]&&!e[Kt.outside]}function U5(e,t,n,r){let s,i=-1;for(const l of e){const c=t(l);vx(c)&&(c[Kt.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):c[Kt.today]&&i<ts.Today&&(s=l,i=ts.Today))}return s||(s=e.find(l=>vx(t(l)))),s}function z5(e,t,n,r,s,i,l){const{ISOWeek:c,broadcastCalendar:f}=i,{addDays:h,addMonths:p,addWeeks:y,addYears:g,endOfBroadcastWeek:v,endOfISOWeek:D,endOfWeek:k,max:T,min:E,startOfBroadcastWeek:N,startOfISOWeek:O,startOfWeek:A}=l;let S={day:h,week:y,month:p,year:g,startOfWeek:I=>f?N(I,l):c?O(I):A(I),endOfWeek:I=>f?v(I):c?D(I):k(I)}[e](n,t==="after"?1:-1);return t==="before"&&r?S=T([r,S]):t==="after"&&s&&(S=E([s,S])),S}function g2(e,t,n,r,s,i,l,c=0){if(c>365)return;const f=z5(e,t,n.date,r,s,i,l),h=!!(i.disabled&&As(f,i.disabled,l)),p=!!(i.hidden&&As(f,i.hidden,l)),y=f,g=new n2(f,y,l);return!h&&!p?g:g2(e,t,g,r,s,i,l,c+1)}function W5(e,t,n,r,s){const{autoFocus:i}=e,[l,c]=C.useState(),f=U5(t.days,n,r||(()=>!1),l),[h,p]=C.useState(i?f:void 0);return{isFocusTarget:k=>!!(f!=null&&f.isEqualTo(k)),setFocused:p,focused:h,blur:()=>{c(h),p(void 0)},moveFocus:(k,T)=>{if(!h)return;const E=g2(k,T,h,t.navStart,t.navEnd,e,s);E&&(e.disableNavigation&&!t.days.some(O=>O.isEqualTo(E))||(t.goToDay(E),p(E)))}}}function Y5(e,t){const{selected:n,required:r,onSelect:s}=e,[i,l]=Dd(n,s?n:void 0),c=s?n:i,{isSameDay:f}=t,h=v=>(c==null?void 0:c.some(D=>f(D,v)))??!1,{min:p,max:y}=e;return{selected:c,select:(v,D,k)=>{let T=[...c??[]];if(h(v)){if((c==null?void 0:c.length)===p||r&&(c==null?void 0:c.length)===1)return;T=c==null?void 0:c.filter(E=>!f(E,v))}else(c==null?void 0:c.length)===y?T=[v]:T=[...T,v];return s||l(T),s==null||s(T,v,D,k),T},isSelected:h}}function $5(e,t,n=0,r=0,s=!1,i=fs){const{from:l,to:c}=t||{},{isSameDay:f,isAfter:h,isBefore:p}=i;let y;if(!l&&!c)y={from:e,to:n>0?void 0:e};else if(l&&!c)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&&c)if(f(l,e)&&f(c,e))s?y={from:l,to:c}:y=void 0;else if(f(l,e))y={from:l,to:n>0?void 0:e};else if(f(c,e))y={from:e,to:n>0?void 0:e};else if(p(e,l))y={from:e,to:c};else if(h(e,l))y={from:l,to:e};else if(h(e,c))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 q5(e,t,n=fs){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 c=0;c<=l;c++){if(r.includes(s.getDay()))return!0;s=n.addDays(s,1)}return!1}function Ex(e,t,n=fs){return Os(e,t.from,!1,n)||Os(e,t.to,!1,n)||Os(t,e.from,!1,n)||Os(t,e.to,!1,n)}function V5(e,t,n=fs){const r=Array.isArray(t)?t:[t];if(r.filter(c=>typeof c!="function").some(c=>typeof c=="boolean"?c:n.isDate(c)?Os(e,c,!1,n):o2(c,n)?c.some(f=>Os(e,f,!1,n)):_d(c)?c.from&&c.to?Ex(e,{from:c.from,to:c.to},n):!1:s2(c)?q5(e,c.dayOfWeek,n):Vm(c)?n.isAfter(c.before,c.after)?Ex(e,{from:n.addDays(c.after,1),to:n.addDays(c.before,-1)},n):As(e.from,c,n)||As(e.to,c,n):Qm(c)||Gm(c)?As(e.from,c,n)||As(e.to,c,n):!1))return!0;const l=r.filter(c=>typeof c=="function");if(l.length){let c=e.from;const f=n.differenceInCalendarDays(e.to,e.from);for(let h=0;h<=f;h++){if(l.some(p=>p(c)))return!0;c=n.addDays(c,1)}}return!1}function Q5(e,t){const{disabled:n,excludeDisabled:r,selected:s,required:i,onSelect:l}=e,[c,f]=Dd(s,l?s:void 0),h=l?s:c;return{selected:h,select:(g,v,D)=>{const{min:k,max:T}=e,E=g?$5(g,h,k,T,i,t):void 0;return r&&n&&(E!=null&&E.from)&&E.to&&V5({from:E.from,to:E.to},n,t)&&(E.from=g,E.to=void 0),l||f(E),l==null||l(E,g,v,D),E},isSelected:g=>h&&Os(h,g,!1,t)}}function G5(e,t){const{selected:n,required:r,onSelect:s}=e,[i,l]=Dd(n,s?n:void 0),c=s?n:i,{isSameDay:f}=t;return{selected:c,select:(y,g,v)=>{let D=y;return!r&&c&&c&&f(y,c)&&(D=void 0),s||l(D),s==null||s(D,y,g,v),D},isSelected:y=>c?f(c,y):!1}}function K5(e,t){const n=G5(e,t),r=Y5(e,t),s=Q5(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return s;default:return}}function Tr(e,t){return e instanceof jn&&e.timeZone===t?e:new jn(e,t)}function Qa(e,t,n){return Tr(e,t)}function Tx(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?Qa(e,t):Array.isArray(e)?e.map(r=>r instanceof Date?Qa(r,t):r):_d(e)?{...e,from:e.from?Tr(e.from,t):e.from,to:e.to?Tr(e.to,t):e.to}:Vm(e)?{before:Qa(e.before,t),after:Qa(e.after,t)}:Qm(e)?{after:Qa(e.after,t)}:Gm(e)?{before:Qa(e.before,t)}:e}function o0(e,t,n){return e&&(Array.isArray(e)?e.map(r=>Tx(r,t)):Tx(e,t))}function Ka(e){var Or;let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=Tr(t.today,n)),t.month&&(t.month=Tr(t.month,n)),t.defaultMonth&&(t.defaultMonth=Tr(t.defaultMonth,n)),t.startMonth&&(t.startMonth=Tr(t.startMonth,n)),t.endMonth&&(t.endMonth=Tr(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=Tr(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=(Or=t.selected)==null?void 0:Or.map(Xe=>Tr(Xe,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?Tr(t.selected.from,n):t.selected.from,to:t.selected.to?Tr(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=o0(t.disabled,n)),t.hidden!==void 0&&(t.hidden=o0(t.hidden,n)),t.modifiers)){const Xe={};Object.keys(t.modifiers).forEach(ut=>{var Me;Xe[ut]=o0((Me=t.modifiers)==null?void 0:Me[ut],n)}),t.modifiers=Xe}const{components:r,formatters:s,labels:i,dateLib:l,locale:c,classNames:f}=C.useMemo(()=>{const Xe={...t2,...t.locale},ut=t.broadcastCalendar?1:t.weekStartsOn,Me=t.noonSafe&&t.timeZone?N5(t.timeZone,{weekStartsOn:ut,locale:Xe}):void 0,ze=t.dateLib&&Me?{...Me,...t.dateLib}:t.dateLib??Me,pt=new mr({locale:Xe,weekStartsOn:ut,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},ze);return{dateLib:pt,components:a5(t.components),formatters:g5(t.formatters),labels:T5(t.labels,pt.options),locale:Xe,classNames:{...l5(),...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:v,onDayClick:D,onDayFocus:k,onDayKeyDown:T,onDayMouseEnter:E,onDayMouseLeave:N,onNextClick:O,onPrevClick:A,showWeekNumber:R,styles:S}=t,{formatCaption:I,formatDay:_,formatMonthDropdown:P,formatWeekNumber:F,formatWeekNumberHeader:H,formatWeekdayName:U,formatYearDropdown:Y}=s,q=H5(t,l),{days:G,months:ee,navStart:he,navEnd:te,previousMonth:ue,nextMonth:M,goToMonth:Q}=q,le=s5(G,t,he,te,l),{isSelected:j,select:se,selected:ye}=K5(t,l)??{},{blur:xe,focused:Oe,isFocusTarget:ae,moveFocus:de,setFocused:_e}=W5(t,q,le,j??(()=>!1),l),{labelDayButton:ke,labelGridcell:Pe,labelGrid:Ue,labelMonthDropdown:et,labelNav:Ke,labelPrevious:ge,labelNext:me,labelWeekday:fe,labelWeekNumber:J,labelWeekNumberHeader:Z,labelYearDropdown:be}=i,Ne=C.useMemo(()=>S5(l,t.ISOWeek,t.broadcastCalendar,t.today),[l,t.ISOWeek,t.broadcastCalendar,t.today]),$e=p!==void 0||D!==void 0,ct=C.useCallback(()=>{ue&&(Q(ue),A==null||A(ue))},[ue,Q,A]),ht=C.useCallback(()=>{M&&(Q(M),O==null||O(M))},[Q,M,O]),ie=C.useCallback((Xe,ut)=>Me=>{Me.preventDefault(),Me.stopPropagation(),_e(Xe),!ut.disabled&&(se==null||se(Xe.date,ut,Me),D==null||D(Xe.date,ut,Me))},[se,D,_e]),ve=C.useCallback((Xe,ut)=>Me=>{_e(Xe),k==null||k(Xe.date,ut,Me)},[k,_e]),Re=C.useCallback((Xe,ut)=>Me=>{xe(),v==null||v(Xe.date,ut,Me)},[xe,v]),rt=C.useCallback((Xe,ut)=>Me=>{const ze={ArrowLeft:[Me.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[Me.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[Me.shiftKey?"year":"week","after"],ArrowUp:[Me.shiftKey?"year":"week","before"],PageUp:[Me.shiftKey?"year":"month","before"],PageDown:[Me.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(ze[Me.key]){Me.preventDefault(),Me.stopPropagation();const[pt,We]=ze[Me.key];de(pt,We)}T==null||T(Xe.date,ut,Me)},[de,T,t.dir]),ot=C.useCallback((Xe,ut)=>Me=>{E==null||E(Xe.date,ut,Me)},[E]),xt=C.useCallback((Xe,ut)=>Me=>{N==null||N(Xe.date,ut,Me)},[N]),Zt=C.useCallback(Xe=>ut=>{const Me=Number(ut.target.value),ze=l.setMonth(l.startOfMonth(Xe),Me);Q(ze)},[l,Q]),hn=C.useCallback(Xe=>ut=>{const Me=Number(ut.target.value),ze=l.setYear(l.startOfMonth(Xe),Me);Q(ze)},[l,Q]),{className:Dn,style:$n}=C.useMemo(()=>({className:[f[Ge.Root],t.className].filter(Boolean).join(" "),style:{...S==null?void 0:S[Ge.Root],...t.style}}),[f,t.className,t.style,S]),Wt=i5(t),It=C.useRef(null);A5(It,!!t.animate,{classNames:f,months:ee,focused:Oe,dateLib:l});const yn={dayPickerProps:t,selected:ye,select:se,isSelected:j,months:ee,nextMonth:M,previousMonth:ue,goToMonth:Q,getModifiers:le,components:r,classNames:f,styles:S,labels:i,formatters:s};return Le.createElement(r2.Provider,{value:yn},Le.createElement(r.Root,{rootRef:t.animate?It:void 0,className:Dn,style:$n,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"],...Wt},Le.createElement(r.Months,{className:f[Ge.Months],style:S==null?void 0:S[Ge.Months]},!t.hideNavigation&&!y&&Le.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:f[Ge.Nav],style:S==null?void 0:S[Ge.Nav],"aria-label":Ke(),onPreviousClick:ct,onNextClick:ht,previousMonth:ue,nextMonth:M}),ee.map((Xe,ut)=>Le.createElement(r.Month,{"data-animated-month":t.animate?"true":void 0,className:f[Ge.Month],style:S==null?void 0:S[Ge.Month],key:ut,displayIndex:ut,calendarMonth:Xe},y==="around"&&!t.hideNavigation&&ut===0&&Le.createElement(r.PreviousMonthButton,{type:"button",className:f[Ge.PreviousMonthButton],tabIndex:ue?void 0:-1,"aria-disabled":ue?void 0:!0,"aria-label":ge(ue),onClick:ct,"data-animated-button":t.animate?"true":void 0},Le.createElement(r.Chevron,{disabled:ue?void 0:!0,className:f[Ge.Chevron],orientation:t.dir==="rtl"?"right":"left"})),Le.createElement(r.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:f[Ge.MonthCaption],style:S==null?void 0:S[Ge.MonthCaption],calendarMonth:Xe,displayIndex:ut},h!=null&&h.startsWith("dropdown")?Le.createElement(r.DropdownNav,{className:f[Ge.Dropdowns],style:S==null?void 0:S[Ge.Dropdowns]},(()=>{const Me=h==="dropdown"||h==="dropdown-months"?Le.createElement(r.MonthsDropdown,{key:"month",className:f[Ge.MonthsDropdown],"aria-label":et(),classNames:f,components:r,disabled:!!t.disableNavigation,onChange:Zt(Xe.date),options:w5(Xe.date,he,te,s,l),style:S==null?void 0:S[Ge.Dropdown],value:l.getMonth(Xe.date)}):Le.createElement("span",{key:"month"},P(Xe.date,l)),ze=h==="dropdown"||h==="dropdown-years"?Le.createElement(r.YearsDropdown,{key:"year",className:f[Ge.YearsDropdown],"aria-label":be(l.options),classNames:f,components:r,disabled:!!t.disableNavigation,onChange:hn(Xe.date),options:C5(he,te,s,l,!!t.reverseYears),style:S==null?void 0:S[Ge.Dropdown],value:l.getYear(Xe.date)}):Le.createElement("span",{key:"year"},Y(Xe.date,l));return l.getMonthYearOrder()==="year-first"?[ze,Me]:[Me,ze]})(),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(Xe.date,l.options,l))):Le.createElement(r.CaptionLabel,{className:f[Ge.CaptionLabel],role:"status","aria-live":"polite"},I(Xe.date,l.options,l))),y==="around"&&!t.hideNavigation&&ut===g-1&&Le.createElement(r.NextMonthButton,{type:"button",className:f[Ge.NextMonthButton],tabIndex:M?void 0:-1,"aria-disabled":M?void 0:!0,"aria-label":me(M),onClick:ht,"data-animated-button":t.animate?"true":void 0},Le.createElement(r.Chevron,{disabled:M?void 0:!0,className:f[Ge.Chevron],orientation:t.dir==="rtl"?"left":"right"})),ut===g-1&&y==="after"&&!t.hideNavigation&&Le.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:f[Ge.Nav],style:S==null?void 0:S[Ge.Nav],"aria-label":Ke(),onPreviousClick:ct,onNextClick:ht,previousMonth:ue,nextMonth:M}),Le.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":p==="multiple"||p==="range","aria-label":Ue(Xe.date,l.options,l)||void 0,className:f[Ge.MonthGrid],style:S==null?void 0:S[Ge.MonthGrid]},!t.hideWeekdays&&Le.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:f[Ge.Weekdays],style:S==null?void 0:S[Ge.Weekdays]},R&&Le.createElement(r.WeekNumberHeader,{"aria-label":Z(l.options),className:f[Ge.WeekNumberHeader],style:S==null?void 0:S[Ge.WeekNumberHeader],scope:"col"},H()),Ne.map(Me=>Le.createElement(r.Weekday,{"aria-label":fe(Me,l.options,l),className:f[Ge.Weekday],key:String(Me),style:S==null?void 0:S[Ge.Weekday],scope:"col"},U(Me,l.options,l)))),Le.createElement(r.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:f[Ge.Weeks],style:S==null?void 0:S[Ge.Weeks]},Xe.weeks.map(Me=>Le.createElement(r.Week,{className:f[Ge.Week],key:Me.weekNumber,style:S==null?void 0:S[Ge.Week],week:Me},R&&Le.createElement(r.WeekNumber,{week:Me,style:S==null?void 0:S[Ge.WeekNumber],"aria-label":J(Me.weekNumber,{locale:c}),className:f[Ge.WeekNumber],scope:"row",role:"rowheader"},F(Me.weekNumber,l)),Me.days.map(ze=>{const{date:pt}=ze,We=le(ze);if(We[Kt.focused]=!We.hidden&&!!(Oe!=null&&Oe.isEqualTo(ze)),We[zr.selected]=(j==null?void 0:j(pt))||We.selected,_d(ye)){const{from:$t,to:nn}=ye;We[zr.range_start]=!!($t&&nn&&l.isSameDay(pt,$t)),We[zr.range_end]=!!($t&&nn&&l.isSameDay(pt,nn)),We[zr.range_middle]=Os(ye,pt,!0,l)}const Yt=k5(We,S,t.modifiersStyles),en=o5(We,f,t.modifiersClassNames),tn=!$e&&!We.hidden?Pe(pt,We,l.options,l):void 0;return Le.createElement(r.Day,{key:`${ze.isoDate}_${ze.displayMonthId}`,day:ze,modifiers:We,className:en.join(" "),style:Yt,role:"gridcell","aria-selected":We.selected||void 0,"aria-label":tn,"data-day":ze.isoDate,"data-month":ze.outside?ze.dateMonthId:void 0,"data-selected":We.selected||void 0,"data-disabled":We.disabled||void 0,"data-hidden":We.hidden||void 0,"data-outside":ze.outside||void 0,"data-focused":We.focused||void 0,"data-today":We.today||void 0},!We.hidden&&$e?Le.createElement(r.DayButton,{className:f[Ge.DayButton],style:S==null?void 0:S[Ge.DayButton],type:"button",day:ze,modifiers:We,disabled:!We.focused&&We.disabled||void 0,"aria-disabled":We.focused&&We.disabled||void 0,tabIndex:ae(ze)?0:-1,"aria-label":ke(pt,We,l.options,l),onClick:ie(ze,We),onBlur:Re(ze,We),onFocus:ve(ze,We),onKeyDown:rt(ze,We),onMouseEnter:ot(ze,We),onMouseLeave:xt(ze,We)},_(pt,l.options,l)):!We.hidden&&_(ze.date,l.options,l))})))))))),t.footer&&Le.createElement(r.Footer,{className:f[Ge.Footer],style:S==null?void 0:S[Ge.Footer],role:"status","aria-live":"polite"},t.footer)))}function Ci({trigger:e,children:t,isOpen:n,onOpenChange:r,width:s=340}){const[i,l]=C.useState(!1),c=C.useRef(null),f=C.useRef(null),h=n!==void 0?n:i,p=C.useCallback(g=>{r?r(g):l(g)},[r]),y=C.useCallback(()=>p(!1),[p]);return C.useEffect(()=>{if(!h)return;function g(v){const D=v.target;c.current&&!c.current.contains(D)&&f.current&&!f.current.contains(D)&&y()}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[h,y]),C.useEffect(()=>{if(!h)return;function g(v){v.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:c,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]=C.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:c=>{c.stopPropagation(),l()},onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.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 ba({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 x2=[{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"}],X5=`
|
|
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 ed(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="custom"}function Jm(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="relative"}const X0={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 J5(e){return!!(Jm(e)||typeof e=="string"&&e in X0)}function Z5(e){return Jm(e)?e:typeof e=="string"&&e in X0?X0[e]:{type:"relative",direction:"previous",value:30,unit:"day",includeToday:!1}}function e6(e){const n=ca(new Date);if(e.direction==="current")switch(e.unit){case"day":return{start:n,end:eS(n)};case"week":return{start:Yr(n,{weekStartsOn:1}),end:bd(n,{weekStartsOn:1})};case"month":return{start:Xl(n),end:gd(n)};case"quarter":return{start:Xc(n),end:Sm(n)};case"year":return{start:yi(n),end:xd(n)}}const r=e.value??1,s=e.direction==="previous",l=(s?{day:Sr,week:lv,month:Bl,quarter:iv,year:Dm}:{day:Ms,week:pd,month:Ti,quarter:km,year:yd})[e.unit];if(s){const c=e.includeToday?n:Sr(n,1),f=l((e.includeToday,n),r);return{start:f<c?f:c,end:f<c?c:f}}else{const c=e.includeToday?n:Ms(n,1),f=l(c,r);return{start:c<f?c:f,end:c<f?f:c}}}function t6(e){if(ed(e))return`${e.start} to ${e.end}`;if(Jm(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=x2.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 n6=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 b2({name:e,label:t="Date",description:n,chartName:r,defaultValue:s="last_30_days"}){var k;const i=Ni(),l=Je(T=>T.globalFilters),c=Je(T=>T.chartFilters),f=Je(T=>T.setGlobalFilter),h=Je(T=>T.setChartFilter),p=r?((k=c[r])==null?void 0:k[e])??l[e]??s:l[e]??s;C.useEffect(()=>{var E;(r?((E=c[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,c,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,v=t6(p),D=()=>{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:v,active:g,icon:n6,description:n,onClear:D}),children:d.jsx(r6,{currentValue:p,description:n,onApply:y,onClose:i.close})})}function r6({currentValue:e,description:t,onApply:n,onClose:r}){const[s,i]=C.useState(()=>J5(e)?"relative":ed(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(s6,{currentValue:e,onSelectPreset:l=>{n(l),r()},onNavigate:i}),s==="fixed"&&d.jsx(o6,{currentValue:e,onApply:n,onBack:()=>i("presets")}),s==="relative"&&d.jsx(a6,{currentValue:e,onApply:n,onBack:()=>i("presets")})]})}function s6({currentValue:e,onSelectPreset:t,onNavigate:n}){return d.jsxs("div",{className:"py-1",children:[x2.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 o6({currentValue:e,onApply:t,onBack:n}){const[r,s]=C.useState("between"),[i,l]=C.useState(()=>{if(ed(e)){const g=ws(e.start,"yyyy-MM-dd",new Date),v=ws(e.end,"yyyy-MM-dd",new Date);return{from:g,to:v}}}),[c,f]=C.useState(()=>{if(ed(e)&&r!=="between")return ws(e.start,"yyyy-MM-dd",new Date)}),h=()=>{if(r==="between"&&(i!=null&&i.from)&&(i!=null&&i.to))t({type:"custom",start:on(i.from,"yyyy-MM-dd"),end:on(i.to,"yyyy-MM-dd")});else if(r==="on"&&c){const g=on(c,"yyyy-MM-dd");t({type:"custom",start:g,end:g})}else r==="before"&&c?t({type:"custom",start:"1970-01-01",end:on(c,"yyyy-MM-dd")}):r==="after"&&c&&t({type:"custom",start:on(c,"yyyy-MM-dd"),end:on(new Date(2099,11,31),"yyyy-MM-dd")})},p=r==="between"?!!(i!=null&&i.from&&(i!=null&&i.to)):!!c,y=[{key:"between",label:"Between"},{key:"before",label:"Before"},{key:"on",label:"On"},{key:"after",label:"After"}];return d.jsxs("div",{children:[d.jsx(ba,{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:X5}),r==="between"?d.jsx(Ka,{mode:"range",selected:i,onSelect:l,numberOfMonths:2,defaultMonth:(i==null?void 0:i.from)||new Date}):d.jsx(Ka,{mode:"single",selected:c,onSelect:f,numberOfMonths:2,defaultMonth:c||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 a6({currentValue:e,onApply:t,onBack:n}){const r=Z5(e),[s,i]=C.useState(r.direction),[l,c]=C.useState(r.value??30),[f,h]=C.useState(r.unit),[p,y]=C.useState(r.includeToday??!1),g=C.useMemo(()=>{const N=e6({direction:s,value:s==="current"?void 0:l,unit:f,includeToday:p}),O=N.start.getFullYear(),A=N.end.getFullYear();return O===A?`${on(N.start,"MMM d")} – ${on(N.end,"MMM d, yyyy")}`:`${on(N.start,"MMM d, yyyy")} – ${on(N.end,"MMM d, yyyy")}`},[s,l,f,p]),v=()=>{t({type:"relative",direction:s,value:s==="current"?void 0:l,unit:f,includeToday:p})},D=[{key:"previous",label:"Previous"},{key:"current",label:"Current"},{key:"next",label:"Next"}],k=[{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(ba,{title:"Relative date range",onBack:n}),d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsx("div",{className:"flex gap-1",children:D.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=>c(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:k.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:v,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}function td({name:e,label:t=e,description:n,options:r,chartName:s,defaultValue:i,source:l}){var F,H;const c=Ni(),f=Je(U=>U.globalFilters),h=Je(U=>U.chartFilters),p=Je(U=>U.setGlobalFilter),y=Je(U=>U.setChartFilter),g=!!l,{data:v,isLoading:D}=sr({queryKey:g?s?["parameterOptions",s,e]:["modelOptions",l.model,l.value_field,l.label_field]:["noop"],queryFn:()=>s?ft.getParameterOptions(s,e):ft.getModelOptions(l.model,l.value_field,l.label_field),enabled:g,staleTime:300*1e3}),k=g?[{value:"",label:"All"},...(v==null?void 0:v.options)??[]]:[{value:"",label:"All"},...r??[]],T=s?((F=h[s])==null?void 0:F[e])??f[e]??i??"":f[e]??i??"",[E,N]=C.useState(T),[O,A]=C.useState("");C.useEffect(()=>{c.isOpen&&(N(T),A(""))},[c.isOpen,T]),C.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 R=()=>{const U=E||null;s?y(s,e,U):p(e,U),c.close()},S=O?k.filter(U=>U.label.toLowerCase().includes(O.toLowerCase())):k,I=T?((H=k.find(U=>U.value===T))==null?void 0:H.label)||T:void 0,_=!!T&&T!==i,P=()=>{const U=i??null;s?y(s,e,U):p(e,U)};return g&&D?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:c.isOpen,onOpenChange:c.onOpenChange,trigger:d.jsx(_i,{label:t,value:I||t,active:_,description:n,onClear:P}),children:[d.jsx(ba,{title:t,description:n}),d.jsxs("div",{className:"p-3",children:[k.length>6&&d.jsx("div",{className:"mb-2",children:d.jsx("input",{type:"text",placeholder:"Search...",value:O,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:[S.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:()=>N(U.value),className:"text-blue-600"}),d.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:U.label})]},U.value)),S.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:R,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}function v2({name:e,label:t=e,description:n,options:r,chartName:s,defaultValue:i,source:l}){const c=Ni(),f=Je(Y=>Y.globalFilters),h=Je(Y=>Y.chartFilters),p=Je(Y=>Y.setGlobalFilter),y=Je(Y=>Y.setChartFilter),g=!!l,{data:v,isLoading:D}=sr({queryKey:g?s?["parameterOptions",s,e]:["modelOptions",l.model,l.value_field,l.label_field]:["noop"],queryFn:()=>s?ft.getParameterOptions(s,e):ft.getModelOptions(l.model,l.value_field,l.label_field),enabled:g,staleTime:300*1e3}),k=g?(v==null?void 0:v.options)??[]:r??[],T=(()=>{var q;const Y=s?((q=h[s])==null?void 0:q[e])??f[e]??i??[]:f[e]??i??[];return Array.isArray(Y)?Y:[]})(),[E,N]=C.useState(T),[O,A]=C.useState("");C.useEffect(()=>{c.isOpen&&(N(T),A(""))},[c.isOpen]),C.useEffect(()=>{var q;(s?((q=h[s])==null?void 0:q[e])??f[e]:f[e])===void 0&&i&&(s?y(s,e,i):p(e,i))},[s,e,i,f,h,p,y]);const R=Y=>{N(q=>q.includes(Y)?q.filter(G=>G!==Y):[...q,Y])},S=()=>{E.length===k.length?N([]):N(k.map(Y=>Y.value))},I=()=>{const Y=E.length>0?E:null;s?y(s,e,Y):p(e,Y),c.close()},_=O?k.filter(Y=>Y.label.toLowerCase().includes(O.toLowerCase())):k,P=T.length===0?void 0:T.length<=2?T.map(Y=>{var q;return((q=k.find(G=>G.value===Y))==null?void 0:q.label)||Y}).join(", "):`${T.length} selected`,F=T.length>0,H=E.length===k.length&&k.length>0,U=()=>{const Y=i??null;s?y(s,e,Y):p(e,Y)};return g&&D?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:c.isOpen,onOpenChange:c.onOpenChange,trigger:d.jsx(_i,{label:t,value:P||t,active:F,description:n,onClear:U}),children:[d.jsx(ba,{title:t,description:n}),d.jsxs("div",{className:"p-3",children:[k.length>6&&d.jsx("div",{className:"mb-2",children:d.jsx("input",{type:"text",placeholder:"Search...",value:O,onChange:Y=>A(Y.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:[!O&&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:H,onChange:S,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)"}})]}),_.map(Y=>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(Y.value),onChange:()=>R(Y.value),className:"text-blue-600 rounded"}),d.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:Y.label})]},Y.value)),_.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 J0=[{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"}],E2=["is_empty","is_not_empty"];function T2(e){return typeof e=="object"&&e!==null&&"operator"in e&&"value"in e}function i6(e){var t,n;if(T2(e))return E2.includes(e.operator)?(t=J0.find(s=>s.value===e.operator))==null?void 0:t.label:`${((n=J0.find(s=>s.value===e.operator))==null?void 0:n.label)||e.operator} "${e.value}"`;if(typeof e=="string"&&e)return e}function w2({name:e,label:t=e,description:n,chartName:r,defaultValue:s}){var R;const i=Ni(),l=Je(S=>S.globalFilters),c=Je(S=>S.chartFilters),f=Je(S=>S.setGlobalFilter),h=Je(S=>S.setChartFilter),p=r?((R=c[r])==null?void 0:R[e])??l[e]??s??null:l[e]??s??null,[y,g]=C.useState("contains"),[v,D]=C.useState("");C.useEffect(()=>{i.isOpen&&(T2(p)?(g(p.operator),D(p.value)):typeof p=="string"?(g("is"),D(p)):(g("contains"),D("")))},[i.isOpen]);const k=()=>{const S={operator:y,value:v};r?h(r,e,S):f(e,S),i.close()},T=!E2.includes(y),E=!T||v.trim().length>0,N=i6(p),O=!!N,A=()=>{const S=s??null;r?h(r,e,S):f(e,S)};return d.jsxs(Ci,{isOpen:i.isOpen,onOpenChange:i.onOpenChange,trigger:d.jsx(_i,{label:t,value:N||t,active:O,description:n,onClear:A}),children:[d.jsx(ba,{title:t,description:n}),d.jsxs("div",{className:"p-4 space-y-3",children:[d.jsx("select",{value:y,onChange:S=>g(S.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:J0.map(S=>d.jsx("option",{value:S.value,children:S.label},S.value))}),T&&d.jsx("input",{type:"text",value:v,onChange:S=>D(S.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:S=>{S.key==="Enter"&&E&&k()}})]}),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:k,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 Z0=[{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"}],k2=["is_empty","is_not_empty"];function S2(e){return typeof e=="object"&&e!==null&&"operator"in e&&"value"in e&&typeof e.value=="number"}function l6(e){var t,n;if(S2(e)){if(k2.includes(e.operator))return(t=Z0.find(s=>s.value===e.operator))==null?void 0:t.label;const r=((n=Z0.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 C2({name:e,label:t=e,description:n,chartName:r,defaultValue:s}){var P;const i=Ni(),l=Je(F=>F.globalFilters),c=Je(F=>F.chartFilters),f=Je(F=>F.setGlobalFilter),h=Je(F=>F.setChartFilter),p=r?((P=c[r])==null?void 0:P[e])??l[e]??s??null:l[e]??s??null,[y,g]=C.useState("equal"),[v,D]=C.useState(""),[k,T]=C.useState("");C.useEffect(()=>{i.isOpen&&(S2(p)?(g(p.operator),D(String(p.value)),T(p.value2!==void 0?String(p.value2):"")):typeof p=="number"?(g("equal"),D(String(p)),T("")):(g("equal"),D(""),T("")))},[i.isOpen]);const E=()=>{const F={operator:y,value:parseFloat(v)||0,...y==="between"?{value2:parseFloat(k)||0}:{}};r?h(r,e,F):f(e,F),i.close()},N=!k2.includes(y),O=y==="between",A=!N||v!==""&&(!O||k!==""),R=l6(p),S=p===s||typeof p=="number"&&p===s||p==null,I=!!R&&!S,_=()=>{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:R||t,active:I,description:n,onClear:_}),children:[d.jsx(ba,{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:Z0.map(F=>d.jsx("option",{value:F.value,children:F.label},F.value))}),N&&d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"number",value:v,onChange:F=>D(F.target.value),placeholder:O?"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()}}),O&&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:k,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 N2({name:e,label:t=e,description:n,chartName:r}){var T;const s=Ni(),i=Je(E=>E.globalFilters),l=Je(E=>E.chartFilters),c=Je(E=>E.setGlobalFilter),f=Je(E=>E.setChartFilter),h=r?((T=l[r])==null?void 0:T[e])??i[e]??null:i[e]??null,[p,y]=C.useState(typeof h=="boolean"?h:null);C.useEffect(()=>{s.isOpen&&y(typeof h=="boolean"?h:null)},[s.isOpen]);const g=()=>{r?f(r,e,p):c(e,p),s.close()},v=typeof h=="boolean"?h?"True":"False":void 0,D=typeof h=="boolean",k=()=>{r?f(r,e,null):c(e,null)};return d.jsxs(Ci,{isOpen:s.isOpen,onOpenChange:s.onOpenChange,width:240,trigger:d.jsx(_i,{label:t,value:v||t,active:D,description:n,onClear:k}),children:[d.jsx(ba,{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 da(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim()}function _2({parameters:e,chartName:t}){const n=Je(f=>f.globalFilters),r=Je(f=>f.chartFilters),s=Je(f=>f.resetFilters),i=Je(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)}),c=()=>{t?i(t):s()};return d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.map(f=>{const h=f.label||da(f.name),p=typeof f.default=="string"?f.default:void 0;switch(f.type){case"date_range":return d.jsx(b2,{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(td,{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(td,{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(v2,{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(w2,{name:f.name,label:h,description:f.description,chartName:t,defaultValue:p},f.name);case"number":return d.jsx(C2,{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(N2,{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:c,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 D2({resourceType:e,resourceName:t}){const n=So(k=>k.auth),[r,s]=C.useState(!1),[i,l]=C.useState(null),[c,f]=C.useState(null),[h,p]=C.useState(!1),y=C.useRef(null);if(n.status!=="authenticated")return null;const g=n.user.role==="admin"||n.user.role==="editor";C.useEffect(()=>{if(!r)return;const k=T=>{y.current&&!y.current.contains(T.target)&&s(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[r]);const v=async()=>{const k=e==="dashboard"?`#/dashboards/${t}`:`#/charts/${t}`,T=`${window.location.origin}/${k}`;await navigator.clipboard.writeText(T),f("link"),setTimeout(()=>f(null),2e3)},D=async()=>{p(!0);try{const k=await ft.createShareLink({resourceType:e,resourceName:t}),T=e==="dashboard"?`#/public/dashboards/${t}?token=${k.token}`:`#/public/charts/${t}?token=${k.token}`,E=`${window.location.origin}/${T}`;l(E),await navigator.clipboard.writeText(E),f("public"),setTimeout(()=>f(null),2e3)}catch(k){console.error("Failed to create share link:",k)}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:v,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"})}),c==="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:D,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..."}):c==="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 u6({rowCount:e,durationMs:t,cached:n,view:r,onToggleView:s,onExportCSV:i,onExportPNG:l,onShowSql:c,onShowEvents:f,eventCount:h}){const[p,y]=C.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})]}),c&&d.jsx("button",{onClick:c,className:"px-2 py-0.5 rounded border hover:bg-black/5 transition-colors font-mono",style:{borderColor:"var(--yc-color-border)"},children:"SQL"}),(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 c6=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"]),d6=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 Br(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function f6(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">${Br(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">${Br(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">${Br(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">${Br(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">${Br(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(),c=e.slice(s);/^\s*\(/.test(c)&&d6.has(l)?t.push(`<span class="sql-function">${Br(i)}</span>`):c6.has(l)?t.push(`<span class="sql-keyword">${Br(i)}</span>`):t.push(Br(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">${Br(e.slice(n,s))}</span>`),n=s;continue}if("=<>!+-*/%".includes(r(n))){t.push(`<span class="sql-operator">${Br(r(n))}</span>`),n++;continue}t.push(Br(r(n))),n++}return t.join("")}function h6(e){return f6(e).split(`
|
|
75
|
-
`).map(r=>`<div class="sql-line">${r||" "}</div>`).join("")}function m6({isOpen:e,onClose:t,compiledSql:n,modelName:r,connection:s,durationMs:i,rowCount:l,cached:c}){const[f,h]=C.useState(!1),p=C.useMemo(()=>n?h6(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",c&&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 wx=[{name:"Red",hex:"#ef4444"},{name:"Orange",hex:"#f97316"},{name:"Green",hex:"#10b981"},{name:"Blue",hex:"#3b82f6"},{name:"Purple",hex:"#8b5cf6"}];function em({value:e,onChange:t,themePalette:n,compact:r}){const[s,i]=C.useState(!1),[l,c]=C.useState(""),f=C.useRef(null);C.useEffect(()=>{if(!s)return;function g(v){f.current&&!f.current.contains(v.target)&&i(!1)}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[s]),C.useEffect(()=>{if(s&&e){const g=wx.some(v=>v.hex.toLowerCase()===e.toLowerCase())||h.some(v=>v.toLowerCase()===e.toLowerCase());c(g?"":e)}},[s]);const h=n??qm;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:wx.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,v)=>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}-${v}`))})]}),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=>c(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 p6({open:e,title:t,message:n,confirmLabel:r="Delete",cancelLabel:s="Cancel",variant:i="danger",onConfirm:l,onCancel:c}){const f=C.useRef(null);return C.useEffect(()=>{var h;e&&((h=f.current)==null||h.focus())},[e]),C.useEffect(()=>{if(!e)return;function h(p){p.key==="Escape"&&c()}return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,c]),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:c}),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:c,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 y6({isOpen:e,onClose:t,events:n,allEvents:r,chartName:s,canEdit:i,eventsVisible:l,onToggleVisible:c,themePalette:f}){const h=Yn(),[p,y]=C.useState(!1),[g,v]=C.useState(""),[D,k]=C.useState(""),[T,E]=C.useState(""),[N,O]=C.useState(""),[A,R]=C.useState(!1),[S,I]=C.useState(""),[_,P]=C.useState(!1),[F,H]=C.useState(!1),U=C.useRef(null),Y=C.useRef(null),q=C.useRef(null),[G,ee]=C.useState(null),[he,te]=C.useState(null),[ue,M]=C.useState(""),Q=C.useRef(null),[le,j]=C.useState(null),[se,ye]=C.useState(null),xe=C.useRef(null),Oe=C.useRef(null),[ae,de]=C.useState(null);C.useEffect(()=>{var J;p&&((J=U.current)==null||J.focus())},[p]),C.useEffect(()=>{var J;he&&((J=Q.current)==null||J.focus())},[he]),C.useEffect(()=>{if(!_)return;function J(Z){Y.current&&!Y.current.contains(Z.target)&&P(!1)}return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[_]),C.useEffect(()=>{if(!F)return;function J(Z){q.current&&!q.current.contains(Z.target)&&H(!1)}return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[F]),C.useEffect(()=>{if(le===null)return;function J(Z){xe.current&&!xe.current.contains(Z.target)&&j(null)}return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[le]),C.useEffect(()=>{if(se===null)return;function J(Z){Oe.current&&!Oe.current.contains(Z.target)&&ye(null)}return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[se]);const _e=Ja({mutationFn:J=>ft.createChartEvent(J),onSuccess:()=>{h.invalidateQueries({queryKey:["chartEvents"]}),Ue()}}),ke=Ja({mutationFn:J=>ft.deleteChartEvent(J),onSuccess:()=>h.invalidateQueries({queryKey:["chartEvents"]})}),Pe=Ja({mutationFn:({index:J,event:Z})=>ft.updateChartEvent(J,Z),onSuccess:()=>{h.invalidateQueries({queryKey:["chartEvents"]}),ee(null),te(null)}});function Ue(){y(!1),v(""),k(""),E(""),O(""),R(!1),I(""),P(!1),H(!1)}function et(){!D.trim()||!g.trim()||_e.mutate({date:D.trim(),label:g.trim(),...N.trim()?{description:N.trim()}:{},...T.trim()?{color:T.trim()}:{},...A&&S.trim()?{endDate:S.trim()}:{},charts:[s]})}function Ke(J){return r.findIndex(Z=>Z.date===J.date&&Z.label===J.label&&(Z.description??"")===(J.description??"")&&(Z.endDate??"")===(J.endDate??""))}function ge(J){de(J)}function me(){if(!ae)return;const J=Ke(ae);J!==-1&&(ke.mutate(J),de(null))}function fe(J){if(G===null||!he)return;const Z=Ke(J);if(Z===-1)return;const be=J[he]??"";if(ue===be){ee(null),te(null);return}Pe.mutate({index:Z,event:{...J,[he]:ue}})}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:c,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:()=>P(!_),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:D?"var(--yc-color-text)":"var(--yc-color-text-muted)"},children:D||(A?"Start date":"Select date")}),_&&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(Ka,{mode:"single",numberOfMonths:1,selected:D?ws(D,"yyyy-MM-dd",new Date):void 0,onSelect:J=>{J&&(k(on(J,"yyyy-MM-dd")),P(!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:()=>{R(!A),A&&(I(""),H(!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:()=>H(!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:S?"var(--yc-color-text)":"var(--yc-color-text-muted)"},children:S||"End date"}),F&&d.jsxs("div",{ref:q,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(Ka,{mode:"single",numberOfMonths:1,selected:S?ws(S,"yyyy-MM-dd",new Date):void 0,onSelect:J=>{J&&(I(on(J,"yyyy-MM-dd")),H(!1))}})]})]}),d.jsx("input",{ref:U,type:"text",value:g,onChange:J=>v(J.target.value),onKeyDown:J=>{J.key==="Enter"&&et(),J.key==="Escape"&&Ue()},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:N,onChange:J=>O(J.target.value),onKeyDown:J=>{J.key==="Escape"&&Ue()},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(em,{value:T,onChange:E,themePalette:f})]}),d.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[d.jsx("button",{onClick:Ue,className:"px-2 py-1 text-xs rounded",style:{color:"var(--yc-color-text-muted)"},children:"Cancel"}),d.jsx("button",{onClick:et,disabled:!D.trim()||!g.trim()||_e.isPending,className:"px-2 py-1 text-xs rounded text-white disabled:opacity-50",style:{backgroundColor:"var(--yc-color-primary, #3b82f6)"},children:_e.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((J,Z)=>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(em,{value:J.color??"",onChange:be=>{const Ne=Ke(J);Ne!==-1&&Pe.mutate({index:Ne,event:{...J,...be?{color:be}:{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:J.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:be=>{i&&(be.stopPropagation(),j(le===Z?null:Z),ye(null))},children:J.date}),le===Z&&d.jsxs("div",{ref:xe,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(Ka,{mode:"single",numberOfMonths:1,selected:(()=>{try{return ws(J.date,"yyyy-MM-dd",new Date)}catch{return}})(),defaultMonth:(()=>{try{return ws(J.date,"yyyy-MM-dd",new Date)}catch{return}})(),onSelect:be=>{if(!be)return;const Ne=on(be,"yyyy-MM-dd");if(j(null),Ne===J.date)return;const $e=Ke(J);$e!==-1&&Pe.mutate({index:$e,event:{...J,date:Ne}})}})]}),J.endDate&&d.jsxs(d.Fragment,{children:[d.jsx("span",{children:"→"}),d.jsx("span",{style:{cursor:i?"pointer":"default"},onClick:be=>{i&&(be.stopPropagation(),ye(se===Z?null:Z),j(null))},children:J.endDate}),se===Z&&d.jsxs("div",{ref:Oe,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(Ka,{mode:"single",numberOfMonths:1,selected:(()=>{try{return ws(J.endDate,"yyyy-MM-dd",new Date)}catch{return}})(),defaultMonth:(()=>{try{return ws(J.endDate,"yyyy-MM-dd",new Date)}catch{return}})(),onSelect:be=>{if(!be)return;const Ne=on(be,"yyyy-MM-dd");if(ye(null),Ne===J.endDate)return;const $e=Ke(J);$e!==-1&&Pe.mutate({index:$e,event:{...J,endDate:Ne}})}})]})]})]}),G===Z&&he==="label"?d.jsx("input",{ref:Q,type:"text",value:ue,onChange:be=>M(be.target.value),onBlur:()=>fe(J),onKeyDown:be=>{be.key==="Enter"&&fe(J),be.key==="Escape"&&(ee(null),te(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&&(ee(Z),te("label"),M(J.label))},children:J.label}),G===Z&&he==="description"?d.jsx("input",{ref:Q,type:"text",value:ue,onChange:be=>M(be.target.value),onBlur:()=>fe(J),onKeyDown:be=>{be.key==="Enter"&&fe(J),be.key==="Escape"&&(ee(null),te(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:J.description?"var(--yc-color-text-secondary)":"var(--yc-color-text-muted)",cursor:i?"pointer":"default"},onClick:()=>{i&&(ee(Z),te("description"),M(J.description??""))},children:J.description||(i?"Add description":"")}),J.charts&&J.charts.length>0&&d.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:J.charts.length===1&&J.charts[0]===s?"This chart only":`${J.charts.length} charts`})]}),i&&d.jsx("button",{onClick:()=>ge(J),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"})})})]},`${J.date}-${J.label}-${Z}`))})]})]}),d.jsx(p6,{open:ae!==null,title:"Delete event",message:`Delete "${ae==null?void 0:ae.label}"? This cannot be undone.`,onConfirm:me,onCancel:()=>de(null)})]}):null}async function g6(e,t,n="png"){const{default:r}=await Wr(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);nd(i,`${t}.${n}`)}async function x6(e,t,n){const[{default:r},{jsPDF:s}]=await Promise.all([Wr(()=>import("./html2canvas.esm-QH1iLAAe.js"),[]),Wr(()=>import("./jspdf.es.min-CpRfbJ_H.js").then(A=>A.j),[])]),i=await r(e,{backgroundColor:"#f9fafb",scale:2,useCORS:!0,logging:!1}),l=i.toDataURL("image/png"),c=i.width,f=i.height,p=c/f>1,y=new s({orientation:p?"landscape":"portrait",unit:"mm"}),g=y.internal.pageSize.getWidth(),v=y.internal.pageSize.getHeight();let D=0;n&&(D=8,y.setFontSize(16),y.text(n,g/2,D,{align:"center"}),D=14);const k=g,T=v-D;let E=k,N=f/c*E;N>T&&(N=T,E=c/f*N);const O=(g-E)/2;y.addImage(l,"PNG",O,D,E,N),y.save(`${t}.pdf`)}async function b6(e,t,n){const{jsPDF:r}=await Wr(async()=>{const{jsPDF:T}=await import("./jspdf.es.min-CpRfbJ_H.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,c=new r({orientation:l?"landscape":"portrait",unit:"mm"}),f=c.internal.pageSize.getWidth(),h=c.internal.pageSize.getHeight();let p=15;n&&(c.setFontSize(14),c.text(n,f/2,10,{align:"center"}));const y=f-20,g=h-p-15;let v=y,D=s.height/s.width*v;D>g&&(D=g,v=s.width/s.height*D);const k=(f-v)/2;c.addImage(e,"PNG",k,p,v,D),c.save(`${t}.pdf`)}function Od(e,t,n){if(e.length===0)return;const r=t.map(l=>l.name),s=e.map(l=>t.map(c=>{const f=l[c.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
|
-
`);O2(i,`${n}.csv`,"text/csv;charset=utf-8;")}function v6(e,t){const n=JSON.stringify(e,null,2);O2(n,`${t}.json`,"application/json;charset=utf-8;")}function nd(e,t){const n=document.createElement("a");n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function O2(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 Ga=50;function A2({data:e,columns:t,drillDownColumns:n,filterDisplay:r,chartName:s}){const[i,l]=C.useState(null),[c,f]=C.useState(0),h=C.useMemo(()=>n&&n.length>0?n.map(N=>({field:N.field,label:N.label??N.field,format:N.format})):t.map(N=>({field:N.name,label:N.name,format:void 0})),[n,t]),p=C.useMemo(()=>{if(!i)return e;const{field:N,direction:O}=i;return[...e].sort((A,R)=>{const S=A[N],I=R[N];if(S==null&&I==null)return 0;if(S==null)return 1;if(I==null)return-1;if(typeof S=="number"&&typeof I=="number")return O==="asc"?S-I:I-S;const _=String(S),P=String(I);return O==="asc"?_.localeCompare(P):P.localeCompare(_)})},[e,i]),y=Math.ceil(p.length/Ga),g=p.slice(c*Ga,(c+1)*Ga),v=c*Ga+1,D=Math.min((c+1)*Ga,p.length),k=N=>{l(O=>!O||O.field!==N?{field:N,direction:"asc"}:O.direction==="asc"?{field:N,direction:"desc"}:null),f(0)},T=(N,O)=>N==null?"":O&&typeof N=="number"?O.includes("$")?`$${N.toLocaleString()}`:O.includes("%")?`${N.toFixed(1)}%`:N.toLocaleString():String(N),E=N=>!i||i.field!==N?"":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:()=>Od(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:()=>v6(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(N=>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:()=>k(N.field),children:[N.label,E(N.field)]},N.field))]})}),d.jsx("tbody",{children:g.map((N,O)=>d.jsxs("tr",{style:{backgroundColor:O%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:O%2===0?"var(--yc-color-surface)":"var(--yc-color-input-bg)"},children:c*Ga+O+1}),h.map(A=>d.jsx("td",{className:"px-4 py-2",style:{color:"var(--yc-color-text-secondary)"},children:T(N[A.field],A.format)},A.field))]},O))})]})}),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 ",v,"-",D," of ",p.length]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>f(N=>Math.max(0,N-1)),disabled:c===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(N=>Math.min(y-1,N+1)),disabled:c>=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 rd extends C.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 E6(e,t){return e.length<=t?e:e.slice(0,t)+"..."}function T6(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 Ad(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 c=n.indexOf(t);if(i===-1&&(i=0),l===-1&&(l=n.length-1),c!==-1)return c>=i&&c<=l}return!1});return r.length===0?"":r.map(s=>{const i=s.color??"#6366f1",l=s.endDate?`${s.date} → ${s.endDate}`:"",c=s.description?E6(s.description,100):"",f=c?`<div style="font-size: 11px; color: #888; margin-top: 2px;">${T6(c)}</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 Id(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 Md(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 c=l.date,f=l.endDate;if(n&&n.length>0&&s&&i){const p=n.indexOf(c),y=n.indexOf(f);p===-1&&(c=s),y===-1&&(f=i);const g=n.indexOf(c),v=n.indexOf(f);if(g>v)return[]}const h=l.color??t;return[[{xAxis:c,itemStyle:{color:h,opacity:.1},label:{show:!0,formatter:l.label,position:"insideTop",fontSize:11,color:h,padding:[2,6]}},{xAxis:f}]]})}const Zm="#22c55e",I2="dashed";function w6(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e.toLocaleString()}function M2(e){return e.type==="fixed"}function k6(e){return e.type==="cumulative"}function S6(e){return e.type==="model"}function Ld(e,t){const n=[];for(const r of e){const s=r.color??Zm,i=r.style??I2;if(M2(r)){const l=w6(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(k6(r)){const l=r.from?t.indexOf(r.from):0,c=r.by?t.indexOf(r.by):t.length-1,f=Math.max(0,l===-1?0:l),h=c===-1?t.length-1:c;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 Rd(e,t){const n=[];for(const r of e){if(!r.zone)continue;const s=r.color??Zm;if(M2(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 Pd(e,t){const n=[];for(const r of e){if(!S6(r)||!t)continue;const s=r.color??Zm,i=r.style??I2,l=t.rows.map(c=>{const f=c[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 sd="#22c55e",od="#ef4444";function L2(e){return e.type==="fixed"}function R2(e){return e.type==="cumulative"}function C6(e,t){const n=t.find(L2);return n?e>=n.value?sd:od:null}function N6(e,t,n,r){const s=r.find(R2);if(!s||n===0)return null;const i=s.value/n*(t+1);return e>=i?sd:od}function _6(e,t){const n=t.find(L2);if(n)return e.map(s=>({value:s,itemStyle:{color:s>=n.value?sd:od}}));const r=t.find(R2);if(r){const s=e.length;return e.map((i,l)=>{const c=r.value/s*(l+1);return{value:i,itemStyle:{color:i>=c?sd:od}}})}return e}function P2(e,t){if(e.length===0||t.length===0)return null;const n=e[e.length-1],r=C6(n,t);return r||N6(n,e.length-1,e.length,t)}function D6(e){return"field"in e}function O6(e){return"columns"in e}function a0(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]=r===0?0:(s.data[n]??0)/r*100}return e}function jd(e,t,n){var s,i;const r=t.stacking?"total":void 0;if(!t.series){const l=((s=t.y)==null?void 0:s.field)??"",c=e.map(h=>{const p=h[l];return typeof p=="number"?p:parseFloat(String(p))||0}),f=[{name:l,data:c,color:bi(0,void 0,n),stack:r}];return t.stacking==="percent"?a0(f):f}if(D6(t.series)){const l=t.series.field,c=t.series.colors,f=((i=t.y)==null?void 0:i.field)??"",h=[],p=new Map;e.forEach(g=>{const v=String(g[l]??"");p.has(v)||(h.push(v),p.set(v,[]));const D=g[f];p.get(v).push(typeof D=="number"?D:parseFloat(String(D))||0)});const y=h.map((g,v)=>({name:g,data:p.get(g),color:dO(g,v,c,n),stack:r}));return t.stacking==="percent"?a0(y):y}if(O6(t.series)){const l=t.series.columns.map((c,f)=>{const h=e.map(p=>{const y=p[c.field];return typeof y=="number"?y:parseFloat(String(y))||0});return{name:c.name??c.field,data:h,color:bi(f,c.color,n),opacity:c.opacity,style:c.style,gradient:c.gradient,stack:r,chartType:c.type,yAxisIndex:c.axis==="right"?1:c.axis==="left"?0:void 0}});return t.stacking==="percent"?a0(l):l}return[]}function ad(e){const t=e.match(/^(\d{4}-\d{2}-\d{2})T00:00:00(?:\.0+)?(?:Z|[+-]00:?00)?$/);return x1(t?t[1]:e)}function A6(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 j2(e){const t=Math.floor(e.getMonth()/3)+1,n=e.getFullYear().toString().slice(-2);return`Q${t} '${n}`}function I6(e){if(e.length<2)return"MMM dd, yyyy";const t=e.map(c=>c.getTime()).sort((c,f)=>c-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 M6(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 Fd(e,t){const n=new Set,r=e.filter(l=>{const c=l[t.field];return n.has(c)?!1:(n.add(c),!0)});if(t.type!=="temporal")return r.map(l=>String(l[t.field]??""));const s=[];for(const l of r){const c=l[t.field];if(typeof c=="string")try{s.push(ad(c))}catch{}}const i=s.length>0?M6(s):"MMM dd, yyyy";return r.map(l=>{const c=l[t.field];if(typeof c=="string")try{const f=ad(c);return t.format==="quarter"?j2(f):on(f,i)}catch{return String(c??"")}return String(c??"")})}function Bd(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 Rs(r,t)}function Rs(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(ad(i))}catch{}}r.length>0&&(n=I6(r))}return e.map(r=>{const s=r[t.field];if(t.type==="temporal"&&typeof s=="string")try{const i=ad(s);if(t.format==="quarter")return j2(i);const l=t.format?A6(t.format):n??"MMM yyyy";return on(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 L6(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 Hd(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=L6(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 Ps(e){return((e==null?void 0:e.base)??"modern")==="modern"?{smooth:!0,barBorderRadius:[4,4,0,0],pieBorderRadius:4}:{smooth:!1,barBorderRadius:[0,0,0,0],pieBorderRadius:0}}const F2=C.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:s,theme:i,height:l=400,loading:c=!1,onChartClick:f,events:h,goalData:p},y){var H,U,Y,q,G,ee,he,te;const g=$r(),v=(s==null?void 0:s.series)&&"field"in s.series,D=v?Bd(t,n):Rs(t,n),k=n.type==="temporal"?Fd(t,n):D,T=C.useMemo(()=>{if(v){const ue=new Set;return t.filter(M=>{const Q=M[n.field];return ue.has(Q)?!1:(ue.add(Q),!0)}).map(M=>M[n.field])}return t.map(ue=>ue[n.field])},[t,n.field,v]),E=C.useMemo(()=>{if(f)return{click:ue=>{var ye,xe,Oe,ae;const M=ue;if(M.componentType!=="series")return;const Q=M.dataIndex!=null?T[M.dataIndex]:void 0,le=Q!=null?String(Q):M.name;if(le==null||le==="")return;const j=((xe=(ye=M.event)==null?void 0:ye.event)==null?void 0:xe.clientX)??0,se=((ae=(Oe=M.event)==null?void 0:Oe.event)==null?void 0:ae.clientY)??0;f(n.field,le,{x:j,y:se},M.seriesName)}}},[f,n.field,T]);let N,O,A;if(s){const ue=jd(t,{type:s.type,y:r?{field:r.field,type:r.type}:void 0,series:s.series,stacking:s.stacking},i),M=Ps(i);N=ue.map(Q=>{const le=Hd(Q.color,Q.gradient??s.gradient);return{type:"line",name:Q.name,data:Q.data,smooth:M.smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:Q.color,type:Q.style==="dashed"?"dashed":Q.style==="dotted"?"dotted":"solid"},itemStyle:{color:Q.color},areaStyle:le?{color:le}:void 0,stack:Q.stack,...Q.opacity!==void 0?{opacity:Q.opacity}:{}}}),ue.length>1&&(O={show:((H=s.legend)==null?void 0:H.show)!==!1,...((U=s.legend)==null?void 0:U.position)==="top"?{top:0}:((Y=s.legend)==null?void 0:Y.position)==="left"?{left:0,orient:"vertical"}:((q=s.legend)==null?void 0:q.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:g.textColor,fontSize:12}}),(G=s.interactions)!=null&&G.zoom&&(A=[{type:"inside",start:0,end:100},{type:"slider",start:0,end:100,bottom:0}])}else{const ue=(r==null?void 0:r.field)??"";N=[{type:"line",data:t.map(Q=>{const le=Q[ue];return typeof le=="number"?le:parseFloat(String(le))||0}),smooth:Ps(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 R=(s==null?void 0:s.goals)??[];if(R.length>0&&Array.isArray(N)){const ue=P2(((ee=N[0])==null?void 0:ee.data)??[],R);ue&&N[0]&&(N[0].lineStyle={...N[0].lineStyle,color:ue},N[0].itemStyle={color:ue});const M=Ld(R,D),Q=Rd(R);if(M.length>0&&N[0]){const j=N[0].markLine,se=(j==null?void 0:j.data)??[];N[0].markLine={...j,silent:!0,symbol:"none",data:[...se,...M]}}Q.length>0&&N[0]&&(N[0].markArea={silent:!0,data:Q});const le=Pd(R,p);for(const j of le)N.push({type:"line",name:j.name,data:j.data,z:j.z,showSymbol:j.showSymbol,lineStyle:j.lineStyle,itemStyle:{color:j.color}})}const S=C.useMemo(()=>{if(!(h!=null&&h.length))return[];const M=h.flatMap(se=>se.endDate?[se.date,se.endDate]:[se.date]).map(se=>({[n.field]:se})),le=Rs([...t,...M],n).slice(t.length);let j=0;return h.map(se=>{const ye={...se,date:le[j++]??se.date};return se.endDate&&(ye.endDate=le[j++]??se.endDate),ye})},[h,t,n]),I=Array.isArray(N)?N.map(ue=>ue.name).filter(Boolean):[],_=Id(S,g.textColor,D),P=Md(S,g.textColor,D);if((_||P.length>0)&&Array.isArray(N)){const ue={type:"line",data:((he=N[0])==null?void 0:he.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};_&&(ue.markLine=_),P.length>0&&(ue.markArea={silent:!0,data:P}),N.push(ue)}const F={tooltip:{trigger:"axis",formatter:ue=>{const M=ue;if(!Array.isArray(M)||M.length===0)return"";let le=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${k[M[0].dataIndex]??M[0].name}</div>`;for(const j of M)le+=`<div>${j.marker} ${j.seriesName}: ${ko(j.value,r==null?void 0:r.format)}</div>`;return le+=Ad(S,M[0].name,D),le+="</div>",le}},legend:O?{...O,...I.length>0?{data:I}:{}}:void 0,grid:{left:"3%",right:"4%",bottom:"10%",top:"10%",containLabel:!0},xAxis:{type:"category",data:D,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:((te=s==null?void 0:s.y)==null?void 0:te.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:g.textColor,fontSize:12},axisLabel:{color:g.textColor,fontSize:12,formatter:ue=>ko(ue,r==null?void 0:r.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:g.splitLineColor,type:"dashed"}}},series:N,...A?{dataZoom:A}:{},animation:!0,animationDuration:300};return d.jsx(Dr,{ref:y,option:F,height:l,loading:c,onEvents:E})}),B2=C.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:s,theme:i,height:l=400,loading:c=!1,horizontal:f=!1,onChartClick:h,activeCrossFilter:p,events:y,goalData:g},v){var he,te,ue,M,Q,le,j;const D=$r(),k=(s==null?void 0:s.series)&&"field"in s.series,T=k?Bd(t,n):Rs(t,n),E=n.type==="temporal"?Fd(t,n):T,N=(p==null?void 0:p.field)===n.field,O=f||(s==null?void 0:s.orientation)==="horizontal",A=C.useMemo(()=>{if(k){const se=new Set;return t.filter(ye=>{const xe=ye[n.field];return se.has(xe)?!1:(se.add(xe),!0)}).map(ye=>ye[n.field])}return t.map(se=>se[n.field])},[t,n.field,k]),R=C.useMemo(()=>{if(h)return{click:se=>{var _e,ke,Pe,Ue;const ye=se;if(ye.componentType!=="series")return;const xe=ye.dataIndex!=null?A[ye.dataIndex]:void 0,Oe=xe!=null?String(xe):ye.name;if(Oe==null||Oe==="")return;const ae=((ke=(_e=ye.event)==null?void 0:_e.event)==null?void 0:ke.clientX)??0,de=((Ue=(Pe=ye.event)==null?void 0:Pe.event)==null?void 0:Ue.clientY)??0;h(n.field,Oe,{x:ae,y:de},ye.seriesName)}}},[h,n.field,A]),S=(s==null?void 0:s.stacking)==="percent",I=se=>S?`${se.toFixed(1)}%`:ko(se,r==null?void 0:r.format);let _,P=!1;if(s){const se=jd(t,{type:s.type,y:r?{field:r.field,type:r.type}:void 0,series:s.series,stacking:s.stacking},i),ye=se.length>1,xe=!!s.stacking;P=ye;const Oe=Ps(i);_=se.map((ae,de)=>{const _e=Hd(ae.color,ae.gradient??s.gradient),ke=xe&&de===se.length-1,Pe=xe?ke?Oe.barBorderRadius:[0,0,0,0]:Oe.barBorderRadius;return{type:"bar",name:ae.name,data:N?ae.data.map((Ue,et)=>({value:Ue,itemStyle:{opacity:String(A[et])===(p==null?void 0:p.value)?1:.3}})):ae.data,barWidth:ye&&!xe?void 0:"60%",barMinHeight:2,itemStyle:{color:_e??ae.color,borderRadius:Pe},stack:ae.stack,...ae.opacity!==void 0?{opacity:ae.opacity}:{}}})}else{const se=(r==null?void 0:r.field)??"",ye=t.map(Oe=>{const ae=Oe[se];return typeof ae=="number"?ae:parseFloat(String(ae))||0}),xe=Ps(i);_=[{type:"bar",data:N?ye.map((Oe,ae)=>({value:Oe,itemStyle:{opacity:String(A[ae])===(p==null?void 0:p.value)?1:.3}})):ye,barWidth:"60%",barMinHeight:2,itemStyle:{color:"#3B82F6",borderRadius:xe.barBorderRadius},emphasis:{itemStyle:{color:"#2563EB"}}}]}const F=(s==null?void 0:s.goals)??[];if(F.length>0&&Array.isArray(_)&&!O){if(_[0]){const ae=_[0].data.map(_e=>typeof _e=="number"?_e:_e.value),de=_6(ae,F);_[0].data=de}const se=Ld(F,T),ye=Rd(F);se.length>0&&_[0]&&(_[0].markLine={silent:!0,symbol:"none",data:se}),ye.length>0&&_[0]&&(_[0].markArea={silent:!0,data:ye});const xe=Pd(F,g);for(const Oe of xe)_.push({type:"line",name:Oe.name,data:Oe.data,z:Oe.z,showSymbol:Oe.showSymbol,lineStyle:Oe.lineStyle,itemStyle:{color:Oe.color}})}const H=C.useMemo(()=>{if(!(y!=null&&y.length))return[];const ye=y.flatMap(de=>de.endDate?[de.date,de.endDate]:[de.date]).map(de=>({[n.field]:de})),Oe=Rs([...t,...ye],n).slice(t.length);let ae=0;return y.map(de=>{const _e={...de,date:Oe[ae++]??de.date};return de.endDate&&(_e.endDate=Oe[ae++]??de.endDate),_e})},[y,t,n]),U=Array.isArray(_)?_.map(se=>se.name).filter(Boolean):[],Y=Id(H,D.textColor,T),q=Md(H,D.textColor,T);if((Y||q.length>0)&&Array.isArray(_)){const se={type:"line",data:((he=_[0])==null?void 0:he.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};Y&&(se.markLine=Y),q.length>0&&(se.markArea={silent:!0,data:q}),_.push(se)}const ee={tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:se=>{const ye=se;if(!Array.isArray(ye)||ye.length===0)return"";const xe=E[ye[0].dataIndex]??ye[0].name,Oe=Ad(H,ye[0].name,T);if(ye.length===1){const de=ye[0];return`
|
|
95
|
-
<div style="padding: 8px;">
|
|
96
|
-
<div style="font-weight: 600; margin-bottom: 4px;">${xe}</div>
|
|
97
|
-
<div>${de.marker} ${(r==null?void 0:r.label)||(r==null?void 0:r.field)||de.seriesName}: ${I(de.value)}</div>
|
|
98
|
-
${Oe}
|
|
99
|
-
</div>
|
|
100
|
-
`}const ae=ye.map(de=>`<div>${de.marker} ${de.seriesName}: ${I(de.value)}</div>`).join("");return`
|
|
101
|
-
<div style="padding: 8px;">
|
|
102
|
-
<div style="font-weight: 600; margin-bottom: 4px;">${xe}</div>
|
|
103
|
-
${ae}
|
|
104
|
-
${Oe}
|
|
105
|
-
</div>
|
|
106
|
-
`}},legend:P?{show:((te=s==null?void 0:s.legend)==null?void 0:te.show)!==!1,...((ue=s==null?void 0:s.legend)==null?void 0:ue.position)==="top"?{top:0}:((M=s==null?void 0:s.legend)==null?void 0:M.position)==="left"?{left:0,orient:"vertical"}:((Q=s==null?void 0:s.legend)==null?void 0:Q.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:D.textColor,fontSize:12},...U.length>0?{data:U}:{}}:void 0,grid:{left:"3%",right:"4%",bottom:P?"15%":"10%",top:"10%",containLabel:!0},xAxis:O?{type:((le=s==null?void 0:s.y)==null?void 0:le.scale)==="log"?"log":"value",axisLabel:{color:D.textColor,fontSize:12,formatter:se=>I(se)},axisLine:{show:!1},splitLine:{lineStyle:{color:D.splitLineColor,type:"dashed"}}}:{type:"category",data:T,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:D.textColor,fontSize:12},axisLabel:{color:D.textColor,fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:D.borderColor}},axisTick:{show:!1}},yAxis:O?{type:"category",data:T,axisLabel:{color:D.textColor,fontSize:12},axisLine:{show:!1},axisTick:{show:!1}}:{type:((j=s==null?void 0:s.y)==null?void 0:j.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:D.textColor,fontSize:12},...S?{max:100}:{},axisLabel:{color:D.textColor,fontSize:12,formatter:se=>I(se)},axisLine:{show:!1},splitLine:{lineStyle:{color:D.splitLineColor,type:"dashed"}}},series:_,animation:!0,animationDuration:300};return d.jsx(Dr,{ref:v,option:ee,height:l,loading:c,onEvents:R})}),H2=C.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:s,theme:i,height:l=400,loading:c=!1,onChartClick:f,events:h,goalData:p},y){var U,Y,q,G,ee,he,te,ue;const g=$r(),v=(s==null?void 0:s.series)&&"field"in s.series,D=v?Bd(t,n):Rs(t,n),k=n.type==="temporal"?Fd(t,n):D,T=(s==null?void 0:s.stacking)==="percent",E=C.useMemo(()=>{if(v){const M=new Set;return t.filter(Q=>{const le=Q[n.field];return M.has(le)?!1:(M.add(le),!0)}).map(Q=>Q[n.field])}return t.map(M=>M[n.field])},[t,n.field,v]),N=C.useMemo(()=>{if(f)return{click:M=>{var xe,Oe,ae,de;const Q=M;if(Q.componentType!=="series")return;const le=Q.dataIndex!=null?E[Q.dataIndex]:void 0,j=le!=null?String(le):Q.name;if(j==null||j==="")return;const se=((Oe=(xe=Q.event)==null?void 0:xe.event)==null?void 0:Oe.clientX)??0,ye=((de=(ae=Q.event)==null?void 0:ae.event)==null?void 0:de.clientY)??0;f(n.field,j,{x:se,y:ye},Q.seriesName)}}},[f,n.field,E]);let O,A,R;if(s){const M=jd(t,{type:s.type,y:r?{field:r.field,type:r.type}:void 0,series:s.series,stacking:s.stacking},i),Q=Ps(i);O=M.map(le=>{const j=Hd(le.color,le.gradient??s.gradient??!0);return{type:"line",name:le.name,data:le.data,smooth:Q.smooth,symbol:"none",lineStyle:{width:2,color:le.color,type:le.style==="dashed"?"dashed":le.style==="dotted"?"dotted":"solid"},itemStyle:{color:le.color},areaStyle:{color:j??le.color},stack:le.stack,...le.opacity!==void 0?{opacity:le.opacity}:{}}}),M.length>1&&(A={show:((U=s.legend)==null?void 0:U.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"}:((G=s.legend)==null?void 0:G.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:g.textColor,fontSize:12}}),(ee=s.interactions)!=null&&ee.zoom&&(R=[{type:"inside",start:0,end:100},{type:"slider",start:0,end:100,bottom:0}])}else{const M=(r==null?void 0:r.field)??"";O=[{type:"line",data:t.map(le=>{const j=le[M];return typeof j=="number"?j:parseFloat(String(j))||0}),smooth:Ps(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 S=(s==null?void 0:s.goals)??[];if(S.length>0&&Array.isArray(O)){const M=P2(((he=O[0])==null?void 0:he.data)??[],S);M&&O[0]&&(O[0].lineStyle={...O[0].lineStyle,color:M},O[0].itemStyle={color:M});const Q=Ld(S,D),le=Rd(S);if(Q.length>0&&O[0]){const se=O[0].markLine,ye=(se==null?void 0:se.data)??[];O[0].markLine={...se,silent:!0,symbol:"none",data:[...ye,...Q]}}le.length>0&&O[0]&&(O[0].markArea={silent:!0,data:le});const j=Pd(S,p);for(const se of j)O.push({type:"line",name:se.name,data:se.data,z:se.z,showSymbol:se.showSymbol,lineStyle:se.lineStyle,itemStyle:{color:se.color}})}const I=C.useMemo(()=>{if(!(h!=null&&h.length))return[];const Q=h.flatMap(ye=>ye.endDate?[ye.date,ye.endDate]:[ye.date]).map(ye=>({[n.field]:ye})),j=Rs([...t,...Q],n).slice(t.length);let se=0;return h.map(ye=>{const xe={...ye,date:j[se++]??ye.date};return ye.endDate&&(xe.endDate=j[se++]??ye.endDate),xe})},[h,t,n]),_=Array.isArray(O)?O.map(M=>M.name).filter(Boolean):[],P=Id(I,g.textColor,D),F=Md(I,g.textColor,D);if((P||F.length>0)&&Array.isArray(O)){const M={type:"line",data:((te=O[0])==null?void 0:te.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};P&&(M.markLine=P),F.length>0&&(M.markArea={silent:!0,data:F}),O.push(M)}const H={tooltip:{trigger:"axis",formatter:M=>{const Q=M;if(!Array.isArray(Q)||Q.length===0)return"";let j=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${k[Q[0].dataIndex]??Q[0].name}</div>`;for(const se of Q){const ye=T?`${se.value.toFixed(1)}%`:ko(se.value,r==null?void 0:r.format);j+=`<div>${se.marker} ${se.seriesName}: ${ye}</div>`}return j+=Ad(I,Q[0].name,D),j+="</div>",j}},legend:A?{...A,..._.length>0?{data:_}:{}}:void 0,grid:{left:"3%",right:"4%",bottom:"10%",top:"10%",containLabel:!0},xAxis:{type:"category",data:D,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:((ue=s==null?void 0:s.y)==null?void 0:ue.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:M=>T?`${M}%`:ko(M,r==null?void 0:r.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:g.splitLineColor,type:"dashed"}}},series:O,...R?{dataZoom:R}:{},animation:!0,animationDuration:300};return d.jsx(Dr,{ref:y,option:H,height:l,loading:c,onEvents:N})}),U2=C.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:s,theme:i,height:l=400,loading:c=!1,onChartClick:f,activeCrossFilter:h},p){var N,O,A,R;const y=$r(),g=(h==null?void 0:h.field)===n.field,v=C.useMemo(()=>t.map(S=>S[n.field]),[t,n.field]),D=C.useMemo(()=>{if(f)return{click:S=>{var U,Y,q,G;const I=S;if(I.componentType!=="series")return;const _=I.dataIndex!=null?v[I.dataIndex]:void 0,P=_!=null?String(_):I.name;if(P==null||P==="")return;const F=((Y=(U=I.event)==null?void 0:U.event)==null?void 0:Y.clientX)??0,H=((G=(q=I.event)==null?void 0:q.event)==null?void 0:G.clientY)??0;f(n.field,P,{x:F,y:H})}}},[f,n.field,v]),k=t.map((S,I)=>{const _=S[r.field],P=typeof _=="number"?_:parseFloat(String(_))||0;return{name:String(S[n.field]??""),value:P,itemStyle:{color:bi(I,void 0,i)}}}),T=S=>{if(r.format){if(r.format.includes("$"))return`$${S.toLocaleString()}`;if(r.format.includes("%"))return`${S.toFixed(1)}%`}return S.toLocaleString()},E={tooltip:{trigger:"item",formatter:S=>{const I=S;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:((N=s==null?void 0:s.legend)==null?void 0:N.show)!==!1,type:"scroll",...((O=s==null?void 0:s.legend)==null?void 0:O.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"}:((R=s==null?void 0:s.legend)==null?void 0:R.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:Ps(i).pieBorderRadius,borderColor:y.surfaceColor,borderWidth:2},label:{show:!1},emphasis:{label:{show:!0,fontSize:14,fontWeight:"bold"}},labelLine:{show:!1},data:k.map(S=>({...S,itemStyle:{...S.itemStyle,...g&&(h==null?void 0:h.value)!==S.name?{opacity:.3}:{}}}))}],animation:!0,animationDuration:300};return d.jsx(Dr,{ref:p,option:E,height:l,loading:c,onEvents:D})}),z2=C.forwardRef(function({data:t,xAxis:n,yAxis:r,centerValue:s,chartConfig:i,theme:l,height:c=400,loading:f=!1,onChartClick:h,activeCrossFilter:p},y){var R,S,I,_,P;const g=$r(),v=(p==null?void 0:p.field)===n.field,D=C.useMemo(()=>t.map(F=>F[n.field]),[t,n.field]),k=C.useMemo(()=>{if(h)return{click:F=>{var ee,he,te,ue;const H=F;if(H.componentType!=="series")return;const U=H.dataIndex!=null?D[H.dataIndex]:void 0,Y=U!=null?String(U):H.name;if(Y==null||Y==="")return;const q=((he=(ee=H.event)==null?void 0:ee.event)==null?void 0:he.clientX)??0,G=((ue=(te=H.event)==null?void 0:te.event)==null?void 0:ue.clientY)??0;h(n.field,Y,{x:q,y:G})}}},[h,n.field,D]),T=t.map((F,H)=>{const U=F[r.field],Y=typeof U=="number"?U:parseFloat(String(U))||0;return{name:String(F[n.field]??""),value:Y,itemStyle:{color:bi(H,void 0,l)}}});let E=null;if(s)if(s.field==="total"||!s.field)E=T.reduce((F,H)=>F+H.value,0);else{const F=(R=t[0])==null?void 0:R[s.field];E=typeof F=="number"?F:parseFloat(String(F))||null}const N=(F,H)=>{if(H){if(H.includes("$"))return`$${F.toLocaleString()}`;if(H.includes("%"))return`${F.toFixed(1)}%`}return F.toLocaleString()},O=E!==null?s!=null&&s.label?`{value|${N(E,(s==null?void 0:s.format)||r.format)}}
|
|
113
|
-
{label|${s.label}}`:`{value|${N(E,(s==null?void 0:s.format)||r.format)}}`:"",A={tooltip:{trigger:"item",formatter:F=>{const H=F;return`
|
|
114
|
-
<div style="padding: 8px;">
|
|
115
|
-
<div style="font-weight: 600; margin-bottom: 4px;">${H.name}</div>
|
|
116
|
-
<div>${H.marker} ${r.label||r.field}: ${N(H.value,r.format)}</div>
|
|
117
|
-
<div style="color: ${g.textColor}; font-size: 12px;">${H.percent.toFixed(1)}%</div>
|
|
118
|
-
</div>
|
|
119
|
-
`}},legend:{show:((S=i==null?void 0:i.legend)==null?void 0:S.show)!==!1,type:"scroll",...((I=i==null?void 0:i.legend)==null?void 0:I.position)==="top"?{top:0,orient:"horizontal",left:"center"}:((_=i==null?void 0:i.legend)==null?void 0:_.position)==="bottom"?{bottom:0,orient:"horizontal",left:"center"}:((P=i==null?void 0:i.legend)==null?void 0:P.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:Ps(l).pieBorderRadius,borderColor:g.surfaceColor,borderWidth:2},label:{show:E!==null,position:"center",formatter:O,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,...v&&(p==null?void 0:p.value)!==F.name?{opacity:.3}:{}}}))}],animation:!0,animationDuration:300};return d.jsx(Dr,{ref:y,option:A,height:c,loading:f,onEvents:k})}),R6=5,P6=50;function i0(e){if(e==null)return null;const t=typeof e=="number"?e:parseFloat(String(e));return isNaN(t)?null:t}function j6(e,t,n,r,s){return n===t?(r+s)/2:r+(e-t)/(n-t)*(s-r)}function F6(e,t,n,r){const{size:s,group:i}=r,l=(s==null?void 0:s.min)??R6,c=(s==null?void 0:s.max)??P6,f=[];for(const v of e){const D=i0(v[t]),k=i0(v[n]);if(D===null||k===null)continue;let T=null;if(s&&(T=i0(v[s.field]),T===null))continue;const E=i?String(v[i.field]??"Other"):"data";f.push({x:D,y:k,sizeVal:T,groupVal:E})}let h=1/0,p=-1/0;if(s){for(const v of f)v.sizeVal!==null&&(h=Math.min(h,v.sizeVal),p=Math.max(p,v.sizeVal));isFinite(h)||(h=0,p=0)}const y=new Map;for(const v of f){const D=y.get(v.groupVal);D?D.push(v):y.set(v.groupVal,[v])}if(y.size===0)return{series:[{name:"data",data:[],symbolSizes:s?[]:void 0}]};const g=[];for(const[v,D]of y){const k=[],T=[];for(const E of D)s&&E.sizeVal!==null?(k.push([E.x,E.y,E.sizeVal]),T.push(j6(E.sizeVal,h,p,l,c))):k.push([E.x,E.y]);g.push({name:v,data:k,symbolSizes:s?T:void 0})}return{series:g}}function B6(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 c=(t*s-n*r)/l,f=(r-c*n)/t,h=r/t;let p=0,y=0;for(const[T,E]of e){const N=c*T+f;p+=(E-N)**2,y+=(E-h)**2}const g=y===0?1:1-p/y,v=e.map(([T])=>T),D=Math.min(...v),k=Math.max(...v);return{slope:c,intercept:f,rSquared:g,line:[[D,c*D+f],[k,c*k+f]]}}const W2=C.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:s,theme:i,height:l=400,loading:c=!1,onChartClick:f,activeCrossFilter:h},p){const y=$r(),g=C.useMemo(()=>{var R,S,I;const D={size:s==null?void 0:s.size,group:s==null?void 0:s.group},{series:k}=F6(t,n.field,r.field,D),T=(_,P)=>{if(P.format){if(P.format.includes("$"))return`$${_.toLocaleString()}`;if(P.format.includes("%"))return`${_.toFixed(1)}%`}return _.toLocaleString()},E=[],N=[];k.forEach((_,P)=>{const F=bi(P,k.length===1&&typeof(s==null?void 0:s.color)=="string"?s.color:void 0,i),H=_.symbolSizes;if(E.push({type:"scatter",name:_.name,data:_.data,symbolSize:H?(U,Y)=>H[Y.dataIndex]??10:10,itemStyle:{color:F},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.3)"}}}),s!=null&&s.regression&&_.data.length>=2){const U=_.data.map(q=>[q[0],q[1]]),Y=B6(U);if(Y){E.push({type:"line",name:`${_.name} trend`,data:Y.line,showSymbol:!1,lineStyle:{color:F,type:"dashed",opacity:.6,width:2},itemStyle:{color:F},tooltip:{show:!1},silent:!0});const q=[];if(s.regression.show_equation){const G=Y.intercept>=0?"+":"-";q.push(`y = ${Y.slope.toFixed(2)}x ${G} ${Math.abs(Y.intercept).toFixed(2)}`)}if(s.regression.show_r_squared&&q.push(`R² = ${Y.rSquared.toFixed(3)}`),q.length>0){const G=P*20;N.push({type:"text",left:"70%",top:`${12+G}%`,style:{text:q.join(" "),fill:F,fontSize:11,fontFamily:"monospace"}})}}}});const O=((R=s==null?void 0:s.size)==null?void 0:R.label)??((S=s==null?void 0:s.size)==null?void 0:S.field);return{tooltip:{trigger:"item",formatter:_=>{const P=_,F=P.value[0]??0,H=P.value[1]??0,U=P.value[2];let Y='<div style="padding: 8px;">';return k.length>1&&(Y+=`<div style="font-weight: 600; margin-bottom: 4px;">${P.seriesName}</div>`),Y+=`<div>${P.marker} ${n.label||n.field}: ${T(F,n)}</div>`,Y+=`<div>${P.marker} ${r.label||r.field}: ${T(H,r)}</div>`,O&&U!=null&&(Y+=`<div>${P.marker} ${O}: ${U.toLocaleString()}</div>`),Y+="</div>",Y}},legend:k.length>1?{show:((I=s==null?void 0:s.legend)==null?void 0:I.show)!==!1,top:0,data:k.map(_=>_.name)}:void 0,grid:{left:"3%",right:"4%",bottom:"3%",top:k.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:_=>T(_,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:_=>T(_,r)},axisLine:{show:!1},splitLine:{lineStyle:{color:y.splitLineColor,type:"dashed"}}},series:E,graphic:N.length>0?N:void 0,animation:!0,animationDuration:300}},[t,n,r,s,i,y]),v=C.useMemo(()=>{if(f)return{click:D=>{var O,A,R,S,I;const k=D;if(k.componentType!=="series")return;const T=(O=k.value)==null?void 0:O[0];if(T==null)return;const E=((R=(A=k.event)==null?void 0:A.event)==null?void 0:R.clientX)??0,N=((I=(S=k.event)==null?void 0:S.event)==null?void 0:I.clientY)??0;f(n.field,String(T),{x:E,y:N},k.seriesName)}}},[f,n.field]);return d.jsx(Dr,{ref:p,option:g,height:l,loading:c,onEvents:v})});var Di=md();function l0(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 H6(e,t){return t.map(n=>String(e[n]??"")).join("\0")}function U6(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),c=[...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 v=new Map;for(const T of g){const E=l.length>0?H6(T,l):"";v.has(E)||v.set(E,[]),v.get(E).push(T)}const D=[];for(const[,T]of v){const E={};for(const O of l)E[O]=String(T[0][O]??"");const N={};for(const O of s){const A=O.aggregate??"sum";for(const R of c){const S=`${O.field}:${R}`,_=T.filter(P=>String(P[r]??"")===R).map(P=>P[O.field]).filter(P=>typeof P=="number");N[S]=_.length>0?l0(_,A):null}}D.push({labels:E,values:N})}l.length>0&&D.sort((T,E)=>{const N=T.labels[l[0]]??"",O=E.labels[l[0]]??"";return N.localeCompare(O)});const k={};for(const T of s){const E=T.aggregate??"sum";for(const N of c){const O=`${T.field}:${N}`,A=D.map(R=>R.values[O]).filter(R=>R!==null);A.length>0&&(k[O]=E==="avg"?A.reduce((R,S)=>R+S,0)/A.length:l0(A,E))}}h.push({key:y,rows:D,subtotals:k})}const p={};for(const y of s){const g=y.aggregate??"sum";for(const v of c){const D=`${y.field}:${v}`,k=h.map(T=>T.subtotals[D]).filter(T=>T!==void 0);k.length>0&&(p[D]=g==="avg"?k.reduce((T,E)=>T+E,0)/k.length:l0(k,g))}}return{columnValues:c,groups:h,grandTotals:p}}function z6(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,c=r.replace("#",""),f=parseInt(c.substring(0,2),16),h=parseInt(c.substring(2,4),16),p=parseInt(c.substring(4,6),16);return`rgba(${f}, ${h}, ${p}, ${l})`}const W6=50,Y6=[25,50,100];function $6({text:e,anchorRef:t,onClose:n}){const r=C.useRef(null),[s,i]=C.useState(null),[l,c]=C.useState(!1),f=async h=>{h.stopPropagation(),await navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),1500)};return C.useLayoutEffect(()=>{if(t.current){const h=t.current.getBoundingClientRect();i({top:h.bottom+4,left:h.left})}},[t]),C.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 q6({data:e,pivotConfig:t,height:n}){var R,S;const[r,s]=C.useState(new Set),i=C.useMemo(()=>U6(e,t),[e,t]),l=t.rows,c=t.values,f=t.subtotals!==!1,h=t.grandTotals!==!1,p=((R=t.heatmap)==null?void 0:R.color)??"#4CAF50",y=((S=t.heatmap)==null?void 0:S.scope)??"column",g=C.useMemo(()=>new Set(c.filter(I=>I.heatmap).map(I=>I.field)),[c]),v=C.useMemo(()=>{if(g.size===0)return new Map;const I=new Map;if(y==="global"){let _=1/0,P=-1/0;for(const F of i.groups)for(const H of F.rows)for(const[U,Y]of Object.entries(H.values)){const q=U.split(":")[0];Y!==null&&g.has(q)&&(Y<_&&(_=Y),Y>P&&(P=Y))}if(_!==1/0){for(const F of c)if(g.has(F.field))for(const H of i.columnValues)I.set(`${F.field}:${H}`,{min:_,max:P})}}else for(const _ of c)if(g.has(_.field))for(const P of i.columnValues){const F=`${_.field}:${P}`;let H=1/0,U=-1/0;for(const Y of i.groups)for(const q of Y.rows){const G=q.values[F];G!=null&&(G<H&&(H=G),G>U&&(U=G))}H!==1/0&&I.set(F,{min:H,max:U})}return I},[i,g,y,c]),D=C.useMemo(()=>{const I=new Map;for(const _ of c)I.set(_.field,_.format);return I},[c]),k=I=>{s(_=>{const P=new Set(_);return P.has(I)?P.delete(I):P.add(I),P})},T=[];for(const I of i.columnValues)if(c.length===1)T.push({cellKey:`${c[0].field}:${I}`,label:I});else for(const _ of c)T.push({cellKey:`${_.field}:${I}`,label:`${I} - ${da(_.field)}`});const E=l.map(I=>da(I)).join(" → "),N=l.length>1,O=N?2:1,A=(I,_)=>{const P=I.split(":")[0];if(!g.has(P))return"transparent";const F=v.get(I);return F?z6(_,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:[N?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 _=r.has(I.key),P=f&&I.rows.length>1;return d.jsxs(C.Fragment,{children:[d.jsxs("tr",{className:"cursor-pointer select-none",style:{background:"var(--yc-color-surface-hover)"},onClick:()=>k(I.key),children:[d.jsxs("td",{colSpan:O,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:_?"▶":"▼"}),I.key]}),T.map(F=>d.jsx("td",{className:"px-4 py-2",style:{borderBottom:"1px solid var(--yc-color-border)"}},F.cellKey))]}),!_&&I.rows.map((F,H)=>d.jsxs("tr",{children:[N?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 Y=F.values[U.cellKey]??null,q=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,Y)},children:Wl(Y,D.get(q))},U.cellKey)})]},H)),!_&&P&&d.jsxs("tr",{style:{background:"var(--yc-color-surface-hover)"},children:[d.jsxs("td",{colSpan:O,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 H=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(H,D.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:O,className:"px-4 py-3 font-bold",style:{color:"var(--yc-color-text)"},children:"Grand totals"}),T.map(I=>{const _=i.grandTotals[I.cellKey]??null,P=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.get(P))},I.cellKey)})]})})]})})}function tm({data:e,columns:t,chartConfig:n,height:r=400,loading:s=!1,onRowClick:i}){var Ue,et,Ke;const[l,c]=C.useState(null),f=C.useRef(null),[h,p]=C.useState({}),y=C.useRef(null),g=C.useRef(!1),v=C.useCallback((ge,me)=>{me.preventDefault(),me.stopPropagation();const fe=me.target.closest("th"),J=(fe==null?void 0:fe.offsetWidth)??150;y.current={field:ge,startX:me.clientX,startWidth:J};const Z=Ne=>{if(!y.current)return;const $e=Ne.clientX-y.current.startX,ct=Math.max(60,y.current.startWidth+$e);p(ht=>({...ht,[y.current.field]:ct}))},be=()=>{y.current=null,g.current=!0,setTimeout(()=>{g.current=!1},0),document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",be),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",Z),document.addEventListener("mouseup",be),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[]),[D,k]=C.useState(((Ue=n==null?void 0:n.sort)==null?void 0:Ue.field)??null),[T,E]=C.useState(((et=n==null?void 0:n.sort)==null?void 0:et.direction)??(n!=null&&n.sort?"asc":null)),[N,O]=C.useState([]),A=C.useRef([]),R=n==null?void 0:n.pagination,S=(R==null?void 0:R.enabled)!==!1&&R!=null,I=(R==null?void 0:R.mode)??"paginated",_=(R==null?void 0:R.page_size)??W6,[P,F]=C.useState(0),[H,U]=C.useState(_),[Y,q]=C.useState(_),G=C.useRef(null),ee=C.useMemo(()=>{let ge;n!=null&&n.columns&&n.columns.length>0?ge=n.columns.map(fe=>({field:fe.field,label:fe.label??da(fe.field),format:fe.format,sticky:fe.sticky??!1,stickyIndex:-1,summary:fe.summary,overflow:fe.overflow,font:fe.font})):ge=t.map(fe=>({field:fe.name,label:da(fe.name),format:void 0,sticky:!1,stickyIndex:-1,summary:void 0}));let me=0;return ge.map(fe=>fe.sticky&&me<3?{...fe,stickyIndex:me++}:{...fe,sticky:!1,stickyIndex:-1})},[n==null?void 0:n.columns,t]),he=C.useMemo(()=>ee.filter(ge=>ge.sticky).length,[ee]),te=C.useCallback(ge=>me=>{A.current[ge]=me},[]);C.useLayoutEffect(()=>{if(he===0){O([]);return}const ge=()=>{var Z;const fe=[];let J=0;for(let be=0;be<he;be++)fe.push(J),J+=((Z=A.current[be])==null?void 0:Z.offsetWidth)??0;O(fe)};if(ge(),typeof ResizeObserver>"u")return;const me=new ResizeObserver(ge);for(let fe=0;fe<he;fe++){const J=A.current[fe];J&&me.observe(J)}return()=>me.disconnect()},[he,ee,s]);const ue=ge=>{g.current||(D===ge?T==="asc"?E("desc"):T==="desc"?(k(null),E(null)):E("asc"):(k(ge),E("asc")))},M=C.useMemo(()=>!D||!T?e:[...e].sort((ge,me)=>{const fe=ge[D],J=me[D];if(fe==null)return 1;if(J==null)return-1;let Z=0;return typeof fe=="number"&&typeof J=="number"?Z=fe-J:Z=String(fe).localeCompare(String(J)),T==="asc"?Z:-Z}),[e,D,T]);C.useEffect(()=>{F(0),q(H)},[e,D,T,H]);const Q=M.length,le=S?Math.ceil(Q/H):1,j=C.useMemo(()=>S?I==="infinite_scroll"?M.slice(0,Y):M.slice(P*H,(P+1)*H):M,[M,S,I,P,H,Y]);C.useEffect(()=>{if(!S||I!=="infinite_scroll")return;const ge=G.current;if(!ge||typeof IntersectionObserver>"u")return;const me=new IntersectionObserver(fe=>{var J;(J=fe[0])!=null&&J.isIntersecting&&Y<Q&&q(Z=>Math.min(Z+H,Q))},{rootMargin:"100px"});return me.observe(ge),()=>me.disconnect()},[S,I,Y,Q,H]);const se=C.useMemo(()=>{const ge=ee.filter(fe=>fe.summary);if(ge.length===0)return null;const me={};for(const fe of ge){const J=e.map(Z=>Z[fe.field]).filter(Z=>typeof Z=="number");if(fe.summary==="count"){me[fe.field]=e.filter(Z=>Z[fe.field]!=null).length;continue}if(J.length===0){me[fe.field]=null;continue}switch(fe.summary){case"sum":me[fe.field]=J.reduce((Z,be)=>Z+be,0);break;case"avg":me[fe.field]=J.reduce((Z,be)=>Z+be,0)/J.length;break;case"min":me[fe.field]=Math.min(...J);break;case"max":me[fe.field]=Math.max(...J);break}}return me},[e,ee]),ye=((Ke=n==null?void 0:n.summary)==null?void 0:Ke.label)??"Total",xe=ee.findIndex(ge=>!ge.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 ge=typeof r=="number"?`${r}px`:r;return d.jsx(q6,{data:e,pivotConfig:n.pivot,height:ge})}const Oe=typeof r=="number"?`${r}px`:r,ae=(ge,me)=>ge.sticky?{position:"sticky",left:`${N[ge.stickyIndex]??0}px`,zIndex:me?3:1,backgroundColor:me?"#f0f4f8":"#f8fafc"}:{},de=ge=>ge.sticky&&ge.stickyIndex===he-1?"shadow-[2px_0_4px_rgba(0,0,0,0.08)]":"",_e=S&&I==="paginated"?P*H:0,ke=_e+1,Pe=Math.min(_e+j.length,Q);return d.jsxs("div",{className:"h-full flex flex-col",style:{maxHeight:Oe},children:[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(h).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:"#"}),ee.map((ge,me)=>d.jsxs("th",{ref:ge.sticky?te(ge.stickyIndex):void 0,className:`px-4 py-3 text-left font-medium text-gray-600 cursor-pointer hover:bg-gray-100 select-none ${de(ge)}`,style:{...ae(ge,!0),backgroundColor:ge.sticky?"#f0f4f8":void 0,...h[ge.field]?{width:h[ge.field],minWidth:h[ge.field]}:{},position:ge.sticky?"sticky":"relative",borderRight:"1px solid rgba(0,0,0,0.06)"},onClick:()=>ue(ge.field),children:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("span",{children:ge.label}),d.jsx("span",{className:`w-4 text-center text-gray-400 ${D===ge.field?"visible":"invisible"}`,children:D===ge.field&&T==="asc"?"↑":"↓"})]}),d.jsx("div",{onMouseDown:fe=>v(ge.field,fe),style:{position:"absolute",right:0,top:0,bottom:0,width:4,cursor:"col-resize"},className:"hover:bg-blue-400 hover:opacity-50"})]},ge.field))]})}),d.jsx("tbody",{children:j.map((ge,me)=>d.jsxs("tr",{className:`border-b border-gray-100${i?" cursor-pointer hover:bg-black/5 dark:hover:bg-white/5":""}`,onClick:i?fe=>{const J=fe.target.closest("td[data-field]"),Z=(J==null?void 0:J.getAttribute("data-field"))??void 0;i(ge,{x:fe.clientX,y:fe.clientY},Z)}:void 0,children:[d.jsx("td",{className:"px-3 py-3 text-right yc-row-num bg-white w-10",children:_e+me+1}),ee.map(fe=>{const J=Wl(ge[fe.field],fe.format),Z=ge[fe.field],be=Z==null?void 0:String(Z),Ne=fe.overflow??"ellipsis",$e=Ne==="wrap"?{whiteSpace:"normal",wordBreak:"break-all"}:Ne==="hidden"?{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"clip"}:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},ct=`${me}:${fe.field}`,ht=Ne!=="wrap"&&be&&be.length>20,ie=l===ct;return d.jsxs("td",{"data-field":fe.field,className:`px-4 py-3 text-gray-700 bg-white ${de(fe)}${fe.font==="mono"?" font-mono text-[0.8125rem]":""}${ht?" cursor-pointer":""}`,style:{maxWidth:h[fe.field]??200,...$e,...ae(fe,!1),borderRight:"1px solid rgba(0,0,0,0.06)"},title:Ne!=="wrap"&&!ie?be:void 0,...ht?i?{onDoubleClick:ve=>{ve.stopPropagation(),f.current=ve.currentTarget,c(ie?null:ct)}}:{onClick:ve=>{ve.stopPropagation(),ve.preventDefault(),f.current=ve.currentTarget,c(ie?null:ct)}}:{},children:[J,ie&&be&&d.jsx($6,{text:J,anchorRef:f,onClose:()=>c(null)})]},fe.field)})]},me))}),se&&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"}),ee.map((ge,me)=>{const fe=se[ge.field],J=xe>=0&&me===xe;return d.jsx("td",{className:`px-4 py-3 text-gray-700 bg-gray-50 ${de(ge)}`,style:ae(ge,!1),children:J?ye:fe!=null?Wl(fe,ge.format):""},ge.field)})]})})]}),M.length===0&&d.jsx("div",{className:"text-center py-8 text-gray-400",children:"No data"}),S&&I==="infinite_scroll"&&Y<Q&&d.jsx("div",{ref:G,className:"flex justify-center py-4",children:d.jsx("span",{className:"text-sm text-gray-400",children:"Loading more..."})})]}),S&&I==="paginated"&&Q>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 ",ke,"-",Pe," of ",Q.toLocaleString()]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("select",{value:H,onChange:ge=>{const me=Number(ge.target.value);U(me),F(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:[Y6.map(ge=>d.jsxs("option",{value:ge,children:[ge," / page"]},ge)),d.jsx("option",{value:Q,children:"All"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>F(ge=>Math.max(0,ge-1)),disabled:P===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:[P+1," / ",le]}),d.jsx("button",{onClick:()=>F(ge=>Math.min(le-1,ge+1)),disabled:P>=le-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"})]})]})]}),S&&I==="infinite_scroll"&&Q>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(Y,Q).toLocaleString()," of ",Q.toLocaleString()]})]})}function V6(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 Q6({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,c=V6(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:c}),(r||f)&&d.jsx("div",{className:"text-sm text-gray-500 mt-2 text-center",children:r||f})]})}const Y2=C.forwardRef(function({data:t,xAxis:n,chartConfig:r,theme:s,height:i=400,loading:l=!1,onChartClick:c,events:f,goalData:h},p){var Y,q,G,ee,he,te,ue;const y=$r(),g=(r==null?void 0:r.series)&&"field"in r.series,v=g?Bd(t,n):Rs(t,n),D=n.type==="temporal"?Fd(t,n):v,k=C.useMemo(()=>{if(g){const M=new Set;return t.filter(Q=>{const le=Q[n.field];return M.has(le)?!1:(M.add(le),!0)}).map(Q=>Q[n.field])}return t.map(M=>M[n.field])},[t,n.field,g]),T=C.useMemo(()=>{if(c)return{click:M=>{var xe,Oe,ae,de;const Q=M;if(Q.componentType!=="series")return;const le=Q.dataIndex!=null?k[Q.dataIndex]:void 0,j=le!=null?String(le):Q.name;if(j==null||j==="")return;const se=((Oe=(xe=Q.event)==null?void 0:xe.event)==null?void 0:Oe.clientX)??0,ye=((de=(ae=Q.event)==null?void 0:ae.event)==null?void 0:de.clientY)??0;c(n.field,j,{x:se,y:ye},Q.seriesName)}}},[c,n.field,k]),E=jd(t,{series:r.series},s),N=(Y=r.axes)==null?void 0:Y.left,O=(q=r.axes)==null?void 0:q.right,A=[];A.push({type:(N==null?void 0:N.scale)==="log"?"log":"value",name:N==null?void 0:N.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:y.textColor,fontSize:12},axisLabel:{color:y.textColor,fontSize:12,formatter:M=>ko(M,N==null?void 0:N.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:y.splitLineColor,type:"dashed"}}}),O&&A.push({type:O.scale==="log"?"log":"value",name:O.label,nameLocation:"middle",nameGap:60,nameTextStyle:{color:y.textColor,fontSize:12},axisLabel:{color:y.textColor,fontSize:12,formatter:M=>ko(M,O.format)},axisLine:{show:!1},splitLine:{show:!1}});const R=Ps(s),S=E.map(M=>{const Q=Hd(M.color,M.gradient??r.gradient),le=M.chartType??"bar",j={name:M.name,data:M.data,yAxisIndex:M.yAxisIndex??0,itemStyle:{color:Q??M.color},...M.opacity!==void 0?{opacity:M.opacity}:{}};return le==="line"?{...j,type:"line",smooth:R.smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:M.color,type:M.style==="dashed"?"dashed":M.style==="dotted"?"dotted":"solid"}}:le==="area"?{...j,type:"line",smooth:R.smooth,symbol:"none",lineStyle:{width:2,color:M.color},areaStyle:{color:Q??M.color}}:{...j,type:"bar",barWidth:"60%",itemStyle:{color:Q??M.color,borderRadius:R.barBorderRadius}}}),I=(r==null?void 0:r.goals)??[];if(I.length>0&&Array.isArray(S)){const M=Ld(I,v),Q=Rd(I);M.length>0&&S[0]&&(S[0].markLine={silent:!0,symbol:"none",data:M}),Q.length>0&&S[0]&&(S[0].markArea={silent:!0,data:Q});const le=Pd(I,h);for(const j of le)S.push({type:"line",name:j.name,data:j.data,yAxisIndex:0,z:j.z,showSymbol:j.showSymbol,lineStyle:j.lineStyle,itemStyle:{color:j.color}})}const _=C.useMemo(()=>{if(!(f!=null&&f.length))return[];const Q=f.flatMap(ye=>ye.endDate?[ye.date,ye.endDate]:[ye.date]).map(ye=>({[n.field]:ye})),j=Rs([...t,...Q],n).slice(t.length);let se=0;return f.map(ye=>{const xe={...ye,date:j[se++]??ye.date};return ye.endDate&&(xe.endDate=j[se++]??ye.endDate),xe})},[f,t,n]),P=Array.isArray(S)?S.map(M=>M.name).filter(Boolean):[],F=Id(_,y.textColor,v),H=Md(_,y.textColor,v);if((F||H.length>0)&&Array.isArray(S)){const M={type:"line",data:((G=S[0])==null?void 0:G.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};F&&(M.markLine=F),H.length>0&&(M.markArea={silent:!0,data:H}),S.push(M)}const U={tooltip:{trigger:"axis",axisPointer:{type:"cross"},formatter:M=>{const Q=M;if(!Array.isArray(Q)||Q.length===0)return"";let j=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${D[Q[0].dataIndex]??Q[0].name}</div>`;for(const se of Q){const ye=E.find(Oe=>Oe.name===se.seriesName),xe=(ye==null?void 0:ye.yAxisIndex)===1?O:N;j+=`<div>${se.marker} ${se.seriesName}: ${ko(se.value,xe==null?void 0:xe.format)}</div>`}return j+=Ad(_,Q[0].name,v),j+="</div>",j}},legend:{show:((ee=r.legend)==null?void 0:ee.show)!==!1,...((he=r.legend)==null?void 0:he.position)==="top"?{top:0}:((te=r.legend)==null?void 0:te.position)==="left"?{left:0,orient:"vertical"}:((ue=r.legend)==null?void 0:ue.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:y.textColor,fontSize:12},...P.length>0?{data:P}:{}},grid:{left:"3%",right:O?"8%":"4%",bottom:"15%",top:"10%",containLabel:!0},xAxis:{type:"category",data:v,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:S,animation:!0,animationDuration:300};return d.jsx(Dr,{ref:p,option:U,height:i,loading:l,onEvents:T})}),$2=C.forwardRef(function({data:t,chartConfig:n,height:r=400,loading:s=!1},i){const l=C.useMemo(()=>{var N,O;const c=n.x.field,f=n.y.field,h=n.value.field,p=[...new Set(t.map(A=>String(A[c]??"")))],y=[...new Set(t.map(A=>String(A[f]??"")))],g=[];let v=1/0,D=-1/0;for(const A of t){const R=String(A[c]??""),S=String(A[f]??""),I=Number(A[h]??0),_=p.indexOf(R),P=y.indexOf(S);_>=0&&P>=0&&(g.push([_,P,I]),I<v&&(v=I),I>D&&(D=I))}v===1/0&&(v=0),D===-1/0&&(D=0);const k=((N=n.color_range)==null?void 0:N.min)??"#EBF5FB",T=((O=n.color_range)==null?void 0:O.max)??"#1A5276",E=n.show_values??!0;return{tooltip:{position:"top",formatter:A=>{const R=A,S=p[R.value[0]]??"",I=y[R.value[1]]??"",_=R.value[2],P=n.value.label??h;return`${S}, ${I}<br/>${P}: <b>${_}</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:v,max:D,calculable:!0,orient:"horizontal",left:"center",bottom:"0%",inRange:{color:[k,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(Dr,{ref:i,option:l,height:r,loading:s})}),q2=C.forwardRef(function({data:t,chartConfig:n,theme:r,height:s=400,loading:i=!1},l){const c=$r(),f=C.useMemo(()=>{var k;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)})),v={};for(let T=1;T<g.length;T++){const E=g[T-1],N=g[T];if(E&&N&&E.value>0){const O=(N.value/E.value*100).toFixed(1);v[N.name]=`${O}% of ${E.name}`}}const D=n.color??((k=r==null?void 0:r.palette)==null?void 0:k[0])??"#3B82F6";return{tooltip:{trigger:"item",formatter:T=>{const E=T;let N=`${E.name}: <b>${E.value.toLocaleString()}</b>`;return y&&v[E.name]&&(N+=`<br/><span style="color:${c.textColor}">${v[E.name]}</span>`),N}},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}
|
|
120
|
-
${E.value.toLocaleString()}`}},itemStyle:{borderColor:c.surfaceColor,borderWidth:1,color:T=>{const N=1-T.dataIndex*.15;return`${D}${Math.round(Math.max(N,.3)*255).toString(16).padStart(2,"0")}`}},data:g}]}},[t,n,r,c]);return d.jsx(Dr,{ref:l,option:f,height:s,loading:i})}),V2=C.forwardRef(function({data:t,chartConfig:n,height:r=400,loading:s=!1},i){const l=$r(),c=C.useMemo(()=>{var O,A,R;const f=n.category.field,h=n.value.field,p=n.total_field,y=((O=n.colors)==null?void 0:O.increase)??"#22C55E",g=((A=n.colors)==null?void 0:A.decrease)??"#EF4444",v=((R=n.colors)==null?void 0:R.total)??"#3B82F6",D=[],k=[],T=[],E=[];let N=0;for(const S of t){const I=String(S[f]??""),_=Number(S[h]??0),P=p?!!S[p]:!1;D.push(I),P?(k.push(Math.min(0,_)),T.push(Math.abs(_)),E.push(v),N=_):(_>=0?(k.push(N),T.push(_),E.push(y)):(k.push(N+_),T.push(Math.abs(_)),E.push(g)),N+=_)}return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:S=>{var U,Y;const I=S;if(!I[0])return"";const _=I[0].dataIndex,P=Number(((U=t[_])==null?void 0:U[h])??0),H=!(p?!!((Y=t[_])!=null&&Y[p]):!1)&&P>=0?"+":"";return`${I[0].name}<br/><b>${H}${P.toLocaleString()}</b>`}},grid:{left:"3%",right:"4%",bottom:"10%",containLabel:!0},xAxis:{type:"category",data:D,axisLabel:{color:l.textColor,rotate:D.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:k,itemStyle:{color:"transparent",borderColor:"transparent"},emphasis:{itemStyle:{color:"transparent",borderColor:"transparent"}},tooltip:{show:!1}},{type:"bar",stack:"waterfall",data:T.map((S,I)=>({value:S,itemStyle:{color:E[I]}})),label:{show:!0,position:"top",formatter:S=>{var H,U;const I=S,_=Number(((H=t[I.dataIndex])==null?void 0:H[h])??0);return(p?!!((U=t[I.dataIndex])!=null&&U[p]):!1)?_.toLocaleString():`${_>=0?"+":""}${_.toLocaleString()}`}}}]}},[t,n,l]);return d.jsx(Dr,{ref:i,option:c,height:r,loading:s})}),Q2=C.forwardRef(function({data:t,chartConfig:n,theme:r,height:s=400,loading:i=!1},l){const c=$r(),f=C.useMemo(()=>{var N;const h=n.value.field,p=n.min??0,y=n.max??100,g=n.format??"",v=t[0]?Number(t[0][h]??0):0,D=Math.min(Math.max(v,p),y);let k;if(n.thresholds&&n.thresholds.length>0){const O=y-p||1;k=n.thresholds.map(A=>[(A.value-p)/O,A.color])}else k=[[1,((N=r==null?void 0:r.palette)==null?void 0:N[0])??"#3B82F6"]];const E=[{type:"gauge",min:p,max:y,progress:{show:!0,width:18},axisLine:{lineStyle:{width:18,color:k}},axisTick:{show:!1},splitLine:{length:10,lineStyle:{width:2,color:c.textColor}},axisLabel:{distance:25,color:c.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:`{value}${g}`},data:[{value:D}]}];if(n.goal){const O=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:c.textColor},detail:{show:!1},data:[{value:O,name:n.goal.label??"Goal"}]})}return{series:E}},[t,n,r,c]);return d.jsx(Dr,{ref:l,option:f,height:s,loading:i})});function G2({onRefresh:e,onExportCSV:t,onExportPNG:n,onExportSVG:r,onExportPDF:s,isRefreshing:i=!1,hideImageExport:l=!1}){const[c,f]=C.useState(!1),h=C.useRef(null);return C.useEffect(()=>{const p=y=>{h.current&&!h.current.contains(y.target)&&f(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),d.jsxs("div",{className:"relative",ref:h,children:[d.jsx("button",{onClick:()=>f(!c),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"})})}),c&&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(),f(!1)},disabled:i,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 ${i?"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(),f(!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"]}),!l&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:()=>{n(),f(!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(),f(!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(),f(!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 nm(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),c=l>=12?"PM":"AM",f=l%12||12,h=i==="00"?`${f}:${s} ${c}`:`${f}:${s}:${i} ${c}`;return`${n} ${h}`}function K2({x:e,y:t,field:n,value:r,allFields:s,onFilter:i,onViewDetails:l,onGoToChart:c,onAddEvent:f,detailModel:h,targetChart:p,isTemporalChart:y,onClose:g}){const v=C.useRef(null);C.useEffect(()=>{const I=P=>{v.current&&!v.current.contains(P.target)&&g()},_=P=>{P.key==="Escape"&&g()};return document.addEventListener("mousedown",I),document.addEventListener("keydown",_),()=>{document.removeEventListener("mousedown",I),document.removeEventListener("keydown",_)}},[g]);const D=s?Object.entries(s).map(([I,_])=>`${I} = ${nm(_)}`).join(", "):`${n} = ${nm(r)}`;let k=0;i&&k++,h&&k++,p&&k++,f&&y&&k++;const T=280,E=k*36+8,N=Math.min(e,window.innerWidth-T-8),O=Math.min(t,window.innerHeight-E-8),A=()=>{i==null||i(),g()},R=()=>{l==null||l(),g()},S=()=>{c==null||c(),g()};return Di.createPortal(d.jsxs("div",{ref:v,className:"fixed z-[9999] rounded-lg shadow-lg py-1 min-w-[200px]",style:{left:N,top:O,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: ",D]})]}),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:R,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:S,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 X2({date:e,onSave:t,onClose:n,saving:r=!1,themePalette:s}){const[i,l]=C.useState(""),[c,f]=C.useState(e),[h,p]=C.useState(""),[y,g]=C.useState(!1),[v,D]=C.useState(""),k=C.useRef(null);C.useEffect(()=>{var E;(E=k.current)==null||E.focus()},[]),C.useEffect(()=>{function E(N){N.key==="Escape"&&n()}return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[n]);function T(E){E.preventDefault(),i.trim()&&t({date:c,label:i.trim(),color:h,...y&&v?{endDate:v}:{}})}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:c,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&&D("")},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:v,onChange:E=>D(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:k,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(em,{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 G6={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 id({isLoading:e,error:t,data:n,hasActiveFilters:r,onRetry:s,children:i}){if(t){const l=t.errorType?G6[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 K6={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 u0(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 X6(e,t){const n=e>=0?"+":"";return t==="percent_change"?`${n}${e.toFixed(1)}%`:`${n}${e.toLocaleString()}`}function J6({chartName:e,drillParams:t}){var ke,Pe,Ue,et,Ke,ge,me,fe,J;const n=C.useMemo(()=>{if(!t)return;const Z=Object.fromEntries(Object.entries(t).filter(([be])=>!be.startsWith("_")));return Object.keys(Z).length>0?Z:void 0},[t]),{data:r,isLoading:s}=Vb(e),{data:i,isLoading:l,error:c}=uv(e,n),{data:f}=ya(),h=Om(),p=Je(Z=>Z.getEffectiveFilters),y=C.useRef(null),{events:g,allEvents:v}=fv(e),D=So(Z=>Z.auth),k=Yn(),[T,E]=C.useState(null),N=D.status==="disabled"||D.status==="authenticated"&&(D.user.role==="admin"||D.user.role==="editor"),O=((Pe=(ke=r==null?void 0:r.chart)==null?void 0:ke.x)==null?void 0:Pe.type)==="temporal",A=Ja({mutationFn:Z=>ft.createChartEvent({date:Z.date,label:Z.label,...Z.color?{color:Z.color}:{},...Z.endDate?{endDate:Z.endDate}:{}}),onSuccess:()=>{k.invalidateQueries({queryKey:["chartEvents"]}),E(null)}}),[R,S]=C.useState("chart"),[I,_]=C.useState(!1),[P,F]=C.useState(!1),[H,U]=C.useState(()=>{const Z=localStorage.getItem(`yamchart-events-visible-${e}`);return Z===null?!0:Z==="1"});function Y(){U(Z=>{const be=!Z;return localStorage.setItem(`yamchart-events-visible-${e}`,be?"1":"0"),be})}const q=(()=>{try{const Z=sessionStorage.getItem("yamchart-last-dashboard");if(Z)return JSON.parse(Z)}catch{}return null})(),G=t==null?void 0:t._from,ee=!!n&&Object.keys(n).length>0,he=n?Object.entries(n).map(([Z,be])=>`${Z}: ${be}`).join(", "):"",ue=p(e).granularity,M=ue?K6[ue]:void 0,[Q,le]=C.useState(null),j=C.useCallback((Z,be,Ne,$e)=>{var ht;let ct;if($e&&((ht=r==null?void 0:r.chart)!=null&&ht.series)&&"field"in r.chart.series){const ie=r.chart.series.field;ie&&ie!==Z&&(ct={[Z]:be,[ie]:$e})}le({x:Ne.x,y:Ne.y,field:Z,value:be,allFields:ct})},[r]),se=C.useCallback(()=>{Q&&E(Q.value)},[Q]),ye=C.useCallback(()=>{var $e,ct;if(!Q||!(($e=r==null?void 0:r.drillDown)!=null&&$e.model))return;const Z=r.drillDown,be=Z.fields?typeof Z.fields=="string"?Z.fields:Z.fields[0]:Z.field??((ct=r.chart.x)==null?void 0:ct.field)??Q.field,Ne=new URLSearchParams;if(Q.allFields)for(const[ht,ie]of Object.entries(Q.allFields))Ne.set(ht,ie);else Ne.set(be,Q.value);Ne.set("_from",e),window.location.hash=`/charts/${e}/detail?${Ne.toString()}`,le(null)},[Q,r,e]),xe=C.useCallback(()=>{var $e,ct;if(!Q||!(($e=r==null?void 0:r.drillDown)!=null&&$e.chart))return;const Z=r.drillDown,be=Z.fields?typeof Z.fields=="string"?Z.fields:Z.fields[0]:Z.field??((ct=r.chart.x)==null?void 0:ct.field)??Q.field,Ne=new URLSearchParams;if(Q.allFields)for(const[ht,ie]of Object.entries(Q.allFields))Ne.set(ht,ie);else Ne.set(be,Q.value);Ne.set("_from",e),window.location.hash=`/charts/${r.drillDown.chart}?${Ne.toString()}`,le(null)},[Q,r,e]),Oe=()=>{!i||!r||Od(i.rows,i.columns,r.name||e)},ae=()=>{var be;const Z=(be=y.current)==null?void 0:be.getDataURL("png");Z&&r&&nd(Z,`${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 de=M?{...r.chart.x,label:M.label,format:M.format}:r.chart.x,_e=()=>{var Z,be;if(!i)return d.jsx("div",{className:"h-full animate-pulse",style:{background:"var(--yc-color-background)"}});if(R==="table"&&i)return d.jsx(tm,{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(F2,{ref:y,data:i.rows,columns:i.columns,xAxis:de,yAxis:r.chart.y,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l,onChartClick:j,events:H?g:[]}):null;case"bar":return r.chart.x&&(r.chart.y||r.chart.series)?d.jsx(B2,{ref:y,data:i.rows,xAxis:de,yAxis:r.chart.y,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l,onChartClick:j,events:H?g:[]}):null;case"area":return r.chart.x&&(r.chart.y||r.chart.series)?d.jsx(H2,{ref:y,data:i.rows,xAxis:de,yAxis:r.chart.y,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l,onChartClick:j,events:H?g:[]}):null;case"pie":return r.chart.x&&r.chart.y?d.jsx(U2,{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:j}):null;case"donut":return r.chart.x&&r.chart.y?d.jsx(z2,{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:j}):null;case"scatter":return r.chart.x&&r.chart.y?d.jsx(W2,{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:j}):null;case"combo":return r.chart.x?d.jsx(Y2,{ref:y,data:i.rows,xAxis:de,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l,onChartClick:j,events:H?g:[]}):null;case"heatmap":return d.jsx($2,{ref:y,data:i.rows,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l});case"funnel":return d.jsx(q2,{ref:y,data:i.rows,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l});case"waterfall":return d.jsx(V2,{ref:y,data:i.rows,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l});case"gauge":return d.jsx(Q2,{ref:y,data:i.rows,chartConfig:r.chart,theme:f==null?void 0:f.theme,height:"100%",loading:l});case"table":return d.jsx(tm,{data:i.rows,columns:i.columns,chartConfig:r.chart,height:"100%",loading:l,onRowClick:r.drillDown?(Ne,$e,ct)=>{const ht=r.drillDown,ie=ht.fields?typeof ht.fields=="string"?[ht.fields]:ht.fields:ht.field?[ht.field]:[];if(ie.length===0)return;const ve={};for(const Re of ie)Re in Ne?ve[Re]=String(Ne[Re]??""):ct?ve[Re]=ct:ve[Re]="";le({x:$e.x,y:$e.y,field:ie[0],value:ve[ie[0]],allFields:ie.length>1?ve:void 0})}:void 0});case"kpi":{const Ne=r.chart;if(!((Z=Ne.value)!=null&&Z.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 $e=i.rows[0],ct=$e[Ne.value.field],ht=u0(ct,Ne.format);let ie=null,ve="percent_change",Re,rt,ot;if(i.comparison)ie=i.comparison.change,ve=i.comparison.changeType,Re=i.comparison.currentPeriodLabel,rt=i.comparison.previousPeriodLabel,ot=u0(i.comparison.previousValue,Ne.format);else if((be=Ne.comparison)!=null&&be.enabled&&Ne.comparison.field){const xt=$e[Ne.comparison.field];ve=Ne.comparison.type,xt&&xt!==0&&(ie=ve==="percent_change"?(ct-xt)/xt*100:ct-xt,ot=u0(xt,Ne.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:[ht,Ne.unit&&d.jsx("span",{className:"text-3xl font-normal ml-2",style:{color:"var(--yc-color-text-secondary)"},children:Ne.unit})]}),Re&&d.jsx("div",{className:"text-sm mt-2",style:{color:"var(--yc-color-text-secondary)"},children:Re}),ie!==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:ie>=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:X6(ie,ve)}),ot&&d.jsxs("span",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["vs ",ot]}),rt&&d.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["(",rt,")"]})]})]})}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(rd,{fallback:(Z,be)=>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:Z.message}),d.jsx("button",{onClick:be,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:[!G&&q&&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/${q.name}`,className:"hover:underline",style:{color:"var(--yc-color-primary)"},children:q.title})]}),G&&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/${G}`},className:"hover:underline",style:{color:"var(--yc-color-primary)"},children:G}),d.jsx("span",{children:"/"}),d.jsx("span",{style:{color:"var(--yc-color-text)"},className:"font-medium",children:r.title}),he&&d.jsxs("span",{children:["(",he,")"]})]}),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(D2,{resourceType:"chart",resourceName:e})]})]}),r.parameters.length>0&&d.jsx(_2,{parameters:r.parameters,chartName:e}),ee&&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(([Z,be])=>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:[Z,": ",be]},Z))]})]}),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(id,{isLoading:l,error:c,data:i==null?void 0:i.rows,onRetry:()=>h(e),children:_e()})})}),d.jsx("div",{className:"px-6 pb-2",children:d.jsx(u6,{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:R,onToggleView:S,onExportCSV:Oe,onExportPNG:ae,onShowSql:()=>_(!I),onShowEvents:O?()=>F(!P):void 0,eventCount:O?g.length:void 0})}),ee&&i&&d.jsx("div",{className:"px-6 pb-4",children:d.jsx(A2,{data:i.rows,columns:i.columns,drillDownColumns:(Ue=r.drillDown)==null?void 0:Ue.columns,filterDisplay:he,chartName:e})}),Q&&d.jsx(K2,{x:Q.x,y:Q.y,field:Q.field,value:Q.value,allFields:Q.allFields,onViewDetails:(et=r.drillDown)!=null&&et.model?ye:void 0,onGoToChart:(Ke=r.drillDown)!=null&&Ke.chart?xe:void 0,onAddEvent:N?se:void 0,detailModel:(ge=r.drillDown)==null?void 0:ge.model,targetChart:(me=r.drillDown)==null?void 0:me.chart,isTemporalChart:O,onClose:()=>le(null)}),T&&d.jsx(X2,{date:T,onSave:Z=>A.mutate(Z),onClose:()=>E(null),saving:A.isPending,themePalette:(fe=f==null?void 0:f.theme)==null?void 0:fe.palette}),d.jsx(m6,{isOpen:I,onClose:()=>_(!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(y6,{isOpen:P,onClose:()=>F(!1),events:g,allEvents:v,chartName:e,canEdit:N,eventsVisible:H,onToggleVisible:Y,themePalette:(J=f==null?void 0:f.theme)==null?void 0:J.palette})]})})}function Z6({chartName:e,params:t}){var f;const n=Object.fromEntries(Object.entries(t).filter(([h])=>!h.startsWith("_"))),{data:r}=sr({queryKey:["chart",e],queryFn:()=>ft.getChart(e)}),{data:s,isLoading:i,error:l}=sr({queryKey:["chartDetail",e,n],queryFn:()=>ft.queryChartDetail(e,n),enabled:!!e}),c=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(A2,{data:s.rows,columns:s.columns,drillDownColumns:(f=r==null?void 0:r.drillDown)==null?void 0:f.columns,filterDisplay:c,chartName:e})]})}function eA(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 J2=C.createContext(null);function tA({children:e}){const[t,n]=C.useState(!1),[r,s]=C.useState(null),[i,l]=C.useState(null),[c,f]=C.useState(null),h=C.useRef(eA()),[p,y]=C.useState(!1),[g,v]=C.useState(!1),D=r!==null,k=C.useMemo(()=>r||i,[r,i]),T=C.useCallback(I=>{l(I)},[]),E=C.useCallback(I=>{if(I===null){s(null);return}const _=r||i;_&&h.current.push(_),s(I),y(h.current.canUndo()),v(h.current.canRedo())},[r,i]),N=C.useCallback(()=>{const I=h.current.undo();I&&(s(I),y(h.current.canUndo()),v(h.current.canRedo()))},[]),O=C.useCallback(()=>{const I=h.current.redo();I&&(s(I),y(h.current.canUndo()),v(h.current.canRedo()))},[]);C.useEffect(()=>{h.current.clear(),y(!1),v(!1),f(null)},[t]),C.useEffect(()=>{if(!t)return;const I=_=>{const P=_.metaKey||_.ctrlKey;P&&_.key==="z"&&!_.shiftKey&&(_.preventDefault(),N()),P&&_.key==="z"&&_.shiftKey&&(_.preventDefault(),O())};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[t,N,O]);const A=C.useCallback(I=>{var q;const _=r||i;if(!_)return;const F=I.type==="chart"&&((q=I.ref)==null?void 0:q.toLowerCase().includes("kpi"))?3:6,U={height:100,widgets:[{...I,cols:F}]},Y={..._,rows:[..._.rows,U]};E(Y)},[r,i,E]),R=C.useCallback((I,_)=>{const P=r||i;if(!P)return;const F=P.rows.map((U,Y)=>{if(Y!==I)return U;const q=U.widgets.filter((G,ee)=>ee!==_);return{...U,widgets:q}}).filter(U=>U.widgets.length>0),H={...P,rows:F};E(H)},[r,i,E]),S=C.useCallback((I,_,P)=>{const F=r||i;if(!F)return;const H=F.rows.map((Y,q)=>{if(q!==I)return Y;const G=Y.widgets.map((ee,he)=>he!==_?ee:{...ee,...P});return{...Y,widgets:G}}),U={...F,rows:H};E(U)},[r,i,E]);return d.jsx(J2.Provider,{value:{isEditing:t,setIsEditing:n,pendingLayout:r,setPendingLayout:E,hasChanges:D,originalLayout:i,setOriginalLayout:T,currentLayout:k,addWidget:A,removeWidget:R,updateWidget:S,pendingFilters:c,setPendingFilters:f,undo:N,redo:O,canUndo:p,canRedo:g},children:e})}function Oi(){const e=C.useContext(J2);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:c,containerPadding:f,rowHeight:h}=e,p=Ai(e);let y,g,v,D;if(l?(y=Math.round(l.width),g=Math.round(l.height)):(y=vi(r,p,c[0]),g=vi(s,h,c[1])),i?(v=Math.round(i.top),D=Math.round(i.left)):l?(v=Math.round(l.top),D=Math.round(l.left)):(v=Math.round((h+c[1])*n+f[1]),D=Math.round((p+c[0])*t+f[0])),!i&&!l){if(Number.isFinite(r)){const T=Math.round((p+c[0])*(t+r)+f[0])-D-y;T!==c[0]&&(y+=T-c[0])}if(Number.isFinite(s)){const T=Math.round((h+c[1])*(n+s)+f[1])-v-g;T!==c[1]&&(g+=T-c[1])}}return{top:v,left:D,width:y,height:g}}function nA(e,t,n,r,s){const{margin:i,containerPadding:l,cols:c,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=ld(y,0,c-r),g=ld(g,0,h-s),{x:y,y:g}}function Rc(e,t,n){const{margin:r,containerPadding:s,rowHeight:i}=e,l=Ai(e),c=Math.round((n-s[0])/(l+r[0])),f=Math.round((t-s[1])/(i+r[1]));return{x:c,y:f}}function rA(e,t,n){const{margin:r,rowHeight:s}=e,i=Ai(e),l=Math.max(1,Math.round((t+r[0])/(i+r[0]))),c=Math.max(1,Math.round((n+r[1])/(s+r[1])));return{w:l,h:c}}function ld(e,t,n){return Math.max(Math.min(e,n),t)}function ep(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&&ep(r,t))return r}}function Z2(e,t){return e.filter(n=>ep(n,t))}function sA(e,t){return t==="horizontal"?eE(e):t==="vertical"||t==="wrap"?rm(e):[...e]}function rm(e){return[...e].sort((t,n)=>t.y!==n.y?t.y-n.y:t.x-n.x)}function eE(e){return[...e].sort((t,n)=>t.x!==n.x?t.x-n.x:t.y-n.y)}function Ud(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 zd(e){return e.filter(t=>t.static===!0)}function fa(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]=fa(r))}return t}function oA(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 aA(e,t,n){let r=Yo(e,t);return r?(r=n(fa(r)),[oA(e,r),r]):[[...e],null]}function tp(e,t){const n=zd(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,c,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=sA(e,l);(l==="vertical"&&typeof r=="number"?p>=r:l==="horizontal"&&typeof n=="number"?h>=n:!1)&&(y=y.reverse());const v=Z2(y,t),D=v.length>0;if(D&&f)return Co(e);if(D&&i)return t.x=h,t.y=p,t.moved=!1,e;let k=[...e];for(let T=0;T<v.length;T++){const E=v[T];E!==void 0&&(E.moved||(E.static?k=kx(k,E,t,s,l):k=kx(k,t,E,s,l)))}return k}function kx(e,t,n,r,s,i){const l=s==="horizontal",c=s==="vertical",f=t.static;if(r){r=!1;const y={x:l?Math.max(t.x-n.w,0):n.x,y:c?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},g=oa(e,y),v=g!==void 0&&g.y+g.h>t.y,D=g!==void 0&&t.x+t.w>g.x;if(!g)return Qo(e,n,l?y.x:void 0,c?y.y:void 0,r,f,s);if(v&&c)return Qo(e,n,void 0,n.y+1,r,f,s);if(v&&s===null)return t.y=n.y,n.y=n.y+n.h,[...e];if(D&&l)return Qo(e,t,n.x,void 0,r,f,s)}const h=l?n.x+1:void 0,p=c?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 iA={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,c=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,c))}}},lA={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)}}},uA={name:"containerBounds",constrainPosition(e,t,n,{cols:r,maxRows:s,containerHeight:i,rowHeight:l,margin:c}){const f=i>0?Math.floor((i+c[1])/(l+c[1])):s;return{x:Eo(t,0,Math.max(0,r-e.w)),y:Eo(n,0,Math.max(0,f-e.h))}}},ud=[iA,lA];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 cA(e,t,n,r,s,i){let l={w:n,h:r};for(const c of e)c.constrainSize&&(l=c.constrainSize(t,l.w,l.h,s,i));if(t.constraints)for(const c of t.constraints)c.constrainSize&&(l=c.constrainSize(t,l.w,l.h,s,i));return l}function np({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 tE({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:"absolute"}}function Sx(e){return e*100+"%"}function dA(e,t,n,r){return e+n>r?t:n}function nE(e,t,n){return e<0?t:n}function fA(e){return Math.max(0,e)}function cd(e){return Math.max(0,e)}var rp=(e,t,n)=>{const{left:r,height:s,width:i}=t,l=e.top-(s-e.height);return{left:r,width:i,height:nE(l,e.height,s),top:cd(l)}},sp=(e,t,n)=>{const{top:r,left:s,height:i,width:l}=t;return{top:r,height:i,width:dA(e.left,e.width,l,n),left:fA(s)}},op=(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:cd(r),left:0}:{height:s,width:i,top:cd(r),left:l}},ap=(e,t,n)=>{const{top:r,left:s,height:i,width:l}=t;return{width:l,left:s,height:nE(r,e.height,i),top:cd(r)}},hA=(e,t,n)=>rp(e,sp(e,t,n)),mA=(e,t,n)=>rp(e,op(e,t)),pA=(e,t,n)=>ap(e,sp(e,t,n)),yA=(e,t,n)=>ap(e,op(e,t)),gA={n:rp,ne:hA,e:sp,se:pA,s:ap,sw:yA,w:op,nw:mA};function xA(e,t,n,r){const s=gA[e];return s?s(t,{...t,...n},r):n}var ip={type:"transform",scale:1,calcStyle(e){return np(e)}},rE={type:"absolute",scale:1,calcStyle(e){return tE(e)}};function sE(e){return{type:"transform",scale:e,calcStyle(t){return np(t)},calcDragPosition(t,n,r,s){return{left:(t-r)/e,top:(n-s)/e}}}}var bA=ip,vA={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},EA={enabled:!0,bounded:!1,threshold:3},TA={enabled:!0,handles:["se"]},wA={enabled:!1,defaultItem:{w:1,h:1}};function lp(e,t,n,r,s){const i=r==="x"?"w":"h";t[r]+=1;const l=e.findIndex(f=>f.i===t.i),c=s??zd(e).length>0;for(let f=l+1;f<e.length;f++){const h=e[f];if(h!==void 0&&!h.static){if(!c&&h.y>t.y+t.h)break;ep(t,h)&&lp(e,h,n+t[i],r,c)}}t[r]=n}function kA(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;)lp(n,t,s.y+s.h,"y");return t.y=Math.max(t.y,0),t}function SA(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(lp(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 oE={type:"vertical",allowOverlap:!1,compact(e,t){const n=zd(e);let r=Ud(n);const s=rm(e),i=new Array(e.length);for(let l=0;l<s.length;l++){const c=s[l];if(c===void 0)continue;let f=fa(c);f.static||(f=kA(n,f,s,r),r=Math.max(r,f.y+f.h),n.push(f));const h=e.indexOf(c);i[h]=f,f.moved=!1}return i}},aE={type:"horizontal",allowOverlap:!1,compact(e,t){const n=zd(e),r=eE(e),s=new Array(e.length);for(let i=0;i<r.length;i++){const l=r[i];if(l===void 0)continue;let c=fa(l);c.static||(c=SA(n,c,t,r),n.push(c));const f=e.indexOf(l);s[f]=c,c.moved=!1}return s}},iE={type:null,allowOverlap:!1,compact(e,t){return Co(e)}},CA={...oE,allowOverlap:!0,compact(e,t){return Co(e)}},NA={...aE,allowOverlap:!0,compact(e,t){return Co(e)}},_A={...iE,allowOverlap:!0};function yu(e,t=!1,n=!1){let r;return t?e==="vertical"?r=CA:e==="horizontal"?r=NA:r=_A:e==="vertical"?r=oE:e==="horizontal"?r=aE:r=iE,n?{...r,preventCollision:n}:r}function lE(e){return Object.keys(e).sort((n,r)=>e[n]-e[r])}function Cx(e,t){const n=lE(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 Nx(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 c0(e,t,n,r,s,i){const l=e[n];if(l)return Co(l);let c=e[r];const f=lE(t),h=f.slice(f.indexOf(n));for(let v=0;v<h.length;v++){const D=h[v];if(D===void 0)continue;const k=e[D];if(k){c=k;break}}const p=Co(c||[]),y=tp(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:{}},d0={},f0={exports:{}},h0,_x;function DA(){if(_x)return h0;_x=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return h0=e,h0}var m0,Dx;function OA(){if(Dx)return m0;Dx=1;var e=DA();function t(){}function n(){}return n.resetWarningCache=t,m0=function(){function r(l,c,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},m0}var Ox;function Wd(){return Ox||(Ox=1,f0.exports=OA()()),f0.exports}var Fc={exports:{}},Ax;function AA(){if(Ax)return Fc.exports;Ax=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 un={},oo={},Ix;function Yd(){if(Ix)return oo;Ix=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 c=0,f=i.length;c<f;c++)if(l.apply(l,[i[c],c,i]))return i[c]}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,c){if(i[l])return new Error(`Invalid prop ${l} passed to ${c} - do not set this, set it on the child.`)}return oo}var ao={},Mx;function IA(){if(Mx)return ao;Mx=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 c,f;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const l=(f=(c=window.document)==null?void 0:c.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="",c=!0;for(let f=0;f<i.length;f++)c?(l+=i[f].toUpperCase(),c=!1):i[f]==="-"?c=!0:l+=i[f];return l}return ao.default=t(),ao}var Lx;function up(){if(Lx)return un;Lx=1,Object.defineProperty(un,"__esModule",{value:!0}),un.addClassName=R,un.addEvent=l,un.addUserSelectStyles=N,un.createCSSTransform=v,un.createSVGTransform=D,un.getTouch=T,un.getTouchIdentifier=E,un.getTranslation=k,un.innerHeight=p,un.innerWidth=y,un.matchesSelector=s,un.matchesSelectorAndParentsTo=i,un.offsetXYFromParent=g,un.outerHeight=f,un.outerWidth=h,un.removeClassName=S,un.removeEvent=c,un.scheduleRemoveUserSelectStyles=O;var e=Yd(),t=n(IA());function n(I,_){if(typeof WeakMap=="function")var P=new WeakMap,F=new WeakMap;return(n=function(H,U){if(!U&&H&&H.__esModule)return H;var Y,q,G={__proto__:null,default:H};if(H===null||typeof H!="object"&&typeof H!="function")return G;if(Y=U?F:P){if(Y.has(H))return Y.get(H);Y.set(H,G)}for(const ee in H)ee!=="default"&&{}.hasOwnProperty.call(H,ee)&&((q=(Y=Object.defineProperty)&&Object.getOwnPropertyDescriptor(H,ee))&&(q.get||q.set)?Y(G,ee,q):G[ee]=H[ee]);return G})(I,_)}let r="";function s(I,_){return r||(r=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(P){return(0,e.isFunction)(I[P])})),(0,e.isFunction)(I[r])?I[r](_):!1}function i(I,_,P){let F=I;do{if(s(F,_))return!0;if(F===P)return!1;F=F.parentNode}while(F);return!1}function l(I,_,P,F){if(!I)return;const H={capture:!0,...F};I.addEventListener?I.addEventListener(_,P,H):I.attachEvent?I.attachEvent("on"+_,P):I["on"+_]=P}function c(I,_,P,F){if(!I)return;const H={capture:!0,...F};I.removeEventListener?I.removeEventListener(_,P,H):I.detachEvent?I.detachEvent("on"+_,P):I["on"+_]=null}function f(I){let _=I.clientHeight;const P=I.ownerDocument.defaultView.getComputedStyle(I);return _+=(0,e.int)(P.borderTopWidth),_+=(0,e.int)(P.borderBottomWidth),_}function h(I){let _=I.clientWidth;const P=I.ownerDocument.defaultView.getComputedStyle(I);return _+=(0,e.int)(P.borderLeftWidth),_+=(0,e.int)(P.borderRightWidth),_}function p(I){let _=I.clientHeight;const P=I.ownerDocument.defaultView.getComputedStyle(I);return _-=(0,e.int)(P.paddingTop),_-=(0,e.int)(P.paddingBottom),_}function y(I){let _=I.clientWidth;const P=I.ownerDocument.defaultView.getComputedStyle(I);return _-=(0,e.int)(P.paddingLeft),_-=(0,e.int)(P.paddingRight),_}function g(I,_,P){const H=_===_.ownerDocument.body?{left:0,top:0}:_.getBoundingClientRect(),U=(I.clientX+_.scrollLeft-H.left)/P,Y=(I.clientY+_.scrollTop-H.top)/P;return{x:U,y:Y}}function v(I,_){const P=k(I,_,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:P}}function D(I,_){return k(I,_,"")}function k(I,_,P){let{x:F,y:H}=I,U=`translate(${F}${P},${H}${P})`;if(_){const Y=`${typeof _.x=="string"?_.x:_.x+P}`,q=`${typeof _.y=="string"?_.y:_.y+P}`;U=`translate(${Y}, ${q})`+U}return U}function T(I,_){return I.targetTouches&&(0,e.findInArray)(I.targetTouches,P=>_===P.identifier)||I.changedTouches&&(0,e.findInArray)(I.changedTouches,P=>_===P.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 N(I){if(!I)return;let _=I.getElementById("react-draggable-style-el");_||(_=I.createElement("style"),_.type="text/css",_.id="react-draggable-style-el",_.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
121
|
-
`,_.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
122
|
-
`,I.getElementsByTagName("head")[0].appendChild(_)),I.body&&R(I.body,"react-draggable-transparent-selection")}function O(I){window.requestAnimationFrame?window.requestAnimationFrame(()=>{A(I)}):A(I)}function A(I){if(I)try{if(I.body&&S(I.body,"react-draggable-transparent-selection"),I.selection)I.selection.empty();else{const _=(I.defaultView||window).getSelection();_&&_.type!=="Caret"&&_.removeAllRanges()}}catch{}}function R(I,_){I.classList?I.classList.add(_):I.className.match(new RegExp(`(?:^|\\s)${_}(?!\\S)`))||(I.className+=` ${_}`)}function S(I,_){I.classList?I.classList.remove(_):I.className=I.className.replace(new RegExp(`(?:^|\\s)${_}(?!\\S)`,"g"),"")}return un}var Zr={},Rx;function uE(){if(Rx)return Zr;Rx=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.canDragX=s,Zr.canDragY=i,Zr.createCoreData=c,Zr.createDraggableData=f,Zr.getBoundPosition=n,Zr.getControlPosition=l,Zr.snapToGrid=r;var e=Yd(),t=up();function n(y,g,v){if(!y.props.bounds)return[g,v];let{bounds:D}=y.props;D=typeof D=="string"?D:h(D);const k=p(y);if(typeof D=="string"){const{ownerDocument:T}=k,E=T.defaultView;let N;if(D==="parent"?N=k.parentNode:N=k.getRootNode().querySelector(D),!(N instanceof E.HTMLElement))throw new Error('Bounds selector "'+D+'" could not find an element.');const O=N,A=E.getComputedStyle(k),R=E.getComputedStyle(O);D={left:-k.offsetLeft+(0,e.int)(R.paddingLeft)+(0,e.int)(A.marginLeft),top:-k.offsetTop+(0,e.int)(R.paddingTop)+(0,e.int)(A.marginTop),right:(0,t.innerWidth)(O)-(0,t.outerWidth)(k)-k.offsetLeft+(0,e.int)(R.paddingRight)-(0,e.int)(A.marginRight),bottom:(0,t.innerHeight)(O)-(0,t.outerHeight)(k)-k.offsetTop+(0,e.int)(R.paddingBottom)-(0,e.int)(A.marginBottom)}}return(0,e.isNum)(D.right)&&(g=Math.min(g,D.right)),(0,e.isNum)(D.bottom)&&(v=Math.min(v,D.bottom)),(0,e.isNum)(D.left)&&(g=Math.max(g,D.left)),(0,e.isNum)(D.top)&&(v=Math.max(v,D.top)),[g,v]}function r(y,g,v){const D=Math.round(g/y[0])*y[0],k=Math.round(v/y[1])*y[1];return[D,k]}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,v){const D=typeof g=="number"?(0,t.getTouch)(y,g):null;if(typeof g=="number"&&!D)return null;const k=p(v),T=v.props.offsetParent||k.offsetParent||k.ownerDocument.body;return(0,t.offsetXYFromParent)(D||y,T,v.props.scale)}function c(y,g,v){const D=!(0,e.isNum)(y.lastX),k=p(y);return D?{node:k,deltaX:0,deltaY:0,lastX:g,lastY:v,x:g,y:v}:{node:k,deltaX:g-y.lastX,deltaY:v-y.lastY,lastX:y.lastX,lastY:y.lastY,x:g,y:v}}function f(y,g){const v=y.props.scale;return{node:g.node,x:y.state.x+g.deltaX/v,y:y.state.y+g.deltaY/v,deltaX:g.deltaX/v,deltaY:g.deltaY/v,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={},Px;function cE(){if(Px)return Bc;Px=1,Object.defineProperty(Bc,"__esModule",{value:!0}),Bc.default=e;function e(){}return Bc}var jx;function MA(){if(jx)return Cl;jx=1,Object.defineProperty(Cl,"__esModule",{value:!0}),Cl.default=void 0;var e=f(ha()),t=c(Wd()),n=c(md()),r=up(),s=uE(),i=Yd(),l=c(cE());function c(k){return k&&k.__esModule?k:{default:k}}function f(k,T){if(typeof WeakMap=="function")var E=new WeakMap,N=new WeakMap;return(f=function(O,A){if(!A&&O&&O.__esModule)return O;var R,S,I={__proto__:null,default:O};if(O===null||typeof O!="object"&&typeof O!="function")return I;if(R=A?N:E){if(R.has(O))return R.get(O);R.set(O,I)}for(const _ in O)_!=="default"&&{}.hasOwnProperty.call(O,_)&&((S=(R=Object.defineProperty)&&Object.getOwnPropertyDescriptor(O,_))&&(S.get||S.set)?R(I,_,S):I[_]=O[_]);return I})(k,T)}function h(k,T,E){return(T=p(T))in k?Object.defineProperty(k,T,{value:E,enumerable:!0,configurable:!0,writable:!0}):k[T]=E,k}function p(k){var T=y(k,"string");return typeof T=="symbol"?T:T+""}function y(k,T){if(typeof k!="object"||!k)return k;var E=k[Symbol.toPrimitive];if(E!==void 0){var N=E.call(k,T);if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(k)}const g={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let v=g.mouse,D=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:N}=E;if(this.props.disabled||!(T.target instanceof N.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 O=(0,r.getTouchIdentifier)(T);this.touchIdentifier=O;const A=(0,s.getControlPosition)(T,O,this);if(A==null)return;const{x:R,y:S}=A,I=(0,s.createCoreData)(this,R,S);(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)(N),this.dragging=!0,this.lastX=R,this.lastY=S,(0,r.addEvent)(N,v.move,this.handleDrag),(0,r.addEvent)(N,v.stop,this.handleDragStop))}),h(this,"handleDrag",T=>{const E=(0,s.getControlPosition)(T,this.touchIdentifier,this);if(E==null)return;let{x:N,y:O}=E;if(Array.isArray(this.props.grid)){let S=N-this.lastX,I=O-this.lastY;if([S,I]=(0,s.snapToGrid)(this.props.grid,S,I),!S&&!I)return;N=this.lastX+S,O=this.lastY+I}const A=(0,s.createCoreData)(this,N,O);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=N,this.lastY=O}),h(this,"handleDragStop",T=>{if(!this.dragging)return;const E=(0,s.getControlPosition)(T,this.touchIdentifier,this);if(E==null)return;let{x:N,y:O}=E;if(Array.isArray(this.props.grid)){let I=N-this.lastX||0,_=O-this.lastY||0;[I,_]=(0,s.snapToGrid)(this.props.grid,I,_),N=this.lastX+I,O=this.lastY+_}const A=(0,s.createCoreData)(this,N,O);if(this.props.onStop(T,A)===!1||this.mounted===!1)return!1;const S=this.findDOMNode();S&&this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(S.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",A),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,S&&((0,l.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(S.ownerDocument,v.move,this.handleDrag),(0,r.removeEvent)(S.ownerDocument,v.stop,this.handleDragStop))}),h(this,"onMouseDown",T=>(v=g.mouse,this.handleDragStart(T))),h(this,"onMouseUp",T=>(v=g.mouse,this.handleDragStop(T))),h(this,"onTouchStart",T=>(v=g.touch,this.handleDragStart(T))),h(this,"onTouchEnd",T=>(v=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,N;return(T=this.props)!=null&&T.nodeRef?(N=(E=this.props)==null?void 0:E.nodeRef)==null?void 0:N.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=D,h(D,"displayName","DraggableCore"),h(D,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(k,T){if(k[T]&&k[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(D,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Cl}var Fx;function LA(){return Fx||(Fx=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(ha()),n=p(Wd()),r=p(md()),s=AA(),i=up(),l=uE(),c=Yd(),f=p(MA()),h=p(cE());function p(E){return E&&E.__esModule?E:{default:E}}function y(E,N){if(typeof WeakMap=="function")var O=new WeakMap,A=new WeakMap;return(y=function(R,S){if(!S&&R&&R.__esModule)return R;var I,_,P={__proto__:null,default:R};if(R===null||typeof R!="object"&&typeof R!="function")return P;if(I=S?A:O){if(I.has(R))return I.get(R);I.set(R,P)}for(const F in R)F!=="default"&&{}.hasOwnProperty.call(R,F)&&((_=(I=Object.defineProperty)&&Object.getOwnPropertyDescriptor(R,F))&&(_.get||_.set)?I(P,F,_):P[F]=R[F]);return P})(E,N)}function g(){return g=Object.assign?Object.assign.bind():function(E){for(var N=1;N<arguments.length;N++){var O=arguments[N];for(var A in O)({}).hasOwnProperty.call(O,A)&&(E[A]=O[A])}return E},g.apply(null,arguments)}function v(E,N,O){return(N=D(N))in E?Object.defineProperty(E,N,{value:O,enumerable:!0,configurable:!0,writable:!0}):E[N]=O,E}function D(E){var N=k(E,"string");return typeof N=="symbol"?N:N+""}function k(E,N){if(typeof E!="object"||!E)return E;var O=E[Symbol.toPrimitive];if(O!==void 0){var A=O.call(E,N);if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(N==="string"?String:Number)(E)}class T extends t.Component{static getDerivedStateFromProps(N,O){let{position:A}=N,{prevPropsPosition:R}=O;return A&&(!R||A.x!==R.x||A.y!==R.y)?((0,h.default)("Draggable: getDerivedStateFromProps %j",{position:A,prevPropsPosition:R}),{x:A.x,y:A.y,prevPropsPosition:{...A}}):null}constructor(N){super(N),v(this,"onDragStart",(O,A)=>{if((0,h.default)("Draggable: onDragStart: %j",A),this.props.onStart(O,(0,l.createDraggableData)(this,A))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(O,A)=>{if(!this.state.dragging)return!1;(0,h.default)("Draggable: onDrag: %j",A);const R=(0,l.createDraggableData)(this,A),S={x:R.x,y:R.y,slackX:0,slackY:0};if(this.props.bounds){const{x:_,y:P}=S;S.x+=this.state.slackX,S.y+=this.state.slackY;const[F,H]=(0,l.getBoundPosition)(this,S.x,S.y);S.x=F,S.y=H,S.slackX=this.state.slackX+(_-S.x),S.slackY=this.state.slackY+(P-S.y),R.x=S.x,R.y=S.y,R.deltaX=S.x-this.state.x,R.deltaY=S.y-this.state.y}if(this.props.onDrag(O,R)===!1)return!1;this.setState(S)}),v(this,"onDragStop",(O,A)=>{if(!this.state.dragging||this.props.onStop(O,(0,l.createDraggableData)(this,A))===!1)return!1;(0,h.default)("Draggable: onDragStop: %j",A);const S={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:_,y:P}=this.props.position;S.x=_,S.y=P}this.setState(S)}),this.state={dragging:!1,dragged:!1,x:N.position?N.position.x:N.defaultPosition.x,y:N.position?N.position.y:N.defaultPosition.y,prevPropsPosition:{...N.position},slackX:0,slackY:0,isElementSVG:!1},N.position&&!(N.onDrag||N.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 N,O;return((O=(N=this.props)==null?void 0:N.nodeRef)==null?void 0:O.current)??r.default.findDOMNode(this)}render(){const{axis:N,bounds:O,children:A,defaultPosition:R,defaultClassName:S,defaultClassNameDragging:I,defaultClassNameDragged:_,position:P,positionOffset:F,scale:H,...U}=this.props;let Y={},q=null;const ee=!!!P||this.state.dragging,he=P||R,te={x:(0,l.canDragX)(this)&&ee?this.state.x:he.x,y:(0,l.canDragY)(this)&&ee?this.state.y:he.y};this.state.isElementSVG?q=(0,i.createSVGTransform)(te,F):Y=(0,i.createCSSTransform)(te,F);const ue=(0,s.clsx)(A.props.className||"",S,{[I]:this.state.dragging,[_]: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:ue,style:{...A.props.style,...Y},transform:q}))}}e.default=T,v(T,"displayName","Draggable"),v(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:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),v(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})})(d0)),d0}var Bx;function cp(){if(Bx)return Sl.exports;Bx=1;const{default:e,DraggableCore:t}=LA();return Sl.exports=e,Sl.exports.default=e,Sl.exports.DraggableCore=t,Sl.exports}var RA=cp(),Nl={exports:{}},_l={},Hc={},Hx;function PA(){if(Hx)return Hc;Hx=1,Hc.__esModule=!0,Hc.cloneElement=c;var e=t(ha());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 c(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={},Ux;function dE(){if(Ux)return Dl;Ux=1,Dl.__esModule=!0,Dl.resizableProps=void 0;var e=t(Wd());cp();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 zx;function fE(){if(zx)return _l;zx=1,_l.__esModule=!0,_l.default=void 0;var e=i(ha()),t=cp(),n=PA(),r=dE();const s=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function i(k,T){if(typeof WeakMap=="function")var E=new WeakMap,N=new WeakMap;return(i=function(O,A){if(!A&&O&&O.__esModule)return O;var R,S,I={__proto__:null,default:O};if(O===null||typeof O!="object"&&typeof O!="function")return I;if(R=A?N:E){if(R.has(O))return R.get(O);R.set(O,I)}for(const _ in O)_!=="default"&&{}.hasOwnProperty.call(O,_)&&((S=(R=Object.defineProperty)&&Object.getOwnPropertyDescriptor(O,_))&&(S.get||S.set)?R(I,_,S):I[_]=O[_]);return I})(k,T)}function l(){return l=Object.assign?Object.assign.bind():function(k){for(var T=1;T<arguments.length;T++){var E=arguments[T];for(var N in E)({}).hasOwnProperty.call(E,N)&&(k[N]=E[N])}return k},l.apply(null,arguments)}function c(k,T){if(k==null)return{};var E,N,O=f(k,T);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(k);for(N=0;N<A.length;N++)E=A[N],T.indexOf(E)===-1&&{}.propertyIsEnumerable.call(k,E)&&(O[E]=k[E])}return O}function f(k,T){if(k==null)return{};var E={};for(var N in k)if({}.hasOwnProperty.call(k,N)){if(T.indexOf(N)!==-1)continue;E[N]=k[N]}return E}function h(k,T){var E=Object.keys(k);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(k);T&&(N=N.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),E.push.apply(E,N)}return E}function p(k){for(var T=1;T<arguments.length;T++){var E=arguments[T]!=null?arguments[T]:{};T%2?h(Object(E),!0).forEach(function(N){y(k,N,E[N])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(E)):h(Object(E)).forEach(function(N){Object.defineProperty(k,N,Object.getOwnPropertyDescriptor(E,N))})}return k}function y(k,T,E){return(T=g(T))in k?Object.defineProperty(k,T,{value:E,enumerable:!0,configurable:!0,writable:!0}):k[T]=E,k}function g(k){var T=v(k,"string");return typeof T=="symbol"?T:T+""}function v(k,T){if(typeof k!="object"||!k)return k;var E=k[Symbol.toPrimitive];if(E!==void 0){var N=E.call(k,T);if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(k)}let D=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:N,maxConstraints:O,lockAspectRatio:A}=this.props;if(!N&&!O&&!A)return[T,E];if(A){const P=this.props.width/this.props.height,F=T-this.props.width,H=E-this.props.height;Math.abs(F)>Math.abs(H*P)?E=T/P:T=E*P}const[R,S]=[T,E];let[I,_]=this.slack||[0,0];return T+=I,E+=_,N&&(T=Math.max(N[0],T),E=Math.max(N[1],E)),O&&(T=Math.min(O[0],T),E=Math.min(O[1],E)),this.slack=[I+(R-T),_+(S-E)],[T,E]}resizeHandler(T,E){return(N,O)=>{var he;let{node:A,deltaX:R,deltaY:S}=O;T==="onResizeStart"&&this.resetData();const I=(this.props.axis==="both"||this.props.axis==="x")&&E!=="n"&&E!=="s",_=(this.props.axis==="both"||this.props.axis==="y")&&E!=="e"&&E!=="w";if(!I&&!_)return;const P=E[0],F=E[E.length-1],H=A.getBoundingClientRect();if(this.lastHandleRect!=null){if(F==="w"){const te=H.left-this.lastHandleRect.left;R+=te}if(P==="n"){const te=H.top-this.lastHandleRect.top;S+=te}}this.lastHandleRect=H,F==="w"&&(R=-R),P==="n"&&(S=-S);let U=this.props.width+(I?R/this.props.transformScale:0),Y=this.props.height+(_?S/this.props.transformScale:0);[U,Y]=this.runConstraints(U,Y),T==="onResizeStop"&&this.lastSize&&({width:U,height:Y}=this.lastSize);const q=U!==this.props.width||Y!==this.props.height;T!=="onResizeStop"&&(this.lastSize={width:U,height:Y});const G=typeof this.props[T]=="function"?this.props[T]:null;G&&!(T==="onResize"&&!q)&&((he=N.persist)==null||he.call(N),G(N,{node:A,size:{width:U,height:Y},handle:E})),T==="onResizeStop"&&this.resetData()}}renderResizeHandle(T,E){const{handle:N}=this.props;if(!N)return e.createElement("span",{className:`react-resizable-handle react-resizable-handle-${T}`,ref:E});if(typeof N=="function")return N(T,E);const O=typeof N.type=="string",A=p({ref:E},O?{}:{handleAxis:T});return e.cloneElement(N,A)}render(){const T=this.props,{children:E,className:N,draggableOpts:O,width:A,height:R,handle:S,handleSize:I,lockAspectRatio:_,axis:P,minConstraints:F,maxConstraints:H,onResize:U,onResizeStop:Y,onResizeStart:q,resizeHandles:G,transformScale:ee}=T,he=c(T,s);return(0,n.cloneElement)(E,p(p({},he),{},{className:`${N?`${N} `:""}react-resizable`,children:[...e.Children.toArray(E.props.children),...G.map(te=>{const ue=this.handleRefs[te]??(this.handleRefs[te]=e.createRef());return e.createElement(t.DraggableCore,l({},O,{nodeRef:ue,key:`resizableHandle-${te}`,onStop:this.resizeHandler("onResizeStop",te),onStart:this.resizeHandler("onResizeStart",te),onDrag:this.resizeHandler("onResize",te)}),this.renderResizeHandle(te,ue))})]}))}};return _l.default=D,D.propTypes=r.resizableProps,D.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},_l}var Ol={},Wx;function jA(){if(Wx)return Ol;Wx=1,Ol.__esModule=!0,Ol.default=void 0;var e=l(ha()),t=i(Wd()),n=i(fE()),r=dE();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 N=new WeakMap,O=new WeakMap;return(l=function(A,R){if(!R&&A&&A.__esModule)return A;var S,I,_={__proto__:null,default:A};if(A===null||typeof A!="object"&&typeof A!="function")return _;if(S=R?O:N){if(S.has(A))return S.get(A);S.set(A,_)}for(const P in A)P!=="default"&&{}.hasOwnProperty.call(A,P)&&((I=(S=Object.defineProperty)&&Object.getOwnPropertyDescriptor(A,P))&&(I.get||I.set)?S(_,P,I):_[P]=A[P]);return _})(T,E)}function c(){return c=Object.assign?Object.assign.bind():function(T){for(var E=1;E<arguments.length;E++){var N=arguments[E];for(var O in N)({}).hasOwnProperty.call(N,O)&&(T[O]=N[O])}return T},c.apply(null,arguments)}function f(T,E){var N=Object.keys(T);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(T);E&&(O=O.filter(function(A){return Object.getOwnPropertyDescriptor(T,A).enumerable})),N.push.apply(N,O)}return N}function h(T){for(var E=1;E<arguments.length;E++){var N=arguments[E]!=null?arguments[E]:{};E%2?f(Object(N),!0).forEach(function(O){p(T,O,N[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(N)):f(Object(N)).forEach(function(O){Object.defineProperty(T,O,Object.getOwnPropertyDescriptor(N,O))})}return T}function p(T,E,N){return(E=y(E))in T?Object.defineProperty(T,E,{value:N,enumerable:!0,configurable:!0,writable:!0}):T[E]=N,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 N=T[Symbol.toPrimitive];if(N!==void 0){var O=N.call(T,E);if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(E==="string"?String:Number)(T)}function v(T,E){if(T==null)return{};var N,O,A=D(T,E);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(T);for(O=0;O<R.length;O++)N=R[O],E.indexOf(N)===-1&&{}.propertyIsEnumerable.call(T,N)&&(A[N]=T[N])}return A}function D(T,E){if(T==null)return{};var N={};for(var O in T)if({}.hasOwnProperty.call(T,O)){if(E.indexOf(O)!==-1)continue;N[O]=T[O]}return N}let k=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,N)=>{var A;const{size:O}=N;this.props.onResize?((A=E.persist)==null||A.call(E),this.setState(O,()=>this.props.onResize&&this.props.onResize(E,N))):this.setState(O)}}static getDerivedStateFromProps(E,N){return N.propsWidth!==E.width||N.propsHeight!==E.height?{width:E.width,height:E.height,propsWidth:E.width,propsHeight:E.height}:null}render(){const E=this.props,{handle:N,handleSize:O,onResize:A,onResizeStart:R,onResizeStop:S,draggableOpts:I,minConstraints:_,maxConstraints:P,lockAspectRatio:F,axis:H,width:U,height:Y,resizeHandles:q,style:G,transformScale:ee}=E,he=v(E,s);return e.createElement(n.default,{axis:H,draggableOpts:I,handle:N,handleSize:O,height:this.state.height,lockAspectRatio:F,maxConstraints:P,minConstraints:_,onResizeStart:R,onResize:this.onResize,onResizeStop:S,resizeHandles:q,transformScale:ee,width:this.state.width},e.createElement("div",c({},he,{style:h(h({},G),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return Ol.default=k,k.propTypes=h(h({},r.resizableProps),{},{children:t.default.element}),Ol}var Yx;function FA(){return Yx||(Yx=1,Nl.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Nl.exports.Resizable=fE().default,Nl.exports.ResizableBox=jA().default),Nl.exports}var BA=FA();function hE(e){return function(n,r,s,i,l,c,f){return e(n,r,f)}}function $d(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),c=i.get(r);if(l&&c)return l===r&&c===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 mE(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 $x(e){return e.constructor===Object||e.constructor==null}function qx(e){return typeof e.then=="function"}function qd(e,t){return e===t||e!==e&&t!==t}var HA="[object Arguments]",UA="[object Boolean]",zA="[object Date]",WA="[object RegExp]",YA="[object Map]",$A="[object Number]",qA="[object Object]",VA="[object Set]",QA="[object String]",Vx=Object.prototype.toString;function Vd(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,s=e.areObjectsEqual,i=e.areRegExpsEqual,l=e.areSetsEqual,c=e.createIsNestedEqual,f=c(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($x(p)&&$x(y))return s(p,y,f,g);var v=Array.isArray(p),D=Array.isArray(y);if(v||D)return v===D&&t(p,y,f,g);var k=Vx.call(p);return k!==Vx.call(y)?!1:k===zA?n(p,y,f,g):k===WA?i(p,y,f,g):k===YA?r(p,y,f,g):k===VA?l(p,y,f,g):k===qA||k===HA?qx(p)||qx(y)?!1:s(p,y,f,g):k===UA||k===$A||k===QA?qd(p.valueOf(),y.valueOf()):!1}return h}function pE(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 GA=$d(pE);function yE(e,t){return qd(e.valueOf(),t.valueOf())}function gE(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(c,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(c,y,f,g,e,t,r))&&(i[p]=!0),p++}),l++,s=h}}),s}var KA=$d(gE),XA="_owner",JA=Object.prototype.hasOwnProperty;function xE(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===XA){var c=!!e.$$typeof,f=!!t.$$typeof;if((c||f)&&c!==f)return!1}if(!JA.call(t,l)||!n(e[l],t[l],l,l,e,t,r))return!1}return!0}var ZA=$d(xE);function bE(e,t){return e.source===t.source&&e.flags===t.flags}function vE(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,c){if(s){var f=!1,h=0;t.forEach(function(p,y){!f&&!i[h]&&(f=n(l,p,c,y,e,t,r))&&(i[h]=!0),h++}),s=f}}),s}var eI=$d(vE),EE=Object.freeze({areArraysEqual:pE,areDatesEqual:yE,areMapsEqual:gE,areObjectsEqual:xE,areRegExpsEqual:bE,areSetsEqual:vE,createIsNestedEqual:hE}),TE=Object.freeze({areArraysEqual:GA,areDatesEqual:yE,areMapsEqual:KA,areObjectsEqual:ZA,areRegExpsEqual:bE,areSetsEqual:eI,createIsNestedEqual:hE}),tI=Vd(EE);function ks(e,t){return tI(e,t,void 0)}Vd(mE(EE,{createIsNestedEqual:function(){return qd}}));Vd(TE);Vd(mE(TE,{createIsNestedEqual:function(){return qd}}));function Qx(e){const{children:t,cols:n,containerWidth:r,margin:s,containerPadding:i,rowHeight:l,maxRows:c,isDraggable:f,isResizable:h,isBounded:p,static:y,useCSSTransforms:g=!0,usePercentages:v=!1,transformScale:D=1,positionStrategy:k,dragThreshold:T=0,droppingPosition:E,className:N="",style:O,handle:A="",cancel:R="",x:S,y:I,w:_,h:P,minW:F=1,maxW:H=1/0,minH:U=1,maxH:Y=1/0,i:q,resizeHandles:G,resizeHandle:ee,constraints:he=ud,layoutItem:te,layout:ue=[],onDragStart:M,onDrag:Q,onDragStop:le,onResizeStart:j,onResize:se,onResizeStop:ye}=e,[xe,Oe]=C.useState(!1),[ae,de]=C.useState(!1),_e=C.useRef(null),ke=C.useRef({left:0,top:0}),Pe=C.useRef({top:0,left:0,width:0,height:0}),Ue=C.useRef(void 0),et=C.useRef(ue);et.current=ue;const Ke=C.useRef(null),ge=C.useRef(null),me=C.useRef(!1),fe=C.useRef({x:0,y:0}),J=C.useRef(!1),Z=C.useMemo(()=>({cols:n,containerPadding:i,containerWidth:r,margin:s,maxRows:c,rowHeight:l}),[n,i,r,s,c,l]),be=C.useMemo(()=>({cols:n,maxRows:c,containerWidth:r,containerHeight:0,rowHeight:l,margin:s,layout:[]}),[n,c,r,l,s]),Ne=C.useCallback(()=>({...be,layout:et.current}),[be]),$e=C.useMemo(()=>te??{i:q,x:S,y:I,w:_,h:P,minW:F,maxW:H,minH:U,maxH:Y},[te,q,S,I,_,P,F,H,U,Y]),ct=C.useCallback(Me=>{if(k!=null&&k.calcStyle)return k.calcStyle(Me);if(g)return np(Me);const ze=tE(Me);return v?{...ze,left:Sx(Me.left/r),width:Sx(Me.width/r)}:ze},[k,g,v,r]),ht=C.useCallback((Me,{node:ze})=>{if(!M)return;const{offsetParent:pt}=ze;if(!pt)return;const We=pt.getBoundingClientRect(),Yt=ze.getBoundingClientRect(),en=Yt.left/D,tn=We.left/D,$t=Yt.top/D,nn=We.top/D;let On;if(k!=null&&k.calcDragPosition){const lt=Me;On=k.calcDragPosition(lt.clientX,lt.clientY,lt.clientX-Yt.left,lt.clientY-Yt.top)}else On={left:en-tn+pt.scrollLeft,top:$t-nn+pt.scrollTop};if(ke.current=On,T>0){const lt=Me;fe.current={x:lt.clientX,y:lt.clientY},me.current=!0,J.current=!1,Oe(!0);return}Oe(!0);const qn=Rc(Z,On.top,On.left),{x:Vr,y:Ye}=Pc(he,$e,qn.x,qn.y,Ne());M(q,Vr,Ye,{e:Me,node:ze,newPosition:On})},[M,D,Z,k,T,he,$e,Ne,q]),ie=C.useCallback((Me,{node:ze,deltaX:pt,deltaY:We})=>{if(!Q||!xe)return;const Yt=Me;if(me.current&&!J.current){const Vr=Yt.clientX-fe.current.x,Ye=Yt.clientY-fe.current.y;if(Math.hypot(Vr,Ye)<T)return;if(J.current=!0,me.current=!1,M){const Ze=Rc(Z,ke.current.top,ke.current.left),{x:gt,y:Nt}=Pc(he,$e,Ze.x,Ze.y,Ne());M(q,gt,Nt,{e:Me,node:ze,newPosition:ke.current})}}let en=ke.current.top+We,tn=ke.current.left+pt;if(p){const{offsetParent:Vr}=ze;if(Vr){const Ye=Vr.clientHeight-vi(P,l,s[1]);en=ld(en,0,Ye);const lt=Ai(Z),Ze=r-vi(_,lt,s[0]);tn=ld(tn,0,Ze)}}const $t={top:en,left:tn};ke.current=$t;const nn=Rc(Z,en,tn),{x:On,y:qn}=Pc(he,$e,nn.x,nn.y,Ne());Q(q,On,qn,{e:Me,node:ze,newPosition:$t})},[Q,M,xe,T,p,P,l,s,Z,r,_,q,he,$e,Ne]),ve=C.useCallback((Me,{node:ze})=>{if(!le||!xe)return;const pt=me.current;if(me.current=!1,J.current=!1,fe.current={x:0,y:0},pt){Oe(!1),ke.current={left:0,top:0};return}const{left:We,top:Yt}=ke.current,en={top:Yt,left:We};Oe(!1),ke.current={left:0,top:0};const tn=Rc(Z,Yt,We),{x:$t,y:nn}=Pc(he,$e,tn.x,tn.y,Ne());le(q,$t,nn,{e:Me,node:ze,newPosition:en})},[le,xe,Z,he,$e,Ne,q]);Ke.current=ht,ge.current=ie;const Re=C.useCallback((Me,{node:ze,size:pt,handle:We},Yt,en)=>{const tn=en==="onResizeStart"?j:en==="onResize"?se:ye;if(!tn)return;let $t;ze?$t=xA(We,Yt,pt,r):$t={...pt,top:Yt.top,left:Yt.left},Pe.current=$t;const nn=rA(Z,$t.width,$t.height),{w:On,h:qn}=cA(he,$e,nn.w,nn.h,We,Ne());tn(q,On,qn,{e:Me.nativeEvent,node:ze,size:$t,handle:We})},[j,se,ye,r,Z,q,he,$e,Ne]),rt=C.useCallback((Me,ze)=>{de(!0);const pt=kl(Z,S,I,_,P),We={...ze,handle:ze.handle};Re(Me,We,pt,"onResizeStart")},[Re,Z,S,I,_,P]),ot=C.useCallback((Me,ze)=>{const pt=kl(Z,S,I,_,P),We={...ze,handle:ze.handle};Re(Me,We,pt,"onResize")},[Re,Z,S,I,_,P]),xt=C.useCallback((Me,ze)=>{de(!1),Pe.current={top:0,left:0,width:0,height:0};const pt=kl(Z,S,I,_,P),We={...ze,handle:ze.handle};Re(Me,We,pt,"onResizeStop")},[Re,Z,S,I,_,P]);C.useEffect(()=>{var We,Yt;if(!E)return;const Me=_e.current;if(!Me)return;const ze=Ue.current||{left:0,top:0},pt=xe&&(E.left!==ze.left||E.top!==ze.top);if(xe){if(pt){const en=E.left-ke.current.left,tn=E.top-ke.current.top,$t={node:Me,deltaX:en,deltaY:tn,lastX:ke.current.left,lastY:ke.current.top,x:E.left,y:E.top};(Yt=ge.current)==null||Yt.call(ge,E.e,$t)}}else{const en={node:Me,deltaX:E.left,deltaY:E.top,lastX:0,lastY:0,x:E.left,y:E.top};(We=Ke.current)==null||We.call(Ke,E.e,en)}Ue.current=E},[E,xe,q]);const Zt=kl(Z,S,I,_,P,xe?ke.current:null,ae?Pe.current:null),hn=Le.Children.only(t),Dn=kl(Z,0,0,1,1),$n=[Dn.width,Dn.height],Wt=[1/0,1/0],It=hn.props,yn=It.className,Or=It.style;let Xe=Le.cloneElement(hn,{ref:_e,className:Wn("react-grid-item",yn,N,{static:y,resizing:ae,"react-draggable":f,"react-draggable-dragging":xe,dropping:!!E,cssTransforms:g}),style:{...O,...Or,...ct(Zt)}});const ut=ee;return Xe=d.jsx(BA.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:Zt.width,height:Zt.height,minConstraints:$n,maxConstraints:Wt,onResizeStart:rt,onResize:ot,onResizeStop:xt,transformScale:D,resizeHandles:G,handle:ut,children:Xe}),Xe=d.jsx(RA.DraggableCore,{disabled:!f,onStart:ht,onDrag:ie,onStop:ve,handle:A,cancel:".react-resizable-handle"+(R?","+R:""),scale:D,nodeRef:_e,children:Xe}),Xe}var Es=()=>{},Gx="react-grid-layout",wE=!1;try{wE=/firefox/i.test(navigator.userAgent)}catch{}function nI(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 Kx(e,t,n,r){const s=[],i=new Set;Le.Children.forEach(t,c=>{if(!Le.isValidElement(c)||c.key===null)return;const f=String(c.key);i.add(f);const h=e.find(p=>p.i===f);if(h)s.push(fa(h));else{const y=c.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:Ud(s),w:1,h:1})}});const l=tp(s,{cols:n});return r.compact(l,n)}function kE(e){const{children:t,width:n,gridConfig:r,dragConfig:s,resizeConfig:i,dropConfig:l,positionStrategy:c=bA,compactor:f,constraints:h=ud,layout:p=[],droppingItem:y,autoSize:g=!0,className:v="",style:D={},innerRef:k,onLayoutChange:T=Es,onDragStart:E=Es,onDrag:N=Es,onDragStop:O=Es,onResizeStart:A=Es,onResize:R=Es,onResizeStop:S=Es,onDrop:I=Es,onDropDragOver:_=Es}=e,P=C.useMemo(()=>({...vA,...r}),[r]),F=C.useMemo(()=>({...EA,...s}),[s]),H=C.useMemo(()=>({...TA,...i}),[i]),U=C.useMemo(()=>({...wA,...l}),[l]),{cols:Y,rowHeight:q,maxRows:G,margin:ee,containerPadding:he}=P,{enabled:te,bounded:ue,handle:M,cancel:Q,threshold:le}=F,{enabled:j,handles:se,handleComponent:ye}=H,{enabled:xe,defaultItem:Oe,onDragOver:ae}=U,de=f??yu("vertical"),_e=de.type,ke=de.allowOverlap,Pe=de.preventCollision??!1,Ue=C.useMemo(()=>y??{i:"__dropping-elem__",...Oe},[y,Oe]),et=c.type==="transform",Ke=c.scale,ge=he??ee,[me,fe]=C.useState(!1),[J,Z]=C.useState(()=>Kx(p,t,Y,de)),[be,Ne]=C.useState(null),[$e,ct]=C.useState(!1),[ht,ie]=C.useState(null),[ve,Re]=C.useState(),rt=C.useRef(null),ot=C.useRef(null),xt=C.useRef(null),Zt=C.useRef(0),hn=C.useRef(J),Dn=C.useRef(p),$n=C.useRef(t),Wt=C.useRef(_e),It=C.useRef(J);It.current=J,C.useEffect(()=>{fe(!0),ks(J,p)||T(J)},[]),C.useEffect(()=>{if(be||ht)return;const Ye=!ks(p,Dn.current),lt=!nI(t,$n.current),Ze=_e!==Wt.current;if(Ye||lt||Ze){const Nt=Kx(Ye?p:J,t,Y,de);ks(Nt,J)||Z(Nt)}Dn.current=p,$n.current=t,Wt.current=_e},[p,t,Y,_e,de,be,ht,J]),C.useEffect(()=>{if(!be&&!ks(J,hn.current)){hn.current=J;const Ye=J.filter(lt=>lt.i!==Ue.i);T(Ye)}},[J,be,T,Ue.i]);const yn=C.useMemo(()=>{if(!g)return;const Ye=Ud(J),lt=ge[1];return Ye*q+(Ye-1)*ee[1]+lt*2+"px"},[g,J,q,ee,ge]),Or=C.useCallback((Ye,lt,Ze,gt)=>{const Nt=It.current,wt=Yo(Nt,Ye);if(!wt)return;const Lt={w:wt.w,h:wt.h,x:wt.x,y:wt.y,i:Ye};rt.current=fa(wt),xt.current=Nt,Ne(Lt),E(Nt,wt,wt,null,gt.e,gt.node)},[E]),Xe=C.useCallback((Ye,lt,Ze,gt)=>{const Nt=It.current,wt=rt.current,Lt=Yo(Nt,Ye);if(!Lt)return;const Rt={w:Lt.w,h:Lt.h,x:Lt.x,y:Lt.y,i:Ye},Mt=Qo(Nt,Lt,lt,Ze,!0,Pe,_e,Y,ke);N(Mt,wt,Lt,Rt,gt.e,gt.node),Z(de.compact(Mt,Y)),Ne(Rt)},[Pe,_e,Y,ke,de,N]),ut=C.useCallback((Ye,lt,Ze,gt)=>{if(!be)return;const Nt=It.current,wt=rt.current,Lt=Yo(Nt,Ye);if(!Lt)return;const Rt=Qo(Nt,Lt,lt,Ze,!0,Pe,_e,Y,ke),Mt=de.compact(Rt,Y);O(Mt,wt,Lt,null,gt.e,gt.node);const gn=xt.current;rt.current=null,xt.current=null,Ne(null),Z(Mt),gn&&!ks(gn,Mt)&&T(Mt)},[be,Pe,_e,Y,ke,de,O,T]),Me=C.useCallback((Ye,lt,Ze,gt)=>{const Nt=It.current,wt=Yo(Nt,Ye);wt&&(ot.current=fa(wt),xt.current=Nt,ct(!0),A(Nt,wt,wt,null,gt.e,gt.node))},[A]),ze=C.useCallback((Ye,lt,Ze,gt)=>{const Nt=It.current,wt=ot.current,{handle:Lt}=gt;let Rt=!1,Mt,gn;const[Ea,pr]=aA(Nt,Ye,Pt=>(Mt=Pt.x,gn=Pt.y,["sw","w","nw","n","ne"].includes(Lt)&&(["sw","nw","w"].includes(Lt)&&(Mt=Pt.x+(Pt.w-lt),lt=Pt.x!==Mt&&Mt<0?Pt.w:lt,Mt=Mt<0?0:Mt),["ne","n","nw"].includes(Lt)&&(gn=Pt.y+(Pt.h-Ze),Ze=Pt.y!==gn&&gn<0?Pt.h:Ze,gn=gn<0?0:gn),Rt=!0),Pe&&!ke&&Z2(Nt,{...Pt,w:lt,h:Ze,x:Mt??Pt.x,y:gn??Pt.y}).filter(Ta=>Ta.i!==Pt.i).length>0&&(gn=Pt.y,Ze=Pt.h,Mt=Pt.x,lt=Pt.w,Rt=!1),Pt.w=lt,Pt.h=Ze,Pt));if(!pr)return;let js=Ea;Rt&&Mt!==void 0&&gn!==void 0&&(js=Qo(Ea,pr,Mt,gn,!0,Pe,_e,Y,ke));const Do={w:pr.w,h:pr.h,x:pr.x,y:pr.y,i:Ye,static:!0};R(js,wt,pr,Do,gt.e,gt.node),Z(de.compact(js,Y)),Ne(Do)},[Pe,_e,Y,ke,de,R]),pt=C.useCallback((Ye,lt,Ze,gt)=>{const Nt=It.current,wt=ot.current,Lt=Yo(Nt,Ye),Rt=de.compact(Nt,Y);S(Rt,wt,Lt??null,null,gt.e,gt.node);const Mt=xt.current;ot.current=null,xt.current=null,Ne(null),ct(!1),Z(Rt),Mt&&!ks(Mt,Rt)&&T(Rt)},[Y,de,S,T]),We=C.useCallback(()=>{const Ye=It.current;if(!Ye.some(gt=>gt.i===Ue.i)){ie(null),Ne(null),Re(void 0);return}const Ze=de.compact(Ye.filter(gt=>gt.i!==Ue.i),Y);Z(Ze),ie(null),Ne(null),Re(void 0)},[Ue.i,Y,de]),Yt=C.useCallback(Ye=>{var bu;if(Ye.preventDefault(),Ye.stopPropagation(),wE&&!((bu=Ye.nativeEvent.target)!=null&&bu.classList.contains(Gx)))return!1;const lt=ae?ae(Ye.nativeEvent):_(Ye);if(lt===!1)return ht&&We(),!1;const{dragOffsetX:Ze=0,dragOffsetY:gt=0,...Nt}=lt??{},wt={...Ue,...Nt},Lt=Ye.currentTarget.getBoundingClientRect(),Rt={cols:Y,margin:ee,maxRows:G,rowHeight:q,containerWidth:n,containerPadding:ge},Mt=Ai(Rt),gn=vi(wt.w,Mt,ee[0]),Ea=vi(wt.h,q,ee[1]),pr=gn/2,js=Ea/2,Do=Ye.clientX-Lt.left+Ze-pr,Pt=Ye.clientY-Lt.top+gt-js,Ri=Math.max(0,Do),Ta=Math.max(0,Pt),jt={left:Ri/Ke,top:Ta/Ke,e:Ye.nativeEvent};if(ht)ve&&(ve.left!==jt.left||ve.top!==jt.top)&&Re(jt);else{const Oo=nA(Rt,Ta,Ri,wt.w,wt.h);ie(d.jsx("div",{},wt.i)),Re(jt),Z([...It.current,{...wt,x:Oo.x,y:Oo.y,static:!1,isDraggable:!0}])}},[ht,ve,Ue,ae,_,We,Ke,Y,ee,G,q,n,ge]),en=C.useCallback(Ye=>{Ye.preventDefault(),Ye.stopPropagation(),Zt.current--,Zt.current<0&&(Zt.current=0),Zt.current===0&&We()},[We]),tn=C.useCallback(Ye=>{Ye.preventDefault(),Ye.stopPropagation(),Zt.current++},[]),$t=C.useCallback(Ye=>{Ye.preventDefault(),Ye.stopPropagation();const lt=It.current,Ze=lt.find(gt=>gt.i===Ue.i);Zt.current=0,We(),I(lt,Ze,Ye.nativeEvent)},[Ue.i,We,I]),nn=C.useCallback((Ye,lt)=>{if(!Ye||!Ye.key)return null;const Ze=Yo(J,String(Ye.key));if(!Ze)return null;const gt=typeof Ze.isDraggable=="boolean"?Ze.isDraggable:!Ze.static&&te,Nt=typeof Ze.isResizable=="boolean"?Ze.isResizable:!Ze.static&&j,wt=Ze.resizeHandles||[...se],Lt=gt&&ue&&Ze.isBounded!==!1,Rt=ye;return d.jsx(Qx,{containerWidth:n,cols:Y,margin:ee,containerPadding:ge,maxRows:G,rowHeight:q,cancel:Q,handle:M,onDragStart:Or,onDrag:Xe,onDragStop:ut,onResizeStart:Me,onResize:ze,onResizeStop:pt,isDraggable:gt,isResizable:Nt,isBounded:Lt,useCSSTransforms:et&&me,usePercentages:!me,transformScale:Ke,positionStrategy:c,dragThreshold:le,w:Ze.w,h:Ze.h,x:Ze.x,y:Ze.y,i:Ze.i,minH:Ze.minH,minW:Ze.minW,maxH:Ze.maxH,maxW:Ze.maxW,static:Ze.static,droppingPosition:lt?ve:void 0,resizeHandles:wt,resizeHandle:Rt,constraints:h,layoutItem:Ze,layout:J,children:Ye},Ze.i)},[J,n,Y,ee,ge,G,q,Q,M,Or,Xe,ut,Me,ze,pt,te,j,ue,et,me,Ke,c,le,ve,se,ye,h]),On=()=>be?d.jsx(Qx,{w:be.w,h:be.h,x:be.x,y:be.y,i:be.i,className:`react-grid-placeholder ${$e?"placeholder-resizing":""}`,containerWidth:n,cols:Y,margin:ee,containerPadding:ge,maxRows:G,rowHeight:q,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:et,transformScale:Ke,constraints:h,layout:J,children:d.jsx("div",{})}):null,qn=Wn(Gx,v),Vr={height:yn,...D};return d.jsxs("div",{ref:k,className:qn,style:Vr,onDrop:xe?$t:void 0,onDragLeave:xe?en:void 0,onDragEnter:xe?tn:void 0,onDragOver:xe?Yt:void 0,children:[Le.Children.map(t,Ye=>Le.isValidElement(Ye)?nn(Ye):null),xe&&ht&&nn(ht,!0),On()]})}var rI={lg:1200,md:996,sm:768,xs:480,xxs:0},sI={lg:12,md:10,sm:6,xs:4,xxs:2},p0=()=>{};function oI(e,t,n,r){const s=[];Le.Children.forEach(t,l=>{if(!Le.isValidElement(l)||l.key===null)return;const c=String(l.key),f=e.find(h=>h.i===c);if(f)s.push({...f,i:c});else{const p=l.props["data-grid"];p?s.push({i:c,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:c,x:0,y:Ud(s),w:1,h:1})}});const i=tp(s,{cols:n});return r.compact(i,n)}function aI(e){const{children:t,width:n,breakpoint:r,breakpoints:s=rI,cols:i=sI,layouts:l={},rowHeight:c=150,maxRows:f=1/0,margin:h=[10,10],containerPadding:p=null,compactor:y,onBreakpointChange:g=p0,onLayoutChange:v=p0,onWidthChange:D=p0,...k}=e,T=y??yu("vertical"),E=T.type,N=T.allowOverlap,O=C.useMemo(()=>r??Cx(s,n),[]),A=C.useMemo(()=>Nx(O,i),[O,i]),R=C.useMemo(()=>c0(l,s,O,O,A,E),[]),[S,I]=C.useState(O),[_,P]=C.useState(A),[F,H]=C.useState(R),[U,Y]=C.useState(l),q=C.useRef(n),G=C.useRef(r),ee=C.useRef(s),he=C.useRef(i),te=C.useRef(l),ue=C.useRef(E),M=C.useRef(U);C.useEffect(()=>{M.current=U},[U]);const Q=C.useMemo(()=>ks(l,te.current)?null:c0(l,s,S,S,_,T),[l,s,S,_,T]),le=Q??F;C.useEffect(()=>{Q!==null&&(H(Q),Y(l),M.current=l,te.current=l)},[Q,l]),C.useEffect(()=>{if(E!==ue.current){const Oe=T.compact(Co(le),_),ae={...M.current,[S]:Oe};H(Oe),Y(ae),M.current=ae,v(Oe,ae),ue.current=E}},[E,T,le,_,N,S,v]),C.useEffect(()=>{const Oe=n!==q.current,ae=r!==G.current,de=!ks(s,ee.current),_e=!ks(i,he.current);if(Oe||ae||de||_e){const ke=r??Cx(s,n),Pe=Nx(ke,i),Ue=S;if(Ue!==ke||de||_e){const ge={...M.current};ge[Ue]||(ge[Ue]=Co(F));let me=c0(ge,s,ke,Ue,Pe,T);me=oI(me,t,Pe,T),ge[ke]=me,I(ke),P(Pe),H(me),Y(ge),M.current=ge,g(ke,Pe),v(me,ge)}const et=jc(h,ke),Ke=p?jc(p,ke):null;D(n,et,Pe,Ke),q.current=n,G.current=r,ee.current=s,he.current=i}},[n,r,s,i,S,_,F,t,T,E,N,h,p,g,v,D]);const j=C.useCallback(Oe=>{const de={...M.current,[S]:Oe};H(Oe),Y(de),M.current=de,v(Oe,de)},[S,v]),se=C.useMemo(()=>jc(h,S),[h,S]),ye=C.useMemo(()=>p===null?null:jc(p,S),[p,S]),xe=C.useMemo(()=>({cols:_,rowHeight:c,maxRows:f,margin:se,containerPadding:ye}),[_,c,f,se,ye]);return d.jsx(kE,{...k,width:n,gridConfig:xe,compactor:T,onLayoutChange:j,layout:le,children:t})}function SE(e){const{children:t,width:n,cols:r=12,rowHeight:s=150,maxRows:i=1/0,margin:l=[10,10],containerPadding:c=null,layout:f,droppingItem:h,compactType:p,preventCollision:y=!1,allowOverlap:g=!1,verticalCompact:v,isDraggable:D=!0,isBounded:k=!1,draggableHandle:T,draggableCancel:E,isResizable:N=!0,resizeHandles:O=["se"],resizeHandle:A,isDroppable:R=!1,useCSSTransforms:S=!0,transformScale:I=1,autoSize:_,className:P,style:F,innerRef:H,onLayoutChange:U,onDragStart:Y,onDrag:q,onDragStop:G,onResizeStart:ee,onResize:he,onResizeStop:te,onDrop:ue,onDropDragOver:M}=e;let Q=p===void 0?"vertical":p;v===!1&&(Q=null);const le={cols:r,rowHeight:s,maxRows:i,margin:l,containerPadding:c},j={enabled:D,bounded:k,handle:T,cancel:E,threshold:0},se={enabled:N,handles:O,handleComponent:A},ye={enabled:R};let xe;S?I!==1?xe=sE(I):xe=ip:xe=rE;const Oe=yu(Q,g,y),ae=k?[...ud,uA]:ud;return d.jsx(kE,{width:n,gridConfig:le,dragConfig:j,resizeConfig:se,dropConfig:ye,positionStrategy:xe,compactor:Oe,constraints:ae,layout:f,droppingItem:h,autoSize:_,className:P,style:F,innerRef:H,onLayoutChange:U,onDragStart:Y,onDrag:q,onDragStop:G,onResizeStart:ee,onResize:he,onResizeStop:te,onDrop:ue,onDropDragOver:M,children:t})}SE.displayName="ReactGridLayout";var iI=SE;function CE(e){const{children:t,width:n,breakpoint:r,breakpoints:s,cols:i,layouts:l,onBreakpointChange:c,onLayoutChange:f,onWidthChange:h,rowHeight:p,maxRows:y,margin:g,containerPadding:v,droppingItem:D,compactType:k,preventCollision:T=!1,allowOverlap:E=!1,verticalCompact:N,isDraggable:O=!0,isBounded:A=!1,draggableHandle:R,draggableCancel:S,isResizable:I=!0,resizeHandles:_=["se"],resizeHandle:P,isDroppable:F=!1,useCSSTransforms:H=!0,transformScale:U=1,autoSize:Y,className:q,style:G,innerRef:ee,onDragStart:he,onDrag:te,onDragStop:ue,onResizeStart:M,onResize:Q,onResizeStop:le,onDrop:j,onDropDragOver:se}=e;let ye=k===void 0?"vertical":k;N===!1&&(ye=null);const xe={enabled:O,bounded:A,handle:R,cancel:S},Oe={enabled:I,handles:_,handleComponent:P},ae={enabled:F};let de;H?U!==1?de=sE(U):de=ip:de=rE;const _e=yu(ye,E,T);return d.jsx(aI,{width:n,breakpoint:r,breakpoints:s,cols:i,layouts:l,rowHeight:p,maxRows:y,margin:g,containerPadding:v,compactor:_e,dragConfig:xe,resizeConfig:Oe,dropConfig:ae,positionStrategy:de,droppingItem:D,autoSize:Y,className:q,style:G,innerRef:ee,onBreakpointChange:c,onLayoutChange:f,onWidthChange:h,onDragStart:he,onDrag:te,onDragStop:ue,onResizeStart:M,onResize:Q,onResizeStop:le,onDrop:j,onDropDragOver:se,children:t})}CE.displayName="ResponsiveReactGridLayout";var lI=CE;function uI(e){const t=e,n=[...e].sort((h,p)=>h.y-p.y||h.x-p.x),r=[];let s=0,i=0,l=0;for(const h of n){const p=Math.min(h.w,6);i+p>6&&(s+=l,i=0,l=0),r.push({...h,x:i,y:s,w:p}),i+=p,l=Math.max(l,h.h)}const c=[];let f=0;for(const h of n)c.push({...h,x:0,y:f,w:1}),f+=h.h;return{lg:t,md:r,sm:c}}function cI(e,t,n,r){const s=Object.values(n);if(s.length===0)return e;let i=e,l=!1;for(const c of s){if(c.sourceChart===r||!t.some(h=>h.name===c.field))continue;const f=i.filter(h=>String(h[c.field])===c.value);f.length!==i.length&&(l=!0),i=f}return l?i:e}function NE(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),c=t==null?void 0:t.some(f=>f.name===i.field);return!l&&!c})}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 dI(e,t){const n=e>=0?"+":"";return t==="percent_change"?`${n}${e.toFixed(1)}%`:`${n}${e.toLocaleString()}`}function fI({chartRef:e}){var F,H,U,Y,q,G;const{data:t}=Vb(e),{data:n,isLoading:r,error:s,isFetching:i}=uv(e),l=Om(),c=Je(ee=>ee.crossFilters),f=C.useMemo(()=>n!=null&&n.columns?NE(n.columns,t==null?void 0:t.parameters,c,e):!1,[n==null?void 0:n.columns,t==null?void 0:t.parameters,c,e]),h=()=>{l(e)},p=()=>{if(!n||!t)return;const ee=t.name||e;Od(n.rows,n.columns,ee)};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(id,{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(!((H=g==null?void 0:g.value)!=null&&H.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 v=y[g.value.field],D=Al(v,g.format);let k=null,T="percent_change",E,N,O;if(n.comparison)k=n.comparison.change,T=n.comparison.changeType,E=n.comparison.currentPeriodLabel,N=n.comparison.previousPeriodLabel,O=Al(n.comparison.previousValue,g.format);else if((U=g.comparison)!=null&&U.enabled&&g.comparison.field){const ee=y[g.comparison.field];T=g.comparison.type,ee&&ee!==0&&(T==="percent_change"?k=(v-ee)/ee*100:k=v-ee,O=Al(ee,g.format))}const A=g.goal,R=A&&A.value!==0?Math.max(0,Math.min(v/A.value*100,100)):null,S=A?v>=A.value?"var(--yc-color-success)":"var(--yc-color-danger)":void 0,I=t==null?void 0:t.drillDown,_=!!(I!=null&&I.chart||I!=null&&I.model),P=()=>{if(!I)return;const ee=new URLSearchParams({_from:e});I.chart?window.location.hash=`/charts/${I.chart}?${ee.toString()}`:I.model&&(window.location.hash=`/charts/${e}/detail?${ee.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(G2,{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.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:Wn("font-bold leading-none text-center",_&&"cursor-pointer hover:opacity-75 transition-opacity"),style:{color:"var(--yc-color-text)",fontSize:"clamp(1.25rem, min(40cqh, 14cqw), 8rem)"},onClick:_?P:void 0,role:_?"button":void 0,tabIndex:_?0:void 0,onKeyDown:_?ee=>{(ee.key==="Enter"||ee.key===" ")&&P()}:void 0,children:[D,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}),k!==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:k>=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:dI(k,T)}),O&&d.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:["vs ",O]}),!O&&((Y=g.comparison)==null?void 0:Y.label)&&d.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:g.comparison.label}),(N||O||((q=g.comparison)==null?void 0:q.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:[N&&d.jsx("div",{className:"font-medium",children:N}),!N&&((G=g.comparison)==null?void 0:G.label)&&d.jsx("div",{className:"font-medium",children:g.comparison.label}),O&&d.jsxs("div",{style:{opacity:.75},className:"mt-0.5",children:["Previous: ",O]})]})})]}),A&&R!==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(v,g.format)," / ",Al(A.value,g.format)]}),d.jsxs("span",{children:[R.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:`${R}%`,backgroundColor:S}})})]}),A.label&&d.jsx("div",{className:"text-xs mt-1 text-center",style:{color:"var(--yc-color-text-muted)"},children:A.label})]})]})]})}function hI({chartRef:e}){var ae,de,_e,ke,Pe,Ue,et,Ke,ge;const{data:t,isLoading:n,isFetching:r,error:s}=bN(e),{data:i}=ya(),l=t==null?void 0:t.config,c=t,f=Om(),h=C.useRef(null),[p,y]=C.useState(!1),g=Je(me=>me.chartFilters),v=Je(me=>me.resetChartFilters),D=Je(me=>me.crossFilters),k=Je(me=>me.setCrossFilter),{events:T}=fv(e),E=So(me=>me.auth),N=Yn(),[O,A]=C.useState(null),R=E.status==="disabled"||E.status==="authenticated"&&(E.user.role==="admin"||E.user.role==="editor"),S=((de=(ae=l==null?void 0:l.chart)==null?void 0:ae.x)==null?void 0:de.type)==="temporal",I=Ja({mutationFn:me=>ft.createChartEvent({date:me.date,label:me.label,...me.color?{color:me.color}:{}}),onSuccess:()=>{N.invalidateQueries({queryKey:["chartEvents"]}),A(null)}}),_=g[e]&&Object.keys(g[e]).length>0,P=C.useMemo(()=>{for(const me of Object.values(D))if(me.sourceChart===e)return{field:me.field,value:me.value};return null},[D,e]),F=C.useMemo(()=>!(c!=null&&c.rows)||!(c!=null&&c.columns)?(c==null?void 0:c.rows)??[]:cI(c.rows,c.columns,D,e),[c==null?void 0:c.rows,c==null?void 0:c.columns,D,e]),H=C.useMemo(()=>c!=null&&c.columns?NE(c.columns,l==null?void 0:l.parameters,D,e):!1,[c==null?void 0:c.columns,l==null?void 0:l.parameters,D,e]),[U,Y]=C.useState(null),q=C.useCallback((me,fe,J,Z)=>{var Ne;let be;if(Z&&((Ne=l==null?void 0:l.chart)!=null&&Ne.series)&&"field"in l.chart.series){const $e=l.chart.series.field;$e&&$e!==me&&(be={[me]:fe,[$e]:Z})}Y({x:J.x,y:J.y,field:me,value:fe,allFields:be})},[l]),G=C.useCallback(()=>{var me,fe,J,Z;if(U)if(U.allFields)for(const[be,Ne]of Object.entries(U.allFields)){const $e=((fe=(me=l==null?void 0:l.chart)==null?void 0:me.x)==null?void 0:fe.type)==="temporal"&&be===l.chart.x.field;k(be,Ne,e,$e||void 0)}else{const be=((Z=(J=l==null?void 0:l.chart)==null?void 0:J.x)==null?void 0:Z.type)==="temporal"&&U.field===l.chart.x.field;k(U.field,U.value,e,be||void 0)}},[U,k,e,l]),ee=C.useCallback(()=>{U&&A(U.value)},[U]),he=C.useCallback(()=>{var Z,be,Ne;if(!U||!((Z=l==null?void 0:l.drillDown)!=null&&Z.model))return;const me=l.drillDown,fe=me.fields?typeof me.fields=="string"?me.fields:me.fields[0]:me.field??((Ne=(be=l.chart)==null?void 0:be.x)==null?void 0:Ne.field)??U.field,J=new URLSearchParams;if(U.allFields)for(const[$e,ct]of Object.entries(U.allFields))J.set($e,ct);else J.set(fe,U.value);J.set("_from",e),window.location.hash=`/charts/${e}/detail?${J.toString()}`,Y(null)},[U,l,e]),te=C.useCallback(()=>{var Z,be,Ne;if(!U||!((Z=l==null?void 0:l.drillDown)!=null&&Z.chart))return;const me=l.drillDown,fe=me.fields?typeof me.fields=="string"?me.fields:me.fields[0]:me.field??((Ne=(be=l.chart)==null?void 0:be.x)==null?void 0:Ne.field)??U.field,J=new URLSearchParams;if(U.allFields)for(const[$e,ct]of Object.entries(U.allFields))J.set($e,ct);else J.set(fe,U.value);J.set("_from",e),window.location.hash=`/charts/${l.drillDown.chart}?${J.toString()}`,Y(null)},[U,l,e]),ue=()=>{f(e)},M=()=>{v(e),y(!1)},Q=()=>{if(!c||!l)return;const me=l.name||e;Od(F,c.columns,me)},le=()=>{var fe;const me=(fe=h.current)==null?void 0:fe.getDataURL("png");me&&l&&nd(me,`${l.name||e}.png`)},j=()=>{var fe;const me=(fe=h.current)==null?void 0:fe.getDataURL("svg");me&&l&&nd(me,`${l.name||e}.svg`)},se=async()=>{var fe;const me=(fe=h.current)==null?void 0:fe.getDataURL("png");me&&l&&await b6(me,l.name||e,l.title)};if(!l&&s)return d.jsx(id,{isLoading:!1,error:s,data:void 0,onRetry:()=>f(e),children:d.jsx("div",{})});if(!l||!c)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(((_e=l.chart)==null?void 0:_e.type)==="kpi")return d.jsx(fI,{chartRef:e});const ye=["line","bar","area","pie","donut","scatter","combo","heatmap","funnel","waterfall","gauge"].includes(l.chart.type),xe=()=>{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(F2,{ref:h,data:F,columns:c.columns,xAxis:l.chart.x,yAxis:l.chart.y,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:q,activeCrossFilter:P,events:T,goalData:c.goalData});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(B2,{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:q,activeCrossFilter:P,events:T,goalData:c.goalData});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(H2,{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:q,activeCrossFilter:P,events:T,goalData:c.goalData});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(U2,{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:q,activeCrossFilter:P});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(z2,{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:q,activeCrossFilter:P});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(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:q,activeCrossFilter:P});case"table":return d.jsx(tm,{data:F,columns:c.columns,chartConfig:l.chart,height:"100%",loading:r,onRowClick:l!=null&&l.drillDown?(me,fe,J)=>{const Z=l.drillDown,be=Z.fields?typeof Z.fields=="string"?[Z.fields]:Z.fields:Z.field?[Z.field]:[];if(be.length===0)return;const Ne={};for(const $e of be)$e in me?Ne[$e]=String(me[$e]??""):J?Ne[$e]=J:Ne[$e]="";Y({x:fe.x,y:fe.y,field:be[0],value:Ne[be[0]],allFields:be.length>1?Ne:void 0})}:void 0});case"metric":return l.chart.y?d.jsx(Q6,{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(Y2,{ref:h,data:F,xAxis:l.chart.x,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:q,activeCrossFilter:P,events:T,goalData:c.goalData}):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($2,{ref:h,data:F,chartConfig:l.chart,height:"100%",loading:r});case"funnel":return d.jsx(q2,{ref:h,data:F,chartConfig:l.chart,height:"100%",loading:r});case"waterfall":return d.jsx(V2,{ref:h,data:F,chartConfig:l.chart,height:"100%",loading:r});case"gauge":return d.jsx(Q2,{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']})}},Oe=l.parameters&&l.parameters.length>0;return d.jsx(rd,{fallback:(me,fe)=>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:me.message}),d.jsx("button",{onClick:fe,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}),(((ke=l==null?void 0:l.drillDown)==null?void 0:ke.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.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded",children:"Filtered"}),H&&!_&&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:[Oe&&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(G2,{onRefresh:ue,onExportCSV:Q,onExportPNG:ye?le:Q,onExportSVG:ye?j:Q,onExportPDF:ye?se:void 0,isRefreshing:r})]})]}),p&&Oe&&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(_2,{parameters:l.parameters,chartName:e}),_&&d.jsx("button",{onClick:M,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(id,{isLoading:n,error:s,data:F,onRetry:()=>f(e),children:xe()})}),U&&d.jsx(K2,{x:U.x,y:U.y,field:U.field,value:U.value,allFields:U.allFields,onFilter:G,onViewDetails:(Ue=l==null?void 0:l.drillDown)!=null&&Ue.model?he:void 0,onGoToChart:(et=l==null?void 0:l.drillDown)!=null&&et.chart?te:void 0,onAddEvent:R?ee:void 0,detailModel:(Ke=l==null?void 0:l.drillDown)==null?void 0:Ke.model,targetChart:(ge=l==null?void 0:l.drillDown)==null?void 0:ge.chart,isTemporalChart:S,onClose:()=>Y(null)}),O&&d.jsx(X2,{date:O,onSave:me=>I.mutate(me),onClose:()=>A(null),saving:I.isPending})]})})}const Xx=/[#.]/g;function mI(e,t){const n=e||"",r={};let s=0,i,l;for(;s<n.length;){Xx.lastIndex=s;const c=Xx.exec(n),f=n.slice(s,c?c.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),c&&(i=c[0],s++)}return{type:"element",tagName:l||t||"div",properties:r,children:[]}}function _E(e,t,n){const r=n?xI(n):void 0;function s(i,l,...c){let f;if(i==null){f={type:"root",children:[]};const h=l;c.unshift(h)}else{f=mI(i,t);const h=f.tagName.toLowerCase(),p=r?r.get(h):void 0;if(f.tagName=p||h,pI(l))c.unshift(l);else for(const[y,g]of Object.entries(l))yI(e,f.properties,y,g)}for(const h of c)sm(f.children,h);return f.type==="element"&&f.tagName==="template"&&(f.content={type:"root",children:f.children},f.children=[]),f}return s}function pI(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 yI(e,t,n,r){const s=wd(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=L1(r):s.commaSeparated?i=D1(r):s.commaOrSpaceSeparated?i=L1(D1(r).join(" ")):i=Jx(s,s.property,r):Array.isArray(r)?i=[...r]:i=s.property==="style"?gI(r):String(r);if(Array.isArray(i)){const l=[];for(const c of i)l.push(Jx(s,s.property,c));i=l}s.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[s.property]=i}}function sm(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)sm(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?sm(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Jx(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 gI(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function xI(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const bI=["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"],vI=_E(fu,"div"),EI=_E(No,"g",bI);function TI(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 c=n[l];if(c===void 0){const f=Zx(t,n[l-1]);c=f===-1?t.length+1:f+1,n[l]=c}if(c>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 c=n[n.length-1],f=Zx(t,c),h=f===-1?t.length+1:f+1;if(c===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 Zx(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
123
|
-
`,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/"},DE={}.hasOwnProperty,wI=Object.prototype;function kI(e,t){const n=t||{};return dp({file:n.file||void 0,location:!1,schema:n.space==="svg"?No:fu,verbose:n.verbose||!1},e)}function dp(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:OE(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const i=String(e.file),l=TI(i),c=l.toPoint(0),f=l.toPoint(i.length);n.position={start:c,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=SI(e,t),n}}function OE(e,t){let n=-1;const r=[];for(;++n<t.length;){const s=dp(e,t[n]);r.push(s)}return r}function SI(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 c=t.attrs[r],f=(c.prefix?c.prefix+":":"")+c.name;DE.call(wI,f)||(s[f]=c.value)}const l=(e.schema.space==="svg"?EI:vI)(t.tagName,s,OE(e,t.childNodes));if(qc(e,t,l),l.tagName==="template"){const c=t,f=c.sourceCodeLocation,h=f&&f.startTag&&Xa(f.startTag),p=f&&f.endTag&&Xa(f.endTag),y=dp(e,c.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=CI(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function CI(e,t,n){const r=Xa(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)DE.call(n.attrs,l)&&(i[wd(e.schema,l).property]=Xa(n.attrs[l]));n.startTag;const c=Xa(n.startTag),f=n.endTag?Xa(n.endTag):void 0,h={opening:c};f&&(h.closing=f),h.properties=i,t.data={position:h}}}return r}function Xa(e){const t=eb({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=eb({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function eb(e){return e.line&&e.column?e:void 0}const tb={}.hasOwnProperty;function AE(e,t){const n=t||{};function r(s,...i){let l=r.invalid;const c=r.handlers;if(s&&tb.call(s,e)){const f=String(s[e]);l=tb.call(c,f)?c[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 NI={},_I={}.hasOwnProperty,IE=AE("type",{handlers:{root:OI,element:RI,text:MI,comment:LI,doctype:II}});function DI(e,t){const r=(t||NI).space;return IE(e,r==="svg"?No:fu)}function OI(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=fp(e.children,n,t),Ii(e,n),n}function AI(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=fp(e.children,n,t),Ii(e,n),n}function II(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ii(e,t),t}function MI(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ii(e,t),t}function LI(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ii(e,t),t}function RI(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"&&_I.call(e.properties,i)){const f=PI(r,i,e.properties[i]);f&&s.push(f)}}const l=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:Go[l],childNodes:[],parentNode:null};return c.childNodes=fp(e.children,c,r),Ii(e,c),e.tagName==="template"&&e.content&&(c.content=AI(e.content,r)),c}function PI(e,t,n){const r=wd(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?yv(n):kv(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 fp(e,t,n){let r=-1;const s=[];if(e)for(;++r<e.length;){const i=IE(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 jI=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],FI=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]),Vt="�";var B;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(B||(B={}));const Zn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function ME(e){return e>=55296&&e<=57343}function BI(e){return e>=56320&&e<=57343}function HI(e,t){return(e-55296)*1024+9216+t}function LE(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function RE(e){return e>=64976&&e<=65007||FI.has(e)}var pe;(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"})(pe||(pe={}));const UI=65536;class zI{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=UI,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,c=i+n;return{code:t,startLine:r,endLine:r,startCol:l,endCol:l,startOffset:c,endOffset:c}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(BI(n))return this.pos++,this._addGap(),HI(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,B.EOF;return this._err(pe.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,B.EOF;const r=this.html.charCodeAt(n);return r===B.CARRIAGE_RETURN?B.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,B.EOF;let t=this.html.charCodeAt(this.pos);return t===B.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,B.LINE_FEED):t===B.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,ME(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===B.LINE_FEED||t===B.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){LE(t)?this._err(pe.controlCharacterInInputStream):RE(t)&&this._err(pe.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var yt;(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"})(yt||(yt={}));function PE(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 WI=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))),YI=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 $I(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=YI.get(e))!==null&&t!==void 0?t:e}var Sn;(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"})(Sn||(Sn={}));const qI=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 om(e){return e>=Sn.ZERO&&e<=Sn.NINE}function VI(e){return e>=Sn.UPPER_A&&e<=Sn.UPPER_F||e>=Sn.LOWER_A&&e<=Sn.LOWER_F}function QI(e){return e>=Sn.UPPER_A&&e<=Sn.UPPER_Z||e>=Sn.LOWER_A&&e<=Sn.LOWER_Z||om(e)}function GI(e){return e===Sn.EQUALS||QI(e)}var wn;(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"})(wn||(wn={}));var Ds;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ds||(Ds={}));class KI{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=wn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ds.Strict}startEntity(t){this.decodeMode=t,this.state=wn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case wn.EntityStart:return t.charCodeAt(n)===Sn.NUM?(this.state=wn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=wn.NamedEntity,this.stateNamedEntity(t,n));case wn.NumericStart:return this.stateNumericStart(t,n);case wn.NumericDecimal:return this.stateNumericDecimal(t,n);case wn.NumericHex:return this.stateNumericHex(t,n);case wn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|qI)===Sn.LOWER_X?(this.state=wn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=wn.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(om(s)||VI(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(om(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===Sn.SEMI)this.consumed+=1;else if(this.decodeMode===Ds.Strict)return 0;return this.emitCodePoint($I(this.result),this.consumed),this.errors&&(t!==Sn.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=XI(r,s,this.treeIndex+Math.max(1,i),l),this.treeIndex<0)return this.result===0||this.decodeMode===Ds.Attribute&&(i===0||GI(l))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],i=(s&To.VALUE_LENGTH)>>14,i!==0){if(l===Sn.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Ds.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 wn.NamedEntity:return this.result!==0&&(this.decodeMode!==Ds.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case wn.NumericDecimal:return this.emitNumericEntity(0,2);case wn.NumericHex:return this.emitNumericEntity(0,3);case wn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case wn.EntityStart:return 0}}}function XI(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,c=l+s-1;for(;l<=c;){const f=l+c>>>1,h=e[f];if(h<r)l=f+1;else if(h>r)c=f-1;else return e[f+s]}return-1}var Te;(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/"})(Te||(Te={}));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 _r;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(_r||(_r={}));var re;(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"})(re||(re={}));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 JI=new Map([[re.A,x.A],[re.ADDRESS,x.ADDRESS],[re.ANNOTATION_XML,x.ANNOTATION_XML],[re.APPLET,x.APPLET],[re.AREA,x.AREA],[re.ARTICLE,x.ARTICLE],[re.ASIDE,x.ASIDE],[re.B,x.B],[re.BASE,x.BASE],[re.BASEFONT,x.BASEFONT],[re.BGSOUND,x.BGSOUND],[re.BIG,x.BIG],[re.BLOCKQUOTE,x.BLOCKQUOTE],[re.BODY,x.BODY],[re.BR,x.BR],[re.BUTTON,x.BUTTON],[re.CAPTION,x.CAPTION],[re.CENTER,x.CENTER],[re.CODE,x.CODE],[re.COL,x.COL],[re.COLGROUP,x.COLGROUP],[re.DD,x.DD],[re.DESC,x.DESC],[re.DETAILS,x.DETAILS],[re.DIALOG,x.DIALOG],[re.DIR,x.DIR],[re.DIV,x.DIV],[re.DL,x.DL],[re.DT,x.DT],[re.EM,x.EM],[re.EMBED,x.EMBED],[re.FIELDSET,x.FIELDSET],[re.FIGCAPTION,x.FIGCAPTION],[re.FIGURE,x.FIGURE],[re.FONT,x.FONT],[re.FOOTER,x.FOOTER],[re.FOREIGN_OBJECT,x.FOREIGN_OBJECT],[re.FORM,x.FORM],[re.FRAME,x.FRAME],[re.FRAMESET,x.FRAMESET],[re.H1,x.H1],[re.H2,x.H2],[re.H3,x.H3],[re.H4,x.H4],[re.H5,x.H5],[re.H6,x.H6],[re.HEAD,x.HEAD],[re.HEADER,x.HEADER],[re.HGROUP,x.HGROUP],[re.HR,x.HR],[re.HTML,x.HTML],[re.I,x.I],[re.IMG,x.IMG],[re.IMAGE,x.IMAGE],[re.INPUT,x.INPUT],[re.IFRAME,x.IFRAME],[re.KEYGEN,x.KEYGEN],[re.LABEL,x.LABEL],[re.LI,x.LI],[re.LINK,x.LINK],[re.LISTING,x.LISTING],[re.MAIN,x.MAIN],[re.MALIGNMARK,x.MALIGNMARK],[re.MARQUEE,x.MARQUEE],[re.MATH,x.MATH],[re.MENU,x.MENU],[re.META,x.META],[re.MGLYPH,x.MGLYPH],[re.MI,x.MI],[re.MO,x.MO],[re.MN,x.MN],[re.MS,x.MS],[re.MTEXT,x.MTEXT],[re.NAV,x.NAV],[re.NOBR,x.NOBR],[re.NOFRAMES,x.NOFRAMES],[re.NOEMBED,x.NOEMBED],[re.NOSCRIPT,x.NOSCRIPT],[re.OBJECT,x.OBJECT],[re.OL,x.OL],[re.OPTGROUP,x.OPTGROUP],[re.OPTION,x.OPTION],[re.P,x.P],[re.PARAM,x.PARAM],[re.PLAINTEXT,x.PLAINTEXT],[re.PRE,x.PRE],[re.RB,x.RB],[re.RP,x.RP],[re.RT,x.RT],[re.RTC,x.RTC],[re.RUBY,x.RUBY],[re.S,x.S],[re.SCRIPT,x.SCRIPT],[re.SEARCH,x.SEARCH],[re.SECTION,x.SECTION],[re.SELECT,x.SELECT],[re.SOURCE,x.SOURCE],[re.SMALL,x.SMALL],[re.SPAN,x.SPAN],[re.STRIKE,x.STRIKE],[re.STRONG,x.STRONG],[re.STYLE,x.STYLE],[re.SUB,x.SUB],[re.SUMMARY,x.SUMMARY],[re.SUP,x.SUP],[re.TABLE,x.TABLE],[re.TBODY,x.TBODY],[re.TEMPLATE,x.TEMPLATE],[re.TEXTAREA,x.TEXTAREA],[re.TFOOT,x.TFOOT],[re.TD,x.TD],[re.TH,x.TH],[re.THEAD,x.THEAD],[re.TITLE,x.TITLE],[re.TR,x.TR],[re.TRACK,x.TRACK],[re.TT,x.TT],[re.U,x.U],[re.UL,x.UL],[re.SVG,x.SVG],[re.VAR,x.VAR],[re.WBR,x.WBR],[re.XMP,x.XMP]]);function Mi(e){var t;return(t=JI.get(e))!==null&&t!==void 0?t:x.UNKNOWN}const Ce=x,ZI={[Te.HTML]:new Set([Ce.ADDRESS,Ce.APPLET,Ce.AREA,Ce.ARTICLE,Ce.ASIDE,Ce.BASE,Ce.BASEFONT,Ce.BGSOUND,Ce.BLOCKQUOTE,Ce.BODY,Ce.BR,Ce.BUTTON,Ce.CAPTION,Ce.CENTER,Ce.COL,Ce.COLGROUP,Ce.DD,Ce.DETAILS,Ce.DIR,Ce.DIV,Ce.DL,Ce.DT,Ce.EMBED,Ce.FIELDSET,Ce.FIGCAPTION,Ce.FIGURE,Ce.FOOTER,Ce.FORM,Ce.FRAME,Ce.FRAMESET,Ce.H1,Ce.H2,Ce.H3,Ce.H4,Ce.H5,Ce.H6,Ce.HEAD,Ce.HEADER,Ce.HGROUP,Ce.HR,Ce.HTML,Ce.IFRAME,Ce.IMG,Ce.INPUT,Ce.LI,Ce.LINK,Ce.LISTING,Ce.MAIN,Ce.MARQUEE,Ce.MENU,Ce.META,Ce.NAV,Ce.NOEMBED,Ce.NOFRAMES,Ce.NOSCRIPT,Ce.OBJECT,Ce.OL,Ce.P,Ce.PARAM,Ce.PLAINTEXT,Ce.PRE,Ce.SCRIPT,Ce.SECTION,Ce.SELECT,Ce.SOURCE,Ce.STYLE,Ce.SUMMARY,Ce.TABLE,Ce.TBODY,Ce.TD,Ce.TEMPLATE,Ce.TEXTAREA,Ce.TFOOT,Ce.TH,Ce.THEAD,Ce.TITLE,Ce.TR,Ce.TRACK,Ce.UL,Ce.WBR,Ce.XMP]),[Te.MATHML]:new Set([Ce.MI,Ce.MO,Ce.MN,Ce.MS,Ce.MTEXT,Ce.ANNOTATION_XML]),[Te.SVG]:new Set([Ce.TITLE,Ce.FOREIGN_OBJECT,Ce.DESC]),[Te.XLINK]:new Set,[Te.XML]:new Set,[Te.XMLNS]:new Set},am=new Set([Ce.H1,Ce.H2,Ce.H3,Ce.H4,Ce.H5,Ce.H6]);re.STYLE,re.SCRIPT,re.XMP,re.IFRAME,re.NOEMBED,re.NOFRAMES,re.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 cn={DATA:z.DATA,RCDATA:z.RCDATA,RAWTEXT:z.RAWTEXT,SCRIPT_DATA:z.SCRIPT_DATA,PLAINTEXT:z.PLAINTEXT,CDATA_SECTION:z.CDATA_SECTION};function eM(e){return e>=B.DIGIT_0&&e<=B.DIGIT_9}function Fl(e){return e>=B.LATIN_CAPITAL_A&&e<=B.LATIN_CAPITAL_Z}function tM(e){return e>=B.LATIN_SMALL_A&&e<=B.LATIN_SMALL_Z}function lo(e){return tM(e)||Fl(e)}function nb(e){return lo(e)||eM(e)}function Uc(e){return e+32}function jE(e){return e===B.SPACE||e===B.LINE_FEED||e===B.TABULATION||e===B.FORM_FEED}function rb(e){return jE(e)||e===B.SOLIDUS||e===B.GREATER_THAN_SIGN}function nM(e){return e===B.NULL?pe.nullCharacterReference:e>1114111?pe.characterReferenceOutsideUnicodeRange:ME(e)?pe.surrogateCharacterReference:RE(e)?pe.noncharacterCharacterReference:LE(e)||e===B.CARRIAGE_RETURN?pe.controlCharacterReference:null}class rM{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 zI(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new KI(WI,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(pe.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(pe.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=nM(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:yt.START_TAG,tagName:"",tagID:x.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:yt.END_TAG,tagName:"",tagID:x.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:yt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:yt.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(PE(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(pe.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===yt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(pe.endTagWithAttributes),t.selfClosing&&this._err(pe.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 yt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case yt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case yt.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:yt.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=jE(t)?yt.WHITESPACE_CHARACTER:t===B.NULL?yt.NULL_CHARACTER:yt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(yt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=z.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Ds.Attribute:Ds.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===z.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===z.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===z.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case z.DATA:{this._stateData(t);break}case z.RCDATA:{this._stateRcdata(t);break}case z.RAWTEXT:{this._stateRawtext(t);break}case z.SCRIPT_DATA:{this._stateScriptData(t);break}case z.PLAINTEXT:{this._statePlaintext(t);break}case z.TAG_OPEN:{this._stateTagOpen(t);break}case z.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case z.TAG_NAME:{this._stateTagName(t);break}case z.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case z.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case z.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case z.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case z.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case z.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case z.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case z.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case z.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case z.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case z.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case z.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case z.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case z.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case z.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case z.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case z.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case z.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case z.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case z.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case z.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case z.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case z.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case z.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case z.BOGUS_COMMENT:{this._stateBogusComment(t);break}case z.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case z.COMMENT_START:{this._stateCommentStart(t);break}case z.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case z.COMMENT:{this._stateComment(t);break}case z.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case z.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case z.COMMENT_END:{this._stateCommentEnd(t);break}case z.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case z.DOCTYPE:{this._stateDoctype(t);break}case z.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case z.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case z.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case z.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case z.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case z.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case z.CDATA_SECTION:{this._stateCdataSection(t);break}case z.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case z.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case z.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case z.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case B.LESS_THAN_SIGN:{this.state=z.TAG_OPEN;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this._emitCodePoint(t);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case B.AMPERSAND:{this._startCharacterReference();break}case B.LESS_THAN_SIGN:{this.state=z.RCDATA_LESS_THAN_SIGN;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Vt);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case B.LESS_THAN_SIGN:{this.state=z.RAWTEXT_LESS_THAN_SIGN;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Vt);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_LESS_THAN_SIGN;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Vt);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case B.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Vt);break}case B.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 B.EXCLAMATION_MARK:{this.state=z.MARKUP_DECLARATION_OPEN;break}case B.SOLIDUS:{this.state=z.END_TAG_OPEN;break}case B.QUESTION_MARK:{this._err(pe.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t);break}case B.EOF:{this._err(pe.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(pe.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 B.GREATER_THAN_SIGN:{this._err(pe.missingEndTagName),this.state=z.DATA;break}case B.EOF:{this._err(pe.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(pe.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=z.BEFORE_ATTRIBUTE_NAME;break}case B.SOLIDUS:{this.state=z.SELF_CLOSING_START_TAG;break}case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentTagToken();break}case B.NULL:{this._err(pe.unexpectedNullCharacter),n.tagName+=Vt;break}case B.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Fl(t)?Uc(t):t)}}_stateRcdataLessThanSign(t){t===B.SOLIDUS?this.state=z.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=z.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){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 B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=z.BEFORE_ATTRIBUTE_NAME,!1;case B.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=z.SELF_CLOSING_START_TAG,!1;case B.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=z.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=z.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===B.SOLIDUS?this.state=z.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=z.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){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 B.SOLIDUS:{this.state=z.SCRIPT_DATA_END_TAG_OPEN;break}case B.EXCLAMATION_MARK:{this.state=z.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=z.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){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===B.HYPHEN_MINUS?(this.state=z.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===B.HYPHEN_MINUS?(this.state=z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case B.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Vt);break}case B.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case B.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_ESCAPED,this._emitChars(Vt);break}case B.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case B.HYPHEN_MINUS:{this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.GREATER_THAN_SIGN:{this.state=z.SCRIPT_DATA,this._emitChars(">");break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_ESCAPED,this._emitChars(Vt);break}case B.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===B.SOLIDUS?this.state=z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN: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(Zn.SCRIPT,!1)&&rb(this.preprocessor.peek(Zn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Zn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case B.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(Vt);break}case B.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case B.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Vt);break}case B.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case B.HYPHEN_MINUS:{this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.GREATER_THAN_SIGN:{this.state=z.SCRIPT_DATA,this._emitChars(">");break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Vt);break}case B.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===B.SOLIDUS?(this.state=z.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Zn.SCRIPT,!1)&&rb(this.preprocessor.peek(Zn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Zn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=z.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.SOLIDUS:case B.GREATER_THAN_SIGN:case B.EOF:{this.state=z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case B.EQUALS_SIGN:{this._err(pe.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=z.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=z.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:case B.SOLIDUS:case B.GREATER_THAN_SIGN:case B.EOF:{this._leaveAttrName(),this.state=z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case B.EQUALS_SIGN:{this._leaveAttrName(),this.state=z.BEFORE_ATTRIBUTE_VALUE;break}case B.QUOTATION_MARK:case B.APOSTROPHE:case B.LESS_THAN_SIGN:{this._err(pe.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.name+=Vt;break}default:this.currentAttr.name+=String.fromCodePoint(Fl(t)?Uc(t):t)}}_stateAfterAttributeName(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.SOLIDUS:{this.state=z.SELF_CLOSING_START_TAG;break}case B.EQUALS_SIGN:{this.state=z.BEFORE_ATTRIBUTE_VALUE;break}case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=z.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:{this.state=z.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this.state=z.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(pe.missingAttributeValue),this.state=z.DATA,this.emitCurrentTagToken();break}default:this.state=z.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case B.QUOTATION_MARK:{this.state=z.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=Vt;break}case B.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case B.APOSTROPHE:{this.state=z.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=Vt;break}case B.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this._leaveAttrValue(),this.state=z.BEFORE_ATTRIBUTE_NAME;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=z.DATA,this.emitCurrentTagToken();break}case B.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=Vt;break}case B.QUOTATION_MARK:case B.APOSTROPHE:case B.LESS_THAN_SIGN:case B.EQUALS_SIGN:case B.GRAVE_ACCENT:{this._err(pe.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case B.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this._leaveAttrValue(),this.state=z.BEFORE_ATTRIBUTE_NAME;break}case B.SOLIDUS:{this._leaveAttrValue(),this.state=z.SELF_CLOSING_START_TAG;break}case B.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=z.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._err(pe.missingWhitespaceBetweenAttributes),this.state=z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case B.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=z.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._err(pe.unexpectedSolidusInTag),this.state=z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentComment(n);break}case B.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case B.NULL:{this._err(pe.unexpectedNullCharacter),n.data+=Vt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Zn.DASH_DASH,!0)?(this._createCommentToken(Zn.DASH_DASH.length+1),this.state=z.COMMENT_START):this._consumeSequenceIfMatch(Zn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Zn.DOCTYPE.length+1),this.state=z.DOCTYPE):this._consumeSequenceIfMatch(Zn.CDATA_START,!0)?this.inForeignNode?this.state=z.CDATA_SECTION:(this._err(pe.cdataInHtmlContent),this._createCommentToken(Zn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=z.BOGUS_COMMENT):this._ensureHibernation()||(this._err(pe.incorrectlyOpenedComment),this._createCommentToken(2),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case B.HYPHEN_MINUS:{this.state=z.COMMENT_START_DASH;break}case B.GREATER_THAN_SIGN:{this._err(pe.abruptClosingOfEmptyComment),this.state=z.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=z.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=z.COMMENT_END;break}case B.GREATER_THAN_SIGN:{this._err(pe.abruptClosingOfEmptyComment),this.state=z.DATA,this.emitCurrentComment(n);break}case B.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=z.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=z.COMMENT_END_DASH;break}case B.LESS_THAN_SIGN:{n.data+="<",this.state=z.COMMENT_LESS_THAN_SIGN;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),n.data+=Vt;break}case B.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case B.EXCLAMATION_MARK:{n.data+="!",this.state=z.COMMENT_LESS_THAN_SIGN_BANG;break}case B.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=z.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===B.HYPHEN_MINUS?this.state=z.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=z.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===B.HYPHEN_MINUS?this.state=z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=z.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==B.GREATER_THAN_SIGN&&t!==B.EOF&&this._err(pe.nestedComment),this.state=z.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=z.COMMENT_END;break}case B.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=z.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentComment(n);break}case B.EXCLAMATION_MARK:{this.state=z.COMMENT_END_BANG;break}case B.HYPHEN_MINUS:{n.data+="-";break}case B.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=z.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case B.HYPHEN_MINUS:{n.data+="--!",this.state=z.COMMENT_END_DASH;break}case B.GREATER_THAN_SIGN:{this._err(pe.incorrectlyClosedComment),this.state=z.DATA,this.emitCurrentComment(n);break}case B.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=z.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=z.BEFORE_DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this.state=z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case B.EOF:{this._err(pe.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.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 B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.NULL:{this._err(pe.unexpectedNullCharacter),this._createDoctypeToken(Vt),this.state=z.DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.EOF:{this._err(pe.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=z.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=z.AFTER_DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.NULL:{this._err(pe.unexpectedNullCharacter),n.name+=Vt;break}case B.EOF:{this._err(pe.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 B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Zn.PUBLIC,!1)?this.state=z.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Zn.SYSTEM,!1)?this.state=z.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(pe.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.QUOTATION_MARK:{this._err(pe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(pe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(pe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:{n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(pe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case B.QUOTATION_MARK:{this.state=z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),n.publicId+=Vt;break}case B.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case B.APOSTROPHE:{this.state=z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),n.publicId+=Vt;break}case B.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.QUOTATION_MARK:{this._err(pe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(pe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.QUOTATION_MARK:{n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.QUOTATION_MARK:{this._err(pe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(pe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:{n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case B.QUOTATION_MARK:{this.state=z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),n.systemId+=Vt;break}case B.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case B.APOSTROPHE:{this.state=z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.NULL:{this._err(pe.unexpectedNullCharacter),n.systemId+=Vt;break}case B.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.NULL:{this._err(pe.unexpectedNullCharacter);break}case B.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case B.RIGHT_SQUARE_BRACKET:{this.state=z.CDATA_SECTION_BRACKET;break}case B.EOF:{this._err(pe.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===B.RIGHT_SQUARE_BRACKET?this.state=z.CDATA_SECTION_END:(this._emitChars("]"),this.state=z.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case B.GREATER_THAN_SIGN:{this.state=z.DATA;break}case B.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=z.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(B.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&nb(this.preprocessor.peek(1))?z.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){nb(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===B.SEMICOLON&&this._err(pe.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const FE=new Set([x.DD,x.DT,x.LI,x.OPTGROUP,x.OPTION,x.P,x.RB,x.RP,x.RT,x.RTC]),sb=new Set([...FE,x.CAPTION,x.COLGROUP,x.TBODY,x.TD,x.TFOOT,x.TH,x.THEAD,x.TR]),dd=new Set([x.APPLET,x.CAPTION,x.HTML,x.MARQUEE,x.OBJECT,x.TABLE,x.TD,x.TEMPLATE,x.TH]),sM=new Set([...dd,x.OL,x.UL]),oM=new Set([...dd,x.BUTTON]),ob=new Set([x.ANNOTATION_XML,x.MI,x.MN,x.MO,x.MS,x.MTEXT]),ab=new Set([x.DESC,x.FOREIGN_OBJECT,x.TITLE]),aM=new Set([x.TR,x.TEMPLATE,x.HTML]),iM=new Set([x.TBODY,x.TFOOT,x.THEAD,x.TEMPLATE,x.HTML]),lM=new Set([x.TABLE,x.TEMPLATE,x.HTML]),uM=new Set([x.TD,x.TH]);class cM{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)===Te.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])!==Te.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(am,Te.HTML)}popUntilTableCellPopped(){this.popUntilPopped(uM,Te.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(lM,Te.HTML)}clearBackToTableBodyContext(){this.clearBackTo(iM,Te.HTML)}clearBackToTableRowContext(){this.clearBackTo(aM,Te.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 Te.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case Te.SVG:{if(ab.has(s))return!1;break}case Te.MATHML:{if(ob.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,dd)}hasInListItemScope(t){return this.hasInDynamicScope(t,sM)}hasInButtonScope(t){return this.hasInDynamicScope(t,oM)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Te.HTML:{if(am.has(n))return!0;if(dd.has(n))return!1;break}case Te.SVG:{if(ab.has(n))return!1;break}case Te.MATHML:{if(ob.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Te.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])===Te.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])===Te.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&&FE.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&sb.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&sb.has(this.currentTagId);)this.pop()}}const y0=3;var os;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(os||(os={}));const ib={type:os.Marker};class dM{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 c=0;c<this.entries.length;c++){const f=this.entries[c];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:c,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<y0)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<y0)return;const s=new Map(n.map(l=>[l.name,l.value]));let i=0;for(let l=0;l<r.length;l++){const c=r[l];c.attrs.every(f=>s.get(f.name)===f.value)&&(i+=1,i>=y0&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(ib)}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(ib);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:_r.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}}},BE="html",fM="about:legacy-compat",hM="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",HE=["+//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//"],mM=[...HE,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],pM=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),UE=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],yM=[...UE,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function lb(e,t){return t.some(n=>e.startsWith(n))}function gM(e){return e.name===BE&&e.publicId===null&&(e.systemId===null||e.systemId===fM)}function xM(e){if(e.name!==BE)return _r.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===hM)return _r.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),pM.has(n))return _r.QUIRKS;let r=t===null?mM:HE;if(lb(n,r))return _r.QUIRKS;if(r=t===null?UE:yM,lb(n,r))return _r.LIMITED_QUIRKS}return _r.NO_QUIRKS}const ub={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},bM="definitionurl",vM="definitionURL",EM=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])),TM=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Te.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Te.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Te.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Te.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Te.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Te.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Te.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Te.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Te.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Te.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Te.XMLNS}]]),wM=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])),kM=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 SM(e){const t=e.tagID;return t===x.FONT&&e.attrs.some(({name:r})=>r===aa.COLOR||r===aa.SIZE||r===aa.FACE)||kM.has(t)}function zE(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===bM){e.attrs[t].name=vM;break}}function WE(e){for(let t=0;t<e.attrs.length;t++){const n=EM.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function hp(e){for(let t=0;t<e.attrs.length;t++){const n=TM.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 CM(e){const t=wM.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Mi(e.tagName))}function NM(e,t){return t===Te.MATHML&&(e===x.MI||e===x.MO||e===x.MN||e===x.MS||e===x.MTEXT)}function _M(e,t,n){if(t===Te.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===ub.TEXT_HTML||s===ub.APPLICATION_XML}}return t===Te.SVG&&(e===x.FOREIGN_OBJECT||e===x.DESC||e===x.TITLE)}function DM(e,t,n,r){return(!r||r===Te.HTML)&&_M(e,t,n)||(!r||r===Te.MATHML)&&NM(e,t)}const OM="hidden",AM=8,IM=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 MM={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},YE=new Set([x.TABLE,x.TBODY,x.TFOOT,x.THEAD,x.TR]),cb={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:uo,onParseError:null};class db{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={...cb,...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 rM(this.options,this),this.activeFormattingElements=new dM(this.treeAdapter),this.fragmentContextID=r?Mi(this.treeAdapter.getTagName(r)):x.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new cM(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={...cb,...n};t??(t=r.treeAdapter.createElement(re.TEMPLATE,Te.HTML,[]));const s=r.treeAdapter.createElement("documentmock",Te.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:MM,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)===Te.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Te.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=cn.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)===re.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Te.HTML))switch(this.fragmentContextID){case x.TITLE:case x.TEXTAREA:{this.tokenizer.state=cn.RCDATA;break}case x.STYLE:case x.XMP:case x.IFRAME:case x.NOEMBED:case x.NOFRAMES:case x.NOSCRIPT:{this.tokenizer.state=cn.RAWTEXT;break}case x.SCRIPT:{this.tokenizer.state=cn.SCRIPT_DATA;break}case x.PLAINTEXT:{this.tokenizer.state=cn.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(c=>this.treeAdapter.isDocumentTypeNode(c));l&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,Te.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Te.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(re.HTML,Te.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===yt.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)===re.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Te.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===x.MGLYPH||t.tagID===x.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Te.HTML)}_processToken(t){switch(t.type){case yt.CHARACTER:{this.onCharacter(t);break}case yt.NULL_CHARACTER:{this.onNullCharacter(t);break}case yt.COMMENT:{this.onComment(t);break}case yt.DOCTYPE:{this.onDoctype(t);break}case yt.START_TAG:{this._processStartTag(t);break}case yt.END_TAG:{this.onEndTag(t);break}case yt.EOF:{this.onEof(t);break}case yt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return DM(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 YE.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)===Te.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 ZI[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){uR(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:{qE(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:{g0(this,t);break}case V.IN_TABLE_TEXT:{JE(this,t);break}case V.IN_COLUMN_GROUP:{fd(this,t);break}case V.AFTER_BODY:{hd(this,t);break}case V.AFTER_AFTER_BODY:{Vc(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){lR(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:{g0(this,t);break}case V.IN_COLUMN_GROUP:{fd(this,t);break}case V.AFTER_BODY:{hd(this,t);break}case V.AFTER_AFTER_BODY:{Vc(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){im(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:{im(this,t);break}case V.IN_TABLE_TEXT:{Ml(this,t);break}case V.AFTER_BODY:{HM(this,t);break}case V.AFTER_AFTER_BODY:case V.AFTER_AFTER_FRAMESET:{UM(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case V.INITIAL:{zM(this,t);break}case V.BEFORE_HEAD:case V.IN_HEAD:case V.IN_HEAD_NO_SCRIPT:case V.AFTER_HEAD:{this._err(t,pe.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,pe.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?cR(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case V.INITIAL:{Il(this,t);break}case V.BEFORE_HTML:{WM(this,t);break}case V.BEFORE_HEAD:{$M(this,t);break}case V.IN_HEAD:{qr(this,t);break}case V.IN_HEAD_NO_SCRIPT:{QM(this,t);break}case V.AFTER_HEAD:{KM(this,t);break}case V.IN_BODY:{Bn(this,t);break}case V.IN_TABLE:{Ei(this,t);break}case V.IN_TABLE_TEXT:{Ml(this,t);break}case V.IN_CAPTION:{qL(this,t);break}case V.IN_COLUMN_GROUP:{yp(this,t);break}case V.IN_TABLE_BODY:{Kd(this,t);break}case V.IN_ROW:{Xd(this,t);break}case V.IN_CELL:{GL(this,t);break}case V.IN_SELECT:{tT(this,t);break}case V.IN_SELECT_IN_TABLE:{XL(this,t);break}case V.IN_TEMPLATE:{ZL(this,t);break}case V.AFTER_BODY:{tR(this,t);break}case V.IN_FRAMESET:{nR(this,t);break}case V.AFTER_FRAMESET:{sR(this,t);break}case V.AFTER_AFTER_BODY:{aR(this,t);break}case V.AFTER_AFTER_FRAMESET:{iR(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?dR(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case V.INITIAL:{Il(this,t);break}case V.BEFORE_HTML:{YM(this,t);break}case V.BEFORE_HEAD:{qM(this,t);break}case V.IN_HEAD:{VM(this,t);break}case V.IN_HEAD_NO_SCRIPT:{GM(this,t);break}case V.AFTER_HEAD:{XM(this,t);break}case V.IN_BODY:{Gd(this,t);break}case V.TEXT:{PL(this,t);break}case V.IN_TABLE:{eu(this,t);break}case V.IN_TABLE_TEXT:{Ml(this,t);break}case V.IN_CAPTION:{VL(this,t);break}case V.IN_COLUMN_GROUP:{QL(this,t);break}case V.IN_TABLE_BODY:{lm(this,t);break}case V.IN_ROW:{eT(this,t);break}case V.IN_CELL:{KL(this,t);break}case V.IN_SELECT:{nT(this,t);break}case V.IN_SELECT_IN_TABLE:{JL(this,t);break}case V.IN_TEMPLATE:{eR(this,t);break}case V.AFTER_BODY:{sT(this,t);break}case V.IN_FRAMESET:{rR(this,t);break}case V.AFTER_FRAMESET:{oR(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:{KE(this,t);break}case V.TEXT:{jL(this,t);break}case V.IN_TABLE_TEXT:{Ml(this,t);break}case V.IN_TEMPLATE:{rT(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:{pp(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===B.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case 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:{$E(this,t);break}case V.IN_TABLE:case V.IN_TABLE_BODY:case V.IN_ROW:{g0(this,t);break}case V.IN_TABLE_TEXT:{XE(this,t);break}}}}function LM(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):GE(e,t),n}function RM(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 PM(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 c=e.activeFormattingElements.getElementEntry(l),f=c&&i>=IM;!c||f?(f&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(l)):(l=jM(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(l,r),r=l)}return r}function jM(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 FM(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===Te.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function BM(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 mp(e,t){for(let n=0;n<AM;n++){const r=LM(e,t);if(!r)break;const s=RM(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const i=PM(e,s,r.element),l=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(i),l&&FM(e,l,i),BM(e,s,r)}}function im(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function HM(e,t){e._appendCommentNode(t,e.openElements.items[0])}function UM(e,t){e._appendCommentNode(t,e.document)}function pp(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 zM(e,t){e._setDocumentType(t);const n=t.forceQuirks?_r.QUIRKS:xM(t);gM(t)||e._err(t,pe.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=V.BEFORE_HTML}function Il(e,t){e._err(t,pe.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,_r.QUIRKS),e.insertionMode=V.BEFORE_HTML,e._processToken(t)}function WM(e,t){t.tagID===x.HTML?(e._insertElement(t,Te.HTML),e.insertionMode=V.BEFORE_HEAD):Yl(e,t)}function YM(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 $M(e,t){switch(t.tagID){case x.HTML:{Bn(e,t);break}case x.HEAD:{e._insertElement(t,Te.HTML),e.headElement=e.openElements.current,e.insertionMode=V.IN_HEAD;break}default:$l(e,t)}}function qM(e,t){const n=t.tagID;n===x.HEAD||n===x.BODY||n===x.HTML||n===x.BR?$l(e,t):e._err(t,pe.endTagWithoutMatchingOpenElement)}function $l(e,t){e._insertFakeElement(re.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:{Bn(e,t);break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:{e._appendElement(t,Te.HTML),t.ackSelfClosing=!0;break}case x.TITLE:{e._switchToTextParsing(t,cn.RCDATA);break}case x.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,cn.RAWTEXT):(e._insertElement(t,Te.HTML),e.insertionMode=V.IN_HEAD_NO_SCRIPT);break}case x.NOFRAMES:case x.STYLE:{e._switchToTextParsing(t,cn.RAWTEXT);break}case x.SCRIPT:{e._switchToTextParsing(t,cn.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,pe.misplacedStartTagForHeadElement);break}default:ql(e,t)}}function VM(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:{va(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function va(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==x.TEMPLATE&&e._err(t,pe.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(x.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,pe.endTagWithoutMatchingOpenElement)}function ql(e,t){e.openElements.pop(),e.insertionMode=V.AFTER_HEAD,e._processToken(t)}function QM(e,t){switch(t.tagID){case x.HTML:{Bn(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,pe.nestedNoscriptInHead);break}default:Vl(e,t)}}function GM(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,pe.endTagWithoutMatchingOpenElement)}}function Vl(e,t){const n=t.type===yt.EOF?pe.openElementsLeftAfterEof:pe.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=V.IN_HEAD,e._processToken(t)}function KM(e,t){switch(t.tagID){case x.HTML:{Bn(e,t);break}case x.BODY:{e._insertElement(t,Te.HTML),e.framesetOk=!1,e.insertionMode=V.IN_BODY;break}case x.FRAMESET:{e._insertElement(t,Te.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,pe.abandonedHeadElementChild),e.openElements.push(e.headElement,x.HEAD),qr(e,t),e.openElements.remove(e.headElement);break}case x.HEAD:{e._err(t,pe.misplacedStartTagForHeadElement);break}default:Ql(e,t)}}function XM(e,t){switch(t.tagID){case x.BODY:case x.HTML:case x.BR:{Ql(e,t);break}case x.TEMPLATE:{va(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function Ql(e,t){e._insertFakeElement(re.BODY,x.BODY),e.insertionMode=V.IN_BODY,Qd(e,t)}function Qd(e,t){switch(t.type){case yt.CHARACTER:{qE(e,t);break}case yt.WHITESPACE_CHARACTER:{$E(e,t);break}case yt.COMMENT:{im(e,t);break}case yt.START_TAG:{Bn(e,t);break}case yt.END_TAG:{Gd(e,t);break}case yt.EOF:{KE(e,t);break}}}function $E(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function qE(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function JM(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function ZM(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function eL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Te.HTML),e.insertionMode=V.IN_FRAMESET)}function tL(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,Te.HTML)}function nL(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&am.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Te.HTML)}function rL(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,Te.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function sL(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,Te.HTML),n||(e.formElement=e.openElements.current))}function oL(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,Te.HTML)}function aL(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,Te.HTML),e.tokenizer.state=cn.PLAINTEXT}function iL(e,t){e.openElements.hasInScope(x.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(x.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Te.HTML),e.framesetOk=!1}function lL(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(re.A);n&&(mp(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Te.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function uL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Te.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function cL(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(x.NOBR)&&(mp(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Te.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function dL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Te.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function fL(e,t){e.treeAdapter.getDocumentMode(e.document)!==_r.QUIRKS&&e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,Te.HTML),e.framesetOk=!1,e.insertionMode=V.IN_TABLE}function VE(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Te.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function QE(e){const t=PE(e,aa.TYPE);return t!=null&&t.toLowerCase()===OM}function hL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Te.HTML),QE(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function mL(e,t){e._appendElement(t,Te.HTML),t.ackSelfClosing=!0}function pL(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._appendElement(t,Te.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function yL(e,t){t.tagName=re.IMG,t.tagID=x.IMG,VE(e,t)}function gL(e,t){e._insertElement(t,Te.HTML),e.skipNextNewLine=!0,e.tokenizer.state=cn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=V.TEXT}function xL(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,cn.RAWTEXT)}function bL(e,t){e.framesetOk=!1,e._switchToTextParsing(t,cn.RAWTEXT)}function fb(e,t){e._switchToTextParsing(t,cn.RAWTEXT)}function vL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Te.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 EL(e,t){e.openElements.currentTagId===x.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Te.HTML)}function TL(e,t){e.openElements.hasInScope(x.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Te.HTML)}function wL(e,t){e.openElements.hasInScope(x.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(x.RTC),e._insertElement(t,Te.HTML)}function kL(e,t){e._reconstructActiveFormattingElements(),zE(t),hp(t),t.selfClosing?e._appendElement(t,Te.MATHML):e._insertElement(t,Te.MATHML),t.ackSelfClosing=!0}function SL(e,t){e._reconstructActiveFormattingElements(),WE(t),hp(t),t.selfClosing?e._appendElement(t,Te.SVG):e._insertElement(t,Te.SVG),t.ackSelfClosing=!0}function hb(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Te.HTML)}function Bn(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:{uL(e,t);break}case x.A:{lL(e,t);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{nL(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:{tL(e,t);break}case x.LI:case x.DD:case x.DT:{oL(e,t);break}case x.BR:case x.IMG:case x.WBR:case x.AREA:case x.EMBED:case x.KEYGEN:{VE(e,t);break}case x.HR:{pL(e,t);break}case x.RB:case x.RTC:{TL(e,t);break}case x.RT:case x.RP:{wL(e,t);break}case x.PRE:case x.LISTING:{rL(e,t);break}case x.XMP:{xL(e,t);break}case x.SVG:{SL(e,t);break}case x.HTML:{JM(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:{ZM(e,t);break}case x.FORM:{sL(e,t);break}case x.NOBR:{cL(e,t);break}case x.MATH:{kL(e,t);break}case x.TABLE:{fL(e,t);break}case x.INPUT:{hL(e,t);break}case x.PARAM:case x.TRACK:case x.SOURCE:{mL(e,t);break}case x.IMAGE:{yL(e,t);break}case x.BUTTON:{iL(e,t);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{dL(e,t);break}case x.IFRAME:{bL(e,t);break}case x.SELECT:{vL(e,t);break}case x.OPTION:case x.OPTGROUP:{EL(e,t);break}case x.NOEMBED:case x.NOFRAMES:{fb(e,t);break}case x.FRAMESET:{eL(e,t);break}case x.TEXTAREA:{gL(e,t);break}case x.NOSCRIPT:{e.options.scriptingEnabled?fb(e,t):hb(e,t);break}case x.PLAINTEXT:{aL(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:hb(e,t)}}function CL(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 NL(e,t){e.openElements.hasInScope(x.BODY)&&(e.insertionMode=V.AFTER_BODY,sT(e,t))}function _L(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function DL(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 OL(e){e.openElements.hasInButtonScope(x.P)||e._insertFakeElement(re.P,x.P),e._closePElement()}function AL(e){e.openElements.hasInListItemScope(x.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(x.LI),e.openElements.popUntilTagNamePopped(x.LI))}function IL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function ML(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function LL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function RL(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(re.BR,x.BR),e.openElements.pop(),e.framesetOk=!1}function GE(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 Gd(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:{mp(e,t);break}case x.P:{OL(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:{_L(e,t);break}case x.LI:{AL(e);break}case x.DD:case x.DT:{IL(e,t);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{ML(e);break}case x.BR:{RL(e);break}case x.BODY:{CL(e,t);break}case x.HTML:{NL(e,t);break}case x.FORM:{DL(e);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{LL(e,t);break}case x.TEMPLATE:{va(e,t);break}default:GE(e,t)}}function KE(e,t){e.tmplInsertionModeStack.length>0?rT(e,t):pp(e,t)}function PL(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 jL(e,t){e._err(t,pe.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function g0(e,t){if(e.openElements.currentTagId!==void 0&&YE.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 yt.CHARACTER:{JE(e,t);break}case yt.WHITESPACE_CHARACTER:{XE(e,t);break}}else gu(e,t)}function FL(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Te.HTML),e.insertionMode=V.IN_CAPTION}function BL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Te.HTML),e.insertionMode=V.IN_COLUMN_GROUP}function HL(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(re.COLGROUP,x.COLGROUP),e.insertionMode=V.IN_COLUMN_GROUP,yp(e,t)}function UL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Te.HTML),e.insertionMode=V.IN_TABLE_BODY}function zL(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(re.TBODY,x.TBODY),e.insertionMode=V.IN_TABLE_BODY,Kd(e,t)}function WL(e,t){e.openElements.hasInTableScope(x.TABLE)&&(e.openElements.popUntilTagNamePopped(x.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function YL(e,t){QE(t)?e._appendElement(t,Te.HTML):gu(e,t),t.ackSelfClosing=!0}function $L(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Te.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:{zL(e,t);break}case x.STYLE:case x.SCRIPT:case x.TEMPLATE:{qr(e,t);break}case x.COL:{HL(e,t);break}case x.FORM:{$L(e,t);break}case x.TABLE:{WL(e,t);break}case x.TBODY:case x.TFOOT:case x.THEAD:{UL(e,t);break}case x.INPUT:{YL(e,t);break}case x.CAPTION:{FL(e,t);break}case x.COLGROUP:{BL(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:{va(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,Qd(e,t),e.fosterParentingEnabled=n}function XE(e,t){e.pendingCharacterTokens.push(t)}function JE(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 ZE=new Set([x.CAPTION,x.COL,x.COLGROUP,x.TBODY,x.TD,x.TFOOT,x.TH,x.THEAD,x.TR]);function qL(e,t){const n=t.tagID;ZE.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)):Bn(e,t)}function VL(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:Gd(e,t)}}function yp(e,t){switch(t.tagID){case x.HTML:{Bn(e,t);break}case x.COL:{e._appendElement(t,Te.HTML),t.ackSelfClosing=!0;break}case x.TEMPLATE:{qr(e,t);break}default:fd(e,t)}}function QL(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:{va(e,t);break}case x.COL:break;default:fd(e,t)}}function fd(e,t){e.openElements.currentTagId===x.COLGROUP&&(e.openElements.pop(),e.insertionMode=V.IN_TABLE,e._processToken(t))}function Kd(e,t){switch(t.tagID){case x.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Te.HTML),e.insertionMode=V.IN_ROW;break}case x.TH:case x.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(re.TR,x.TR),e.insertionMode=V.IN_ROW,Xd(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 lm(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 Xd(e,t){switch(t.tagID){case x.TH:case x.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Te.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,Kd(e,t));break}default:Ei(e,t)}}function eT(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,lm(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,lm(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 GL(e,t){const n=t.tagID;ZE.has(n)?(e.openElements.hasInTableScope(x.TD)||e.openElements.hasInTableScope(x.TH))&&(e._closeTableCell(),Xd(e,t)):Bn(e,t)}function KL(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(),eT(e,t));break}case x.BODY:case x.CAPTION:case x.COL:case x.COLGROUP:case x.HTML:break;default:Gd(e,t)}}function tT(e,t){switch(t.tagID){case x.HTML:{Bn(e,t);break}case x.OPTION:{e.openElements.currentTagId===x.OPTION&&e.openElements.pop(),e._insertElement(t,Te.HTML);break}case x.OPTGROUP:{e.openElements.currentTagId===x.OPTION&&e.openElements.pop(),e.openElements.currentTagId===x.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Te.HTML);break}case x.HR:{e.openElements.currentTagId===x.OPTION&&e.openElements.pop(),e.openElements.currentTagId===x.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Te.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 nT(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:{va(e,t);break}}}function XL(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)):tT(e,t)}function JL(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)):nT(e,t)}function ZL(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,yp(e,t);break}case x.TR:{e.tmplInsertionModeStack[0]=V.IN_TABLE_BODY,e.insertionMode=V.IN_TABLE_BODY,Kd(e,t);break}case x.TD:case x.TH:{e.tmplInsertionModeStack[0]=V.IN_ROW,e.insertionMode=V.IN_ROW,Xd(e,t);break}default:e.tmplInsertionModeStack[0]=V.IN_BODY,e.insertionMode=V.IN_BODY,Bn(e,t)}}function eR(e,t){t.tagID===x.TEMPLATE&&va(e,t)}function rT(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(x.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):pp(e,t)}function tR(e,t){t.tagID===x.HTML?Bn(e,t):hd(e,t)}function sT(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 hd(e,t)}function hd(e,t){e.insertionMode=V.IN_BODY,Qd(e,t)}function nR(e,t){switch(t.tagID){case x.HTML:{Bn(e,t);break}case x.FRAMESET:{e._insertElement(t,Te.HTML);break}case x.FRAME:{e._appendElement(t,Te.HTML),t.ackSelfClosing=!0;break}case x.NOFRAMES:{qr(e,t);break}}}function rR(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 sR(e,t){switch(t.tagID){case x.HTML:{Bn(e,t);break}case x.NOFRAMES:{qr(e,t);break}}}function oR(e,t){t.tagID===x.HTML&&(e.insertionMode=V.AFTER_AFTER_FRAMESET)}function aR(e,t){t.tagID===x.HTML?Bn(e,t):Vc(e,t)}function Vc(e,t){e.insertionMode=V.IN_BODY,Qd(e,t)}function iR(e,t){switch(t.tagID){case x.HTML:{Bn(e,t);break}case x.NOFRAMES:{qr(e,t);break}}}function lR(e,t){t.chars=Vt,e._insertCharacters(t)}function uR(e,t){e._insertCharacters(t),e.framesetOk=!1}function oT(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Te.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function cR(e,t){if(SM(t))oT(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Te.MATHML?zE(t):r===Te.SVG&&(CM(t),WE(t)),hp(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function dR(e,t){if(t.tagID===x.P||t.tagID===x.BR){oT(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)===Te.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}re.AREA,re.BASE,re.BASEFONT,re.BGSOUND,re.BR,re.COL,re.EMBED,re.FRAME,re.HR,re.IMG,re.INPUT,re.KEYGEN,re.LINK,re.META,re.PARAM,re.SOURCE,re.TRACK,re.WBR;const fR=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,hR=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),mb={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function aT(e,t){const n=wR(e),r=AE("type",{handlers:{root:mR,element:pR,text:yR,comment:lT,doctype:gR,raw:bR},unknown:vR}),s={parser:n?new db(mb):db.getFragmentParser(void 0,mb),handle(c){r(c,s)},stitches:!1,options:t||{}};r(e,s),Li(s,ds());const i=n?s.parser.document:s.parser.getFragment(),l=kI(i,{file:s.options.file});return s.stitches&&Ym(l,"comment",function(c,f,h){const p=c;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 iT(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function mR(e,t){iT(e.children,t)}function pR(e,t){ER(e,t),iT(e.children,t),TR(e,t)}function yR(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:yt.CHARACTER,chars:e.value,location:xu(e)};Li(t,ds(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function gR(e,t){const n={type:yt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:xu(e)};Li(t,ds(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function xR(e,t){t.stitches=!0;const n=kR(e);if("children"in e&&"children"in n){const r=aT({type:"root",children:e.children},t.options);n.children=r.children}lT({type:"comment",value:{stitch:n}},t)}function lT(e,t){const n=e.value,r={type:yt.COMMENT,data:n,location:xu(e)};Li(t,ds(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function bR(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,uT(t,ds(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(fR,"<$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 vR(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))xR(n,t);else{let r="";throw hR.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){uT(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=cn.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 uT(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 ER(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===cn.PLAINTEXT)return;Li(t,ds(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=DI({...e,children:[]},{space:s===Go.svg?"svg":"html"}),l={type:yt.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 TR(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&jI.includes(n)||t.parser.tokenizer.state===cn.PLAINTEXT)return;Li(t,kd(e));const r={type:yt.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===cn.RCDATA||t.parser.tokenizer.state===cn.RAWTEXT||t.parser.tokenizer.state===cn.SCRIPT_DATA)&&(t.parser.tokenizer.state=cn.DATA)}function wR(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=ds(e)||{line:void 0,column:void 0,offset:void 0},n=kd(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 kR(e){return"children"in e?xi({...e,children:[]}):xi(e)}function SR(e){return function(t,n){return aT(t,{...e,file:n})}}const cT=[{command:"/ai",description:"Generate text at this line"},{command:"/ai!",description:"Replace all widget content"}];function CR({filter:e,selectedIndex:t,position:n,onSelect:r,onClose:s}){const i=C.useRef(null),l=C.useMemo(()=>{const c=e.toLowerCase();return cT.filter(f=>f.command.toLowerCase().includes(c)||f.description.toLowerCase().includes(c))},[e]);return C.useEffect(()=>{function c(f){i.current&&!i.current.contains(f.target)&&s()}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[s]),C.useEffect(()=>{var f;const c=(f=i.current)==null?void 0:f.querySelector('[data-selected="true"]');c&&typeof c.scrollIntoView=="function"&&c.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((c,f)=>d.jsxs("button",{"data-selected":f===t,onMouseDown:h=>{h.preventDefault(),r(c.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:c.command}),d.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:c.description})]},c.command))}),document.body)}function NR(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(`
|
|
124
|
-
`),s=r.findIndex(i=>i.trim()===t.trim());return s===-1?e:(r[s]=n,r.join(`
|
|
125
|
-
`))}function _R({chartName:e,chartTitle:t,displayValue:n,field:r,change:s,previousValue:i,lockedPreset:l,lockedRange:c,format:f}){const[h,p]=C.useState(!1),[y,g]=C.useState({top:0,left:0,placement:"below"}),v=C.useRef(null),D=C.useRef(null);C.useEffect(()=>{if(!h||!D.current)return;const N=()=>{var Y,q;if(!D.current)return;const O=D.current.getBoundingClientRect(),A=((Y=v.current)==null?void 0:Y.offsetHeight)||180,S=window.innerHeight-O.bottom,I=O.top,_=8;let P="below",F;S<A+_&&I>S?(P="above",F=O.top+window.scrollY-A-_):F=O.bottom+window.scrollY+_;let H=O.left+window.scrollX;const U=((q=v.current)==null?void 0:q.offsetWidth)||220;H+U>window.innerWidth-_&&(H=window.innerWidth-U-_),H<_&&(H=_),g({top:F,left:H,placement:P})};N(),requestAnimationFrame(N)},[h]),C.useEffect(()=>{if(!h)return;function N(O){v.current&&!v.current.contains(O.target)&&D.current&&!D.current.contains(O.target)&&p(!1)}return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[h]),C.useEffect(()=>{if(!h)return;function N(O){O.key==="Escape"&&p(!1)}return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[h]);const k=l?l.replace(/_/g," ").replace(/\b\w/g,N=>N.toUpperCase()):c?c.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:D,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:v,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"})}),k?d.jsx("span",{children:k}):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 DR(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 c;if(l){const h=l.match(/^(\d{4}-\d{2}-\d{2})\.\.(\d{4}-\d{2}-\d{2})$/);h?c={startDate:h[1],endDate:h[2]}:c={preset:l}}const f=`${s}:${i||""}:${l||""}`;n.has(f)||n.set(f,{chartName:s,field:i,locked:c})}return Array.from(n.values())}function OR(e){return Array.from(new Set(e.map(t=>t.chartName)))}function AR(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 IR(e,t){if(e.locked){if(e.locked.preset)return gi({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 gi(t)}function um(e){const t=e.locked?e.locked.preset||`${e.locked.startDate}..${e.locked.endDate}`:"current";return`${e.chartName}:${e.field||"value"}:${t}`}function MR(e,t){const n=OR(e),r=C.useMemo(()=>{const p=new Map;return e.forEach(y=>{const g=IR(y,t),v=`${y.chartName}:${JSON.stringify(g)}`;p.has(v)||p.set(v,{chartName:y.chartName,params:g,refs:[]}),p.get(v).refs.push(y)}),Array.from(p.values())},[e,t]),s=i1({queries:r.map(p=>({queryKey:["chartData",p.chartName,p.params],queryFn:()=>ft.queryChart(p.chartName,p.params),enabled:r.length>0}))}),i=i1({queries:n.map(p=>({queryKey:["chart",p],queryFn:()=>ft.getChart(p),enabled:n.length>0}))}),l=C.useMemo(()=>{const p={};return n.forEach((y,g)=>{const v=i[g];v!=null&&v.data&&(p[y]=v.data)}),p},[n,i]),c=C.useMemo(()=>{const p={};return r.forEach((y,g)=>{var T,E,N;const v=s[g],D=(T=l[y.chartName])==null?void 0:T.chart;if(!((N=(E=v==null?void 0:v.data)==null?void 0:E.rows)!=null&&N[0])||!D)return;const k=v.data.rows[0];y.refs.forEach(O=>{var R,S;const A=um(O);if(D.type==="kpi"&&((R=D.value)!=null&&R.field)){const I=D.value.field,_=k[I]??0,P={value:_,formatted:AR(_,D.format),fields:{}};if(Object.entries(k).forEach(([F,H])=>{typeof H=="number"&&(P.fields[F]=H)}),(S=D.comparison)!=null&&S.enabled&&D.comparison.field){const F=k[D.comparison.field];F&&F!==0&&(D.comparison.type==="percent_change"?P.change=(_-F)/F*100:P.change=_-F)}p[A]=P}})}),p},[r,s,l]),f=s.some(p=>p.isLoading)||i.some(p=>p.isLoading),h=C.useMemo(()=>{const p={};return n.forEach((y,g)=>{var D;const v=i[g];(D=v==null?void 0:v.data)!=null&&D.title&&(p[y]=v.data.title)}),p},[n,i]);return{values:c,isLoading:f,getRefKey:um,chartTitles:h}}function LR(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,c,f,h)=>{let p,y,g;if(h){const N=h.match(/^(\d{4}-\d{2}-\d{2})\.\.(\d{4}-\d{2}-\d{2})$/);N?(p={startDate:N[1],endDate:N[2]},g=h):(p={preset:h},y=h)}const D=um({chartName:c,field:f,locked:p}),k=t[D];if(!k)return l;let T;if(f)if(f==="formatted"||f==="value")T=k.formatted;else if(f==="change"&&k.change!==void 0)T=`${k.change>=0?"+":""}${k.change.toFixed(1)}%`;else if(k.fields[f]!==void 0)T=k.fields[f].toLocaleString();else return l;else T=k.formatted;const E=`kpi-ref-${s++}`;return r[E]={chartName:c,chartTitle:n[c]||c,displayValue:T,field:f,change:k.change,previousValue:k.fields.previous_value,lockedPreset:y,lockedRange:g},`<kpi-ref data-ref-id="${E}">${T}</kpi-ref>`}),refData:r}}function RR({filter:e,kpiCharts:t,selectedIndex:n,position:r,onSelect:s,onClose:i}){const l=C.useRef(null),c=C.useMemo(()=>{const f=e.toLowerCase();return t.filter(h=>h.name.toLowerCase().includes(f)||h.title.toLowerCase().includes(f))},[e,t]);return C.useEffect(()=>{function f(h){l.current&&!l.current.contains(h.target)&&i()}return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[i]),C.useEffect(()=>{var h;const f=(h=l.current)==null?void 0:h.querySelector('[data-selected="true"]');f==null||f.scrollIntoView({block:"nearest"})},[n]),c.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:c.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 PR({content:e,onUpdate:t,isContentEditing:n,onEditStart:r,onEditEnd:s,dashboardName:i}){const{isEditing:l}=Oi(),[c,f]=C.useState(e),h=C.useRef(null),[p,y]=C.useState(null),[g,v]=C.useState({top:0,left:0}),D=C.useRef(null),[k,T]=C.useState(!1),[E,N]=C.useState(null),[O,A]=C.useState(null),[R,S]=C.useState({top:0,left:0}),I=Je(ae=>ae.globalFilters),{data:_}=sr({queryKey:["config"],queryFn:()=>ft.getConfig()}),P=C.useMemo(()=>(_==null?void 0:_.charts.filter(ae=>ae.type==="kpi"))||[],[_]),F=C.useMemo(()=>DR(e),[e]),{values:H,isLoading:U,chartTitles:Y}=MR(F,I),{content:q,refData:G}=C.useMemo(()=>U||Object.keys(H).length===0?{content:e,refData:{}}:LR(e,H,Y),[e,H,U,Y]),ee=C.useMemo(()=>({"kpi-ref":({children:ae,...de})=>{const _e=de["data-ref-id"],ke=_e?G[_e]:null;return ke?d.jsx(_R,{chartName:ke.chartName,chartTitle:ke.chartTitle,displayValue:ke.displayValue,field:ke.field,change:ke.change,previousValue:ke.previousValue,lockedPreset:ke.lockedPreset,lockedRange:ke.lockedRange}):d.jsx("span",{children:ae})}}),[G]);C.useEffect(()=>{n||f(e)},[e,n]),C.useEffect(()=>{n&&h.current&&h.current.focus()},[n]);const he=()=>{t==null||t(c),y(null),s==null||s()},te=()=>{f(e),y(null),s==null||s()},ue=()=>{const ae=h.current,de=D.current;if(!ae||!de)return;const _e=ae.selectionStart,ke=ae.value.substring(0,_e);de.textContent=ke;const Pe=ae.getBoundingClientRect(),Ue=de.offsetWidth,et=parseFloat(getComputedStyle(ae).lineHeight)||18,Ke=ae.clientWidth-16,ge=ke.split(`
|
|
126
|
-
`),me=ge[ge.length-1]||"";de.textContent=me;const fe=Math.min(de.offsetWidth,Ke),Z=(ge.length-1+Math.floor(Ue/Ke))*et;v({top:Pe.top+Z+et+4-ae.scrollTop,left:Pe.left+fe+8})},M=()=>{const ae=h.current,de=D.current;if(!ae||!de)return;const _e=ae.selectionStart,ke=ae.value.substring(0,_e),Pe=ae.getBoundingClientRect(),Ue=parseFloat(getComputedStyle(ae).lineHeight)||18,et=ae.clientWidth-16,Ke=ke.split(`
|
|
127
|
-
`),ge=Ke[Ke.length-1]||"";de.textContent=ge;const me=Math.min(de.offsetWidth,et);de.textContent=ke;const J=(Ke.length-1+Math.floor(de.offsetWidth/et))*Ue;S({top:Pe.top+J+Ue+4-ae.scrollTop,left:Pe.left+me+8})},Q=C.useMemo(()=>{if(!(p!=null&&p.active))return[];const ae=p.filter.toLowerCase();return P.filter(de=>de.name.toLowerCase().includes(ae)||de.title.toLowerCase().includes(ae))},[p,P]),le=ae=>{if(!p||!h.current)return;const de=h.current,_e=c.substring(0,p.startPos),ke=c.substring(de.selectionStart),Pe=`{{${ae}}}`,Ue=_e+Pe+ke;f(Ue),y(null);const et=_e.length+Pe.length;setTimeout(()=>{de.selectionStart=de.selectionEnd=et,de.focus()},0)},j=ae=>{if(!h.current)return;const de=h.current,_e=de.selectionStart,ke=c.lastIndexOf(`
|
|
128
|
-
`,_e-1)+1,Pe=c.indexOf(`
|
|
129
|
-
`,_e),Ue=Pe===-1?c.length:Pe,et=c.substring(0,ke),Ke=c.substring(Ue),ge=et+ae+" "+Ke;f(ge),A(null);const me=ke+ae.length+1;setTimeout(()=>{de.selectionStart=de.selectionEnd=me,de.focus()},0)},se=async(ae,de,_e)=>{T(!0),N(null);const ke=de==="replace"?"⏳ Generating...":zc(c,_e,"⏳ Generating...");f(ke);const Pe=zc(c,_e,"").replace(/\n\n\n+/g,`
|
|
130
|
-
|
|
131
|
-
`).trim();try{const Ue=await ft.generateText({prompt:ae,mode:de,dashboard:i,existingContent:de==="insert"?Pe:void 0,filters:I});f(de==="replace"?Ue.content:zc(ke,"⏳ Generating...",Ue.content))}catch(Ue){const et=Ue instanceof Error?Ue.message:"Generation failed";N(et),f(de==="replace"?_e:zc(ke,"⏳ Generating...",_e))}finally{T(!1)}},ye=ae=>{if(O!=null&&O.active){const fe=O.filter.toLowerCase(),J=cT.filter(Z=>Z.command.toLowerCase().includes(fe)||Z.description.toLowerCase().includes(fe));if(ae.key==="ArrowDown"){ae.preventDefault(),A(Z=>Z?{...Z,selectedIndex:Math.min(Z.selectedIndex+1,J.length-1)}:null);return}if(ae.key==="ArrowUp"){ae.preventDefault(),A(Z=>Z?{...Z,selectedIndex:Math.max(Z.selectedIndex-1,0)}:null);return}if(ae.key==="Enter"||ae.key==="Tab"){ae.preventDefault();const Z=J[O.selectedIndex];Z&&j(Z.command);return}if(ae.key==="Escape"){ae.preventDefault(),A(null);return}}if(p!=null&&p.active){if(ae.key==="ArrowDown"){ae.preventDefault(),y(fe=>fe?{...fe,selectedIndex:Math.min(fe.selectedIndex+1,Q.length-1)}:null);return}if(ae.key==="ArrowUp"){ae.preventDefault(),y(fe=>fe?{...fe,selectedIndex:Math.max(fe.selectedIndex-1,0)}:null);return}if(ae.key==="Enter"||ae.key==="Tab"){ae.preventDefault();const fe=Q[p.selectedIndex];fe&&le(fe.name);return}if(ae.key==="Escape"){ae.preventDefault(),y(null);return}}if(ae.key==="Escape"){ae.preventDefault(),te();return}if(ae.key!=="Enter")return;const de=h.current;if(de){const fe=de.selectionStart,J=c.substring(0,fe),Z=J.lastIndexOf(`
|
|
132
|
-
`)+1,be=J.substring(Z),Ne=NR(be);if(Ne&&i){ae.preventDefault(),se(Ne.prompt,Ne.mode,be);return}}const _e=ae.currentTarget,{selectionStart:ke,value:Pe}=_e,Ue=Pe.substring(0,ke),et=Ue.lastIndexOf(`
|
|
133
|
-
`)+1,Ke=Ue.substring(et),ge=Ke.match(/^(\s*)([-*])\s(.*)$/);if(ge){const fe=ge[1]??"",J=ge[2]??"-";if(!(ge[3]??"").trim()){ae.preventDefault();const $e=Pe.substring(0,et)+Pe.substring(ke);f($e),setTimeout(()=>{_e.selectionStart=_e.selectionEnd=et},0);return}ae.preventDefault();const be=`
|
|
134
|
-
${fe}${J} `,Ne=Pe.substring(0,ke)+be+Pe.substring(ke);f(Ne),setTimeout(()=>{_e.selectionStart=_e.selectionEnd=ke+be.length},0);return}const me=Ke.match(/^(\s*)(\d+)\.\s(.*)$/);if(me){const fe=me[1]??"",J=me[2]??"1";if(!(me[3]??"").trim()){ae.preventDefault();const ct=Pe.substring(0,et)+Pe.substring(ke);f(ct),setTimeout(()=>{_e.selectionStart=_e.selectionEnd=et},0);return}ae.preventDefault();const be=parseInt(J,10)+1,Ne=`
|
|
135
|
-
${fe}${be}. `,$e=Pe.substring(0,ke)+Ne+Pe.substring(ke);f($e),setTimeout(()=>{_e.selectionStart=_e.selectionEnd=ke+Ne.length},0);return}},xe=ae=>{E&&N(null);const de=ae.target.value,_e=ae.target.selectionStart;f(de);const ke=de.substring(0,_e),Pe=ke.lastIndexOf("{");if(Pe>=0){const Ke=ke.substring(Pe+1);if(!Ke.includes("}")&&!Ke.includes(`
|
|
136
|
-
`)){const ge=Ke.replace(/^\{/,"");y({active:!0,startPos:Pe,filter:ge,selectedIndex:0}),setTimeout(ue,0);return}}y(null);const Ue=ke.lastIndexOf(`
|
|
137
|
-
`)+1,et=ke.substring(Ue);if(et.startsWith("/")&&!et.includes(" ")){const Ke=et.substring(1);A({active:!0,filter:Ke,selectedIndex:0}),setTimeout(M,0)}else O!=null&&O.active&&A(null)},Oe=ae=>{const de=ae.relatedTarget;de!=null&&de.closest("[data-kpi-autocomplete]")||k||he()};return n?d.jsxs("div",{className:"h-full relative",children:[d.jsx("textarea",{ref:h,value:c,onChange:xe,onKeyDown:ye,onBlur:Oe,disabled:k,className:"h-full w-full p-4 resize-none font-mono text-sm focus:outline-none bg-transparent",style:k?{opacity:.6}:void 0,placeholder:"Type markdown here... Use {{ to insert KPI references, / for AI commands"}),d.jsx("span",{ref:D,className:"invisible fixed top-0 left-0 font-mono text-sm whitespace-pre","aria-hidden":"true"}),(p==null?void 0:p.active)&&Q.length>0&&d.jsx(RR,{filter:p.filter,kpiCharts:P,selectedIndex:p.selectedIndex,position:g,onSelect:le,onClose:()=>y(null)}),(O==null?void 0:O.active)&&d.jsx(CR,{filter:O.filter,selectedIndex:O.selectedIndex,position:R,onSelect:j,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 justify-center",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",style:{fontSize:"clamp(0.875rem, min(5cqh, 2.5cqw), 1.5rem)"},children:d.jsx(Xv,{rehypePlugins:[SR],components:ee,children:q})}),l&&t&&!e&&d.jsx("div",{className:"text-sm italic",style:{color:"var(--yc-color-text-muted)"},children:"Double-click to edit"})]})}function jR({children:e,onRemove:t,widgetType:n,onDoubleClick:r,isContentEditing:s}){const{isEditing:i}=Oi();return d.jsxs("div",{className:Wn("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,dT=12,FR={lg:1024,md:768,sm:0},BR={lg:12,md:6,sm:1};function HR(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 UR(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 zR=40;function WR(e){const t=[];for(let n=0;n<e;n++)for(let r=0;r<dT;r++)t.push({i:`bg-${n}-${r}`,x:r,y:n,w:1,h:1,static:!0});return t}const fT=WR(zR),YR=fT.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 $R({layout:e,onLayoutChange:t,dashboardName:n}){const{isEditing:r,setPendingLayout:s,setOriginalLayout:i,currentLayout:l,removeWidget:c,updateWidget:f}=Oi(),h=xm(),p=C.useRef(""),y=C.useRef(""),g=C.useRef(null),[v,D]=C.useState(0),[k,T]=C.useState(null),E=C.useRef(0),N=C.useRef(!1);C.useEffect(()=>{const q=g.current;if(!q)return;const G=new ResizeObserver(ee=>{var te;const he=(te=ee[0])==null?void 0:te.contentRect.width;he&&he>0&&D(Math.floor(he))});return G.observe(q),()=>G.disconnect()},[]),C.useEffect(()=>{const q=JSON.stringify(e);q!==p.current&&(p.current=q,i(e))},[e,i]),C.useEffect(()=>{r||T(null)},[r]);const O=l||e,A=O.gap??16,{gridLayout:R,widgetMap:S,widgetList:I}=C.useMemo(()=>{const q=[],G=new Map,ee=[];let he=0;const te=new Set;return O.rows.forEach((M,Q)=>{let le=0,j=0;M.widgets.forEach((se,ye)=>{let xe=HR(se);if(te.has(xe)){let _e=2;for(;te.has(`${xe}-${_e}`);)_e++;xe=`${xe}-${_e}`}te.add(xe);const Oe=se.height??M.height,ae=Math.ceil(Oe/Ll),de={i:xe,x:se.x??le,y:se.y??he,w:se.cols,h:ae,minW:1,minH:1,static:!r||k===xe};q.push(de),G.set(xe,{widget:se,rowIndex:Q,widgetIndex:ye}),ee.push({id:xe,widget:se,rowIndex:Q,widgetIndex:ye}),le+=se.cols,j=Math.max(j,ae)}),he+=j}),{gridLayout:UR(q),widgetMap:G,widgetList:ee}},[O,r,k]);C.useEffect(()=>{r&&I.length>E.current&&setTimeout(()=>{var q;(q=g.current)==null||q.scrollIntoView({behavior:"smooth",block:"end"})},100),E.current=I.length},[I.length,r]);const _=C.useMemo(()=>uI(R),[R]),P=C.useCallback(q=>{const ee=[...q.filter(Q=>S.has(Q.i))].sort((Q,le)=>Q.y-le.y||Q.x-le.x),he=ee.map(Q=>`${Q.i}:${Q.x},${Q.y},${Q.w},${Q.h}`).join("|");if(he===y.current)return null;y.current=he;const te=new Map;ee.forEach(Q=>{const le=S.get(Q.i);if(!le)return;let j=te.get(Q.y);j||(j={items:[]},te.set(Q.y,j));const se=Q.h*Ll;j.items.push({item:Q,widget:{...le.widget,cols:Q.w,height:se,x:Q.x,y:Q.y}})});const ue=[],M=[...te.keys()].sort((Q,le)=>Q-le);for(const Q of M){const le=te.get(Q),j=Math.max(...le.items.map(se=>se.item.h));ue.push({height:j*Ll,widgets:le.items.map(se=>se.widget)})}return{gap:O.gap,rows:ue}},[S,O.gap]),F=C.useCallback(q=>{if(!r||N.current)return;const G=P(q);G&&(s(G),t==null||t(G))},[r,P,s,t]),H=C.useCallback(q=>{if(N.current=!1,!r)return;const G=P(q);G&&(s(G),t==null||t(G))},[r,P,s,t]),U=C.useCallback((q,G)=>{c(q,G)},[c]),Y=C.useCallback((q,G,ee)=>{f(q,G,{content:ee})},[f]);return d.jsxs(d.Fragment,{children:[!r&&d.jsx("style",{children:".react-resizable-handle { display: none !important; }"}),r&&d.jsx("style",{children:`
|
|
138
|
-
.react-grid-placeholder {
|
|
139
|
-
background: rgba(59, 130, 246, 0.15) !important;
|
|
140
|
-
border: 2px dashed rgba(59, 130, 246, 0.4) !important;
|
|
141
|
-
border-radius: var(--yc-radius) !important;
|
|
142
|
-
opacity: 1 !important;
|
|
143
|
-
}
|
|
144
|
-
.yc-edit-grid .react-grid-item {
|
|
145
|
-
transition: all 200ms ease !important;
|
|
146
|
-
}
|
|
147
|
-
.yc-edit-grid .react-grid-item.react-draggable-dragging {
|
|
148
|
-
transition: none !important;
|
|
149
|
-
z-index: 100;
|
|
150
|
-
box-shadow: 0 8px 25px rgba(0,0,0,0.15);
|
|
151
|
-
}
|
|
152
|
-
.yc-edit-grid .react-resizable-handle {
|
|
153
|
-
background: none !important;
|
|
154
|
-
width: 24px !important;
|
|
155
|
-
height: 24px !important;
|
|
156
|
-
z-index: 10 !important;
|
|
157
|
-
}
|
|
158
|
-
.yc-edit-grid .react-resizable-handle::after {
|
|
159
|
-
content: '' !important;
|
|
160
|
-
position: absolute !important;
|
|
161
|
-
right: 4px !important;
|
|
162
|
-
bottom: 4px !important;
|
|
163
|
-
width: 10px !important;
|
|
164
|
-
height: 10px !important;
|
|
165
|
-
border-right: 2px solid rgba(59,130,246,0.4) !important;
|
|
166
|
-
border-bottom: 2px solid rgba(59,130,246,0.4) !important;
|
|
167
|
-
border-radius: 0 0 2px 0 !important;
|
|
168
|
-
}
|
|
169
|
-
.yc-edit-grid .react-resizable-handle:hover::after {
|
|
170
|
-
border-color: rgba(59,130,246,0.8) !important;
|
|
171
|
-
}
|
|
172
|
-
.yc-bg-grid {
|
|
173
|
-
position: absolute !important;
|
|
174
|
-
inset: 0 !important;
|
|
175
|
-
pointer-events: none !important;
|
|
176
|
-
z-index: 0 !important;
|
|
177
|
-
overflow: hidden !important;
|
|
178
|
-
}
|
|
179
|
-
.yc-bg-grid .react-grid-item {
|
|
180
|
-
transition: none !important;
|
|
181
|
-
}
|
|
182
|
-
.yc-edit-grid {
|
|
183
|
-
position: relative;
|
|
184
|
-
}
|
|
185
|
-
.yc-edit-grid > .react-grid-item {
|
|
186
|
-
z-index: 1;
|
|
187
|
-
}
|
|
188
|
-
`}),d.jsxs("div",{ref:g,style:{position:"relative"},children:[v>0&&r&&h==="lg"&&d.jsx(iI,{className:"yc-bg-grid",layout:fT,cols:dT,rowHeight:Ll,width:v,margin:[A,A],useCSSTransforms:!0,compactType:null,isDraggable:!1,isResizable:!1,autoSize:!1,children:YR}),v>0&&d.jsx(lI,{className:r?"layout yc-edit-grid":"layout",layouts:_,breakpoints:FR,cols:BR,rowHeight:Ll,width:v,margin:[A,A],isDraggable:r&&h==="lg",isResizable:r&&h==="lg",onLayoutChange:(q,G)=>{G.lg&&F(G.lg)},onDragStart:()=>{N.current=!0},onResizeStart:()=>{N.current=!0},onDragStop:q=>H([...q]),onResizeStop:q=>H([...q]),compactType:"vertical",autoSize:!0,useCSSTransforms:!0,children:I.map(({id:q,widget:G,rowIndex:ee,widgetIndex:he})=>d.jsx("div",{className:"h-full",children:d.jsxs(jR,{onRemove:()=>U(ee,he),widgetType:G.type,isContentEditing:k===q,onDoubleClick:G.type==="text"?()=>T(q):void 0,children:[G.type==="chart"&&G.ref&&d.jsx(hI,{chartRef:G.ref}),G.type==="text"&&d.jsx(PR,{content:G.content||"",onUpdate:te=>Y(ee,he,te),isContentEditing:k===q,onEditStart:()=>T(q),onEditEnd:()=>T(null),dashboardName:n})]})},q))})]})]})}function qR({isOpen:e,onClose:t,onAdd:n,existingCharts:r}){const{data:s}=ya(),[i,l]=C.useState(""),c=C.useRef(null);if(C.useEffect(()=>{const y=v=>{v.key==="Escape"&&t()},g=v=>{c.current&&!c.current.contains(v.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:c,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 VR(e){const t=Math.floor((Date.now()-e)/1e3);if(t<10)return"just now";if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:new Date(e).toLocaleDateString()}function QR({dashboardId:e,title:t,description:n,contentRef:r,activeTab:s}){const{isEditing:i,setIsEditing:l,pendingLayout:c,setPendingLayout:f,setOriginalLayout:h,hasChanges:p,addWidget:y,currentLayout:g,undo:v,redo:D,canUndo:k,canRedo:T}=Oi(),E=xm(),O=!!pa(),A=Td(),R=TN(e),S=wN(),I=Fk({queryKey:["chartData"]}),_=Yn(),P=(()=>{const j=_.getQueryCache();let se=0;for(const ye of j.getAll()){const xe=ye.queryKey[0];(xe==="chartData"||xe==="chartWithData")&&ye.state.dataUpdatedAt>se&&(se=ye.state.dataUpdatedAt)}return se>0?se:null})(),[F,H]=C.useState(!1),[U,Y]=C.useState(!1),[q,G]=C.useState(!1),[ee,he]=C.useState(!1),te=(g==null?void 0:g.rows.flatMap(j=>j.widgets.filter(se=>se.type==="chart"&&se.ref).map(se=>se.ref)))||[],ue=()=>{S()},M=async j=>{if(r.current){he(!0),H(!1);try{j==="pdf"?await x6(r.current,`${e}-dashboard`,t):await g6(r.current,`${e}-dashboard`,j)}finally{he(!1)}}},Q=async()=>{if(c)try{await R.mutateAsync({layout:c,tab:s}),h(c),f(null),l(!1)}catch(j){console.error("Failed to save:",j)}},le=()=>{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: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:()=>G(!q),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"})})]}),q&&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:()=>{G(!1),Y(!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:()=>{G(!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:v,disabled:!k,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:D,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:le,className:"px-4 py-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"Cancel"}),d.jsx("button",{onClick:Q,disabled:!p||R.isPending,className:Wn("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:R.isPending?"Saving...":"Save & Push"})]}):d.jsxs(d.Fragment,{children:[P&&I===0&&d.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},title:new Date(P).toLocaleString(),children:["Updated ",VR(P)]}),d.jsx("button",{onClick:ue,disabled:I>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:Wn("w-5 h-5",I>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:()=>H(!F),disabled:ee,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-50",style:{color:"var(--yc-color-text-secondary)"},title:"Export dashboard",children:ee?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"})})}),F&&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:()=>M("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:()=>M("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:()=>M("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"]})]})]}),!O&&d.jsx(D2,{resourceType:"dashboard",resourceName:e}),!O&&A&&d.jsxs("button",{onClick:()=>Ls.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"]}),!O&&(E==="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"})})}))]})})]}),n&&d.jsx("p",{className:"px-4 pb-3 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:n})]}),d.jsx(qR,{isOpen:U,onClose:()=>Y(!1),onAdd:y,existingCharts:te})]})}function GR({filters:e,isEditing:t,onReorder:n,onRename:r,showCrossFilters:s}){const[i,l]=C.useState(null),[c,f]=C.useState(null),h=Je(A=>A.globalFilters),p=Je(A=>A.resetFilters),y=Je(A=>A.crossFilters),g=Je(A=>A.clearCrossFilter),v=Je(A=>A.clearAllCrossFilters),D=s?Object.values(y):[];if(e.length===0&&D.length===0)return null;const k=e.some(A=>{const R=h[A.name];if(R==null||R===""||Array.isArray(R)&&R.length===0)return!1;const S=A.default??(A.type==="date_range"?"last_30_days":void 0);return JSON.stringify(R)!==JSON.stringify(S)});function T(A,R){l(R),A.dataTransfer.effectAllowed="move"}function E(A,R){A.preventDefault(),A.dataTransfer.dropEffect="move",f(R)}function N(A,R){if(A.preventDefault(),i===null||i===R)return;const S=[...e],I=S.splice(i,1)[0];S.splice(R,0,I),n==null||n(S),l(null),f(null)}function O(){l(null),f(null)}return t?d.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.map((A,R)=>{const S=A.label||da(A.name),I=i===R?"opacity-50":"";return d.jsxs("div",{draggable:!0,onDragStart:_=>T(_,R),onDragOver:_=>E(_,R),onDrop:_=>N(_,R),onDragEnd:O,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:c===R?{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(KR,{value:S,onChange:_=>r==null?void 0:r(R,_)}),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 R=A.label||da(A.name),S=typeof A.default=="string"?A.default:void 0;switch(A.type){case"date_range":return d.jsx(b2,{name:A.name,label:R,description:A.description,defaultValue:S},A.name);case"select":{const I=(A.options||[]).map(_=>typeof _=="string"?{value:_,label:_}:_);return d.jsx(td,{name:A.name,label:R,description:A.description,options:I,defaultValue:S},A.name)}case"dynamic_select":return A.source?d.jsx(td,{name:A.name,label:R,description:A.description,source:A.source,defaultValue:S},A.name):d.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[R,": dynamic_select requires source"]},A.name);case"multi_select":{const I=(A.options||[]).map(_=>typeof _=="string"?{value:_,label:_}:_);return d.jsx(v2,{name:A.name,label:R,description:A.description,options:I,defaultValue:Array.isArray(A.default)?A.default:void 0,source:A.source},A.name)}case"text":return d.jsx(w2,{name:A.name,label:R,description:A.description,defaultValue:S},A.name);case"number":return d.jsx(C2,{name:A.name,label:R,description:A.description,defaultValue:typeof A.default=="number"?A.default:void 0},A.name);case"boolean":return d.jsx(N2,{name:A.name,label:R,description:A.description},A.name);default:return d.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[R,": ",A.type," (not supported)"]},A.name)}}),D.length>0&&e.length>0&&d.jsx("div",{className:"w-px h-6 mx-1",style:{backgroundColor:"var(--yc-color-border)"}}),D.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,": ",nm(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}`)),(k||D.length>0)&&d.jsx("button",{type:"button",onClick:()=>{k&&p(),D.length>0&&v()},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 KR({value:e,onChange:t}){const[n,r]=C.useState(!1),[s,i]=C.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:c=>{c.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:c=>i(c.target.value),onBlur:l,onKeyDown:c=>{c.key==="Enter"&&l(),c.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:c=>c.stopPropagation()})}function XR({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:Wn("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 JR({dashboardId:e,title:t,description:n,contentRef:r,tabs:s,activeTab:i,onTabChange:l,filters:c}){const{isEditing:f,pendingFilters:h,setPendingFilters:p}=Oi(),y=Je(v=>Object.keys(v.crossFilters).length>0);C.useEffect(()=>{f&&!h&&p([...c])},[f]);const g=f&&h?h:c;return d.jsxs(d.Fragment,{children:[d.jsx(QR,{dashboardId:e,title:t,description:n,contentRef:r,activeTab:s?i:void 0}),s&&i&&l&&d.jsx(XR,{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(GR,{filters:g,isEditing:f,onReorder:v=>p(v),onRename:(v,D)=>{const k=[...g];k[v]={...k[v],label:D},p(k)},showCrossFilters:!f})})]})}function ZR({dashboardId:e,branch:t,initialTab:n}){const{data:r,isLoading:s,error:i}=EN(e,t),l=C.useRef(null),c=Yn(),f=Je(k=>k.globalFilters),[h,p]=C.useState(n||"");C.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]),C.useEffect(()=>{if(!(r!=null&&r.tabs))return;const k=r.tabs.map(E=>E.name);if(h&&k.includes(h))return;const T=n&&k.includes(n)?n:k[0];T&&p(T)},[r==null?void 0:r.tabs,n]);const y=Je(k=>k.clearAllCrossFilters),g=C.useCallback(k=>{var E;p(k),y();const T=`#/dashboards/${e}`;if(window.history.replaceState(null,"",`${T}?tab=${encodeURIComponent(k)}`),r!=null&&r.name){const N=gi(Object.fromEntries(Object.entries(f).filter(([A,R])=>R!=null)));ft.warmDashboardCache(r.name,N,k).catch(()=>{});const O=(E=r.tabs)==null?void 0:E.find(A=>A.name===k);if(O)for(const A of O.layout.rows)for(const R of A.widgets)R.type==="chart"&&R.ref&&c.prefetchQuery({queryKey:["chartWithData",R.ref,N],queryFn:()=>ft.queryChart(R.ref,N,{includeConfig:!0}),staleTime:1e3*60*5})}},[e,r==null?void 0:r.name,r==null?void 0:r.tabs,f,c,y]),v=C.useMemo(()=>{if(r){if(r.tabs){const k=r.tabs.find(T=>T.name===h);return k==null?void 0:k.layout}return r.layout}},[r,h]),D=C.useMemo(()=>{if(!r)return[];const k=r.filters||[];if(r.tabs){const T=r.tabs.find(N=>N.name===h),E=(T==null?void 0:T.filters)||[];return[...k,...E]}return k},[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"]})}):v?d.jsx(tA,{children:d.jsxs("div",{style:{backgroundColor:"var(--yc-color-background)"},children:[d.jsx(JR,{dashboardId:e,title:r.title,description:r.description,contentRef:l,tabs:r.tabs,activeTab:h,onTabChange:r.tabs?g:void 0,filters:D}),d.jsx("div",{ref:l,className:"p-6",children:d.jsx($R,{layout:v,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 eP=C.lazy(()=>Wr(()=>import("./LoginPage-XYLwfbfw.js"),__vite__mapDeps([0,1])).then(e=>({default:e.LoginPage}))),tP=C.lazy(()=>Wr(()=>import("./SetupWizard-fle7FC4b.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SetupWizard}))),nP=C.lazy(()=>Wr(()=>import("./UserManagement-DwZ-AaqI.js"),__vite__mapDeps([3,1])).then(e=>({default:e.UserManagement}))),rP=C.lazy(()=>Wr(()=>import("./ShareManagement-b3j4jzn3.js"),__vite__mapDeps([4,1])).then(e=>({default:e.ShareManagement}))),sP=C.lazy(()=>Wr(()=>import("./PublicViewer-CZJYS0wF.js"),__vite__mapDeps([5,1])).then(e=>({default:e.PublicViewer}))),oP=C.lazy(()=>Wr(()=>import("./EventManagement-DQY1Sic0.js"),__vite__mapDeps([6,1])).then(e=>({default:e.EventManagement}))),aP=C.lazy(()=>Wr(()=>import("./ExplorePage-C9M-fQ3Y.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 x0(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,v]of new URLSearchParams(s).entries())y[g]=v;return{type:i[1]==="dashboards"?"public_dashboard":"public_chart",name:decodeURIComponent(i[2]),params:y}}const[l,c]=t.split("?"),f=l==null?void 0:l.match(/^\/(charts)\/(.+)\/detail$/);if(f&&f[2]){const y={};if(c)for(const[g,v]of new URLSearchParams(c).entries())y[g]=v;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(c)for(const[y,g]of new URLSearchParams(c).entries())p[y]=g;return{type:h[1]==="dashboards"?"dashboard":"chart",name:decodeURIComponent(h[2]),params:p}}function pb(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 iP(){SN();const e=So(k=>k.auth),t=So(k=>k.checkAuth),n=Td();C.useEffect(()=>{t()},[t]);const{data:r,isLoading:s}=ya(),{data:i,isLoading:l}=cv(),c=Je(k=>k.resetFilters),[f,h]=C.useState(()=>window.location.hash.replace(/^#/,"")||"");C.useEffect(()=>{const k=()=>{h(window.location.hash.replace(/^#/,"")||""),c()};return window.addEventListener("hashchange",k),()=>window.removeEventListener("hashchange",k)},[c]);const p=C.useCallback(k=>{window.location.hash=k,h(k),c()},[c]);C.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=x0(f);if(y&&(y.type==="public_chart"||y.type==="public_dashboard"))return d.jsx(C.Suspense,{fallback:d.jsx(Rl,{}),children:d.jsx(sP,{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(C.Suspense,{fallback:d.jsx(Rl,{}),children:d.jsx(tP,{})});if(e.status==="unauthenticated")return d.jsx(C.Suspense,{fallback:d.jsx(Rl,{}),children:d.jsx(eP,{})});const g=x0(f);if((g==null?void 0:g.type)==="explore")return d.jsx(rd,{fallback:pb,children:d.jsx(T1,{children:d.jsx(C.Suspense,{fallback:d.jsx(Rl,{}),children:d.jsx(aP,{})})})});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 v=x0(f),D=()=>v?v.type==="settings"&&v.name==="users"?d.jsx(C.Suspense,{fallback:d.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:d.jsx(nP,{})}):v.type==="settings"&&v.name==="shares"?d.jsx(C.Suspense,{fallback:d.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:d.jsx(rP,{})}):v.type==="events"?d.jsx(C.Suspense,{fallback:d.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:d.jsx(oP,{})}):v.type==="dashboard"?d.jsx(ZR,{dashboardId:v.name,initialTab:v.params.tab}):v.type==="chart_detail"?d.jsx(Z6,{chartName:v.name,params:v.params}):d.jsx(J6,{chartName:v.name,drillParams:v.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:k=>{k.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(rd,{fallback:pb,children:d.jsx(T1,{children:d.jsx(TO,{currentPath:f,onNavigate:p,onNavigateToUsers:()=>p("/settings/users"),onNavigateToShares:()=>p("/settings/shares"),children:D()})})})}lk.createRoot(document.getElementById("root")).render(d.jsx(C.StrictMode,{children:d.jsx(Bk,{children:d.jsx(iP,{})})}));export{cu as A,B2 as B,id as C,A2 as D,em as E,_2 as F,Q2 as G,$2 as H,xm as I,$N as J,bO as K,F2 as L,Xv as M,vO as N,U2 as P,D2 as S,tm as T,V2 as W,Wr as _,ft as a,Vb as b,Wn as c,uv as d,ya as e,Om as f,Je as g,Td as h,Ls as i,d as j,K2 as k,q2 as l,Y2 as m,W2 as n,z2 as o,H2 as p,dP as q,ZR as r,Yn as s,sr as t,So as u,Ja as v,ws as w,p6 as x,Ka as y,on as z};
|