yamchart 0.7.2 → 0.8.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.
Files changed (74) hide show
  1. package/CLAUDE.md +51 -0
  2. package/dist/{advisor-5BTRAICH.js → advisor-57BOMUUF.js} +11 -10
  3. package/dist/{advisor-5BTRAICH.js.map → advisor-57BOMUUF.js.map} +1 -1
  4. package/dist/{chunk-5VA43CTW.js → chunk-E2UZXDF6.js} +37 -42
  5. package/dist/chunk-E2UZXDF6.js.map +1 -0
  6. package/dist/{chunk-SSUVEADJ.js → chunk-JYQKDWLG.js} +76 -14
  7. package/dist/chunk-JYQKDWLG.js.map +1 -0
  8. package/dist/{chunk-565OEBW7.js → chunk-OTAUP5RC.js} +3 -3
  9. package/dist/chunk-UND73EOB.js +449 -0
  10. package/dist/chunk-UND73EOB.js.map +1 -0
  11. package/dist/{chunk-UDRJFEJU.js → chunk-X6LQGWUX.js} +349 -176
  12. package/dist/chunk-X6LQGWUX.js.map +1 -0
  13. package/dist/{connection-utils-AGSQ5HNN.js → connection-utils-FTSZU2VF.js} +5 -4
  14. package/dist/{describe-AA4UT4U6.js → describe-TGIOBNJB.js} +5 -4
  15. package/dist/{describe-AA4UT4U6.js.map → describe-TGIOBNJB.js.map} +1 -1
  16. package/dist/{dev-EUWIRL4N.js → dev-MRZ76V74.js} +485 -44
  17. package/dist/dev-MRZ76V74.js.map +1 -0
  18. package/dist/{dist-LZNDQDH3.js → dist-PVHFUYP2.js} +23 -3
  19. package/dist/{dist-YTGUIBKG.js → dist-WDTDQDTX.js} +72 -1
  20. package/dist/dist-WDTDQDTX.js.map +1 -0
  21. package/dist/index.js +135 -17
  22. package/dist/index.js.map +1 -1
  23. package/dist/{init-CI4VARQG.js → init-UYQE5DPU.js} +2 -2
  24. package/dist/{init-CI4VARQG.js.map → init-UYQE5DPU.js.map} +1 -1
  25. package/dist/public/assets/EventManagement-BlxJ2TFw.js +18 -0
  26. package/dist/public/assets/{LoginPage-BwMmpq8e.js → LoginPage-BT8ikmPn.js} +1 -1
  27. package/dist/public/assets/PublicViewer-B4uFxgbt.js +1 -0
  28. package/dist/public/assets/{SetupWizard-DU8R2dPp.js → SetupWizard-njrOhCzw.js} +1 -1
  29. package/dist/public/assets/ShareManagement-Bg16oJhW.js +1 -0
  30. package/dist/public/assets/UserManagement-tiCIT4UY.js +1 -0
  31. package/dist/public/assets/index-B41yj3io.js +187 -0
  32. package/dist/public/assets/{index-C0hWblBI.css → index-BZ25r23j.css} +1 -1
  33. package/dist/public/assets/{index.es-YeJujQ5o.js → index.es-BuktD_R2.js} +1 -1
  34. package/dist/public/assets/{jspdf.es.min-BzZgn3ka.js → jspdf.es.min-DFRl2hZQ.js} +3 -3
  35. package/dist/public/index.html +2 -2
  36. package/dist/{query-THDVBBVZ.js → query-JRMMNXX6.js} +5 -4
  37. package/dist/{query-THDVBBVZ.js.map → query-JRMMNXX6.js.map} +1 -1
  38. package/dist/{sample-6WPQS7PA.js → sample-VGIY4U4J.js} +5 -4
  39. package/dist/{sample-6WPQS7PA.js.map → sample-VGIY4U4J.js.map} +1 -1
  40. package/dist/{search-657DXBRS.js → search-QSYNG4SR.js} +5 -4
  41. package/dist/{search-657DXBRS.js.map → search-QSYNG4SR.js.map} +1 -1
  42. package/dist/semantic-RAP3S5PQ.js +39 -0
  43. package/dist/semantic-RAP3S5PQ.js.map +1 -0
  44. package/dist/{sync-warehouse-4KBV5S3L.js → sync-warehouse-XHTBZH25.js} +5 -4
  45. package/dist/{sync-warehouse-4KBV5S3L.js.map → sync-warehouse-XHTBZH25.js.map} +1 -1
  46. package/dist/{tables-KLDBUUSE.js → tables-UOO342TA.js} +5 -4
  47. package/dist/{tables-KLDBUUSE.js.map → tables-UOO342TA.js.map} +1 -1
  48. package/dist/templates/default/.claude/skills/databricks/SKILL.md +76 -0
  49. package/dist/templates/default/.claude/skills/dbt-advisor/SKILL.md +107 -0
  50. package/dist/templates/default/.claude/skills/duckdb/SKILL.md +67 -0
  51. package/dist/templates/default/.claude/skills/mysql/SKILL.md +69 -0
  52. package/dist/templates/default/.claude/skills/postgres/SKILL.md +69 -0
  53. package/dist/templates/default/.claude/skills/snowflake/SKILL.md +64 -0
  54. package/dist/templates/default/CLAUDE.md +7 -0
  55. package/dist/templates/default/docs/yamchart-reference.md +222 -1
  56. package/dist/{test-JSAWS5ZP.js → test-TXRZWNXK.js} +5 -4
  57. package/dist/{test-JSAWS5ZP.js.map → test-TXRZWNXK.js.map} +1 -1
  58. package/dist/update-UKMEWCSO.js +220 -0
  59. package/dist/update-UKMEWCSO.js.map +1 -0
  60. package/package.json +5 -3
  61. package/dist/chunk-5VA43CTW.js.map +0 -1
  62. package/dist/chunk-SSUVEADJ.js.map +0 -1
  63. package/dist/chunk-UDRJFEJU.js.map +0 -1
  64. package/dist/dev-EUWIRL4N.js.map +0 -1
  65. package/dist/dist-YTGUIBKG.js.map +0 -1
  66. package/dist/public/assets/PublicViewer-vIDojjIR.js +0 -1
  67. package/dist/public/assets/ShareManagement-7iS6lM2T.js +0 -1
  68. package/dist/public/assets/UserManagement-By7YRZrF.js +0 -1
  69. package/dist/public/assets/index-CXx1PiRF.js +0 -174
  70. package/dist/update-HCR6MYJX.js +0 -88
  71. package/dist/update-HCR6MYJX.js.map +0 -1
  72. /package/dist/{chunk-565OEBW7.js.map → chunk-OTAUP5RC.js.map} +0 -0
  73. /package/dist/{connection-utils-AGSQ5HNN.js.map → connection-utils-FTSZU2VF.js.map} +0 -0
  74. /package/dist/{dist-LZNDQDH3.js.map → dist-PVHFUYP2.js.map} +0 -0
@@ -0,0 +1,187 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginPage-BT8ikmPn.js","assets/echarts-DtOYsfLX.js","assets/SetupWizard-njrOhCzw.js","assets/UserManagement-tiCIT4UY.js","assets/ShareManagement-Bg16oJhW.js","assets/PublicViewer-B4uFxgbt.js","assets/EventManagement-BlxJ2TFw.js"])))=>i.map(i=>d[i]);
2
+ var zw=Object.defineProperty;var Lg=e=>{throw TypeError(e)};var Ww=(e,t,n)=>t in e?zw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>Ww(e,typeof t!="symbol"?t+"":t,n),Nh=(e,t,n)=>t.has(e)||Lg("Cannot "+n);var Y=(e,t,n)=>(Nh(e,t,"read from private field"),n?n.call(e):t.get(e)),je=(e,t,n)=>t.has(e)?Lg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),De=(e,t,n,r)=>(Nh(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),rt=(e,t,n)=>(Nh(e,t,"access private method"),n);var Ec=(e,t,n,r)=>({set _(o){De(e,t,o,n)},get _(){return Y(e,t,r)}});import{r as fa,a as N,R as Ie,E as Yw,g as xx}from"./echarts-DtOYsfLX.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)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(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Dh={exports:{}},fl={};/**
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 Rg;function $w(){if(Rg)return fl;Rg=1;var e=fa(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(c,d,h){var p,y={},b=null,v=null;h!==void 0&&(b=""+h),d.key!==void 0&&(b=""+d.key),d.ref!==void 0&&(v=d.ref);for(p in d)r.call(d,p)&&!i.hasOwnProperty(p)&&(y[p]=d[p]);if(c&&c.defaultProps)for(p in d=c.defaultProps,d)y[p]===void 0&&(y[p]=d[p]);return{$$typeof:t,type:c,key:b,ref:v,props:y,_owner:o.current}}return fl.Fragment=n,fl.jsx=l,fl.jsxs=l,fl}var Pg;function qw(){return Pg||(Pg=1,Dh.exports=$w()),Dh.exports}var f=qw(),Tc={},Oh={exports:{}},Xn={},Ah={exports:{}},Ih={};/**
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 jg;function Vw(){return jg||(jg=1,(function(e){function t(ee,ce){var M=ee.length;ee.push(ce);e:for(;0<M;){var G=M-1>>>1,ae=ee[G];if(0<o(ae,ce))ee[G]=ce,ee[M]=ae,M=G;else break e}}function n(ee){return ee.length===0?null:ee[0]}function r(ee){if(ee.length===0)return null;var ce=ee[0],M=ee.pop();if(M!==ce){ee[0]=M;e:for(var G=0,ae=ee.length,j=ae>>>1;G<j;){var le=2*(G+1)-1,he=ee[le],pe=le+1,Oe=ee[pe];if(0>o(he,M))pe<ae&&0>o(Oe,he)?(ee[G]=Oe,ee[pe]=M,G=pe):(ee[G]=he,ee[le]=M,G=le);else if(pe<ae&&0>o(Oe,M))ee[G]=Oe,ee[pe]=M,G=pe;else break e}}return ce}function o(ee,ce){var M=ee.sortIndex-ce.sortIndex;return M!==0?M:ee.id-ce.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 d=[],h=[],p=1,y=null,b=3,v=!1,D=!1,k=!1,E=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(ee){for(var ce=n(h);ce!==null;){if(ce.callback===null)r(h);else if(ce.startTime<=ee)r(h),ce.sortIndex=ce.expirationTime,t(d,ce);else break;ce=n(h)}}function A(ee){if(k=!1,O(ee),!D)if(n(d)!==null)D=!0,ne(L);else{var ce=n(h);ce!==null&&me(A,ce.startTime-ee)}}function L(ee,ce){D=!1,k&&(k=!1,T(I),I=-1),v=!0;var M=b;try{for(O(ce),y=n(d);y!==null&&(!(y.expirationTime>ce)||ee&&!F());){var G=y.callback;if(typeof G=="function"){y.callback=null,b=y.priorityLevel;var ae=G(y.expirationTime<=ce);ce=e.unstable_now(),typeof ae=="function"?y.callback=ae:y===n(d)&&r(d),O(ce)}else r(d);y=n(d)}if(y!==null)var j=!0;else{var le=n(h);le!==null&&me(A,le.startTime-ce),j=!1}return j}finally{y=null,b=M,v=!1}}var _=!1,S=null,I=-1,P=5,U=-1;function F(){return!(e.unstable_now()-U<P)}function H(){if(S!==null){var ee=e.unstable_now();U=ee;var ce=!0;try{ce=S(!0,ee)}finally{ce?W():(_=!1,S=null)}}else _=!1}var W;if(typeof C=="function")W=function(){C(H)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,Q=$.port2;$.port1.onmessage=H,W=function(){Q.postMessage(null)}}else W=function(){E(H,0)};function ne(ee){S=ee,_||(_=!0,W())}function me(ee,ce){I=E(function(){ee(e.unstable_now())},ce)}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(ee){ee.callback=null},e.unstable_continueExecution=function(){D||v||(D=!0,ne(L))},e.unstable_forceFrameRate=function(ee){0>ee||125<ee?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<ee?Math.floor(1e3/ee):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(ee){switch(b){case 1:case 2:case 3:var ce=3;break;default:ce=b}var M=b;b=ce;try{return ee()}finally{b=M}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(ee,ce){switch(ee){case 1:case 2:case 3:case 4:case 5:break;default:ee=3}var M=b;b=ee;try{return ce()}finally{b=M}},e.unstable_scheduleCallback=function(ee,ce,M){var G=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?G+M:G):M=G,ee){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=M+ae,ee={id:p++,callback:ce,priorityLevel:ee,startTime:M,expirationTime:ae,sortIndex:-1},M>G?(ee.sortIndex=M,t(h,ee),n(d)===null&&ee===n(h)&&(k?(T(I),I=-1):k=!0,me(A,M-G))):(ee.sortIndex=ae,t(d,ee),D||v||(D=!0,ne(L))),ee},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(ee){var ce=b;return function(){var M=b;b=ce;try{return ee.apply(this,arguments)}finally{b=M}}}})(Ih)),Ih}var Fg;function Qw(){return Fg||(Fg=1,Ah.exports=Vw()),Ah.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 Bg;function Gw(){if(Bg)return Xn;Bg=1;var e=fa(),t=Qw();function n(s){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+s,u=1;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+s+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function i(s,a){l(s,a),l(s+"Capture",a)}function l(s,a){for(o[s]=a,s=0;s<a.length;s++)r.add(a[s])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},y={};function b(s){return d.call(y,s)?!0:d.call(p,s)?!1:h.test(s)?y[s]=!0:(p[s]=!0,!1)}function v(s,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:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function D(s,a,u,m){if(a===null||typeof a>"u"||v(s,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(s,a,u,m,x,w,R){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=m,this.attributeNamespace=x,this.mustUseProperty=u,this.propertyName=s,this.type=a,this.sanitizeURL=w,this.removeEmptyString=R}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){E[s]=new k(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var a=s[0];E[a]=new k(a,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){E[s]=new k(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){E[s]=new k(s,2,!1,s,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(s){E[s]=new k(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){E[s]=new k(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){E[s]=new k(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){E[s]=new k(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){E[s]=new k(s,5,!1,s.toLowerCase(),null,!1,!1)});var T=/[\-:]([a-z])/g;function C(s){return s[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(s){var a=s.replace(T,C);E[a]=new k(a,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var a=s.replace(T,C);E[a]=new k(a,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var a=s.replace(T,C);E[a]=new k(a,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){E[s]=new k(s,1,!1,s.toLowerCase(),null,!1,!1)}),E.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){E[s]=new k(s,1,!1,s.toLowerCase(),null,!0,!0)});function O(s,a,u,m){var x=E.hasOwnProperty(a)?E[a]:null;(x!==null?x.type!==0:m||!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(D(a,u,x,m)&&(u=null),m||x===null?b(a)&&(u===null?s.removeAttribute(a):s.setAttribute(a,""+u)):x.mustUseProperty?s[x.propertyName]=u===null?x.type===3?!1:"":u:(a=x.attributeName,m=x.attributeNamespace,u===null?s.removeAttribute(a):(x=x.type,u=x===3||x===4&&u===!0?"":""+u,m?s.setAttributeNS(m,a,u):s.setAttribute(a,u))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,L=Symbol.for("react.element"),_=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),U=Symbol.for("react.provider"),F=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),me=Symbol.for("react.offscreen"),ee=Symbol.iterator;function ce(s){return s===null||typeof s!="object"?null:(s=ee&&s[ee]||s["@@iterator"],typeof s=="function"?s:null)}var M=Object.assign,G;function ae(s){if(G===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);G=a&&a[1]||""}return`
27
+ `+G+s}var j=!1;function le(s,a){if(!s||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(ue){var m=ue}Reflect.construct(s,[],a)}else{try{a.call()}catch(ue){m=ue}s.call(a.prototype)}else{try{throw Error()}catch(ue){m=ue}s()}}catch(ue){if(ue&&m&&typeof ue.stack=="string"){for(var x=ue.stack.split(`
28
+ `),w=m.stack.split(`
29
+ `),R=x.length-1,q=w.length-1;1<=R&&0<=q&&x[R]!==w[q];)q--;for(;1<=R&&0<=q;R--,q--)if(x[R]!==w[q]){if(R!==1||q!==1)do if(R--,q--,0>q||x[R]!==w[q]){var K=`
30
+ `+x[R].replace(" at new "," at ");return s.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",s.displayName)),K}while(1<=R&&0<=q);break}}}finally{j=!1,Error.prepareStackTrace=u}return(s=s?s.displayName||s.name:"")?ae(s):""}function he(s){switch(s.tag){case 5:return ae(s.type);case 16:return ae("Lazy");case 13:return ae("Suspense");case 19:return ae("SuspenseList");case 0:case 2:case 15:return s=le(s.type,!1),s;case 11:return s=le(s.type.render,!1),s;case 1:return s=le(s.type,!0),s;default:return""}}function pe(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case _:return"Portal";case P:return"Profiler";case I:return"StrictMode";case W:return"Suspense";case $:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case F:return(s.displayName||"Context")+".Consumer";case U:return(s._context.displayName||"Context")+".Provider";case H:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case Q:return a=s.displayName||null,a!==null?a:pe(s.type)||"Memo";case ne:a=s._payload,s=s._init;try{return pe(s(a))}catch{}}return null}function Oe(s){var a=s.type;switch(s.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 s=a.render,s=s.displayName||s.name||"",a.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(a);case 8:return a===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function oe(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function fe(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function _e(s){var a=fe(s)?"checked":"value",u=Object.getOwnPropertyDescriptor(s.constructor.prototype,a),m=""+s[a];if(!s.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var x=u.get,w=u.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return x.call(this)},set:function(R){m=""+R,w.call(this,R)}}),Object.defineProperty(s,a,{enumerable:u.enumerable}),{getValue:function(){return m},setValue:function(R){m=""+R},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function Ee(s){s._valueTracker||(s._valueTracker=_e(s))}function Fe(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var u=a.getValue(),m="";return s&&(m=fe(s)?s.checked?"true":"false":s.value),s=m,s!==u?(a.setValue(s),!0):!1}function $e(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function st(s,a){var u=a.checked;return M({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??s._wrapperState.initialChecked})}function Je(s,a){var u=a.defaultValue==null?"":a.defaultValue,m=a.checked!=null?a.checked:a.defaultChecked;u=oe(a.value!=null?a.value:u),s._wrapperState={initialChecked:m,initialValue:u,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function tt(s,a){a=a.checked,a!=null&&O(s,"checked",a,!1)}function Te(s,a){tt(s,a);var u=oe(a.value),m=a.type;if(u!=null)m==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+u):s.value!==""+u&&(s.value=""+u);else if(m==="submit"||m==="reset"){s.removeAttribute("value");return}a.hasOwnProperty("value")?se(s,a.type,u):a.hasOwnProperty("defaultValue")&&se(s,a.type,oe(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(s.defaultChecked=!!a.defaultChecked)}function Re(s,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=""+s._wrapperState.initialValue,u||a===s.value||(s.value=a),s.defaultValue=a}u=s.name,u!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,u!==""&&(s.name=u)}function se(s,a,u){(a!=="number"||$e(s.ownerDocument)!==s)&&(u==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+u&&(s.defaultValue=""+u))}var te=Array.isArray;function ge(s,a,u,m){if(s=s.options,a){a={};for(var x=0;x<u.length;x++)a["$"+u[x]]=!0;for(u=0;u<s.length;u++)x=a.hasOwnProperty("$"+s[u].value),s[u].selected!==x&&(s[u].selected=x),x&&m&&(s[u].defaultSelected=!0)}else{for(u=""+oe(u),a=null,x=0;x<s.length;x++){if(s[x].value===u){s[x].selected=!0,m&&(s[x].defaultSelected=!0);return}a!==null||s[x].disabled||(a=s[x])}a!==null&&(a.selected=!0)}}function Ne(s,a){if(a.dangerouslySetInnerHTML!=null)throw Error(n(91));return M({},a,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function qe(s,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(te(u)){if(1<u.length)throw Error(n(93));u=u[0]}a=u}a==null&&(a=""),u=a}s._wrapperState={initialValue:oe(u)}}function pt(s,a){var u=oe(a.value),m=oe(a.defaultValue);u!=null&&(u=""+u,u!==s.value&&(s.value=u),a.defaultValue==null&&s.defaultValue!==u&&(s.defaultValue=u)),m!=null&&(s.defaultValue=""+m)}function yt(s){var a=s.textContent;a===s._wrapperState.initialValue&&a!==""&&a!==null&&(s.value=a)}function ie(s){switch(s){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ye(s,a){return s==null||s==="http://www.w3.org/1999/xhtml"?ie(a):s==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var Me,nt=(function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(a,u,m,x){MSApp.execUnsafeLocalFunction(function(){return s(a,u,m,x)})}:s})(function(s,a){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=a;else{for(Me=Me||document.createElement("div"),Me.innerHTML="<svg>"+a.valueOf().toString()+"</svg>",a=Me.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;a.firstChild;)s.appendChild(a.firstChild)}});function ot(s,a){if(a){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=a;return}}s.textContent=a}var gt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Zt=["Webkit","ms","Moz","O"];Object.keys(gt).forEach(function(s){Zt.forEach(function(a){a=a+s.charAt(0).toUpperCase()+s.substring(1),gt[a]=gt[s]})});function hn(s,a,u){return a==null||typeof a=="boolean"||a===""?"":u||typeof a!="number"||a===0||gt.hasOwnProperty(s)&&gt[s]?(""+a).trim():a+"px"}function Dn(s,a){s=s.style;for(var u in a)if(a.hasOwnProperty(u)){var m=u.indexOf("--")===0,x=hn(u,a[u],m);u==="float"&&(u="cssFloat"),m?s.setProperty(u,x):s[u]=x}}var Yn=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(s,a){if(a){if(Yn[s]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(n(137,s));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(s,a){if(s.indexOf("-")===-1)return typeof a.is=="string";switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yn=null;function Dr(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Ge=null,ut=null,Ae=null;function He(s){if(s=Xi(s)){if(typeof Ge!="function")throw Error(n(280));var a=s.stateNode;a&&(a=Pu(a),Ge(s.stateNode,s.type,a))}}function ft(s){ut?Ae?Ae.push(s):Ae=[s]:ut=s}function Ue(){if(ut){var s=ut,a=Ae;if(Ae=ut=null,He(s),a)for(s=0;s<a.length;s++)He(a[s])}}function Yt(s,a){return s(a)}function en(){}var tn=!1;function $t(s,a,u){if(tn)return s(a,u);tn=!0;try{return Yt(s,a,u)}finally{tn=!1,(ut!==null||Ae!==null)&&(en(),Ue())}}function nn(s,a){var u=s.stateNode;if(u===null)return null;var m=Pu(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)||(s=s.type,m=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!m;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(n(231,a,typeof u));return u}var On=!1;if(c)try{var $n={};Object.defineProperty($n,"passive",{get:function(){On=!0}}),window.addEventListener("test",$n,$n),window.removeEventListener("test",$n,$n)}catch{On=!1}function $r(s,a,u,m,x,w,R,q,K){var ue=Array.prototype.slice.call(arguments,3);try{a.apply(u,ue)}catch(ve){this.onError(ve)}}var ze=!1,lt=null,Ke=!1,mt=null,_t={onError:function(s){ze=!0,lt=s}};function wt(s,a,u,m,x,w,R,q,K){ze=!1,lt=null,$r.apply(_t,arguments)}function Lt(s,a,u,m,x,w,R,q,K){if(wt.apply(this,arguments),ze){if(ze){var ue=lt;ze=!1,lt=null}else throw Error(n(198));Ke||(Ke=!0,mt=ue)}}function Rt(s){var a=s,u=s;if(s.alternate)for(;a.return;)a=a.return;else{s=a;do a=s,(a.flags&4098)!==0&&(u=a.return),s=a.return;while(s)}return a.tag===3?u:null}function Mt(s){if(s.tag===13){var a=s.memoizedState;if(a===null&&(s=s.alternate,s!==null&&(a=s.memoizedState)),a!==null)return a.dehydrated}return null}function gn(s){if(Rt(s)!==s)throw Error(n(188))}function xa(s){var a=s.alternate;if(!a){if(a=Rt(s),a===null)throw Error(n(188));return a!==s?null:s}for(var u=s,m=a;;){var x=u.return;if(x===null)break;var w=x.alternate;if(w===null){if(m=x.return,m!==null){u=m;continue}break}if(x.child===w.child){for(w=x.child;w;){if(w===u)return gn(x),s;if(w===m)return gn(x),a;w=w.sibling}throw Error(n(188))}if(u.return!==m.return)u=x,m=w;else{for(var R=!1,q=x.child;q;){if(q===u){R=!0,u=x,m=w;break}if(q===m){R=!0,m=x,u=w;break}q=q.sibling}if(!R){for(q=w.child;q;){if(q===u){R=!0,u=w,m=x;break}if(q===m){R=!0,m=w,u=x;break}q=q.sibling}if(!R)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?s:a}function pr(s){return s=xa(s),s!==null?Ps(s):null}function Ps(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var a=Ps(s);if(a!==null)return a;s=s.sibling}return null}var No=t.unstable_scheduleCallback,Pt=t.unstable_cancelCallback,Ii=t.unstable_shouldYield,va=t.unstable_requestPaint,jt=t.unstable_now,pu=t.unstable_getCurrentPriorityLevel,Do=t.unstable_ImmediatePriority,up=t.unstable_UserBlockingPriority,yu=t.unstable_NormalPriority,nT=t.unstable_LowPriority,cp=t.unstable_IdlePriority,gu=null,qr=null;function rT(s){if(qr&&typeof qr.onCommitFiberRoot=="function")try{qr.onCommitFiberRoot(gu,s,void 0,(s.current.flags&128)===128)}catch{}}var Or=Math.clz32?Math.clz32:aT,sT=Math.log,oT=Math.LN2;function aT(s){return s>>>=0,s===0?32:31-(sT(s)/oT|0)|0}var bu=64,xu=4194304;function Mi(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function vu(s,a){var u=s.pendingLanes;if(u===0)return 0;var m=0,x=s.suspendedLanes,w=s.pingedLanes,R=u&268435455;if(R!==0){var q=R&~x;q!==0?m=Mi(q):(w&=R,w!==0&&(m=Mi(w)))}else R=u&~x,R!==0?m=Mi(R):w!==0&&(m=Mi(w));if(m===0)return 0;if(a!==0&&a!==m&&(a&x)===0&&(x=m&-m,w=a&-a,x>=w||x===16&&(w&4194240)!==0))return a;if((m&4)!==0&&(m|=u&16),a=s.entangledLanes,a!==0)for(s=s.entanglements,a&=m;0<a;)u=31-Or(a),x=1<<u,m|=s[u],a&=~x;return m}function iT(s,a){switch(s){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 lT(s,a){for(var u=s.suspendedLanes,m=s.pingedLanes,x=s.expirationTimes,w=s.pendingLanes;0<w;){var R=31-Or(w),q=1<<R,K=x[R];K===-1?((q&u)===0||(q&m)!==0)&&(x[R]=iT(q,a)):K<=a&&(s.expiredLanes|=q),w&=~q}}function Qd(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function dp(){var s=bu;return bu<<=1,(bu&4194240)===0&&(bu=64),s}function Gd(s){for(var a=[],u=0;31>u;u++)a.push(s);return a}function Li(s,a,u){s.pendingLanes|=a,a!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,a=31-Or(a),s[a]=u}function uT(s,a){var u=s.pendingLanes&~a;s.pendingLanes=a,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=a,s.mutableReadLanes&=a,s.entangledLanes&=a,a=s.entanglements;var m=s.eventTimes;for(s=s.expirationTimes;0<u;){var x=31-Or(u),w=1<<x;a[x]=0,m[x]=-1,s[x]=-1,u&=~w}}function Kd(s,a){var u=s.entangledLanes|=a;for(s=s.entanglements;u;){var m=31-Or(u),x=1<<m;x&a|s[m]&a&&(s[m]|=a),u&=~x}}var Ot=0;function fp(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var hp,Xd,mp,pp,yp,Jd=!1,Eu=[],js=null,Fs=null,Bs=null,Ri=new Map,Pi=new Map,Hs=[],cT="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 gp(s,a){switch(s){case"focusin":case"focusout":js=null;break;case"dragenter":case"dragleave":Fs=null;break;case"mouseover":case"mouseout":Bs=null;break;case"pointerover":case"pointerout":Ri.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pi.delete(a.pointerId)}}function ji(s,a,u,m,x,w){return s===null||s.nativeEvent!==w?(s={blockedOn:a,domEventName:u,eventSystemFlags:m,nativeEvent:w,targetContainers:[x]},a!==null&&(a=Xi(a),a!==null&&Xd(a)),s):(s.eventSystemFlags|=m,a=s.targetContainers,x!==null&&a.indexOf(x)===-1&&a.push(x),s)}function dT(s,a,u,m,x){switch(a){case"focusin":return js=ji(js,s,a,u,m,x),!0;case"dragenter":return Fs=ji(Fs,s,a,u,m,x),!0;case"mouseover":return Bs=ji(Bs,s,a,u,m,x),!0;case"pointerover":var w=x.pointerId;return Ri.set(w,ji(Ri.get(w)||null,s,a,u,m,x)),!0;case"gotpointercapture":return w=x.pointerId,Pi.set(w,ji(Pi.get(w)||null,s,a,u,m,x)),!0}return!1}function bp(s){var a=Oo(s.target);if(a!==null){var u=Rt(a);if(u!==null){if(a=u.tag,a===13){if(a=Mt(u),a!==null){s.blockedOn=a,yp(s.priority,function(){mp(u)});return}}else if(a===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Tu(s){if(s.blockedOn!==null)return!1;for(var a=s.targetContainers;0<a.length;){var u=ef(s.domEventName,s.eventSystemFlags,a[0],s.nativeEvent);if(u===null){u=s.nativeEvent;var m=new u.constructor(u.type,u);yn=m,u.target.dispatchEvent(m),yn=null}else return a=Xi(u),a!==null&&Xd(a),s.blockedOn=u,!1;a.shift()}return!0}function xp(s,a,u){Tu(s)&&u.delete(a)}function fT(){Jd=!1,js!==null&&Tu(js)&&(js=null),Fs!==null&&Tu(Fs)&&(Fs=null),Bs!==null&&Tu(Bs)&&(Bs=null),Ri.forEach(xp),Pi.forEach(xp)}function Fi(s,a){s.blockedOn===a&&(s.blockedOn=null,Jd||(Jd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,fT)))}function Bi(s){function a(x){return Fi(x,s)}if(0<Eu.length){Fi(Eu[0],s);for(var u=1;u<Eu.length;u++){var m=Eu[u];m.blockedOn===s&&(m.blockedOn=null)}}for(js!==null&&Fi(js,s),Fs!==null&&Fi(Fs,s),Bs!==null&&Fi(Bs,s),Ri.forEach(a),Pi.forEach(a),u=0;u<Hs.length;u++)m=Hs[u],m.blockedOn===s&&(m.blockedOn=null);for(;0<Hs.length&&(u=Hs[0],u.blockedOn===null);)bp(u),u.blockedOn===null&&Hs.shift()}var Ea=A.ReactCurrentBatchConfig,wu=!0;function hT(s,a,u,m){var x=Ot,w=Ea.transition;Ea.transition=null;try{Ot=1,Zd(s,a,u,m)}finally{Ot=x,Ea.transition=w}}function mT(s,a,u,m){var x=Ot,w=Ea.transition;Ea.transition=null;try{Ot=4,Zd(s,a,u,m)}finally{Ot=x,Ea.transition=w}}function Zd(s,a,u,m){if(wu){var x=ef(s,a,u,m);if(x===null)bf(s,a,m,ku,u),gp(s,m);else if(dT(x,s,a,u,m))m.stopPropagation();else if(gp(s,m),a&4&&-1<cT.indexOf(s)){for(;x!==null;){var w=Xi(x);if(w!==null&&hp(w),w=ef(s,a,u,m),w===null&&bf(s,a,m,ku,u),w===x)break;x=w}x!==null&&m.stopPropagation()}else bf(s,a,m,null,u)}}var ku=null;function ef(s,a,u,m){if(ku=null,s=Dr(m),s=Oo(s),s!==null)if(a=Rt(s),a===null)s=null;else if(u=a.tag,u===13){if(s=Mt(a),s!==null)return s;s=null}else if(u===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;s=null}else a!==s&&(s=null);return ku=s,null}function vp(s){switch(s){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(pu()){case Do:return 1;case up:return 4;case yu:case nT:return 16;case cp:return 536870912;default:return 16}default:return 16}}var Us=null,tf=null,Su=null;function Ep(){if(Su)return Su;var s,a=tf,u=a.length,m,x="value"in Us?Us.value:Us.textContent,w=x.length;for(s=0;s<u&&a[s]===x[s];s++);var R=u-s;for(m=1;m<=R&&a[u-m]===x[w-m];m++);return Su=x.slice(s,1<m?1-m:void 0)}function Cu(s){var a=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&a===13&&(s=13)):s=a,s===10&&(s=13),32<=s||s===13?s:0}function _u(){return!0}function Tp(){return!1}function or(s){function a(u,m,x,w,R){this._reactName=u,this._targetInst=x,this.type=m,this.nativeEvent=w,this.target=R,this.currentTarget=null;for(var q in s)s.hasOwnProperty(q)&&(u=s[q],this[q]=u?u(w):w[q]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?_u:Tp,this.isPropagationStopped=Tp,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=_u)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=_u)},persist:function(){},isPersistent:_u}),a}var Ta={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nf=or(Ta),Hi=M({},Ta,{view:0,detail:0}),pT=or(Hi),rf,sf,Ui,Nu=M({},Hi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:af,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Ui&&(Ui&&s.type==="mousemove"?(rf=s.screenX-Ui.screenX,sf=s.screenY-Ui.screenY):sf=rf=0,Ui=s),rf)},movementY:function(s){return"movementY"in s?s.movementY:sf}}),wp=or(Nu),yT=M({},Nu,{dataTransfer:0}),gT=or(yT),bT=M({},Hi,{relatedTarget:0}),of=or(bT),xT=M({},Ta,{animationName:0,elapsedTime:0,pseudoElement:0}),vT=or(xT),ET=M({},Ta,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),TT=or(ET),wT=M({},Ta,{data:0}),kp=or(wT),kT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ST={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"},CT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _T(s){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(s):(s=CT[s])?!!a[s]:!1}function af(){return _T}var NT=M({},Hi,{key:function(s){if(s.key){var a=kT[s.key]||s.key;if(a!=="Unidentified")return a}return s.type==="keypress"?(s=Cu(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?ST[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:af,charCode:function(s){return s.type==="keypress"?Cu(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Cu(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),DT=or(NT),OT=M({},Nu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sp=or(OT),AT=M({},Hi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:af}),IT=or(AT),MT=M({},Ta,{propertyName:0,elapsedTime:0,pseudoElement:0}),LT=or(MT),RT=M({},Nu,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),PT=or(RT),jT=[9,13,27,32],lf=c&&"CompositionEvent"in window,zi=null;c&&"documentMode"in document&&(zi=document.documentMode);var FT=c&&"TextEvent"in window&&!zi,Cp=c&&(!lf||zi&&8<zi&&11>=zi),_p=" ",Np=!1;function Dp(s,a){switch(s){case"keyup":return jT.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Op(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var wa=!1;function BT(s,a){switch(s){case"compositionend":return Op(a);case"keypress":return a.which!==32?null:(Np=!0,_p);case"textInput":return s=a.data,s===_p&&Np?null:s;default:return null}}function HT(s,a){if(wa)return s==="compositionend"||!lf&&Dp(s,a)?(s=Ep(),Su=tf=Us=null,wa=!1,s):null;switch(s){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 Cp&&a.locale!=="ko"?null:a.data;default:return null}}var UT={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 Ap(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a==="input"?!!UT[s.type]:a==="textarea"}function Ip(s,a,u,m){ft(m),a=Mu(a,"onChange"),0<a.length&&(u=new nf("onChange","change",null,u,m),s.push({event:u,listeners:a}))}var Wi=null,Yi=null;function zT(s){Kp(s,0)}function Du(s){var a=Na(s);if(Fe(a))return s}function WT(s,a){if(s==="change")return a}var Mp=!1;if(c){var uf;if(c){var cf="oninput"in document;if(!cf){var Lp=document.createElement("div");Lp.setAttribute("oninput","return;"),cf=typeof Lp.oninput=="function"}uf=cf}else uf=!1;Mp=uf&&(!document.documentMode||9<document.documentMode)}function Rp(){Wi&&(Wi.detachEvent("onpropertychange",Pp),Yi=Wi=null)}function Pp(s){if(s.propertyName==="value"&&Du(Yi)){var a=[];Ip(a,Yi,s,Dr(s)),$t(zT,a)}}function YT(s,a,u){s==="focusin"?(Rp(),Wi=a,Yi=u,Wi.attachEvent("onpropertychange",Pp)):s==="focusout"&&Rp()}function $T(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Du(Yi)}function qT(s,a){if(s==="click")return Du(a)}function VT(s,a){if(s==="input"||s==="change")return Du(a)}function QT(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}var Ar=typeof Object.is=="function"?Object.is:QT;function $i(s,a){if(Ar(s,a))return!0;if(typeof s!="object"||s===null||typeof a!="object"||a===null)return!1;var u=Object.keys(s),m=Object.keys(a);if(u.length!==m.length)return!1;for(m=0;m<u.length;m++){var x=u[m];if(!d.call(a,x)||!Ar(s[x],a[x]))return!1}return!0}function jp(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Fp(s,a){var u=jp(s);s=0;for(var m;u;){if(u.nodeType===3){if(m=s+u.textContent.length,s<=a&&m>=a)return{node:u,offset:a-s};s=m}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=jp(u)}}function Bp(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?Bp(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function Hp(){for(var s=window,a=$e();a instanceof s.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)s=a.contentWindow;else break;a=$e(s.document)}return a}function df(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}function GT(s){var a=Hp(),u=s.focusedElem,m=s.selectionRange;if(a!==u&&u&&u.ownerDocument&&Bp(u.ownerDocument.documentElement,u)){if(m!==null&&df(u)){if(a=m.start,s=m.end,s===void 0&&(s=a),"selectionStart"in u)u.selectionStart=a,u.selectionEnd=Math.min(s,u.value.length);else if(s=(a=u.ownerDocument||document)&&a.defaultView||window,s.getSelection){s=s.getSelection();var x=u.textContent.length,w=Math.min(m.start,x);m=m.end===void 0?w:Math.min(m.end,x),!s.extend&&w>m&&(x=m,m=w,w=x),x=Fp(u,w);var R=Fp(u,m);x&&R&&(s.rangeCount!==1||s.anchorNode!==x.node||s.anchorOffset!==x.offset||s.focusNode!==R.node||s.focusOffset!==R.offset)&&(a=a.createRange(),a.setStart(x.node,x.offset),s.removeAllRanges(),w>m?(s.addRange(a),s.extend(R.node,R.offset)):(a.setEnd(R.node,R.offset),s.addRange(a)))}}for(a=[],s=u;s=s.parentNode;)s.nodeType===1&&a.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<a.length;u++)s=a[u],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var KT=c&&"documentMode"in document&&11>=document.documentMode,ka=null,ff=null,qi=null,hf=!1;function Up(s,a,u){var m=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;hf||ka==null||ka!==$e(m)||(m=ka,"selectionStart"in m&&df(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}),qi&&$i(qi,m)||(qi=m,m=Mu(ff,"onSelect"),0<m.length&&(a=new nf("onSelect","select",null,a,u),s.push({event:a,listeners:m}),a.target=ka)))}function Ou(s,a){var u={};return u[s.toLowerCase()]=a.toLowerCase(),u["Webkit"+s]="webkit"+a,u["Moz"+s]="moz"+a,u}var Sa={animationend:Ou("Animation","AnimationEnd"),animationiteration:Ou("Animation","AnimationIteration"),animationstart:Ou("Animation","AnimationStart"),transitionend:Ou("Transition","TransitionEnd")},mf={},zp={};c&&(zp=document.createElement("div").style,"AnimationEvent"in window||(delete Sa.animationend.animation,delete Sa.animationiteration.animation,delete Sa.animationstart.animation),"TransitionEvent"in window||delete Sa.transitionend.transition);function Au(s){if(mf[s])return mf[s];if(!Sa[s])return s;var a=Sa[s],u;for(u in a)if(a.hasOwnProperty(u)&&u in zp)return mf[s]=a[u];return s}var Wp=Au("animationend"),Yp=Au("animationiteration"),$p=Au("animationstart"),qp=Au("transitionend"),Vp=new Map,Qp="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 zs(s,a){Vp.set(s,a),i(a,[s])}for(var pf=0;pf<Qp.length;pf++){var yf=Qp[pf],XT=yf.toLowerCase(),JT=yf[0].toUpperCase()+yf.slice(1);zs(XT,"on"+JT)}zs(Wp,"onAnimationEnd"),zs(Yp,"onAnimationIteration"),zs($p,"onAnimationStart"),zs("dblclick","onDoubleClick"),zs("focusin","onFocus"),zs("focusout","onBlur"),zs(qp,"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 Vi="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(" "),ZT=new Set("cancel close invalid load scroll toggle".split(" ").concat(Vi));function Gp(s,a,u){var m=s.type||"unknown-event";s.currentTarget=u,Lt(m,a,void 0,s),s.currentTarget=null}function Kp(s,a){a=(a&4)!==0;for(var u=0;u<s.length;u++){var m=s[u],x=m.event;m=m.listeners;e:{var w=void 0;if(a)for(var R=m.length-1;0<=R;R--){var q=m[R],K=q.instance,ue=q.currentTarget;if(q=q.listener,K!==w&&x.isPropagationStopped())break e;Gp(x,q,ue),w=K}else for(R=0;R<m.length;R++){if(q=m[R],K=q.instance,ue=q.currentTarget,q=q.listener,K!==w&&x.isPropagationStopped())break e;Gp(x,q,ue),w=K}}}if(Ke)throw s=mt,Ke=!1,mt=null,s}function Ut(s,a){var u=a[kf];u===void 0&&(u=a[kf]=new Set);var m=s+"__bubble";u.has(m)||(Xp(a,s,2,!1),u.add(m))}function gf(s,a,u){var m=0;a&&(m|=4),Xp(u,s,m,a)}var Iu="_reactListening"+Math.random().toString(36).slice(2);function Qi(s){if(!s[Iu]){s[Iu]=!0,r.forEach(function(u){u!=="selectionchange"&&(ZT.has(u)||gf(u,!1,s),gf(u,!0,s))});var a=s.nodeType===9?s:s.ownerDocument;a===null||a[Iu]||(a[Iu]=!0,gf("selectionchange",!1,a))}}function Xp(s,a,u,m){switch(vp(a)){case 1:var x=hT;break;case 4:x=mT;break;default:x=Zd}u=x.bind(null,a,u,s),x=void 0,!On||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(x=!0),m?x!==void 0?s.addEventListener(a,u,{capture:!0,passive:x}):s.addEventListener(a,u,!0):x!==void 0?s.addEventListener(a,u,{passive:x}):s.addEventListener(a,u,!1)}function bf(s,a,u,m,x){var w=m;if((a&1)===0&&(a&2)===0&&m!==null)e:for(;;){if(m===null)return;var R=m.tag;if(R===3||R===4){var q=m.stateNode.containerInfo;if(q===x||q.nodeType===8&&q.parentNode===x)break;if(R===4)for(R=m.return;R!==null;){var K=R.tag;if((K===3||K===4)&&(K=R.stateNode.containerInfo,K===x||K.nodeType===8&&K.parentNode===x))return;R=R.return}for(;q!==null;){if(R=Oo(q),R===null)return;if(K=R.tag,K===5||K===6){m=w=R;continue e}q=q.parentNode}}m=m.return}$t(function(){var ue=w,ve=Dr(u),we=[];e:{var be=Vp.get(s);if(be!==void 0){var Le=nf,We=s;switch(s){case"keypress":if(Cu(u)===0)break e;case"keydown":case"keyup":Le=DT;break;case"focusin":We="focus",Le=of;break;case"focusout":We="blur",Le=of;break;case"beforeblur":case"afterblur":Le=of;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":Le=wp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Le=gT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Le=IT;break;case Wp:case Yp:case $p:Le=vT;break;case qp:Le=LT;break;case"scroll":Le=pT;break;case"wheel":Le=PT;break;case"copy":case"cut":case"paste":Le=TT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Le=Sp}var Ye=(a&4)!==0,ln=!Ye&&s==="scroll",J=Ye?be!==null?be+"Capture":null:be;Ye=[];for(var X=ue,re;X!==null;){re=X;var Ce=re.stateNode;if(re.tag===5&&Ce!==null&&(re=Ce,J!==null&&(Ce=nn(X,J),Ce!=null&&Ye.push(Gi(X,Ce,re)))),ln)break;X=X.return}0<Ye.length&&(be=new Le(be,We,null,u,ve),we.push({event:be,listeners:Ye}))}}if((a&7)===0){e:{if(be=s==="mouseover"||s==="pointerover",Le=s==="mouseout"||s==="pointerout",be&&u!==yn&&(We=u.relatedTarget||u.fromElement)&&(Oo(We)||We[hs]))break e;if((Le||be)&&(be=ve.window===ve?ve:(be=ve.ownerDocument)?be.defaultView||be.parentWindow:window,Le?(We=u.relatedTarget||u.toElement,Le=ue,We=We?Oo(We):null,We!==null&&(ln=Rt(We),We!==ln||We.tag!==5&&We.tag!==6)&&(We=null)):(Le=null,We=ue),Le!==We)){if(Ye=wp,Ce="onMouseLeave",J="onMouseEnter",X="mouse",(s==="pointerout"||s==="pointerover")&&(Ye=Sp,Ce="onPointerLeave",J="onPointerEnter",X="pointer"),ln=Le==null?be:Na(Le),re=We==null?be:Na(We),be=new Ye(Ce,X+"leave",Le,u,ve),be.target=ln,be.relatedTarget=re,Ce=null,Oo(ve)===ue&&(Ye=new Ye(J,X+"enter",We,u,ve),Ye.target=re,Ye.relatedTarget=ln,Ce=Ye),ln=Ce,Le&&We)t:{for(Ye=Le,J=We,X=0,re=Ye;re;re=Ca(re))X++;for(re=0,Ce=J;Ce;Ce=Ca(Ce))re++;for(;0<X-re;)Ye=Ca(Ye),X--;for(;0<re-X;)J=Ca(J),re--;for(;X--;){if(Ye===J||J!==null&&Ye===J.alternate)break t;Ye=Ca(Ye),J=Ca(J)}Ye=null}else Ye=null;Le!==null&&Jp(we,be,Le,Ye,!1),We!==null&&ln!==null&&Jp(we,ln,We,Ye,!0)}}e:{if(be=ue?Na(ue):window,Le=be.nodeName&&be.nodeName.toLowerCase(),Le==="select"||Le==="input"&&be.type==="file")var Ve=WT;else if(Ap(be))if(Mp)Ve=VT;else{Ve=$T;var Ze=YT}else(Le=be.nodeName)&&Le.toLowerCase()==="input"&&(be.type==="checkbox"||be.type==="radio")&&(Ve=qT);if(Ve&&(Ve=Ve(s,ue))){Ip(we,Ve,u,ve);break e}Ze&&Ze(s,be,ue),s==="focusout"&&(Ze=be._wrapperState)&&Ze.controlled&&be.type==="number"&&se(be,"number",be.value)}switch(Ze=ue?Na(ue):window,s){case"focusin":(Ap(Ze)||Ze.contentEditable==="true")&&(ka=Ze,ff=ue,qi=null);break;case"focusout":qi=ff=ka=null;break;case"mousedown":hf=!0;break;case"contextmenu":case"mouseup":case"dragend":hf=!1,Up(we,u,ve);break;case"selectionchange":if(KT)break;case"keydown":case"keyup":Up(we,u,ve)}var et;if(lf)e:{switch(s){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else wa?Dp(s,u)&&(at="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(at="onCompositionStart");at&&(Cp&&u.locale!=="ko"&&(wa||at!=="onCompositionStart"?at==="onCompositionEnd"&&wa&&(et=Ep()):(Us=ve,tf="value"in Us?Us.value:Us.textContent,wa=!0)),Ze=Mu(ue,at),0<Ze.length&&(at=new kp(at,s,null,u,ve),we.push({event:at,listeners:Ze}),et?at.data=et:(et=Op(u),et!==null&&(at.data=et)))),(et=FT?BT(s,u):HT(s,u))&&(ue=Mu(ue,"onBeforeInput"),0<ue.length&&(ve=new kp("onBeforeInput","beforeinput",null,u,ve),we.push({event:ve,listeners:ue}),ve.data=et))}Kp(we,a)})}function Gi(s,a,u){return{instance:s,listener:a,currentTarget:u}}function Mu(s,a){for(var u=a+"Capture",m=[];s!==null;){var x=s,w=x.stateNode;x.tag===5&&w!==null&&(x=w,w=nn(s,u),w!=null&&m.unshift(Gi(s,w,x)),w=nn(s,a),w!=null&&m.push(Gi(s,w,x))),s=s.return}return m}function Ca(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function Jp(s,a,u,m,x){for(var w=a._reactName,R=[];u!==null&&u!==m;){var q=u,K=q.alternate,ue=q.stateNode;if(K!==null&&K===m)break;q.tag===5&&ue!==null&&(q=ue,x?(K=nn(u,w),K!=null&&R.unshift(Gi(u,K,q))):x||(K=nn(u,w),K!=null&&R.push(Gi(u,K,q)))),u=u.return}R.length!==0&&s.push({event:a,listeners:R})}var ew=/\r\n?/g,tw=/\u0000|\uFFFD/g;function Zp(s){return(typeof s=="string"?s:""+s).replace(ew,`
31
+ `).replace(tw,"")}function Lu(s,a,u){if(a=Zp(a),Zp(s)!==a&&u)throw Error(n(425))}function Ru(){}var xf=null,vf=null;function Ef(s,a){return s==="textarea"||s==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Tf=typeof setTimeout=="function"?setTimeout:void 0,nw=typeof clearTimeout=="function"?clearTimeout:void 0,ey=typeof Promise=="function"?Promise:void 0,rw=typeof queueMicrotask=="function"?queueMicrotask:typeof ey<"u"?function(s){return ey.resolve(null).then(s).catch(sw)}:Tf;function sw(s){setTimeout(function(){throw s})}function wf(s,a){var u=a,m=0;do{var x=u.nextSibling;if(s.removeChild(u),x&&x.nodeType===8)if(u=x.data,u==="/$"){if(m===0){s.removeChild(x),Bi(a);return}m--}else u!=="$"&&u!=="$?"&&u!=="$!"||m++;u=x}while(u);Bi(a)}function Ws(s){for(;s!=null;s=s.nextSibling){var a=s.nodeType;if(a===1||a===3)break;if(a===8){if(a=s.data,a==="$"||a==="$!"||a==="$?")break;if(a==="/$")return null}}return s}function ty(s){s=s.previousSibling;for(var a=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"){if(a===0)return s;a--}else u==="/$"&&a++}s=s.previousSibling}return null}var _a=Math.random().toString(36).slice(2),Vr="__reactFiber$"+_a,Ki="__reactProps$"+_a,hs="__reactContainer$"+_a,kf="__reactEvents$"+_a,ow="__reactListeners$"+_a,aw="__reactHandles$"+_a;function Oo(s){var a=s[Vr];if(a)return a;for(var u=s.parentNode;u;){if(a=u[hs]||u[Vr]){if(u=a.alternate,a.child!==null||u!==null&&u.child!==null)for(s=ty(s);s!==null;){if(u=s[Vr])return u;s=ty(s)}return a}s=u,u=s.parentNode}return null}function Xi(s){return s=s[Vr]||s[hs],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function Na(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(n(33))}function Pu(s){return s[Ki]||null}var Sf=[],Da=-1;function Ys(s){return{current:s}}function zt(s){0>Da||(s.current=Sf[Da],Sf[Da]=null,Da--)}function Ft(s,a){Da++,Sf[Da]=s.current,s.current=a}var $s={},An=Ys($s),qn=Ys(!1),Ao=$s;function Oa(s,a){var u=s.type.contextTypes;if(!u)return $s;var m=s.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===a)return m.__reactInternalMemoizedMaskedChildContext;var x={},w;for(w in u)x[w]=a[w];return m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=a,s.__reactInternalMemoizedMaskedChildContext=x),x}function Vn(s){return s=s.childContextTypes,s!=null}function ju(){zt(qn),zt(An)}function ny(s,a,u){if(An.current!==$s)throw Error(n(168));Ft(An,a),Ft(qn,u)}function ry(s,a,u){var m=s.stateNode;if(a=a.childContextTypes,typeof m.getChildContext!="function")return u;m=m.getChildContext();for(var x in m)if(!(x in a))throw Error(n(108,Oe(s)||"Unknown",x));return M({},u,m)}function Fu(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||$s,Ao=An.current,Ft(An,s),Ft(qn,qn.current),!0}function sy(s,a,u){var m=s.stateNode;if(!m)throw Error(n(169));u?(s=ry(s,a,Ao),m.__reactInternalMemoizedMergedChildContext=s,zt(qn),zt(An),Ft(An,s)):zt(qn),Ft(qn,u)}var ms=null,Bu=!1,Cf=!1;function oy(s){ms===null?ms=[s]:ms.push(s)}function iw(s){Bu=!0,oy(s)}function qs(){if(!Cf&&ms!==null){Cf=!0;var s=0,a=Ot;try{var u=ms;for(Ot=1;s<u.length;s++){var m=u[s];do m=m(!0);while(m!==null)}ms=null,Bu=!1}catch(x){throw ms!==null&&(ms=ms.slice(s+1)),No(Do,qs),x}finally{Ot=a,Cf=!1}}return null}var Aa=[],Ia=0,Hu=null,Uu=0,yr=[],gr=0,Io=null,ps=1,ys="";function Mo(s,a){Aa[Ia++]=Uu,Aa[Ia++]=Hu,Hu=s,Uu=a}function ay(s,a,u){yr[gr++]=ps,yr[gr++]=ys,yr[gr++]=Io,Io=s;var m=ps;s=ys;var x=32-Or(m)-1;m&=~(1<<x),u+=1;var w=32-Or(a)+x;if(30<w){var R=x-x%5;w=(m&(1<<R)-1).toString(32),m>>=R,x-=R,ps=1<<32-Or(a)+x|u<<x|m,ys=w+s}else ps=1<<w|u<<x|m,ys=s}function _f(s){s.return!==null&&(Mo(s,1),ay(s,1,0))}function Nf(s){for(;s===Hu;)Hu=Aa[--Ia],Aa[Ia]=null,Uu=Aa[--Ia],Aa[Ia]=null;for(;s===Io;)Io=yr[--gr],yr[gr]=null,ys=yr[--gr],yr[gr]=null,ps=yr[--gr],yr[gr]=null}var ar=null,ir=null,qt=!1,Ir=null;function iy(s,a){var u=Er(5,null,null,0);u.elementType="DELETED",u.stateNode=a,u.return=s,a=s.deletions,a===null?(s.deletions=[u],s.flags|=16):a.push(u)}function ly(s,a){switch(s.tag){case 5:var u=s.type;return a=a.nodeType!==1||u.toLowerCase()!==a.nodeName.toLowerCase()?null:a,a!==null?(s.stateNode=a,ar=s,ir=Ws(a.firstChild),!0):!1;case 6:return a=s.pendingProps===""||a.nodeType!==3?null:a,a!==null?(s.stateNode=a,ar=s,ir=null,!0):!1;case 13:return a=a.nodeType!==8?null:a,a!==null?(u=Io!==null?{id:ps,overflow:ys}:null,s.memoizedState={dehydrated:a,treeContext:u,retryLane:1073741824},u=Er(18,null,null,0),u.stateNode=a,u.return=s,s.child=u,ar=s,ir=null,!0):!1;default:return!1}}function Df(s){return(s.mode&1)!==0&&(s.flags&128)===0}function Of(s){if(qt){var a=ir;if(a){var u=a;if(!ly(s,a)){if(Df(s))throw Error(n(418));a=Ws(u.nextSibling);var m=ar;a&&ly(s,a)?iy(m,u):(s.flags=s.flags&-4097|2,qt=!1,ar=s)}}else{if(Df(s))throw Error(n(418));s.flags=s.flags&-4097|2,qt=!1,ar=s}}}function uy(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;ar=s}function zu(s){if(s!==ar)return!1;if(!qt)return uy(s),qt=!0,!1;var a;if((a=s.tag!==3)&&!(a=s.tag!==5)&&(a=s.type,a=a!=="head"&&a!=="body"&&!Ef(s.type,s.memoizedProps)),a&&(a=ir)){if(Df(s))throw cy(),Error(n(418));for(;a;)iy(s,a),a=Ws(a.nextSibling)}if(uy(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(317));e:{for(s=s.nextSibling,a=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"){if(a===0){ir=Ws(s.nextSibling);break e}a--}else u!=="$"&&u!=="$!"&&u!=="$?"||a++}s=s.nextSibling}ir=null}}else ir=ar?Ws(s.stateNode.nextSibling):null;return!0}function cy(){for(var s=ir;s;)s=Ws(s.nextSibling)}function Ma(){ir=ar=null,qt=!1}function Af(s){Ir===null?Ir=[s]:Ir.push(s)}var lw=A.ReactCurrentBatchConfig;function Ji(s,a,u){if(s=u.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var m=u.stateNode}if(!m)throw Error(n(147,s));var x=m,w=""+s;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===w?a.ref:(a=function(R){var q=x.refs;R===null?delete q[w]:q[w]=R},a._stringRef=w,a)}if(typeof s!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,s))}return s}function Wu(s,a){throw s=Object.prototype.toString.call(a),Error(n(31,s==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":s))}function dy(s){var a=s._init;return a(s._payload)}function fy(s){function a(J,X){if(s){var re=J.deletions;re===null?(J.deletions=[X],J.flags|=16):re.push(X)}}function u(J,X){if(!s)return null;for(;X!==null;)a(J,X),X=X.sibling;return null}function m(J,X){for(J=new Map;X!==null;)X.key!==null?J.set(X.key,X):J.set(X.index,X),X=X.sibling;return J}function x(J,X){return J=eo(J,X),J.index=0,J.sibling=null,J}function w(J,X,re){return J.index=re,s?(re=J.alternate,re!==null?(re=re.index,re<X?(J.flags|=2,X):re):(J.flags|=2,X)):(J.flags|=1048576,X)}function R(J){return s&&J.alternate===null&&(J.flags|=2),J}function q(J,X,re,Ce){return X===null||X.tag!==6?(X=Th(re,J.mode,Ce),X.return=J,X):(X=x(X,re),X.return=J,X)}function K(J,X,re,Ce){var Ve=re.type;return Ve===S?ve(J,X,re.props.children,Ce,re.key):X!==null&&(X.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===ne&&dy(Ve)===X.type)?(Ce=x(X,re.props),Ce.ref=Ji(J,X,re),Ce.return=J,Ce):(Ce=hc(re.type,re.key,re.props,null,J.mode,Ce),Ce.ref=Ji(J,X,re),Ce.return=J,Ce)}function ue(J,X,re,Ce){return X===null||X.tag!==4||X.stateNode.containerInfo!==re.containerInfo||X.stateNode.implementation!==re.implementation?(X=wh(re,J.mode,Ce),X.return=J,X):(X=x(X,re.children||[]),X.return=J,X)}function ve(J,X,re,Ce,Ve){return X===null||X.tag!==7?(X=Uo(re,J.mode,Ce,Ve),X.return=J,X):(X=x(X,re),X.return=J,X)}function we(J,X,re){if(typeof X=="string"&&X!==""||typeof X=="number")return X=Th(""+X,J.mode,re),X.return=J,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case L:return re=hc(X.type,X.key,X.props,null,J.mode,re),re.ref=Ji(J,null,X),re.return=J,re;case _:return X=wh(X,J.mode,re),X.return=J,X;case ne:var Ce=X._init;return we(J,Ce(X._payload),re)}if(te(X)||ce(X))return X=Uo(X,J.mode,re,null),X.return=J,X;Wu(J,X)}return null}function be(J,X,re,Ce){var Ve=X!==null?X.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return Ve!==null?null:q(J,X,""+re,Ce);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case L:return re.key===Ve?K(J,X,re,Ce):null;case _:return re.key===Ve?ue(J,X,re,Ce):null;case ne:return Ve=re._init,be(J,X,Ve(re._payload),Ce)}if(te(re)||ce(re))return Ve!==null?null:ve(J,X,re,Ce,null);Wu(J,re)}return null}function Le(J,X,re,Ce,Ve){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return J=J.get(re)||null,q(X,J,""+Ce,Ve);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case L:return J=J.get(Ce.key===null?re:Ce.key)||null,K(X,J,Ce,Ve);case _:return J=J.get(Ce.key===null?re:Ce.key)||null,ue(X,J,Ce,Ve);case ne:var Ze=Ce._init;return Le(J,X,re,Ze(Ce._payload),Ve)}if(te(Ce)||ce(Ce))return J=J.get(re)||null,ve(X,J,Ce,Ve,null);Wu(X,Ce)}return null}function We(J,X,re,Ce){for(var Ve=null,Ze=null,et=X,at=X=0,Tn=null;et!==null&&at<re.length;at++){et.index>at?(Tn=et,et=null):Tn=et.sibling;var kt=be(J,et,re[at],Ce);if(kt===null){et===null&&(et=Tn);break}s&&et&&kt.alternate===null&&a(J,et),X=w(kt,X,at),Ze===null?Ve=kt:Ze.sibling=kt,Ze=kt,et=Tn}if(at===re.length)return u(J,et),qt&&Mo(J,at),Ve;if(et===null){for(;at<re.length;at++)et=we(J,re[at],Ce),et!==null&&(X=w(et,X,at),Ze===null?Ve=et:Ze.sibling=et,Ze=et);return qt&&Mo(J,at),Ve}for(et=m(J,et);at<re.length;at++)Tn=Le(et,J,at,re[at],Ce),Tn!==null&&(s&&Tn.alternate!==null&&et.delete(Tn.key===null?at:Tn.key),X=w(Tn,X,at),Ze===null?Ve=Tn:Ze.sibling=Tn,Ze=Tn);return s&&et.forEach(function(to){return a(J,to)}),qt&&Mo(J,at),Ve}function Ye(J,X,re,Ce){var Ve=ce(re);if(typeof Ve!="function")throw Error(n(150));if(re=Ve.call(re),re==null)throw Error(n(151));for(var Ze=Ve=null,et=X,at=X=0,Tn=null,kt=re.next();et!==null&&!kt.done;at++,kt=re.next()){et.index>at?(Tn=et,et=null):Tn=et.sibling;var to=be(J,et,kt.value,Ce);if(to===null){et===null&&(et=Tn);break}s&&et&&to.alternate===null&&a(J,et),X=w(to,X,at),Ze===null?Ve=to:Ze.sibling=to,Ze=to,et=Tn}if(kt.done)return u(J,et),qt&&Mo(J,at),Ve;if(et===null){for(;!kt.done;at++,kt=re.next())kt=we(J,kt.value,Ce),kt!==null&&(X=w(kt,X,at),Ze===null?Ve=kt:Ze.sibling=kt,Ze=kt);return qt&&Mo(J,at),Ve}for(et=m(J,et);!kt.done;at++,kt=re.next())kt=Le(et,J,at,kt.value,Ce),kt!==null&&(s&&kt.alternate!==null&&et.delete(kt.key===null?at:kt.key),X=w(kt,X,at),Ze===null?Ve=kt:Ze.sibling=kt,Ze=kt);return s&&et.forEach(function(Uw){return a(J,Uw)}),qt&&Mo(J,at),Ve}function ln(J,X,re,Ce){if(typeof re=="object"&&re!==null&&re.type===S&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case L:e:{for(var Ve=re.key,Ze=X;Ze!==null;){if(Ze.key===Ve){if(Ve=re.type,Ve===S){if(Ze.tag===7){u(J,Ze.sibling),X=x(Ze,re.props.children),X.return=J,J=X;break e}}else if(Ze.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===ne&&dy(Ve)===Ze.type){u(J,Ze.sibling),X=x(Ze,re.props),X.ref=Ji(J,Ze,re),X.return=J,J=X;break e}u(J,Ze);break}else a(J,Ze);Ze=Ze.sibling}re.type===S?(X=Uo(re.props.children,J.mode,Ce,re.key),X.return=J,J=X):(Ce=hc(re.type,re.key,re.props,null,J.mode,Ce),Ce.ref=Ji(J,X,re),Ce.return=J,J=Ce)}return R(J);case _:e:{for(Ze=re.key;X!==null;){if(X.key===Ze)if(X.tag===4&&X.stateNode.containerInfo===re.containerInfo&&X.stateNode.implementation===re.implementation){u(J,X.sibling),X=x(X,re.children||[]),X.return=J,J=X;break e}else{u(J,X);break}else a(J,X);X=X.sibling}X=wh(re,J.mode,Ce),X.return=J,J=X}return R(J);case ne:return Ze=re._init,ln(J,X,Ze(re._payload),Ce)}if(te(re))return We(J,X,re,Ce);if(ce(re))return Ye(J,X,re,Ce);Wu(J,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,X!==null&&X.tag===6?(u(J,X.sibling),X=x(X,re),X.return=J,J=X):(u(J,X),X=Th(re,J.mode,Ce),X.return=J,J=X),R(J)):u(J,X)}return ln}var La=fy(!0),hy=fy(!1),Yu=Ys(null),$u=null,Ra=null,If=null;function Mf(){If=Ra=$u=null}function Lf(s){var a=Yu.current;zt(Yu),s._currentValue=a}function Rf(s,a,u){for(;s!==null;){var m=s.alternate;if((s.childLanes&a)!==a?(s.childLanes|=a,m!==null&&(m.childLanes|=a)):m!==null&&(m.childLanes&a)!==a&&(m.childLanes|=a),s===u)break;s=s.return}}function Pa(s,a){$u=s,If=Ra=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&a)!==0&&(Qn=!0),s.firstContext=null)}function br(s){var a=s._currentValue;if(If!==s)if(s={context:s,memoizedValue:a,next:null},Ra===null){if($u===null)throw Error(n(308));Ra=s,$u.dependencies={lanes:0,firstContext:s}}else Ra=Ra.next=s;return a}var Lo=null;function Pf(s){Lo===null?Lo=[s]:Lo.push(s)}function my(s,a,u,m){var x=a.interleaved;return x===null?(u.next=u,Pf(a)):(u.next=x.next,x.next=u),a.interleaved=u,gs(s,m)}function gs(s,a){s.lanes|=a;var u=s.alternate;for(u!==null&&(u.lanes|=a),u=s,s=s.return;s!==null;)s.childLanes|=a,u=s.alternate,u!==null&&(u.childLanes|=a),u=s,s=s.return;return u.tag===3?u.stateNode:null}var Vs=!1;function jf(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function py(s,a){s=s.updateQueue,a.updateQueue===s&&(a.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function bs(s,a){return{eventTime:s,lane:a,tag:0,payload:null,callback:null,next:null}}function Qs(s,a,u){var m=s.updateQueue;if(m===null)return null;if(m=m.shared,(vt&2)!==0){var x=m.pending;return x===null?a.next=a:(a.next=x.next,x.next=a),m.pending=a,gs(s,u)}return x=m.interleaved,x===null?(a.next=a,Pf(m)):(a.next=x.next,x.next=a),m.interleaved=a,gs(s,u)}function qu(s,a,u){if(a=a.updateQueue,a!==null&&(a=a.shared,(u&4194240)!==0)){var m=a.lanes;m&=s.pendingLanes,u|=m,a.lanes=u,Kd(s,u)}}function yy(s,a){var u=s.updateQueue,m=s.alternate;if(m!==null&&(m=m.updateQueue,u===m)){var x=null,w=null;if(u=u.firstBaseUpdate,u!==null){do{var R={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};w===null?x=w=R:w=w.next=R,u=u.next}while(u!==null);w===null?x=w=a:w=w.next=a}else x=w=a;u={baseState:m.baseState,firstBaseUpdate:x,lastBaseUpdate:w,shared:m.shared,effects:m.effects},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=a:s.next=a,u.lastBaseUpdate=a}function Vu(s,a,u,m){var x=s.updateQueue;Vs=!1;var w=x.firstBaseUpdate,R=x.lastBaseUpdate,q=x.shared.pending;if(q!==null){x.shared.pending=null;var K=q,ue=K.next;K.next=null,R===null?w=ue:R.next=ue,R=K;var ve=s.alternate;ve!==null&&(ve=ve.updateQueue,q=ve.lastBaseUpdate,q!==R&&(q===null?ve.firstBaseUpdate=ue:q.next=ue,ve.lastBaseUpdate=K))}if(w!==null){var we=x.baseState;R=0,ve=ue=K=null,q=w;do{var be=q.lane,Le=q.eventTime;if((m&be)===be){ve!==null&&(ve=ve.next={eventTime:Le,lane:0,tag:q.tag,payload:q.payload,callback:q.callback,next:null});e:{var We=s,Ye=q;switch(be=a,Le=u,Ye.tag){case 1:if(We=Ye.payload,typeof We=="function"){we=We.call(Le,we,be);break e}we=We;break e;case 3:We.flags=We.flags&-65537|128;case 0:if(We=Ye.payload,be=typeof We=="function"?We.call(Le,we,be):We,be==null)break e;we=M({},we,be);break e;case 2:Vs=!0}}q.callback!==null&&q.lane!==0&&(s.flags|=64,be=x.effects,be===null?x.effects=[q]:be.push(q))}else Le={eventTime:Le,lane:be,tag:q.tag,payload:q.payload,callback:q.callback,next:null},ve===null?(ue=ve=Le,K=we):ve=ve.next=Le,R|=be;if(q=q.next,q===null){if(q=x.shared.pending,q===null)break;be=q,q=be.next,be.next=null,x.lastBaseUpdate=be,x.shared.pending=null}}while(!0);if(ve===null&&(K=we),x.baseState=K,x.firstBaseUpdate=ue,x.lastBaseUpdate=ve,a=x.shared.interleaved,a!==null){x=a;do R|=x.lane,x=x.next;while(x!==a)}else w===null&&(x.shared.lanes=0);jo|=R,s.lanes=R,s.memoizedState=we}}function gy(s,a,u){if(s=a.effects,a.effects=null,s!==null)for(a=0;a<s.length;a++){var m=s[a],x=m.callback;if(x!==null){if(m.callback=null,m=u,typeof x!="function")throw Error(n(191,x));x.call(m)}}}var Zi={},Qr=Ys(Zi),el=Ys(Zi),tl=Ys(Zi);function Ro(s){if(s===Zi)throw Error(n(174));return s}function Ff(s,a){switch(Ft(tl,a),Ft(el,s),Ft(Qr,Zi),s=a.nodeType,s){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:ye(null,"");break;default:s=s===8?a.parentNode:a,a=s.namespaceURI||null,s=s.tagName,a=ye(a,s)}zt(Qr),Ft(Qr,a)}function ja(){zt(Qr),zt(el),zt(tl)}function by(s){Ro(tl.current);var a=Ro(Qr.current),u=ye(a,s.type);a!==u&&(Ft(el,s),Ft(Qr,u))}function Bf(s){el.current===s&&(zt(Qr),zt(el))}var Qt=Ys(0);function Qu(s){for(var a=s;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===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Hf=[];function Uf(){for(var s=0;s<Hf.length;s++)Hf[s]._workInProgressVersionPrimary=null;Hf.length=0}var Gu=A.ReactCurrentDispatcher,zf=A.ReactCurrentBatchConfig,Po=0,Gt=null,bn=null,vn=null,Ku=!1,nl=!1,rl=0,uw=0;function In(){throw Error(n(321))}function Wf(s,a){if(a===null)return!1;for(var u=0;u<a.length&&u<s.length;u++)if(!Ar(s[u],a[u]))return!1;return!0}function Yf(s,a,u,m,x,w){if(Po=w,Gt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Gu.current=s===null||s.memoizedState===null?hw:mw,s=u(m,x),nl){w=0;do{if(nl=!1,rl=0,25<=w)throw Error(n(301));w+=1,vn=bn=null,a.updateQueue=null,Gu.current=pw,s=u(m,x)}while(nl)}if(Gu.current=Zu,a=bn!==null&&bn.next!==null,Po=0,vn=bn=Gt=null,Ku=!1,a)throw Error(n(300));return s}function $f(){var s=rl!==0;return rl=0,s}function Gr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vn===null?Gt.memoizedState=vn=s:vn=vn.next=s,vn}function xr(){if(bn===null){var s=Gt.alternate;s=s!==null?s.memoizedState:null}else s=bn.next;var a=vn===null?Gt.memoizedState:vn.next;if(a!==null)vn=a,bn=s;else{if(s===null)throw Error(n(310));bn=s,s={memoizedState:bn.memoizedState,baseState:bn.baseState,baseQueue:bn.baseQueue,queue:bn.queue,next:null},vn===null?Gt.memoizedState=vn=s:vn=vn.next=s}return vn}function sl(s,a){return typeof a=="function"?a(s):a}function qf(s){var a=xr(),u=a.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=s;var m=bn,x=m.baseQueue,w=u.pending;if(w!==null){if(x!==null){var R=x.next;x.next=w.next,w.next=R}m.baseQueue=x=w,u.pending=null}if(x!==null){w=x.next,m=m.baseState;var q=R=null,K=null,ue=w;do{var ve=ue.lane;if((Po&ve)===ve)K!==null&&(K=K.next={lane:0,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),m=ue.hasEagerState?ue.eagerState:s(m,ue.action);else{var we={lane:ve,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null};K===null?(q=K=we,R=m):K=K.next=we,Gt.lanes|=ve,jo|=ve}ue=ue.next}while(ue!==null&&ue!==w);K===null?R=m:K.next=q,Ar(m,a.memoizedState)||(Qn=!0),a.memoizedState=m,a.baseState=R,a.baseQueue=K,u.lastRenderedState=m}if(s=u.interleaved,s!==null){x=s;do w=x.lane,Gt.lanes|=w,jo|=w,x=x.next;while(x!==s)}else x===null&&(u.lanes=0);return[a.memoizedState,u.dispatch]}function Vf(s){var a=xr(),u=a.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=s;var m=u.dispatch,x=u.pending,w=a.memoizedState;if(x!==null){u.pending=null;var R=x=x.next;do w=s(w,R.action),R=R.next;while(R!==x);Ar(w,a.memoizedState)||(Qn=!0),a.memoizedState=w,a.baseQueue===null&&(a.baseState=w),u.lastRenderedState=w}return[w,m]}function xy(){}function vy(s,a){var u=Gt,m=xr(),x=a(),w=!Ar(m.memoizedState,x);if(w&&(m.memoizedState=x,Qn=!0),m=m.queue,Qf(wy.bind(null,u,m,s),[s]),m.getSnapshot!==a||w||vn!==null&&vn.memoizedState.tag&1){if(u.flags|=2048,ol(9,Ty.bind(null,u,m,x,a),void 0,null),En===null)throw Error(n(349));(Po&30)!==0||Ey(u,a,x)}return x}function Ey(s,a,u){s.flags|=16384,s={getSnapshot:a,value:u},a=Gt.updateQueue,a===null?(a={lastEffect:null,stores:null},Gt.updateQueue=a,a.stores=[s]):(u=a.stores,u===null?a.stores=[s]:u.push(s))}function Ty(s,a,u,m){a.value=u,a.getSnapshot=m,ky(a)&&Sy(s)}function wy(s,a,u){return u(function(){ky(a)&&Sy(s)})}function ky(s){var a=s.getSnapshot;s=s.value;try{var u=a();return!Ar(s,u)}catch{return!0}}function Sy(s){var a=gs(s,1);a!==null&&Pr(a,s,1,-1)}function Cy(s){var a=Gr();return typeof s=="function"&&(s=s()),a.memoizedState=a.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:sl,lastRenderedState:s},a.queue=s,s=s.dispatch=fw.bind(null,Gt,s),[a.memoizedState,s]}function ol(s,a,u,m){return s={tag:s,create:a,destroy:u,deps:m,next:null},a=Gt.updateQueue,a===null?(a={lastEffect:null,stores:null},Gt.updateQueue=a,a.lastEffect=s.next=s):(u=a.lastEffect,u===null?a.lastEffect=s.next=s:(m=u.next,u.next=s,s.next=m,a.lastEffect=s)),s}function _y(){return xr().memoizedState}function Xu(s,a,u,m){var x=Gr();Gt.flags|=s,x.memoizedState=ol(1|a,u,void 0,m===void 0?null:m)}function Ju(s,a,u,m){var x=xr();m=m===void 0?null:m;var w=void 0;if(bn!==null){var R=bn.memoizedState;if(w=R.destroy,m!==null&&Wf(m,R.deps)){x.memoizedState=ol(a,u,w,m);return}}Gt.flags|=s,x.memoizedState=ol(1|a,u,w,m)}function Ny(s,a){return Xu(8390656,8,s,a)}function Qf(s,a){return Ju(2048,8,s,a)}function Dy(s,a){return Ju(4,2,s,a)}function Oy(s,a){return Ju(4,4,s,a)}function Ay(s,a){if(typeof a=="function")return s=s(),a(s),function(){a(null)};if(a!=null)return s=s(),a.current=s,function(){a.current=null}}function Iy(s,a,u){return u=u!=null?u.concat([s]):null,Ju(4,4,Ay.bind(null,a,s),u)}function Gf(){}function My(s,a){var u=xr();a=a===void 0?null:a;var m=u.memoizedState;return m!==null&&a!==null&&Wf(a,m[1])?m[0]:(u.memoizedState=[s,a],s)}function Ly(s,a){var u=xr();a=a===void 0?null:a;var m=u.memoizedState;return m!==null&&a!==null&&Wf(a,m[1])?m[0]:(s=s(),u.memoizedState=[s,a],s)}function Ry(s,a,u){return(Po&21)===0?(s.baseState&&(s.baseState=!1,Qn=!0),s.memoizedState=u):(Ar(u,a)||(u=dp(),Gt.lanes|=u,jo|=u,s.baseState=!0),a)}function cw(s,a){var u=Ot;Ot=u!==0&&4>u?u:4,s(!0);var m=zf.transition;zf.transition={};try{s(!1),a()}finally{Ot=u,zf.transition=m}}function Py(){return xr().memoizedState}function dw(s,a,u){var m=Js(s);if(u={lane:m,action:u,hasEagerState:!1,eagerState:null,next:null},jy(s))Fy(a,u);else if(u=my(s,a,u,m),u!==null){var x=Un();Pr(u,s,m,x),By(u,a,m)}}function fw(s,a,u){var m=Js(s),x={lane:m,action:u,hasEagerState:!1,eagerState:null,next:null};if(jy(s))Fy(a,x);else{var w=s.alternate;if(s.lanes===0&&(w===null||w.lanes===0)&&(w=a.lastRenderedReducer,w!==null))try{var R=a.lastRenderedState,q=w(R,u);if(x.hasEagerState=!0,x.eagerState=q,Ar(q,R)){var K=a.interleaved;K===null?(x.next=x,Pf(a)):(x.next=K.next,K.next=x),a.interleaved=x;return}}catch{}finally{}u=my(s,a,x,m),u!==null&&(x=Un(),Pr(u,s,m,x),By(u,a,m))}}function jy(s){var a=s.alternate;return s===Gt||a!==null&&a===Gt}function Fy(s,a){nl=Ku=!0;var u=s.pending;u===null?a.next=a:(a.next=u.next,u.next=a),s.pending=a}function By(s,a,u){if((u&4194240)!==0){var m=a.lanes;m&=s.pendingLanes,u|=m,a.lanes=u,Kd(s,u)}}var Zu={readContext:br,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},hw={readContext:br,useCallback:function(s,a){return Gr().memoizedState=[s,a===void 0?null:a],s},useContext:br,useEffect:Ny,useImperativeHandle:function(s,a,u){return u=u!=null?u.concat([s]):null,Xu(4194308,4,Ay.bind(null,a,s),u)},useLayoutEffect:function(s,a){return Xu(4194308,4,s,a)},useInsertionEffect:function(s,a){return Xu(4,2,s,a)},useMemo:function(s,a){var u=Gr();return a=a===void 0?null:a,s=s(),u.memoizedState=[s,a],s},useReducer:function(s,a,u){var m=Gr();return a=u!==void 0?u(a):a,m.memoizedState=m.baseState=a,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:a},m.queue=s,s=s.dispatch=dw.bind(null,Gt,s),[m.memoizedState,s]},useRef:function(s){var a=Gr();return s={current:s},a.memoizedState=s},useState:Cy,useDebugValue:Gf,useDeferredValue:function(s){return Gr().memoizedState=s},useTransition:function(){var s=Cy(!1),a=s[0];return s=cw.bind(null,s[1]),Gr().memoizedState=s,[a,s]},useMutableSource:function(){},useSyncExternalStore:function(s,a,u){var m=Gt,x=Gr();if(qt){if(u===void 0)throw Error(n(407));u=u()}else{if(u=a(),En===null)throw Error(n(349));(Po&30)!==0||Ey(m,a,u)}x.memoizedState=u;var w={value:u,getSnapshot:a};return x.queue=w,Ny(wy.bind(null,m,w,s),[s]),m.flags|=2048,ol(9,Ty.bind(null,m,w,u,a),void 0,null),u},useId:function(){var s=Gr(),a=En.identifierPrefix;if(qt){var u=ys,m=ps;u=(m&~(1<<32-Or(m)-1)).toString(32)+u,a=":"+a+"R"+u,u=rl++,0<u&&(a+="H"+u.toString(32)),a+=":"}else u=uw++,a=":"+a+"r"+u.toString(32)+":";return s.memoizedState=a},unstable_isNewReconciler:!1},mw={readContext:br,useCallback:My,useContext:br,useEffect:Qf,useImperativeHandle:Iy,useInsertionEffect:Dy,useLayoutEffect:Oy,useMemo:Ly,useReducer:qf,useRef:_y,useState:function(){return qf(sl)},useDebugValue:Gf,useDeferredValue:function(s){var a=xr();return Ry(a,bn.memoizedState,s)},useTransition:function(){var s=qf(sl)[0],a=xr().memoizedState;return[s,a]},useMutableSource:xy,useSyncExternalStore:vy,useId:Py,unstable_isNewReconciler:!1},pw={readContext:br,useCallback:My,useContext:br,useEffect:Qf,useImperativeHandle:Iy,useInsertionEffect:Dy,useLayoutEffect:Oy,useMemo:Ly,useReducer:Vf,useRef:_y,useState:function(){return Vf(sl)},useDebugValue:Gf,useDeferredValue:function(s){var a=xr();return bn===null?a.memoizedState=s:Ry(a,bn.memoizedState,s)},useTransition:function(){var s=Vf(sl)[0],a=xr().memoizedState;return[s,a]},useMutableSource:xy,useSyncExternalStore:vy,useId:Py,unstable_isNewReconciler:!1};function Mr(s,a){if(s&&s.defaultProps){a=M({},a),s=s.defaultProps;for(var u in s)a[u]===void 0&&(a[u]=s[u]);return a}return a}function Kf(s,a,u,m){a=s.memoizedState,u=u(m,a),u=u==null?a:M({},a,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var ec={isMounted:function(s){return(s=s._reactInternals)?Rt(s)===s:!1},enqueueSetState:function(s,a,u){s=s._reactInternals;var m=Un(),x=Js(s),w=bs(m,x);w.payload=a,u!=null&&(w.callback=u),a=Qs(s,w,x),a!==null&&(Pr(a,s,x,m),qu(a,s,x))},enqueueReplaceState:function(s,a,u){s=s._reactInternals;var m=Un(),x=Js(s),w=bs(m,x);w.tag=1,w.payload=a,u!=null&&(w.callback=u),a=Qs(s,w,x),a!==null&&(Pr(a,s,x,m),qu(a,s,x))},enqueueForceUpdate:function(s,a){s=s._reactInternals;var u=Un(),m=Js(s),x=bs(u,m);x.tag=2,a!=null&&(x.callback=a),a=Qs(s,x,m),a!==null&&(Pr(a,s,m,u),qu(a,s,m))}};function Hy(s,a,u,m,x,w,R){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(m,w,R):a.prototype&&a.prototype.isPureReactComponent?!$i(u,m)||!$i(x,w):!0}function Uy(s,a,u){var m=!1,x=$s,w=a.contextType;return typeof w=="object"&&w!==null?w=br(w):(x=Vn(a)?Ao:An.current,m=a.contextTypes,w=(m=m!=null)?Oa(s,x):$s),a=new a(u,w),s.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=ec,s.stateNode=a,a._reactInternals=s,m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=x,s.__reactInternalMemoizedMaskedChildContext=w),a}function zy(s,a,u,m){s=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,m),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,m),a.state!==s&&ec.enqueueReplaceState(a,a.state,null)}function Xf(s,a,u,m){var x=s.stateNode;x.props=u,x.state=s.memoizedState,x.refs={},jf(s);var w=a.contextType;typeof w=="object"&&w!==null?x.context=br(w):(w=Vn(a)?Ao:An.current,x.context=Oa(s,w)),x.state=s.memoizedState,w=a.getDerivedStateFromProps,typeof w=="function"&&(Kf(s,a,w,u),x.state=s.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(a=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),a!==x.state&&ec.enqueueReplaceState(x,x.state,null),Vu(s,u,x,m),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308)}function Fa(s,a){try{var u="",m=a;do u+=he(m),m=m.return;while(m);var x=u}catch(w){x=`
32
+ Error generating stack: `+w.message+`
33
+ `+w.stack}return{value:s,source:a,stack:x,digest:null}}function Jf(s,a,u){return{value:s,source:null,stack:u??null,digest:a??null}}function Zf(s,a){try{console.error(a.value)}catch(u){setTimeout(function(){throw u})}}var yw=typeof WeakMap=="function"?WeakMap:Map;function Wy(s,a,u){u=bs(-1,u),u.tag=3,u.payload={element:null};var m=a.value;return u.callback=function(){ic||(ic=!0,mh=m),Zf(s,a)},u}function Yy(s,a,u){u=bs(-1,u),u.tag=3;var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var x=a.value;u.payload=function(){return m(x)},u.callback=function(){Zf(s,a)}}var w=s.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(u.callback=function(){Zf(s,a),typeof m!="function"&&(Ks===null?Ks=new Set([this]):Ks.add(this));var R=a.stack;this.componentDidCatch(a.value,{componentStack:R!==null?R:""})}),u}function $y(s,a,u){var m=s.pingCache;if(m===null){m=s.pingCache=new yw;var x=new Set;m.set(a,x)}else x=m.get(a),x===void 0&&(x=new Set,m.set(a,x));x.has(u)||(x.add(u),s=Ow.bind(null,s,a,u),a.then(s,s))}function qy(s){do{var a;if((a=s.tag===13)&&(a=s.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return s;s=s.return}while(s!==null);return null}function Vy(s,a,u,m,x){return(s.mode&1)===0?(s===a?s.flags|=65536:(s.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(a=bs(-1,1),a.tag=2,Qs(u,a,1))),u.lanes|=1),s):(s.flags|=65536,s.lanes=x,s)}var gw=A.ReactCurrentOwner,Qn=!1;function Hn(s,a,u,m){a.child=s===null?hy(a,null,u,m):La(a,s.child,u,m)}function Qy(s,a,u,m,x){u=u.render;var w=a.ref;return Pa(a,x),m=Yf(s,a,u,m,w,x),u=$f(),s!==null&&!Qn?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~x,xs(s,a,x)):(qt&&u&&_f(a),a.flags|=1,Hn(s,a,m,x),a.child)}function Gy(s,a,u,m,x){if(s===null){var w=u.type;return typeof w=="function"&&!Eh(w)&&w.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(a.tag=15,a.type=w,Ky(s,a,w,m,x)):(s=hc(u.type,null,m,a,a.mode,x),s.ref=a.ref,s.return=a,a.child=s)}if(w=s.child,(s.lanes&x)===0){var R=w.memoizedProps;if(u=u.compare,u=u!==null?u:$i,u(R,m)&&s.ref===a.ref)return xs(s,a,x)}return a.flags|=1,s=eo(w,m),s.ref=a.ref,s.return=a,a.child=s}function Ky(s,a,u,m,x){if(s!==null){var w=s.memoizedProps;if($i(w,m)&&s.ref===a.ref)if(Qn=!1,a.pendingProps=m=w,(s.lanes&x)!==0)(s.flags&131072)!==0&&(Qn=!0);else return a.lanes=s.lanes,xs(s,a,x)}return eh(s,a,u,m,x)}function Xy(s,a,u){var m=a.pendingProps,x=m.children,w=s!==null?s.memoizedState:null;if(m.mode==="hidden")if((a.mode&1)===0)a.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ft(Ha,lr),lr|=u;else{if((u&1073741824)===0)return s=w!==null?w.baseLanes|u:u,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:s,cachePool:null,transitions:null},a.updateQueue=null,Ft(Ha,lr),lr|=s,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=w!==null?w.baseLanes:u,Ft(Ha,lr),lr|=m}else w!==null?(m=w.baseLanes|u,a.memoizedState=null):m=u,Ft(Ha,lr),lr|=m;return Hn(s,a,x,u),a.child}function Jy(s,a){var u=a.ref;(s===null&&u!==null||s!==null&&s.ref!==u)&&(a.flags|=512,a.flags|=2097152)}function eh(s,a,u,m,x){var w=Vn(u)?Ao:An.current;return w=Oa(a,w),Pa(a,x),u=Yf(s,a,u,m,w,x),m=$f(),s!==null&&!Qn?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~x,xs(s,a,x)):(qt&&m&&_f(a),a.flags|=1,Hn(s,a,u,x),a.child)}function Zy(s,a,u,m,x){if(Vn(u)){var w=!0;Fu(a)}else w=!1;if(Pa(a,x),a.stateNode===null)nc(s,a),Uy(a,u,m),Xf(a,u,m,x),m=!0;else if(s===null){var R=a.stateNode,q=a.memoizedProps;R.props=q;var K=R.context,ue=u.contextType;typeof ue=="object"&&ue!==null?ue=br(ue):(ue=Vn(u)?Ao:An.current,ue=Oa(a,ue));var ve=u.getDerivedStateFromProps,we=typeof ve=="function"||typeof R.getSnapshotBeforeUpdate=="function";we||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(q!==m||K!==ue)&&zy(a,R,m,ue),Vs=!1;var be=a.memoizedState;R.state=be,Vu(a,m,R,x),K=a.memoizedState,q!==m||be!==K||qn.current||Vs?(typeof ve=="function"&&(Kf(a,u,ve,m),K=a.memoizedState),(q=Vs||Hy(a,u,q,m,be,K,ue))?(we||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount()),typeof R.componentDidMount=="function"&&(a.flags|=4194308)):(typeof R.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=m,a.memoizedState=K),R.props=m,R.state=K,R.context=ue,m=q):(typeof R.componentDidMount=="function"&&(a.flags|=4194308),m=!1)}else{R=a.stateNode,py(s,a),q=a.memoizedProps,ue=a.type===a.elementType?q:Mr(a.type,q),R.props=ue,we=a.pendingProps,be=R.context,K=u.contextType,typeof K=="object"&&K!==null?K=br(K):(K=Vn(u)?Ao:An.current,K=Oa(a,K));var Le=u.getDerivedStateFromProps;(ve=typeof Le=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(q!==we||be!==K)&&zy(a,R,m,K),Vs=!1,be=a.memoizedState,R.state=be,Vu(a,m,R,x);var We=a.memoizedState;q!==we||be!==We||qn.current||Vs?(typeof Le=="function"&&(Kf(a,u,Le,m),We=a.memoizedState),(ue=Vs||Hy(a,u,ue,m,be,We,K)||!1)?(ve||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(m,We,K),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(m,We,K)),typeof R.componentDidUpdate=="function"&&(a.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof R.componentDidUpdate!="function"||q===s.memoizedProps&&be===s.memoizedState||(a.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||q===s.memoizedProps&&be===s.memoizedState||(a.flags|=1024),a.memoizedProps=m,a.memoizedState=We),R.props=m,R.state=We,R.context=K,m=ue):(typeof R.componentDidUpdate!="function"||q===s.memoizedProps&&be===s.memoizedState||(a.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||q===s.memoizedProps&&be===s.memoizedState||(a.flags|=1024),m=!1)}return th(s,a,u,m,w,x)}function th(s,a,u,m,x,w){Jy(s,a);var R=(a.flags&128)!==0;if(!m&&!R)return x&&sy(a,u,!1),xs(s,a,w);m=a.stateNode,gw.current=a;var q=R&&typeof u.getDerivedStateFromError!="function"?null:m.render();return a.flags|=1,s!==null&&R?(a.child=La(a,s.child,null,w),a.child=La(a,null,q,w)):Hn(s,a,q,w),a.memoizedState=m.state,x&&sy(a,u,!0),a.child}function eg(s){var a=s.stateNode;a.pendingContext?ny(s,a.pendingContext,a.pendingContext!==a.context):a.context&&ny(s,a.context,!1),Ff(s,a.containerInfo)}function tg(s,a,u,m,x){return Ma(),Af(x),a.flags|=256,Hn(s,a,u,m),a.child}var nh={dehydrated:null,treeContext:null,retryLane:0};function rh(s){return{baseLanes:s,cachePool:null,transitions:null}}function ng(s,a,u){var m=a.pendingProps,x=Qt.current,w=!1,R=(a.flags&128)!==0,q;if((q=R)||(q=s!==null&&s.memoizedState===null?!1:(x&2)!==0),q?(w=!0,a.flags&=-129):(s===null||s.memoizedState!==null)&&(x|=1),Ft(Qt,x&1),s===null)return Of(a),s=a.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((a.mode&1)===0?a.lanes=1:s.data==="$!"?a.lanes=8:a.lanes=1073741824,null):(R=m.children,s=m.fallback,w?(m=a.mode,w=a.child,R={mode:"hidden",children:R},(m&1)===0&&w!==null?(w.childLanes=0,w.pendingProps=R):w=mc(R,m,0,null),s=Uo(s,m,u,null),w.return=a,s.return=a,w.sibling=s,a.child=w,a.child.memoizedState=rh(u),a.memoizedState=nh,s):sh(a,R));if(x=s.memoizedState,x!==null&&(q=x.dehydrated,q!==null))return bw(s,a,R,m,q,x,u);if(w){w=m.fallback,R=a.mode,x=s.child,q=x.sibling;var K={mode:"hidden",children:m.children};return(R&1)===0&&a.child!==x?(m=a.child,m.childLanes=0,m.pendingProps=K,a.deletions=null):(m=eo(x,K),m.subtreeFlags=x.subtreeFlags&14680064),q!==null?w=eo(q,w):(w=Uo(w,R,u,null),w.flags|=2),w.return=a,m.return=a,m.sibling=w,a.child=m,m=w,w=a.child,R=s.child.memoizedState,R=R===null?rh(u):{baseLanes:R.baseLanes|u,cachePool:null,transitions:R.transitions},w.memoizedState=R,w.childLanes=s.childLanes&~u,a.memoizedState=nh,m}return w=s.child,s=w.sibling,m=eo(w,{mode:"visible",children:m.children}),(a.mode&1)===0&&(m.lanes=u),m.return=a,m.sibling=null,s!==null&&(u=a.deletions,u===null?(a.deletions=[s],a.flags|=16):u.push(s)),a.child=m,a.memoizedState=null,m}function sh(s,a){return a=mc({mode:"visible",children:a},s.mode,0,null),a.return=s,s.child=a}function tc(s,a,u,m){return m!==null&&Af(m),La(a,s.child,null,u),s=sh(a,a.pendingProps.children),s.flags|=2,a.memoizedState=null,s}function bw(s,a,u,m,x,w,R){if(u)return a.flags&256?(a.flags&=-257,m=Jf(Error(n(422))),tc(s,a,R,m)):a.memoizedState!==null?(a.child=s.child,a.flags|=128,null):(w=m.fallback,x=a.mode,m=mc({mode:"visible",children:m.children},x,0,null),w=Uo(w,x,R,null),w.flags|=2,m.return=a,w.return=a,m.sibling=w,a.child=m,(a.mode&1)!==0&&La(a,s.child,null,R),a.child.memoizedState=rh(R),a.memoizedState=nh,w);if((a.mode&1)===0)return tc(s,a,R,null);if(x.data==="$!"){if(m=x.nextSibling&&x.nextSibling.dataset,m)var q=m.dgst;return m=q,w=Error(n(419)),m=Jf(w,m,void 0),tc(s,a,R,m)}if(q=(R&s.childLanes)!==0,Qn||q){if(m=En,m!==null){switch(R&-R){case 4:x=2;break;case 16:x=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:x=32;break;case 536870912:x=268435456;break;default:x=0}x=(x&(m.suspendedLanes|R))!==0?0:x,x!==0&&x!==w.retryLane&&(w.retryLane=x,gs(s,x),Pr(m,s,x,-1))}return vh(),m=Jf(Error(n(421))),tc(s,a,R,m)}return x.data==="$?"?(a.flags|=128,a.child=s.child,a=Aw.bind(null,s),x._reactRetry=a,null):(s=w.treeContext,ir=Ws(x.nextSibling),ar=a,qt=!0,Ir=null,s!==null&&(yr[gr++]=ps,yr[gr++]=ys,yr[gr++]=Io,ps=s.id,ys=s.overflow,Io=a),a=sh(a,m.children),a.flags|=4096,a)}function rg(s,a,u){s.lanes|=a;var m=s.alternate;m!==null&&(m.lanes|=a),Rf(s.return,a,u)}function oh(s,a,u,m,x){var w=s.memoizedState;w===null?s.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:m,tail:u,tailMode:x}:(w.isBackwards=a,w.rendering=null,w.renderingStartTime=0,w.last=m,w.tail=u,w.tailMode=x)}function sg(s,a,u){var m=a.pendingProps,x=m.revealOrder,w=m.tail;if(Hn(s,a,m.children,u),m=Qt.current,(m&2)!==0)m=m&1|2,a.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=a.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&rg(s,u,a);else if(s.tag===19)rg(s,u,a);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}m&=1}if(Ft(Qt,m),(a.mode&1)===0)a.memoizedState=null;else switch(x){case"forwards":for(u=a.child,x=null;u!==null;)s=u.alternate,s!==null&&Qu(s)===null&&(x=u),u=u.sibling;u=x,u===null?(x=a.child,a.child=null):(x=u.sibling,u.sibling=null),oh(a,!1,x,u,w);break;case"backwards":for(u=null,x=a.child,a.child=null;x!==null;){if(s=x.alternate,s!==null&&Qu(s)===null){a.child=x;break}s=x.sibling,x.sibling=u,u=x,x=s}oh(a,!0,u,null,w);break;case"together":oh(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function nc(s,a){(a.mode&1)===0&&s!==null&&(s.alternate=null,a.alternate=null,a.flags|=2)}function xs(s,a,u){if(s!==null&&(a.dependencies=s.dependencies),jo|=a.lanes,(u&a.childLanes)===0)return null;if(s!==null&&a.child!==s.child)throw Error(n(153));if(a.child!==null){for(s=a.child,u=eo(s,s.pendingProps),a.child=u,u.return=a;s.sibling!==null;)s=s.sibling,u=u.sibling=eo(s,s.pendingProps),u.return=a;u.sibling=null}return a.child}function xw(s,a,u){switch(a.tag){case 3:eg(a),Ma();break;case 5:by(a);break;case 1:Vn(a.type)&&Fu(a);break;case 4:Ff(a,a.stateNode.containerInfo);break;case 10:var m=a.type._context,x=a.memoizedProps.value;Ft(Yu,m._currentValue),m._currentValue=x;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?ng(s,a,u):(Ft(Qt,Qt.current&1),s=xs(s,a,u),s!==null?s.sibling:null);Ft(Qt,Qt.current&1);break;case 19:if(m=(u&a.childLanes)!==0,(s.flags&128)!==0){if(m)return sg(s,a,u);a.flags|=128}if(x=a.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),Ft(Qt,Qt.current),m)break;return null;case 22:case 23:return a.lanes=0,Xy(s,a,u)}return xs(s,a,u)}var og,ah,ag,ig;og=function(s,a){for(var u=a.child;u!==null;){if(u.tag===5||u.tag===6)s.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===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}},ah=function(){},ag=function(s,a,u,m){var x=s.memoizedProps;if(x!==m){s=a.stateNode,Ro(Qr.current);var w=null;switch(u){case"input":x=st(s,x),m=st(s,m),w=[];break;case"select":x=M({},x,{value:void 0}),m=M({},m,{value:void 0}),w=[];break;case"textarea":x=Ne(s,x),m=Ne(s,m),w=[];break;default:typeof x.onClick!="function"&&typeof m.onClick=="function"&&(s.onclick=Ru)}Wt(u,m);var R;u=null;for(ue in x)if(!m.hasOwnProperty(ue)&&x.hasOwnProperty(ue)&&x[ue]!=null)if(ue==="style"){var q=x[ue];for(R in q)q.hasOwnProperty(R)&&(u||(u={}),u[R]="")}else ue!=="dangerouslySetInnerHTML"&&ue!=="children"&&ue!=="suppressContentEditableWarning"&&ue!=="suppressHydrationWarning"&&ue!=="autoFocus"&&(o.hasOwnProperty(ue)?w||(w=[]):(w=w||[]).push(ue,null));for(ue in m){var K=m[ue];if(q=x!=null?x[ue]:void 0,m.hasOwnProperty(ue)&&K!==q&&(K!=null||q!=null))if(ue==="style")if(q){for(R in q)!q.hasOwnProperty(R)||K&&K.hasOwnProperty(R)||(u||(u={}),u[R]="");for(R in K)K.hasOwnProperty(R)&&q[R]!==K[R]&&(u||(u={}),u[R]=K[R])}else u||(w||(w=[]),w.push(ue,u)),u=K;else ue==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,q=q?q.__html:void 0,K!=null&&q!==K&&(w=w||[]).push(ue,K)):ue==="children"?typeof K!="string"&&typeof K!="number"||(w=w||[]).push(ue,""+K):ue!=="suppressContentEditableWarning"&&ue!=="suppressHydrationWarning"&&(o.hasOwnProperty(ue)?(K!=null&&ue==="onScroll"&&Ut("scroll",s),w||q===K||(w=[])):(w=w||[]).push(ue,K))}u&&(w=w||[]).push("style",u);var ue=w;(a.updateQueue=ue)&&(a.flags|=4)}},ig=function(s,a,u,m){u!==m&&(a.flags|=4)};function al(s,a){if(!qt)switch(s.tailMode){case"hidden":a=s.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?a||s.tail===null?s.tail=null:s.tail.sibling=null:m.sibling=null}}function Mn(s){var a=s.alternate!==null&&s.alternate.child===s.child,u=0,m=0;if(a)for(var x=s.child;x!==null;)u|=x.lanes|x.childLanes,m|=x.subtreeFlags&14680064,m|=x.flags&14680064,x.return=s,x=x.sibling;else for(x=s.child;x!==null;)u|=x.lanes|x.childLanes,m|=x.subtreeFlags,m|=x.flags,x.return=s,x=x.sibling;return s.subtreeFlags|=m,s.childLanes=u,a}function vw(s,a,u){var m=a.pendingProps;switch(Nf(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 Vn(a.type)&&ju(),Mn(a),null;case 3:return m=a.stateNode,ja(),zt(qn),zt(An),Uf(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(s===null||s.child===null)&&(zu(a)?a.flags|=4:s===null||s.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Ir!==null&&(gh(Ir),Ir=null))),ah(s,a),Mn(a),null;case 5:Bf(a);var x=Ro(tl.current);if(u=a.type,s!==null&&a.stateNode!=null)ag(s,a,u,m,x),s.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(s=Ro(Qr.current),zu(a)){m=a.stateNode,u=a.type;var w=a.memoizedProps;switch(m[Vr]=a,m[Ki]=w,s=(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(x=0;x<Vi.length;x++)Ut(Vi[x],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":Je(m,w),Ut("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!w.multiple},Ut("invalid",m);break;case"textarea":qe(m,w),Ut("invalid",m)}Wt(u,w),x=null;for(var R in w)if(w.hasOwnProperty(R)){var q=w[R];R==="children"?typeof q=="string"?m.textContent!==q&&(w.suppressHydrationWarning!==!0&&Lu(m.textContent,q,s),x=["children",q]):typeof q=="number"&&m.textContent!==""+q&&(w.suppressHydrationWarning!==!0&&Lu(m.textContent,q,s),x=["children",""+q]):o.hasOwnProperty(R)&&q!=null&&R==="onScroll"&&Ut("scroll",m)}switch(u){case"input":Ee(m),Re(m,w,!0);break;case"textarea":Ee(m),yt(m);break;case"select":case"option":break;default:typeof w.onClick=="function"&&(m.onclick=Ru)}m=x,a.updateQueue=m,m!==null&&(a.flags|=4)}else{R=x.nodeType===9?x:x.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=ie(u)),s==="http://www.w3.org/1999/xhtml"?u==="script"?(s=R.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof m.is=="string"?s=R.createElement(u,{is:m.is}):(s=R.createElement(u),u==="select"&&(R=s,m.multiple?R.multiple=!0:m.size&&(R.size=m.size))):s=R.createElementNS(s,u),s[Vr]=a,s[Ki]=m,og(s,a,!1,!1),a.stateNode=s;e:{switch(R=It(u,m),u){case"dialog":Ut("cancel",s),Ut("close",s),x=m;break;case"iframe":case"object":case"embed":Ut("load",s),x=m;break;case"video":case"audio":for(x=0;x<Vi.length;x++)Ut(Vi[x],s);x=m;break;case"source":Ut("error",s),x=m;break;case"img":case"image":case"link":Ut("error",s),Ut("load",s),x=m;break;case"details":Ut("toggle",s),x=m;break;case"input":Je(s,m),x=st(s,m),Ut("invalid",s);break;case"option":x=m;break;case"select":s._wrapperState={wasMultiple:!!m.multiple},x=M({},m,{value:void 0}),Ut("invalid",s);break;case"textarea":qe(s,m),x=Ne(s,m),Ut("invalid",s);break;default:x=m}Wt(u,x),q=x;for(w in q)if(q.hasOwnProperty(w)){var K=q[w];w==="style"?Dn(s,K):w==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&nt(s,K)):w==="children"?typeof K=="string"?(u!=="textarea"||K!=="")&&ot(s,K):typeof K=="number"&&ot(s,""+K):w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&w!=="autoFocus"&&(o.hasOwnProperty(w)?K!=null&&w==="onScroll"&&Ut("scroll",s):K!=null&&O(s,w,K,R))}switch(u){case"input":Ee(s),Re(s,m,!1);break;case"textarea":Ee(s),yt(s);break;case"option":m.value!=null&&s.setAttribute("value",""+oe(m.value));break;case"select":s.multiple=!!m.multiple,w=m.value,w!=null?ge(s,!!m.multiple,w,!1):m.defaultValue!=null&&ge(s,!!m.multiple,m.defaultValue,!0);break;default:typeof x.onClick=="function"&&(s.onclick=Ru)}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(s&&a.stateNode!=null)ig(s,a,s.memoizedProps,m);else{if(typeof m!="string"&&a.stateNode===null)throw Error(n(166));if(u=Ro(tl.current),Ro(Qr.current),zu(a)){if(m=a.stateNode,u=a.memoizedProps,m[Vr]=a,(w=m.nodeValue!==u)&&(s=ar,s!==null))switch(s.tag){case 3:Lu(m.nodeValue,u,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&Lu(m.nodeValue,u,(s.mode&1)!==0)}w&&(a.flags|=4)}else m=(u.nodeType===9?u:u.ownerDocument).createTextNode(m),m[Vr]=a,a.stateNode=m}return Mn(a),null;case 13:if(zt(Qt),m=a.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(qt&&ir!==null&&(a.mode&1)!==0&&(a.flags&128)===0)cy(),Ma(),a.flags|=98560,w=!1;else if(w=zu(a),m!==null&&m.dehydrated!==null){if(s===null){if(!w)throw Error(n(318));if(w=a.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(n(317));w[Vr]=a}else Ma(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Mn(a),w=!1}else Ir!==null&&(gh(Ir),Ir=null),w=!0;if(!w)return a.flags&65536?a:null}return(a.flags&128)!==0?(a.lanes=u,a):(m=m!==null,m!==(s!==null&&s.memoizedState!==null)&&m&&(a.child.flags|=8192,(a.mode&1)!==0&&(s===null||(Qt.current&1)!==0?xn===0&&(xn=3):vh())),a.updateQueue!==null&&(a.flags|=4),Mn(a),null);case 4:return ja(),ah(s,a),s===null&&Qi(a.stateNode.containerInfo),Mn(a),null;case 10:return Lf(a.type._context),Mn(a),null;case 17:return Vn(a.type)&&ju(),Mn(a),null;case 19:if(zt(Qt),w=a.memoizedState,w===null)return Mn(a),null;if(m=(a.flags&128)!==0,R=w.rendering,R===null)if(m)al(w,!1);else{if(xn!==0||s!==null&&(s.flags&128)!==0)for(s=a.child;s!==null;){if(R=Qu(s),R!==null){for(a.flags|=128,al(w,!1),m=R.updateQueue,m!==null&&(a.updateQueue=m,a.flags|=4),a.subtreeFlags=0,m=u,u=a.child;u!==null;)w=u,s=m,w.flags&=14680066,R=w.alternate,R===null?(w.childLanes=0,w.lanes=s,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=R.childLanes,w.lanes=R.lanes,w.child=R.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=R.memoizedProps,w.memoizedState=R.memoizedState,w.updateQueue=R.updateQueue,w.type=R.type,s=R.dependencies,w.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),u=u.sibling;return Ft(Qt,Qt.current&1|2),a.child}s=s.sibling}w.tail!==null&&jt()>Ua&&(a.flags|=128,m=!0,al(w,!1),a.lanes=4194304)}else{if(!m)if(s=Qu(R),s!==null){if(a.flags|=128,m=!0,u=s.updateQueue,u!==null&&(a.updateQueue=u,a.flags|=4),al(w,!0),w.tail===null&&w.tailMode==="hidden"&&!R.alternate&&!qt)return Mn(a),null}else 2*jt()-w.renderingStartTime>Ua&&u!==1073741824&&(a.flags|=128,m=!0,al(w,!1),a.lanes=4194304);w.isBackwards?(R.sibling=a.child,a.child=R):(u=w.last,u!==null?u.sibling=R:a.child=R,w.last=R)}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 xh(),m=a.memoizedState!==null,s!==null&&s.memoizedState!==null!==m&&(a.flags|=8192),m&&(a.mode&1)!==0?(lr&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 Ew(s,a){switch(Nf(a),a.tag){case 1:return Vn(a.type)&&ju(),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return ja(),zt(qn),zt(An),Uf(),s=a.flags,(s&65536)!==0&&(s&128)===0?(a.flags=s&-65537|128,a):null;case 5:return Bf(a),null;case 13:if(zt(Qt),s=a.memoizedState,s!==null&&s.dehydrated!==null){if(a.alternate===null)throw Error(n(340));Ma()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 19:return zt(Qt),null;case 4:return ja(),null;case 10:return Lf(a.type._context),null;case 22:case 23:return xh(),null;case 24:return null;default:return null}}var rc=!1,Ln=!1,Tw=typeof WeakSet=="function"?WeakSet:Set,Be=null;function Ba(s,a){var u=s.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(m){rn(s,a,m)}else u.current=null}function ih(s,a,u){try{u()}catch(m){rn(s,a,m)}}var lg=!1;function ww(s,a){if(xf=wu,s=Hp(),df(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var m=u.getSelection&&u.getSelection();if(m&&m.rangeCount!==0){u=m.anchorNode;var x=m.anchorOffset,w=m.focusNode;m=m.focusOffset;try{u.nodeType,w.nodeType}catch{u=null;break e}var R=0,q=-1,K=-1,ue=0,ve=0,we=s,be=null;t:for(;;){for(var Le;we!==u||x!==0&&we.nodeType!==3||(q=R+x),we!==w||m!==0&&we.nodeType!==3||(K=R+m),we.nodeType===3&&(R+=we.nodeValue.length),(Le=we.firstChild)!==null;)be=we,we=Le;for(;;){if(we===s)break t;if(be===u&&++ue===x&&(q=R),be===w&&++ve===m&&(K=R),(Le=we.nextSibling)!==null)break;we=be,be=we.parentNode}we=Le}u=q===-1||K===-1?null:{start:q,end:K}}else u=null}u=u||{start:0,end:0}}else u=null;for(vf={focusedElem:s,selectionRange:u},wu=!1,Be=a;Be!==null;)if(a=Be,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,Be=s;else for(;Be!==null;){a=Be;try{var We=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if(We!==null){var Ye=We.memoizedProps,ln=We.memoizedState,J=a.stateNode,X=J.getSnapshotBeforeUpdate(a.elementType===a.type?Ye:Mr(a.type,Ye),ln);J.__reactInternalSnapshotBeforeUpdate=X}break;case 3:var re=a.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ce){rn(a,a.return,Ce)}if(s=a.sibling,s!==null){s.return=a.return,Be=s;break}Be=a.return}return We=lg,lg=!1,We}function il(s,a,u){var m=a.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var x=m=m.next;do{if((x.tag&s)===s){var w=x.destroy;x.destroy=void 0,w!==void 0&&ih(a,u,w)}x=x.next}while(x!==m)}}function sc(s,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var u=a=a.next;do{if((u.tag&s)===s){var m=u.create;u.destroy=m()}u=u.next}while(u!==a)}}function lh(s){var a=s.ref;if(a!==null){var u=s.stateNode;switch(s.tag){case 5:s=u;break;default:s=u}typeof a=="function"?a(s):a.current=s}}function ug(s){var a=s.alternate;a!==null&&(s.alternate=null,ug(a)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(a=s.stateNode,a!==null&&(delete a[Vr],delete a[Ki],delete a[kf],delete a[ow],delete a[aw])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function cg(s){return s.tag===5||s.tag===3||s.tag===4}function dg(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||cg(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function uh(s,a,u){var m=s.tag;if(m===5||m===6)s=s.stateNode,a?u.nodeType===8?u.parentNode.insertBefore(s,a):u.insertBefore(s,a):(u.nodeType===8?(a=u.parentNode,a.insertBefore(s,u)):(a=u,a.appendChild(s)),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=Ru));else if(m!==4&&(s=s.child,s!==null))for(uh(s,a,u),s=s.sibling;s!==null;)uh(s,a,u),s=s.sibling}function ch(s,a,u){var m=s.tag;if(m===5||m===6)s=s.stateNode,a?u.insertBefore(s,a):u.appendChild(s);else if(m!==4&&(s=s.child,s!==null))for(ch(s,a,u),s=s.sibling;s!==null;)ch(s,a,u),s=s.sibling}var Cn=null,Lr=!1;function Gs(s,a,u){for(u=u.child;u!==null;)fg(s,a,u),u=u.sibling}function fg(s,a,u){if(qr&&typeof qr.onCommitFiberUnmount=="function")try{qr.onCommitFiberUnmount(gu,u)}catch{}switch(u.tag){case 5:Ln||Ba(u,a);case 6:var m=Cn,x=Lr;Cn=null,Gs(s,a,u),Cn=m,Lr=x,Cn!==null&&(Lr?(s=Cn,u=u.stateNode,s.nodeType===8?s.parentNode.removeChild(u):s.removeChild(u)):Cn.removeChild(u.stateNode));break;case 18:Cn!==null&&(Lr?(s=Cn,u=u.stateNode,s.nodeType===8?wf(s.parentNode,u):s.nodeType===1&&wf(s,u),Bi(s)):wf(Cn,u.stateNode));break;case 4:m=Cn,x=Lr,Cn=u.stateNode.containerInfo,Lr=!0,Gs(s,a,u),Cn=m,Lr=x;break;case 0:case 11:case 14:case 15:if(!Ln&&(m=u.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){x=m=m.next;do{var w=x,R=w.destroy;w=w.tag,R!==void 0&&((w&2)!==0||(w&4)!==0)&&ih(u,a,R),x=x.next}while(x!==m)}Gs(s,a,u);break;case 1:if(!Ln&&(Ba(u,a),m=u.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=u.memoizedProps,m.state=u.memoizedState,m.componentWillUnmount()}catch(q){rn(u,a,q)}Gs(s,a,u);break;case 21:Gs(s,a,u);break;case 22:u.mode&1?(Ln=(m=Ln)||u.memoizedState!==null,Gs(s,a,u),Ln=m):Gs(s,a,u);break;default:Gs(s,a,u)}}function hg(s){var a=s.updateQueue;if(a!==null){s.updateQueue=null;var u=s.stateNode;u===null&&(u=s.stateNode=new Tw),a.forEach(function(m){var x=Iw.bind(null,s,m);u.has(m)||(u.add(m),m.then(x,x))})}}function Rr(s,a){var u=a.deletions;if(u!==null)for(var m=0;m<u.length;m++){var x=u[m];try{var w=s,R=a,q=R;e:for(;q!==null;){switch(q.tag){case 5:Cn=q.stateNode,Lr=!1;break e;case 3:Cn=q.stateNode.containerInfo,Lr=!0;break e;case 4:Cn=q.stateNode.containerInfo,Lr=!0;break e}q=q.return}if(Cn===null)throw Error(n(160));fg(w,R,x),Cn=null,Lr=!1;var K=x.alternate;K!==null&&(K.return=null),x.return=null}catch(ue){rn(x,a,ue)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)mg(a,s),a=a.sibling}function mg(s,a){var u=s.alternate,m=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(Rr(a,s),Kr(s),m&4){try{il(3,s,s.return),sc(3,s)}catch(Ye){rn(s,s.return,Ye)}try{il(5,s,s.return)}catch(Ye){rn(s,s.return,Ye)}}break;case 1:Rr(a,s),Kr(s),m&512&&u!==null&&Ba(u,u.return);break;case 5:if(Rr(a,s),Kr(s),m&512&&u!==null&&Ba(u,u.return),s.flags&32){var x=s.stateNode;try{ot(x,"")}catch(Ye){rn(s,s.return,Ye)}}if(m&4&&(x=s.stateNode,x!=null)){var w=s.memoizedProps,R=u!==null?u.memoizedProps:w,q=s.type,K=s.updateQueue;if(s.updateQueue=null,K!==null)try{q==="input"&&w.type==="radio"&&w.name!=null&&tt(x,w),It(q,R);var ue=It(q,w);for(R=0;R<K.length;R+=2){var ve=K[R],we=K[R+1];ve==="style"?Dn(x,we):ve==="dangerouslySetInnerHTML"?nt(x,we):ve==="children"?ot(x,we):O(x,ve,we,ue)}switch(q){case"input":Te(x,w);break;case"textarea":pt(x,w);break;case"select":var be=x._wrapperState.wasMultiple;x._wrapperState.wasMultiple=!!w.multiple;var Le=w.value;Le!=null?ge(x,!!w.multiple,Le,!1):be!==!!w.multiple&&(w.defaultValue!=null?ge(x,!!w.multiple,w.defaultValue,!0):ge(x,!!w.multiple,w.multiple?[]:"",!1))}x[Ki]=w}catch(Ye){rn(s,s.return,Ye)}}break;case 6:if(Rr(a,s),Kr(s),m&4){if(s.stateNode===null)throw Error(n(162));x=s.stateNode,w=s.memoizedProps;try{x.nodeValue=w}catch(Ye){rn(s,s.return,Ye)}}break;case 3:if(Rr(a,s),Kr(s),m&4&&u!==null&&u.memoizedState.isDehydrated)try{Bi(a.containerInfo)}catch(Ye){rn(s,s.return,Ye)}break;case 4:Rr(a,s),Kr(s);break;case 13:Rr(a,s),Kr(s),x=s.child,x.flags&8192&&(w=x.memoizedState!==null,x.stateNode.isHidden=w,!w||x.alternate!==null&&x.alternate.memoizedState!==null||(hh=jt())),m&4&&hg(s);break;case 22:if(ve=u!==null&&u.memoizedState!==null,s.mode&1?(Ln=(ue=Ln)||ve,Rr(a,s),Ln=ue):Rr(a,s),Kr(s),m&8192){if(ue=s.memoizedState!==null,(s.stateNode.isHidden=ue)&&!ve&&(s.mode&1)!==0)for(Be=s,ve=s.child;ve!==null;){for(we=Be=ve;Be!==null;){switch(be=Be,Le=be.child,be.tag){case 0:case 11:case 14:case 15:il(4,be,be.return);break;case 1:Ba(be,be.return);var We=be.stateNode;if(typeof We.componentWillUnmount=="function"){m=be,u=be.return;try{a=m,We.props=a.memoizedProps,We.state=a.memoizedState,We.componentWillUnmount()}catch(Ye){rn(m,u,Ye)}}break;case 5:Ba(be,be.return);break;case 22:if(be.memoizedState!==null){gg(we);continue}}Le!==null?(Le.return=be,Be=Le):gg(we)}ve=ve.sibling}e:for(ve=null,we=s;;){if(we.tag===5){if(ve===null){ve=we;try{x=we.stateNode,ue?(w=x.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none"):(q=we.stateNode,K=we.memoizedProps.style,R=K!=null&&K.hasOwnProperty("display")?K.display:null,q.style.display=hn("display",R))}catch(Ye){rn(s,s.return,Ye)}}}else if(we.tag===6){if(ve===null)try{we.stateNode.nodeValue=ue?"":we.memoizedProps}catch(Ye){rn(s,s.return,Ye)}}else if((we.tag!==22&&we.tag!==23||we.memoizedState===null||we===s)&&we.child!==null){we.child.return=we,we=we.child;continue}if(we===s)break e;for(;we.sibling===null;){if(we.return===null||we.return===s)break e;ve===we&&(ve=null),we=we.return}ve===we&&(ve=null),we.sibling.return=we.return,we=we.sibling}}break;case 19:Rr(a,s),Kr(s),m&4&&hg(s);break;case 21:break;default:Rr(a,s),Kr(s)}}function Kr(s){var a=s.flags;if(a&2){try{e:{for(var u=s.return;u!==null;){if(cg(u)){var m=u;break e}u=u.return}throw Error(n(160))}switch(m.tag){case 5:var x=m.stateNode;m.flags&32&&(ot(x,""),m.flags&=-33);var w=dg(s);ch(s,w,x);break;case 3:case 4:var R=m.stateNode.containerInfo,q=dg(s);uh(s,q,R);break;default:throw Error(n(161))}}catch(K){rn(s,s.return,K)}s.flags&=-3}a&4096&&(s.flags&=-4097)}function kw(s,a,u){Be=s,pg(s)}function pg(s,a,u){for(var m=(s.mode&1)!==0;Be!==null;){var x=Be,w=x.child;if(x.tag===22&&m){var R=x.memoizedState!==null||rc;if(!R){var q=x.alternate,K=q!==null&&q.memoizedState!==null||Ln;q=rc;var ue=Ln;if(rc=R,(Ln=K)&&!ue)for(Be=x;Be!==null;)R=Be,K=R.child,R.tag===22&&R.memoizedState!==null?bg(x):K!==null?(K.return=R,Be=K):bg(x);for(;w!==null;)Be=w,pg(w),w=w.sibling;Be=x,rc=q,Ln=ue}yg(s)}else(x.subtreeFlags&8772)!==0&&w!==null?(w.return=x,Be=w):yg(s)}}function yg(s){for(;Be!==null;){var a=Be;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||sc(5,a);break;case 1:var m=a.stateNode;if(a.flags&4&&!Ln)if(u===null)m.componentDidMount();else{var x=a.elementType===a.type?u.memoizedProps:Mr(a.type,u.memoizedProps);m.componentDidUpdate(x,u.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var w=a.updateQueue;w!==null&&gy(a,w,m);break;case 3:var R=a.updateQueue;if(R!==null){if(u=null,a.child!==null)switch(a.child.tag){case 5:u=a.child.stateNode;break;case 1:u=a.child.stateNode}gy(a,R,u)}break;case 5:var q=a.stateNode;if(u===null&&a.flags&4){u=q;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 ue=a.alternate;if(ue!==null){var ve=ue.memoizedState;if(ve!==null){var we=ve.dehydrated;we!==null&&Bi(we)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Ln||a.flags&512&&lh(a)}catch(be){rn(a,a.return,be)}}if(a===s){Be=null;break}if(u=a.sibling,u!==null){u.return=a.return,Be=u;break}Be=a.return}}function gg(s){for(;Be!==null;){var a=Be;if(a===s){Be=null;break}var u=a.sibling;if(u!==null){u.return=a.return,Be=u;break}Be=a.return}}function bg(s){for(;Be!==null;){var a=Be;try{switch(a.tag){case 0:case 11:case 15:var u=a.return;try{sc(4,a)}catch(K){rn(a,u,K)}break;case 1:var m=a.stateNode;if(typeof m.componentDidMount=="function"){var x=a.return;try{m.componentDidMount()}catch(K){rn(a,x,K)}}var w=a.return;try{lh(a)}catch(K){rn(a,w,K)}break;case 5:var R=a.return;try{lh(a)}catch(K){rn(a,R,K)}}}catch(K){rn(a,a.return,K)}if(a===s){Be=null;break}var q=a.sibling;if(q!==null){q.return=a.return,Be=q;break}Be=a.return}}var Sw=Math.ceil,oc=A.ReactCurrentDispatcher,dh=A.ReactCurrentOwner,vr=A.ReactCurrentBatchConfig,vt=0,En=null,mn=null,_n=0,lr=0,Ha=Ys(0),xn=0,ll=null,jo=0,ac=0,fh=0,ul=null,Gn=null,hh=0,Ua=1/0,vs=null,ic=!1,mh=null,Ks=null,lc=!1,Xs=null,uc=0,cl=0,ph=null,cc=-1,dc=0;function Un(){return(vt&6)!==0?jt():cc!==-1?cc:cc=jt()}function Js(s){return(s.mode&1)===0?1:(vt&2)!==0&&_n!==0?_n&-_n:lw.transition!==null?(dc===0&&(dc=dp()),dc):(s=Ot,s!==0||(s=window.event,s=s===void 0?16:vp(s.type)),s)}function Pr(s,a,u,m){if(50<cl)throw cl=0,ph=null,Error(n(185));Li(s,u,m),((vt&2)===0||s!==En)&&(s===En&&((vt&2)===0&&(ac|=u),xn===4&&Zs(s,_n)),Kn(s,m),u===1&&vt===0&&(a.mode&1)===0&&(Ua=jt()+500,Bu&&qs()))}function Kn(s,a){var u=s.callbackNode;lT(s,a);var m=vu(s,s===En?_n:0);if(m===0)u!==null&&Pt(u),s.callbackNode=null,s.callbackPriority=0;else if(a=m&-m,s.callbackPriority!==a){if(u!=null&&Pt(u),a===1)s.tag===0?iw(vg.bind(null,s)):oy(vg.bind(null,s)),rw(function(){(vt&6)===0&&qs()}),u=null;else{switch(fp(m)){case 1:u=Do;break;case 4:u=up;break;case 16:u=yu;break;case 536870912:u=cp;break;default:u=yu}u=Ng(u,xg.bind(null,s))}s.callbackPriority=a,s.callbackNode=u}}function xg(s,a){if(cc=-1,dc=0,(vt&6)!==0)throw Error(n(327));var u=s.callbackNode;if(za()&&s.callbackNode!==u)return null;var m=vu(s,s===En?_n:0);if(m===0)return null;if((m&30)!==0||(m&s.expiredLanes)!==0||a)a=fc(s,m);else{a=m;var x=vt;vt|=2;var w=Tg();(En!==s||_n!==a)&&(vs=null,Ua=jt()+500,Bo(s,a));do try{Nw();break}catch(q){Eg(s,q)}while(!0);Mf(),oc.current=w,vt=x,mn!==null?a=0:(En=null,_n=0,a=xn)}if(a!==0){if(a===2&&(x=Qd(s),x!==0&&(m=x,a=yh(s,x))),a===1)throw u=ll,Bo(s,0),Zs(s,m),Kn(s,jt()),u;if(a===6)Zs(s,m);else{if(x=s.current.alternate,(m&30)===0&&!Cw(x)&&(a=fc(s,m),a===2&&(w=Qd(s),w!==0&&(m=w,a=yh(s,w))),a===1))throw u=ll,Bo(s,0),Zs(s,m),Kn(s,jt()),u;switch(s.finishedWork=x,s.finishedLanes=m,a){case 0:case 1:throw Error(n(345));case 2:Ho(s,Gn,vs);break;case 3:if(Zs(s,m),(m&130023424)===m&&(a=hh+500-jt(),10<a)){if(vu(s,0)!==0)break;if(x=s.suspendedLanes,(x&m)!==m){Un(),s.pingedLanes|=s.suspendedLanes&x;break}s.timeoutHandle=Tf(Ho.bind(null,s,Gn,vs),a);break}Ho(s,Gn,vs);break;case 4:if(Zs(s,m),(m&4194240)===m)break;for(a=s.eventTimes,x=-1;0<m;){var R=31-Or(m);w=1<<R,R=a[R],R>x&&(x=R),m&=~w}if(m=x,m=jt()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*Sw(m/1960))-m,10<m){s.timeoutHandle=Tf(Ho.bind(null,s,Gn,vs),m);break}Ho(s,Gn,vs);break;case 5:Ho(s,Gn,vs);break;default:throw Error(n(329))}}}return Kn(s,jt()),s.callbackNode===u?xg.bind(null,s):null}function yh(s,a){var u=ul;return s.current.memoizedState.isDehydrated&&(Bo(s,a).flags|=256),s=fc(s,a),s!==2&&(a=Gn,Gn=u,a!==null&&gh(a)),s}function gh(s){Gn===null?Gn=s:Gn.push.apply(Gn,s)}function Cw(s){for(var a=s;;){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 x=u[m],w=x.getSnapshot;x=x.value;try{if(!Ar(w(),x))return!1}catch{return!1}}}if(u=a.child,a.subtreeFlags&16384&&u!==null)u.return=a,a=u;else{if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Zs(s,a){for(a&=~fh,a&=~ac,s.suspendedLanes|=a,s.pingedLanes&=~a,s=s.expirationTimes;0<a;){var u=31-Or(a),m=1<<u;s[u]=-1,a&=~m}}function vg(s){if((vt&6)!==0)throw Error(n(327));za();var a=vu(s,0);if((a&1)===0)return Kn(s,jt()),null;var u=fc(s,a);if(s.tag!==0&&u===2){var m=Qd(s);m!==0&&(a=m,u=yh(s,m))}if(u===1)throw u=ll,Bo(s,0),Zs(s,a),Kn(s,jt()),u;if(u===6)throw Error(n(345));return s.finishedWork=s.current.alternate,s.finishedLanes=a,Ho(s,Gn,vs),Kn(s,jt()),null}function bh(s,a){var u=vt;vt|=1;try{return s(a)}finally{vt=u,vt===0&&(Ua=jt()+500,Bu&&qs())}}function Fo(s){Xs!==null&&Xs.tag===0&&(vt&6)===0&&za();var a=vt;vt|=1;var u=vr.transition,m=Ot;try{if(vr.transition=null,Ot=1,s)return s()}finally{Ot=m,vr.transition=u,vt=a,(vt&6)===0&&qs()}}function xh(){lr=Ha.current,zt(Ha)}function Bo(s,a){s.finishedWork=null,s.finishedLanes=0;var u=s.timeoutHandle;if(u!==-1&&(s.timeoutHandle=-1,nw(u)),mn!==null)for(u=mn.return;u!==null;){var m=u;switch(Nf(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&ju();break;case 3:ja(),zt(qn),zt(An),Uf();break;case 5:Bf(m);break;case 4:ja();break;case 13:zt(Qt);break;case 19:zt(Qt);break;case 10:Lf(m.type._context);break;case 22:case 23:xh()}u=u.return}if(En=s,mn=s=eo(s.current,null),_n=lr=a,xn=0,ll=null,fh=ac=jo=0,Gn=ul=null,Lo!==null){for(a=0;a<Lo.length;a++)if(u=Lo[a],m=u.interleaved,m!==null){u.interleaved=null;var x=m.next,w=u.pending;if(w!==null){var R=w.next;w.next=x,m.next=R}u.pending=m}Lo=null}return s}function Eg(s,a){do{var u=mn;try{if(Mf(),Gu.current=Zu,Ku){for(var m=Gt.memoizedState;m!==null;){var x=m.queue;x!==null&&(x.pending=null),m=m.next}Ku=!1}if(Po=0,vn=bn=Gt=null,nl=!1,rl=0,dh.current=null,u===null||u.return===null){xn=1,ll=a,mn=null;break}e:{var w=s,R=u.return,q=u,K=a;if(a=_n,q.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var ue=K,ve=q,we=ve.tag;if((ve.mode&1)===0&&(we===0||we===11||we===15)){var be=ve.alternate;be?(ve.updateQueue=be.updateQueue,ve.memoizedState=be.memoizedState,ve.lanes=be.lanes):(ve.updateQueue=null,ve.memoizedState=null)}var Le=qy(R);if(Le!==null){Le.flags&=-257,Vy(Le,R,q,w,a),Le.mode&1&&$y(w,ue,a),a=Le,K=ue;var We=a.updateQueue;if(We===null){var Ye=new Set;Ye.add(K),a.updateQueue=Ye}else We.add(K);break e}else{if((a&1)===0){$y(w,ue,a),vh();break e}K=Error(n(426))}}else if(qt&&q.mode&1){var ln=qy(R);if(ln!==null){(ln.flags&65536)===0&&(ln.flags|=256),Vy(ln,R,q,w,a),Af(Fa(K,q));break e}}w=K=Fa(K,q),xn!==4&&(xn=2),ul===null?ul=[w]:ul.push(w),w=R;do{switch(w.tag){case 3:w.flags|=65536,a&=-a,w.lanes|=a;var J=Wy(w,K,a);yy(w,J);break e;case 1:q=K;var X=w.type,re=w.stateNode;if((w.flags&128)===0&&(typeof X.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(Ks===null||!Ks.has(re)))){w.flags|=65536,a&=-a,w.lanes|=a;var Ce=Yy(w,q,a);yy(w,Ce);break e}}w=w.return}while(w!==null)}kg(u)}catch(Ve){a=Ve,mn===u&&u!==null&&(mn=u=u.return);continue}break}while(!0)}function Tg(){var s=oc.current;return oc.current=Zu,s===null?Zu:s}function vh(){(xn===0||xn===3||xn===2)&&(xn=4),En===null||(jo&268435455)===0&&(ac&268435455)===0||Zs(En,_n)}function fc(s,a){var u=vt;vt|=2;var m=Tg();(En!==s||_n!==a)&&(vs=null,Bo(s,a));do try{_w();break}catch(x){Eg(s,x)}while(!0);if(Mf(),vt=u,oc.current=m,mn!==null)throw Error(n(261));return En=null,_n=0,xn}function _w(){for(;mn!==null;)wg(mn)}function Nw(){for(;mn!==null&&!Ii();)wg(mn)}function wg(s){var a=_g(s.alternate,s,lr);s.memoizedProps=s.pendingProps,a===null?kg(s):mn=a,dh.current=null}function kg(s){var a=s;do{var u=a.alternate;if(s=a.return,(a.flags&32768)===0){if(u=vw(u,a,lr),u!==null){mn=u;return}}else{if(u=Ew(u,a),u!==null){u.flags&=32767,mn=u;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{xn=6,mn=null;return}}if(a=a.sibling,a!==null){mn=a;return}mn=a=s}while(a!==null);xn===0&&(xn=5)}function Ho(s,a,u){var m=Ot,x=vr.transition;try{vr.transition=null,Ot=1,Dw(s,a,u,m)}finally{vr.transition=x,Ot=m}return null}function Dw(s,a,u,m){do za();while(Xs!==null);if((vt&6)!==0)throw Error(n(327));u=s.finishedWork;var x=s.finishedLanes;if(u===null)return null;if(s.finishedWork=null,s.finishedLanes=0,u===s.current)throw Error(n(177));s.callbackNode=null,s.callbackPriority=0;var w=u.lanes|u.childLanes;if(uT(s,w),s===En&&(mn=En=null,_n=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||lc||(lc=!0,Ng(yu,function(){return za(),null})),w=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||w){w=vr.transition,vr.transition=null;var R=Ot;Ot=1;var q=vt;vt|=4,dh.current=null,ww(s,u),mg(u,s),GT(vf),wu=!!xf,vf=xf=null,s.current=u,kw(u),va(),vt=q,Ot=R,vr.transition=w}else s.current=u;if(lc&&(lc=!1,Xs=s,uc=x),w=s.pendingLanes,w===0&&(Ks=null),rT(u.stateNode),Kn(s,jt()),a!==null)for(m=s.onRecoverableError,u=0;u<a.length;u++)x=a[u],m(x.value,{componentStack:x.stack,digest:x.digest});if(ic)throw ic=!1,s=mh,mh=null,s;return(uc&1)!==0&&s.tag!==0&&za(),w=s.pendingLanes,(w&1)!==0?s===ph?cl++:(cl=0,ph=s):cl=0,qs(),null}function za(){if(Xs!==null){var s=fp(uc),a=vr.transition,u=Ot;try{if(vr.transition=null,Ot=16>s?16:s,Xs===null)var m=!1;else{if(s=Xs,Xs=null,uc=0,(vt&6)!==0)throw Error(n(331));var x=vt;for(vt|=4,Be=s.current;Be!==null;){var w=Be,R=w.child;if((Be.flags&16)!==0){var q=w.deletions;if(q!==null){for(var K=0;K<q.length;K++){var ue=q[K];for(Be=ue;Be!==null;){var ve=Be;switch(ve.tag){case 0:case 11:case 15:il(8,ve,w)}var we=ve.child;if(we!==null)we.return=ve,Be=we;else for(;Be!==null;){ve=Be;var be=ve.sibling,Le=ve.return;if(ug(ve),ve===ue){Be=null;break}if(be!==null){be.return=Le,Be=be;break}Be=Le}}}var We=w.alternate;if(We!==null){var Ye=We.child;if(Ye!==null){We.child=null;do{var ln=Ye.sibling;Ye.sibling=null,Ye=ln}while(Ye!==null)}}Be=w}}if((w.subtreeFlags&2064)!==0&&R!==null)R.return=w,Be=R;else e:for(;Be!==null;){if(w=Be,(w.flags&2048)!==0)switch(w.tag){case 0:case 11:case 15:il(9,w,w.return)}var J=w.sibling;if(J!==null){J.return=w.return,Be=J;break e}Be=w.return}}var X=s.current;for(Be=X;Be!==null;){R=Be;var re=R.child;if((R.subtreeFlags&2064)!==0&&re!==null)re.return=R,Be=re;else e:for(R=X;Be!==null;){if(q=Be,(q.flags&2048)!==0)try{switch(q.tag){case 0:case 11:case 15:sc(9,q)}}catch(Ve){rn(q,q.return,Ve)}if(q===R){Be=null;break e}var Ce=q.sibling;if(Ce!==null){Ce.return=q.return,Be=Ce;break e}Be=q.return}}if(vt=x,qs(),qr&&typeof qr.onPostCommitFiberRoot=="function")try{qr.onPostCommitFiberRoot(gu,s)}catch{}m=!0}return m}finally{Ot=u,vr.transition=a}}return!1}function Sg(s,a,u){a=Fa(u,a),a=Wy(s,a,1),s=Qs(s,a,1),a=Un(),s!==null&&(Li(s,1,a),Kn(s,a))}function rn(s,a,u){if(s.tag===3)Sg(s,s,u);else for(;a!==null;){if(a.tag===3){Sg(a,s,u);break}else if(a.tag===1){var m=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Ks===null||!Ks.has(m))){s=Fa(u,s),s=Yy(a,s,1),a=Qs(a,s,1),s=Un(),a!==null&&(Li(a,1,s),Kn(a,s));break}}a=a.return}}function Ow(s,a,u){var m=s.pingCache;m!==null&&m.delete(a),a=Un(),s.pingedLanes|=s.suspendedLanes&u,En===s&&(_n&u)===u&&(xn===4||xn===3&&(_n&130023424)===_n&&500>jt()-hh?Bo(s,0):fh|=u),Kn(s,a)}function Cg(s,a){a===0&&((s.mode&1)===0?a=1:(a=xu,xu<<=1,(xu&130023424)===0&&(xu=4194304)));var u=Un();s=gs(s,a),s!==null&&(Li(s,a,u),Kn(s,u))}function Aw(s){var a=s.memoizedState,u=0;a!==null&&(u=a.retryLane),Cg(s,u)}function Iw(s,a){var u=0;switch(s.tag){case 13:var m=s.stateNode,x=s.memoizedState;x!==null&&(u=x.retryLane);break;case 19:m=s.stateNode;break;default:throw Error(n(314))}m!==null&&m.delete(a),Cg(s,u)}var _g;_g=function(s,a,u){if(s!==null)if(s.memoizedProps!==a.pendingProps||qn.current)Qn=!0;else{if((s.lanes&u)===0&&(a.flags&128)===0)return Qn=!1,xw(s,a,u);Qn=(s.flags&131072)!==0}else Qn=!1,qt&&(a.flags&1048576)!==0&&ay(a,Uu,a.index);switch(a.lanes=0,a.tag){case 2:var m=a.type;nc(s,a),s=a.pendingProps;var x=Oa(a,An.current);Pa(a,u),x=Yf(null,a,m,s,x,u);var w=$f();return a.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,Vn(m)?(w=!0,Fu(a)):w=!1,a.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,jf(a),x.updater=ec,a.stateNode=x,x._reactInternals=a,Xf(a,m,s,u),a=th(null,a,m,!0,w,u)):(a.tag=0,qt&&w&&_f(a),Hn(null,a,x,u),a=a.child),a;case 16:m=a.elementType;e:{switch(nc(s,a),s=a.pendingProps,x=m._init,m=x(m._payload),a.type=m,x=a.tag=Lw(m),s=Mr(m,s),x){case 0:a=eh(null,a,m,s,u);break e;case 1:a=Zy(null,a,m,s,u);break e;case 11:a=Qy(null,a,m,s,u);break e;case 14:a=Gy(null,a,m,Mr(m.type,s),u);break e}throw Error(n(306,m,""))}return a;case 0:return m=a.type,x=a.pendingProps,x=a.elementType===m?x:Mr(m,x),eh(s,a,m,x,u);case 1:return m=a.type,x=a.pendingProps,x=a.elementType===m?x:Mr(m,x),Zy(s,a,m,x,u);case 3:e:{if(eg(a),s===null)throw Error(n(387));m=a.pendingProps,w=a.memoizedState,x=w.element,py(s,a),Vu(a,m,null,u);var R=a.memoizedState;if(m=R.element,w.isDehydrated)if(w={element:m,isDehydrated:!1,cache:R.cache,pendingSuspenseBoundaries:R.pendingSuspenseBoundaries,transitions:R.transitions},a.updateQueue.baseState=w,a.memoizedState=w,a.flags&256){x=Fa(Error(n(423)),a),a=tg(s,a,m,u,x);break e}else if(m!==x){x=Fa(Error(n(424)),a),a=tg(s,a,m,u,x);break e}else for(ir=Ws(a.stateNode.containerInfo.firstChild),ar=a,qt=!0,Ir=null,u=hy(a,null,m,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Ma(),m===x){a=xs(s,a,u);break e}Hn(s,a,m,u)}a=a.child}return a;case 5:return by(a),s===null&&Of(a),m=a.type,x=a.pendingProps,w=s!==null?s.memoizedProps:null,R=x.children,Ef(m,x)?R=null:w!==null&&Ef(m,w)&&(a.flags|=32),Jy(s,a),Hn(s,a,R,u),a.child;case 6:return s===null&&Of(a),null;case 13:return ng(s,a,u);case 4:return Ff(a,a.stateNode.containerInfo),m=a.pendingProps,s===null?a.child=La(a,null,m,u):Hn(s,a,m,u),a.child;case 11:return m=a.type,x=a.pendingProps,x=a.elementType===m?x:Mr(m,x),Qy(s,a,m,x,u);case 7:return Hn(s,a,a.pendingProps,u),a.child;case 8:return Hn(s,a,a.pendingProps.children,u),a.child;case 12:return Hn(s,a,a.pendingProps.children,u),a.child;case 10:e:{if(m=a.type._context,x=a.pendingProps,w=a.memoizedProps,R=x.value,Ft(Yu,m._currentValue),m._currentValue=R,w!==null)if(Ar(w.value,R)){if(w.children===x.children&&!qn.current){a=xs(s,a,u);break e}}else for(w=a.child,w!==null&&(w.return=a);w!==null;){var q=w.dependencies;if(q!==null){R=w.child;for(var K=q.firstContext;K!==null;){if(K.context===m){if(w.tag===1){K=bs(-1,u&-u),K.tag=2;var ue=w.updateQueue;if(ue!==null){ue=ue.shared;var ve=ue.pending;ve===null?K.next=K:(K.next=ve.next,ve.next=K),ue.pending=K}}w.lanes|=u,K=w.alternate,K!==null&&(K.lanes|=u),Rf(w.return,u,a),q.lanes|=u;break}K=K.next}}else if(w.tag===10)R=w.type===a.type?null:w.child;else if(w.tag===18){if(R=w.return,R===null)throw Error(n(341));R.lanes|=u,q=R.alternate,q!==null&&(q.lanes|=u),Rf(R,u,a),R=w.sibling}else R=w.child;if(R!==null)R.return=w;else for(R=w;R!==null;){if(R===a){R=null;break}if(w=R.sibling,w!==null){w.return=R.return,R=w;break}R=R.return}w=R}Hn(s,a,x.children,u),a=a.child}return a;case 9:return x=a.type,m=a.pendingProps.children,Pa(a,u),x=br(x),m=m(x),a.flags|=1,Hn(s,a,m,u),a.child;case 14:return m=a.type,x=Mr(m,a.pendingProps),x=Mr(m.type,x),Gy(s,a,m,x,u);case 15:return Ky(s,a,a.type,a.pendingProps,u);case 17:return m=a.type,x=a.pendingProps,x=a.elementType===m?x:Mr(m,x),nc(s,a),a.tag=1,Vn(m)?(s=!0,Fu(a)):s=!1,Pa(a,u),Uy(a,m,x),Xf(a,m,x,u),th(null,a,m,!0,s,u);case 19:return sg(s,a,u);case 22:return Xy(s,a,u)}throw Error(n(156,a.tag))};function Ng(s,a){return No(s,a)}function Mw(s,a,u,m){this.tag=s,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=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(s,a,u,m){return new Mw(s,a,u,m)}function Eh(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Lw(s){if(typeof s=="function")return Eh(s)?1:0;if(s!=null){if(s=s.$$typeof,s===H)return 11;if(s===Q)return 14}return 2}function eo(s,a){var u=s.alternate;return u===null?(u=Er(s.tag,a,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=a,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&14680064,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,a=s.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u}function hc(s,a,u,m,x,w){var R=2;if(m=s,typeof s=="function")Eh(s)&&(R=1);else if(typeof s=="string")R=5;else e:switch(s){case S:return Uo(u.children,x,w,a);case I:R=8,x|=8;break;case P:return s=Er(12,u,a,x|2),s.elementType=P,s.lanes=w,s;case W:return s=Er(13,u,a,x),s.elementType=W,s.lanes=w,s;case $:return s=Er(19,u,a,x),s.elementType=$,s.lanes=w,s;case me:return mc(u,x,w,a);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case U:R=10;break e;case F:R=9;break e;case H:R=11;break e;case Q:R=14;break e;case ne:R=16,m=null;break e}throw Error(n(130,s==null?s:typeof s,""))}return a=Er(R,u,a,x),a.elementType=s,a.type=m,a.lanes=w,a}function Uo(s,a,u,m){return s=Er(7,s,m,a),s.lanes=u,s}function mc(s,a,u,m){return s=Er(22,s,m,a),s.elementType=me,s.lanes=u,s.stateNode={isHidden:!1},s}function Th(s,a,u){return s=Er(6,s,null,a),s.lanes=u,s}function wh(s,a,u){return a=Er(4,s.children!==null?s.children:[],s.key,a),a.lanes=u,a.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},a}function Rw(s,a,u,m,x){this.tag=a,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gd(0),this.expirationTimes=Gd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gd(0),this.identifierPrefix=m,this.onRecoverableError=x,this.mutableSourceEagerHydrationData=null}function kh(s,a,u,m,x,w,R,q,K){return s=new Rw(s,a,u,q,K),a===1?(a=1,w===!0&&(a|=8)):a=0,w=Er(3,null,null,a),s.current=w,w.stateNode=s,w.memoizedState={element:m,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},jf(w),s}function Pw(s,a,u){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_,key:m==null?null:""+m,children:s,containerInfo:a,implementation:u}}function Dg(s){if(!s)return $s;s=s._reactInternals;e:{if(Rt(s)!==s||s.tag!==1)throw Error(n(170));var a=s;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(Vn(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(n(171))}if(s.tag===1){var u=s.type;if(Vn(u))return ry(s,u,a)}return a}function Og(s,a,u,m,x,w,R,q,K){return s=kh(u,m,!0,s,x,w,R,q,K),s.context=Dg(null),u=s.current,m=Un(),x=Js(u),w=bs(m,x),w.callback=a??null,Qs(u,w,x),s.current.lanes=x,Li(s,x,m),Kn(s,m),s}function pc(s,a,u,m){var x=a.current,w=Un(),R=Js(x);return u=Dg(u),a.context===null?a.context=u:a.pendingContext=u,a=bs(w,R),a.payload={element:s},m=m===void 0?null:m,m!==null&&(a.callback=m),s=Qs(x,a,R),s!==null&&(Pr(s,x,R,w),qu(s,x,R)),R}function yc(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function Ag(s,a){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<a?u:a}}function Sh(s,a){Ag(s,a),(s=s.alternate)&&Ag(s,a)}function jw(){return null}var Ig=typeof reportError=="function"?reportError:function(s){console.error(s)};function Ch(s){this._internalRoot=s}gc.prototype.render=Ch.prototype.render=function(s){var a=this._internalRoot;if(a===null)throw Error(n(409));pc(s,a,null,null)},gc.prototype.unmount=Ch.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var a=s.containerInfo;Fo(function(){pc(null,s,null,null)}),a[hs]=null}};function gc(s){this._internalRoot=s}gc.prototype.unstable_scheduleHydration=function(s){if(s){var a=pp();s={blockedOn:null,target:s,priority:a};for(var u=0;u<Hs.length&&a!==0&&a<Hs[u].priority;u++);Hs.splice(u,0,s),u===0&&bp(s)}};function _h(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function bc(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function Mg(){}function Fw(s,a,u,m,x){if(x){if(typeof m=="function"){var w=m;m=function(){var ue=yc(R);w.call(ue)}}var R=Og(a,m,s,0,null,!1,!1,"",Mg);return s._reactRootContainer=R,s[hs]=R.current,Qi(s.nodeType===8?s.parentNode:s),Fo(),R}for(;x=s.lastChild;)s.removeChild(x);if(typeof m=="function"){var q=m;m=function(){var ue=yc(K);q.call(ue)}}var K=kh(s,0,!1,null,null,!1,!1,"",Mg);return s._reactRootContainer=K,s[hs]=K.current,Qi(s.nodeType===8?s.parentNode:s),Fo(function(){pc(a,K,u,m)}),K}function xc(s,a,u,m,x){var w=u._reactRootContainer;if(w){var R=w;if(typeof x=="function"){var q=x;x=function(){var K=yc(R);q.call(K)}}pc(a,R,s,x)}else R=Fw(u,a,s,x,m);return yc(R)}hp=function(s){switch(s.tag){case 3:var a=s.stateNode;if(a.current.memoizedState.isDehydrated){var u=Mi(a.pendingLanes);u!==0&&(Kd(a,u|1),Kn(a,jt()),(vt&6)===0&&(Ua=jt()+500,qs()))}break;case 13:Fo(function(){var m=gs(s,1);if(m!==null){var x=Un();Pr(m,s,1,x)}}),Sh(s,1)}},Xd=function(s){if(s.tag===13){var a=gs(s,134217728);if(a!==null){var u=Un();Pr(a,s,134217728,u)}Sh(s,134217728)}},mp=function(s){if(s.tag===13){var a=Js(s),u=gs(s,a);if(u!==null){var m=Un();Pr(u,s,a,m)}Sh(s,a)}},pp=function(){return Ot},yp=function(s,a){var u=Ot;try{return Ot=s,a()}finally{Ot=u}},Ge=function(s,a,u){switch(a){case"input":if(Te(s,u),a=u.name,u.type==="radio"&&a!=null){for(u=s;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!==s&&m.form===s.form){var x=Pu(m);if(!x)throw Error(n(90));Fe(m),Te(m,x)}}}break;case"textarea":pt(s,u);break;case"select":a=u.value,a!=null&&ge(s,!!u.multiple,a,!1)}},Yt=bh,en=Fo;var Bw={usingClientEntryPoint:!1,Events:[Xi,Na,Pu,ft,Ue,bh]},dl={findFiberByHostInstance:Oo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Hw={bundleType:dl.bundleType,version:dl.version,rendererPackageName:dl.rendererPackageName,rendererConfig:dl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=pr(s),s===null?null:s.stateNode},findFiberByHostInstance:dl.findFiberByHostInstance||jw,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 vc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vc.isDisabled&&vc.supportsFiber)try{gu=vc.inject(Hw),qr=vc}catch{}}return Xn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Bw,Xn.createPortal=function(s,a){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_h(a))throw Error(n(200));return Pw(s,a,null,u)},Xn.createRoot=function(s,a){if(!_h(s))throw Error(n(299));var u=!1,m="",x=Ig;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onRecoverableError!==void 0&&(x=a.onRecoverableError)),a=kh(s,1,!1,null,null,u,!1,m,x),s[hs]=a.current,Qi(s.nodeType===8?s.parentNode:s),new Ch(a)},Xn.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var a=s._reactInternals;if(a===void 0)throw typeof s.render=="function"?Error(n(188)):(s=Object.keys(s).join(","),Error(n(268,s)));return s=pr(a),s=s===null?null:s.stateNode,s},Xn.flushSync=function(s){return Fo(s)},Xn.hydrate=function(s,a,u){if(!bc(a))throw Error(n(200));return xc(null,s,a,!0,u)},Xn.hydrateRoot=function(s,a,u){if(!_h(s))throw Error(n(405));var m=u!=null&&u.hydratedSources||null,x=!1,w="",R=Ig;if(u!=null&&(u.unstable_strictMode===!0&&(x=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(R=u.onRecoverableError)),a=Og(a,null,s,1,u??null,x,!1,w,R),s[hs]=a.current,Qi(s),m)for(s=0;s<m.length;s++)u=m[s],x=u._getVersion,x=x(u._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[u,x]:a.mutableSourceEagerHydrationData.push(u,x);return new gc(a)},Xn.render=function(s,a,u){if(!bc(a))throw Error(n(200));return xc(null,s,a,!1,u)},Xn.unmountComponentAtNode=function(s){if(!bc(s))throw Error(n(40));return s._reactRootContainer?(Fo(function(){xc(null,null,s,!1,function(){s._reactRootContainer=null,s[hs]=null})}),!0):!1},Xn.unstable_batchedUpdates=bh,Xn.unstable_renderSubtreeIntoContainer=function(s,a,u,m){if(!bc(u))throw Error(n(200));if(s==null||s._reactInternals===void 0)throw Error(n(38));return xc(s,a,u,!1,m)},Xn.version="18.3.1-next-f1338f8080-20240426",Xn}var Hg;function dd(){if(Hg)return Oh.exports;Hg=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(),Oh.exports=Gw(),Oh.exports}var Ug;function Kw(){if(Ug)return Tc;Ug=1;var e=dd();return Tc.createRoot=e.createRoot,Tc.hydrateRoot=e.hydrateRoot,Tc}var Xw=Kw(),ha=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(){}},Jw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},uo,rm,ix,Zw=(ix=class{constructor(){je(this,uo,Jw);je(this,rm,!1)}setTimeoutProvider(e){De(this,uo,e)}setTimeout(e,t){return Y(this,uo).setTimeout(e,t)}clearTimeout(e){Y(this,uo).clearTimeout(e)}setInterval(e,t){return Y(this,uo).setInterval(e,t)}clearInterval(e){Y(this,uo).clearInterval(e)}},uo=new WeakMap,rm=new WeakMap,ix),$o=new Zw;function ek(e){setTimeout(e,0)}var aa=typeof window>"u"||"Deno"in globalThis;function Pn(){}function tk(e,t){return typeof e=="function"?e(t):e}function f0(e){return typeof e=="number"&&e>=0&&e!==1/0}function vx(e,t){return Math.max(e+(t||0)-Date.now(),0)}function To(e,t){return typeof e=="function"?e(t):e}function Cr(e,t){return typeof e=="function"?e(t):e}function zg(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==sm(l,t.options))return!1}else if(!Yl(t.queryKey,l))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||o&&o!==t.state.fetchStatus||i&&!i(t))}function Wg(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ia(t.options.mutationKey)!==ia(i))return!1}else if(!Yl(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function sm(e,t){return((t==null?void 0:t.queryKeyHashFn)||ia)(e)}function ia(e){return JSON.stringify(e,(t,n)=>h0(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Yl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Yl(e[n],t[n])):!1}var nk=Object.prototype.hasOwnProperty;function om(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Yg(e)&&Yg(t);if(!r&&!(h0(e)&&h0(t)))return t;const i=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,d=r?new Array(c):{};let h=0;for(let p=0;p<c;p++){const y=r?p:l[p],b=e[y],v=t[y];if(b===v){d[y]=b,(r?p<i:nk.call(e,y))&&h++;continue}if(b===null||v===null||typeof b!="object"||typeof v!="object"){d[y]=v;continue}const D=om(b,v,n+1);d[y]=D,D===b&&h++}return i===c&&h===i?e:d}function $l(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 Yg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function h0(e){if(!$g(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!$g(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function $g(e){return Object.prototype.toString.call(e)==="[object Object]"}function rk(e){return new Promise(t=>{$o.setTimeout(t,e)})}function m0(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?om(e,t):t}function sk(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function ok(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var am=Symbol();function Ex(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===am?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function im(e,t){return typeof e=="function"?e(...t):!!e}function ak(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var Go,co,Za,lx,ik=(lx=class extends ha{constructor(){super();je(this,Go);je(this,co);je(this,Za);De(this,Za,t=>{if(!aa&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Y(this,co)||this.setEventListener(Y(this,Za))}onUnsubscribe(){var t;this.hasListeners()||((t=Y(this,co))==null||t.call(this),De(this,co,void 0))}setEventListener(t){var n;De(this,Za,t),(n=Y(this,co))==null||n.call(this),De(this,co,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Y(this,Go)!==t&&(De(this,Go,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Y(this,Go)=="boolean"?Y(this,Go):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Go=new WeakMap,co=new WeakMap,Za=new WeakMap,lx),lm=new ik;function p0(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var lk=ek;function uk(){let e=[],t=0,n=c=>{c()},r=c=>{c()},o=lk;const i=c=>{t?e.push(c):o(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&o(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||l()}return d},batchCalls:c=>(...d)=>{i(()=>{c(...d)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{o=c}}}var Xt=uk(),ei,fo,ti,ux,ck=(ux=class extends ha{constructor(){super();je(this,ei,!0);je(this,fo);je(this,ti);De(this,ti,t=>{if(!aa&&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(){Y(this,fo)||this.setEventListener(Y(this,ti))}onUnsubscribe(){var t;this.hasListeners()||((t=Y(this,fo))==null||t.call(this),De(this,fo,void 0))}setEventListener(t){var n;De(this,ti,t),(n=Y(this,fo))==null||n.call(this),De(this,fo,t(this.setOnline.bind(this)))}setOnline(t){Y(this,ei)!==t&&(De(this,ei,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Y(this,ei)}},ei=new WeakMap,fo=new WeakMap,ti=new WeakMap,ux),qc=new ck;function dk(e){return Math.min(1e3*2**e,3e4)}function Tx(e){return(e??"online")==="online"?qc.isOnline():!0}var y0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wx(e){let t=!1,n=0,r;const o=p0(),i=()=>o.status!=="pending",l=k=>{var E;if(!i()){const T=new y0(k);b(T),(E=e.onCancel)==null||E.call(e,T)}},c=()=>{t=!0},d=()=>{t=!1},h=()=>lm.isFocused()&&(e.networkMode==="always"||qc.isOnline())&&e.canRun(),p=()=>Tx(e.networkMode)&&e.canRun(),y=k=>{i()||(r==null||r(),o.resolve(k))},b=k=>{i()||(r==null||r(),o.reject(k))},v=()=>new Promise(k=>{var E;r=T=>{(i()||h())&&k(T)},(E=e.onPause)==null||E.call(e)}).then(()=>{var k;r=void 0,i()||(k=e.onContinue)==null||k.call(e)}),D=()=>{if(i())return;let k;const E=n===0?e.initialPromise:void 0;try{k=E??e.fn()}catch(T){k=Promise.reject(T)}Promise.resolve(k).then(y).catch(T=>{var _;if(i())return;const C=e.retry??(aa?0:3),O=e.retryDelay??dk,A=typeof O=="function"?O(n,T):O,L=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,T);if(t||!L){b(T);return}n++,(_=e.onFail)==null||_.call(e,n,T),rk(A).then(()=>h()?void 0:v()).then(()=>{t?b(T):D()})})};return{promise:o,status:()=>o.status,cancel:l,continue:()=>(r==null||r(),o),cancelRetry:c,continueRetry:d,canStart:p,start:()=>(p()?D():v().then(D),o)}}var Ko,cx,kx=(cx=class{constructor(){je(this,Ko)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),f0(this.gcTime)&&De(this,Ko,$o.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(aa?1/0:300*1e3))}clearGcTimeout(){Y(this,Ko)&&($o.clearTimeout(Y(this,Ko)),De(this,Ko,void 0))}},Ko=new WeakMap,cx),Xo,ni,wr,Jo,kn,Kl,Zo,Br,Ts,dx,fk=(dx=class extends kx{constructor(t){super();je(this,Br);je(this,Xo);je(this,ni);je(this,wr);je(this,Jo);je(this,kn);je(this,Kl);je(this,Zo);De(this,Zo,!1),De(this,Kl,t.defaultOptions),this.setOptions(t.options),this.observers=[],De(this,Jo,t.client),De(this,wr,Y(this,Jo).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,De(this,Xo,Vg(this.options)),this.state=t.state??Y(this,Xo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=Y(this,kn))==null?void 0:t.promise}setOptions(t){if(this.options={...Y(this,Kl),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Vg(this.options);n.data!==void 0&&(this.setState(qg(n.data,n.dataUpdatedAt)),De(this,Xo,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Y(this,wr).remove(this)}setData(t,n){const r=m0(this.state.data,t,this.options);return rt(this,Br,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){rt(this,Br,Ts).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=Y(this,kn))==null?void 0:r.promise;return(o=Y(this,kn))==null||o.cancel(t),n?n.then(Pn).catch(Pn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Y(this,Xo))}isActive(){return this.observers.some(t=>Cr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===am||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>To(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:!vx(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Y(this,kn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Y(this,kn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Y(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||(Y(this,kn)&&(Y(this,Zo)?Y(this,kn).cancel({revert:!0}):Y(this,kn).cancelRetry()),this.scheduleGc()),Y(this,wr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||rt(this,Br,Ts).call(this,{type:"invalidate"})}async fetch(t,n){var d,h,p,y,b,v,D,k,E,T,C,O;if(this.state.fetchStatus!=="idle"&&((d=Y(this,kn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Y(this,kn))return Y(this,kn).continueRetry(),Y(this,kn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const A=this.observers.find(L=>L.options.queryFn);A&&this.setOptions(A.options)}const r=new AbortController,o=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(De(this,Zo,!0),r.signal)})},i=()=>{const A=Ex(this.options,n),_=(()=>{const S={client:Y(this,Jo),queryKey:this.queryKey,meta:this.meta};return o(S),S})();return De(this,Zo,!1),this.options.persister?this.options.persister(A,_,this):A(_)},c=(()=>{const A={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Y(this,Jo),state:this.state,fetchFn:i};return o(A),A})();(h=this.options.behavior)==null||h.onFetch(c,this),De(this,ni,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=c.fetchOptions)==null?void 0:p.meta))&&rt(this,Br,Ts).call(this,{type:"fetch",meta:(y=c.fetchOptions)==null?void 0:y.meta}),De(this,kn,wx({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:A=>{A instanceof y0&&A.revert&&this.setState({...Y(this,ni),fetchStatus:"idle"}),r.abort()},onFail:(A,L)=>{rt(this,Br,Ts).call(this,{type:"failed",failureCount:A,error:L})},onPause:()=>{rt(this,Br,Ts).call(this,{type:"pause"})},onContinue:()=>{rt(this,Br,Ts).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const A=await Y(this,kn).start();if(A===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(A),(v=(b=Y(this,wr).config).onSuccess)==null||v.call(b,A,this),(k=(D=Y(this,wr).config).onSettled)==null||k.call(D,A,this.state.error,this),A}catch(A){if(A instanceof y0){if(A.silent)return Y(this,kn).promise;if(A.revert){if(this.state.data===void 0)throw A;return this.state.data}}throw rt(this,Br,Ts).call(this,{type:"error",error:A}),(T=(E=Y(this,wr).config).onError)==null||T.call(E,A,this),(O=(C=Y(this,wr).config).onSettled)==null||O.call(C,this.state.data,A,this),A}finally{this.scheduleGc()}}},Xo=new WeakMap,ni=new WeakMap,wr=new WeakMap,Jo=new WeakMap,kn=new WeakMap,Kl=new WeakMap,Zo=new WeakMap,Br=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,...Sx(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...qg(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return De(this,ni,t.manual?o:void 0),o;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()}),Y(this,wr).notify({query:this,type:"updated",action:t})})},dx);function Sx(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Tx(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function qg(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Vg(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 er,bt,Xl,zn,ea,ri,Ss,ho,Jl,si,oi,ta,na,mo,ai,Nt,Al,g0,b0,x0,v0,E0,T0,w0,Cx,fx,um=(fx=class extends ha{constructor(t,n){super();je(this,Nt);je(this,er);je(this,bt);je(this,Xl);je(this,zn);je(this,ea);je(this,ri);je(this,Ss);je(this,ho);je(this,Jl);je(this,si);je(this,oi);je(this,ta);je(this,na);je(this,mo);je(this,ai,new Set);this.options=n,De(this,er,t),De(this,ho,null),De(this,Ss,p0()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Y(this,bt).addObserver(this),Qg(Y(this,bt),this.options)?rt(this,Nt,Al).call(this):this.updateResult(),rt(this,Nt,v0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return k0(Y(this,bt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return k0(Y(this,bt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,rt(this,Nt,E0).call(this),rt(this,Nt,T0).call(this),Y(this,bt).removeObserver(this)}setOptions(t){const n=this.options,r=Y(this,bt);if(this.options=Y(this,er).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Cr(this.options.enabled,Y(this,bt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");rt(this,Nt,w0).call(this),Y(this,bt).setOptions(this.options),n._defaulted&&!$l(this.options,n)&&Y(this,er).getQueryCache().notify({type:"observerOptionsUpdated",query:Y(this,bt),observer:this});const o=this.hasListeners();o&&Gg(Y(this,bt),r,this.options,n)&&rt(this,Nt,Al).call(this),this.updateResult(),o&&(Y(this,bt)!==r||Cr(this.options.enabled,Y(this,bt))!==Cr(n.enabled,Y(this,bt))||To(this.options.staleTime,Y(this,bt))!==To(n.staleTime,Y(this,bt)))&&rt(this,Nt,g0).call(this);const i=rt(this,Nt,b0).call(this);o&&(Y(this,bt)!==r||Cr(this.options.enabled,Y(this,bt))!==Cr(n.enabled,Y(this,bt))||i!==Y(this,mo))&&rt(this,Nt,x0).call(this,i)}getOptimisticResult(t){const n=Y(this,er).getQueryCache().build(Y(this,er),t),r=this.createResult(n,t);return mk(this,r)&&(De(this,zn,r),De(this,ri,this.options),De(this,ea,Y(this,bt).state)),r}getCurrentResult(){return Y(this,zn)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&Y(this,Ss).status==="pending"&&Y(this,Ss).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,o))})}trackProp(t){Y(this,ai).add(t)}getCurrentQuery(){return Y(this,bt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Y(this,er).defaultQueryOptions(t),r=Y(this,er).getQueryCache().build(Y(this,er),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return rt(this,Nt,Al).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Y(this,zn)))}createResult(t,n){var P;const r=Y(this,bt),o=this.options,i=Y(this,zn),l=Y(this,ea),c=Y(this,ri),h=t!==r?t.state:Y(this,Xl),{state:p}=t;let y={...p},b=!1,v;if(n._optimisticResults){const U=this.hasListeners(),F=!U&&Qg(t,n),H=U&&Gg(t,r,n,o);(F||H)&&(y={...y,...Sx(p.data,t.options)}),n._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:D,errorUpdatedAt:k,status:E}=y;v=y.data;let T=!1;if(n.placeholderData!==void 0&&v===void 0&&E==="pending"){let U;i!=null&&i.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(U=i.data,T=!0):U=typeof n.placeholderData=="function"?n.placeholderData((P=Y(this,oi))==null?void 0:P.state.data,Y(this,oi)):n.placeholderData,U!==void 0&&(E="success",v=m0(i==null?void 0:i.data,U,n),b=!0)}if(n.select&&v!==void 0&&!T)if(i&&v===(l==null?void 0:l.data)&&n.select===Y(this,Jl))v=Y(this,si);else try{De(this,Jl,n.select),v=n.select(v),v=m0(i==null?void 0:i.data,v,n),De(this,si,v),De(this,ho,null)}catch(U){De(this,ho,U)}Y(this,ho)&&(D=Y(this,ho),v=Y(this,si),k=Date.now(),E="error");const C=y.fetchStatus==="fetching",O=E==="pending",A=E==="error",L=O&&C,_=v!==void 0,I={status:E,fetchStatus:y.fetchStatus,isPending:O,isSuccess:E==="success",isError:A,isInitialLoading:L,isLoading:L,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:C,isRefetching:C&&!O,isLoadingError:A&&!_,isPaused:y.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:A&&_,isStale:cm(t,n),refetch:this.refetch,promise:Y(this,Ss),isEnabled:Cr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const U=I.data!==void 0,F=I.status==="error"&&!U,H=Q=>{F?Q.reject(I.error):U&&Q.resolve(I.data)},W=()=>{const Q=De(this,Ss,I.promise=p0());H(Q)},$=Y(this,Ss);switch($.status){case"pending":t.queryHash===r.queryHash&&H($);break;case"fulfilled":(F||I.data!==$.value)&&W();break;case"rejected":(!F||I.error!==$.reason)&&W();break}}return I}updateResult(){const t=Y(this,zn),n=this.createResult(Y(this,bt),this.options);if(De(this,ea,Y(this,bt).state),De(this,ri,this.options),Y(this,ea).data!==void 0&&De(this,oi,Y(this,bt)),$l(n,t))return;De(this,zn,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,i=typeof o=="function"?o():o;if(i==="all"||!i&&!Y(this,ai).size)return!0;const l=new Set(i??Y(this,ai));return this.options.throwOnError&&l.add("error"),Object.keys(Y(this,zn)).some(c=>{const d=c;return Y(this,zn)[d]!==t[d]&&l.has(d)})};rt(this,Nt,Cx).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&rt(this,Nt,v0).call(this)}},er=new WeakMap,bt=new WeakMap,Xl=new WeakMap,zn=new WeakMap,ea=new WeakMap,ri=new WeakMap,Ss=new WeakMap,ho=new WeakMap,Jl=new WeakMap,si=new WeakMap,oi=new WeakMap,ta=new WeakMap,na=new WeakMap,mo=new WeakMap,ai=new WeakMap,Nt=new WeakSet,Al=function(t){rt(this,Nt,w0).call(this);let n=Y(this,bt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Pn)),n},g0=function(){rt(this,Nt,E0).call(this);const t=To(this.options.staleTime,Y(this,bt));if(aa||Y(this,zn).isStale||!f0(t))return;const r=vx(Y(this,zn).dataUpdatedAt,t)+1;De(this,ta,$o.setTimeout(()=>{Y(this,zn).isStale||this.updateResult()},r))},b0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Y(this,bt)):this.options.refetchInterval)??!1},x0=function(t){rt(this,Nt,T0).call(this),De(this,mo,t),!(aa||Cr(this.options.enabled,Y(this,bt))===!1||!f0(Y(this,mo))||Y(this,mo)===0)&&De(this,na,$o.setInterval(()=>{(this.options.refetchIntervalInBackground||lm.isFocused())&&rt(this,Nt,Al).call(this)},Y(this,mo)))},v0=function(){rt(this,Nt,g0).call(this),rt(this,Nt,x0).call(this,rt(this,Nt,b0).call(this))},E0=function(){Y(this,ta)&&($o.clearTimeout(Y(this,ta)),De(this,ta,void 0))},T0=function(){Y(this,na)&&($o.clearInterval(Y(this,na)),De(this,na,void 0))},w0=function(){const t=Y(this,er).getQueryCache().build(Y(this,er),this.options);if(t===Y(this,bt))return;const n=Y(this,bt);De(this,bt,t),De(this,Xl,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Cx=function(t){Xt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Y(this,zn))}),Y(this,er).getQueryCache().notify({query:Y(this,bt),type:"observerResultsUpdated"})})},fx);function hk(e,t){return Cr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Qg(e,t){return hk(e,t)||e.state.data!==void 0&&k0(e,t,t.refetchOnMount)}function k0(e,t,n){if(Cr(t.enabled,e)!==!1&&To(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&cm(e,t)}return!1}function Gg(e,t,n,r){return(e!==t||Cr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&cm(e,n)}function cm(e,t){return Cr(t.enabled,e)!==!1&&e.isStaleByTime(To(t.staleTime,e))}function mk(e,t){return!$l(e.getCurrentResult(),t)}function Kg(e){return{onFetch:(t,n)=>{var p,y,b,v,D;const r=t.options,o=(b=(y=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:y.fetchMore)==null?void 0:b.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:[]},d=0;const h=async()=>{let k=!1;const E=O=>{ak(O,()=>t.signal,()=>k=!0)},T=Ex(t.options,t.fetchOptions),C=async(O,A,L)=>{if(k)return Promise.reject();if(A==null&&O.pages.length)return Promise.resolve(O);const S=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:A,direction:L?"backward":"forward",meta:t.options.meta};return E(F),F})(),I=await T(S),{maxPages:P}=t.options,U=L?ok:sk;return{pages:U(O.pages,I,P),pageParams:U(O.pageParams,A,P)}};if(o&&i.length){const O=o==="backward",A=O?pk:Xg,L={pages:i,pageParams:l},_=A(r,L);c=await C(L,_,O)}else{const O=e??i.length;do{const A=d===0?l[0]??r.initialPageParam:Xg(r,c);if(d>0&&A==null)break;c=await C(c,A),d++}while(d<O)}return c};t.options.persister?t.fetchFn=()=>{var k,E;return(E=(k=t.options).persister)==null?void 0:E.call(k,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function Xg(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 pk(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 Zl,es,Rn,ra,ts,ao,hx,yk=(hx=class extends kx{constructor(t){super();je(this,ts);je(this,Zl);je(this,es);je(this,Rn);je(this,ra);De(this,Zl,t.client),this.mutationId=t.mutationId,De(this,Rn,t.mutationCache),De(this,es,[]),this.state=t.state||_x(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Y(this,es).includes(t)||(Y(this,es).push(t),this.clearGcTimeout(),Y(this,Rn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){De(this,es,Y(this,es).filter(n=>n!==t)),this.scheduleGc(),Y(this,Rn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Y(this,es).length||(this.state.status==="pending"?this.scheduleGc():Y(this,Rn).remove(this))}continue(){var t;return((t=Y(this,ra))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,c,d,h,p,y,b,v,D,k,E,T,C,O,A,L,_,S;const n=()=>{rt(this,ts,ao).call(this,{type:"continue"})},r={client:Y(this,Zl),meta:this.options.meta,mutationKey:this.options.mutationKey};De(this,ra,wx({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(I,P)=>{rt(this,ts,ao).call(this,{type:"failed",failureCount:I,error:P})},onPause:()=>{rt(this,ts,ao).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Y(this,Rn).canRun(this)}));const o=this.state.status==="pending",i=!Y(this,ra).canStart();try{if(o)n();else{rt(this,ts,ao).call(this,{type:"pending",variables:t,isPaused:i}),Y(this,Rn).config.onMutate&&await Y(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&&rt(this,ts,ao).call(this,{type:"pending",context:P,variables:t,isPaused:i})}const I=await Y(this,ra).start();return await((h=(d=Y(this,Rn).config).onSuccess)==null?void 0:h.call(d,I,t,this.state.context,this,r)),await((y=(p=this.options).onSuccess)==null?void 0:y.call(p,I,t,this.state.context,r)),await((v=(b=Y(this,Rn).config).onSettled)==null?void 0:v.call(b,I,null,this.state.variables,this.state.context,this,r)),await((k=(D=this.options).onSettled)==null?void 0:k.call(D,I,null,t,this.state.context,r)),rt(this,ts,ao).call(this,{type:"success",data:I}),I}catch(I){try{await((T=(E=Y(this,Rn).config).onError)==null?void 0:T.call(E,I,t,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((O=(C=this.options).onError)==null?void 0:O.call(C,I,t,this.state.context,r))}catch(P){Promise.reject(P)}try{await((L=(A=Y(this,Rn).config).onSettled)==null?void 0:L.call(A,void 0,I,this.state.variables,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((S=(_=this.options).onSettled)==null?void 0:S.call(_,void 0,I,t,this.state.context,r))}catch(P){Promise.reject(P)}throw rt(this,ts,ao).call(this,{type:"error",error:I}),I}finally{Y(this,Rn).runNext(this)}}},Zl=new WeakMap,es=new WeakMap,Rn=new WeakMap,ra=new WeakMap,ts=new WeakSet,ao=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(()=>{Y(this,es).forEach(r=>{r.onMutationUpdate(t)}),Y(this,Rn).notify({mutation:this,type:"updated",action:t})})},hx);function _x(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Cs,Hr,eu,mx,gk=(mx=class extends ha{constructor(t={}){super();je(this,Cs);je(this,Hr);je(this,eu);this.config=t,De(this,Cs,new Set),De(this,Hr,new Map),De(this,eu,0)}build(t,n,r){const o=new yk({client:t,mutationCache:this,mutationId:++Ec(this,eu)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){Y(this,Cs).add(t);const n=wc(t);if(typeof n=="string"){const r=Y(this,Hr).get(n);r?r.push(t):Y(this,Hr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Y(this,Cs).delete(t)){const n=wc(t);if(typeof n=="string"){const r=Y(this,Hr).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&Y(this,Hr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=wc(t);if(typeof n=="string"){const r=Y(this,Hr).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=wc(t);if(typeof n=="string"){const o=(r=Y(this,Hr).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Xt.batch(()=>{Y(this,Cs).forEach(t=>{this.notify({type:"removed",mutation:t})}),Y(this,Cs).clear(),Y(this,Hr).clear()})}getAll(){return Array.from(Y(this,Cs))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Wg(n,r))}findAll(t={}){return this.getAll().filter(n=>Wg(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,Hr=new WeakMap,eu=new WeakMap,mx);function wc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var _s,po,tr,Ns,Is,Uc,S0,px,bk=(px=class extends ha{constructor(n,r){super();je(this,Is);je(this,_s);je(this,po);je(this,tr);je(this,Ns);De(this,_s,n),this.setOptions(r),this.bindMethods(),rt(this,Is,Uc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=Y(this,_s).defaultMutationOptions(n),$l(this.options,r)||Y(this,_s).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Y(this,tr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ia(r.mutationKey)!==ia(this.options.mutationKey)?this.reset():((o=Y(this,tr))==null?void 0:o.state.status)==="pending"&&Y(this,tr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=Y(this,tr))==null||n.removeObserver(this)}onMutationUpdate(n){rt(this,Is,Uc).call(this),rt(this,Is,S0).call(this,n)}getCurrentResult(){return Y(this,po)}reset(){var n;(n=Y(this,tr))==null||n.removeObserver(this),De(this,tr,void 0),rt(this,Is,Uc).call(this),rt(this,Is,S0).call(this)}mutate(n,r){var o;return De(this,Ns,r),(o=Y(this,tr))==null||o.removeObserver(this),De(this,tr,Y(this,_s).getMutationCache().build(Y(this,_s),this.options)),Y(this,tr).addObserver(this),Y(this,tr).execute(n)}},_s=new WeakMap,po=new WeakMap,tr=new WeakMap,Ns=new WeakMap,Is=new WeakSet,Uc=function(){var r;const n=((r=Y(this,tr))==null?void 0:r.state)??_x();De(this,po,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},S0=function(n){Xt.batch(()=>{var r,o,i,l,c,d,h,p;if(Y(this,Ns)&&this.hasListeners()){const y=Y(this,po).variables,b=Y(this,po).context,v={client:Y(this,_s),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(o=(r=Y(this,Ns)).onSuccess)==null||o.call(r,n.data,y,b,v)}catch(D){Promise.reject(D)}try{(l=(i=Y(this,Ns)).onSettled)==null||l.call(i,n.data,null,y,b,v)}catch(D){Promise.reject(D)}}else if((n==null?void 0:n.type)==="error"){try{(d=(c=Y(this,Ns)).onError)==null||d.call(c,n.error,y,b,v)}catch(D){Promise.reject(D)}try{(p=(h=Y(this,Ns)).onSettled)==null||p.call(h,void 0,n.error,y,b,v)}catch(D){Promise.reject(D)}}}this.listeners.forEach(y=>{y(Y(this,po))})})},px);function Jg(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function xk(e,t,n){const r=e.slice(0);return r[t]=n,r}var ii,cr,li,ui,kr,yo,tu,nu,ru,su,Nn,C0,_0,N0,D0,O0,yx,vk=(yx=class extends ha{constructor(t,n,r){super();je(this,Nn);je(this,ii);je(this,cr);je(this,li);je(this,ui);je(this,kr);je(this,yo);je(this,tu);je(this,nu);je(this,ru);je(this,su,[]);De(this,ii,t),De(this,ui,r),De(this,li,[]),De(this,kr,[]),De(this,cr,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&Y(this,kr).forEach(t=>{t.subscribe(n=>{rt(this,Nn,D0).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,Y(this,kr).forEach(t=>{t.destroy()})}setQueries(t,n){De(this,li,t),De(this,ui,n),Xt.batch(()=>{const r=Y(this,kr),o=rt(this,Nn,N0).call(this,Y(this,li));o.forEach(y=>y.observer.setOptions(y.defaultedQueryOptions));const i=o.map(y=>y.observer),l=i.map(y=>y.getCurrentResult()),c=r.length!==i.length,d=i.some((y,b)=>y!==r[b]),h=c||d,p=h?!0:l.some((y,b)=>{const v=Y(this,cr)[b];return!v||!$l(y,v)});!h&&!p||(h&&(De(this,su,o),De(this,kr,i)),De(this,cr,l),this.hasListeners()&&(h&&(Jg(r,i).forEach(y=>{y.destroy()}),Jg(i,r).forEach(y=>{y.subscribe(b=>{rt(this,Nn,D0).call(this,y,b)})})),rt(this,Nn,O0).call(this)))})}getCurrentResult(){return Y(this,cr)}getQueries(){return Y(this,kr).map(t=>t.getCurrentQuery())}getObservers(){return Y(this,kr)}getOptimisticResult(t,n){const r=rt(this,Nn,N0).call(this,t),o=r.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),i=r.map(l=>l.defaultedQueryOptions.queryHash);return[o,l=>rt(this,Nn,_0).call(this,l??o,n,i),()=>rt(this,Nn,C0).call(this,o,r)]}},ii=new WeakMap,cr=new WeakMap,li=new WeakMap,ui=new WeakMap,kr=new WeakMap,yo=new WeakMap,tu=new WeakMap,nu=new WeakMap,ru=new WeakMap,su=new WeakMap,Nn=new WeakSet,C0=function(t,n){return n.map((r,o)=>{const i=t[o];return r.defaultedQueryOptions.notifyOnChangeProps?i:r.observer.trackResult(i,l=>{n.forEach(c=>{c.observer.trackProp(l)})})})},_0=function(t,n,r){if(n){const o=Y(this,ru),i=r!==void 0&&o!==void 0&&(o.length!==r.length||r.some((l,c)=>l!==o[c]));return(!Y(this,yo)||Y(this,cr)!==Y(this,nu)||i||n!==Y(this,tu))&&(De(this,tu,n),De(this,nu,Y(this,cr)),r!==void 0&&De(this,ru,r),De(this,yo,om(Y(this,yo),n(t)))),Y(this,yo)}return t},N0=function(t){const n=new Map;Y(this,kr).forEach(o=>{const i=o.options.queryHash;if(!i)return;const l=n.get(i);l?l.push(o):n.set(i,[o])});const r=[];return t.forEach(o=>{var d;const i=Y(this,ii).defaultQueryOptions(o),c=((d=n.get(i.queryHash))==null?void 0:d.shift())??new um(Y(this,ii),i);r.push({defaultedQueryOptions:i,observer:c})}),r},D0=function(t,n){const r=Y(this,kr).indexOf(t);r!==-1&&(De(this,cr,xk(Y(this,cr),r,n)),rt(this,Nn,O0).call(this))},O0=function(){var t;if(this.hasListeners()){const n=Y(this,yo),r=rt(this,Nn,C0).call(this,Y(this,cr),Y(this,su)),o=rt(this,Nn,_0).call(this,r,(t=Y(this,ui))==null?void 0:t.combine);n!==o&&Xt.batch(()=>{this.listeners.forEach(i=>{i(Y(this,cr))})})}},yx),ns,gx,Ek=(gx=class extends ha{constructor(t={}){super();je(this,ns);this.config=t,De(this,ns,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??sm(o,n);let l=this.get(i);return l||(l=new fk({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(l)),l}add(t){Y(this,ns).has(t.queryHash)||(Y(this,ns).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Y(this,ns).get(t.queryHash);n&&(t.destroy(),n===t&&Y(this,ns).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Xt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Y(this,ns).get(t)}getAll(){return[...Y(this,ns).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>zg(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>zg(t,r)):n}notify(t){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()})})}},ns=new WeakMap,gx),sn,go,bo,ci,di,xo,fi,hi,bx,Tk=(bx=class{constructor(e={}){je(this,sn);je(this,go);je(this,bo);je(this,ci);je(this,di);je(this,xo);je(this,fi);je(this,hi);De(this,sn,e.queryCache||new Ek),De(this,go,e.mutationCache||new gk),De(this,bo,e.defaultOptions||{}),De(this,ci,new Map),De(this,di,new Map),De(this,xo,0)}mount(){Ec(this,xo)._++,Y(this,xo)===1&&(De(this,fi,lm.subscribe(async e=>{e&&(await this.resumePausedMutations(),Y(this,sn).onFocus())})),De(this,hi,qc.subscribe(async e=>{e&&(await this.resumePausedMutations(),Y(this,sn).onOnline())})))}unmount(){var e,t;Ec(this,xo)._--,Y(this,xo)===0&&((e=Y(this,fi))==null||e.call(this),De(this,fi,void 0),(t=Y(this,hi))==null||t.call(this),De(this,hi,void 0))}isFetching(e){return Y(this,sn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Y(this,go).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Y(this,sn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Y(this,sn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(To(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Y(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}),o=Y(this,sn).get(r.queryHash),i=o==null?void 0:o.state.data,l=tk(t,i);if(l!==void 0)return Y(this,sn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Xt.batch(()=>Y(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=Y(this,sn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Y(this,sn);Xt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Y(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(()=>Y(this,sn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Pn).catch(Pn)}invalidateQueries(e,t={}){return Xt.batch(()=>(Y(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(()=>Y(this,sn).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Pn)),o.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=Y(this,sn).build(this,t);return n.isStaleByTime(To(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=Kg(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pn).catch(Pn)}ensureInfiniteQueryData(e){return e.behavior=Kg(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return qc.isOnline()?Y(this,go).resumePausedMutations():Promise.resolve()}getQueryCache(){return Y(this,sn)}getMutationCache(){return Y(this,go)}getDefaultOptions(){return Y(this,bo)}setDefaultOptions(e){De(this,bo,e)}setQueryDefaults(e,t){Y(this,ci).set(ia(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Y(this,ci).values()],n={};return t.forEach(r=>{Yl(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){Y(this,di).set(ia(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Y(this,di).values()],n={};return t.forEach(r=>{Yl(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Y(this,bo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=sm(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===am&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Y(this,bo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Y(this,sn).clear(),Y(this,go).clear()}},sn=new WeakMap,go=new WeakMap,bo=new WeakMap,ci=new WeakMap,di=new WeakMap,xo=new WeakMap,fi=new WeakMap,hi=new WeakMap,bx),Nx=N.createContext(void 0),Wn=e=>{const t=N.useContext(Nx);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},wk=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(Nx.Provider,{value:e,children:t})),Dx=N.createContext(!1),Ox=()=>N.useContext(Dx);Dx.Provider;function kk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Sk=N.createContext(kk()),Ax=()=>N.useContext(Sk),Ix=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?im(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Mx=e=>{N.useEffect(()=>{e.clearReset()},[e])},Lx=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||im(n,[e.error,r])),Rx=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Px=(e,t)=>e.isLoading&&e.isFetching&&!t,A0=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Vc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Zg({queries:e,...t},n){const r=Wn(),o=Ox(),i=Ax(),l=N.useMemo(()=>e.map(k=>{const E=r.defaultQueryOptions(k);return E._optimisticResults=o?"isRestoring":"optimistic",E}),[e,r,o]);l.forEach(k=>{Rx(k);const E=r.getQueryCache().get(k.queryHash);Ix(k,i,E)}),Mx(i);const[c]=N.useState(()=>new vk(r,l,t)),[d,h,p]=c.getOptimisticResult(l,t.combine),y=!o&&t.subscribed!==!1;N.useSyncExternalStore(N.useCallback(k=>y?c.subscribe(Xt.batchCalls(k)):Pn,[c,y]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),N.useEffect(()=>{c.setQueries(l,t)},[l,t,c]);const v=d.some((k,E)=>A0(l[E],k))?d.flatMap((k,E)=>{const T=l[E];if(T){const C=new um(r,T);if(A0(T,k))return Vc(T,C,i);Px(k,o)&&Vc(T,C,i)}return[]}):[];if(v.length>0)throw Promise.all(v);const D=d.find((k,E)=>{const T=l[E];return T&&Lx({result:k,errorResetBoundary:i,throwOnError:T.throwOnError,query:r.getQueryCache().get(T.queryHash),suspense:T.suspense})});if(D!=null&&D.error)throw D.error;return h(p())}function Ck(e,t,n){var b,v,D,k;const r=Ox(),o=Ax(),i=Wn(),l=i.defaultQueryOptions(e);(v=(b=i.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||v.call(b,l);const c=i.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",Rx(l),Ix(l,o,c),Mx(o);const d=!i.getQueryCache().get(l.queryHash),[h]=N.useState(()=>new t(i,l)),p=h.getOptimisticResult(l),y=!r&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(E=>{const T=y?h.subscribe(Xt.batchCalls(E)):Pn;return h.updateResult(),T},[h,y]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),N.useEffect(()=>{h.setOptions(l)},[l,h]),A0(l,p))throw Vc(l,h,o);if(Lx({result:p,errorResetBoundary:o,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&&!aa&&Px(p,r)){const E=d?Vc(l,h,o):c==null?void 0:c.promise;E==null||E.catch(Pn).finally(()=>{h.updateResult()})}return l.notifyOnChangeProps?p:h.trackResult(p)}function hr(e,t){return Ck(e,um)}function _k(e,t){const n=Wn(),r=n.getQueryCache();return N.useSyncExternalStore(N.useCallback(o=>r.subscribe(Xt.batchCalls(o)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}function Ka(e,t){const n=Wn(),[r]=N.useState(()=>new bk(n,e));N.useEffect(()=>{r.setOptions(e)},[r,e]);const o=N.useSyncExternalStore(N.useCallback(l=>r.subscribe(Xt.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=N.useCallback((l,c)=>{r.mutate(l,c).catch(Pn)},[r]);if(o.error&&im(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}function Nk({children:e}){const[t]=N.useState(()=>new Tk({defaultOptions:{queries:{staleTime:3e5,gcTime:18e5,refetchOnWindowFocus:!1,retry:1}}}));return f.jsx(wk,{client:t,children:e})}const Dk="modulepreload",Ok=function(e){return"/"+e},e1={},ls=function(t,n,r){let o=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]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));o=l(n.map(h=>{if(h=Ok(h),h in e1)return;e1[h]=!0;const p=h.endsWith(".css"),y=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${y}`))return;const b=document.createElement("link");if(b.rel=p?"stylesheet":Dk,p||(b.as="script"),b.crossOrigin="",b.href=h,d&&b.setAttribute("nonce",d),document.head.appendChild(b),p)return new Promise((v,D)=>{b.addEventListener("load",v),b.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 o.then(l=>{for(const c of l||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})},t1={md:768,lg:1024};function n1(e){return e>=t1.lg?"lg":e>=t1.md?"md":"sm"}function dm(){const[e,t]=N.useState(()=>typeof window<"u"?n1(window.innerWidth):"lg");return N.useEffect(()=>{function n(){t(n1(window.innerWidth))}return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}const fm="/api";class ou extends Error{constructor(t,n,r){super(n),this.status=t,this.errorType=r,this.name="ApiError"}}async function Et(e,t){const n={...t==null?void 0:t.headers};t!=null&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${fm}${e}`,{credentials:"include",...t,headers:n});if(!r.ok){const o=await r.json().catch(()=>({error:"Unknown error"}));throw new ou(r.status,o.error||`HTTP ${r.status}`,o.errorType)}return r.json()}async function kc(e,t){const n=await fetch(`${fm}${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 ou(n.status,r.error||`HTTP ${n.status}`,r.errorType)}return n.json()}const xt={getHealth:()=>Et("/health"),reconnect:()=>Et("/connections/reconnect",{method:"POST",body:"{}"}),getConfig:()=>Et("/config"),getChart:e=>Et(`/charts/${encodeURIComponent(e)}`),queryChart:(e,t={},n={})=>Et(`/charts/${encodeURIComponent(e)}/query${n.includeConfig?"?includeConfig=true":""}`,{method:"POST",body:JSON.stringify(t)}),queryChartsBatch:(e,t={})=>Et("/charts/batch",{method:"POST",body:JSON.stringify({charts:e,includeConfig:t.includeConfig})}),queryChartDetail:(e,t={})=>Et(`/charts/${encodeURIComponent(e)}/detail`,{method:"POST",body:JSON.stringify(t)}),invalidateChart:e=>Et(`/charts/${encodeURIComponent(e)}/invalidate`,{method:"POST"}),getChartEvents:()=>Et("/chart-events"),createChartEvent:e=>Et("/chart-events",{method:"POST",body:JSON.stringify(e)}),deleteChartEvent:e=>Et(`/chart-events/${e}`,{method:"DELETE"}),updateChartEvent:(e,t)=>Et(`/chart-events/${e}`,{method:"PUT",body:JSON.stringify(t)}),getParameterOptions:(e,t)=>Et(`/charts/${encodeURIComponent(e)}/parameters/${encodeURIComponent(t)}/options`),getModelOptions:(e,t,n)=>Et(`/models/${encodeURIComponent(e)}/options?value_field=${encodeURIComponent(t)}&label_field=${encodeURIComponent(n)}`),getDashboards:()=>Et("/dashboards"),getDashboard:(e,t)=>{const n=t?`/dashboards/${encodeURIComponent(e)}?branch=${encodeURIComponent(t)}`:`/dashboards/${encodeURIComponent(e)}`;return Et(n)},saveDashboard:(e,t,n,r)=>Et(`/dashboards/${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify(r?{tab:r,tabLayout:t,message:n}:{layout:t,message:n})}),warmDashboardCache:(e,t={},n)=>Et(`/dashboards/${encodeURIComponent(e)}/warm-cache`,{method:"POST",body:JSON.stringify({params:t,...n?{tab:n}:{}})}),getBranches:()=>Et("/git/branches"),createBranch:(e,t)=>Et("/git/branches",{method:"POST",body:JSON.stringify({name:e,from:t})}),checkoutBranch:e=>Et("/git/checkout",{method:"POST",body:JSON.stringify({branch:e})}),getAuthMe:async()=>{const e=await fetch(`${fm}/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 ou(e.status,`HTTP ${e.status}`);return e.json()},authSetup:e=>Et("/auth/setup",{method:"POST",body:JSON.stringify(e)}),authLogin:e=>Et("/auth/login",{method:"POST",body:JSON.stringify(e)}),authLogout:()=>Et("/auth/logout",{method:"POST"}),authChangePassword:e=>Et("/auth/me/password",{method:"PUT",body:JSON.stringify(e)}),authListUsers:()=>Et("/auth/users"),authCreateUser:e=>Et("/auth/users",{method:"POST",body:JSON.stringify(e)}),authUpdateUser:(e,t)=>Et(`/auth/users/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),authDeleteUser:e=>Et(`/auth/users/${encodeURIComponent(e)}`,{method:"DELETE"}),createShareLink:e=>Et("/shares",{method:"POST",body:JSON.stringify(e)}),listShareLinks:()=>Et("/shares"),revokeShareLink:e=>Et(`/shares/${encodeURIComponent(e)}`,{method:"DELETE"}),getPublicConfig:e=>kc(`/public/config?share_token=${encodeURIComponent(e)}`),getPublicDashboard:(e,t)=>kc(`/public/dashboards/${encodeURIComponent(e)}?share_token=${encodeURIComponent(t)}`),queryPublicChart:(e,t,n,r=!1)=>{const o=new URLSearchParams({share_token:n});return r&&o.set("includeConfig","true"),kc(`/public/charts/${encodeURIComponent(e)}/query?${o}`,{method:"POST",body:JSON.stringify(t)})},queryPublicChartBatch:(e,t,n=!1)=>kc(`/public/charts/batch?share_token=${encodeURIComponent(t)}`,{method:"POST",body:JSON.stringify({charts:e,includeConfig:n})}),generateText:e=>Et("/chat/generate-text",{method:"POST",body:JSON.stringify(e)})};function ma(){return hr({queryKey:["config"],queryFn:xt.getConfig,staleTime:1/0})}function Ak(){return hr({queryKey:["health"],queryFn:xt.getHealth,refetchInterval:3e4})}function jx(e){return hr({queryKey:["chart",e],queryFn:()=>xt.getChart(e),enabled:!!e,staleTime:1e3*60*10})}const r1=e=>{let t;const n=new Set,r=(h,p)=>{const y=typeof h=="function"?h(t):h;if(!Object.is(y,t)){const b=t;t=p??(typeof y!="object"||y===null)?y:Object.assign({},t,y),n.forEach(v=>v(t,b))}},o=()=>t,c={setState:r,getState:o,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h))},d=t=e(r,o,c);return c},Ik=(e=>e?r1(e):r1),Mk=e=>e;function Lk(e,t=Mk){const n=Ie.useSyncExternalStore(e.subscribe,Ie.useCallback(()=>t(e.getState()),[e,t]),Ie.useCallback(()=>t(e.getInitialState()),[e,t]));return Ie.useDebugValue(n),n}const s1=e=>{const t=Ik(e),n=r=>Lk(t,r);return Object.assign(n,t),n},Fx=(e=>e?s1(e):s1),Xe=Fx((e,t)=>({globalFilters:{},chartFilters:{},crossFilters:{},setGlobalFilter:(n,r)=>e(o=>{if(r==null){const{[n]:i,...l}=o.globalFilters;return{globalFilters:l}}return{globalFilters:{...o.globalFilters,[n]:r}}}),setChartFilter:(n,r,o)=>e(i=>{if(o==null){const l=i.chartFilters[n];if(!l)return i;const{[r]:c,...d}=l;return{chartFilters:{...i.chartFilters,[n]:d}}}return{chartFilters:{...i.chartFilters,[n]:{...i.chartFilters[n],[r]:o}}}}),setCrossFilter:(n,r,o,i)=>e(l=>{const c=l.crossFilters[n];if(c&&c.value===r){const{[n]:d,...h}=l.crossFilters;return{crossFilters:h}}return{crossFilters:{...l.crossFilters,[n]:{field:n,value:r,sourceChart:o,temporal:i}}}}),clearCrossFilter:n=>e(r=>{const{[n]:o,...i}=r.crossFilters;return{crossFilters:i}}),clearAllCrossFilters:()=>e({crossFilters:{}}),getEffectiveFilters:n=>{const{globalFilters:r,crossFilters:o,chartFilters:i}=t(),l={};for(const c of Object.values(o))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]:o,...i}=r.chartFilters;return{chartFilters:i}})})),Bx=6048e5,Rk=864e5,hm=6e4,mm=36e5,Pk=1e3,o1=Symbol.for("constructDateFrom");function Dt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&o1 in e?e[o1](t):e instanceof Date?new e.constructor(t):new Date(t)}function dt(e,t){return Dt(t||e,e)}function Ms(e,t,n){const r=dt(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 vi(e,t,n){const r=dt(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 o=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 o>=l?i:(r.setFullYear(i.getFullYear(),i.getMonth(),o),r)}let jk={};function pa(){return jk}function zr(e,t){var c,d,h,p;const n=pa(),r=(t==null?void 0:t.weekStartsOn)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??n.weekStartsOn??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,o=dt(e,t==null?void 0:t.in),i=o.getDay(),l=(i<r?7:0)+i-r;return o.setDate(o.getDate()-l),o.setHours(0,0,0,0),o}function la(e,t){return zr(e,{...t,weekStartsOn:1})}function Hx(e,t){const n=dt(e,t==null?void 0:t.in),r=n.getFullYear(),o=Dt(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const i=la(o),l=Dt(n,0);l.setFullYear(r,0,4),l.setHours(0,0,0,0);const c=la(l);return n.getTime()>=i.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Qc(e){const t=dt(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 Ei(e,...t){const n=Dt.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function ua(e,t){const n=dt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function pm(e,t,n){const[r,o]=Ei(n==null?void 0:n.in,e,t),i=ua(r),l=ua(o),c=+i-Qc(i),d=+l-Qc(l);return Math.round((c-d)/Rk)}function Fk(e,t){const n=Hx(e,t),r=Dt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),la(r)}function ym(e,t,n){return vi(e,t*3,n)}function fd(e,t,n){return Ms(e,t*7,n)}function hd(e,t,n){return vi(e,t*12,n)}function Bk(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=Dt.bind(null,o));const i=dt(o,r);(!n||n<i||isNaN(+i))&&(n=i)}),Dt(r,n||NaN)}function Hk(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=Dt.bind(null,o));const i=dt(o,r);(!n||n>i||isNaN(+i))&&(n=i)}),Dt(r,n||NaN)}function Uk(e,t,n){const[r,o]=Ei(n==null?void 0:n.in,e,t);return+ua(r)==+ua(o)}function Ux(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function zk(e){return!(!Ux(e)&&typeof e!="number"||isNaN(+dt(e)))}function zx(e,t,n){const[r,o]=Ei(n==null?void 0:n.in,e,t),i=r.getFullYear()-o.getFullYear(),l=r.getMonth()-o.getMonth();return i*12+l}function Wk(e,t){const n=dt(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function md(e,t){const n=dt(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 Wx(e,t){const[n,r]=Ei(e,t.start,t.end);return{start:n,end:r}}function Yk(e,t){const{start:n,end:r}=Wx(t==null?void 0:t.in,e);let o=+n>+r;const i=o?+n:+r,l=o?r:n;l.setHours(0,0,0,0),l.setDate(1);let c=1;const d=[];for(;+l<=i;)d.push(Dt(n,l)),l.setMonth(l.getMonth()+c);return o?d.reverse():d}function Gc(e,t){const n=dt(e,t==null?void 0:t.in),r=n.getMonth(),o=r-r%3;return n.setMonth(o,1),n.setHours(0,0,0,0),n}function ql(e,t){const n=dt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function pd(e,t){const n=dt(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 mi(e,t){const n=dt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function $k(e,t){const{start:n,end:r}=Wx(t==null?void 0:t.in,e);let o=+n>+r;const i=o?+n:+r,l=o?r:n;l.setHours(0,0,0,0),l.setMonth(0,1);let c=1;const d=[];for(;+l<=i;)d.push(Dt(n,l)),l.setFullYear(l.getFullYear()+c);return o?d.reverse():d}function yd(e,t){var c,d,h,p;const n=pa(),r=(t==null?void 0:t.weekStartsOn)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??n.weekStartsOn??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,o=dt(e,t==null?void 0:t.in),i=o.getDay(),l=(i<r?-7:0)+6-(i-r);return o.setDate(o.getDate()+l),o.setHours(23,59,59,999),o}function qk(e,t){return yd(e,{...t,weekStartsOn:1})}function gm(e,t){const n=dt(e,t==null?void 0:t.in),r=n.getMonth(),o=r-r%3+3;return n.setMonth(o,0),n.setHours(23,59,59,999),n}const Vk={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"}},Qk=(e,t,n)=>{let r;const o=Vk[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Mh(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Gk={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Kk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Xk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Jk={date:Mh({formats:Gk,defaultWidth:"full"}),time:Mh({formats:Kk,defaultWidth:"full"}),dateTime:Mh({formats:Xk,defaultWidth:"full"})},Zk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},eS=(e,t,n,r)=>Zk[e];function hl(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,c=n!=null&&n.width?String(n.width):l;o=e.formattingValues[c]||e.formattingValues[l]}else{const l=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[c]||e.values[l]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const tS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},nS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},rS={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"]},sS={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"]},oS={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"}},aS={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"}},iS=(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"},lS={ordinalNumber:iS,era:hl({values:tS,defaultWidth:"wide"}),quarter:hl({values:nS,defaultWidth:"wide",argumentCallback:e=>e-1}),month:hl({values:rS,defaultWidth:"wide"}),day:hl({values:sS,defaultWidth:"wide"}),dayPeriod:hl({values:oS,defaultWidth:"wide",formattingValues:aS,defaultFormattingWidth:"wide"})};function ml(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const l=i[0],c=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(c)?cS(c,y=>y.test(l)):uS(c,y=>y.test(l));let h;h=e.valueCallback?e.valueCallback(d):d,h=n.valueCallback?n.valueCallback(h):h;const p=t.slice(l.length);return{value:h,rest:p}}}function uS(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function cS(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function dS(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=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(o.length);return{value:l,rest:c}}}const fS=/^(\d+)(th|st|nd|rd)?/i,hS=/\d+/i,mS={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pS={any:[/^b/i,/^(a|c)/i]},yS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},gS={any:[/1/i,/2/i,/3/i,/4/i]},bS={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},xS={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]},vS={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},ES={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]},TS={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},wS={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}},kS={ordinalNumber:dS({matchPattern:fS,parsePattern:hS,valueCallback:e=>parseInt(e,10)}),era:ml({matchPatterns:mS,defaultMatchWidth:"wide",parsePatterns:pS,defaultParseWidth:"any"}),quarter:ml({matchPatterns:yS,defaultMatchWidth:"wide",parsePatterns:gS,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ml({matchPatterns:bS,defaultMatchWidth:"wide",parsePatterns:xS,defaultParseWidth:"any"}),day:ml({matchPatterns:vS,defaultMatchWidth:"wide",parsePatterns:ES,defaultParseWidth:"any"}),dayPeriod:ml({matchPatterns:TS,defaultMatchWidth:"any",parsePatterns:wS,defaultParseWidth:"any"})},Yo={code:"en-US",formatDistance:Qk,formatLong:Jk,formatRelative:eS,localize:lS,match:kS,options:{weekStartsOn:0,firstWeekContainsDate:1}};function SS(e,t){const n=dt(e,t==null?void 0:t.in);return pm(n,mi(n))+1}function gd(e,t){const n=dt(e,t==null?void 0:t.in),r=+la(n)-+Fk(n);return Math.round(r/Bx)+1}function bm(e,t){var p,y,b,v;const n=dt(e,t==null?void 0:t.in),r=n.getFullYear(),o=pa(),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)??o.firstWeekContainsDate??((v=(b=o.locale)==null?void 0:b.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=zr(l,t),d=Dt((t==null?void 0:t.in)||e,0);d.setFullYear(r,0,i),d.setHours(0,0,0,0);const h=zr(d,t);return+n>=+c?r+1:+n>=+h?r:r-1}function CS(e,t){var c,d,h,p;const n=pa(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,o=bm(e,t),i=Dt((t==null?void 0:t.in)||e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),zr(i,t)}function bd(e,t){const n=dt(e,t==null?void 0:t.in),r=+zr(n,t)-+CS(n,t);return Math.round(r/Bx)+1}function At(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const no={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(),o=Math.trunc(r*Math.pow(10,n-3));return At(o,t.length)}},Wa={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},a1={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(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return no.y(e,t)},Y:function(e,t,n,r){const o=bm(e,r),i=o>0?o:1-o;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=Hx(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 no.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 o=bd(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):At(o,t.length)},I:function(e,t,n){const r=gd(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"}):no.d(e,t)},D:function(e,t,n){const r=SS(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 o=e.getDay(),i=(o-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(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-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(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return At(o,t.length);case"io":return n.ordinalNumber(o,{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 o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Wa.noon:r===0?o=Wa.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Wa.evening:r>=12?o=Wa.afternoon:r>=4?o=Wa.morning:o=Wa.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{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 no.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):no.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"}):no.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):no.s(e,t)},S:function(e,t){return no.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return l1(r);case"XXXX":case"XX":return zo(r);case"XXXXX":case"XXX":default:return zo(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return l1(r);case"xxxx":case"xx":return zo(r);case"xxxxx":case"xxx":default:return zo(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+i1(r,":");case"OOOO":default:return"GMT"+zo(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+i1(r,":");case"zzzz":default:return"GMT"+zo(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 i1(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+At(i,2)}function l1(e,t){return e%60===0?(e>0?"-":"+")+At(Math.abs(e)/60,2):zo(e,t)}function zo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=At(Math.trunc(r/60),2),i=At(r%60,2);return n+o+t+i}const u1=(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"})}},Yx=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},_S=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return u1(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}}",u1(r,t)).replace("{{time}}",Yx(o,t))},I0={p:Yx,P:_S},NS=/^D+$/,DS=/^Y+$/,OS=["D","DD","YY","YYYY"];function $x(e){return NS.test(e)}function qx(e){return DS.test(e)}function M0(e,t,n){const r=AS(e,t,n);if(console.warn(r),OS.includes(e))throw new RangeError(r)}function AS(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 IS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,MS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,LS=/^'([^]*?)'?$/,RS=/''/g,PS=/[a-zA-Z]/;function on(e,t,n){var p,y,b,v,D,k,E,T;const r=pa(),o=(n==null?void 0:n.locale)??r.locale??Yo,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=(b=r.locale)==null?void 0:b.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??((T=(E=r.locale)==null?void 0:E.options)==null?void 0:T.weekStartsOn)??0,c=dt(e,n==null?void 0:n.in);if(!zk(c))throw new RangeError("Invalid time value");let d=t.match(MS).map(C=>{const O=C[0];if(O==="p"||O==="P"){const A=I0[O];return A(C,o.formatLong)}return C}).join("").match(IS).map(C=>{if(C==="''")return{isToken:!1,value:"'"};const O=C[0];if(O==="'")return{isToken:!1,value:jS(C)};if(a1[O])return{isToken:!0,value:C};if(O.match(PS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");return{isToken:!1,value:C}});o.localize.preprocessor&&(d=o.localize.preprocessor(c,d));const h={firstWeekContainsDate:i,weekStartsOn:l,locale:o};return d.map(C=>{if(!C.isToken)return C.value;const O=C.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&qx(O)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&$x(O))&&M0(O,t,String(e));const A=a1[O[0]];return A(c,O,o.localize,h)}).join("")}function jS(e){const t=e.match(LS);return t?t[1].replace(RS,"'"):e}function FS(e,t){const n=dt(e,t==null?void 0:t.in),r=n.getFullYear(),o=n.getMonth(),i=Dt(n,0);return i.setFullYear(r,o+1,0),i.setHours(0,0,0,0),i.getDate()}function BS(){return Object.assign({},pa())}function HS(e,t){const n=dt(e,t==null?void 0:t.in).getDay();return n===0?7:n}function US(e,t){return dt(e,t==null?void 0:t.in).getMonth()}function zS(e,t){return dt(e,t==null?void 0:t.in).getFullYear()}function WS(e,t){return+dt(e)>+dt(t)}function YS(e,t){return+dt(e)<+dt(t)}function $S(e,t){const n=qS(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 qS(e){var t;return typeof e=="function"&&((t=e.prototype)==null?void 0:t.constructor)===e}const VS=10;class Vx{constructor(){Pe(this,"subPriority",0)}validate(t,n){return!0}}class QS extends Vx{constructor(t,n,r,o,i){super(),this.value=t,this.validateValue=n,this.setValue=r,this.priority=o,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 GS extends Vx{constructor(n,r){super();Pe(this,"priority",VS);Pe(this,"subPriority",-1);this.context=n||(o=>Dt(r,o))}set(n,r){return r.timestampIsSet?n:Dt(n,$S(n,this.context))}}let Ct=class{run(t,n,r,o){const i=this.parse(t,n,r,o);return i?{setter:new QS(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(t,n,r){return!0}};class KS extends Ct{constructor(){super(...arguments);Pe(this,"priority",140);Pe(this,"incompatibleTokens",["R","u","t","T"])}parse(n,r,o){switch(r){case"G":case"GG":case"GGG":return o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"});case"GGGGG":return o.era(n,{width:"narrow"});case"GGGG":default:return o.era(n,{width:"wide"})||o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"})}}set(n,r,o){return r.era=o,n.setFullYear(o,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}/},ss={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 os(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,o=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*(o*mm+i*hm+l*Pk),rest:t.slice(n[0].length)}}function Qx(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 Kc(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 xm(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 Gx(e,t){const n=t>0,r=n?t:1-t;let o;if(r<=50)o=e||100;else{const i=r+50,l=Math.trunc(i/100)*100,c=e>=i%100;o=e+l-(c?100:0)}return n?o:1-o}function Kx(e){return e%400===0||e%4===0&&e%100!==0}class XS extends Ct{constructor(){super(...arguments);Pe(this,"priority",130);Pe(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,r,o){const i=l=>({year:l,isTwoDigitYear:r==="yy"});switch(r){case"y":return fn(an(4,n),i);case"yo":return fn(o.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,o){const i=n.getFullYear();if(o.isTwoDigitYear){const c=Gx(o.year,i);return n.setFullYear(c,0,1),n.setHours(0,0,0,0),n}const l=!("era"in r)||r.era===1?o.year:1-o.year;return n.setFullYear(l,0,1),n.setHours(0,0,0,0),n}}class JS extends Ct{constructor(){super(...arguments);Pe(this,"priority",130);Pe(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,r,o){const i=l=>({year:l,isTwoDigitYear:r==="YY"});switch(r){case"Y":return fn(an(4,n),i);case"Yo":return fn(o.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,o,i){const l=bm(n,i);if(o.isTwoDigitYear){const d=Gx(o.year,l);return n.setFullYear(d,0,i.firstWeekContainsDate),n.setHours(0,0,0,0),zr(n,i)}const c=!("era"in r)||r.era===1?o.year:1-o.year;return n.setFullYear(c,0,i.firstWeekContainsDate),n.setHours(0,0,0,0),zr(n,i)}}class ZS extends Ct{constructor(){super(...arguments);Pe(this,"priority",130);Pe(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,r){return Kc(r==="R"?4:r.length,n)}set(n,r,o){const i=Dt(n,0);return i.setFullYear(o,0,4),i.setHours(0,0,0,0),la(i)}}class eC extends Ct{constructor(){super(...arguments);Pe(this,"priority",130);Pe(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,r){return Kc(r==="u"?4:r.length,n)}set(n,r,o){return n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}}class tC extends Ct{constructor(){super(...arguments);Pe(this,"priority",120);Pe(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"Q":case"QQ":return an(r.length,n);case"Qo":return o.ordinalNumber(n,{unit:"quarter"});case"QQQ":return o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(n,{width:"wide",context:"formatting"})||o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=1&&r<=4}set(n,r,o){return n.setMonth((o-1)*3,1),n.setHours(0,0,0,0),n}}class nC extends Ct{constructor(){super(...arguments);Pe(this,"priority",120);Pe(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"q":case"qq":return an(r.length,n);case"qo":return o.ordinalNumber(n,{unit:"quarter"});case"qqq":return o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(n,{width:"wide",context:"standalone"})||o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=1&&r<=4}set(n,r,o){return n.setMonth((o-1)*3,1),n.setHours(0,0,0,0),n}}class rC extends Ct{constructor(){super(...arguments);Pe(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);Pe(this,"priority",110)}parse(n,r,o){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(o.ordinalNumber(n,{unit:"month"}),i);case"MMM":return o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(n,{width:"wide",context:"formatting"})||o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.setMonth(o,1),n.setHours(0,0,0,0),n}}class sC extends Ct{constructor(){super(...arguments);Pe(this,"priority",110);Pe(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,r,o){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(o.ordinalNumber(n,{unit:"month"}),i);case"LLL":return o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(n,{width:"wide",context:"standalone"})||o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.setMonth(o,1),n.setHours(0,0,0,0),n}}function oC(e,t,n){const r=dt(e,n==null?void 0:n.in),o=bd(r,n)-t;return r.setDate(r.getDate()-o*7),dt(r,n==null?void 0:n.in)}class aC extends Ct{constructor(){super(...arguments);Pe(this,"priority",100);Pe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,r,o){switch(r){case"w":return Jt(dn.week,n);case"wo":return o.ordinalNumber(n,{unit:"week"});default:return an(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,o,i){return zr(oC(n,o,i),i)}}function iC(e,t,n){const r=dt(e,n==null?void 0:n.in),o=gd(r,n)-t;return r.setDate(r.getDate()-o*7),r}class lC extends Ct{constructor(){super(...arguments);Pe(this,"priority",100);Pe(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,r,o){switch(r){case"I":return Jt(dn.week,n);case"Io":return o.ordinalNumber(n,{unit:"week"});default:return an(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,o){return la(iC(n,o))}}const uC=[31,28,31,30,31,30,31,31,30,31,30,31],cC=[31,29,31,30,31,30,31,31,30,31,30,31];class dC extends Ct{constructor(){super(...arguments);Pe(this,"priority",90);Pe(this,"subPriority",1);Pe(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"d":return Jt(dn.date,n);case"do":return o.ordinalNumber(n,{unit:"date"});default:return an(r.length,n)}}validate(n,r){const o=n.getFullYear(),i=Kx(o),l=n.getMonth();return i?r>=1&&r<=cC[l]:r>=1&&r<=uC[l]}set(n,r,o){return n.setDate(o),n.setHours(0,0,0,0),n}}class fC extends Ct{constructor(){super(...arguments);Pe(this,"priority",90);Pe(this,"subpriority",1);Pe(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,r,o){switch(r){case"D":case"DD":return Jt(dn.dayOfYear,n);case"Do":return o.ordinalNumber(n,{unit:"date"});default:return an(r.length,n)}}validate(n,r){const o=n.getFullYear();return Kx(o)?r>=1&&r<=366:r>=1&&r<=365}set(n,r,o){return n.setMonth(0,o),n.setHours(0,0,0,0),n}}function vm(e,t,n){var y,b,v,D;const r=pa(),o=(n==null?void 0:n.weekStartsOn)??((b=(y=n==null?void 0:n.locale)==null?void 0:y.options)==null?void 0:b.weekStartsOn)??r.weekStartsOn??((D=(v=r.locale)==null?void 0:v.options)==null?void 0:D.weekStartsOn)??0,i=dt(e,n==null?void 0:n.in),l=i.getDay(),d=(t%7+7)%7,h=7-o,p=t<0||t>6?t-(l+h)%7:(d+h)%7-(l+h)%7;return Ms(i,p,n)}class hC extends Ct{constructor(){super(...arguments);Pe(this,"priority",90);Pe(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"E":case"EE":case"EEE":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,i){return n=vm(n,o,i),n.setHours(0,0,0,0),n}}class mC extends Ct{constructor(){super(...arguments);Pe(this,"priority",90);Pe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,r,o,i){const l=c=>{const d=Math.floor((c-1)/7)*7;return(c+i.weekStartsOn+6)%7+d};switch(r){case"e":case"ee":return fn(an(r.length,n),l);case"eo":return fn(o.ordinalNumber(n,{unit:"day"}),l);case"eee":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeeee":return o.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,i){return n=vm(n,o,i),n.setHours(0,0,0,0),n}}class pC extends Ct{constructor(){super(...arguments);Pe(this,"priority",90);Pe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,r,o,i){const l=c=>{const d=Math.floor((c-1)/7)*7;return(c+i.weekStartsOn+6)%7+d};switch(r){case"c":case"cc":return fn(an(r.length,n),l);case"co":return fn(o.ordinalNumber(n,{unit:"day"}),l);case"ccc":return o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"ccccc":return o.day(n,{width:"narrow",context:"standalone"});case"cccccc":return o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(n,{width:"wide",context:"standalone"})||o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,i){return n=vm(n,o,i),n.setHours(0,0,0,0),n}}function yC(e,t,n){const r=dt(e,n==null?void 0:n.in),o=HS(r,n),i=t-o;return Ms(r,i,n)}class gC extends Ct{constructor(){super(...arguments);Pe(this,"priority",90);Pe(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,r,o){const i=l=>l===0?7:l;switch(r){case"i":case"ii":return an(r.length,n);case"io":return o.ordinalNumber(n,{unit:"day"});case"iii":return fn(o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),i);case"iiiii":return fn(o.day(n,{width:"narrow",context:"formatting"}),i);case"iiiiii":return fn(o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),i);case"iiii":default:return fn(o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),i)}}validate(n,r){return r>=1&&r<=7}set(n,r,o){return n=yC(n,o),n.setHours(0,0,0,0),n}}class bC extends Ct{constructor(){super(...arguments);Pe(this,"priority",80);Pe(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,r,o){switch(r){case"a":case"aa":case"aaa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(xm(o),0,0,0),n}}class xC extends Ct{constructor(){super(...arguments);Pe(this,"priority",80);Pe(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,r,o){switch(r){case"b":case"bb":case"bbb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(xm(o),0,0,0),n}}class vC extends Ct{constructor(){super(...arguments);Pe(this,"priority",80);Pe(this,"incompatibleTokens",["a","b","t","T"])}parse(n,r,o){switch(r){case"B":case"BB":case"BBB":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(xm(o),0,0,0),n}}class EC extends Ct{constructor(){super(...arguments);Pe(this,"priority",70);Pe(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,r,o){switch(r){case"h":return Jt(dn.hour12h,n);case"ho":return o.ordinalNumber(n,{unit:"hour"});default:return an(r.length,n)}}validate(n,r){return r>=1&&r<=12}set(n,r,o){const i=n.getHours()>=12;return i&&o<12?n.setHours(o+12,0,0,0):!i&&o===12?n.setHours(0,0,0,0):n.setHours(o,0,0,0),n}}class TC extends Ct{constructor(){super(...arguments);Pe(this,"priority",70);Pe(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,r,o){switch(r){case"H":return Jt(dn.hour23h,n);case"Ho":return o.ordinalNumber(n,{unit:"hour"});default:return an(r.length,n)}}validate(n,r){return r>=0&&r<=23}set(n,r,o){return n.setHours(o,0,0,0),n}}class wC extends Ct{constructor(){super(...arguments);Pe(this,"priority",70);Pe(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,r,o){switch(r){case"K":return Jt(dn.hour11h,n);case"Ko":return o.ordinalNumber(n,{unit:"hour"});default:return an(r.length,n)}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.getHours()>=12&&o<12?n.setHours(o+12,0,0,0):n.setHours(o,0,0,0),n}}class kC extends Ct{constructor(){super(...arguments);Pe(this,"priority",70);Pe(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,r,o){switch(r){case"k":return Jt(dn.hour24h,n);case"ko":return o.ordinalNumber(n,{unit:"hour"});default:return an(r.length,n)}}validate(n,r){return r>=1&&r<=24}set(n,r,o){const i=o<=24?o%24:o;return n.setHours(i,0,0,0),n}}class SC extends Ct{constructor(){super(...arguments);Pe(this,"priority",60);Pe(this,"incompatibleTokens",["t","T"])}parse(n,r,o){switch(r){case"m":return Jt(dn.minute,n);case"mo":return o.ordinalNumber(n,{unit:"minute"});default:return an(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,o){return n.setMinutes(o,0,0),n}}class CC extends Ct{constructor(){super(...arguments);Pe(this,"priority",50);Pe(this,"incompatibleTokens",["t","T"])}parse(n,r,o){switch(r){case"s":return Jt(dn.second,n);case"so":return o.ordinalNumber(n,{unit:"second"});default:return an(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,o){return n.setSeconds(o,0),n}}class _C extends Ct{constructor(){super(...arguments);Pe(this,"priority",30);Pe(this,"incompatibleTokens",["t","T"])}parse(n,r){const o=i=>Math.trunc(i*Math.pow(10,-r.length+3));return fn(an(r.length,n),o)}set(n,r,o){return n.setMilliseconds(o),n}}class NC extends Ct{constructor(){super(...arguments);Pe(this,"priority",10);Pe(this,"incompatibleTokens",["t","T","x"])}parse(n,r){switch(r){case"X":return os(ss.basicOptionalMinutes,n);case"XX":return os(ss.basic,n);case"XXXX":return os(ss.basicOptionalSeconds,n);case"XXXXX":return os(ss.extendedOptionalSeconds,n);case"XXX":default:return os(ss.extended,n)}}set(n,r,o){return r.timestampIsSet?n:Dt(n,n.getTime()-Qc(n)-o)}}class DC extends Ct{constructor(){super(...arguments);Pe(this,"priority",10);Pe(this,"incompatibleTokens",["t","T","X"])}parse(n,r){switch(r){case"x":return os(ss.basicOptionalMinutes,n);case"xx":return os(ss.basic,n);case"xxxx":return os(ss.basicOptionalSeconds,n);case"xxxxx":return os(ss.extendedOptionalSeconds,n);case"xxx":default:return os(ss.extended,n)}}set(n,r,o){return r.timestampIsSet?n:Dt(n,n.getTime()-Qc(n)-o)}}class OC extends Ct{constructor(){super(...arguments);Pe(this,"priority",40);Pe(this,"incompatibleTokens","*")}parse(n){return Qx(n)}set(n,r,o){return[Dt(n,o*1e3),{timestampIsSet:!0}]}}class AC extends Ct{constructor(){super(...arguments);Pe(this,"priority",20);Pe(this,"incompatibleTokens","*")}parse(n){return Qx(n)}set(n,r,o){return[Dt(n,o),{timestampIsSet:!0}]}}const IC={G:new KS,y:new XS,Y:new JS,R:new ZS,u:new eC,Q:new tC,q:new nC,M:new rC,L:new sC,w:new aC,I:new lC,d:new dC,D:new fC,E:new hC,e:new mC,c:new pC,i:new gC,a:new bC,b:new xC,B:new vC,h:new EC,H:new TC,K:new wC,k:new kC,m:new SC,s:new CC,S:new _C,X:new NC,x:new DC,t:new OC,T:new AC},MC=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,LC=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,RC=/^'([^]*?)'?$/,PC=/''/g,jC=/\S/,FC=/[a-zA-Z]/;function ws(e,t,n,r){var E,T,C,O;const o=()=>Dt(n,NaN),i=BS(),l=i.locale??Yo,c=i.firstWeekContainsDate??((T=(E=i.locale)==null?void 0:E.options)==null?void 0:T.firstWeekContainsDate)??1,d=i.weekStartsOn??((O=(C=i.locale)==null?void 0:C.options)==null?void 0:O.weekStartsOn)??0,h={firstWeekContainsDate:c,weekStartsOn:d,locale:l},p=[new GS(r==null?void 0:r.in,n)],y=t.match(LC).map(A=>{const L=A[0];if(L in I0){const _=I0[L];return _(A,l.formatLong)}return A}).join("").match(MC),b=[];for(let A of y){qx(A)&&M0(A,t,e),$x(A)&&M0(A,t,e);const L=A[0],_=IC[L];if(_){const{incompatibleTokens:S}=_;if(Array.isArray(S)){const P=b.find(U=>S.includes(U.token)||U.token===L);if(P)throw new RangeError(`The format string mustn't contain \`${P.fullToken}\` and \`${A}\` at the same time`)}else if(_.incompatibleTokens==="*"&&b.length>0)throw new RangeError(`The format string mustn't contain \`${A}\` and any other token at the same time`);b.push({token:L,fullToken:A});const I=_.run(e,A,l.match,h);if(!I)return o();p.push(I.setter),e=I.rest}else{if(L.match(FC))throw new RangeError("Format string contains an unescaped latin alphabet character `"+L+"`");if(A==="''"?A="'":L==="'"&&(A=BC(A)),e.indexOf(A)===0)e=e.slice(A.length);else return o()}}if(e.length>0&&jC.test(e))return o();const v=p.map(A=>A.priority).sort((A,L)=>L-A).filter((A,L,_)=>_.indexOf(A)===L).map(A=>p.filter(L=>L.priority===A).sort((L,_)=>_.subPriority-L.subPriority)).map(A=>A[0]);let D=dt(n,r==null?void 0:r.in);if(isNaN(+D))return o();const k={};for(const A of v){if(!A.validate(D,h))return o();const L=A.set(D,k,h);Array.isArray(L)?(D=L[0],Object.assign(k,L[1])):D=L}return D}function BC(e){return e.match(RC)[1].replace(PC,"'")}function HC(e,t,n){const[r,o]=Ei(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function UC(e,t,n){const[r,o]=Ei(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()}function Sr(e,t,n){return Ms(e,-t,n)}function c1(e,t){const n=()=>Dt(t==null?void 0:t.in,NaN),o=$C(e);let i;if(o.date){const h=qC(o.date,2);i=VC(h.restDateString,h.year)}if(!i||isNaN(+i))return n();const l=+i;let c=0,d;if(o.time&&(c=QC(o.time),isNaN(c)))return n();if(o.timezone){if(d=GC(o.timezone),isNaN(d))return n()}else{const h=new Date(l+c),p=dt(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 dt(l+c+d,t==null?void 0:t.in)}const Sc={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},zC=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,WC=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,YC=/^([+-])(\d{2})(?::?(\d{2}))?$/;function $C(e){const t={},n=e.split(Sc.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],Sc.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Sc.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const o=Sc.timezone.exec(r);o?(t.time=r.replace(o[1],""),t.timezone=o[1]):t.time=r}return t}function qC(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 o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?o:i*100,restDateString:e.slice((r[1]||r[2]).length)}}function VC(e,t){if(t===null)return new Date(NaN);const n=e.match(zC);if(!n)return new Date(NaN);const r=!!n[4],o=pl(n[1]),i=pl(n[2])-1,l=pl(n[3]),c=pl(n[4]),d=pl(n[5])-1;if(r)return e_(t,c,d)?KC(t,c,d):new Date(NaN);{const h=new Date(0);return!JC(t,i,l)||!ZC(t,o)?new Date(NaN):(h.setUTCFullYear(t,i,Math.max(o,l)),h)}}function pl(e){return e?parseInt(e):1}function QC(e){const t=e.match(WC);if(!t)return NaN;const n=Lh(t[1]),r=Lh(t[2]),o=Lh(t[3]);return t_(n,r,o)?n*mm+r*hm+o*1e3:NaN}function Lh(e){return e&&parseFloat(e.replace(",","."))||0}function GC(e){if(e==="Z")return 0;const t=e.match(YC);if(!t)return 0;const n=t[1]==="+"?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return n_(r,o)?n*(r*mm+o*hm):NaN}function KC(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const o=r.getUTCDay()||7,i=(t-1)*7+n+1-o;return r.setUTCDate(r.getUTCDate()+i),r}const XC=[31,null,31,30,31,30,31,31,30,31,30,31];function Xx(e){return e%400===0||e%4===0&&e%100!==0}function JC(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(XC[t]||(Xx(e)?29:28))}function ZC(e,t){return t>=1&&t<=(Xx(e)?366:365)}function e_(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function t_(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function n_(e,t){return t>=0&&t<=59}function r_(e,t,n){const r=dt(e,n==null?void 0:n.in),o=r.getFullYear(),i=r.getDate(),l=Dt(e,0);l.setFullYear(o,t,15),l.setHours(0,0,0,0);const c=FS(l);return r.setMonth(t,Math.min(i,c)),r}function s_(e,t,n){const r=dt(e,n==null?void 0:n.in);return isNaN(+r)?Dt(e,NaN):(r.setFullYear(t),r)}function Ll(e,t,n){return vi(e,-t,n)}function Jx(e,t,n){return ym(e,-t,n)}function Zx(e,t,n){return fd(e,-t,n)}function Em(e,t,n){return hd(e,-t,n)}const o_="yyyy-MM-dd";function Tt(e){return on(e,o_)}function a_(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(Ll(t,12)),end_date:r}}case"year_to_date":return{start_date:Tt(mi(t)),end_date:n};case"month_to_date":return{start_date:Tt(ql(t)),end_date:n};case"quarter_to_date":return{start_date:Tt(Gc(t)),end_date:n};case"previous_month":{const r=Ll(t,1);return{start_date:Tt(ql(r)),end_date:Tt(md(r))}}case"previous_quarter":{const r=Ll(t,3);return{start_date:Tt(Gc(r)),end_date:Tt(gm(r))}}case"previous_year":{const r=Em(t,1);return{start_date:Tt(mi(r)),end_date:Tt(pd(r))}}default:return null}}function i_(e){const n=ua(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(zr(n,{weekStartsOn:1})),end_date:Tt(yd(n,{weekStartsOn:1}))};case"month":return{start_date:Tt(ql(n)),end_date:Tt(md(n))};case"quarter":return{start_date:Tt(Gc(n)),end_date:Tt(gm(n))};case"year":return{start_date:Tt(mi(n)),end_date:Tt(pd(n))}}const r=e.value??1;if(e.direction==="previous"){const c=e.includeToday?n:Sr(n,1),h={day:Sr,week:Zx,month:Ll,quarter:Jx,year:Em}[e.unit]((e.includeToday,n),r);return{start_date:Tt(h<c?h:c),end_date:Tt(h<c?c:h)}}const o=e.includeToday?n:Ms(n,1),l={day:Ms,week:fd,month:vi,quarter:ym,year:hd}[e.unit](o,r);return{start_date:Tt(o<l?o:l),end_date:Tt(o<l?l:o)}}function pi(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=a_(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=i_(n);return{...e,start_date:r.start_date,end_date:r.end_date}}}return e}function e2(e,t){const n=Xe(d=>d.globalFilters),r=Xe(d=>d.chartFilters),o=Xe(d=>d.crossFilters),i=Xe(d=>d.getEffectiveFilters),l=N.useMemo(()=>Object.fromEntries(Object.entries(i(e)).filter(([d,h])=>h!=null&&h!==""&&!(Array.isArray(h)&&h.length===0))),[n,r,o,e]),c=N.useMemo(()=>{const d=pi(l);return t?{...d,...t}:d},[l,t]);return hr({queryKey:["chartData",e,c],queryFn:()=>xt.queryChart(e,c),enabled:!!e})}function l_(e){const t=Xe(c=>c.globalFilters),n=Xe(c=>c.chartFilters),r=Xe(c=>c.crossFilters),o=Xe(c=>c.getEffectiveFilters),i=N.useMemo(()=>Object.fromEntries(Object.entries(o(e)).filter(([c,d])=>d!=null&&d!==""&&!(Array.isArray(d)&&d.length===0))),[t,n,r,e]),l=N.useMemo(()=>pi(i),[i]);return hr({queryKey:["chartWithData",e,l],queryFn:()=>xt.queryChart(e,l,{includeConfig:!0}),enabled:!!e})}function Tm(){const e=Wn();return t=>{e.invalidateQueries({queryKey:["chartData",t]}),e.invalidateQueries({queryKey:["chartWithData",t]})}}function t2(){return hr({queryKey:["dashboards"],queryFn:()=>xt.getDashboards()})}function d1(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 u_(e){return e.tabs?e.tabs[0]?d1(e.tabs[0].layout):[]:e.layout?d1(e.layout):[]}function c_(e,t){var i,l,c;const n=Wn(),r=Xe(d=>d.globalFilters),o=hr({queryKey:["dashboard",e,t],queryFn:()=>xt.getDashboard(e,t),enabled:!!e});return N.useEffect(()=>{var d,h,p,y,b;if((d=o.data)!=null&&d.name&&((h=o.data)!=null&&h.layout||(p=o.data)!=null&&p.tabs)){const v=u_(o.data);(b=(y=o.data.tabs)==null?void 0:y[0])==null||b.name;const D=pi(Object.fromEntries(Object.entries(r).filter(([k,E])=>E!=null)));v.forEach(k=>{n.prefetchQuery({queryKey:["chartWithData",k,D],queryFn:()=>xt.queryChart(k,D,{includeConfig:!0}),staleTime:1e3*60*5})})}},[(i=o.data)==null?void 0:i.layout,(l=o.data)==null?void 0:l.tabs,(c=o.data)==null?void 0:c.name,r,n]),o}function d_(e){const t=Wn();return Ka({mutationFn:({layout:n,message:r,tab:o})=>xt.saveDashboard(e,n,r,o),onSuccess:()=>{t.invalidateQueries({queryKey:["dashboard",e]})}})}function f_(){const e=Wn();return()=>{e.invalidateQueries({queryKey:["chartData"]}),e.invalidateQueries({queryKey:["chartWithData"]})}}const h_=[["config"],["dashboard"],["dashboards"],["chartData"],["chartWithData"],["chart"]];function m_(){const e=Wn(),t=N.useRef(1e3);N.useEffect(()=>{let n=null,r=null,o=!1;function i(){o||(n=new EventSource("/api/events"),n.addEventListener("config-change",()=>{t.current=1e3;for(const l of h_)e.invalidateQueries({queryKey:l})}),n.onopen=()=>{t.current=1e3},n.onerror=()=>{n==null||n.close(),n=null,o||(r=setTimeout(i,t.current),t.current=Math.min(t.current*2,3e4))})}return i(),()=>{o=!0,n==null||n.close(),r&&clearTimeout(r)}},[e])}const wm=N.createContext(null),Cc="yc-theme-mode";function p_(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function y_({configMode:e,children:t}){const n=N.useCallback(()=>{const d=localStorage.getItem(Cc);return d==="light"||d==="dark"?d:e==="light"||e==="dark"?e:p_()},[e]),[r,o]=N.useState(n);N.useEffect(()=>{if(localStorage.getItem(Cc)||e&&e!=="auto")return;const h=window.matchMedia("(prefers-color-scheme: dark)"),p=y=>o(y.matches?"dark":"light");return h.addEventListener("change",p),()=>h.removeEventListener("change",p)},[e]),N.useEffect(()=>{document.documentElement.setAttribute("data-theme",r)},[r]);const i=N.useCallback(()=>{o(d=>{const h=d==="light"?"dark":"light";return localStorage.setItem(Cc,h),h})},[]),l=N.useCallback(()=>{localStorage.removeItem(Cc),o(n())},[n]),c=N.useMemo(()=>({mode:r,toggleMode:i,clearOverride:l}),[r,i,l]);return f.jsx(wm.Provider,{value:c,children:t})}function n2(){const e=N.useContext(wm);if(!e)throw new Error("useThemeMode must be used within ThemeModeProvider");return e}function g_(){return N.useContext(wm)}const _c={textColor:"#6b7280",borderColor:"#e5e7eb",surfaceColor:"#ffffff",splitLineColor:"#e5e7eb"};function cs(){const e=g_(),t=(e==null?void 0:e.mode)??"light";return N.useMemo(()=>{const n=getComputedStyle(document.documentElement);return{textColor:n.getPropertyValue("--yc-color-text-secondary").trim()||_c.textColor,borderColor:n.getPropertyValue("--yc-color-border").trim()||_c.borderColor,surfaceColor:n.getPropertyValue("--yc-color-surface").trim()||_c.surfaceColor,splitLineColor:n.getPropertyValue("--yc-color-border").trim()||_c.splitLineColor}},[t])}function f1(e,t){var i;const n=t.trim();if(!n)return e;const r=n.toLowerCase(),o=[];for(const l of e){const c=l.title.toLowerCase(),d=((i=l.description)==null?void 0:i.toLowerCase())??"",h=c.startsWith(r),p=c.includes(r),y=d.includes(r);h?o.push({item:l,rank:0}):p?o.push({item:l,rank:1}):y&&o.push({item:l,rank:2})}return o.sort((l,c)=>l.rank!==c.rank?l.rank-c.rank:l.item.title.localeCompare(c.item.title)),o.map(l=>l.item)}function b_(e,t){const[n,r]=N.useState(""),[o,i]=N.useState(0),l=N.useMemo(()=>{const b=f1(e,n),v=f1(t,n);return{dashboards:b,charts:v,all:[...b,...v]}},[e,t,n]),c=N.useCallback(b=>{r(b),i(0)},[]),d=N.useCallback(()=>{i(b=>Math.min(b+1,Math.max(l.all.length-1,0)))},[l.all.length]),h=N.useCallback(()=>{i(b=>Math.max(b-1,0))},[]),p=N.useCallback(()=>{r(""),i(0)},[]),y=l.all.length>0?l.all[o]??null:null;return{query:n,activeIndex:o,results:l,setQuery:c,setActiveIndex:i,moveDown:d,moveUp:h,resetSearch:p,activeItem:y}}function x_(e,t){return e.filter(n=>!n.charts||n.charts.length===0?!0:t?n.charts.includes(t):!1)}function r2(e){const{data:t,...n}=hr({queryKey:["chartEvents"],queryFn:()=>xt.getChartEvents(),staleTime:3e4}),r=(t==null?void 0:t.events)??[];return{events:N.useMemo(()=>t!=null&&t.events?x_(t.events,e):[],[t==null?void 0:t.events,e]),allEvents:r,...n}}const s2=new Set(["system-ui","serif","sans-serif","monospace","ui-monospace","cursive"]),v_={compact:"13px",default:"14px",comfortable:"16px"},E_={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 T_(e){const t=parseInt(e.replace("#",""),16),n=(t>>16)/255,r=(t>>8&255)/255,o=(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(o)}function h1(e,t){const n=parseInt(e.replace("#",""),16),r=Math.min(255,Math.max(0,(n>>16)+Math.round(2.55*t))),o=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)+(o<<8)+i).toString(16).slice(1)}`}function Rh(e){return s2.has(e)?`${e}, sans-serif`:e.toLowerCase().includes("mono")?`'${e}', monospace`:`'${e}', system-ui, sans-serif`}function w_(e,t="light"){var _,S,I,P,U,F,H,W,$,Q,ne,me;const n=e.base??"modern",r=E_[n],o=r.modeColors[t],i=((_=e.colors)==null?void 0:_.primary)??o.primary,l=((S=e.colors)==null?void 0:S.background)??o.background,c=((I=e.colors)==null?void 0:I.surface)??o.surface,d=((P=e.colors)==null?void 0:P.sidebar)??o.sidebar,h=((U=e.colors)==null?void 0:U.text)??o.text,p=((F=e.fonts)==null?void 0:F.heading)??r.fonts.heading,y=((H=e.fonts)==null?void 0:H.body)??r.fonts.body,b=((W=e.fonts)==null?void 0:W.mono)??r.fonts.mono,v=v_[(($=e.fonts)==null?void 0:$.size)??r.fonts.size]??"14px",D=e.palette??r.palette,k=new Set;for(const ee of[p,y,b])!s2.has(ee)&&ee!=="ui-monospace"&&k.add(ee);const E=k.size>0?`https://fonts.googleapis.com/css2?${[...k].map(ee=>`family=${encodeURIComponent(ee)}:wght@400;500;600;700`).join("&")}&display=swap`:null,T=T_(d)<.2,C=T?"#f1f5f9":h,O=T?"#94a3b8":o.textSecondary,A=T?"rgba(255,255,255,0.1)":o.border,L={"--yc-color-primary":i,"--yc-color-primary-light":h1(i,t==="dark"?15:20),"--yc-color-primary-dark":h1(i,t==="dark"?-10:-15),"--yc-color-background":l,"--yc-color-surface":c,"--yc-color-sidebar":d,"--yc-color-text":h,"--yc-color-text-secondary":o.textSecondary,"--yc-color-border":o.border,"--yc-color-surface-hover":o.surfaceHover,"--yc-color-text-muted":o.textMuted,"--yc-color-input-bg":o.inputBg,"--yc-color-danger":o.danger,"--yc-color-success":o.success,"--yc-color-sidebar-text":C,"--yc-color-sidebar-text-secondary":O,"--yc-color-sidebar-border":A,"--yc-font-heading":Rh(p),"--yc-font-body":Rh(y),"--yc-font-mono":Rh(b),"--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:L,palette:D,sidebarShow:((Q=e.sidebar)==null?void 0:Q.show)??r.sidebarShow,sidebarLinks:(ne=e.sidebar)==null?void 0:ne.links,sidebarSections:(me=e.sidebar)==null?void 0:me.sections,logo:e.logo,favicon:e.favicon,title:e.title,customCss:e.customCss,googleFontsUrl:E}}const o2=N.createContext(null);function k_({children:e}){const{data:t}=ma(),{mode:n}=n2(),r=N.useMemo(()=>w_((t==null?void 0:t.theme)??{},n),[t==null?void 0:t.theme,n]);return N.useEffect(()=>{const o=document.documentElement;for(const[i,l]of Object.entries(r.cssVars))o.style.setProperty(i,l);return()=>{for(const i of Object.keys(r.cssVars))o.style.removeProperty(i)}},[r.cssVars]),N.useEffect(()=>{if(!r.googleFontsUrl)return;const o="yc-google-fonts";let i=document.getElementById(o);return i||(i=document.createElement("link"),i.id=o,i.rel="stylesheet",document.head.appendChild(i)),i.href=r.googleFontsUrl,()=>{i==null||i.remove()}},[r.googleFontsUrl]),N.useEffect(()=>{if(!r.customCss)return;const o="yc-custom-css";let i=document.getElementById(o);return i||(i=document.createElement("link"),i.id=o,i.rel="stylesheet",document.head.appendChild(i)),i.href="/api/theme/custom.css",()=>{i==null||i.remove()}},[r.customCss]),N.useEffect(()=>{const o=r.title||(t==null?void 0:t.name)||"Yamchart";document.title=o},[r.title,t==null?void 0:t.name]),N.useEffect(()=>{if(!r.favicon)return;const o="yc-favicon";let i=document.querySelector(`link#${o}`);i||(i=document.createElement("link"),i.id=o,i.rel="icon",document.head.appendChild(i)),i.href=`/api/assets/${r.favicon.replace(/^\.\/assets\//,"")}`},[r.favicon]),f.jsx(o2.Provider,{value:r,children:e})}function S_({children:e}){var r;const{data:t}=ma(),n=(r=t==null?void 0:t.theme)==null?void 0:r.mode;return f.jsx(y_,{configMode:n,children:f.jsx(k_,{children:e})})}function km(){const e=N.useContext(o2);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function a2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=a2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function nr(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=a2(e))&&(r&&(r+=" "),r+=t);return r}function zc({type:e,className:t,style:n}){const r={className:t,style:n,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},o={strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5};switch(e){case"bar":return f.jsx("svg",{...r,children:f.jsx("path",{...o,d:"M3 20h18M5 20V10h3v10M10 20V4h3v16M15 20v-8h3v8"})});case"line":return f.jsx("svg",{...r,children:f.jsx("path",{...o,d:"M3 20h18M4 16l4-6 4 4 4-8 4 6"})});case"area":return f.jsxs("svg",{...r,children:[f.jsx("path",{...o,d:"M3 20h18"}),f.jsx("path",{...o,d:"M4 16l4-6 4 4 4-8 4 6v8H4z",fill:"currentColor",opacity:.15}),f.jsx("path",{...o,d:"M4 16l4-6 4 4 4-8 4 6"})]});case"pie":return f.jsxs("svg",{...r,children:[f.jsx("path",{...o,d:"M12 2a10 10 0 110 20 10 10 0 010-20z"}),f.jsx("path",{...o,d:"M12 2v10l8.66 5"})]});case"donut":return f.jsxs("svg",{...r,children:[f.jsx("circle",{...o,cx:"12",cy:"12",r:"10"}),f.jsx("circle",{...o,cx:"12",cy:"12",r:"5"}),f.jsx("path",{...o,d:"M12 2v5M22 12h-5"})]});case"scatter":return f.jsxs("svg",{...r,children:[f.jsx("path",{...o,d:"M3 20h18M3 20V4"}),f.jsx("circle",{cx:"7",cy:"15",r:"1.5",fill:"currentColor"}),f.jsx("circle",{cx:"10",cy:"10",r:"1.5",fill:"currentColor"}),f.jsx("circle",{cx:"13",cy:"13",r:"1.5",fill:"currentColor"}),f.jsx("circle",{cx:"15",cy:"7",r:"1.5",fill:"currentColor"}),f.jsx("circle",{cx:"18",cy:"9",r:"1.5",fill:"currentColor"})]});case"combo":return f.jsxs("svg",{...r,children:[f.jsx("path",{...o,d:"M3 20h18"}),f.jsx("path",{...o,d:"M5 20v-6h3v6M10 20v-10h3v10"}),f.jsx("path",{...o,d:"M5 10l4-3 4 2 5-5"})]});case"heatmap":return f.jsxs("svg",{...r,children:[f.jsx("rect",{...o,x:"3",y:"3",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.2}),f.jsx("rect",{...o,x:"10",y:"3",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.6}),f.jsx("rect",{...o,x:"17",y:"3",width:"4",height:"5",rx:"1",fill:"currentColor",opacity:.4}),f.jsx("rect",{...o,x:"3",y:"10",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.8}),f.jsx("rect",{...o,x:"10",y:"10",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.3}),f.jsx("rect",{...o,x:"17",y:"10",width:"4",height:"5",rx:"1",fill:"currentColor",opacity:.9}),f.jsx("rect",{...o,x:"3",y:"17",width:"5",height:"4",rx:"1",fill:"currentColor",opacity:.5}),f.jsx("rect",{...o,x:"10",y:"17",width:"5",height:"4",rx:"1",fill:"currentColor",opacity:.7}),f.jsx("rect",{...o,x:"17",y:"17",width:"4",height:"4",rx:"1",fill:"currentColor",opacity:.1})]});case"funnel":return f.jsx("svg",{...r,children:f.jsx("path",{...o,d:"M3 4h18l-3 5H6L3 4zM6 9h12l-2 5H8L6 9zM8 14h8l-2 5h-4l-2-5z"})});case"waterfall":return f.jsxs("svg",{...r,children:[f.jsx("path",{...o,d:"M3 20h18"}),f.jsx("path",{...o,d:"M5 8h3v4H5zM9 6h3v2H9zM13 10h3v4h-3zM17 6h3v8h-3"}),f.jsx("path",{...o,d:"M8 10h1M12 8h1",strokeDasharray:"2 1"})]});case"gauge":return f.jsxs("svg",{...r,children:[f.jsx("path",{...o,d:"M4.93 17.07A10 10 0 0112 2a10 10 0 017.07 15.07"}),f.jsx("path",{...o,d:"M12 12l-3-6",strokeWidth:2}),f.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"})]});case"kpi":case"metric":return f.jsxs("svg",{...r,children:[f.jsx("path",{...o,d:"M4 6h16M4 6v12a2 2 0 002 2h12a2 2 0 002-2V6"}),f.jsx("path",{...o,d:"M9 11h6M12 11v5",strokeWidth:2})]});case"table":return f.jsx("svg",{...r,children:f.jsx("path",{...o,d:"M3 5h18M3 10h18M3 15h18M3 20h18M8 5v15M15 5v15"})});default:return f.jsx("svg",{...r,children:f.jsx("path",{...o,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 m1="yamchart-sidebar-folders";function C_(e){return e?e.replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()):"Ungrouped"}function p1(e){const t=new Map;for(const r of e){const o=r.folder??"";t.has(o)||t.set(o,[]),t.get(o).push(r)}const n=[];for(const[r,o]of t)o.sort((i,l)=>{const c=i.title||i.name,d=l.title||l.name;return c.localeCompare(d)}),n.push({folder:r,label:C_(r),items:o});return n.sort((r,o)=>!r.folder&&!o.folder?0:r.folder?o.folder?r.label.localeCompare(o.label):-1:1),n}function y1({expanded:e,className:t,style:n}){return f.jsx("svg",{className:nr("w-3.5 h-3.5 transition-transform",e&&"rotate-90",t),style:n,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}function g1({dashboards:e,charts:t,currentPath:n,onNavigate:r,collapsed:o=!1}){var L,_;const i=km(),l=n.split("?")[0],c=S=>l===S,d=((L=i.sidebarSections)==null?void 0:L.dashboards)!==!1,h=((_=i.sidebarSections)==null?void 0:_.charts)!==!1,p={backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)",borderColor:"var(--yc-color-primary)"},y=N.useMemo(()=>p1(e),[e]),b=N.useMemo(()=>p1(t),[t]),v=N.useMemo(()=>{for(const S of e)if(c(`/dashboards/${S.name}`))return S.folder??"";return null},[e,l]),D=N.useMemo(()=>{for(const S of t)if(c(`/charts/${S.name}`))return S.folder??"";return null},[t,l]),[k,E]=N.useState(()=>{try{const S=localStorage.getItem(m1);return S?JSON.parse(S):{}}catch{return{}}});N.useEffect(()=>{try{localStorage.setItem(m1,JSON.stringify(k))}catch{}},[k]);const T=N.useCallback((S,I)=>{const P=`${S}:${I}`;return S==="dashboards"&&v===I||S==="charts"&&D===I?!0:k[P]??!1},[k,v,D]),C=N.useCallback((S,I)=>{const P=`${S}:${I}`,U=S==="dashboards"&&v===I||S==="charts"&&D===I;E(F=>{const H=F[P]??U;return{...F,[P]:!H}})},[v,D]),O=y.length>1||y.some(S=>S.folder!==""),A=b.length>1||b.some(S=>S.folder!=="");return f.jsx("aside",{className:nr("yc-sidebar border-r flex flex-col transition-all overflow-hidden",o?"w-16":"w-56"),style:{backgroundColor:"var(--yc-color-sidebar)",borderColor:"var(--yc-color-sidebar-border)"},children:o?f.jsxs("div",{className:"py-3 flex flex-col items-center gap-1 overflow-y-auto",children:[d&&e.map(S=>{const I=`/dashboards/${S.name}`,P=c(I);return f.jsx("button",{onClick:()=>r(I),className:"p-2 rounded transition-colors",title:S.title,style:P?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-sidebar-text-secondary)"},children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"})})},S.name)}),d&&h&&e.length>0&&t.length>0&&f.jsx("div",{className:"w-8 border-t my-1",style:{borderColor:"var(--yc-color-sidebar-border)"}}),h&&t.map(S=>{const I=`/charts/${S.name}`,P=c(I);return f.jsx("button",{onClick:()=>r(I),className:"p-2 rounded transition-colors",title:S.title,style:P?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-sidebar-text-secondary)"},children:f.jsx(zc,{type:S.type,className:"w-5 h-5"})},S.name)}),f.jsx("div",{className:"w-8 border-t my-1",style:{borderColor:"var(--yc-color-sidebar-border)"}}),f.jsx("button",{onClick:()=>r("/events"),className:"p-2 rounded transition-colors",title:"Events",style:c("/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:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"})})})]}):f.jsxs(f.Fragment,{children:[d&&e.length>0&&f.jsxs("div",{className:"py-2",children:[f.jsx("div",{className:"px-4 py-2 text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:"Dashboards"}),O?y.map(S=>{const I=T("dashboards",S.folder);return f.jsxs("div",{children:[f.jsxs("button",{onClick:()=>C("dashboards",S.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:[f.jsx(y1,{expanded:I}),f.jsx("span",{className:"truncate",children:S.label}),f.jsx("span",{className:"ml-auto opacity-50",children:S.items.length})]}),I&&S.items.map(P=>{const U=`/dashboards/${P.name}`,F=c(U);return f.jsxs("button",{onClick:()=>r(U),className:nr("w-full flex items-center gap-3 pl-8 pr-4 py-2 text-sm transition-colors",F&&"border-r-2"),style:F?p:{color:"var(--yc-color-sidebar-text)"},title:P.title,children:[f.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:f.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"})}),f.jsx("span",{className:"truncate",children:P.title})]},P.name)})]},S.folder)}):e.map(S=>{const I=`/dashboards/${S.name}`,P=c(I);return f.jsxs("button",{onClick:()=>r(I),className:nr("w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors",P&&"border-r-2"),style:P?p:{color:"var(--yc-color-sidebar-text)"},title:S.title,children:[f.jsx("svg",{className:"w-5 h-5 flex-shrink-0",style:{color:P?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"})}),f.jsx("span",{className:"truncate",children:S.title})]},S.name)})]}),d&&h&&e.length>0&&t.length>0&&f.jsx("div",{className:"mx-4 border-t",style:{borderColor:"var(--yc-color-sidebar-border)"}}),h&&t.length>0&&f.jsxs("div",{className:"py-2 flex-1 overflow-y-auto",children:[f.jsx("div",{className:"px-4 py-2 text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:"Charts"}),A?b.map(S=>{const I=T("charts",S.folder);return f.jsxs("div",{children:[f.jsxs("button",{onClick:()=>C("charts",S.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:[f.jsx(y1,{expanded:I}),f.jsx("span",{className:"truncate",children:S.label}),f.jsx("span",{className:"ml-auto opacity-50",children:S.items.length})]}),I&&S.items.map(P=>{const U=`/charts/${P.name}`,F=c(U);return f.jsxs("button",{onClick:()=>r(U),className:nr("w-full flex items-center gap-3 pl-8 pr-4 py-2 text-sm transition-colors",F&&"border-r-2"),style:F?p:{color:"var(--yc-color-sidebar-text)"},title:P.title,children:[f.jsx(zc,{type:P.type,className:"w-5 h-5 flex-shrink-0",style:{color:F?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"}}),f.jsx("span",{className:"truncate",children:P.title})]},P.name)})]},S.folder)}):t.map(S=>{const I=`/charts/${S.name}`,P=c(I);return f.jsxs("button",{onClick:()=>r(I),className:nr("w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors",P&&"border-r-2"),style:P?p:{color:"var(--yc-color-sidebar-text)"},title:S.title,children:[f.jsx(zc,{type:S.type,className:"w-5 h-5 flex-shrink-0",style:{color:P?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"}}),f.jsx("span",{className:"truncate",children:S.title})]},S.name)})]}),i.sidebarLinks&&i.sidebarLinks.length>0&&f.jsx("div",{className:"py-2 border-t",style:{borderColor:"var(--yc-color-sidebar-border)"},children:i.sidebarLinks.map(S=>f.jsxs("a",{href:S.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:[f.jsx("svg",{className:"w-5 h-5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"})}),f.jsx("span",{className:"truncate",children:S.label})]},S.url))}),f.jsx("div",{className:"py-2 border-t mt-auto",style:{borderColor:"var(--yc-color-sidebar-border)"},children:f.jsxs("button",{onClick:()=>r("/events"),className:nr("w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors",c("/events")&&"border-r-2"),style:c("/events")?p:{color:"var(--yc-color-sidebar-text)"},children:[f.jsx("svg",{className:"w-5 h-5 flex-shrink-0",style:{color:c("/events")?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"})}),f.jsx("span",{children:"Events"})]})})]})})}function __({connection:e}){return f.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:[f.jsx("div",{className:"absolute -top-1 right-4 w-2 h-2 bg-gray-900 rotate-45"}),f.jsxs("div",{className:"space-y-1.5",children:[f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Name"}),f.jsx("span",{className:"font-medium",children:e.name})]}),f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Type"}),f.jsx("span",{className:"font-medium capitalize",children:e.type})]}),(e.type==="duckdb"||e.type==="sqlite")&&e.path&&f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Path"}),f.jsx("span",{className:"font-medium truncate max-w-[120px]",title:e.path,children:e.path})]}),(e.type==="postgres"||e.type==="mysql")&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Host"}),f.jsxs("span",{className:"font-medium",children:[e.host,":",e.port]})]}),f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Database"}),f.jsx("span",{className:"font-medium",children:e.database})]}),e.schema&&f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Schema"}),f.jsx("span",{className:"font-medium",children:e.schema})]})]}),e.type==="snowflake"&&f.jsxs(f.Fragment,{children:[e.account&&f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Account"}),f.jsx("span",{className:"font-medium truncate max-w-[120px]",title:e.account,children:e.account})]}),e.warehouse&&f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Warehouse"}),f.jsx("span",{className:"font-medium",children:e.warehouse})]}),e.database&&f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Database"}),f.jsx("span",{className:"font-medium",children:e.database})]}),e.schema&&f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Schema"}),f.jsx("span",{className:"font-medium",children:e.schema})]}),e.role&&f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Role"}),f.jsx("span",{className:"font-medium",children:e.role})]})]})]})]})}function N_({status:e,connection:t,connectionStatus:n,authType:r}){const o=Wn(),[i,l]=N.useState(!1),[c,d]=N.useState(null),h=n==="disconnected",p=n?n==="connected":e==="ok",y=h&&r==="externalbrowser",b=async()=>{l(!0),d(null);try{await xt.reconnect(),await o.invalidateQueries()}catch(v){d(v instanceof Error?v.message:"Reconnection failed")}finally{l(!1)}};return f.jsxs("div",{className:"relative group",children:[f.jsxs("div",{className:"flex items-center gap-2 cursor-default",children:[i?f.jsx("span",{className:"w-2 h-2 rounded-full animate-pulse",style:{backgroundColor:"var(--yc-color-warning, #f59e0b)"}}):f.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:p?"var(--yc-color-success)":"var(--yc-color-danger)"}}),f.jsx("span",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:i?"Reconnecting...":p?"Connected":"Disconnected"}),y&&!i&&f.jsx("button",{onClick:b,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&&f.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&&f.jsx(__,{connection:t})]})}const ko=Fx(e=>({auth:{status:"loading"},providers:[],checkAuth:async()=>{try{const t=await xt.getAuthMe(),n=t.providers??[];t.needsSetup?e({auth:{status:"needs_setup"},providers:n}):t.user?e({auth:{status:"authenticated",user:t.user},providers:n}):e({auth:{status:"unauthenticated"},providers:n})}catch(t){t instanceof ou?t.status===404?e({auth:{status:"disabled"},providers:[]}):e({auth:{status:"disabled"},providers:[]}):e({auth:{status:"disabled"},providers:[]})}},login:async(t,n)=>{const{user:r}=await xt.authLogin({email:t,password:n});e({auth:{status:"authenticated",user:r}})},setup:async(t,n,r)=>{const{user:o}=await xt.authSetup({email:t,name:n,password:r});e({auth:{status:"authenticated",user:o}})},logout:async()=>{await xt.authLogout(),e({auth:{status:"unauthenticated"}})}}));function D_({onClose:e}){const[t,n]=N.useState(""),[r,o]=N.useState(""),[i,l]=N.useState(""),[c,d]=N.useState(""),[h,p]=N.useState(!1),[y,b]=N.useState(!1),v=async D=>{if(D.preventDefault(),d(""),r!==i){d("New passwords do not match");return}if(r.length<8){d("Password must be at least 8 characters");return}b(!0);try{await xt.authChangePassword({current_password:t,new_password:r}),p(!0),setTimeout(e,1500)}catch(k){d(k instanceof ou?k.message:"An error occurred")}finally{b(!1)}};return f.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:e,children:f.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:[f.jsx("h2",{className:"text-lg font-semibold mb-4",style:{color:"var(--yc-color-text)"},children:"Change Password"}),h?f.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."}):f.jsxs("form",{onSubmit:v,className:"space-y-4",children:[c&&f.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}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium mb-1",style:{color:"var(--yc-color-text-secondary)"},children:"Current Password"}),f.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)"}})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium mb-1",style:{color:"var(--yc-color-text-secondary)"},children:"New Password"}),f.jsx("input",{type:"password",value:r,onChange:D=>o(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)"}})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium mb-1",style:{color:"var(--yc-color-text-secondary)"},children:"Confirm New Password"}),f.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)"}})]}),f.jsxs("div",{className:"flex justify-end gap-3",children:[f.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"}),f.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 O_({onNavigateToUsers:e,onNavigateToShares:t}){const n=ko(h=>h.auth),r=ko(h=>h.logout),[o,i]=N.useState(!1),[l,c]=N.useState(!1),d=N.useRef(null);return N.useEffect(()=>{const h=p=>{d.current&&!d.current.contains(p.target)&&i(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]),n.status!=="authenticated"?null:f.jsxs("div",{className:"relative",ref:d,children:[f.jsxs("button",{onClick:()=>i(!o),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:[f.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()}),f.jsx("span",{children:n.user.name})]}),o&&f.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:[f.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"&&f.jsxs(f.Fragment,{children:[f.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&&f.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"})]}),f.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"}),f.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&&f.jsx(D_,{onClose:()=>c(!1)})]})}function A_({onToggleSidebar:e,onOpenSearch:t,currentPath:n,onNavigateToUsers:r,onNavigateToShares:o}){var b;const i=km(),{mode:l,toggleMode:c}=n2(),{data:d}=Ak(),h=ko(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 f.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:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("button",{onClick:e,className:"p-1.5 rounded hover:bg-black/5 transition-colors",title:"Toggle sidebar",children:f.jsx("svg",{className:"w-5 h-5",style:{color:"var(--yc-color-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),y&&f.jsx("img",{src:y,alt:"",className:"h-6 w-auto"}),f.jsx("nav",{className:"flex items-center gap-1.5 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:p.map((v,D)=>f.jsxs("span",{className:"flex items-center gap-1.5",children:[D>0&&f.jsx("span",{children:"/"}),f.jsx("span",{className:D===p.length-1?"font-medium":"",style:D===p.length-1?{color:"var(--yc-color-text)"}:void 0,children:v})]},D))})]}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.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:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),f.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"&&((b=navigator.platform)!=null&&b.includes("Mac"))?"⌘K":"Ctrl+K"})]}),f.jsx(N_,{status:d==null?void 0:d.status,connection:d==null?void 0:d.connection,connectionStatus:d==null?void 0:d.connectionStatus,authType:d==null?void 0:d.authType}),f.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"?f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"})}):f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"})})}),f.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["v",d==null?void 0:d.version]}),h.status==="authenticated"&&r&&f.jsx(O_,{onNavigateToUsers:r,onNavigateToShares:o})]})]})}function I_({className:e,style:t}){return f.jsx("svg",{className:e,style:t,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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 b1(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),o=e.slice(n,n+t.length),i=e.slice(n+t.length);return f.jsxs(f.Fragment,{children:[r,f.jsx("mark",{style:{color:"var(--yc-color-primary)",backgroundColor:"transparent",fontWeight:600},children:o}),i]})}function M_(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 o=Math.floor((n-t.length)/2);let i=Math.max(0,r-o),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 x1({item:e,query:t,isActive:n,onClick:r,onMouseEnter:o}){const i=t.trim().toLowerCase(),l=i&&e.title.toLowerCase().includes(i),c=e.description&&(!i||!l);return f.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:o,"data-active":n||void 0,children:[f.jsx("div",{className:"flex-shrink-0",style:{color:"var(--yc-color-text-secondary)"},children:e.kind==="dashboard"?f.jsx(I_,{className:"w-5 h-5"}):f.jsx(zc,{type:e.type,className:"w-5 h-5"})}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"text-sm truncate",children:b1(e.title,t)}),c&&f.jsx("div",{className:"text-xs truncate mt-0.5",style:{color:"var(--yc-color-text-secondary)"},children:i?b1(M_(e.description,t),t):e.description})]})]})}function L_({isOpen:e,onClose:t,onNavigate:n,dashboards:r,charts:o}){const i=N.useRef(null),l=N.useMemo(()=>r.map(L=>({kind:"dashboard",name:L.name,title:L.title,description:L.description})),[r]),c=N.useMemo(()=>o.map(L=>({kind:"chart",name:L.name,title:L.title,description:L.description,type:L.type})),[o]),{query:d,activeIndex:h,results:p,setQuery:y,setActiveIndex:b,moveDown:v,moveUp:D,resetSearch:k,activeItem:E}=b_(l,c);if(N.useEffect(()=>{if(e){const L=setTimeout(()=>{var _;return(_=i.current)==null?void 0:_.focus()},50);return()=>clearTimeout(L)}else k()},[e,k]),N.useEffect(()=>{if(!e)return;const L=document.querySelector('[data-active="true"]');L&&L.scrollIntoView({block:"nearest"})},[e,h]),N.useEffect(()=>{if(!e)return;function L(_){switch(_.key){case"ArrowDown":_.preventDefault(),v();break;case"Tab":_.preventDefault(),_.shiftKey?D():v();break;case"ArrowUp":_.preventDefault(),D();break;case"Enter":if(_.preventDefault(),E){const S=E.kind==="dashboard"?`/dashboards/${E.name}`:`/charts/${E.name}`;n(S),t()}break;case"Escape":_.preventDefault(),t();break}}return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[e,E,v,D,n,t]),!e)return null;const T=d.trim().length>0,C=T&&p.all.length===0,O=p.dashboards.length;function A(L){const _=L.kind==="dashboard"?`/dashboards/${L.name}`:`/charts/${L.name}`;n(_),t()}return f.jsx("div",{className:"fixed inset-0 z-50 flex justify-center",style:{backgroundColor:"rgba(0, 0, 0, 0.5)"},onClick:L=>{L.target===L.currentTarget&&t()},children:f.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:[f.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b",style:{borderColor:"var(--yc-color-border)"},children:[f.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:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),f.jsx("input",{ref:i,type:"text",value:d,onChange:L=>y(L.target.value),placeholder:"Search dashboards and charts...",className:"flex-1 bg-transparent outline-none text-sm",style:{color:"var(--yc-color-text)"}}),T&&f.jsx("button",{onClick:()=>y(""),className:"p-0.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsx("div",{className:"overflow-y-auto py-2",style:{maxHeight:"20rem"},children:C?f.jsxs("div",{className:"px-3 py-8 text-center text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["No results for “",d,"”"]}):f.jsxs(f.Fragment,{children:[p.dashboards.length>0&&f.jsxs("div",{children:[f.jsx("div",{className:"px-3 py-1.5 text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-text-secondary)"},children:"Dashboards"}),p.dashboards.map((L,_)=>f.jsx(x1,{item:L,query:d,isActive:_===h,onClick:()=>A(L),onMouseEnter:()=>b(_)},`dashboard-${L.name}`))]}),p.charts.length>0&&f.jsxs("div",{children:[f.jsx("div",{className:"px-3 py-1.5 text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-text-secondary)"},children:"Charts"}),p.charts.map((L,_)=>f.jsx(x1,{item:L,query:d,isActive:O+_===h,onClick:()=>A(L),onMouseEnter:()=>b(O+_)},`chart-${L.name}`))]})]})})]})})}const v1="yamchart-sidebar-hidden";function R_({children:e,currentPath:t,onNavigate:n,onNavigateToUsers:r,onNavigateToShares:o}){const{data:i}=ma(),{data:l}=t2(),c=km(),d=dm(),h=(i==null?void 0:i.charts)||[],p=l||[],[y,b]=N.useState(()=>c.sidebarShow?localStorage.getItem(v1)==="true":!0),[v,D]=N.useState(!1),[k,E]=N.useState(!1);N.useEffect(()=>{const A=L=>{(L.metaKey||L.ctrlKey)&&L.key==="k"&&(L.preventDefault(),E(!0))};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[]);const T=!y&&d!=="sm",C=d==="md"&&!y,O=N.useCallback(()=>{if(d==="sm"){D(A=>!A);return}b(A=>{const L=!A;return localStorage.setItem(v1,String(L)),L})},[d]);return f.jsxs("div",{className:"flex h-screen",style:{backgroundColor:"var(--yc-color-background)"},children:[T&&f.jsx(g1,{dashboards:p,charts:h,currentPath:t,onNavigate:n,collapsed:C}),d==="sm"&&v&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 transition-opacity",onClick:()=>D(!1)}),f.jsx("aside",{className:"fixed inset-y-0 left-0 z-50 w-64 shadow-xl",style:{backgroundColor:"var(--yc-color-sidebar)"},children:f.jsx(g1,{dashboards:p,charts:h,currentPath:t,onNavigate:A=>{n(A),D(!1)}})})]}),f.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[f.jsx(A_,{onToggleSidebar:O,onOpenSearch:()=>E(!0),currentPath:t,onNavigateToUsers:r,onNavigateToShares:o}),f.jsx("main",{className:"flex-1 overflow-auto",children:e})]}),f.jsx(L_,{isOpen:k,onClose:()=>E(!1),onNavigate:A=>{n(A),E(!1)},dashboards:p,charts:h})]})}function P_(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 Ph={},Il={};function qo(e,t){try{const r=(Ph[e]||(Ph[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in Il?Il[r]:E1(r,r.split(":"))}catch{if(e in Il)return Il[e];const n=e==null?void 0:e.match(j_);return n?E1(e,n.slice(1)):NaN}}const j_=/([+-]\d\d):?(\d\d)?/;function E1(e,t){const n=+(t[0]||0),r=+(t[1]||0),o=+(t[2]||0)/60;return Il[e]=n*60+r>0?n*60+r+o:n*60-r-o}class is extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(qo(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)),i2(this),L0(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new is(...n,t):new is(Date.now(),t)}withTimeZone(t){return new is(+this,t)}getTimezoneOffset(){const t=-qo(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),L0(this),+this}[Symbol.for("constructDateFrom")](t){return new is(+new Date(t),this.timeZone)}}const T1=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!T1.test(e))return;const t=e.replace(T1,"$1UTC");is.prototype[t]&&(e.startsWith("get")?is.prototype[e]=function(){return this.internal[t]()}:(is.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),F_(this),+this},is.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),L0(this),+this}))});function L0(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-qo(e.timeZone,e)*60))}function F_(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()),i2(e)}function i2(e){const t=qo(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const o=-new Date(+e).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),l=o-i,c=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();l&&c&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+l);const d=o-n;d&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+d);const h=new Date(+e);h.setUTCSeconds(0);const p=o>0?h.getSeconds():(h.getSeconds()-60)%60,y=Math.round(-(qo(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 b=qo(e.timeZone,e),v=b>0?Math.floor(b):Math.ceil(b),k=-new Date(+e).getTimezoneOffset()-v,E=v!==n,T=k-d;if(E&&T){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+T);const C=qo(e.timeZone,e),O=C>0?Math.floor(C):Math.ceil(C),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 is{static tz(t,...n){return n.length?new jn(...n,t):new jn(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),o=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,o]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${o}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,o]=this.tzComponents();return`${t} GMT${n}${r}${o} (${P_(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"),o=String(Math.abs(t)%60).padStart(2,"0");return[n,r,o]}withTimeZone(t){return new jn(+this,t)}[Symbol.for("constructDateFrom")](t){return new jn(+new Date(t),this.timeZone)}}const w1=5,B_=4;function H_(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,-r+1),i=t.addDays(o,w1*7-1);return t.getMonth(e)===t.getMonth(i)?w1:B_}function l2(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 U_(e,t){const n=l2(e,t),r=H_(e,t);return t.addDays(n,r*7-1)}const u2={...Yo,labels:{labelDayButton:(e,t,n,r)=>{let o;r&&typeof r.format=="function"?o=r.format.bind(r):o=(l,c)=>on(l,c,{locale:Yo,...n});let i=o(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=(o,i)=>on(o,i,{locale:Yo,...t}),r(e,"LLLL yyyy")},labelGridcell:(e,t,n,r)=>{let o;r&&typeof r.format=="function"?o=r.format.bind(r):o=(l,c)=>on(l,c,{locale:Yo,...n});let i=o(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=(o,i)=>on(o,i,{locale:Yo,...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,o,i)=>{var l;return(l=this.overrides)!=null&&l.newDate?this.overrides.newDate(r,o,i):this.options.timeZone?new jn(r,o,i,this.options.timeZone):new Date(r,o,i)},this.addDays=(r,o)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(r,o):Ms(r,o)},this.addMonths=(r,o)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(r,o):vi(r,o)},this.addWeeks=(r,o)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(r,o):fd(r,o)},this.addYears=(r,o)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(r,o):hd(r,o)},this.differenceInCalendarDays=(r,o)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,o):pm(r,o)},this.differenceInCalendarMonths=(r,o)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,o):zx(r,o)},this.eachMonthOfInterval=r=>{var o;return(o=this.overrides)!=null&&o.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):Yk(r)},this.eachYearOfInterval=r=>{var c;const o=(c=this.overrides)!=null&&c.eachYearOfInterval?this.overrides.eachYearOfInterval(r):$k(r),i=new Set(o.map(d=>this.getYear(d)));if(i.size===o.length)return o;const l=[];return i.forEach(d=>{l.push(new Date(d,0,1))}),l},this.endOfBroadcastWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):U_(r,this)},this.endOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfISOWeek?this.overrides.endOfISOWeek(r):qk(r)},this.endOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.endOfMonth?this.overrides.endOfMonth(r):md(r)},this.endOfWeek=(r,o)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(r,o):yd(r,this.options)},this.endOfYear=r=>{var o;return(o=this.overrides)!=null&&o.endOfYear?this.overrides.endOfYear(r):pd(r)},this.format=(r,o,i)=>{var c;const l=(c=this.overrides)!=null&&c.format?this.overrides.format(r,o,this.options):on(r,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(l):l},this.getISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.getISOWeek?this.overrides.getISOWeek(r):gd(r)},this.getMonth=(r,o)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(r,this.options):US(r,this.options)},this.getYear=(r,o)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(r,this.options):zS(r,this.options)},this.getWeek=(r,o)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(r,this.options):bd(r,this.options)},this.isAfter=(r,o)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(r,o):WS(r,o)},this.isBefore=(r,o)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(r,o):YS(r,o)},this.isDate=r=>{var o;return(o=this.overrides)!=null&&o.isDate?this.overrides.isDate(r):Ux(r)},this.isSameDay=(r,o)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(r,o):Uk(r,o)},this.isSameMonth=(r,o)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(r,o):HC(r,o)},this.isSameYear=(r,o)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(r,o):UC(r,o)},this.max=r=>{var o;return(o=this.overrides)!=null&&o.max?this.overrides.max(r):Bk(r)},this.min=r=>{var o;return(o=this.overrides)!=null&&o.min?this.overrides.min(r):Hk(r)},this.setMonth=(r,o)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(r,o):r_(r,o)},this.setYear=(r,o)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(r,o):s_(r,o)},this.startOfBroadcastWeek=(r,o)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):l2(r,this)},this.startOfDay=r=>{var o;return(o=this.overrides)!=null&&o.startOfDay?this.overrides.startOfDay(r):ua(r)},this.startOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.startOfISOWeek?this.overrides.startOfISOWeek(r):la(r)},this.startOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.startOfMonth?this.overrides.startOfMonth(r):ql(r)},this.startOfWeek=(r,o)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(r,this.options):zr(r,this.options)},this.startOfYear=r=>{var o;return(o=this.overrides)!=null&&o.startOfYear?this.overrides.startOfYear(r):mi(r)},this.options={locale:u2,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let o=0;o<10;o++)r[o.toString()]=n.format(o);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:o}=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:o}).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 ds=new mr;class c2{constructor(t,n,r=ds){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 z_{constructor(t,n){this.date=t,this.weeks=n}}class W_{constructor(t,n){this.days=n,this.weekNumber=t}}function Y_(e){return Ie.createElement("button",{...e})}function $_(e){return Ie.createElement("span",{...e})}function q_(e){const{size:t=24,orientation:n="left",className:r}=e;return Ie.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&Ie.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&Ie.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&Ie.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&Ie.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function V_(e){const{day:t,modifiers:n,...r}=e;return Ie.createElement("td",{...r})}function Q_(e){const{day:t,modifiers:n,...r}=e,o=Ie.useRef(null);return Ie.useEffect(()=>{var i;n.focused&&((i=o.current)==null||i.focus())},[n.focused]),Ie.createElement("button",{ref:o,...r})}var Qe;(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"})(Qe||(Qe={}));var Kt;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Kt||(Kt={}));var Ur;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Ur||(Ur={}));var dr;(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"})(dr||(dr={}));function G_(e){const{options:t,className:n,components:r,classNames:o,...i}=e,l=[o[Qe.Dropdown],n].join(" "),c=t==null?void 0:t.find(({value:d})=>d===i.value);return Ie.createElement("span",{"data-disabled":i.disabled,className:o[Qe.DropdownRoot]},Ie.createElement(r.Select,{className:l,...i},t==null?void 0:t.map(({value:d,label:h,disabled:p})=>Ie.createElement(r.Option,{key:d,value:d,disabled:p},h))),Ie.createElement("span",{className:o[Qe.CaptionLabel],"aria-hidden":!0},c==null?void 0:c.label,Ie.createElement(r.Chevron,{orientation:"down",size:18,className:o[Qe.Chevron]})))}function K_(e){return Ie.createElement("div",{...e})}function X_(e){return Ie.createElement("div",{...e})}function J_(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Ie.createElement("div",{...r},e.children)}function Z_(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Ie.createElement("div",{...r})}function eN(e){return Ie.createElement("table",{...e})}function tN(e){return Ie.createElement("div",{...e})}const d2=N.createContext(void 0);function au(){const e=N.useContext(d2);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function nN(e){const{components:t}=au();return Ie.createElement(t.Dropdown,{...e})}function rN(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...i}=e,{components:l,classNames:c,labels:{labelPrevious:d,labelNext:h}}=au(),p=N.useCallback(b=>{o&&(n==null||n(b))},[o,n]),y=N.useCallback(b=>{r&&(t==null||t(b))},[r,t]);return Ie.createElement("nav",{...i},Ie.createElement(l.PreviousMonthButton,{type:"button",className:c[Qe.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":d(r),onClick:y},Ie.createElement(l.Chevron,{disabled:r?void 0:!0,className:c[Qe.Chevron],orientation:"left"})),Ie.createElement(l.NextMonthButton,{type:"button",className:c[Qe.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":h(o),onClick:p},Ie.createElement(l.Chevron,{disabled:o?void 0:!0,orientation:"right",className:c[Qe.Chevron]})))}function sN(e){const{components:t}=au();return Ie.createElement(t.Button,{...e})}function oN(e){return Ie.createElement("option",{...e})}function aN(e){const{components:t}=au();return Ie.createElement(t.Button,{...e})}function iN(e){const{rootRef:t,...n}=e;return Ie.createElement("div",{...n,ref:t})}function lN(e){return Ie.createElement("select",{...e})}function uN(e){const{week:t,...n}=e;return Ie.createElement("tr",{...n})}function cN(e){return Ie.createElement("th",{...e})}function dN(e){return Ie.createElement("thead",{"aria-hidden":!0},Ie.createElement("tr",{...e}))}function fN(e){const{week:t,...n}=e;return Ie.createElement("th",{...n})}function hN(e){return Ie.createElement("th",{...e})}function mN(e){return Ie.createElement("tbody",{...e})}function pN(e){const{components:t}=au();return Ie.createElement(t.Dropdown,{...e})}const yN=Object.freeze(Object.defineProperty({__proto__:null,Button:Y_,CaptionLabel:$_,Chevron:q_,Day:V_,DayButton:Q_,Dropdown:G_,DropdownNav:K_,Footer:X_,Month:J_,MonthCaption:Z_,MonthGrid:eN,Months:tN,MonthsDropdown:nN,Nav:rN,NextMonthButton:sN,Option:oN,PreviousMonthButton:aN,Root:iN,Select:lN,Week:uN,WeekNumber:fN,WeekNumberHeader:hN,Weekday:cN,Weekdays:dN,Weeks:mN,YearsDropdown:pN},Symbol.toStringTag,{value:"Module"}));function Os(e,t,n=!1,r=ds){let{from:o,to:i}=e;const{differenceInCalendarDays:l,isSameDay:c}=r;return o&&i?(l(i,o)<0&&([o,i]=[i,o]),l(t,o)>=(n?1:0)&&l(i,t)>=(n?1:0)):!n&&i?c(i,t):!n&&o?c(o,t):!1}function Sm(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function xd(e){return!!(e&&typeof e=="object"&&"from"in e)}function Cm(e){return!!(e&&typeof e=="object"&&"after"in e)}function _m(e){return!!(e&&typeof e=="object"&&"before"in e)}function f2(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function h2(e,t){return Array.isArray(e)&&e.every(t.isDate)}function As(e,t,n=ds){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:i,isAfter:l}=n;return r.some(c=>{if(typeof c=="boolean")return c;if(n.isDate(c))return o(e,c);if(h2(c,n))return c.some(d=>o(e,d));if(xd(c))return Os(c,e,!1,n);if(f2(c))return Array.isArray(c.dayOfWeek)?c.dayOfWeek.includes(e.getDay()):c.dayOfWeek===e.getDay();if(Sm(c)){const d=i(c.before,e),h=i(c.after,e),p=d>0,y=h<0;return l(c.before,c.after)?y&&p:p||y}return Cm(c)?i(e,c.after)>0:_m(c)?i(c.before,e)>0:typeof c=="function"?c(e):!1})}function gN(e,t,n,r,o){const{disabled:i,hidden:l,modifiers:c,showOutsideDays:d,broadcastCalendar:h,today:p=o.today()}=t,{isSameDay:y,isSameMonth:b,startOfMonth:v,isBefore:D,endOfMonth:k,isAfter:E}=o,T=n&&v(n),C=r&&k(r),O={[Kt.focused]:[],[Kt.outside]:[],[Kt.disabled]:[],[Kt.hidden]:[],[Kt.today]:[]},A={};for(const L of e){const{date:_,displayMonth:S}=L,I=!!(S&&!b(_,S)),P=!!(T&&D(_,T)),U=!!(C&&E(_,C)),F=!!(i&&As(_,i,o)),H=!!(l&&As(_,l,o))||P||U||!h&&!d&&I||h&&d===!1&&I,W=y(_,p);I&&O.outside.push(L),F&&O.disabled.push(L),H&&O.hidden.push(L),W&&O.today.push(L),c&&Object.keys(c).forEach($=>{const Q=c==null?void 0:c[$];Q&&As(_,Q,o)&&(A[$]?A[$].push(L):A[$]=[L])})}return L=>{const _={[Kt.focused]:!1,[Kt.disabled]:!1,[Kt.hidden]:!1,[Kt.outside]:!1,[Kt.today]:!1},S={};for(const I in O){const P=O[I];_[I]=P.some(U=>U===L)}for(const I in A)S[I]=A[I].some(P=>P===L);return{..._,...S}}}function bN(e,t,n={}){return Object.entries(e).filter(([,o])=>o===!0).reduce((o,[i])=>(n[i]?o.push(n[i]):t[Kt[i]]?o.push(t[Kt[i]]):t[Ur[i]]&&o.push(t[Ur[i]]),o),[t[Qe.Day]])}function xN(e){return{...yN,...e}}function vN(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 EN(){const e={};for(const t in Qe)e[Qe[t]]=`rdp-${Qe[t]}`;for(const t in Kt)e[Kt[t]]=`rdp-${Kt[t]}`;for(const t in Ur)e[Ur[t]]=`rdp-${Ur[t]}`;for(const t in dr)e[dr[t]]=`rdp-${dr[t]}`;return e}function m2(e,t,n){return(n??new mr(t)).formatMonthYear(e)}const TN=m2;function wN(e,t,n){return(n??new mr(t)).format(e,"d")}function kN(e,t=ds){return t.format(e,"LLLL")}function SN(e,t,n){return(n??new mr(t)).format(e,"cccccc")}function CN(e,t=ds){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function _N(){return""}function p2(e,t=ds){return t.format(e,"yyyy")}const NN=p2,DN=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:m2,formatDay:wN,formatMonthCaption:TN,formatMonthDropdown:kN,formatWeekNumber:CN,formatWeekNumberHeader:_N,formatWeekdayName:SN,formatYearCaption:NN,formatYearDropdown:p2},Symbol.toStringTag,{value:"Module"}));function ON(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...DN,...e}}function Nm(e,t,n,r){let o=(r??new mr(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const AN=Nm;function Dm(e,t,n){return(n??new mr(t)).formatMonthYear(e)}const IN=Dm;function y2(e,t,n,r){let o=(r??new mr(n)).format(e,"PPPP");return t!=null&&t.today&&(o=`Today, ${o}`),o}function g2(e){return"Choose the Month"}function b2(){return""}const MN="Go to the Next Month";function x2(e,t){return MN}function v2(e){return"Go to the Previous Month"}function E2(e,t,n){return(n??new mr(t)).format(e,"cccc")}function T2(e,t){return`Week ${e}`}function w2(e){return"Week Number"}function k2(e){return"Choose the Year"}const LN=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:IN,labelDay:AN,labelDayButton:Nm,labelGrid:Dm,labelGridcell:y2,labelMonthDropdown:g2,labelNav:b2,labelNext:x2,labelPrevious:v2,labelWeekNumber:T2,labelWeekNumberHeader:w2,labelWeekday:E2,labelYearDropdown:k2},Symbol.toStringTag,{value:"Module"})),jr=(e,t,n)=>t||(n?typeof n=="function"?n:(...r)=>n:e);function RN(e,t){var r;const n=((r=t.locale)==null?void 0:r.labels)??{};return{...LN,...e??{},labelDayButton:jr(Nm,e==null?void 0:e.labelDayButton,n.labelDayButton),labelMonthDropdown:jr(g2,e==null?void 0:e.labelMonthDropdown,n.labelMonthDropdown),labelNext:jr(x2,e==null?void 0:e.labelNext,n.labelNext),labelPrevious:jr(v2,e==null?void 0:e.labelPrevious,n.labelPrevious),labelWeekNumber:jr(T2,e==null?void 0:e.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:jr(k2,e==null?void 0:e.labelYearDropdown,n.labelYearDropdown),labelGrid:jr(Dm,e==null?void 0:e.labelGrid,n.labelGrid),labelGridcell:jr(y2,e==null?void 0:e.labelGridcell,n.labelGridcell),labelNav:jr(b2,e==null?void 0:e.labelNav,n.labelNav),labelWeekNumberHeader:jr(w2,e==null?void 0:e.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:jr(E2,e==null?void 0:e.labelWeekday,n.labelWeekday)}}function PN(e,t,n,r,o){const{startOfMonth:i,startOfYear:l,endOfYear:c,eachMonthOfInterval:d,getMonth:h}=o;return d({start:l(e),end:c(e)}).map(b=>{const v=r.formatMonthDropdown(b,o),D=h(b),k=t&&b<i(t)||n&&b>i(n)||!1;return{value:D,label:v,disabled:k}})}function jN(e,t={},n={}){let r={...t==null?void 0:t[Qe.Day]};return Object.entries(e).filter(([,o])=>o===!0).forEach(([o])=>{r={...r,...n==null?void 0:n[o]}}),r}function FN(e,t,n,r){const o=r??e.today(),i=n?e.startOfBroadcastWeek(o,e):t?e.startOfISOWeek(o):e.startOfWeek(o),l=[];for(let c=0;c<7;c++){const d=e.addDays(i,c);l.push(d)}return l}function BN(e,t,n,r,o=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:l,eachYearOfInterval:c,getYear:d}=r,h=i(e),p=l(t),y=c({start:h,end:p});return o&&y.reverse(),y.map(b=>{const v=n.formatYearDropdown(b,r);return{value:d(b),label:v,disabled:!1}})}function HN(e,t={}){var c;const{weekStartsOn:n,locale:r}=t,o=n??((c=r==null?void 0:r.options)==null?void 0:c.weekStartsOn)??0,i=d=>{const h=typeof d=="number"||typeof d=="string"?new Date(d):d;return new jn(h.getFullYear(),h.getMonth(),h.getDate(),12,0,0,e)},l=d=>{const h=i(d);return new Date(h.getFullYear(),h.getMonth(),h.getDate(),0,0,0,0)};return{today:()=>i(jn.tz(e)),newDate:(d,h,p)=>new jn(d,h,p,12,0,0,e),startOfDay:d=>i(d),startOfWeek:(d,h)=>{const p=i(d),y=(h==null?void 0:h.weekStartsOn)??o,b=(p.getDay()-y+7)%7;return p.setDate(p.getDate()-b),p},startOfISOWeek:d=>{const h=i(d),p=(h.getDay()-1+7)%7;return h.setDate(h.getDate()-p),h},startOfMonth:d=>{const h=i(d);return h.setDate(1),h},startOfYear:d=>{const h=i(d);return h.setMonth(0,1),h},endOfWeek:(d,h)=>{const p=i(d),v=((((h==null?void 0:h.weekStartsOn)??o)+6)%7-p.getDay()+7)%7;return p.setDate(p.getDate()+v),p},endOfISOWeek:d=>{const h=i(d),p=(7-h.getDay())%7;return h.setDate(h.getDate()+p),h},endOfMonth:d=>{const h=i(d);return h.setMonth(h.getMonth()+1,0),h},endOfYear:d=>{const h=i(d);return h.setMonth(11,31),h},eachMonthOfInterval:d=>{const h=i(d.start),p=i(d.end),y=[],b=new jn(h.getFullYear(),h.getMonth(),1,12,0,0,e),v=p.getFullYear()*12+p.getMonth();for(;b.getFullYear()*12+b.getMonth()<=v;)y.push(new jn(b,e)),b.setMonth(b.getMonth()+1,1);return y},addDays:(d,h)=>{const p=i(d);return p.setDate(p.getDate()+h),p},addWeeks:(d,h)=>{const p=i(d);return p.setDate(p.getDate()+h*7),p},addMonths:(d,h)=>{const p=i(d);return p.setMonth(p.getMonth()+h),p},addYears:(d,h)=>{const p=i(d);return p.setFullYear(p.getFullYear()+h),p},eachYearOfInterval:d=>{const h=i(d.start),p=i(d.end),y=[],b=new jn(h.getFullYear(),0,1,12,0,0,e);for(;b.getFullYear()<=p.getFullYear();)y.push(new jn(b,e)),b.setFullYear(b.getFullYear()+1,0,1);return y},getWeek:(d,h)=>{var y;const p=l(d);return bd(p,{weekStartsOn:(h==null?void 0:h.weekStartsOn)??o,firstWeekContainsDate:(h==null?void 0:h.firstWeekContainsDate)??((y=r==null?void 0:r.options)==null?void 0:y.firstWeekContainsDate)??1})},getISOWeek:d=>{const h=l(d);return gd(h)},differenceInCalendarDays:(d,h)=>{const p=l(d),y=l(h);return pm(p,y)},differenceInCalendarMonths:(d,h)=>{const p=l(d),y=l(h);return zx(p,y)}}}const iu=e=>e instanceof HTMLElement?e:null,jh=e=>[...e.querySelectorAll("[data-animated-month]")??[]],UN=e=>iu(e.querySelector("[data-animated-month]")),Fh=e=>iu(e.querySelector("[data-animated-caption]")),Bh=e=>iu(e.querySelector("[data-animated-weeks]")),zN=e=>iu(e.querySelector("[data-animated-nav]")),WN=e=>iu(e.querySelector("[data-animated-weekdays]"));function YN(e,t,{classNames:n,months:r,focused:o,dateLib:i}){const l=N.useRef(null),c=N.useRef(r),d=N.useRef(!1);N.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),b=y?n[dr.caption_after_enter]:n[dr.caption_before_enter],v=y?n[dr.weeks_after_enter]:n[dr.weeks_before_enter],D=l.current,k=e.current.cloneNode(!0);if(k instanceof HTMLElement?(jh(k).forEach(O=>{if(!(O instanceof HTMLElement))return;const A=UN(O);A&&O.contains(A)&&O.removeChild(A);const L=Fh(O);L&&L.classList.remove(b);const _=Bh(O);_&&_.classList.remove(v)}),l.current=k):l.current=null,d.current||p||o)return;const E=D instanceof HTMLElement?jh(D):[],T=jh(e.current);if(T!=null&&T.every(C=>C instanceof HTMLElement)&&E&&E.every(C=>C instanceof HTMLElement)){d.current=!0,e.current.style.isolation="isolate";const C=zN(e.current);C&&(C.style.zIndex="1"),T.forEach((O,A)=>{const L=E[A];if(!L)return;O.style.position="relative",O.style.overflow="hidden";const _=Fh(O);_&&_.classList.add(b);const S=Bh(O);S&&S.classList.add(v);const I=()=>{d.current=!1,e.current&&(e.current.style.isolation=""),C&&(C.style.zIndex=""),_&&_.classList.remove(b),S&&S.classList.remove(v),O.style.position="",O.style.overflow="",O.contains(L)&&O.removeChild(L)};L.style.pointerEvents="none",L.style.position="absolute",L.style.overflow="hidden",L.setAttribute("aria-hidden","true");const P=WN(L);P&&(P.style.opacity="0");const U=Fh(L);U&&(U.classList.add(y?n[dr.caption_before_exit]:n[dr.caption_after_exit]),U.addEventListener("animationend",I));const F=Bh(L);F&&F.classList.add(y?n[dr.weeks_before_exit]:n[dr.weeks_after_exit]),O.insertBefore(L,O.firstChild)})}})}function $N(e,t,n,r){const o=e[0],i=e[e.length-1],{ISOWeek:l,fixedWeeks:c,broadcastCalendar:d}=n??{},{addDays:h,differenceInCalendarDays:p,differenceInCalendarMonths:y,endOfBroadcastWeek:b,endOfISOWeek:v,endOfMonth:D,endOfWeek:k,isAfter:E,startOfBroadcastWeek:T,startOfISOWeek:C,startOfWeek:O}=r,A=d?T(o,r):l?C(o):O(o),L=d?b(i):l?v(D(i)):k(D(i)),_=t&&(d?b(t):l?v(t):k(t)),S=_&&E(L,_)?_:L,I=p(S,A),P=y(i,o)+1,U=[];for(let W=0;W<=I;W++){const $=h(A,W);U.push($)}const H=(d?35:42)*P;if(c&&U.length<H){const W=H-U.length;for(let $=0;$<W;$++){const Q=h(U[U.length-1],1);U.push(Q)}}return U}function qN(e){const t=[];return e.reduce((n,r)=>{const o=r.weeks.reduce((i,l)=>i.concat(l.days.slice()),t.slice());return n.concat(o.slice())},t.slice())}function VN(e,t,n,r){const{numberOfMonths:o=1}=n,i=[];for(let l=0;l<o;l++){const c=r.addMonths(e,l);if(t&&c>t)break;i.push(c)}return i}function k1(e,t,n,r){const{month:o,defaultMonth:i,today:l=r.today(),numberOfMonths:c=1}=e;let d=o||i||l;const{differenceInCalendarMonths:h,addMonths:p,startOfMonth:y}=r;if(n&&h(n,d)<c-1){const b=-1*(c-1);d=p(n,b)}return t&&h(d,t)<0&&(d=t),y(d)}function QN(e,t,n,r){const{addDays:o,endOfBroadcastWeek:i,endOfISOWeek:l,endOfMonth:c,endOfWeek:d,getISOWeek:h,getWeek:p,startOfBroadcastWeek:y,startOfISOWeek:b,startOfWeek:v}=r,D=e.reduce((k,E)=>{const T=n.broadcastCalendar?y(E,r):n.ISOWeek?b(E):v(E),C=n.broadcastCalendar?i(E):n.ISOWeek?l(c(E)):d(c(E)),O=t.filter(S=>S>=T&&S<=C),A=n.broadcastCalendar?35:42;if(n.fixedWeeks&&O.length<A){const S=t.filter(I=>{const P=A-O.length;return I>C&&I<=o(C,P)});O.push(...S)}const L=O.reduce((S,I)=>{const P=n.ISOWeek?h(I):p(I),U=S.find(H=>H.weekNumber===P),F=new c2(I,E,r);return U?U.days.push(F):S.push(new W_(P,[F])),S},[]),_=new z_(E,L);return k.push(_),k},[]);return n.reverseMonths?D.reverse():D}function GN(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:i,startOfMonth:l,endOfMonth:c,addYears:d,endOfYear:h,newDate:p,today:y}=t,{fromYear:b,toYear:v,fromMonth:D,toMonth:k}=e;!n&&D&&(n=D),!n&&b&&(n=t.newDate(b,0,1)),!r&&k&&(r=k),!r&&v&&(r=p(v,11,31));const E=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=l(n):b?n=p(b,0,1):!n&&E&&(n=o(d(e.today??y(),-100))),r?r=c(r):v?r=p(v,11,31):!r&&E&&(r=h(e.today??y())),[n&&i(n),r&&i(r)]}function KN(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:i=1}=n,{startOfMonth:l,addMonths:c,differenceInCalendarMonths:d}=r,h=o?i:1,p=l(e);if(!t)return c(p,h);if(!(d(t,e)<i))return c(p,h)}function XN(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:i}=n,{startOfMonth:l,addMonths:c,differenceInCalendarMonths:d}=r,h=o?i??1:1,p=l(e);if(!t)return c(p,-h);if(!(d(p,t)<=0))return c(p,-h)}function JN(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function vd(e,t){const[n,r]=N.useState(e);return[t===void 0?n:t,r]}function ZN(e,t){var A;const[n,r]=GN(e,t),{startOfMonth:o,endOfMonth:i}=t,l=k1(e,n,r,t),[c,d]=vd(l,e.month?l:void 0);N.useEffect(()=>{const L=k1(e,n,r,t);d(L)},[e.timeZone]);const{months:h,weeks:p,days:y,previousMonth:b,nextMonth:v}=N.useMemo(()=>{const L=VN(c,r,{numberOfMonths:e.numberOfMonths},t),_=$N(L,e.endMonth?i(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),S=QN(L,_,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),I=JN(S),P=qN(S),U=XN(c,n,e,t),F=KN(c,r,e,t);return{months:S,weeks:I,days:P,previousMonth:U,nextMonth:F}},[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,E=L=>p.some(_=>_.days.some(S=>S.isEqualTo(L))),T=L=>{if(D)return;let _=o(L);n&&_<o(n)&&(_=o(n)),r&&_>o(r)&&(_=o(r)),d(_),k==null||k(_)};return{months:h,weeks:p,days:y,navStart:n,navEnd:r,previousMonth:b,nextMonth:v,goToMonth:T,goToDay:L=>{E(L)||T(L.date)}}}var Jr;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Jr||(Jr={}));function S1(e){return!e[Kt.disabled]&&!e[Kt.hidden]&&!e[Kt.outside]}function e3(e,t,n,r){let o,i=-1;for(const l of e){const c=t(l);S1(c)&&(c[Kt.focused]&&i<Jr.FocusedModifier?(o=l,i=Jr.FocusedModifier):r!=null&&r.isEqualTo(l)&&i<Jr.LastFocused?(o=l,i=Jr.LastFocused):n(l.date)&&i<Jr.Selected?(o=l,i=Jr.Selected):c[Kt.today]&&i<Jr.Today&&(o=l,i=Jr.Today))}return o||(o=e.find(l=>S1(t(l)))),o}function t3(e,t,n,r,o,i,l){const{ISOWeek:c,broadcastCalendar:d}=i,{addDays:h,addMonths:p,addWeeks:y,addYears:b,endOfBroadcastWeek:v,endOfISOWeek:D,endOfWeek:k,max:E,min:T,startOfBroadcastWeek:C,startOfISOWeek:O,startOfWeek:A}=l;let _={day:h,week:y,month:p,year:b,startOfWeek:S=>d?C(S,l):c?O(S):A(S),endOfWeek:S=>d?v(S):c?D(S):k(S)}[e](n,t==="after"?1:-1);return t==="before"&&r?_=E([r,_]):t==="after"&&o&&(_=T([o,_])),_}function S2(e,t,n,r,o,i,l,c=0){if(c>365)return;const d=t3(e,t,n.date,r,o,i,l),h=!!(i.disabled&&As(d,i.disabled,l)),p=!!(i.hidden&&As(d,i.hidden,l)),y=d,b=new c2(d,y,l);return!h&&!p?b:S2(e,t,b,r,o,i,l,c+1)}function n3(e,t,n,r,o){const{autoFocus:i}=e,[l,c]=N.useState(),d=e3(t.days,n,r||(()=>!1),l),[h,p]=N.useState(i?d:void 0);return{isFocusTarget:k=>!!(d!=null&&d.isEqualTo(k)),setFocused:p,focused:h,blur:()=>{c(h),p(void 0)},moveFocus:(k,E)=>{if(!h)return;const T=S2(k,E,h,t.navStart,t.navEnd,e,o);T&&(e.disableNavigation&&!t.days.some(O=>O.isEqualTo(T))||(t.goToDay(T),p(T)))}}}function r3(e,t){const{selected:n,required:r,onSelect:o}=e,[i,l]=vd(n,o?n:void 0),c=o?n:i,{isSameDay:d}=t,h=v=>(c==null?void 0:c.some(D=>d(D,v)))??!1,{min:p,max:y}=e;return{selected:c,select:(v,D,k)=>{let E=[...c??[]];if(h(v)){if((c==null?void 0:c.length)===p||r&&(c==null?void 0:c.length)===1)return;E=c==null?void 0:c.filter(T=>!d(T,v))}else(c==null?void 0:c.length)===y?E=[v]:E=[...E,v];return o||l(E),o==null||o(E,v,D,k),E},isSelected:h}}function s3(e,t,n=0,r=0,o=!1,i=ds){const{from:l,to:c}=t||{},{isSameDay:d,isAfter:h,isBefore:p}=i;let y;if(!l&&!c)y={from:e,to:n>0?void 0:e};else if(l&&!c)d(l,e)?n===0?y={from:l,to:e}:o?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(d(l,e)&&d(c,e))o?y={from:l,to:c}:y=void 0;else if(d(l,e))y={from:l,to:n>0?void 0:e};else if(d(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 b=i.differenceInCalendarDays(y.to,y.from);r>0&&b>r?y={from:e,to:void 0}:n>1&&b<n&&(y={from:e,to:void 0})}return y}function o3(e,t,n=ds){const r=Array.isArray(t)?t:[t];let o=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(o.getDay()))return!0;o=n.addDays(o,1)}return!1}function C1(e,t,n=ds){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 a3(e,t,n=ds){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):h2(c,n)?c.some(d=>Os(e,d,!1,n)):xd(c)?c.from&&c.to?C1(e,{from:c.from,to:c.to},n):!1:f2(c)?o3(e,c.dayOfWeek,n):Sm(c)?n.isAfter(c.before,c.after)?C1(e,{from:n.addDays(c.after,1),to:n.addDays(c.before,-1)},n):As(e.from,c,n)||As(e.to,c,n):Cm(c)||_m(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 d=n.differenceInCalendarDays(e.to,e.from);for(let h=0;h<=d;h++){if(l.some(p=>p(c)))return!0;c=n.addDays(c,1)}}return!1}function i3(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:i,onSelect:l}=e,[c,d]=vd(o,l?o:void 0),h=l?o:c;return{selected:h,select:(b,v,D)=>{const{min:k,max:E}=e,T=b?s3(b,h,k,E,i,t):void 0;return r&&n&&(T!=null&&T.from)&&T.to&&a3({from:T.from,to:T.to},n,t)&&(T.from=b,T.to=void 0),l||d(T),l==null||l(T,b,v,D),T},isSelected:b=>h&&Os(h,b,!1,t)}}function l3(e,t){const{selected:n,required:r,onSelect:o}=e,[i,l]=vd(n,o?n:void 0),c=o?n:i,{isSameDay:d}=t;return{selected:c,select:(y,b,v)=>{let D=y;return!r&&c&&c&&d(y,c)&&(D=void 0),o||l(D),o==null||o(D,y,b,v),D},isSelected:y=>c?d(c,y):!1}}function u3(e,t){const n=l3(e,t),r=r3(e,t),o=i3(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function Tr(e,t){return e instanceof jn&&e.timeZone===t?e:new jn(e,t)}function Ya(e,t,n){return Tr(e,t)}function _1(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?Ya(e,t):Array.isArray(e)?e.map(r=>r instanceof Date?Ya(r,t):r):xd(e)?{...e,from:e.from?Tr(e.from,t):e.from,to:e.to?Tr(e.to,t):e.to}:Sm(e)?{before:Ya(e.before,t),after:Ya(e.after,t)}:Cm(e)?{after:Ya(e.after,t)}:_m(e)?{before:Ya(e.before,t)}:e}function Hh(e,t,n){return e&&(Array.isArray(e)?e.map(r=>_1(r,t)):_1(e,t))}function Qa(e){var Dr;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=(Dr=t.selected)==null?void 0:Dr.map(Ge=>Tr(Ge,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=Hh(t.disabled,n)),t.hidden!==void 0&&(t.hidden=Hh(t.hidden,n)),t.modifiers)){const Ge={};Object.keys(t.modifiers).forEach(ut=>{var Ae;Ge[ut]=Hh((Ae=t.modifiers)==null?void 0:Ae[ut],n)}),t.modifiers=Ge}const{components:r,formatters:o,labels:i,dateLib:l,locale:c,classNames:d}=N.useMemo(()=>{const Ge={...u2,...t.locale},ut=t.broadcastCalendar?1:t.weekStartsOn,Ae=t.noonSafe&&t.timeZone?HN(t.timeZone,{weekStartsOn:ut,locale:Ge}):void 0,He=t.dateLib&&Ae?{...Ae,...t.dateLib}:t.dateLib??Ae,ft=new mr({locale:Ge,weekStartsOn:ut,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},He);return{dateLib:ft,components:xN(t.components),formatters:ON(t.formatters),labels:RN(t.labels,ft.options),locale:Ge,classNames:{...EN(),...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:b=1,onDayBlur:v,onDayClick:D,onDayFocus:k,onDayKeyDown:E,onDayMouseEnter:T,onDayMouseLeave:C,onNextClick:O,onPrevClick:A,showWeekNumber:L,styles:_}=t,{formatCaption:S,formatDay:I,formatMonthDropdown:P,formatWeekNumber:U,formatWeekNumberHeader:F,formatWeekdayName:H,formatYearDropdown:W}=o,$=ZN(t,l),{days:Q,months:ne,navStart:me,navEnd:ee,previousMonth:ce,nextMonth:M,goToMonth:G}=$,ae=gN(Q,t,me,ee,l),{isSelected:j,select:le,selected:he}=u3(t,l)??{},{blur:pe,focused:Oe,isFocusTarget:oe,moveFocus:fe,setFocused:_e}=n3(t,$,ae,j??(()=>!1),l),{labelDayButton:Ee,labelGridcell:Fe,labelGrid:$e,labelMonthDropdown:st,labelNav:Je,labelPrevious:tt,labelNext:Te,labelWeekday:Re,labelWeekNumber:se,labelWeekNumberHeader:te,labelYearDropdown:ge}=i,Ne=N.useMemo(()=>FN(l,t.ISOWeek,t.broadcastCalendar,t.today),[l,t.ISOWeek,t.broadcastCalendar,t.today]),qe=p!==void 0||D!==void 0,pt=N.useCallback(()=>{ce&&(G(ce),A==null||A(ce))},[ce,G,A]),yt=N.useCallback(()=>{M&&(G(M),O==null||O(M))},[G,M,O]),ie=N.useCallback((Ge,ut)=>Ae=>{Ae.preventDefault(),Ae.stopPropagation(),_e(Ge),!ut.disabled&&(le==null||le(Ge.date,ut,Ae),D==null||D(Ge.date,ut,Ae))},[le,D,_e]),ye=N.useCallback((Ge,ut)=>Ae=>{_e(Ge),k==null||k(Ge.date,ut,Ae)},[k,_e]),Me=N.useCallback((Ge,ut)=>Ae=>{pe(),v==null||v(Ge.date,ut,Ae)},[pe,v]),nt=N.useCallback((Ge,ut)=>Ae=>{const He={ArrowLeft:[Ae.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[Ae.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[Ae.shiftKey?"year":"week","after"],ArrowUp:[Ae.shiftKey?"year":"week","before"],PageUp:[Ae.shiftKey?"year":"month","before"],PageDown:[Ae.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(He[Ae.key]){Ae.preventDefault(),Ae.stopPropagation();const[ft,Ue]=He[Ae.key];fe(ft,Ue)}E==null||E(Ge.date,ut,Ae)},[fe,E,t.dir]),ot=N.useCallback((Ge,ut)=>Ae=>{T==null||T(Ge.date,ut,Ae)},[T]),gt=N.useCallback((Ge,ut)=>Ae=>{C==null||C(Ge.date,ut,Ae)},[C]),Zt=N.useCallback(Ge=>ut=>{const Ae=Number(ut.target.value),He=l.setMonth(l.startOfMonth(Ge),Ae);G(He)},[l,G]),hn=N.useCallback(Ge=>ut=>{const Ae=Number(ut.target.value),He=l.setYear(l.startOfMonth(Ge),Ae);G(He)},[l,G]),{className:Dn,style:Yn}=N.useMemo(()=>({className:[d[Qe.Root],t.className].filter(Boolean).join(" "),style:{..._==null?void 0:_[Qe.Root],...t.style}}),[d,t.className,t.style,_]),Wt=vN(t),It=N.useRef(null);YN(It,!!t.animate,{classNames:d,months:ne,focused:Oe,dateLib:l});const yn={dayPickerProps:t,selected:he,select:le,isSelected:j,months:ne,nextMonth:M,previousMonth:ce,goToMonth:G,getModifiers:ae,components:r,classNames:d,styles:_,labels:i,formatters:o};return Ie.createElement(d2.Provider,{value:yn},Ie.createElement(r.Root,{rootRef:t.animate?It:void 0,className:Dn,style:Yn,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},Ie.createElement(r.Months,{className:d[Qe.Months],style:_==null?void 0:_[Qe.Months]},!t.hideNavigation&&!y&&Ie.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:d[Qe.Nav],style:_==null?void 0:_[Qe.Nav],"aria-label":Je(),onPreviousClick:pt,onNextClick:yt,previousMonth:ce,nextMonth:M}),ne.map((Ge,ut)=>Ie.createElement(r.Month,{"data-animated-month":t.animate?"true":void 0,className:d[Qe.Month],style:_==null?void 0:_[Qe.Month],key:ut,displayIndex:ut,calendarMonth:Ge},y==="around"&&!t.hideNavigation&&ut===0&&Ie.createElement(r.PreviousMonthButton,{type:"button",className:d[Qe.PreviousMonthButton],tabIndex:ce?void 0:-1,"aria-disabled":ce?void 0:!0,"aria-label":tt(ce),onClick:pt,"data-animated-button":t.animate?"true":void 0},Ie.createElement(r.Chevron,{disabled:ce?void 0:!0,className:d[Qe.Chevron],orientation:t.dir==="rtl"?"right":"left"})),Ie.createElement(r.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:d[Qe.MonthCaption],style:_==null?void 0:_[Qe.MonthCaption],calendarMonth:Ge,displayIndex:ut},h!=null&&h.startsWith("dropdown")?Ie.createElement(r.DropdownNav,{className:d[Qe.Dropdowns],style:_==null?void 0:_[Qe.Dropdowns]},(()=>{const Ae=h==="dropdown"||h==="dropdown-months"?Ie.createElement(r.MonthsDropdown,{key:"month",className:d[Qe.MonthsDropdown],"aria-label":st(),classNames:d,components:r,disabled:!!t.disableNavigation,onChange:Zt(Ge.date),options:PN(Ge.date,me,ee,o,l),style:_==null?void 0:_[Qe.Dropdown],value:l.getMonth(Ge.date)}):Ie.createElement("span",{key:"month"},P(Ge.date,l)),He=h==="dropdown"||h==="dropdown-years"?Ie.createElement(r.YearsDropdown,{key:"year",className:d[Qe.YearsDropdown],"aria-label":ge(l.options),classNames:d,components:r,disabled:!!t.disableNavigation,onChange:hn(Ge.date),options:BN(me,ee,o,l,!!t.reverseYears),style:_==null?void 0:_[Qe.Dropdown],value:l.getYear(Ge.date)}):Ie.createElement("span",{key:"year"},W(Ge.date,l));return l.getMonthYearOrder()==="year-first"?[He,Ae]:[Ae,He]})(),Ie.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"}},S(Ge.date,l.options,l))):Ie.createElement(r.CaptionLabel,{className:d[Qe.CaptionLabel],role:"status","aria-live":"polite"},S(Ge.date,l.options,l))),y==="around"&&!t.hideNavigation&&ut===b-1&&Ie.createElement(r.NextMonthButton,{type:"button",className:d[Qe.NextMonthButton],tabIndex:M?void 0:-1,"aria-disabled":M?void 0:!0,"aria-label":Te(M),onClick:yt,"data-animated-button":t.animate?"true":void 0},Ie.createElement(r.Chevron,{disabled:M?void 0:!0,className:d[Qe.Chevron],orientation:t.dir==="rtl"?"left":"right"})),ut===b-1&&y==="after"&&!t.hideNavigation&&Ie.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:d[Qe.Nav],style:_==null?void 0:_[Qe.Nav],"aria-label":Je(),onPreviousClick:pt,onNextClick:yt,previousMonth:ce,nextMonth:M}),Ie.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":p==="multiple"||p==="range","aria-label":$e(Ge.date,l.options,l)||void 0,className:d[Qe.MonthGrid],style:_==null?void 0:_[Qe.MonthGrid]},!t.hideWeekdays&&Ie.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:d[Qe.Weekdays],style:_==null?void 0:_[Qe.Weekdays]},L&&Ie.createElement(r.WeekNumberHeader,{"aria-label":te(l.options),className:d[Qe.WeekNumberHeader],style:_==null?void 0:_[Qe.WeekNumberHeader],scope:"col"},F()),Ne.map(Ae=>Ie.createElement(r.Weekday,{"aria-label":Re(Ae,l.options,l),className:d[Qe.Weekday],key:String(Ae),style:_==null?void 0:_[Qe.Weekday],scope:"col"},H(Ae,l.options,l)))),Ie.createElement(r.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:d[Qe.Weeks],style:_==null?void 0:_[Qe.Weeks]},Ge.weeks.map(Ae=>Ie.createElement(r.Week,{className:d[Qe.Week],key:Ae.weekNumber,style:_==null?void 0:_[Qe.Week],week:Ae},L&&Ie.createElement(r.WeekNumber,{week:Ae,style:_==null?void 0:_[Qe.WeekNumber],"aria-label":se(Ae.weekNumber,{locale:c}),className:d[Qe.WeekNumber],scope:"row",role:"rowheader"},U(Ae.weekNumber,l)),Ae.days.map(He=>{const{date:ft}=He,Ue=ae(He);if(Ue[Kt.focused]=!Ue.hidden&&!!(Oe!=null&&Oe.isEqualTo(He)),Ue[Ur.selected]=(j==null?void 0:j(ft))||Ue.selected,xd(he)){const{from:$t,to:nn}=he;Ue[Ur.range_start]=!!($t&&nn&&l.isSameDay(ft,$t)),Ue[Ur.range_end]=!!($t&&nn&&l.isSameDay(ft,nn)),Ue[Ur.range_middle]=Os(he,ft,!0,l)}const Yt=jN(Ue,_,t.modifiersStyles),en=bN(Ue,d,t.modifiersClassNames),tn=!qe&&!Ue.hidden?Fe(ft,Ue,l.options,l):void 0;return Ie.createElement(r.Day,{key:`${He.isoDate}_${He.displayMonthId}`,day:He,modifiers:Ue,className:en.join(" "),style:Yt,role:"gridcell","aria-selected":Ue.selected||void 0,"aria-label":tn,"data-day":He.isoDate,"data-month":He.outside?He.dateMonthId:void 0,"data-selected":Ue.selected||void 0,"data-disabled":Ue.disabled||void 0,"data-hidden":Ue.hidden||void 0,"data-outside":He.outside||void 0,"data-focused":Ue.focused||void 0,"data-today":Ue.today||void 0},!Ue.hidden&&qe?Ie.createElement(r.DayButton,{className:d[Qe.DayButton],style:_==null?void 0:_[Qe.DayButton],type:"button",day:He,modifiers:Ue,disabled:!Ue.focused&&Ue.disabled||void 0,"aria-disabled":Ue.focused&&Ue.disabled||void 0,tabIndex:oe(He)?0:-1,"aria-label":Ee(ft,Ue,l.options,l),onClick:ie(He,Ue),onBlur:Me(He,Ue),onFocus:ye(He,Ue),onKeyDown:nt(He,Ue),onMouseEnter:ot(He,Ue),onMouseLeave:gt(He,Ue)},I(ft,l.options,l)):!Ue.hidden&&I(He.date,l.options,l))})))))))),t.footer&&Ie.createElement(r.Footer,{className:d[Qe.Footer],style:_==null?void 0:_[Qe.Footer],role:"status","aria-live":"polite"},t.footer)))}function Ti({trigger:e,children:t,isOpen:n,onOpenChange:r,width:o=340}){const[i,l]=N.useState(!1),c=N.useRef(null),d=N.useRef(null),h=n!==void 0?n:i,p=N.useCallback(b=>{r?r(b):l(b)},[r]),y=N.useCallback(()=>p(!1),[p]);return N.useEffect(()=>{if(!h)return;function b(v){const D=v.target;c.current&&!c.current.contains(D)&&d.current&&!d.current.contains(D)&&y()}return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[h,y]),N.useEffect(()=>{if(!h)return;function b(v){v.key==="Escape"&&y()}return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[h,y]),f.jsxs("div",{className:"relative",style:{display:"inline-flex"},children:[f.jsx("div",{ref:d,onClick:()=>p(!h),children:e}),h&&f.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:o},children:t})]})}function wi(){const[e,t]=N.useState(!1);return{isOpen:e,open:()=>t(!0),close:()=>t(!1),toggle:()=>t(n=>!n),onOpenChange:t}}function ki({label:e,value:t,active:n,icon:r,onClick:o,onClear:i}){return f.jsxs("button",{type:"button",onClick:o,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&&f.jsx("span",{className:"flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},children:r}),t?f.jsxs("span",{className:"font-medium",children:[f.jsxs("span",{style:{color:"var(--yc-color-text-secondary)"},children:[e,": "]}),f.jsx("span",{style:{color:n?"var(--yc-color-primary)":"var(--yc-color-text, #111)"},children:t})]}):f.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:e}),n&&i?f.jsx("span",{role:"button",tabIndex:0,"aria-label":`Reset ${e} filter`,onClick:l=>{l.stopPropagation(),i()},onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.stopPropagation(),i())},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:f.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:f.jsx("path",{d:"M3 3l6 6M9 3l-6 6"})})}):f.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:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}function ya({title:e,onBack:t}){return f.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:[t&&f.jsx("button",{type:"button",onClick:t,className:"flex items-center justify-center w-6 h-6 rounded hover:bg-black/5",style:{color:"var(--yc-color-text-secondary)"},children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),f.jsx("span",{className:"text-sm font-medium",style:{color:"var(--yc-color-text, #111)"},children:e})]})}const C2=[{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"}],c3=`
34
+ .rdp-root {
35
+ --rdp-accent-color: var(--yc-color-primary, #2563eb);
36
+ --rdp-accent-background-color: color-mix(in srgb, var(--yc-color-primary, #2563eb) 15%, transparent);
37
+ --rdp-range_start-color: white;
38
+ --rdp-range_start-background: var(--yc-color-primary, #2563eb);
39
+ --rdp-range_end-color: white;
40
+ --rdp-range_end-background: var(--yc-color-primary, #2563eb);
41
+ --rdp-range_middle-background: color-mix(in srgb, var(--yc-color-primary, #2563eb) 15%, transparent);
42
+ --rdp-range_middle-color: var(--yc-color-primary, #1e40af);
43
+ --rdp-day_button-height: 36px;
44
+ --rdp-day_button-width: 36px;
45
+ color: var(--yc-color-text);
46
+ font-size: 14px;
47
+ }
48
+ .rdp-months { flex-wrap: nowrap; gap: 16px; }
49
+ .rdp-month_caption { font-size: 15px; font-weight: 600; }
50
+ .rdp-day { border-radius: 0; }
51
+ .rdp-selected .rdp-day_button { font-weight: 600; }
52
+ .rdp-range_start .rdp-day_button,
53
+ .rdp-range_end .rdp-day_button { font-weight: 600; }
54
+ .rdp-today .rdp-day_button {
55
+ font-weight: 700;
56
+ border: 2px solid var(--yc-color-primary, #2563eb);
57
+ }
58
+ .rdp-day_button:hover { background-color: var(--yc-color-surface-hover, #e5e7eb) !important; }
59
+ `;function Xc(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="custom"}function Om(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="relative"}const R0={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 d3(e){return!!(Om(e)||typeof e=="string"&&e in R0)}function f3(e){return Om(e)?e:typeof e=="string"&&e in R0?R0[e]:{type:"relative",direction:"previous",value:30,unit:"day",includeToday:!1}}function h3(e){const n=ua(new Date);if(e.direction==="current")switch(e.unit){case"day":return{start:n,end:Wk(n)};case"week":return{start:zr(n,{weekStartsOn:1}),end:yd(n,{weekStartsOn:1})};case"month":return{start:ql(n),end:md(n)};case"quarter":return{start:Gc(n),end:gm(n)};case"year":return{start:mi(n),end:pd(n)}}const r=e.value??1,o=e.direction==="previous",l=(o?{day:Sr,week:Zx,month:Ll,quarter:Jx,year:Em}:{day:Ms,week:fd,month:vi,quarter:ym,year:hd})[e.unit];if(o){const c=e.includeToday?n:Sr(n,1),d=l((e.includeToday,n),r);return{start:d<c?d:c,end:d<c?c:d}}else{const c=e.includeToday?n:Ms(n,1),d=l(c,r);return{start:c<d?c:d,end:c<d?d:c}}}function m3(e){if(Xc(e))return`${e.start} to ${e.end}`;if(Om(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=C2.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 p3=f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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 _2({name:e,label:t="Date",chartName:n,defaultValue:r="last_30_days"}){var D;const o=wi(),i=Xe(k=>k.globalFilters),l=Xe(k=>k.chartFilters),c=Xe(k=>k.setGlobalFilter),d=Xe(k=>k.setChartFilter),h=n?((D=l[n])==null?void 0:D[e])??i[e]??r:i[e]??r;N.useEffect(()=>{var E;(n?((E=l[n])==null?void 0:E[e])??i[e]:i[e])===void 0&&r&&(n?d(n,e,r):c(e,r))},[n,e,r,i,l,c,d]);const p=k=>{const E=k;n?d(n,e,E):c(e,E),o.close()},y=typeof h=="string"?h!==r:!0,b=m3(h),v=()=>{n?d(n,e,r):c(e,r)};return f.jsx(Ti,{isOpen:o.isOpen,onOpenChange:o.onOpenChange,width:620,trigger:f.jsx(ki,{label:t,value:b,active:y,icon:p3,onClear:v}),children:f.jsx(y3,{currentValue:h,onApply:p,onClose:o.close})})}function y3({currentValue:e,onApply:t,onClose:n}){const[r,o]=N.useState(()=>d3(e)?"relative":Xc(e)?"fixed":"presets");return f.jsxs("div",{children:[r==="presets"&&f.jsx(g3,{currentValue:e,onSelectPreset:i=>{t(i),n()},onNavigate:o}),r==="fixed"&&f.jsx(b3,{currentValue:e,onApply:t,onBack:()=>o("presets")}),r==="relative"&&f.jsx(x3,{currentValue:e,onApply:t,onBack:()=>o("presets")})]})}function g3({currentValue:e,onSelectPreset:t,onNavigate:n}){return f.jsxs("div",{className:"py-1",children:[C2.map((r,o)=>{if("divider"in r)return f.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border, #e5e7eb)"}},`divider-${o}`);const i=typeof e=="string"&&e===r.value;return f.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:[f.jsx("span",{className:i?"font-medium":"",children:r.label}),i&&f.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-primary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]},r.value)}),f.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border, #e5e7eb)"}}),f.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:[f.jsx("span",{children:"Fixed date range..."}),f.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]}),f.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:[f.jsx("span",{children:"Relative date range..."}),f.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})}function b3({currentValue:e,onApply:t,onBack:n}){const[r,o]=N.useState("between"),[i,l]=N.useState(()=>{if(Xc(e)){const b=ws(e.start,"yyyy-MM-dd",new Date),v=ws(e.end,"yyyy-MM-dd",new Date);return{from:b,to:v}}}),[c,d]=N.useState(()=>{if(Xc(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 b=on(c,"yyyy-MM-dd");t({type:"custom",start:b,end:b})}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 f.jsxs("div",{children:[f.jsx(ya,{title:"Fixed date range",onBack:n}),f.jsx("div",{className:"px-4 pt-3",children:f.jsx("div",{className:"flex gap-1 mb-3",children:y.map(b=>f.jsx("button",{type:"button",onClick:()=>o(b.key),className:"px-3 py-1 text-xs rounded-full font-medium transition-colors",style:r===b.key?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-text-secondary)"},children:b.label},b.key))})}),f.jsxs("div",{className:"px-4 flex justify-center",children:[f.jsx("style",{children:c3}),r==="between"?f.jsx(Qa,{mode:"range",selected:i,onSelect:l,numberOfMonths:2,defaultMonth:(i==null?void 0:i.from)||new Date}):f.jsx(Qa,{mode:"single",selected:c,onSelect:d,numberOfMonths:2,defaultMonth:c||new Date})]}),f.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:f.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 x3({currentValue:e,onApply:t,onBack:n}){const r=f3(e),[o,i]=N.useState(r.direction),[l,c]=N.useState(r.value??30),[d,h]=N.useState(r.unit),[p,y]=N.useState(r.includeToday??!1),b=N.useMemo(()=>{const C=h3({direction:o,value:o==="current"?void 0:l,unit:d,includeToday:p}),O=C.start.getFullYear(),A=C.end.getFullYear();return O===A?`${on(C.start,"MMM d")} – ${on(C.end,"MMM d, yyyy")}`:`${on(C.start,"MMM d, yyyy")} – ${on(C.end,"MMM d, yyyy")}`},[o,l,d,p]),v=()=>{t({type:"relative",direction:o,value:o==="current"?void 0:l,unit:d,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"}],E=[{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"},{value:"quarter",label:"Quarter"},{value:"year",label:"Year"}];return f.jsxs("div",{children:[f.jsx(ya,{title:"Relative date range",onBack:n}),f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsx("div",{className:"flex gap-1",children:D.map(T=>f.jsx("button",{type:"button",onClick:()=>i(T.key),className:"px-3 py-1 text-xs rounded-full font-medium transition-colors",style:o===T.key?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-text-secondary)"},children:T.label},T.key))}),o==="current"?f.jsx("div",{className:"flex gap-2",children:E.map(T=>f.jsx("button",{type:"button",onClick:()=>h(T.value),className:"px-3 py-1.5 text-sm rounded border transition-colors",style:d===T.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:T.label},T.value))}):f.jsxs("div",{className:"flex gap-2",children:[f.jsx("input",{type:"number",min:1,value:l,onChange:T=>c(Math.max(1,parseInt(T.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)"}}),f.jsx("select",{value:d,onChange:T=>h(T.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(T=>f.jsx("option",{value:T.value,children:T.label},T.value))})]}),o!=="current"&&f.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("input",{type:"checkbox",checked:p,onChange:T=>y(T.target.checked),className:"rounded border-gray-300"}),"Include today"]}),f.jsxs("div",{className:"flex items-center gap-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"})}),f.jsx("span",{children:b})]})]}),f.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:f.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 Jc({name:e,label:t=e,options:n,chartName:r,defaultValue:o,source:i}){var P,U;const l=wi(),c=Xe(F=>F.globalFilters),d=Xe(F=>F.chartFilters),h=Xe(F=>F.setGlobalFilter),p=Xe(F=>F.setChartFilter),y=!!i,{data:b,isLoading:v}=hr({queryKey:y?r?["parameterOptions",r,e]:["modelOptions",i.model,i.value_field,i.label_field]:["noop"],queryFn:()=>r?xt.getParameterOptions(r,e):xt.getModelOptions(i.model,i.value_field,i.label_field),enabled:y,staleTime:300*1e3}),D=y?[{value:"",label:"All"},...(b==null?void 0:b.options)??[]]:[{value:"",label:"All"},...n??[]],k=r?((P=d[r])==null?void 0:P[e])??c[e]??o??"":c[e]??o??"",[E,T]=N.useState(k),[C,O]=N.useState("");N.useEffect(()=>{l.isOpen&&(T(k),O(""))},[l.isOpen,k]),N.useEffect(()=>{var H;(r?((H=d[r])==null?void 0:H[e])??c[e]:c[e])===void 0&&o&&(r?p(r,e,o):h(e,o))},[r,e,o,c,d,h,p]);const A=()=>{const F=E||null;r?p(r,e,F):h(e,F),l.close()},L=C?D.filter(F=>F.label.toLowerCase().includes(C.toLowerCase())):D,_=k?((U=D.find(F=>F.value===k))==null?void 0:U.label)||k:void 0,S=!!k&&k!==o,I=()=>{const F=o??null;r?p(r,e,F):h(e,F)};return y&&v?f.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:f.jsx("span",{className:"text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Loading..."})}):f.jsxs(Ti,{isOpen:l.isOpen,onOpenChange:l.onOpenChange,trigger:f.jsx(ki,{label:t,value:_||t,active:S,onClear:I}),children:[f.jsx(ya,{title:t}),f.jsxs("div",{className:"p-3",children:[D.length>6&&f.jsx("div",{className:"mb-2",children:f.jsx("input",{type:"text",placeholder:"Search...",value:C,onChange:F=>O(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)"},autoFocus:!0})}),f.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[L.map(F=>f.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm",children:[f.jsx("input",{type:"radio",name:`select-${e}`,checked:E===F.value,onChange:()=>T(F.value),className:"text-blue-600"}),f.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:F.label})]},F.value)),L.length===0&&f.jsx("div",{className:"text-sm px-2 py-3 text-center",style:{color:"var(--yc-color-text-muted)"},children:"No matches"})]})]}),f.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:f.jsx("button",{type:"button",onClick:A,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}function N2({name:e,label:t=e,options:n,chartName:r,defaultValue:o,source:i}){const l=wi(),c=Xe(H=>H.globalFilters),d=Xe(H=>H.chartFilters),h=Xe(H=>H.setGlobalFilter),p=Xe(H=>H.setChartFilter),y=!!i,{data:b,isLoading:v}=hr({queryKey:y?r?["parameterOptions",r,e]:["modelOptions",i.model,i.value_field,i.label_field]:["noop"],queryFn:()=>r?xt.getParameterOptions(r,e):xt.getModelOptions(i.model,i.value_field,i.label_field),enabled:y,staleTime:300*1e3}),D=y?(b==null?void 0:b.options)??[]:n??[],k=(()=>{var W;const H=r?((W=d[r])==null?void 0:W[e])??c[e]??o??[]:c[e]??o??[];return Array.isArray(H)?H:[]})(),[E,T]=N.useState(k),[C,O]=N.useState("");N.useEffect(()=>{l.isOpen&&(T(k),O(""))},[l.isOpen]),N.useEffect(()=>{var W;(r?((W=d[r])==null?void 0:W[e])??c[e]:c[e])===void 0&&o&&(r?p(r,e,o):h(e,o))},[r,e,o,c,d,h,p]);const A=H=>{T(W=>W.includes(H)?W.filter($=>$!==H):[...W,H])},L=()=>{E.length===D.length?T([]):T(D.map(H=>H.value))},_=()=>{const H=E.length>0?E:null;r?p(r,e,H):h(e,H),l.close()},S=C?D.filter(H=>H.label.toLowerCase().includes(C.toLowerCase())):D,I=k.length===0?void 0:k.length<=2?k.map(H=>{var W;return((W=D.find($=>$.value===H))==null?void 0:W.label)||H}).join(", "):`${k.length} selected`,P=k.length>0,U=E.length===D.length&&D.length>0,F=()=>{const H=o??null;r?p(r,e,H):h(e,H)};return y&&v?f.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:f.jsx("span",{className:"text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Loading..."})}):f.jsxs(Ti,{isOpen:l.isOpen,onOpenChange:l.onOpenChange,trigger:f.jsx(ki,{label:t,value:I||t,active:P,onClear:F}),children:[f.jsx(ya,{title:t}),f.jsxs("div",{className:"p-3",children:[D.length>6&&f.jsx("div",{className:"mb-2",children:f.jsx("input",{type:"text",placeholder:"Search...",value:C,onChange:H=>O(H.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})}),f.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[!C&&f.jsxs(f.Fragment,{children:[f.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:[f.jsx("input",{type:"checkbox",checked:U,onChange:L,className:"text-blue-600 rounded"}),f.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:"Select all"})]}),f.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border, #e5e7eb)"}})]}),S.map(H=>f.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm",children:[f.jsx("input",{type:"checkbox",checked:E.includes(H.value),onChange:()=>A(H.value),className:"text-blue-600 rounded"}),f.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:H.label})]},H.value)),S.length===0&&f.jsx("div",{className:"text-sm px-2 py-3 text-center",style:{color:"var(--yc-color-text-muted)"},children:"No matches"})]})]}),f.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:f.jsx("button",{type:"button",onClick:_,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}const P0=[{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"}],D2=["is_empty","is_not_empty"];function O2(e){return typeof e=="object"&&e!==null&&"operator"in e&&"value"in e}function v3(e){var t,n;if(O2(e))return D2.includes(e.operator)?(t=P0.find(o=>o.value===e.operator))==null?void 0:t.label:`${((n=P0.find(o=>o.value===e.operator))==null?void 0:n.label)||e.operator} "${e.value}"`;if(typeof e=="string"&&e)return e}function A2({name:e,label:t=e,chartName:n,defaultValue:r}){var A;const o=wi(),i=Xe(L=>L.globalFilters),l=Xe(L=>L.chartFilters),c=Xe(L=>L.setGlobalFilter),d=Xe(L=>L.setChartFilter),h=n?((A=l[n])==null?void 0:A[e])??i[e]??r??null:i[e]??r??null,[p,y]=N.useState("contains"),[b,v]=N.useState("");N.useEffect(()=>{o.isOpen&&(O2(h)?(y(h.operator),v(h.value)):typeof h=="string"?(y("is"),v(h)):(y("contains"),v("")))},[o.isOpen]);const D=()=>{const L={operator:p,value:b};n?d(n,e,L):c(e,L),o.close()},k=!D2.includes(p),E=!k||b.trim().length>0,T=v3(h),C=!!T,O=()=>{const L=r??null;n?d(n,e,L):c(e,L)};return f.jsxs(Ti,{isOpen:o.isOpen,onOpenChange:o.onOpenChange,trigger:f.jsx(ki,{label:t,value:T||t,active:C,onClear:O}),children:[f.jsx(ya,{title:t}),f.jsxs("div",{className:"p-4 space-y-3",children:[f.jsx("select",{value:p,onChange:L=>y(L.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:P0.map(L=>f.jsx("option",{value:L.value,children:L.label},L.value))}),k&&f.jsx("input",{type:"text",value:b,onChange:L=>v(L.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:L=>{L.key==="Enter"&&E&&D()}})]}),f.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:f.jsx("button",{type:"button",onClick:D,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 j0=[{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"}],I2=["is_empty","is_not_empty"];function M2(e){return typeof e=="object"&&e!==null&&"operator"in e&&"value"in e&&typeof e.value=="number"}function E3(e){var t,n;if(M2(e)){if(I2.includes(e.operator))return(t=j0.find(o=>o.value===e.operator))==null?void 0:t.label;const r=((n=j0.find(o=>o.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 L2({name:e,label:t=e,chartName:n,defaultValue:r}){var I;const o=wi(),i=Xe(P=>P.globalFilters),l=Xe(P=>P.chartFilters),c=Xe(P=>P.setGlobalFilter),d=Xe(P=>P.setChartFilter),h=n?((I=l[n])==null?void 0:I[e])??i[e]??r??null:i[e]??r??null,[p,y]=N.useState("equal"),[b,v]=N.useState(""),[D,k]=N.useState("");N.useEffect(()=>{o.isOpen&&(M2(h)?(y(h.operator),v(String(h.value)),k(h.value2!==void 0?String(h.value2):"")):typeof h=="number"?(y("equal"),v(String(h)),k("")):(y("equal"),v(""),k("")))},[o.isOpen]);const E=()=>{const P={operator:p,value:parseFloat(b)||0,...p==="between"?{value2:parseFloat(D)||0}:{}};n?d(n,e,P):c(e,P),o.close()},T=!I2.includes(p),C=p==="between",O=!T||b!==""&&(!C||D!==""),A=E3(h),L=h===r||typeof h=="number"&&h===r||h==null,_=!!A&&!L,S=()=>{const P=r??null;n?d(n,e,P):c(e,P)};return f.jsxs(Ti,{isOpen:o.isOpen,onOpenChange:o.onOpenChange,trigger:f.jsx(ki,{label:t,value:A||t,active:_,onClear:S}),children:[f.jsx(ya,{title:t}),f.jsxs("div",{className:"p-4 space-y-3",children:[f.jsx("select",{value:p,onChange:P=>y(P.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(P=>f.jsx("option",{value:P.value,children:P.label},P.value))}),T&&f.jsxs("div",{className:"flex gap-2",children:[f.jsx("input",{type:"number",value:b,onChange:P=>v(P.target.value),placeholder:C?"Min":"Enter value...",className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},autoFocus:!0,onKeyDown:P=>{P.key==="Enter"&&O&&E()}}),C&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-sm self-center",style:{color:"var(--yc-color-text-muted)"},children:"and"}),f.jsx("input",{type:"number",value:D,onChange:P=>k(P.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:P=>{P.key==="Enter"&&O&&E()}})]})]})]}),f.jsxs("div",{className:"flex justify-between px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:[f.jsx("button",{type:"button",onClick:()=>{n?d(n,e,null):c(e,null),o.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"}),f.jsx("button",{type:"button",onClick:E,disabled:!O,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-40 disabled:cursor-not-allowed",children:"Update filter"})]})]})}function R2({name:e,label:t=e,chartName:n}){var k;const r=wi(),o=Xe(E=>E.globalFilters),i=Xe(E=>E.chartFilters),l=Xe(E=>E.setGlobalFilter),c=Xe(E=>E.setChartFilter),d=n?((k=i[n])==null?void 0:k[e])??o[e]??null:o[e]??null,[h,p]=N.useState(typeof d=="boolean"?d:null);N.useEffect(()=>{r.isOpen&&p(typeof d=="boolean"?d:null)},[r.isOpen]);const y=()=>{n?c(n,e,h):l(e,h),r.close()},b=typeof d=="boolean"?d?"True":"False":void 0,v=typeof d=="boolean",D=()=>{n?c(n,e,null):l(e,null)};return f.jsxs(Ti,{isOpen:r.isOpen,onOpenChange:r.onOpenChange,width:240,trigger:f.jsx(ki,{label:t,value:b||t,active:v,onClear:D}),children:[f.jsx(ya,{title:t}),f.jsxs("div",{className:"p-4 space-y-1",children:[[{value:!0,label:"True"},{value:!1,label:"False"}].map(E=>f.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm",children:[f.jsx("input",{type:"radio",name:`bool-${e}`,checked:h===E.value,onChange:()=>p(E.value),className:"text-blue-600"}),f.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:E.label})]},String(E.value))),f.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:[f.jsx("input",{type:"radio",name:`bool-${e}`,checked:h===null,onChange:()=>p(null),className:"text-blue-600"}),f.jsx("span",{children:"Any"})]})]}),f.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:f.jsx("button",{type:"button",onClick:y,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}function ca(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim()}function P2({parameters:e,chartName:t}){const n=Xe(d=>d.globalFilters),r=Xe(d=>d.chartFilters),o=Xe(d=>d.resetFilters),i=Xe(d=>d.resetChartFilters);if(e.length===0)return null;const l=e.some(d=>{var p;const h=t?((p=r[t])==null?void 0:p[d.name])??n[d.name]:n[d.name];return h==null?!1:JSON.stringify(h)!==JSON.stringify(d.default)}),c=()=>{t?i(t):o()};return f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.map(d=>{const h=d.label||ca(d.name),p=typeof d.default=="string"?d.default:void 0;switch(d.type){case"date_range":return f.jsx(_2,{name:d.name,label:h,chartName:t,defaultValue:p},d.name);case"select":{const y=(d.options||[]).map(b=>typeof b=="string"?{value:b,label:b}:b);return f.jsx(Jc,{name:d.name,label:h,options:y,chartName:t,defaultValue:p},d.name)}case"dynamic_select":return!t&&!d.source?f.jsxs("div",{className:"text-sm text-gray-500",children:[h,": dynamic_select requires chartName or source"]},d.name):f.jsx(Jc,{name:d.name,label:h,chartName:t,defaultValue:p,source:d.source},d.name);case"multi_select":{const y=(d.options||[]).map(b=>typeof b=="string"?{value:b,label:b}:b);return f.jsx(N2,{name:d.name,label:h,options:y,chartName:t,defaultValue:Array.isArray(d.default)?d.default:void 0,source:d.source},d.name)}case"text":return f.jsx(A2,{name:d.name,label:h,chartName:t,defaultValue:p},d.name);case"number":return f.jsx(L2,{name:d.name,label:h,chartName:t,defaultValue:typeof d.default=="number"?d.default:void 0},d.name);case"boolean":return f.jsx(R2,{name:d.name,label:h,chartName:t},d.name);default:return f.jsxs("div",{className:"text-sm text-gray-500",children:[h,": ",d.type," (not supported)"]},d.name)}}),l&&f.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 T3({resourceType:e,resourceName:t}){const n=ko(k=>k.auth),[r,o]=N.useState(!1),[i,l]=N.useState(null),[c,d]=N.useState(null),[h,p]=N.useState(!1),y=N.useRef(null);if(n.status!=="authenticated")return null;const b=n.user.role==="admin"||n.user.role==="editor";N.useEffect(()=>{if(!r)return;const k=E=>{y.current&&!y.current.contains(E.target)&&o(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[r]);const v=async()=>{const k=e==="dashboard"?`#/dashboards/${t}`:`#/charts/${t}`,E=`${window.location.origin}/${k}`;await navigator.clipboard.writeText(E),d("link"),setTimeout(()=>d(null),2e3)},D=async()=>{p(!0);try{const k=await xt.createShareLink({resourceType:e,resourceName:t}),E=e==="dashboard"?`#/public/dashboards/${t}?token=${k.token}`:`#/public/charts/${t}?token=${k.token}`,T=`${window.location.origin}/${E}`;l(T),await navigator.clipboard.writeText(T),d("public"),setTimeout(()=>d(null),2e3)}catch(k){console.error("Failed to create share link:",k)}finally{p(!1)}};return f.jsxs("div",{className:"relative",ref:y,children:[f.jsxs("button",{onClick:()=>o(!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:[f.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.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"})}),f.jsx("span",{children:"Share"})]}),r&&f.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:[f.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:[f.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-muted)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.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"?f.jsx("span",{style:{color:"var(--yc-color-success)"},children:"Copied!"}):f.jsx("span",{children:"Copy link (requires login)"})]}),b&&f.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:[f.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-muted)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.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?f.jsx("span",{style:{color:"var(--yc-color-text-muted)"},children:"Creating..."}):c==="public"?f.jsx("span",{style:{color:"var(--yc-color-success)"},children:"Public link copied!"}):f.jsx("span",{children:"Create public link"})]}),i&&f.jsxs("div",{className:"px-3 py-2 border-t",style:{borderColor:"var(--yc-color-border)"},children:[f.jsx("div",{className:"text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"Public URL:"}),f.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 w3({rowCount:e,durationMs:t,cached:n,view:r,onToggleView:o,onExportCSV:i,onExportPNG:l,onShowSql:c,onShowEvents:d,eventCount:h}){const[p,y]=N.useState(!1);return f.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:[f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{onClick:()=>o("chart"),className:`p-1.5 rounded transition-colors ${r==="chart"?"bg-black/5":"hover:bg-black/5"}`,title:"Chart view",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"})})}),f.jsx("button",{onClick:()=>o("table"),className:`p-1.5 rounded transition-colors ${r==="table"?"bg-black/5":"hover:bg-black/5"}`,title:"Table view",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"})})})]}),f.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&f.jsxs("span",{children:[e.toLocaleString()," rows"]}),t!=null&&f.jsxs("span",{children:[n&&f.jsx("span",{className:"text-green-600 mr-1",title:"Served from cache",children:"cached"}),t,"ms"]}),d&&f.jsxs("button",{onClick:d,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&&f.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&&f.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)&&f.jsxs("div",{className:"relative",children:[f.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&&f.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&&f.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&&f.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 k3=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"]),S3=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 Fr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function C3(e){const t=[];let n=0;const r=o=>e.charAt(o);for(;n<e.length;){if(r(n)==="-"&&r(n+1)==="-"){const o=e.indexOf(`
60
+ `,n),i=o===-1?e.slice(n):e.slice(n,o);t.push(`<span class="sql-comment">${Fr(i)}</span>`),n+=i.length;continue}if(r(n)==="/"&&r(n+1)==="*"){const o=e.indexOf("*/",n+2),i=o===-1?e.slice(n):e.slice(n,o+2);t.push(`<span class="sql-comment">${Fr(i)}</span>`),n+=i.length;continue}if(r(n)==="'"){let o=n+1;for(;o<e.length;)if(r(o)==="'"&&r(o+1)==="'")o+=2;else if(r(o)==="'"){o++;break}else o++;t.push(`<span class="sql-string">${Fr(e.slice(n,o))}</span>`),n=o;continue}if(r(n)==='"'){const o=e.indexOf('"',n+1),i=o===-1?e.slice(n):e.slice(n,o+1);t.push(`<span class="sql-identifier">${Fr(i)}</span>`),n+=i.length;continue}if(/\d/.test(r(n))&&(n===0||/[\s,=(]/.test(r(n-1)))){let o=n;for(;o<e.length&&/[\d.]/.test(r(o));)o++;t.push(`<span class="sql-number">${Fr(e.slice(n,o))}</span>`),n=o;continue}if(/[a-zA-Z_]/.test(r(n))){let o=n;for(;o<e.length&&/[a-zA-Z0-9_]/.test(r(o));)o++;const i=e.slice(n,o),l=i.toUpperCase(),c=e.slice(o);/^\s*\(/.test(c)&&S3.has(l)?t.push(`<span class="sql-function">${Fr(i)}</span>`):k3.has(l)?t.push(`<span class="sql-keyword">${Fr(i)}</span>`):t.push(Fr(i)),n=o;continue}if(r(n)===":"&&r(n+1)===":"){let o=n+2;for(;o<e.length&&/[a-zA-Z0-9_]/.test(r(o));)o++;t.push(`<span class="sql-type">${Fr(e.slice(n,o))}</span>`),n=o;continue}if("=<>!+-*/%".includes(r(n))){t.push(`<span class="sql-operator">${Fr(r(n))}</span>`),n++;continue}t.push(Fr(r(n))),n++}return t.join("")}function _3(e){return C3(e).split(`
61
+ `).map(r=>`<div class="sql-line">${r||" "}</div>`).join("")}function N3({isOpen:e,onClose:t,compiledSql:n,modelName:r,connection:o,durationMs:i,rowCount:l,cached:c}){const[d,h]=N.useState(!1),p=N.useMemo(()=>n?_3(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 f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 bg-black/20 z-40",onClick:t}),f.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:[f.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b flex-shrink-0",style:{borderColor:"var(--yc-color-border)"},children:[f.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--yc-color-text)",fontFamily:"var(--yc-font-heading)"},children:"Query Details"}),f.jsx("button",{onClick:t,className:"p-1.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-text-secondary)"},children:"Metadata"}),f.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&&f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Model"}),f.jsx("span",{className:"font-mono text-xs",style:{color:"var(--yc-color-text)"},children:r})]}),o&&f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Connection"}),f.jsx("span",{style:{color:"var(--yc-color-text)"},children:o})]}),l!=null&&f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Rows"}),f.jsx("span",{style:{color:"var(--yc-color-text)"},children:l.toLocaleString()})]}),i!=null&&f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Duration"}),f.jsxs("span",{style:{color:"var(--yc-color-text)"},children:[i,"ms",c&&f.jsx("span",{className:"ml-2 text-green-600 text-xs",children:"(cached)"})]})]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-text-secondary)"},children:"Compiled SQL"}),f.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:d?"Copied!":"Copy"})]}),n?f.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}}):f.jsx("p",{className:"text-sm italic",style:{color:"var(--yc-color-text-secondary)"},children:"No SQL available."})]})]})]})]})}const j2=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#06B6D4","#F97316","#84CC16","#14B8A6"];function yi(e,t,n){if(t)return t;const r=(n==null?void 0:n.palette)??j2;return r[e%r.length]}function D3(e,t,n,r){return n!=null&&n[e]?n[e]:yi(t,void 0,r)}const N1=[{name:"Red",hex:"#ef4444"},{name:"Orange",hex:"#f97316"},{name:"Green",hex:"#10b981"},{name:"Blue",hex:"#3b82f6"},{name:"Purple",hex:"#8b5cf6"}];function F0({value:e,onChange:t,themePalette:n,compact:r}){const[o,i]=N.useState(!1),[l,c]=N.useState(""),d=N.useRef(null);N.useEffect(()=>{if(!o)return;function b(v){d.current&&!d.current.contains(v.target)&&i(!1)}return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[o]),N.useEffect(()=>{if(o&&e){const b=N1.some(v=>v.hex.toLowerCase()===e.toLowerCase())||h.some(v=>v.toLowerCase()===e.toLowerCase());c(b?"":e)}},[o]);const h=n??j2;function p(b){t(b),i(!1)}function y(){const b=l.trim();b&&/^#[0-9a-fA-F]{3,8}$/.test(b)&&(t(b),i(!1))}return f.jsxs("div",{className:"relative",ref:d,children:[r?f.jsx("button",{type:"button",onClick:()=>i(!o),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"}):f.jsxs("button",{type:"button",onClick:()=>i(!o),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:[f.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"}}),f.jsx("span",{className:"truncate",children:e||"Color"})]}),o&&f.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:[f.jsxs("div",{className:"mb-2",children:[f.jsx("div",{className:"text-[10px] font-medium uppercase tracking-wider mb-1.5",style:{color:"var(--yc-color-text-muted)"},children:"Standard"}),f.jsx("div",{className:"space-y-0.5",children:N1.map(b=>f.jsxs("button",{type:"button",onClick:()=>p(b.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())===b.hex.toLowerCase()?"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)":"transparent",color:"var(--yc-color-text)"},children:[f.jsx("span",{className:"w-3.5 h-3.5 rounded-full flex-shrink-0",style:{backgroundColor:b.hex}}),b.name]},b.hex))})]}),f.jsxs("div",{className:"mb-2 pt-1",style:{borderTop:"1px solid var(--yc-color-border)"},children:[f.jsx("div",{className:"text-[10px] font-medium uppercase tracking-wider mb-1.5",style:{color:"var(--yc-color-text-muted)"},children:"Theme"}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map((b,v)=>f.jsx("button",{type:"button",onClick:()=>p(b),className:"w-5 h-5 rounded-full flex-shrink-0 transition-transform hover:scale-110",style:{backgroundColor:b,outline:(e==null?void 0:e.toLowerCase())===b.toLowerCase()?"2px solid var(--yc-color-primary)":"none",outlineOffset:2},title:b},`${b}-${v}`))})]}),f.jsxs("div",{className:"pt-1",style:{borderTop:"1px solid var(--yc-color-border)"},children:[f.jsx("div",{className:"text-[10px] font-medium uppercase tracking-wider mb-1.5",style:{color:"var(--yc-color-text-muted)"},children:"Custom"}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.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)"}}),f.jsx("input",{type:"text",value:l,onChange:b=>c(b.target.value),onKeyDown:b=>{b.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)"}}),f.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&&f.jsx("div",{className:"pt-2 mt-1",style:{borderTop:"1px solid var(--yc-color-border)"},children:f.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 O3({open:e,title:t,message:n,confirmLabel:r="Delete",cancelLabel:o="Cancel",variant:i="danger",onConfirm:l,onCancel:c}){const d=N.useRef(null);return N.useEffect(()=>{var h;e&&((h=d.current)==null||h.focus())},[e]),N.useEffect(()=>{if(!e)return;function h(p){p.key==="Escape"&&c()}return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,c]),e?f.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center",children:[f.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:c}),f.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:[f.jsx("h3",{className:"text-base font-semibold mb-1",style:{color:"var(--yc-color-text)"},children:t}),f.jsx("p",{className:"text-sm mb-5",style:{color:"var(--yc-color-text-secondary)"},children:n}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.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:o}),f.jsx("button",{ref:d,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 Nc=`
62
+ .rdp-root {
63
+ --rdp-accent-color: var(--yc-color-primary, #2563eb);
64
+ --rdp-accent-background-color: color-mix(in srgb, var(--yc-color-primary, #2563eb) 15%, transparent);
65
+ --rdp-day_button-height: 32px;
66
+ --rdp-day_button-width: 32px;
67
+ color: var(--yc-color-text);
68
+ font-size: 13px;
69
+ }
70
+ .rdp-months { flex-wrap: nowrap; }
71
+ .rdp-month_caption { font-size: 14px; font-weight: 600; }
72
+ .rdp-selected .rdp-day_button { font-weight: 600; }
73
+ .rdp-today .rdp-day_button {
74
+ font-weight: 700;
75
+ border: 2px solid var(--yc-color-primary, #2563eb);
76
+ }
77
+ .rdp-day_button:hover { background-color: var(--yc-color-surface-hover, #e5e7eb) !important; }
78
+ `;function A3({isOpen:e,onClose:t,events:n,allEvents:r,chartName:o,canEdit:i,eventsVisible:l,onToggleVisible:c,themePalette:d}){const h=Wn(),[p,y]=N.useState(!1),[b,v]=N.useState(""),[D,k]=N.useState(""),[E,T]=N.useState(""),[C,O]=N.useState(""),[A,L]=N.useState(!1),[_,S]=N.useState(""),[I,P]=N.useState(!1),[U,F]=N.useState(!1),H=N.useRef(null),W=N.useRef(null),$=N.useRef(null),[Q,ne]=N.useState(null),[me,ee]=N.useState(null),[ce,M]=N.useState(""),G=N.useRef(null),[ae,j]=N.useState(null),[le,he]=N.useState(null),pe=N.useRef(null),Oe=N.useRef(null),[oe,fe]=N.useState(null);N.useEffect(()=>{var se;p&&((se=H.current)==null||se.focus())},[p]),N.useEffect(()=>{var se;me&&((se=G.current)==null||se.focus())},[me]),N.useEffect(()=>{if(!I)return;function se(te){W.current&&!W.current.contains(te.target)&&P(!1)}return document.addEventListener("mousedown",se),()=>document.removeEventListener("mousedown",se)},[I]),N.useEffect(()=>{if(!U)return;function se(te){$.current&&!$.current.contains(te.target)&&F(!1)}return document.addEventListener("mousedown",se),()=>document.removeEventListener("mousedown",se)},[U]),N.useEffect(()=>{if(ae===null)return;function se(te){pe.current&&!pe.current.contains(te.target)&&j(null)}return document.addEventListener("mousedown",se),()=>document.removeEventListener("mousedown",se)},[ae]),N.useEffect(()=>{if(le===null)return;function se(te){Oe.current&&!Oe.current.contains(te.target)&&he(null)}return document.addEventListener("mousedown",se),()=>document.removeEventListener("mousedown",se)},[le]);const _e=Ka({mutationFn:se=>xt.createChartEvent(se),onSuccess:()=>{h.invalidateQueries({queryKey:["chartEvents"]}),$e()}}),Ee=Ka({mutationFn:se=>xt.deleteChartEvent(se),onSuccess:()=>h.invalidateQueries({queryKey:["chartEvents"]})}),Fe=Ka({mutationFn:({index:se,event:te})=>xt.updateChartEvent(se,te),onSuccess:()=>{h.invalidateQueries({queryKey:["chartEvents"]}),ne(null),ee(null)}});function $e(){y(!1),v(""),k(""),T(""),O(""),L(!1),S(""),P(!1),F(!1)}function st(){!D.trim()||!b.trim()||_e.mutate({date:D.trim(),label:b.trim(),...C.trim()?{description:C.trim()}:{},...E.trim()?{color:E.trim()}:{},...A&&_.trim()?{endDate:_.trim()}:{},charts:[o]})}function Je(se){return r.findIndex(te=>te.date===se.date&&te.label===se.label&&(te.description??"")===(se.description??"")&&(te.endDate??"")===(se.endDate??""))}function tt(se){fe(se)}function Te(){if(!oe)return;const se=Je(oe);se!==-1&&(Ee.mutate(se),fe(null))}function Re(se){if(Q===null||!me)return;const te=Je(se);if(te===-1)return;const ge=se[me]??"";if(ce===ge){ne(null),ee(null);return}Fe.mutate({index:te,event:{...se,[me]:ce}})}return e?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 bg-black/20 z-40",onClick:t}),f.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:[f.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b flex-shrink-0",style:{borderColor:"var(--yc-color-border)"},children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--yc-color-text)",fontFamily:"var(--yc-font-heading)"},children:"Events"}),n.length>0&&f.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})]}),f.jsx("button",{onClick:t,className:"p-1.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-4",children:[f.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:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium",style:{color:"var(--yc-color-text)"},children:"Show on chart"}),f.jsx("div",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:"Display event markers as dashed lines"})]}),f.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:f.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&&f.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:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add event"]}),p&&f.jsxs("div",{className:"p-3 rounded space-y-2",style:{backgroundColor:"var(--yc-color-background)",border:"1px solid var(--yc-color-border)"},children:[f.jsx("div",{className:"text-xs font-medium mb-2",style:{color:"var(--yc-color-text-secondary)"},children:"New event"}),f.jsxs("div",{className:"relative",children:[f.jsx("button",{onClick:()=>P(!I),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")}),I&&f.jsxs("div",{ref:W,className:"absolute z-50 rounded-lg shadow-lg p-2 mt-1",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[f.jsx("style",{children:Nc}),f.jsx(Qa,{mode:"single",numberOfMonths:1,selected:D?ws(D,"yyyy-MM-dd",new Date):void 0,onSelect:se=>{se&&(k(on(se,"yyyy-MM-dd")),P(!1))}})]})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:"Multi-day"}),f.jsx("button",{onClick:()=>{L(!A),A&&(S(""),F(!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:f.jsx("span",{className:"absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform",style:{left:A?22:2}})})]}),A&&f.jsxs("div",{className:"relative",children:[f.jsx("button",{onClick:()=>F(!U),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:_?"var(--yc-color-text)":"var(--yc-color-text-muted)"},children:_||"End date"}),U&&f.jsxs("div",{ref:$,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:[f.jsx("style",{children:Nc}),f.jsx(Qa,{mode:"single",numberOfMonths:1,selected:_?ws(_,"yyyy-MM-dd",new Date):void 0,onSelect:se=>{se&&(S(on(se,"yyyy-MM-dd")),F(!1))}})]})]}),f.jsx("input",{ref:H,type:"text",value:b,onChange:se=>v(se.target.value),onKeyDown:se=>{se.key==="Enter"&&st(),se.key==="Escape"&&$e()},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)"}}),f.jsxs("div",{children:[f.jsx("textarea",{value:C,onChange:se=>O(se.target.value),onKeyDown:se=>{se.key==="Escape"&&$e()},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)"}}),f.jsxs("div",{className:"text-[10px] mt-0.5",style:{color:"var(--yc-color-text-muted)"},children:["Supports ",f.jsx("a",{href:"https://www.markdownguide.org/basic-syntax/",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--yc-color-primary)",textDecoration:"underline"},children:"Markdown"})]})]}),f.jsxs("div",{children:[f.jsx("div",{className:"text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"Color (optional)"}),f.jsx(F0,{value:E,onChange:T,themePalette:d})]}),f.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[f.jsx("button",{onClick:$e,className:"px-2 py-1 text-xs rounded",style:{color:"var(--yc-color-text-muted)"},children:"Cancel"}),f.jsx("button",{onClick:st,disabled:!D.trim()||!b.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?f.jsxs("div",{className:"text-center py-8",children:[f.jsx("div",{className:"text-sm",style:{color:"var(--yc-color-text-muted)"},children:"No events for this chart"}),f.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:"Events appear as dashed vertical lines on the chart"})]}):f.jsx("div",{className:"space-y-1",children:n.map((se,te)=>f.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?f.jsx("div",{className:"flex-shrink-0 mt-0.5",children:f.jsx(F0,{value:se.color??"",onChange:ge=>{const Ne=Je(se);Ne!==-1&&Fe.mutate({index:Ne,event:{...se,...ge?{color:ge}:{color:void 0}}})},themePalette:d,compact:!0})}):f.jsx("span",{className:"w-3 h-3 rounded-full flex-shrink-0 mt-0.5",style:{backgroundColor:se.color||"#6366f1"}}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"text-xs relative flex items-center gap-1",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("span",{style:{cursor:i?"pointer":"default"},onClick:ge=>{i&&(ge.stopPropagation(),j(ae===te?null:te),he(null))},children:se.date}),ae===te&&f.jsxs("div",{ref:pe,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:[f.jsx("style",{children:Nc}),f.jsx(Qa,{mode:"single",numberOfMonths:1,selected:(()=>{try{return ws(se.date,"yyyy-MM-dd",new Date)}catch{return}})(),defaultMonth:(()=>{try{return ws(se.date,"yyyy-MM-dd",new Date)}catch{return}})(),onSelect:ge=>{if(!ge)return;const Ne=on(ge,"yyyy-MM-dd");if(j(null),Ne===se.date)return;const qe=Je(se);qe!==-1&&Fe.mutate({index:qe,event:{...se,date:Ne}})}})]}),se.endDate&&f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"→"}),f.jsx("span",{style:{cursor:i?"pointer":"default"},onClick:ge=>{i&&(ge.stopPropagation(),he(le===te?null:te),j(null))},children:se.endDate}),le===te&&f.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:[f.jsx("style",{children:Nc}),f.jsx(Qa,{mode:"single",numberOfMonths:1,selected:(()=>{try{return ws(se.endDate,"yyyy-MM-dd",new Date)}catch{return}})(),defaultMonth:(()=>{try{return ws(se.endDate,"yyyy-MM-dd",new Date)}catch{return}})(),onSelect:ge=>{if(!ge)return;const Ne=on(ge,"yyyy-MM-dd");if(he(null),Ne===se.endDate)return;const qe=Je(se);qe!==-1&&Fe.mutate({index:qe,event:{...se,endDate:Ne}})}})]})]})]}),Q===te&&me==="label"?f.jsx("input",{ref:G,type:"text",value:ce,onChange:ge=>M(ge.target.value),onBlur:()=>Re(se),onKeyDown:ge=>{ge.key==="Enter"&&Re(se),ge.key==="Escape"&&(ne(null),ee(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"}}):f.jsx("div",{className:"text-sm font-medium truncate",style:{color:"var(--yc-color-text)",cursor:i?"pointer":"default"},onClick:()=>{i&&(ne(te),ee("label"),M(se.label))},children:se.label}),Q===te&&me==="description"?f.jsx("input",{ref:G,type:"text",value:ce,onChange:ge=>M(ge.target.value),onBlur:()=>Re(se),onKeyDown:ge=>{ge.key==="Enter"&&Re(se),ge.key==="Escape"&&(ne(null),ee(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"}}):f.jsx("div",{className:"text-xs truncate mt-0.5",style:{color:se.description?"var(--yc-color-text-secondary)":"var(--yc-color-text-muted)",cursor:i?"pointer":"default"},onClick:()=>{i&&(ne(te),ee("description"),M(se.description??""))},children:se.description||(i?"Add description":"")}),se.charts&&se.charts.length>0&&f.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:se.charts.length===1&&se.charts[0]===o?"This chart only":`${se.charts.length} charts`})]}),i&&f.jsx("button",{onClick:()=>tt(se),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:f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"})})})]},`${se.date}-${se.label}-${te}`))})]})]}),f.jsx(O3,{open:oe!==null,title:"Delete event",message:`Delete "${oe==null?void 0:oe.label}"? This cannot be undone.`,onConfirm:Te,onCancel:()=>fe(null)})]}):null}async function I3(e,t,n="png"){const{default:r}=await ls(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);Zc(i,`${t}.${n}`)}async function M3(e,t,n){const[{default:r},{jsPDF:o}]=await Promise.all([ls(()=>import("./html2canvas.esm-QH1iLAAe.js"),[]),ls(()=>import("./jspdf.es.min-DFRl2hZQ.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,d=i.height,p=c/d>1,y=new o({orientation:p?"landscape":"portrait",unit:"mm"}),b=y.internal.pageSize.getWidth(),v=y.internal.pageSize.getHeight();let D=10;n&&(y.setFontSize(16),y.text(n,b/2,D,{align:"center"}),D=20);const k=b-20,E=v-D-10;let T=k,C=d/c*T;C>E&&(C=E,T=c/d*C);const O=(b-T)/2;y.addImage(l,"PNG",O,D,T,C),y.save(`${t}.pdf`)}async function L3(e,t,n){const{jsPDF:r}=await ls(async()=>{const{jsPDF:E}=await import("./jspdf.es.min-DFRl2hZQ.js").then(T=>T.j);return{jsPDF:E}},[]),o=new Image;o.src=e,await new Promise(E=>{o.onload=E});const l=o.width/o.height>1.2,c=new r({orientation:l?"landscape":"portrait",unit:"mm"}),d=c.internal.pageSize.getWidth(),h=c.internal.pageSize.getHeight();let p=15;n&&(c.setFontSize(14),c.text(n,d/2,10,{align:"center"}));const y=d-20,b=h-p-15;let v=y,D=o.height/o.width*v;D>b&&(D=b,v=o.width/o.height*D);const k=(d-v)/2;c.addImage(e,"PNG",k,p,v,D),c.save(`${t}.pdf`)}function Ed(e,t,n){if(e.length===0)return;const r=t.map(l=>l.name),o=e.map(l=>t.map(c=>{const d=l[c.name];if(d==null)return"";const h=String(d);return h.includes(",")||h.includes('"')||h.includes(`
79
+ `)?`"${h.replace(/"/g,'""')}"`:h})),i=[r.join(","),...o.map(l=>l.join(","))].join(`
80
+ `);F2(i,`${n}.csv`,"text/csv;charset=utf-8;")}function R3(e,t){const n=JSON.stringify(e,null,2);F2(n,`${t}.json`,"application/json;charset=utf-8;")}function Zc(e,t){const n=document.createElement("a");n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function F2(e,t,n){const r=new Blob([e],{type:n}),o=URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)}const $a=50;function B2({data:e,columns:t,drillDownColumns:n,filterDisplay:r,chartName:o}){const[i,l]=N.useState(null),[c,d]=N.useState(0),h=N.useMemo(()=>n&&n.length>0?n.map(C=>({field:C.field,label:C.label??C.field,format:C.format})):t.map(C=>({field:C.name,label:C.name,format:void 0})),[n,t]),p=N.useMemo(()=>{if(!i)return e;const{field:C,direction:O}=i;return[...e].sort((A,L)=>{const _=A[C],S=L[C];if(_==null&&S==null)return 0;if(_==null)return 1;if(S==null)return-1;if(typeof _=="number"&&typeof S=="number")return O==="asc"?_-S:S-_;const I=String(_),P=String(S);return O==="asc"?I.localeCompare(P):P.localeCompare(I)})},[e,i]),y=Math.ceil(p.length/$a),b=p.slice(c*$a,(c+1)*$a),v=c*$a+1,D=Math.min((c+1)*$a,p.length),k=C=>{l(O=>!O||O.field!==C?{field:C,direction:"asc"}:O.direction==="asc"?{field:C,direction:"desc"}:null),d(0)},E=(C,O)=>C==null?"":O&&typeof C=="number"?O.includes("$")?`$${C.toLocaleString()}`:O.includes("%")?`${C.toFixed(1)}%`:C.toLocaleString():String(C),T=C=>!i||i.field!==C?"":i.direction==="asc"?" ↑":" ↓";return f.jsxs("div",{className:"border rounded-lg overflow-hidden",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[f.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:[f.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["Showing ",p.length," rows filtered by ",r]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{onClick:()=>Ed(e,t,`${o}-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"}),f.jsx("button",{onClick:()=>R3(e,`${o}-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"})]})]}),f.jsx("div",{className:"overflow-x-auto",children:f.jsxs("table",{className:"w-full text-sm yc-table",children:[f.jsx("thead",{children:f.jsxs("tr",{className:"border-b",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-input-bg)"},children:[f.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(C=>f.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(C.field),children:[C.label,T(C.field)]},C.field))]})}),f.jsx("tbody",{children:b.map((C,O)=>f.jsxs("tr",{style:{backgroundColor:O%2===0?"var(--yc-color-surface)":"var(--yc-color-input-bg)"},children:[f.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*$a+O+1}),h.map(A=>f.jsx("td",{className:"px-4 py-2",style:{color:"var(--yc-color-text-secondary)"},children:E(C[A.field],A.format)},A.field))]},O))})]})}),y>1&&f.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:[f.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["Showing ",v,"-",D," of ",p.length]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{onClick:()=>d(C=>Math.max(0,C-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"}),f.jsx("button",{onClick:()=>d(C=>Math.min(y-1,C+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 Am extends N.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidUpdate(t){this.state.error&&t.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){return this.state.error?this.props.fallback(this.state.error,()=>this.setState({error:null})):this.props.children}}const Wr=N.forwardRef(function({option:t,height:n=400,loading:r=!1,onEvents:o},i){const l=N.useRef(null),c=N.useRef(null);return N.useImperativeHandle(i,()=>({getDataURL:d=>{var p;const h=(p=l.current)==null?void 0:p.getEchartsInstance();if(h)try{return h.getDataURL({type:d==="png"?"png":"svg",pixelRatio:2,backgroundColor:"#fff"})}catch{return h.getDataURL({type:"svg",pixelRatio:2,backgroundColor:"#fff"})}},getInstance:()=>{var d;return(d=l.current)==null?void 0:d.getEchartsInstance()}})),N.useEffect(()=>{const d=c.current;if(!d)return;let h;const p=new ResizeObserver(()=>{clearTimeout(h),h=setTimeout(()=>{var y,b;(b=(y=l.current)==null?void 0:y.getEchartsInstance())==null||b.resize()},150)});return p.observe(d),()=>{clearTimeout(h),p.disconnect()}},[]),f.jsx("div",{ref:c,style:{height:n,width:"100%"},children:f.jsx(Yw,{ref:l,option:t,notMerge:!0,style:{height:"100%",width:"100%"},showLoading:r,onEvents:o,opts:{renderer:"canvas"}})})});function P3(e,t){return e.length<=t?e:e.slice(0,t)+"..."}function j3(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 Td(e,t,n){const r=e.filter(o=>{if(o.date===t)return!0;if(o.endDate&&n&&n.length>0){let i=n.indexOf(o.date),l=n.indexOf(o.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(o=>{const i=o.color??"#6366f1",l=o.endDate?`${o.date} → ${o.endDate}`:"",c=o.description?P3(o.description,100):"",d=c?`<div style="font-size: 11px; color: #888; margin-top: 2px;">${j3(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;">${o.label}</span>${h}${d}</div>`}).join("")}function wd(e,t,n){let r=e.filter(o=>!o.endDate);if(n&&n.length>0&&(r=r.filter(o=>n.includes(o.date))),r.length!==0)return{silent:!0,symbol:"none",tooltip:{show:!1},data:r.map(o=>{const i=o.color??t;return{xAxis:o.date,label:{formatter:o.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 kd(e,t,n){const r=e.filter(l=>l.endDate);if(r.length===0)return[];const o=n==null?void 0:n[0],i=n==null?void 0:n[n.length-1];return r.flatMap(l=>{let c=l.date,d=l.endDate;if(n&&n.length>0&&o&&i){const p=n.indexOf(c),y=n.indexOf(d);p===-1&&(c=o),y===-1&&(d=i);const b=n.indexOf(c),v=n.indexOf(d);if(b>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:d}]]})}const Im="#22c55e",H2="dashed";function F3(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e.toLocaleString()}function U2(e){return e.type==="fixed"}function B3(e){return e.type==="cumulative"}function H3(e){return e.type==="model"}function Sd(e,t){const n=[];for(const r of e){const o=r.color??Im,i=r.style??H2;if(U2(r)){const l=F3(r.value);n.push({yAxis:r.value,label:{formatter:r.label?`${r.label}: ${l}`:l,position:"insideEndTop",fontSize:11,color:o,backgroundColor:"rgba(255,255,255,0.85)",padding:[2,6],borderRadius:2},lineStyle:{color:o,type:i,width:2}})}if(B3(r)){const l=r.from?t.indexOf(r.from):0,c=r.by?t.indexOf(r.by):t.length-1,d=Math.max(0,l===-1?0:l),h=c===-1?t.length-1:c;n.push([{coord:[d,0],label:{formatter:r.label??"",position:"insideEndTop",fontSize:11,color:o},lineStyle:{color:o,type:i,width:2}},{coord:[h,r.value]}])}}return n}function Cd(e,t){const n=[];for(const r of e){if(!r.zone)continue;const o=r.color??Im;if(U2(r)){const i=r.value*(1-r.zone.tolerance),l=r.value*(1+r.zone.tolerance);n.push([{yAxis:i,itemStyle:{color:o,opacity:.08}},{yAxis:l}])}}return n}function _d(e,t){const n=[];for(const r of e){if(!H3(r)||!t)continue;const o=r.color??Im,i=r.style??H2,l=t.rows.map(c=>{const d=c[r.source.value_field];return typeof d=="number"?d:parseFloat(String(d))||0});n.push({name:r.label??"Goal",data:l,color:o,lineStyle:{type:i,width:2,color:o},showSymbol:!1,z:5})}return n}const ed="#22c55e",td="#ef4444";function z2(e){return e.type==="fixed"}function W2(e){return e.type==="cumulative"}function U3(e,t){const n=t.find(z2);return n?e>=n.value?ed:td:null}function z3(e,t,n,r){const o=r.find(W2);if(!o||n===0)return null;const i=o.value/n*(t+1);return e>=i?ed:td}function W3(e,t){const n=t.find(z2);if(n)return e.map(o=>({value:o,itemStyle:{color:o>=n.value?ed:td}}));const r=t.find(W2);if(r){const o=e.length;return e.map((i,l)=>{const c=r.value/o*(l+1);return{value:i,itemStyle:{color:i>=c?ed:td}}})}return e}function Y2(e,t){if(e.length===0||t.length===0)return null;const n=e[e.length-1],r=U3(n,t);return r||z3(n,e.length-1,e.length,t)}function Y3(e){return"field"in e}function $3(e){return"columns"in e}function Uh(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 o of e)r+=o.data[n]??0;for(const o of e)o.data[n]=r===0?0:(o.data[n]??0)/r*100}return e}function Nd(e,t,n){var o,i;const r=t.stacking?"total":void 0;if(!t.series){const l=((o=t.y)==null?void 0:o.field)??"",c=e.map(h=>{const p=h[l];return typeof p=="number"?p:parseFloat(String(p))||0}),d=[{name:l,data:c,color:yi(0,void 0,n),stack:r}];return t.stacking==="percent"?Uh(d):d}if(Y3(t.series)){const l=t.series.field,c=t.series.colors,d=((i=t.y)==null?void 0:i.field)??"",h=[],p=new Map;e.forEach(b=>{const v=String(b[l]??"");p.has(v)||(h.push(v),p.set(v,[]));const D=b[d];p.get(v).push(typeof D=="number"?D:parseFloat(String(D))||0)});const y=h.map((b,v)=>({name:b,data:p.get(b),color:D3(b,v,c,n),stack:r}));return t.stacking==="percent"?Uh(y):y}if($3(t.series)){const l=t.series.columns.map((c,d)=>{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:yi(d,c.color,n),opacity:c.opacity,style:c.style,gradient:c.gradient,stack:r,chartType:c.type,yAxisIndex:c.axis==="right"?1:c.axis==="left"?0:void 0}});return t.stacking==="percent"?Uh(l):l}return[]}function nd(e){const t=e.match(/^(\d{4}-\d{2}-\d{2})T00:00:00(?:\.0+)?(?:Z|[+-]00:?00)?$/);return c1(t?t[1]:e)}function q3(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 $2(e){const t=Math.floor(e.getMonth()/3)+1,n=e.getFullYear().toString().slice(-2);return`Q${t} '${n}`}function V3(e){if(e.length<2)return"MMM dd, yyyy";const t=e.map(c=>c.getTime()).sort((c,d)=>c-d),n=t[0],r=t[t.length-1],o=(r-n)/(1e3*60*60*24);return o<2?"MMM dd, h:mm a":o<=90||(r-n)/(t.length-1)/(1e3*60*60*24)<28?"MMM dd":o<=730?"MMM yyyy":"yyyy"}function Q3(e){if(e.length<2)return"MMM dd, yyyy";const t=e.map(r=>r.getTime()).sort((r,o)=>r-o),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 Dd(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 o=[];for(const l of r){const c=l[t.field];if(typeof c=="string")try{o.push(nd(c))}catch{}}const i=o.length>0?Q3(o):"MMM dd, yyyy";return r.map(l=>{const c=l[t.field];if(typeof c=="string")try{const d=nd(c);return t.format==="quarter"?$2(d):on(d,i)}catch{return String(c??"")}return String(c??"")})}function Od(e,t){const n=new Set,r=e.filter(o=>{const i=o[t.field];return n.has(i)?!1:(n.add(i),!0)});return Ls(r,t)}function Ls(e,t){let n;if(t.type==="temporal"&&!t.format){const r=[];for(const o of e){const i=o[t.field];if(typeof i=="string")try{r.push(nd(i))}catch{}}r.length>0&&(n=V3(r))}return e.map(r=>{const o=r[t.field];if(t.type==="temporal"&&typeof o=="string")try{const i=nd(o);if(t.format==="quarter")return $2(i);const l=t.format?q3(t.format):n??"MMM yyyy";return on(i,l)}catch{return String(o??"")}return String(o??"")})}function wo(e,t){if(t){if(t.includes("$"))return`$${e.toLocaleString()}`;if(t.includes("%"))return`${e.toFixed(1)}%`}return e.toLocaleString()}function G3(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 Ad(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=G3(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 Rs(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 q2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:o,theme:i,height:l=400,loading:c=!1,onChartClick:d,events:h,goalData:p},y){var F,H,W,$,Q,ne,me,ee;const b=cs(),v=(o==null?void 0:o.series)&&"field"in o.series,D=v?Od(t,n):Ls(t,n),k=n.type==="temporal"?Dd(t,n):D,E=N.useMemo(()=>{if(v){const ce=new Set;return t.filter(M=>{const G=M[n.field];return ce.has(G)?!1:(ce.add(G),!0)}).map(M=>M[n.field])}return t.map(ce=>ce[n.field])},[t,n.field,v]),T=N.useMemo(()=>{if(d)return{click:ce=>{var he,pe,Oe,oe;const M=ce;if(M.componentType!=="series")return;const G=M.dataIndex!=null?E[M.dataIndex]:void 0,ae=G!=null?String(G):M.name;if(ae==null||ae==="")return;const j=((pe=(he=M.event)==null?void 0:he.event)==null?void 0:pe.clientX)??0,le=((oe=(Oe=M.event)==null?void 0:Oe.event)==null?void 0:oe.clientY)??0;d(n.field,ae,{x:j,y:le},M.seriesName)}}},[d,n.field,E]);let C,O,A;if(o){const ce=Nd(t,{type:o.type,y:r?{field:r.field,type:r.type}:void 0,series:o.series,stacking:o.stacking},i),M=Rs(i);C=ce.map(G=>{const ae=Ad(G.color,G.gradient??o.gradient);return{type:"line",name:G.name,data:G.data,smooth:M.smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:G.color,type:G.style==="dashed"?"dashed":G.style==="dotted"?"dotted":"solid"},itemStyle:{color:G.color},areaStyle:ae?{color:ae}:void 0,stack:G.stack,...G.opacity!==void 0?{opacity:G.opacity}:{}}}),ce.length>1&&(O={show:((F=o.legend)==null?void 0:F.show)!==!1,...((H=o.legend)==null?void 0:H.position)==="top"?{top:0}:((W=o.legend)==null?void 0:W.position)==="left"?{left:0,orient:"vertical"}:(($=o.legend)==null?void 0:$.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:b.textColor,fontSize:12}}),(Q=o.interactions)!=null&&Q.zoom&&(A=[{type:"inside",start:0,end:100},{type:"slider",start:0,end:100,bottom:0}])}else{const ce=(r==null?void 0:r.field)??"";C=[{type:"line",data:t.map(G=>{const ae=G[ce];return typeof ae=="number"?ae:parseFloat(String(ae))||0}),smooth:Rs(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 L=(o==null?void 0:o.goals)??[];if(L.length>0&&Array.isArray(C)){const ce=Y2(((ne=C[0])==null?void 0:ne.data)??[],L);ce&&C[0]&&(C[0].lineStyle={...C[0].lineStyle,color:ce},C[0].itemStyle={color:ce});const M=Sd(L,D),G=Cd(L);if(M.length>0&&C[0]){const j=C[0].markLine,le=(j==null?void 0:j.data)??[];C[0].markLine={...j,silent:!0,symbol:"none",data:[...le,...M]}}G.length>0&&C[0]&&(C[0].markArea={silent:!0,data:G});const ae=_d(L,p);for(const j of ae)C.push({type:"line",name:j.name,data:j.data,z:j.z,showSymbol:j.showSymbol,lineStyle:j.lineStyle,itemStyle:{color:j.color}})}const _=N.useMemo(()=>{if(!(h!=null&&h.length))return[];const M=h.flatMap(le=>le.endDate?[le.date,le.endDate]:[le.date]).map(le=>({[n.field]:le})),ae=Ls([...t,...M],n).slice(t.length);let j=0;return h.map(le=>{const he={...le,date:ae[j++]??le.date};return le.endDate&&(he.endDate=ae[j++]??le.endDate),he})},[h,t,n]),S=Array.isArray(C)?C.map(ce=>ce.name).filter(Boolean):[],I=wd(_,b.textColor,D),P=kd(_,b.textColor,D);if((I||P.length>0)&&Array.isArray(C)){const ce={type:"line",data:((me=C[0])==null?void 0:me.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};I&&(ce.markLine=I),P.length>0&&(ce.markArea={silent:!0,data:P}),C.push(ce)}const U={tooltip:{trigger:"axis",formatter:ce=>{const M=ce;if(!Array.isArray(M)||M.length===0)return"";let ae=`<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)ae+=`<div>${j.marker} ${j.seriesName}: ${wo(j.value,r==null?void 0:r.format)}</div>`;return ae+=Td(_,M[0].name,D),ae+="</div>",ae}},legend:O?{...O,...S.length>0?{data:S}:{}}: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:b.textColor,fontSize:12},axisLabel:{color:b.textColor,fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:b.borderColor}},axisTick:{show:!1}},yAxis:{type:((ee=o==null?void 0:o.y)==null?void 0:ee.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:b.textColor,fontSize:12},axisLabel:{color:b.textColor,fontSize:12,formatter:ce=>wo(ce,r==null?void 0:r.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:b.splitLineColor,type:"dashed"}}},series:C,...A?{dataZoom:A}:{},animation:!0,animationDuration:300};return f.jsx(Wr,{ref:y,option:U,height:l,loading:c,onEvents:T})}),V2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:o,theme:i,height:l=400,loading:c=!1,horizontal:d=!1,onChartClick:h,activeCrossFilter:p,events:y,goalData:b},v){var me,ee,ce,M,G,ae,j;const D=cs(),k=(o==null?void 0:o.series)&&"field"in o.series,E=k?Od(t,n):Ls(t,n),T=n.type==="temporal"?Dd(t,n):E,C=(p==null?void 0:p.field)===n.field,O=d||(o==null?void 0:o.orientation)==="horizontal",A=N.useMemo(()=>{if(k){const le=new Set;return t.filter(he=>{const pe=he[n.field];return le.has(pe)?!1:(le.add(pe),!0)}).map(he=>he[n.field])}return t.map(le=>le[n.field])},[t,n.field,k]),L=N.useMemo(()=>{if(h)return{click:le=>{var _e,Ee,Fe,$e;const he=le;if(he.componentType!=="series")return;const pe=he.dataIndex!=null?A[he.dataIndex]:void 0,Oe=pe!=null?String(pe):he.name;if(Oe==null||Oe==="")return;const oe=((Ee=(_e=he.event)==null?void 0:_e.event)==null?void 0:Ee.clientX)??0,fe=(($e=(Fe=he.event)==null?void 0:Fe.event)==null?void 0:$e.clientY)??0;h(n.field,Oe,{x:oe,y:fe},he.seriesName)}}},[h,n.field,A]),_=(o==null?void 0:o.stacking)==="percent",S=le=>_?`${le.toFixed(1)}%`:wo(le,r==null?void 0:r.format);let I,P=!1;if(o){const le=Nd(t,{type:o.type,y:r?{field:r.field,type:r.type}:void 0,series:o.series,stacking:o.stacking},i),he=le.length>1,pe=!!o.stacking;P=he;const Oe=Rs(i);I=le.map(oe=>{const fe=Ad(oe.color,oe.gradient??o.gradient);return{type:"bar",name:oe.name,data:C?oe.data.map((_e,Ee)=>({value:_e,itemStyle:{opacity:String(A[Ee])===(p==null?void 0:p.value)?1:.3}})):oe.data,barWidth:he&&!pe?void 0:"60%",itemStyle:{color:fe??oe.color,borderRadius:Oe.barBorderRadius},stack:oe.stack,...oe.opacity!==void 0?{opacity:oe.opacity}:{}}})}else{const le=(r==null?void 0:r.field)??"",he=t.map(Oe=>{const oe=Oe[le];return typeof oe=="number"?oe:parseFloat(String(oe))||0}),pe=Rs(i);I=[{type:"bar",data:C?he.map((Oe,oe)=>({value:Oe,itemStyle:{opacity:String(A[oe])===(p==null?void 0:p.value)?1:.3}})):he,barWidth:"60%",itemStyle:{color:"#3B82F6",borderRadius:pe.barBorderRadius},emphasis:{itemStyle:{color:"#2563EB"}}}]}const U=(o==null?void 0:o.goals)??[];if(U.length>0&&Array.isArray(I)&&!O){if(I[0]){const oe=I[0].data.map(_e=>typeof _e=="number"?_e:_e.value),fe=W3(oe,U);I[0].data=fe}const le=Sd(U,E),he=Cd(U);le.length>0&&I[0]&&(I[0].markLine={silent:!0,symbol:"none",data:le}),he.length>0&&I[0]&&(I[0].markArea={silent:!0,data:he});const pe=_d(U,b);for(const Oe of pe)I.push({type:"line",name:Oe.name,data:Oe.data,z:Oe.z,showSymbol:Oe.showSymbol,lineStyle:Oe.lineStyle,itemStyle:{color:Oe.color}})}const F=N.useMemo(()=>{if(!(y!=null&&y.length))return[];const he=y.flatMap(fe=>fe.endDate?[fe.date,fe.endDate]:[fe.date]).map(fe=>({[n.field]:fe})),Oe=Ls([...t,...he],n).slice(t.length);let oe=0;return y.map(fe=>{const _e={...fe,date:Oe[oe++]??fe.date};return fe.endDate&&(_e.endDate=Oe[oe++]??fe.endDate),_e})},[y,t,n]),H=Array.isArray(I)?I.map(le=>le.name).filter(Boolean):[],W=wd(F,D.textColor,E),$=kd(F,D.textColor,E);if((W||$.length>0)&&Array.isArray(I)){const le={type:"line",data:((me=I[0])==null?void 0:me.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};W&&(le.markLine=W),$.length>0&&(le.markArea={silent:!0,data:$}),I.push(le)}const ne={tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:le=>{const he=le;if(!Array.isArray(he)||he.length===0)return"";const pe=T[he[0].dataIndex]??he[0].name,Oe=Td(F,he[0].name,E);if(he.length===1){const fe=he[0];return`
81
+ <div style="padding: 8px;">
82
+ <div style="font-weight: 600; margin-bottom: 4px;">${pe}</div>
83
+ <div>${fe.marker} ${(r==null?void 0:r.label)||(r==null?void 0:r.field)||fe.seriesName}: ${S(fe.value)}</div>
84
+ ${Oe}
85
+ </div>
86
+ `}const oe=he.map(fe=>`<div>${fe.marker} ${fe.seriesName}: ${S(fe.value)}</div>`).join("");return`
87
+ <div style="padding: 8px;">
88
+ <div style="font-weight: 600; margin-bottom: 4px;">${pe}</div>
89
+ ${oe}
90
+ ${Oe}
91
+ </div>
92
+ `}},legend:P?{show:((ee=o==null?void 0:o.legend)==null?void 0:ee.show)!==!1,...((ce=o==null?void 0:o.legend)==null?void 0:ce.position)==="top"?{top:0}:((M=o==null?void 0:o.legend)==null?void 0:M.position)==="left"?{left:0,orient:"vertical"}:((G=o==null?void 0:o.legend)==null?void 0:G.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:D.textColor,fontSize:12},...H.length>0?{data:H}:{}}:void 0,grid:{left:"3%",right:"4%",bottom:P?"15%":"10%",top:"10%",containLabel:!0},xAxis:O?{type:((ae=o==null?void 0:o.y)==null?void 0:ae.scale)==="log"?"log":"value",axisLabel:{color:D.textColor,fontSize:12,formatter:le=>S(le)},axisLine:{show:!1},splitLine:{lineStyle:{color:D.splitLineColor,type:"dashed"}}}:{type:"category",data:E,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:E,axisLabel:{color:D.textColor,fontSize:12},axisLine:{show:!1},axisTick:{show:!1}}:{type:((j=o==null?void 0:o.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},..._?{max:100}:{},axisLabel:{color:D.textColor,fontSize:12,formatter:le=>S(le)},axisLine:{show:!1},splitLine:{lineStyle:{color:D.splitLineColor,type:"dashed"}}},series:I,animation:!0,animationDuration:300};return f.jsx(Wr,{ref:v,option:ne,height:l,loading:c,onEvents:L})}),Q2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:o,theme:i,height:l=400,loading:c=!1,onChartClick:d,events:h,goalData:p},y){var H,W,$,Q,ne,me,ee,ce;const b=cs(),v=(o==null?void 0:o.series)&&"field"in o.series,D=v?Od(t,n):Ls(t,n),k=n.type==="temporal"?Dd(t,n):D,E=(o==null?void 0:o.stacking)==="percent",T=N.useMemo(()=>{if(v){const M=new Set;return t.filter(G=>{const ae=G[n.field];return M.has(ae)?!1:(M.add(ae),!0)}).map(G=>G[n.field])}return t.map(M=>M[n.field])},[t,n.field,v]),C=N.useMemo(()=>{if(d)return{click:M=>{var pe,Oe,oe,fe;const G=M;if(G.componentType!=="series")return;const ae=G.dataIndex!=null?T[G.dataIndex]:void 0,j=ae!=null?String(ae):G.name;if(j==null||j==="")return;const le=((Oe=(pe=G.event)==null?void 0:pe.event)==null?void 0:Oe.clientX)??0,he=((fe=(oe=G.event)==null?void 0:oe.event)==null?void 0:fe.clientY)??0;d(n.field,j,{x:le,y:he},G.seriesName)}}},[d,n.field,T]);let O,A,L;if(o){const M=Nd(t,{type:o.type,y:r?{field:r.field,type:r.type}:void 0,series:o.series,stacking:o.stacking},i),G=Rs(i);O=M.map(ae=>{const j=Ad(ae.color,ae.gradient??o.gradient??!0);return{type:"line",name:ae.name,data:ae.data,smooth:G.smooth,symbol:"none",lineStyle:{width:2,color:ae.color,type:ae.style==="dashed"?"dashed":ae.style==="dotted"?"dotted":"solid"},itemStyle:{color:ae.color},areaStyle:{color:j??ae.color},stack:ae.stack,...ae.opacity!==void 0?{opacity:ae.opacity}:{}}}),M.length>1&&(A={show:((H=o.legend)==null?void 0:H.show)!==!1,...((W=o.legend)==null?void 0:W.position)==="top"?{top:0}:(($=o.legend)==null?void 0:$.position)==="left"?{left:0,orient:"vertical"}:((Q=o.legend)==null?void 0:Q.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:b.textColor,fontSize:12}}),(ne=o.interactions)!=null&&ne.zoom&&(L=[{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(ae=>{const j=ae[M];return typeof j=="number"?j:parseFloat(String(j))||0}),smooth:Rs(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 _=(o==null?void 0:o.goals)??[];if(_.length>0&&Array.isArray(O)){const M=Y2(((me=O[0])==null?void 0:me.data)??[],_);M&&O[0]&&(O[0].lineStyle={...O[0].lineStyle,color:M},O[0].itemStyle={color:M});const G=Sd(_,D),ae=Cd(_);if(G.length>0&&O[0]){const le=O[0].markLine,he=(le==null?void 0:le.data)??[];O[0].markLine={...le,silent:!0,symbol:"none",data:[...he,...G]}}ae.length>0&&O[0]&&(O[0].markArea={silent:!0,data:ae});const j=_d(_,p);for(const le of j)O.push({type:"line",name:le.name,data:le.data,z:le.z,showSymbol:le.showSymbol,lineStyle:le.lineStyle,itemStyle:{color:le.color}})}const S=N.useMemo(()=>{if(!(h!=null&&h.length))return[];const G=h.flatMap(he=>he.endDate?[he.date,he.endDate]:[he.date]).map(he=>({[n.field]:he})),j=Ls([...t,...G],n).slice(t.length);let le=0;return h.map(he=>{const pe={...he,date:j[le++]??he.date};return he.endDate&&(pe.endDate=j[le++]??he.endDate),pe})},[h,t,n]),I=Array.isArray(O)?O.map(M=>M.name).filter(Boolean):[],P=wd(S,b.textColor,D),U=kd(S,b.textColor,D);if((P||U.length>0)&&Array.isArray(O)){const M={type:"line",data:((ee=O[0])==null?void 0:ee.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};P&&(M.markLine=P),U.length>0&&(M.markArea={silent:!0,data:U}),O.push(M)}const F={tooltip:{trigger:"axis",formatter:M=>{const G=M;if(!Array.isArray(G)||G.length===0)return"";let j=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${k[G[0].dataIndex]??G[0].name}</div>`;for(const le of G){const he=E?`${le.value.toFixed(1)}%`:wo(le.value,r==null?void 0:r.format);j+=`<div>${le.marker} ${le.seriesName}: ${he}</div>`}return j+=Td(S,G[0].name,D),j+="</div>",j}},legend:A?{...A,...I.length>0?{data:I}:{}}: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:b.textColor,fontSize:12},axisLabel:{color:b.textColor,fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:b.borderColor}},axisTick:{show:!1}},yAxis:{type:((ce=o==null?void 0:o.y)==null?void 0:ce.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:b.textColor,fontSize:12},...E?{max:100}:{},axisLabel:{color:b.textColor,fontSize:12,formatter:M=>E?`${M}%`:wo(M,r==null?void 0:r.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:b.splitLineColor,type:"dashed"}}},series:O,...L?{dataZoom:L}:{},animation:!0,animationDuration:300};return f.jsx(Wr,{ref:y,option:F,height:l,loading:c,onEvents:C})}),G2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:o,theme:i,height:l=400,loading:c=!1,onChartClick:d,activeCrossFilter:h},p){var C,O,A,L;const y=cs(),b=(h==null?void 0:h.field)===n.field,v=N.useMemo(()=>t.map(_=>_[n.field]),[t,n.field]),D=N.useMemo(()=>{if(d)return{click:_=>{var H,W,$,Q;const S=_;if(S.componentType!=="series")return;const I=S.dataIndex!=null?v[S.dataIndex]:void 0,P=I!=null?String(I):S.name;if(P==null||P==="")return;const U=((W=(H=S.event)==null?void 0:H.event)==null?void 0:W.clientX)??0,F=((Q=($=S.event)==null?void 0:$.event)==null?void 0:Q.clientY)??0;d(n.field,P,{x:U,y:F})}}},[d,n.field,v]),k=t.map((_,S)=>{const I=_[r.field],P=typeof I=="number"?I:parseFloat(String(I))||0;return{name:String(_[n.field]??""),value:P,itemStyle:{color:yi(S,void 0,i)}}}),E=_=>{if(r.format){if(r.format.includes("$"))return`$${_.toLocaleString()}`;if(r.format.includes("%"))return`${_.toFixed(1)}%`}return _.toLocaleString()},T={tooltip:{trigger:"item",formatter:_=>{const S=_;return`
93
+ <div style="padding: 8px;">
94
+ <div style="font-weight: 600; margin-bottom: 4px;">${S.name}</div>
95
+ <div>${S.marker} ${r.label||r.field}: ${E(S.value)}</div>
96
+ <div style="color: ${y.textColor}; font-size: 12px;">${S.percent.toFixed(1)}%</div>
97
+ </div>
98
+ `}},legend:{show:((C=o==null?void 0:o.legend)==null?void 0:C.show)!==!1,type:"scroll",...((O=o==null?void 0:o.legend)==null?void 0:O.position)==="top"?{top:0,orient:"horizontal",left:"center"}:((A=o==null?void 0:o.legend)==null?void 0:A.position)==="bottom"?{bottom:0,orient:"horizontal",left:"center"}:((L=o==null?void 0:o.legend)==null?void 0:L.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:Rs(i).pieBorderRadius,borderColor:y.surfaceColor,borderWidth:2},label:{show:!1},emphasis:{label:{show:!0,fontSize:14,fontWeight:"bold"}},labelLine:{show:!1},data:k.map(_=>({..._,itemStyle:{..._.itemStyle,...b&&(h==null?void 0:h.value)!==_.name?{opacity:.3}:{}}}))}],animation:!0,animationDuration:300};return f.jsx(Wr,{ref:p,option:T,height:l,loading:c,onEvents:D})}),K2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,centerValue:o,chartConfig:i,theme:l,height:c=400,loading:d=!1,onChartClick:h,activeCrossFilter:p},y){var L,_,S,I,P;const b=cs(),v=(p==null?void 0:p.field)===n.field,D=N.useMemo(()=>t.map(U=>U[n.field]),[t,n.field]),k=N.useMemo(()=>{if(h)return{click:U=>{var ne,me,ee,ce;const F=U;if(F.componentType!=="series")return;const H=F.dataIndex!=null?D[F.dataIndex]:void 0,W=H!=null?String(H):F.name;if(W==null||W==="")return;const $=((me=(ne=F.event)==null?void 0:ne.event)==null?void 0:me.clientX)??0,Q=((ce=(ee=F.event)==null?void 0:ee.event)==null?void 0:ce.clientY)??0;h(n.field,W,{x:$,y:Q})}}},[h,n.field,D]),E=t.map((U,F)=>{const H=U[r.field],W=typeof H=="number"?H:parseFloat(String(H))||0;return{name:String(U[n.field]??""),value:W,itemStyle:{color:yi(F,void 0,l)}}});let T=null;if(o)if(o.field==="total"||!o.field)T=E.reduce((U,F)=>U+F.value,0);else{const U=(L=t[0])==null?void 0:L[o.field];T=typeof U=="number"?U:parseFloat(String(U))||null}const C=(U,F)=>{if(F){if(F.includes("$"))return`$${U.toLocaleString()}`;if(F.includes("%"))return`${U.toFixed(1)}%`}return U.toLocaleString()},O=T!==null?o!=null&&o.label?`{value|${C(T,(o==null?void 0:o.format)||r.format)}}
99
+ {label|${o.label}}`:`{value|${C(T,(o==null?void 0:o.format)||r.format)}}`:"",A={tooltip:{trigger:"item",formatter:U=>{const F=U;return`
100
+ <div style="padding: 8px;">
101
+ <div style="font-weight: 600; margin-bottom: 4px;">${F.name}</div>
102
+ <div>${F.marker} ${r.label||r.field}: ${C(F.value,r.format)}</div>
103
+ <div style="color: ${b.textColor}; font-size: 12px;">${F.percent.toFixed(1)}%</div>
104
+ </div>
105
+ `}},legend:{show:((_=i==null?void 0:i.legend)==null?void 0:_.show)!==!1,type:"scroll",...((S=i==null?void 0:i.legend)==null?void 0:S.position)==="top"?{top:0,orient:"horizontal",left:"center"}:((I=i==null?void 0:i.legend)==null?void 0:I.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:b.textColor,fontSize:12,width:120,overflow:"truncate"},pageTextStyle:{color:b.textColor}},series:[{type:"pie",radius:["40%","60%"],center:["35%","50%"],avoidLabelOverlap:!0,itemStyle:{borderRadius:Rs(l).pieBorderRadius,borderColor:b.surfaceColor,borderWidth:2},label:{show:T!==null,position:"center",formatter:O,rich:{value:{fontSize:22,fontWeight:"bold",color:b.textColor,lineHeight:30},label:{fontSize:12,color:b.textColor,lineHeight:20}}},emphasis:{label:{show:!0,fontSize:14,fontWeight:"bold"},scaleSize:5},labelLine:{show:!1},data:E.map(U=>({...U,itemStyle:{...U.itemStyle,...v&&(p==null?void 0:p.value)!==U.name?{opacity:.3}:{}}}))}],animation:!0,animationDuration:300};return f.jsx(Wr,{ref:y,option:A,height:c,loading:d,onEvents:k})}),K3=5,X3=50;function zh(e){if(e==null)return null;const t=typeof e=="number"?e:parseFloat(String(e));return isNaN(t)?null:t}function J3(e,t,n,r,o){return n===t?(r+o)/2:r+(e-t)/(n-t)*(o-r)}function Z3(e,t,n,r){const{size:o,group:i}=r,l=(o==null?void 0:o.min)??K3,c=(o==null?void 0:o.max)??X3,d=[];for(const v of e){const D=zh(v[t]),k=zh(v[n]);if(D===null||k===null)continue;let E=null;if(o&&(E=zh(v[o.field]),E===null))continue;const T=i?String(v[i.field]??"Other"):"data";d.push({x:D,y:k,sizeVal:E,groupVal:T})}let h=1/0,p=-1/0;if(o){for(const v of d)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 d){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:o?[]:void 0}]};const b=[];for(const[v,D]of y){const k=[],E=[];for(const T of D)o&&T.sizeVal!==null?(k.push([T.x,T.y,T.sizeVal]),E.push(J3(T.sizeVal,h,p,l,c))):k.push([T.x,T.y]);b.push({name:v,data:k,symbolSizes:o?E:void 0})}return{series:b}}function e4(e){const t=e.length;if(t<2)return null;let n=0,r=0,o=0,i=0;for(const[E,T]of e)n+=E,r+=T,o+=E*T,i+=E*E;const l=t*i-n*n;if(l===0)return null;const c=(t*o-n*r)/l,d=(r-c*n)/t,h=r/t;let p=0,y=0;for(const[E,T]of e){const C=c*E+d;p+=(T-C)**2,y+=(T-h)**2}const b=y===0?1:1-p/y,v=e.map(([E])=>E),D=Math.min(...v),k=Math.max(...v);return{slope:c,intercept:d,rSquared:b,line:[[D,c*D+d],[k,c*k+d]]}}const X2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:o,theme:i,height:l=400,loading:c=!1,onChartClick:d,activeCrossFilter:h},p){const y=cs(),b=N.useMemo(()=>{var L,_,S;const D={size:o==null?void 0:o.size,group:o==null?void 0:o.group},{series:k}=Z3(t,n.field,r.field,D),E=(I,P)=>{if(P.format){if(P.format.includes("$"))return`$${I.toLocaleString()}`;if(P.format.includes("%"))return`${I.toFixed(1)}%`}return I.toLocaleString()},T=[],C=[];k.forEach((I,P)=>{const U=yi(P,k.length===1&&typeof(o==null?void 0:o.color)=="string"?o.color:void 0,i),F=I.symbolSizes;if(T.push({type:"scatter",name:I.name,data:I.data,symbolSize:F?(H,W)=>F[W.dataIndex]??10:10,itemStyle:{color:U},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.3)"}}}),o!=null&&o.regression&&I.data.length>=2){const H=I.data.map($=>[$[0],$[1]]),W=e4(H);if(W){T.push({type:"line",name:`${I.name} trend`,data:W.line,showSymbol:!1,lineStyle:{color:U,type:"dashed",opacity:.6,width:2},itemStyle:{color:U},tooltip:{show:!1},silent:!0});const $=[];if(o.regression.show_equation){const Q=W.intercept>=0?"+":"-";$.push(`y = ${W.slope.toFixed(2)}x ${Q} ${Math.abs(W.intercept).toFixed(2)}`)}if(o.regression.show_r_squared&&$.push(`R² = ${W.rSquared.toFixed(3)}`),$.length>0){const Q=P*20;C.push({type:"text",left:"70%",top:`${12+Q}%`,style:{text:$.join(" "),fill:U,fontSize:11,fontFamily:"monospace"}})}}}});const O=((L=o==null?void 0:o.size)==null?void 0:L.label)??((_=o==null?void 0:o.size)==null?void 0:_.field);return{tooltip:{trigger:"item",formatter:I=>{const P=I,U=P.value[0]??0,F=P.value[1]??0,H=P.value[2];let W='<div style="padding: 8px;">';return k.length>1&&(W+=`<div style="font-weight: 600; margin-bottom: 4px;">${P.seriesName}</div>`),W+=`<div>${P.marker} ${n.label||n.field}: ${E(U,n)}</div>`,W+=`<div>${P.marker} ${r.label||r.field}: ${E(F,r)}</div>`,O&&H!=null&&(W+=`<div>${P.marker} ${O}: ${H.toLocaleString()}</div>`),W+="</div>",W}},legend:k.length>1?{show:((S=o==null?void 0:o.legend)==null?void 0:S.show)!==!1,top:0,data:k.map(I=>I.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:I=>E(I,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:I=>E(I,r)},axisLine:{show:!1},splitLine:{lineStyle:{color:y.splitLineColor,type:"dashed"}}},series:T,graphic:C.length>0?C:void 0,animation:!0,animationDuration:300}},[t,n,r,o,i,y]),v=N.useMemo(()=>{if(d)return{click:D=>{var O,A,L,_,S;const k=D;if(k.componentType!=="series")return;const E=(O=k.value)==null?void 0:O[0];if(E==null)return;const T=((L=(A=k.event)==null?void 0:A.event)==null?void 0:L.clientX)??0,C=((S=(_=k.event)==null?void 0:_.event)==null?void 0:S.clientY)??0;d(n.field,String(E),{x:T,y:C},k.seriesName)}}},[d,n.field]);return f.jsx(Wr,{ref:p,option:b,height:l,loading:c,onEvents:v})});function Wh(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 t4(e,t){return t.map(n=>String(e[n]??"")).join("\0")}function n4(e,t){if(e.length===0)return{columnValues:[],groups:[],grandTotals:{}};const{rows:n,columns:r,values:o}=t,i=n[0],l=n.slice(1),c=[...new Set(e.map(y=>String(y[r]??"")))].sort((y,b)=>y.localeCompare(b,void 0,{numeric:!0})),d=new Map;for(const y of e){const b=String(y[i]??"");d.has(b)||d.set(b,[]),d.get(b).push(y)}const h=[];for(const[y,b]of d){const v=new Map;for(const E of b){const T=l.length>0?t4(E,l):"";v.has(T)||v.set(T,[]),v.get(T).push(E)}const D=[];for(const[,E]of v){const T={};for(const O of l)T[O]=String(E[0][O]??"");const C={};for(const O of o){const A=O.aggregate??"sum";for(const L of c){const _=`${O.field}:${L}`,I=E.filter(P=>String(P[r]??"")===L).map(P=>P[O.field]).filter(P=>typeof P=="number");C[_]=I.length>0?Wh(I,A):null}}D.push({labels:T,values:C})}l.length>0&&D.sort((E,T)=>{const C=E.labels[l[0]]??"",O=T.labels[l[0]]??"";return C.localeCompare(O)});const k={};for(const E of o){const T=E.aggregate??"sum";for(const C of c){const O=`${E.field}:${C}`,A=D.map(L=>L.values[O]).filter(L=>L!==null);A.length>0&&(k[O]=T==="avg"?A.reduce((L,_)=>L+_,0)/A.length:Wh(A,T))}}h.push({key:y,rows:D,subtotals:k})}const p={};for(const y of o){const b=y.aggregate??"sum";for(const v of c){const D=`${y.field}:${v}`,k=h.map(E=>E.subtotals[D]).filter(E=>E!==void 0);k.length>0&&(p[D]=b==="avg"?k.reduce((E,T)=>E+T,0)/k.length:Wh(k,b))}}return{columnValues:c,groups:h,grandTotals:p}}function r4(e,t,n,r="#4CAF50",o=.5){if(e===null||t===n)return"transparent";const i=(e-t)/(n-t);if(i<=0)return"transparent";const l=Math.round(i*o*100)/100,c=r.replace("#",""),d=parseInt(c.substring(0,2),16),h=parseInt(c.substring(2,4),16),p=parseInt(c.substring(4,6),16);return`rgba(${d}, ${h}, ${p}, ${l})`}function Rl(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 s4({data:e,pivotConfig:t,height:n}){var L,_;const[r,o]=N.useState(new Set),i=N.useMemo(()=>n4(e,t),[e,t]),l=t.rows,c=t.values,d=t.subtotals!==!1,h=t.grandTotals!==!1,p=((L=t.heatmap)==null?void 0:L.color)??"#4CAF50",y=((_=t.heatmap)==null?void 0:_.scope)??"column",b=N.useMemo(()=>new Set(c.filter(S=>S.heatmap).map(S=>S.field)),[c]),v=N.useMemo(()=>{if(b.size===0)return new Map;const S=new Map;if(y==="global"){let I=1/0,P=-1/0;for(const U of i.groups)for(const F of U.rows)for(const[H,W]of Object.entries(F.values)){const $=H.split(":")[0];W!==null&&b.has($)&&(W<I&&(I=W),W>P&&(P=W))}if(I!==1/0){for(const U of c)if(b.has(U.field))for(const F of i.columnValues)S.set(`${U.field}:${F}`,{min:I,max:P})}}else for(const I of c)if(b.has(I.field))for(const P of i.columnValues){const U=`${I.field}:${P}`;let F=1/0,H=-1/0;for(const W of i.groups)for(const $ of W.rows){const Q=$.values[U];Q!=null&&(Q<F&&(F=Q),Q>H&&(H=Q))}F!==1/0&&S.set(U,{min:F,max:H})}return S},[i,b,y,c]),D=N.useMemo(()=>{const S=new Map;for(const I of c)S.set(I.field,I.format);return S},[c]),k=S=>{o(I=>{const P=new Set(I);return P.has(S)?P.delete(S):P.add(S),P})},E=[];for(const S of i.columnValues)if(c.length===1)E.push({cellKey:`${c[0].field}:${S}`,label:S});else for(const I of c)E.push({cellKey:`${I.field}:${S}`,label:`${S} - ${ca(I.field)}`});const T=l.map(S=>ca(S)).join(" → "),C=l.length>1,O=C?2:1,A=(S,I)=>{const P=S.split(":")[0];if(!b.has(P))return"transparent";const U=v.get(S);return U?r4(I,U.min,U.max,p):"transparent"};return e.length===0?f.jsx("div",{className:"h-full overflow-auto",style:{maxHeight:n},children:f.jsx("div",{className:"text-center py-8",style:{color:"var(--yc-color-text-secondary)"},children:"No data"})}):f.jsx("div",{className:"h-full overflow-auto",style:{maxHeight:n},children:f.jsxs("table",{className:"min-w-full text-sm",style:{borderCollapse:"collapse"},children:[f.jsx("thead",{className:"sticky top-0 z-[2]",style:{background:"var(--yc-color-surface-hover)"},children:f.jsxs("tr",{children:[C?f.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:T}):f.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:T}),E.map(S=>f.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:S.label},S.cellKey))]})}),f.jsx("tbody",{children:i.groups.map(S=>{const I=r.has(S.key),P=d&&S.rows.length>1;return f.jsxs(N.Fragment,{children:[f.jsxs("tr",{className:"cursor-pointer select-none",style:{background:"var(--yc-color-surface-hover)"},onClick:()=>k(S.key),children:[f.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:[f.jsx("span",{className:"mr-1 inline-block w-4 text-center",style:{color:"var(--yc-color-text-muted)"},children:I?"▶":"▼"}),S.key]}),E.map(U=>f.jsx("td",{className:"px-4 py-2",style:{borderBottom:"1px solid var(--yc-color-border)"}},U.cellKey))]}),!I&&S.rows.map((U,F)=>f.jsxs("tr",{children:[C?f.jsxs(f.Fragment,{children:[f.jsx("td",{className:"px-4 py-2",style:{borderBottom:"1px solid var(--yc-color-border)"}}),f.jsx("td",{className:"px-4 py-2",style:{color:"var(--yc-color-text)",borderBottom:"1px solid var(--yc-color-border)"},children:Object.values(U.labels).join(", ")})]}):f.jsx("td",{className:"px-4 py-2",style:{color:"var(--yc-color-text)",borderBottom:"1px solid var(--yc-color-border)"}}),E.map(H=>{const W=U.values[H.cellKey]??null,$=H.cellKey.split(":")[0];return f.jsx("td",{className:"px-4 py-2 text-right",style:{color:"var(--yc-color-text)",borderBottom:"1px solid var(--yc-color-border)",backgroundColor:A(H.cellKey,W)},children:Rl(W,D.get($))},H.cellKey)})]},F)),!I&&P&&f.jsxs("tr",{style:{background:"var(--yc-color-surface-hover)"},children:[f.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 ",S.key]}),E.map(U=>{const F=S.subtotals[U.cellKey]??null,H=U.cellKey.split(":")[0];return f.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:Rl(F,D.get(H))},U.cellKey)})]})]},S.key)})}),h&&f.jsx("tfoot",{className:"sticky bottom-0 z-[2]",style:{background:"var(--yc-color-surface-hover)"},children:f.jsxs("tr",{style:{borderTop:"2px solid var(--yc-color-border)"},children:[f.jsx("td",{colSpan:O,className:"px-4 py-3 font-bold",style:{color:"var(--yc-color-text)"},children:"Grand totals"}),E.map(S=>{const I=i.grandTotals[S.cellKey]??null,P=S.cellKey.split(":")[0];return f.jsx("td",{className:"px-4 py-3 text-right font-bold",style:{color:"var(--yc-color-text)"},children:Rl(I,D.get(P))},S.cellKey)})]})})]})})}function B0({data:e,columns:t,chartConfig:n,height:r=400,loading:o=!1,onRowClick:i}){var I,P,U;const[l,c]=N.useState(((I=n==null?void 0:n.sort)==null?void 0:I.field)??null),[d,h]=N.useState(((P=n==null?void 0:n.sort)==null?void 0:P.direction)??(n!=null&&n.sort?"asc":null)),[p,y]=N.useState([]),b=N.useRef([]),v=N.useMemo(()=>{let F;n!=null&&n.columns&&n.columns.length>0?F=n.columns.map(W=>({field:W.field,label:W.label??ca(W.field),format:W.format,sticky:W.sticky??!1,stickyIndex:-1,summary:W.summary})):F=t.map(W=>({field:W.name,label:ca(W.name),format:void 0,sticky:!1,stickyIndex:-1,summary:void 0}));let H=0;return F.map(W=>W.sticky&&H<3?{...W,stickyIndex:H++}:{...W,sticky:!1,stickyIndex:-1})},[n==null?void 0:n.columns,t]),D=N.useMemo(()=>v.filter(F=>F.sticky).length,[v]),k=N.useCallback(F=>H=>{b.current[F]=H},[]);N.useLayoutEffect(()=>{if(D===0){y([]);return}const F=()=>{var Q;const W=[];let $=0;for(let ne=0;ne<D;ne++)W.push($),$+=((Q=b.current[ne])==null?void 0:Q.offsetWidth)??0;y(W)};if(F(),typeof ResizeObserver>"u")return;const H=new ResizeObserver(F);for(let W=0;W<D;W++){const $=b.current[W];$&&H.observe($)}return()=>H.disconnect()},[D,v,o]);const E=F=>{l===F?d==="asc"?h("desc"):d==="desc"?(c(null),h(null)):h("asc"):(c(F),h("asc"))},T=N.useMemo(()=>!l||!d?e:[...e].sort((F,H)=>{const W=F[l],$=H[l];if(W==null)return 1;if($==null)return-1;let Q=0;return typeof W=="number"&&typeof $=="number"?Q=W-$:Q=String(W).localeCompare(String($)),d==="asc"?Q:-Q}),[e,l,d]),C=N.useMemo(()=>{const F=v.filter(W=>W.summary);if(F.length===0)return null;const H={};for(const W of F){const $=e.map(Q=>Q[W.field]).filter(Q=>typeof Q=="number");if(W.summary==="count"){H[W.field]=e.filter(Q=>Q[W.field]!=null).length;continue}if($.length===0){H[W.field]=null;continue}switch(W.summary){case"sum":H[W.field]=$.reduce((Q,ne)=>Q+ne,0);break;case"avg":H[W.field]=$.reduce((Q,ne)=>Q+ne,0)/$.length;break;case"min":H[W.field]=Math.min(...$);break;case"max":H[W.field]=Math.max(...$);break}}return H},[e,v]),O=((U=n==null?void 0:n.summary)==null?void 0:U.label)??"Total",A=v.findIndex(F=>!F.summary);if(o)return f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsx("div",{className:"animate-pulse bg-gray-100 w-full h-full rounded"})});if(n!=null&&n.pivot){const F=typeof r=="number"?`${r}px`:r;return f.jsx(s4,{data:e,pivotConfig:n.pivot,height:F})}const L=typeof r=="number"?`${r}px`:r,_=(F,H)=>F.sticky?{position:"sticky",left:`${p[F.stickyIndex]??0}px`,zIndex:H?3:1}:{},S=F=>F.sticky&&F.stickyIndex===D-1?"shadow-[2px_0_4px_rgba(0,0,0,0.08)]":"";return f.jsxs("div",{className:"h-full overflow-auto",style:{maxHeight:L},children:[f.jsxs("table",{className:"min-w-full text-sm yc-table",children:[f.jsx("thead",{className:"sticky top-0 z-[2] bg-gray-50 border-b border-gray-200",children:f.jsxs("tr",{children:[f.jsx("th",{className:"px-3 py-3 text-right font-medium text-gray-400 select-none bg-gray-50 w-10",children:"#"}),v.map((F,H)=>f.jsx("th",{ref:F.sticky?k(F.stickyIndex):void 0,className:`px-4 py-3 text-left font-medium text-gray-600 cursor-pointer hover:bg-gray-100 select-none bg-gray-50 ${S(F)}`,style:_(F,!0),onClick:()=>E(F.field),children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("span",{children:F.label}),f.jsx("span",{className:`w-4 text-center text-gray-400 ${l===F.field?"visible":"invisible"}`,children:l===F.field&&d==="asc"?"↑":"↓"})]})},F.field))]})}),f.jsx("tbody",{children:T.map((F,H)=>f.jsxs("tr",{className:`border-b border-gray-100${i?" cursor-pointer hover:bg-black/5 dark:hover:bg-white/5":""}`,onClick:i?W=>{const $=W.target.closest("td[data-field]"),Q=($==null?void 0:$.getAttribute("data-field"))??void 0;i(F,{x:W.clientX,y:W.clientY},Q)}:void 0,children:[f.jsx("td",{className:"px-3 py-3 text-right yc-row-num bg-white w-10",children:H+1}),v.map(W=>f.jsx("td",{"data-field":W.field,className:`px-4 py-3 text-gray-700 bg-white ${S(W)}`,style:{maxWidth:200,..._(W,!1)},children:Rl(F[W.field],W.format)},W.field))]},H))}),C&&f.jsx("tfoot",{className:"sticky bottom-0 z-[2]",children:f.jsxs("tr",{className:"border-t-2 border-gray-300 bg-gray-50 font-medium",children:[f.jsx("td",{className:"px-3 py-3 bg-gray-50 w-10"}),v.map((F,H)=>{const W=C[F.field],$=A>=0&&H===A;return f.jsx("td",{className:`px-4 py-3 text-gray-700 bg-gray-50 ${S(F)}`,style:_(F,!1),children:$?O:W!=null?Rl(W,F.format):""},F.field)})]})})]}),T.length===0&&f.jsx("div",{className:"text-center py-8 text-gray-400",children:"No data"})]})}function o4(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 a4({data:e,yAxis:t,loading:n=!1,title:r}){if(n)return f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsx("div",{className:"animate-pulse bg-gray-200 h-16 w-32 rounded"})});if(!e||e.length===0)return f.jsx("div",{className:"h-full flex items-center justify-center text-gray-400",children:"No data"});const o=e[0],i=o==null?void 0:o[t.field],l=typeof i=="number"?i:parseFloat(String(i))||0,c=o4(l,t.format),d=t.label||t.field;return f.jsxs("div",{className:"h-full flex flex-col items-center justify-center p-4",children:[f.jsx("div",{className:"text-4xl font-bold text-gray-900 tabular-nums",children:c}),(r||d)&&f.jsx("div",{className:"text-sm text-gray-500 mt-2 text-center",children:r||d})]})}const J2=N.forwardRef(function({data:t,xAxis:n,chartConfig:r,theme:o,height:i=400,loading:l=!1,onChartClick:c,events:d,goalData:h},p){var W,$,Q,ne,me,ee,ce;const y=cs(),b=(r==null?void 0:r.series)&&"field"in r.series,v=b?Od(t,n):Ls(t,n),D=n.type==="temporal"?Dd(t,n):v,k=N.useMemo(()=>{if(b){const M=new Set;return t.filter(G=>{const ae=G[n.field];return M.has(ae)?!1:(M.add(ae),!0)}).map(G=>G[n.field])}return t.map(M=>M[n.field])},[t,n.field,b]),E=N.useMemo(()=>{if(c)return{click:M=>{var pe,Oe,oe,fe;const G=M;if(G.componentType!=="series")return;const ae=G.dataIndex!=null?k[G.dataIndex]:void 0,j=ae!=null?String(ae):G.name;if(j==null||j==="")return;const le=((Oe=(pe=G.event)==null?void 0:pe.event)==null?void 0:Oe.clientX)??0,he=((fe=(oe=G.event)==null?void 0:oe.event)==null?void 0:fe.clientY)??0;c(n.field,j,{x:le,y:he},G.seriesName)}}},[c,n.field,k]),T=Nd(t,{series:r.series},o),C=(W=r.axes)==null?void 0:W.left,O=($=r.axes)==null?void 0:$.right,A=[];A.push({type:(C==null?void 0:C.scale)==="log"?"log":"value",name:C==null?void 0:C.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:y.textColor,fontSize:12},axisLabel:{color:y.textColor,fontSize:12,formatter:M=>wo(M,C==null?void 0:C.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=>wo(M,O.format)},axisLine:{show:!1},splitLine:{show:!1}});const L=Rs(o),_=T.map(M=>{const G=Ad(M.color,M.gradient??r.gradient),ae=M.chartType??"bar",j={name:M.name,data:M.data,yAxisIndex:M.yAxisIndex??0,itemStyle:{color:G??M.color},...M.opacity!==void 0?{opacity:M.opacity}:{}};return ae==="line"?{...j,type:"line",smooth:L.smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:M.color,type:M.style==="dashed"?"dashed":M.style==="dotted"?"dotted":"solid"}}:ae==="area"?{...j,type:"line",smooth:L.smooth,symbol:"none",lineStyle:{width:2,color:M.color},areaStyle:{color:G??M.color}}:{...j,type:"bar",barWidth:"60%",itemStyle:{color:G??M.color,borderRadius:L.barBorderRadius}}}),S=(r==null?void 0:r.goals)??[];if(S.length>0&&Array.isArray(_)){const M=Sd(S,v),G=Cd(S);M.length>0&&_[0]&&(_[0].markLine={silent:!0,symbol:"none",data:M}),G.length>0&&_[0]&&(_[0].markArea={silent:!0,data:G});const ae=_d(S,h);for(const j of ae)_.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 I=N.useMemo(()=>{if(!(d!=null&&d.length))return[];const G=d.flatMap(he=>he.endDate?[he.date,he.endDate]:[he.date]).map(he=>({[n.field]:he})),j=Ls([...t,...G],n).slice(t.length);let le=0;return d.map(he=>{const pe={...he,date:j[le++]??he.date};return he.endDate&&(pe.endDate=j[le++]??he.endDate),pe})},[d,t,n]),P=Array.isArray(_)?_.map(M=>M.name).filter(Boolean):[],U=wd(I,y.textColor,v),F=kd(I,y.textColor,v);if((U||F.length>0)&&Array.isArray(_)){const M={type:"line",data:((Q=_[0])==null?void 0:Q.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};U&&(M.markLine=U),F.length>0&&(M.markArea={silent:!0,data:F}),_.push(M)}const H={tooltip:{trigger:"axis",axisPointer:{type:"cross"},formatter:M=>{const G=M;if(!Array.isArray(G)||G.length===0)return"";let j=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${D[G[0].dataIndex]??G[0].name}</div>`;for(const le of G){const he=T.find(Oe=>Oe.name===le.seriesName),pe=(he==null?void 0:he.yAxisIndex)===1?O:C;j+=`<div>${le.marker} ${le.seriesName}: ${wo(le.value,pe==null?void 0:pe.format)}</div>`}return j+=Td(I,G[0].name,v),j+="</div>",j}},legend:{show:((ne=r.legend)==null?void 0:ne.show)!==!1,...((me=r.legend)==null?void 0:me.position)==="top"?{top:0}:((ee=r.legend)==null?void 0:ee.position)==="left"?{left:0,orient:"vertical"}:((ce=r.legend)==null?void 0:ce.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:_,animation:!0,animationDuration:300};return f.jsx(Wr,{ref:p,option:H,height:i,loading:l,onEvents:E})}),Z2=N.forwardRef(function({data:t,chartConfig:n,height:r=400,loading:o=!1},i){const l=N.useMemo(()=>{var C,O;const c=n.x.field,d=n.y.field,h=n.value.field,p=[...new Set(t.map(A=>String(A[c]??"")))],y=[...new Set(t.map(A=>String(A[d]??"")))],b=[];let v=1/0,D=-1/0;for(const A of t){const L=String(A[c]??""),_=String(A[d]??""),S=Number(A[h]??0),I=p.indexOf(L),P=y.indexOf(_);I>=0&&P>=0&&(b.push([I,P,S]),S<v&&(v=S),S>D&&(D=S))}v===1/0&&(v=0),D===-1/0&&(D=0);const k=((C=n.color_range)==null?void 0:C.min)??"#EBF5FB",E=((O=n.color_range)==null?void 0:O.max)??"#1A5276",T=n.show_values??!0;return{tooltip:{position:"top",formatter:A=>{const L=A,_=p[L.value[0]]??"",S=y[L.value[1]]??"",I=L.value[2],P=n.value.label??h;return`${_}, ${S}<br/>${P}: <b>${I}</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,E]}},series:[{type:"heatmap",data:b,label:{show:T},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}},[t,n]);return f.jsx(Wr,{ref:i,option:l,height:r,loading:o})}),ev=N.forwardRef(function({data:t,chartConfig:n,theme:r,height:o=400,loading:i=!1},l){const c=cs(),d=N.useMemo(()=>{var k;const h=n.stage.field,p=n.value.field,y=n.show_conversion??!0,b=t.map(E=>({name:String(E[h]??""),value:Number(E[p]??0)})),v={};for(let E=1;E<b.length;E++){const T=b[E-1],C=b[E];if(T&&C&&T.value>0){const O=(C.value/T.value*100).toFixed(1);v[C.name]=`${O}% of ${T.name}`}}const D=n.color??((k=r==null?void 0:r.palette)==null?void 0:k[0])??"#3B82F6";return{tooltip:{trigger:"item",formatter:E=>{const T=E;let C=`${T.name}: <b>${T.value.toLocaleString()}</b>`;return y&&v[T.name]&&(C+=`<br/><span style="color:${c.textColor}">${v[T.name]}</span>`),C}},series:[{type:"funnel",left:"10%",top:"10%",bottom:"10%",width:"80%",sort:"descending",gap:2,label:{show:!0,position:"inside",formatter:E=>{const T=E;return`${T.name}
106
+ ${T.value.toLocaleString()}`}},itemStyle:{borderColor:c.surfaceColor,borderWidth:1,color:E=>{const C=1-E.dataIndex*.15;return`${D}${Math.round(Math.max(C,.3)*255).toString(16).padStart(2,"0")}`}},data:b}]}},[t,n,r,c]);return f.jsx(Wr,{ref:l,option:d,height:o,loading:i})}),tv=N.forwardRef(function({data:t,chartConfig:n,height:r=400,loading:o=!1},i){const l=cs(),c=N.useMemo(()=>{var O,A,L;const d=n.category.field,h=n.value.field,p=n.total_field,y=((O=n.colors)==null?void 0:O.increase)??"#22C55E",b=((A=n.colors)==null?void 0:A.decrease)??"#EF4444",v=((L=n.colors)==null?void 0:L.total)??"#3B82F6",D=[],k=[],E=[],T=[];let C=0;for(const _ of t){const S=String(_[d]??""),I=Number(_[h]??0),P=p?!!_[p]:!1;D.push(S),P?(k.push(Math.min(0,I)),E.push(Math.abs(I)),T.push(v),C=I):(I>=0?(k.push(C),E.push(I),T.push(y)):(k.push(C+I),E.push(Math.abs(I)),T.push(b)),C+=I)}return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:_=>{var H,W;const S=_;if(!S[0])return"";const I=S[0].dataIndex,P=Number(((H=t[I])==null?void 0:H[h])??0),F=!(p?!!((W=t[I])!=null&&W[p]):!1)&&P>=0?"+":"";return`${S[0].name}<br/><b>${F}${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:E.map((_,S)=>({value:_,itemStyle:{color:T[S]}})),label:{show:!0,position:"top",formatter:_=>{var F,H;const S=_,I=Number(((F=t[S.dataIndex])==null?void 0:F[h])??0);return(p?!!((H=t[S.dataIndex])!=null&&H[p]):!1)?I.toLocaleString():`${I>=0?"+":""}${I.toLocaleString()}`}}}]}},[t,n,l]);return f.jsx(Wr,{ref:i,option:c,height:r,loading:o})}),nv=N.forwardRef(function({data:t,chartConfig:n,theme:r,height:o=400,loading:i=!1},l){const c=cs(),d=N.useMemo(()=>{var C;const h=n.value.field,p=n.min??0,y=n.max??100,b=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,((C=r==null?void 0:r.palette)==null?void 0:C[0])??"#3B82F6"]];const T=[{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}${b}`},data:[{value:D}]}];if(n.goal){const O=Math.min(Math.max(n.goal.value,p),y);T.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:T}},[t,n,r,c]);return f.jsx(Wr,{ref:l,option:d,height:o,loading:i})});function rv({onRefresh:e,onExportCSV:t,onExportPNG:n,onExportSVG:r,onExportPDF:o,isRefreshing:i=!1,hideImageExport:l=!1}){const[c,d]=N.useState(!1),h=N.useRef(null);return N.useEffect(()=>{const p=y=>{h.current&&!h.current.contains(y.target)&&d(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),f.jsxs("div",{className:"relative",ref:h,children:[f.jsx("button",{onClick:()=>d(!c),className:"p-1.5 hover:bg-black/5 rounded transition-colors",style:{color:"var(--yc-color-text-muted)"},title:"Chart actions",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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&&f.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:[f.jsxs("button",{onClick:()=>{e(),d(!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:[f.jsx("svg",{className:`w-4 h-4 ${i?"animate-spin":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"]}),f.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border)"}}),f.jsxs("button",{onClick:()=>{t(),d(!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:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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&&f.jsxs(f.Fragment,{children:[f.jsxs("button",{onClick:()=>{n(),d(!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:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"]}),f.jsxs("button",{onClick:()=>{r(),d(!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:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),"Export SVG"]}),o&&f.jsxs("button",{onClick:()=>{o(),d(!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:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"]})]})]})]})}var lu=dd();function H0(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,o,i]=t;if(r==="00"&&o==="00"&&i==="00")return n;const l=parseInt(r,10),c=l>=12?"PM":"AM",d=l%12||12,h=i==="00"?`${d}:${o} ${c}`:`${d}:${o}:${i} ${c}`;return`${n} ${h}`}function sv({x:e,y:t,field:n,value:r,allFields:o,onFilter:i,onViewDetails:l,onGoToChart:c,onAddEvent:d,detailModel:h,targetChart:p,isTemporalChart:y,onClose:b}){const v=N.useRef(null);N.useEffect(()=>{const S=P=>{v.current&&!v.current.contains(P.target)&&b()},I=P=>{P.key==="Escape"&&b()};return document.addEventListener("mousedown",S),document.addEventListener("keydown",I),()=>{document.removeEventListener("mousedown",S),document.removeEventListener("keydown",I)}},[b]);const D=o?Object.entries(o).map(([S,I])=>`${S} = ${H0(I)}`).join(", "):`${n} = ${H0(r)}`;let k=0;i&&k++,h&&k++,p&&k++,d&&y&&k++;const E=280,T=k*36+8,C=Math.min(e,window.innerWidth-E-8),O=Math.min(t,window.innerHeight-T-8),A=()=>{i==null||i(),b()},L=()=>{l==null||l(),b()},_=()=>{c==null||c(),b()};return lu.createPortal(f.jsxs("div",{ref:v,className:"fixed z-[9999] rounded-lg shadow-lg py-1 min-w-[200px]",style:{left:C,top:O,maxWidth:E,backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[i&&f.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:[f.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:f.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"})}),f.jsxs("span",{className:"truncate",children:["Filter: ",D]})]}),h&&f.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:L,children:[f.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:f.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"})}),f.jsx("span",{children:"View details"})]}),p&&f.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:_,children:[f.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:f.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"})}),f.jsxs("span",{children:["Go to ",p]})]}),d&&y&&f.jsxs(f.Fragment,{children:[(i||h||p)&&f.jsx("div",{className:"my-1 border-t",style:{borderColor:"var(--yc-color-border)"}}),f.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:()=>{d(),b()},children:[f.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:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),f.jsx("span",{children:"Add event"})]})]})]}),document.body)}function ov({date:e,onSave:t,onClose:n,saving:r=!1,themePalette:o}){const[i,l]=N.useState(""),[c,d]=N.useState(e),[h,p]=N.useState(""),[y,b]=N.useState(!1),[v,D]=N.useState(""),k=N.useRef(null);N.useEffect(()=>{var T;(T=k.current)==null||T.focus()},[]),N.useEffect(()=>{function T(C){C.key==="Escape"&&n()}return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[n]);function E(T){T.preventDefault(),i.trim()&&t({date:c,label:i.trim(),color:h,...y&&v?{endDate:v}:{}})}return lu.createPortal(f.jsxs("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center",children:[f.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:n}),f.jsxs("form",{onSubmit:E,className:"relative rounded-lg shadow-xl p-5 w-80",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[f.jsx("h3",{className:"text-sm font-semibold mb-3",style:{color:"var(--yc-color-text)"},children:"Add event"}),f.jsx("label",{className:"block text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:y?"Start date":"Date"}),f.jsx("input",{type:"text",value:c,onChange:T=>d(T.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)"}}),f.jsxs("div",{className:"flex items-center justify-between mb-3",children:[f.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:"Multi-day"}),f.jsx("button",{type:"button",onClick:()=>{b(!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:f.jsx("span",{className:"absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform",style:{left:y?22:2}})})]}),y&&f.jsxs(f.Fragment,{children:[f.jsx("label",{className:"block text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"End date"}),f.jsx("input",{type:"text",value:v,onChange:T=>D(T.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)"}})]}),f.jsx("label",{className:"block text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"Label"}),f.jsx("input",{ref:k,type:"text",value:i,onChange:T=>l(T.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)"}}),f.jsx("label",{className:"block text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"Color (optional)"}),f.jsx("div",{className:"mb-4",children:f.jsx(F0,{value:h,onChange:p,themePalette:o})}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",onClick:n,className:"px-3 py-1.5 text-sm rounded",style:{color:"var(--yc-color-text-muted)"},children:"Cancel"}),f.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 i4={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 rd({isLoading:e,error:t,data:n,hasActiveFilters:r,onRetry:o,children:i}){if(t){const l=t.errorType?i4[t.errorType]:void 0;return f.jsx("div",{className:"h-full flex items-center justify-center p-6",children:f.jsxs("div",{className:"text-center max-w-sm",children:[f.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:f.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"var(--yc-color-danger)"},children:f.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"})})}),f.jsx("p",{className:"text-sm font-medium",style:{color:"var(--yc-color-text)"},children:(l==null?void 0:l.title)??"Failed to load chart"}),f.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-secondary)"},children:t.message}),(l==null?void 0:l.hint)&&f.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:l.hint}),o&&f.jsx("button",{onClick:o,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?f.jsx("div",{className:"h-full animate-pulse rounded",style:{backgroundColor:"var(--yc-color-surface-hover)"}}):n&&n.length===0?f.jsx("div",{className:"h-full flex items-center justify-center p-6",children:f.jsxs("div",{className:"text-center",children:[f.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:f.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"var(--yc-color-text-muted)"},children:f.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"})})}),f.jsx("p",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"No data matches your filters"}),r&&f.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:"Try adjusting your filters"})]})}):f.jsx(f.Fragment,{children:i})}const l4={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 Yh(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 u4(e,t){const n=e>=0?"+":"";return t==="percent_change"?`${n}${e.toFixed(1)}%`:`${n}${e.toLocaleString()}`}function c4({chartName:e,drillParams:t}){var Ee,Fe,$e,st,Je,tt,Te,Re,se;const n=N.useMemo(()=>{if(!t)return;const te=Object.fromEntries(Object.entries(t).filter(([ge])=>!ge.startsWith("_")));return Object.keys(te).length>0?te:void 0},[t]),{data:r,isLoading:o}=jx(e),{data:i,isLoading:l,error:c}=e2(e,n),{data:d}=ma(),h=Tm(),p=Xe(te=>te.getEffectiveFilters),y=N.useRef(null),{events:b,allEvents:v}=r2(e),D=ko(te=>te.auth),k=Wn(),[E,T]=N.useState(null),C=D.status==="disabled"||D.status==="authenticated"&&(D.user.role==="admin"||D.user.role==="editor"),O=((Fe=(Ee=r==null?void 0:r.chart)==null?void 0:Ee.x)==null?void 0:Fe.type)==="temporal",A=Ka({mutationFn:te=>xt.createChartEvent({date:te.date,label:te.label,...te.color?{color:te.color}:{},...te.endDate?{endDate:te.endDate}:{}}),onSuccess:()=>{k.invalidateQueries({queryKey:["chartEvents"]}),T(null)}}),[L,_]=N.useState("chart"),[S,I]=N.useState(!1),[P,U]=N.useState(!1),[F,H]=N.useState(()=>{const te=localStorage.getItem(`yamchart-events-visible-${e}`);return te===null?!0:te==="1"});function W(){H(te=>{const ge=!te;return localStorage.setItem(`yamchart-events-visible-${e}`,ge?"1":"0"),ge})}const $=(()=>{try{const te=sessionStorage.getItem("yamchart-last-dashboard");if(te)return JSON.parse(te)}catch{}return null})(),Q=t==null?void 0:t._from,ne=!!n&&Object.keys(n).length>0,me=n?Object.entries(n).map(([te,ge])=>`${te}: ${ge}`).join(", "):"",ce=p(e).granularity,M=ce?l4[ce]:void 0,[G,ae]=N.useState(null),j=N.useCallback((te,ge,Ne,qe)=>{var yt;let pt;if(qe&&((yt=r==null?void 0:r.chart)!=null&&yt.series)&&"field"in r.chart.series){const ie=r.chart.series.field;ie&&ie!==te&&(pt={[te]:ge,[ie]:qe})}ae({x:Ne.x,y:Ne.y,field:te,value:ge,allFields:pt})},[r]),le=N.useCallback(()=>{G&&T(G.value)},[G]),he=N.useCallback(()=>{var qe,pt;if(!G||!((qe=r==null?void 0:r.drillDown)!=null&&qe.model))return;const te=r.drillDown,ge=te.fields?typeof te.fields=="string"?te.fields:te.fields[0]:te.field??((pt=r.chart.x)==null?void 0:pt.field)??G.field,Ne=new URLSearchParams;if(G.allFields)for(const[yt,ie]of Object.entries(G.allFields))Ne.set(yt,ie);else Ne.set(ge,G.value);Ne.set("_from",e),window.location.hash=`/charts/${e}/detail?${Ne.toString()}`,ae(null)},[G,r,e]),pe=N.useCallback(()=>{var qe,pt;if(!G||!((qe=r==null?void 0:r.drillDown)!=null&&qe.chart))return;const te=r.drillDown,ge=te.fields?typeof te.fields=="string"?te.fields:te.fields[0]:te.field??((pt=r.chart.x)==null?void 0:pt.field)??G.field,Ne=new URLSearchParams;if(G.allFields)for(const[yt,ie]of Object.entries(G.allFields))Ne.set(yt,ie);else Ne.set(ge,G.value);Ne.set("_from",e),window.location.hash=`/charts/${r.drillDown.chart}?${Ne.toString()}`,ae(null)},[G,r,e]),Oe=()=>{!i||!r||Ed(i.rows,i.columns,r.name||e)},oe=()=>{var ge;const te=(ge=y.current)==null?void 0:ge.getDataURL("png");te&&r&&Zc(te,`${r.name||e}.png`)};if(o)return f.jsx("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"Loading chart..."});if(!r)return f.jsxs("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:["Chart not found: ",e]});const fe=M?{...r.chart.x,label:M.label,format:M.format}:r.chart.x,_e=()=>{var te,ge;if(!i)return f.jsx("div",{className:"h-full animate-pulse",style:{background:"var(--yc-color-background)"}});if(L==="table"&&i)return f.jsx(B0,{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)?f.jsx(q2,{ref:y,data:i.rows,columns:i.columns,xAxis:fe,yAxis:r.chart.y,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l,onChartClick:j,events:F?b:[]}):null;case"bar":return r.chart.x&&(r.chart.y||r.chart.series)?f.jsx(V2,{ref:y,data:i.rows,xAxis:fe,yAxis:r.chart.y,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l,onChartClick:j,events:F?b:[]}):null;case"area":return r.chart.x&&(r.chart.y||r.chart.series)?f.jsx(Q2,{ref:y,data:i.rows,xAxis:fe,yAxis:r.chart.y,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l,onChartClick:j,events:F?b:[]}):null;case"pie":return r.chart.x&&r.chart.y?f.jsx(G2,{ref:y,data:i.rows,xAxis:r.chart.x,yAxis:r.chart.y,theme:d==null?void 0:d.theme,height:"100%",loading:l,onChartClick:j}):null;case"donut":return r.chart.x&&r.chart.y?f.jsx(K2,{ref:y,data:i.rows,xAxis:r.chart.x,yAxis:r.chart.y,centerValue:r.chart.centerValue,theme:d==null?void 0:d.theme,height:"100%",loading:l,onChartClick:j}):null;case"scatter":return r.chart.x&&r.chart.y?f.jsx(X2,{ref:y,data:i.rows,xAxis:r.chart.x,yAxis:r.chart.y,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l,onChartClick:j}):null;case"combo":return r.chart.x?f.jsx(J2,{ref:y,data:i.rows,xAxis:fe,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l,onChartClick:j,events:F?b:[]}):null;case"heatmap":return f.jsx(Z2,{ref:y,data:i.rows,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l});case"funnel":return f.jsx(ev,{ref:y,data:i.rows,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l});case"waterfall":return f.jsx(tv,{ref:y,data:i.rows,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l});case"gauge":return f.jsx(nv,{ref:y,data:i.rows,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l});case"table":return f.jsx(B0,{data:i.rows,columns:i.columns,chartConfig:r.chart,height:"100%",loading:l,onRowClick:r.drillDown?(Ne,qe,pt)=>{const yt=r.drillDown,ie=yt.fields?typeof yt.fields=="string"?[yt.fields]:yt.fields:yt.field?[yt.field]:[];if(ie.length===0)return;const ye={};for(const Me of ie)Me in Ne?ye[Me]=String(Ne[Me]??""):pt?ye[Me]=pt:ye[Me]="";ae({x:qe.x,y:qe.y,field:ie[0],value:ye[ie[0]],allFields:ie.length>1?ye:void 0})}:void 0});case"kpi":{const Ne=r.chart;if(!((te=Ne.value)!=null&&te.field)||!i.rows[0])return f.jsx("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"No data available"});const qe=i.rows[0],pt=qe[Ne.value.field],yt=Yh(pt,Ne.format);let ie=null,ye="percent_change",Me,nt,ot;if(i.comparison)ie=i.comparison.change,ye=i.comparison.changeType,Me=i.comparison.currentPeriodLabel,nt=i.comparison.previousPeriodLabel,ot=Yh(i.comparison.previousValue,Ne.format);else if((ge=Ne.comparison)!=null&&ge.enabled&&Ne.comparison.field){const gt=qe[Ne.comparison.field];ye=Ne.comparison.type,gt&&gt!==0&&(ie=ye==="percent_change"?(pt-gt)/gt*100:pt-gt,ot=Yh(gt,Ne.format))}return f.jsxs("div",{className:"h-full flex flex-col items-center justify-center p-8",children:[f.jsxs("div",{className:"text-6xl font-bold tabular-nums",style:{color:"var(--yc-color-text)"},children:[yt,Ne.unit&&f.jsx("span",{className:"text-3xl font-normal ml-2",style:{color:"var(--yc-color-text-secondary)"},children:Ne.unit})]}),Me&&f.jsx("div",{className:"text-sm mt-2",style:{color:"var(--yc-color-text-secondary)"},children:Me}),ie!==null&&f.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[f.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:u4(ie,ye)}),ot&&f.jsxs("span",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["vs ",ot]}),nt&&f.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["(",nt,")"]})]})]})}default:return f.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 f.jsx(Am,{fallback:(te,ge)=>f.jsx("div",{className:"flex items-center justify-center h-full p-8",children:f.jsxs("div",{className:"text-center",children:[f.jsx("p",{className:"text-sm font-medium",style:{color:"var(--yc-color-danger)"},children:"Failed to render chart"}),f.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-secondary)"},children:te.message}),f.jsx("button",{onClick:ge,className:"mt-2 text-xs hover:opacity-80",style:{color:"var(--yc-color-primary)"},children:"Retry"})]})}),resetKey:e,children:f.jsxs("div",{className:"h-full flex flex-col",children:[f.jsxs("div",{className:"px-6 pt-4 pb-3 space-y-3",children:[!Q&&$&&f.jsxs("div",{className:"flex items-center gap-1.5 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),f.jsx("a",{href:`#/dashboards/${$.name}`,className:"hover:underline",style:{color:"var(--yc-color-primary)"},children:$.title})]}),Q&&f.jsxs("div",{className:"flex items-center gap-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("button",{onClick:()=>{window.location.hash=`/charts/${Q}`},className:"hover:underline",style:{color:"var(--yc-color-primary)"},children:Q}),f.jsx("span",{children:"/"}),f.jsx("span",{style:{color:"var(--yc-color-text)"},className:"font-medium",children:r.title}),me&&f.jsxs("span",{children:["(",me,")"]})]}),f.jsxs("div",{className:"flex items-start justify-between gap-4",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-xl font-semibold",style:{color:"var(--yc-color-text)",fontFamily:"var(--yc-font-heading)"},children:r.title}),r.description&&f.jsx("p",{className:"text-sm mt-1",style:{color:"var(--yc-color-text-secondary)"},children:r.description})]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.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:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"})})}),f.jsx(T3,{resourceType:"chart",resourceName:e})]})]}),r.parameters.length>0&&f.jsx(P2,{parameters:r.parameters,chartName:e}),ne&&f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsx("span",{className:"text-xs font-medium",style:{color:"var(--yc-color-text-secondary)"},children:"Filtered:"}),Object.entries(n).map(([te,ge])=>f.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:[te,": ",ge]},te))]})]}),f.jsx("div",{className:"flex-1 min-h-0 px-6",children:f.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:f.jsx(rd,{isLoading:l,error:c,data:i==null?void 0:i.rows,onRetry:()=>h(e),children:_e()})})}),f.jsx("div",{className:"px-6 pb-2",children:f.jsx(w3,{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:L,onToggleView:_,onExportCSV:Oe,onExportPNG:oe,onShowSql:()=>I(!S),onShowEvents:O?()=>U(!P):void 0,eventCount:O?b.length:void 0})}),ne&&i&&f.jsx("div",{className:"px-6 pb-4",children:f.jsx(B2,{data:i.rows,columns:i.columns,drillDownColumns:($e=r.drillDown)==null?void 0:$e.columns,filterDisplay:me,chartName:e})}),G&&f.jsx(sv,{x:G.x,y:G.y,field:G.field,value:G.value,allFields:G.allFields,onViewDetails:(st=r.drillDown)!=null&&st.model?he:void 0,onGoToChart:(Je=r.drillDown)!=null&&Je.chart?pe:void 0,onAddEvent:C?le:void 0,detailModel:(tt=r.drillDown)==null?void 0:tt.model,targetChart:(Te=r.drillDown)==null?void 0:Te.chart,isTemporalChart:O,onClose:()=>ae(null)}),E&&f.jsx(ov,{date:E,onSave:te=>A.mutate(te),onClose:()=>T(null),saving:A.isPending,themePalette:(Re=d==null?void 0:d.theme)==null?void 0:Re.palette}),f.jsx(N3,{isOpen:S,onClose:()=>I(!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}),f.jsx(A3,{isOpen:P,onClose:()=>U(!1),events:b,allEvents:v,chartName:e,canEdit:C,eventsVisible:F,onToggleVisible:W,themePalette:(se=d==null?void 0:d.theme)==null?void 0:se.palette})]})})}function d4({chartName:e,params:t}){var d;const n=Object.fromEntries(Object.entries(t).filter(([h])=>!h.startsWith("_"))),{data:r}=hr({queryKey:["chart",e],queryFn:()=>xt.getChart(e)}),{data:o,isLoading:i,error:l}=hr({queryKey:["chartDetail",e,n],queryFn:()=>xt.queryChartDetail(e,n),enabled:!!e}),c=Object.entries(n).map(([h,p])=>`${h}: ${p}`).join(", ");return i?f.jsx("div",{className:"flex items-center justify-center h-64",children:f.jsx("div",{style:{color:"var(--yc-color-text-secondary)"},children:"Loading details..."})}):l||!o?f.jsx("div",{className:"flex items-center justify-center h-64",children:f.jsxs("div",{style:{color:"var(--yc-color-danger)"},children:["Failed to load details: ",(l==null?void 0:l.message)||"Unknown error"]})}):f.jsxs("div",{className:"p-6",children:[f.jsxs("div",{className:"flex items-center gap-2 text-sm mb-4",children:[f.jsx("button",{onClick:()=>{window.history.back()},className:"hover:underline",style:{color:"var(--yc-color-primary)"},children:"← Back"}),f.jsx("span",{style:{color:"var(--yc-color-text-muted)"},children:"/"}),f.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&&f.jsx("div",{className:"flex items-center gap-2 mb-4 flex-wrap",children:Object.entries(n).map(([h,p])=>f.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))}),f.jsx(B2,{data:o.rows,columns:o.columns,drillDownColumns:(d=r==null?void 0:r.drillDown)==null?void 0:d.columns,filterDisplay:c,chartName:e})]})}function f4(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 av=N.createContext(null);function h4({children:e}){const[t,n]=N.useState(!1),[r,o]=N.useState(null),[i,l]=N.useState(null),[c,d]=N.useState(null),h=N.useRef(f4()),[p,y]=N.useState(!1),[b,v]=N.useState(!1),D=r!==null,k=N.useMemo(()=>r||i,[r,i]),E=N.useCallback(S=>{l(S)},[]),T=N.useCallback(S=>{if(S===null){o(null);return}const I=r||i;I&&h.current.push(I),o(S),y(h.current.canUndo()),v(h.current.canRedo())},[r,i]),C=N.useCallback(()=>{const S=h.current.undo();S&&(o(S),y(h.current.canUndo()),v(h.current.canRedo()))},[]),O=N.useCallback(()=>{const S=h.current.redo();S&&(o(S),y(h.current.canUndo()),v(h.current.canRedo()))},[]);N.useEffect(()=>{h.current.clear(),y(!1),v(!1),d(null)},[t]),N.useEffect(()=>{if(!t)return;const S=I=>{const P=I.metaKey||I.ctrlKey;P&&I.key==="z"&&!I.shiftKey&&(I.preventDefault(),C()),P&&I.key==="z"&&I.shiftKey&&(I.preventDefault(),O())};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[t,C,O]);const A=N.useCallback(S=>{var $;const I=r||i;if(!I)return;const U=S.type==="chart"&&(($=S.ref)==null?void 0:$.toLowerCase().includes("kpi"))?3:6,H={height:100,widgets:[{...S,cols:U}]},W={...I,rows:[...I.rows,H]};T(W)},[r,i,T]),L=N.useCallback((S,I)=>{const P=r||i;if(!P)return;const U=P.rows.map((H,W)=>{if(W!==S)return H;const $=H.widgets.filter((Q,ne)=>ne!==I);return{...H,widgets:$}}).filter(H=>H.widgets.length>0),F={...P,rows:U};T(F)},[r,i,T]),_=N.useCallback((S,I,P)=>{const U=r||i;if(!U)return;const F=U.rows.map((W,$)=>{if($!==S)return W;const Q=W.widgets.map((ne,me)=>me!==I?ne:{...ne,...P});return{...W,widgets:Q}}),H={...U,rows:F};T(H)},[r,i,T]);return f.jsx(av.Provider,{value:{isEditing:t,setIsEditing:n,pendingLayout:r,setPendingLayout:T,hasChanges:D,originalLayout:i,setOriginalLayout:E,currentLayout:k,addWidget:A,removeWidget:L,updateWidget:_,pendingFilters:c,setPendingFilters:d,undo:C,redo:O,canUndo:p,canRedo:b},children:e})}function Si(){const e=N.useContext(av);if(!e)throw new Error("useEditMode must be used within EditModeProvider");return e}function Ci(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function gi(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function yl(e,t,n,r,o,i,l){const{margin:c,containerPadding:d,rowHeight:h}=e,p=Ci(e);let y,b,v,D;if(l?(y=Math.round(l.width),b=Math.round(l.height)):(y=gi(r,p,c[0]),b=gi(o,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+d[1]),D=Math.round((p+c[0])*t+d[0])),!i&&!l){if(Number.isFinite(r)){const E=Math.round((p+c[0])*(t+r)+d[0])-D-y;E!==c[0]&&(y+=E-c[0])}if(Number.isFinite(o)){const E=Math.round((h+c[1])*(n+o)+d[1])-v-b;E!==c[1]&&(b+=E-c[1])}}return{top:v,left:D,width:y,height:b}}function m4(e,t,n,r,o){const{margin:i,containerPadding:l,cols:c,rowHeight:d,maxRows:h}=e,p=Ci(e);let y=Math.round((n-l[0])/(p+i[0])),b=Math.round((t-l[1])/(d+i[1]));return y=sd(y,0,c-r),b=sd(b,0,h-o),{x:y,y:b}}function Dc(e,t,n){const{margin:r,containerPadding:o,rowHeight:i}=e,l=Ci(e),c=Math.round((n-o[0])/(l+r[0])),d=Math.round((t-o[1])/(i+r[1]));return{x:c,y:d}}function p4(e,t,n){const{margin:r,rowHeight:o}=e,i=Ci(e),l=Math.max(1,Math.round((t+r[0])/(i+r[0]))),c=Math.max(1,Math.round((n+r[1])/(o+r[1])));return{w:l,h:c}}function sd(e,t,n){return Math.max(Math.min(e,n),t)}function Mm(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 sa(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0&&Mm(r,t))return r}}function iv(e,t){return e.filter(n=>Mm(n,t))}function y4(e,t){return t==="horizontal"?lv(e):t==="vertical"||t==="wrap"?U0(e):[...e]}function U0(e){return[...e].sort((t,n)=>t.y!==n.y?t.y-n.y:t.x-n.x)}function lv(e){return[...e].sort((t,n)=>t.x!==n.x?t.x-n.x:t.y-n.y)}function Id(e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0){const o=r.y+r.h;o>t&&(t=o)}}return t}function Wo(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0&&r.i===t)return r}}function Md(e){return e.filter(t=>t.static===!0)}function da(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 So(e){const t=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];r!==void 0&&(t[n]=da(r))}return t}function g4(e,t){const n=new Array(e.length);for(let r=0;r<e.length;r++){const o=e[r];o!==void 0&&(t.i===o.i?n[r]=t:n[r]=o)}return n}function b4(e,t,n){let r=Wo(e,t);return r?(r=n(da(r)),[g4(e,r),r]):[[...e],null]}function Lm(e,t){const n=Md(e);for(let r=0;r<e.length;r++){const o=e[r];if(o!==void 0)if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;sa(n,o);)o.y++}return e}function Vo(e,t,n,r,o,i,l,c,d){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=y4(e,l);(l==="vertical"&&typeof r=="number"?p>=r:l==="horizontal"&&typeof n=="number"?h>=n:!1)&&(y=y.reverse());const v=iv(y,t),D=v.length>0;if(D&&d)return So(e);if(D&&i)return t.x=h,t.y=p,t.moved=!1,e;let k=[...e];for(let E=0;E<v.length;E++){const T=v[E];T!==void 0&&(T.moved||(T.static?k=D1(k,T,t,o,l):k=D1(k,t,T,o,l)))}return k}function D1(e,t,n,r,o,i){const l=o==="horizontal",c=o==="vertical",d=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"},b=sa(e,y),v=b!==void 0&&b.y+b.h>t.y,D=b!==void 0&&t.x+t.w>b.x;if(!b)return Vo(e,n,l?y.x:void 0,c?y.y:void 0,r,d,o);if(v&&c)return Vo(e,n,void 0,n.y+1,r,d,o);if(v&&o===null)return t.y=n.y,n.y=n.y+n.h,[...e];if(D&&l)return Vo(e,t,n.x,void 0,r,d,o)}const h=l?n.x+1:void 0,p=c?n.y+1:void 0;return h===void 0&&p===void 0?[...e]:Vo(e,n,h,p,r,d,o)}function vo(e,t,n){return Math.max(t,Math.min(n,e))}var x4={name:"gridBounds",constrainPosition(e,t,n,{cols:r,maxRows:o}){return{x:vo(t,0,Math.max(0,r-e.w)),y:vo(n,0,Math.max(0,o-e.h))}},constrainSize(e,t,n,r,{cols:o,maxRows:i}){const l=r==="w"||r==="nw"||r==="sw"?e.x+e.w:o-e.x,c=r==="n"||r==="nw"||r==="ne"?e.y+e.h:i-e.y;return{w:vo(t,1,Math.max(1,l)),h:vo(n,1,Math.max(1,c))}}},v4={name:"minMaxSize",constrainSize(e,t,n){return{w:vo(t,e.minW??1,e.maxW??1/0),h:vo(n,e.minH??1,e.maxH??1/0)}}},E4={name:"containerBounds",constrainPosition(e,t,n,{cols:r,maxRows:o,containerHeight:i,rowHeight:l,margin:c}){const d=i>0?Math.floor((i+c[1])/(l+c[1])):o;return{x:vo(t,0,Math.max(0,r-e.w)),y:vo(n,0,Math.max(0,d-e.h))}}},od=[x4,v4];function Oc(e,t,n,r,o){let i={x:n,y:r};for(const l of e)l.constrainPosition&&(i=l.constrainPosition(t,i.x,i.y,o));if(t.constraints)for(const l of t.constraints)l.constrainPosition&&(i=l.constrainPosition(t,i.x,i.y,o));return i}function T4(e,t,n,r,o,i){let l={w:n,h:r};for(const c of e)c.constrainSize&&(l=c.constrainSize(t,l.w,l.h,o,i));if(t.constraints)for(const c of t.constraints)c.constrainSize&&(l=c.constrainSize(t,l.w,l.h,o,i));return l}function Rm({top:e,left:t,width:n,height:r}){const o=`translate(${t}px,${e}px)`;return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:`${n}px`,height:`${r}px`,position:"absolute"}}function uv({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:"absolute"}}function O1(e){return e*100+"%"}function w4(e,t,n,r){return e+n>r?t:n}function cv(e,t,n){return e<0?t:n}function k4(e){return Math.max(0,e)}function ad(e){return Math.max(0,e)}var Pm=(e,t,n)=>{const{left:r,height:o,width:i}=t,l=e.top-(o-e.height);return{left:r,width:i,height:cv(l,e.height,o),top:ad(l)}},jm=(e,t,n)=>{const{top:r,left:o,height:i,width:l}=t;return{top:r,height:i,width:w4(e.left,e.width,l,n),left:k4(o)}},Fm=(e,t,n)=>{const{top:r,height:o,width:i}=t,l=e.left+e.width-i;return l<0?{height:o,width:e.left+e.width,top:ad(r),left:0}:{height:o,width:i,top:ad(r),left:l}},Bm=(e,t,n)=>{const{top:r,left:o,height:i,width:l}=t;return{width:l,left:o,height:cv(r,e.height,i),top:ad(r)}},S4=(e,t,n)=>Pm(e,jm(e,t,n)),C4=(e,t,n)=>Pm(e,Fm(e,t)),_4=(e,t,n)=>Bm(e,jm(e,t,n)),N4=(e,t,n)=>Bm(e,Fm(e,t)),D4={n:Pm,ne:S4,e:jm,se:_4,s:Bm,sw:N4,w:Fm,nw:C4};function O4(e,t,n,r){const o=D4[e];return o?o(t,{...t,...n},r):n}var Hm={type:"transform",scale:1,calcStyle(e){return Rm(e)}},dv={type:"absolute",scale:1,calcStyle(e){return uv(e)}};function fv(e){return{type:"transform",scale:e,calcStyle(t){return Rm(t)},calcDragPosition(t,n,r,o){return{left:(t-r)/e,top:(n-o)/e}}}}var A4=Hm,I4={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},M4={enabled:!0,bounded:!1,threshold:3},L4={enabled:!0,handles:["se"]},R4={enabled:!1,defaultItem:{w:1,h:1}};function Um(e,t,n,r,o){const i=r==="x"?"w":"h";t[r]+=1;const l=e.findIndex(d=>d.i===t.i),c=o??Md(e).length>0;for(let d=l+1;d<e.length;d++){const h=e[d];if(h!==void 0&&!h.static){if(!c&&h.y>t.y+t.h)break;Mm(t,h)&&Um(e,h,n+t[i],r,c)}}t[r]=n}function P4(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&&!sa(e,t);)t.y--;let o;for(;(o=sa(e,t))!==void 0;)Um(n,t,o.y+o.h,"y");return t.y=Math.max(t.y,0),t}function j4(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!sa(e,t);)t.x--;let o;for(;(o=sa(e,t))!==void 0;)if(Um(r,t,o.x+o.w,"x"),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!sa(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var hv={type:"vertical",allowOverlap:!1,compact(e,t){const n=Md(e);let r=Id(n);const o=U0(e),i=new Array(e.length);for(let l=0;l<o.length;l++){const c=o[l];if(c===void 0)continue;let d=da(c);d.static||(d=P4(n,d,o,r),r=Math.max(r,d.y+d.h),n.push(d));const h=e.indexOf(c);i[h]=d,d.moved=!1}return i}},mv={type:"horizontal",allowOverlap:!1,compact(e,t){const n=Md(e),r=lv(e),o=new Array(e.length);for(let i=0;i<r.length;i++){const l=r[i];if(l===void 0)continue;let c=da(l);c.static||(c=j4(n,c,t,r),n.push(c));const d=e.indexOf(l);o[d]=c,c.moved=!1}return o}},pv={type:null,allowOverlap:!1,compact(e,t){return So(e)}},F4={...hv,allowOverlap:!0,compact(e,t){return So(e)}},B4={...mv,allowOverlap:!0,compact(e,t){return So(e)}},H4={...pv,allowOverlap:!0};function uu(e,t=!1,n=!1){let r;return t?e==="vertical"?r=F4:e==="horizontal"?r=B4:r=H4:e==="vertical"?r=hv:e==="horizontal"?r=mv:r=pv,n?{...r,preventCollision:n}:r}function yv(e){return Object.keys(e).sort((n,r)=>e[n]-e[r])}function A1(e,t){const n=yv(e);let r=n[0];if(r===void 0)throw new Error("No breakpoints defined");for(let o=1;o<n.length;o++){const i=n[o];if(i===void 0)continue;const l=e[i];t>l&&(r=i)}return r}function I1(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 $h(e,t,n,r,o,i){const l=e[n];if(l)return So(l);let c=e[r];const d=yv(t),h=d.slice(d.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=So(c||[]),y=Lm(p,{cols:o});return(typeof i=="object"&&i!==null?i:uu(i)).compact(y,o)}function Ac(e,t){if(Array.isArray(e))return e;const n=e,r=n[t];if(r!==void 0)return r;const o=Object.keys(n);for(const i of o){const l=n[i];if(l!==void 0)return l}return[10,10]}var gl={exports:{}},qh={},Vh={exports:{}},Qh,M1;function U4(){if(M1)return Qh;M1=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Qh=e,Qh}var Gh,L1;function z4(){if(L1)return Gh;L1=1;var e=U4();function t(){}function n(){}return n.resetWarningCache=t,Gh=function(){function r(l,c,d,h,p,y){if(y!==e){var b=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 b.name="Invariant Violation",b}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Gh}var R1;function Ld(){return R1||(R1=1,Vh.exports=z4()()),Vh.exports}var Ic={exports:{}},P1;function W4(){if(P1)return Ic.exports;P1=1;function e(n){var r,o,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]&&(o=e(n[r]))&&(i&&(i+=" "),i+=o)}else for(o in n)n[o]&&(i&&(i+=" "),i+=o);return i}function t(){for(var n,r,o=0,i="",l=arguments.length;o<l;o++)(n=arguments[o])&&(r=e(n))&&(i&&(i+=" "),i+=r);return i}return Ic.exports=t,Ic.exports.clsx=t,Ic.exports}var un={},ro={},j1;function Rd(){if(j1)return ro;j1=1,Object.defineProperty(ro,"__esModule",{value:!0}),ro.dontSetMe=o,ro.findInArray=e,ro.int=r,ro.isFunction=t,ro.isNum=n;function e(i,l){for(let c=0,d=i.length;c<d;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 o(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 ro}var so={},F1;function Y4(){if(F1)return so;F1=1,Object.defineProperty(so,"__esModule",{value:!0}),so.browserPrefixToKey=n,so.browserPrefixToStyle=r,so.default=void 0,so.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var c,d;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const l=(d=(c=window.document)==null?void 0:c.documentElement)==null?void 0:d.style;if(!l||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}${o(i)}`:i}function r(i,l){return l?`-${l.toLowerCase()}-${i}`:i}function o(i){let l="",c=!0;for(let d=0;d<i.length;d++)c?(l+=i[d].toUpperCase(),c=!1):i[d]==="-"?c=!0:l+=i[d];return l}return so.default=t(),so}var B1;function zm(){if(B1)return un;B1=1,Object.defineProperty(un,"__esModule",{value:!0}),un.addClassName=L,un.addEvent=l,un.addUserSelectStyles=C,un.createCSSTransform=v,un.createSVGTransform=D,un.getTouch=E,un.getTouchIdentifier=T,un.getTranslation=k,un.innerHeight=p,un.innerWidth=y,un.matchesSelector=o,un.matchesSelectorAndParentsTo=i,un.offsetXYFromParent=b,un.outerHeight=d,un.outerWidth=h,un.removeClassName=_,un.removeEvent=c,un.scheduleRemoveUserSelectStyles=O;var e=Rd(),t=n(Y4());function n(S,I){if(typeof WeakMap=="function")var P=new WeakMap,U=new WeakMap;return(n=function(F,H){if(!H&&F&&F.__esModule)return F;var W,$,Q={__proto__:null,default:F};if(F===null||typeof F!="object"&&typeof F!="function")return Q;if(W=H?U:P){if(W.has(F))return W.get(F);W.set(F,Q)}for(const ne in F)ne!=="default"&&{}.hasOwnProperty.call(F,ne)&&(($=(W=Object.defineProperty)&&Object.getOwnPropertyDescriptor(F,ne))&&($.get||$.set)?W(Q,ne,$):Q[ne]=F[ne]);return Q})(S,I)}let r="";function o(S,I){return r||(r=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(P){return(0,e.isFunction)(S[P])})),(0,e.isFunction)(S[r])?S[r](I):!1}function i(S,I,P){let U=S;do{if(o(U,I))return!0;if(U===P)return!1;U=U.parentNode}while(U);return!1}function l(S,I,P,U){if(!S)return;const F={capture:!0,...U};S.addEventListener?S.addEventListener(I,P,F):S.attachEvent?S.attachEvent("on"+I,P):S["on"+I]=P}function c(S,I,P,U){if(!S)return;const F={capture:!0,...U};S.removeEventListener?S.removeEventListener(I,P,F):S.detachEvent?S.detachEvent("on"+I,P):S["on"+I]=null}function d(S){let I=S.clientHeight;const P=S.ownerDocument.defaultView.getComputedStyle(S);return I+=(0,e.int)(P.borderTopWidth),I+=(0,e.int)(P.borderBottomWidth),I}function h(S){let I=S.clientWidth;const P=S.ownerDocument.defaultView.getComputedStyle(S);return I+=(0,e.int)(P.borderLeftWidth),I+=(0,e.int)(P.borderRightWidth),I}function p(S){let I=S.clientHeight;const P=S.ownerDocument.defaultView.getComputedStyle(S);return I-=(0,e.int)(P.paddingTop),I-=(0,e.int)(P.paddingBottom),I}function y(S){let I=S.clientWidth;const P=S.ownerDocument.defaultView.getComputedStyle(S);return I-=(0,e.int)(P.paddingLeft),I-=(0,e.int)(P.paddingRight),I}function b(S,I,P){const F=I===I.ownerDocument.body?{left:0,top:0}:I.getBoundingClientRect(),H=(S.clientX+I.scrollLeft-F.left)/P,W=(S.clientY+I.scrollTop-F.top)/P;return{x:H,y:W}}function v(S,I){const P=k(S,I,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:P}}function D(S,I){return k(S,I,"")}function k(S,I,P){let{x:U,y:F}=S,H=`translate(${U}${P},${F}${P})`;if(I){const W=`${typeof I.x=="string"?I.x:I.x+P}`,$=`${typeof I.y=="string"?I.y:I.y+P}`;H=`translate(${W}, ${$})`+H}return H}function E(S,I){return S.targetTouches&&(0,e.findInArray)(S.targetTouches,P=>I===P.identifier)||S.changedTouches&&(0,e.findInArray)(S.changedTouches,P=>I===P.identifier)}function T(S){if(S.targetTouches&&S.targetTouches[0])return S.targetTouches[0].identifier;if(S.changedTouches&&S.changedTouches[0])return S.changedTouches[0].identifier}function C(S){if(!S)return;let I=S.getElementById("react-draggable-style-el");I||(I=S.createElement("style"),I.type="text/css",I.id="react-draggable-style-el",I.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
107
+ `,I.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
108
+ `,S.getElementsByTagName("head")[0].appendChild(I)),S.body&&L(S.body,"react-draggable-transparent-selection")}function O(S){window.requestAnimationFrame?window.requestAnimationFrame(()=>{A(S)}):A(S)}function A(S){if(S)try{if(S.body&&_(S.body,"react-draggable-transparent-selection"),S.selection)S.selection.empty();else{const I=(S.defaultView||window).getSelection();I&&I.type!=="Caret"&&I.removeAllRanges()}}catch{}}function L(S,I){S.classList?S.classList.add(I):S.className.match(new RegExp(`(?:^|\\s)${I}(?!\\S)`))||(S.className+=` ${I}`)}function _(S,I){S.classList?S.classList.remove(I):S.className=S.className.replace(new RegExp(`(?:^|\\s)${I}(?!\\S)`,"g"),"")}return un}var Xr={},H1;function gv(){if(H1)return Xr;H1=1,Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.canDragX=o,Xr.canDragY=i,Xr.createCoreData=c,Xr.createDraggableData=d,Xr.getBoundPosition=n,Xr.getControlPosition=l,Xr.snapToGrid=r;var e=Rd(),t=zm();function n(y,b,v){if(!y.props.bounds)return[b,v];let{bounds:D}=y.props;D=typeof D=="string"?D:h(D);const k=p(y);if(typeof D=="string"){const{ownerDocument:E}=k,T=E.defaultView;let C;if(D==="parent"?C=k.parentNode:C=k.getRootNode().querySelector(D),!(C instanceof T.HTMLElement))throw new Error('Bounds selector "'+D+'" could not find an element.');const O=C,A=T.getComputedStyle(k),L=T.getComputedStyle(O);D={left:-k.offsetLeft+(0,e.int)(L.paddingLeft)+(0,e.int)(A.marginLeft),top:-k.offsetTop+(0,e.int)(L.paddingTop)+(0,e.int)(A.marginTop),right:(0,t.innerWidth)(O)-(0,t.outerWidth)(k)-k.offsetLeft+(0,e.int)(L.paddingRight)-(0,e.int)(A.marginRight),bottom:(0,t.innerHeight)(O)-(0,t.outerHeight)(k)-k.offsetTop+(0,e.int)(L.paddingBottom)-(0,e.int)(A.marginBottom)}}return(0,e.isNum)(D.right)&&(b=Math.min(b,D.right)),(0,e.isNum)(D.bottom)&&(v=Math.min(v,D.bottom)),(0,e.isNum)(D.left)&&(b=Math.max(b,D.left)),(0,e.isNum)(D.top)&&(v=Math.max(v,D.top)),[b,v]}function r(y,b,v){const D=Math.round(b/y[0])*y[0],k=Math.round(v/y[1])*y[1];return[D,k]}function o(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,b,v){const D=typeof b=="number"?(0,t.getTouch)(y,b):null;if(typeof b=="number"&&!D)return null;const k=p(v),E=v.props.offsetParent||k.offsetParent||k.ownerDocument.body;return(0,t.offsetXYFromParent)(D||y,E,v.props.scale)}function c(y,b,v){const D=!(0,e.isNum)(y.lastX),k=p(y);return D?{node:k,deltaX:0,deltaY:0,lastX:b,lastY:v,x:b,y:v}:{node:k,deltaX:b-y.lastX,deltaY:v-y.lastY,lastX:y.lastX,lastY:y.lastY,x:b,y:v}}function d(y,b){const v=y.props.scale;return{node:b.node,x:y.state.x+b.deltaX/v,y:y.state.y+b.deltaY/v,deltaX:b.deltaX/v,deltaY:b.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 b=y.findDOMNode();if(!b)throw new Error("<DraggableCore>: Unmounted during event!");return b}return Xr}var bl={},Mc={},U1;function bv(){if(U1)return Mc;U1=1,Object.defineProperty(Mc,"__esModule",{value:!0}),Mc.default=e;function e(){}return Mc}var z1;function $4(){if(z1)return bl;z1=1,Object.defineProperty(bl,"__esModule",{value:!0}),bl.default=void 0;var e=d(fa()),t=c(Ld()),n=c(dd()),r=zm(),o=gv(),i=Rd(),l=c(bv());function c(k){return k&&k.__esModule?k:{default:k}}function d(k,E){if(typeof WeakMap=="function")var T=new WeakMap,C=new WeakMap;return(d=function(O,A){if(!A&&O&&O.__esModule)return O;var L,_,S={__proto__:null,default:O};if(O===null||typeof O!="object"&&typeof O!="function")return S;if(L=A?C:T){if(L.has(O))return L.get(O);L.set(O,S)}for(const I in O)I!=="default"&&{}.hasOwnProperty.call(O,I)&&((_=(L=Object.defineProperty)&&Object.getOwnPropertyDescriptor(O,I))&&(_.get||_.set)?L(S,I,_):S[I]=O[I]);return S})(k,E)}function h(k,E,T){return(E=p(E))in k?Object.defineProperty(k,E,{value:T,enumerable:!0,configurable:!0,writable:!0}):k[E]=T,k}function p(k){var E=y(k,"string");return typeof E=="symbol"?E:E+""}function y(k,E){if(typeof k!="object"||!k)return k;var T=k[Symbol.toPrimitive];if(T!==void 0){var C=T.call(k,E);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(E==="string"?String:Number)(k)}const b={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let v=b.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",E=>{if(this.props.onMouseDown(E),!this.props.allowAnyClick&&typeof E.button=="number"&&E.button!==0)return!1;const T=this.findDOMNode();if(!T||!T.ownerDocument||!T.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:C}=T;if(this.props.disabled||!(E.target instanceof C.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(E.target,this.props.handle,T)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(E.target,this.props.cancel,T))return;E.type==="touchstart"&&!this.props.allowMobileScroll&&E.preventDefault();const O=(0,r.getTouchIdentifier)(E);this.touchIdentifier=O;const A=(0,o.getControlPosition)(E,O,this);if(A==null)return;const{x:L,y:_}=A,S=(0,o.createCoreData)(this,L,_);(0,l.default)("DraggableCore: handleDragStart: %j",S),(0,l.default)("calling",this.props.onStart),!(this.props.onStart(E,S)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(C),this.dragging=!0,this.lastX=L,this.lastY=_,(0,r.addEvent)(C,v.move,this.handleDrag),(0,r.addEvent)(C,v.stop,this.handleDragStop))}),h(this,"handleDrag",E=>{const T=(0,o.getControlPosition)(E,this.touchIdentifier,this);if(T==null)return;let{x:C,y:O}=T;if(Array.isArray(this.props.grid)){let _=C-this.lastX,S=O-this.lastY;if([_,S]=(0,o.snapToGrid)(this.props.grid,_,S),!_&&!S)return;C=this.lastX+_,O=this.lastY+S}const A=(0,o.createCoreData)(this,C,O);if((0,l.default)("DraggableCore: handleDrag: %j",A),this.props.onDrag(E,A)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const S=document.createEvent("MouseEvents");S.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(S)}return}this.lastX=C,this.lastY=O}),h(this,"handleDragStop",E=>{if(!this.dragging)return;const T=(0,o.getControlPosition)(E,this.touchIdentifier,this);if(T==null)return;let{x:C,y:O}=T;if(Array.isArray(this.props.grid)){let S=C-this.lastX||0,I=O-this.lastY||0;[S,I]=(0,o.snapToGrid)(this.props.grid,S,I),C=this.lastX+S,O=this.lastY+I}const A=(0,o.createCoreData)(this,C,O);if(this.props.onStop(E,A)===!1||this.mounted===!1)return!1;const _=this.findDOMNode();_&&this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(_.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",A),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,_&&((0,l.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(_.ownerDocument,v.move,this.handleDrag),(0,r.removeEvent)(_.ownerDocument,v.stop,this.handleDragStop))}),h(this,"onMouseDown",E=>(v=b.mouse,this.handleDragStart(E))),h(this,"onMouseUp",E=>(v=b.mouse,this.handleDragStop(E))),h(this,"onTouchStart",E=>(v=b.touch,this.handleDragStart(E))),h(this,"onTouchEnd",E=>(v=b.touch,this.handleDragStop(E)))}componentDidMount(){this.mounted=!0;const E=this.findDOMNode();E&&(0,r.addEvent)(E,b.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const E=this.findDOMNode();if(E){const{ownerDocument:T}=E;(0,r.removeEvent)(T,b.mouse.move,this.handleDrag),(0,r.removeEvent)(T,b.touch.move,this.handleDrag),(0,r.removeEvent)(T,b.mouse.stop,this.handleDragStop),(0,r.removeEvent)(T,b.touch.stop,this.handleDragStop),(0,r.removeEvent)(E,b.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(T)}}findDOMNode(){var E,T,C;return(E=this.props)!=null&&E.nodeRef?(C=(T=this.props)==null?void 0:T.nodeRef)==null?void 0:C.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return bl.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,E){if(k[E]&&k[E].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}),bl}var W1;function q4(){return W1||(W1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return d.default}}),e.default=void 0;var t=y(fa()),n=p(Ld()),r=p(dd()),o=W4(),i=zm(),l=gv(),c=Rd(),d=p($4()),h=p(bv());function p(T){return T&&T.__esModule?T:{default:T}}function y(T,C){if(typeof WeakMap=="function")var O=new WeakMap,A=new WeakMap;return(y=function(L,_){if(!_&&L&&L.__esModule)return L;var S,I,P={__proto__:null,default:L};if(L===null||typeof L!="object"&&typeof L!="function")return P;if(S=_?A:O){if(S.has(L))return S.get(L);S.set(L,P)}for(const U in L)U!=="default"&&{}.hasOwnProperty.call(L,U)&&((I=(S=Object.defineProperty)&&Object.getOwnPropertyDescriptor(L,U))&&(I.get||I.set)?S(P,U,I):P[U]=L[U]);return P})(T,C)}function b(){return b=Object.assign?Object.assign.bind():function(T){for(var C=1;C<arguments.length;C++){var O=arguments[C];for(var A in O)({}).hasOwnProperty.call(O,A)&&(T[A]=O[A])}return T},b.apply(null,arguments)}function v(T,C,O){return(C=D(C))in T?Object.defineProperty(T,C,{value:O,enumerable:!0,configurable:!0,writable:!0}):T[C]=O,T}function D(T){var C=k(T,"string");return typeof C=="symbol"?C:C+""}function k(T,C){if(typeof T!="object"||!T)return T;var O=T[Symbol.toPrimitive];if(O!==void 0){var A=O.call(T,C);if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(T)}class E extends t.Component{static getDerivedStateFromProps(C,O){let{position:A}=C,{prevPropsPosition:L}=O;return A&&(!L||A.x!==L.x||A.y!==L.y)?((0,h.default)("Draggable: getDerivedStateFromProps %j",{position:A,prevPropsPosition:L}),{x:A.x,y:A.y,prevPropsPosition:{...A}}):null}constructor(C){super(C),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 L=(0,l.createDraggableData)(this,A),_={x:L.x,y:L.y,slackX:0,slackY:0};if(this.props.bounds){const{x:I,y:P}=_;_.x+=this.state.slackX,_.y+=this.state.slackY;const[U,F]=(0,l.getBoundPosition)(this,_.x,_.y);_.x=U,_.y=F,_.slackX=this.state.slackX+(I-_.x),_.slackY=this.state.slackY+(P-_.y),L.x=_.x,L.y=_.y,L.deltaX=_.x-this.state.x,L.deltaY=_.y-this.state.y}if(this.props.onDrag(O,L)===!1)return!1;this.setState(_)}),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 _={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:I,y:P}=this.props.position;_.x=I,_.y=P}this.setState(_)}),this.state={dragging:!1,dragged:!1,x:C.position?C.position.x:C.defaultPosition.x,y:C.position?C.position.y:C.defaultPosition.y,prevPropsPosition:{...C.position},slackX:0,slackY:0,isElementSVG:!1},C.position&&!(C.onDrag||C.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var C,O;return((O=(C=this.props)==null?void 0:C.nodeRef)==null?void 0:O.current)??r.default.findDOMNode(this)}render(){const{axis:C,bounds:O,children:A,defaultPosition:L,defaultClassName:_,defaultClassNameDragging:S,defaultClassNameDragged:I,position:P,positionOffset:U,scale:F,...H}=this.props;let W={},$=null;const ne=!!!P||this.state.dragging,me=P||L,ee={x:(0,l.canDragX)(this)&&ne?this.state.x:me.x,y:(0,l.canDragY)(this)&&ne?this.state.y:me.y};this.state.isElementSVG?$=(0,i.createSVGTransform)(ee,U):W=(0,i.createCSSTransform)(ee,U);const ce=(0,o.clsx)(A.props.className||"",_,{[S]:this.state.dragging,[I]:this.state.dragged});return t.createElement(d.default,b({},H,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(A),{className:ce,style:{...A.props.style,...W},transform:$}))}}e.default=E,v(E,"displayName","Draggable"),v(E,"propTypes",{...d.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),v(E,"defaultProps",{...d.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(qh)),qh}var Y1;function Wm(){if(Y1)return gl.exports;Y1=1;const{default:e,DraggableCore:t}=q4();return gl.exports=e,gl.exports.default=e,gl.exports.DraggableCore=t,gl.exports}var V4=Wm(),xl={exports:{}},vl={},Lc={},$1;function Q4(){if($1)return Lc;$1=1,Lc.__esModule=!0,Lc.cloneElement=c;var e=t(fa());function t(d){return d&&d.__esModule?d:{default:d}}function n(d,h){var p=Object.keys(d);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(d);h&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(d,b).enumerable})),p.push.apply(p,y)}return p}function r(d){for(var h=1;h<arguments.length;h++){var p=arguments[h]!=null?arguments[h]:{};h%2?n(Object(p),!0).forEach(function(y){o(d,y,p[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(p)):n(Object(p)).forEach(function(y){Object.defineProperty(d,y,Object.getOwnPropertyDescriptor(p,y))})}return d}function o(d,h,p){return(h=i(h))in d?Object.defineProperty(d,h,{value:p,enumerable:!0,configurable:!0,writable:!0}):d[h]=p,d}function i(d){var h=l(d,"string");return typeof h=="symbol"?h:h+""}function l(d,h){if(typeof d!="object"||!d)return d;var p=d[Symbol.toPrimitive];if(p!==void 0){var y=p.call(d,h);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(d)}function c(d,h){return h.style&&d.props.style&&(h.style=r(r({},d.props.style),h.style)),h.className&&d.props.className&&(h.className=`${d.props.className} ${h.className}`),e.default.cloneElement(d,h)}return Lc}var El={},q1;function xv(){if(q1)return El;q1=1,El.__esModule=!0,El.resizableProps=void 0;var e=t(Ld());Wm();function t(n){return n&&n.__esModule?n:{default:n}}return El.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),o=0;o<n;o++)r[o]=arguments[o];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),o=0;o<n;o++)r[o]=arguments[o];const[i]=r;return i.axis==="both"||i.axis==="x"?e.default.number.isRequired(...r):e.default.number(...r)}},El}var V1;function vv(){if(V1)return vl;V1=1,vl.__esModule=!0,vl.default=void 0;var e=i(fa()),t=Wm(),n=Q4(),r=xv();const o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function i(k,E){if(typeof WeakMap=="function")var T=new WeakMap,C=new WeakMap;return(i=function(O,A){if(!A&&O&&O.__esModule)return O;var L,_,S={__proto__:null,default:O};if(O===null||typeof O!="object"&&typeof O!="function")return S;if(L=A?C:T){if(L.has(O))return L.get(O);L.set(O,S)}for(const I in O)I!=="default"&&{}.hasOwnProperty.call(O,I)&&((_=(L=Object.defineProperty)&&Object.getOwnPropertyDescriptor(O,I))&&(_.get||_.set)?L(S,I,_):S[I]=O[I]);return S})(k,E)}function l(){return l=Object.assign?Object.assign.bind():function(k){for(var E=1;E<arguments.length;E++){var T=arguments[E];for(var C in T)({}).hasOwnProperty.call(T,C)&&(k[C]=T[C])}return k},l.apply(null,arguments)}function c(k,E){if(k==null)return{};var T,C,O=d(k,E);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(k);for(C=0;C<A.length;C++)T=A[C],E.indexOf(T)===-1&&{}.propertyIsEnumerable.call(k,T)&&(O[T]=k[T])}return O}function d(k,E){if(k==null)return{};var T={};for(var C in k)if({}.hasOwnProperty.call(k,C)){if(E.indexOf(C)!==-1)continue;T[C]=k[C]}return T}function h(k,E){var T=Object.keys(k);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(k);E&&(C=C.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),T.push.apply(T,C)}return T}function p(k){for(var E=1;E<arguments.length;E++){var T=arguments[E]!=null?arguments[E]:{};E%2?h(Object(T),!0).forEach(function(C){y(k,C,T[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(T)):h(Object(T)).forEach(function(C){Object.defineProperty(k,C,Object.getOwnPropertyDescriptor(T,C))})}return k}function y(k,E,T){return(E=b(E))in k?Object.defineProperty(k,E,{value:T,enumerable:!0,configurable:!0,writable:!0}):k[E]=T,k}function b(k){var E=v(k,"string");return typeof E=="symbol"?E:E+""}function v(k,E){if(typeof k!="object"||!k)return k;var T=k[Symbol.toPrimitive];if(T!==void 0){var C=T.call(k,E);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(E==="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(E,T){const{minConstraints:C,maxConstraints:O,lockAspectRatio:A}=this.props;if(!C&&!O&&!A)return[E,T];if(A){const P=this.props.width/this.props.height,U=E-this.props.width,F=T-this.props.height;Math.abs(U)>Math.abs(F*P)?T=E/P:E=T*P}const[L,_]=[E,T];let[S,I]=this.slack||[0,0];return E+=S,T+=I,C&&(E=Math.max(C[0],E),T=Math.max(C[1],T)),O&&(E=Math.min(O[0],E),T=Math.min(O[1],T)),this.slack=[S+(L-E),I+(_-T)],[E,T]}resizeHandler(E,T){return(C,O)=>{var me;let{node:A,deltaX:L,deltaY:_}=O;E==="onResizeStart"&&this.resetData();const S=(this.props.axis==="both"||this.props.axis==="x")&&T!=="n"&&T!=="s",I=(this.props.axis==="both"||this.props.axis==="y")&&T!=="e"&&T!=="w";if(!S&&!I)return;const P=T[0],U=T[T.length-1],F=A.getBoundingClientRect();if(this.lastHandleRect!=null){if(U==="w"){const ee=F.left-this.lastHandleRect.left;L+=ee}if(P==="n"){const ee=F.top-this.lastHandleRect.top;_+=ee}}this.lastHandleRect=F,U==="w"&&(L=-L),P==="n"&&(_=-_);let H=this.props.width+(S?L/this.props.transformScale:0),W=this.props.height+(I?_/this.props.transformScale:0);[H,W]=this.runConstraints(H,W),E==="onResizeStop"&&this.lastSize&&({width:H,height:W}=this.lastSize);const $=H!==this.props.width||W!==this.props.height;E!=="onResizeStop"&&(this.lastSize={width:H,height:W});const Q=typeof this.props[E]=="function"?this.props[E]:null;Q&&!(E==="onResize"&&!$)&&((me=C.persist)==null||me.call(C),Q(C,{node:A,size:{width:H,height:W},handle:T})),E==="onResizeStop"&&this.resetData()}}renderResizeHandle(E,T){const{handle:C}=this.props;if(!C)return e.createElement("span",{className:`react-resizable-handle react-resizable-handle-${E}`,ref:T});if(typeof C=="function")return C(E,T);const O=typeof C.type=="string",A=p({ref:T},O?{}:{handleAxis:E});return e.cloneElement(C,A)}render(){const E=this.props,{children:T,className:C,draggableOpts:O,width:A,height:L,handle:_,handleSize:S,lockAspectRatio:I,axis:P,minConstraints:U,maxConstraints:F,onResize:H,onResizeStop:W,onResizeStart:$,resizeHandles:Q,transformScale:ne}=E,me=c(E,o);return(0,n.cloneElement)(T,p(p({},me),{},{className:`${C?`${C} `:""}react-resizable`,children:[...e.Children.toArray(T.props.children),...Q.map(ee=>{const ce=this.handleRefs[ee]??(this.handleRefs[ee]=e.createRef());return e.createElement(t.DraggableCore,l({},O,{nodeRef:ce,key:`resizableHandle-${ee}`,onStop:this.resizeHandler("onResizeStop",ee),onStart:this.resizeHandler("onResizeStart",ee),onDrag:this.resizeHandler("onResize",ee)}),this.renderResizeHandle(ee,ce))})]}))}};return vl.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},vl}var Tl={},Q1;function G4(){if(Q1)return Tl;Q1=1,Tl.__esModule=!0,Tl.default=void 0;var e=l(fa()),t=i(Ld()),n=i(vv()),r=xv();const o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function i(E){return E&&E.__esModule?E:{default:E}}function l(E,T){if(typeof WeakMap=="function")var C=new WeakMap,O=new WeakMap;return(l=function(A,L){if(!L&&A&&A.__esModule)return A;var _,S,I={__proto__:null,default:A};if(A===null||typeof A!="object"&&typeof A!="function")return I;if(_=L?O:C){if(_.has(A))return _.get(A);_.set(A,I)}for(const P in A)P!=="default"&&{}.hasOwnProperty.call(A,P)&&((S=(_=Object.defineProperty)&&Object.getOwnPropertyDescriptor(A,P))&&(S.get||S.set)?_(I,P,S):I[P]=A[P]);return I})(E,T)}function c(){return c=Object.assign?Object.assign.bind():function(E){for(var T=1;T<arguments.length;T++){var C=arguments[T];for(var O in C)({}).hasOwnProperty.call(C,O)&&(E[O]=C[O])}return E},c.apply(null,arguments)}function d(E,T){var C=Object.keys(E);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(E);T&&(O=O.filter(function(A){return Object.getOwnPropertyDescriptor(E,A).enumerable})),C.push.apply(C,O)}return C}function h(E){for(var T=1;T<arguments.length;T++){var C=arguments[T]!=null?arguments[T]:{};T%2?d(Object(C),!0).forEach(function(O){p(E,O,C[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(C)):d(Object(C)).forEach(function(O){Object.defineProperty(E,O,Object.getOwnPropertyDescriptor(C,O))})}return E}function p(E,T,C){return(T=y(T))in E?Object.defineProperty(E,T,{value:C,enumerable:!0,configurable:!0,writable:!0}):E[T]=C,E}function y(E){var T=b(E,"string");return typeof T=="symbol"?T:T+""}function b(E,T){if(typeof E!="object"||!E)return E;var C=E[Symbol.toPrimitive];if(C!==void 0){var O=C.call(E,T);if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(E)}function v(E,T){if(E==null)return{};var C,O,A=D(E,T);if(Object.getOwnPropertySymbols){var L=Object.getOwnPropertySymbols(E);for(O=0;O<L.length;O++)C=L[O],T.indexOf(C)===-1&&{}.propertyIsEnumerable.call(E,C)&&(A[C]=E[C])}return A}function D(E,T){if(E==null)return{};var C={};for(var O in E)if({}.hasOwnProperty.call(E,O)){if(T.indexOf(O)!==-1)continue;C[O]=E[O]}return C}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=(T,C)=>{var A;const{size:O}=C;this.props.onResize?((A=T.persist)==null||A.call(T),this.setState(O,()=>this.props.onResize&&this.props.onResize(T,C))):this.setState(O)}}static getDerivedStateFromProps(T,C){return C.propsWidth!==T.width||C.propsHeight!==T.height?{width:T.width,height:T.height,propsWidth:T.width,propsHeight:T.height}:null}render(){const T=this.props,{handle:C,handleSize:O,onResize:A,onResizeStart:L,onResizeStop:_,draggableOpts:S,minConstraints:I,maxConstraints:P,lockAspectRatio:U,axis:F,width:H,height:W,resizeHandles:$,style:Q,transformScale:ne}=T,me=v(T,o);return e.createElement(n.default,{axis:F,draggableOpts:S,handle:C,handleSize:O,height:this.state.height,lockAspectRatio:U,maxConstraints:P,minConstraints:I,onResizeStart:L,onResize:this.onResize,onResizeStop:_,resizeHandles:$,transformScale:ne,width:this.state.width},e.createElement("div",c({},me,{style:h(h({},Q),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return Tl.default=k,k.propTypes=h(h({},r.resizableProps),{},{children:t.default.element}),Tl}var G1;function K4(){return G1||(G1=1,xl.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},xl.exports.Resizable=vv().default,xl.exports.ResizableBox=G4().default),xl.exports}var X4=K4();function Ev(e){return function(n,r,o,i,l,c,d){return e(n,r,d)}}function Pd(e){return function(n,r,o,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,o,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 d=e(n,r,o,i);return i.delete(n),i.delete(r),d}}function Tv(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 K1(e){return e.constructor===Object||e.constructor==null}function X1(e){return typeof e.then=="function"}function jd(e,t){return e===t||e!==e&&t!==t}var J4="[object Arguments]",Z4="[object Boolean]",eD="[object Date]",tD="[object RegExp]",nD="[object Map]",rD="[object Number]",sD="[object Object]",oD="[object Set]",aD="[object String]",J1=Object.prototype.toString;function Fd(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,o=e.areObjectsEqual,i=e.areRegExpsEqual,l=e.areSetsEqual,c=e.createIsNestedEqual,d=c(h);function h(p,y,b){if(p===y)return!0;if(!p||!y||typeof p!="object"||typeof y!="object")return p!==p&&y!==y;if(K1(p)&&K1(y))return o(p,y,d,b);var v=Array.isArray(p),D=Array.isArray(y);if(v||D)return v===D&&t(p,y,d,b);var k=J1.call(p);return k!==J1.call(y)?!1:k===eD?n(p,y,d,b):k===tD?i(p,y,d,b):k===nD?r(p,y,d,b):k===oD?l(p,y,d,b):k===sD||k===J4?X1(p)||X1(y)?!1:o(p,y,d,b):k===Z4||k===rD||k===aD?jd(p.valueOf(),y.valueOf()):!1}return h}function wv(e,t,n,r){var o=e.length;if(t.length!==o)return!1;for(;o-- >0;)if(!n(e[o],t[o],o,o,e,t,r))return!1;return!0}var iD=Pd(wv);function kv(e,t){return jd(e.valueOf(),t.valueOf())}function Sv(e,t,n,r){var o=e.size===t.size;if(!o)return!1;if(!e.size)return!0;var i={},l=0;return e.forEach(function(c,d){if(o){var h=!1,p=0;t.forEach(function(y,b){!h&&!i[p]&&(h=n(d,b,l,p,e,t,r)&&n(c,y,d,b,e,t,r))&&(i[p]=!0),p++}),l++,o=h}}),o}var lD=Pd(Sv),uD="_owner",cD=Object.prototype.hasOwnProperty;function Cv(e,t,n,r){var o=Object.keys(e),i=o.length;if(Object.keys(t).length!==i)return!1;for(var l;i-- >0;){if(l=o[i],l===uD){var c=!!e.$$typeof,d=!!t.$$typeof;if((c||d)&&c!==d)return!1}if(!cD.call(t,l)||!n(e[l],t[l],l,l,e,t,r))return!1}return!0}var dD=Pd(Cv);function _v(e,t){return e.source===t.source&&e.flags===t.flags}function Nv(e,t,n,r){var o=e.size===t.size;if(!o)return!1;if(!e.size)return!0;var i={};return e.forEach(function(l,c){if(o){var d=!1,h=0;t.forEach(function(p,y){!d&&!i[h]&&(d=n(l,p,c,y,e,t,r))&&(i[h]=!0),h++}),o=d}}),o}var fD=Pd(Nv),Dv=Object.freeze({areArraysEqual:wv,areDatesEqual:kv,areMapsEqual:Sv,areObjectsEqual:Cv,areRegExpsEqual:_v,areSetsEqual:Nv,createIsNestedEqual:Ev}),Ov=Object.freeze({areArraysEqual:iD,areDatesEqual:kv,areMapsEqual:lD,areObjectsEqual:dD,areRegExpsEqual:_v,areSetsEqual:fD,createIsNestedEqual:Ev}),hD=Fd(Dv);function ks(e,t){return hD(e,t,void 0)}Fd(Tv(Dv,{createIsNestedEqual:function(){return jd}}));Fd(Ov);Fd(Tv(Ov,{createIsNestedEqual:function(){return jd}}));function Z1(e){const{children:t,cols:n,containerWidth:r,margin:o,containerPadding:i,rowHeight:l,maxRows:c,isDraggable:d,isResizable:h,isBounded:p,static:y,useCSSTransforms:b=!0,usePercentages:v=!1,transformScale:D=1,positionStrategy:k,dragThreshold:E=0,droppingPosition:T,className:C="",style:O,handle:A="",cancel:L="",x:_,y:S,w:I,h:P,minW:U=1,maxW:F=1/0,minH:H=1,maxH:W=1/0,i:$,resizeHandles:Q,resizeHandle:ne,constraints:me=od,layoutItem:ee,layout:ce=[],onDragStart:M,onDrag:G,onDragStop:ae,onResizeStart:j,onResize:le,onResizeStop:he}=e,[pe,Oe]=N.useState(!1),[oe,fe]=N.useState(!1),_e=N.useRef(null),Ee=N.useRef({left:0,top:0}),Fe=N.useRef({top:0,left:0,width:0,height:0}),$e=N.useRef(void 0),st=N.useRef(ce);st.current=ce;const Je=N.useRef(null),tt=N.useRef(null),Te=N.useRef(!1),Re=N.useRef({x:0,y:0}),se=N.useRef(!1),te=N.useMemo(()=>({cols:n,containerPadding:i,containerWidth:r,margin:o,maxRows:c,rowHeight:l}),[n,i,r,o,c,l]),ge=N.useMemo(()=>({cols:n,maxRows:c,containerWidth:r,containerHeight:0,rowHeight:l,margin:o,layout:[]}),[n,c,r,l,o]),Ne=N.useCallback(()=>({...ge,layout:st.current}),[ge]),qe=N.useMemo(()=>ee??{i:$,x:_,y:S,w:I,h:P,minW:U,maxW:F,minH:H,maxH:W},[ee,$,_,S,I,P,U,F,H,W]),pt=N.useCallback(Ae=>{if(k!=null&&k.calcStyle)return k.calcStyle(Ae);if(b)return Rm(Ae);const He=uv(Ae);return v?{...He,left:O1(Ae.left/r),width:O1(Ae.width/r)}:He},[k,b,v,r]),yt=N.useCallback((Ae,{node:He})=>{if(!M)return;const{offsetParent:ft}=He;if(!ft)return;const Ue=ft.getBoundingClientRect(),Yt=He.getBoundingClientRect(),en=Yt.left/D,tn=Ue.left/D,$t=Yt.top/D,nn=Ue.top/D;let On;if(k!=null&&k.calcDragPosition){const lt=Ae;On=k.calcDragPosition(lt.clientX,lt.clientY,lt.clientX-Yt.left,lt.clientY-Yt.top)}else On={left:en-tn+ft.scrollLeft,top:$t-nn+ft.scrollTop};if(Ee.current=On,E>0){const lt=Ae;Re.current={x:lt.clientX,y:lt.clientY},Te.current=!0,se.current=!1,Oe(!0);return}Oe(!0);const $n=Dc(te,On.top,On.left),{x:$r,y:ze}=Oc(me,qe,$n.x,$n.y,Ne());M($,$r,ze,{e:Ae,node:He,newPosition:On})},[M,D,te,k,E,me,qe,Ne,$]),ie=N.useCallback((Ae,{node:He,deltaX:ft,deltaY:Ue})=>{if(!G||!pe)return;const Yt=Ae;if(Te.current&&!se.current){const $r=Yt.clientX-Re.current.x,ze=Yt.clientY-Re.current.y;if(Math.hypot($r,ze)<E)return;if(se.current=!0,Te.current=!1,M){const Ke=Dc(te,Ee.current.top,Ee.current.left),{x:mt,y:_t}=Oc(me,qe,Ke.x,Ke.y,Ne());M($,mt,_t,{e:Ae,node:He,newPosition:Ee.current})}}let en=Ee.current.top+Ue,tn=Ee.current.left+ft;if(p){const{offsetParent:$r}=He;if($r){const ze=$r.clientHeight-gi(P,l,o[1]);en=sd(en,0,ze);const lt=Ci(te),Ke=r-gi(I,lt,o[0]);tn=sd(tn,0,Ke)}}const $t={top:en,left:tn};Ee.current=$t;const nn=Dc(te,en,tn),{x:On,y:$n}=Oc(me,qe,nn.x,nn.y,Ne());G($,On,$n,{e:Ae,node:He,newPosition:$t})},[G,M,pe,E,p,P,l,o,te,r,I,$,me,qe,Ne]),ye=N.useCallback((Ae,{node:He})=>{if(!ae||!pe)return;const ft=Te.current;if(Te.current=!1,se.current=!1,Re.current={x:0,y:0},ft){Oe(!1),Ee.current={left:0,top:0};return}const{left:Ue,top:Yt}=Ee.current,en={top:Yt,left:Ue};Oe(!1),Ee.current={left:0,top:0};const tn=Dc(te,Yt,Ue),{x:$t,y:nn}=Oc(me,qe,tn.x,tn.y,Ne());ae($,$t,nn,{e:Ae,node:He,newPosition:en})},[ae,pe,te,me,qe,Ne,$]);Je.current=yt,tt.current=ie;const Me=N.useCallback((Ae,{node:He,size:ft,handle:Ue},Yt,en)=>{const tn=en==="onResizeStart"?j:en==="onResize"?le:he;if(!tn)return;let $t;He?$t=O4(Ue,Yt,ft,r):$t={...ft,top:Yt.top,left:Yt.left},Fe.current=$t;const nn=p4(te,$t.width,$t.height),{w:On,h:$n}=T4(me,qe,nn.w,nn.h,Ue,Ne());tn($,On,$n,{e:Ae.nativeEvent,node:He,size:$t,handle:Ue})},[j,le,he,r,te,$,me,qe,Ne]),nt=N.useCallback((Ae,He)=>{fe(!0);const ft=yl(te,_,S,I,P),Ue={...He,handle:He.handle};Me(Ae,Ue,ft,"onResizeStart")},[Me,te,_,S,I,P]),ot=N.useCallback((Ae,He)=>{const ft=yl(te,_,S,I,P),Ue={...He,handle:He.handle};Me(Ae,Ue,ft,"onResize")},[Me,te,_,S,I,P]),gt=N.useCallback((Ae,He)=>{fe(!1),Fe.current={top:0,left:0,width:0,height:0};const ft=yl(te,_,S,I,P),Ue={...He,handle:He.handle};Me(Ae,Ue,ft,"onResizeStop")},[Me,te,_,S,I,P]);N.useEffect(()=>{var Ue,Yt;if(!T)return;const Ae=_e.current;if(!Ae)return;const He=$e.current||{left:0,top:0},ft=pe&&(T.left!==He.left||T.top!==He.top);if(pe){if(ft){const en=T.left-Ee.current.left,tn=T.top-Ee.current.top,$t={node:Ae,deltaX:en,deltaY:tn,lastX:Ee.current.left,lastY:Ee.current.top,x:T.left,y:T.top};(Yt=tt.current)==null||Yt.call(tt,T.e,$t)}}else{const en={node:Ae,deltaX:T.left,deltaY:T.top,lastX:0,lastY:0,x:T.left,y:T.top};(Ue=Je.current)==null||Ue.call(Je,T.e,en)}$e.current=T},[T,pe,$]);const Zt=yl(te,_,S,I,P,pe?Ee.current:null,oe?Fe.current:null),hn=Ie.Children.only(t),Dn=yl(te,0,0,1,1),Yn=[Dn.width,Dn.height],Wt=[1/0,1/0],It=hn.props,yn=It.className,Dr=It.style;let Ge=Ie.cloneElement(hn,{ref:_e,className:nr("react-grid-item",yn,C,{static:y,resizing:oe,"react-draggable":d,"react-draggable-dragging":pe,dropping:!!T,cssTransforms:b}),style:{...O,...Dr,...pt(Zt)}});const ut=ne;return Ge=f.jsx(X4.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:Zt.width,height:Zt.height,minConstraints:Yn,maxConstraints:Wt,onResizeStart:nt,onResize:ot,onResizeStop:gt,transformScale:D,resizeHandles:Q,handle:ut,children:Ge}),Ge=f.jsx(V4.DraggableCore,{disabled:!d,onStart:yt,onDrag:ie,onStop:ye,handle:A,cancel:".react-resizable-handle"+(L?","+L:""),scale:D,nodeRef:_e,children:Ge}),Ge}var Es=()=>{},eb="react-grid-layout",Av=!1;try{Av=/firefox/i.test(navigator.userAgent)}catch{}function mD(e,t){const n=Ie.Children.toArray(e),r=Ie.Children.toArray(t);if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++){const i=n[o],l=r[o];if((i==null?void 0:i.key)!==(l==null?void 0:l.key))return!1}return!0}function tb(e,t,n,r){const o=[],i=new Set;Ie.Children.forEach(t,c=>{if(!Ie.isValidElement(c)||c.key===null)return;const d=String(c.key);i.add(d);const h=e.find(p=>p.i===d);if(h)o.push(da(h));else{const y=c.props["data-grid"];y?o.push({i:d,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}):o.push({i:d,x:0,y:Id(o),w:1,h:1})}});const l=Lm(o,{cols:n});return r.compact(l,n)}function Iv(e){const{children:t,width:n,gridConfig:r,dragConfig:o,resizeConfig:i,dropConfig:l,positionStrategy:c=A4,compactor:d,constraints:h=od,layout:p=[],droppingItem:y,autoSize:b=!0,className:v="",style:D={},innerRef:k,onLayoutChange:E=Es,onDragStart:T=Es,onDrag:C=Es,onDragStop:O=Es,onResizeStart:A=Es,onResize:L=Es,onResizeStop:_=Es,onDrop:S=Es,onDropDragOver:I=Es}=e,P=N.useMemo(()=>({...I4,...r}),[r]),U=N.useMemo(()=>({...M4,...o}),[o]),F=N.useMemo(()=>({...L4,...i}),[i]),H=N.useMemo(()=>({...R4,...l}),[l]),{cols:W,rowHeight:$,maxRows:Q,margin:ne,containerPadding:me}=P,{enabled:ee,bounded:ce,handle:M,cancel:G,threshold:ae}=U,{enabled:j,handles:le,handleComponent:he}=F,{enabled:pe,defaultItem:Oe,onDragOver:oe}=H,fe=d??uu("vertical"),_e=fe.type,Ee=fe.allowOverlap,Fe=fe.preventCollision??!1,$e=N.useMemo(()=>y??{i:"__dropping-elem__",...Oe},[y,Oe]),st=c.type==="transform",Je=c.scale,tt=me??ne,[Te,Re]=N.useState(!1),[se,te]=N.useState(()=>tb(p,t,W,fe)),[ge,Ne]=N.useState(null),[qe,pt]=N.useState(!1),[yt,ie]=N.useState(null),[ye,Me]=N.useState(),nt=N.useRef(null),ot=N.useRef(null),gt=N.useRef(null),Zt=N.useRef(0),hn=N.useRef(se),Dn=N.useRef(p),Yn=N.useRef(t),Wt=N.useRef(_e),It=N.useRef(se);It.current=se,N.useEffect(()=>{Re(!0),ks(se,p)||E(se)},[]),N.useEffect(()=>{if(ge||yt)return;const ze=!ks(p,Dn.current),lt=!mD(t,Yn.current),Ke=_e!==Wt.current;if(ze||lt||Ke){const _t=tb(ze?p:se,t,W,fe);ks(_t,se)||te(_t)}Dn.current=p,Yn.current=t,Wt.current=_e},[p,t,W,_e,fe,ge,yt,se]),N.useEffect(()=>{if(!ge&&!ks(se,hn.current)){hn.current=se;const ze=se.filter(lt=>lt.i!==$e.i);E(ze)}},[se,ge,E,$e.i]);const yn=N.useMemo(()=>{if(!b)return;const ze=Id(se),lt=tt[1];return ze*$+(ze-1)*ne[1]+lt*2+"px"},[b,se,$,ne,tt]),Dr=N.useCallback((ze,lt,Ke,mt)=>{const _t=It.current,wt=Wo(_t,ze);if(!wt)return;const Lt={w:wt.w,h:wt.h,x:wt.x,y:wt.y,i:ze};nt.current=da(wt),gt.current=_t,Ne(Lt),T(_t,wt,wt,null,mt.e,mt.node)},[T]),Ge=N.useCallback((ze,lt,Ke,mt)=>{const _t=It.current,wt=nt.current,Lt=Wo(_t,ze);if(!Lt)return;const Rt={w:Lt.w,h:Lt.h,x:Lt.x,y:Lt.y,i:ze},Mt=Vo(_t,Lt,lt,Ke,!0,Fe,_e,W,Ee);C(Mt,wt,Lt,Rt,mt.e,mt.node),te(fe.compact(Mt,W)),Ne(Rt)},[Fe,_e,W,Ee,fe,C]),ut=N.useCallback((ze,lt,Ke,mt)=>{if(!ge)return;const _t=It.current,wt=nt.current,Lt=Wo(_t,ze);if(!Lt)return;const Rt=Vo(_t,Lt,lt,Ke,!0,Fe,_e,W,Ee),Mt=fe.compact(Rt,W);O(Mt,wt,Lt,null,mt.e,mt.node);const gn=gt.current;nt.current=null,gt.current=null,Ne(null),te(Mt),gn&&!ks(gn,Mt)&&E(Mt)},[ge,Fe,_e,W,Ee,fe,O,E]),Ae=N.useCallback((ze,lt,Ke,mt)=>{const _t=It.current,wt=Wo(_t,ze);wt&&(ot.current=da(wt),gt.current=_t,pt(!0),A(_t,wt,wt,null,mt.e,mt.node))},[A]),He=N.useCallback((ze,lt,Ke,mt)=>{const _t=It.current,wt=ot.current,{handle:Lt}=mt;let Rt=!1,Mt,gn;const[xa,pr]=b4(_t,ze,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-Ke),Ke=Pt.y!==gn&&gn<0?Pt.h:Ke,gn=gn<0?0:gn),Rt=!0),Fe&&!Ee&&iv(_t,{...Pt,w:lt,h:Ke,x:Mt??Pt.x,y:gn??Pt.y}).filter(va=>va.i!==Pt.i).length>0&&(gn=Pt.y,Ke=Pt.h,Mt=Pt.x,lt=Pt.w,Rt=!1),Pt.w=lt,Pt.h=Ke,Pt));if(!pr)return;let Ps=xa;Rt&&Mt!==void 0&&gn!==void 0&&(Ps=Vo(xa,pr,Mt,gn,!0,Fe,_e,W,Ee));const No={w:pr.w,h:pr.h,x:pr.x,y:pr.y,i:ze,static:!0};L(Ps,wt,pr,No,mt.e,mt.node),te(fe.compact(Ps,W)),Ne(No)},[Fe,_e,W,Ee,fe,L]),ft=N.useCallback((ze,lt,Ke,mt)=>{const _t=It.current,wt=ot.current,Lt=Wo(_t,ze),Rt=fe.compact(_t,W);_(Rt,wt,Lt??null,null,mt.e,mt.node);const Mt=gt.current;ot.current=null,gt.current=null,Ne(null),pt(!1),te(Rt),Mt&&!ks(Mt,Rt)&&E(Rt)},[W,fe,_,E]),Ue=N.useCallback(()=>{const ze=It.current;if(!ze.some(mt=>mt.i===$e.i)){ie(null),Ne(null),Me(void 0);return}const Ke=fe.compact(ze.filter(mt=>mt.i!==$e.i),W);te(Ke),ie(null),Ne(null),Me(void 0)},[$e.i,W,fe]),Yt=N.useCallback(ze=>{var pu;if(ze.preventDefault(),ze.stopPropagation(),Av&&!((pu=ze.nativeEvent.target)!=null&&pu.classList.contains(eb)))return!1;const lt=oe?oe(ze.nativeEvent):I(ze);if(lt===!1)return yt&&Ue(),!1;const{dragOffsetX:Ke=0,dragOffsetY:mt=0,..._t}=lt??{},wt={...$e,..._t},Lt=ze.currentTarget.getBoundingClientRect(),Rt={cols:W,margin:ne,maxRows:Q,rowHeight:$,containerWidth:n,containerPadding:tt},Mt=Ci(Rt),gn=gi(wt.w,Mt,ne[0]),xa=gi(wt.h,$,ne[1]),pr=gn/2,Ps=xa/2,No=ze.clientX-Lt.left+Ke-pr,Pt=ze.clientY-Lt.top+mt-Ps,Ii=Math.max(0,No),va=Math.max(0,Pt),jt={left:Ii/Je,top:va/Je,e:ze.nativeEvent};if(yt)ye&&(ye.left!==jt.left||ye.top!==jt.top)&&Me(jt);else{const Do=m4(Rt,va,Ii,wt.w,wt.h);ie(f.jsx("div",{},wt.i)),Me(jt),te([...It.current,{...wt,x:Do.x,y:Do.y,static:!1,isDraggable:!0}])}},[yt,ye,$e,oe,I,Ue,Je,W,ne,Q,$,n,tt]),en=N.useCallback(ze=>{ze.preventDefault(),ze.stopPropagation(),Zt.current--,Zt.current<0&&(Zt.current=0),Zt.current===0&&Ue()},[Ue]),tn=N.useCallback(ze=>{ze.preventDefault(),ze.stopPropagation(),Zt.current++},[]),$t=N.useCallback(ze=>{ze.preventDefault(),ze.stopPropagation();const lt=It.current,Ke=lt.find(mt=>mt.i===$e.i);Zt.current=0,Ue(),S(lt,Ke,ze.nativeEvent)},[$e.i,Ue,S]),nn=N.useCallback((ze,lt)=>{if(!ze||!ze.key)return null;const Ke=Wo(se,String(ze.key));if(!Ke)return null;const mt=typeof Ke.isDraggable=="boolean"?Ke.isDraggable:!Ke.static&&ee,_t=typeof Ke.isResizable=="boolean"?Ke.isResizable:!Ke.static&&j,wt=Ke.resizeHandles||[...le],Lt=mt&&ce&&Ke.isBounded!==!1,Rt=he;return f.jsx(Z1,{containerWidth:n,cols:W,margin:ne,containerPadding:tt,maxRows:Q,rowHeight:$,cancel:G,handle:M,onDragStart:Dr,onDrag:Ge,onDragStop:ut,onResizeStart:Ae,onResize:He,onResizeStop:ft,isDraggable:mt,isResizable:_t,isBounded:Lt,useCSSTransforms:st&&Te,usePercentages:!Te,transformScale:Je,positionStrategy:c,dragThreshold:ae,w:Ke.w,h:Ke.h,x:Ke.x,y:Ke.y,i:Ke.i,minH:Ke.minH,minW:Ke.minW,maxH:Ke.maxH,maxW:Ke.maxW,static:Ke.static,droppingPosition:lt?ye:void 0,resizeHandles:wt,resizeHandle:Rt,constraints:h,layoutItem:Ke,layout:se,children:ze},Ke.i)},[se,n,W,ne,tt,Q,$,G,M,Dr,Ge,ut,Ae,He,ft,ee,j,ce,st,Te,Je,c,ae,ye,le,he,h]),On=()=>ge?f.jsx(Z1,{w:ge.w,h:ge.h,x:ge.x,y:ge.y,i:ge.i,className:`react-grid-placeholder ${qe?"placeholder-resizing":""}`,containerWidth:n,cols:W,margin:ne,containerPadding:tt,maxRows:Q,rowHeight:$,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:st,transformScale:Je,constraints:h,layout:se,children:f.jsx("div",{})}):null,$n=nr(eb,v),$r={height:yn,...D};return f.jsxs("div",{ref:k,className:$n,style:$r,onDrop:pe?$t:void 0,onDragLeave:pe?en:void 0,onDragEnter:pe?tn:void 0,onDragOver:pe?Yt:void 0,children:[Ie.Children.map(t,ze=>Ie.isValidElement(ze)?nn(ze):null),pe&&yt&&nn(yt,!0),On()]})}var pD={lg:1200,md:996,sm:768,xs:480,xxs:0},yD={lg:12,md:10,sm:6,xs:4,xxs:2},Kh=()=>{};function gD(e,t,n,r){const o=[];Ie.Children.forEach(t,l=>{if(!Ie.isValidElement(l)||l.key===null)return;const c=String(l.key),d=e.find(h=>h.i===c);if(d)o.push({...d,i:c});else{const p=l.props["data-grid"];p?o.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}):o.push({i:c,x:0,y:Id(o),w:1,h:1})}});const i=Lm(o,{cols:n});return r.compact(i,n)}function bD(e){const{children:t,width:n,breakpoint:r,breakpoints:o=pD,cols:i=yD,layouts:l={},rowHeight:c=150,maxRows:d=1/0,margin:h=[10,10],containerPadding:p=null,compactor:y,onBreakpointChange:b=Kh,onLayoutChange:v=Kh,onWidthChange:D=Kh,...k}=e,E=y??uu("vertical"),T=E.type,C=E.allowOverlap,O=N.useMemo(()=>r??A1(o,n),[]),A=N.useMemo(()=>I1(O,i),[O,i]),L=N.useMemo(()=>$h(l,o,O,O,A,T),[]),[_,S]=N.useState(O),[I,P]=N.useState(A),[U,F]=N.useState(L),[H,W]=N.useState(l),$=N.useRef(n),Q=N.useRef(r),ne=N.useRef(o),me=N.useRef(i),ee=N.useRef(l),ce=N.useRef(T),M=N.useRef(H);N.useEffect(()=>{M.current=H},[H]);const G=N.useMemo(()=>ks(l,ee.current)?null:$h(l,o,_,_,I,E),[l,o,_,I,E]),ae=G??U;N.useEffect(()=>{G!==null&&(F(G),W(l),M.current=l,ee.current=l)},[G,l]),N.useEffect(()=>{if(T!==ce.current){const Oe=E.compact(So(ae),I),oe={...M.current,[_]:Oe};F(Oe),W(oe),M.current=oe,v(Oe,oe),ce.current=T}},[T,E,ae,I,C,_,v]),N.useEffect(()=>{const Oe=n!==$.current,oe=r!==Q.current,fe=!ks(o,ne.current),_e=!ks(i,me.current);if(Oe||oe||fe||_e){const Ee=r??A1(o,n),Fe=I1(Ee,i),$e=_;if($e!==Ee||fe||_e){const tt={...M.current};tt[$e]||(tt[$e]=So(U));let Te=$h(tt,o,Ee,$e,Fe,E);Te=gD(Te,t,Fe,E),tt[Ee]=Te,S(Ee),P(Fe),F(Te),W(tt),M.current=tt,b(Ee,Fe),v(Te,tt)}const st=Ac(h,Ee),Je=p?Ac(p,Ee):null;D(n,st,Fe,Je),$.current=n,Q.current=r,ne.current=o,me.current=i}},[n,r,o,i,_,I,U,t,E,T,C,h,p,b,v,D]);const j=N.useCallback(Oe=>{const fe={...M.current,[_]:Oe};F(Oe),W(fe),M.current=fe,v(Oe,fe)},[_,v]),le=N.useMemo(()=>Ac(h,_),[h,_]),he=N.useMemo(()=>p===null?null:Ac(p,_),[p,_]),pe=N.useMemo(()=>({cols:I,rowHeight:c,maxRows:d,margin:le,containerPadding:he}),[I,c,d,le,he]);return f.jsx(Iv,{...k,width:n,gridConfig:pe,compactor:E,onLayoutChange:j,layout:ae,children:t})}function Mv(e){const{children:t,width:n,cols:r=12,rowHeight:o=150,maxRows:i=1/0,margin:l=[10,10],containerPadding:c=null,layout:d,droppingItem:h,compactType:p,preventCollision:y=!1,allowOverlap:b=!1,verticalCompact:v,isDraggable:D=!0,isBounded:k=!1,draggableHandle:E,draggableCancel:T,isResizable:C=!0,resizeHandles:O=["se"],resizeHandle:A,isDroppable:L=!1,useCSSTransforms:_=!0,transformScale:S=1,autoSize:I,className:P,style:U,innerRef:F,onLayoutChange:H,onDragStart:W,onDrag:$,onDragStop:Q,onResizeStart:ne,onResize:me,onResizeStop:ee,onDrop:ce,onDropDragOver:M}=e;let G=p===void 0?"vertical":p;v===!1&&(G=null);const ae={cols:r,rowHeight:o,maxRows:i,margin:l,containerPadding:c},j={enabled:D,bounded:k,handle:E,cancel:T,threshold:0},le={enabled:C,handles:O,handleComponent:A},he={enabled:L};let pe;_?S!==1?pe=fv(S):pe=Hm:pe=dv;const Oe=uu(G,b,y),oe=k?[...od,E4]:od;return f.jsx(Iv,{width:n,gridConfig:ae,dragConfig:j,resizeConfig:le,dropConfig:he,positionStrategy:pe,compactor:Oe,constraints:oe,layout:d,droppingItem:h,autoSize:I,className:P,style:U,innerRef:F,onLayoutChange:H,onDragStart:W,onDrag:$,onDragStop:Q,onResizeStart:ne,onResize:me,onResizeStop:ee,onDrop:ce,onDropDragOver:M,children:t})}Mv.displayName="ReactGridLayout";var xD=Mv;function Lv(e){const{children:t,width:n,breakpoint:r,breakpoints:o,cols:i,layouts:l,onBreakpointChange:c,onLayoutChange:d,onWidthChange:h,rowHeight:p,maxRows:y,margin:b,containerPadding:v,droppingItem:D,compactType:k,preventCollision:E=!1,allowOverlap:T=!1,verticalCompact:C,isDraggable:O=!0,isBounded:A=!1,draggableHandle:L,draggableCancel:_,isResizable:S=!0,resizeHandles:I=["se"],resizeHandle:P,isDroppable:U=!1,useCSSTransforms:F=!0,transformScale:H=1,autoSize:W,className:$,style:Q,innerRef:ne,onDragStart:me,onDrag:ee,onDragStop:ce,onResizeStart:M,onResize:G,onResizeStop:ae,onDrop:j,onDropDragOver:le}=e;let he=k===void 0?"vertical":k;C===!1&&(he=null);const pe={enabled:O,bounded:A,handle:L,cancel:_},Oe={enabled:S,handles:I,handleComponent:P},oe={enabled:U};let fe;F?H!==1?fe=fv(H):fe=Hm:fe=dv;const _e=uu(he,T,E);return f.jsx(bD,{width:n,breakpoint:r,breakpoints:o,cols:i,layouts:l,rowHeight:p,maxRows:y,margin:b,containerPadding:v,compactor:_e,dragConfig:pe,resizeConfig:Oe,dropConfig:oe,positionStrategy:fe,droppingItem:D,autoSize:W,className:$,style:Q,innerRef:ne,onBreakpointChange:c,onLayoutChange:d,onWidthChange:h,onDragStart:me,onDrag:ee,onDragStop:ce,onResizeStart:M,onResize:G,onResizeStop:ae,onDrop:j,onDropDragOver:le,children:t})}Lv.displayName="ResponsiveReactGridLayout";var vD=Lv;function ED(e){const t=e,n=[...e].sort((h,p)=>h.y-p.y||h.x-p.x),r=[];let o=0,i=0,l=0;for(const h of n){const p=Math.min(h.w,6);i+p>6&&(o+=l,i=0,l=0),r.push({...h,x:i,y:o,w:p}),i+=p,l=Math.max(l,h.h)}const c=[];let d=0;for(const h of n)c.push({...h,x:0,y:d,w:1}),d+=h.h;return{lg:t,md:r,sm:c}}function TD(e,t,n,r){const o=Object.values(n);if(o.length===0)return e;let i=e,l=!1;for(const c of o){if(c.sourceChart===r||!t.some(h=>h.name===c.field))continue;const d=i.filter(h=>String(h[c.field])===c.value);d.length!==i.length&&(l=!0),i=d}return l?i:e}function Rv(e,t,n,r){const o=Object.values(n).filter(i=>i.sourceChart!==r);return o.length===0?!1:o.every(i=>{const l=e.some(d=>d.name===i.field),c=t==null?void 0:t.some(d=>d.name===i.field);return!l&&!c})}function wl(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 wD(e,t){const n=e>=0?"+":"";return t==="percent_change"?`${n}${e.toFixed(1)}%`:`${n}${e.toLocaleString()}`}function kD({chartRef:e}){var U,F,H,W,$,Q;const{data:t}=jx(e),{data:n,isLoading:r,error:o,isFetching:i}=e2(e),l=Tm(),c=Xe(ne=>ne.crossFilters),d=N.useMemo(()=>n!=null&&n.columns?Rv(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 ne=t.name||e;Ed(n.rows,n.columns,ne)};if(r)return f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsx("div",{className:"animate-pulse h-12 w-24 rounded",style:{backgroundColor:"var(--yc-color-surface-hover)"}})});if(o)return f.jsx(rd,{isLoading:!1,error:o,data:void 0,onRetry:h,children:f.jsx("div",{})});if(!((U=n==null?void 0:n.rows)!=null&&U[0]))return f.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],b=t==null?void 0:t.chart;if(!((F=b==null?void 0:b.value)!=null&&F.field))return f.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[b.value.field],D=wl(v,b.format);let k=null,E="percent_change",T,C,O;if(n.comparison)k=n.comparison.change,E=n.comparison.changeType,T=n.comparison.currentPeriodLabel,C=n.comparison.previousPeriodLabel,O=wl(n.comparison.previousValue,b.format);else if((H=b.comparison)!=null&&H.enabled&&b.comparison.field){const ne=y[b.comparison.field];E=b.comparison.type,ne&&ne!==0&&(E==="percent_change"?k=(v-ne)/ne*100:k=v-ne,O=wl(ne,b.format))}const A=b.goal,L=A&&A.value!==0?Math.max(0,Math.min(v/A.value*100,100)):null,_=A?v>=A.value?"var(--yc-color-success)":"var(--yc-color-danger)":void 0,S=t==null?void 0:t.drillDown,I=!!(S!=null&&S.chart||S!=null&&S.model),P=()=>{if(!S)return;const ne=new URLSearchParams({_from:e});S.chart?window.location.hash=`/charts/${S.chart}?${ne.toString()}`:S.model&&(window.location.hash=`/charts/${e}/detail?${ne.toString()}`)};return f.jsxs("div",{className:"h-full flex flex-col p-4 group relative",style:{containerType:"size"},children:[f.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity z-10",children:f.jsx(rv,{onRefresh:h,onExportCSV:p,onExportPNG:p,onExportSVG:p,isRefreshing:i,hideImageExport:!0})}),f.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[f.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}),I&&f.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:[f.jsx("title",{children:"Click value to drill down"}),f.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&&f.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"})]}),f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center min-h-0",children:[f.jsxs("div",{className:nr("font-bold leading-none text-center",I&&"cursor-pointer hover:opacity-75 transition-opacity"),style:{color:"var(--yc-color-text)",fontSize:"clamp(1.25rem, min(40cqh, 14cqw), 8rem)"},onClick:I?P:void 0,role:I?"button":void 0,tabIndex:I?0:void 0,onKeyDown:I?ne=>{(ne.key==="Enter"||ne.key===" ")&&P()}:void 0,children:[D,b.unit&&f.jsx("span",{className:"font-normal ml-1",style:{fontSize:"0.5em",color:"var(--yc-color-text-muted)"},children:b.unit})]}),T&&f.jsx("div",{className:"text-xs mt-1.5 truncate",style:{color:"var(--yc-color-text-muted)"},children:T}),k!==null&&f.jsxs("div",{className:"mt-1.5 flex items-center gap-2 flex-wrap justify-center relative group/comparison kpi-comparison",children:[f.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:wD(k,E)}),O&&f.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:["vs ",O]}),!O&&((W=b.comparison)==null?void 0:W.label)&&f.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:b.comparison.label}),(C||O||(($=b.comparison)==null?void 0:$.label))&&f.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:f.jsxs("div",{className:"kpi-tooltip text-xs rounded-md px-3 py-2 shadow-lg whitespace-nowrap",children:[C&&f.jsx("div",{className:"font-medium",children:C}),!C&&((Q=b.comparison)==null?void 0:Q.label)&&f.jsx("div",{className:"font-medium",children:b.comparison.label}),O&&f.jsxs("div",{style:{opacity:.75},className:"mt-0.5",children:["Previous: ",O]})]})})]}),A&&L!==null&&f.jsxs("div",{className:"mt-2 w-full max-w-[200px]",children:[A.show_progress&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex justify-between text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:[f.jsxs("span",{children:[wl(v,b.format)," / ",wl(A.value,b.format)]}),f.jsxs("span",{children:[L.toFixed(0),"%"]})]}),f.jsx("div",{className:"w-full h-1.5 rounded-full",style:{backgroundColor:"var(--yc-color-surface-hover)"},children:f.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${L}%`,backgroundColor:_}})})]}),A.label&&f.jsx("div",{className:"text-xs mt-1 text-center",style:{color:"var(--yc-color-text-muted)"},children:A.label})]})]})]})}function SD({chartRef:e}){var oe,fe,_e,Ee,Fe,$e,st,Je,tt;const{data:t,isLoading:n,isFetching:r,error:o}=l_(e),{data:i}=ma(),l=t==null?void 0:t.config,c=t,d=Tm(),h=N.useRef(null),[p,y]=N.useState(!1),b=Xe(Te=>Te.chartFilters),v=Xe(Te=>Te.resetChartFilters),D=Xe(Te=>Te.crossFilters),k=Xe(Te=>Te.setCrossFilter),{events:E}=r2(e),T=ko(Te=>Te.auth),C=Wn(),[O,A]=N.useState(null),L=T.status==="disabled"||T.status==="authenticated"&&(T.user.role==="admin"||T.user.role==="editor"),_=((fe=(oe=l==null?void 0:l.chart)==null?void 0:oe.x)==null?void 0:fe.type)==="temporal",S=Ka({mutationFn:Te=>xt.createChartEvent({date:Te.date,label:Te.label,...Te.color?{color:Te.color}:{}}),onSuccess:()=>{C.invalidateQueries({queryKey:["chartEvents"]}),A(null)}}),I=b[e]&&Object.keys(b[e]).length>0,P=N.useMemo(()=>{for(const Te of Object.values(D))if(Te.sourceChart===e)return{field:Te.field,value:Te.value};return null},[D,e]),U=N.useMemo(()=>!(c!=null&&c.rows)||!(c!=null&&c.columns)?(c==null?void 0:c.rows)??[]:TD(c.rows,c.columns,D,e),[c==null?void 0:c.rows,c==null?void 0:c.columns,D,e]),F=N.useMemo(()=>c!=null&&c.columns?Rv(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]),[H,W]=N.useState(null),$=N.useCallback((Te,Re,se,te)=>{var Ne;let ge;if(te&&((Ne=l==null?void 0:l.chart)!=null&&Ne.series)&&"field"in l.chart.series){const qe=l.chart.series.field;qe&&qe!==Te&&(ge={[Te]:Re,[qe]:te})}W({x:se.x,y:se.y,field:Te,value:Re,allFields:ge})},[l]),Q=N.useCallback(()=>{var Te,Re,se,te;if(H)if(H.allFields)for(const[ge,Ne]of Object.entries(H.allFields)){const qe=((Re=(Te=l==null?void 0:l.chart)==null?void 0:Te.x)==null?void 0:Re.type)==="temporal"&&ge===l.chart.x.field;k(ge,Ne,e,qe||void 0)}else{const ge=((te=(se=l==null?void 0:l.chart)==null?void 0:se.x)==null?void 0:te.type)==="temporal"&&H.field===l.chart.x.field;k(H.field,H.value,e,ge||void 0)}},[H,k,e,l]),ne=N.useCallback(()=>{H&&A(H.value)},[H]),me=N.useCallback(()=>{var te,ge,Ne;if(!H||!((te=l==null?void 0:l.drillDown)!=null&&te.model))return;const Te=l.drillDown,Re=Te.fields?typeof Te.fields=="string"?Te.fields:Te.fields[0]:Te.field??((Ne=(ge=l.chart)==null?void 0:ge.x)==null?void 0:Ne.field)??H.field,se=new URLSearchParams;if(H.allFields)for(const[qe,pt]of Object.entries(H.allFields))se.set(qe,pt);else se.set(Re,H.value);se.set("_from",e),window.location.hash=`/charts/${e}/detail?${se.toString()}`,W(null)},[H,l,e]),ee=N.useCallback(()=>{var te,ge,Ne;if(!H||!((te=l==null?void 0:l.drillDown)!=null&&te.chart))return;const Te=l.drillDown,Re=Te.fields?typeof Te.fields=="string"?Te.fields:Te.fields[0]:Te.field??((Ne=(ge=l.chart)==null?void 0:ge.x)==null?void 0:Ne.field)??H.field,se=new URLSearchParams;if(H.allFields)for(const[qe,pt]of Object.entries(H.allFields))se.set(qe,pt);else se.set(Re,H.value);se.set("_from",e),window.location.hash=`/charts/${l.drillDown.chart}?${se.toString()}`,W(null)},[H,l,e]),ce=()=>{d(e)},M=()=>{v(e),y(!1)},G=()=>{if(!c||!l)return;const Te=l.name||e;Ed(U,c.columns,Te)},ae=()=>{var Re;const Te=(Re=h.current)==null?void 0:Re.getDataURL("png");Te&&l&&Zc(Te,`${l.name||e}.png`)},j=()=>{var Re;const Te=(Re=h.current)==null?void 0:Re.getDataURL("svg");Te&&l&&Zc(Te,`${l.name||e}.svg`)},le=async()=>{var Re;const Te=(Re=h.current)==null?void 0:Re.getDataURL("png");Te&&l&&await L3(Te,l.name||e,l.title)};if(!l&&o)return f.jsx(rd,{isLoading:!1,error:o,data:void 0,onRetry:()=>d(e),children:f.jsx("div",{})});if(!l||!c)return n?f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsx("div",{className:"animate-pulse w-full h-full rounded",style:{backgroundColor:"var(--yc-color-surface-hover)"}})}):f.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 f.jsx(kD,{chartRef:e});const he=["line","bar","area","pie","donut","scatter","combo","heatmap","funnel","waterfall","gauge"].includes(l.chart.type),pe=()=>{switch(l.chart.type){case"line":return!l.chart.x||!l.chart.y&&!l.chart.series?f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):f.jsx(q2,{ref:h,data:U,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:$,activeCrossFilter:P,events:E,goalData:c.goalData});case"bar":return!l.chart.x||!l.chart.y&&!l.chart.series?f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):f.jsx(V2,{ref:h,data:U,xAxis:l.chart.x,yAxis:l.chart.y,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:$,activeCrossFilter:P,events:E,goalData:c.goalData});case"area":return!l.chart.x||!l.chart.y&&!l.chart.series?f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):f.jsx(Q2,{ref:h,data:U,xAxis:l.chart.x,yAxis:l.chart.y,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:$,activeCrossFilter:P,events:E,goalData:c.goalData});case"pie":return!l.chart.x||!l.chart.y?f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):f.jsx(G2,{ref:h,data:U,xAxis:l.chart.x,yAxis:l.chart.y,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:$,activeCrossFilter:P});case"donut":return!l.chart.x||!l.chart.y?f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):f.jsx(K2,{ref:h,data:U,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:$,activeCrossFilter:P});case"scatter":return!l.chart.x||!l.chart.y?f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):f.jsx(X2,{ref:h,data:U,xAxis:l.chart.x,yAxis:l.chart.y,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:$,activeCrossFilter:P});case"table":return f.jsx(B0,{data:U,columns:c.columns,chartConfig:l.chart,height:"100%",loading:r,onRowClick:l!=null&&l.drillDown?(Te,Re,se)=>{const te=l.drillDown,ge=te.fields?typeof te.fields=="string"?[te.fields]:te.fields:te.field?[te.field]:[];if(ge.length===0)return;const Ne={};for(const qe of ge)qe in Te?Ne[qe]=String(Te[qe]??""):se?Ne[qe]=se:Ne[qe]="";W({x:Re.x,y:Re.y,field:ge[0],value:Ne[ge[0]],allFields:ge.length>1?Ne:void 0})}:void 0});case"metric":return l.chart.y?f.jsx(a4,{data:U,yAxis:l.chart.y,title:l.title,loading:r}):f.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?f.jsx(J2,{ref:h,data:U,xAxis:l.chart.x,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:$,activeCrossFilter:P,events:E,goalData:c.goalData}):f.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?f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):f.jsx(Z2,{ref:h,data:U,chartConfig:l.chart,height:"100%",loading:r});case"funnel":return f.jsx(ev,{ref:h,data:U,chartConfig:l.chart,height:"100%",loading:r});case"waterfall":return f.jsx(tv,{ref:h,data:U,chartConfig:l.chart,height:"100%",loading:r});case"gauge":return f.jsx(nv,{ref:h,data:U,chartConfig:l.chart,height:"100%",loading:r});default:return f.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 f.jsx(Am,{fallback:(Te,Re)=>f.jsx("div",{className:"h-full flex items-center justify-center p-4",children:f.jsxs("div",{className:"text-center",children:[f.jsx("p",{className:"text-sm font-medium",style:{color:"var(--yc-color-danger)"},children:"Failed to render chart"}),f.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-secondary)"},children:Te.message}),f.jsx("button",{onClick:Re,className:"mt-2 text-xs text-blue-600 hover:text-blue-700",children:"Retry"})]})}),resetKey:e,children:f.jsxs("div",{className:"h-full p-2 flex flex-col group",children:[f.jsxs("div",{className:"flex items-center justify-between mb-2 px-2 flex-shrink-0",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("a",{href:`#/charts/${e}`,className:"text-sm font-medium hover:underline",style:{color:"var(--yc-color-text)"},children:l.title}),(((Ee=l==null?void 0:l.drillDown)==null?void 0:Ee.chart)||((Fe=l==null?void 0:l.drillDown)==null?void 0:Fe.model))&&f.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:[f.jsx("title",{children:"Click chart to drill down"}),f.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"})]}),I&&f.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded",children:"Filtered"}),F&&!I&&f.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"})]}),f.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[Oe&&f.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:f.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-secondary)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.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"})})}),f.jsx(rv,{onRefresh:ce,onExportCSV:G,onExportPNG:he?ae:G,onExportSVG:he?j:G,onExportPDF:he?le:void 0,isRefreshing:r})]})]}),p&&Oe&&f.jsx("div",{className:"mb-2 px-2 flex-shrink-0",children:f.jsxs("div",{className:"flex items-end gap-2 flex-wrap",children:[f.jsx(P2,{parameters:l.parameters,chartName:e}),I&&f.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"})]})}),f.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:f.jsx(rd,{isLoading:n,error:o,data:U,onRetry:()=>d(e),children:pe()})}),H&&f.jsx(sv,{x:H.x,y:H.y,field:H.field,value:H.value,allFields:H.allFields,onFilter:Q,onViewDetails:($e=l==null?void 0:l.drillDown)!=null&&$e.model?me:void 0,onGoToChart:(st=l==null?void 0:l.drillDown)!=null&&st.chart?ee:void 0,onAddEvent:L?ne:void 0,detailModel:(Je=l==null?void 0:l.drillDown)==null?void 0:Je.model,targetChart:(tt=l==null?void 0:l.drillDown)==null?void 0:tt.chart,isTemporalChart:_,onClose:()=>W(null)}),O&&f.jsx(ov,{date:O,onSave:Te=>S.mutate(Te),onClose:()=>A(null),saving:S.isPending})]})})}function nb(e){const t=[],n=String(e||"");let r=n.indexOf(","),o=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const l=n.slice(o,r).trim();(l||!i)&&t.push(l),o=r+1,r=n.indexOf(",",o)}return t}function Pv(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const CD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_D=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ND={};function rb(e,t){return(ND.jsx?_D:CD).test(e)}const DD=/[ \t\n\f\r]/g;function OD(e){return typeof e=="object"?e.type==="text"?sb(e.value):!1:sb(e)}function sb(e){return e.replace(DD,"")===""}class cu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}cu.prototype.normal={};cu.prototype.property={};cu.prototype.space=void 0;function jv(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new cu(n,r,t)}function Vl(e){return e.toLowerCase()}class sr{constructor(t,n){this.attribute=n,this.property=t}}sr.prototype.attribute="";sr.prototype.booleanish=!1;sr.prototype.boolean=!1;sr.prototype.commaOrSpaceSeparated=!1;sr.prototype.commaSeparated=!1;sr.prototype.defined=!1;sr.prototype.mustUseProperty=!1;sr.prototype.number=!1;sr.prototype.overloadedBoolean=!1;sr.prototype.property="";sr.prototype.spaceSeparated=!1;sr.prototype.space=void 0;let AD=0;const ct=ga(),pn=ga(),z0=ga(),Se=ga(),Bt=ga(),Xa=ga(),ur=ga();function ga(){return 2**++AD}const W0=Object.freeze(Object.defineProperty({__proto__:null,boolean:ct,booleanish:pn,commaOrSpaceSeparated:ur,commaSeparated:Xa,number:Se,overloadedBoolean:z0,spaceSeparated:Bt},Symbol.toStringTag,{value:"Module"})),Xh=Object.keys(W0);class Ym extends sr{constructor(t,n,r,o){let i=-1;if(super(t,n),ob(this,"space",o),typeof r=="number")for(;++i<Xh.length;){const l=Xh[i];ob(this,Xh[i],(r&W0[l])===W0[l])}}}Ym.prototype.defined=!0;function ob(e,t,n){n&&(e[t]=n)}function _i(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new Ym(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Vl(r)]=r,n[Vl(i.attribute)]=r}return new cu(t,n,e.space)}const Fv=_i({properties:{ariaActiveDescendant:null,ariaAtomic:pn,ariaAutoComplete:null,ariaBusy:pn,ariaChecked:pn,ariaColCount:Se,ariaColIndex:Se,ariaColSpan:Se,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:Se,ariaLive:null,ariaModal:pn,ariaMultiLine:pn,ariaMultiSelectable:pn,ariaOrientation:null,ariaOwns:Bt,ariaPlaceholder:null,ariaPosInSet:Se,ariaPressed:pn,ariaReadOnly:pn,ariaRelevant:null,ariaRequired:pn,ariaRoleDescription:Bt,ariaRowCount:Se,ariaRowIndex:Se,ariaRowSpan:Se,ariaSelected:pn,ariaSetSize:Se,ariaSort:null,ariaValueMax:Se,ariaValueMin:Se,ariaValueNow:Se,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 Hv(e,t){return Bv(e,t.toLowerCase())}const ID=_i({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Xa,acceptCharset:Bt,accessKey:Bt,action:null,allow:null,allowFullScreen:ct,allowPaymentRequest:ct,allowUserMedia:ct,alt:null,as:null,async:ct,autoCapitalize:null,autoComplete:Bt,autoFocus:ct,autoPlay:ct,blocking:Bt,capture:null,charSet:null,checked:ct,cite:null,className:Bt,cols:Se,colSpan:null,content:null,contentEditable:pn,controls:ct,controlsList:Bt,coords:Se|Xa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ct,defer:ct,dir:null,dirName:null,disabled:ct,download:z0,draggable:pn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ct,formTarget:null,headers:Bt,height:Se,hidden:z0,high:Se,href:null,hrefLang:null,htmlFor:Bt,httpEquiv:Bt,id:null,imageSizes:null,imageSrcSet:null,inert:ct,inputMode:null,integrity:null,is:null,isMap:ct,itemId:null,itemProp:Bt,itemRef:Bt,itemScope:ct,itemType:Bt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ct,low:Se,manifest:null,max:null,maxLength:Se,media:null,method:null,min:null,minLength:Se,multiple:ct,muted:ct,name:null,nonce:null,noModule:ct,noValidate:ct,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:ct,optimum:Se,pattern:null,ping:Bt,placeholder:null,playsInline:ct,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ct,referrerPolicy:null,rel:Bt,required:ct,reversed:ct,rows:Se,rowSpan:Se,sandbox:Bt,scope:null,scoped:ct,seamless:ct,selected:ct,shadowRootClonable:ct,shadowRootDelegatesFocus:ct,shadowRootMode:null,shape:null,size:Se,sizes:null,slot:null,span:Se,spellCheck:pn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Se,step:null,style:null,tabIndex:Se,target:null,title:null,translate:null,type:null,typeMustMatch:ct,useMap:null,value:pn,width:Se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Bt,axis:null,background:null,bgColor:null,border:Se,borderColor:null,bottomMargin:Se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ct,declare:ct,event:null,face:null,frame:null,frameBorder:null,hSpace:Se,leftMargin:Se,link:null,longDesc:null,lowSrc:null,marginHeight:Se,marginWidth:Se,noResize:ct,noHref:ct,noShade:ct,noWrap:ct,object:null,profile:null,prompt:null,rev:null,rightMargin:Se,rules:null,scheme:null,scrolling:pn,standby:null,summary:null,text:null,topMargin:Se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Se,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ct,disableRemotePlayback:ct,prefix:null,property:null,results:Se,security:null,unselectable:null},space:"html",transform:Hv}),MD=_i({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:ur,accentHeight:Se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Se,amplitude:Se,arabicForm:null,ascent:Se,attributeName:null,attributeType:null,azimuth:Se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Se,by:null,calcMode:null,capHeight:Se,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:Se,diffuseConstant:Se,direction:null,display:null,dur:null,divisor:Se,dominantBaseline:null,download:ct,dx:null,dy:null,edgeMode:null,editable:null,elevation:Se,enableBackground:null,end:null,event:null,exponent:Se,externalResourcesRequired:null,fill:null,fillOpacity:Se,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:Xa,g2:Xa,glyphName:Xa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Se,horizOriginX:Se,horizOriginY:Se,id:null,ideographic:Se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Se,k:Se,k1:Se,k2:Se,k3:Se,k4:Se,kernelMatrix:ur,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Se,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:Se,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:Se,overlineThickness:Se,paintOrder:null,panose1:null,path:null,pathLength:Se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Bt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Se,pointsAtY:Se,pointsAtZ:Se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ur,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ur,rev:ur,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ur,requiredFeatures:ur,requiredFonts:ur,requiredFormats:ur,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:Se,specularExponent:Se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Se,strikethroughThickness:Se,string:null,stroke:null,strokeDashArray:ur,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Se,strokeOpacity:Se,strokeWidth:null,style:null,surfaceScale:Se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ur,tabIndex:Se,tableValues:null,target:null,targetX:Se,targetY:Se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ur,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Se,underlineThickness:Se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Se,values:null,vAlphabetic:Se,vMathematical:Se,vectorEffect:null,vHanging:Se,vIdeographic:Se,version:null,vertAdvY:Se,vertOriginX:Se,vertOriginY:Se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Bv}),Uv=_i({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()}}),zv=_i({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Hv}),Wv=_i({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),LD={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"},RD=/[A-Z]/g,ab=/-[a-z]/g,PD=/^data[-\w.:]+$/i;function Bd(e,t){const n=Vl(t);let r=t,o=sr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&PD.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(ab,FD);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!ab.test(i)){let l=i.replace(RD,jD);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Ym}return new o(r,t)}function jD(e){return"-"+e.toLowerCase()}function FD(e){return e.charAt(1).toUpperCase()}const du=jv([Fv,ID,Uv,zv,Wv],"html"),Co=jv([Fv,MD,Uv,zv,Wv],"svg");function ib(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Yv(e){return e.join(" ").trim()}var qa={},Jh,lb;function BD(){if(lb)return Jh;lb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
109
+ `,h="/",p="*",y="",b="comment",v="declaration";function D(E,T){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];T=T||{};var C=1,O=1;function A($){var Q=$.match(t);Q&&(C+=Q.length);var ne=$.lastIndexOf(d);O=~ne?$.length-ne:O+$.length}function L(){var $={line:C,column:O};return function(Q){return Q.position=new _($),P(),Q}}function _($){this.start=$,this.end={line:C,column:O},this.source=T.source}_.prototype.content=E;function S($){var Q=new Error(T.source+":"+C+":"+O+": "+$);if(Q.reason=$,Q.filename=T.source,Q.line=C,Q.column=O,Q.source=E,!T.silent)throw Q}function I($){var Q=$.exec(E);if(Q){var ne=Q[0];return A(ne),E=E.slice(ne.length),Q}}function P(){I(n)}function U($){var Q;for($=$||[];Q=F();)Q!==!1&&$.push(Q);return $}function F(){var $=L();if(!(h!=E.charAt(0)||p!=E.charAt(1))){for(var Q=2;y!=E.charAt(Q)&&(p!=E.charAt(Q)||h!=E.charAt(Q+1));)++Q;if(Q+=2,y===E.charAt(Q-1))return S("End of comment missing");var ne=E.slice(2,Q-2);return O+=2,A(ne),E=E.slice(Q),O+=2,$({type:b,comment:ne})}}function H(){var $=L(),Q=I(r);if(Q){if(F(),!I(o))return S("property missing ':'");var ne=I(i),me=$({type:v,property:k(Q[0].replace(e,y)),value:ne?k(ne[0].replace(e,y)):y});return I(l),me}}function W(){var $=[];U($);for(var Q;Q=H();)Q!==!1&&($.push(Q),U($));return $}return P(),W()}function k(E){return E?E.replace(c,y):y}return Jh=D,Jh}var ub;function HD(){if(ub)return qa;ub=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(BD());function n(r,o){let i=null;if(!r||typeof r!="string")return i;const l=(0,t.default)(r),c=typeof o=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:p}=d;c?o(h,p,d):p&&(i=i||{},i[h]=p)}),i}return qa}var kl={},cb;function UD(){if(cb)return kl;cb=1,Object.defineProperty(kl,"__esModule",{value:!0}),kl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(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,"-")},d=function(h,p){return p===void 0&&(p={}),i(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(o,c):h=h.replace(r,c),h.replace(t,l))};return kl.camelCase=d,kl}var Sl,db;function zD(){if(db)return Sl;db=1;var e=Sl&&Sl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(HD()),n=UD();function r(o,i){var l={};return!o||typeof o!="string"||(0,t.default)(o,function(c,d){c&&d&&(l[(0,n.camelCase)(c,i)]=d)}),l}return r.default=r,Sl=r,Sl}var WD=zD();const YD=xx(WD),Hd=$v("end"),fs=$v("start");function $v(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function $D(e){const t=fs(e),n=Hd(e);if(t&&n)return{start:t,end:n}}function Pl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?fb(e.position):"start"in e||"end"in e?fb(e):"line"in e||"column"in e?Y0(e):""}function Y0(e){return hb(e&&e.line)+":"+hb(e&&e.column)}function fb(e){return Y0(e&&e.start)+"-"+Y0(e&&e.end)}function hb(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 o="",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"?o=t:!i.cause&&t&&(l=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?i.ruleId=r:(i.source=r.slice(0,d),i.ruleId=r.slice(d+1))}if(!i.place&&i.ancestors&&i.ancestors){const d=i.ancestors[i.ancestors.length-1];d&&(i.place=d.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=o,this.line=c?c.line:void 0,this.name=Pl(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 $m={}.hasOwnProperty,qD=new Map,VD=/[A-Z]/g,QD=new Set(["table","tbody","thead","tfoot","tr"]),GD=new Set(["td","th"]),qv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function KD(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=sO(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=rO(n,t.jsx,t.jsxs)}const o={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"?Co:du,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Vv(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Vv(e,t,n){if(t.type==="element")return XD(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return JD(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return eO(e,t,n);if(t.type==="mdxjsEsm")return ZD(e,t);if(t.type==="root")return tO(e,t,n);if(t.type==="text")return nO(e,t)}function XD(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Co,e.schema=o),e.ancestors.push(t);const i=Gv(e,t.tagName,!1),l=oO(e,t);let c=Vm(e,t);return QD.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!OD(d):!0})),Qv(e,l,i,t),qm(l,c),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function JD(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)}Ql(e,t.position)}function ZD(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ql(e,t.position)}function eO(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Co,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:Gv(e,t.name,!0),l=aO(e,t),c=Vm(e,t);return Qv(e,l,i,t),qm(l,c),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function tO(e,t,n){const r={};return qm(r,Vm(e,t)),e.create(t,e.Fragment,r,n)}function nO(e,t){return t.value}function Qv(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function qm(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function rO(e,t,n){return r;function r(o,i,l,c){const h=Array.isArray(l.children)?n:t;return c?h(i,l,c):h(i,l)}}function sO(e,t){return n;function n(r,o,i,l){const c=Array.isArray(i.children),d=fs(r);return t(o,i,l,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function oO(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&$m.call(t.properties,o)){const i=iO(e,o,t.properties[o]);if(i){const[l,c]=i;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&GD.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 aO(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 Ql(e,t.position);else{const o=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 Ql(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function Vm(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:qD;for(;++r<t.children.length;){const i=t.children[r];let l;if(e.passKeys){const d=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(d){const h=o.get(d)||0;l=d+"-"+h,o.set(d,h+1)}}const c=Vv(e,i,l);c!==void 0&&n.push(c)}return n}function iO(e,t,n){const r=Bd(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Pv(n):Yv(n)),r.property==="style"){let o=typeof n=="object"?n:lO(e,String(n));return e.stylePropertyNameCase==="css"&&(o=uO(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?LD[r.property]||r.property:r.attribute,n]}}function lO(e,t){try{return YD(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Fn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=qv+"#cannot-parse-style-attribute",o}}function Gv(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,l;for(;++i<o.length;){const c=rb(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(i&&c.type==="Literal"),optional:!1}:c}r=l}else r=rb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return $m.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ql(e)}function Ql(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=qv+"#cannot-handle-mdx-estrees-without-createevaluater",n}function uO(e){const t={};let n;for(n in e)$m.call(e,n)&&(t[cO(n)]=e[n]);return t}function cO(e){let t=e.replace(VD,dO);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function dO(e){return"-"+e.toLowerCase()}const Zh={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"]},fO={};function hO(e,t){const n=fO,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Kv(e,r,o)}function Kv(e,t,n){if(mO(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return mb(e.children,t,n)}return Array.isArray(e)?mb(e,t,n):""}function mb(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Kv(e[o],t,n);return r.join("")}function mO(e){return!!(e&&typeof e=="object")}const pb=document.createElement("i");function Qm(e){const t="&"+e+";";pb.innerHTML=t;const n=pb.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function us(e,t,n,r){const o=e.length;let i=0,l;if(t<0?t=-t>o?0:o+t:t=t>o?o: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 _r(e,t){return e.length>0?(us(e,e.length,0,t),e):t}const yb={}.hasOwnProperty;function pO(e){const t={};let n=-1;for(;++n<e.length;)yO(t,e[n]);return t}function yO(e,t){let n;for(n in t){const o=(yb.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let l;if(i)for(l in i){yb.call(o,l)||(o[l]=[]);const c=i[l];gO(o[l],Array.isArray(c)?c:c?[c]:[])}}}function gO(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);us(e,0,0,r)}function Xv(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 Ja(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const as=_o(/[A-Za-z]/),fr=_o(/[\dA-Za-z]/),bO=_o(/[#-'*+\--9=?A-Z^-~]/);function $0(e){return e!==null&&(e<32||e===127)}const q0=_o(/\d/),xO=_o(/[\dA-Fa-f]/),vO=_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 EO=_o(new RegExp("\\p{P}|\\p{S}","u")),TO=_o(/\s/);function _o(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ni(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let l="";if(i===37&&fr(e.charCodeAt(n+1))&&fr(e.charCodeAt(n+2)))o=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),o=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function Ht(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(d){return St(d)?(e.enter(n),c(d)):t(d)}function c(d){return St(d)&&i++<o?(e.consume(d),c):(e.exit(n),t(d))}}const wO={tokenize:kO};function kO(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);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 o(c){return e.enter("paragraph"),i(c)}function i(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return it(c)?(e.consume(c),e.exit("chunkText"),i):(e.consume(c),l)}}const SO={tokenize:CO},gb={tokenize:_O};function CO(e){const t=this,n=[];let r=0,o,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,d,h)(O)}return h(O)}function d(O){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&C();const A=t.events.length;let L=A,_;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){_=t.events[L][1].end;break}T(r);let S=A;for(;S<t.events.length;)t.events[S][1].end={..._},S++;return us(t.events,L+1,0,t.events.slice(A)),t.events.length=S,h(O)}return c(O)}function h(O){if(r===n.length){if(!o)return b(O);if(o.currentConstruct&&o.currentConstruct.concrete)return D(O);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gb,p,y)(O)}function p(O){return o&&C(),T(r),b(O)}function y(O){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,D(O)}function b(O){return t.containerState={},e.attempt(gb,v,D)(O)}function v(O){return r++,n.push([t.currentConstruct,t.containerState]),b(O)}function D(O){if(O===null){o&&C(),T(0),e.consume(O);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),k(O)}function k(O){if(O===null){E(e.exit("chunkFlow"),!0),T(0),e.consume(O);return}return it(O)?(e.consume(O),E(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(O),k)}function E(O,A){const L=t.sliceStream(O);if(A&&L.push(null),O.previous=i,i&&(i.next=O),i=O,o.defineSkip(O.start),o.write(L),t.parser.lazy[O.start.line]){let _=o.events.length;for(;_--;)if(o.events[_][1].start.offset<l&&(!o.events[_][1].end||o.events[_][1].end.offset>l))return;const S=t.events.length;let I=S,P,U;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(P){U=t.events[I][1].end;break}P=!0}for(T(r),_=S;_<t.events.length;)t.events[_][1].end={...U},_++;us(t.events,I+1,0,t.events.slice(S)),t.events.length=_}}function T(O){let A=n.length;for(;A-- >O;){const L=n[A];t.containerState=L[1],L[0].exit.call(t,e)}n.length=O}function C(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function _O(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 bb(e){if(e===null||rr(e)||TO(e))return 1;if(EO(e))return 2}function Gm(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const V0={name:"attention",resolveAll:NO,tokenize:DO};function NO(e,t){let n=-1,r,o,i,l,c,d,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;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const y={...e[r][1].end},b={...e[n][1].start};xb(y,-d),xb(b,d),l={type:d>1?"strongSequence":"emphasisSequence",start:y,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},i={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=_r(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=_r(h,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",i,t]]),h=_r(h,Gm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=_r(h,[["exit",i,t],["enter",c,t],["exit",c,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,h=_r(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,us(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 DO(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=bb(r);let i;return l;function l(d){return i=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===i)return e.consume(d),c;const h=e.exit("attentionSequence"),p=bb(d),y=!p||p===2&&o||n.includes(d),b=!o||o===2&&p||n.includes(r);return h._open=!!(i===42?y:y&&(o||!b)),h._close=!!(i===42?b:b&&(p||!y)),t(d)}}function xb(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const OO={name:"autolink",tokenize:AO};function AO(e,t,n){let r=0;return o;function o(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(v){return as(v)?(e.consume(v),l):v===64?n(v):h(v)}function l(v){return v===43||v===45||v===46||fr(v)?(r=1,c(v)):h(v)}function c(v){return v===58?(e.consume(v),r=0,d):(v===43||v===45||v===46||fr(v))&&r++<32?(e.consume(v),c):(r=0,h(v))}function d(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||$0(v)?n(v):(e.consume(v),d)}function h(v){return v===64?(e.consume(v),p):bO(v)?(e.consume(v),h):n(v)}function p(v){return fr(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):b(v)}function b(v){if((v===45||fr(v))&&r++<63){const D=v===45?b:y;return e.consume(v),D}return n(v)}}const Ud={partial:!0,tokenize:IO};function IO(e,t,n){return r;function r(i){return St(i)?Ht(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||it(i)?t(i):n(i)}}const Jv={continuation:{tokenize:LO},exit:RO,name:"blockQuote",tokenize:MO};function MO(e,t,n){const r=this;return o;function o(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 LO(e,t,n){const r=this;return o;function o(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(Jv,t,n)(l)}}function RO(e){e.exit("blockQuote")}const Zv={name:"characterEscape",tokenize:PO};function PO(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return vO(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const eE={name:"characterReference",tokenize:jO};function jO(e,t,n){const r=this;let o=0,i,l;return c;function c(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),d}function d(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),i=31,l=fr,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=xO,p):(e.enter("characterReferenceValue"),i=7,l=q0,p(y))}function p(y){if(y===59&&o){const b=e.exit("characterReferenceValue");return l===fr&&!Qm(r.sliceSerialize(b))?n(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(y)&&o++<i?(e.consume(y),p):n(y)}}const vb={partial:!0,tokenize:BO},Eb={concrete:!0,name:"codeFenced",tokenize:FO};function FO(e,t,n){const r=this,o={partial:!0,tokenize:L};let i=0,l=0,c;return d;function d(_){return h(_)}function h(_){const S=r.events[r.events.length-1];return i=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,c=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(_)}function p(_){return _===c?(l++,e.consume(_),p):l<3?n(_):(e.exit("codeFencedFenceSequence"),St(_)?Ht(e,y,"whitespace")(_):y(_))}function y(_){return _===null||it(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(vb,k,A)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===null||it(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(_)):St(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ht(e,v,"whitespace")(_)):_===96&&_===c?n(_):(e.consume(_),b)}function v(_){return _===null||it(_)?y(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),D(_))}function D(_){return _===null||it(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(_)):_===96&&_===c?n(_):(e.consume(_),D)}function k(_){return e.attempt(o,A,E)(_)}function E(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),T}function T(_){return i>0&&St(_)?Ht(e,C,"linePrefix",i+1)(_):C(_)}function C(_){return _===null||it(_)?e.check(vb,k,A)(_):(e.enter("codeFlowValue"),O(_))}function O(_){return _===null||it(_)?(e.exit("codeFlowValue"),C(_)):(e.consume(_),O)}function A(_){return e.exit("codeFenced"),t(_)}function L(_,S,I){let P=0;return U;function U(Q){return _.enter("lineEnding"),_.consume(Q),_.exit("lineEnding"),F}function F(Q){return _.enter("codeFencedFence"),St(Q)?Ht(_,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):H(Q)}function H(Q){return Q===c?(_.enter("codeFencedFenceSequence"),W(Q)):I(Q)}function W(Q){return Q===c?(P++,_.consume(Q),W):P>=l?(_.exit("codeFencedFenceSequence"),St(Q)?Ht(_,$,"whitespace")(Q):$(Q)):I(Q)}function $(Q){return Q===null||it(Q)?(_.exit("codeFencedFence"),S(Q)):I(Q)}}}function BO(e,t,n){const r=this;return o;function o(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 e0={name:"codeIndented",tokenize:UO},HO={partial:!0,tokenize:zO};function UO(e,t,n){const r=this;return o;function o(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?d(h):it(h)?e.attempt(HO,l,d)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||it(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),c)}function d(h){return e.exit("codeIndented"),t(h)}}function zO(e,t,n){const r=this;return o;function o(l){return r.parser.lazy[r.now().line]?n(l):it(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):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)?o(l):n(l)}}const WO={name:"codeText",previous:$O,resolve:YO,tokenize:qO};function YO(e){let t=e.length-4,n=3,r,o;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;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function $O(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function qO(e,t,n){let r=0,o,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"),d(y))}function d(y){return y===null?n(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),d):y===96?(i=e.enter("codeTextSequence"),o=0,p(y)):it(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(y))}function h(y){return y===null||y===32||y===96||it(y)?(e.exit("codeTextData"),d(y)):(e.consume(y),h)}function p(y){return y===96?(e.consume(y),o++,p):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(y)):(i.type="codeTextData",h(y))}}class VO{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 o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Cl(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),Cl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Cl(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);Cl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Cl(this.left,n.reverse())}}}function Cl(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 tE(e){const t={};let n=-1,r,o,i,l,c,d,h;const p=new VO(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"&&(d=r[1]._tokenizer.events,i=0,i<d.length&&d[i][1].type==="lineEndingBlank"&&(i+=2),i<d.length&&d[i][1].type==="content"))for(;++i<d.length&&d[i][1].type!=="content";)d[i][1].type==="chunkText"&&(d[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,QO(p,n)),n=t[n],h=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(l=p.get(i),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(o&&(p.get(o)[1].type="lineEndingBlank"),l[1].type="lineEnding",o=i);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;o&&(r[1].end={...p.get(o)[1].start},c=p.slice(o,n),c.unshift(r),p.splice(o,n-o+1,c))}}return us(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function QO(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=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,d=[],h={};let p,y,b=-1,v=n,D=0,k=0;const E=[k];for(;v;){for(;e.get(++o)[1]!==v;);i.push(o),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;++b<c.length;)c[b][0]==="exit"&&c[b-1][0]==="enter"&&c[b][1].type===c[b-1][1].type&&c[b][1].start.line!==c[b][1].end.line&&(k=b+1,E.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):E.pop(),b=E.length;b--;){const T=c.slice(E[b],E[b+1]),C=i.pop();d.push([C,C+T.length-1]),e.splice(C,2,T)}for(d.reverse(),b=-1;++b<d.length;)h[D+d[b][0]]=D+d[b][1],D+=d[b][1]-d[b][0]-1;return h}const GO={resolve:XO,tokenize:JO},KO={partial:!0,tokenize:ZO};function XO(e){return tE(e),e}function JO(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(c)}function o(c){return c===null?i(c):it(c)?e.check(KO,l,i)(c):(e.consume(c),o)}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,o}}function ZO(e,t,n){const r=this;return o;function o(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 nE(e,t,n,r,o,i,l,c,d){const h=d||Number.POSITIVE_INFINITY;let p=0;return y;function y(T){return T===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(T),e.exit(i),b):T===null||T===32||T===41||$0(T)?n(T):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),k(T))}function b(T){return T===62?(e.enter(i),e.consume(T),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),v(T))}function v(T){return T===62?(e.exit("chunkString"),e.exit(c),b(T)):T===null||T===60||it(T)?n(T):(e.consume(T),T===92?D:v)}function D(T){return T===60||T===62||T===92?(e.consume(T),v):v(T)}function k(T){return!p&&(T===null||T===41||rr(T))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(T)):p<h&&T===40?(e.consume(T),p++,k):T===41?(e.consume(T),p--,k):T===null||T===32||T===40||$0(T)?n(T):(e.consume(T),T===92?E:k)}function E(T){return T===40||T===41||T===92?(e.consume(T),k):k(T)}}function rE(e,t,n,r,o,i){const l=this;let c=0,d;return h;function h(v){return e.enter(r),e.enter(o),e.consume(v),e.exit(o),e.enter(i),p}function p(v){return c>999||v===null||v===91||v===93&&!d||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(i),e.enter(o),e.consume(v),e.exit(o),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),d||(d=!St(v)),v===92?b:y)}function b(v){return v===91||v===92||v===93?(e.consume(v),c++,y):y(v)}}function sE(e,t,n,r,o,i){let l;return c;function c(b){return b===34||b===39||b===40?(e.enter(r),e.enter(o),e.consume(b),e.exit(o),l=b===40?41:b,d):n(b)}function d(b){return b===l?(e.enter(o),e.consume(b),e.exit(o),e.exit(r),t):(e.enter(i),h(b))}function h(b){return b===l?(e.exit(i),d(l)):b===null?n(b):it(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Ht(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===l||b===null||it(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?y:p)}function y(b){return b===l||b===92?(e.consume(b),p):p(b)}}function jl(e,t){let n;return r;function r(o){return it(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):St(o)?Ht(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const e6={name:"definition",tokenize:n6},t6={partial:!0,tokenize:r6};function n6(e,t,n){const r=this;let o;return i;function i(v){return e.enter("definition"),l(v)}function l(v){return rE.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return o=Ja(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),d):n(v)}function d(v){return rr(v)?jl(e,h)(v):h(v)}function h(v){return nE(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(t6,y,y)(v)}function y(v){return St(v)?Ht(e,b,"whitespace")(v):b(v)}function b(v){return v===null||it(v)?(e.exit("definition"),r.parser.defined.push(o),t(v)):n(v)}}function r6(e,t,n){return r;function r(c){return rr(c)?jl(e,o)(c):n(c)}function o(c){return sE(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 s6={name:"hardBreakEscape",tokenize:o6};function o6(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return it(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const a6={name:"headingAtx",resolve:i6,tokenize:l6};function i6(e,t){let n=e.length-2,r=3,o,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&&(o={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"},us(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function l6(e,t,n){let r=0;return o;function o(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"),d(p)):p===null||it(p)?(e.exit("atxHeading"),t(p)):St(p)?Ht(e,c,"whitespace")(p):(e.enter("atxHeadingText"),h(p))}function d(p){return p===35?(e.consume(p),d):(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 u6=["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"],Tb=["pre","script","style","textarea"],c6={concrete:!0,name:"htmlFlow",resolveTo:h6,tokenize:m6},d6={partial:!0,tokenize:y6},f6={partial:!0,tokenize:p6};function h6(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 m6(e,t,n){const r=this;let o,i,l,c,d;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),b):j===47?(e.consume(j),i=!0,k):j===63?(e.consume(j),o=3,r.interrupt?t:M):as(j)?(e.consume(j),l=String.fromCharCode(j),E):n(j)}function b(j){return j===45?(e.consume(j),o=2,v):j===91?(e.consume(j),o=5,c=0,D):as(j)?(e.consume(j),o=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 le="CDATA[";return j===le.charCodeAt(c++)?(e.consume(j),c===le.length?r.interrupt?t:H:D):n(j)}function k(j){return as(j)?(e.consume(j),l=String.fromCharCode(j),E):n(j)}function E(j){if(j===null||j===47||j===62||rr(j)){const le=j===47,he=l.toLowerCase();return!le&&!i&&Tb.includes(he)?(o=1,r.interrupt?t(j):H(j)):u6.includes(l.toLowerCase())?(o=6,le?(e.consume(j),T):r.interrupt?t(j):H(j)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):i?C(j):O(j))}return j===45||fr(j)?(e.consume(j),l+=String.fromCharCode(j),E):n(j)}function T(j){return j===62?(e.consume(j),r.interrupt?t:H):n(j)}function C(j){return St(j)?(e.consume(j),C):U(j)}function O(j){return j===47?(e.consume(j),U):j===58||j===95||as(j)?(e.consume(j),A):St(j)?(e.consume(j),O):U(j)}function A(j){return j===45||j===46||j===58||j===95||fr(j)?(e.consume(j),A):L(j)}function L(j){return j===61?(e.consume(j),_):St(j)?(e.consume(j),L):O(j)}function _(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),d=j,S):St(j)?(e.consume(j),_):I(j)}function S(j){return j===d?(e.consume(j),d=null,P):j===null||it(j)?n(j):(e.consume(j),S)}function I(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||rr(j)?L(j):(e.consume(j),I)}function P(j){return j===47||j===62||St(j)?O(j):n(j)}function U(j){return j===62?(e.consume(j),F):n(j)}function F(j){return j===null||it(j)?H(j):St(j)?(e.consume(j),F):n(j)}function H(j){return j===45&&o===2?(e.consume(j),ne):j===60&&o===1?(e.consume(j),me):j===62&&o===4?(e.consume(j),G):j===63&&o===3?(e.consume(j),M):j===93&&o===5?(e.consume(j),ce):it(j)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(d6,ae,W)(j)):j===null||it(j)?(e.exit("htmlFlowData"),W(j)):(e.consume(j),H)}function W(j){return e.check(f6,$,ae)(j)}function $(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),Q}function Q(j){return j===null||it(j)?W(j):(e.enter("htmlFlowData"),H(j))}function ne(j){return j===45?(e.consume(j),M):H(j)}function me(j){return j===47?(e.consume(j),l="",ee):H(j)}function ee(j){if(j===62){const le=l.toLowerCase();return Tb.includes(le)?(e.consume(j),G):H(j)}return as(j)&&l.length<8?(e.consume(j),l+=String.fromCharCode(j),ee):H(j)}function ce(j){return j===93?(e.consume(j),M):H(j)}function M(j){return j===62?(e.consume(j),G):j===45&&o===2?(e.consume(j),M):H(j)}function G(j){return j===null||it(j)?(e.exit("htmlFlowData"),ae(j)):(e.consume(j),G)}function ae(j){return e.exit("htmlFlow"),t(j)}}function p6(e,t,n){const r=this;return o;function o(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 y6(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ud,t,n)}}const g6={name:"htmlText",tokenize:b6};function b6(e,t,n){const r=this;let o,i,l;return c;function c(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),d}function d(M){return M===33?(e.consume(M),h):M===47?(e.consume(M),L):M===63?(e.consume(M),O):as(M)?(e.consume(M),I):n(M)}function h(M){return M===45?(e.consume(M),p):M===91?(e.consume(M),i=0,D):as(M)?(e.consume(M),C):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),b):it(M)?(l=y,me(M)):(e.consume(M),y)}function b(M){return M===45?(e.consume(M),v):y(M)}function v(M){return M===62?ne(M):M===45?b(M):y(M)}function D(M){const G="CDATA[";return M===G.charCodeAt(i++)?(e.consume(M),i===G.length?k:D):n(M)}function k(M){return M===null?n(M):M===93?(e.consume(M),E):it(M)?(l=k,me(M)):(e.consume(M),k)}function E(M){return M===93?(e.consume(M),T):k(M)}function T(M){return M===62?ne(M):M===93?(e.consume(M),T):k(M)}function C(M){return M===null||M===62?ne(M):it(M)?(l=C,me(M)):(e.consume(M),C)}function O(M){return M===null?n(M):M===63?(e.consume(M),A):it(M)?(l=O,me(M)):(e.consume(M),O)}function A(M){return M===62?ne(M):O(M)}function L(M){return as(M)?(e.consume(M),_):n(M)}function _(M){return M===45||fr(M)?(e.consume(M),_):S(M)}function S(M){return it(M)?(l=S,me(M)):St(M)?(e.consume(M),S):ne(M)}function I(M){return M===45||fr(M)?(e.consume(M),I):M===47||M===62||rr(M)?P(M):n(M)}function P(M){return M===47?(e.consume(M),ne):M===58||M===95||as(M)?(e.consume(M),U):it(M)?(l=P,me(M)):St(M)?(e.consume(M),P):ne(M)}function U(M){return M===45||M===46||M===58||M===95||fr(M)?(e.consume(M),U):F(M)}function F(M){return M===61?(e.consume(M),H):it(M)?(l=F,me(M)):St(M)?(e.consume(M),F):P(M)}function H(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),o=M,W):it(M)?(l=H,me(M)):St(M)?(e.consume(M),H):(e.consume(M),$)}function W(M){return M===o?(e.consume(M),o=void 0,Q):M===null?n(M):it(M)?(l=W,me(M)):(e.consume(M),W)}function $(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),$)}function Q(M){return M===47||M===62||rr(M)?P(M):n(M)}function ne(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function me(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),ee}function ee(M){return St(M)?Ht(e,ce,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):ce(M)}function ce(M){return e.enter("htmlTextData"),l(M)}}const Km={name:"labelEnd",resolveAll:T6,resolveTo:w6,tokenize:k6},x6={tokenize:S6},v6={tokenize:C6},E6={tokenize:_6};function T6(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 o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&us(e,0,e.length,n),e}function w6(e,t){let n=e.length,r=0,o,i,l,c;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(l=n);const d={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",d,t],["enter",h,t]],c=_r(c,e.slice(i+1,i+r+3)),c=_r(c,[["enter",p,t]]),c=_r(c,Gm(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),c=_r(c,[["exit",p,t],e[l-2],e[l-1],["exit",h,t]]),c=_r(c,e.slice(l+1)),c=_r(c,[["exit",d,t]]),us(e,i,e.length,c),e}function k6(e,t,n){const r=this;let o=r.events.length,i,l;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return c;function c(b){return i?i._inactive?y(b):(l=r.parser.defined.includes(Ja(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),d):n(b)}function d(b){return b===40?e.attempt(x6,p,l?p:y)(b):b===91?e.attempt(v6,p,l?h:y)(b):l?p(b):y(b)}function h(b){return e.attempt(E6,p,y)(b)}function p(b){return t(b)}function y(b){return i._balanced=!0,n(b)}}function S6(e,t,n){return r;function r(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),o}function o(y){return rr(y)?jl(e,i)(y):i(y)}function i(y){return y===41?p(y):nE(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function l(y){return rr(y)?jl(e,d)(y):p(y)}function c(y){return n(y)}function d(y){return y===34||y===39||y===40?sE(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):p(y)}function h(y){return rr(y)?jl(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 C6(e,t,n){const r=this;return o;function o(c){return rE.call(r,e,i,l,"reference","referenceMarker","referenceString")(c)}function i(c){return r.parser.defined.includes(Ja(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function _6(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const N6={name:"labelStartImage",resolveAll:Km.resolveAll,tokenize:D6};function D6(e,t,n){const r=this;return o;function o(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 O6={name:"labelStartLink",resolveAll:Km.resolveAll,tokenize:A6};function A6(e,t,n){const r=this;return o;function o(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 t0={name:"lineEnding",tokenize:I6};function I6(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ht(e,t,"linePrefix")}}const Wc={name:"thematicBreak",tokenize:M6};function M6(e,t,n){let r=0,o;return i;function i(h){return e.enter("thematicBreak"),l(h)}function l(h){return o=h,c(h)}function c(h){return h===o?(e.enter("thematicBreakSequence"),d(h)):r>=3&&(h===null||it(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===o?(e.consume(h),r++,d):(e.exit("thematicBreakSequence"),St(h)?Ht(e,c,"whitespace")(h):c(h))}}const Zn={continuation:{tokenize:j6},exit:B6,name:"list",tokenize:P6},L6={partial:!0,tokenize:H6},R6={partial:!0,tokenize:F6};function P6(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[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:q0(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(Wc,n,h)(v):h(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return n(v)}function d(v){return q0(v)&&++l<10?(e.consume(v),d):(!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(Ud,r.interrupt?n:p,e.attempt(L6,b,y))}function p(v){return r.containerState.initialBlankLine=!0,i++,b(v)}function y(v){return St(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),b):n(v)}function b(v){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function j6(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ud,o,i);function o(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(R6,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ht(e,e.attempt(Zn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function F6(e,t,n){const r=this;return Ht(e,o,"listItemIndent",r.containerState.size+1);function o(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 B6(e){e.exit(this.containerState.type)}function H6(e,t,n){const r=this;return Ht(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const l=r.events[r.events.length-1];return!St(i)&&l&&l[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const wb={name:"setextUnderline",resolveTo:U6,tokenize:z6};function U6(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=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[o][1].type="setextHeadingText",i?(e.splice(o,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 z6(e,t,n){const r=this;let o;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"),o=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===o?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),St(h)?Ht(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||it(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const W6={tokenize:Y6};function Y6(e){const t=this,n=e.attempt(Ud,r,e.attempt(this.parser.constructs.flowInitial,o,Ht(e,e.attempt(this.parser.constructs.flow,o,e.attempt(GO,o)),"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 o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const $6={resolveAll:aE()},q6=oE("string"),V6=oE("text");function oE(e){return{resolveAll:aE(e==="text"?Q6:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,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),d}function d(p){return h(p)?(n.exit("data"),i(p)):(n.consume(p),d)}function h(p){if(p===null)return!0;const y=o[p];let b=-1;if(y)for(;++b<y.length;){const v=y[b];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function aE(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function Q6(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],o=t.sliceStream(r);let i=o.length,l=-1,c=0,d;for(;i--;){const h=o[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)d=!0,c++;else if(h!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const h={type:n===e.length||d||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 G6={42:Zn,43:Zn,45:Zn,48:Zn,49:Zn,50:Zn,51:Zn,52:Zn,53:Zn,54:Zn,55:Zn,56:Zn,57:Zn,62:Jv},K6={91:e6},X6={[-2]:e0,[-1]:e0,32:e0},J6={35:a6,42:Wc,45:[wb,Wc],60:c6,61:wb,95:Wc,96:Eb,126:Eb},Z6={38:eE,92:Zv},eA={[-5]:t0,[-4]:t0,[-3]:t0,33:N6,38:eE,42:V0,60:[OO,g6],91:O6,92:[s6,Zv],93:Km,95:V0,96:WO},tA={null:[V0,$6]},nA={null:[42,95]},rA={null:[]},sA=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:nA,contentInitial:K6,disable:rA,document:G6,flow:J6,flowInitial:X6,insideSpan:tA,string:Z6,text:eA},Symbol.toStringTag,{value:"Module"}));function oA(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 o={},i=[];let l=[],c=[];const d={attempt:S(L),check:S(_),consume:C,enter:O,exit:A,interrupt:S(_,{interrupt:!0})},h={code:null,containerState:{},defineSkip:k,events:[],now:D,parser:e,previous:null,sliceSerialize:b,sliceStream:v,write:y};let p=t.tokenize.call(h,d);return t.resolveAll&&i.push(t),h;function y(F){return l=_r(l,F),E(),l[l.length-1]!==null?[]:(I(t,0),h.events=Gm(i,h.events,h),h.events)}function b(F,H){return iA(v(F),H)}function v(F){return aA(l,F)}function D(){const{_bufferIndex:F,_index:H,line:W,column:$,offset:Q}=r;return{_bufferIndex:F,_index:H,line:W,column:$,offset:Q}}function k(F){o[F.line]=F.column,U()}function E(){let F;for(;r._index<l.length;){const H=l[r._index];if(typeof H=="string")for(F=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===F&&r._bufferIndex<H.length;)T(H.charCodeAt(r._bufferIndex));else T(H)}}function T(F){p=p(F)}function C(F){it(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,U()):F!==-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=F}function O(F,H){const W=H||{};return W.type=F,W.start=D(),h.events.push(["enter",W,h]),c.push(W),W}function A(F){const H=c.pop();return H.end=D(),h.events.push(["exit",H,h]),H}function L(F,H){I(F,H.from)}function _(F,H){H.restore()}function S(F,H){return W;function W($,Q,ne){let me,ee,ce,M;return Array.isArray($)?ae($):"tokenize"in $?ae([$]):G($);function G(pe){return Oe;function Oe(oe){const fe=oe!==null&&pe[oe],_e=oe!==null&&pe.null,Ee=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(_e)?_e:_e?[_e]:[]];return ae(Ee)(oe)}}function ae(pe){return me=pe,ee=0,pe.length===0?ne:j(pe[ee])}function j(pe){return Oe;function Oe(oe){return M=P(),ce=pe,pe.partial||(h.currentConstruct=pe),pe.name&&h.parser.constructs.disable.null.includes(pe.name)?he():pe.tokenize.call(H?Object.assign(Object.create(h),H):h,d,le,he)(oe)}}function le(pe){return F(ce,M),Q}function he(pe){return M.restore(),++ee<me.length?j(me[ee]):ne}}}function I(F,H){F.resolveAll&&!i.includes(F)&&i.push(F),F.resolve&&us(h.events,H,h.events.length-H,F.resolve(h.events.slice(H),h)),F.resolveTo&&(h.events=F.resolveTo(h.events,h))}function P(){const F=D(),H=h.previous,W=h.currentConstruct,$=h.events.length,Q=Array.from(c);return{from:$,restore:ne};function ne(){r=F,h.previous=H,h.currentConstruct=W,h.events.length=$,c=Q,U()}}function U(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function aA(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(r,i)];else{if(l=e.slice(n,o),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}i>0&&l.push(e[o].slice(0,i))}return l}function iA(e,t){let n=-1;const r=[];let o;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=`
110
+ `;break}case-3:{l=`\r
111
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(i)}o=i===-2,r.push(l)}return r.join("")}function lA(e){const r={constructs:pO([sA,...(e||{}).extensions||[]]),content:o(wO),defined:[],document:o(SO),flow:o(W6),lazy:{},string:o(q6),text:o(V6)};return r;function o(i){return l;function l(c){return oA(r,i,c)}}}function uA(e){for(;!tE(e););return e}const kb=/[\0\t\n\r]/g;function cA(){let e=1,t="",n=!0,r;return o;function o(i,l,c){const d=[];let h,p,y,b,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(kb.lastIndex=y,h=kb.exec(i),b=h&&h.index!==void 0?h.index:i.length,v=i.charCodeAt(b),!h){t=i.slice(y);break}if(v===10&&y===b&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),y<b&&(d.push(i.slice(y,b)),e+=b-y),v){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}y=b+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const dA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fA(e){return e.replace(dA,hA)}function hA(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return Xv(n.slice(i?2:1),i?16:10)}return Qm(n)||e}const iE={}.hasOwnProperty;function mA(e,t,n){return typeof t!="string"&&(n=t,t=void 0),pA(n)(uA(lA(n).document().write(cA()(e,t,!0))))}function pA(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(se),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(Je),blockQuote:i(_e),characterEscape:P,characterReference:P,codeFenced:i(Ee),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(Ee,l),codeText:i(Fe,l),codeTextData:P,data:P,codeFlowValue:P,definition:i($e),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(st),hardBreakEscape:i(tt),hardBreakTrailing:i(tt),htmlFlow:i(Te,l),htmlFlowData:P,htmlText:i(Te,l),htmlTextData:P,image:i(Re),label:l,link:i(se),listItem:i(ge),listItemValue:b,listOrdered:i(te,y),listUnordered:i(te),paragraph:i(Ne),reference:j,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(Je),strong:i(qe),thematicBreak:i(yt)},exit:{atxHeading:d(),atxHeadingSequence:L,autolink:d(),autolinkEmail:fe,autolinkProtocol:oe,blockQuote:d(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:pe,characterReference:Oe,codeFenced:d(E),codeFencedFence:k,codeFencedFenceInfo:v,codeFencedFenceMeta:D,codeFlowValue:U,codeIndented:d(T),codeText:d(Q),codeTextData:U,data:U,definition:d(),definitionDestinationString:A,definitionLabelString:C,definitionTitleString:O,emphasis:d(),hardBreakEscape:d(H),hardBreakTrailing:d(H),htmlFlow:d(W),htmlFlowData:U,htmlText:d($),htmlTextData:U,image:d(me),label:ce,labelText:ee,lineEnding:F,link:d(ne),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:le,resourceDestinationString:M,resourceTitleString:G,resource:ae,setextHeading:d(I),setextHeadingLineSequence:S,setextHeadingText:_,strong:d(),thematicBreak:d()}};lE(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ie){let ye={type:"root",children:[]};const Me={stack:[ye],tokenStack:[],config:t,enter:c,exit:h,buffer:l,resume:p,data:n},nt=[];let ot=-1;for(;++ot<ie.length;)if(ie[ot][1].type==="listOrdered"||ie[ot][1].type==="listUnordered")if(ie[ot][0]==="enter")nt.push(ot);else{const gt=nt.pop();ot=o(ie,gt,ot)}for(ot=-1;++ot<ie.length;){const gt=t[ie[ot][0]];iE.call(gt,ie[ot][1].type)&&gt[ie[ot][1].type].call(Object.assign({sliceSerialize:ie[ot][2].sliceSerialize},Me),ie[ot][1])}if(Me.tokenStack.length>0){const gt=Me.tokenStack[Me.tokenStack.length-1];(gt[1]||Sb).call(Me,void 0,gt[0])}for(ye.position={start:oo(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:oo(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},ot=-1;++ot<t.transforms.length;)ye=t.transforms[ot](ye)||ye;return ye}function o(ie,ye,Me){let nt=ye-1,ot=-1,gt=!1,Zt,hn,Dn,Yn;for(;++nt<=Me;){const Wt=ie[nt];switch(Wt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Wt[0]==="enter"?ot++:ot--,Yn=void 0;break}case"lineEndingBlank":{Wt[0]==="enter"&&(Zt&&!Yn&&!ot&&!Dn&&(Dn=nt),Yn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Yn=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=nt;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",gt=!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||nt,0,["exit",Zt,Wt[2]]),nt++,Me++}if(Wt[1].type==="listItemPrefix"){const It={type:"listItem",_spread:!1,start:Object.assign({},Wt[1].start),end:void 0};Zt=It,ie.splice(nt,0,["enter",It,Wt[2]]),nt++,Me++,Dn=void 0,Yn=!0}}}return ie[ye][1]._spread=gt,Me}function i(ie,ye){return Me;function Me(nt){c.call(this,ie(nt),nt),ye&&ye.call(this,nt)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(ie,ye,Me){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([ye,Me||void 0]),ie.position={start:oo(ye.start),end:void 0}}function d(ie){return ye;function ye(Me){ie&&ie.call(this,Me),h.call(this,Me)}}function h(ie,ye){const Me=this.stack.pop(),nt=this.tokenStack.pop();if(nt)nt[0].type!==ie.type&&(ye?ye.call(this,ie,nt[0]):(nt[1]||Sb).call(this,ie,nt[0]));else throw new Error("Cannot close `"+ie.type+"` ("+Pl({start:ie.start,end:ie.end})+"): it’s not open");Me.position.end=oo(ie.end)}function p(){return hO(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function b(ie){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=ie}function D(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=ie}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ie.replace(/(\r?\n|\r)$/g,"")}function C(ie){const ye=this.resume(),Me=this.stack[this.stack.length-1];Me.label=ye,Me.identifier=Ja(this.sliceSerialize(ie)).toLowerCase()}function O(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ie}function A(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ie}function L(ie){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Me=this.sliceSerialize(ie).length;ye.depth=Me}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function S(ie){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function P(ie){const Me=this.stack[this.stack.length-1].children;let nt=Me[Me.length-1];(!nt||nt.type!=="text")&&(nt=pt(),nt.position={start:oo(ie.start),end:void 0},Me.push(nt)),this.stack.push(nt)}function U(ie){const ye=this.stack.pop();ye.value+=this.sliceSerialize(ie),ye.position.end=oo(ie.end)}function F(ie){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=ye.children[ye.children.length-1];Me.position.end=oo(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(P.call(this,ie),U.call(this,ie))}function H(){this.data.atHardBreak=!0}function W(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ie}function $(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ie}function Q(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ie}function ne(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ye,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function me(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ye,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function ee(ie){const ye=this.sliceSerialize(ie),Me=this.stack[this.stack.length-2];Me.label=fA(ye),Me.identifier=Ja(ye).toLowerCase()}function ce(){const ie=this.stack[this.stack.length-1],ye=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const nt=ie.children;Me.children=nt}else Me.alt=ye}function M(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ie}function G(){const ie=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ie}function ae(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function le(ie){const ye=this.resume(),Me=this.stack[this.stack.length-1];Me.label=ye,Me.identifier=Ja(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function he(ie){this.data.characterReferenceType=ie.type}function pe(ie){const ye=this.sliceSerialize(ie),Me=this.data.characterReferenceType;let nt;Me?(nt=Xv(ye,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):nt=Qm(ye);const ot=this.stack[this.stack.length-1];ot.value+=nt}function Oe(ie){const ye=this.stack.pop();ye.position.end=oo(ie.end)}function oe(ie){U.call(this,ie);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(ie)}function fe(ie){U.call(this,ie);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(ie)}function _e(){return{type:"blockquote",children:[]}}function Ee(){return{type:"code",lang:null,meta:null,value:""}}function Fe(){return{type:"inlineCode",value:""}}function $e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function st(){return{type:"emphasis",children:[]}}function Je(){return{type:"heading",depth:0,children:[]}}function tt(){return{type:"break"}}function Te(){return{type:"html",value:""}}function Re(){return{type:"image",title:null,url:"",alt:null}}function se(){return{type:"link",title:null,url:"",children:[]}}function te(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function ge(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function Ne(){return{type:"paragraph",children:[]}}function qe(){return{type:"strong",children:[]}}function pt(){return{type:"text",value:""}}function yt(){return{type:"thematicBreak"}}}function oo(e){return{line:e.line,column:e.column,offset:e.offset}}function lE(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?lE(e,r):yA(e,r)}}function yA(e,t){let n;for(n in t)if(iE.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 Sb(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Pl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Pl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Pl({start:t.start,end:t.end})+") is still open")}function gA(e){const t=this;t.parser=n;function n(r){return mA(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function bA(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 xA(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
112
+ `}]}function vA(e,t){const n=t.value?t.value+`
113
+ `:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[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 EA(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TA(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wA(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Ni(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 d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function kA(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 SA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function uE(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 o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&l.type==="text"?l.value+=r:o.push({type:"text",value:r}),o}function CA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return uE(e,t);const o={src:Ni(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function _A(e,t){const n={src:Ni(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 NA(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 DA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return uE(e,t);const o={href:Ni(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function OA(e,t){const n={href:Ni(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 AA(e,t,n){const r=e.all(t),o=n?IA(n):cE(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];(o||c!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
114
+ `}),p.type==="element"&&p.tagName==="p"&&!o?l.push(...p.children):l.push(p)}const d=r[r.length-1];d&&(o||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
115
+ `});const h={type:"element",tagName:"li",properties:i,children:l};return e.patch(t,h),e.applyData(t,h)}function IA(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=cE(n[r])}return t}function cE(e){const t=e.spread;return t??e.children.length>1}function MA(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const l=r[o];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 LA(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RA(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function PA(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jA(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),o.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=fs(t.children[1]),d=Hd(t.children[t.children.length-1]);c&&d&&(l.position={start:c,end:d}),o.push(l)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function FA(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 d=-1;const h=[];for(;++d<c;){const y=t.children[d],b={},v=l?l[d]:void 0;v&&(b.align=v);let D={type:"element",tagName:i,properties:b,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 BA(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Cb=9,_b=32;function HA(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(Nb(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(Nb(t.slice(o),o>0,!1)),i.join("")}function Nb(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===Cb||i===_b;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===Cb||i===_b;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function UA(e,t){const n={type:"text",value:HA(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function zA(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const WA={blockquote:bA,break:xA,code:vA,delete:EA,emphasis:TA,footnoteReference:wA,heading:kA,html:SA,imageReference:CA,image:_A,inlineCode:NA,linkReference:DA,link:OA,listItem:AA,list:MA,paragraph:LA,root:RA,strong:PA,table:jA,tableCell:BA,tableRow:FA,text:UA,thematicBreak:zA,toml:Rc,yaml:Rc,definition:Rc,footnoteDefinition:Rc};function Rc(){}const dE=-1,zd=0,Fl=1,id=2,Xm=3,Jm=4,Zm=5,ep=6,fE=7,hE=8,Db=typeof self=="object"?self:globalThis,YA=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,l]=t[o];switch(i){case zd:case dE:return n(l,o);case Fl:{const c=n([],o);for(const d of l)c.push(r(d));return c}case id:{const c=n({},o);for(const[d,h]of l)c[r(d)]=r(h);return c}case Xm:return n(new Date(l),o);case Jm:{const{source:c,flags:d}=l;return n(new RegExp(c,d),o)}case Zm:{const c=n(new Map,o);for(const[d,h]of l)c.set(r(d),r(h));return c}case ep:{const c=n(new Set,o);for(const d of l)c.add(r(d));return c}case fE:{const{name:c,message:d}=l;return n(new Db[c](d),o)}case hE:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);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 Db[i](l),o)};return r},Ob=e=>YA(new Map,e)(0),Va="",{toString:$A}={},{keys:qA}=Object,_l=e=>{const t=typeof e;if(t!=="object"||!e)return[zd,t];const n=$A.call(e).slice(8,-1);switch(n){case"Array":return[Fl,Va];case"Object":return[id,Va];case"Date":return[Xm,Va];case"RegExp":return[Jm,Va];case"Map":return[Zm,Va];case"Set":return[ep,Va];case"DataView":return[Fl,n]}return n.includes("Array")?[Fl,n]:n.includes("Error")?[fE,n]:[id,n]},Pc=([e,t])=>e===zd&&(t==="function"||t==="symbol"),VA=(e,t,n,r)=>{const o=(l,c)=>{const d=r.push(l)-1;return n.set(c,d),d},i=l=>{if(n.has(l))return n.get(l);let[c,d]=_l(l);switch(c){case zd:{let p=l;switch(d){case"bigint":c=hE,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return o([dE],l)}return o([c,p],l)}case Fl:{if(d){let b=l;return d==="DataView"?b=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(b=new Uint8Array(l)),o([d,[...b]],l)}const p=[],y=o([c,p],l);for(const b of l)p.push(i(b));return y}case id:{if(d)switch(d){case"BigInt":return o([d,l.toString()],l);case"Boolean":case"Number":case"String":return o([d,l.valueOf()],l)}if(t&&"toJSON"in l)return i(l.toJSON());const p=[],y=o([c,p],l);for(const b of qA(l))(e||!Pc(_l(l[b])))&&p.push([i(b),i(l[b])]);return y}case Xm:return o([c,l.toISOString()],l);case Jm:{const{source:p,flags:y}=l;return o([c,{source:p,flags:y}],l)}case Zm:{const p=[],y=o([c,p],l);for(const[b,v]of l)(e||!(Pc(_l(b))||Pc(_l(v))))&&p.push([i(b),i(v)]);return y}case ep:{const p=[],y=o([c,p],l);for(const b of l)(e||!Pc(_l(b)))&&p.push(i(b));return y}}const{message:h}=l;return o([c,{name:d,message:h}],l)};return i},Ab=(e,{json:t,lossy:n}={})=>{const r=[];return VA(!(t||n),!!t,new Map,r)(e),r},bi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ob(Ab(e,t)):structuredClone(e):(e,t)=>Ob(Ab(e,t));function QA(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 GA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function KA(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||QA,r=e.options.footnoteBackLabel||GA,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[d]);if(!h)continue;const p=e.all(h),y=String(h.identifier).toUpperCase(),b=Ni(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 C=typeof n=="string"?n:n(d,v);typeof C=="string"&&(C={type:"text",value:C}),D.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,v),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const E=p[p.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const C=E.children[E.children.length-1];C&&C.type==="text"?C.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...D)}else p.push(...D);const T={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(p,!0)};e.patch(h,T),c.push(T)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...bi(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
116
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
117
+ `}]}}const mE=(function(e){if(e==null)return e5;if(typeof e=="function")return Wd(e);if(typeof e=="object")return Array.isArray(e)?XA(e):JA(e);if(typeof e=="string")return ZA(e);throw new Error("Expected function, string, or object as test")});function XA(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=mE(e[n]);return Wd(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function JA(e){const t=e;return Wd(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function ZA(e){return Wd(t);function t(n){return n&&n.type===e}}function Wd(e){return t;function t(n,r,o){return!!(t5(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function e5(){return!0}function t5(e){return e!==null&&typeof e=="object"&&"type"in e}const pE=[],n5=!0,Ib=!1,r5="skip";function s5(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=mE(o),l=r?-1:1;c(e,void 0,[])();function c(d,h,p){const y=d&&typeof d=="object"?d:{};if(typeof y.type=="string"){const v=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return b;function b(){let v=pE,D,k,E;if((!t||i(d,h,p[p.length-1]||void 0))&&(v=o5(n(d,p)),v[0]===Ib))return v;if("children"in d&&d.children){const T=d;if(T.children&&v[0]!==r5)for(k=(r?T.children.length:-1)+l,E=p.concat(T);k>-1&&k<T.children.length;){const C=T.children[k];if(D=c(C,k,E)(),D[0]===Ib)return D;k=typeof D[1]=="number"?D[1]:k+l}}return v}}}function o5(e){return Array.isArray(e)?e:typeof e=="number"?[n5,e]:e==null?pE:[e]}function tp(e,t,n,r){let o,i,l;typeof t=="function"&&typeof n!="function"?(i=void 0,l=t,o=n):(i=t,l=n,o=r),s5(e,i,c,o);function c(d,h){const p=h[h.length-1],y=p?p.children.indexOf(d):void 0;return l(d,y,p)}}const Q0={}.hasOwnProperty,a5={};function i5(e,t){const n=t||a5,r=new Map,o=new Map,i=new Map,l={...WA,...n.handlers},c={all:h,applyData:u5,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:l,one:d,options:n,patch:l5,wrap:d5};return tp(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const y=p.type==="definition"?r:o,b=String(p.identifier).toUpperCase();y.has(b)||y.set(b,p)}}),c;function d(p,y){const b=p.type,v=c.handlers[b];if(Q0.call(c.handlers,b)&&v)return v(c,p,y);if(c.options.passThrough&&c.options.passThrough.includes(b)){if("children"in p){const{children:k,...E}=p,T=bi(E);return T.children=c.all(p),T}return bi(p)}return(c.options.unknownHandler||c5)(c,p,y)}function h(p){const y=[];if("children"in p){const b=p.children;let v=-1;for(;++v<b.length;){const D=c.one(b[v],p);if(D){if(v&&b[v-1].type==="break"&&(!Array.isArray(D)&&D.type==="text"&&(D.value=Mb(D.value)),!Array.isArray(D)&&D.type==="element")){const k=D.children[0];k&&k.type==="text"&&(k.value=Mb(k.value))}Array.isArray(D)?y.push(...D):y.push(D)}}}return y}}function l5(e,t){e.position&&(t.position=$D(e))}function u5(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&i&&Object.assign(n.properties,bi(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function c5(e,t){const n=t.data||{},r="value"in t&&!(Q0.call(n,"hProperties")||Q0.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 d5(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
118
+ `});++r<e.length;)r&&n.push({type:"text",value:`
119
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
120
+ `}),n}function Mb(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Lb(e,t){const n=i5(e,t),r=n.one(e,void 0),o=KA(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
121
+ `},o),i}function f5(e,t){return e&&"run"in e?async function(n,r){const o=Lb(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Lb(n,{file:r,...e||t})}}function Rb(e){if(e)throw e}var n0,Pb;function h5(){if(Pb)return n0;Pb=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=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 b;for(b in h);return typeof b>"u"||e.call(h,b)},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 n0=function d(){var h,p,y,b,v,D,k=arguments[0],E=1,T=arguments.length,C=!1;for(typeof k=="boolean"&&(C=k,k=arguments[1]||{},E=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});E<T;++E)if(h=arguments[E],h!=null)for(p in h)y=c(k,p),b=c(h,p),k!==b&&(C&&b&&(i(b)||(v=o(b)))?(v?(v=!1,D=y&&o(y)?y:[]):D=y&&i(y)?y:{},l(k,{name:p,newValue:d(C,D,b)})):typeof b<"u"&&l(k,{name:p,newValue:b}));return k},n0}var m5=h5();const r0=xx(m5);function G0(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 p5(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const l=o.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...o);function c(d,...h){const p=e[++i];let y=-1;if(d){l(d);return}for(;++y<o.length;)(h[y]===null||h[y]===void 0)&&(h[y]=o[y]);o=h,p?y5(p,c)(...h):l(null,...h)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function y5(e,t){let n;return r;function r(...l){const c=e.length>l.length;let d;c&&l.push(o);try{d=e.apply(this,l)}catch(h){const p=h;if(c&&n)throw p;return o(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(i,o):d instanceof Error?o(d):i(d))}function o(l,...c){n||(n=!0,t(l,...c))}function i(l){o(null,l)}}const Zr={basename:g5,dirname:b5,extname:x5,join:v5,sep:"/"};function g5(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');fu(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else l<0&&(i=!0,l=o+1),c>-1&&(e.codePointAt(o)===t.codePointAt(c--)?c<0&&(r=o):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function b5(e){if(fu(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 x5(e){fu(e);let t=e.length,n=-1,r=0,o=-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?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function v5(...e){let t=-1,n;for(;++t<e.length;)fu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":E5(n)}function E5(e){fu(e);const t=e.codePointAt(0)===47;let n=T5(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function T5(e,t){let n="",r=0,o=-1,i=0,l=-1,c,d;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(o===l-1||i===1))if(o!==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(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),o=l,i=0;continue}}else if(n.length>0){n="",r=0,o=l,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),r=l-o-1;o=l,i=0}else c===46&&i>-1?i++:i=-1}return n}function fu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const w5={cwd:k5};function k5(){return"/"}function K0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function S5(e){if(typeof e=="string")e=new URL(e);else if(!K0(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 C5(e)}function C5(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 o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const s0=["history","path","basename","stem","extname","dirname"];class yE{constructor(t){let n;t?K0(t)?n={path:t}:typeof t=="string"||_5(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":w5.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<s0.length;){const i=s0[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)s0.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?Zr.basename(this.path):void 0}set basename(t){a0(t,"basename"),o0(t,"basename"),this.path=Zr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Zr.dirname(this.path):void 0}set dirname(t){jb(this.basename,"dirname"),this.path=Zr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Zr.extname(this.path):void 0}set extname(t){if(o0(t,"extname"),jb(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=Zr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){K0(t)&&(t=S5(t)),a0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Zr.basename(this.path,this.extname):void 0}set stem(t){a0(t,"stem"),o0(t,"stem"),this.path=Zr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Fn(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function o0(e,t){if(e&&e.includes(Zr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Zr.sep+"`")}function a0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function jb(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function _5(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const N5=(function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),D5={}.hasOwnProperty;class np extends N5{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=p5()}copy(){const t=new np;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(r0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(u0("data",this.frozen),this.namespace[t]=n,this):D5.call(this.namespace,t)&&this.namespace[t]||void 0:t?(u0("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 o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=jc(t),r=this.parser||this.Parser;return i0("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),i0("process",this.parser||this.Parser),l0("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,l){const c=jc(t),d=r.parse(c);r.run(d,c,function(p,y,b){if(p||!y||!b)return h(p);const v=y,D=r.stringify(v,b);I5(D)?b.value=D:b.result=D,h(p,b)});function h(p,y){p||!y?l(p):i?i(y):n(void 0,y)}}}processSync(t){let n=!1,r;return this.freeze(),i0("processSync",this.parser||this.Parser),l0("processSync",this.compiler||this.Compiler),this.process(t,o),Bb("processSync","process",n),r;function o(i,l){n=!0,Rb(i),r=l}}run(t,n,r){Fb(t),this.freeze();const o=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 d=jc(n);o.run(t,d,h);function h(p,y,b){const v=y||t;p?c(p):l?l(v):r(void 0,v,b)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),Bb("runSync","run",r),o;function i(l,c){Rb(l),o=c,r=!0}}stringify(t,n){this.freeze();const r=jc(n),o=this.compiler||this.Compiler;return l0("stringify",o),Fb(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(u0("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[p,...y]=h;d(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&&(o.settings=r0(!0,o.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 d(h,p){let y=-1,b=-1;for(;++y<r.length;)if(r[y][0]===h){b=y;break}if(b===-1)r.push([h,...p]);else if(p.length>0){let[v,...D]=p;const k=r[b][1];G0(k)&&G0(v)&&(v=r0(!0,k,v)),r[b]=[h,v,...D]}}}}const O5=new np().freeze();function i0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function l0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function u0(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 Fb(e){if(!G0(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Bb(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function jc(e){return A5(e)?e:new yE(e)}function A5(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function I5(e){return typeof e=="string"||M5(e)}function M5(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const L5="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Hb=[],Ub={allowDangerousHtml:!0},R5=/^(https?|ircs?|mailto|xmpp)$/i,P5=[{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 j5(e){const t=F5(e),n=B5(e);return H5(t.runSync(t.parse(n),n),e)}function F5(e){const t=e.rehypePlugins||Hb,n=e.remarkPlugins||Hb,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ub}:Ub;return O5().use(gA).use(n).use(f5,r).use(t)}function B5(e){const t=e.children||"",n=new yE;return typeof t=="string"&&(n.value=t),n}function H5(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||U5;for(const p of P5)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+L5+p.id,void 0);return tp(e,h),KD(e,{Fragment:f.Fragment,components:o,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function h(p,y,b){if(p.type==="raw"&&b&&typeof y=="number")return l?b.children.splice(y,1):b.children[y]={type:"text",value:p.value},y;if(p.type==="element"){let v;for(v in Zh)if(Object.hasOwn(Zh,v)&&Object.hasOwn(p.properties,v)){const D=p.properties[v],k=Zh[v];(k===null||k.includes(p.tagName))&&(p.properties[v]=d(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,b)),v&&b&&typeof y=="number")return c&&p.children?b.children.splice(y,1,...p.children):b.children.splice(y,1),y}}}function U5(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||R5.test(e.slice(0,t))?e:""}const zb=/[#.]/g;function z5(e,t){const n=e||"",r={};let o=0,i,l;for(;o<n.length;){zb.lastIndex=o;const c=zb.exec(n),d=n.slice(o,c?c.index:n.length);d&&(i?i==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:l=d,o+=d.length),c&&(i=c[0],o++)}return{type:"element",tagName:l||t||"div",properties:r,children:[]}}function gE(e,t,n){const r=n?q5(n):void 0;function o(i,l,...c){let d;if(i==null){d={type:"root",children:[]};const h=l;c.unshift(h)}else{d=z5(i,t);const h=d.tagName.toLowerCase(),p=r?r.get(h):void 0;if(d.tagName=p||h,W5(l))c.unshift(l);else for(const[y,b]of Object.entries(l))Y5(e,d.properties,y,b)}for(const h of c)X0(d.children,h);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return o}function W5(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 o=t[r];if(o&&typeof o=="object"){if(!Array.isArray(o))return!0;const i=o;for(const l of i)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function Y5(e,t,n,r){const o=Bd(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"?o.spaceSeparated?i=ib(r):o.commaSeparated?i=nb(r):o.commaOrSpaceSeparated?i=ib(nb(r).join(" ")):i=Wb(o,o.property,r):Array.isArray(r)?i=[...r]:i=o.property==="style"?$5(r):String(r);if(Array.isArray(i)){const l=[];for(const c of i)l.push(Wb(o,o.property,c));i=l}o.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[o.property]=i}}function X0(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)X0(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?X0(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Wb(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Vl(n)===Vl(t)))return!0}return n}function $5(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function q5(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const V5=["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"],Q5=gE(du,"div"),G5=gE(Co,"g",V5);function K5(e){const t=String(e),n=[];return{toOffset:o,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 d=Yb(t,n[l-1]);c=d===-1?t.length+1:d+1,n[l]=c}if(c>i)return{line:l+1,column:i-(l>0?n[l-1]:0)+1,offset:i};l++}}}function o(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],d=Yb(t,c),h=d===-1?t.length+1:d+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 Yb(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
122
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Qo={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/"},bE={}.hasOwnProperty,X5=Object.prototype;function J5(e,t){const n=t||{};return rp({file:n.file||void 0,location:!1,schema:n.space==="svg"?Co:du,verbose:n.verbose||!1},e)}function rp(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Yc(e,r,n),n}case"#document":case"#document-fragment":{const r=t,o="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:xE(e,t.childNodes),data:{quirksMode:o}},e.file&&e.location){const i=String(e.file),l=K5(i),c=l.toPoint(0),d=l.toPoint(i.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Yc(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Yc(e,r,n),n}default:return n=Z5(e,t),n}}function xE(e,t){let n=-1;const r=[];for(;++n<t.length;){const o=rp(e,t[n]);r.push(o)}return r}function Z5(e,t){const n=e.schema;e.schema=t.namespaceURI===Qo.svg?Co:du;let r=-1;const o={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;bE.call(X5,d)||(o[d]=c.value)}const l=(e.schema.space==="svg"?G5:Q5)(t.tagName,o,xE(e,t.childNodes));if(Yc(e,t,l),l.tagName==="template"){const c=t,d=c.sourceCodeLocation,h=d&&d.startTag&&Ga(d.startTag),p=d&&d.endTag&&Ga(d.endTag),y=rp(e,c.content);h&&p&&e.file&&(y.position={start:h.end,end:p.start}),l.content=y}return e.schema=n,l}function Yc(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=eI(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function eI(e,t,n){const r=Ga(n);if(t.type==="element"){const o=t.children[t.children.length-1];if(r&&!n.endTag&&o&&o.position&&o.position.end&&(r.end=Object.assign({},o.position.end)),e.verbose){const i={};let l;if(n.attrs)for(l in n.attrs)bE.call(n.attrs,l)&&(i[Bd(e.schema,l).property]=Ga(n.attrs[l]));n.startTag;const c=Ga(n.startTag),d=n.endTag?Ga(n.endTag):void 0,h={opening:c};d&&(h.closing=d),h.properties=i,t.data={position:h}}}return r}function Ga(e){const t=$b({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=$b({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function $b(e){return e.line&&e.column?e:void 0}const qb={}.hasOwnProperty;function vE(e,t){const n=t||{};function r(o,...i){let l=r.invalid;const c=r.handlers;if(o&&qb.call(o,e)){const d=String(o[e]);l=qb.call(c,d)?c[d]:r.unknown}if(l)return l.call(this,o,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const tI={},nI={}.hasOwnProperty,EE=vE("type",{handlers:{root:sI,element:uI,text:iI,comment:lI,doctype:aI}});function rI(e,t){const r=(t||tI).space;return EE(e,r==="svg"?Co:du)}function sI(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=sp(e.children,n,t),Di(e,n),n}function oI(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=sp(e.children,n,t),Di(e,n),n}function aI(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Di(e,t),t}function iI(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Di(e,t),t}function lI(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Di(e,t),t}function uI(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Co);const o=[];let i;if(e.properties){for(i in e.properties)if(i!=="children"&&nI.call(e.properties,i)){const d=cI(r,i,e.properties[i]);d&&o.push(d)}}const l=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:o,namespaceURI:Qo[l],childNodes:[],parentNode:null};return c.childNodes=sp(e.children,c,r),Di(e,c),e.tagName==="template"&&e.content&&(c.content=oI(e.content,r)),c}function cI(e,t,n){const r=Bd(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?Pv(n):Yv(n));const o={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const i=o.name.indexOf(":");i<0?o.prefix="":(o.name=o.name.slice(i+1),o.prefix=r.attribute.slice(0,i)),o.namespace=Qo[r.space]}return o}function sp(e,t,n){let r=-1;const o=[];if(e)for(;++r<e.length;){const i=EE(e[r],n);i.parentNode=t,o.push(i)}return o}function Di(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 dI=["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 Jn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function TE(e){return e>=55296&&e<=57343}function hI(e){return e>=56320&&e<=57343}function mI(e,t){return(e-55296)*1024+9216+t}function wE(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function kE(e){return e>=64976&&e<=65007||fI.has(e)}var de;(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"})(de||(de={}));const pI=65536;class yI{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=pI,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:o,offset:i}=this,l=o+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(hI(n))return this.pos++,this._addGap(),mI(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,B.EOF;return this._err(de.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,TE(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){wE(t)?this._err(de.controlCharacterInInputStream):kE(t)&&this._err(de.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var ht;(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"})(ht||(ht={}));function SE(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 gI=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୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉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ǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻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Ā;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;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ↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସ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;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼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))),bI=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 xI(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=bI.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 vI=32;var Eo;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Eo||(Eo={}));function J0(e){return e>=Sn.ZERO&&e<=Sn.NINE}function EI(e){return e>=Sn.UPPER_A&&e<=Sn.UPPER_F||e>=Sn.LOWER_A&&e<=Sn.LOWER_F}function TI(e){return e>=Sn.UPPER_A&&e<=Sn.UPPER_Z||e>=Sn.LOWER_A&&e<=Sn.LOWER_Z||J0(e)}function wI(e){return e===Sn.EQUALS||TI(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)|vI)===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,o){if(n!==r){const i=r-n;this.result=this.result*Math.pow(o,i)+Number.parseInt(t.substr(n,i),o),this.consumed+=i}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const o=t.charCodeAt(n);if(J0(o)||EI(o))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const o=t.charCodeAt(n);if(J0(o))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(o,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(xI(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 o=r[this.treeIndex],i=(o&Eo.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const l=t.charCodeAt(n);if(this.treeIndex=SI(r,o,this.treeIndex+Math.max(1,i),l),this.treeIndex<0)return this.result===0||this.decodeMode===Ds.Attribute&&(i===0||wI(l))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],i=(o&Eo.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,o=(r[n]&Eo.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[t]&~Eo.VALUE_LENGTH:o[t+1],r),n===3&&this.emitCodePoint(o[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 SI(e,t,n,r){const o=(t&Eo.BRANCH_LENGTH)>>7,i=t&Eo.JUMP_TABLE;if(o===0)return i!==0&&r===i?n:-1;if(i){const d=r-i;return d<0||d>=o?-1:e[n+d]-1}let l=n,c=l+o-1;for(;l<=c;){const d=l+c>>>1,h=e[d];if(h<r)l=d+1;else if(h>r)c=d-1;else return e[d+o]}return-1}var xe;(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/"})(xe||(xe={}));var oa;(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"})(oa||(oa={}));var Nr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Nr||(Nr={}));var Z;(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"})(Z||(Z={}));var g;(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"})(g||(g={}));const CI=new Map([[Z.A,g.A],[Z.ADDRESS,g.ADDRESS],[Z.ANNOTATION_XML,g.ANNOTATION_XML],[Z.APPLET,g.APPLET],[Z.AREA,g.AREA],[Z.ARTICLE,g.ARTICLE],[Z.ASIDE,g.ASIDE],[Z.B,g.B],[Z.BASE,g.BASE],[Z.BASEFONT,g.BASEFONT],[Z.BGSOUND,g.BGSOUND],[Z.BIG,g.BIG],[Z.BLOCKQUOTE,g.BLOCKQUOTE],[Z.BODY,g.BODY],[Z.BR,g.BR],[Z.BUTTON,g.BUTTON],[Z.CAPTION,g.CAPTION],[Z.CENTER,g.CENTER],[Z.CODE,g.CODE],[Z.COL,g.COL],[Z.COLGROUP,g.COLGROUP],[Z.DD,g.DD],[Z.DESC,g.DESC],[Z.DETAILS,g.DETAILS],[Z.DIALOG,g.DIALOG],[Z.DIR,g.DIR],[Z.DIV,g.DIV],[Z.DL,g.DL],[Z.DT,g.DT],[Z.EM,g.EM],[Z.EMBED,g.EMBED],[Z.FIELDSET,g.FIELDSET],[Z.FIGCAPTION,g.FIGCAPTION],[Z.FIGURE,g.FIGURE],[Z.FONT,g.FONT],[Z.FOOTER,g.FOOTER],[Z.FOREIGN_OBJECT,g.FOREIGN_OBJECT],[Z.FORM,g.FORM],[Z.FRAME,g.FRAME],[Z.FRAMESET,g.FRAMESET],[Z.H1,g.H1],[Z.H2,g.H2],[Z.H3,g.H3],[Z.H4,g.H4],[Z.H5,g.H5],[Z.H6,g.H6],[Z.HEAD,g.HEAD],[Z.HEADER,g.HEADER],[Z.HGROUP,g.HGROUP],[Z.HR,g.HR],[Z.HTML,g.HTML],[Z.I,g.I],[Z.IMG,g.IMG],[Z.IMAGE,g.IMAGE],[Z.INPUT,g.INPUT],[Z.IFRAME,g.IFRAME],[Z.KEYGEN,g.KEYGEN],[Z.LABEL,g.LABEL],[Z.LI,g.LI],[Z.LINK,g.LINK],[Z.LISTING,g.LISTING],[Z.MAIN,g.MAIN],[Z.MALIGNMARK,g.MALIGNMARK],[Z.MARQUEE,g.MARQUEE],[Z.MATH,g.MATH],[Z.MENU,g.MENU],[Z.META,g.META],[Z.MGLYPH,g.MGLYPH],[Z.MI,g.MI],[Z.MO,g.MO],[Z.MN,g.MN],[Z.MS,g.MS],[Z.MTEXT,g.MTEXT],[Z.NAV,g.NAV],[Z.NOBR,g.NOBR],[Z.NOFRAMES,g.NOFRAMES],[Z.NOEMBED,g.NOEMBED],[Z.NOSCRIPT,g.NOSCRIPT],[Z.OBJECT,g.OBJECT],[Z.OL,g.OL],[Z.OPTGROUP,g.OPTGROUP],[Z.OPTION,g.OPTION],[Z.P,g.P],[Z.PARAM,g.PARAM],[Z.PLAINTEXT,g.PLAINTEXT],[Z.PRE,g.PRE],[Z.RB,g.RB],[Z.RP,g.RP],[Z.RT,g.RT],[Z.RTC,g.RTC],[Z.RUBY,g.RUBY],[Z.S,g.S],[Z.SCRIPT,g.SCRIPT],[Z.SEARCH,g.SEARCH],[Z.SECTION,g.SECTION],[Z.SELECT,g.SELECT],[Z.SOURCE,g.SOURCE],[Z.SMALL,g.SMALL],[Z.SPAN,g.SPAN],[Z.STRIKE,g.STRIKE],[Z.STRONG,g.STRONG],[Z.STYLE,g.STYLE],[Z.SUB,g.SUB],[Z.SUMMARY,g.SUMMARY],[Z.SUP,g.SUP],[Z.TABLE,g.TABLE],[Z.TBODY,g.TBODY],[Z.TEMPLATE,g.TEMPLATE],[Z.TEXTAREA,g.TEXTAREA],[Z.TFOOT,g.TFOOT],[Z.TD,g.TD],[Z.TH,g.TH],[Z.THEAD,g.THEAD],[Z.TITLE,g.TITLE],[Z.TR,g.TR],[Z.TRACK,g.TRACK],[Z.TT,g.TT],[Z.U,g.U],[Z.UL,g.UL],[Z.SVG,g.SVG],[Z.VAR,g.VAR],[Z.WBR,g.WBR],[Z.XMP,g.XMP]]);function Oi(e){var t;return(t=CI.get(e))!==null&&t!==void 0?t:g.UNKNOWN}const ke=g,_I={[xe.HTML]:new Set([ke.ADDRESS,ke.APPLET,ke.AREA,ke.ARTICLE,ke.ASIDE,ke.BASE,ke.BASEFONT,ke.BGSOUND,ke.BLOCKQUOTE,ke.BODY,ke.BR,ke.BUTTON,ke.CAPTION,ke.CENTER,ke.COL,ke.COLGROUP,ke.DD,ke.DETAILS,ke.DIR,ke.DIV,ke.DL,ke.DT,ke.EMBED,ke.FIELDSET,ke.FIGCAPTION,ke.FIGURE,ke.FOOTER,ke.FORM,ke.FRAME,ke.FRAMESET,ke.H1,ke.H2,ke.H3,ke.H4,ke.H5,ke.H6,ke.HEAD,ke.HEADER,ke.HGROUP,ke.HR,ke.HTML,ke.IFRAME,ke.IMG,ke.INPUT,ke.LI,ke.LINK,ke.LISTING,ke.MAIN,ke.MARQUEE,ke.MENU,ke.META,ke.NAV,ke.NOEMBED,ke.NOFRAMES,ke.NOSCRIPT,ke.OBJECT,ke.OL,ke.P,ke.PARAM,ke.PLAINTEXT,ke.PRE,ke.SCRIPT,ke.SECTION,ke.SELECT,ke.SOURCE,ke.STYLE,ke.SUMMARY,ke.TABLE,ke.TBODY,ke.TD,ke.TEMPLATE,ke.TEXTAREA,ke.TFOOT,ke.TH,ke.THEAD,ke.TITLE,ke.TR,ke.TRACK,ke.UL,ke.WBR,ke.XMP]),[xe.MATHML]:new Set([ke.MI,ke.MO,ke.MN,ke.MS,ke.MTEXT,ke.ANNOTATION_XML]),[xe.SVG]:new Set([ke.TITLE,ke.FOREIGN_OBJECT,ke.DESC]),[xe.XLINK]:new Set,[xe.XML]:new Set,[xe.XMLNS]:new Set},Z0=new Set([ke.H1,ke.H2,ke.H3,ke.H4,ke.H5,ke.H6]);Z.STYLE,Z.SCRIPT,Z.XMP,Z.IFRAME,Z.NOEMBED,Z.NOFRAMES,Z.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 NI(e){return e>=B.DIGIT_0&&e<=B.DIGIT_9}function Ml(e){return e>=B.LATIN_CAPITAL_A&&e<=B.LATIN_CAPITAL_Z}function DI(e){return e>=B.LATIN_SMALL_A&&e<=B.LATIN_SMALL_Z}function io(e){return DI(e)||Ml(e)}function Vb(e){return io(e)||NI(e)}function Fc(e){return e+32}function CE(e){return e===B.SPACE||e===B.LINE_FEED||e===B.TABULATION||e===B.FORM_FEED}function Qb(e){return CE(e)||e===B.SOLIDUS||e===B.GREATER_THAN_SIGN}function OI(e){return e===B.NULL?de.nullCharacterReference:e>1114111?de.characterReferenceOutsideUnicodeRange:TE(e)?de.surrogateCharacterReference:kE(e)?de.noncharacterCharacterReference:wE(e)||e===B.CARRIAGE_RETURN?de.controlCharacterReference:null}class AI{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 yI(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new kI(gI,(r,o)=>{this.preprocessor.pos=this.entityStartPos+o-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(de.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(de.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const o=OI(r);o&&this._err(o,1)}}:void 0)}_err(t,n=0){var r,o;(o=(r=this.handler).onParseError)===null||o===void 0||o.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:ht.START_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:ht.END_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:ht.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:ht.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(SE(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const o=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);o[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(de.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=Oi(t.tagName),t.type===ht.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(de.endTagWithAttributes),t.selfClosing&&this._err(de.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 ht.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case ht.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case ht.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:ht.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=CE(t)?ht.WHITESPACE_CHARACTER:t===B.NULL?ht.NULL_CHARACTER:ht.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(ht.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(de.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(de.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(de.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(de.unexpectedNullCharacter),this._emitChars(Vt);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case B.NULL:{this._err(de.unexpectedNullCharacter),this._emitChars(Vt);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(io(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(de.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t);break}case B.EOF:{this._err(de.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(de.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=z.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(io(t))this._createEndTagToken(),this.state=z.TAG_NAME,this._stateTagName(t);else switch(t){case B.GREATER_THAN_SIGN:{this._err(de.missingEndTagName),this.state=z.DATA;break}case B.EOF:{this._err(de.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(de.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(de.unexpectedNullCharacter),n.tagName+=Vt;break}case B.EOF:{this._err(de.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Ml(t)?Fc(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){io(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){io(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){io(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(de.unexpectedNullCharacter),this._emitChars(Vt);break}case B.EOF:{this._err(de.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(de.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_ESCAPED,this._emitChars(Vt);break}case B.EOF:{this._err(de.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(de.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_ESCAPED,this._emitChars(Vt);break}case B.EOF:{this._err(de.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:io(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){io(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(Jn.SCRIPT,!1)&&Qb(this.preprocessor.peek(Jn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Jn.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(de.unexpectedNullCharacter),this._emitChars(Vt);break}case B.EOF:{this._err(de.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(de.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Vt);break}case B.EOF:{this._err(de.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(de.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Vt);break}case B.EOF:{this._err(de.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(Jn.SCRIPT,!1)&&Qb(this.preprocessor.peek(Jn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Jn.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(de.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(de.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case B.NULL:{this._err(de.unexpectedNullCharacter),this.currentAttr.name+=Vt;break}default:this.currentAttr.name+=String.fromCodePoint(Ml(t)?Fc(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(de.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(de.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(de.unexpectedNullCharacter),this.currentAttr.value+=Vt;break}case B.EOF:{this._err(de.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(de.unexpectedNullCharacter),this.currentAttr.value+=Vt;break}case B.EOF:{this._err(de.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(de.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(de.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case B.EOF:{this._err(de.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(de.eofInTag),this._emitEOFToken();break}default:this._err(de.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(de.eofInTag),this._emitEOFToken();break}default:this._err(de.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(de.unexpectedNullCharacter),n.data+=Vt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Jn.DASH_DASH,!0)?(this._createCommentToken(Jn.DASH_DASH.length+1),this.state=z.COMMENT_START):this._consumeSequenceIfMatch(Jn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Jn.DOCTYPE.length+1),this.state=z.DOCTYPE):this._consumeSequenceIfMatch(Jn.CDATA_START,!0)?this.inForeignNode?this.state=z.CDATA_SECTION:(this._err(de.cdataInHtmlContent),this._createCommentToken(Jn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=z.BOGUS_COMMENT):this._ensureHibernation()||(this._err(de.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(de.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(de.abruptClosingOfEmptyComment),this.state=z.DATA,this.emitCurrentComment(n);break}case B.EOF:{this._err(de.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(de.unexpectedNullCharacter),n.data+=Vt;break}case B.EOF:{this._err(de.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(de.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(de.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(de.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(de.incorrectlyClosedComment),this.state=z.DATA,this.emitCurrentComment(n);break}case B.EOF:{this._err(de.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(de.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(de.missingWhitespaceBeforeDoctypeName),this.state=z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Ml(t))this._createDoctypeToken(String.fromCharCode(Fc(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(de.unexpectedNullCharacter),this._createDoctypeToken(Vt),this.state=z.DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this._err(de.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.EOF:{this._err(de.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(de.unexpectedNullCharacter),n.name+=Vt;break}case B.EOF:{this._err(de.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Ml(t)?Fc(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(de.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Jn.PUBLIC,!1)?this.state=z.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Jn.SYSTEM,!1)?this.state=z.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(de.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(de.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(de.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(de.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(de.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(de.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(de.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(de.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(de.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(de.unexpectedNullCharacter),n.publicId+=Vt;break}case B.GREATER_THAN_SIGN:{this._err(de.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.EOF:{this._err(de.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(de.unexpectedNullCharacter),n.publicId+=Vt;break}case B.GREATER_THAN_SIGN:{this._err(de.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.EOF:{this._err(de.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(de.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(de.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.EOF:{this._err(de.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(de.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(de.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(de.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(de.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(de.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(de.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(de.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(de.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(de.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(de.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(de.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(de.unexpectedNullCharacter),n.systemId+=Vt;break}case B.GREATER_THAN_SIGN:{this._err(de.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.EOF:{this._err(de.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(de.unexpectedNullCharacter),n.systemId+=Vt;break}case B.GREATER_THAN_SIGN:{this._err(de.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.EOF:{this._err(de.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(de.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(de.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(de.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(de.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()&&Vb(this.preprocessor.peek(1))?z.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Vb(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===B.SEMICOLON&&this._err(de.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const _E=new Set([g.DD,g.DT,g.LI,g.OPTGROUP,g.OPTION,g.P,g.RB,g.RP,g.RT,g.RTC]),Gb=new Set([..._E,g.CAPTION,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]),ld=new Set([g.APPLET,g.CAPTION,g.HTML,g.MARQUEE,g.OBJECT,g.TABLE,g.TD,g.TEMPLATE,g.TH]),II=new Set([...ld,g.OL,g.UL]),MI=new Set([...ld,g.BUTTON]),Kb=new Set([g.ANNOTATION_XML,g.MI,g.MN,g.MO,g.MS,g.MTEXT]),Xb=new Set([g.DESC,g.FOREIGN_OBJECT,g.TITLE]),LI=new Set([g.TR,g.TEMPLATE,g.HTML]),RI=new Set([g.TBODY,g.TFOOT,g.THEAD,g.TEMPLATE,g.HTML]),PI=new Set([g.TABLE,g.TEMPLATE,g.HTML]),jI=new Set([g.TD,g.TH]);class FI{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=g.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===g.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===xe.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 o=this._indexOf(t)+1;this.items.splice(o,0,n),this.tagIDs.splice(o,0,r),this.stackTop++,o===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,o===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])!==xe.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(Z0,xe.HTML)}popUntilTableCellPopped(){this.popUntilPopped(jI,xe.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(PI,xe.HTML)}clearBackToTableBodyContext(){this.clearBackTo(RI,xe.HTML)}clearBackToTableRowContext(){this.clearBackTo(LI,xe.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]===g.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]===g.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const o=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case xe.HTML:{if(o===t)return!0;if(n.has(o))return!1;break}case xe.SVG:{if(Xb.has(o))return!1;break}case xe.MATHML:{if(Kb.has(o))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,ld)}hasInListItemScope(t){return this.hasInDynamicScope(t,II)}hasInButtonScope(t){return this.hasInDynamicScope(t,MI)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case xe.HTML:{if(Z0.has(n))return!0;if(ld.has(n))return!1;break}case xe.SVG:{if(Xb.has(n))return!1;break}case xe.MATHML:{if(Kb.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===xe.HTML)switch(this.tagIDs[n]){case t:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===xe.HTML)switch(this.tagIDs[t]){case g.TBODY:case g.THEAD:case g.TFOOT:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===xe.HTML)switch(this.tagIDs[n]){case t:return!0;case g.OPTION:case g.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&_E.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Gb.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Gb.has(this.currentTagId);)this.pop()}}const c0=3;var rs;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(rs||(rs={}));const Jb={type:rs.Marker};class BI{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],o=n.length,i=this.treeAdapter.getTagName(t),l=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const d=this.entries[c];if(d.type===rs.Marker)break;const{element:h}=d;if(this.treeAdapter.getTagName(h)===i&&this.treeAdapter.getNamespaceURI(h)===l){const p=this.treeAdapter.getAttrList(h);p.length===o&&r.push({idx:c,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<c0)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<c0)return;const o=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(d=>o.get(d.name)===d.value)&&(i+=1,i>=c0&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(Jb)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:rs.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:rs.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(Jb);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===rs.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===rs.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===rs.Element&&n.element===t)}}const lo={createDocument(){return{nodeName:"#document",mode:Nr.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 o=e.childNodes.find(i=>i.nodeName==="#documentType");if(o)o.name=t,o.publicId=n,o.systemId=r;else{const i={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};lo.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(lo.isTextNode(n)){n.value+=t;return}}lo.appendChild(e,lo.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&lo.isTextNode(r)?r.value+=t:lo.insertBefore(e,lo.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}}},NE="html",HI="about:legacy-compat",UI="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",DE=["+//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//"],zI=[...DE,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],WI=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),OE=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],YI=[...OE,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Zb(e,t){return t.some(n=>e.startsWith(n))}function $I(e){return e.name===NE&&e.publicId===null&&(e.systemId===null||e.systemId===HI)}function qI(e){if(e.name!==NE)return Nr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===UI)return Nr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),WI.has(n))return Nr.QUIRKS;let r=t===null?zI:DE;if(Zb(n,r))return Nr.QUIRKS;if(r=t===null?OE:YI,Zb(n,r))return Nr.LIMITED_QUIRKS}return Nr.NO_QUIRKS}const ex={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},VI="definitionurl",QI="definitionURL",GI=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),KI=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:xe.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:xe.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:xe.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:xe.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:xe.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:xe.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:xe.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:xe.XML}],["xml:space",{prefix:"xml",name:"space",namespace:xe.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:xe.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:xe.XMLNS}]]),XI=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])),JI=new Set([g.B,g.BIG,g.BLOCKQUOTE,g.BODY,g.BR,g.CENTER,g.CODE,g.DD,g.DIV,g.DL,g.DT,g.EM,g.EMBED,g.H1,g.H2,g.H3,g.H4,g.H5,g.H6,g.HEAD,g.HR,g.I,g.IMG,g.LI,g.LISTING,g.MENU,g.META,g.NOBR,g.OL,g.P,g.PRE,g.RUBY,g.S,g.SMALL,g.SPAN,g.STRONG,g.STRIKE,g.SUB,g.SUP,g.TABLE,g.TT,g.U,g.UL,g.VAR]);function ZI(e){const t=e.tagID;return t===g.FONT&&e.attrs.some(({name:r})=>r===oa.COLOR||r===oa.SIZE||r===oa.FACE)||JI.has(t)}function AE(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===VI){e.attrs[t].name=QI;break}}function IE(e){for(let t=0;t<e.attrs.length;t++){const n=GI.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function op(e){for(let t=0;t<e.attrs.length;t++){const n=KI.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 eM(e){const t=XI.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Oi(e.tagName))}function tM(e,t){return t===xe.MATHML&&(e===g.MI||e===g.MO||e===g.MN||e===g.MS||e===g.MTEXT)}function nM(e,t,n){if(t===xe.MATHML&&e===g.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===oa.ENCODING){const o=n[r].value.toLowerCase();return o===ex.TEXT_HTML||o===ex.APPLICATION_XML}}return t===xe.SVG&&(e===g.FOREIGN_OBJECT||e===g.DESC||e===g.TITLE)}function rM(e,t,n,r){return(!r||r===xe.HTML)&&nM(e,t,n)||(!r||r===xe.MATHML)&&tM(e,t)}const sM="hidden",oM=8,aM=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 iM={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},ME=new Set([g.TABLE,g.TBODY,g.TFOOT,g.THEAD,g.TR]),tx={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:lo,onParseError:null};class nx{constructor(t,n,r=null,o=null){this.fragmentContext=r,this.scriptHandler=o,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={...tx,...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 AI(this.options,this),this.activeFormattingElements=new BI(this.treeAdapter),this.fragmentContextID=r?Oi(this.treeAdapter.getTagName(r)):g.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new FI(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={...tx,...n};t??(t=r.treeAdapter.createElement(Z.TEMPLATE,xe.HTML,[]));const o=r.treeAdapter.createElement("documentmock",xe.HTML,[]),i=new this(r,o,t);return i.fragmentContextID===g.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 o;if(!this.onParseError)return;const i=(o=t.location)!==null&&o!==void 0?o:iM,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 o,i;(i=(o=this.treeAdapter).onItemPush)===null||i===void 0||i.call(o,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,o;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(o=(r=this.treeAdapter).onItemPop)===null||o===void 0||o.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)===xe.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,xe.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)===Z.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==xe.HTML))switch(this.fragmentContextID){case g.TITLE:case g.TEXTAREA:{this.tokenizer.state=cn.RCDATA;break}case g.STYLE:case g.XMP:case g.IFRAME:case g.NOEMBED:case g.NOFRAMES:case g.NOSCRIPT:{this.tokenizer.state=cn.RAWTEXT;break}case g.SCRIPT:{this.tokenizer.state=cn.SCRIPT_DATA;break}case g.PLAINTEXT:{this.tokenizer.state=cn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",o=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,o),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,xe.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,xe.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(Z.HTML,xe.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,g.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 o=this.treeAdapter.getChildNodes(n),i=r?o.lastIndexOf(r):o.length,l=o[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(l)){const{endLine:d,endCol:h,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:d,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,o=this.treeAdapter.getTagName(t),i=n.type===ht.END_TAG&&o===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===g.SVG&&this.treeAdapter.getTagName(n)===Z.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===xe.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===g.MGLYPH||t.tagID===g.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,xe.HTML)}_processToken(t){switch(t.type){case ht.CHARACTER:{this.onCharacter(t);break}case ht.NULL_CHARACTER:{this.onNullCharacter(t);break}case ht.COMMENT:{this.onComment(t);break}case ht.DOCTYPE:{this.onDoctype(t);break}case ht.START_TAG:{this._processStartTag(t);break}case ht.END_TAG:{this.onEndTag(t);break}case ht.EOF:{this.onEof(t);break}case ht.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const o=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return rM(t,o,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(o=>o.type===rs.Marker||this.openElements.contains(o.element)),r=n===-1?t-1:n-1;for(let o=r;o>=0;o--){const i=this.activeFormattingElements.entries[o];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(g.P),this.openElements.popUntilTagNamePopped(g.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case g.TR:{this.insertionMode=V.IN_ROW;return}case g.TBODY:case g.THEAD:case g.TFOOT:{this.insertionMode=V.IN_TABLE_BODY;return}case g.CAPTION:{this.insertionMode=V.IN_CAPTION;return}case g.COLGROUP:{this.insertionMode=V.IN_COLUMN_GROUP;return}case g.TABLE:{this.insertionMode=V.IN_TABLE;return}case g.BODY:{this.insertionMode=V.IN_BODY;return}case g.FRAMESET:{this.insertionMode=V.IN_FRAMESET;return}case g.SELECT:{this._resetInsertionModeForSelect(t);return}case g.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case g.HTML:{this.insertionMode=this.headElement?V.AFTER_HEAD:V.BEFORE_HEAD;return}case g.TD:case g.TH:{if(t>0){this.insertionMode=V.IN_CELL;return}break}case g.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===g.TEMPLATE)break;if(r===g.TABLE){this.insertionMode=V.IN_SELECT_IN_TABLE;return}}this.insertionMode=V.IN_SELECT}_isElementCausesFosterParenting(t){return ME.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 g.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===xe.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case g.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 _I[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){jL(this,t);return}switch(this.insertionMode){case V.INITIAL:{Nl(this,t);break}case V.BEFORE_HTML:{Bl(this,t);break}case V.BEFORE_HEAD:{Hl(this,t);break}case V.IN_HEAD:{Ul(this,t);break}case V.IN_HEAD_NO_SCRIPT:{zl(this,t);break}case V.AFTER_HEAD:{Wl(this,t);break}case V.IN_BODY:case V.IN_CAPTION:case V.IN_CELL:case V.IN_TEMPLATE:{RE(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:{d0(this,t);break}case V.IN_TABLE_TEXT:{UE(this,t);break}case V.IN_COLUMN_GROUP:{ud(this,t);break}case V.AFTER_BODY:{cd(this,t);break}case V.AFTER_AFTER_BODY:{$c(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){PL(this,t);return}switch(this.insertionMode){case V.INITIAL:{Nl(this,t);break}case V.BEFORE_HTML:{Bl(this,t);break}case V.BEFORE_HEAD:{Hl(this,t);break}case V.IN_HEAD:{Ul(this,t);break}case V.IN_HEAD_NO_SCRIPT:{zl(this,t);break}case V.AFTER_HEAD:{Wl(this,t);break}case V.TEXT:{this._insertCharacters(t);break}case V.IN_TABLE:case V.IN_TABLE_BODY:case V.IN_ROW:{d0(this,t);break}case V.IN_COLUMN_GROUP:{ud(this,t);break}case V.AFTER_BODY:{cd(this,t);break}case V.AFTER_AFTER_BODY:{$c(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){em(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:{em(this,t);break}case V.IN_TABLE_TEXT:{Dl(this,t);break}case V.AFTER_BODY:{mM(this,t);break}case V.AFTER_AFTER_BODY:case V.AFTER_AFTER_FRAMESET:{pM(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case V.INITIAL:{yM(this,t);break}case V.BEFORE_HEAD:case V.IN_HEAD:case V.IN_HEAD_NO_SCRIPT:case V.AFTER_HEAD:{this._err(t,de.misplacedDoctype);break}case V.IN_TABLE_TEXT:{Dl(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,de.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?FL(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case V.INITIAL:{Nl(this,t);break}case V.BEFORE_HTML:{gM(this,t);break}case V.BEFORE_HEAD:{xM(this,t);break}case V.IN_HEAD:{Yr(this,t);break}case V.IN_HEAD_NO_SCRIPT:{TM(this,t);break}case V.AFTER_HEAD:{kM(this,t);break}case V.IN_BODY:{Bn(this,t);break}case V.IN_TABLE:{xi(this,t);break}case V.IN_TABLE_TEXT:{Dl(this,t);break}case V.IN_CAPTION:{vL(this,t);break}case V.IN_COLUMN_GROUP:{lp(this,t);break}case V.IN_TABLE_BODY:{qd(this,t);break}case V.IN_ROW:{Vd(this,t);break}case V.IN_CELL:{wL(this,t);break}case V.IN_SELECT:{YE(this,t);break}case V.IN_SELECT_IN_TABLE:{SL(this,t);break}case V.IN_TEMPLATE:{_L(this,t);break}case V.AFTER_BODY:{DL(this,t);break}case V.IN_FRAMESET:{OL(this,t);break}case V.AFTER_FRAMESET:{IL(this,t);break}case V.AFTER_AFTER_BODY:{LL(this,t);break}case V.AFTER_AFTER_FRAMESET:{RL(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?BL(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case V.INITIAL:{Nl(this,t);break}case V.BEFORE_HTML:{bM(this,t);break}case V.BEFORE_HEAD:{vM(this,t);break}case V.IN_HEAD:{EM(this,t);break}case V.IN_HEAD_NO_SCRIPT:{wM(this,t);break}case V.AFTER_HEAD:{SM(this,t);break}case V.IN_BODY:{$d(this,t);break}case V.TEXT:{cL(this,t);break}case V.IN_TABLE:{Gl(this,t);break}case V.IN_TABLE_TEXT:{Dl(this,t);break}case V.IN_CAPTION:{EL(this,t);break}case V.IN_COLUMN_GROUP:{TL(this,t);break}case V.IN_TABLE_BODY:{tm(this,t);break}case V.IN_ROW:{WE(this,t);break}case V.IN_CELL:{kL(this,t);break}case V.IN_SELECT:{$E(this,t);break}case V.IN_SELECT_IN_TABLE:{CL(this,t);break}case V.IN_TEMPLATE:{NL(this,t);break}case V.AFTER_BODY:{VE(this,t);break}case V.IN_FRAMESET:{AL(this,t);break}case V.AFTER_FRAMESET:{ML(this,t);break}case V.AFTER_AFTER_BODY:{$c(this,t);break}}}onEof(t){switch(this.insertionMode){case V.INITIAL:{Nl(this,t);break}case V.BEFORE_HTML:{Bl(this,t);break}case V.BEFORE_HEAD:{Hl(this,t);break}case V.IN_HEAD:{Ul(this,t);break}case V.IN_HEAD_NO_SCRIPT:{zl(this,t);break}case V.AFTER_HEAD:{Wl(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:{BE(this,t);break}case V.TEXT:{dL(this,t);break}case V.IN_TABLE_TEXT:{Dl(this,t);break}case V.IN_TEMPLATE:{qE(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:{ip(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:{LE(this,t);break}case V.IN_TABLE:case V.IN_TABLE_BODY:case V.IN_ROW:{d0(this,t);break}case V.IN_TABLE_TEXT:{HE(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):FE(e,t),n}function uM(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const o=e.openElements.items[r];if(o===t.element)break;e._isSpecialElement(o,e.openElements.tagIDs[r])&&(n=o)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function cM(e,t,n){let r=t,o=e.openElements.getCommonAncestor(t);for(let i=0,l=o;l!==n;i++,l=o){o=e.openElements.getCommonAncestor(l);const c=e.activeFormattingElements.getElementEntry(l),d=c&&i>=aM;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(l)):(l=dM(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(l,r),r=l)}return r}function dM(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),o=Oi(r);if(e._isElementCausesFosterParenting(o))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);o===g.TEMPLATE&&i===xe.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function hM(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:o}=n,i=e.treeAdapter.createElement(o.tagName,r,o.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,o),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i,o.tagID)}function ap(e,t){for(let n=0;n<oM;n++){const r=lM(e,t);if(!r)break;const o=uM(e,r);if(!o)break;e.activeFormattingElements.bookmark=r;const i=cM(e,o,r.element),l=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(i),l&&fM(e,l,i),hM(e,o,r)}}function em(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function mM(e,t){e._appendCommentNode(t,e.openElements.items[0])}function pM(e,t){e._appendCommentNode(t,e.document)}function ip(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],o=e.treeAdapter.getNodeSourceCodeLocation(r);if(o&&!o.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 yM(e,t){e._setDocumentType(t);const n=t.forceQuirks?Nr.QUIRKS:qI(t);$I(t)||e._err(t,de.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=V.BEFORE_HTML}function Nl(e,t){e._err(t,de.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Nr.QUIRKS),e.insertionMode=V.BEFORE_HTML,e._processToken(t)}function gM(e,t){t.tagID===g.HTML?(e._insertElement(t,xe.HTML),e.insertionMode=V.BEFORE_HEAD):Bl(e,t)}function bM(e,t){const n=t.tagID;(n===g.HTML||n===g.HEAD||n===g.BODY||n===g.BR)&&Bl(e,t)}function Bl(e,t){e._insertFakeRootElement(),e.insertionMode=V.BEFORE_HEAD,e._processToken(t)}function xM(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.HEAD:{e._insertElement(t,xe.HTML),e.headElement=e.openElements.current,e.insertionMode=V.IN_HEAD;break}default:Hl(e,t)}}function vM(e,t){const n=t.tagID;n===g.HEAD||n===g.BODY||n===g.HTML||n===g.BR?Hl(e,t):e._err(t,de.endTagWithoutMatchingOpenElement)}function Hl(e,t){e._insertFakeElement(Z.HEAD,g.HEAD),e.headElement=e.openElements.current,e.insertionMode=V.IN_HEAD,e._processToken(t)}function Yr(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:{e._appendElement(t,xe.HTML),t.ackSelfClosing=!0;break}case g.TITLE:{e._switchToTextParsing(t,cn.RCDATA);break}case g.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,cn.RAWTEXT):(e._insertElement(t,xe.HTML),e.insertionMode=V.IN_HEAD_NO_SCRIPT);break}case g.NOFRAMES:case g.STYLE:{e._switchToTextParsing(t,cn.RAWTEXT);break}case g.SCRIPT:{e._switchToTextParsing(t,cn.SCRIPT_DATA);break}case g.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=V.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(V.IN_TEMPLATE);break}case g.HEAD:{e._err(t,de.misplacedStartTagForHeadElement);break}default:Ul(e,t)}}function EM(e,t){switch(t.tagID){case g.HEAD:{e.openElements.pop(),e.insertionMode=V.AFTER_HEAD;break}case g.BODY:case g.BR:case g.HTML:{Ul(e,t);break}case g.TEMPLATE:{ba(e,t);break}default:e._err(t,de.endTagWithoutMatchingOpenElement)}}function ba(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==g.TEMPLATE&&e._err(t,de.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,de.endTagWithoutMatchingOpenElement)}function Ul(e,t){e.openElements.pop(),e.insertionMode=V.AFTER_HEAD,e._processToken(t)}function TM(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.BASEFONT:case g.BGSOUND:case g.HEAD:case g.LINK:case g.META:case g.NOFRAMES:case g.STYLE:{Yr(e,t);break}case g.NOSCRIPT:{e._err(t,de.nestedNoscriptInHead);break}default:zl(e,t)}}function wM(e,t){switch(t.tagID){case g.NOSCRIPT:{e.openElements.pop(),e.insertionMode=V.IN_HEAD;break}case g.BR:{zl(e,t);break}default:e._err(t,de.endTagWithoutMatchingOpenElement)}}function zl(e,t){const n=t.type===ht.EOF?de.openElementsLeftAfterEof:de.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=V.IN_HEAD,e._processToken(t)}function kM(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.BODY:{e._insertElement(t,xe.HTML),e.framesetOk=!1,e.insertionMode=V.IN_BODY;break}case g.FRAMESET:{e._insertElement(t,xe.HTML),e.insertionMode=V.IN_FRAMESET;break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{e._err(t,de.abandonedHeadElementChild),e.openElements.push(e.headElement,g.HEAD),Yr(e,t),e.openElements.remove(e.headElement);break}case g.HEAD:{e._err(t,de.misplacedStartTagForHeadElement);break}default:Wl(e,t)}}function SM(e,t){switch(t.tagID){case g.BODY:case g.HTML:case g.BR:{Wl(e,t);break}case g.TEMPLATE:{ba(e,t);break}default:e._err(t,de.endTagWithoutMatchingOpenElement)}}function Wl(e,t){e._insertFakeElement(Z.BODY,g.BODY),e.insertionMode=V.IN_BODY,Yd(e,t)}function Yd(e,t){switch(t.type){case ht.CHARACTER:{RE(e,t);break}case ht.WHITESPACE_CHARACTER:{LE(e,t);break}case ht.COMMENT:{em(e,t);break}case ht.START_TAG:{Bn(e,t);break}case ht.END_TAG:{$d(e,t);break}case ht.EOF:{BE(e,t);break}}}function LE(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function RE(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function CM(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function _M(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function NM(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,xe.HTML),e.insertionMode=V.IN_FRAMESET)}function DM(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,xe.HTML)}function OM(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Z0.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,xe.HTML)}function AM(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,xe.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function IM(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,xe.HTML),n||(e.formElement=e.openElements.current))}function MM(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const o=e.openElements.tagIDs[r];if(n===g.LI&&o===g.LI||(n===g.DD||n===g.DT)&&(o===g.DD||o===g.DT)){e.openElements.generateImpliedEndTagsWithExclusion(o),e.openElements.popUntilTagNamePopped(o);break}if(o!==g.ADDRESS&&o!==g.DIV&&o!==g.P&&e._isSpecialElement(e.openElements.items[r],o))break}e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,xe.HTML)}function LM(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,xe.HTML),e.tokenizer.state=cn.PLAINTEXT}function RM(e,t){e.openElements.hasInScope(g.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.framesetOk=!1}function PM(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Z.A);n&&(ap(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function jM(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function FM(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(g.NOBR)&&(ap(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,xe.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function BM(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function HM(e,t){e.treeAdapter.getDocumentMode(e.document)!==Nr.QUIRKS&&e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,xe.HTML),e.framesetOk=!1,e.insertionMode=V.IN_TABLE}function PE(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,xe.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function jE(e){const t=SE(e,oa.TYPE);return t!=null&&t.toLowerCase()===sM}function UM(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,xe.HTML),jE(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function zM(e,t){e._appendElement(t,xe.HTML),t.ackSelfClosing=!0}function WM(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._appendElement(t,xe.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function YM(e,t){t.tagName=Z.IMG,t.tagID=g.IMG,PE(e,t)}function $M(e,t){e._insertElement(t,xe.HTML),e.skipNextNewLine=!0,e.tokenizer.state=cn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=V.TEXT}function qM(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,cn.RAWTEXT)}function VM(e,t){e.framesetOk=!1,e._switchToTextParsing(t,cn.RAWTEXT)}function rx(e,t){e._switchToTextParsing(t,cn.RAWTEXT)}function QM(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,xe.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 GM(e,t){e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML)}function KM(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,xe.HTML)}function XM(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(g.RTC),e._insertElement(t,xe.HTML)}function JM(e,t){e._reconstructActiveFormattingElements(),AE(t),op(t),t.selfClosing?e._appendElement(t,xe.MATHML):e._insertElement(t,xe.MATHML),t.ackSelfClosing=!0}function ZM(e,t){e._reconstructActiveFormattingElements(),IE(t),op(t),t.selfClosing?e._appendElement(t,xe.SVG):e._insertElement(t,xe.SVG),t.ackSelfClosing=!0}function sx(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,xe.HTML)}function Bn(e,t){switch(t.tagID){case g.I:case g.S:case g.B:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.SMALL:case g.STRIKE:case g.STRONG:{jM(e,t);break}case g.A:{PM(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{OM(e,t);break}case g.P:case g.DL:case g.OL:case g.UL:case g.DIV:case g.DIR:case g.NAV:case g.MAIN:case g.MENU:case g.ASIDE:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.DETAILS:case g.ADDRESS:case g.ARTICLE:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{DM(e,t);break}case g.LI:case g.DD:case g.DT:{MM(e,t);break}case g.BR:case g.IMG:case g.WBR:case g.AREA:case g.EMBED:case g.KEYGEN:{PE(e,t);break}case g.HR:{WM(e,t);break}case g.RB:case g.RTC:{KM(e,t);break}case g.RT:case g.RP:{XM(e,t);break}case g.PRE:case g.LISTING:{AM(e,t);break}case g.XMP:{qM(e,t);break}case g.SVG:{ZM(e,t);break}case g.HTML:{CM(e,t);break}case g.BASE:case g.LINK:case g.META:case g.STYLE:case g.TITLE:case g.SCRIPT:case g.BGSOUND:case g.BASEFONT:case g.TEMPLATE:{Yr(e,t);break}case g.BODY:{_M(e,t);break}case g.FORM:{IM(e,t);break}case g.NOBR:{FM(e,t);break}case g.MATH:{JM(e,t);break}case g.TABLE:{HM(e,t);break}case g.INPUT:{UM(e,t);break}case g.PARAM:case g.TRACK:case g.SOURCE:{zM(e,t);break}case g.IMAGE:{YM(e,t);break}case g.BUTTON:{RM(e,t);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{BM(e,t);break}case g.IFRAME:{VM(e,t);break}case g.SELECT:{QM(e,t);break}case g.OPTION:case g.OPTGROUP:{GM(e,t);break}case g.NOEMBED:case g.NOFRAMES:{rx(e,t);break}case g.FRAMESET:{NM(e,t);break}case g.TEXTAREA:{$M(e,t);break}case g.NOSCRIPT:{e.options.scriptingEnabled?rx(e,t):sx(e,t);break}case g.PLAINTEXT:{LM(e,t);break}case g.COL:case g.TH:case g.TD:case g.TR:case g.HEAD:case g.FRAME:case g.TBODY:case g.TFOOT:case g.THEAD:case g.CAPTION:case g.COLGROUP:break;default:sx(e,t)}}function eL(e,t){if(e.openElements.hasInScope(g.BODY)&&(e.insertionMode=V.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function tL(e,t){e.openElements.hasInScope(g.BODY)&&(e.insertionMode=V.AFTER_BODY,VE(e,t))}function nL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function rL(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(g.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(g.FORM):n&&e.openElements.remove(n))}function sL(e){e.openElements.hasInButtonScope(g.P)||e._insertFakeElement(Z.P,g.P),e._closePElement()}function oL(e){e.openElements.hasInListItemScope(g.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(g.LI),e.openElements.popUntilTagNamePopped(g.LI))}function aL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function iL(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 uL(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Z.BR,g.BR),e.openElements.pop(),e.framesetOk=!1}function FE(e,t){const n=t.tagName,r=t.tagID;for(let o=e.openElements.stackTop;o>0;o--){const i=e.openElements.items[o],l=e.openElements.tagIDs[o];if(r===l&&(r!==g.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=o&&e.openElements.shortenToLength(o);break}if(e._isSpecialElement(i,l))break}}function $d(e,t){switch(t.tagID){case g.A:case g.B:case g.I:case g.S:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.NOBR:case g.SMALL:case g.STRIKE:case g.STRONG:{ap(e,t);break}case g.P:{sL(e);break}case g.DL:case g.UL:case g.OL:case g.DIR:case g.DIV:case g.NAV:case g.PRE:case g.MAIN:case g.MENU:case g.ASIDE:case g.BUTTON:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.ADDRESS:case g.ARTICLE:case g.DETAILS:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.LISTING:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{nL(e,t);break}case g.LI:{oL(e);break}case g.DD:case g.DT:{aL(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{iL(e);break}case g.BR:{uL(e);break}case g.BODY:{eL(e,t);break}case g.HTML:{tL(e,t);break}case g.FORM:{rL(e);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{lL(e,t);break}case g.TEMPLATE:{ba(e,t);break}default:FE(e,t)}}function BE(e,t){e.tmplInsertionModeStack.length>0?qE(e,t):ip(e,t)}function cL(e,t){var n;t.tagID===g.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function dL(e,t){e._err(t,de.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function d0(e,t){if(e.openElements.currentTagId!==void 0&&ME.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 ht.CHARACTER:{UE(e,t);break}case ht.WHITESPACE_CHARACTER:{HE(e,t);break}}else hu(e,t)}function fL(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,xe.HTML),e.insertionMode=V.IN_CAPTION}function hL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,xe.HTML),e.insertionMode=V.IN_COLUMN_GROUP}function mL(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Z.COLGROUP,g.COLGROUP),e.insertionMode=V.IN_COLUMN_GROUP,lp(e,t)}function pL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,xe.HTML),e.insertionMode=V.IN_TABLE_BODY}function yL(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Z.TBODY,g.TBODY),e.insertionMode=V.IN_TABLE_BODY,qd(e,t)}function gL(e,t){e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function bL(e,t){jE(t)?e._appendElement(t,xe.HTML):hu(e,t),t.ackSelfClosing=!0}function xL(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,xe.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function xi(e,t){switch(t.tagID){case g.TD:case g.TH:case g.TR:{yL(e,t);break}case g.STYLE:case g.SCRIPT:case g.TEMPLATE:{Yr(e,t);break}case g.COL:{mL(e,t);break}case g.FORM:{xL(e,t);break}case g.TABLE:{gL(e,t);break}case g.TBODY:case g.TFOOT:case g.THEAD:{pL(e,t);break}case g.INPUT:{bL(e,t);break}case g.CAPTION:{fL(e,t);break}case g.COLGROUP:{hL(e,t);break}default:hu(e,t)}}function Gl(e,t){switch(t.tagID){case g.TABLE:{e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode());break}case g.TEMPLATE:{ba(e,t);break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:hu(e,t)}}function hu(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Yd(e,t),e.fosterParentingEnabled=n}function HE(e,t){e.pendingCharacterTokens.push(t)}function UE(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Dl(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)hu(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([g.CAPTION,g.COL,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]);function vL(e,t){const n=t.tagID;zE.has(n)?e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=V.IN_TABLE,xi(e,t)):Bn(e,t)}function EL(e,t){const n=t.tagID;switch(n){case g.CAPTION:case g.TABLE:{e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=V.IN_TABLE,n===g.TABLE&&Gl(e,t));break}case g.BODY:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:$d(e,t)}}function lp(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.COL:{e._appendElement(t,xe.HTML),t.ackSelfClosing=!0;break}case g.TEMPLATE:{Yr(e,t);break}default:ud(e,t)}}function TL(e,t){switch(t.tagID){case g.COLGROUP:{e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=V.IN_TABLE);break}case g.TEMPLATE:{ba(e,t);break}case g.COL:break;default:ud(e,t)}}function ud(e,t){e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=V.IN_TABLE,e._processToken(t))}function qd(e,t){switch(t.tagID){case g.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,xe.HTML),e.insertionMode=V.IN_ROW;break}case g.TH:case g.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(Z.TR,g.TR),e.insertionMode=V.IN_ROW,Vd(e,t);break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE,xi(e,t));break}default:xi(e,t)}}function tm(e,t){const n=t.tagID;switch(t.tagID){case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE);break}case g.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE,Gl(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:case g.TR:break;default:Gl(e,t)}}function Vd(e,t){switch(t.tagID){case g.TH:case g.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,xe.HTML),e.insertionMode=V.IN_CELL,e.activeFormattingElements.insertMarker();break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY,qd(e,t));break}default:xi(e,t)}}function WE(e,t){switch(t.tagID){case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY);break}case g.TABLE:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY,tm(e,t));break}case g.TBODY:case g.TFOOT:case g.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(g.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=V.IN_TABLE_BODY,tm(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:break;default:Gl(e,t)}}function wL(e,t){const n=t.tagID;zE.has(n)?(e.openElements.hasInTableScope(g.TD)||e.openElements.hasInTableScope(g.TH))&&(e._closeTableCell(),Vd(e,t)):Bn(e,t)}function kL(e,t){const n=t.tagID;switch(n){case g.TD:case g.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=V.IN_ROW);break}case g.TABLE:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),WE(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:break;default:$d(e,t)}}function YE(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._insertElement(t,xe.HTML);break}case g.OPTGROUP:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._insertElement(t,xe.HTML);break}case g.HR:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._appendElement(t,xe.HTML),t.ackSelfClosing=!0;break}case g.INPUT:case g.KEYGEN:case g.TEXTAREA:case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),t.tagID!==g.SELECT&&e._processStartTag(t));break}case g.SCRIPT:case g.TEMPLATE:{Yr(e,t);break}}}function $E(e,t){switch(t.tagID){case g.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===g.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===g.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop();break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop();break}case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode());break}case g.TEMPLATE:{ba(e,t);break}}}function SL(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e._processStartTag(t)):YE(e,t)}function CL(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e.onEndTag(t)):$E(e,t)}function _L(e,t){switch(t.tagID){case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{Yr(e,t);break}case g.CAPTION:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.tmplInsertionModeStack[0]=V.IN_TABLE,e.insertionMode=V.IN_TABLE,xi(e,t);break}case g.COL:{e.tmplInsertionModeStack[0]=V.IN_COLUMN_GROUP,e.insertionMode=V.IN_COLUMN_GROUP,lp(e,t);break}case g.TR:{e.tmplInsertionModeStack[0]=V.IN_TABLE_BODY,e.insertionMode=V.IN_TABLE_BODY,qd(e,t);break}case g.TD:case g.TH:{e.tmplInsertionModeStack[0]=V.IN_ROW,e.insertionMode=V.IN_ROW,Vd(e,t);break}default:e.tmplInsertionModeStack[0]=V.IN_BODY,e.insertionMode=V.IN_BODY,Bn(e,t)}}function NL(e,t){t.tagID===g.TEMPLATE&&ba(e,t)}function qE(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):ip(e,t)}function DL(e,t){t.tagID===g.HTML?Bn(e,t):cd(e,t)}function VE(e,t){var n;if(t.tagID===g.HTML){if(e.fragmentContext||(e.insertionMode=V.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===g.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 cd(e,t)}function cd(e,t){e.insertionMode=V.IN_BODY,Yd(e,t)}function OL(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.FRAMESET:{e._insertElement(t,xe.HTML);break}case g.FRAME:{e._appendElement(t,xe.HTML),t.ackSelfClosing=!0;break}case g.NOFRAMES:{Yr(e,t);break}}}function AL(e,t){t.tagID===g.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==g.FRAMESET&&(e.insertionMode=V.AFTER_FRAMESET))}function IL(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.NOFRAMES:{Yr(e,t);break}}}function ML(e,t){t.tagID===g.HTML&&(e.insertionMode=V.AFTER_AFTER_FRAMESET)}function LL(e,t){t.tagID===g.HTML?Bn(e,t):$c(e,t)}function $c(e,t){e.insertionMode=V.IN_BODY,Yd(e,t)}function RL(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.NOFRAMES:{Yr(e,t);break}}}function PL(e,t){t.chars=Vt,e._insertCharacters(t)}function jL(e,t){e._insertCharacters(t),e.framesetOk=!1}function QE(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==xe.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function FL(e,t){if(ZI(t))QE(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===xe.MATHML?AE(t):r===xe.SVG&&(eM(t),IE(t)),op(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function BL(e,t){if(t.tagID===g.P||t.tagID===g.BR){QE(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)===xe.HTML){e._endTagOutsideForeignContent(t);break}const o=e.treeAdapter.getTagName(r);if(o.toLowerCase()===t.tagName){t.tagName=o,e.openElements.shortenToLength(n);break}}}Z.AREA,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BR,Z.COL,Z.EMBED,Z.FRAME,Z.HR,Z.IMG,Z.INPUT,Z.KEYGEN,Z.LINK,Z.META,Z.PARAM,Z.SOURCE,Z.TRACK,Z.WBR;const HL=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,UL=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),ox={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function GE(e,t){const n=XL(e),r=vE("type",{handlers:{root:zL,element:WL,text:YL,comment:XE,doctype:$L,raw:VL},unknown:QL}),o={parser:n?new nx(ox):nx.getFragmentParser(void 0,ox),handle(c){r(c,o)},stitches:!1,options:t||{}};r(e,o),Ai(o,fs());const i=n?o.parser.document:o.parser.getFragment(),l=J5(i,{file:o.options.file});return o.stitches&&tp(l,"comment",function(c,d,h){const p=c;if(p.value.stitch&&h&&d!==void 0){const y=h.children;return y[d]=p.value.stitch,d}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function KE(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function zL(e,t){KE(e.children,t)}function WL(e,t){GL(e,t),KE(e.children,t),KL(e,t)}function YL(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:ht.CHARACTER,chars:e.value,location:mu(e)};Ai(t,fs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function $L(e,t){const n={type:ht.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:mu(e)};Ai(t,fs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function qL(e,t){t.stitches=!0;const n=JL(e);if("children"in e&&"children"in n){const r=GE({type:"root",children:e.children},t.options);n.children=r.children}XE({type:"comment",value:{stitch:n}},t)}function XE(e,t){const n=e.value,r={type:ht.COMMENT,data:n,location:mu(e)};Ai(t,fs(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function VL(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,JE(t,fs(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(HL,"&lt;$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 QL(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))qL(n,t);else{let r="";throw UL.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Ai(e,t){JE(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 JE(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function GL(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===cn.PLAINTEXT)return;Ai(t,fs(e));const r=t.parser.openElements.current;let o="namespaceURI"in r?r.namespaceURI:Qo.html;o===Qo.html&&n==="svg"&&(o=Qo.svg);const i=rI({...e,children:[]},{space:o===Qo.svg?"svg":"html"}),l={type:ht.START_TAG,tagName:n,tagID:Oi(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:mu(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function KL(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&dI.includes(n)||t.parser.tokenizer.state===cn.PLAINTEXT)return;Ai(t,Hd(e));const r={type:ht.END_TAG,tagName:n,tagID:Oi(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:mu(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 XL(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function mu(e){const t=fs(e)||{line:void 0,column:void 0,offset:void 0},n=Hd(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 JL(e){return"children"in e?bi({...e,children:[]}):bi(e)}function ZL(e){return function(t,n){return GE(t,{...e,file:n})}}const ZE=[{command:"/ai",description:"Generate text at this line"},{command:"/ai!",description:"Replace all widget content"}];function eR({filter:e,selectedIndex:t,position:n,onSelect:r,onClose:o}){const i=N.useRef(null),l=N.useMemo(()=>{const c=e.toLowerCase();return ZE.filter(d=>d.command.toLowerCase().includes(c)||d.description.toLowerCase().includes(c))},[e]);return N.useEffect(()=>{function c(d){i.current&&!i.current.contains(d.target)&&o()}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[o]),N.useEffect(()=>{var d;const c=(d=i.current)==null?void 0:d.querySelector('[data-selected="true"]');c&&typeof c.scrollIntoView=="function"&&c.scrollIntoView({block:"nearest"})},[t]),l.length===0?null:lu.createPortal(f.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,d)=>f.jsxs("button",{"data-selected":d===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:d===t?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("span",{className:"font-mono font-medium min-w-[3rem]",children:c.command}),f.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:c.description})]},c.command))}),document.body)}function tR(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 Bc(e,t,n){const r=e.split(`
123
+ `),o=r.findIndex(i=>i.trim()===t.trim());return o===-1?e:(r[o]=n,r.join(`
124
+ `))}function nR({chartName:e,chartTitle:t,displayValue:n,field:r,change:o,previousValue:i,lockedPreset:l,lockedRange:c,format:d}){const[h,p]=N.useState(!1),[y,b]=N.useState({top:0,left:0,placement:"below"}),v=N.useRef(null),D=N.useRef(null);N.useEffect(()=>{if(!h||!D.current)return;const C=()=>{var W,$;if(!D.current)return;const O=D.current.getBoundingClientRect(),A=((W=v.current)==null?void 0:W.offsetHeight)||180,_=window.innerHeight-O.bottom,S=O.top,I=8;let P="below",U;_<A+I&&S>_?(P="above",U=O.top+window.scrollY-A-I):U=O.bottom+window.scrollY+I;let F=O.left+window.scrollX;const H=(($=v.current)==null?void 0:$.offsetWidth)||220;F+H>window.innerWidth-I&&(F=window.innerWidth-H-I),F<I&&(F=I),b({top:U,left:F,placement:P})};C(),requestAnimationFrame(C)},[h]),N.useEffect(()=>{if(!h)return;function C(O){v.current&&!v.current.contains(O.target)&&D.current&&!D.current.contains(O.target)&&p(!1)}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[h]),N.useEffect(()=>{if(!h)return;function C(O){O.key==="Escape"&&p(!1)}return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[h]);const k=l?l.replace(/_/g," ").replace(/\b\w/g,C=>C.toUpperCase()):c?c.replace(".."," to "):null,E=o!==void 0?`${o>=0?"+":""}${o.toFixed(1)}%`:null,T=o!==void 0?o>=0?"var(--yc-color-success)":"var(--yc-color-danger)":void 0;return f.jsxs(f.Fragment,{children:[f.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&&lu.createPortal(f.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:[f.jsx("div",{className:"font-medium mb-2",style:{color:"var(--yc-color-text)"},children:t}),f.jsxs("div",{className:"flex items-baseline gap-2 mb-2",children:[f.jsx("span",{className:"text-2xl font-bold",style:{color:"var(--yc-color-text)"},children:n}),r&&r!=="value"&&r!=="formatted"&&f.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["(",r,")"]})]}),E&&f.jsxs("div",{className:"text-sm mb-2",style:T?{color:T}:void 0,children:[E," vs previous period",i!==void 0&&f.jsxs("span",{className:"ml-1",style:{color:"var(--yc-color-text-secondary)"},children:["(",(d==null?void 0:d.type)==="currency"?"$":"",i.toLocaleString(),")"]})]}),f.jsx("div",{className:"border-t my-2",style:{borderColor:"var(--yc-color-border)"}}),f.jsxs("div",{className:"flex items-center gap-2 text-xs",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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?f.jsx("span",{children:k}):f.jsx("span",{className:"italic",children:"Follows dashboard filter"})]}),f.jsxs("div",{className:"flex items-center gap-2 text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"})}),f.jsx("span",{children:e})]})]}),document.body)]})}function rR(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 o=r[1],i=r[2],l=r[3];if(!o)continue;let c;if(l){const h=l.match(/^(\d{4}-\d{2}-\d{2})\.\.(\d{4}-\d{2}-\d{2})$/);h?c={startDate:h[1],endDate:h[2]}:c={preset:l}}const d=`${o}:${i||""}:${l||""}`;n.has(d)||n.set(d,{chartName:o,field:i,locked:c})}return Array.from(n.values())}function sR(e){return Array.from(new Set(e.map(t=>t.chartName)))}function oR(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 aR(e,t){if(e.locked){if(e.locked.preset)return pi({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 pi(t)}function nm(e){const t=e.locked?e.locked.preset||`${e.locked.startDate}..${e.locked.endDate}`:"current";return`${e.chartName}:${e.field||"value"}:${t}`}function iR(e,t){const n=sR(e),r=N.useMemo(()=>{const p=new Map;return e.forEach(y=>{const b=aR(y,t),v=`${y.chartName}:${JSON.stringify(b)}`;p.has(v)||p.set(v,{chartName:y.chartName,params:b,refs:[]}),p.get(v).refs.push(y)}),Array.from(p.values())},[e,t]),o=Zg({queries:r.map(p=>({queryKey:["chartData",p.chartName,p.params],queryFn:()=>xt.queryChart(p.chartName,p.params),enabled:r.length>0}))}),i=Zg({queries:n.map(p=>({queryKey:["chart",p],queryFn:()=>xt.getChart(p),enabled:n.length>0}))}),l=N.useMemo(()=>{const p={};return n.forEach((y,b)=>{const v=i[b];v!=null&&v.data&&(p[y]=v.data)}),p},[n,i]),c=N.useMemo(()=>{const p={};return r.forEach((y,b)=>{var E,T,C;const v=o[b],D=(E=l[y.chartName])==null?void 0:E.chart;if(!((C=(T=v==null?void 0:v.data)==null?void 0:T.rows)!=null&&C[0])||!D)return;const k=v.data.rows[0];y.refs.forEach(O=>{var L,_;const A=nm(O);if(D.type==="kpi"&&((L=D.value)!=null&&L.field)){const S=D.value.field,I=k[S]??0,P={value:I,formatted:oR(I,D.format),fields:{}};if(Object.entries(k).forEach(([U,F])=>{typeof F=="number"&&(P.fields[U]=F)}),(_=D.comparison)!=null&&_.enabled&&D.comparison.field){const U=k[D.comparison.field];U&&U!==0&&(D.comparison.type==="percent_change"?P.change=(I-U)/U*100:P.change=I-U)}p[A]=P}})}),p},[r,o,l]),d=o.some(p=>p.isLoading)||i.some(p=>p.isLoading),h=N.useMemo(()=>{const p={};return n.forEach((y,b)=>{var D;const v=i[b];(D=v==null?void 0:v.data)!=null&&D.title&&(p[y]=v.data.title)}),p},[n,i]);return{values:c,isLoading:d,getRefKey:nm,chartTitles:h}}function lR(e,t,n){const r={};let o=0;return{content:e.replace(/\{\{([a-zA-Z0-9_-]+)(?:\.([a-zA-Z0-9_]+))?(?:@([a-zA-Z0-9_-]+|\d{4}-\d{2}-\d{2}\.\.\d{4}-\d{2}-\d{2}))?\}\}/g,(l,c,d,h)=>{let p,y,b;if(h){const C=h.match(/^(\d{4}-\d{2}-\d{2})\.\.(\d{4}-\d{2}-\d{2})$/);C?(p={startDate:C[1],endDate:C[2]},b=h):(p={preset:h},y=h)}const D=nm({chartName:c,field:d,locked:p}),k=t[D];if(!k)return l;let E;if(d)if(d==="formatted"||d==="value")E=k.formatted;else if(d==="change"&&k.change!==void 0)E=`${k.change>=0?"+":""}${k.change.toFixed(1)}%`;else if(k.fields[d]!==void 0)E=k.fields[d].toLocaleString();else return l;else E=k.formatted;const T=`kpi-ref-${o++}`;return r[T]={chartName:c,chartTitle:n[c]||c,displayValue:E,field:d,change:k.change,previousValue:k.fields.previous_value,lockedPreset:y,lockedRange:b},`<kpi-ref data-ref-id="${T}">${E}</kpi-ref>`}),refData:r}}function uR({filter:e,kpiCharts:t,selectedIndex:n,position:r,onSelect:o,onClose:i}){const l=N.useRef(null),c=N.useMemo(()=>{const d=e.toLowerCase();return t.filter(h=>h.name.toLowerCase().includes(d)||h.title.toLowerCase().includes(d))},[e,t]);return N.useEffect(()=>{function d(h){l.current&&!l.current.contains(h.target)&&i()}return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[i]),N.useEffect(()=>{var h;const d=(h=l.current)==null?void 0:h.querySelector('[data-selected="true"]');d==null||d.scrollIntoView({block:"nearest"})},[n]),c.length===0?null:lu.createPortal(f.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((d,h)=>f.jsxs("button",{"data-selected":h===n,onMouseDown:p=>{p.preventDefault(),o(d.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:[f.jsx("span",{className:"font-medium truncate",children:d.title}),f.jsx("span",{className:"text-xs font-mono truncate",style:{color:"var(--yc-color-text-muted)"},children:`{{${d.name}}}`})]},d.name))}),document.body)}function cR({content:e,onUpdate:t,isContentEditing:n,onEditStart:r,onEditEnd:o,dashboardName:i}){const{isEditing:l}=Si(),[c,d]=N.useState(e),h=N.useRef(null),[p,y]=N.useState(null),[b,v]=N.useState({top:0,left:0}),D=N.useRef(null),[k,E]=N.useState(!1),[T,C]=N.useState(null),[O,A]=N.useState(null),[L,_]=N.useState({top:0,left:0}),S=Xe(oe=>oe.globalFilters),{data:I}=hr({queryKey:["config"],queryFn:()=>xt.getConfig()}),P=N.useMemo(()=>(I==null?void 0:I.charts.filter(oe=>oe.type==="kpi"))||[],[I]),U=N.useMemo(()=>rR(e),[e]),{values:F,isLoading:H,chartTitles:W}=iR(U,S),{content:$,refData:Q}=N.useMemo(()=>H||Object.keys(F).length===0?{content:e,refData:{}}:lR(e,F,W),[e,F,H,W]),ne=N.useMemo(()=>({"kpi-ref":({children:oe,...fe})=>{const _e=fe["data-ref-id"],Ee=_e?Q[_e]:null;return Ee?f.jsx(nR,{chartName:Ee.chartName,chartTitle:Ee.chartTitle,displayValue:Ee.displayValue,field:Ee.field,change:Ee.change,previousValue:Ee.previousValue,lockedPreset:Ee.lockedPreset,lockedRange:Ee.lockedRange}):f.jsx("span",{children:oe})}}),[Q]);N.useEffect(()=>{n||d(e)},[e,n]),N.useEffect(()=>{n&&h.current&&h.current.focus()},[n]);const me=()=>{t==null||t(c),y(null),o==null||o()},ee=()=>{d(e),y(null),o==null||o()},ce=()=>{const oe=h.current,fe=D.current;if(!oe||!fe)return;const _e=oe.selectionStart,Ee=oe.value.substring(0,_e);fe.textContent=Ee;const Fe=oe.getBoundingClientRect(),$e=fe.offsetWidth,st=parseFloat(getComputedStyle(oe).lineHeight)||18,Je=oe.clientWidth-16,tt=Ee.split(`
125
+ `),Te=tt[tt.length-1]||"";fe.textContent=Te;const Re=Math.min(fe.offsetWidth,Je),te=(tt.length-1+Math.floor($e/Je))*st;v({top:Fe.top+te+st+4-oe.scrollTop,left:Fe.left+Re+8})},M=()=>{const oe=h.current,fe=D.current;if(!oe||!fe)return;const _e=oe.selectionStart,Ee=oe.value.substring(0,_e),Fe=oe.getBoundingClientRect(),$e=parseFloat(getComputedStyle(oe).lineHeight)||18,st=oe.clientWidth-16,Je=Ee.split(`
126
+ `),tt=Je[Je.length-1]||"";fe.textContent=tt;const Te=Math.min(fe.offsetWidth,st);fe.textContent=Ee;const se=(Je.length-1+Math.floor(fe.offsetWidth/st))*$e;_({top:Fe.top+se+$e+4-oe.scrollTop,left:Fe.left+Te+8})},G=N.useMemo(()=>{if(!(p!=null&&p.active))return[];const oe=p.filter.toLowerCase();return P.filter(fe=>fe.name.toLowerCase().includes(oe)||fe.title.toLowerCase().includes(oe))},[p,P]),ae=oe=>{if(!p||!h.current)return;const fe=h.current,_e=c.substring(0,p.startPos),Ee=c.substring(fe.selectionStart),Fe=`{{${oe}}}`,$e=_e+Fe+Ee;d($e),y(null);const st=_e.length+Fe.length;setTimeout(()=>{fe.selectionStart=fe.selectionEnd=st,fe.focus()},0)},j=oe=>{if(!h.current)return;const fe=h.current,_e=fe.selectionStart,Ee=c.lastIndexOf(`
127
+ `,_e-1)+1,Fe=c.indexOf(`
128
+ `,_e),$e=Fe===-1?c.length:Fe,st=c.substring(0,Ee),Je=c.substring($e),tt=st+oe+" "+Je;d(tt),A(null);const Te=Ee+oe.length+1;setTimeout(()=>{fe.selectionStart=fe.selectionEnd=Te,fe.focus()},0)},le=async(oe,fe,_e)=>{E(!0),C(null);const Ee=fe==="replace"?"⏳ Generating...":Bc(c,_e,"⏳ Generating...");d(Ee);const Fe=Bc(c,_e,"").replace(/\n\n\n+/g,`
129
+
130
+ `).trim();try{const $e=await xt.generateText({prompt:oe,mode:fe,dashboard:i,existingContent:fe==="insert"?Fe:void 0,filters:S});d(fe==="replace"?$e.content:Bc(Ee,"⏳ Generating...",$e.content))}catch($e){const st=$e instanceof Error?$e.message:"Generation failed";C(st),d(fe==="replace"?_e:Bc(Ee,"⏳ Generating...",_e))}finally{E(!1)}},he=oe=>{if(O!=null&&O.active){const Re=O.filter.toLowerCase(),se=ZE.filter(te=>te.command.toLowerCase().includes(Re)||te.description.toLowerCase().includes(Re));if(oe.key==="ArrowDown"){oe.preventDefault(),A(te=>te?{...te,selectedIndex:Math.min(te.selectedIndex+1,se.length-1)}:null);return}if(oe.key==="ArrowUp"){oe.preventDefault(),A(te=>te?{...te,selectedIndex:Math.max(te.selectedIndex-1,0)}:null);return}if(oe.key==="Enter"||oe.key==="Tab"){oe.preventDefault();const te=se[O.selectedIndex];te&&j(te.command);return}if(oe.key==="Escape"){oe.preventDefault(),A(null);return}}if(p!=null&&p.active){if(oe.key==="ArrowDown"){oe.preventDefault(),y(Re=>Re?{...Re,selectedIndex:Math.min(Re.selectedIndex+1,G.length-1)}:null);return}if(oe.key==="ArrowUp"){oe.preventDefault(),y(Re=>Re?{...Re,selectedIndex:Math.max(Re.selectedIndex-1,0)}:null);return}if(oe.key==="Enter"||oe.key==="Tab"){oe.preventDefault();const Re=G[p.selectedIndex];Re&&ae(Re.name);return}if(oe.key==="Escape"){oe.preventDefault(),y(null);return}}if(oe.key==="Escape"){oe.preventDefault(),ee();return}if(oe.key!=="Enter")return;const fe=h.current;if(fe){const Re=fe.selectionStart,se=c.substring(0,Re),te=se.lastIndexOf(`
131
+ `)+1,ge=se.substring(te),Ne=tR(ge);if(Ne&&i){oe.preventDefault(),le(Ne.prompt,Ne.mode,ge);return}}const _e=oe.currentTarget,{selectionStart:Ee,value:Fe}=_e,$e=Fe.substring(0,Ee),st=$e.lastIndexOf(`
132
+ `)+1,Je=$e.substring(st),tt=Je.match(/^(\s*)([-*])\s(.*)$/);if(tt){const Re=tt[1]??"",se=tt[2]??"-";if(!(tt[3]??"").trim()){oe.preventDefault();const qe=Fe.substring(0,st)+Fe.substring(Ee);d(qe),setTimeout(()=>{_e.selectionStart=_e.selectionEnd=st},0);return}oe.preventDefault();const ge=`
133
+ ${Re}${se} `,Ne=Fe.substring(0,Ee)+ge+Fe.substring(Ee);d(Ne),setTimeout(()=>{_e.selectionStart=_e.selectionEnd=Ee+ge.length},0);return}const Te=Je.match(/^(\s*)(\d+)\.\s(.*)$/);if(Te){const Re=Te[1]??"",se=Te[2]??"1";if(!(Te[3]??"").trim()){oe.preventDefault();const pt=Fe.substring(0,st)+Fe.substring(Ee);d(pt),setTimeout(()=>{_e.selectionStart=_e.selectionEnd=st},0);return}oe.preventDefault();const ge=parseInt(se,10)+1,Ne=`
134
+ ${Re}${ge}. `,qe=Fe.substring(0,Ee)+Ne+Fe.substring(Ee);d(qe),setTimeout(()=>{_e.selectionStart=_e.selectionEnd=Ee+Ne.length},0);return}},pe=oe=>{T&&C(null);const fe=oe.target.value,_e=oe.target.selectionStart;d(fe);const Ee=fe.substring(0,_e),Fe=Ee.lastIndexOf("{");if(Fe>=0){const Je=Ee.substring(Fe+1);if(!Je.includes("}")&&!Je.includes(`
135
+ `)){const tt=Je.replace(/^\{/,"");y({active:!0,startPos:Fe,filter:tt,selectedIndex:0}),setTimeout(ce,0);return}}y(null);const $e=Ee.lastIndexOf(`
136
+ `)+1,st=Ee.substring($e);if(st.startsWith("/")&&!st.includes(" ")){const Je=st.substring(1);A({active:!0,filter:Je,selectedIndex:0}),setTimeout(M,0)}else O!=null&&O.active&&A(null)},Oe=oe=>{const fe=oe.relatedTarget;fe!=null&&fe.closest("[data-kpi-autocomplete]")||k||me()};return n?f.jsxs("div",{className:"h-full relative",children:[f.jsx("textarea",{ref:h,value:c,onChange:pe,onKeyDown:he,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"}),f.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)&&G.length>0&&f.jsx(uR,{filter:p.filter,kpiCharts:P,selectedIndex:p.selectedIndex,position:b,onSelect:ae,onClose:()=>y(null)}),(O==null?void 0:O.active)&&f.jsx(eR,{filter:O.filter,selectedIndex:O.selectedIndex,position:L,onSelect:j,onClose:()=>A(null)}),T&&f.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:T})]}):f.jsxs("div",{className:"h-full p-4 overflow-auto flex flex-col justify-center",style:{containerType:"size"},children:[f.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:f.jsx(j5,{rehypePlugins:[ZL],components:ne,children:$})}),l&&t&&!e&&f.jsx("div",{className:"text-sm italic",style:{color:"var(--yc-color-text-muted)"},children:"Double-click to edit"})]})}function dR({children:e,onRemove:t,widgetType:n,onDoubleClick:r,isContentEditing:o}){const{isEditing:i}=Si();return f.jsxs("div",{className:nr("h-full relative",i&&"ring-2 ring-blue-200",i&&!o&&"select-none"),style:{background:"var(--yc-color-surface)",borderRadius:"var(--yc-radius)",boxShadow:"var(--yc-shadow)",border:"var(--yc-card-border)"},children:[i&&f.jsxs(f.Fragment,{children:[!(n==="text"&&o)&&f.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&&f.jsx("div",{className:"absolute top-1 right-1 z-10",children:f.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:f.jsx("svg",{className:"w-3 h-3 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})})]}),f.jsx("div",{className:"h-full",children:e})]})}const Ol=38,eT=12,fR={lg:1024,md:768,sm:0},hR={lg:12,md:6,sm:1};function mR(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 pR(e){const t=[...e].sort((r,o)=>r.y-o.y||r.x-o.x),n=[];return t.map(r=>{let o=0;for(const l of n)r.x<l.x+l.w&&r.x+r.w>l.x&&(o=Math.max(o,l.y+l.h));const i={...r,y:o};return n.push(i),i})}const yR=40;function gR(e){const t=[];for(let n=0;n<e;n++)for(let r=0;r<eT;r++)t.push({i:`bg-${n}-${r}`,x:r,y:n,w:1,h:1,static:!0});return t}const tT=gR(yR),bR=tT.map(e=>f.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 xR({layout:e,onLayoutChange:t,dashboardName:n}){const{isEditing:r,setPendingLayout:o,setOriginalLayout:i,currentLayout:l,removeWidget:c,updateWidget:d}=Si(),h=dm(),p=N.useRef(""),y=N.useRef(""),b=N.useRef(null),[v,D]=N.useState(0),[k,E]=N.useState(null),T=N.useRef(0),C=N.useRef(!1);N.useEffect(()=>{const $=b.current;if(!$)return;const Q=new ResizeObserver(ne=>{var ee;const me=(ee=ne[0])==null?void 0:ee.contentRect.width;me&&me>0&&D(Math.floor(me))});return Q.observe($),()=>Q.disconnect()},[]),N.useEffect(()=>{const $=JSON.stringify(e);$!==p.current&&(p.current=$,i(e))},[e,i]),N.useEffect(()=>{r||E(null)},[r]);const O=l||e,A=O.gap??16,{gridLayout:L,widgetMap:_,widgetList:S}=N.useMemo(()=>{const $=[],Q=new Map,ne=[];let me=0;const ee=new Set;return O.rows.forEach((M,G)=>{let ae=0,j=0;M.widgets.forEach((le,he)=>{let pe=mR(le);if(ee.has(pe)){let _e=2;for(;ee.has(`${pe}-${_e}`);)_e++;pe=`${pe}-${_e}`}ee.add(pe);const Oe=le.height??M.height,oe=Math.ceil(Oe/Ol),fe={i:pe,x:le.x??ae,y:le.y??me,w:le.cols,h:oe,minW:1,minH:1,static:!r||k===pe};$.push(fe),Q.set(pe,{widget:le,rowIndex:G,widgetIndex:he}),ne.push({id:pe,widget:le,rowIndex:G,widgetIndex:he}),ae+=le.cols,j=Math.max(j,oe)}),me+=j}),{gridLayout:pR($),widgetMap:Q,widgetList:ne}},[O,r,k]);N.useEffect(()=>{r&&S.length>T.current&&setTimeout(()=>{var $;($=b.current)==null||$.scrollIntoView({behavior:"smooth",block:"end"})},100),T.current=S.length},[S.length,r]);const I=N.useMemo(()=>ED(L),[L]),P=N.useCallback($=>{const ne=[...$.filter(G=>_.has(G.i))].sort((G,ae)=>G.y-ae.y||G.x-ae.x),me=ne.map(G=>`${G.i}:${G.x},${G.y},${G.w},${G.h}`).join("|");if(me===y.current)return null;y.current=me;const ee=new Map;ne.forEach(G=>{const ae=_.get(G.i);if(!ae)return;let j=ee.get(G.y);j||(j={items:[]},ee.set(G.y,j));const le=G.h*Ol;j.items.push({item:G,widget:{...ae.widget,cols:G.w,height:le,x:G.x,y:G.y}})});const ce=[],M=[...ee.keys()].sort((G,ae)=>G-ae);for(const G of M){const ae=ee.get(G),j=Math.max(...ae.items.map(le=>le.item.h));ce.push({height:j*Ol,widgets:ae.items.map(le=>le.widget)})}return{gap:O.gap,rows:ce}},[_,O.gap]),U=N.useCallback($=>{if(!r||C.current)return;const Q=P($);Q&&(o(Q),t==null||t(Q))},[r,P,o,t]),F=N.useCallback($=>{if(C.current=!1,!r)return;const Q=P($);Q&&(o(Q),t==null||t(Q))},[r,P,o,t]),H=N.useCallback(($,Q)=>{c($,Q)},[c]),W=N.useCallback(($,Q,ne)=>{d($,Q,{content:ne})},[d]);return f.jsxs(f.Fragment,{children:[!r&&f.jsx("style",{children:".react-resizable-handle { display: none !important; }"}),r&&f.jsx("style",{children:`
137
+ .react-grid-placeholder {
138
+ background: rgba(59, 130, 246, 0.15) !important;
139
+ border: 2px dashed rgba(59, 130, 246, 0.4) !important;
140
+ border-radius: var(--yc-radius) !important;
141
+ opacity: 1 !important;
142
+ }
143
+ .yc-edit-grid .react-grid-item {
144
+ transition: all 200ms ease !important;
145
+ }
146
+ .yc-edit-grid .react-grid-item.react-draggable-dragging {
147
+ transition: none !important;
148
+ z-index: 100;
149
+ box-shadow: 0 8px 25px rgba(0,0,0,0.15);
150
+ }
151
+ .yc-edit-grid .react-resizable-handle {
152
+ background: none !important;
153
+ width: 24px !important;
154
+ height: 24px !important;
155
+ z-index: 10 !important;
156
+ }
157
+ .yc-edit-grid .react-resizable-handle::after {
158
+ content: '' !important;
159
+ position: absolute !important;
160
+ right: 4px !important;
161
+ bottom: 4px !important;
162
+ width: 10px !important;
163
+ height: 10px !important;
164
+ border-right: 2px solid rgba(59,130,246,0.4) !important;
165
+ border-bottom: 2px solid rgba(59,130,246,0.4) !important;
166
+ border-radius: 0 0 2px 0 !important;
167
+ }
168
+ .yc-edit-grid .react-resizable-handle:hover::after {
169
+ border-color: rgba(59,130,246,0.8) !important;
170
+ }
171
+ .yc-bg-grid {
172
+ position: absolute !important;
173
+ inset: 0 !important;
174
+ pointer-events: none !important;
175
+ z-index: 0 !important;
176
+ overflow: hidden !important;
177
+ }
178
+ .yc-bg-grid .react-grid-item {
179
+ transition: none !important;
180
+ }
181
+ .yc-edit-grid {
182
+ position: relative;
183
+ }
184
+ .yc-edit-grid > .react-grid-item {
185
+ z-index: 1;
186
+ }
187
+ `}),f.jsxs("div",{ref:b,style:{position:"relative"},children:[v>0&&r&&h==="lg"&&f.jsx(xD,{className:"yc-bg-grid",layout:tT,cols:eT,rowHeight:Ol,width:v,margin:[A,A],useCSSTransforms:!0,compactType:null,isDraggable:!1,isResizable:!1,autoSize:!1,children:bR}),v>0&&f.jsx(vD,{className:r?"layout yc-edit-grid":"layout",layouts:I,breakpoints:fR,cols:hR,rowHeight:Ol,width:v,margin:[A,A],isDraggable:r&&h==="lg",isResizable:r&&h==="lg",onLayoutChange:($,Q)=>{Q.lg&&U(Q.lg)},onDragStart:()=>{C.current=!0},onResizeStart:()=>{C.current=!0},onDragStop:$=>F([...$]),onResizeStop:$=>F([...$]),compactType:"vertical",autoSize:!0,useCSSTransforms:!0,children:S.map(({id:$,widget:Q,rowIndex:ne,widgetIndex:me})=>f.jsx("div",{className:"h-full",children:f.jsxs(dR,{onRemove:()=>H(ne,me),widgetType:Q.type,isContentEditing:k===$,onDoubleClick:Q.type==="text"?()=>E($):void 0,children:[Q.type==="chart"&&Q.ref&&f.jsx(SD,{chartRef:Q.ref}),Q.type==="text"&&f.jsx(cR,{content:Q.content||"",onUpdate:ee=>W(ne,me,ee),isContentEditing:k===$,onEditStart:()=>E($),onEditEnd:()=>E(null),dashboardName:n})]})},$))})]})]})}function vR({isOpen:e,onClose:t,onAdd:n,existingCharts:r}){const{data:o}=ma(),[i,l]=N.useState(""),c=N.useRef(null);if(N.useEffect(()=>{const y=v=>{v.key==="Escape"&&t()},b=v=>{c.current&&!c.current.contains(v.target)&&t()};return e&&(document.addEventListener("keydown",y),document.addEventListener("mousedown",b)),()=>{document.removeEventListener("keydown",y),document.removeEventListener("mousedown",b)}},[e,t]),!e)return null;const h=((o==null?void 0:o.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 f.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:f.jsxs("div",{ref:c,className:"rounded-lg shadow-xl w-full max-w-md mx-4",style:{backgroundColor:"var(--yc-color-surface)"},children:[f.jsxs("div",{className:"p-4 border-b",style:{borderColor:"var(--yc-color-border)"},children:[f.jsxs("div",{className:"flex items-center justify-between mb-3",children:[f.jsx("h2",{className:"text-lg font-semibold",style:{color:"var(--yc-color-text)"},children:"Add Chart"}),f.jsx("button",{onClick:t,className:"p-1 hover:opacity-80",style:{color:"var(--yc-color-text-muted)"},children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.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})]}),f.jsx("div",{className:"max-h-80 overflow-y-auto",children:h.length===0?f.jsx("div",{className:"p-4 text-center text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"No charts found"}):f.jsx("div",{className:"p-2",children:h.map(y=>{const b=r.includes(y.name);return f.jsxs("button",{onClick:()=>p(y.name),disabled:b,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:[f.jsxs("div",{children:[f.jsx("div",{className:"font-medium",style:{color:"var(--yc-color-text)"},children:y.title}),f.jsx("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:y.name}),y.description&&f.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:y.description})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.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}),b?f.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-success)"},children:"Added"}):f.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:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})]})]},y.name)})})})]})})}function ER(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 TR({dashboardId:e,title:t,description:n,contentRef:r,activeTab:o}){const{isEditing:i,setIsEditing:l,pendingLayout:c,setPendingLayout:d,setOriginalLayout:h,hasChanges:p,addWidget:y,currentLayout:b,undo:v,redo:D,canUndo:k,canRedo:E}=Si(),T=dm(),C=d_(e),O=f_(),A=_k({queryKey:["chartData"]}),L=Wn(),_=(()=>{const M=L.getQueryCache();let G=0;for(const ae of M.getAll()){const j=ae.queryKey[0];(j==="chartData"||j==="chartWithData")&&ae.state.dataUpdatedAt>G&&(G=ae.state.dataUpdatedAt)}return G>0?G:null})(),[S,I]=N.useState(!1),[P,U]=N.useState(!1),[F,H]=N.useState(!1),[W,$]=N.useState(!1),Q=(b==null?void 0:b.rows.flatMap(M=>M.widgets.filter(G=>G.type==="chart"&&G.ref).map(G=>G.ref)))||[],ne=()=>{O()},me=async M=>{if(r.current){$(!0),I(!1);try{M==="pdf"?await M3(r.current,`${e}-dashboard`,t):await I3(r.current,`${e}-dashboard`,M)}finally{$(!1)}}},ee=async()=>{if(c)try{await C.mutateAsync({layout:c,tab:o}),h(c),d(null),l(!1)}catch(M){console.error("Failed to save:",M)}},ce=()=>{d(null),l(!1)};return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"border-b",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-surface)"},children:[f.jsxs("div",{className:"flex items-center justify-between p-4",children:[f.jsx("div",{children:f.jsx("h1",{className:"text-xl font-semibold",style:{color:"var(--yc-color-text)"},children:t})}),f.jsx("div",{className:"flex items-center gap-2",children:i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"relative",children:[f.jsxs("button",{onClick:()=>H(!F),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:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add Widget",f.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),F&&f.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:[f.jsxs("button",{onClick:()=>{H(!1),U(!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:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"]}),f.jsxs("button",{onClick:()=>{H(!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:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h7"})}),"Text"]})]})]}),f.jsxs("div",{className:"flex items-center",children:[f.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:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h10a5 5 0 015 5v2M3 10l4-4m-4 4l4 4"})})}),f.jsx("button",{onClick:D,disabled:!E,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:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 10H11a5 5 0 00-5 5v2m15-7l-4-4m4 4l-4 4"})})})]}),f.jsx("div",{className:"w-px h-6 mx-2",style:{backgroundColor:"var(--yc-color-border)"}}),f.jsx("button",{onClick:ce,className:"px-4 py-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"Cancel"}),f.jsx("button",{onClick:ee,disabled:!p||C.isPending,className:nr("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:C.isPending?"Saving...":"Save & Push"})]}):f.jsxs(f.Fragment,{children:[_&&A===0&&f.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},title:new Date(_).toLocaleString(),children:["Updated ",ER(_)]}),f.jsx("button",{onClick:ne,disabled:A>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:f.jsx("svg",{className:nr("w-5 h-5",A>0&&"animate-spin"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"})})}),f.jsxs("div",{className:"relative",children:[f.jsx("button",{onClick:()=>I(!S),disabled:W,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-50",style:{color:"var(--yc-color-text-secondary)"},title:"Export dashboard",children:W?f.jsxs("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),f.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"})]}):f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"})})}),S&&f.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:[f.jsxs("button",{onClick:()=>me("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:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"]}),f.jsxs("button",{onClick:()=>me("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:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"]}),f.jsxs("button",{onClick:()=>me("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:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"]})]})]}),T==="lg"?f.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:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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"})})}):f.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:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.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&&f.jsx("p",{className:"px-4 pb-3 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:n})]}),f.jsx(vR,{isOpen:P,onClose:()=>U(!1),onAdd:y,existingCharts:Q})]})}function wR({filters:e,isEditing:t,onReorder:n,onRename:r,showCrossFilters:o}){const[i,l]=N.useState(null),[c,d]=N.useState(null),h=Xe(A=>A.globalFilters),p=Xe(A=>A.resetFilters),y=Xe(A=>A.crossFilters),b=Xe(A=>A.clearCrossFilter),v=Xe(A=>A.clearAllCrossFilters),D=o?Object.values(y):[];if(e.length===0&&D.length===0)return null;const k=e.some(A=>{const L=h[A.name];if(L==null||L===""||Array.isArray(L)&&L.length===0)return!1;const _=A.default??(A.type==="date_range"?"last_30_days":void 0);return JSON.stringify(L)!==JSON.stringify(_)});function E(A,L){l(L),A.dataTransfer.effectAllowed="move"}function T(A,L){A.preventDefault(),A.dataTransfer.dropEffect="move",d(L)}function C(A,L){if(A.preventDefault(),i===null||i===L)return;const _=[...e],S=_.splice(i,1)[0];_.splice(L,0,S),n==null||n(_),l(null),d(null)}function O(){l(null),d(null)}return t?f.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.map((A,L)=>{const _=A.label||ca(A.name),S=i===L?"opacity-50":"";return f.jsxs("div",{draggable:!0,onDragStart:I=>E(I,L),onDragOver:I=>T(I,L),onDrop:I=>C(I,L),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 ${S}`,style:c===L?{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:[f.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:f.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"})}),f.jsx(kR,{value:_,onChange:I=>r==null?void 0:r(L,I)}),f.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:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]},A.name)})}):f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.map(A=>{const L=A.label||ca(A.name),_=typeof A.default=="string"?A.default:void 0;switch(A.type){case"date_range":return f.jsx(_2,{name:A.name,label:L,defaultValue:_},A.name);case"select":{const S=(A.options||[]).map(I=>typeof I=="string"?{value:I,label:I}:I);return f.jsx(Jc,{name:A.name,label:L,options:S,defaultValue:_},A.name)}case"dynamic_select":return A.source?f.jsx(Jc,{name:A.name,label:L,source:A.source,defaultValue:_},A.name):f.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[L,": dynamic_select requires source"]},A.name);case"multi_select":{const S=(A.options||[]).map(I=>typeof I=="string"?{value:I,label:I}:I);return f.jsx(N2,{name:A.name,label:L,options:S,defaultValue:Array.isArray(A.default)?A.default:void 0,source:A.source},A.name)}case"text":return f.jsx(A2,{name:A.name,label:L,defaultValue:_},A.name);case"number":return f.jsx(L2,{name:A.name,label:L,defaultValue:typeof A.default=="number"?A.default:void 0},A.name);case"boolean":return f.jsx(R2,{name:A.name,label:L},A.name);default:return f.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[L,": ",A.type," (not supported)"]},A.name)}}),D.length>0&&e.length>0&&f.jsx("div",{className:"w-px h-6 mx-1",style:{backgroundColor:"var(--yc-color-border)"}}),D.map(A=>f.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,": ",H0(A.value),f.jsx("button",{onClick:()=>b(A.field),className:"ml-0.5 hover:opacity-80","aria-label":`Clear ${A.field} filter`,children:f.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:f.jsx("path",{d:"M3 3l6 6M9 3l-6 6"})})})]},`cf-${A.field}`)),(k||D.length>0)&&f.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]=N.useState(!1),[o,i]=N.useState(e);if(!n)return f.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(){o.trim()&&o!==e&&t(o.trim()),r(!1)}return f.jsx("input",{autoFocus:!0,value:o,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 SR({tabs:e,activeTab:t,onTabChange:n}){const{isEditing:r}=Si();return f.jsx("div",{className:"flex border-b mb-4 mt-2",style:{borderColor:"var(--yc-color-border)"},children:e.map(o=>f.jsx("button",{onClick:()=>n(o.name),disabled:r&&o.name!==t,className:nr("px-4 py-2 text-sm font-medium border-b-2 transition-colors",o.name===t?"border-blue-500 text-blue-600":"border-transparent hover:border-gray-300",r&&o.name!==t&&"opacity-50 cursor-not-allowed hover:border-transparent"),style:o.name!==t?{color:"var(--yc-color-text-secondary)"}:void 0,children:o.label},o.name))})}function CR({dashboardId:e,title:t,description:n,contentRef:r,tabs:o,activeTab:i,onTabChange:l,filters:c}){const{isEditing:d,pendingFilters:h,setPendingFilters:p}=Si(),y=Xe(v=>Object.keys(v.crossFilters).length>0);N.useEffect(()=>{d&&!h&&p([...c])},[d]);const b=d&&h?h:c;return f.jsxs(f.Fragment,{children:[f.jsx(TR,{dashboardId:e,title:t,description:n,contentRef:r,activeTab:o?i:void 0}),o&&i&&l&&f.jsx(SR,{tabs:o,activeTab:i,onTabChange:l}),(b.length>0||!d&&y)&&f.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:f.jsx(wR,{filters:b,isEditing:d,onReorder:v=>p(v),onRename:(v,D)=>{const k=[...b];k[v]={...k[v],label:D},p(k)},showCrossFilters:!d})})]})}function _R({dashboardId:e,branch:t,initialTab:n}){const{data:r,isLoading:o,error:i}=c_(e,t),l=N.useRef(null),c=Wn(),d=Xe(k=>k.globalFilters),[h,p]=N.useState(n||"");N.useEffect(()=>{r&&sessionStorage.setItem("yamchart-last-dashboard",JSON.stringify({name:r.name,title:r.title}))},[r==null?void 0:r.name,r==null?void 0:r.title]),N.useEffect(()=>{if(!(r!=null&&r.tabs))return;const k=r.tabs.map(T=>T.name);if(h&&k.includes(h))return;const E=n&&k.includes(n)?n:k[0];E&&p(E)},[r==null?void 0:r.tabs,n]);const y=Xe(k=>k.clearAllCrossFilters),b=N.useCallback(k=>{var T;p(k),y();const E=`#/dashboards/${e}`;if(window.history.replaceState(null,"",`${E}?tab=${encodeURIComponent(k)}`),r!=null&&r.name){const C=pi(Object.fromEntries(Object.entries(d).filter(([A,L])=>L!=null)));xt.warmDashboardCache(r.name,C,k).catch(()=>{});const O=(T=r.tabs)==null?void 0:T.find(A=>A.name===k);if(O)for(const A of O.layout.rows)for(const L of A.widgets)L.type==="chart"&&L.ref&&c.prefetchQuery({queryKey:["chartWithData",L.ref,C],queryFn:()=>xt.queryChart(L.ref,C,{includeConfig:!0}),staleTime:1e3*60*5})}},[e,r==null?void 0:r.name,r==null?void 0:r.tabs,d,c,y]),v=N.useMemo(()=>{if(r){if(r.tabs){const k=r.tabs.find(E=>E.name===h);return k==null?void 0:k.layout}return r.layout}},[r,h]),D=N.useMemo(()=>{if(!r)return[];const k=r.filters||[];if(r.tabs){const E=r.tabs.find(C=>C.name===h),T=(E==null?void 0:E.filters)||[];return[...k,...T]}return k},[r,h]);return o?f.jsx("div",{className:"flex items-center justify-center h-64",children:f.jsx("div",{style:{color:"var(--yc-color-text-secondary)"},children:"Loading dashboard..."})}):i||!r?f.jsx("div",{className:"flex items-center justify-center h-64",children:f.jsxs("div",{style:{color:"var(--yc-color-danger)"},children:["Failed to load dashboard: ",(i==null?void 0:i.message)||"Unknown error"]})}):v?f.jsx(h4,{children:f.jsxs("div",{style:{backgroundColor:"var(--yc-color-background)"},children:[f.jsx(CR,{dashboardId:e,title:r.title,description:r.description,contentRef:l,tabs:r.tabs,activeTab:h,onTabChange:r.tabs?b:void 0,filters:D}),f.jsx("div",{ref:l,className:"p-6",children:f.jsx(xR,{layout:v,dashboardName:r.name})})]})}):f.jsx("div",{className:"flex items-center justify-center h-64",children:f.jsx("div",{style:{color:"var(--yc-color-text-secondary)"},children:"No layout available"})})}const NR=N.lazy(()=>ls(()=>import("./LoginPage-BT8ikmPn.js"),__vite__mapDeps([0,1])).then(e=>({default:e.LoginPage}))),DR=N.lazy(()=>ls(()=>import("./SetupWizard-njrOhCzw.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SetupWizard}))),OR=N.lazy(()=>ls(()=>import("./UserManagement-tiCIT4UY.js"),__vite__mapDeps([3,1])).then(e=>({default:e.UserManagement}))),AR=N.lazy(()=>ls(()=>import("./ShareManagement-Bg16oJhW.js"),__vite__mapDeps([4,1])).then(e=>({default:e.ShareManagement}))),IR=N.lazy(()=>ls(()=>import("./PublicViewer-B4uFxgbt.js"),__vite__mapDeps([5,1])).then(e=>({default:e.PublicViewer}))),MR=N.lazy(()=>ls(()=>import("./EventManagement-BlxJ2TFw.js"),__vite__mapDeps([6,1])).then(e=>({default:e.EventManagement}))),Hc=()=>f.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:f.jsx("div",{className:"text-gray-500",children:"Loading..."})});function ax(e){const t=e.replace(/^#?/,""),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,o]=t.split("?"),i=r==null?void 0:r.match(/^\/public\/(charts|dashboards)\/(.+)$/);if(i&&i[1]&&i[2]){const y={};if(o)for(const[b,v]of new URLSearchParams(o).entries())y[b]=v;return{type:i[1]==="dashboards"?"public_dashboard":"public_chart",name:decodeURIComponent(i[2]),params:y}}const[l,c]=t.split("?"),d=l==null?void 0:l.match(/^\/(charts)\/(.+)\/detail$/);if(d&&d[2]){const y={};if(c)for(const[b,v]of new URLSearchParams(c).entries())y[b]=v;return{type:"chart_detail",name:decodeURIComponent(d[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,b]of new URLSearchParams(c).entries())p[y]=b;return{type:h[1]==="dashboards"?"dashboard":"chart",name:decodeURIComponent(h[2]),params:p}}function LR(e,t){return f.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:f.jsxs("div",{className:"text-center max-w-md p-8",children:[f.jsx("div",{className:"w-12 h-12 mx-auto mb-4 rounded-full bg-red-50 flex items-center justify-center",children:f.jsx("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.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"})})}),f.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:"Something went wrong"}),f.jsx("p",{className:"text-sm text-gray-500 mt-2",children:e.message}),f.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 RR(){m_();const e=ko(v=>v.auth),t=ko(v=>v.checkAuth);N.useEffect(()=>{t()},[t]);const{data:n,isLoading:r}=ma(),{data:o,isLoading:i}=t2(),l=Xe(v=>v.clearAllCrossFilters),[c,d]=N.useState(()=>window.location.hash.replace(/^#/,"")||"");N.useEffect(()=>{const v=()=>{d(window.location.hash.replace(/^#/,"")||""),l()};return window.addEventListener("hashchange",v),()=>window.removeEventListener("hashchange",v)},[l]);const h=N.useCallback(v=>{window.location.hash=v,d(v),l()},[l]);N.useEffect(()=>{r||i||c||(o&&o.length>0&&o[0]?h(`/dashboards/${o[0].name}`):n!=null&&n.charts&&n.charts.length>0&&n.charts[0]&&h(`/charts/${n.charts[0].name}`))},[r,i,o,n,c,h]);const p=ax(c);if(p&&(p.type==="public_chart"||p.type==="public_dashboard"))return f.jsx(N.Suspense,{fallback:f.jsx(Hc,{}),children:f.jsx(IR,{parsed:{type:p.type,name:p.name,params:p.params}})});if(e.status==="loading")return f.jsx(Hc,{});if(e.status==="needs_setup")return f.jsx(N.Suspense,{fallback:f.jsx(Hc,{}),children:f.jsx(DR,{})});if(e.status==="unauthenticated")return f.jsx(N.Suspense,{fallback:f.jsx(Hc,{}),children:f.jsx(NR,{})});if(r||i)return f.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:f.jsx("div",{className:"text-gray-500",children:"Loading..."})});const y=ax(c),b=()=>y?y.type==="settings"&&y.name==="users"?f.jsx(N.Suspense,{fallback:f.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:f.jsx(OR,{})}):y.type==="settings"&&y.name==="shares"?f.jsx(N.Suspense,{fallback:f.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:f.jsx(AR,{})}):y.type==="events"?f.jsx(N.Suspense,{fallback:f.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:f.jsx(MR,{})}):y.type==="dashboard"?f.jsx(_R,{dashboardId:y.name,initialTab:y.params.tab}):y.type==="chart_detail"?f.jsx(d4,{chartName:y.name,params:y.params}):f.jsx(c4,{chartName:y.name,drillParams:y.params}):f.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Select a dashboard or chart from the sidebar"});return f.jsx(Am,{fallback:LR,children:f.jsx(S_,{children:f.jsx(R_,{currentPath:c,onNavigate:h,onNavigateToUsers:()=>h("/settings/users"),onNavigateToShares:()=>h("/settings/shares"),children:b()})})})}Xw.createRoot(document.getElementById("root")).render(f.jsx(N.StrictMode,{children:f.jsx(Nk,{children:f.jsx(RR,{})})}));export{ou as A,V2 as B,rd as C,B2 as D,F0 as E,P2 as F,nv as G,Z2 as H,q2 as L,j5 as M,G2 as P,T3 as S,B0 as T,tv as W,ls as _,xt as a,jx as b,nr as c,e2 as d,ma as e,Tm as f,Xe as g,sv as h,ev as i,f as j,J2 as k,X2 as l,K2 as m,Q2 as n,_R as o,Wn as p,hr as q,Ka as r,ws as s,O3 as t,ko as u,Qa as v,on as w};