@malloy-publisher/sdk 0.0.228 → 0.0.229
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ServerProvider-BnQo3hhW.es.js → ServerProvider-BdQK_q3C.es.js} +780 -715
- package/dist/ServerProvider-n4SO1thp.cjs.js +1 -0
- package/dist/client/api.d.ts +79 -1
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +1 -1
- package/dist/components/Materializations/CreateEnvMaterializationDialog.d.ts +14 -0
- package/dist/components/Materializations/EnvironmentMaterializations.d.ts +7 -0
- package/dist/components/Materializations/MaterializationDetailDialog.d.ts +2 -1
- package/dist/components/Materializations/MaterializationRunsList.d.ts +5 -1
- package/dist/components/Materializations/ScheduleCard.d.ts +20 -0
- package/dist/components/Materializations/SectionLabel.d.ts +10 -0
- package/dist/components/Materializations/SetScheduleDialog.d.ts +11 -0
- package/dist/components/Materializations/TriggerChip.d.ts +10 -0
- package/dist/components/Materializations/cron.d.ts +23 -0
- package/dist/components/Materializations/index.d.ts +1 -0
- package/dist/components/Materializations/utils.d.ts +9 -0
- package/dist/components/Notebook/Notebook.d.ts +6 -1
- package/dist/components/Notebook/NotebookCell.d.ts +3 -1
- package/dist/components/RenderedResult/ResultContainer.d.ts +3 -1
- package/dist/components/RenderedResult/renderLogs.d.ts +6 -0
- package/dist/components/ResultsDialog.d.ts +3 -1
- package/dist/constants/docLinks.d.ts +6 -0
- package/dist/{core-DYlbkyc-.cjs.js → core-BJUrppec.cjs.js} +1 -1
- package/dist/{core-CEDZMHV1.es.js → core-Coi3caGs.es.js} +1 -1
- package/dist/index-DWcuaQOW.cjs.js +309 -0
- package/dist/{index-DC7gIcJX.es.js → index-mbDUet0T.es.js} +34625 -25301
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +54 -52
- package/dist/utils/queryClient.d.ts +5 -0
- package/package.json +3 -1
- package/src/components/Environment/AddPackageDialog.tsx +2 -1
- package/src/components/Environment/Environment.tsx +8 -0
- package/src/components/Home/Home.tsx +5 -4
- package/src/components/Materializations/CreateEnvMaterializationDialog.tsx +176 -0
- package/src/components/Materializations/EnvironmentMaterializations.tsx +264 -0
- package/src/components/Materializations/ManifestView.tsx +2 -3
- package/src/components/Materializations/MaterializationDetailDialog.tsx +121 -95
- package/src/components/Materializations/MaterializationRunsList.tsx +37 -0
- package/src/components/Materializations/Materializations.tsx +86 -1
- package/src/components/Materializations/ScheduleCard.tsx +228 -0
- package/src/components/Materializations/SectionLabel.tsx +27 -0
- package/src/components/Materializations/SetScheduleDialog.tsx +159 -0
- package/src/components/Materializations/TriggerChip.tsx +41 -0
- package/src/components/Materializations/cron.ts +121 -0
- package/src/components/Materializations/index.ts +1 -0
- package/src/components/Materializations/utils.ts +14 -0
- package/src/components/Model/ModelCell.tsx +4 -0
- package/src/components/Notebook/Notebook.tsx +14 -1
- package/src/components/Notebook/NotebookCell.tsx +103 -2
- package/src/components/Package/Package.tsx +14 -3
- package/src/components/QueryResult/QueryResult.tsx +7 -1
- package/src/components/RenderedResult/RenderedResult.tsx +153 -51
- package/src/components/RenderedResult/ResultContainer.tsx +40 -1
- package/src/components/RenderedResult/renderLogs.spec.ts +55 -0
- package/src/components/RenderedResult/renderLogs.ts +40 -0
- package/src/components/ResultsDialog.tsx +4 -0
- package/src/constants/docLinks.ts +17 -0
- package/src/index.ts +1 -0
- package/src/utils/queryClient.ts +14 -0
- package/dist/ServerProvider-CCKhmHeT.cjs.js +0 -1
- package/dist/index-DO6Y8XP_.cjs.js +0 -307
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
"use strict";var Gv=Object.create;var sm=Object.defineProperty;var Qv=Object.getOwnPropertyDescriptor;var Xv=Object.getOwnPropertyNames;var Zv=Object.getPrototypeOf,Jv=Object.prototype.hasOwnProperty;var eT=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Xv(t))!Jv.call(e,o)&&o!==n&&sm(e,o,{get:()=>t[o],enumerable:!(r=Qv(t,o))||r.enumerable});return e};var qs=(e,t,n)=>(n=e!=null?Gv(Zv(e)):{},eT(t||!e||!e.__esModule?sm(n,"default",{value:e,enumerable:!0}):n,e));const c=require("react/jsx-runtime"),w=require("@mui/material"),W=require("react"),Lr=require("@tanstack/react-query"),De=require("./ServerProvider-n4SO1thp.cjs.js"),wu=require("markdown-to-jsx"),On=require("@mui/icons-material"),Ot=require("@mui/system"),tT=require("@emotion/styled"),nT=require("@emotion/react"),Ta=require("react-dom"),eb=require("@react-spring/web"),rT=require("react-router-dom");function tb(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const M=tb(W),oT=tb(Ta),am=e=>e,iT=()=>{let e=am;return{configure(t){e=t},generate(t){return e(t)},reset(){e=am}}},nb=iT();function mo(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function Fe(e){if(typeof e!="string")throw new Error(mo(7));return e.charAt(0).toUpperCase()+e.slice(1)}function lm(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}function Tr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sT(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Qc={exports:{}},Xc,um;function aT(){if(um)return Xc;um=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Xc=e,Xc}var Zc,cm;function lT(){if(cm)return Zc;cm=1;var e=aT();function t(){}function n(){}return n.resetWarningCache=t,Zc=function(){function r(s,a,l,u,d,f){if(f!==e){var h=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 h.name="Invariant Violation",h}}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},Zc}var dm;function uT(){return dm||(dm=1,Qc.exports=lT()()),Qc.exports}var cT=uT();const Ee=Tr(cT);function rb(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=rb(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ue(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=rb(e))&&(r&&(r+=" "),r+=t);return r}function Ke(e,t,n=void 0){const r={};for(const o in e){const i=e[o];let s="",a=!0;for(let l=0;l<i.length;l+=1){const u=i[l];u&&(s+=(a===!0?"":" ")+t(u),a=!1,n&&n[u]&&(s+=" "+n[u]))}r[o]=s}return r}var Jc={exports:{}},$t={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-is.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var fm;function dT(){if(fm)return $t;fm=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),p=Symbol.for("react.client.reference");function m(b){if(typeof b=="object"&&b!==null){var y=b.$$typeof;switch(y){case e:switch(b=b.type,b){case n:case o:case r:case l:case u:case h:return b;default:switch(b=b&&b.$$typeof,b){case s:case a:case f:case d:return b;case i:return b;default:return y}}case t:return y}}}return $t.ContextConsumer=i,$t.ContextProvider=s,$t.Element=e,$t.ForwardRef=a,$t.Fragment=n,$t.Lazy=f,$t.Memo=d,$t.Portal=t,$t.Profiler=o,$t.StrictMode=r,$t.Suspense=l,$t.SuspenseList=u,$t.isContextConsumer=function(b){return m(b)===i},$t.isContextProvider=function(b){return m(b)===s},$t.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},$t.isForwardRef=function(b){return m(b)===a},$t.isFragment=function(b){return m(b)===n},$t.isLazy=function(b){return m(b)===f},$t.isMemo=function(b){return m(b)===d},$t.isPortal=function(b){return m(b)===t},$t.isProfiler=function(b){return m(b)===o},$t.isStrictMode=function(b){return m(b)===r},$t.isSuspense=function(b){return m(b)===l},$t.isSuspenseList=function(b){return m(b)===u},$t.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===o||b===r||b===l||b===u||typeof b=="object"&&b!==null&&(b.$$typeof===f||b.$$typeof===d||b.$$typeof===s||b.$$typeof===i||b.$$typeof===a||b.$$typeof===p||b.getModuleId!==void 0)},$t.typeOf=m,$t}var pm;function fT(){return pm||(pm=1,Jc.exports=dT()),Jc.exports}var ob=fT();function Gr(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 ib(e){if(M.isValidElement(e)||ob.isValidElementType(e)||!Gr(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=ib(e[n])}),t}function An(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return Gr(e)&&Gr(t)&&Object.keys(t).forEach(o=>{M.isValidElement(t[o])||ob.isValidElementType(t[o])?r[o]=t[o]:Gr(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&Gr(e[o])?r[o]=An(e[o],t[o],n):n.clone?r[o]=Gr(t[o])?ib(t[o]):t[o]:r[o]=t[o]}),r}function Oa(e,t){return t?An(e,t,{clone:!1}):e}function hm(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,o)=>{const i=/min-width:\s*([0-9.]+)/;return+(r.match(i)?.[1]||0)-+(o.match(i)?.[1]||0)});return n.length?n.reduce((r,o)=>{const i=t[o];return delete r[o],r[o]=i,r},{...t}):t}function pT(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function hT(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,o]=n,i=Number.isNaN(+r)?r||0:+r;return e.containerQueries(o).up(i)}function mT(e){const t=(i,s)=>i.replace("@media",s?`@container ${s}`:"@container");function n(i,s){i.up=(...a)=>t(e.breakpoints.up(...a),s),i.down=(...a)=>t(e.breakpoints.down(...a),s),i.between=(...a)=>t(e.breakpoints.between(...a),s),i.only=(...a)=>t(e.breakpoints.only(...a),s),i.not=(...a)=>{const l=t(e.breakpoints.not(...a),s);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},o=i=>(n(r,i),r);return n(o),{...e,containerQueries:o}}const Ju={xs:0,sm:600,md:900,lg:1200,xl:1536},mm={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Ju[e]}px)`},gT={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:Ju[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function go(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const i=r.breakpoints||mm;return t.reduce((s,a,l)=>(s[i.up(i.keys[l])]=n(t[l]),s),{})}if(typeof t=="object"){const i=r.breakpoints||mm;return Object.keys(t).reduce((s,a)=>{if(pT(i.keys,a)){const l=hT(r.containerQueries?r:gT,a);l&&(s[l]=n(t[a],a))}else if(Object.keys(i.values||Ju).includes(a)){const l=i.up(a);s[l]=n(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return n(t)}function bT(e={}){return e.keys?.reduce((n,r)=>{const o=e.up(r);return n[o]={},n},{})||{}}function gm(e,t){return e.reduce((n,r)=>{const o=n[r];return(!o||Object.keys(o).length===0)&&delete n[r],n},t)}function ec(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,e);if(r!=null)return r}return t.split(".").reduce((r,o)=>r&&r[o]!=null?r[o]:null,e)}function Du(e,t,n,r=n){let o;return typeof e=="function"?o=e(n):Array.isArray(e)?o=e[n]||r:o=ec(e,n)||r,t&&(o=t(o,r,e)),o}function cn(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:o}=e,i=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,u=ec(l,r)||{};return go(s,a,f=>{let h=Du(u,o,f);return f===h&&typeof f=="string"&&(h=Du(u,o,`${t}${f==="default"?"":Fe(f)}`,f)),n===!1?h:{[n]:h}})};return i.propTypes={},i.filterProps=[t],i}function yT(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const xT={m:"margin",p:"padding"},CT={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},bm={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},ET=yT(e=>{if(e.length>2)if(bm[e])e=bm[e];else return[e];const[t,n]=e.split(""),r=xT[t],o=CT[n]||"";return Array.isArray(o)?o.map(i=>r+i):[r+o]}),Hf=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],zf=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Hf,...zf];function ul(e,t,n,r){const o=ec(e,t,!0)??n;return typeof o=="number"||typeof o=="string"?i=>typeof i=="string"?i:typeof o=="string"?o.startsWith("var(")&&i===0?0:o.startsWith("var(")&&i===1?o:`calc(${i} * ${o})`:o*i:Array.isArray(o)?i=>{if(typeof i=="string")return i;const s=Math.abs(i),a=o[s];return i>=0?a:typeof a=="number"?-a:typeof a=="string"&&a.startsWith("var(")?`calc(-1 * ${a})`:`-${a}`}:typeof o=="function"?o:()=>{}}function Uf(e){return ul(e,"spacing",8)}function cl(e,t){return typeof t=="string"||t==null?t:e(t)}function vT(e,t){return n=>e.reduce((r,o)=>(r[o]=cl(t,n),r),{})}function TT(e,t,n,r){if(!t.includes(n))return null;const o=ET(n),i=vT(o,r),s=e[n];return go(e,s,i)}function sb(e,t){const n=Uf(e.theme);return Object.keys(e).map(r=>TT(e,t,r,n)).reduce(Oa,{})}function an(e){return sb(e,Hf)}an.propTypes={};an.filterProps=Hf;function ln(e){return sb(e,zf)}ln.propTypes={};ln.filterProps=zf;function tc(...e){const t=e.reduce((r,o)=>(o.filterProps.forEach(i=>{r[i]=o}),r),{}),n=r=>Object.keys(r).reduce((o,i)=>t[i]?Oa(o,t[i](r)):o,{});return n.propTypes={},n.filterProps=e.reduce((r,o)=>r.concat(o.filterProps),[]),n}function hr(e){return typeof e!="number"?e:`${e}px solid`}function Sr(e,t){return cn({prop:e,themeKey:"borders",transform:t})}const ST=Sr("border",hr),kT=Sr("borderTop",hr),wT=Sr("borderRight",hr),DT=Sr("borderBottom",hr),IT=Sr("borderLeft",hr),AT=Sr("borderColor"),OT=Sr("borderTopColor"),MT=Sr("borderRightColor"),PT=Sr("borderBottomColor"),RT=Sr("borderLeftColor"),NT=Sr("outline",hr),FT=Sr("outlineColor"),nc=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=ul(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:cl(t,r)});return go(e,e.borderRadius,n)}return null};nc.propTypes={};nc.filterProps=["borderRadius"];tc(ST,kT,wT,DT,IT,AT,OT,MT,PT,RT,nc,NT,FT);const rc=e=>{if(e.gap!==void 0&&e.gap!==null){const t=ul(e.theme,"spacing",8),n=r=>({gap:cl(t,r)});return go(e,e.gap,n)}return null};rc.propTypes={};rc.filterProps=["gap"];const oc=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=ul(e.theme,"spacing",8),n=r=>({columnGap:cl(t,r)});return go(e,e.columnGap,n)}return null};oc.propTypes={};oc.filterProps=["columnGap"];const ic=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=ul(e.theme,"spacing",8),n=r=>({rowGap:cl(t,r)});return go(e,e.rowGap,n)}return null};ic.propTypes={};ic.filterProps=["rowGap"];const LT=cn({prop:"gridColumn"}),_T=cn({prop:"gridRow"}),BT=cn({prop:"gridAutoFlow"}),jT=cn({prop:"gridAutoColumns"}),$T=cn({prop:"gridAutoRows"}),HT=cn({prop:"gridTemplateColumns"}),zT=cn({prop:"gridTemplateRows"}),UT=cn({prop:"gridTemplateAreas"}),VT=cn({prop:"gridArea"});tc(rc,oc,ic,LT,_T,BT,jT,$T,HT,zT,UT,VT);function ts(e,t){return t==="grey"?t:e}const WT=cn({prop:"color",themeKey:"palette",transform:ts}),qT=cn({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:ts}),YT=cn({prop:"backgroundColor",themeKey:"palette",transform:ts});tc(WT,qT,YT);function rr(e){return e<=1&&e!==0?`${e*100}%`:e}const KT=cn({prop:"width",transform:rr}),Vf=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const r=e.theme?.breakpoints?.values?.[n]||Ju[n];return r?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:rr(n)}};return go(e,e.maxWidth,t)}return null};Vf.filterProps=["maxWidth"];const GT=cn({prop:"minWidth",transform:rr}),QT=cn({prop:"height",transform:rr}),XT=cn({prop:"maxHeight",transform:rr}),ZT=cn({prop:"minHeight",transform:rr});cn({prop:"size",cssProperty:"width",transform:rr});cn({prop:"size",cssProperty:"height",transform:rr});const JT=cn({prop:"boxSizing"});tc(KT,Vf,GT,QT,XT,ZT,JT);const dl={border:{themeKey:"borders",transform:hr},borderTop:{themeKey:"borders",transform:hr},borderRight:{themeKey:"borders",transform:hr},borderBottom:{themeKey:"borders",transform:hr},borderLeft:{themeKey:"borders",transform:hr},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:hr},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:nc},color:{themeKey:"palette",transform:ts},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:ts},backgroundColor:{themeKey:"palette",transform:ts},p:{style:ln},pt:{style:ln},pr:{style:ln},pb:{style:ln},pl:{style:ln},px:{style:ln},py:{style:ln},padding:{style:ln},paddingTop:{style:ln},paddingRight:{style:ln},paddingBottom:{style:ln},paddingLeft:{style:ln},paddingX:{style:ln},paddingY:{style:ln},paddingInline:{style:ln},paddingInlineStart:{style:ln},paddingInlineEnd:{style:ln},paddingBlock:{style:ln},paddingBlockStart:{style:ln},paddingBlockEnd:{style:ln},m:{style:an},mt:{style:an},mr:{style:an},mb:{style:an},ml:{style:an},mx:{style:an},my:{style:an},margin:{style:an},marginTop:{style:an},marginRight:{style:an},marginBottom:{style:an},marginLeft:{style:an},marginX:{style:an},marginY:{style:an},marginInline:{style:an},marginInlineStart:{style:an},marginInlineEnd:{style:an},marginBlock:{style:an},marginBlockStart:{style:an},marginBlockEnd:{style:an},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:rc},rowGap:{style:ic},columnGap:{style:oc},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:rr},maxWidth:{style:Vf},minWidth:{transform:rr},height:{transform:rr},maxHeight:{transform:rr},minHeight:{transform:rr},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function eS(...e){const t=e.reduce((r,o)=>r.concat(Object.keys(o)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function tS(e,t){return typeof e=="function"?e(t):e}function nS(){function e(n,r,o,i){const s={[n]:r,theme:o},a=i[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:u,transform:d,style:f}=a;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const h=ec(o,u)||{};return f?f(s):go(s,r,m=>{let b=Du(h,d,m);return m===b&&typeof m=="string"&&(b=Du(h,d,`${n}${m==="default"?"":Fe(m)}`,m)),l===!1?b:{[l]:b}})}function t(n){const{sx:r,theme:o={},nested:i}=n||{};if(!r)return null;const s=o.unstable_sxConfig??dl;function a(l){let u=l;if(typeof l=="function")u=l(o);else if(typeof l!="object")return l;if(!u)return null;const d=bT(o.breakpoints),f=Object.keys(d);let h=d;return Object.keys(u).forEach(p=>{const m=tS(u[p],o);if(m!=null)if(typeof m=="object")if(s[p])h=Oa(h,e(p,m,o,s));else{const b=go({theme:o},m,y=>({[p]:y}));eS(b,m)?h[p]=t({sx:m,theme:o,nested:!0}):h=Oa(h,b)}else h=Oa(h,e(p,m,o,s))}),!i&&o.modularCssLayers?{"@layer sx":hm(o,gm(f,h))}:hm(o,gm(f,h))}return Array.isArray(r)?r.map(a):a(r)}return t}const cs=nS();cs.filterProps=["sx"];const rS=e=>{const t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??dl;return Object.keys(e).forEach(r=>{n[r]?t.systemProps[r]=e[r]:t.otherProps[r]=e[r]}),t};function oS(e){const{sx:t,...n}=e,{systemProps:r,otherProps:o}=rS(n);let i;return Array.isArray(t)?i=[r,...t]:typeof t=="function"?i=(...s)=>{const a=t(...s);return Gr(a)?{...r,...a}:r}:i={...r,...t},{...o,sx:i}}function iS(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Wf(e,t=0,n=1){return iS(e,t,n)}function sS(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,o)=>o<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Fo(e){if(e.type)return e;if(e.charAt(0)==="#")return Fo(sS(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(mo(9,e));let r=e.substring(t+1,e.length-1),o;if(n==="color"){if(r=r.split(" "),o=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error(mo(10,o))}else r=r.split(",");return r=r.map(i=>parseFloat(i)),{type:n,values:r,colorSpace:o}}const aS=e=>{const t=Fo(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},Sa=(e,t)=>{try{return aS(e)}catch{return e}};function sc(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((o,i)=>i<3?parseInt(o,10):o):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function ab(e){e=Fo(e);const{values:t}=e,n=t[0],r=t[1]/100,o=t[2]/100,i=r*Math.min(o,1-o),s=(u,d=(u+n/30)%12)=>o-i*Math.max(Math.min(d-3,9-d,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),sc({type:a,values:l})}function Yd(e){e=Fo(e);let t=e.type==="hsl"||e.type==="hsla"?Fo(ab(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function lS(e,t){const n=Yd(e),r=Yd(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Iu(e,t){return e=Fo(e),t=Wf(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,sc(e)}function qo(e,t,n){try{return Iu(e,t)}catch{return e}}function ac(e,t){if(e=Fo(e),t=Wf(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return sc(e)}function Ft(e,t,n){try{return ac(e,t)}catch{return e}}function lc(e,t){if(e=Fo(e),t=Wf(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return sc(e)}function Lt(e,t,n){try{return lc(e,t)}catch{return e}}function Kd(e,t=.15){return Yd(e)>.5?ac(e,t):lc(e,t)}function $l(e,t,n){try{return Kd(e,t)}catch{return e}}const Ya={black:"#000",white:"#fff"},uS={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Bi={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},ji={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},Ys={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},$i={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},Hi={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},zi={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function lb(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Ya.white,default:Ya.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const ub=lb();function cb(){return{text:{primary:Ya.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Ya.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const Gd=cb();function ym(e,t,n,r){const o=r.light||r,i=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=lc(e.main,o):t==="dark"&&(e.dark=ac(e.main,i)))}function xm(e,t,n,r,o){const i=o.light||o,s=o.dark||o*1.5;t[n]||(t.hasOwnProperty(r)?t[n]=t[r]:n==="light"?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(i*100).toFixed(0)}%)`:n==="dark"&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(s*100).toFixed(0)}%)`))}function cS(e="light"){return e==="dark"?{main:$i[200],light:$i[50],dark:$i[400]}:{main:$i[700],light:$i[400],dark:$i[800]}}function dS(e="light"){return e==="dark"?{main:Bi[200],light:Bi[50],dark:Bi[400]}:{main:Bi[500],light:Bi[300],dark:Bi[700]}}function fS(e="light"){return e==="dark"?{main:ji[500],light:ji[300],dark:ji[700]}:{main:ji[700],light:ji[400],dark:ji[800]}}function pS(e="light"){return e==="dark"?{main:Hi[400],light:Hi[300],dark:Hi[700]}:{main:Hi[700],light:Hi[500],dark:Hi[900]}}function hS(e="light"){return e==="dark"?{main:zi[400],light:zi[300],dark:zi[700]}:{main:zi[800],light:zi[500],dark:zi[900]}}function mS(e="light"){return e==="dark"?{main:Ys[400],light:Ys[300],dark:Ys[700]}:{main:"#ed6c02",light:Ys[500],dark:Ys[900]}}function gS(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function qf(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:o,...i}=e,s=e.primary||cS(t),a=e.secondary||dS(t),l=e.error||fS(t),u=e.info||pS(t),d=e.success||hS(t),f=e.warning||mS(t);function h(y){return o?gS(y):lS(y,Gd.text.primary)>=n?Gd.text.primary:ub.text.primary}const p=({color:y,name:x,mainShade:C=500,lightShade:v=300,darkShade:S=700})=>{if(y={...y},!y.main&&y[C]&&(y.main=y[C]),!y.hasOwnProperty("main"))throw new Error(mo(11,x?` (${x})`:"",C));if(typeof y.main!="string")throw new Error(mo(12,x?` (${x})`:"",JSON.stringify(y.main)));return o?(xm(o,y,"light",v,r),xm(o,y,"dark",S,r)):(ym(y,"light",v,r),ym(y,"dark",S,r)),y.contrastText||(y.contrastText=h(y.main)),y};let m;return t==="light"?m=lb():t==="dark"&&(m=cb()),An({common:{...Ya},mode:t,primary:p({color:s,name:"primary"}),secondary:p({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:p({color:l,name:"error"}),warning:p({color:f,name:"warning"}),info:p({color:u,name:"info"}),success:p({color:d,name:"success"}),grey:uS,contrastThreshold:n,getContrastText:h,augmentColor:p,tonalOffset:r,...m},i)}function bS(e){for(var t=0,n,r=0,o=e.length;o>=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var yS={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function xS(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var CS=/[A-Z]|^ms/g,ES=/_EMO_([^_]+?)_([^]*?)_EMO_/g,db=function(t){return t.charCodeAt(1)===45},Cm=function(t){return t!=null&&typeof t!="boolean"},ed=xS(function(e){return db(e)?e:e.replace(CS,"-$&").toLowerCase()}),Em=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(ES,function(r,o,i){return Po={name:o,styles:i,next:Po},o})}return yS[t]!==1&&!db(t)&&typeof n=="number"&&n!==0?n+"px":n};function Au(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var o=n;if(o.anim===1)return Po={name:o.name,styles:o.styles,next:Po},o.name;var i=n;if(i.styles!==void 0){var s=i.next;if(s!==void 0)for(;s!==void 0;)Po={name:s.name,styles:s.styles,next:Po},s=s.next;var a=i.styles+";";return a}return vS(e,t,n)}}var l=n;return l}function vS(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=Au(e,t,n[o])+";";else for(var i in n){var s=n[i];if(typeof s!="object"){var a=s;Cm(a)&&(r+=ed(i)+":"+Em(i,a)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&t==null)for(var l=0;l<s.length;l++)Cm(s[l])&&(r+=ed(i)+":"+Em(i,s[l])+";");else{var u=Au(e,t,s);switch(i){case"animation":case"animationName":{r+=ed(i)+":"+u+";";break}default:r+=i+"{"+u+"}"}}}return r}var vm=/label:\s*([^\s;{]+)\s*(;|$)/g,Po;function TS(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,o="";Po=void 0;var i=e[0];if(i==null||i.raw===void 0)r=!1,o+=Au(n,t,i);else{var s=i;o+=s[0]}for(var a=1;a<e.length;a++)if(o+=Au(n,t,e[a]),r){var l=i;o+=l[a]}vm.lastIndex=0;for(var u="",d;(d=vm.exec(o))!==null;)u+="-"+d[1];var f=bS(o)+u;return{name:f,styles:o,next:Po}}function SS(e,t){return tT(e,t)}function kS(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Tm=[];function ii(e){return Tm[0]=e,TS(Tm)}const yn=typeof window<"u"?M.useLayoutEffect:M.useEffect;function wS(e){return Object.keys(e).length===0}function fb(e=null){const t=M.useContext(nT.ThemeContext);return!t||wS(t)?e:t}const DS=M.createContext(),kr=()=>M.useContext(DS)??!1;function Ka(e,t,n=!1){const r={...t};for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)){const i=o;if(i==="components"||i==="slots")r[i]={...e[i],...r[i]};else if(i==="componentsProps"||i==="slotProps"){const s=e[i],a=t[i];if(!a)r[i]=s||{};else if(!s)r[i]=a;else{r[i]={...a};for(const l in s)if(Object.prototype.hasOwnProperty.call(s,l)){const u=l;r[i][u]=Ka(s[u],a[u],n)}}}else i==="className"&&n&&t.className?r.className=Ue(e?.className,t?.className):i==="style"&&n&&t.style?r.style={...e?.style,...t?.style}:r[i]===void 0&&(r[i]=e[i])}return r}const IS=M.createContext(void 0);function AS(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const o=t.components[n];return o.defaultProps?Ka(o.defaultProps,r,t.components.mergeClassNameAndStyle):!o.styleOverrides&&!o.variants?Ka(o,r,t.components.mergeClassNameAndStyle):r}function OS({props:e,name:t}){const n=M.useContext(IS);return AS({props:e,name:t,theme:{components:n}})}let Sm=0;function MS(e){const[t,n]=M.useState(e),r=e||t;return M.useEffect(()=>{t==null&&(Sm+=1,n(`mui-${Sm}`))},[t]),r}const PS={...M},km=PS.useId;function _r(e){if(km!==void 0){const t=km();return e??t}return MS(e)}const RS=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function NS(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...o}=e,i=RS(t),s=Object.keys(i);function a(h){return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n})`}function l(h){return`@media (max-width:${(typeof t[h]=="number"?t[h]:h)-r/100}${n})`}function u(h,p){const m=s.indexOf(p);return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n}) and (max-width:${(m!==-1&&typeof t[s[m]]=="number"?t[s[m]]:p)-r/100}${n})`}function d(h){return s.indexOf(h)+1<s.length?u(h,s[s.indexOf(h)+1]):a(h)}function f(h){const p=s.indexOf(h);return p===0?a(s[1]):p===s.length-1?l(s[p]):u(h,s[s.indexOf(h)+1]).replace("@media","@media not all and")}return{keys:s,values:i,up:a,down:l,between:u,only:d,not:f,unit:n,...o}}const FS={borderRadius:4};function LS(e=8,t=Uf({spacing:e})){if(e.mui)return e;const n=(...r)=>(r.length===0?[1]:r).map(i=>{const s=t(i);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function _S(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let r=n.getColorSchemeSelector(e);return r==="&"?t:((r.includes("data-")||r.includes("."))&&(r=`*:where(${r.replace(/\s*&$/,"")}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function Yf(e={},...t){const{breakpoints:n={},palette:r={},spacing:o,shape:i={},...s}=e,a=NS(n),l=LS(o);let u=An({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...FS,...i}},s);return u=mT(u),u.applyStyles=_S,u=t.reduce((d,f)=>An(d,f),u),u.unstable_sxConfig={...dl,...s?.unstable_sxConfig},u.unstable_sx=function(f){return cs({sx:f,theme:this})},u}const BS=Yf();function jS(e=BS){return fb(e)}const wm=(e,t,n,r=[])=>{let o=e;t.forEach((i,s)=>{s===t.length-1?Array.isArray(o)?o[Number(i)]=n:o&&typeof o=="object"&&(o[i]=n):o&&typeof o=="object"&&(o[i]||(o[i]=r.includes(i)?[]:{}),o=o[i])})},$S=(e,t,n)=>{function r(o,i=[],s=[]){Object.entries(o).forEach(([a,l])=>{(!n||n&&!n([...i,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...i,a],Array.isArray(l)?[...s,a]:s):t([...i,a],l,s))})}r(e)},HS=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function td(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},o={},i={},s={};return $S(e,(a,l,u)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const d=`--${n?`${n}-`:""}${a.join("-")}`,f=HS(a,l);Object.assign(o,{[d]:f}),wm(i,a,`var(${d})`,u),wm(s,a,`var(${d}, ${f})`,u)}},a=>a[0]==="vars"),{css:o,vars:i,varsWithDefaults:s}}function zS(e,t={}){const{getSelector:n=x,disableCssColorScheme:r,colorSchemeSelector:o,enableContrastVars:i}=t,{colorSchemes:s={},components:a,defaultColorScheme:l="light",...u}=e,{vars:d,css:f,varsWithDefaults:h}=td(u,t);let p=h;const m={},{[l]:b,...y}=s;if(Object.entries(y||{}).forEach(([S,I])=>{const{vars:T,css:N,varsWithDefaults:O}=td(I,t);p=An(p,O),m[S]={css:N,vars:T}}),b){const{css:S,vars:I,varsWithDefaults:T}=td(b,t);p=An(p,T),m[l]={css:S,vars:I}}function x(S,I){let T=o;if(o==="class"&&(T=".%s"),o==="data"&&(T="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(T=`[${o}="%s"]`),S){if(T==="media")return e.defaultColorScheme===S?":root":{[`@media (prefers-color-scheme: ${s[S]?.palette?.mode||S})`]:{":root":I}};if(T)return e.defaultColorScheme===S?`:root, ${T.replace("%s",String(S))}`:T.replace("%s",String(S))}return":root"}return{vars:p,generateThemeVars:()=>{let S={...d};return Object.entries(m).forEach(([,{vars:I}])=>{S=An(S,I)}),S},generateStyleSheets:()=>{const S=[],I=e.defaultColorScheme||"light";function T(F,B){Object.keys(B).length&&S.push(typeof F=="string"?{[F]:{...B}}:F)}T(n(void 0,{...f}),f);const{[I]:N,...O}=m;if(N){const{css:F}=N,B=s[I]?.palette?.mode,j=!r&&B?{colorScheme:B,...F}:{...F};T(n(I,{...j}),j)}return Object.entries(O).forEach(([F,{css:B}])=>{const j=s[F]?.palette?.mode,D=!r&&j?{colorScheme:j,...B}:{...B};T(n(F,{...D}),D)}),i&&S.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),S}}}function US(e){const t={};return Object.entries(e).forEach(r=>{const[o,i]=r;typeof i=="object"&&(t[o]=`${i.fontStyle?`${i.fontStyle} `:""}${i.fontVariant?`${i.fontVariant} `:""}${i.fontWeight?`${i.fontWeight} `:""}${i.fontStretch?`${i.fontStretch} `:""}${i.fontSize||""}${i.lineHeight?`/${i.lineHeight} `:""}${i.fontFamily||""}`)}),t}function VS(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}const WS={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Ge(e,t,n="Mui"){const r=WS[t];return r?`${n}-${r}`:`${nb.generate(e)}-${t}`}function qS(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function YS(e){return Math.round(e*1e5)/1e5}const Dm={textTransform:"uppercase"},Im='"Roboto", "Helvetica", "Arial", sans-serif';function KS(e,t){const{fontFamily:n=Im,fontSize:r=14,fontWeightLight:o=300,fontWeightRegular:i=400,fontWeightMedium:s=500,fontWeightBold:a=700,htmlFontSize:l=16,allVariants:u,pxToRem:d,...f}=typeof t=="function"?t(e):t,h=r/14,p=d||(y=>`${y/l*h}rem`),m=(y,x,C,v,S)=>({fontFamily:n,fontWeight:y,fontSize:p(x),lineHeight:C,...n===Im?{letterSpacing:`${YS(v/x)}em`}:{},...S,...u}),b={h1:m(o,96,1.167,-1.5),h2:m(o,60,1.2,-.5),h3:m(i,48,1.167,0),h4:m(i,34,1.235,.25),h5:m(i,24,1.334,0),h6:m(s,20,1.6,.15),subtitle1:m(i,16,1.75,.15),subtitle2:m(s,14,1.57,.1),body1:m(i,16,1.5,.15),body2:m(i,14,1.43,.15),button:m(s,14,1.75,.4,Dm),caption:m(i,12,1.66,.4),overline:m(i,12,2.66,1,Dm),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return An({htmlFontSize:l,pxToRem:p,fontFamily:n,fontSize:r,fontWeightLight:o,fontWeightRegular:i,fontWeightMedium:s,fontWeightBold:a,...b},f,{clone:!1})}const GS=.2,QS=.14,XS=.12;function Jt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${GS})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${QS})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${XS})`].join(",")}const ZS=["none",Jt(0,2,1,-1,0,1,1,0,0,1,3,0),Jt(0,3,1,-2,0,2,2,0,0,1,5,0),Jt(0,3,3,-2,0,3,4,0,0,1,8,0),Jt(0,2,4,-1,0,4,5,0,0,1,10,0),Jt(0,3,5,-1,0,5,8,0,0,1,14,0),Jt(0,3,5,-1,0,6,10,0,0,1,18,0),Jt(0,4,5,-2,0,7,10,1,0,2,16,1),Jt(0,5,5,-3,0,8,10,1,0,3,14,2),Jt(0,5,6,-3,0,9,12,1,0,3,16,2),Jt(0,6,6,-3,0,10,14,1,0,4,18,3),Jt(0,6,7,-4,0,11,15,1,0,4,20,3),Jt(0,7,8,-4,0,12,17,2,0,5,22,4),Jt(0,7,8,-4,0,13,19,2,0,5,24,4),Jt(0,7,9,-4,0,14,21,2,0,5,26,4),Jt(0,8,9,-5,0,15,22,2,0,6,28,5),Jt(0,8,10,-5,0,16,24,2,0,6,30,5),Jt(0,8,11,-5,0,17,26,2,0,6,32,5),Jt(0,9,11,-5,0,18,28,2,0,7,34,6),Jt(0,9,12,-6,0,19,29,2,0,7,36,6),Jt(0,10,13,-6,0,20,31,3,0,8,38,7),Jt(0,10,13,-6,0,21,33,3,0,8,40,7),Jt(0,10,14,-6,0,22,35,3,0,8,42,7),Jt(0,11,14,-7,0,23,36,3,0,9,44,8),Jt(0,11,15,-7,0,24,38,3,0,9,46,8)],JS={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},pb={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Am(e){return`${Math.round(e)}ms`}function ek(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function tk(e){const t={...JS,...e.easing},n={...pb,...e.duration};return{getAutoHeightDuration:ek,create:(o=["all"],i={})=>{const{duration:s=n.standard,easing:a=t.easeInOut,delay:l=0,...u}=i;return(Array.isArray(o)?o:[o]).map(d=>`${d} ${typeof s=="string"?s:Am(s)} ${a} ${typeof l=="string"?l:Am(l)}`).join(",")},...e,easing:t,duration:n}}const nk={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function rk(e){return Gr(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function hb(e={}){const t={...e};function n(r){const o=Object.entries(r);for(let i=0;i<o.length;i++){const[s,a]=o[i];!rk(a)||s.startsWith("unstable_")?delete r[s]:Gr(a)&&(r[s]={...a},n(r[s]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
10
|
+
|
|
11
|
+
const theme = ${JSON.stringify(t,null,2)};
|
|
12
|
+
|
|
13
|
+
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
14
|
+
theme.transitions = createTransitions(theme.transitions || {});
|
|
15
|
+
|
|
16
|
+
export default theme;`}function Om(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const ok=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let r=0;r<t.length;r+=1)n+=+t[r];return n};function ik(e){Object.assign(e,{alpha(t,n){const r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n=="string"?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof n=="string"?`calc(${n})`:n})`:Iu(t,ok(n))},lighten(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${Om(n)})`:lc(t,n)},darken(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${Om(n)})`:ac(t,n)}})}function Qd(e={},...t){const{breakpoints:n,mixins:r={},spacing:o,palette:i={},transitions:s={},typography:a={},shape:l,colorSpace:u,...d}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(mo(20));const f=qf({...i,colorSpace:u}),h=Yf(e);let p=An(h,{mixins:qS(h.breakpoints,r),palette:f,shadows:ZS.slice(),typography:KS(f,a),transitions:tk(s),zIndex:{...nk}});return p=An(p,d),p=t.reduce((m,b)=>An(m,b),p),p.unstable_sxConfig={...dl,...d?.unstable_sxConfig},p.unstable_sx=function(b){return cs({sx:b,theme:this})},p.toRuntimeSource=hb,ik(p),p}function Xd(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const sk=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=Xd(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function mb(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function gb(e){return e==="dark"?sk:[]}function ak(e){const{palette:t={mode:"light"},opacity:n,overlays:r,colorSpace:o,...i}=e,s=qf({...t,colorSpace:o});return{palette:s,opacity:{...mb(s.mode),...n},overlays:r||gb(s.mode),...i}}function lk(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const uk=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],ck=e=>(t,n)=>{const r=e.rootSelector||":root",o=e.colorSchemeSelector;let i=o;if(o==="class"&&(i=".%s"),o==="data"&&(i="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(i=`[${o}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const s={};return uk(e.cssVarPrefix).forEach(a=>{s[a]=n[a],delete n[a]}),i==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:s}}:i?{[i.replace("%s",t)]:s,[`${r}, ${i.replace("%s",t)}`]:n}:{[r]:{...n,...s}}}if(i&&i!=="media")return`${r}, ${i.replace("%s",String(t))}`}else if(t){if(i==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(i)return i.replace("%s",String(t))}return r};function dk(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function Se(e,t,n){!e[t]&&n&&(e[t]=n)}function ka(e){return typeof e!="string"||!e.startsWith("hsl")?e:ab(e)}function ao(e,t){`${t}Channel`in e||(e[`${t}Channel`]=Sa(ka(e[t])))}function fk(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const zr=e=>{try{return e()}catch{}},pk=(e="mui")=>Ot.unstable_createGetCssVar(e);function nd(e,t,n,r,o){if(!n)return;n=n===!0?{}:n;const i=o==="dark"?"dark":"light";if(!r){t[o]=ak({...n,palette:{mode:i,...n?.palette},colorSpace:e});return}const{palette:s,...a}=Qd({...r,palette:{mode:i,...n?.palette},colorSpace:e});return t[o]={...n,palette:s,opacity:{...mb(i),...n?.opacity},overlays:n?.overlays||gb(i)},a}function hk(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:o=!1,cssVarPrefix:i="mui",nativeColor:s=!1,shouldSkipGeneratingVar:a=lk,colorSchemeSelector:l=n.light&&n.dark?"media":void 0,rootSelector:u=":root",...d}=e,f=Object.keys(n)[0],h=r||(n.light&&f!=="light"?"light":f),p=pk(i),{[h]:m,light:b,dark:y,...x}=n,C={...x};let v=m;if((h==="dark"&&!("dark"in n)||h==="light"&&!("light"in n))&&(v=!0),!v)throw new Error(mo(21,h));let S;s&&(S="oklch");const I=nd(S,C,v,d,h);b&&!C.light&&nd(S,C,b,void 0,"light"),y&&!C.dark&&nd(S,C,y,void 0,"dark");let T={defaultColorScheme:h,...I,cssVarPrefix:i,colorSchemeSelector:l,rootSelector:u,getCssVar:p,colorSchemes:C,font:{...US(I.typography),...I.font},spacing:fk(d.spacing)};Object.keys(T.colorSchemes).forEach(j=>{const D=T.colorSchemes[j].palette,H=L=>{const $=L.split("-"),K=$[1],G=$[2];return p(L,D[K][G])};D.mode==="light"&&(Se(D.common,"background","#fff"),Se(D.common,"onBackground","#000")),D.mode==="dark"&&(Se(D.common,"background","#000"),Se(D.common,"onBackground","#fff"));function _(L,$,K){if(S){let G;return L===qo&&(G=`transparent ${((1-K)*100).toFixed(0)}%`),L===Ft&&(G=`#000 ${(K*100).toFixed(0)}%`),L===Lt&&(G=`#fff ${(K*100).toFixed(0)}%`),`color-mix(in ${S}, ${$}, ${G})`}return L($,K)}if(dk(D,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),D.mode==="light"){Se(D.Alert,"errorColor",_(Ft,D.error.light,.6)),Se(D.Alert,"infoColor",_(Ft,D.info.light,.6)),Se(D.Alert,"successColor",_(Ft,D.success.light,.6)),Se(D.Alert,"warningColor",_(Ft,D.warning.light,.6)),Se(D.Alert,"errorFilledBg",H("palette-error-main")),Se(D.Alert,"infoFilledBg",H("palette-info-main")),Se(D.Alert,"successFilledBg",H("palette-success-main")),Se(D.Alert,"warningFilledBg",H("palette-warning-main")),Se(D.Alert,"errorFilledColor",zr(()=>D.getContrastText(D.error.main))),Se(D.Alert,"infoFilledColor",zr(()=>D.getContrastText(D.info.main))),Se(D.Alert,"successFilledColor",zr(()=>D.getContrastText(D.success.main))),Se(D.Alert,"warningFilledColor",zr(()=>D.getContrastText(D.warning.main))),Se(D.Alert,"errorStandardBg",_(Lt,D.error.light,.9)),Se(D.Alert,"infoStandardBg",_(Lt,D.info.light,.9)),Se(D.Alert,"successStandardBg",_(Lt,D.success.light,.9)),Se(D.Alert,"warningStandardBg",_(Lt,D.warning.light,.9)),Se(D.Alert,"errorIconColor",H("palette-error-main")),Se(D.Alert,"infoIconColor",H("palette-info-main")),Se(D.Alert,"successIconColor",H("palette-success-main")),Se(D.Alert,"warningIconColor",H("palette-warning-main")),Se(D.AppBar,"defaultBg",H("palette-grey-100")),Se(D.Avatar,"defaultBg",H("palette-grey-400")),Se(D.Button,"inheritContainedBg",H("palette-grey-300")),Se(D.Button,"inheritContainedHoverBg",H("palette-grey-A100")),Se(D.Chip,"defaultBorder",H("palette-grey-400")),Se(D.Chip,"defaultAvatarColor",H("palette-grey-700")),Se(D.Chip,"defaultIconColor",H("palette-grey-700")),Se(D.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),Se(D.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),Se(D.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),Se(D.LinearProgress,"primaryBg",_(Lt,D.primary.main,.62)),Se(D.LinearProgress,"secondaryBg",_(Lt,D.secondary.main,.62)),Se(D.LinearProgress,"errorBg",_(Lt,D.error.main,.62)),Se(D.LinearProgress,"infoBg",_(Lt,D.info.main,.62)),Se(D.LinearProgress,"successBg",_(Lt,D.success.main,.62)),Se(D.LinearProgress,"warningBg",_(Lt,D.warning.main,.62)),Se(D.Skeleton,"bg",S?_(qo,D.text.primary,.11):`rgba(${H("palette-text-primaryChannel")} / 0.11)`),Se(D.Slider,"primaryTrack",_(Lt,D.primary.main,.62)),Se(D.Slider,"secondaryTrack",_(Lt,D.secondary.main,.62)),Se(D.Slider,"errorTrack",_(Lt,D.error.main,.62)),Se(D.Slider,"infoTrack",_(Lt,D.info.main,.62)),Se(D.Slider,"successTrack",_(Lt,D.success.main,.62)),Se(D.Slider,"warningTrack",_(Lt,D.warning.main,.62));const L=S?_(Ft,D.background.default,.6825):$l(D.background.default,.8);Se(D.SnackbarContent,"bg",L),Se(D.SnackbarContent,"color",zr(()=>S?Gd.text.primary:D.getContrastText(L))),Se(D.SpeedDialAction,"fabHoverBg",$l(D.background.paper,.15)),Se(D.StepConnector,"border",H("palette-grey-400")),Se(D.StepContent,"border",H("palette-grey-400")),Se(D.Switch,"defaultColor",H("palette-common-white")),Se(D.Switch,"defaultDisabledColor",H("palette-grey-100")),Se(D.Switch,"primaryDisabledColor",_(Lt,D.primary.main,.62)),Se(D.Switch,"secondaryDisabledColor",_(Lt,D.secondary.main,.62)),Se(D.Switch,"errorDisabledColor",_(Lt,D.error.main,.62)),Se(D.Switch,"infoDisabledColor",_(Lt,D.info.main,.62)),Se(D.Switch,"successDisabledColor",_(Lt,D.success.main,.62)),Se(D.Switch,"warningDisabledColor",_(Lt,D.warning.main,.62)),Se(D.TableCell,"border",_(Lt,_(qo,D.divider,1),.88)),Se(D.Tooltip,"bg",_(qo,D.grey[700],.92))}if(D.mode==="dark"){Se(D.Alert,"errorColor",_(Lt,D.error.light,.6)),Se(D.Alert,"infoColor",_(Lt,D.info.light,.6)),Se(D.Alert,"successColor",_(Lt,D.success.light,.6)),Se(D.Alert,"warningColor",_(Lt,D.warning.light,.6)),Se(D.Alert,"errorFilledBg",H("palette-error-dark")),Se(D.Alert,"infoFilledBg",H("palette-info-dark")),Se(D.Alert,"successFilledBg",H("palette-success-dark")),Se(D.Alert,"warningFilledBg",H("palette-warning-dark")),Se(D.Alert,"errorFilledColor",zr(()=>D.getContrastText(D.error.dark))),Se(D.Alert,"infoFilledColor",zr(()=>D.getContrastText(D.info.dark))),Se(D.Alert,"successFilledColor",zr(()=>D.getContrastText(D.success.dark))),Se(D.Alert,"warningFilledColor",zr(()=>D.getContrastText(D.warning.dark))),Se(D.Alert,"errorStandardBg",_(Ft,D.error.light,.9)),Se(D.Alert,"infoStandardBg",_(Ft,D.info.light,.9)),Se(D.Alert,"successStandardBg",_(Ft,D.success.light,.9)),Se(D.Alert,"warningStandardBg",_(Ft,D.warning.light,.9)),Se(D.Alert,"errorIconColor",H("palette-error-main")),Se(D.Alert,"infoIconColor",H("palette-info-main")),Se(D.Alert,"successIconColor",H("palette-success-main")),Se(D.Alert,"warningIconColor",H("palette-warning-main")),Se(D.AppBar,"defaultBg",H("palette-grey-900")),Se(D.AppBar,"darkBg",H("palette-background-paper")),Se(D.AppBar,"darkColor",H("palette-text-primary")),Se(D.Avatar,"defaultBg",H("palette-grey-600")),Se(D.Button,"inheritContainedBg",H("palette-grey-800")),Se(D.Button,"inheritContainedHoverBg",H("palette-grey-700")),Se(D.Chip,"defaultBorder",H("palette-grey-700")),Se(D.Chip,"defaultAvatarColor",H("palette-grey-300")),Se(D.Chip,"defaultIconColor",H("palette-grey-300")),Se(D.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),Se(D.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),Se(D.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),Se(D.LinearProgress,"primaryBg",_(Ft,D.primary.main,.5)),Se(D.LinearProgress,"secondaryBg",_(Ft,D.secondary.main,.5)),Se(D.LinearProgress,"errorBg",_(Ft,D.error.main,.5)),Se(D.LinearProgress,"infoBg",_(Ft,D.info.main,.5)),Se(D.LinearProgress,"successBg",_(Ft,D.success.main,.5)),Se(D.LinearProgress,"warningBg",_(Ft,D.warning.main,.5)),Se(D.Skeleton,"bg",S?_(qo,D.text.primary,.13):`rgba(${H("palette-text-primaryChannel")} / 0.13)`),Se(D.Slider,"primaryTrack",_(Ft,D.primary.main,.5)),Se(D.Slider,"secondaryTrack",_(Ft,D.secondary.main,.5)),Se(D.Slider,"errorTrack",_(Ft,D.error.main,.5)),Se(D.Slider,"infoTrack",_(Ft,D.info.main,.5)),Se(D.Slider,"successTrack",_(Ft,D.success.main,.5)),Se(D.Slider,"warningTrack",_(Ft,D.warning.main,.5));const L=S?_(Lt,D.background.default,.985):$l(D.background.default,.98);Se(D.SnackbarContent,"bg",L),Se(D.SnackbarContent,"color",zr(()=>S?ub.text.primary:D.getContrastText(L))),Se(D.SpeedDialAction,"fabHoverBg",$l(D.background.paper,.15)),Se(D.StepConnector,"border",H("palette-grey-600")),Se(D.StepContent,"border",H("palette-grey-600")),Se(D.Switch,"defaultColor",H("palette-grey-300")),Se(D.Switch,"defaultDisabledColor",H("palette-grey-600")),Se(D.Switch,"primaryDisabledColor",_(Ft,D.primary.main,.55)),Se(D.Switch,"secondaryDisabledColor",_(Ft,D.secondary.main,.55)),Se(D.Switch,"errorDisabledColor",_(Ft,D.error.main,.55)),Se(D.Switch,"infoDisabledColor",_(Ft,D.info.main,.55)),Se(D.Switch,"successDisabledColor",_(Ft,D.success.main,.55)),Se(D.Switch,"warningDisabledColor",_(Ft,D.warning.main,.55)),Se(D.TableCell,"border",_(Ft,_(qo,D.divider,1),.68)),Se(D.Tooltip,"bg",_(qo,D.grey[700],.92))}ao(D.background,"default"),ao(D.background,"paper"),ao(D.common,"background"),ao(D.common,"onBackground"),ao(D,"divider"),Object.keys(D).forEach(L=>{const $=D[L];L!=="tonalOffset"&&$&&typeof $=="object"&&($.main&&Se(D[L],"mainChannel",Sa(ka($.main))),$.light&&Se(D[L],"lightChannel",Sa(ka($.light))),$.dark&&Se(D[L],"darkChannel",Sa(ka($.dark))),$.contrastText&&Se(D[L],"contrastTextChannel",Sa(ka($.contrastText))),L==="text"&&(ao(D[L],"primary"),ao(D[L],"secondary")),L==="action"&&($.active&&ao(D[L],"active"),$.selected&&ao(D[L],"selected")))})}),T=t.reduce((j,D)=>An(j,D),T);const N={prefix:i,disableCssColorScheme:o,shouldSkipGeneratingVar:a,getSelector:ck(T),enableContrastVars:s},{vars:O,generateThemeVars:F,generateStyleSheets:B}=zS(T,N);return T.vars=O,Object.entries(T.colorSchemes[T.defaultColorScheme]).forEach(([j,D])=>{T[j]=D}),T.generateThemeVars=F,T.generateStyleSheets=B,T.generateSpacing=function(){return Ot.createSpacing(d.spacing,Uf(this))},T.getColorSchemeSelector=VS(l),T.spacing=T.generateSpacing(),T.shouldSkipGeneratingVar=a,T.unstable_sxConfig={...dl,...d?.unstable_sxConfig},T.unstable_sx=function(D){return cs({sx:D,theme:this})},T.toRuntimeSource=hb,T}function Mm(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:qf({...n===!0?{}:n.palette,mode:t})})}function bb(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:o=n?void 0:{light:!0},defaultColorScheme:i=n?.mode,...s}=e,a=i||"light",l=o?.[a],u={...o,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return Qd(e,...t);let d=n;"palette"in e||u[a]&&(u[a]!==!0?d=u[a].palette:a==="dark"&&(d={mode:"dark"}));const f=Qd({...e,palette:d},...t);return f.defaultColorScheme=a,f.colorSchemes=u,f.palette.mode==="light"&&(f.colorSchemes.light={...u.light!==!0&&u.light,palette:f.palette},Mm(f,"dark",u.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...u.dark!==!0&&u.dark,palette:f.palette},Mm(f,"light",u.light)),f}return!n&&!("light"in u)&&a==="light"&&(u.light=!0),hk({...s,colorSchemes:u,defaultColorScheme:a,...typeof r!="boolean"&&r},...t)}const uc=bb(),Cs="$$material";function Lo(){const e=Ot.useTheme(uc);return e[Cs]||e}function mk(e){return c.jsx(Ot.GlobalStyles,{...e,defaultTheme:uc,themeId:Cs})}function gk(e){const{variants:t,...n}=e,r={variants:t,style:ii(n),isProcessed:!0};return r.style===n||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=ii(o.style))}),r}const bk=Yf();function No(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function ni(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function yk(e){return e?(t,n)=>n[e]:null}function xk(e,t,n){e.theme=vk(e.theme)?n:e.theme[t]||e.theme}function ru(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(o=>ru(e,o,n));if(Array.isArray(r?.variants)){let o;if(r.isProcessed)o=n?ni(r.style,n):r.style;else{const{variants:i,...s}=r;o=n?ni(ii(s),n):s}return yb(e,r.variants,[o],n)}return r?.isProcessed?n?ni(ii(r.style),n):r.style:n?ni(ii(r),n):r}function yb(e,t,n=[],r=void 0){let o;e:for(let i=0;i<t.length;i+=1){const s=t[i];if(typeof s.props=="function"){if(o??={...e,...e.ownerState,ownerState:e.ownerState},!s.props(o))continue}else for(const a in s.props)if(e[a]!==s.props[a]&&e.ownerState?.[a]!==s.props[a])continue e;typeof s.style=="function"?(o??={...e,...e.ownerState,ownerState:e.ownerState},n.push(r?ni(ii(s.style(o)),r):s.style(o))):n.push(r?ni(ii(s.style),r):s.style)}return n}function Ck(e={}){const{themeId:t,defaultTheme:n=bk,rootShouldForwardProp:r=No,slotShouldForwardProp:o=No}=e;function i(a){xk(a,t,n)}return(a,l={})=>{kS(a,T=>T.filter(N=>N!==cs));const{name:u,slot:d,skipVariantsResolver:f,skipSx:h,overridesResolver:p=yk(Sk(d)),...m}=l,b=u&&u.startsWith("Mui")||d?"components":"custom",y=f!==void 0?f:d&&d!=="Root"&&d!=="root"||!1,x=h||!1;let C=No;d==="Root"||d==="root"?C=r:d?C=o:Tk(a)&&(C=void 0);const v=SS(a,{shouldForwardProp:C,label:Ek(),...m}),S=T=>{if(T.__emotion_real===T)return T;if(typeof T=="function")return function(O){return ru(O,T,O.theme.modularCssLayers?b:void 0)};if(Gr(T)){const N=gk(T);return function(F){return N.variants?ru(F,N,F.theme.modularCssLayers?b:void 0):F.theme.modularCssLayers?ni(N.style,b):N.style}}return T},I=(...T)=>{const N=[],O=T.map(S),F=[];if(N.push(i),u&&p&&F.push(function(H){const L=H.theme.components?.[u]?.styleOverrides;if(!L)return null;const $={};for(const K in L)$[K]=ru(H,L[K],H.theme.modularCssLayers?"theme":void 0);return p(H,$)}),u&&!y&&F.push(function(H){const L=H.theme?.components?.[u]?.variants;return L?yb(H,L,[],H.theme.modularCssLayers?"theme":void 0):null}),x||F.push(cs),Array.isArray(O[0])){const D=O.shift(),H=new Array(N.length).fill(""),_=new Array(F.length).fill("");let L;L=[...H,...D,..._],L.raw=[...H,...D.raw,..._],N.unshift(L)}const B=[...N,...O,...F],j=v(...B);return a.muiName&&(j.muiName=a.muiName),j};return v.withConfig&&(I.withConfig=v.withConfig),I}}function Ek(e,t){return void 0}function vk(e){for(const t in e)return!1;return!0}function Tk(e){return typeof e=="string"&&e.charCodeAt(0)>96}function Sk(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function xb(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const $n=e=>xb(e)&&e!=="classes",fe=Ck({themeId:Cs,defaultTheme:uc,rootShouldForwardProp:$n});function kk(e){return function(n){return c.jsx(mk,{styles:typeof e=="function"?r=>e({theme:r,...n}):e})}}function wk(){return oS}const ft=Ot.unstable_memoTheme;function ut(e){return OS(e)}function We(e,t,n="Mui"){const r={};return t.forEach(o=>{r[o]=Ge(e,o,n)}),r}function Dk(e){return Ge("MuiSvgIcon",e)}We("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Ik=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${Fe(t)}`,`fontSize${Fe(n)}`]};return Ke(o,Dk,r)},Ak=fe("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Fe(n.color)}`],t[`fontSize${Fe(n.fontSize)}`]]}})(ft(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),Ou=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:u,inheritViewBox:d=!1,titleAccess:f,viewBox:h="0 0 24 24",...p}=r,m=M.isValidElement(o)&&o.type==="svg",b={...r,color:s,component:a,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:d,viewBox:h,hasSvgAsChild:m},y={};d||(y.viewBox=h);const x=Ik(b);return c.jsxs(Ak,{as:a,className:Ue(x.root,i),focusable:"false",color:u,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...y,...p,...m&&o.props,ownerState:b,children:[m?o.props.children:o,f?c.jsx("title",{children:f}):null]})});Ou.muiName="SvgIcon";function mt(e,t){function n(r,o){return c.jsx(Ou,{"data-testid":void 0,ref:o,...r,children:e})}return n.muiName=Ou.muiName,M.memo(M.forwardRef(n))}function Cb(e,t=166){let n;function r(...o){const i=()=>{e.apply(this,o)};clearTimeout(n),n=setTimeout(i,t)}return r.clear=()=>{clearTimeout(n)},r}function ou(e,t){return M.isValidElement(e)&&t.indexOf(e.type.muiName??e.type?._payload?.value?.muiName)!==-1}function mn(e){return e&&e.ownerDocument||document}function bo(e){return mn(e).defaultView||window}function Zd(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function or(e){const{controlled:t,default:n,name:r,state:o="value"}=e,{current:i}=M.useRef(t!==void 0),[s,a]=M.useState(n),l=i?t:s,u=M.useCallback(d=>{i||a(d)},[]);return[l,u]}function Ve(e){const t=M.useRef(e);return yn(()=>{t.current=e}),M.useRef((...n)=>(0,t.current)(...n)).current}function vt(...e){const t=M.useRef(void 0),n=M.useCallback(r=>{const o=e.map(i=>{if(i==null)return null;if(typeof i=="function"){const s=i,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return i.current=r,()=>{i.current=null}});return()=>{o.forEach(i=>i?.())}},e);return M.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}function Ok(e,t){const n=e.charCodeAt(2);return e[0]==="o"&&e[1]==="n"&&n>=65&&n<=90&&typeof t=="function"}function Eb(e,t){if(!e)return t;function n(s,a){const l={};return Object.keys(a).forEach(u=>{Ok(u,a[u])&&typeof s[u]=="function"&&(l[u]=(...d)=>{s[u](...d),a[u](...d)})}),l}if(typeof e=="function"||typeof t=="function")return s=>{const a=typeof t=="function"?t(s):t,l=typeof e=="function"?e({...s,...a}):e,u=Ue(s?.className,a?.className,l?.className),d=n(l,a);return{...a,...l,...d,...!!u&&{className:u},...a?.style&&l?.style&&{style:{...a.style,...l.style}},...a?.sx&&l?.sx&&{sx:[...Array.isArray(a.sx)?a.sx:[a.sx],...Array.isArray(l.sx)?l.sx:[l.sx]]}}};const r=t,o=n(e,r),i=Ue(r?.className,e?.className);return{...t,...e,...o,...!!i&&{className:i},...r?.style&&e?.style&&{style:{...r.style,...e.style}},...r?.sx&&e?.sx&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}const fl=mt(c.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"})),Ui=Ot.createStack({createStyledComponent:fe("div",{name:"MuiStack",slot:"Root"}),useThemeProps:e=>ut({props:e,name:"MuiStack"})});class ns{constructor(t,n){this.workbookData=n,this.workbookStorage=t,this.workbookData?this.isSaved=!0:(this.workbookData={models:[],cells:[],workbookPath:void 0},this.isSaved=!1)}isSaved;workbookStorage;getWorkbookData(){return this.workbookData}getWorkbookPath(){return this.workbookData.workbookPath}async renameWorkbook(t){if(this.workbookData.workbookPath.path!==t)try{await this.workbookStorage.moveWorkbook(this.workbookData.workbookPath,{path:t,workspace:this.workbookData.workbookPath.workspace})}catch{}return this.workbookData.workbookPath.path=t,this.isSaved=!1,await this.saveWorkbook()}getCells(){return this.workbookData.cells}deleteCell(t){return this.workbookData.cells=[...this.workbookData.cells.slice(0,t),...this.workbookData.cells.slice(t+1)],this.isSaved=!1,this}insertCell(t,n){return this.workbookData.cells=[...this.workbookData.cells.slice(0,t),n,...this.workbookData.cells.slice(t)],this.isSaved=!1,this}setCell(t,n){return this.workbookData.cells[t]=n,this.isSaved=!1,this}setModels(t){return this.workbookData.models=t,this.isSaved=!1,this}getModels(){return this.workbookData.models}updateWorkbookData(t){return this.workbookData=t,this.isSaved=!1,this}async saveWorkbook(){if(!this.isSaved){if(!this.workbookData.workbookPath)throw new Error("Workbook path is not set");await this.workbookStorage.saveWorkbook(this.workbookData.workbookPath,JSON.stringify(this.workbookData)),this.isSaved=!0}return new ns(this.workbookStorage,this.workbookData)}toMalloyWorkbook(){return this.workbookData.cells.map(t=>t.isMarkdown?`>>>markdown
|
|
17
|
+
`+t.value:`>>>malloy
|
|
18
|
+
import {${t.sourceName}}" from '${t.modelPath}'"
|
|
19
|
+
`+t.value+`
|
|
20
|
+
`).join(`
|
|
21
|
+
`)}static newWorkbook(t){return new ns(t,void 0)}static async loadWorkbook(t,n){let r;try{const o=await t.getWorkbook(n);o&&(r=JSON.parse(o))}catch{r={models:[],cells:[],workbookPath:n}}return new ns(t,r)}}const Hl=mt(c.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})),vb=mt(c.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),Pm=mt(c.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"})),Kf=mt(c.jsx("path",{d:"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5m-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4zm-3-4h8v2H8z"}));function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(null,arguments)}function Ze(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Jd(e){const t=[],n=String(e||"");let r=n.indexOf(","),o=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const s=n.slice(o,r).trim();(s||!i)&&t.push(s),o=r+1,r=n.indexOf(",",o)}return t}function cc(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Mk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Rk={};function Rm(e,t){return(Rk.jsx?Pk:Mk).test(e)}const Nk=/[ \t\n\f\r]/g;function Gf(e){return typeof e=="object"?e.type==="text"?Nm(e.value):!1:Nm(e)}function Nm(e){return e.replace(Nk,"")===""}let pl=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};pl.prototype.normal={};pl.prototype.property={};pl.prototype.space=void 0;function Tb(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new pl(n,r,t)}function Ga(e){return e.toLowerCase()}let Gn=class{constructor(t,n){this.attribute=n,this.property=t}};Gn.prototype.attribute="";Gn.prototype.booleanish=!1;Gn.prototype.boolean=!1;Gn.prototype.commaOrSpaceSeparated=!1;Gn.prototype.commaSeparated=!1;Gn.prototype.defined=!1;Gn.prototype.mustUseProperty=!1;Gn.prototype.number=!1;Gn.prototype.overloadedBoolean=!1;Gn.prototype.property="";Gn.prototype.spaceSeparated=!1;Gn.prototype.space=void 0;let Fk=0;const ht=bi(),pn=bi(),ef=bi(),$e=bi(),qt=bi(),rs=bi(),Zn=bi();function bi(){return 2**++Fk}const tf=Object.freeze(Object.defineProperty({__proto__:null,boolean:ht,booleanish:pn,commaOrSpaceSeparated:Zn,commaSeparated:rs,number:$e,overloadedBoolean:ef,spaceSeparated:qt},Symbol.toStringTag,{value:"Module"})),rd=Object.keys(tf);let Qf=class extends Gn{constructor(t,n,r,o){let i=-1;if(super(t,n),Fm(this,"space",o),typeof r=="number")for(;++i<rd.length;){const s=rd[i];Fm(this,rd[i],(r&tf[s])===tf[s])}}};Qf.prototype.defined=!0;function Fm(e,t,n){n&&(e[t]=n)}function Es(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new Qf(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Ga(r)]=r,n[Ga(i.attribute)]=r}return new pl(t,n,e.space)}const Sb=Es({properties:{ariaActiveDescendant:null,ariaAtomic:pn,ariaAutoComplete:null,ariaBusy:pn,ariaChecked:pn,ariaColCount:$e,ariaColIndex:$e,ariaColSpan:$e,ariaControls:qt,ariaCurrent:null,ariaDescribedBy:qt,ariaDetails:null,ariaDisabled:pn,ariaDropEffect:qt,ariaErrorMessage:null,ariaExpanded:pn,ariaFlowTo:qt,ariaGrabbed:pn,ariaHasPopup:null,ariaHidden:pn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qt,ariaLevel:$e,ariaLive:null,ariaModal:pn,ariaMultiLine:pn,ariaMultiSelectable:pn,ariaOrientation:null,ariaOwns:qt,ariaPlaceholder:null,ariaPosInSet:$e,ariaPressed:pn,ariaReadOnly:pn,ariaRelevant:null,ariaRequired:pn,ariaRoleDescription:qt,ariaRowCount:$e,ariaRowIndex:$e,ariaRowSpan:$e,ariaSelected:pn,ariaSetSize:$e,ariaSort:null,ariaValueMax:$e,ariaValueMin:$e,ariaValueNow:$e,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function kb(e,t){return t in e?e[t]:t}function wb(e,t){return kb(e,t.toLowerCase())}const Lk=Es({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:rs,acceptCharset:qt,accessKey:qt,action:null,allow:null,allowFullScreen:ht,allowPaymentRequest:ht,allowUserMedia:ht,alt:null,as:null,async:ht,autoCapitalize:null,autoComplete:qt,autoFocus:ht,autoPlay:ht,blocking:qt,capture:null,charSet:null,checked:ht,cite:null,className:qt,cols:$e,colSpan:null,content:null,contentEditable:pn,controls:ht,controlsList:qt,coords:$e|rs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ht,defer:ht,dir:null,dirName:null,disabled:ht,download:ef,draggable:pn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ht,formTarget:null,headers:qt,height:$e,hidden:ef,high:$e,href:null,hrefLang:null,htmlFor:qt,httpEquiv:qt,id:null,imageSizes:null,imageSrcSet:null,inert:ht,inputMode:null,integrity:null,is:null,isMap:ht,itemId:null,itemProp:qt,itemRef:qt,itemScope:ht,itemType:qt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ht,low:$e,manifest:null,max:null,maxLength:$e,media:null,method:null,min:null,minLength:$e,multiple:ht,muted:ht,name:null,nonce:null,noModule:ht,noValidate:ht,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:ht,optimum:$e,pattern:null,ping:qt,placeholder:null,playsInline:ht,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ht,referrerPolicy:null,rel:qt,required:ht,reversed:ht,rows:$e,rowSpan:$e,sandbox:qt,scope:null,scoped:ht,seamless:ht,selected:ht,shadowRootClonable:ht,shadowRootDelegatesFocus:ht,shadowRootMode:null,shape:null,size:$e,sizes:null,slot:null,span:$e,spellCheck:pn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$e,step:null,style:null,tabIndex:$e,target:null,title:null,translate:null,type:null,typeMustMatch:ht,useMap:null,value:pn,width:$e,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:qt,axis:null,background:null,bgColor:null,border:$e,borderColor:null,bottomMargin:$e,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ht,declare:ht,event:null,face:null,frame:null,frameBorder:null,hSpace:$e,leftMargin:$e,link:null,longDesc:null,lowSrc:null,marginHeight:$e,marginWidth:$e,noResize:ht,noHref:ht,noShade:ht,noWrap:ht,object:null,profile:null,prompt:null,rev:null,rightMargin:$e,rules:null,scheme:null,scrolling:pn,standby:null,summary:null,text:null,topMargin:$e,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$e,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ht,disableRemotePlayback:ht,prefix:null,property:null,results:$e,security:null,unselectable:null},space:"html",transform:wb}),_k=Es({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:Zn,accentHeight:$e,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$e,amplitude:$e,arabicForm:null,ascent:$e,attributeName:null,attributeType:null,azimuth:$e,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$e,by:null,calcMode:null,capHeight:$e,className:qt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$e,diffuseConstant:$e,direction:null,display:null,dur:null,divisor:$e,dominantBaseline:null,download:ht,dx:null,dy:null,edgeMode:null,editable:null,elevation:$e,enableBackground:null,end:null,event:null,exponent:$e,externalResourcesRequired:null,fill:null,fillOpacity:$e,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:rs,g2:rs,glyphName:rs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$e,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$e,horizOriginX:$e,horizOriginY:$e,id:null,ideographic:$e,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$e,k:$e,k1:$e,k2:$e,k3:$e,k4:$e,kernelMatrix:Zn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$e,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:$e,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:$e,overlineThickness:$e,paintOrder:null,panose1:null,path:null,pathLength:$e,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$e,pointsAtY:$e,pointsAtZ:$e,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Zn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Zn,rev:Zn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Zn,requiredFeatures:Zn,requiredFonts:Zn,requiredFormats:Zn,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:$e,specularExponent:$e,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$e,strikethroughThickness:$e,string:null,stroke:null,strokeDashArray:Zn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$e,strokeOpacity:$e,strokeWidth:null,style:null,surfaceScale:$e,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Zn,tabIndex:$e,tableValues:null,target:null,targetX:$e,targetY:$e,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Zn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$e,underlineThickness:$e,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$e,values:null,vAlphabetic:$e,vMathematical:$e,vectorEffect:null,vHanging:$e,vIdeographic:$e,version:null,vertAdvY:$e,vertOriginX:$e,vertOriginY:$e,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$e,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:kb}),Db=Es({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()}}),Ib=Es({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:wb}),Ab=Es({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Bk={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"},jk=/[A-Z]/g,Lm=/-[a-z]/g,$k=/^data[-\w.:]+$/i;function hl(e,t){const n=Ga(t);let r=t,o=Gn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&$k.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Lm,zk);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Lm.test(i)){let s=i.replace(jk,Hk);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=Qf}return new o(r,t)}function Hk(e){return"-"+e.toLowerCase()}function zk(e){return e.charAt(1).toUpperCase()}const vs=Tb([Sb,Lk,Db,Ib,Ab],"html"),_o=Tb([Sb,_k,Db,Ib,Ab],"svg");function nf(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function dc(e){return e.join(" ").trim()}var Vi={},od,_m;function Uk(){if(_m)return od;_m=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
|
|
22
|
+
`,u="/",d="*",f="",h="comment",p="declaration";od=function(b,y){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];y=y||{};var x=1,C=1;function v(H){var _=H.match(t);_&&(x+=_.length);var L=H.lastIndexOf(l);C=~L?H.length-L:C+H.length}function S(){var H={line:x,column:C};return function(_){return _.position=new I(H),O(),_}}function I(H){this.start=H,this.end={line:x,column:C},this.source=y.source}I.prototype.content=b;function T(H){var _=new Error(y.source+":"+x+":"+C+": "+H);if(_.reason=H,_.filename=y.source,_.line=x,_.column=C,_.source=b,!y.silent)throw _}function N(H){var _=H.exec(b);if(_){var L=_[0];return v(L),b=b.slice(L.length),_}}function O(){N(n)}function F(H){var _;for(H=H||[];_=B();)_!==!1&&H.push(_);return H}function B(){var H=S();if(!(u!=b.charAt(0)||d!=b.charAt(1))){for(var _=2;f!=b.charAt(_)&&(d!=b.charAt(_)||u!=b.charAt(_+1));)++_;if(_+=2,f===b.charAt(_-1))return T("End of comment missing");var L=b.slice(2,_-2);return C+=2,v(L),b=b.slice(_),C+=2,H({type:h,comment:L})}}function j(){var H=S(),_=N(r);if(_){if(B(),!N(o))return T("property missing ':'");var L=N(i),$=H({type:p,property:m(_[0].replace(e,f)),value:L?m(L[0].replace(e,f)):f});return N(s),$}}function D(){var H=[];F(H);for(var _;_=j();)_!==!1&&(H.push(_),F(H));return H}return O(),D()};function m(b){return b?b.replace(a,f):f}return od}var Bm;function Vk(){if(Bm)return Vi;Bm=1;var e=Vi&&Vi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.default=n;var t=e(Uk());function n(r,o){var i=null;if(!r||typeof r!="string")return i;var s=(0,t.default)(r),a=typeof o=="function";return s.forEach(function(l){if(l.type==="declaration"){var u=l.property,d=l.value;a?o(u,d,l):d&&(i=i||{},i[u]=d)}}),i}return Vi}var Ks={},jm;function Wk(){if(jm)return Ks;jm=1,Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(u){return!u||n.test(u)||e.test(u)},s=function(u,d){return d.toUpperCase()},a=function(u,d){return"".concat(d,"-")},l=function(u,d){return d===void 0&&(d={}),i(u)?u:(u=u.toLowerCase(),d.reactCompat?u=u.replace(o,a):u=u.replace(r,a),u.replace(t,s))};return Ks.camelCase=l,Ks}var Gs,$m;function qk(){if($m)return Gs;$m=1;var e=Gs&&Gs.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(Vk()),n=Wk();function r(o,i){var s={};return!o||typeof o!="string"||(0,t.default)(o,function(a,l){a&&l&&(s[(0,n.camelCase)(a,i)]=l)}),s}return r.default=r,Gs=r,Gs}var Yk=qk();const Kk=Tr(Yk),fc=Ob("end"),Jr=Ob("start");function Ob(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 Gk(e){const t=Jr(e),n=fc(e);if(t&&n)return{start:t,end:n}}function Ma(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Hm(e.position):"start"in e||"end"in e?Hm(e):"line"in e||"column"in e?rf(e):""}function rf(e){return zm(e&&e.line)+":"+zm(e&&e.column)}function Hm(e){return rf(e&&e.start)+"-"+rf(e&&e.end)}function zm(e){return e&&typeof e=="number"?e:1}class Mn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},s=!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&&(s=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=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=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=a?a.line:void 0,this.name=Ma(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=s&&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}}Mn.prototype.file="";Mn.prototype.name="";Mn.prototype.reason="";Mn.prototype.message="";Mn.prototype.stack="";Mn.prototype.column=void 0;Mn.prototype.line=void 0;Mn.prototype.ancestors=void 0;Mn.prototype.cause=void 0;Mn.prototype.fatal=void 0;Mn.prototype.place=void 0;Mn.prototype.ruleId=void 0;Mn.prototype.source=void 0;const Xf={}.hasOwnProperty,Qk=new Map,Xk=/[A-Z]/g,Zk=new Set(["table","tbody","thead","tfoot","tr"]),Jk=new Set(["td","th"]),Mb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ew(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=lw(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=aw(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"?_o:vs,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Pb(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Pb(e,t,n){if(t.type==="element")return tw(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return nw(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ow(e,t,n);if(t.type==="mdxjsEsm")return rw(e,t);if(t.type==="root")return iw(e,t,n);if(t.type==="text")return sw(e,t)}function tw(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=_o,e.schema=o),e.ancestors.push(t);const i=Nb(e,t.tagName,!1),s=uw(e,t);let a=Jf(e,t);return Zk.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!Gf(l):!0})),Rb(e,s,i,t),Zf(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function nw(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)}Qa(e,t.position)}function rw(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Qa(e,t.position)}function ow(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=_o,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:Nb(e,t.name,!0),s=cw(e,t),a=Jf(e,t);return Rb(e,s,i,t),Zf(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function iw(e,t,n){const r={};return Zf(r,Jf(e,t)),e.create(t,e.Fragment,r,n)}function sw(e,t){return t.value}function Rb(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Zf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function aw(e,t,n){return r;function r(o,i,s,a){const u=Array.isArray(s.children)?n:t;return a?u(i,s,a):u(i,s)}}function lw(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=Jr(r);return t(o,i,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function uw(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Xf.call(t.properties,o)){const i=dw(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Jk.has(t.tagName)?r=a:n[s]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function cw(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 s=i.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Qa(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 a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else Qa(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function Jf(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Qk;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const u=o.get(l)||0;s=l+"-"+u,o.set(l,u+1)}}const a=Pb(e,i,s);a!==void 0&&n.push(a)}return n}function dw(e,t,n){const r=hl(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?cc(n):dc(n)),r.property==="style"){let o=typeof n=="object"?n:fw(e,String(n));return e.stylePropertyNameCase==="css"&&(o=pw(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?Bk[r.property]||r.property:r.attribute,n]}}function fw(e,t){try{return Kk(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Mn("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=Mb+"#cannot-parse-style-attribute",o}}function Nb(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,s;for(;++i<o.length;){const a=Rm(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=s}else r=Rm(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return Xf.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Qa(e)}function Qa(e,t){const n=new Mn("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=Mb+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pw(e){const t={};let n;for(n in e)Xf.call(e,n)&&(t[hw(n)]=e[n]);return t}function hw(e){let t=e.replace(Xk,mw);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function mw(e){return"-"+e.toLowerCase()}const id={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"]},gw={};function ep(e,t){const n=gw,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Fb(e,r,o)}function Fb(e,t,n){if(bw(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 Um(e.children,t,n)}return Array.isArray(e)?Um(e,t,n):""}function Um(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Fb(e[o],t,n);return r.join("")}function bw(e){return!!(e&&typeof e=="object")}const Vm=document.createElement("i");function tp(e){const t="&"+e+";";Vm.innerHTML=t;const n=Vm.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ir(e,t,n,r){const o=e.length;let i=0,s;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function mr(e,t){return e.length>0?(ir(e,e.length,0,t),e):t}const Wm={}.hasOwnProperty;function Lb(e){const t={};let n=-1;for(;++n<e.length;)yw(t,e[n]);return t}function yw(e,t){let n;for(n in t){const o=(Wm.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){Wm.call(o,s)||(o[s]=[]);const a=i[s];xw(o[s],Array.isArray(a)?a:a?[a]:[])}}}function xw(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ir(e,0,0,r)}function _b(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 Nr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const _n=Bo(/[A-Za-z]/),In=Bo(/[\dA-Za-z]/),Cw=Bo(/[#-'*+\--9=?A-Z^-~]/);function Mu(e){return e!==null&&(e<32||e===127)}const of=Bo(/\d/),Ew=Bo(/[\dA-Fa-f]/),vw=Bo(/[!-/:-@[-`{-~]/);function tt(e){return e!==null&&e<-2}function Vt(e){return e!==null&&(e<0||e===32)}function St(e){return e===-2||e===-1||e===32}const pc=Bo(/\p{P}|\p{S}/u),ci=Bo(/\s/);function Bo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ts(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&In(e.charCodeAt(n+1))&&In(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),o=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function At(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return St(l)?(e.enter(n),a(l)):t(l)}function a(l){return St(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const Tw={tokenize:Sw};function Sw(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),At(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return tt(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const kw={tokenize:ww},qm={tokenize:Dw};function ww(e){const t=this,n=[];let r=0,o,i,s;return a;function a(v){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,u)(v)}return u(v)}function l(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&C();const S=t.events.length;let I=S,T;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){T=t.events[I][1].end;break}x(r);let N=S;for(;N<t.events.length;)t.events[N][1].end={...T},N++;return ir(t.events,I+1,0,t.events.slice(S)),t.events.length=N,u(v)}return a(v)}function u(v){if(r===n.length){if(!o)return h(v);if(o.currentConstruct&&o.currentConstruct.concrete)return m(v);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(qm,d,f)(v)}function d(v){return o&&C(),x(r),h(v)}function f(v){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(v)}function h(v){return t.containerState={},e.attempt(qm,p,m)(v)}function p(v){return r++,n.push([t.currentConstruct,t.containerState]),h(v)}function m(v){if(v===null){o&&C(),x(0),e.consume(v);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),b(v)}function b(v){if(v===null){y(e.exit("chunkFlow"),!0),x(0),e.consume(v);return}return tt(v)?(e.consume(v),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(v),b)}function y(v,S){const I=t.sliceStream(v);if(S&&I.push(null),v.previous=i,i&&(i.next=v),i=v,o.defineSkip(v.start),o.write(I),t.parser.lazy[v.start.line]){let T=o.events.length;for(;T--;)if(o.events[T][1].start.offset<s&&(!o.events[T][1].end||o.events[T][1].end.offset>s))return;const N=t.events.length;let O=N,F,B;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(F){B=t.events[O][1].end;break}F=!0}for(x(r),T=N;T<t.events.length;)t.events[T][1].end={...B},T++;ir(t.events,O+1,0,t.events.slice(N)),t.events.length=T}}function x(v){let S=n.length;for(;S-- >v;){const I=n[S];t.containerState=I[1],I[0].exit.call(t,e)}n.length=v}function C(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Dw(e,t,n){return At(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ds(e){if(e===null||Vt(e)||ci(e))return 1;if(pc(e))return 2}function hc(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 sf={name:"attention",resolveAll:Iw,tokenize:Aw};function Iw(e,t){let n=-1,r,o,i,s,a,l,u,d;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;l=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 f={...e[r][1].end},h={...e[n][1].start};Ym(f,-l),Ym(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=mr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=mr(u,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),u=mr(u,hc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=mr(u,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=mr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ir(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Aw(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=ds(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const u=e.exit("attentionSequence"),d=ds(l),f=!d||d===2&&o||n.includes(l),h=!o||o===2&&d||n.includes(r);return u._open=!!(i===42?f:f&&(o||!h)),u._close=!!(i===42?h:h&&(d||!f)),t(l)}}function Ym(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ow={name:"autolink",tokenize:Mw};function Mw(e,t,n){let r=0;return o;function o(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return _n(p)?(e.consume(p),s):p===64?n(p):u(p)}function s(p){return p===43||p===45||p===46||In(p)?(r=1,a(p)):u(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||In(p))&&r++<32?(e.consume(p),a):(r=0,u(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Mu(p)?n(p):(e.consume(p),l)}function u(p){return p===64?(e.consume(p),d):Cw(p)?(e.consume(p),u):n(p)}function d(p){return In(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||In(p))&&r++<63){const m=p===45?h:f;return e.consume(p),m}return n(p)}}const ml={partial:!0,tokenize:Pw};function Pw(e,t,n){return r;function r(i){return St(i)?At(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||tt(i)?t(i):n(i)}}const Bb={continuation:{tokenize:Nw},exit:Fw,name:"blockQuote",tokenize:Rw};function Rw(e,t,n){const r=this;return o;function o(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return St(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Nw(e,t,n){const r=this;return o;function o(s){return St(s)?At(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(Bb,t,n)(s)}}function Fw(e){e.exit("blockQuote")}const jb={name:"characterEscape",tokenize:Lw};function Lw(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 vw(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const $b={name:"characterReference",tokenize:_w};function _w(e,t,n){const r=this;let o=0,i,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),i=31,s=In,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=Ew,d):(e.enter("characterReferenceValue"),i=7,s=of,d(f))}function d(f){if(f===59&&o){const h=e.exit("characterReferenceValue");return s===In&&!tp(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&o++<i?(e.consume(f),d):n(f)}}const Km={partial:!0,tokenize:jw},Gm={concrete:!0,name:"codeFenced",tokenize:Bw};function Bw(e,t,n){const r=this,o={partial:!0,tokenize:I};let i=0,s=0,a;return l;function l(T){return u(T)}function u(T){const N=r.events[r.events.length-1];return i=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,a=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(T)}function d(T){return T===a?(s++,e.consume(T),d):s<3?n(T):(e.exit("codeFencedFenceSequence"),St(T)?At(e,f,"whitespace")(T):f(T))}function f(T){return T===null||tt(T)?(e.exit("codeFencedFence"),r.interrupt?t(T):e.check(Km,b,S)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(T))}function h(T){return T===null||tt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(T)):St(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),At(e,p,"whitespace")(T)):T===96&&T===a?n(T):(e.consume(T),h)}function p(T){return T===null||tt(T)?f(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(T))}function m(T){return T===null||tt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(T)):T===96&&T===a?n(T):(e.consume(T),m)}function b(T){return e.attempt(o,S,y)(T)}function y(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),x}function x(T){return i>0&&St(T)?At(e,C,"linePrefix",i+1)(T):C(T)}function C(T){return T===null||tt(T)?e.check(Km,b,S)(T):(e.enter("codeFlowValue"),v(T))}function v(T){return T===null||tt(T)?(e.exit("codeFlowValue"),C(T)):(e.consume(T),v)}function S(T){return e.exit("codeFenced"),t(T)}function I(T,N,O){let F=0;return B;function B(L){return T.enter("lineEnding"),T.consume(L),T.exit("lineEnding"),j}function j(L){return T.enter("codeFencedFence"),St(L)?At(T,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):D(L)}function D(L){return L===a?(T.enter("codeFencedFenceSequence"),H(L)):O(L)}function H(L){return L===a?(F++,T.consume(L),H):F>=s?(T.exit("codeFencedFenceSequence"),St(L)?At(T,_,"whitespace")(L):_(L)):O(L)}function _(L){return L===null||tt(L)?(T.exit("codeFencedFence"),N(L)):O(L)}}}function jw(e,t,n){const r=this;return o;function o(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const sd={name:"codeIndented",tokenize:Hw},$w={partial:!0,tokenize:zw};function Hw(e,t,n){const r=this;return o;function o(u){return e.enter("codeIndented"),At(e,i,"linePrefix",5)(u)}function i(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):tt(u)?e.attempt($w,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||tt(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function zw(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):tt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):At(e,i,"linePrefix",5)(s)}function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):tt(s)?o(s):n(s)}}const Uw={name:"codeText",previous:Ww,resolve:Vw,tokenize:qw};function Vw(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 Ww(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function qw(e,t,n){let r=0,o,i;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(i=e.enter("codeTextSequence"),o=0,d(f)):tt(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||tt(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),o++,d):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",u(f))}}class Yw{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&&Qs(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),Qs(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Qs(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);Qs(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Qs(this.left,n.reverse())}}}function Qs(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 Hb(e){const t={};let n=-1,r,o,i,s,a,l,u;const d=new Yw(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Kw(d,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(s=d.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(o&&(d.get(o)[1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;o&&(r[1].end={...d.get(o)[1].start},a=d.slice(o,n),a.unshift(r),d.splice(o,n-o+1,a))}}return ir(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function Kw(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],u={};let d,f,h=-1,p=n,m=0,b=0;const y=[b];for(;p;){for(;e.get(++o)[1]!==p;);i.push(o),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(b=h+1,y.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),h=y.length;h--;){const x=a.slice(y[h],y[h+1]),C=i.pop();l.push([C,C+x.length-1]),e.splice(C,2,x)}for(l.reverse(),h=-1;++h<l.length;)u[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return u}const Gw={resolve:Xw,tokenize:Zw},Qw={partial:!0,tokenize:Jw};function Xw(e){return Hb(e),e}function Zw(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):tt(a)?e.check(Qw,s,i)(a):(e.consume(a),o)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function Jw(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),At(e,i,"linePrefix")}function i(s){if(s===null||tt(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function zb(e,t,n,r,o,i,s,a,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(x){return x===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(x),e.exit(i),h):x===null||x===32||x===41||Mu(x)?n(x):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(x))}function h(x){return x===62?(e.enter(i),e.consume(x),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===62?(e.exit("chunkString"),e.exit(a),h(x)):x===null||x===60||tt(x)?n(x):(e.consume(x),x===92?m:p)}function m(x){return x===60||x===62||x===92?(e.consume(x),p):p(x)}function b(x){return!d&&(x===null||x===41||Vt(x))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(x)):d<u&&x===40?(e.consume(x),d++,b):x===41?(e.consume(x),d--,b):x===null||x===32||x===40||Mu(x)?n(x):(e.consume(x),x===92?y:b)}function y(x){return x===40||x===41||x===92?(e.consume(x),b):b(x)}}function Ub(e,t,n,r,o,i){const s=this;let a=0,l;return u;function u(p){return e.enter(r),e.enter(o),e.consume(p),e.exit(o),e.enter(i),d}function d(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(i),e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):tt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||tt(p)||a++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!St(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function Vb(e,t,n,r,o,i){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(o),e.consume(h),e.exit(o),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(o),e.consume(h),e.exit(o),e.exit(r),t):(e.enter(i),u(h))}function u(h){return h===s?(e.exit(i),l(s)):h===null?n(h):tt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),At(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===s||h===null||tt(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===s||h===92?(e.consume(h),d):d(h)}}function Pa(e,t){let n;return r;function r(o){return tt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):St(o)?At(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const e3={name:"definition",tokenize:n3},t3={partial:!0,tokenize:r3};function n3(e,t,n){const r=this;let o;return i;function i(p){return e.enter("definition"),s(p)}function s(p){return Ub.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return o=Nr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return Vt(p)?Pa(e,u)(p):u(p)}function u(p){return zb(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(t3,f,f)(p)}function f(p){return St(p)?At(e,h,"whitespace")(p):h(p)}function h(p){return p===null||tt(p)?(e.exit("definition"),r.parser.defined.push(o),t(p)):n(p)}}function r3(e,t,n){return r;function r(a){return Vt(a)?Pa(e,o)(a):n(a)}function o(a){return Vb(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return St(a)?At(e,s,"whitespace")(a):s(a)}function s(a){return a===null||tt(a)?t(a):n(a)}}const o3={name:"hardBreakEscape",tokenize:i3};function i3(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return tt(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const s3={name:"headingAtx",resolve:a3,tokenize:l3};function a3(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"},ir(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function l3(e,t,n){let r=0;return o;function o(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||Vt(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||tt(d)?(e.exit("atxHeading"),t(d)):St(d)?At(e,a,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function u(d){return d===null||d===35||Vt(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),u)}}const u3=["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"],Qm=["pre","script","style","textarea"],c3={concrete:!0,name:"htmlFlow",resolveTo:p3,tokenize:h3},d3={partial:!0,tokenize:g3},f3={partial:!0,tokenize:m3};function p3(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 h3(e,t,n){const r=this;let o,i,s,a,l;return u;function u(z){return d(z)}function d(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),f}function f(z){return z===33?(e.consume(z),h):z===47?(e.consume(z),i=!0,b):z===63?(e.consume(z),o=3,r.interrupt?t:R):_n(z)?(e.consume(z),s=String.fromCharCode(z),y):n(z)}function h(z){return z===45?(e.consume(z),o=2,p):z===91?(e.consume(z),o=5,a=0,m):_n(z)?(e.consume(z),o=4,r.interrupt?t:R):n(z)}function p(z){return z===45?(e.consume(z),r.interrupt?t:R):n(z)}function m(z){const pe="CDATA[";return z===pe.charCodeAt(a++)?(e.consume(z),a===pe.length?r.interrupt?t:D:m):n(z)}function b(z){return _n(z)?(e.consume(z),s=String.fromCharCode(z),y):n(z)}function y(z){if(z===null||z===47||z===62||Vt(z)){const pe=z===47,J=s.toLowerCase();return!pe&&!i&&Qm.includes(J)?(o=1,r.interrupt?t(z):D(z)):u3.includes(s.toLowerCase())?(o=6,pe?(e.consume(z),x):r.interrupt?t(z):D(z)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(z):i?C(z):v(z))}return z===45||In(z)?(e.consume(z),s+=String.fromCharCode(z),y):n(z)}function x(z){return z===62?(e.consume(z),r.interrupt?t:D):n(z)}function C(z){return St(z)?(e.consume(z),C):B(z)}function v(z){return z===47?(e.consume(z),B):z===58||z===95||_n(z)?(e.consume(z),S):St(z)?(e.consume(z),v):B(z)}function S(z){return z===45||z===46||z===58||z===95||In(z)?(e.consume(z),S):I(z)}function I(z){return z===61?(e.consume(z),T):St(z)?(e.consume(z),I):v(z)}function T(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),l=z,N):St(z)?(e.consume(z),T):O(z)}function N(z){return z===l?(e.consume(z),l=null,F):z===null||tt(z)?n(z):(e.consume(z),N)}function O(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||Vt(z)?I(z):(e.consume(z),O)}function F(z){return z===47||z===62||St(z)?v(z):n(z)}function B(z){return z===62?(e.consume(z),j):n(z)}function j(z){return z===null||tt(z)?D(z):St(z)?(e.consume(z),j):n(z)}function D(z){return z===45&&o===2?(e.consume(z),$):z===60&&o===1?(e.consume(z),K):z===62&&o===4?(e.consume(z),oe):z===63&&o===3?(e.consume(z),R):z===93&&o===5?(e.consume(z),q):tt(z)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(d3,se,H)(z)):z===null||tt(z)?(e.exit("htmlFlowData"),H(z)):(e.consume(z),D)}function H(z){return e.check(f3,_,se)(z)}function _(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),L}function L(z){return z===null||tt(z)?H(z):(e.enter("htmlFlowData"),D(z))}function $(z){return z===45?(e.consume(z),R):D(z)}function K(z){return z===47?(e.consume(z),s="",G):D(z)}function G(z){if(z===62){const pe=s.toLowerCase();return Qm.includes(pe)?(e.consume(z),oe):D(z)}return _n(z)&&s.length<8?(e.consume(z),s+=String.fromCharCode(z),G):D(z)}function q(z){return z===93?(e.consume(z),R):D(z)}function R(z){return z===62?(e.consume(z),oe):z===45&&o===2?(e.consume(z),R):D(z)}function oe(z){return z===null||tt(z)?(e.exit("htmlFlowData"),se(z)):(e.consume(z),oe)}function se(z){return e.exit("htmlFlow"),t(z)}}function m3(e,t,n){const r=this;return o;function o(s){return tt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function g3(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(ml,t,n)}}const b3={name:"htmlText",tokenize:y3};function y3(e,t,n){const r=this;let o,i,s;return a;function a(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),l}function l(R){return R===33?(e.consume(R),u):R===47?(e.consume(R),I):R===63?(e.consume(R),v):_n(R)?(e.consume(R),O):n(R)}function u(R){return R===45?(e.consume(R),d):R===91?(e.consume(R),i=0,m):_n(R)?(e.consume(R),C):n(R)}function d(R){return R===45?(e.consume(R),p):n(R)}function f(R){return R===null?n(R):R===45?(e.consume(R),h):tt(R)?(s=f,K(R)):(e.consume(R),f)}function h(R){return R===45?(e.consume(R),p):f(R)}function p(R){return R===62?$(R):R===45?h(R):f(R)}function m(R){const oe="CDATA[";return R===oe.charCodeAt(i++)?(e.consume(R),i===oe.length?b:m):n(R)}function b(R){return R===null?n(R):R===93?(e.consume(R),y):tt(R)?(s=b,K(R)):(e.consume(R),b)}function y(R){return R===93?(e.consume(R),x):b(R)}function x(R){return R===62?$(R):R===93?(e.consume(R),x):b(R)}function C(R){return R===null||R===62?$(R):tt(R)?(s=C,K(R)):(e.consume(R),C)}function v(R){return R===null?n(R):R===63?(e.consume(R),S):tt(R)?(s=v,K(R)):(e.consume(R),v)}function S(R){return R===62?$(R):v(R)}function I(R){return _n(R)?(e.consume(R),T):n(R)}function T(R){return R===45||In(R)?(e.consume(R),T):N(R)}function N(R){return tt(R)?(s=N,K(R)):St(R)?(e.consume(R),N):$(R)}function O(R){return R===45||In(R)?(e.consume(R),O):R===47||R===62||Vt(R)?F(R):n(R)}function F(R){return R===47?(e.consume(R),$):R===58||R===95||_n(R)?(e.consume(R),B):tt(R)?(s=F,K(R)):St(R)?(e.consume(R),F):$(R)}function B(R){return R===45||R===46||R===58||R===95||In(R)?(e.consume(R),B):j(R)}function j(R){return R===61?(e.consume(R),D):tt(R)?(s=j,K(R)):St(R)?(e.consume(R),j):F(R)}function D(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),o=R,H):tt(R)?(s=D,K(R)):St(R)?(e.consume(R),D):(e.consume(R),_)}function H(R){return R===o?(e.consume(R),o=void 0,L):R===null?n(R):tt(R)?(s=H,K(R)):(e.consume(R),H)}function _(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||Vt(R)?F(R):(e.consume(R),_)}function L(R){return R===47||R===62||Vt(R)?F(R):n(R)}function $(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function K(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),G}function G(R){return St(R)?At(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):q(R)}function q(R){return e.enter("htmlTextData"),s(R)}}const np={name:"labelEnd",resolveAll:v3,resolveTo:T3,tokenize:S3},x3={tokenize:k3},C3={tokenize:w3},E3={tokenize:D3};function v3(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&&ir(e,0,e.length,n),e}function T3(e,t){let n=e.length,r=0,o,i,s,a;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(s){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"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},d={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=mr(a,e.slice(i+1,i+r+3)),a=mr(a,[["enter",d,t]]),a=mr(a,hc(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=mr(a,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),a=mr(a,e.slice(s+1)),a=mr(a,[["exit",l,t]]),ir(e,i,e.length,a),e}function S3(e,t,n){const r=this;let o=r.events.length,i,s;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 a;function a(h){return i?i._inactive?f(h):(s=r.parser.defined.includes(Nr(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(x3,d,s?d:f)(h):h===91?e.attempt(C3,d,s?u:f)(h):s?d(h):f(h)}function u(h){return e.attempt(E3,d,f)(h)}function d(h){return t(h)}function f(h){return i._balanced=!0,n(h)}}function k3(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),o}function o(f){return Vt(f)?Pa(e,i)(f):i(f)}function i(f){return f===41?d(f):zb(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Vt(f)?Pa(e,l)(f):d(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?Vb(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return Vt(f)?Pa(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function w3(e,t,n){const r=this;return o;function o(a){return Ub.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(Nr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function D3(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 I3={name:"labelStartImage",resolveAll:np.resolveAll,tokenize:A3};function A3(e,t,n){const r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const O3={name:"labelStartLink",resolveAll:np.resolveAll,tokenize:M3};function M3(e,t,n){const r=this;return o;function o(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const ad={name:"lineEnding",tokenize:P3};function P3(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),At(e,t,"linePrefix")}}const iu={name:"thematicBreak",tokenize:R3};function R3(e,t,n){let r=0,o;return i;function i(u){return e.enter("thematicBreak"),s(u)}function s(u){return o=u,a(u)}function a(u){return u===o?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||tt(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===o?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),St(u)?At(e,a,"whitespace")(u):a(u))}}const Vn={continuation:{tokenize:_3},exit:j3,name:"list",tokenize:L3},N3={partial:!0,tokenize:$3},F3={partial:!0,tokenize:B3};function L3(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,s=0;return a;function a(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:of(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(iu,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return of(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(ml,r.interrupt?n:d,e.attempt(N3,h,f))}function d(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return St(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function _3(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ml,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,At(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!St(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(F3,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,At(e,e.attempt(Vn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function B3(e,t,n){const r=this;return At(e,o,"listItemIndent",r.containerState.size+1);function o(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function j3(e){e.exit(this.containerState.type)}function $3(e,t,n){const r=this;return At(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const s=r.events[r.events.length-1];return!St(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const Xm={name:"setextUnderline",resolveTo:H3,tokenize:z3};function H3(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 s={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",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function z3(e,t,n){const r=this;let o;return i;function i(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),o=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===o?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),St(u)?At(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||tt(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const U3={tokenize:V3};function V3(e){const t=this,n=e.attempt(ml,r,e.attempt(this.parser.constructs.flowInitial,o,At(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Gw,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 W3={resolveAll:qb()},q3=Wb("string"),Y3=Wb("text");function Wb(e){return{resolveAll:qb(e==="text"?K3:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,s,a);return s;function s(d){return u(d)?i(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const f=o[d];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function qb(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 K3(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,s=-1,a=0,l;for(;i--;){const u=o[i];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)l=!0,a++;else if(u!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:r.start._bufferIndex+s,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const G3={42:Vn,43:Vn,45:Vn,48:Vn,49:Vn,50:Vn,51:Vn,52:Vn,53:Vn,54:Vn,55:Vn,56:Vn,57:Vn,62:Bb},Q3={91:e3},X3={[-2]:sd,[-1]:sd,32:sd},Z3={35:s3,42:iu,45:[Xm,iu],60:c3,61:Xm,95:iu,96:Gm,126:Gm},J3={38:$b,92:jb},eD={[-5]:ad,[-4]:ad,[-3]:ad,33:I3,38:$b,42:sf,60:[Ow,b3],91:O3,92:[o3,jb],93:np,95:sf,96:Uw},tD={null:[sf,W3]},nD={null:[42,95]},rD={null:[]},oD=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:nD,contentInitial:Q3,disable:rD,document:G3,flow:Z3,flowInitial:X3,insideSpan:tD,string:J3,text:eD},Symbol.toStringTag,{value:"Module"}));function iD(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 s=[],a=[];const l={attempt:N(I),check:N(T),consume:C,enter:v,exit:S,interrupt:N(T,{interrupt:!0})},u={code:null,containerState:{},defineSkip:b,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let d=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function f(j){return s=mr(s,j),y(),s[s.length-1]!==null?[]:(O(t,0),u.events=hc(i,u.events,u),u.events)}function h(j,D){return aD(p(j),D)}function p(j){return sD(s,j)}function m(){const{_bufferIndex:j,_index:D,line:H,column:_,offset:L}=r;return{_bufferIndex:j,_index:D,line:H,column:_,offset:L}}function b(j){o[j.line]=j.column,B()}function y(){let j;for(;r._index<s.length;){const D=s[r._index];if(typeof D=="string")for(j=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<D.length;)x(D.charCodeAt(r._bufferIndex));else x(D)}}function x(j){d=d(j)}function C(j){tt(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,B()):j!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=j}function v(j,D){const H=D||{};return H.type=j,H.start=m(),u.events.push(["enter",H,u]),a.push(H),H}function S(j){const D=a.pop();return D.end=m(),u.events.push(["exit",D,u]),D}function I(j,D){O(j,D.from)}function T(j,D){D.restore()}function N(j,D){return H;function H(_,L,$){let K,G,q,R;return Array.isArray(_)?se(_):"tokenize"in _?se([_]):oe(_);function oe(Q){return re;function re(ne){const ae=ne!==null&&Q[ne],ie=ne!==null&&Q.null,Z=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(ie)?ie:ie?[ie]:[]];return se(Z)(ne)}}function se(Q){return K=Q,G=0,Q.length===0?$:z(Q[G])}function z(Q){return re;function re(ne){return R=F(),q=Q,Q.partial||(u.currentConstruct=Q),Q.name&&u.parser.constructs.disable.null.includes(Q.name)?J():Q.tokenize.call(D?Object.assign(Object.create(u),D):u,l,pe,J)(ne)}}function pe(Q){return j(q,R),L}function J(Q){return R.restore(),++G<K.length?z(K[G]):$}}}function O(j,D){j.resolveAll&&!i.includes(j)&&i.push(j),j.resolve&&ir(u.events,D,u.events.length-D,j.resolve(u.events.slice(D),u)),j.resolveTo&&(u.events=j.resolveTo(u.events,u))}function F(){const j=m(),D=u.previous,H=u.currentConstruct,_=u.events.length,L=Array.from(a);return{from:_,restore:$};function $(){r=j,u.previous=D,u.currentConstruct=H,u.events.length=_,a=L,B()}}function B(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function sD(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let s;if(n===o)s=[e[n].slice(r,i)];else{if(s=e.slice(n,o),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}i>0&&s.push(e[o].slice(0,i))}return s}function aD(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
|
|
23
|
+
`;break}case-3:{s=`\r
|
|
24
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&o)continue;s=" ";break}default:s=String.fromCharCode(i)}o=i===-2,r.push(s)}return r.join("")}function lD(e){const r={constructs:Lb([oD,...(e||{}).extensions||[]]),content:o(Tw),defined:[],document:o(kw),flow:o(U3),lazy:{},string:o(q3),text:o(Y3)};return r;function o(i){return s;function s(a){return iD(r,i,a)}}}function uD(e){for(;!Hb(e););return e}const Zm=/[\0\t\n\r]/g;function cD(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let u,d,f,h,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),f=0,t="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(Zm.lastIndex=f,u=Zm.exec(i),h=u&&u.index!==void 0?u.index:i.length,p=i.charCodeAt(h),!u){t=i.slice(f);break}if(p===10&&f===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<h&&(l.push(i.slice(f,h)),e+=h-f),p){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const dD=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fD(e){return e.replace(dD,pD)}function pD(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return _b(n.slice(i?2:1),i?16:10)}return tp(n)||e}const Yb={}.hasOwnProperty;function hD(e,t,n){return typeof t!="string"&&(n=t,t=void 0),mD(n)(uD(lD(n).document().write(cD()(e,t,!0))))}function mD(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(ze),autolinkProtocol:F,autolinkEmail:F,atxHeading:i(Ie),blockQuote:i(ie),characterEscape:F,characterReference:F,codeFenced:i(Z),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(Z,s),codeText:i(me,s),codeTextData:F,data:F,codeFlowValue:F,definition:i(le),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(ue),hardBreakEscape:i(Ce),hardBreakTrailing:i(Ce),htmlFlow:i(we,s),htmlFlowData:F,htmlText:i(we,s),htmlTextData:F,image:i(ye),label:s,link:i(ze),listItem:i(nt),listItemValue:h,listOrdered:i(Ne,f),listUnordered:i(Ne),paragraph:i(_e),reference:z,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(Ie),strong:i(Bt),thematicBreak:i(ot)},exit:{atxHeading:l(),atxHeadingSequence:I,autolink:l(),autolinkEmail:ae,autolinkProtocol:ne,blockQuote:l(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:Q,characterReference:re,codeFenced:l(y),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:B,codeIndented:l(x),codeText:l(L),codeTextData:B,data:B,definition:l(),definitionDestinationString:S,definitionLabelString:C,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(D),hardBreakTrailing:l(D),htmlFlow:l(H),htmlFlowData:B,htmlText:l(_),htmlTextData:B,image:l(K),label:q,labelText:G,lineEnding:j,link:l($),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:pe,resourceDestinationString:R,resourceTitleString:oe,resource:se,setextHeading:l(O),setextHeadingLineSequence:N,setextHeadingText:T,strong:l(),thematicBreak:l()}};Kb(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(xe){let Pe={type:"root",children:[]};const qe={stack:[Pe],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:d,data:n},Je=[];let Xe=-1;for(;++Xe<xe.length;)if(xe[Xe][1].type==="listOrdered"||xe[Xe][1].type==="listUnordered")if(xe[Xe][0]==="enter")Je.push(Xe);else{const Re=Je.pop();Xe=o(xe,Re,Xe)}for(Xe=-1;++Xe<xe.length;){const Re=t[xe[Xe][0]];Yb.call(Re,xe[Xe][1].type)&&Re[xe[Xe][1].type].call(Object.assign({sliceSerialize:xe[Xe][2].sliceSerialize},qe),xe[Xe][1])}if(qe.tokenStack.length>0){const Re=qe.tokenStack[qe.tokenStack.length-1];(Re[1]||Jm).call(qe,void 0,Re[0])}for(Pe.position={start:Do(xe.length>0?xe[0][1].start:{line:1,column:1,offset:0}),end:Do(xe.length>0?xe[xe.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<t.transforms.length;)Pe=t.transforms[Xe](Pe)||Pe;return Pe}function o(xe,Pe,qe){let Je=Pe-1,Xe=-1,Re=!1,ct,lt,Mt,be;for(;++Je<=qe;){const Ae=xe[Je];switch(Ae[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ae[0]==="enter"?Xe++:Xe--,be=void 0;break}case"lineEndingBlank":{Ae[0]==="enter"&&(ct&&!be&&!Xe&&!Mt&&(Mt=Je),be=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:be=void 0}if(!Xe&&Ae[0]==="enter"&&Ae[1].type==="listItemPrefix"||Xe===-1&&Ae[0]==="exit"&&(Ae[1].type==="listUnordered"||Ae[1].type==="listOrdered")){if(ct){let Oe=Je;for(lt=void 0;Oe--;){const Qe=xe[Oe];if(Qe[1].type==="lineEnding"||Qe[1].type==="lineEndingBlank"){if(Qe[0]==="exit")continue;lt&&(xe[lt][1].type="lineEndingBlank",Re=!0),Qe[1].type="lineEnding",lt=Oe}else if(!(Qe[1].type==="linePrefix"||Qe[1].type==="blockQuotePrefix"||Qe[1].type==="blockQuotePrefixWhitespace"||Qe[1].type==="blockQuoteMarker"||Qe[1].type==="listItemIndent"))break}Mt&&(!lt||Mt<lt)&&(ct._spread=!0),ct.end=Object.assign({},lt?xe[lt][1].start:Ae[1].end),xe.splice(lt||Je,0,["exit",ct,Ae[2]]),Je++,qe++}if(Ae[1].type==="listItemPrefix"){const Oe={type:"listItem",_spread:!1,start:Object.assign({},Ae[1].start),end:void 0};ct=Oe,xe.splice(Je,0,["enter",Oe,Ae[2]]),Je++,qe++,Mt=void 0,be=!0}}}return xe[Pe][1]._spread=Re,qe}function i(xe,Pe){return qe;function qe(Je){a.call(this,xe(Je),Je),Pe&&Pe.call(this,Je)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(xe,Pe,qe){this.stack[this.stack.length-1].children.push(xe),this.stack.push(xe),this.tokenStack.push([Pe,qe||void 0]),xe.position={start:Do(Pe.start),end:void 0}}function l(xe){return Pe;function Pe(qe){xe&&xe.call(this,qe),u.call(this,qe)}}function u(xe,Pe){const qe=this.stack.pop(),Je=this.tokenStack.pop();if(Je)Je[0].type!==xe.type&&(Pe?Pe.call(this,xe,Je[0]):(Je[1]||Jm).call(this,xe,Je[0]));else throw new Error("Cannot close `"+xe.type+"` ("+Ma({start:xe.start,end:xe.end})+"): it’s not open");qe.position.end=Do(xe.end)}function d(){return ep(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(xe){if(this.data.expectingFirstListItemValue){const Pe=this.stack[this.stack.length-2];Pe.start=Number.parseInt(this.sliceSerialize(xe),10),this.data.expectingFirstListItemValue=void 0}}function p(){const xe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.lang=xe}function m(){const xe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.meta=xe}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const xe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=xe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const xe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=xe.replace(/(\r?\n|\r)$/g,"")}function C(xe){const Pe=this.resume(),qe=this.stack[this.stack.length-1];qe.label=Pe,qe.identifier=Nr(this.sliceSerialize(xe)).toLowerCase()}function v(){const xe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.title=xe}function S(){const xe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.url=xe}function I(xe){const Pe=this.stack[this.stack.length-1];if(!Pe.depth){const qe=this.sliceSerialize(xe).length;Pe.depth=qe}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function N(xe){const Pe=this.stack[this.stack.length-1];Pe.depth=this.sliceSerialize(xe).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function F(xe){const qe=this.stack[this.stack.length-1].children;let Je=qe[qe.length-1];(!Je||Je.type!=="text")&&(Je=yt(),Je.position={start:Do(xe.start),end:void 0},qe.push(Je)),this.stack.push(Je)}function B(xe){const Pe=this.stack.pop();Pe.value+=this.sliceSerialize(xe),Pe.position.end=Do(xe.end)}function j(xe){const Pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const qe=Pe.children[Pe.children.length-1];qe.position.end=Do(xe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Pe.type)&&(F.call(this,xe),B.call(this,xe))}function D(){this.data.atHardBreak=!0}function H(){const xe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=xe}function _(){const xe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=xe}function L(){const xe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=xe}function $(){const xe=this.stack[this.stack.length-1];if(this.data.inReference){const Pe=this.data.referenceType||"shortcut";xe.type+="Reference",xe.referenceType=Pe,delete xe.url,delete xe.title}else delete xe.identifier,delete xe.label;this.data.referenceType=void 0}function K(){const xe=this.stack[this.stack.length-1];if(this.data.inReference){const Pe=this.data.referenceType||"shortcut";xe.type+="Reference",xe.referenceType=Pe,delete xe.url,delete xe.title}else delete xe.identifier,delete xe.label;this.data.referenceType=void 0}function G(xe){const Pe=this.sliceSerialize(xe),qe=this.stack[this.stack.length-2];qe.label=fD(Pe),qe.identifier=Nr(Pe).toLowerCase()}function q(){const xe=this.stack[this.stack.length-1],Pe=this.resume(),qe=this.stack[this.stack.length-1];if(this.data.inReference=!0,qe.type==="link"){const Je=xe.children;qe.children=Je}else qe.alt=Pe}function R(){const xe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.url=xe}function oe(){const xe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.title=xe}function se(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function pe(xe){const Pe=this.resume(),qe=this.stack[this.stack.length-1];qe.label=Pe,qe.identifier=Nr(this.sliceSerialize(xe)).toLowerCase(),this.data.referenceType="full"}function J(xe){this.data.characterReferenceType=xe.type}function Q(xe){const Pe=this.sliceSerialize(xe),qe=this.data.characterReferenceType;let Je;qe?(Je=_b(Pe,qe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Je=tp(Pe);const Xe=this.stack[this.stack.length-1];Xe.value+=Je}function re(xe){const Pe=this.stack.pop();Pe.position.end=Do(xe.end)}function ne(xe){B.call(this,xe);const Pe=this.stack[this.stack.length-1];Pe.url=this.sliceSerialize(xe)}function ae(xe){B.call(this,xe);const Pe=this.stack[this.stack.length-1];Pe.url="mailto:"+this.sliceSerialize(xe)}function ie(){return{type:"blockquote",children:[]}}function Z(){return{type:"code",lang:null,meta:null,value:""}}function me(){return{type:"inlineCode",value:""}}function le(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ue(){return{type:"emphasis",children:[]}}function Ie(){return{type:"heading",depth:0,children:[]}}function Ce(){return{type:"break"}}function we(){return{type:"html",value:""}}function ye(){return{type:"image",title:null,url:"",alt:null}}function ze(){return{type:"link",title:null,url:"",children:[]}}function Ne(xe){return{type:"list",ordered:xe.type==="listOrdered",start:null,spread:xe._spread,children:[]}}function nt(xe){return{type:"listItem",spread:xe._spread,checked:null,children:[]}}function _e(){return{type:"paragraph",children:[]}}function Bt(){return{type:"strong",children:[]}}function yt(){return{type:"text",value:""}}function ot(){return{type:"thematicBreak"}}}function Do(e){return{line:e.line,column:e.column,offset:e.offset}}function Kb(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Kb(e,r):gD(e,r)}}function gD(e,t){let n;for(n in t)if(Yb.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 Jm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ma({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ma({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ma({start:t.start,end:t.end})+") is still open")}function bD(e){const t=this;t.parser=n;function n(r){return hD(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function yD(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 xD(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
25
|
+
`}]}function CD(e,t){const n=t.value?t.value+`
|
|
26
|
+
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function ED(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vD(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TD(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Ts(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function SD(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 kD(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Gb(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 s=o[o.length-1];return s&&s.type==="text"?s.value+=r:o.push({type:"text",value:r}),o}function wD(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gb(e,t);const o={src:Ts(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 DD(e,t){const n={src:Ts(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 ID(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 AD(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gb(e,t);const o={href:Ts(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 OD(e,t){const n={href:Ts(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 MD(e,t,n){const r=e.all(t),o=n?PD(n):Qb(t),i={},s=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const d=r[a];(o||a!==0||d.type!=="element"||d.tagName!=="p")&&s.push({type:"text",value:`
|
|
27
|
+
`}),d.type==="element"&&d.tagName==="p"&&!o?s.push(...d.children):s.push(d)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
|
|
28
|
+
`});const u={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,u),e.applyData(t,u)}function PD(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=Qb(n[r])}return t}function Qb(e){const t=e.spread;return t??e.children.length>1}function RD(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 s=r[o];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.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 ND(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FD(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function LD(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _D(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),o.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Jr(t.children[1]),l=fc(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),o.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function BD(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const f=t.children[l],h={},p=s?s[l]:void 0;p&&(h.align=p);let m={type:"element",tagName:i,properties:h,children:[]};f&&(m.children=e.all(f),e.patch(f,m),m=e.applyData(f,m)),u.push(m)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function jD(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const e0=9,t0=32;function $D(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(n0(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(n0(t.slice(o),o>0,!1)),i.join("")}function n0(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===e0||i===t0;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===e0||i===t0;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function HD(e,t){const n={type:"text",value:$D(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function zD(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const UD={blockquote:yD,break:xD,code:CD,delete:ED,emphasis:vD,footnoteReference:TD,heading:SD,html:kD,imageReference:wD,image:DD,inlineCode:ID,linkReference:AD,link:OD,listItem:MD,list:RD,paragraph:ND,root:FD,strong:LD,table:_D,tableCell:jD,tableRow:BD,text:HD,thematicBreak:zD,toml:zl,yaml:zl,definition:zl,footnoteDefinition:zl};function zl(){}const Xb=-1,mc=0,Ra=1,Pu=2,rp=3,op=4,ip=5,sp=6,Zb=7,Jb=8,r0=typeof self=="object"?self:globalThis,VD=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,s]=t[o];switch(i){case mc:case Xb:return n(s,o);case Ra:{const a=n([],o);for(const l of s)a.push(r(l));return a}case Pu:{const a=n({},o);for(const[l,u]of s)a[r(l)]=r(u);return a}case rp:return n(new Date(s),o);case op:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case ip:{const a=n(new Map,o);for(const[l,u]of s)a.set(r(l),r(u));return a}case sp:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case Zb:{const{name:a,message:l}=s;return n(new r0[a](l),o)}case Jb:return n(BigInt(s),o);case"BigInt":return n(Object(BigInt(s)),o);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new r0[i](s),o)};return r},o0=e=>VD(new Map,e)(0),Wi="",{toString:WD}={},{keys:qD}=Object,Xs=e=>{const t=typeof e;if(t!=="object"||!e)return[mc,t];const n=WD.call(e).slice(8,-1);switch(n){case"Array":return[Ra,Wi];case"Object":return[Pu,Wi];case"Date":return[rp,Wi];case"RegExp":return[op,Wi];case"Map":return[ip,Wi];case"Set":return[sp,Wi];case"DataView":return[Ra,n]}return n.includes("Array")?[Ra,n]:n.includes("Error")?[Zb,n]:[Pu,n]},Ul=([e,t])=>e===mc&&(t==="function"||t==="symbol"),YD=(e,t,n,r)=>{const o=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},i=s=>{if(n.has(s))return n.get(s);let[a,l]=Xs(s);switch(a){case mc:{let d=s;switch(l){case"bigint":a=Jb,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return o([Xb],s)}return o([a,d],s)}case Ra:{if(l){let h=s;return l==="DataView"?h=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(s)),o([l,[...h]],s)}const d=[],f=o([a,d],s);for(const h of s)d.push(i(h));return f}case Pu:{if(l)switch(l){case"BigInt":return o([l,s.toString()],s);case"Boolean":case"Number":case"String":return o([l,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const d=[],f=o([a,d],s);for(const h of qD(s))(e||!Ul(Xs(s[h])))&&d.push([i(h),i(s[h])]);return f}case rp:return o([a,s.toISOString()],s);case op:{const{source:d,flags:f}=s;return o([a,{source:d,flags:f}],s)}case ip:{const d=[],f=o([a,d],s);for(const[h,p]of s)(e||!(Ul(Xs(h))||Ul(Xs(p))))&&d.push([i(h),i(p)]);return f}case sp:{const d=[],f=o([a,d],s);for(const h of s)(e||!Ul(Xs(h)))&&d.push(i(h));return f}}const{message:u}=s;return o([a,{name:l,message:u}],s)};return i},i0=(e,{json:t,lossy:n}={})=>{const r=[];return YD(!(t||n),!!t,new Map,r)(e),r},di=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?o0(i0(e,t)):structuredClone(e):(e,t)=>o0(i0(e,t));function KD(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 GD(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function QD(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||KD,r=e.options.footnoteBackLabel||GD,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const d=e.all(u),f=String(u.identifier).toUpperCase(),h=Ts(f.toLowerCase());let p=0;const m=[],b=e.footnoteCounts.get(f);for(;b!==void 0&&++p<=b;){m.length>0&&m.push({type:"text",value:" "});let C=typeof n=="string"?n:n(l,p);typeof C=="string"&&(C={type:"text",value:C}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const y=d[d.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const C=y.children[y.children.length-1];C&&C.type==="text"?C.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...m)}else d.push(...m);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...di(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
29
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
30
|
+
`}]}}const gc=(function(e){if(e==null)return eI;if(typeof e=="function")return bc(e);if(typeof e=="object")return Array.isArray(e)?XD(e):ZD(e);if(typeof e=="string")return JD(e);throw new Error("Expected function, string, or object as test")});function XD(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=gc(e[n]);return bc(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function ZD(e){const t=e;return bc(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function JD(e){return bc(t);function t(n){return n&&n.type===e}}function bc(e){return t;function t(n,r,o){return!!(tI(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function eI(){return!0}function tI(e){return e!==null&&typeof e=="object"&&"type"in e}const ey=[],nI=!0,Ru=!1,Na="skip";function ty(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=gc(o),s=r?-1:1;a(e,void 0,[])();function a(l,u,d){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=ey,m,b,y;if((!t||i(l,u,d[d.length-1]||void 0))&&(p=rI(n(l,d)),p[0]===Ru))return p;if("children"in l&&l.children){const x=l;if(x.children&&p[0]!==Na)for(b=(r?x.children.length:-1)+s,y=d.concat(x);b>-1&&b<x.children.length;){const C=x.children[b];if(m=a(C,b,y)(),m[0]===Ru)return m;b=typeof m[1]=="number"?m[1]:b+s}}return p}}}function rI(e){return Array.isArray(e)?e:typeof e=="number"?[nI,e]:e==null?ey:[e]}function Kn(e,t,n,r){let o,i,s;typeof t=="function"&&typeof n!="function"?(i=void 0,s=t,o=n):(i=t,s=n,o=r),ty(e,i,a,o);function a(l,u){const d=u[u.length-1],f=d?d.children.indexOf(l):void 0;return s(l,f,d)}}const af={}.hasOwnProperty,oI={};function iI(e,t){const n=t||oI,r=new Map,o=new Map,i=new Map,s={...UD,...n.handlers},a={all:u,applyData:aI,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:sI,wrap:uI};return Kn(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:o,h=String(d.identifier).toUpperCase();f.has(h)||f.set(h,d)}}),a;function l(d,f){const h=d.type,p=a.handlers[h];if(af.call(a.handlers,h)&&p)return p(a,d,f);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in d){const{children:b,...y}=d,x=di(y);return x.children=a.all(d),x}return di(d)}return(a.options.unknownHandler||lI)(a,d,f)}function u(d){const f=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const m=a.one(h[p],d);if(m){if(p&&h[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=s0(m.value)),!Array.isArray(m)&&m.type==="element")){const b=m.children[0];b&&b.type==="text"&&(b.value=s0(b.value))}Array.isArray(m)?f.push(...m):f.push(m)}}}return f}}function sI(e,t){e.position&&(t.position=Gk(e))}function aI(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 s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&i&&Object.assign(n.properties,di(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function lI(e,t){const n=t.data||{},r="value"in t&&!(af.call(n,"hProperties")||af.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 uI(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
31
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
32
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
33
|
+
`}),n}function s0(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function a0(e,t){const n=iI(e,t),r=n.one(e,void 0),o=QD(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
|
|
34
|
+
`},o),i}function cI(e,t){return e&&"run"in e?async function(n,r){const o=a0(n,{file:r,...t});await e.run(o,r)}:function(n,r){return a0(n,{file:r,...e||t})}}function l0(e){if(e)throw e}var ld,u0;function dI(){if(u0)return ld;u0=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},i=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var d=e.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!d&&!f)return!1;var h;for(h in u);return typeof h>"u"||e.call(u,h)},s=function(u,d){n&&d.name==="__proto__"?n(u,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):u[d.name]=d.newValue},a=function(u,d){if(d==="__proto__")if(e.call(u,d)){if(r)return r(u,d).value}else return;return u[d]};return ld=function l(){var u,d,f,h,p,m,b=arguments[0],y=1,x=arguments.length,C=!1;for(typeof b=="boolean"&&(C=b,b=arguments[1]||{},y=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});y<x;++y)if(u=arguments[y],u!=null)for(d in u)f=a(b,d),h=a(u,d),b!==h&&(C&&h&&(i(h)||(p=o(h)))?(p?(p=!1,m=f&&o(f)?f:[]):m=f&&i(f)?f:{},s(b,{name:d,newValue:l(C,m,h)})):typeof h<"u"&&s(b,{name:d,newValue:h}));return b},ld}var fI=dI();const ud=Tr(fI);function lf(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 pI(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...u){const d=e[++i];let f=-1;if(l){s(l);return}for(;++f<o.length;)(u[f]===null||u[f]===void 0)&&(u[f]=o[f]);o=u,d?hI(d,a)(...u):s(null,...u)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function hI(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(u){const d=u;if(a&&n)throw d;return o(d)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const qr={basename:mI,dirname:gI,extname:bI,join:yI,sep:"/"};function mI(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');gl(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 s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function gI(e){if(gl(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 bI(e){gl(e);let t=e.length,n=-1,r=0,o=-1,i=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===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 yI(...e){let t=-1,n;for(;++t<e.length;)gl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":xI(n)}function xI(e){gl(e);const t=e.codePointAt(0)===47;let n=CI(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function CI(e,t){let n="",r=0,o=-1,i=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-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(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length>0){n="",r=0,o=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function gl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const EI={cwd:vI};function vI(){return"/"}function uf(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function TI(e){if(typeof e=="string")e=new URL(e);else if(!uf(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 SI(e)}function SI(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 cd=["history","path","basename","stem","extname","dirname"];class ny{constructor(t){let n;t?uf(t)?n={path:t}:typeof t=="string"||kI(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":EI.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<cd.length;){const i=cd[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)cd.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?qr.basename(this.path):void 0}set basename(t){fd(t,"basename"),dd(t,"basename"),this.path=qr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?qr.dirname(this.path):void 0}set dirname(t){c0(this.basename,"dirname"),this.path=qr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?qr.extname(this.path):void 0}set extname(t){if(dd(t,"extname"),c0(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=qr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){uf(t)&&(t=TI(t)),fd(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?qr.basename(this.path,this.extname):void 0}set stem(t){fd(t,"stem"),dd(t,"stem"),this.path=qr.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 Mn(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 dd(e,t){if(e&&e.includes(qr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+qr.sep+"`")}function fd(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function c0(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function kI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wI=(function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),DI={}.hasOwnProperty;class ap extends wI{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=pI()}copy(){const t=new ap;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ud(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(md("data",this.frozen),this.namespace[t]=n,this):DI.call(this.namespace,t)&&this.namespace[t]||void 0:t?(md("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=Vl(t),r=this.parser||this.Parser;return pd("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),pd("process",this.parser||this.Parser),hd("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Vl(t),l=r.parse(a);r.run(l,a,function(d,f,h){if(d||!f||!h)return u(d);const p=f,m=r.stringify(p,h);OI(m)?h.value=m:h.result=m,u(d,h)});function u(d,f){d||!f?s(d):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),pd("processSync",this.parser||this.Parser),hd("processSync",this.compiler||this.Compiler),this.process(t,o),f0("processSync","process",n),r;function o(i,s){n=!0,l0(i),r=s}}run(t,n,r){d0(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(s,a){const l=Vl(n);o.run(t,l,u);function u(d,f,h){const p=f||t;d?a(d):s?s(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),f0("runSync","run",r),o;function i(s,a){l0(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Vl(n),o=this.compiler||this.Compiler;return hd("stringify",o),d0(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(md("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...f]=u;l(d,f)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))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");a(u.plugins),u.settings&&(o.settings=ud(!0,o.settings,u.settings))}function a(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];i(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,d){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===u){h=f;break}if(h===-1)r.push([u,...d]);else if(d.length>0){let[p,...m]=d;const b=r[h][1];lf(b)&&lf(p)&&(p=ud(!0,b,p)),r[h]=[u,p,...m]}}}}const II=new ap().freeze();function pd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function md(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 d0(e){if(!lf(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function f0(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Vl(e){return AI(e)?e:new ny(e)}function AI(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function OI(e){return typeof e=="string"||MI(e)}function MI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const PI="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",p0=[],h0={allowDangerousHtml:!0},RI=/^(https?|ircs?|mailto|xmpp)$/i,NI=[{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:"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 FI(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,i=e.components,s=e.disallowedElements,a=e.rehypePlugins||p0,l=e.remarkPlugins||p0,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...h0}:h0,d=e.skipHtml,f=e.unwrapDisallowed,h=e.urlTransform||LI,p=II().use(bD).use(l).use(cI,u).use(a),m=new ny;typeof r=="string"&&(m.value=r);for(const C of NI)Object.hasOwn(e,C.from)&&(""+C.from+(C.to?"use `"+C.to+"` instead":"remove it")+PI+C.id,void 0);const b=p.parse(m);let y=p.runSync(b,m);return o&&(y={type:"element",tagName:"div",properties:{className:o},children:y.type==="root"?y.children:[y]}),Kn(y,x),ew(y,{Fragment:c.Fragment,components:i,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function x(C,v,S){if(C.type==="raw"&&S&&typeof v=="number")return d?S.children.splice(v,1):S.children[v]={type:"text",value:C.value},v;if(C.type==="element"){let I;for(I in id)if(Object.hasOwn(id,I)&&Object.hasOwn(C.properties,I)){const T=C.properties[I],N=id[I];(N===null||N.includes(C.tagName))&&(C.properties[I]=h(String(T||""),I,C))}}if(C.type==="element"){let I=t?!t.includes(C.tagName):s?s.includes(C.tagName):!1;if(!I&&n&&typeof v=="number"&&(I=!n(C,v,S)),I&&S&&typeof v=="number")return f&&C.children?S.children.splice(v,1,...C.children):S.children.splice(v,1),v}}}function LI(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||RI.test(e.slice(0,t))?e:""}function cf(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function _I(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function BI(e,t,n){const o=gc((n||{}).ignore||[]),i=jI(t);let s=-1;for(;++s<i.length;)ty(e,"text",a);function a(u,d){let f=-1,h;for(;++f<d.length;){const p=d[f],m=h?h.children:void 0;if(o(p,m?m.indexOf(p):void 0,h))return;h=p}if(h)return l(u,d)}function l(u,d){const f=d[d.length-1],h=i[s][0],p=i[s][1];let m=0;const y=f.children.indexOf(u);let x=!1,C=[];h.lastIndex=0;let v=h.exec(u.value);for(;v;){const S=v.index,I={index:v.index,input:v.input,stack:[...d,u]};let T=p(...v,I);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?h.lastIndex=S+1:(m!==S&&C.push({type:"text",value:u.value.slice(m,S)}),Array.isArray(T)?C.push(...T):T&&C.push(T),m=S+v[0].length,x=!0),!h.global)break;v=h.exec(u.value)}return x?(m<u.value.length&&C.push({type:"text",value:u.value.slice(m)}),f.children.splice(y,1,...C)):C=[u],y+C.length}}function jI(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const o=n[r];t.push([$I(o[0]),HI(o[1])])}return t}function $I(e){return typeof e=="string"?new RegExp(_I(e),"g"):e}function HI(e){return typeof e=="function"?e:function(){return e}}const gd="phrasing",bd=["autolink","link","image","label"];function zI(){return{transforms:[GI],enter:{literalAutolink:VI,literalAutolinkEmail:yd,literalAutolinkHttp:yd,literalAutolinkWww:yd},exit:{literalAutolink:KI,literalAutolinkEmail:YI,literalAutolinkHttp:WI,literalAutolinkWww:qI}}}function UI(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:gd,notInConstruct:bd},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:gd,notInConstruct:bd},{character:":",before:"[ps]",after:"\\/",inConstruct:gd,notInConstruct:bd}]}}function VI(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function yd(e){this.config.enter.autolinkProtocol.call(this,e)}function WI(e){this.config.exit.autolinkProtocol.call(this,e)}function qI(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function YI(e){this.config.exit.autolinkEmail.call(this,e)}function KI(e){this.exit(e)}function GI(e){BI(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,QI],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,XI]],{ignore:["link","linkReference"]})}function QI(e,t,n,r,o){let i="";if(!ry(o)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!ZI(n)))return!1;const s=JI(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:i+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function XI(e,t,n,r){return!ry(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function ZI(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function JI(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=cf(e,"(");let i=cf(e,")");for(;r!==-1&&o>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function ry(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ci(n)||pc(n))&&(!t||n!==47)}oy.peek=l6;function e6(){this.buffer()}function t6(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function n6(){this.buffer()}function r6(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function o6(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Nr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function i6(e){this.exit(e)}function s6(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Nr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function a6(e){this.exit(e)}function l6(){return"["}function oy(e,t,n,r){const o=n.createTracker(r);let i=o.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return i+=o.move(n.safe(n.associationId(e),{after:"]",before:i})),a(),s(),i+=o.move("]"),i}function u6(){return{enter:{gfmFootnoteCallString:e6,gfmFootnoteCall:t6,gfmFootnoteDefinitionLabelString:n6,gfmFootnoteDefinition:r6},exit:{gfmFootnoteCallString:o6,gfmFootnoteCall:i6,gfmFootnoteDefinitionLabelString:s6,gfmFootnoteDefinition:a6}}}function c6(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:oy},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,o,i,s){const a=i.createTracker(s);let l=a.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return l+=a.move(i.safe(i.associationId(r),{before:l,after:"]"})),d(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
|
|
35
|
+
`:" ")+i.indentLines(i.containerFlow(r,a.current()),t?iy:d6))),u(),l}}function d6(e,t,n){return t===0?e:iy(e,t,n)}function iy(e,t,n){return(n?"":" ")+e}const f6=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];sy.peek=b6;function p6(){return{canContainEols:["delete"],enter:{strikethrough:m6},exit:{strikethrough:g6}}}function h6(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:f6}],handlers:{delete:sy}}}function m6(e){this.enter({type:"delete",children:[]},e)}function g6(e){this.exit(e)}function sy(e,t,n,r){const o=n.createTracker(r),i=n.enter("strikethrough");let s=o.move("~~");return s+=n.containerPhrasing(e,{...o.current(),before:s,after:"~"}),s+=o.move("~~"),i(),s}function b6(){return"~"}function y6(e){return e.length}function x6(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||y6,i=[],s=[],a=[],l=[];let u=0,d=-1;for(;++d<e.length;){const b=[],y=[];let x=-1;for(e[d].length>u&&(u=e[d].length);++x<e[d].length;){const C=C6(e[d][x]);if(n.alignDelimiters!==!1){const v=o(C);y[x]=v,(l[x]===void 0||v>l[x])&&(l[x]=v)}b.push(C)}s[d]=b,a[d]=y}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)i[f]=m0(r[f]);else{const b=m0(r);for(;++f<u;)i[f]=b}f=-1;const h=[],p=[];for(;++f<u;){const b=i[f];let y="",x="";b===99?(y=":",x=":"):b===108?y=":":b===114&&(x=":");let C=n.alignDelimiters===!1?1:Math.max(1,l[f]-y.length-x.length);const v=y+"-".repeat(C)+x;n.alignDelimiters!==!1&&(C=y.length+C+x.length,C>l[f]&&(l[f]=C),p[f]=C),h[f]=v}s.splice(1,0,h),a.splice(1,0,p),d=-1;const m=[];for(;++d<s.length;){const b=s[d],y=a[d];f=-1;const x=[];for(;++f<u;){const C=b[f]||"";let v="",S="";if(n.alignDelimiters!==!1){const I=l[f]-(y[f]||0),T=i[f];T===114?v=" ".repeat(I):T===99?I%2?(v=" ".repeat(I/2+.5),S=" ".repeat(I/2-.5)):(v=" ".repeat(I/2),S=v):S=" ".repeat(I)}n.delimiterStart!==!1&&!f&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||f)&&x.push(" "),n.alignDelimiters!==!1&&x.push(v),x.push(C),n.alignDelimiters!==!1&&x.push(S),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&x.push("|")}m.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return m.join(`
|
|
36
|
+
`)}function C6(e){return e==null?"":String(e)}function m0(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const g0={}.hasOwnProperty;function yc(e,t){const n=t||{};function r(o,...i){let s=r.invalid;const a=r.handlers;if(o&&g0.call(o,e)){const l=String(o[e]);s=g0.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,o,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function E6(e,t,n,r){const o=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const s=n.indentLines(n.containerFlow(e,i.current()),v6);return o(),s}function v6(e,t,n){return">"+(n?"":" ")+e}function T6(e,t){return b0(e,t.inConstruct,!0)&&!b0(e,t.notInConstruct,!1)}function b0(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function y0(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
|
|
37
|
+
`&&T6(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
38
|
+
`}function S6(e,t){const n=String(e);let r=n.indexOf(t),o=r,i=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++i>s&&(s=i):i=1,o=r+t.length,r=n.indexOf(t,o);return s}function k6(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function w6(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function D6(e,t,n,r){const o=w6(n),i=e.value||"",s=o==="`"?"GraveAccent":"Tilde";if(k6(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(i,I6);return f(),h}const a=n.createTracker(r),l=o.repeat(Math.max(S6(i,o)+1,3)),u=n.enter("codeFenced");let d=a.move(l);if(e.lang){const f=n.enter(`codeFencedLang${s}`);d+=a.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...a.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${s}`);d+=a.move(" "),d+=a.move(n.safe(e.meta,{before:d,after:`
|
|
39
|
+
`,encode:["`"],...a.current()})),f()}return d+=a.move(`
|
|
40
|
+
`),i&&(d+=a.move(i+`
|
|
41
|
+
`)),d+=a.move(l),u(),d}function I6(e,t,n){return(n?"":" ")+e}function lp(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function A6(e,t,n,r){const o=lp(n),i=o==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
42
|
+
`,...l.current()}))),a(),e.title&&(a=n.enter(`title${i}`),u+=l.move(" "+o),u+=l.move(n.safe(e.title,{before:u,after:o,...l.current()})),u+=l.move(o),a()),s(),u}function O6(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Xa(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Nu(e,t,n){const r=ds(e),o=ds(t);return r===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ay.peek=M6;function ay(e,t,n,r){const o=O6(n),i=n.enter("emphasis"),s=n.createTracker(r),a=s.move(o);let l=s.move(n.containerPhrasing(e,{after:o,before:a,...s.current()}));const u=l.charCodeAt(0),d=Nu(r.before.charCodeAt(r.before.length-1),u,o);d.inside&&(l=Xa(u)+l.slice(1));const f=l.charCodeAt(l.length-1),h=Nu(r.after.charCodeAt(0),f,o);h.inside&&(l=l.slice(0,-1)+Xa(f));const p=s.move(o);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},a+l+p}function M6(e,t,n){return n.options.emphasis||"*"}function P6(e,t){let n=!1;return Kn(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ru}),!!((!e.depth||e.depth<3)&&ep(e)&&(t.options.setext||n))}function R6(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(P6(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...i.current(),before:`
|
|
43
|
+
`,after:`
|
|
44
|
+
`});return f(),d(),h+`
|
|
45
|
+
`+(o===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
46
|
+
`))+1))}const s="#".repeat(o),a=n.enter("headingAtx"),l=n.enter("phrasing");i.move(s+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
47
|
+
`,...i.current()});return/^[\t ]/.test(u)&&(u=Xa(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),a(),u}ly.peek=N6;function ly(e){return e.value||""}function N6(){return"<"}uy.peek=F6;function uy(e,t,n,r){const o=lp(n),i=o==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${i}`),u+=l.move(" "+o),u+=l.move(n.safe(e.title,{before:u,after:o,...l.current()})),u+=l.move(o),a()),u+=l.move(")"),s(),u}function F6(){return"!"}cy.peek=L6;function cy(e,t,n,r){const o=e.referenceType,i=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const u=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=d,i(),o==="full"||!u||u!==f?l+=a.move(f+"]"):o==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function L6(){return"!"}dy.peek=_6;function dy(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const s=n.unsafe[i],a=n.compilePattern(s);let l;if(s.atBreak)for(;l=a.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return o+r+o}function _6(){return"`"}function fy(e,t){const n=ep(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}py.peek=B6;function py(e,t,n,r){const o=lp(n),i=o==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(fy(e,n)){const d=n.stack;n.stack=[],a=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(e,{before:f,after:">",...s.current()})),f+=s.move(">"),a(),n.stack=d,f}a=n.enter("link"),l=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${i}`),u+=s.move(" "+o),u+=s.move(n.safe(e.title,{before:u,after:o,...s.current()})),u+=s.move(o),l()),u+=s.move(")"),a(),u}function B6(e,t,n){return fy(e,n)?"<":"["}hy.peek=j6;function hy(e,t,n,r){const o=e.referenceType,i=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=d,i(),o==="full"||!u||u!==f?l+=a.move(f+"]"):o==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function j6(){return"["}function up(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function $6(e){const t=up(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function H6(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function my(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function z6(e,t,n,r){const o=n.enter("list"),i=n.bulletCurrent;let s=e.ordered?H6(n):up(n);const a=e.ordered?s==="."?")":".":$6(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),my(n)===s&&d){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=a),n.bulletCurrent=s;const u=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=i,o(),u}function U6(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function V6(e,t,n,r){const o=U6(n);let i=n.bulletCurrent||up(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let s=i.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(i+" ".repeat(s-i.length)),a.shift(s);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),d);return l(),u;function d(f,h,p){return h?(p?"":" ".repeat(s))+f:(p?i:i+" ".repeat(s-i.length))+f}}function W6(e,t,n,r){const o=n.enter("paragraph"),i=n.enter("phrasing"),s=n.containerPhrasing(e,r);return i(),o(),s}const q6=gc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Y6(e,t,n,r){return(e.children.some(function(s){return q6(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function K6(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}gy.peek=G6;function gy(e,t,n,r){const o=K6(n),i=n.enter("strong"),s=n.createTracker(r),a=s.move(o+o);let l=s.move(n.containerPhrasing(e,{after:o,before:a,...s.current()}));const u=l.charCodeAt(0),d=Nu(r.before.charCodeAt(r.before.length-1),u,o);d.inside&&(l=Xa(u)+l.slice(1));const f=l.charCodeAt(l.length-1),h=Nu(r.after.charCodeAt(0),f,o);h.inside&&(l=l.slice(0,-1)+Xa(f));const p=s.move(o+o);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},a+l+p}function G6(e,t,n){return n.options.strong||"*"}function Q6(e,t,n,r){return n.safe(e.value,r)}function X6(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Z6(e,t,n){const r=(my(n)+(n.options.ruleSpaces?" ":"")).repeat(X6(n));return n.options.ruleSpaces?r.slice(0,-1):r}const by={blockquote:E6,break:y0,code:D6,definition:A6,emphasis:ay,hardBreak:y0,heading:R6,html:ly,image:uy,imageReference:cy,inlineCode:dy,link:py,linkReference:hy,list:z6,listItem:V6,paragraph:W6,root:Y6,strong:gy,text:Q6,thematicBreak:Z6};function J6(){return{enter:{table:eA,tableData:x0,tableHeader:x0,tableRow:nA},exit:{codeText:rA,table:tA,tableData:xd,tableHeader:xd,tableRow:xd}}}function eA(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function tA(e){this.exit(e),this.data.inTable=void 0}function nA(e){this.enter({type:"tableRow",children:[]},e)}function xd(e){this.exit(e)}function x0(e){this.enter({type:"tableCell",children:[]},e)}function rA(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,oA));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function oA(e,t){return t==="|"?t:e}function iA(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
48
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:l,tableRow:a}};function s(p,m,b,y){return u(d(p,b,y),p.align)}function a(p,m,b,y){const x=f(p,b,y),C=u([x]);return C.slice(0,C.indexOf(`
|
|
49
|
+
`))}function l(p,m,b,y){const x=b.enter("tableCell"),C=b.enter("phrasing"),v=b.containerPhrasing(p,{...y,before:i,after:i});return C(),x(),v}function u(p,m){return x6(p,{align:m,alignDelimiters:r,padding:n,stringLength:o})}function d(p,m,b){const y=p.children;let x=-1;const C=[],v=m.enter("table");for(;++x<y.length;)C[x]=f(y[x],m,b);return v(),C}function f(p,m,b){const y=p.children;let x=-1;const C=[],v=m.enter("tableRow");for(;++x<y.length;)C[x]=l(y[x],p,m,b);return v(),C}function h(p,m,b){let y=by.inlineCode(p,m,b);return b.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function sA(){return{exit:{taskListCheckValueChecked:C0,taskListCheckValueUnchecked:C0,paragraph:lA}}}function aA(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:uA}}}function C0(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function lA(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=t.children;let i=-1,s;for(;++i<o.length;){const a=o[i];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function uA(e,t,n,r){const o=e.children[0],i=typeof e.checked=="boolean"&&o&&o.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);i&&a.move(s);let l=by.listItem(e,t,n,{...r,...a.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(d){return d+s}}function cA(){return[zI(),u6(),p6(),J6(),sA()]}function dA(e){return{extensions:[UI(),c6(e),h6(),iA(e),aA()]}}const fA={tokenize:yA,partial:!0},yy={tokenize:xA,partial:!0},xy={tokenize:CA,partial:!0},Cy={tokenize:EA,partial:!0},pA={tokenize:vA,partial:!0},Ey={name:"wwwAutolink",tokenize:gA,previous:Ty},vy={name:"protocolAutolink",tokenize:bA,previous:Sy},Co={name:"emailAutolink",tokenize:mA,previous:ky},eo={};function hA(){return{text:eo}}let Yo=48;for(;Yo<123;)eo[Yo]=Co,Yo++,Yo===58?Yo=65:Yo===91&&(Yo=97);eo[43]=Co;eo[45]=Co;eo[46]=Co;eo[95]=Co;eo[72]=[Co,vy];eo[104]=[Co,vy];eo[87]=[Co,Ey];eo[119]=[Co,Ey];function mA(e,t,n){const r=this;let o,i;return s;function s(f){return!df(f)||!ky.call(r,r.previous)||cp(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return df(f)?(e.consume(f),a):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(pA,d,u)(f):f===45||f===95||In(f)?(i=!0,e.consume(f),l):d(f)}function u(f){return e.consume(f),o=!0,l}function d(f){return i&&o&&_n(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function gA(e,t,n){const r=this;return o;function o(s){return s!==87&&s!==119||!Ty.call(r,r.previous)||cp(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(fA,e.attempt(yy,e.attempt(xy,i),n),n)(s))}function i(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function bA(e,t,n){const r=this;let o="",i=!1;return s;function s(f){return(f===72||f===104)&&Sy.call(r,r.previous)&&!cp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(_n(f)&&o.length<5)return o+=String.fromCodePoint(f),e.consume(f),a;if(f===58){const h=o.toLowerCase();if(h==="http"||h==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),i?u:(i=!0,l)):n(f)}function u(f){return f===null||Mu(f)||Vt(f)||ci(f)||pc(f)?n(f):e.attempt(yy,e.attempt(xy,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function yA(e,t,n){let r=0;return o;function o(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),o):s===46&&r===3?(e.consume(s),i):n(s)}function i(s){return s===null?n(s):t(s)}}function xA(e,t,n){let r,o,i;return s;function s(u){return u===46||u===95?e.check(Cy,l,a)(u):u===null||Vt(u)||ci(u)||u!==45&&pc(u)?l(u):(i=!0,e.consume(u),s)}function a(u){return u===95?r=!0:(o=r,r=void 0),e.consume(u),s}function l(u){return o||r||!i?n(u):t(u)}}function CA(e,t){let n=0,r=0;return o;function o(s){return s===40?(n++,e.consume(s),o):s===41&&r<n?i(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(Cy,t,i)(s):s===null||Vt(s)||ci(s)?t(s):(e.consume(s),o)}function i(s){return s===41&&r++,e.consume(s),o}}function EA(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),i):a===93?(e.consume(a),o):a===60||a===null||Vt(a)||ci(a)?t(a):n(a)}function o(a){return a===null||a===40||a===91||Vt(a)||ci(a)?t(a):r(a)}function i(a){return _n(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):_n(a)?(e.consume(a),s):n(a)}}function vA(e,t,n){return r;function r(i){return e.consume(i),o}function o(i){return In(i)?n(i):t(i)}}function Ty(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Vt(e)}function Sy(e){return!_n(e)}function ky(e){return!(e===47||df(e))}function df(e){return e===43||e===45||e===46||e===95||In(e)}function cp(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const TA={tokenize:MA,partial:!0};function SA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:IA,continuation:{tokenize:AA},exit:OA}},text:{91:{name:"gfmFootnoteCall",tokenize:DA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:kA,resolveTo:wA}}}}function kA(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;o--;){const l=r.events[o][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);const u=Nr(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function wA(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function DA(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,s;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(i>999||f===93&&!s||f===null||f===91||Vt(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return o.includes(Nr(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Vt(f)||(s=!0),i++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),i++,u):u(f)}}function IA(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,s=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(s>999||m===93&&!a||m===null||m===91||Vt(m))return n(m);if(m===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return i=Nr(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Vt(m)||(a=!0),s++,e.consume(m),m===92?f:d}function f(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),o.includes(i)||o.push(i),At(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function AA(e,t,n){return e.check(ml,t,e.attempt(TA,t,n))}function OA(e){e.exit("gfmFootnoteDefinition")}function MA(e,t,n){const r=this;return At(e,o,"gfmFootnoteDefinitionIndent",5);function o(i){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(i):n(i)}}function PA(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},f={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},h=[["enter",d,a],["enter",s[u][1],a],["exit",s[u][1],a],["enter",f,a]],p=a.parser.constructs.insideSpan.null;p&&ir(h,h.length,0,hc(p,s.slice(u+1,l),a)),ir(h,h.length,0,[["exit",f,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",d,a]]),ir(s,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function i(s,a,l){const u=this.previous,d=this.events;let f=0;return h;function h(m){return u===126&&d[d.length-1][1].type!=="characterEscape"?l(m):(s.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const b=ds(u);if(m===126)return f>1?l(m):(s.consume(m),f++,p);if(f<2&&!n)return l(m);const y=s.exit("strikethroughSequenceTemporary"),x=ds(m);return y._open=!x||x===2&&!!b,y._close=!b||b===2&&!!x,a(m)}}}class RA{constructor(){this.map=[]}add(t,n,r){NA(this,t,n,r)}consume(t){if(this.map.sort(function(i,s){return i[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const i of o)t.push(i);o=r.pop()}this.map.length=0}}function NA(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...r);return}o+=1}e.map.push([t,n,r])}}function FA(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function LA(){return{flow:{null:{name:"table",tokenize:_A,resolveAll:BA}}}}function _A(e,t,n){const r=this;let o=0,i=0,s;return a;function a(B){let j=r.events.length-1;for(;j>-1;){const _=r.events[j][1].type;if(_==="lineEnding"||_==="linePrefix")j--;else break}const D=j>-1?r.events[j][1].type:null,H=D==="tableHead"||D==="tableRow"?T:l;return H===T&&r.parser.lazy[r.now().line]?n(B):H(B)}function l(B){return e.enter("tableHead"),e.enter("tableRow"),u(B)}function u(B){return B===124||(s=!0,i+=1),d(B)}function d(B){return B===null?n(B):tt(B)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),p):n(B):St(B)?At(e,d,"whitespace")(B):(i+=1,s&&(s=!1,o+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),f(B)))}function f(B){return B===null||B===124||Vt(B)?(e.exit("data"),d(B)):(e.consume(B),B===92?h:f)}function h(B){return B===92||B===124?(e.consume(B),f):f(B)}function p(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(e.enter("tableDelimiterRow"),s=!1,St(B)?At(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):m(B))}function m(B){return B===45||B===58?y(B):B===124?(s=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),b):I(B)}function b(B){return St(B)?At(e,y,"whitespace")(B):y(B)}function y(B){return B===58?(i+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),x):B===45?(i+=1,x(B)):B===null||tt(B)?S(B):I(B)}function x(B){return B===45?(e.enter("tableDelimiterFiller"),C(B)):I(B)}function C(B){return B===45?(e.consume(B),C):B===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(B))}function v(B){return St(B)?At(e,S,"whitespace")(B):S(B)}function S(B){return B===124?m(B):B===null||tt(B)?!s||o!==i?I(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):I(B)}function I(B){return n(B)}function T(B){return e.enter("tableRow"),N(B)}function N(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),N):B===null||tt(B)?(e.exit("tableRow"),t(B)):St(B)?At(e,N,"whitespace")(B):(e.enter("data"),O(B))}function O(B){return B===null||B===124||Vt(B)?(e.exit("data"),N(B)):(e.consume(B),B===92?F:O)}function F(B){return B===92||B===124?(e.consume(B),O):O(B)}}function BA(e,t){let n=-1,r=!0,o=0,i=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,u,d,f;const h=new RA;for(;++n<e.length;){const p=e[n],m=p[1];p[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(E0(h,t,l,u,d),d=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,f=void 0,i=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",d,t]])),o=m.type==="tableDelimiterRow"?2:d?3:1):o&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(i[1]!==0&&(s[0]=s[1],f=Wl(h,t,i,o,void 0,f),i=[0,0,0,0]),s[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(s[0]=s[1],f=Wl(h,t,i,o,void 0,f)),i=s,s=[i[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,i[1]!==0?(s[0]=s[1],f=Wl(h,t,i,o,n,f)):s[1]!==0&&(f=Wl(h,t,s,o,n,f)),o=0):o&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&E0(h,t,l,u,d),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=FA(t.events,n))}return e}function Wl(e,t,n,r,o,i){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(i.end=Object.assign({},Gi(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const l=Gi(t.events,n[1]);if(i={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const u=Gi(t.events,n[2]),d=Gi(t.events,n[3]),f={type:a,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,b=n[3]-n[2]-1;e.add(m,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return o!==void 0&&(i.end=Object.assign({},Gi(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function E0(e,t,n,r,o){const i=[],s=Gi(t.events,n);o&&(o.end=Object.assign({},s),i.push(["exit",o,t])),r.end=Object.assign({},s),i.push(["exit",r,t]),e.add(n+1,0,i)}function Gi(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const jA={name:"tasklistCheck",tokenize:HA};function $A(){return{text:{91:jA}}}function HA(e,t,n){const r=this;return o;function o(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return Vt(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return tt(l)?t(l):St(l)?e.check({tokenize:zA},t,n)(l):n(l)}}function zA(e,t,n){return At(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function UA(e){return Lb([hA(),SA(),PA(e),LA(),$A()])}const VA={};function WA(e){const t=this,n=e||VA,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(UA(n)),i.push(cA()),s.push(dA(n))}const v0=/[#.]/g;function qA(e,t){const n=e||"",r={};let o=0,i,s;for(;o<n.length;){v0.lastIndex=o;const a=v0.exec(n),l=n.slice(o,a?a.index:n.length);l&&(i?i==="#"?r.id=l:Array.isArray(r.className)?r.className.push(l):r.className=[l]:s=l,o+=l.length),a&&(i=a[0],o++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function wy(e,t,n){const r=n?QA(n):void 0;function o(i,s,...a){let l;if(i==null){l={type:"root",children:[]};const u=s;a.unshift(u)}else{l=qA(i,t);const u=l.tagName.toLowerCase(),d=r?r.get(u):void 0;if(l.tagName=d||u,YA(s))a.unshift(s);else for(const[f,h]of Object.entries(s))KA(e,l.properties,f,h)}for(const u of a)ff(l.children,u);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return o}function YA(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 s of i)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function KA(e,t,n,r){const o=hl(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=nf(r):o.commaSeparated?i=Jd(r):o.commaOrSpaceSeparated?i=nf(Jd(r).join(" ")):i=T0(o,o.property,r):Array.isArray(r)?i=[...r]:i=o.property==="style"?GA(r):String(r);if(Array.isArray(i)){const s=[];for(const a of i)s.push(T0(o,o.property,a));i=s}o.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[o.property]=i}}function ff(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)ff(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?ff(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function T0(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Ga(n)===Ga(t)))return!0}return n}function GA(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function QA(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const XA=["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"],ZA=wy(vs,"div"),JA=wy(_o,"g",XA);function e5(e){const t=String(e),n=[];return{toOffset:o,toPoint:r};function r(i){if(typeof i=="number"&&i>-1&&i<=t.length){let s=0;for(;;){let a=n[s];if(a===void 0){const l=S0(t,n[s-1]);a=l===-1?t.length+1:l+1,n[s]=a}if(a>i)return{line:s+1,column:i-(s>0?n[s-1]:0)+1,offset:i};s++}}}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 a=n[n.length-1],l=S0(t,a),u=l===-1?t.length+1:l+1;if(a===u)break;n.push(u)}const s=(i.line>1?n[i.line-2]:0)+i.column-1;if(s<n[i.line-1])return s}}}function S0(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
50
|
+
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const ri={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/"},Dy={}.hasOwnProperty,t5=Object.prototype;function n5(e,t){const n=t||{};return dp({file:n.file||void 0,location:!1,schema:n.space==="svg"?_o:vs,verbose:n.verbose||!1},e)}function dp(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},su(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:Iy(e,t.childNodes),data:{quirksMode:o}},e.file&&e.location){const i=String(e.file),s=e5(i),a=s.toPoint(0),l=s.toPoint(i.length);n.position={start:a,end:l}}return n}case"#documentType":{const r=t;return n={type:"doctype"},su(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},su(e,r,n),n}default:return n=r5(e,t),n}}function Iy(e,t){let n=-1;const r=[];for(;++n<t.length;){const o=dp(e,t[n]);r.push(o)}return r}function r5(e,t){const n=e.schema;e.schema=t.namespaceURI===ri.svg?_o:vs;let r=-1;const o={};for(;++r<t.attrs.length;){const a=t.attrs[r],l=(a.prefix?a.prefix+":":"")+a.name;Dy.call(t5,l)||(o[l]=a.value)}const s=(e.schema.space==="svg"?JA:ZA)(t.tagName,o,Iy(e,t.childNodes));if(su(e,t,s),s.tagName==="template"){const a=t,l=a.sourceCodeLocation,u=l&&l.startTag&&Xi(l.startTag),d=l&&l.endTag&&Xi(l.endTag),f=dp(e,a.content);u&&d&&e.file&&(f.position={start:u.end,end:d.start}),s.content=f}return e.schema=n,s}function su(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=o5(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function o5(e,t,n){const r=Xi(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 s;if(n.attrs)for(s in n.attrs)Dy.call(n.attrs,s)&&(i[hl(e.schema,s).property]=Xi(n.attrs[s]));n.startTag;const a=Xi(n.startTag),l=n.endTag?Xi(n.endTag):void 0,u={opening:a};l&&(u.closing=l),u.properties=i,t.data={position:u}}}return r}function Xi(e){const t=k0({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=k0({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function k0(e){return e.line&&e.column?e:void 0}class bl{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}bl.prototype.property={};bl.prototype.normal={};bl.prototype.space=null;function Ay(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new bl(n,r,t)}function pf(e){return e.toLowerCase()}class wr{constructor(t,n){this.property=t,this.attribute=n}}wr.prototype.space=null;wr.prototype.boolean=!1;wr.prototype.booleanish=!1;wr.prototype.overloadedBoolean=!1;wr.prototype.number=!1;wr.prototype.commaSeparated=!1;wr.prototype.spaceSeparated=!1;wr.prototype.commaOrSpaceSeparated=!1;wr.prototype.mustUseProperty=!1;wr.prototype.defined=!1;let i5=0;const dt=yi(),hn=yi(),Oy=yi(),He=yi(),Yt=yi(),os=yi(),Jn=yi();function yi(){return 2**++i5}const hf=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:hn,commaOrSpaceSeparated:Jn,commaSeparated:os,number:He,overloadedBoolean:Oy,spaceSeparated:Yt},Symbol.toStringTag,{value:"Module"})),Cd=Object.keys(hf);class fp extends wr{constructor(t,n,r,o){let i=-1;if(super(t,n),w0(this,"space",o),typeof r=="number")for(;++i<Cd.length;){const s=Cd[i];w0(this,Cd[i],(r&hf[s])===hf[s])}}}fp.prototype.defined=!0;function w0(e,t,n){n&&(e[t]=n)}const s5={}.hasOwnProperty;function Ss(e){const t={},n={};let r;for(r in e.properties)if(s5.call(e.properties,r)){const o=e.properties[r],i=new fp(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[pf(r)]=r,n[pf(i.attribute)]=r}return new bl(t,n,e.space)}const My=Ss({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),Py=Ss({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function Ry(e,t){return t in e?e[t]:t}function Ny(e,t){return Ry(e,t.toLowerCase())}const Fy=Ss({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Ny,properties:{xmlns:null,xmlnsXLink:null}}),Ly=Ss({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:hn,ariaAutoComplete:null,ariaBusy:hn,ariaChecked:hn,ariaColCount:He,ariaColIndex:He,ariaColSpan:He,ariaControls:Yt,ariaCurrent:null,ariaDescribedBy:Yt,ariaDetails:null,ariaDisabled:hn,ariaDropEffect:Yt,ariaErrorMessage:null,ariaExpanded:hn,ariaFlowTo:Yt,ariaGrabbed:hn,ariaHasPopup:null,ariaHidden:hn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Yt,ariaLevel:He,ariaLive:null,ariaModal:hn,ariaMultiLine:hn,ariaMultiSelectable:hn,ariaOrientation:null,ariaOwns:Yt,ariaPlaceholder:null,ariaPosInSet:He,ariaPressed:hn,ariaReadOnly:hn,ariaRelevant:null,ariaRequired:hn,ariaRoleDescription:Yt,ariaRowCount:He,ariaRowIndex:He,ariaRowSpan:He,ariaSelected:hn,ariaSetSize:He,ariaSort:null,ariaValueMax:He,ariaValueMin:He,ariaValueNow:He,ariaValueText:null,role:null}}),a5=Ss({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Ny,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:os,acceptCharset:Yt,accessKey:Yt,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:Yt,autoFocus:dt,autoPlay:dt,blocking:Yt,capture:null,charSet:null,checked:dt,cite:null,className:Yt,cols:He,colSpan:null,content:null,contentEditable:hn,controls:dt,controlsList:Yt,coords:He|os,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:Oy,draggable:hn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:Yt,height:He,hidden:dt,high:He,href:null,hrefLang:null,htmlFor:Yt,httpEquiv:Yt,id:null,imageSizes:null,imageSrcSet:null,inert:dt,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:Yt,itemRef:Yt,itemScope:dt,itemType:Yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:He,manifest:null,max:null,maxLength:He,media:null,method:null,min:null,minLength:He,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:dt,optimum:He,pattern:null,ping:Yt,placeholder:null,playsInline:dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:Yt,required:dt,reversed:dt,rows:He,rowSpan:He,sandbox:Yt,scope:null,scoped:dt,seamless:dt,selected:dt,shadowRootClonable:dt,shadowRootDelegatesFocus:dt,shadowRootMode:null,shape:null,size:He,sizes:null,slot:null,span:He,spellCheck:hn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:He,step:null,style:null,tabIndex:He,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:hn,width:He,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Yt,axis:null,background:null,bgColor:null,border:He,borderColor:null,bottomMargin:He,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:He,leftMargin:He,link:null,longDesc:null,lowSrc:null,marginHeight:He,marginWidth:He,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:He,rules:null,scheme:null,scrolling:hn,standby:null,summary:null,text:null,topMargin:He,valueType:null,version:null,vAlign:null,vLink:null,vSpace:He,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:He,security:null,unselectable:null}}),l5=Ss({space:"svg",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"},transform:Ry,properties:{about:Jn,accentHeight:He,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:He,amplitude:He,arabicForm:null,ascent:He,attributeName:null,attributeType:null,azimuth:He,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:He,by:null,calcMode:null,capHeight:He,className:Yt,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:He,diffuseConstant:He,direction:null,display:null,dur:null,divisor:He,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:He,enableBackground:null,end:null,event:null,exponent:He,externalResourcesRequired:null,fill:null,fillOpacity:He,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:os,g2:os,glyphName:os,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:He,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:He,horizOriginX:He,horizOriginY:He,id:null,ideographic:He,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:He,k:He,k1:He,k2:He,k3:He,k4:He,kernelMatrix:Jn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:He,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:He,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:He,overlineThickness:He,paintOrder:null,panose1:null,path:null,pathLength:He,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:He,pointsAtY:He,pointsAtZ:He,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Jn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Jn,rev:Jn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Jn,requiredFeatures:Jn,requiredFonts:Jn,requiredFormats:Jn,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:He,specularExponent:He,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:He,strikethroughThickness:He,string:null,stroke:null,strokeDashArray:Jn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:He,strokeOpacity:He,strokeWidth:null,style:null,surfaceScale:He,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Jn,tabIndex:He,tableValues:null,target:null,targetX:He,targetY:He,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Jn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:He,underlineThickness:He,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:He,values:null,vAlphabetic:He,vMathematical:He,vectorEffect:null,vHanging:He,vIdeographic:He,version:null,vertAdvY:He,vertOriginX:He,vertOriginY:He,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:He,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),u5=/^data[-\w.:]+$/i,D0=/-[a-z]/g,c5=/[A-Z]/g;function d5(e,t){const n=pf(t);let r=t,o=wr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&u5.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(D0,p5);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!D0.test(i)){let s=i.replace(c5,f5);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=fp}return new o(r,t)}function f5(e){return"-"+e.toLowerCase()}function p5(e){return e.charAt(1).toUpperCase()}const h5=Ay([Py,My,Fy,Ly,a5],"html"),_y=Ay([Py,My,Fy,Ly,l5],"svg"),m5={},g5={}.hasOwnProperty,By=yc("type",{handlers:{root:y5,element:T5,text:E5,comment:v5,doctype:C5}});function b5(e,t){const r=(t||m5).space;return By(e,r==="svg"?_y:h5)}function y5(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=pp(e.children,n,t),ks(e,n),n}function x5(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=pp(e.children,n,t),ks(e,n),n}function C5(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return ks(e,t),t}function E5(e){const t={nodeName:"#text",value:e.value,parentNode:null};return ks(e,t),t}function v5(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return ks(e,t),t}function T5(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=_y);const o=[];let i;if(e.properties){for(i in e.properties)if(i!=="children"&&g5.call(e.properties,i)){const l=S5(r,i,e.properties[i]);l&&o.push(l)}}const s=r.space,a={nodeName:e.tagName,tagName:e.tagName,attrs:o,namespaceURI:ri[s],childNodes:[],parentNode:null};return a.childNodes=pp(e.children,a,r),ks(e,a),e.tagName==="template"&&e.content&&(a.content=x5(e.content,r)),a}function S5(e,t,n){const r=d5(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?cc(n):dc(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=ri[r.space]}return o}function pp(e,t,n){let r=-1;const o=[];if(e)for(;++r<e.length;){const i=By(e[r],n);i.parentNode=t,o.push(i)}return o}function ks(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 jy=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],k5=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]),en="�";var V;(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"})(V||(V={}));const zn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function $y(e){return e>=55296&&e<=57343}function w5(e){return e>=56320&&e<=57343}function D5(e,t){return(e-55296)*1024+9216+t}function Hy(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function zy(e){return e>=64976&&e<=65007||k5.has(e)}var ve;(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"})(ve||(ve={}));const I5=65536;class A5{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=I5,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,s=o+n,a=i+n;return{code:t,startLine:r,endLine:r,startCol:s,endCol:s,startOffset:a,endOffset:a}}_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(w5(n))return this.pos++,this._addGap(),D5(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,V.EOF;return this._err(ve.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,V.EOF;const r=this.html.charCodeAt(n);return r===V.CARRIAGE_RETURN?V.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,V.EOF;let t=this.html.charCodeAt(this.pos);return t===V.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,V.LINE_FEED):t===V.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,$y(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===V.LINE_FEED||t===V.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Hy(t)?this._err(ve.controlCharacterInInputStream):zy(t)&&this._err(ve.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var xt;(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"})(xt||(xt={}));function Uy(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 O5=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),M5=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 P5(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=M5.get(e))!==null&&t!==void 0?t:e}var En;(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"})(En||(En={}));const R5=32;var Ro;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Ro||(Ro={}));function mf(e){return e>=En.ZERO&&e<=En.NINE}function N5(e){return e>=En.UPPER_A&&e<=En.UPPER_F||e>=En.LOWER_A&&e<=En.LOWER_F}function F5(e){return e>=En.UPPER_A&&e<=En.UPPER_Z||e>=En.LOWER_A&&e<=En.LOWER_Z||mf(e)}function L5(e){return e===En.EQUALS||F5(e)}var Cn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Cn||(Cn={}));var fo;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(fo||(fo={}));class _5{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Cn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=fo.Strict}startEntity(t){this.decodeMode=t,this.state=Cn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Cn.EntityStart:return t.charCodeAt(n)===En.NUM?(this.state=Cn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Cn.NamedEntity,this.stateNamedEntity(t,n));case Cn.NumericStart:return this.stateNumericStart(t,n);case Cn.NumericDecimal:return this.stateNumericDecimal(t,n);case Cn.NumericHex:return this.stateNumericHex(t,n);case Cn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|R5)===En.LOWER_X?(this.state=Cn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Cn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,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(mf(o)||N5(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(mf(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===En.SEMI)this.consumed+=1;else if(this.decodeMode===fo.Strict)return 0;return this.emitCodePoint(P5(this.result),this.consumed),this.errors&&(t!==En.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&Ro.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const s=t.charCodeAt(n);if(this.treeIndex=B5(r,o,this.treeIndex+Math.max(1,i),s),this.treeIndex<0)return this.result===0||this.decodeMode===fo.Attribute&&(i===0||L5(s))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],i=(o&Ro.VALUE_LENGTH)>>14,i!==0){if(s===En.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==fo.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]&Ro.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]&~Ro.VALUE_LENGTH:o[t+1],r),n===3&&this.emitCodePoint(o[t+2],r),r}end(){var t;switch(this.state){case Cn.NamedEntity:return this.result!==0&&(this.decodeMode!==fo.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Cn.NumericDecimal:return this.emitNumericEntity(0,2);case Cn.NumericHex:return this.emitNumericEntity(0,3);case Cn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Cn.EntityStart:return 0}}}function B5(e,t,n,r){const o=(t&Ro.BRANCH_LENGTH)>>7,i=t&Ro.JUMP_TABLE;if(o===0)return i!==0&&r===i?n:-1;if(i){const l=r-i;return l<0||l>=o?-1:e[n+l]-1}let s=n,a=s+o-1;for(;s<=a;){const l=s+a>>>1,u=e[l];if(u<r)s=l+1;else if(u>r)a=l-1;else return e[l+o]}return-1}var Me;(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/"})(Me||(Me={}));var si;(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"})(si||(si={}));var gr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(gr||(gr={}));var he;(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"})(he||(he={}));var E;(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"})(E||(E={}));const j5=new Map([[he.A,E.A],[he.ADDRESS,E.ADDRESS],[he.ANNOTATION_XML,E.ANNOTATION_XML],[he.APPLET,E.APPLET],[he.AREA,E.AREA],[he.ARTICLE,E.ARTICLE],[he.ASIDE,E.ASIDE],[he.B,E.B],[he.BASE,E.BASE],[he.BASEFONT,E.BASEFONT],[he.BGSOUND,E.BGSOUND],[he.BIG,E.BIG],[he.BLOCKQUOTE,E.BLOCKQUOTE],[he.BODY,E.BODY],[he.BR,E.BR],[he.BUTTON,E.BUTTON],[he.CAPTION,E.CAPTION],[he.CENTER,E.CENTER],[he.CODE,E.CODE],[he.COL,E.COL],[he.COLGROUP,E.COLGROUP],[he.DD,E.DD],[he.DESC,E.DESC],[he.DETAILS,E.DETAILS],[he.DIALOG,E.DIALOG],[he.DIR,E.DIR],[he.DIV,E.DIV],[he.DL,E.DL],[he.DT,E.DT],[he.EM,E.EM],[he.EMBED,E.EMBED],[he.FIELDSET,E.FIELDSET],[he.FIGCAPTION,E.FIGCAPTION],[he.FIGURE,E.FIGURE],[he.FONT,E.FONT],[he.FOOTER,E.FOOTER],[he.FOREIGN_OBJECT,E.FOREIGN_OBJECT],[he.FORM,E.FORM],[he.FRAME,E.FRAME],[he.FRAMESET,E.FRAMESET],[he.H1,E.H1],[he.H2,E.H2],[he.H3,E.H3],[he.H4,E.H4],[he.H5,E.H5],[he.H6,E.H6],[he.HEAD,E.HEAD],[he.HEADER,E.HEADER],[he.HGROUP,E.HGROUP],[he.HR,E.HR],[he.HTML,E.HTML],[he.I,E.I],[he.IMG,E.IMG],[he.IMAGE,E.IMAGE],[he.INPUT,E.INPUT],[he.IFRAME,E.IFRAME],[he.KEYGEN,E.KEYGEN],[he.LABEL,E.LABEL],[he.LI,E.LI],[he.LINK,E.LINK],[he.LISTING,E.LISTING],[he.MAIN,E.MAIN],[he.MALIGNMARK,E.MALIGNMARK],[he.MARQUEE,E.MARQUEE],[he.MATH,E.MATH],[he.MENU,E.MENU],[he.META,E.META],[he.MGLYPH,E.MGLYPH],[he.MI,E.MI],[he.MO,E.MO],[he.MN,E.MN],[he.MS,E.MS],[he.MTEXT,E.MTEXT],[he.NAV,E.NAV],[he.NOBR,E.NOBR],[he.NOFRAMES,E.NOFRAMES],[he.NOEMBED,E.NOEMBED],[he.NOSCRIPT,E.NOSCRIPT],[he.OBJECT,E.OBJECT],[he.OL,E.OL],[he.OPTGROUP,E.OPTGROUP],[he.OPTION,E.OPTION],[he.P,E.P],[he.PARAM,E.PARAM],[he.PLAINTEXT,E.PLAINTEXT],[he.PRE,E.PRE],[he.RB,E.RB],[he.RP,E.RP],[he.RT,E.RT],[he.RTC,E.RTC],[he.RUBY,E.RUBY],[he.S,E.S],[he.SCRIPT,E.SCRIPT],[he.SEARCH,E.SEARCH],[he.SECTION,E.SECTION],[he.SELECT,E.SELECT],[he.SOURCE,E.SOURCE],[he.SMALL,E.SMALL],[he.SPAN,E.SPAN],[he.STRIKE,E.STRIKE],[he.STRONG,E.STRONG],[he.STYLE,E.STYLE],[he.SUB,E.SUB],[he.SUMMARY,E.SUMMARY],[he.SUP,E.SUP],[he.TABLE,E.TABLE],[he.TBODY,E.TBODY],[he.TEMPLATE,E.TEMPLATE],[he.TEXTAREA,E.TEXTAREA],[he.TFOOT,E.TFOOT],[he.TD,E.TD],[he.TH,E.TH],[he.THEAD,E.THEAD],[he.TITLE,E.TITLE],[he.TR,E.TR],[he.TRACK,E.TRACK],[he.TT,E.TT],[he.U,E.U],[he.UL,E.UL],[he.SVG,E.SVG],[he.VAR,E.VAR],[he.WBR,E.WBR],[he.XMP,E.XMP]]);function ws(e){var t;return(t=j5.get(e))!==null&&t!==void 0?t:E.UNKNOWN}const Le=E,$5={[Me.HTML]:new Set([Le.ADDRESS,Le.APPLET,Le.AREA,Le.ARTICLE,Le.ASIDE,Le.BASE,Le.BASEFONT,Le.BGSOUND,Le.BLOCKQUOTE,Le.BODY,Le.BR,Le.BUTTON,Le.CAPTION,Le.CENTER,Le.COL,Le.COLGROUP,Le.DD,Le.DETAILS,Le.DIR,Le.DIV,Le.DL,Le.DT,Le.EMBED,Le.FIELDSET,Le.FIGCAPTION,Le.FIGURE,Le.FOOTER,Le.FORM,Le.FRAME,Le.FRAMESET,Le.H1,Le.H2,Le.H3,Le.H4,Le.H5,Le.H6,Le.HEAD,Le.HEADER,Le.HGROUP,Le.HR,Le.HTML,Le.IFRAME,Le.IMG,Le.INPUT,Le.LI,Le.LINK,Le.LISTING,Le.MAIN,Le.MARQUEE,Le.MENU,Le.META,Le.NAV,Le.NOEMBED,Le.NOFRAMES,Le.NOSCRIPT,Le.OBJECT,Le.OL,Le.P,Le.PARAM,Le.PLAINTEXT,Le.PRE,Le.SCRIPT,Le.SECTION,Le.SELECT,Le.SOURCE,Le.STYLE,Le.SUMMARY,Le.TABLE,Le.TBODY,Le.TD,Le.TEMPLATE,Le.TEXTAREA,Le.TFOOT,Le.TH,Le.THEAD,Le.TITLE,Le.TR,Le.TRACK,Le.UL,Le.WBR,Le.XMP]),[Me.MATHML]:new Set([Le.MI,Le.MO,Le.MN,Le.MS,Le.MTEXT,Le.ANNOTATION_XML]),[Me.SVG]:new Set([Le.TITLE,Le.FOREIGN_OBJECT,Le.DESC]),[Me.XLINK]:new Set,[Me.XML]:new Set,[Me.XMLNS]:new Set},gf=new Set([Le.H1,Le.H2,Le.H3,Le.H4,Le.H5,Le.H6]);he.STYLE,he.SCRIPT,he.XMP,he.IFRAME,he.NOEMBED,he.NOFRAMES,he.PLAINTEXT;var X;(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"})(X||(X={}));const un={DATA:X.DATA,RCDATA:X.RCDATA,RAWTEXT:X.RAWTEXT,SCRIPT_DATA:X.SCRIPT_DATA,PLAINTEXT:X.PLAINTEXT,CDATA_SECTION:X.CDATA_SECTION};function H5(e){return e>=V.DIGIT_0&&e<=V.DIGIT_9}function wa(e){return e>=V.LATIN_CAPITAL_A&&e<=V.LATIN_CAPITAL_Z}function z5(e){return e>=V.LATIN_SMALL_A&&e<=V.LATIN_SMALL_Z}function Ao(e){return z5(e)||wa(e)}function I0(e){return Ao(e)||H5(e)}function ql(e){return e+32}function Vy(e){return e===V.SPACE||e===V.LINE_FEED||e===V.TABULATION||e===V.FORM_FEED}function A0(e){return Vy(e)||e===V.SOLIDUS||e===V.GREATER_THAN_SIGN}function U5(e){return e===V.NULL?ve.nullCharacterReference:e>1114111?ve.characterReferenceOutsideUnicodeRange:$y(e)?ve.surrogateCharacterReference:zy(e)?ve.noncharacterCharacterReference:Hy(e)||e===V.CARRIAGE_RETURN?ve.controlCharacterReference:null}class V5{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=X.DATA,this.returnState=X.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new A5(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new _5(O5,(r,o)=>{this.preprocessor.pos=this.entityStartPos+o-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ve.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ve.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const o=U5(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?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||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:xt.START_TAG,tagName:"",tagID:E.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:xt.END_TAG,tagName:"",tagID:E.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:xt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:xt.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(Uy(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(ve.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=ws(t.tagName),t.type===xt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(ve.endTagWithAttributes),t.selfClosing&&this._err(ve.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 xt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case xt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case xt.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:xt.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=Vy(t)?xt.WHITESPACE_CHARACTER:t===V.NULL?xt.NULL_CHARACTER:xt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(xt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=X.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?fo.Attribute:fo.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===X.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===X.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===X.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case X.DATA:{this._stateData(t);break}case X.RCDATA:{this._stateRcdata(t);break}case X.RAWTEXT:{this._stateRawtext(t);break}case X.SCRIPT_DATA:{this._stateScriptData(t);break}case X.PLAINTEXT:{this._statePlaintext(t);break}case X.TAG_OPEN:{this._stateTagOpen(t);break}case X.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case X.TAG_NAME:{this._stateTagName(t);break}case X.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case X.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case X.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case X.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case X.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case X.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case X.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case X.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case X.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case X.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case X.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case X.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case X.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case X.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case X.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case X.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case X.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case X.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case X.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case X.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case X.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case X.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case X.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case X.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case X.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case X.BOGUS_COMMENT:{this._stateBogusComment(t);break}case X.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case X.COMMENT_START:{this._stateCommentStart(t);break}case X.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case X.COMMENT:{this._stateComment(t);break}case X.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case X.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case X.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case X.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case X.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case X.COMMENT_END:{this._stateCommentEnd(t);break}case X.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case X.DOCTYPE:{this._stateDoctype(t);break}case X.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case X.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case X.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case X.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case X.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case X.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case X.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case X.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case X.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case X.CDATA_SECTION:{this._stateCdataSection(t);break}case X.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case X.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case X.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case X.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case V.LESS_THAN_SIGN:{this.state=X.TAG_OPEN;break}case V.AMPERSAND:{this._startCharacterReference();break}case V.NULL:{this._err(ve.unexpectedNullCharacter),this._emitCodePoint(t);break}case V.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case V.AMPERSAND:{this._startCharacterReference();break}case V.LESS_THAN_SIGN:{this.state=X.RCDATA_LESS_THAN_SIGN;break}case V.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(en);break}case V.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case V.LESS_THAN_SIGN:{this.state=X.RAWTEXT_LESS_THAN_SIGN;break}case V.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(en);break}case V.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case V.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_LESS_THAN_SIGN;break}case V.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(en);break}case V.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case V.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(en);break}case V.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Ao(t))this._createStartTagToken(),this.state=X.TAG_NAME,this._stateTagName(t);else switch(t){case V.EXCLAMATION_MARK:{this.state=X.MARKUP_DECLARATION_OPEN;break}case V.SOLIDUS:{this.state=X.END_TAG_OPEN;break}case V.QUESTION_MARK:{this._err(ve.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=X.BOGUS_COMMENT,this._stateBogusComment(t);break}case V.EOF:{this._err(ve.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ve.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=X.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Ao(t))this._createEndTagToken(),this.state=X.TAG_NAME,this._stateTagName(t);else switch(t){case V.GREATER_THAN_SIGN:{this._err(ve.missingEndTagName),this.state=X.DATA;break}case V.EOF:{this._err(ve.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ve.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=X.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:{this.state=X.BEFORE_ATTRIBUTE_NAME;break}case V.SOLIDUS:{this.state=X.SELF_CLOSING_START_TAG;break}case V.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentTagToken();break}case V.NULL:{this._err(ve.unexpectedNullCharacter),n.tagName+=en;break}case V.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(wa(t)?ql(t):t)}}_stateRcdataLessThanSign(t){t===V.SOLIDUS?this.state=X.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=X.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Ao(t)?(this.state=X.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=X.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 V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=X.BEFORE_ATTRIBUTE_NAME,!1;case V.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=X.SELF_CLOSING_START_TAG,!1;case V.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=X.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=X.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===V.SOLIDUS?this.state=X.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=X.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Ao(t)?(this.state=X.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=X.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=X.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case V.SOLIDUS:{this.state=X.SCRIPT_DATA_END_TAG_OPEN;break}case V.EXCLAMATION_MARK:{this.state=X.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=X.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Ao(t)?(this.state=X.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=X.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=X.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===V.HYPHEN_MINUS?(this.state=X.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=X.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===V.HYPHEN_MINUS?(this.state=X.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=X.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case V.HYPHEN_MINUS:{this.state=X.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case V.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case V.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(en);break}case V.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case V.HYPHEN_MINUS:{this.state=X.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case V.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case V.NULL:{this._err(ve.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_ESCAPED,this._emitChars(en);break}case V.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=X.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case V.HYPHEN_MINUS:{this._emitChars("-");break}case V.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case V.GREATER_THAN_SIGN:{this.state=X.SCRIPT_DATA,this._emitChars(">");break}case V.NULL:{this._err(ve.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_ESCAPED,this._emitChars(en);break}case V.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=X.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===V.SOLIDUS?this.state=X.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Ao(t)?(this._emitChars("<"),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Ao(t)?(this.state=X.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(zn.SCRIPT,!1)&&A0(this.preprocessor.peek(zn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<zn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case V.HYPHEN_MINUS:{this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case V.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case V.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(en);break}case V.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case V.HYPHEN_MINUS:{this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case V.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case V.NULL:{this._err(ve.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(en);break}case V.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case V.HYPHEN_MINUS:{this._emitChars("-");break}case V.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case V.GREATER_THAN_SIGN:{this.state=X.SCRIPT_DATA,this._emitChars(">");break}case V.NULL:{this._err(ve.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(en);break}case V.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===V.SOLIDUS?(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(zn.SCRIPT,!1)&&A0(this.preprocessor.peek(zn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<zn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=X.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:break;case V.SOLIDUS:case V.GREATER_THAN_SIGN:case V.EOF:{this.state=X.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case V.EQUALS_SIGN:{this._err(ve.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=X.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=X.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:case V.SOLIDUS:case V.GREATER_THAN_SIGN:case V.EOF:{this._leaveAttrName(),this.state=X.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case V.EQUALS_SIGN:{this._leaveAttrName(),this.state=X.BEFORE_ATTRIBUTE_VALUE;break}case V.QUOTATION_MARK:case V.APOSTROPHE:case V.LESS_THAN_SIGN:{this._err(ve.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case V.NULL:{this._err(ve.unexpectedNullCharacter),this.currentAttr.name+=en;break}default:this.currentAttr.name+=String.fromCodePoint(wa(t)?ql(t):t)}}_stateAfterAttributeName(t){switch(t){case V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:break;case V.SOLIDUS:{this.state=X.SELF_CLOSING_START_TAG;break}case V.EQUALS_SIGN:{this.state=X.BEFORE_ATTRIBUTE_VALUE;break}case V.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentTagToken();break}case V.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=X.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:break;case V.QUOTATION_MARK:{this.state=X.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case V.APOSTROPHE:{this.state=X.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case V.GREATER_THAN_SIGN:{this._err(ve.missingAttributeValue),this.state=X.DATA,this.emitCurrentTagToken();break}default:this.state=X.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case V.QUOTATION_MARK:{this.state=X.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case V.AMPERSAND:{this._startCharacterReference();break}case V.NULL:{this._err(ve.unexpectedNullCharacter),this.currentAttr.value+=en;break}case V.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case V.APOSTROPHE:{this.state=X.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case V.AMPERSAND:{this._startCharacterReference();break}case V.NULL:{this._err(ve.unexpectedNullCharacter),this.currentAttr.value+=en;break}case V.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:{this._leaveAttrValue(),this.state=X.BEFORE_ATTRIBUTE_NAME;break}case V.AMPERSAND:{this._startCharacterReference();break}case V.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=X.DATA,this.emitCurrentTagToken();break}case V.NULL:{this._err(ve.unexpectedNullCharacter),this.currentAttr.value+=en;break}case V.QUOTATION_MARK:case V.APOSTROPHE:case V.LESS_THAN_SIGN:case V.EQUALS_SIGN:case V.GRAVE_ACCENT:{this._err(ve.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case V.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:{this._leaveAttrValue(),this.state=X.BEFORE_ATTRIBUTE_NAME;break}case V.SOLIDUS:{this._leaveAttrValue(),this.state=X.SELF_CLOSING_START_TAG;break}case V.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=X.DATA,this.emitCurrentTagToken();break}case V.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this._err(ve.missingWhitespaceBetweenAttributes),this.state=X.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case V.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=X.DATA,this.emitCurrentTagToken();break}case V.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this._err(ve.unexpectedSolidusInTag),this.state=X.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case V.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentComment(n);break}case V.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case V.NULL:{this._err(ve.unexpectedNullCharacter),n.data+=en;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(zn.DASH_DASH,!0)?(this._createCommentToken(zn.DASH_DASH.length+1),this.state=X.COMMENT_START):this._consumeSequenceIfMatch(zn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(zn.DOCTYPE.length+1),this.state=X.DOCTYPE):this._consumeSequenceIfMatch(zn.CDATA_START,!0)?this.inForeignNode?this.state=X.CDATA_SECTION:(this._err(ve.cdataInHtmlContent),this._createCommentToken(zn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=X.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ve.incorrectlyOpenedComment),this._createCommentToken(2),this.state=X.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case V.HYPHEN_MINUS:{this.state=X.COMMENT_START_DASH;break}case V.GREATER_THAN_SIGN:{this._err(ve.abruptClosingOfEmptyComment),this.state=X.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=X.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case V.HYPHEN_MINUS:{this.state=X.COMMENT_END;break}case V.GREATER_THAN_SIGN:{this._err(ve.abruptClosingOfEmptyComment),this.state=X.DATA,this.emitCurrentComment(n);break}case V.EOF:{this._err(ve.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=X.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case V.HYPHEN_MINUS:{this.state=X.COMMENT_END_DASH;break}case V.LESS_THAN_SIGN:{n.data+="<",this.state=X.COMMENT_LESS_THAN_SIGN;break}case V.NULL:{this._err(ve.unexpectedNullCharacter),n.data+=en;break}case V.EOF:{this._err(ve.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case V.EXCLAMATION_MARK:{n.data+="!",this.state=X.COMMENT_LESS_THAN_SIGN_BANG;break}case V.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=X.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===V.HYPHEN_MINUS?this.state=X.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=X.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===V.HYPHEN_MINUS?this.state=X.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=X.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==V.GREATER_THAN_SIGN&&t!==V.EOF&&this._err(ve.nestedComment),this.state=X.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case V.HYPHEN_MINUS:{this.state=X.COMMENT_END;break}case V.EOF:{this._err(ve.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=X.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case V.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentComment(n);break}case V.EXCLAMATION_MARK:{this.state=X.COMMENT_END_BANG;break}case V.HYPHEN_MINUS:{n.data+="-";break}case V.EOF:{this._err(ve.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=X.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case V.HYPHEN_MINUS:{n.data+="--!",this.state=X.COMMENT_END_DASH;break}case V.GREATER_THAN_SIGN:{this._err(ve.incorrectlyClosedComment),this.state=X.DATA,this.emitCurrentComment(n);break}case V.EOF:{this._err(ve.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=X.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:{this.state=X.BEFORE_DOCTYPE_NAME;break}case V.GREATER_THAN_SIGN:{this.state=X.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case V.EOF:{this._err(ve.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingWhitespaceBeforeDoctypeName),this.state=X.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(wa(t))this._createDoctypeToken(String.fromCharCode(ql(t))),this.state=X.DOCTYPE_NAME;else switch(t){case V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:break;case V.NULL:{this._err(ve.unexpectedNullCharacter),this._createDoctypeToken(en),this.state=X.DOCTYPE_NAME;break}case V.GREATER_THAN_SIGN:{this._err(ve.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=X.DATA;break}case V.EOF:{this._err(ve.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=X.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:{this.state=X.AFTER_DOCTYPE_NAME;break}case V.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentDoctype(n);break}case V.NULL:{this._err(ve.unexpectedNullCharacter),n.name+=en;break}case V.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(wa(t)?ql(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:break;case V.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentDoctype(n);break}case V.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(zn.PUBLIC,!1)?this.state=X.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(zn.SYSTEM,!1)?this.state=X.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ve.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:{this.state=X.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case V.QUOTATION_MARK:{this._err(ve.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case V.APOSTROPHE:{this._err(ve.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case V.GREATER_THAN_SIGN:{this._err(ve.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(n);break}case V.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:break;case V.QUOTATION_MARK:{n.publicId="",this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case V.APOSTROPHE:{n.publicId="",this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case V.GREATER_THAN_SIGN:{this._err(ve.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(n);break}case V.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case V.QUOTATION_MARK:{this.state=X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case V.NULL:{this._err(ve.unexpectedNullCharacter),n.publicId+=en;break}case V.GREATER_THAN_SIGN:{this._err(ve.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=X.DATA;break}case V.EOF:{this._err(ve.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 V.APOSTROPHE:{this.state=X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case V.NULL:{this._err(ve.unexpectedNullCharacter),n.publicId+=en;break}case V.GREATER_THAN_SIGN:{this._err(ve.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=X.DATA;break}case V.EOF:{this._err(ve.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 V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:{this.state=X.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case V.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentDoctype(n);break}case V.QUOTATION_MARK:{this._err(ve.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case V.APOSTROPHE:{this._err(ve.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case V.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:break;case V.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=X.DATA;break}case V.QUOTATION_MARK:{n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case V.APOSTROPHE:{n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case V.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:{this.state=X.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case V.QUOTATION_MARK:{this._err(ve.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case V.APOSTROPHE:{this._err(ve.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case V.GREATER_THAN_SIGN:{this._err(ve.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(n);break}case V.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:break;case V.QUOTATION_MARK:{n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case V.APOSTROPHE:{n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case V.GREATER_THAN_SIGN:{this._err(ve.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(n);break}case V.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case V.QUOTATION_MARK:{this.state=X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case V.NULL:{this._err(ve.unexpectedNullCharacter),n.systemId+=en;break}case V.GREATER_THAN_SIGN:{this._err(ve.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=X.DATA;break}case V.EOF:{this._err(ve.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 V.APOSTROPHE:{this.state=X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case V.NULL:{this._err(ve.unexpectedNullCharacter),n.systemId+=en;break}case V.GREATER_THAN_SIGN:{this._err(ve.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=X.DATA;break}case V.EOF:{this._err(ve.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 V.SPACE:case V.LINE_FEED:case V.TABULATION:case V.FORM_FEED:break;case V.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=X.DATA;break}case V.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case V.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=X.DATA;break}case V.NULL:{this._err(ve.unexpectedNullCharacter);break}case V.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case V.RIGHT_SQUARE_BRACKET:{this.state=X.CDATA_SECTION_BRACKET;break}case V.EOF:{this._err(ve.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===V.RIGHT_SQUARE_BRACKET?this.state=X.CDATA_SECTION_END:(this._emitChars("]"),this.state=X.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case V.GREATER_THAN_SIGN:{this.state=X.DATA;break}case V.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=X.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(V.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&I0(this.preprocessor.peek(1))?X.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){I0(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===V.SEMICOLON&&this._err(ve.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const Wy=new Set([E.DD,E.DT,E.LI,E.OPTGROUP,E.OPTION,E.P,E.RB,E.RP,E.RT,E.RTC]),O0=new Set([...Wy,E.CAPTION,E.COLGROUP,E.TBODY,E.TD,E.TFOOT,E.TH,E.THEAD,E.TR]),Fu=new Set([E.APPLET,E.CAPTION,E.HTML,E.MARQUEE,E.OBJECT,E.TABLE,E.TD,E.TEMPLATE,E.TH]),W5=new Set([...Fu,E.OL,E.UL]),q5=new Set([...Fu,E.BUTTON]),M0=new Set([E.ANNOTATION_XML,E.MI,E.MN,E.MO,E.MS,E.MTEXT]),P0=new Set([E.DESC,E.FOREIGN_OBJECT,E.TITLE]),Y5=new Set([E.TR,E.TEMPLATE,E.HTML]),K5=new Set([E.TBODY,E.TFOOT,E.THEAD,E.TEMPLATE,E.HTML]),G5=new Set([E.TABLE,E.TEMPLATE,E.HTML]),Q5=new Set([E.TD,E.TH]);class X5{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=E.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===E.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Me.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])!==Me.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(gf,Me.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Q5,Me.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(G5,Me.HTML)}clearBackToTableBodyContext(){this.clearBackTo(K5,Me.HTML)}clearBackToTableRowContext(){this.clearBackTo(Y5,Me.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]===E.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]===E.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 Me.HTML:{if(o===t)return!0;if(n.has(o))return!1;break}case Me.SVG:{if(P0.has(o))return!1;break}case Me.MATHML:{if(M0.has(o))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Fu)}hasInListItemScope(t){return this.hasInDynamicScope(t,W5)}hasInButtonScope(t){return this.hasInDynamicScope(t,q5)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Me.HTML:{if(gf.has(n))return!0;if(Fu.has(n))return!1;break}case Me.SVG:{if(P0.has(n))return!1;break}case Me.MATHML:{if(M0.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Me.HTML)switch(this.tagIDs[n]){case t:return!0;case E.TABLE:case E.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Me.HTML)switch(this.tagIDs[t]){case E.TBODY:case E.THEAD:case E.TFOOT:return!0;case E.TABLE:case E.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Me.HTML)switch(this.tagIDs[n]){case t:return!0;case E.OPTION:case E.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Wy.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&O0.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&O0.has(this.currentTagId);)this.pop()}}const Ed=3;var Yr;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Yr||(Yr={}));const R0={type:Yr.Marker};class Z5{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],o=n.length,i=this.treeAdapter.getTagName(t),s=this.treeAdapter.getNamespaceURI(t);for(let a=0;a<this.entries.length;a++){const l=this.entries[a];if(l.type===Yr.Marker)break;const{element:u}=l;if(this.treeAdapter.getTagName(u)===i&&this.treeAdapter.getNamespaceURI(u)===s){const d=this.treeAdapter.getAttrList(u);d.length===o&&r.push({idx:a,attrs:d})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Ed)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Ed)return;const o=new Map(n.map(s=>[s.name,s.value]));let i=0;for(let s=0;s<r.length;s++){const a=r[s];a.attrs.every(l=>o.get(l.name)===l.value)&&(i+=1,i>=Ed&&this.entries.splice(a.idx,1))}}insertMarker(){this.entries.unshift(R0)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Yr.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Yr.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(R0);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Yr.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Yr.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Yr.Element&&n.element===t)}}const Oo={createDocument(){return{nodeName:"#document",mode:gr.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};Oo.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(Oo.isTextNode(n)){n.value+=t;return}}Oo.appendChild(e,Oo.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Oo.isTextNode(r)?r.value+=t:Oo.insertBefore(e,Oo.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}}},qy="html",J5="about:legacy-compat",e4="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Yy=["+//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//"],t4=[...Yy,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],n4=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Ky=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],r4=[...Ky,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function N0(e,t){return t.some(n=>e.startsWith(n))}function o4(e){return e.name===qy&&e.publicId===null&&(e.systemId===null||e.systemId===J5)}function i4(e){if(e.name!==qy)return gr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===e4)return gr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),n4.has(n))return gr.QUIRKS;let r=t===null?t4:Yy;if(N0(n,r))return gr.QUIRKS;if(r=t===null?Ky:r4,N0(n,r))return gr.LIMITED_QUIRKS}return gr.NO_QUIRKS}const F0={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},s4="definitionurl",a4="definitionURL",l4=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])),u4=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Me.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Me.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Me.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Me.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Me.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Me.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Me.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Me.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Me.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Me.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Me.XMLNS}]]),c4=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])),d4=new Set([E.B,E.BIG,E.BLOCKQUOTE,E.BODY,E.BR,E.CENTER,E.CODE,E.DD,E.DIV,E.DL,E.DT,E.EM,E.EMBED,E.H1,E.H2,E.H3,E.H4,E.H5,E.H6,E.HEAD,E.HR,E.I,E.IMG,E.LI,E.LISTING,E.MENU,E.META,E.NOBR,E.OL,E.P,E.PRE,E.RUBY,E.S,E.SMALL,E.SPAN,E.STRONG,E.STRIKE,E.SUB,E.SUP,E.TABLE,E.TT,E.U,E.UL,E.VAR]);function f4(e){const t=e.tagID;return t===E.FONT&&e.attrs.some(({name:r})=>r===si.COLOR||r===si.SIZE||r===si.FACE)||d4.has(t)}function Gy(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===s4){e.attrs[t].name=a4;break}}function Qy(e){for(let t=0;t<e.attrs.length;t++){const n=l4.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function hp(e){for(let t=0;t<e.attrs.length;t++){const n=u4.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 p4(e){const t=c4.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=ws(e.tagName))}function h4(e,t){return t===Me.MATHML&&(e===E.MI||e===E.MO||e===E.MN||e===E.MS||e===E.MTEXT)}function m4(e,t,n){if(t===Me.MATHML&&e===E.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===si.ENCODING){const o=n[r].value.toLowerCase();return o===F0.TEXT_HTML||o===F0.APPLICATION_XML}}return t===Me.SVG&&(e===E.FOREIGN_OBJECT||e===E.DESC||e===E.TITLE)}function g4(e,t,n,r){return(!r||r===Me.HTML)&&m4(e,t,n)||(!r||r===Me.MATHML)&&h4(e,t)}const b4="hidden",y4=8,x4=3;var te;(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"})(te||(te={}));const C4={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Xy=new Set([E.TABLE,E.TBODY,E.TFOOT,E.THEAD,E.TR]),L0={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Oo,onParseError:null};class _0{constructor(t,n,r=null,o=null){this.fragmentContext=r,this.scriptHandler=o,this.currentToken=null,this.stopped=!1,this.insertionMode=te.INITIAL,this.originalInsertionMode=te.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={...L0,...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 V5(this.options,this),this.activeFormattingElements=new Z5(this.treeAdapter),this.fragmentContextID=r?ws(this.treeAdapter.getTagName(r)):E.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new X5(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={...L0,...n};t??(t=r.treeAdapter.createElement(he.TEMPLATE,Me.HTML,[]));const o=r.treeAdapter.createElement("documentmock",Me.HTML,[]),i=new this(r,o,t);return i.fragmentContextID===E.TEMPLATE&&i.tmplInsertionModeStack.unshift(te.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:C4,s={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(s)}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,s;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,s=this.fragmentContextID):{current:i,currentTagId:s}=this.openElements,this._setContextModes(i,s)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Me.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Me.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=te.TEXT}switchToPlaintextParsing(){this.insertionMode=te.TEXT,this.originalInsertionMode=te.IN_BODY,this.tokenizer.state=un.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)===he.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Me.HTML))switch(this.fragmentContextID){case E.TITLE:case E.TEXTAREA:{this.tokenizer.state=un.RCDATA;break}case E.STYLE:case E.XMP:case E.IFRAME:case E.NOEMBED:case E.NOFRAMES:case E.NOSCRIPT:{this.tokenizer.state=un.RAWTEXT;break}case E.SCRIPT:{this.tokenizer.state=un.SCRIPT_DATA;break}case E.PLAINTEXT:{this.tokenizer.state=un.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 s=this.treeAdapter.getChildNodes(this.document).find(a=>this.treeAdapter.isDocumentTypeNode(a));s&&this.treeAdapter.setNodeSourceCodeLocation(s,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,Me.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Me.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(he.HTML,Me.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,E.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,s=o[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:l,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:l,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,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===xt.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===E.SVG&&this.treeAdapter.getTagName(n)===he.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Me.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===E.MGLYPH||t.tagID===E.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Me.HTML)}_processToken(t){switch(t.type){case xt.CHARACTER:{this.onCharacter(t);break}case xt.NULL_CHARACTER:{this.onNullCharacter(t);break}case xt.COMMENT:{this.onComment(t);break}case xt.DOCTYPE:{this.onDoctype(t);break}case xt.START_TAG:{this._processStartTag(t);break}case xt.END_TAG:{this.onEndTag(t);break}case xt.EOF:{this.onEof(t);break}case xt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const o=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return g4(t,o,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(o=>o.type===Yr.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=te.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(E.P),this.openElements.popUntilTagNamePopped(E.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case E.TR:{this.insertionMode=te.IN_ROW;return}case E.TBODY:case E.THEAD:case E.TFOOT:{this.insertionMode=te.IN_TABLE_BODY;return}case E.CAPTION:{this.insertionMode=te.IN_CAPTION;return}case E.COLGROUP:{this.insertionMode=te.IN_COLUMN_GROUP;return}case E.TABLE:{this.insertionMode=te.IN_TABLE;return}case E.BODY:{this.insertionMode=te.IN_BODY;return}case E.FRAMESET:{this.insertionMode=te.IN_FRAMESET;return}case E.SELECT:{this._resetInsertionModeForSelect(t);return}case E.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case E.HTML:{this.insertionMode=this.headElement?te.AFTER_HEAD:te.BEFORE_HEAD;return}case E.TD:case E.TH:{if(t>0){this.insertionMode=te.IN_CELL;return}break}case E.HEAD:{if(t>0){this.insertionMode=te.IN_HEAD;return}break}}this.insertionMode=te.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===E.TEMPLATE)break;if(r===E.TABLE){this.insertionMode=te.IN_SELECT_IN_TABLE;return}}this.insertionMode=te.IN_SELECT}_isElementCausesFosterParenting(t){return Xy.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 E.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Me.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case E.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 $5[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){QO(this,t);return}switch(this.insertionMode){case te.INITIAL:{Zs(this,t);break}case te.BEFORE_HTML:{Fa(this,t);break}case te.BEFORE_HEAD:{La(this,t);break}case te.IN_HEAD:{_a(this,t);break}case te.IN_HEAD_NO_SCRIPT:{Ba(this,t);break}case te.AFTER_HEAD:{ja(this,t);break}case te.IN_BODY:case te.IN_CAPTION:case te.IN_CELL:case te.IN_TEMPLATE:{Jy(this,t);break}case te.TEXT:case te.IN_SELECT:case te.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case te.IN_TABLE:case te.IN_TABLE_BODY:case te.IN_ROW:{vd(this,t);break}case te.IN_TABLE_TEXT:{ix(this,t);break}case te.IN_COLUMN_GROUP:{Lu(this,t);break}case te.AFTER_BODY:{_u(this,t);break}case te.AFTER_AFTER_BODY:{au(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){GO(this,t);return}switch(this.insertionMode){case te.INITIAL:{Zs(this,t);break}case te.BEFORE_HTML:{Fa(this,t);break}case te.BEFORE_HEAD:{La(this,t);break}case te.IN_HEAD:{_a(this,t);break}case te.IN_HEAD_NO_SCRIPT:{Ba(this,t);break}case te.AFTER_HEAD:{ja(this,t);break}case te.TEXT:{this._insertCharacters(t);break}case te.IN_TABLE:case te.IN_TABLE_BODY:case te.IN_ROW:{vd(this,t);break}case te.IN_COLUMN_GROUP:{Lu(this,t);break}case te.AFTER_BODY:{_u(this,t);break}case te.AFTER_AFTER_BODY:{au(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){bf(this,t);return}switch(this.insertionMode){case te.INITIAL:case te.BEFORE_HTML:case te.BEFORE_HEAD:case te.IN_HEAD:case te.IN_HEAD_NO_SCRIPT:case te.AFTER_HEAD:case te.IN_BODY:case te.IN_TABLE:case te.IN_CAPTION:case te.IN_COLUMN_GROUP:case te.IN_TABLE_BODY:case te.IN_ROW:case te.IN_CELL:case te.IN_SELECT:case te.IN_SELECT_IN_TABLE:case te.IN_TEMPLATE:case te.IN_FRAMESET:case te.AFTER_FRAMESET:{bf(this,t);break}case te.IN_TABLE_TEXT:{Js(this,t);break}case te.AFTER_BODY:{D4(this,t);break}case te.AFTER_AFTER_BODY:case te.AFTER_AFTER_FRAMESET:{I4(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case te.INITIAL:{A4(this,t);break}case te.BEFORE_HEAD:case te.IN_HEAD:case te.IN_HEAD_NO_SCRIPT:case te.AFTER_HEAD:{this._err(t,ve.misplacedDoctype);break}case te.IN_TABLE_TEXT:{Js(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ve.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?XO(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case te.INITIAL:{Zs(this,t);break}case te.BEFORE_HTML:{O4(this,t);break}case te.BEFORE_HEAD:{P4(this,t);break}case te.IN_HEAD:{Br(this,t);break}case te.IN_HEAD_NO_SCRIPT:{F4(this,t);break}case te.AFTER_HEAD:{_4(this,t);break}case te.IN_BODY:{Pn(this,t);break}case te.IN_TABLE:{fs(this,t);break}case te.IN_TABLE_TEXT:{Js(this,t);break}case te.IN_CAPTION:{RO(this,t);break}case te.IN_COLUMN_GROUP:{bp(this,t);break}case te.IN_TABLE_BODY:{Ec(this,t);break}case te.IN_ROW:{vc(this,t);break}case te.IN_CELL:{LO(this,t);break}case te.IN_SELECT:{lx(this,t);break}case te.IN_SELECT_IN_TABLE:{BO(this,t);break}case te.IN_TEMPLATE:{$O(this,t);break}case te.AFTER_BODY:{zO(this,t);break}case te.IN_FRAMESET:{UO(this,t);break}case te.AFTER_FRAMESET:{WO(this,t);break}case te.AFTER_AFTER_BODY:{YO(this,t);break}case te.AFTER_AFTER_FRAMESET:{KO(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?ZO(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case te.INITIAL:{Zs(this,t);break}case te.BEFORE_HTML:{M4(this,t);break}case te.BEFORE_HEAD:{R4(this,t);break}case te.IN_HEAD:{N4(this,t);break}case te.IN_HEAD_NO_SCRIPT:{L4(this,t);break}case te.AFTER_HEAD:{B4(this,t);break}case te.IN_BODY:{Cc(this,t);break}case te.TEXT:{TO(this,t);break}case te.IN_TABLE:{Za(this,t);break}case te.IN_TABLE_TEXT:{Js(this,t);break}case te.IN_CAPTION:{NO(this,t);break}case te.IN_COLUMN_GROUP:{FO(this,t);break}case te.IN_TABLE_BODY:{yf(this,t);break}case te.IN_ROW:{ax(this,t);break}case te.IN_CELL:{_O(this,t);break}case te.IN_SELECT:{ux(this,t);break}case te.IN_SELECT_IN_TABLE:{jO(this,t);break}case te.IN_TEMPLATE:{HO(this,t);break}case te.AFTER_BODY:{dx(this,t);break}case te.IN_FRAMESET:{VO(this,t);break}case te.AFTER_FRAMESET:{qO(this,t);break}case te.AFTER_AFTER_BODY:{au(this,t);break}}}onEof(t){switch(this.insertionMode){case te.INITIAL:{Zs(this,t);break}case te.BEFORE_HTML:{Fa(this,t);break}case te.BEFORE_HEAD:{La(this,t);break}case te.IN_HEAD:{_a(this,t);break}case te.IN_HEAD_NO_SCRIPT:{Ba(this,t);break}case te.AFTER_HEAD:{ja(this,t);break}case te.IN_BODY:case te.IN_TABLE:case te.IN_CAPTION:case te.IN_COLUMN_GROUP:case te.IN_TABLE_BODY:case te.IN_ROW:case te.IN_CELL:case te.IN_SELECT:case te.IN_SELECT_IN_TABLE:{rx(this,t);break}case te.TEXT:{SO(this,t);break}case te.IN_TABLE_TEXT:{Js(this,t);break}case te.IN_TEMPLATE:{cx(this,t);break}case te.AFTER_BODY:case te.IN_FRAMESET:case te.AFTER_FRAMESET:case te.AFTER_AFTER_BODY:case te.AFTER_AFTER_FRAMESET:{gp(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===V.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 te.IN_HEAD:case te.IN_HEAD_NO_SCRIPT:case te.AFTER_HEAD:case te.TEXT:case te.IN_COLUMN_GROUP:case te.IN_SELECT:case te.IN_SELECT_IN_TABLE:case te.IN_FRAMESET:case te.AFTER_FRAMESET:{this._insertCharacters(t);break}case te.IN_BODY:case te.IN_CAPTION:case te.IN_CELL:case te.IN_TEMPLATE:case te.AFTER_BODY:case te.AFTER_AFTER_BODY:case te.AFTER_AFTER_FRAMESET:{Zy(this,t);break}case te.IN_TABLE:case te.IN_TABLE_BODY:case te.IN_ROW:{vd(this,t);break}case te.IN_TABLE_TEXT:{ox(this,t);break}}}}function E4(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):nx(e,t),n}function v4(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 T4(e,t,n){let r=t,o=e.openElements.getCommonAncestor(t);for(let i=0,s=o;s!==n;i++,s=o){o=e.openElements.getCommonAncestor(s);const a=e.activeFormattingElements.getElementEntry(s),l=a&&i>=x4;!a||l?(l&&e.activeFormattingElements.removeEntry(a),e.openElements.remove(s)):(s=S4(e,a),r===t&&(e.activeFormattingElements.bookmark=a),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(s,r),r=s)}return r}function S4(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 k4(e,t,n){const r=e.treeAdapter.getTagName(t),o=ws(r);if(e._isElementCausesFosterParenting(o))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);o===E.TEMPLATE&&i===Me.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function w4(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 mp(e,t){for(let n=0;n<y4;n++){const r=E4(e,t);if(!r)break;const o=v4(e,r);if(!o)break;e.activeFormattingElements.bookmark=r;const i=T4(e,o,r.element),s=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(i),s&&k4(e,s,i),w4(e,o,r)}}function bf(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function D4(e,t){e._appendCommentNode(t,e.openElements.items[0])}function I4(e,t){e._appendCommentNode(t,e.document)}function gp(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],o=e.treeAdapter.getNodeSourceCodeLocation(r);if(o&&!o.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const i=e.openElements.items[1],s=e.treeAdapter.getNodeSourceCodeLocation(i);s&&!s.endTag&&e._setEndLocation(i,t)}}}}function A4(e,t){e._setDocumentType(t);const n=t.forceQuirks?gr.QUIRKS:i4(t);o4(t)||e._err(t,ve.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=te.BEFORE_HTML}function Zs(e,t){e._err(t,ve.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,gr.QUIRKS),e.insertionMode=te.BEFORE_HTML,e._processToken(t)}function O4(e,t){t.tagID===E.HTML?(e._insertElement(t,Me.HTML),e.insertionMode=te.BEFORE_HEAD):Fa(e,t)}function M4(e,t){const n=t.tagID;(n===E.HTML||n===E.HEAD||n===E.BODY||n===E.BR)&&Fa(e,t)}function Fa(e,t){e._insertFakeRootElement(),e.insertionMode=te.BEFORE_HEAD,e._processToken(t)}function P4(e,t){switch(t.tagID){case E.HTML:{Pn(e,t);break}case E.HEAD:{e._insertElement(t,Me.HTML),e.headElement=e.openElements.current,e.insertionMode=te.IN_HEAD;break}default:La(e,t)}}function R4(e,t){const n=t.tagID;n===E.HEAD||n===E.BODY||n===E.HTML||n===E.BR?La(e,t):e._err(t,ve.endTagWithoutMatchingOpenElement)}function La(e,t){e._insertFakeElement(he.HEAD,E.HEAD),e.headElement=e.openElements.current,e.insertionMode=te.IN_HEAD,e._processToken(t)}function Br(e,t){switch(t.tagID){case E.HTML:{Pn(e,t);break}case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:{e._appendElement(t,Me.HTML),t.ackSelfClosing=!0;break}case E.TITLE:{e._switchToTextParsing(t,un.RCDATA);break}case E.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,un.RAWTEXT):(e._insertElement(t,Me.HTML),e.insertionMode=te.IN_HEAD_NO_SCRIPT);break}case E.NOFRAMES:case E.STYLE:{e._switchToTextParsing(t,un.RAWTEXT);break}case E.SCRIPT:{e._switchToTextParsing(t,un.SCRIPT_DATA);break}case E.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=te.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(te.IN_TEMPLATE);break}case E.HEAD:{e._err(t,ve.misplacedStartTagForHeadElement);break}default:_a(e,t)}}function N4(e,t){switch(t.tagID){case E.HEAD:{e.openElements.pop(),e.insertionMode=te.AFTER_HEAD;break}case E.BODY:case E.BR:case E.HTML:{_a(e,t);break}case E.TEMPLATE:{xi(e,t);break}default:e._err(t,ve.endTagWithoutMatchingOpenElement)}}function xi(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==E.TEMPLATE&&e._err(t,ve.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(E.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ve.endTagWithoutMatchingOpenElement)}function _a(e,t){e.openElements.pop(),e.insertionMode=te.AFTER_HEAD,e._processToken(t)}function F4(e,t){switch(t.tagID){case E.HTML:{Pn(e,t);break}case E.BASEFONT:case E.BGSOUND:case E.HEAD:case E.LINK:case E.META:case E.NOFRAMES:case E.STYLE:{Br(e,t);break}case E.NOSCRIPT:{e._err(t,ve.nestedNoscriptInHead);break}default:Ba(e,t)}}function L4(e,t){switch(t.tagID){case E.NOSCRIPT:{e.openElements.pop(),e.insertionMode=te.IN_HEAD;break}case E.BR:{Ba(e,t);break}default:e._err(t,ve.endTagWithoutMatchingOpenElement)}}function Ba(e,t){const n=t.type===xt.EOF?ve.openElementsLeftAfterEof:ve.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=te.IN_HEAD,e._processToken(t)}function _4(e,t){switch(t.tagID){case E.HTML:{Pn(e,t);break}case E.BODY:{e._insertElement(t,Me.HTML),e.framesetOk=!1,e.insertionMode=te.IN_BODY;break}case E.FRAMESET:{e._insertElement(t,Me.HTML),e.insertionMode=te.IN_FRAMESET;break}case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:case E.NOFRAMES:case E.SCRIPT:case E.STYLE:case E.TEMPLATE:case E.TITLE:{e._err(t,ve.abandonedHeadElementChild),e.openElements.push(e.headElement,E.HEAD),Br(e,t),e.openElements.remove(e.headElement);break}case E.HEAD:{e._err(t,ve.misplacedStartTagForHeadElement);break}default:ja(e,t)}}function B4(e,t){switch(t.tagID){case E.BODY:case E.HTML:case E.BR:{ja(e,t);break}case E.TEMPLATE:{xi(e,t);break}default:e._err(t,ve.endTagWithoutMatchingOpenElement)}}function ja(e,t){e._insertFakeElement(he.BODY,E.BODY),e.insertionMode=te.IN_BODY,xc(e,t)}function xc(e,t){switch(t.type){case xt.CHARACTER:{Jy(e,t);break}case xt.WHITESPACE_CHARACTER:{Zy(e,t);break}case xt.COMMENT:{bf(e,t);break}case xt.START_TAG:{Pn(e,t);break}case xt.END_TAG:{Cc(e,t);break}case xt.EOF:{rx(e,t);break}}}function Zy(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Jy(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function j4(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function $4(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function H4(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Me.HTML),e.insertionMode=te.IN_FRAMESET)}function z4(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,Me.HTML)}function U4(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&gf.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Me.HTML)}function V4(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,Me.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function W4(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,Me.HTML),n||(e.formElement=e.openElements.current))}function q4(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===E.LI&&o===E.LI||(n===E.DD||n===E.DT)&&(o===E.DD||o===E.DT)){e.openElements.generateImpliedEndTagsWithExclusion(o),e.openElements.popUntilTagNamePopped(o);break}if(o!==E.ADDRESS&&o!==E.DIV&&o!==E.P&&e._isSpecialElement(e.openElements.items[r],o))break}e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,Me.HTML)}function Y4(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,Me.HTML),e.tokenizer.state=un.PLAINTEXT}function K4(e,t){e.openElements.hasInScope(E.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.framesetOk=!1}function G4(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(he.A);n&&(mp(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Q4(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function X4(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(E.NOBR)&&(mp(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Z4(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function J4(e,t){e.treeAdapter.getDocumentMode(e.document)!==gr.QUIRKS&&e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,Me.HTML),e.framesetOk=!1,e.insertionMode=te.IN_TABLE}function ex(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Me.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function tx(e){const t=Uy(e,si.TYPE);return t!=null&&t.toLowerCase()===b4}function eO(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Me.HTML),tx(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function tO(e,t){e._appendElement(t,Me.HTML),t.ackSelfClosing=!0}function nO(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._appendElement(t,Me.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function rO(e,t){t.tagName=he.IMG,t.tagID=E.IMG,ex(e,t)}function oO(e,t){e._insertElement(t,Me.HTML),e.skipNextNewLine=!0,e.tokenizer.state=un.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=te.TEXT}function iO(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,un.RAWTEXT)}function sO(e,t){e.framesetOk=!1,e._switchToTextParsing(t,un.RAWTEXT)}function B0(e,t){e._switchToTextParsing(t,un.RAWTEXT)}function aO(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===te.IN_TABLE||e.insertionMode===te.IN_CAPTION||e.insertionMode===te.IN_TABLE_BODY||e.insertionMode===te.IN_ROW||e.insertionMode===te.IN_CELL?te.IN_SELECT_IN_TABLE:te.IN_SELECT}function lO(e,t){e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML)}function uO(e,t){e.openElements.hasInScope(E.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Me.HTML)}function cO(e,t){e.openElements.hasInScope(E.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(E.RTC),e._insertElement(t,Me.HTML)}function dO(e,t){e._reconstructActiveFormattingElements(),Gy(t),hp(t),t.selfClosing?e._appendElement(t,Me.MATHML):e._insertElement(t,Me.MATHML),t.ackSelfClosing=!0}function fO(e,t){e._reconstructActiveFormattingElements(),Qy(t),hp(t),t.selfClosing?e._appendElement(t,Me.SVG):e._insertElement(t,Me.SVG),t.ackSelfClosing=!0}function j0(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML)}function Pn(e,t){switch(t.tagID){case E.I:case E.S:case E.B:case E.U:case E.EM:case E.TT:case E.BIG:case E.CODE:case E.FONT:case E.SMALL:case E.STRIKE:case E.STRONG:{Q4(e,t);break}case E.A:{G4(e,t);break}case E.H1:case E.H2:case E.H3:case E.H4:case E.H5:case E.H6:{U4(e,t);break}case E.P:case E.DL:case E.OL:case E.UL:case E.DIV:case E.DIR:case E.NAV:case E.MAIN:case E.MENU:case E.ASIDE:case E.CENTER:case E.FIGURE:case E.FOOTER:case E.HEADER:case E.HGROUP:case E.DIALOG:case E.DETAILS:case E.ADDRESS:case E.ARTICLE:case E.SEARCH:case E.SECTION:case E.SUMMARY:case E.FIELDSET:case E.BLOCKQUOTE:case E.FIGCAPTION:{z4(e,t);break}case E.LI:case E.DD:case E.DT:{q4(e,t);break}case E.BR:case E.IMG:case E.WBR:case E.AREA:case E.EMBED:case E.KEYGEN:{ex(e,t);break}case E.HR:{nO(e,t);break}case E.RB:case E.RTC:{uO(e,t);break}case E.RT:case E.RP:{cO(e,t);break}case E.PRE:case E.LISTING:{V4(e,t);break}case E.XMP:{iO(e,t);break}case E.SVG:{fO(e,t);break}case E.HTML:{j4(e,t);break}case E.BASE:case E.LINK:case E.META:case E.STYLE:case E.TITLE:case E.SCRIPT:case E.BGSOUND:case E.BASEFONT:case E.TEMPLATE:{Br(e,t);break}case E.BODY:{$4(e,t);break}case E.FORM:{W4(e,t);break}case E.NOBR:{X4(e,t);break}case E.MATH:{dO(e,t);break}case E.TABLE:{J4(e,t);break}case E.INPUT:{eO(e,t);break}case E.PARAM:case E.TRACK:case E.SOURCE:{tO(e,t);break}case E.IMAGE:{rO(e,t);break}case E.BUTTON:{K4(e,t);break}case E.APPLET:case E.OBJECT:case E.MARQUEE:{Z4(e,t);break}case E.IFRAME:{sO(e,t);break}case E.SELECT:{aO(e,t);break}case E.OPTION:case E.OPTGROUP:{lO(e,t);break}case E.NOEMBED:case E.NOFRAMES:{B0(e,t);break}case E.FRAMESET:{H4(e,t);break}case E.TEXTAREA:{oO(e,t);break}case E.NOSCRIPT:{e.options.scriptingEnabled?B0(e,t):j0(e,t);break}case E.PLAINTEXT:{Y4(e,t);break}case E.COL:case E.TH:case E.TD:case E.TR:case E.HEAD:case E.FRAME:case E.TBODY:case E.TFOOT:case E.THEAD:case E.CAPTION:case E.COLGROUP:break;default:j0(e,t)}}function pO(e,t){if(e.openElements.hasInScope(E.BODY)&&(e.insertionMode=te.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function hO(e,t){e.openElements.hasInScope(E.BODY)&&(e.insertionMode=te.AFTER_BODY,dx(e,t))}function mO(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function gO(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(E.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(E.FORM):n&&e.openElements.remove(n))}function bO(e){e.openElements.hasInButtonScope(E.P)||e._insertFakeElement(he.P,E.P),e._closePElement()}function yO(e){e.openElements.hasInListItemScope(E.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(E.LI),e.openElements.popUntilTagNamePopped(E.LI))}function xO(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function CO(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function EO(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function vO(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(he.BR,E.BR),e.openElements.pop(),e.framesetOk=!1}function nx(e,t){const n=t.tagName,r=t.tagID;for(let o=e.openElements.stackTop;o>0;o--){const i=e.openElements.items[o],s=e.openElements.tagIDs[o];if(r===s&&(r!==E.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=o&&e.openElements.shortenToLength(o);break}if(e._isSpecialElement(i,s))break}}function Cc(e,t){switch(t.tagID){case E.A:case E.B:case E.I:case E.S:case E.U:case E.EM:case E.TT:case E.BIG:case E.CODE:case E.FONT:case E.NOBR:case E.SMALL:case E.STRIKE:case E.STRONG:{mp(e,t);break}case E.P:{bO(e);break}case E.DL:case E.UL:case E.OL:case E.DIR:case E.DIV:case E.NAV:case E.PRE:case E.MAIN:case E.MENU:case E.ASIDE:case E.BUTTON:case E.CENTER:case E.FIGURE:case E.FOOTER:case E.HEADER:case E.HGROUP:case E.DIALOG:case E.ADDRESS:case E.ARTICLE:case E.DETAILS:case E.SEARCH:case E.SECTION:case E.SUMMARY:case E.LISTING:case E.FIELDSET:case E.BLOCKQUOTE:case E.FIGCAPTION:{mO(e,t);break}case E.LI:{yO(e);break}case E.DD:case E.DT:{xO(e,t);break}case E.H1:case E.H2:case E.H3:case E.H4:case E.H5:case E.H6:{CO(e);break}case E.BR:{vO(e);break}case E.BODY:{pO(e,t);break}case E.HTML:{hO(e,t);break}case E.FORM:{gO(e);break}case E.APPLET:case E.OBJECT:case E.MARQUEE:{EO(e,t);break}case E.TEMPLATE:{xi(e,t);break}default:nx(e,t)}}function rx(e,t){e.tmplInsertionModeStack.length>0?cx(e,t):gp(e,t)}function TO(e,t){var n;t.tagID===E.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function SO(e,t){e._err(t,ve.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function vd(e,t){if(e.openElements.currentTagId!==void 0&&Xy.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=te.IN_TABLE_TEXT,t.type){case xt.CHARACTER:{ix(e,t);break}case xt.WHITESPACE_CHARACTER:{ox(e,t);break}}else yl(e,t)}function kO(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Me.HTML),e.insertionMode=te.IN_CAPTION}function wO(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Me.HTML),e.insertionMode=te.IN_COLUMN_GROUP}function DO(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(he.COLGROUP,E.COLGROUP),e.insertionMode=te.IN_COLUMN_GROUP,bp(e,t)}function IO(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Me.HTML),e.insertionMode=te.IN_TABLE_BODY}function AO(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(he.TBODY,E.TBODY),e.insertionMode=te.IN_TABLE_BODY,Ec(e,t)}function OO(e,t){e.openElements.hasInTableScope(E.TABLE)&&(e.openElements.popUntilTagNamePopped(E.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function MO(e,t){tx(t)?e._appendElement(t,Me.HTML):yl(e,t),t.ackSelfClosing=!0}function PO(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Me.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function fs(e,t){switch(t.tagID){case E.TD:case E.TH:case E.TR:{AO(e,t);break}case E.STYLE:case E.SCRIPT:case E.TEMPLATE:{Br(e,t);break}case E.COL:{DO(e,t);break}case E.FORM:{PO(e,t);break}case E.TABLE:{OO(e,t);break}case E.TBODY:case E.TFOOT:case E.THEAD:{IO(e,t);break}case E.INPUT:{MO(e,t);break}case E.CAPTION:{kO(e,t);break}case E.COLGROUP:{wO(e,t);break}default:yl(e,t)}}function Za(e,t){switch(t.tagID){case E.TABLE:{e.openElements.hasInTableScope(E.TABLE)&&(e.openElements.popUntilTagNamePopped(E.TABLE),e._resetInsertionMode());break}case E.TEMPLATE:{xi(e,t);break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TBODY:case E.TD:case E.TFOOT:case E.TH:case E.THEAD:case E.TR:break;default:yl(e,t)}}function yl(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,xc(e,t),e.fosterParentingEnabled=n}function ox(e,t){e.pendingCharacterTokens.push(t)}function ix(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Js(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)yl(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const sx=new Set([E.CAPTION,E.COL,E.COLGROUP,E.TBODY,E.TD,E.TFOOT,E.TH,E.THEAD,E.TR]);function RO(e,t){const n=t.tagID;sx.has(n)?e.openElements.hasInTableScope(E.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=te.IN_TABLE,fs(e,t)):Pn(e,t)}function NO(e,t){const n=t.tagID;switch(n){case E.CAPTION:case E.TABLE:{e.openElements.hasInTableScope(E.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=te.IN_TABLE,n===E.TABLE&&Za(e,t));break}case E.BODY:case E.COL:case E.COLGROUP:case E.HTML:case E.TBODY:case E.TD:case E.TFOOT:case E.TH:case E.THEAD:case E.TR:break;default:Cc(e,t)}}function bp(e,t){switch(t.tagID){case E.HTML:{Pn(e,t);break}case E.COL:{e._appendElement(t,Me.HTML),t.ackSelfClosing=!0;break}case E.TEMPLATE:{Br(e,t);break}default:Lu(e,t)}}function FO(e,t){switch(t.tagID){case E.COLGROUP:{e.openElements.currentTagId===E.COLGROUP&&(e.openElements.pop(),e.insertionMode=te.IN_TABLE);break}case E.TEMPLATE:{xi(e,t);break}case E.COL:break;default:Lu(e,t)}}function Lu(e,t){e.openElements.currentTagId===E.COLGROUP&&(e.openElements.pop(),e.insertionMode=te.IN_TABLE,e._processToken(t))}function Ec(e,t){switch(t.tagID){case E.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Me.HTML),e.insertionMode=te.IN_ROW;break}case E.TH:case E.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(he.TR,E.TR),e.insertionMode=te.IN_ROW,vc(e,t);break}case E.CAPTION:case E.COL:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE,fs(e,t));break}default:fs(e,t)}}function yf(e,t){const n=t.tagID;switch(t.tagID){case E.TBODY:case E.TFOOT:case E.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE);break}case E.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE,Za(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TD:case E.TH:case E.TR:break;default:Za(e,t)}}function vc(e,t){switch(t.tagID){case E.TH:case E.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Me.HTML),e.insertionMode=te.IN_CELL,e.activeFormattingElements.insertMarker();break}case E.CAPTION:case E.COL:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:case E.TR:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE_BODY,Ec(e,t));break}default:fs(e,t)}}function ax(e,t){switch(t.tagID){case E.TR:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE_BODY);break}case E.TABLE:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE_BODY,yf(e,t));break}case E.TBODY:case E.TFOOT:case E.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(E.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE_BODY,yf(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TD:case E.TH:break;default:Za(e,t)}}function LO(e,t){const n=t.tagID;sx.has(n)?(e.openElements.hasInTableScope(E.TD)||e.openElements.hasInTableScope(E.TH))&&(e._closeTableCell(),vc(e,t)):Pn(e,t)}function _O(e,t){const n=t.tagID;switch(n){case E.TD:case E.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=te.IN_ROW);break}case E.TABLE:case E.TBODY:case E.TFOOT:case E.THEAD:case E.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),ax(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:break;default:Cc(e,t)}}function lx(e,t){switch(t.tagID){case E.HTML:{Pn(e,t);break}case E.OPTION:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e._insertElement(t,Me.HTML);break}case E.OPTGROUP:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Me.HTML);break}case E.HR:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Me.HTML),t.ackSelfClosing=!0;break}case E.INPUT:case E.KEYGEN:case E.TEXTAREA:case E.SELECT:{e.openElements.hasInSelectScope(E.SELECT)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),t.tagID!==E.SELECT&&e._processStartTag(t));break}case E.SCRIPT:case E.TEMPLATE:{Br(e,t);break}}}function ux(e,t){switch(t.tagID){case E.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===E.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===E.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop();break}case E.OPTION:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop();break}case E.SELECT:{e.openElements.hasInSelectScope(E.SELECT)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode());break}case E.TEMPLATE:{xi(e,t);break}}}function BO(e,t){const n=t.tagID;n===E.CAPTION||n===E.TABLE||n===E.TBODY||n===E.TFOOT||n===E.THEAD||n===E.TR||n===E.TD||n===E.TH?(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),e._processStartTag(t)):lx(e,t)}function jO(e,t){const n=t.tagID;n===E.CAPTION||n===E.TABLE||n===E.TBODY||n===E.TFOOT||n===E.THEAD||n===E.TR||n===E.TD||n===E.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),e.onEndTag(t)):ux(e,t)}function $O(e,t){switch(t.tagID){case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:case E.NOFRAMES:case E.SCRIPT:case E.STYLE:case E.TEMPLATE:case E.TITLE:{Br(e,t);break}case E.CAPTION:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:{e.tmplInsertionModeStack[0]=te.IN_TABLE,e.insertionMode=te.IN_TABLE,fs(e,t);break}case E.COL:{e.tmplInsertionModeStack[0]=te.IN_COLUMN_GROUP,e.insertionMode=te.IN_COLUMN_GROUP,bp(e,t);break}case E.TR:{e.tmplInsertionModeStack[0]=te.IN_TABLE_BODY,e.insertionMode=te.IN_TABLE_BODY,Ec(e,t);break}case E.TD:case E.TH:{e.tmplInsertionModeStack[0]=te.IN_ROW,e.insertionMode=te.IN_ROW,vc(e,t);break}default:e.tmplInsertionModeStack[0]=te.IN_BODY,e.insertionMode=te.IN_BODY,Pn(e,t)}}function HO(e,t){t.tagID===E.TEMPLATE&&xi(e,t)}function cx(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(E.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):gp(e,t)}function zO(e,t){t.tagID===E.HTML?Pn(e,t):_u(e,t)}function dx(e,t){var n;if(t.tagID===E.HTML){if(e.fragmentContext||(e.insertionMode=te.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===E.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 _u(e,t)}function _u(e,t){e.insertionMode=te.IN_BODY,xc(e,t)}function UO(e,t){switch(t.tagID){case E.HTML:{Pn(e,t);break}case E.FRAMESET:{e._insertElement(t,Me.HTML);break}case E.FRAME:{e._appendElement(t,Me.HTML),t.ackSelfClosing=!0;break}case E.NOFRAMES:{Br(e,t);break}}}function VO(e,t){t.tagID===E.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==E.FRAMESET&&(e.insertionMode=te.AFTER_FRAMESET))}function WO(e,t){switch(t.tagID){case E.HTML:{Pn(e,t);break}case E.NOFRAMES:{Br(e,t);break}}}function qO(e,t){t.tagID===E.HTML&&(e.insertionMode=te.AFTER_AFTER_FRAMESET)}function YO(e,t){t.tagID===E.HTML?Pn(e,t):au(e,t)}function au(e,t){e.insertionMode=te.IN_BODY,xc(e,t)}function KO(e,t){switch(t.tagID){case E.HTML:{Pn(e,t);break}case E.NOFRAMES:{Br(e,t);break}}}function GO(e,t){t.chars=en,e._insertCharacters(t)}function QO(e,t){e._insertCharacters(t),e.framesetOk=!1}function fx(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Me.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function XO(e,t){if(f4(t))fx(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Me.MATHML?Gy(t):r===Me.SVG&&(p4(t),Qy(t)),hp(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function ZO(e,t){if(t.tagID===E.P||t.tagID===E.BR){fx(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)===Me.HTML){e._endTagOutsideForeignContent(t);break}const o=e.treeAdapter.getTagName(r);if(o.toLowerCase()===t.tagName){t.tagName=o,e.openElements.shortenToLength(n);break}}}he.AREA,he.BASE,he.BASEFONT,he.BGSOUND,he.BR,he.COL,he.EMBED,he.FRAME,he.HR,he.IMG,he.INPUT,he.KEYGEN,he.LINK,he.META,he.PARAM,he.SOURCE,he.TRACK,he.WBR;const JO=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,eM=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),$0={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function px(e,t){const n=cM(e),r=yc("type",{handlers:{root:tM,element:nM,text:rM,comment:mx,doctype:oM,raw:sM},unknown:aM}),o={parser:n?new _0($0):_0.getFragmentParser(void 0,$0),handle(a){r(a,o)},stitches:!1,options:t||{}};r(e,o),Ds(o,Jr());const i=n?o.parser.document:o.parser.getFragment(),s=n5(i,{file:o.options.file});return o.stitches&&Kn(s,"comment",function(a,l,u){const d=a;if(d.value.stitch&&u&&l!==void 0){const f=u.children;return f[l]=d.value.stitch,l}}),s.type==="root"&&s.children.length===1&&s.children[0].type===e.type?s.children[0]:s}function hx(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function tM(e,t){hx(e.children,t)}function nM(e,t){lM(e,t),hx(e.children,t),uM(e,t)}function rM(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:xt.CHARACTER,chars:e.value,location:xl(e)};Ds(t,Jr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function oM(e,t){const n={type:xt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:xl(e)};Ds(t,Jr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function iM(e,t){t.stitches=!0;const n=dM(e);if("children"in e&&"children"in n){const r=px({type:"root",children:e.children},t.options);n.children=r.children}mx({type:"comment",value:{stitch:n}},t)}function mx(e,t){const n=e.value,r={type:xt.COMMENT,data:n,location:xl(e)};Ds(t,Jr(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function sM(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,gx(t,Jr(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(JO,"<$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 aM(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))iM(n,t);else{let r="";throw eM.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 Ds(e,t){gx(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=un.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 gx(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 lM(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===un.PLAINTEXT)return;Ds(t,Jr(e));const r=t.parser.openElements.current;let o="namespaceURI"in r?r.namespaceURI:ri.html;o===ri.html&&n==="svg"&&(o=ri.svg);const i=b5({...e,children:[]},{space:o===ri.svg?"svg":"html"}),s={type:xt.START_TAG,tagName:n,tagID:ws(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:xl(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function uM(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&jy.includes(n)||t.parser.tokenizer.state===un.PLAINTEXT)return;Ds(t,fc(e));const r={type:xt.END_TAG,tagName:n,tagID:ws(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:xl(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===un.RCDATA||t.parser.tokenizer.state===un.RAWTEXT||t.parser.tokenizer.state===un.SCRIPT_DATA)&&(t.parser.tokenizer.state=un.DATA)}function cM(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function xl(e){const t=Jr(e)||{line:void 0,column:void 0,offset:void 0},n=fc(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 dM(e){return"children"in e?di({...e,children:[]}):di(e)}function fM(e){return function(t,n){return px(t,{...e,file:n})}}const pM=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i,hM=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i,mM=({legacyTitle:e=!1,tagName:t="div"}={})=>n=>{Kn(n,"blockquote",(r,o,i)=>{let s="",a="",l=!0,u=r.children.map(d=>{if(l&&d.type==="paragraph"){const f=d.children[0],h=f.type==="text"?f.value:"",p=e?hM:pM,m=h.match(p);if(m&&(l=!1,s=m[1].toLocaleLowerCase(),a=e&&m[2]||s.toLocaleUpperCase(),h.includes(`
|
|
51
|
+
`)&&(d.children[0]={type:"text",value:h.replace(p,"").replace(/^\n+/,"")}),!h.includes(`
|
|
52
|
+
`))){const b=[];d.children.forEach((y,x)=>{x!=0&&(x==1&&y.type==="break"||b.push(y))}),d.children=[...b]}}return d});s&&(r.data={hName:t,hProperties:{class:`markdown-alert markdown-alert-${s}`,dir:"auto"}},u.unshift({type:"paragraph",children:[gM(s),{type:"text",value:a.replace(/^\//,"")}],data:{hProperties:{class:"markdown-alert-title",dir:"auto"}}})),r.children=[...u]})};function gM(e){let t=bM[e]??"";return{type:"emphasis",data:{hName:"svg",hProperties:{class:"octicon",viewBox:"0 0 16 16",width:"16",height:"16",ariaHidden:"true"}},children:[{type:"emphasis",data:{hName:"path",hProperties:{d:t}},children:[]}]}}const bM={note:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z",tip:"M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z",important:"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",warning:"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",caution:"M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"};function yM(e,t){if(typeof document>"u")return;const n=document.createElement("textarea");n.value=e,n.setAttribute("readonly",""),n.style={position:"absolute",left:"-9999px"},document.body.appendChild(n);const r=document.getSelection().rangeCount>0?document.getSelection().getRangeAt(0):!1;n.select();let o=!1;try{o=!!document.execCommand("copy")}catch{o=!1}document.body.removeChild(n),r&&document.getSelection&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(r)),t&&t(o)}function bx(e){if(!e)return null;var t=e;return t.dataset.code&&t.classList.contains("copied")?t:t.parentElement?bx(t.parentElement):null}function xM(e){var t=n=>{var r=bx(n.target);r&&(r.classList.add("active"),yM(r.dataset.code,function(){setTimeout(()=>{r.classList.remove("active")},2e3)}))};W.useEffect(()=>{var n,r;return(n=e.current)==null||n.removeEventListener("click",t,!1),(r=e.current)==null||r.addEventListener("click",t,!1),()=>{var o;(o=e.current)==null||o.removeEventListener("click",t,!1)}},[e])}var CM=["prefixCls","className","source","style","disableCopy","skipHtml","onScroll","onMouseOver","pluginsFilter","rehypeRewrite","wrapperElement","warpperElement","urlTransform"],EM=e=>e;const vM=W.forwardRef((e,t)=>{var{prefixCls:n="wmde-markdown wmde-markdown-color",className:r,source:o,style:i,disableCopy:s=!1,skipHtml:a=!0,onScroll:l,onMouseOver:u,pluginsFilter:d,wrapperElement:f={},warpperElement:h={},urlTransform:p}=e,m=Ze(e,CM),b=W.useRef(null);W.useImperativeHandle(t,()=>Y({},e,{mdp:b}),[b,e]);var y=(n||"")+" "+(r||"");xM(b);var x=[...m.rehypePlugins||[]],C={allowElement:(I,T,N)=>m.allowElement?m.allowElement(I,T,N):/^[A-Za-z0-9]+$/.test(I.tagName)};a||x.push(fM);var v=[mM,...m.remarkPlugins||[],WA],S=Y({},h,f);return c.jsx("div",Y({ref:b,onScroll:l,onMouseOver:u},S,{className:y,style:i,children:c.jsx(FI,Y({},C,m,{skipHtml:!a,urlTransform:p||EM,rehypePlugins:d?d("rehype",x):x,remarkPlugins:d?d("remark",v):v,children:o||""}))}))});var lu={},xf={};function TM(e,t){for(var n=t,r=0;r<e.length;r++){var o=r===e.length-1,i=e.charAt(r),s=n[i]||(n[i]={chars:{}});o&&(s.self=e),n=s.chars}}function H0(e){if(e.length===0)return lu;for(var t={},n=0,r=e;n<r.length;n++){var o=r[n];TM(o,t)}return t}function SM(e){if(e.length===0)return xf;for(var t={},n=0,r=e;n<r.length;n++){var o=r[n];t[o]=!0}return t}var Yl={},z0={type:"String",optional:!0};function kM(e){var t={type:"NoArgument",optional:!1};function n(s){if(t.type&&t.type!==s&&t.type!=="NoArgument")throw new Error('Conflicting pseudo-class argument type: "'.concat(t.type,'" vs "').concat(s,'".'));t.type=s}for(var r=0,o=e;r<o.length;r++){var i=o[r];i==="NoArgument"&&(t.optional=!0),i==="Formula"&&n("Formula"),i==="FormulaOfSelector"&&(n("Formula"),t.ofSelector=!0),i==="String"&&n("String"),i==="Selector"&&n("Selector")}return t}function wM(e){for(var t={},n=0,r=Object.keys(e);n<r.length;n++){var o=r[n],i=e[o];if(i)for(var s=0,a=i;s<a.length;s++){var l=a[s];(t[l]||(t[l]=[])).push(o)}}return t}function U0(e){for(var t=wM(e),n={},r=0,o=Object.keys(t);r<o.length;r++){var i=o[r],s=t[i];s&&(n[i]=kM(s))}return n}var ps=function(){return ps=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},ps.apply(this,arguments)},DM={},Cf={wildcard:!0};function IM(e){return e?typeof e=="boolean"?Cf:e:DM}function AM(e,t){return function(n,r){return t(e(n),e(r))}}function OM(e){return function(t,n){var r=e(t,n);if(!r)throw new Error("Syntax definition cannot be null or undefined.");return r}}function V0(e,t){return function(n,r){return r===!0?e:t(n===!0?e:n,r)}}function qi(e){return function(t,n){if(!n||!t)return n;if(typeof n!="object"||n===null)throw new Error("Unexpected syntax definition extension type: ".concat(n,"."));for(var r=ps({},t),o=0,i=Object.entries(n);o<i.length;o++){var s=i[o],a=s[0],l=s[1];if(a!=="latest"){var u=e[a];r[a]=u(t[a],l)}}return r}}function lo(e,t){return t!==void 0?t:e}function Kl(e,t){return t?e?e.concat(t):t:e}function W0(e,t){if(!t)return e;if(!e)return t;for(var n=ps({},e),r=0,o=Object.entries(t);r<o.length;r++){var i=o[r],s=i[0],a=i[1];if(!a){delete n[s];continue}var l=e[s];if(!l){n[s]=a;continue}n[s]=l.concat(a)}return n}var ai=OM(qi({baseSyntax:lo,modules:Kl,tag:V0(Cf,qi({wildcard:lo})),ids:lo,classNames:lo,namespace:V0(Cf,qi({wildcard:lo})),combinators:Kl,attributes:qi({operators:Kl,caseSensitivityModifiers:Kl,unknownCaseSensitivityModifiers:lo}),pseudoClasses:qi({unknown:lo,definitions:W0}),pseudoElements:qi({unknown:lo,notation:lo,definitions:AM(function(e){return Array.isArray(e)?{NoArgument:e}:e},W0)})})),yx={tag:{},ids:!0,classNames:!0,combinators:[],pseudoElements:{unknown:"reject",notation:"singleColon",definitions:["first-letter","first-line"]},pseudoClasses:{unknown:"reject",definitions:{NoArgument:["link","visited","active"]}}},xx=ai(yx,{tag:{wildcard:!0},combinators:[">","+"],attributes:{unknownCaseSensitivityModifiers:"reject",operators:["=","~=","|="]},pseudoElements:{definitions:["before","after"]},pseudoClasses:{unknown:"reject",definitions:{NoArgument:["hover","focus","first-child"],String:["lang"]}}}),Ef=ai(xx,{namespace:{wildcard:!0},combinators:["~"],attributes:{operators:["^=","$=","*="]},pseudoElements:{notation:"both"},pseudoClasses:{definitions:{NoArgument:["root","last-child","first-of-type","last-of-type","only-child","only-of-type","empty","target","enabled","disabled","checked","indeterminate"],Formula:["nth-child","nth-last-child","nth-of-type","nth-last-of-type"],Selector:["not"]}}}),Cx=ai(Ef,{combinators:["||"],attributes:{caseSensitivityModifiers:["i","I","s","S"]},pseudoClasses:{definitions:{NoArgument:["any-link","local-link","target-within","scope","current","past","future","focus-within","focus-visible","read-write","read-only","placeholder-shown","default","valid","invalid","in-range","out-of-range","required","optional","blank","user-invalid","playing","paused","autofill","modal","fullscreen","picture-in-picture","defined","loading","popover-open"],Formula:["nth-col","nth-last-col"],String:["dir"],FormulaOfSelector:["nth-child","nth-last-child"],Selector:["current","is","where","has","state"]}},pseudoElements:{definitions:{NoArgument:["marker"]}}}),Bu={"css-position-1":{latest:!1,pseudoClasses:{definitions:{NoArgument:["static","relative","absolute"]}}},"css-position-2":{latest:!1,pseudoClasses:{definitions:{NoArgument:["static","relative","absolute","fixed"]}}},"css-position-3":{latest:!1,pseudoClasses:{definitions:{NoArgument:["sticky","fixed","absolute","relative","static"]}}},"css-position-4":{latest:!0,pseudoClasses:{definitions:{NoArgument:["sticky","fixed","absolute","relative","static","initial"]}}},"css-scoping-1":{latest:!0,pseudoClasses:{definitions:{NoArgument:["host","host-context"],Selector:["host","host-context"]}},pseudoElements:{definitions:{Selector:["slotted"]}}},"css-pseudo-4":{latest:!0,pseudoElements:{definitions:{NoArgument:["marker","selection","target-text","search-text","spelling-error","grammar-error","backdrop","file-selector-button","prefix","postfix","placeholder","details-content"],String:["highlight"]}}},"css-shadow-parts-1":{latest:!0,pseudoElements:{definitions:{String:["part"]}}}},Ex=ps(ps({},Cx),{modules:Object.entries(Bu).filter(function(e){var t=e[1].latest;return t}).map(function(e){var t=e[0];return t})}),MM=ai(Ex,{pseudoElements:{unknown:"accept"},pseudoClasses:{unknown:"accept"},attributes:{unknownCaseSensitivityModifiers:"accept"}}),vf={css1:yx,css2:xx,css3:Ef,"selectors-3":Ef,"selectors-4":Cx,latest:Ex,progressive:MM};function PM(){for(var e={pseudoClasses:{},pseudoElements:{}},t=["css1","css2","css3","selectors-3","selectors-4"],n=0,r=t;n<r.length;n++){var o=r[n],i=vf[o];if(i.pseudoClasses&&typeof i.pseudoClasses=="object"){var s=i.pseudoClasses.definitions;if(s)for(var a=0,l=Object.entries(s);a<l.length;a++)for(var u=l[a],d=u[1],f=0,h=d;f<h.length;f++){var p=h[f];e.pseudoClasses[p]||(e.pseudoClasses[p]=[]),e.pseudoClasses[p].includes(o)||e.pseudoClasses[p].push(o)}}if(i.pseudoElements&&typeof i.pseudoElements=="object"){var s=i.pseudoElements.definitions;if(s)if(Array.isArray(s))for(var m=0,b=s;m<b.length;m++){var y=b[m];e.pseudoElements[y]||(e.pseudoElements[y]=[]),e.pseudoElements[y].includes(o)||e.pseudoElements[y].push(o)}else for(var x=0,C=Object.values(s);x<C.length;x++)for(var d=C[x],v=0,S=d;v<S.length;v++){var I=S[v];e.pseudoElements[I]||(e.pseudoElements[I]=[]),e.pseudoElements[I].includes(o)||e.pseudoElements[I].push(o)}}}for(var T=0,N=Object.entries(Bu);T<N.length;T++){var O=N[T],F=O[0],B=O[1];if(B.pseudoClasses&&typeof B.pseudoClasses=="object"){var s=B.pseudoClasses.definitions;if(s)for(var j=0,D=Object.values(s);j<D.length;j++)for(var d=D[j],H=0,_=d;H<_.length;H++){var L=_[H];e.pseudoClasses[L]||(e.pseudoClasses[L]=[]),e.pseudoClasses[L].includes(F)||e.pseudoClasses[L].push(F)}}if(B.pseudoElements&&typeof B.pseudoElements=="object"){var s=B.pseudoElements.definitions;if(s)if(Array.isArray(s))for(var $=0,K=s;$<K.length;$++){var G=K[$];e.pseudoElements[G]||(e.pseudoElements[G]=[]),e.pseudoElements[G].includes(F)||e.pseudoElements[G].push(F)}else for(var q=0,R=Object.values(s);q<R.length;q++)for(var d=R[q],oe=0,se=d;oe<se.length;oe++){var z=se[oe];e.pseudoElements[z]||(e.pseudoElements[z]=[]),e.pseudoElements[z].includes(F)||e.pseudoElements[z].push(F)}}}return e}var q0=PM();function ea(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="-"||e==="_"||e==="\\"||e>=" "}function Y0(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="-"||e==="_"||e>=" "}function ta(e){return e>="a"&&e<="f"||e>="A"&&e<="F"||e>="0"&&e<="9"}var RM={" ":!0," ":!0,"\n":!0,"\r":!0,"\f":!0},NM={'"':!0,"'":!0},Td={0:!0,1:!0,2:!0,3:!0,4:!0,5:!0,6:!0,7:!0,8:!0,9:!0},FM=6,Sd="css-selector-parser parse error: ";function LM(e){e===void 0&&(e={});var t=e.syntax,n=t===void 0?"latest":t,r=e.substitutes,o=e.strict,i=o===void 0?!0:o,s=e.modules,a=typeof n=="object"?n:vf[n];if(a.baseSyntax&&(a=ai(vf[a.baseSyntax],a)),a.modules&&a.modules.length>0)for(var l=0,u=a.modules;l<u.length;l++){var d=u[l],f=Bu[d];f&&(a=ai(f,a))}if(s&&s.length>0)for(var h=0,p=s;h<p.length;h++){var m=p[h],f=Bu[m];f&&(a=ai(f,a))}var b=a.tag?[!0,!!IM(a.tag).wildcard]:[!1,!1],y=b[0],x=b[1],C=!!a.ids,v=!!a.classNames,S=!!a.namespace,I=a.namespace&&(a.namespace===!0||a.namespace.wildcard===!0);if(S&&!y)throw new Error("".concat(Sd,"Namespaces cannot be enabled while tags are disabled."));var T=!!r,N=a.combinators?H0(a.combinators):lu,O=a.attributes?[!0,a.attributes.operators?H0(a.attributes.operators):lu,a.attributes.caseSensitivityModifiers?SM(a.attributes.caseSensitivityModifiers):xf,a.attributes.unknownCaseSensitivityModifiers==="accept"]:[!1,lu,xf,!1],F=O[0],B=O[1],j=O[2],D=O[3],H=D||Object.keys(j).length>0,_=a.pseudoClasses?[!0,a.pseudoClasses.definitions?U0(a.pseudoClasses.definitions):Yl,a.pseudoClasses.unknown==="accept"]:[!1,Yl,!1],L=_[0],$=_[1],K=_[2],G=a.pseudoElements?[!0,a.pseudoElements.notation==="singleColon"||a.pseudoElements.notation==="both",!a.pseudoElements.notation||a.pseudoElements.notation==="doubleColon"||a.pseudoElements.notation==="both",a.pseudoElements.definitions?U0(Array.isArray(a.pseudoElements.definitions)?{NoArgument:a.pseudoElements.definitions}:a.pseudoElements.definitions):Yl,a.pseudoElements.unknown==="accept"]:[!1,!1,!1,Yl,!1],q=G[0],R=G[1],oe=G[2],se=G[3],z=G[4],pe="",J=pe.length,Q=0,re="",ne=function(be){return re===be},ae=function(){return ne("*")||ea(re)},ie=function(be){Q=be,re=pe.charAt(Q)},Z=function(){Q++,re=pe.charAt(Q)},me=function(){var be=re;return Q++,re=pe.charAt(Q),be};function le(be){var Ae=Math.min(J-1,Q),Oe=new Error("".concat(Sd).concat(be," Pos: ").concat(Ae,"."));throw Oe.position=Ae,Oe.name="ParserError",Oe}function ue(be,Ae){if(!be)return le(Ae)}var Ie=function(){ue(Q<J,"Unexpected end of input.")},Ce=function(){return Q>=J},we=function(be){ue(Q<J,'Expected "'.concat(be,'" but end of input reached.')),ue(re===be,'Expected "'.concat(be,'" but "').concat(re,'" found.')),Q++,re=pe.charAt(Q)};function ye(be){var Ae=ze(be,Q);if(Ae)return Q+=Ae.length,re=pe.charAt(Q),Ae}function ze(be,Ae){var Oe=pe.charAt(Ae),Qe=be[Oe];if(Qe){var st=ze(Qe.chars,Ae+1);if(st)return st;if(Qe.self)return Qe.self}}function Ne(){for(var be=me(),Ae=1;ta(re)&&Ae<FM;)be+=me(),Ae++;return yt(),String.fromCharCode(parseInt(be,16))}function nt(be){var Ae="";for(we(be);Q<J;){if(ne(be))return Z(),Ae;ne("\\")?(Z(),ne(be)?(Ae+=be,Z()):re===`
|
|
53
|
+
`||re==="\f"?Z():re==="\r"?(Z(),ne(`
|
|
54
|
+
`)&&Z()):ta(re)?Ae+=Ne():(Ae+=re,Z())):(Ae+=re,Z())}return Ae}function _e(){if(!ea(re))return null;for(var be="";ne("-");)be+=re,Z();for(be==="-"&&!Y0(re)&&!ne("\\")&&le("Identifiers cannot consist of a single hyphen."),i&&be.length>=2&&le("Identifiers cannot start with two hyphens with strict mode on."),Td[re]&&le("Identifiers cannot start with hyphens followed by digits.");Q<J;)if(Y0(re))be+=me();else if(ne("\\"))Z(),Ie(),ta(re)?be+=Ne():be+=me();else break;return be}function Bt(){for(var be="";Q<J&&!ne(")");)if(ne("\\")){if(Z(),Ce()&&!i)return(be+"\\").trim();Ie(),ta(re)?be+=Ne():be+=me()}else be+=me();return be.trim()}function yt(){if(re===" "||re===" "||re==="\f"||re===`
|
|
55
|
+
`){Z();return}re==="\r"&&Z(),re===`
|
|
56
|
+
`&&Z()}function ot(){for(;RM[re];)Z()}function xe(be){be===void 0&&(be=!1),ot();for(var Ae=[Mt(be)];ne(",");)Z(),ot(),Ae.push(Mt(be));return{type:"Selector",rules:Ae}}function Pe(){we("["),ot();var be;if(ne("|")){ue(S,"Namespaces are not enabled."),Z();var Ae=_e();ue(Ae,"Expected attribute name."),be={type:"Attribute",name:Ae,namespace:{type:"NoNamespace"}}}else if(ne("*")){ue(S,"Namespaces are not enabled."),ue(I,"Wildcard namespace is not enabled."),Z(),we("|");var Oe=_e();ue(Oe,"Expected attribute name."),be={type:"Attribute",name:Oe,namespace:{type:"WildcardNamespace"}}}else{var Qe=_e();if(ue(Qe,"Expected attribute name."),be={type:"Attribute",name:Qe},ne("|")){var st=Q;if(Z(),ea(re)){ue(S,"Namespaces are not enabled.");var Nt=_e();ue(Nt,"Expected attribute name."),be={type:"Attribute",name:Nt,namespace:{type:"NamespaceName",name:Qe}}}else ie(st)}}if(ue(be.name,"Expected attribute name."),ot(),Ce()&&!i)return be;if(ne("]"))Z();else{if(be.operator=ye(B),ue(be.operator,"Expected a valid attribute selector operator."),ot(),Ie(),NM[re])be.value={type:"String",value:nt(re)};else if(T&&ne("$")){Z();var Gt=_e();ue(Gt,"Expected substitute name."),be.value={type:"Substitution",name:Gt}}else{var bt=_e();ue(bt,"Expected attribute value."),be.value={type:"String",value:bt}}if(ot(),Ce()&&!i)return be;if(!ne("]")){var sn=_e();if(ue(sn,"Expected end of attribute selector."),be.caseSensitivityModifier=sn,ue(H,"Attribute case sensitivity modifiers are not enabled."),ue(D||j[be.caseSensitivityModifier],"Unknown attribute case sensitivity modifier."),ot(),Ce()&&!i)return be}we("]")}return be}function qe(){for(var be="";Td[re];)be+=me();return ue(be!=="","Formula parse error."),parseInt(be)}var Je=function(){return ne("-")||ne("+")||Td[re]};function Xe(){if(ne("e")||ne("o")){var be=_e();if(be==="even")return ot(),[2,0];if(be==="odd")return ot(),[2,1]}var Ae=null,Oe=1;if(ne("-")&&(Z(),Oe=-1),Je()&&(ne("+")&&Z(),Ae=qe(),!ne("\\")&&!ne("n")))return[0,Ae*Oe];Ae===null&&(Ae=1),Ae*=Oe;var Qe;if(ne("\\")?(Z(),ta(re)?Qe=Ne():Qe=me()):Qe=me(),ue(Qe==="n",'Formula parse error: expected "n".'),ot(),ne("+")||ne("-")){var st=ne("+")?1:-1;return Z(),ot(),[Ae,st*qe()]}else return[Ae,0]}function Re(be,Ae,Oe){var Qe;if(ne("(")){if(Z(),ot(),T&&ne("$")){Z();var st=_e();ue(st,"Expected substitute name."),Qe={type:"Substitution",name:st}}else if(Oe.type==="String")Qe={type:"String",value:Bt()},ue(Qe.value,"Expected ".concat(Ae," argument value."));else if(Oe.type==="Selector")Qe=xe(!0);else if(Oe.type==="Formula"){var Nt=Xe(),Gt=Nt[0],bt=Nt[1];if(Qe={type:"Formula",a:Gt,b:bt},Oe.ofSelector&&(ot(),ne("o")||ne("\\"))){var sn=_e();ue(sn==="of","Formula of selector parse error."),ot(),Qe={type:"FormulaOfSelector",a:Gt,b:bt,selector:Mt()}}}else return le("Invalid ".concat(Ae," signature."));if(ot(),Ce()&&!i)return Qe;we(")")}else ue(Oe.optional,"Argument is required for ".concat(Ae,' "').concat(be,'".'));return Qe}function ct(){if(ne("*"))return ue(x,"Wildcard tag name is not enabled."),Z(),{type:"WildcardTag"};if(ea(re)){ue(y,"Tag names are not enabled.");var be=_e();return ue(be,"Expected tag name."),{type:"TagName",name:be}}else return le("Expected tag name.")}function lt(){if(ne("*")){var be=Q;if(Z(),!ne("|")||(Z(),!ae()))return ie(be),ct();ue(S,"Namespaces are not enabled."),ue(I,"Wildcard namespace is not enabled.");var Ae=ct();return Ae.namespace={type:"WildcardNamespace"},Ae}else if(ne("|")){ue(S,"Namespaces are not enabled."),Z();var Ae=ct();return Ae.namespace={type:"NoNamespace"},Ae}else if(ea(re)){var Oe=_e();if(ue(Oe,"Expected tag name."),!ne("|"))return ue(y,"Tag names are not enabled."),{type:"TagName",name:Oe};var be=Q;if(Z(),!ae())return ie(be),{type:"TagName",name:Oe};ue(S,"Namespaces are not enabled.");var Ae=ct();return Ae.namespace={type:"NamespaceName",name:Oe},Ae}else return le("Expected tag name.")}function Mt(be){var Ae,Oe;be===void 0&&(be=!1);var Qe={type:"Rule",items:[]};if(be){var st=ye(N);st&&(Qe.combinator=st,ot())}for(;Q<J;)if(ae())ue(Qe.items.length===0,"Unexpected tag/namespace start."),Qe.items.push(lt());else if(ne("|")){var Nt=Q;if(Z(),ae())ue(Qe.items.length===0,"Unexpected tag/namespace start."),ie(Nt),Qe.items.push(lt());else{ie(Nt);break}}else if(ne(".")){ue(v,"Class names are not enabled."),Z();var Gt=_e();ue(Gt,"Expected class name."),Qe.items.push({type:"ClassName",name:Gt})}else if(ne("#")){ue(C,"IDs are not enabled."),Z();var bt=_e();ue(bt,"Expected ID name."),Qe.items.push({type:"Id",name:bt})}else if(ne("["))ue(F,"Attributes are not enabled."),Qe.items.push(Pe());else if(ne(":")){var sn=!1,Rn=!1;Z(),ne(":")&&(ue(q,"Pseudo elements are not enabled."),ue(oe,"Pseudo elements double colon notation is not enabled."),sn=!0,Z());var jt=_e();if(ue(sn||jt,"Expected pseudo-class name."),ue(!sn||jt,"Expected pseudo-element name."),ue(jt,"Expected pseudo-class name."),!(!sn||z||Object.prototype.hasOwnProperty.call(se,jt))){var gn=q0.pseudoElements[jt],lr='Unknown pseudo-element "'.concat(jt,'"');gn&&gn.length>0&&(lr+=". It is defined in: ".concat(gn.join(", "))),le(lr+".")}if(Rn=q&&(sn||!sn&&R&&Object.prototype.hasOwnProperty.call(se,jt)),Rn){var Nn=(Ae=se[jt])!==null&&Ae!==void 0?Ae:z&&z0,jr={type:"PseudoElement",name:jt},Hn=Re(jt,"pseudo-element",Nn);Hn&&(ue(Hn.type!=="Formula"&&Hn.type!=="FormulaOfSelector","Pseudo-elements cannot have formula argument."),jr.argument=Hn),Qe.items.push(jr)}else{ue(L,"Pseudo-classes are not enabled.");var Nn=(Oe=$[jt])!==null&&Oe!==void 0?Oe:K&&z0;if(!Nn){var gn=q0.pseudoClasses[jt],lr='Unknown pseudo-class: "'.concat(jt,'"');gn&&gn.length>0&&(lr+=". It is defined in: ".concat(gn.join(", "))),le(lr+".")}var Hn=Re(jt,"pseudo-class",Nn),Pt={type:"PseudoClass",name:jt};Hn&&(Pt.argument=Hn),Qe.items.push(Pt)}}else break;if(Qe.items.length===0)return Ce()?le("Expected rule but end of input reached."):le('Expected rule but "'.concat(re,'" found.'));if(ot(),!Ce()&&!ne(",")&&!ne(")")){var st=ye(N);ot(),Qe.nestedRule=Mt(),Qe.nestedRule.combinator=st}return Qe}return function(be){if(typeof be!="string")throw new Error("".concat(Sd,"Expected string input."));return pe=be,J=pe.length,Q=0,re=pe.charAt(0),xe()}}const _M=LM({syntax:"selectors-4"});function BM(e){if(typeof e!="string")throw new TypeError("Expected `string` as selector, not `"+e+"`");return _M(e)}const vx="֑-߿יִ-﷽ﹰ-ﻼ",Tx="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",jM=new RegExp("^[^"+Tx+"]*["+vx+"]"),$M=new RegExp("^[^"+vx+"]*["+Tx+"]");function HM(e){const t=String(e||"");return jM.test(t)?"rtl":$M.test(t)?"ltr":"neutral"}function Sx(e){return"children"in e?kx(e):"value"in e?e.value:""}function zM(e){return e.type==="text"?e.value:"children"in e?kx(e):""}function kx(e){let t=-1;const n=[];for(;++t<e.children.length;)n[t]=zM(e.children[t]);return n.join("")}function UM(e,t){const n=e.schema,r=e.language,o=e.direction,i=e.editableOrEditingHost;let s;if(t.type==="element"){const u=t.properties.xmlLang||t.properties.lang,d=t.properties.type||"text",f=K0(t);u!=null&&(e.language=String(u)),n&&n.space==="html"?(t.properties.contentEditable==="true"&&(e.editableOrEditingHost=!0),t.tagName==="svg"&&(e.schema=_o),f==="rtl"?s=f:f==="ltr"||f!=="auto"&&t.tagName==="html"||f!=="auto"&&t.tagName==="input"&&d==="tel"?s="ltr":(f==="auto"||t.tagName==="bdi")&&(t.tagName==="textarea"?s=kd(Sx(t)):t.tagName==="input"&&(d==="email"||d==="search"||d==="tel"||d==="text")?s=t.properties.value?kd(String(t.properties.value)):"ltr":Kn(t,l)),s&&(e.direction=s)):e.editableOrEditingHost&&(e.editableOrEditingHost=!1)}return a;function a(){e.schema=n,e.language=r,e.direction=o,e.editableOrEditingHost=i}function l(u){if(u.type==="text")return s=kd(u.value),s?Ru:void 0;if(u!==t&&u.type==="element"&&(u.tagName==="bdi"||u.tagName==="script"||u.tagName==="style"||u.tagName==="textare"||K0(u)))return Na}}function kd(e){const t=HM(e);return t==="neutral"?void 0:t}function K0(e){const t=e.type==="element"&&typeof e.properties.dir=="string"?e.properties.dir.toLowerCase():void 0;return t==="auto"||t==="ltr"||t==="rtl"?t:void 0}function VM(e,t,n){const r=hl(n,e.name),o=t.properties[r.property];let i=WM(o,r);if(!e.value)return i!==void 0;e.value.type;let s=e.value.value;if(e.caseSensitivityModifier==="i"&&(s=s.toLowerCase(),i&&(i=i.toLowerCase())),i!==void 0)switch(e.operator){case"=":return s===i;case"$=":return s===i.slice(-s.length);case"*=":return i.includes(s);case"^=":return s===i.slice(0,s.length);case"|=":return s===i||s===i.slice(0,s.length)&&i.charAt(s.length)==="-";case"~=":return s===i||nf(i).includes(s)}return!1}function WM(e,t){if(e!=null)if(typeof e=="boolean"){if(e)return t.attribute}else if(Array.isArray(e)){if(e.length>0)return(t.commaSeparated?cc:dc)(e)}else return String(e)}const qM=[];function YM(e,t){return(t.properties.className||qM).includes(e.name)}function KM(e,t){return t.properties.id===e.name}function GM(e,t){return e.name===t.tagName}function QM(e,t){return function(n,r){let o=G0(n,"tag");const i=G0(r??"*","range"),s=[];let a=-1;for(;++a<i.length;){const l=i[a].toLowerCase();if(!t&&l==="*")continue;let u=-1;const d=[];for(;++u<o.length;)if(e(o[u].toLowerCase(),l)){if(!t)return o[u];s.push(o[u])}else d.push(o[u]);o=d}return t?s:void 0}}const XM=QM(function(e,t){const n=e.split("-"),r=t.split("-");let o=0,i=0;if(r[i]!=="*"&&n[o]!==r[i])return!1;for(o++,i++;i<r.length;){if(r[i]==="*"){i++;continue}if(!n[o])return!1;if(n[o]===r[i]){o++,i++;continue}if(n[o].length===1)return!1;o++}return!0},!0);function G0(e,t){const n=e&&typeof e=="string"?[e]:e;if(!n||typeof n!="object"||!("length"in n))throw new Error("Invalid "+t+" `"+n+"`, expected non-empty string");return n}const ZM={}.hasOwnProperty;function fi(e,t){const n=e.type==="element"&&ZM.call(e.properties,t)&&e.properties[t];return n!=null&&n!==!1}const JM=new Set([9,10,12,13,32]),Q0=48,eP=57;function tP(e){if(e=e.trim().toLowerCase(),e==="even")return[2,0];if(e==="odd")return[2,1];let t=0,n=0,r=i(),o=s();if(t<e.length&&e.charAt(t)==="n"&&(t++,n=r*(o??1),a(),t<e.length?(r=i(),a(),o=s()):r=o=0),o===null||t<e.length)throw new Error(`n-th rule couldn't be parsed ('${e}')`);return[n,r*o];function i(){return e.charAt(t)==="-"?(t++,-1):(e.charAt(t)==="+"&&t++,1)}function s(){const l=t;let u=0;for(;t<e.length&&e.charCodeAt(t)>=Q0&&e.charCodeAt(t)<=eP;)u=u*10+(e.charCodeAt(t)-Q0),t++;return t===l?null:u}function a(){for(;t<e.length&&JM.has(e.charCodeAt(t));)t++}}var wd,X0;function nP(){return X0||(X0=1,wd={trueFunc:function(){return!0},falseFunc:function(){return!1}}),wd}var rP=nP();const Z0=Tr(rP);function oP(e){const t=e[0],n=e[1]-1;if(n<0&&t<=0)return Z0.falseFunc;if(t===-1)return i=>i<=n;if(t===0)return i=>i===n;if(t===1)return n<0?Z0.trueFunc:i=>i>=n;const r=Math.abs(t),o=(n%r+r)%r;return t>1?i=>i>=n&&i%r===o:i=>i<=n&&i%r===o}function J0(e){return oP(tP(e))}const iP=J0.default||J0,sP=yc("name",{handlers:{"any-link":aP,blank:lP,checked:uP,dir:cP,disabled:wx,empty:dP,enabled:fP,"first-child":pP,"first-of-type":hP,has:mP,is:Dx,lang:bP,"last-child":yP,"last-of-type":xP,not:CP,"nth-child":EP,"nth-last-child":vP,"nth-last-of-type":TP,"nth-of-type":SP,"only-child":kP,"only-of-type":wP,optional:DP,"read-only":IP,"read-write":Ix,required:Ax,root:AP,scope:OP},invalid:gP,unknown:MP});function aP(e,t){return(t.tagName==="a"||t.tagName==="area"||t.tagName==="link")&&fi(t,"href")}function to(e,t){if(e.shallow)throw new Error("Cannot use `:"+t.name+"` without parent")}function lP(e,t){return!Ox(t,n);function n(r){return r.type==="element"||r.type==="text"&&!Gf(r)}}function uP(e,t){return t.tagName==="input"||t.tagName==="menuitem"?!!((t.properties.type==="checkbox"||t.properties.type==="radio")&&fi(t,"checked")):t.tagName==="option"?fi(t,"selected"):!1}function cP(e,t,n,r,o){return e.argument,e.argument.type,o.direction===e.argument.value}function wx(e,t){return(t.tagName==="button"||t.tagName==="input"||t.tagName==="select"||t.tagName==="textarea"||t.tagName==="optgroup"||t.tagName==="option"||t.tagName==="menuitem"||t.tagName==="fieldset")&&fi(t,"disabled")}function dP(e,t){return!Ox(t,n);function n(r){return r.type==="element"||r.type==="text"}}function fP(e,t){return!wx(e,t)}function pP(e,t,n,r,o){return to(o,e),o.elementIndex===0}function hP(e,t,n,r,o){return to(o,e),o.typeIndex===0}function Tc(e){let t=e._cachedFn;if(!t){const n=e.argument;if(n.type!=="Formula")throw new Error("Expected `nth` formula, such as `even` or `2n+1` (`of` is not yet supported)");t=iP(n.a+"n+"+n.b),e._cachedFn=t}return t}function mP(e,t,n,r,o){e.argument,e.argument.type;const i={...o,found:!1,one:!0,results:[],rootQuery:e.argument,scopeElements:[t],shallow:!1};return yp(i,{type:"root",children:t.children}),i.results.length>0}function gP(){}function Dx(e,t,n,r,o){e.argument,e.argument.type;const i={...o,found:!1,one:!0,results:[],rootQuery:e.argument,scopeElements:[t],shallow:!1};return yp(i,t),i.results[0]===t}function bP(e,t,n,r,o){return e.argument,e.argument.type,o.language!==""&&o.language!==void 0&&XM(o.language,Jd(e.argument.value)).length>0}function yP(e,t,n,r,o){return to(o,e),!!(o.elementCount&&o.elementIndex===o.elementCount-1)}function xP(e,t,n,r,o){return to(o,e),typeof o.typeIndex=="number"&&typeof o.typeCount=="number"&&o.typeIndex===o.typeCount-1}function CP(e,t,n,r,o){return!Dx(e,t,n,r,o)}function EP(e,t,n,r,o){const i=Tc(e);return to(o,e),typeof o.elementIndex=="number"&&i(o.elementIndex)}function vP(e,t,n,r,o){const i=Tc(e);return to(o,e),!!(typeof o.elementCount=="number"&&typeof o.elementIndex=="number"&&i(o.elementCount-o.elementIndex-1))}function TP(e,t,n,r,o){const i=Tc(e);return to(o,e),typeof o.typeCount=="number"&&typeof o.typeIndex=="number"&&i(o.typeCount-1-o.typeIndex)}function SP(e,t,n,r,o){const i=Tc(e);return to(o,e),typeof o.typeIndex=="number"&&i(o.typeIndex)}function kP(e,t,n,r,o){return to(o,e),o.elementCount===1}function wP(e,t,n,r,o){return to(o,e),o.typeCount===1}function DP(e,t){return!Ax(e,t)}function IP(e,t,n,r,o){return!Ix(e,t,n,r,o)}function Ix(e,t,n,r,o){return t.tagName==="input"||t.tagName==="textarea"?!fi(t,"readOnly")&&!fi(t,"disabled"):!!o.editableOrEditingHost}function Ax(e,t){return(t.tagName==="input"||t.tagName==="textarea"||t.tagName==="select")&&fi(t,"required")}function AP(e,t,n,r,o){return!!((!r||r.type==="root")&&o.schema&&(o.schema.space==="html"||o.schema.space==="svg")&&(t.tagName==="html"||t.tagName==="svg"))}function OP(e,t,n,r,o){return o.scopeElements.includes(t)}function Ox(e,t){const n=e.children;let r=-1;for(;++r<n.length;)if(t(n[r]))return!0;return!1}function MP(e){const t=e;throw new Error("Unknown pseudo-selector `"+t.name+"`")}function PP(e,t,n,r,o){for(const i of e.items)if(i.type==="Attribute"){if(!VM(i,t,o.schema))return!1}else if(i.type==="Id"){if(!KM(i,t))return!1}else if(i.type==="ClassName"){if(!YM(i,t))return!1}else if(i.type==="PseudoClass"){if(!sP(i,t,n,r,o))return!1}else{if(i.type==="PseudoElement")throw new Error("Invalid selector: `::"+i.name+"`");if(i.type==="TagName"&&!GM(i,t))return!1}return!0}const RP=[];function yp(e,t){t&&Mx(e,[],t,void 0,void 0,t)}function Dd(e,t,n){const r=e[t];r?r.push(n):e[t]=[n]}function NP(e,t,n,r){const o=uu(t.descendant,t.directChild);let i,s=-1;const a={count:0,types:new Map},l={count:0,types:new Map};for(;++s<n.children.length;)eg(a,n.children[s]);for(s=-1;++s<n.children.length;){const u=n.children[s],d=u.type==="element"?u.tagName.toUpperCase():void 0;if(e.elementIndex=l.count,e.typeIndex=d&&l.types.get(d)||0,e.elementCount=a.count,e.typeCount=d?a.types.get(d):0,"children"in u){const f=uu(o,i),h=Mx(e,f,n.children[s],s,n,r);i=uu(h.generalSibling,h.adjacentSibling)}if(e.one&&e.found)break;eg(l,n.children[s])}}function FP(e,t,n,r,o){const i={adjacentSibling:void 0,descendant:void 0,directChild:void 0,generalSibling:void 0};let s=-1;for(;++s<t.length;){const a=t[s];if(e.one&&e.found)break;if(e.shallow&&a.nestedRule)throw new Error("Expected selector without nesting");if(PP(a,n,r,o,e)){const l=a.nestedRule;if(l){const u=l.combinator==="+"?"adjacentSibling":l.combinator==="~"?"generalSibling":l.combinator===">"?"directChild":"descendant";Dd(i,u,l)}else e.found=!0,e.results.includes(n)||e.results.push(n)}a.combinator===void 0?Dd(i,"descendant",a):a.combinator==="~"&&Dd(i,"generalSibling",a)}return i}function uu(e,t){return e&&t&&e.length>0&&t.length>0?[...e,...t]:e&&e.length>0?e:t&&t.length>0?t:RP}function eg(e,t){if(t.type==="element"){const n=t.tagName.toUpperCase(),r=(e.types.get(n)||0)+1;e.count++,e.types.set(n,r)}}function Mx(e,t,n,r,o,i){let s={adjacentSibling:void 0,descendant:void 0,directChild:void 0,generalSibling:void 0};const a=UM(e,n);if(n.type==="element"){let l=e.rootQuery.rules;o&&o!==i&&(l=e.rootQuery.rules.filter(u=>u.combinator===void 0||u.combinator===">"&&o===i)),s=FP(e,uu(t,l),n,r,o)}return"children"in n&&!e.shallow&&!(e.one&&e.found)&&NP(e,s,n,i),a(),s}function LP(e,t,n){const r=_P(e,t);return yp(r,t||void 0),r.results}function _P(e,t,n){return{direction:"ltr",editableOrEditingHost:!1,elementCount:void 0,elementIndex:void 0,found:!1,language:void 0,one:!1,results:[],rootQuery:BM(e),schema:vs,scopeElements:t?t.type==="root"?t.children:[t]:[],shallow:!1,typeIndex:void 0,typeCount:void 0}}const Px=(e=[],t="")=>(e.forEach(n=>{n.type==="text"?t+=n.value:n.type==="element"&&n.children&&Array.isArray(n.children)&&(t+=Px(n.children))}),t),BP=e=>{const{selector:t,rewrite:n}=e||{};return r=>{if(!(!n||typeof n!="function")){if(t&&typeof t=="string"){const o=LP(t,r);o&&o.length>0&&Kn(r,o,(i,s,a)=>{n(i,s,a)});return}Kn(r,(o,i,s)=>{n(o,i,s)})}}},jP=(e="")=>(e.match(/([^?=&]+)(=([^&]*))/g)||[]).reduce((t,n)=>(t[n.slice(0,n.indexOf("="))]=n.slice(n.indexOf("=")+1),t),{}),$P=(e=[],t)=>{let n=t;for(;n>-1;){if(n--,!e[n])return;if(e[n]&&e[n].value&&e[n].value.replace(/(\n|\s)/g,"")!==""||e[n].type!=="text")return!/^rehype:/.test(e[n].value)||e[n].type!=="comment"?void 0:e[n]}},Rx=(e=[],t,n,r)=>{let o=t;for(;o<e.length;)if(o++,n){const i=e[o];if(i&&i.value&&i.value.replace(/(\n|\s)/g,"")!==""||e[o]&&e[o].type==="element")return i.tagName===n?i:void 0}else{const i=e[o];if(!i||i.type==="element"||i.type==="text"&&i.value.replace(/(\n|\s)/g,"")!=="")return;if(i.type&&/^(comment|raw)$/ig.test(i.type))return i.value&&!/^rehype:/.test(i.value.replace(/^(\s+)?<!--(.*?)-->/,"$2")||"")?void 0:r?Rx(e,o,"pre",r)?void 0:(i.value=(i.value||"").replace(/^(\n|\s)+/,""),i):(i.value=(i.value||"").replace(/^(\n|\s)+/,""),i)}},tg=({value:e=""})=>{const t=jP(e.replace(/^<!--(.*?)-->/,"$1").replace(/^rehype:/,""));return Object.keys(t).forEach(n=>{t[n]==="true"&&(t[n]=!0),t[n]==="false"&&(t[n]=!1),typeof t[n]=="string"&&!/^0/.test(t[n])&&!isNaN(+t[n])&&(t[n]=+t[n])}),t},ng=(e,t,n)=>n==="string"?{...e,"data-config":JSON.stringify({...t,rehyp:!0})}:n==="attr"?{...e,...t}:{...e,"data-config":{...t,rehyp:!0}},HP=(e={})=>{const{properties:t="data",codeBlockParames:n=!0}=e;return r=>{Kn(r,"element",(o,i,s)=>{if(n&&o.tagName==="pre"&&o&&Array.isArray(o.children)&&s&&Array.isArray(s.children)&&s.children.length>1){const a=o.children[0];if(a&&a.tagName==="code"&&typeof i=="number"){const l=$P(s.children,i);if(l){const u=tg(l);Object.keys(u).length>0&&(o.properties={...o.properties,"data-type":"rehyp"},a.properties=ng(a.properties,u,t))}}}if(/^(em|strong|b|a|i|p|pre|kbd|blockquote|h(1|2|3|4|5|6)|code|table|img|del|ul|ol)$/.test(o.tagName)&&s&&Array.isArray(s.children)&&typeof i=="number"){const a=Rx(s.children,i,"",n);if(a){const l=tg(a);Object.keys(l).length>0&&(o.properties=ng(o.properties,l,t))}}})}};var zP=function(t){return n=>{Kn(n,r=>{r.type==="element"&&r.tagName==="code"&&r.data&&r.data.meta&&(r.properties=Y({},r.properties,{"data-meta":String(r.data.meta)}))})}},UP=function(t){return n=>{Kn(n,r=>{if(r.type==="element"&&r.tagName==="code"&&r.properties&&r.properties.dataMeta){r.data||(r.data={});var o=r.properties.dataMeta;typeof o=="string"&&(r.data.meta=o),delete r.properties.dataMeta}})}};const VP=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g,WP=Object.hasOwnProperty;class qP{constructor(){this.occurrences,this.reset()}slug(t,n){const r=this;let o=YP(t,n===!0);const i=o;for(;WP.call(r.occurrences,o);)r.occurrences[i]++,o=i+"-"+r.occurrences[i];return r.occurrences[o]=0,o}reset(){this.occurrences=Object.create(null)}}function YP(e,t){return typeof e!="string"?"":(t||(e=e.toLowerCase()),e.replace(VP,"").replace(/ /g,"-"))}function Nx(e){const t=e.type==="element"?e.tagName.toLowerCase():"",n=t.length===2&&t.charCodeAt(0)===104?t.charCodeAt(1):0;return n>48&&n<55?n-48:void 0}const KP={},rg=new qP;function GP(e){const n=(e||KP).prefix||"";return function(r){rg.reset(),Kn(r,"element",function(o){Nx(o)&&!o.properties.id&&(o.properties.id=n+rg.slug(Sx(o)))})}}const Fx=(function(e){if(e==null)return ZP;if(typeof e=="string")return XP(e);if(typeof e=="object")return QP(e);if(typeof e=="function")return xp(e);throw new Error("Expected function, string, or array as `test`")});function QP(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Fx(e[n]);return xp(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function XP(e){return xp(t);function t(n){return n.tagName===e}}function xp(e){return t;function t(n,r,o){return!!(JP(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function ZP(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function JP(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const og={type:"element",tagName:"span",properties:{className:["icon","icon-link"]},children:[]},eR={};function tR(e){const t=e||eR;let n=t.properties;const r=t.headingProperties,o=t.behavior||"prepend",i=t.content,s=t.group,a=Fx(t.test);let l;return o==="after"||o==="before"?l=d:o==="wrap"?l=f:(l=u,n||(n={ariaHidden:"true",tabIndex:-1})),function(h){Kn(h,"element",function(p,m,b){if(Nx(p)&&p.properties.id&&a(p,m,b))return Object.assign(p.properties,Gl(r,p)),l(p,m,b)})};function u(h){const p=ig(i||og,h);return h.children[o==="prepend"?"unshift":"push"](Id(h,Gl(n,h),p)),[Na]}function d(h,p,m){if(typeof p!="number"||!m)return;const b=ig(i||og,h),y=Id(h,Gl(n,h),b);let x=o==="before"?[y,h]:[h,y];if(s){const C=Lx(s,h);C&&!Array.isArray(C)&&C.type==="element"&&(C.children=x,x=[C])}return m.children.splice(p,1,...x),[Na,p+x.length]}function f(h){let p=h.children,m=[];return typeof i=="function"?(p=[],m=i(h)):i&&(m=Cp(i)),h.children=[Id(h,Gl(n,h),Array.isArray(m)?[...p,...m]:[...p,m])],[Na]}}function Cp(e){return di(e)}function Id(e,t,n){return{type:"element",tagName:"a",properties:{...t,href:"#"+e.properties.id},children:n}}function ig(e,t){const n=Lx(e,t);return Array.isArray(n)?n:[n]}function Lx(e,t){return typeof e=="function"?e(t):Cp(e)}function Gl(e,t){return typeof e=="function"?e(t):e?Cp(e):{}}const nR=(e={})=>{const{openDelimiter:t="rehype:ignore:start",closeDelimiter:n="rehype:ignore:end"}=e;return r=>{Kn(r,(o,i,s)=>{if(o.type==="element"||o.type==="root"){let a=!1;o.children=o.children.filter(l=>{if(l.type==="raw"||l.type==="comment"){let u=(l.value||"").trim();if(u=u.replace(/^<!--(.*?)-->/,"$1"),u===t)return a=!0,!1;if(u===n)return a=!1,!1}return!a})}})}};var rR={type:"element",tagName:"svg",properties:{className:"octicon octicon-link",viewBox:"0 0 16 16",version:"1.1",width:"16",height:"16",ariaHidden:"true"},children:[{type:"element",tagName:"path",children:[],properties:{fillRule:"evenodd",d:"M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"}}]};function oR(e){return e===void 0&&(e=""),{type:"element",tagName:"div",properties:{class:"copied","data-code":e},children:[{type:"element",tagName:"svg",properties:{className:"octicon-copy",ariaHidden:"true",viewBox:"0 0 16 16",fill:"currentColor",height:12,width:12},children:[{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"},children:[]},{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"},children:[]}]},{type:"element",tagName:"svg",properties:{className:"octicon-check",ariaHidden:"true",viewBox:"0 0 16 16",fill:"currentColor",height:12,width:12},children:[{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"},children:[]}]}]}}var iR=(e,t)=>(n,r,o)=>{if(n.type==="element"&&o&&o.type==="root"&&/h(1|2|3|4|5|6)/.test(n.tagName)){var i=n.children&&n.children[0];i&&i.properties&&i.properties.ariaHidden==="true"&&(i.properties=Y({class:"anchor"},i.properties),i.children=[rR])}if(n.type==="element"&&n.tagName==="pre"&&!e){var s=Px(n.children);n.children.push(oR(s))}t&&t(n,r===null?void 0:r,o===null?void 0:o)},sR=[GP,tR,nR];const _x=W.forwardRef((e,t)=>{var n,r=[zP,UP,...sR,[BP,{rewrite:iR((n=e.disableCopy)!=null?n:!1,e.rehypeRewrite)}],[HP,{properties:"attr"}],...e.rehypePlugins||[]];return c.jsx(vM,Y({},e,{rehypePlugins:r,ref:t}))});function aR(e,t){return Y({},e,t)}var Is=W.createContext({markdown:""});function Bx(e,t){return e===void 0&&(e=[]),t===void 0&&(t={}),e.forEach(n=>{n.children&&Array.isArray(n.children)?t=Y({},t,Bx(n.children||[])):n.keyCommand&&n.shortcuts&&n.execute&&(t[n.shortcuts.toLocaleLowerCase()]=n)}),t}function jx(e,t,n,r,o){t===void 0&&(t=[]);var i=Bx(t||[]),s=[];if(e.altKey&&s.push("alt"),e.shiftKey&&s.push("shift"),e.metaKey&&s.push("cmd"),e.ctrlKey&&s.push("ctrl"),s.length>0&&!/(control|alt|meta|shift)/.test(e.key.toLocaleLowerCase())&&s.push(e.key.toLocaleLowerCase()),/escape/.test(e.key.toLocaleLowerCase())&&s.push("escape"),!(s.length<1)){var a=!!i[s.join("+")],l=a?i[s.join("+")]:void 0;if(Object.keys(i).forEach(u=>{var d=u.split("+").every(f=>/ctrlcmd/.test(f)?s.includes("ctrl")||s.includes("cmd"):s.includes(f));d&&(l=i[u])}),l&&n){e.stopPropagation(),e.preventDefault(),n.executeCommand(l,r,o,s);return}}}var Ad;function sg(e){if(e.nodeName!=="TEXTAREA")return!1;if(typeof Ad>"u"){var t=document.createElement("textarea");t.value="1",Ad=!!t.firstChild}return Ad}function is(e,t){if(e.focus(),document.selection){var n=document.selection.createRange();n.text=t,n.collapse(!1),n.select();return}var r=!1;if(t!==""?r=document.execCommand&&document.execCommand("insertText",!1,t):r=document.execCommand&&document.execCommand("delete",!1),!r){var o=e.selectionStart,i=e.selectionEnd;if(typeof e.setRangeText=="function")e.setRangeText(t);else{var s=document.createRange(),a=document.createTextNode(t);if(sg(e)){var l=e.firstChild;if(!l)e.appendChild(a);else{for(var u=0,d=null,f=null;l&&(d===null||f===null);){var h=l.nodeValue.length;o>=u&&o<=u+h&&s.setStart(d=l,o-u),i>=u&&i<=u+h&&s.setEnd(f=l,i-u),u+=h,l=l.nextSibling}o!==i&&s.deleteContents()}}if(sg(e)&&s.commonAncestorContainer.nodeName==="#text")s.insertNode(a);else{var p=e.value;e.value=p.slice(0,o)+t+p.slice(i)}}e.setSelectionRange(o+t.length,o+t.length);var m=document.createEvent("UIEvent");m.initEvent("input",!0,!1),e.dispatchEvent(m)}}function jn(e){var{text:t,selection:n,prefix:r,suffix:o=r}=e,i=n;if(t&&t.length&&n.start===n.end&&(i=lR(t,n.start)),i.start>=r.length&&i.end<=t.length-o.length){var s=t.slice(i.start-r.length,i.end+o.length);if(s.startsWith(r)&&s.endsWith(o))return{start:i.start-r.length,end:i.end+o.length}}return i}function $a(e){var{text:t,selection:n}=e,r=t.slice(0,n.start).lastIndexOf(`
|
|
57
|
+
`)+1,o=t.slice(n.end).indexOf(`
|
|
58
|
+
`)+n.end;return o===n.end-1&&(o=t.length),{start:r,end:o}}function $x(e,t){if(e===void 0&&(e=""),t===0)return 0;for(var n=2,r=!0,o=t-1;o>=0&&n>=0;o--)switch(e.charCodeAt(o)){case 32:continue;case 10:n--,r=!1;break;default:return n}return r?0:n}function Hx(e,t){if(e===void 0&&(e=""),t===e.length-1)return 0;for(var n=2,r=!0,o=t;o<e.length&&n>=0;o++)switch(e.charCodeAt(o)){case 32:continue;case 10:{n--,r=!1;break}default:return n}return r?0:n}function lR(e,t){if(!e)throw Error("Argument 'text' should be truthy");for(var n=a=>a===" "||a.charCodeAt(0)===10,r=0,o=e.length,i=t;i-1>-1;i--)if(n(e[i-1])){r=i;break}for(var s=t;s<e.length;s++)if(n(e[s])){o=s;break}return{start:r,end:o}}function Tn(e){var{api:t,selectedText:n,selection:r,prefix:o,suffix:i=o}=e;n.length>=o.length+i.length&&n.startsWith(o)&&n.endsWith(i)?(t.replaceSelection(n.slice(o.length,i.length?-i.length:void 0)),t.setSelectionRange({start:r.start-o.length,end:r.end-o.length})):(t.replaceSelection(""+o+n+i),t.setSelectionRange({start:r.start+o.length,end:r.end+o.length}))}function Ep(e,t){var n=e.split(/\n/),r=0,o=n.map((i,s)=>{if(typeof t=="string")return i.startsWith(t)?(r-=t.length,i.slice(t.length)):(r+=t.length,t+i);if(typeof t=="function"){if(i.startsWith(t(i,s)))return r-=t(i,s).length,i.slice(t(i,s).length);var a=t(i,s);return r+=a.length,t(i,s)+i}throw Error("insertion is expected to be either a string or a function")}).join(`
|
|
59
|
+
`);return{modifiedText:o,insertionLength:r}}var uR={name:"bold",keyCommand:"bold",shortcuts:"ctrlcmd+b",prefix:"**",buttonProps:{"aria-label":"Add bold text (ctrl + b)",title:"Add bold text (ctrl + b)"},icon:c.jsx("svg",{role:"img",width:"12",height:"12",viewBox:"0 0 384 512",children:c.jsx("path",{fill:"currentColor",d:"M304.793 243.891c33.639-18.537 53.657-54.16 53.657-95.693 0-48.236-26.25-87.626-68.626-104.179C265.138 34.01 240.849 32 209.661 32H24c-8.837 0-16 7.163-16 16v33.049c0 8.837 7.163 16 16 16h33.113v318.53H24c-8.837 0-16 7.163-16 16V464c0 8.837 7.163 16 16 16h195.69c24.203 0 44.834-1.289 66.866-7.584C337.52 457.193 376 410.647 376 350.014c0-52.168-26.573-91.684-71.207-106.123zM142.217 100.809h67.444c16.294 0 27.536 2.019 37.525 6.717 15.828 8.479 24.906 26.502 24.906 49.446 0 35.029-20.32 56.79-53.029 56.79h-76.846V100.809zm112.642 305.475c-10.14 4.056-22.677 4.907-31.409 4.907h-81.233V281.943h84.367c39.645 0 63.057 25.38 63.057 63.057.001 28.425-13.66 52.483-34.782 61.284z"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix}),r=t.setSelectionRange(n);Tn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix})}},zx={name:"codeBlock",keyCommand:"codeBlock",shortcuts:"ctrlcmd+shift+j",prefix:"```",buttonProps:{"aria-label":"Insert Code Block (ctrl + shift + j)",title:"Insert Code Block (ctrl + shift +j)"},icon:c.jsx("svg",{width:"13",height:"13",role:"img",viewBox:"0 0 156 156",children:c.jsx("path",{fill:"currentColor",d:"M110.85 120.575 43.7 120.483333 43.7083334 110.091667 110.85 110.191667 110.841667 120.583333 110.85 120.575ZM85.1333334 87.1916666 43.625 86.7083332 43.7083334 76.3166666 85.2083334 76.7916666 85.1333334 87.1916666 85.1333334 87.1916666ZM110.841667 53.4166666 43.7 53.3166666 43.7083334 42.925 110.85 43.025 110.841667 53.4166666ZM36 138C27.2916666 138 20.75 136.216667 16.4 132.666667 12.1333334 129.2 10 124.308333 10 118L10 95.3333332C10 91.0666666 9.25 88.1333332 7.7333334 86.5333332 6.3166668 84.8416666 3.7333334 84 0 84L0 72C3.7333334 72 6.3083334 71.2 7.7333334 69.6 9.2416668 67.9083334 10 64.9333334 10 60.6666666L10 38C10 31.775 12.1333334 26.8833334 16.4 23.3333332 20.7583334 19.7749998 27.2916666 18 36 18L40.6666668 18 40.6666668 30 36 30C34.0212222 29.9719277 32.1263151 30.7979128 30.8 32.2666666 29.3605875 33.8216362 28.5938182 35.8823287 28.6666668 38L28.6666668 60.6666666C28.6666668 67.5083332 26.6666668 72.4 22.6666668 75.3333332 20.9317416 76.7274684 18.8640675 77.6464347 16.6666668 78 18.8916668 78.35 20.8916668 79.2416666 22.6666668 80.6666666 26.6666668 83.95 28.6666668 88.8416666 28.6666668 95.3333332L28.6666668 118C28.6666668 120.308333 29.3750002 122.216667 30.8 123.733333 32.2166666 125.241667 33.9583334 126 36 126L40.6666668 126 40.6666668 138 36 138 36 138ZM114.116667 126 118.783333 126C120.833333 126 122.566667 125.241667 123.983333 123.733333 125.422746 122.178364 126.189515 120.117671 126.116667 118L126.116667 95.3333332C126.116667 88.8333332 128.116667 83.9499998 132.116667 80.6666666 133.9 79.2416666 135.9 78.35 138.116667 78 135.919156 77.6468047 133.851391 76.7277979 132.116667 75.3333332 128.116667 72.3999998 126.116667 67.5 126.116667 60.6666666L126.116667 38C126.189515 35.8823287 125.422746 33.8216361 123.983333 32.2666666 122.657018 30.7979128 120.762111 29.9719277 118.783333 30L114.116667 30 114.116667 18 118.783333 18C127.5 18 133.983333 19.775 138.25 23.3333332 142.608333 26.8833332 144.783333 31.7749998 144.783333 38L144.783333 60.6666666C144.783333 64.9333332 145.5 67.9083332 146.916667 69.6 148.433333 71.2 151.05 72 154.783333 72L154.783333 84C151.05 84 148.433333 84.8333334 146.916667 86.5333332 145.5 88.1333332 144.783333 91.0666666 144.783333 95.3333332L144.783333 118C144.783333 124.308333 142.616667 129.2 138.25 132.666667 133.983333 136.216667 127.5 138 118.783333 138L114.116667 138 114.116667 126 114.116667 126Z"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:"```\n",suffix:"\n```"}),r=t.setSelectionRange(n),o="\n```\n",i="\n```\n";r.selectedText.length>=o.length+i.length-2&&r.selectedText.startsWith(o)&&r.selectedText.endsWith(i)?(o="```\n",i="\n```"):((r.selection.start>=1&&e.text.slice(r.selection.start-1,r.selection.start)===`
|
|
60
|
+
`||r.selection.start===0)&&(o="```\n"),(r.selection.end<=e.text.length-1&&e.text.slice(r.selection.end,r.selection.end+1)===`
|
|
61
|
+
`||r.selection.end===e.text.length)&&(i="\n```"));var s=jn({text:e.text,selection:e.selection,prefix:o,suffix:i}),a=t.setSelectionRange(s);Tn({api:t,selectedText:a.selectedText,selection:e.selection,prefix:o,suffix:i})}},cR={name:"code",keyCommand:"code",shortcuts:"ctrlcmd+j",prefix:"`",buttonProps:{"aria-label":"Insert code (ctrl + j)",title:"Insert code (ctrl + j)"},icon:c.jsx("svg",{width:"14",height:"14",role:"img",viewBox:"0 0 640 512",children:c.jsx("path",{fill:"currentColor",d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"})}),execute:(e,t)=>{if(e.selectedText.indexOf(`
|
|
62
|
+
`)===-1){var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix}),r=t.setSelectionRange(n);Tn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix})}else zx.execute(e,t)}},dR={name:"comment",keyCommand:"comment",shortcuts:"ctrlcmd+/",prefix:"<!-- ",suffix:" -->",buttonProps:{"aria-label":"Insert comment (ctrl + /)",title:"Insert comment (ctrl + /)"},icon:c.jsx("svg",{height:"1em",width:"1em",viewBox:"0 0 25 25",children:c.jsxs("g",{fill:"none",fillRule:"evenodd",children:[c.jsx("polygon",{points:".769 .727 24.981 .727 24.981 24.727 .769 24.727"}),c.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"M12.625,23.8787879 L8.125,19.6969697 L5.125,19.6969697 C2.63971863,19.6969697 0.625,17.8247059 0.625,15.5151515 L0.625,7.15151515 C0.625,4.84196074 2.63971863,2.96969697 5.125,2.96969697 L20.125,2.96969697 C22.6102814,2.96969697 24.625,4.84196074 24.625,7.15151515 L24.625,15.5151515 C24.625,17.8247059 22.6102814,19.6969697 20.125,19.6969697 L17.125,19.6969697 L12.625,23.8787879"}),c.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"M10.625,8.54545455 L7.25,11.3333333 L10.625,14.1212121 M15.6875,8.54545455 L19.0625,11.3333333 L15.6875,14.1212121"})]})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}),r=t.setSelectionRange(n);Tn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix})}},cu={keyCommand:"divider"},fR={name:"fullscreen",keyCommand:"fullscreen",shortcuts:"ctrlcmd+0",value:"fullscreen",buttonProps:{"aria-label":"Toggle fullscreen (ctrl + 0)",title:"Toggle fullscreen (ctrl+ 0)"},icon:c.jsx("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:c.jsx("path",{fill:"currentColor",d:"M118 171.133334L118 342.200271C118 353.766938 126.675 365.333605 141.133333 365.333605L382.634614 365.333605C394.201281 365.333605 405.767948 356.658605 405.767948 342.200271L405.767948 171.133334C405.767948 159.566667 397.092948 148 382.634614 148L141.133333 148C126.674999 148 117.999999 156.675 118 171.133334zM465.353591 413.444444L370 413.444444 370 471.222222 474.0221 471.222222C500.027624 471.222222 520.254143 451 520.254143 425L520.254143 321 462.464089 321 462.464089 413.444444 465.353591 413.444444zM471.0221 43L367 43 367 100.777778 462.353591 100.777778 462.353591 196.111111 520.143647 196.111111 520.143647 89.2222219C517.254144 63.2222219 497.027624 43 471.0221 43zM57.7900547 100.777778L153.143646 100.777778 153.143646 43 46.2320439 43C20.2265191 43 0 63.2222219 0 89.2222219L0 193.222222 57.7900547 193.222222 57.7900547 100.777778zM57.7900547 321L0 321 0 425C0 451 20.2265191 471.222222 46.2320439 471.222223L150.254143 471.222223 150.254143 413.444445 57.7900547 413.444445 57.7900547 321z"})}),execute:(e,t,n,r,o)=>{t.textArea.focus(),o&&n&&r&&n({fullscreen:!r.fullscreen})}};function pR(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var hR=(e,t)=>{var n=Y({children:e,icon:c.jsx("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:c.jsx("path",{fill:"currentColor",d:"M15.7083333,468 C7.03242448,468 0,462.030833 0,454.666667 L0,421.333333 C0,413.969167 7.03242448,408 15.7083333,408 L361.291667,408 C369.967576,408 377,413.969167 377,421.333333 L377,454.666667 C377,462.030833 369.967576,468 361.291667,468 L15.7083333,468 Z M21.6666667,366 C9.69989583,366 0,359.831861 0,352.222222 L0,317.777778 C0,310.168139 9.69989583,304 21.6666667,304 L498.333333,304 C510.300104,304 520,310.168139 520,317.777778 L520,352.222222 C520,359.831861 510.300104,366 498.333333,366 L21.6666667,366 Z M136.835938,64 L136.835937,126 L107.25,126 L107.25,251 L40.75,251 L40.75,126 L-5.68434189e-14,126 L-5.68434189e-14,64 L136.835938,64 Z M212,64 L212,251 L161.648438,251 L161.648438,64 L212,64 Z M378,64 L378,126 L343.25,126 L343.25,251 L281.75,251 L281.75,126 L238,126 L238,64 L378,64 Z M449.047619,189.550781 L520,189.550781 L520,251 L405,251 L405,64 L449.047619,64 L449.047619,189.550781 Z"})}),execute:()=>{}},t,{keyCommand:"group"});return Array.isArray(n.children)&&(n.children=n.children.map(r=>{var o=Y({},(pR(r),r));return o.parent=n,Y({},o)})),n},mR={name:"hr",keyCommand:"hr",shortcuts:"ctrlcmd+h",prefix:`
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
`,suffix:"",buttonProps:{"aria-label":"Insert HR (ctrl + h)",title:"Insert HR (ctrl + h)"},icon:c.jsx("svg",{width:"12",height:"12",viewBox:"0 0 175 175",children:c.jsx("path",{fill:"currentColor",d:"M0,129 L175,129 L175,154 L0,154 L0,129 Z M3,9 L28.2158203,9 L28.2158203,47.9824219 L55.7695313,47.9824219 L55.7695313,9 L81.0966797,9 L81.0966797,107.185547 L55.7695313,107.185547 L55.7695313,68.0214844 L28.2158203,68.0214844 L28.2158203,107.185547 L3,107.185547 L3,9 Z M93.1855469,100.603516 L93.1855469,19 L135.211914,19 C143.004922,19 148.960917,19.6679621 153.080078,21.0039063 C157.199239,22.3398504 160.520495,24.8168764 163.043945,28.4350586 C165.567395,32.0532407 166.829102,36.459935 166.829102,41.6552734 C166.829102,46.1826398 165.864267,50.0883625 163.93457,53.3725586 C162.004873,56.6567547 159.351579,59.3193257 155.974609,61.3603516 C153.822255,62.6591862 150.872089,63.7353473 147.124023,64.5888672 C150.129898,65.5908253 152.319329,66.5927684 153.692383,67.5947266 C154.620122,68.2626987 155.965323,69.6913953 157.728027,71.8808594 C159.490731,74.0703234 160.668942,75.7587831 161.262695,76.9462891 L173,100.603516 L144.953125,100.603516 L131.482422,75.6660156 C129.775382,72.4374839 128.253913,70.3408251 126.917969,69.3759766 C125.0996,68.1142515 123.040051,67.4833984 120.739258,67.4833984 L118.512695,67.4833984 L118.512695,100.603516 L93.1855469,100.603516 Z M118.512695,52.0644531 L129.144531,52.0644531 C130.294928,52.0644531 132.521468,51.6933631 135.824219,50.9511719 C137.494149,50.6171858 138.857905,49.7636787 139.915527,48.390625 C140.97315,47.0175713 141.501953,45.4404386 141.501953,43.6591797 C141.501953,41.0244009 140.667001,39.0019602 138.99707,37.5917969 C137.32714,36.1816336 134.191429,35.4765625 129.589844,35.4765625 L117.512695,35.4765625 L118.512695,52.0644531 Z",transform:"translate(0 9)"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}),r=t.setSelectionRange(n);r.selectedText.length>=e.command.prefix.length&&r.selectedText.startsWith(e.command.prefix)?Tn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}):(r=t.setSelectionRange({start:e.selection.start,end:e.selection.start}),Tn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}))}},gR={name:"image",keyCommand:"image",shortcuts:"ctrlcmd+k",prefix:"",buttonProps:{"aria-label":"Add image (ctrl + k)",title:"Add image (ctrl + k)"},icon:c.jsx("svg",{width:"13",height:"13",viewBox:"0 0 20 20",children:c.jsx("path",{fill:"currentColor",d:"M15 9c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm4-7H1c-.55 0-1 .45-1 1v14c0 .55.45 1 1 1h18c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm-1 13l-6-5-2 2-4-5-4 8V4h16v11z"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}),r=t.setSelectionRange(n);r.selectedText.includes("http")||r.selectedText.includes("www")?Tn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}):(n=jn({text:e.text,selection:e.selection,prefix:"![",suffix:"]()"}),r=t.setSelectionRange(n),r.selectedText.length===0?Tn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:""}):Tn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:"![",suffix:"]()"}))}},bR={name:"italic",keyCommand:"italic",shortcuts:"ctrlcmd+i",prefix:"*",buttonProps:{"aria-label":"Add italic text (ctrl + i)",title:"Add italic text (ctrl + i)"},icon:c.jsx("svg",{"data-name":"italic",width:"12",height:"12",role:"img",viewBox:"0 0 320 512",children:c.jsx("path",{fill:"currentColor",d:"M204.758 416h-33.849l62.092-320h40.725a16 16 0 0 0 15.704-12.937l6.242-32C297.599 41.184 290.034 32 279.968 32H120.235a16 16 0 0 0-15.704 12.937l-6.242 32C96.362 86.816 103.927 96 113.993 96h33.846l-62.09 320H46.278a16 16 0 0 0-15.704 12.935l-6.245 32C22.402 470.815 29.967 480 40.034 480h158.479a16 16 0 0 0 15.704-12.935l6.245-32c1.927-9.88-5.638-19.065-15.704-19.065z"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix}),r=t.setSelectionRange(n);Tn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix})}},yR={name:"link",keyCommand:"link",shortcuts:"ctrlcmd+l",prefix:"[",suffix:"](url)",buttonProps:{"aria-label":"Add a link (ctrl + l)",title:"Add a link (ctrl + l)"},icon:c.jsx("svg",{"data-name":"italic",width:"12",height:"12",role:"img",viewBox:"0 0 520 520",children:c.jsx("path",{fill:"currentColor",d:"M331.751196,182.121107 C392.438214,241.974735 391.605313,337.935283 332.11686,396.871226 C332.005129,396.991316 331.873084,397.121413 331.751196,397.241503 L263.493918,464.491645 C203.291404,523.80587 105.345257,523.797864 45.151885,464.491645 C-15.0506283,405.187427 -15.0506283,308.675467 45.151885,249.371249 L82.8416853,212.237562 C92.836501,202.39022 110.049118,208.9351 110.56511,222.851476 C111.223305,240.5867 114.451306,258.404985 120.407566,275.611815 C122.424812,281.438159 120.983487,287.882964 116.565047,292.23621 L103.272145,305.332975 C74.8052033,333.379887 73.9123737,379.047937 102.098973,407.369054 C130.563883,435.969378 177.350591,436.139505 206.033884,407.879434 L274.291163,340.6393 C302.9257,312.427264 302.805844,266.827265 274.291163,238.733318 C270.531934,235.036561 266.74528,232.16442 263.787465,230.157924 C259.544542,227.2873 256.928256,222.609848 256.731165,217.542518 C256.328935,206.967633 260.13184,196.070508 268.613213,187.714278 L289.998463,166.643567 C295.606326,161.118448 304.403592,160.439942 310.906317,164.911276 C318.353355,170.034591 325.328531,175.793397 331.751196,182.121107 Z M240.704978,55.4828366 L172.447607,122.733236 C172.325719,122.853326 172.193674,122.983423 172.081943,123.103513 C117.703294,179.334654 129.953294,261.569283 185.365841,328.828764 C191.044403,335.721376 198.762988,340.914712 206.209732,346.037661 C212.712465,350.509012 221.510759,349.829503 227.117615,344.305363 L248.502893,323.234572 C256.984277,314.87831 260.787188,303.981143 260.384957,293.406218 C260.187865,288.338869 257.571576,283.661398 253.328648,280.790763 C250.370829,278.78426 246.58417,275.912107 242.824936,272.215337 C214.310216,244.121282 206.209732,204.825874 229.906702,179.334654 L298.164073,112.094263 C326.847404,83.8340838 373.633159,84.0042113 402.099123,112.604645 C430.285761,140.92587 429.393946,186.594095 400.92595,214.641114 L387.63303,227.737929 C383.214584,232.091191 381.773257,238.536021 383.790506,244.362388 C389.746774,261.569283 392.974779,279.387637 393.632975,297.122928 C394.149984,311.039357 411.361608,317.584262 421.356437,307.736882 L459.046288,270.603053 C519.249898,211.29961 519.249898,114.787281 459.047304,55.4828366 C398.853851,-3.82360914 300.907572,-3.83161514 240.704978,55.4828366 Z"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}),r=t.setSelectionRange(n);r.selectedText.includes("http")||r.selectedText.includes("www")?(n=jn({text:e.text,selection:e.selection,prefix:"[](",suffix:")"}),r=t.setSelectionRange(n),Tn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:"[](",suffix:")"})):r.selectedText.length===0?Tn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:"[title",suffix:"](url)"}):Tn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix})}},vp=(e,t,n)=>{var r=jn({text:e.text,selection:e.selection,prefix:e.command.prefix}),o=t.setSelectionRange(r),i=$x(o.text,o.selection.start),s=Array(i+1).join(`
|
|
66
|
+
`),a=Hx(o.text,o.selection.end),l=Array(a+1).join(`
|
|
67
|
+
`),{modifiedText:u,insertionLength:d}=Ep(o.selectedText,n);if(d<0){var f=o.selection.start,h=o.selection.end;o.selection.start>0&&e.text.slice(o.selection.start-1,o.selection.start)===`
|
|
68
|
+
`&&(f-=1),o.selection.end<e.text.length-1&&e.text.slice(o.selection.end,o.selection.end+1)===`
|
|
69
|
+
`&&(h+=1),t.setSelectionRange({start:f,end:h}),t.replaceSelection(""+u),t.setSelectionRange({start:f,end:f+u.length})}else{t.replaceSelection(""+s+u+l);var p=o.selection.start+i,m=p+u.length;t.setSelectionRange({start:p,end:m})}},xR={name:"unordered-list",keyCommand:"list",shortcuts:"ctrl+shift+u",prefix:"- ",buttonProps:{"aria-label":"Add unordered list (ctrl + shift + u)",title:"Add unordered list (ctrl + shift + u)"},icon:c.jsx("svg",{"data-name":"unordered-list",width:"12",height:"12",viewBox:"0 0 512 512",children:c.jsx("path",{fill:"currentColor",d:"M96 96c0 26.51-21.49 48-48 48S0 122.51 0 96s21.49-48 48-48 48 21.49 48 48zM48 208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm0 160c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm96-236h352c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h352c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h352c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"})}),execute:(e,t)=>{vp(e,t,"- ")}},CR={name:"ordered-list",keyCommand:"list",shortcuts:"ctrl+shift+o",prefix:"1. ",buttonProps:{"aria-label":"Add ordered list (ctrl + shift + o)",title:"Add ordered list (ctrl + shift + o)"},icon:c.jsx("svg",{"data-name":"ordered-list",width:"12",height:"12",role:"img",viewBox:"0 0 512 512",children:c.jsx("path",{fill:"currentColor",d:"M3.263 139.527c0-7.477 3.917-11.572 11.573-11.572h15.131V88.078c0-5.163.534-10.503.534-10.503h-.356s-1.779 2.67-2.848 3.738c-4.451 4.273-10.504 4.451-15.666-1.068l-5.518-6.231c-5.342-5.341-4.984-11.216.534-16.379l21.72-19.938C32.815 33.602 36.732 32 42.785 32H54.89c7.656 0 11.749 3.916 11.749 11.572v84.384h15.488c7.655 0 11.572 4.094 11.572 11.572v8.901c0 7.477-3.917 11.572-11.572 11.572H14.836c-7.656 0-11.573-4.095-11.573-11.572v-8.902zM2.211 304.591c0-47.278 50.955-56.383 50.955-69.165 0-7.18-5.954-8.755-9.28-8.755-3.153 0-6.479 1.051-9.455 3.852-5.079 4.903-10.507 7.004-16.111 2.451l-8.579-6.829c-5.779-4.553-7.18-9.805-2.803-15.409C13.592 201.981 26.025 192 47.387 192c19.437 0 44.476 10.506 44.476 39.573 0 38.347-46.753 46.402-48.679 56.909h39.049c7.529 0 11.557 4.027 11.557 11.382v8.755c0 7.354-4.028 11.382-11.557 11.382h-67.94c-7.005 0-12.083-4.028-12.083-11.382v-4.028zM5.654 454.61l5.603-9.28c3.853-6.654 9.105-7.004 15.584-3.152 4.903 2.101 9.63 3.152 14.359 3.152 10.155 0 14.358-3.502 14.358-8.23 0-6.654-5.604-9.106-15.934-9.106h-4.728c-5.954 0-9.28-2.101-12.258-7.88l-1.05-1.926c-2.451-4.728-1.226-9.806 2.801-14.884l5.604-7.004c6.829-8.405 12.257-13.483 12.257-13.483v-.35s-4.203 1.051-12.608 1.051H16.685c-7.53 0-11.383-4.028-11.383-11.382v-8.755c0-7.53 3.853-11.382 11.383-11.382h58.484c7.529 0 11.382 4.027 11.382 11.382v3.327c0 5.778-1.401 9.806-5.079 14.183l-17.509 20.137c19.611 5.078 28.716 20.487 28.716 34.845 0 21.363-14.358 44.126-48.503 44.126-16.636 0-28.192-4.728-35.896-9.455-5.779-4.202-6.304-9.805-2.626-15.934zM144 132h352c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h352c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h352c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"})}),execute:(e,t)=>{vp(e,t,(n,r)=>r+1+". ")}},ER={name:"checked-list",keyCommand:"list",shortcuts:"ctrl+shift+c",prefix:"- [ ] ",buttonProps:{"aria-label":"Add checked list (ctrl + shift + c)",title:"Add checked list (ctrl + shift + c)"},icon:c.jsx("svg",{"data-name":"checked-list",width:"12",height:"12",role:"img",viewBox:"0 0 512 512",children:c.jsx("path",{fill:"currentColor",d:"M208 132h288c8.8 0 16-7.2 16-16V76c0-8.8-7.2-16-16-16H208c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16zm0 160h288c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16H208c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16zm0 160h288c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16H208c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16zM64 368c-26.5 0-48.6 21.5-48.6 48s22.1 48 48.6 48 48-21.5 48-48-21.5-48-48-48zm92.5-299l-72.2 72.2-15.6 15.6c-4.7 4.7-12.9 4.7-17.6 0L3.5 109.4c-4.7-4.7-4.7-12.3 0-17l15.7-15.7c4.7-4.7 12.3-4.7 17 0l22.7 22.1 63.7-63.3c4.7-4.7 12.3-4.7 17 0l17 16.5c4.6 4.7 4.6 12.3-.1 17zm0 159.6l-72.2 72.2-15.7 15.7c-4.7 4.7-12.9 4.7-17.6 0L3.5 269c-4.7-4.7-4.7-12.3 0-17l15.7-15.7c4.7-4.7 12.3-4.7 17 0l22.7 22.1 63.7-63.7c4.7-4.7 12.3-4.7 17 0l17 17c4.6 4.6 4.6 12.2-.1 16.9z"})}),execute:(e,t)=>{vp(e,t,(n,r)=>"- [ ] ")}},vR={name:"preview",keyCommand:"preview",value:"preview",shortcuts:"ctrlcmd+9",buttonProps:{"aria-label":"Preview code (ctrl + 9)",title:"Preview code (ctrl + 9)"},icon:c.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:[c.jsx("polygon",{fill:"currentColor",points:"0 71.293 0 122 38.023 123 38.023 398 0 397 0 449.707 91.023 450.413 91.023 72.293"}),c.jsx("polygon",{fill:"currentColor",points:"148.023 72.293 520 71.293 520 122 200.023 124 200.023 397 520 396 520 449.707 148.023 450.413"})]}),execute:(e,t,n,r,o)=>{t.textArea.focus(),o&&n&&r&&n({preview:"preview"})}},TR={name:"edit",keyCommand:"preview",value:"edit",shortcuts:"ctrlcmd+7",buttonProps:{"aria-label":"Edit code (ctrl + 7)",title:"Edit code (ctrl + 7)"},icon:c.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:[c.jsx("polygon",{fill:"currentColor",points:"0 71.293 0 122 319 122 319 397 0 397 0 449.707 372 449.413 372 71.293"}),c.jsx("polygon",{fill:"currentColor",points:"429 71.293 520 71.293 520 122 481 123 481 396 520 396 520 449.707 429 449.413"})]}),execute:(e,t,n,r,o)=>{t.textArea.focus(),o&&n&&r&&n({preview:"edit"})}},SR={name:"live",keyCommand:"preview",value:"live",shortcuts:"ctrlcmd+8",buttonProps:{"aria-label":"Live code (ctrl + 8)",title:"Live code (ctrl + 8)"},icon:c.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:[c.jsx("polygon",{fill:"currentColor",points:"0 71.293 0 122 179 122 179 397 0 397 0 449.707 232 449.413 232 71.293"}),c.jsx("polygon",{fill:"currentColor",points:"289 71.293 520 71.293 520 122 341 123 341 396 520 396 520 449.707 289 449.413"})]}),execute:(e,t,n,r,o)=>{t.textArea.focus(),o&&n&&r&&n({preview:"live"})}},kR={name:"quote",keyCommand:"quote",shortcuts:"ctrlcmd+q",prefix:"> ",buttonProps:{"aria-label":"Insert a quote (ctrl + q)",title:"Insert a quote (ctrl + q)"},icon:c.jsx("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:c.jsx("path",{fill:"currentColor",d:"M520,95.75 L520,225.75 C520,364.908906 457.127578,437.050625 325.040469,472.443125 C309.577578,476.586875 294.396016,464.889922 294.396016,448.881641 L294.396016,414.457031 C294.396016,404.242891 300.721328,395.025078 310.328125,391.554687 C377.356328,367.342187 414.375,349.711094 414.375,274.5 L341.25,274.5 C314.325781,274.5 292.5,252.674219 292.5,225.75 L292.5,95.75 C292.5,68.8257812 314.325781,47 341.25,47 L471.25,47 C498.174219,47 520,68.8257812 520,95.75 Z M178.75,47 L48.75,47 C21.8257813,47 0,68.8257812 0,95.75 L0,225.75 C0,252.674219 21.8257813,274.5 48.75,274.5 L121.875,274.5 C121.875,349.711094 84.8563281,367.342187 17.828125,391.554687 C8.22132813,395.025078 1.89601563,404.242891 1.89601563,414.457031 L1.89601563,448.881641 C1.89601563,464.889922 17.0775781,476.586875 32.5404687,472.443125 C164.627578,437.050625 227.5,364.908906 227.5,225.75 L227.5,95.75 C227.5,68.8257812 205.674219,47 178.75,47 Z"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix}),r=t.setSelectionRange(n),o=$x(r.text,r.selection.start),i=Array(o+1).join(`
|
|
70
|
+
`),s=Hx(r.text,r.selection.end),a=Array(s+1).join(`
|
|
71
|
+
`),l=Ep(r.selectedText,e.command.prefix);t.replaceSelection(""+i+l.modifiedText+a);var u=r.selection.start+o,d=u+l.modifiedText.length;t.setSelectionRange({start:u,end:d})}},wR={name:"strikethrough",keyCommand:"strikethrough",shortcuts:"ctrl+shift+x",buttonProps:{"aria-label":"Add strikethrough text (ctrl + shift + x)",title:"Add strikethrough text (ctrl + shift + x)"},prefix:"~~",icon:c.jsx("svg",{"data-name":"strikethrough",width:"12",height:"12",role:"img",viewBox:"0 0 512 512",children:c.jsx("path",{fill:"currentColor",d:"M496 288H16c-8.837 0-16-7.163-16-16v-32c0-8.837 7.163-16 16-16h480c8.837 0 16 7.163 16 16v32c0 8.837-7.163 16-16 16zm-214.666 16c27.258 12.937 46.524 28.683 46.524 56.243 0 33.108-28.977 53.676-75.621 53.676-32.325 0-76.874-12.08-76.874-44.271V368c0-8.837-7.164-16-16-16H113.75c-8.836 0-16 7.163-16 16v19.204c0 66.845 77.717 101.82 154.487 101.82 88.578 0 162.013-45.438 162.013-134.424 0-19.815-3.618-36.417-10.143-50.6H281.334zm-30.952-96c-32.422-13.505-56.836-28.946-56.836-59.683 0-33.92 30.901-47.406 64.962-47.406 42.647 0 64.962 16.593 64.962 32.985V136c0 8.837 7.164 16 16 16h45.613c8.836 0 16-7.163 16-16v-30.318c0-52.438-71.725-79.875-142.575-79.875-85.203 0-150.726 40.972-150.726 125.646 0 22.71 4.665 41.176 12.777 56.547h129.823z"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix}),r=t.setSelectionRange(n);Tn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix})}},Ux={name:"heading1",keyCommand:"heading1",shortcuts:"ctrlcmd+1",prefix:"# ",suffix:"",buttonProps:{"aria-label":"Insert Heading 1 (ctrl + 1)",title:"Insert Heading 1 (ctrl + 1)"},icon:c.jsx("div",{style:{fontSize:18,textAlign:"left"},children:"Heading 1"}),execute:(e,t)=>{As({state:e,api:t,prefix:e.command.prefix,suffix:e.command.suffix})}},DR=Ux;function As(e){var{state:t,api:n,prefix:r,suffix:o=r}=e,i=$a({text:t.text,selection:t.selection}),s=n.setSelectionRange(i);Tn({api:n,selectedText:s.selectedText,selection:t.selection,prefix:r,suffix:o})}Y({},Ux,{icon:c.jsx("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:c.jsx("path",{fill:"currentColor",d:"M15.7083333,468 C7.03242448,468 0,462.030833 0,454.666667 L0,421.333333 C0,413.969167 7.03242448,408 15.7083333,408 L361.291667,408 C369.967576,408 377,413.969167 377,421.333333 L377,454.666667 C377,462.030833 369.967576,468 361.291667,468 L15.7083333,468 Z M21.6666667,366 C9.69989583,366 0,359.831861 0,352.222222 L0,317.777778 C0,310.168139 9.69989583,304 21.6666667,304 L498.333333,304 C510.300104,304 520,310.168139 520,317.777778 L520,352.222222 C520,359.831861 510.300104,366 498.333333,366 L21.6666667,366 Z M136.835938,64 L136.835937,126 L107.25,126 L107.25,251 L40.75,251 L40.75,126 L-5.68434189e-14,126 L-5.68434189e-14,64 L136.835938,64 Z M212,64 L212,251 L161.648438,251 L161.648438,64 L212,64 Z M378,64 L378,126 L343.25,126 L343.25,251 L281.75,251 L281.75,126 L238,126 L238,64 L378,64 Z M449.047619,189.550781 L520,189.550781 L520,251 L405,251 L405,64 L449.047619,64 L449.047619,189.550781 Z"})})});var IR={name:"heading2",keyCommand:"heading2",shortcuts:"ctrlcmd+2",prefix:"## ",suffix:"",buttonProps:{"aria-label":"Insert Heading 2 (ctrl + 2)",title:"Insert Heading 2 (ctrl + 2)"},icon:c.jsx("div",{style:{fontSize:16,textAlign:"left"},children:"Heading 2"}),execute:(e,t)=>{As({state:e,api:t,prefix:e.command.prefix,suffix:e.command.suffix})}},AR=IR,OR={name:"heading3",keyCommand:"heading3",shortcuts:"ctrlcmd+3",prefix:"### ",suffix:"",buttonProps:{"aria-label":"Insert Heading 3 (ctrl + 3)",title:"Insert Heading 3 (ctrl + 3)"},icon:c.jsx("div",{style:{fontSize:15,textAlign:"left"},children:"Heading 3"}),execute:(e,t)=>{As({state:e,api:t,prefix:e.command.prefix,suffix:e.command.suffix})}},MR=OR,PR={name:"heading4",keyCommand:"heading4",shortcuts:"ctrlcmd+4",prefix:"#### ",suffix:"",buttonProps:{"aria-label":"Insert Heading 4 (ctrl + 4)",title:"Insert Heading 4 (ctrl + 4)"},icon:c.jsx("div",{style:{fontSize:14,textAlign:"left"},children:"Heading 4"}),execute:(e,t)=>{As({state:e,api:t,prefix:e.command.prefix,suffix:e.command.suffix})}},RR=PR,NR={name:"heading5",keyCommand:"heading5",shortcuts:"ctrlcmd+5",prefix:"##### ",suffix:"",buttonProps:{"aria-label":"Insert Heading 5 (ctrl + 5)",title:"Insert Heading 5 (ctrl + 5)"},icon:c.jsx("div",{style:{fontSize:12,textAlign:"left"},children:"Heading 5"}),execute:(e,t)=>{As({state:e,api:t,prefix:e.command.prefix,suffix:e.command.suffix})}},FR=NR,LR={name:"heading6",keyCommand:"heading6",shortcuts:"ctrlcmd+6",prefix:"###### ",suffix:"",buttonProps:{"aria-label":"Insert Heading 6 (ctrl + 6)",title:"Insert Heading 6 (ctrl + 6)"},icon:c.jsx("div",{style:{fontSize:12,textAlign:"left"},children:"Heading 6"}),execute:(e,t)=>{As({state:e,api:t,prefix:e.command.prefix,suffix:e.command.suffix})}},_R=LR,BR={name:"table",keyCommand:"table",prefix:`
|
|
72
|
+
| Header | Header |
|
|
73
|
+
|--------|--------|
|
|
74
|
+
| Cell | Cell |
|
|
75
|
+
| Cell | Cell |
|
|
76
|
+
| Cell | Cell |
|
|
77
|
+
|
|
78
|
+
`,suffix:"",buttonProps:{"aria-label":"Add table",title:"Add table"},icon:c.jsx("svg",{role:"img",width:"12",height:"12",viewBox:"0 0 512 512",children:c.jsx("path",{fill:"currentColor",d:"M64 256V160H224v96H64zm0 64H224v96H64V320zm224 96V320H448v96H288zM448 256H288V160H448v96zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64z"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}),r=t.setSelectionRange(n);r.selectedText.length>=e.command.prefix.length+e.command.suffix.length&&r.selectedText.startsWith(e.command.prefix)?Tn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}):(r=t.setSelectionRange({start:e.selection.start,end:e.selection.start}),Tn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}))}},jR={name:"help",keyCommand:"help",buttonProps:{"aria-label":"Open help",title:"Open help"},icon:c.jsx("svg",{viewBox:"0 0 16 16",width:"12px",height:"12px",children:c.jsx("path",{d:"M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Zm.9 13H7v-1.8h1.9V13Zm-.1-3.6v.5H7.1v-.6c.2-2.1 2-1.9 1.9-3.2.1-.7-.3-1.1-1-1.1-.8 0-1.2.7-1.2 1.6H5c0-1.7 1.2-3 2.9-3 2.3 0 3 1.4 3 2.3.1 2.3-1.9 2-2.1 3.5Z",fill:"currentColor"})}),execute:()=>{window.open("https://www.markdownguide.org/basic-syntax/","_blank","noreferrer")}},$R=()=>[uR,bR,wR,mR,hR([DR,AR,MR,RR,FR,_R],{name:"title",groupName:"title",buttonProps:{"aria-label":"Insert title",title:"Insert title"}}),cu,yR,kR,cR,zx,dR,gR,BR,cu,xR,CR,ER,cu,jR],HR=()=>[TR,SR,vR,cu,fR];function ju(e){var t;return{selection:{start:e.selectionStart,end:e.selectionEnd},text:e.value,selectedText:(t=e.value)==null?void 0:t.slice(e.selectionStart,e.selectionEnd)}}class Tp{constructor(t){this.textArea=void 0,this.textArea=t}replaceSelection(t){return is(this.textArea,t),ju(this.textArea)}setSelectionRange(t){return this.textArea.focus(),this.textArea.selectionStart=t.start,this.textArea.selectionEnd=t.end,ju(this.textArea)}}class Sp{constructor(t){this.textArea=void 0,this.textApi=void 0,this.textArea=t,this.textApi=new Tp(t)}getState(){return this.textArea?ju(this.textArea):!1}executeCommand(t,n,r,o){t.execute&&t.execute(Y({command:t},ju(this.textArea)),this.textApi,n,r,o)}}function du(e){e.stopPropagation(),e.preventDefault()}function ag(e,t){du(e);var n=e.target,r=new Tp(n),o={start:n.selectionStart,end:n.selectionEnd};if(o=$a({text:n.value,selection:o}),!(t<0&&o.start<=0||t>0&&o.end>=n.value.length)){var i=n.value.slice(o.start,o.end);if(t<0){var s=$a({text:n.value,selection:{start:o.start-1,end:o.start-1}}),a=n.value.slice(s.start,s.end);r.setSelectionRange({start:s.start,end:o.end}),is(n,i+`
|
|
79
|
+
`+a),r.setSelectionRange({start:s.start,end:s.start+i.length})}else{var l=$a({text:n.value,selection:{start:o.end+1,end:o.end+1}}),u=n.value.slice(l.start,l.end);r.setSelectionRange({start:o.start,end:l.end}),is(n,u+`
|
|
80
|
+
`+i),r.setSelectionRange({start:l.end-i.length,end:l.end})}}}function zR(e,t,n){t===void 0&&(t=2),n===void 0&&(n=!1);var r=e.target,o=r.value.substr(0,r.selectionStart),i=o.split(`
|
|
81
|
+
`),s=i[i.length-1],a=new Tp(r);if(!n&&e.code&&e.code.toLowerCase()==="tab"){du(e);var l=new Array(t+1).join(" ");if(r.selectionStart!==r.selectionEnd){var u=r.value.substring(0,r.selectionStart).split(`
|
|
82
|
+
`),d=r.value.substring(0,r.selectionEnd).split(`
|
|
83
|
+
`),f=[];d.forEach((N,O)=>{N!==u[O]&&f.push(N)});var h=f.join(`
|
|
84
|
+
`),p=r.value.substring(r.selectionStart,r.selectionEnd),m=r.value.substring(0,r.selectionStart).length;a.setSelectionRange({start:r.value.indexOf(h),end:r.selectionEnd});var b=Ep(h,e.shiftKey?"":l),y=b.modifiedText;e.shiftKey&&(y=y.split(`
|
|
85
|
+
`).map(N=>N.replace(new RegExp("^"+l),"")).join(`
|
|
86
|
+
`)),a.replaceSelection(y);var x=e.shiftKey?-t:t,C=e.shiftKey?-f.length*t:f.length*t;a.setSelectionRange({start:m+x,end:m+p.length+C})}else return is(r,l)}else if(e.keyCode===13&&e.code.toLowerCase()==="enter"&&(/^(-|\*)\s/.test(s)||/^\d+.\s/.test(s))&&!e.shiftKey){du(e);var v=`
|
|
87
|
+
- `;return s.startsWith("*")&&(v=`
|
|
88
|
+
* `),(s.startsWith("- [ ]")||s.startsWith("- [X]")||s.startsWith("- [x]"))&&(v=`
|
|
89
|
+
- [ ] `),/^\d+.\s/.test(s)&&(v=`
|
|
90
|
+
`+(parseInt(s)+1)+". "),is(r,v)}else if(e.code&&e.code.toLowerCase()==="keyd"&&e.ctrlKey){du(e);var S={start:r.selectionStart,end:r.selectionEnd},I=S;S=$a({text:r.value,selection:S});var T=r.value.slice(S.start,S.end);a.setSelectionRange({start:S.end,end:S.end}),is(r,`
|
|
91
|
+
`+T),a.setSelectionRange({start:I.start,end:I.end})}else e.code&&e.code.toLowerCase()==="arrowup"&&e.altKey?ag(e,-1):e.code&&e.code.toLowerCase()==="arrowdown"&&e.altKey&&ag(e,1)}var UR=["prefixCls","onChange"],VR=["markdown","commands","fullscreen","preview","highlightEnable","extraCommands","tabSize","defaultTabEnable","autoFocusEnd","textareaWarp","dispatch"];function WR(e){var{prefixCls:t,onChange:n}=e,r=Ze(e,UR),o=W.useContext(Is),{markdown:i,commands:s,fullscreen:a,preview:l,highlightEnable:u,extraCommands:d,tabSize:f,defaultTabEnable:h,autoFocusEnd:p,textareaWarp:m,dispatch:b}=o;Ze(o,VR);var y=W.useRef(null),x=W.useRef(),C=W.useRef({fullscreen:a,preview:l});W.useEffect(()=>{C.current={fullscreen:a,preview:l,highlightEnable:u}},[a,l,u]),W.useEffect(()=>{if(y.current&&b){var S=new Sp(y.current);x.current=S,b({textarea:y.current,commandOrchestrator:S})}},[]),W.useEffect(()=>{if(p&&y.current&&m){y.current.focus();var S=y.current.value.length;y.current.setSelectionRange(S,S),setTimeout(()=>{m&&(m.scrollTop=m.scrollHeight),y.current&&(y.current.scrollTop=y.current.scrollHeight)},0)}},[m]);var v=S=>{zR(S,f,h),jx(S,[...s||[],...d||[]],x.current,b,C.current)};return W.useEffect(()=>(y.current&&y.current.addEventListener("keydown",v),()=>{y.current&&y.current.removeEventListener("keydown",v)}),[]),c.jsx("textarea",Y({autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1},r,{ref:y,className:t+"-text-input "+(r.className?r.className:""),value:i,onChange:S=>{b&&b({markdown:S.target.value}),n&&n(S)}}))}var qR=["prefixCls","className","onScroll","renderTextarea"];function YR(e){var t=e||{},{prefixCls:n,className:r,onScroll:o,renderTextarea:i}=t,s=Ze(t,qR),{markdown:a,scrollTop:l,commands:u,extraCommands:d,dispatch:f}=W.useContext(Is),h=W.useRef(null),p=W.useRef(),m=W.createRef();W.useEffect(()=>{var y={};m.current&&(y.textareaWarp=m.current||void 0,m.current.scrollTop=l||0),f&&f(Y({},y))},[]),W.useEffect(()=>{if(h.current&&f){var y=new Sp(h.current);p.current=y,f({textarea:h.current,commandOrchestrator:y})}},[]);var b={WebkitTextFillColor:"initial",overflow:"auto"};return c.jsx("div",{ref:m,className:n+"-area "+(r||""),onScroll:o,children:c.jsx("div",{className:n+"-text",children:i?W.cloneElement(i(Y({},s,{value:a,autoComplete:"off",autoCorrect:"off",spellCheck:"false",autoCapitalize:"off",className:n+"-text-input",style:{WebkitTextFillColor:"inherit",overflow:"auto"}}),{dispatch:f,onChange:s.onChange,shortcuts:jx,useContext:{commands:u,extraCommands:d,commandOrchestrator:p.current}}),{ref:h}):c.jsx(W.Fragment,{children:c.jsx(WR,Y({prefixCls:n},s,{style:b}))})})})}function KR(e){var{prefixCls:t,groupName:n,commands:r,children:o}=e||{},{barPopup:i={}}=W.useContext(Is);return W.useMemo(()=>c.jsx("div",{className:t+"-toolbar-child "+(n&&i[n]?"active":""),onClick:s=>s.stopPropagation(),children:Array.isArray(r)?c.jsx(Vx,Y({commands:r},e,{isChild:!0})):o}),[r,i,n,t])}function lg(e){var{prefixCls:t,overflow:n}=e,{fullscreen:r,preview:o,barPopup:i={},components:s,commandOrchestrator:a,dispatch:l}=W.useContext(Is),u=W.useRef("");function d(f,h){if(l){var p={barPopup:Y({},i)};f.keyCommand==="preview"&&(p.preview=f.value),f.keyCommand==="fullscreen"&&(p.fullscreen=!r),e.commands&&f.keyCommand==="group"?e.commands.forEach(m=>{h===m.groupName?p.barPopup[h]=!0:m.keyCommand&&(p.barPopup[m.groupName]=!1)}):(h||f.parent)&&Object.keys(p.barPopup||{}).forEach(m=>{p.barPopup[m]=!1}),Object.keys(p).length&&l(Y({},p)),a&&a.executeCommand(f)}}return W.useEffect(()=>{document&&n&&(r?document.body.style.overflow="hidden":(u.current||(u.current=window.getComputedStyle(document.body,null).overflow),document.body.style.overflow=u.current))},[r,u,n]),c.jsx("ul",{children:(e.commands||[]).map((f,h)=>{if(f.keyCommand==="divider")return c.jsx("li",Y({},f.liProps,{className:t+"-toolbar-divider"}),h);if(!f.keyCommand)return c.jsx(W.Fragment,{},h);var p=r&&f.keyCommand==="fullscreen"||f.keyCommand==="preview"&&o===f.value,m=f.children&&typeof f.children=="function"?f.children({getState:()=>a.getState(),textApi:a?a.textApi:void 0,close:()=>d({},f.groupName),execute:()=>d({execute:f.execute}),dispatch:l}):void 0,b=i&&o&&o==="preview"&&!/(preview|fullscreen)/.test(f.keyCommand),y=s?.toolbar||f.render,x=y&&typeof y=="function"?y(f,!!b,d,h):null;return c.jsxs("li",Y({},f.liProps,{className:p?"active":"",children:[x&&W.isValidElement(x)&&x,!x&&!f.buttonProps&&f.icon,!x&&f.buttonProps&&W.createElement("button",Y({type:"button",key:h,disabled:b,"data-name":f.name},f.buttonProps,{onClick:C=>{C.stopPropagation(),d(f,f.groupName)}}),f.icon),f.children&&c.jsx(KR,{overflow:n,groupName:f.groupName,prefixCls:t,children:m,commands:Array.isArray(f.children)?f.children:void 0})]}),h)})})}function Vx(e){e===void 0&&(e={});var{prefixCls:t,isChild:n,className:r}=e,{commands:o,extraCommands:i}=W.useContext(Is);return c.jsxs("div",{className:t+"-toolbar "+r,children:[c.jsx(lg,Y({},e,{commands:e.commands||o||[]})),!n&&c.jsx(lg,Y({},e,{commands:i||[]}))]})}function ug(e){var{hideToolbar:t,toolbarBottom:n,placement:r,overflow:o,prefixCls:i}=e;if(t||r==="bottom"&&!n||r==="top"&&n)return null;var s=n?"bottom":"";return c.jsx(Vx,{prefixCls:i,overflow:o,className:s})}var GR=e=>{var{prefixCls:t,onChange:n}=e||{},r=W.useRef(null),o=W.useRef(),i=W.useRef(e.height);W.useEffect(()=>{i.current!==e.height&&(i.current=e.height)},[e.height]);function s(d){if(o.current){var f,h=d.clientY||((f=d.changedTouches[0])==null?void 0:f.clientY),p=o.current.height+h-o.current.dragY;p>=e.minHeight&&p<=e.maxHeight&&n&&n(o.current.height+(h-o.current.dragY))}}function a(){var d,f;o.current=void 0,document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),(d=r.current)==null||d.removeEventListener("touchmove",s),(f=r.current)==null||f.removeEventListener("touchend",a)}function l(d){var f,h,p;d.preventDefault();var m=d.clientY||((f=d.changedTouches[0])==null?void 0:f.clientY);o.current={height:i.current,dragY:m},document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),(h=r.current)==null||h.addEventListener("touchmove",s,{passive:!1}),(p=r.current)==null||p.addEventListener("touchend",a,{passive:!1})}W.useEffect(()=>{if(document){var d,f;(d=r.current)==null||d.addEventListener("touchstart",l,{passive:!1}),(f=r.current)==null||f.addEventListener("mousedown",l)}return()=>{if(document){var h;(h=r.current)==null||h.removeEventListener("touchstart",l),document.removeEventListener("mousemove",s)}}},[]);var u=W.useMemo(()=>c.jsx("svg",{viewBox:"0 0 512 512",height:"100%",children:c.jsx("path",{fill:"currentColor",d:"M304 256c0 26.5-21.5 48-48 48s-48-21.5-48-48 21.5-48 48-48 48 21.5 48 48zm120-48c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48zm-336 0c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z"})}),[]);return c.jsx("div",{className:t+"-bar",ref:r,children:u})},QR=["prefixCls","className","value","commands","commandsFilter","direction","extraCommands","height","enableScroll","visibleDragbar","highlightEnable","preview","fullscreen","overflow","previewOptions","textareaProps","maxHeight","minHeight","autoFocus","autoFocusEnd","tabSize","defaultTabEnable","onChange","onStatistics","onHeightChange","hideToolbar","toolbarBottom","components","renderTextarea"];function XR(e){return e===void 0&&(e={}),Object.keys(e).forEach(t=>{e[t]=!1}),e}var ZR=W.forwardRef((e,t)=>{var n=e||{},{prefixCls:r="w-md-editor",className:o,value:i,commands:s=$R(),commandsFilter:a,direction:l,extraCommands:u=HR(),height:d=200,enableScroll:f=!0,visibleDragbar:h=typeof e.visiableDragbar=="boolean"?e.visiableDragbar:!0,highlightEnable:p=!0,preview:m="live",fullscreen:b=!1,overflow:y=!0,previewOptions:x={},textareaProps:C,maxHeight:v=1200,minHeight:S=100,autoFocus:I,autoFocusEnd:T=!1,tabSize:N=2,defaultTabEnable:O=!1,onChange:F,onStatistics:B,onHeightChange:j,hideToolbar:D,toolbarBottom:H=!1,components:_,renderTextarea:L}=n,$=Ze(n,QR),K=s.map(we=>a?a(we,!1):we).filter(Boolean),G=u.map(we=>a?a(we,!0):we).filter(Boolean),[q,R]=W.useReducer(aR,{markdown:i,preview:m,components:_,height:d,minHeight:S,highlightEnable:p,tabSize:N,defaultTabEnable:O,scrollTop:0,scrollTopPreview:0,commands:K,extraCommands:G,fullscreen:b,barPopup:{}}),oe=W.useRef(null),se=W.useRef(null),z=W.useRef(f);W.useImperativeHandle(t,()=>Y({},q,{container:oe.current,dispatch:R})),W.useMemo(()=>z.current=f,[f]),W.useEffect(()=>{var we={};oe.current&&(we.container=oe.current||void 0),we.markdown=i||"",we.barPopup={},R&&R(Y({},q,we))},[]);var pe=[o,"wmde-markdown-var",l?r+"-"+l:null,r,q.preview?r+"-show-"+q.preview:null,q.fullscreen?r+"-fullscreen":null].filter(Boolean).join(" ").trim();W.useMemo(()=>i!==q.markdown&&R({markdown:i||""}),[i,q.markdown]),W.useMemo(()=>m!==q.preview&&R({preview:m}),[m]),W.useMemo(()=>N!==q.tabSize&&R({tabSize:N}),[N]),W.useMemo(()=>p!==q.highlightEnable&&R({highlightEnable:p}),[p]),W.useMemo(()=>I!==q.autoFocus&&R({autoFocus:I}),[I]),W.useMemo(()=>T!==q.autoFocusEnd&&R({autoFocusEnd:T}),[T]),W.useMemo(()=>b!==q.fullscreen&&R({fullscreen:b}),[b]),W.useMemo(()=>d!==q.height&&R({height:d}),[d]),W.useMemo(()=>d!==q.height&&j&&j(q.height,d,q),[d,j,q]),W.useMemo(()=>s!==q.commands&&R({commands:K}),[e.commands]),W.useMemo(()=>u!==q.extraCommands&&R({extraCommands:G}),[e.extraCommands]);var J=W.useRef(),Q=W.useRef("preview"),re=W.useRef(!1);W.useMemo(()=>{J.current=q.textareaWarp,q.textareaWarp&&(q.textareaWarp.addEventListener("mouseover",()=>{Q.current="text"}),q.textareaWarp.addEventListener("mouseleave",()=>{Q.current="preview"}))},[q.textareaWarp]);var ne=(we,ye)=>{if(z.current){var ze=J.current,Ne=se.current?se.current:void 0;if(re.current||(Q.current=ye,re.current=!0),ze&&Ne){var nt=(ze.scrollHeight-ze.offsetHeight)/(Ne.scrollHeight-Ne.offsetHeight);we.target===ze&&Q.current==="text"&&(Ne.scrollTop=ze.scrollTop/nt),we.target===Ne&&Q.current==="preview"&&(ze.scrollTop=Ne.scrollTop*nt);var _e=0;Q.current==="text"?_e=ze.scrollTop||0:Q.current==="preview"&&(_e=Ne.scrollTop||0),R({scrollTop:_e})}}},ae=r+"-preview "+(x.className||""),ie=we=>ne(we,"preview"),Z=W.useMemo(()=>c.jsx("div",{ref:se,className:ae,children:c.jsx(_x,Y({},x,{onScroll:ie,source:q.markdown||""}))}),[ae,x,q.markdown]),me=_?.preview&&_?.preview(q.markdown||"",q,R);me&&W.isValidElement(me)&&(Z=c.jsx("div",{className:ae,ref:se,onScroll:ie,children:me}));var le=Y({},$.style,{height:q.height||"100%"}),ue=()=>R({barPopup:Y({},XR(q.barPopup))}),Ie=we=>R({height:we}),Ce=we=>{if(F&&F(we.target.value,we,q),C&&C.onChange&&C.onChange(we),q.textarea&&q.textarea instanceof HTMLTextAreaElement&&B){var ye=new Sp(q.textarea),ze=ye.getState()||{};B(Y({},ze,{lineCount:we.target.value.split(`
|
|
92
|
+
`).length,length:we.target.value.length}))}};return c.jsx(Is.Provider,{value:Y({},q,{dispatch:R}),children:c.jsxs("div",Y({ref:oe,className:pe},$,{onClick:ue,style:le,children:[c.jsx(ug,{hideToolbar:D,toolbarBottom:H,prefixCls:r,overflow:y,placement:"top"}),c.jsxs("div",{className:r+"-content",children:[/(edit|live)/.test(q.preview||"")&&c.jsx(YR,Y({className:r+"-input",prefixCls:r,autoFocus:I},C,{onChange:Ce,renderTextarea:_?.textarea||L,onScroll:we=>ne(we,"text")})),/(live|preview)/.test(q.preview||"")&&Z]}),h&&!q.fullscreen&&c.jsx(GR,{prefixCls:r,height:q.height,maxHeight:v,minHeight:S,onChange:Ie}),c.jsx(ug,{hideToolbar:D,toolbarBottom:H,prefixCls:r,overflow:y,placement:"bottom"})]}))})}),Wx=ZR;Wx.Markdown=_x;const Od={scopeName:"source.malloy",patterns:[{include:"#malloy-language"}],repository:{"malloy-language":{patterns:[{include:"#sql-string"},{include:"#comments"},{include:"#tags"},{include:"#strings"},{include:"#numbers"},{include:"#keywords"},{include:"#properties"},{include:"#functions"},{include:"#datetimes"},{include:"#identifiers-quoted"},{include:"#types"},{include:"#constants"},{include:"#timeframes"},{include:"#identifiers-unquoted"}]},"malloy-matched":{begin:"{",end:"}",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"malloy-in-sql":{begin:"%{",name:"source.malloy-in-sql",end:"}%?",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"sql-string":{patterns:[{begin:'(\\b[A-Za-z_][A-Za-z_0-9]*)(\\s*\\.\\s*)(sql)(\\s*\\(\\s*)(""")',end:'"""',beginCaptures:{1:{name:"variable.other"},3:{name:"keyword.control.sql"},5:{name:"punctuation.sql-block.open"}},endCaptures:{0:{name:"punctuation.sql-block.close"}},name:"source.sql",patterns:[{include:"#malloy-in-sql"},{include:"source.sql"}]}]},functions:{patterns:[{match:"(?i)\\b(count)(\\s*\\()(distinct)",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.function.modifier"}}},{match:"(?i)\\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(!)(timestamp|number|string|boolean|date)?(\\s*\\()",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.type"}}}]},datetimes:{patterns:[{match:"(?i)@[0-9]{4}-[0-9]{2}-[0-9]{2}[ T][0-9]{2}:[0-9]{2}((:[0-9]{2})(([\\.,][0-9]+)(\\[[A-Za-z_/]+\\])?)?)?",name:"constant.numeric.timestamp"},{match:"(?i)@[0-9]{4}(-Q[1-4]|-[0-9]{2}(-[0-9]{2}(-WK)?)?)?",name:"constant.numeric.date"}]},"identifiers-quoted":{patterns:[{match:"`[^`]*`",name:"variable.other.quoted"}]},"identifiers-unquoted":{patterns:[{match:"(?i)\\b[A-Za-z_][A-Za-z_0-9]*\\b",name:"variable.other"}]},timeframes:{patterns:[{match:"(?i)\\b((year|quarter|month|week|day|hour|minute|second)s?)\\b",name:"keyword.other.timeframe"},{match:"(?i)\\b(day_of_year|day_of_month)\\b",name:"keyword.other.timeframe"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]},tags:{patterns:[{match:"##\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:'#"',end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{match:"#\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:"#\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"##\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"#",end:"\\n",beginCaptures:{0:{name:"string.quoted"}},name:"string.quoted"}],repository:{"tag-values":{name:"support.type.property-name.json",match:'(-)?((?:[^\\s=#]+)|(?:"[^#]+"))(?:\\s*(=)\\s*((?:[^\\s=#]+)|(?:"[^#]+")))?',captures:{1:{name:"keyword.control.negate"},2:{name:"support.type.property-name.json"},3:{name:"keyword.operator.comparison.ts"},4:{name:"string.quoted"}}}}},strings:{patterns:[{begin:"'",end:"'",beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.single",patterns:[{include:"#escapes"}]},{begin:'"',end:'"',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.double",patterns:[{include:"#escapes"}]},{begin:'"""',end:'"""',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.triple"},{begin:"(?i)[r|/]'",end:"'",name:"string.regexp",patterns:[{include:"#regex-escapes"}]}],repository:{escapes:{name:"constant.character.escape",match:"\\\\(u[A-Fa-f0-9]{4}|.)",captures:{0:{name:"constant.character.escape"}}},"regex-escapes":{name:"constant.character.escape",match:"\\\\.",captures:{0:{name:"constant.character.escape"}}}}},numbers:{match:"(?i)(\\b((0|[1-9][0-9]*)(E[+-]?[0-9]+|\\.[0-9]*)?)|\\.[0-9]+)",name:"constant.numeric"},constants:{patterns:[{match:"(?i)\\bnull\\b",name:"constant.language.null"},{match:"(?i)\\btrue\\b",name:"constant.language.true"},{match:"(?i)\\bfalse\\b",name:"constant.language.false"}]},types:{patterns:[{match:"(?i)\\bstring\\b",name:"entity.name.type.string"},{match:"(?i)\\bnumber\\b",name:"entity.name.type.number"},{match:"(?i)\\bdate\\b",name:"entity.name.type.date"},{match:"(?i)\\btimestamp\\b",name:"entity.name.type.timestamp"},{match:"(?i)\\bboolean\\b",name:"entity.name.type.boolean"}]},properties:{patterns:[{match:"(?i)\\baccept\\b",name:"keyword.control.accept"},{match:"(?i)\\bselect\\b",name:"keyword.control.select"},{match:"(?i)\\bconnection\\b",name:"keyword.control.connection"},{match:"(?i)\\brun\\b",name:"keyword.control.run"},{match:"(?i)\\bextend\\b",name:"keyword.control.extend"},{match:"(?i)\\brefine\\b",name:"keyword.control.refine"},{match:"(?i)\\baggregate\\b",name:"keyword.control.aggregate"},{match:"(?i)\\bsample\\b",name:"keyword.control.sample"},{match:"(?i)\\bcalculate\\b",name:"keyword.control.calculate"},{match:"(?i)\\btimezone\\b",name:"keyword.control.timezone"},{match:"(?i)\\bdimension\\b",name:"keyword.control.dimension"},{match:"(?i)\\bexcept\\b",name:"keyword.control.except"},{match:"(?i)\\bsource\\b",name:"keyword.control.source"},{match:"(?i)\\bgroup_by\\b",name:"keyword.control.group_by"},{match:"(?i)\\bhaving\\b",name:"keyword.control.having"},{match:"(?i)\\bindex\\b",name:"keyword.control.index"},{match:"(?i)\\bjoin_one\\b",name:"keyword.control.join_one"},{match:"(?i)\\bwith\\b",name:"keyword.control.with"},{match:"(?i)\\bjoin_many\\b",name:"keyword.control.join_many"},{match:"(?i)\\bjoin_cross\\b",name:"keyword.control.join_cross"},{match:"(?i)\\blimit\\b",name:"keyword.control.limit"},{match:"(?i)\\bmeasure\\b",name:"keyword.control.measure"},{match:"(?i)\\bnest\\b",name:"keyword.control.nest"},{match:"(?i)\\border_by\\b",name:"keyword.control.order_by"},{match:"(?i)\\bpartition_by\\b",name:"keyword.control.partition_by"},{match:"(?i)\\bprimary_key\\b",name:"keyword.control.primary_key"},{match:"(?i)\\bproject\\b",name:"keyword.control.project"},{match:"(?i)\\bquery\\b",name:"keyword.control.query"},{match:"(?i)\\brename\\b",name:"keyword.control.rename"},{match:"(?i)\\btop\\b",name:"keyword.control.top"},{match:"(?i)\\bview\\b",name:"keyword.control.view"},{match:"(?i)\\bwhere\\b",name:"keyword.control.where"},{match:"(?i)\\bdeclare\\b",name:"keyword.control.declare"}]},keywords:{patterns:[{match:"(?i)\\bis\\b",name:"keyword.control.is"},{match:"(?i)\\bon\\b",name:"keyword.control.on"},{match:"(?i)\\bnot\\b",name:"keyword.other.not"},{match:"(?i)\\bor\\b",name:"keyword.other.or"},{match:"(?i)\\bdesc\\b",name:"keyword.control.desc"},{match:"(?i)\\bby\\b",name:"keyword.control.by"},{match:"(?i)\\band\\b",name:"keyword.other.and"},{match:"(?i)\\basc\\b",name:"keyword.control.asc"},{match:"(?i)\\bfor\\b",name:"keyword.other.for"},{match:"(?i)\\belse\\b",name:"keyword.other.else"},{match:"(?i)\\bto\\b",name:"keyword.other.to"},{match:"(?i)\\bwhen\\b",name:"keyword.other.when"},{match:"(?i)\\bpick\\b",name:"keyword.other.pick"},{match:"(?i)\\bimport\\b",name:"keyword.control.import"}]}}},JR={...Od,patterns:[...Od.patterns,{include:"#docvar"}],repository:{...Od.repository,docvar:{patterns:[{match:"\\<\\<[^(\\>\\>)]*\\>\\>",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"markup.italic.markdown"}]}}},eN={name:"Malloy SQL",scopeName:"source.malloy-sql",patterns:[{include:"#malloysql-sql"}],repository:{"malloysql-sql":{beginCaptures:{0:{name:"entity.other.attribute.malloy-sql"},1:{name:"entity.other.attribute.malloy-sql"},3:{name:"comment.line.double-slash"}},name:"meta.embedded.block.malloysql.sql",patterns:[{include:"#comments"},{begin:"%{",end:"}%",beginCaptures:{0:{name:"punctuation.definition.malloy-sql"}},endCaptures:{0:{name:"punctuation.definition.malloy-sql"}},name:"meta.embedded.block.malloy",patterns:[{include:"source.malloy"}]},{include:"source.sql"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]}}},tN="github-light",nN="github-dark";let Md;function rN(){return Md||(Md=(async()=>{const[{createHighlighterCore:e},{createOnigurumaEngine:t},{default:n},{default:r},{default:o},{default:i},{default:s}]=await Promise.all([Promise.resolve().then(()=>require("./core-BJUrppec.cjs.js")),Promise.resolve().then(()=>require("./engine-oniguruma-BkproSVE.cjs.js")),Promise.resolve().then(()=>require("./sql-BqWZrLHB.cjs.js")),Promise.resolve().then(()=>require("./json-y-J1j5EW.cjs.js")),Promise.resolve().then(()=>require("./typescript-BqvpT6pB.cjs.js")),Promise.resolve().then(()=>require("./github-light-BFTOhCbz.cjs.js")),Promise.resolve().then(()=>require("./github-dark-BKL9xNgN.cjs.js"))]);return e({engine:t(Promise.resolve().then(()=>require("./wasm-Dw4u1m6u.cjs.js"))),themes:[i,s],langs:[n,r,o,{name:"malloy",scopeName:"source.malloy",embeddedLangs:["sql"],...JR},{name:"malloysql",scopeName:"source.malloy-sql",embeddedLangs:["sql"],...eN}]})})()),Md}async function $u(e,t,n="light"){return(await rN()).codeToHtml(e,{lang:t,theme:n==="dark"?nN:tN})}function Xt(e){const{server:t}=De.useServer(),n={...e,queryKey:[...e.queryKey,t],queryFn:async()=>{try{return await e.queryFn()}catch(r){if(r&&typeof r=="object"&&"response"in r){const o=r;if(o.response?.data){const i=new Error(o.response.data.message||o.message);throw i.status=o.response.status,i.data=o.response.data,i}}throw r}},retry:!1,throwOnError:!1};return Lr.useQuery(n,De.globalQueryClient)}function vn(e){const t={...e,mutationFn:async n=>{try{return await e.mutationFn(n)}catch(r){if(r&&typeof r=="object"&&"response"in r){const o=r;if(o.response?.data){const i=new Error(o.response.data.message||o.message);throw i.status=o.response.status,i.data=o.response.data,i}}throw r}},retry:!1,throwOnError:!1};return Lr.useMutation(t,De.globalQueryClient)}const Ht=e=>{const t=new URL(e),n={};if(t.protocol!=="publisher:")throw new Error(`Failed to parse resource URI: ${e}`);const r=(t.hostname+t.pathname).split("/");for(let o=0;o<r.length;o+=2){const i=r[o];i==="environments"?n.environmentName=decodeURI(r[o+1])||void 0:i==="packages"?n.packageName=decodeURI(r[o+1])||void 0:i==="connections"?n.connectionName=decodeURI(r[o+1])||void 0:i==="models"&&(n.modelPath=decodeURI(r.slice(o+1).join("/"))||void 0)}if(n.versionId=t.searchParams.get("versionId")||void 0,!n.environmentName)throw new Error(`Failed to parse resource URI: ${e}`);return n},Cl=e=>{if(!e.environmentName)throw new Error(`Failed to encode resource URI, missing environment name: ${e}`);let t=`publisher://environments/${e.environmentName}`;return e.packageName&&(t+=`/packages/${e.packageName}`),e.connectionName&&(t+=`/connections/${e.connectionName}`),e.modelPath&&(t+=`/models/${e.modelPath}`),e.packageName&&e.versionId&&(t+=`?versionId=${e.versionId}`),t};function kp({sourceAndPaths:e,selectedSourceIndex:t,existingQuery:n,onQueryChange:r,onSourceChange:o,resourceUri:i}){return W.useEffect(()=>{o&&o(t)},[t,o]),c.jsx(De.StyledCardMedia,{children:c.jsxs(Ot.Stack,{spacing:2,component:"section",children:[c.jsx(qx,{sourceAndPath:e[t],existingQuery:n,onChange:s=>{r&&r(s)},resourceUri:i}),c.jsx(Ot.Box,{height:"5px"})]})})}function fu(){return{query:void 0,malloyQuery:void 0,malloyResult:void 0}}function oN({sourceAndPath:e,onChange:t,existingQuery:n,explorerComponents:r,QueryBuilder:o,resourceUri:i}){const[s,a]=W.useState(n||fu()),[l,u]=W.useState(void 0);W.useEffect(()=>{n&&a(n)},[n]);const[d,f]=W.useState([]),{MalloyExplorerProvider:h,QueryPanel:p,ResizableCollapsiblePanel:m,ResultPanel:b,SourcePanel:y}=r;W.useEffect(()=>{t&&t(s)},[t,s]);const{environmentName:x,packageName:C,versionId:v}=Ht(i),{apiClients:S}=De.useServer(),I=vn({mutationFn:()=>{const F=typeof s?.malloyQuery=="string"?s.malloyQuery:new o.ASTQuery({source:e.sourceInfo,query:s?.malloyQuery}).toMalloy();return u({executionState:"running",query:s?.malloyQuery,queryResolutionStartMillis:Date.now(),onCancel:()=>{I.reset(),u(void 0)},response:{result:{}}}),a({...s,query:F}),S.models.executeQueryModel(x,C,e.modelPath,{query:F,sourceName:void 0,queryName:void 0,versionId:v})},onSuccess:F=>{if(F){const B=JSON.parse(F.data.result);a({...s,malloyResult:B}),u(j=>j?{...j,executionState:"finished",response:{result:B}}:void 0)}},onError:F=>{u(void 0),console.error("Query execution error:",F)}}),[T,N]=W.useState(e.sourceInfo.name);W.useEffect(()=>{T!==e.sourceInfo.name&&(N(e.sourceInfo.name),a(fu()),u(void 0))},[e,T]);const O=W.useCallback(F=>{a({...s,malloyQuery:F,malloyResult:void 0})},[s]);return T!==e.sourceInfo.name?c.jsx("div",{children:"Loading..."}):c.jsx(De.StyledExplorerContent,{sx:{border:"1px solid #e0e0e0",borderRadius:"8px",overflow:"hidden"},children:c.jsx(h,{source:e.sourceInfo,query:s?.malloyQuery,topValues:[],onFocusedNestViewPathChange:f,focusedNestViewPath:d,onQueryChange:O,children:c.jsxs("div",{style:{display:"flex",height:"100%",overflowY:"auto"},children:[c.jsx(m,{isInitiallyExpanded:!0,initialWidth:180,minWidth:180,icon:"database",title:e.sourceInfo.name,children:c.jsx(y,{onRefresh:()=>a(fu())})}),c.jsx(m,{isInitiallyExpanded:!0,initialWidth:280,minWidth:280,icon:"filterSliders",title:"Query",children:c.jsx(p,{runQuery:()=>{console.log(`running query with: ${s?.malloyQuery}`);try{I.mutate()}catch(F){console.error("Error running query:",F)}}})}),c.jsx(b,{source:e.sourceInfo,draftQuery:s?.malloyQuery,setDraftQuery:F=>a({...s,malloyQuery:F}),submittedQuery:l,options:{showRawQuery:!0}})]})})},e.sourceInfo.name)}function qx(e){const[t,n]=W.useState(null),[r,o]=W.useState(null),[i,s]=W.useState(!0);return W.useEffect(()=>{let a=!0;return Promise.all([import("@malloydata/malloy-explorer"),import("@malloydata/malloy-query-builder")]).then(([l,u])=>{a&&(n(l),o(u),s(!1))}).catch(l=>{console.error("Failed to load Malloy components:",l),a&&s(!1)}),()=>{a=!1}},[]),i||!t||!r?c.jsx(De.StyledExplorerPage,{children:c.jsx(De.StyledExplorerContent,{children:c.jsx(Ot.Box,{sx:{alignItems:"center",justifyContent:"center",height:"200px",color:"text.secondary"},children:"Loading explorer..."})})}):c.jsx(oN,{...e,explorerComponents:t,QueryBuilder:r,resourceUri:e.resourceUri})}const Yx=mt(c.jsx("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}));function Sn({text:e,size:t=20,color:n="primary",thickness:r=3.6,centered:o=!0,spacing:i=2,textVariant:s="body2"}){const a=c.jsxs(w.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:i},children:[c.jsx(w.CircularProgress,{size:t,color:n,thickness:r}),e&&c.jsx(w.Typography,{variant:s,color:"text.secondary",children:e})]});return o?c.jsx(w.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",width:"100%"},children:a}):a}const iN=new Set(["warn","error"]);function sN(e){if(!e?.length)return;const t=[];let n=!1;for(const r of e)!r.message||!iN.has(r.severity??"")||(r.severity==="error"&&(n=!0),t.includes(r.message)||t.push(r.message));if(t.length)return{severity:n?"error":"warn",title:t.join(`
|
|
93
|
+
`)}}const aN=W.lazy(()=>Promise.resolve().then(()=>_W));function Os({result:e,maxHeight:t,maxResultSize:n=0,renderLogs:r}){const o=W.useRef(null),[i,s]=W.useState(t),[a,l]=W.useState(!1),u=sN(r);if(!e)return null;if(n>0&&e.length>n&&!a)return c.jsxs(w.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,p:4,backgroundColor:"#fafafa",border:"1px solid",borderColor:"#e0e0e0",borderRadius:1},children:[c.jsx(On.Warning,{sx:{fontSize:48,color:"#757575"}}),c.jsx(w.Typography,{variant:"h6",color:"text.secondary",align:"center",children:"Processing large results may cause browser performance issues. Proceed?"}),c.jsx(w.Button,{variant:"contained",color:"primary",onClick:()=>l(!0),children:"Proceed"})]});const f=c.jsx(Sn,{text:"Loading...",centered:!0,size:32}),h=Math.min(t,i);return c.jsxs(w.Box,{ref:o,sx:{position:"relative",height:"auto",border:"0px",borderRadius:0,overflow:"hidden"},children:[e&&c.jsx(W.Suspense,{fallback:f,children:c.jsx(aN,{result:e,height:h,onSizeChange:s})}),u&&c.jsx(w.Box,{sx:{position:"absolute",top:4,right:4,zIndex:1},children:c.jsx(w.Tooltip,{title:u.title,slotProps:{tooltip:{sx:{whiteSpace:"pre-line"}}},children:c.jsx(w.IconButton,{size:"small","aria-label":"Render tag warnings",sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"}},children:c.jsx(Yx,{fontSize:"small",color:u.severity==="error"?"error":"warning"})})})})]})}function lN({cell:e,sourceAndPaths:t,resourceUri:n,onQueryChange:r,onSourceChange:o}){const i={query:e.value,malloyResult:e.result?JSON.parse(e.result):void 0,malloyQuery:e.queryInfo?JSON.parse(e.queryInfo):void 0},s=t.findIndex(a=>a.sourceInfo.name===e.sourceName);return c.jsx(kp,{resourceUri:n,sourceAndPaths:t,selectedSourceIndex:s>=0?s:0,existingQuery:i,onQueryChange:r,onSourceChange:o})}function uN({cell:e,editingMalloy:t,editingMarkdown:n,sourceAndPaths:r,resourceUri:o,onCellChange:i,onClose:s,onEdit:a,onDelete:l,addButtonCallback:u}){const[d,f]=W.useState(e.value),[h,p]=W.useState(!1),[m,b]=W.useState(!1),[y,x]=W.useState(),[C]=W.useState(),[v,S]=W.useState(fu()),[I,T]=W.useState(!1),[N,O]=W.useState(e.sourceName?r.findIndex(se=>se.sourceInfo.name===e.sourceName):0),{mode:F}=De.usePublisherTheme();W.useEffect(()=>{e.isMarkdown||$u(e.value,"malloy",F).then(se=>{x(se)})},[e,F]),W.useEffect(()=>{document.documentElement.setAttribute("data-color-mode","light")});const[B,j]=W.useState(!1),D=()=>{l(),j(!1)},H=r.length===0,_=W.useCallback(()=>{const se=r[N],z=se?.modelPath||e.modelPath||"",pe=se?.sourceInfo.name||e.sourceName||"";i({...e,value:e.isMarkdown?d:v.query,result:v.malloyResult?JSON.stringify(v.malloyResult):void 0,queryInfo:v.malloyQuery?JSON.stringify(v.malloyQuery):void 0,sourceName:pe,modelPath:z})},[e,d,v,i,N,r]),L=c.jsx(w.Tooltip,{title:"Delete Cell",children:c.jsx(w.IconButton,{size:"small",onClick:()=>j(!0),children:c.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14zM10 11v6M14 11v6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),$=c.jsxs(w.Dialog,{open:B,onClose:()=>j(!1),children:[c.jsx(w.DialogTitle,{children:"Confirm Delete"}),c.jsx(w.DialogContent,{children:c.jsx(w.Typography,{children:"Are you sure you want to delete this cell?"})}),c.jsxs(w.DialogActions,{children:[c.jsx(w.Button,{onClick:()=>j(!1),children:"Cancel"}),c.jsx(w.Button,{onClick:D,color:"error",children:"Delete"})]})]}),K=()=>{_(),s()},G=e.isMarkdown?c.jsxs(c.Fragment,{children:[n?c.jsx(w.Tooltip,{title:"Save",children:c.jsx(w.IconButton,{size:"small",onClick:K,children:c.jsx(Hl,{})})}):c.jsx(w.Tooltip,{title:"Edit",children:c.jsx(w.IconButton,{size:"small",onClick:a,children:c.jsx(Pm,{})})}),!n&&L]}):c.jsxs(c.Fragment,{children:[!t&&c.jsx(w.Tooltip,{title:h?"Hide Code":"View Code",children:c.jsx(w.IconButton,{size:"small",onClick:()=>{p(!h)},children:c.jsx(vb,{})})}),!t&&e.result&&c.jsx(w.Tooltip,{title:m?"Hide Embedding":"View Embedding",children:c.jsx(w.IconButton,{size:"small",onClick:()=>{b(!m)},children:c.jsx(Kf,{})})}),t&&c.jsx(w.Tooltip,{title:"Save",children:c.jsx(w.IconButton,{size:"small",onClick:K,children:c.jsx(Hl,{})})}),!t&&c.jsx(w.Tooltip,{title:"Edit",children:c.jsx(w.IconButton,{size:"small",onClick:a,children:c.jsx(Pm,{})})}),!t&&L]}),q=t||n,R=n?c.jsx(w.Tooltip,{title:"Save",children:c.jsx(w.IconButton,{size:"small",onClick:K,children:c.jsx(Hl,{})})}):t?c.jsx(w.Tooltip,{title:"Save",children:c.jsx(w.IconButton,{size:"small",onClick:K,children:c.jsx(Hl,{})})}):null,oe=I&&c.jsx(w.Box,{sx:{position:"absolute",top:"4px",right:"4px",display:"flex",gap:"8px",backgroundColor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:"8px",padding:"2px 4px",boxShadow:1,zIndex:10},children:!q&&c.jsxs(c.Fragment,{children:[u(!0),u(!1),G]})||R});return c.jsxs(De.StyledCard,{sx:se=>({position:"relative",marginTop:"5px",marginBottom:"5px",borderWidth:"1.5px",backgroundColor:se.palette.background.paper,minHeight:"50px"}),onMouseEnter:()=>T(!0),onMouseLeave:()=>{T(!1)},children:[oe,e.isMarkdown?c.jsx(c.Fragment,{children:n?c.jsx(Wx,{value:d,preview:"edit",autoFocus:!0,onChange:se=>{f(se),i({...e,value:se})},onBlur:()=>{_(),I||K()}}):c.jsx(w.Box,{sx:{px:.5,pt:0,mt:0,"& h1, & h2, & h3, & h4, & h5, & h6":{mt:.5,mb:.5},"& p":{mt:.5,mb:.5},"& ul, & ol":{mt:.5,mb:.5},"& li":{mt:0,mb:0},"& pre, & code":{mt:.5,mb:.5},"& blockquote":{mt:.5,mb:.5}},children:e.value?c.jsx(w.Box,{onClick:a,sx:{cursor:"pointer"},children:c.jsx(wu,{children:e.value})}):c.jsxs(w.Box,{onClick:a,sx:{cursor:"pointer"},children:[c.jsx(w.Typography,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Markdown is empty"}),c.jsx(w.Typography,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})})}):c.jsxs(c.Fragment,{children:[c.jsx(w.Collapse,{in:m,timeout:"auto",unmountOnExit:!0,children:c.jsx(w.Stack,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:c.jsx(w.Typography,{component:"div",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:C}})})}),c.jsx(w.Collapse,{in:h,timeout:"auto",unmountOnExit:!0,children:c.jsx(w.Stack,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:c.jsx(w.Typography,{component:"div",className:"content",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:y}})})}),t&&(H?c.jsxs(c.Fragment,{children:[c.jsx(w.Typography,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"No Model Imports"}),c.jsx(w.Typography,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Please add a model import above."})]}):c.jsx(lN,{sourceAndPaths:r,resourceUri:o,onQueryChange:se=>{S(se)},onSourceChange:se=>{O(se)},cell:e})),!t&&e.result&&c.jsx(De.StyledCard,{variant:"outlined",sx:{borderRadius:0},children:c.jsx(Os,{result:e.result,maxHeight:800})}),!t&&!e.result&&c.jsxs(w.Box,{onClick:a,sx:{cursor:"pointer"},children:[c.jsx(w.Typography,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Explore is empty"}),c.jsx(w.Typography,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})]}),B&&$]})}const Kx=W.createContext(void 0);function cN({children:e,workbookStorage:t}){const n=W.useMemo(()=>({workbookStorage:t}),[t]);return c.jsx(Kx.Provider,{value:n,children:e})}function wp(){const e=W.useContext(Kx);if(!e)throw new Error("useWorkbookStorage must be used within a WorkbookStorageProvider");return e}const Fr=mt(c.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),dN=mt(c.jsx("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5z"}));function kn({error:e,context:t}){const n=e.data?.message||"Unknown Error";return c.jsxs(c.Fragment,{children:[t&&c.jsx(w.Typography,{variant:"body2",sx:{p:"10px",m:"auto"},children:t}),c.jsx("pre",{style:{whiteSpace:"pre-wrap",color:"red",padding:"10px",margin:"auto"},children:n})]})}function fN({initialSelectedModels:e,onModelChange:t,resourceUri:n}){const{environmentName:r,packageName:o,versionId:i}=Ht(n),{apiClients:s}=De.useServer(),{data:a,isLoading:l,isSuccess:u,isError:d,error:f}=Xt({queryKey:["models",r,o,i],queryFn:()=>s.models.listModels(r,o,i)}),[h,p]=W.useState(e||[]),[m,b]=W.useState(null);W.useEffect(()=>{p(e||[])},[e]);const y=v=>{const S=h.filter(I=>I!==v);p(S),t(S)},x=v=>{const S=[...h,v];p(S),t(S),b(null)};let C=[];return u&&a?.data&&(C=a.data.filter(v=>!h.includes(v.path)).map(v=>v.path)),d?c.jsx(kn,{error:f,context:`${r} > ${o} > Model Picker`}):c.jsxs(c.Fragment,{children:[c.jsxs(w.FormControl,{fullWidth:!0,children:[l&&c.jsx(w.Typography,{children:"Loading..."}),c.jsxs(w.Stack,{direction:"row",spacing:1,children:[h.map(v=>c.jsx(w.Chip,{label:v,onDelete:()=>y(v),deleteIcon:c.jsx(Fr,{}),sx:{marginBottom:"5px"}},v)),c.jsx(w.Button,{size:"small",startIcon:c.jsx(dN,{}),onClick:v=>b(v.currentTarget),disabled:l||d||C.length===0,children:"Add Model"})]})]}),c.jsxs(w.Menu,{anchorEl:m,open:!!m,onClose:()=>b(null),children:[c.jsx(w.Typography,{variant:"subtitle2",sx:{ml:1},children:"Models"}),c.jsx(w.Divider,{}),C.length===0?c.jsx(w.MenuItem,{disabled:!0,children:"No models available"}):C.map(v=>c.jsx(w.MenuItem,{onClick:()=>x(v),children:c.jsx(w.Typography,{variant:"body2",children:v})},v))]})]})}function Gx(){const e=rT.useNavigate();return(t,n)=>{if(!n||!n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.button!==1){e(t);return}const r=new URL(t,window.location.href).href;(n.metaKey||n.ctrlKey||n.button===1||n.shiftKey)&&window.open(r,"_blank")}}function pN({workbookPath:e,resourceUri:t}){const n=Gx(),{server:r,getAccessToken:o}=De.useServer(),{apiClients:i}=De.useServer(),{workbookStorage:s}=wp(),{environmentName:a,packageName:l}=Ht(t),[u,d]=W.useState(void 0),[f,h]=W.useState(void 0);if(!s)throw new Error("Workbook storage be provided via WorkbookStorageProvider");const[p,m]=W.useState(),[b,y]=W.useState(),[x,C]=W.useState(),[v,S]=W.useState([]),[I,T]=W.useState(null),[N,O]=W.useState(null),F=!!I,B=()=>{T(null),O(null)},j=(oe,se)=>{p&&(m(p.insertCell(se,{isMarkdown:oe,value:""})),oe?C(se):y(se),B(),console.log("handleAddCell",oe,se))},[D,H]=W.useState(!1),_=()=>{H(!0)},L=async()=>{e&&s&&await s.deleteWorkbook(e).then(()=>{h(void 0),d(void 0)}).catch(oe=>{h(`Error deleting workbook: ${oe.message}`),d(void 0)}),H(!1),n(`/${a}/${l}`)},$=()=>{H(!1)},K=W.useCallback(async()=>{if(!p){console.log("No workbook data ref");return}try{m(await p.saveWorkbook()),h(void 0),d("Workbook saved")}catch(oe){h(`Error saving workbook: ${oe.message}`),d(void 0)}},[p]);if(W.useEffect(()=>{if(!p)return;(async()=>{const se=new Map(v.map(({modelPath:J,sourceInfos:Q})=>[J,Q])),z=[],pe=[];for(const J of p.getModels())se.has(J)?z.push({modelPath:J,sourceInfos:se.get(J)}):(console.log("Fetching model from Publisher",J),pe.push(i.models.getModel(a,l,J,void 0).then(Q=>({modelPath:J,sourceInfos:Q.data.sourceInfos.map(re=>JSON.parse(re))}))));if(pe.length>0){const J=await Promise.all(pe);S([...z,...J])}else S(z)})()},[o,p,l,a,r]),W.useEffect(()=>{e&&ns.loadWorkbook(s,e).then(oe=>{m(oe)})},[e,s]),!p)return c.jsx("div",{children:"Loading..."});const G=oe=>{const se=[];for(const z of oe)for(const pe of z.sourceInfos)se.push({modelPath:z.modelPath,sourceInfo:pe});return se},q=(oe,se)=>c.jsx(w.Button,{size:"small",startIcon:c.jsx(fl,{}),onClick:()=>j(oe,se),variant:"contained",sx:{backgroundColor:z=>z.palette.background.paper,color:z=>z.palette.mode==="dark"?z.palette.grey[100]:z.palette.grey[700],boxShadow:"none","&:hover":{backgroundColor:z=>z.palette.mode==="dark"?z.palette.grey[500]:z.palette.grey[300],boxShadow:"none"}},children:oe?"Markdown":"Explore"}),R=c.jsxs(w.Box,{sx:{display:"flex",gap:1,justifyContent:"center",flex:2},children:[q(!1,p.getCells().length),q(!0,p.getCells().length)]});return c.jsxs(De.StyledCard,{variant:"outlined",children:[c.jsxs(De.StyledCardContent,{children:[c.jsx(w.Box,{sx:{mb:2},children:c.jsx(w.Box,{sx:{minHeight:"24px"},children:f?c.jsx(w.Typography,{color:"error",variant:"body2",children:f}):u?c.jsx(w.Typography,{color:"success",variant:"body2",children:u}):c.jsx("span",{children:" "})})}),c.jsxs(Ui,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[c.jsxs(Ui,{direction:"row",spacing:1,alignItems:"center",children:[c.jsx(w.Typography,{variant:"overline",sx:{fontSize:"13px",fontWeight:"bold",verticalAlign:"middle"},children:"Workbook"}),c.jsx(w.Typography,{variant:"subtitle2",sx:{fontSize:"13px",fontWeight:"normal",verticalAlign:"middle",ml:1},children:`${e.workspace} > ${e.path}`})]}),c.jsxs(Ui,{sx:{display:"flex",flexDirection:"row",gap:1},children:[c.jsx(w.Box,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:c.jsx(hN,{workbookData:p})}),c.jsxs(w.Box,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:[c.jsx(w.Button,{color:"error",onClick:_,size:"small",children:"Delete"}),c.jsxs(w.Dialog,{open:D,onClose:$,children:[c.jsx(w.DialogTitle,{children:"Delete Workbook"}),c.jsx(w.DialogContent,{children:c.jsxs(w.DialogContentText,{children:['Are you sure you want to delete the workbook "',e.path,'"? This action cannot be undone.']})}),c.jsxs(w.DialogActions,{children:[c.jsx(w.Button,{onClick:$,color:"primary",size:"small",children:"Cancel"}),c.jsx(w.Button,{onClick:L,color:"error",autoFocus:!0,size:"small",children:"Delete"})]})]})]})]})]}),c.jsx(w.Divider,{}),c.jsxs(Ui,{sx:{display:"flex",flexDirection:"row",width:"100%",mt:2},children:[c.jsx(w.Box,{sx:{flex:1},children:c.jsx(fN,{initialSelectedModels:p.getModels(),onModelChange:oe=>{m(p.setModels(oe)),K()},resourceUri:t})}),c.jsx(w.Box,{sx:{flex:1}})]})]}),c.jsx(De.StyledCardMedia,{children:c.jsxs(Ui,{children:[p.getCells().length===0&&c.jsxs(c.Fragment,{children:[c.jsx(w.Typography,{sx:{textAlign:"center",p:2,variant:"subtitle2",fontWeight:"medium"},children:"Workbook is empty"}),c.jsx(w.Typography,{variant:"body2",sx:{textAlign:"center",mb:2,variant:"body2"},children:"Click the + buttons to add a markdown or code cell."})]}),p.getCells().map((oe,se)=>c.jsx(W.Fragment,{children:c.jsx(uN,{cell:oe,resourceUri:t,addButtonCallback:z=>q(z,se),sourceAndPaths:G(v),editingMarkdown:x===se,editingMalloy:b===se,onDelete:()=>{m(p.deleteCell(se)),K()},onCellChange:z=>{m(p.setCell(se,z))},onEdit:()=>{oe.isMarkdown?C(se):y(se)},onClose:()=>{oe.isMarkdown?C(void 0):y(void 0),K()}},`${se}-${oe.isMarkdown}-${e.workspace}-${e.path}`)},`${se}-${p.getCells().length}`)),R,c.jsxs(w.Menu,{anchorEl:I,open:F,onClose:B,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(w.MenuItem,{onClick:()=>j(!0,N??0),children:"Add Markdown"}),c.jsx(w.MenuItem,{onClick:()=>j(!1,N??0),children:"Add Malloy"})]}),c.jsx(Ui,{sx:{flexDirection:"row",justifyContent:"flex-end",p:1}})]})})]})}function hN({workbookData:e}){const[t,n]=W.useState(!1),r=async()=>{if(!e)return;const o=e.toMalloyWorkbook();try{await navigator.clipboard.writeText(o),n(!0),setTimeout(()=>n(!1),1500)}catch{n(!1),alert("Failed to copy to clipboard")}};return c.jsx(w.Button,{color:"primary",onClick:r,size:"small",children:t?"Copied!":"Export"})}function Qx({onWorkbookClick:e}){const{workbookStorage:t}=wp(),[n,r]=W.useState([]),[o,i]=W.useState(void 0);return W.useEffect(()=>{t&&t.listWorkspaces(!1).then(s=>{const a=[];Promise.all(s.map(async l=>{await t.listWorkbooks(l).then(u=>{a.push(...u)}).catch(u=>{i(`Error listing workbooks: ${u.message}`)})})).then(()=>{r(a),i(void 0)})})},[t]),c.jsxs(c.Fragment,{children:[o&&c.jsx(w.Box,{sx:{mb:2},children:c.jsx(w.Typography,{color:"error",variant:"body2",children:o})}),c.jsx(w.Divider,{}),c.jsx(w.Box,{sx:{maxHeight:"300px",overflow:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"rgba(0,0,0,0.2)",borderRadius:"4px"}},children:c.jsxs(w.List,{dense:!0,children:[n.length===0&&c.jsx(w.ListItem,{children:c.jsx(w.ListItemText,{primary:"No workbooks found.",sx:{textAlign:"center"}})}),n.map(s=>c.jsx(w.ListItem,{onClick:a=>e(s,a),sx:{cursor:"pointer","&:hover":{backgroundColor:"action.hover"}},children:c.jsx(w.ListItemText,{primary:s.path})},s.path))]})})]})}const cg="Local";class mN{async listWorkspaces(t){return Promise.resolve([{name:cg,description:"Stored locally- only accessible to this browser",writeable:!0}])}async listWorkbooks(t){const n=[];for(let r=0;r<localStorage.length;r++){const o=localStorage.key(r);n.push({path:o,workspace:cg})}return n}async getWorkbook(t){const n=localStorage.getItem(t.path);if(n===null)throw new Error(`Notebook not found at path: ${t}`);return n}async deleteWorkbook(t){if(localStorage.getItem(t.path)===null)throw new Error(`Notebook not found at path: ${t}`);localStorage.removeItem(t.path)}async saveWorkbook(t,n){localStorage.setItem(t.path,n)}async moveWorkbook(t,n){const r=localStorage.getItem(t.path);if(r===null)throw new Error(`Notebook not found at path: ${t.path}`);localStorage.setItem(n.path,r),localStorage.removeItem(t.path)}}function gN({onWorkbookSelect:e}){const{workbookStorage:t}=wp(),[n,r]=W.useState(""),[o,i]=W.useState(""),[s,a]=W.useState([]),[l,u]=W.useState(null),[d,f]=W.useState(!1),[h,p]=W.useState(!1),m=!!l,b=T=>{u(T.currentTarget)},y=()=>{u(null)},x=()=>{p(!1)},C=()=>{f(!1),r(""),i("")};W.useEffect(()=>{t&&(console.log("fetching workspaces"),t.listWorkspaces(!0).then(T=>{a(T),T.length===1&&i(T[0].name)}).catch(T=>{console.error("Error fetching workspaces:",T),a([])}))},[t]);const v=(T,N)=>{p(!1),e(T,N)},S=T=>{f(!1),e({path:n,workspace:o},T),r(""),i("")},I=s.length===0;return c.jsxs(c.Fragment,{children:[c.jsx(w.Button,{"aria-controls":m?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":m?"true":void 0,onClick:b,variant:"contained",sx:{height:"40px",px:2,backgroundColor:"#fbbb04","&:hover":{backgroundColor:"#eab308"}},children:"Analyze Package"}),c.jsxs(w.Menu,{id:"basic-menu",anchorEl:l,open:m,onClose:y,MenuListProps:{"aria-labelledby":"basic-button",sx:{py:.5}},children:[c.jsxs(w.MenuItem,{onClick:()=>{f(!0),y()},sx:{py:1,px:2},disabled:I,children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Add,{fontSize:"small"})}),c.jsxs(w.ListItemText,{children:[c.jsx(w.Typography,{variant:"body2",fontWeight:500,children:"New Workbook"}),I?c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:"No workspaces available"}):c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:"Create a new analysis workbook"})]})]}),c.jsxs(w.MenuItem,{onClick:()=>{p(!0),y()},sx:{py:1,px:2},children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Launch,{fontSize:"small"})}),c.jsxs(w.ListItemText,{children:[c.jsx(w.Typography,{variant:"body2",fontWeight:500,children:"Open Workbook"}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:"Open an existing workbook"})]})]})]}),c.jsxs(w.Dialog,{open:d,onClose:C,maxWidth:"sm",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{pb:1,pt:2,px:2},children:[c.jsx(w.Typography,{fontWeight:600,sx:{fontSize:"1.5rem",mb:.5},children:"Create New Workbook"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Start a new analysis workbook to explore your data"})]}),c.jsx(w.DialogContent,{sx:{px:2,pb:2},children:c.jsxs(w.Stack,{spacing:2,sx:{mt:1},children:[s.length>1?c.jsxs(w.FormControl,{fullWidth:!0,size:"small",children:[c.jsx(w.InputLabel,{children:"Workspace"}),c.jsx(w.Select,{value:o,label:"Workspace",onChange:T=>i(T.target.value),children:s.map(T=>c.jsx(w.MenuItem,{value:T.name,children:c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"body2",fontWeight:500,children:T.name}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:T.description})]})},T.name))})]}):s.length===1?c.jsxs(w.Box,{sx:T=>({p:2,border:1,borderColor:"divider",borderRadius:1,backgroundColor:T.palette.mode==="dark"?"rgba(255, 255, 255, 0.04)":"grey.50"}),children:[c.jsxs(w.Typography,{variant:"body2",fontWeight:500,gutterBottom:!0,children:["Workspace: ",s[0].name]}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:s[0].description})]}):null,c.jsx(w.FormControl,{fullWidth:!0,children:c.jsx(w.TextField,{label:"Workbook Name",value:n,onChange:T=>r(T.target.value),placeholder:"Enter workbook name...",fullWidth:!0,autoFocus:!0,size:"small"})}),c.jsxs(w.Stack,{direction:"row",spacing:1,justifyContent:"flex-end",children:[c.jsx(w.Button,{onClick:C,variant:"outlined",size:"small",children:"Cancel"}),c.jsx(w.Button,{onClick:T=>S(T),variant:"contained",disabled:!n.trim()||s.length>1&&!o,size:"small",children:"Create Workbook"})]})]})})]}),c.jsxs(w.Dialog,{open:h,onClose:x,maxWidth:"md",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{pb:1,pt:2,px:2},children:[c.jsx(w.Typography,{fontWeight:600,sx:{mb:.5,fontSize:"1.5rem"},children:"Open Workbook"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Select an existing workbook to continue your analysis"})]}),c.jsx(w.DialogContent,{sx:{px:2,pb:2},children:c.jsx(Qx,{onWorkbookClick:v})})]})]})}const Xx=mt(c.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}));function bN({onSubmit:e,isSubmitting:t,disabled:n,disabledReason:r}){const[o,i]=W.useState(!1),[s,a]=W.useState(!1),l=()=>i(!1),u=async()=>{try{await e({forceRefresh:s}),i(!1)}catch{}},d=c.jsx("span",{children:c.jsx(w.Button,{variant:"contained",startIcon:c.jsx(fl,{}),onClick:()=>i(!0),disabled:n,"aria-label":"New materialization",children:"New materialization"})});return c.jsxs(c.Fragment,{children:[n&&r?c.jsx(w.Tooltip,{title:r,children:d}):d,c.jsxs(w.Dialog,{open:o,onClose:l,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"create-materialization-title",children:[c.jsx(w.DialogTitle,{id:"create-materialization-title",children:"New materialization"}),c.jsxs(w.DialogContent,{children:[c.jsx(w.DialogContentText,{sx:{mb:2},children:"Materialize every persist source in this package: compile, build the tables, and load them so queries serve from the materialized tables."}),c.jsx(w.FormGroup,{children:c.jsx(w.FormControlLabel,{control:c.jsx(w.Switch,{checked:s,onChange:f=>a(f.target.checked)}),label:"Force refresh (rebuild even if unchanged)"})})]}),c.jsxs(w.DialogActions,{children:[c.jsx(w.Button,{onClick:l,children:"Cancel"}),c.jsx(w.Button,{variant:"contained",loading:t,onClick:u,children:"Materialize"})]})]})]})}function Tf({children:e}){return c.jsx(w.Typography,{variant:"caption",component:"h6",sx:{display:"block",textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,color:"text.secondary",mb:1},children:e})}function Ja(e){return e===De.MaterializationStatus.Pending||e===De.MaterializationStatus.ManifestRowsReady}function yN(e){return e===De.MaterializationStatus.ManifestFileReady||e===De.MaterializationStatus.Failed||e===De.MaterializationStatus.Cancelled}function Zx(e){switch(e){case De.MaterializationStatus.ManifestFileReady:return"Done";case De.MaterializationStatus.Failed:return"Failed";case De.MaterializationStatus.Cancelled:return"Cancelled";case De.MaterializationStatus.Pending:case De.MaterializationStatus.ManifestRowsReady:return"Pending";default:return"Unknown"}}function Jx(e){switch(e){case De.MaterializationStatus.ManifestRowsReady:return"info";case De.MaterializationStatus.ManifestFileReady:return"success";case De.MaterializationStatus.Failed:return"error";case De.MaterializationStatus.Cancelled:return"warning";case De.MaterializationStatus.Pending:default:return"default"}}function e2(e){return e.metadata??{}}function xN(e){return e.trigger==="SCHEDULER"?"Scheduled":"Manual"}function t2(e,t){if(!e)return"-";const n=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),o=Math.max(0,r-n);if(o<1e3)return`${o}ms`;const i=Math.round(o/1e3);if(i<60)return`${i}s`;const s=Math.floor(i/60),a=i%60;if(s<60)return`${s}m ${a}s`;const l=Math.floor(s/60),u=s%60;return`${l}h ${u}m`}function Sf(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function CN(e){if(!e)return"-";const t=new Date(e).getTime(),n=Math.round((Date.now()-t)/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const o=Math.floor(r/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function EN({entries:e,builtAt:t}){const n=Object.entries(e??{});return c.jsxs(w.Box,{children:[c.jsxs(w.Stack,{direction:"row",alignItems:"baseline",justifyContent:"space-between",children:[c.jsx(Tf,{children:"Build manifest"}),t&&c.jsxs(w.Typography,{variant:"caption",color:"text.secondary",children:["Built ",Sf(t)]})]}),n.length===0?c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:"No materialized tables yet."}):c.jsxs(w.Table,{size:"small",children:[c.jsx(w.TableHead,{children:c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{children:"Source"}),c.jsx(w.TableCell,{children:"Table name"}),c.jsx(w.TableCell,{children:"Connection"}),c.jsx(w.TableCell,{children:"Realization"}),c.jsx(w.TableCell,{align:"right",children:"Rows"})]})}),c.jsx(w.TableBody,{children:n.map(([r,o])=>c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY},children:o.sourceName??r}),c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY},children:o.physicalTableName??"-"}),c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY},children:o.connectionName??"-"}),c.jsx(w.TableCell,{children:o.realization??"-"}),c.jsx(w.TableCell,{align:"right",children:o.rowCount??"-"})]},r))})]})]})}const Hu=mt([c.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),c.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")]),vN=mt(c.jsx("path",{d:"M9 11.24V7.5C9 6.12 10.12 5 11.5 5S14 6.12 14 7.5v3.74c1.21-.81 2-2.18 2-3.74C16 5.01 13.99 3 11.5 3S7 5.01 7 7.5c0 1.56.79 2.93 2 3.74m9.84 4.63-4.54-2.26c-.17-.07-.35-.11-.54-.11H13v-6c0-.83-.67-1.5-1.5-1.5S10 6.67 10 7.5v10.74c-3.6-.76-3.54-.75-3.67-.75-.31 0-.59.13-.79.33l-.79.8 4.94 4.94c.27.27.65.44 1.06.44h6.79c.75 0 1.33-.55 1.44-1.28l.75-5.27c.01-.07.02-.14.02-.2 0-.62-.38-1.16-.91-1.38"}));function n2({meta:e}){const t=e.trigger==="SCHEDULER";return c.jsx(w.Tooltip,{title:t?"Fired by the materialization schedule":"Triggered manually",children:c.jsx(w.Chip,{size:"small",variant:"outlined",color:t?"info":"default",icon:t?c.jsx(Hu,{fontSize:"small"}):c.jsx(vN,{fontSize:"small"}),label:xN(e)})})}function r2({materialization:e,buildPlan:t,showBuildPlan:n=!0,onClose:r}){const o=e?e2(e):{},i=Object.values(t?.sources??{});return c.jsx(w.Dialog,{open:e!==null,onClose:r,maxWidth:"md",fullWidth:!0,"aria-labelledby":"materialization-detail-title",children:e&&c.jsxs(c.Fragment,{children:[c.jsxs(w.DialogTitle,{sx:{pr:6,pb:1.5},id:"materialization-detail-title",children:[c.jsxs(w.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.75},children:[c.jsx(w.Chip,{size:"small",label:Zx(e.status),color:Jx(e.status),variant:Ja(e.status)?"filled":"outlined"}),c.jsx(n2,{meta:o})]}),c.jsx(w.Typography,{variant:"subtitle1",sx:{fontWeight:600},children:e.packageName??"Materialization"}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",sx:{fontFamily:De.MONO_FONT_FAMILY,wordBreak:"break-all"},children:e.id}),c.jsx(w.IconButton,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:8},children:c.jsx(Fr,{fontSize:"small"})})]}),c.jsxs(w.DialogContent,{dividers:!0,children:[c.jsxs(w.Box,{sx:{bgcolor:"action.hover",borderRadius:2,p:2,mb:3,display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:2},children:[c.jsx(na,{label:"Started",value:Sf(e.startedAt??e.createdAt)}),c.jsx(na,{label:"Completed",value:Sf(e.completedAt)}),c.jsx(na,{label:"Duration",value:t2(e.startedAt,e.completedAt)}),c.jsx(na,{label:"Sources",value:`${o.sourcesBuilt??0} built · ${o.sourcesReused??0} reused`}),c.jsx(na,{label:"Force refresh",value:o.forceRefresh?"Yes":"No"})]}),e.error&&c.jsxs(w.Box,{sx:{borderRadius:2,p:2,mb:3,border:"1px solid",borderColor:"error.main"},children:[c.jsx(Tf,{children:c.jsx(w.Box,{component:"span",sx:{color:"error.main"},children:"Error"})}),c.jsx(w.Typography,{variant:"body2",sx:{fontFamily:De.MONO_FONT_FAMILY,whiteSpace:"pre-wrap"},children:e.error})]}),n&&c.jsxs(w.Box,{sx:{mb:3},children:[c.jsx(Tf,{children:"Build plan"}),i.length===0?c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:"This package has no persist sources."}):c.jsxs(w.Table,{size:"small",children:[c.jsx(w.TableHead,{children:c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{children:"Source"}),c.jsx(w.TableCell,{children:"Connection"}),c.jsx(w.TableCell,{children:"Dialect"}),c.jsx(w.TableCell,{align:"right",children:"Columns"}),c.jsx(w.TableCell,{children:"Source Entity ID"})]})}),c.jsx(w.TableBody,{children:i.map(s=>c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY},children:s.name}),c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY},children:s.connectionName}),c.jsx(w.TableCell,{children:s.dialect??"-"}),c.jsx(w.TableCell,{align:"right",children:s.columns?.length??0}),c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY,fontSize:"0.75rem",wordBreak:"break-all",maxWidth:220},children:s.sourceEntityId})]},s.sourceID))})]})]}),c.jsx(EN,{entries:e.manifest?.entries,builtAt:e.manifest?.builtAt})]})]})})}function na({label:e,value:t}){return c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"caption",color:"text.secondary",display:"block",children:e}),c.jsx(w.Typography,{variant:"body2",children:t})]})}const TN=mt(c.jsx("path",{d:"M6 6h12v12H6z"})),o2=Ee.oneOfType([Ee.func,Ee.object]);function dg(e){try{return e.matches(":focus-visible")}catch{}return!1}const fg={};function i2(e,t){const n=M.useRef(fg);return n.current===fg&&(n.current=e(t)),n}class zu{static create(){return new zu}static use(){const t=i2(zu.create).current,[n,r]=M.useState(!1);return t.shouldMount=n,t.setShouldMount=r,M.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=kN(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function SN(){return zu.use()}function kN(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function kf(e,t){return kf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},kf(e,t)}function Dp(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,kf(e,t)}function wN(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function DN(e,t){e.classList?e.classList.add(t):wN(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function pg(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function IN(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=pg(e.className,t):e.setAttribute("class",pg(e.className&&e.className.baseVal||"",t))}const hg={disabled:!1},Uu=W.createContext(null);var s2=function(t){return t.scrollTop},Da="unmounted",ei="exited",ti="entering",Qi="entered",wf="exiting",Dr=(function(e){Dp(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var s=o,a=s&&!s.isMounting?r.enter:r.appear,l;return i.appearStatus=null,r.in?a?(l=ei,i.appearStatus=ti):l=Qi:r.unmountOnExit||r.mountOnEnter?l=Da:l=ei,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===Da?{status:ei}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var s=this.state.status;this.props.in?s!==ti&&s!==Qi&&(i=ti):(s===ti||s===Qi)&&(i=wf)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,s,a;return i=s=a=o,o!=null&&typeof o!="number"&&(i=o.exit,s=o.enter,a=o.appear!==void 0?o.appear:s),{exit:i,enter:s,appear:a}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===ti){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:Ta.findDOMNode(this);s&&s2(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ei&&this.setState({status:Da})},n.performEnter=function(o){var i=this,s=this.props.enter,a=this.context?this.context.isMounting:o,l=this.props.nodeRef?[a]:[Ta.findDOMNode(this),a],u=l[0],d=l[1],f=this.getTimeouts(),h=a?f.appear:f.enter;if(!o&&!s||hg.disabled){this.safeSetState({status:Qi},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:ti},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:Qi},function(){i.props.onEntered(u,d)})})})},n.performExit=function(){var o=this,i=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:Ta.findDOMNode(this);if(!i||hg.disabled){this.safeSetState({status:ei},function(){o.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:wf},function(){o.props.onExiting(a),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:ei},function(){o.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,i.nextCallback=null,o(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var s=this.props.nodeRef?this.props.nodeRef.current:Ta.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],u=l[0],d=l[1];this.props.addEndListener(u,d)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===Da)return null;var i=this.props,s=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var a=Ze(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return W.createElement(Uu.Provider,{value:null},typeof s=="function"?s(o,a):W.cloneElement(W.Children.only(s),a))},t})(W.Component);Dr.contextType=Uu;Dr.propTypes={};function Yi(){}Dr.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Yi,onEntering:Yi,onEntered:Yi,onExit:Yi,onExiting:Yi,onExited:Yi};Dr.UNMOUNTED=Da;Dr.EXITED=ei;Dr.ENTERING=ti;Dr.ENTERED=Qi;Dr.EXITING=wf;var AN=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return DN(t,r)})},Pd=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return IN(t,r)})},Ip=(function(e){Dp(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(a,l){var u=r.resolveArguments(a,l),d=u[0],f=u[1];r.removeClasses(d,"exit"),r.addClass(d,f?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(a,l)},r.onEntering=function(a,l){var u=r.resolveArguments(a,l),d=u[0],f=u[1],h=f?"appear":"enter";r.addClass(d,h,"active"),r.props.onEntering&&r.props.onEntering(a,l)},r.onEntered=function(a,l){var u=r.resolveArguments(a,l),d=u[0],f=u[1],h=f?"appear":"enter";r.removeClasses(d,h),r.addClass(d,h,"done"),r.props.onEntered&&r.props.onEntered(a,l)},r.onExit=function(a){var l=r.resolveArguments(a),u=l[0];r.removeClasses(u,"appear"),r.removeClasses(u,"enter"),r.addClass(u,"exit","base"),r.props.onExit&&r.props.onExit(a)},r.onExiting=function(a){var l=r.resolveArguments(a),u=l[0];r.addClass(u,"exit","active"),r.props.onExiting&&r.props.onExiting(a)},r.onExited=function(a){var l=r.resolveArguments(a),u=l[0];r.removeClasses(u,"exit"),r.addClass(u,"exit","done"),r.props.onExited&&r.props.onExited(a)},r.resolveArguments=function(a,l){return r.props.nodeRef?[r.props.nodeRef.current,a]:[a,l]},r.getClassNames=function(a){var l=r.props.classNames,u=typeof l=="string",d=u&&l?l+"-":"",f=u?""+d+a:l[a],h=u?f+"-active":l[a+"Active"],p=u?f+"-done":l[a+"Done"];return{baseClassName:f,activeClassName:h,doneClassName:p}},r}var n=t.prototype;return n.addClass=function(o,i,s){var a=this.getClassNames(i)[s+"ClassName"],l=this.getClassNames("enter"),u=l.doneClassName;i==="appear"&&s==="done"&&u&&(a+=" "+u),s==="active"&&o&&s2(o),a&&(this.appliedClasses[i][s]=a,AN(o,a))},n.removeClasses=function(o,i){var s=this.appliedClasses[i],a=s.base,l=s.active,u=s.done;this.appliedClasses[i]={},a&&Pd(o,a),l&&Pd(o,l),u&&Pd(o,u)},n.render=function(){var o=this.props;o.classNames;var i=Ze(o,["classNames"]);return W.createElement(Dr,Y({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t})(W.Component);Ip.defaultProps={classNames:""};Ip.propTypes={};function ON(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ap(e,t){var n=function(i){return t&&W.isValidElement(i)?t(i):i},r=Object.create(null);return e&&W.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function MN(e,t){e=e||{},t=t||{};function n(d){return d in t?t[d]:e[d]}var r=Object.create(null),o=[];for(var i in e)i in t?o.length&&(r[i]=o,o=[]):o.push(i);var s,a={};for(var l in t){if(r[l])for(s=0;s<r[l].length;s++){var u=r[l][s];a[r[l][s]]=n(u)}a[l]=n(l)}for(s=0;s<o.length;s++)a[o[s]]=n(o[s]);return a}function oi(e,t,n){return n[t]!=null?n[t]:e.props[t]}function PN(e,t){return Ap(e.children,function(n){return W.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:oi(n,"appear",e),enter:oi(n,"enter",e),exit:oi(n,"exit",e)})})}function RN(e,t,n){var r=Ap(e.children),o=MN(t,r);return Object.keys(o).forEach(function(i){var s=o[i];if(W.isValidElement(s)){var a=i in t,l=i in r,u=t[i],d=W.isValidElement(u)&&!u.props.in;l&&(!a||d)?o[i]=W.cloneElement(s,{onExited:n.bind(null,s),in:!0,exit:oi(s,"exit",e),enter:oi(s,"enter",e)}):!l&&a&&!d?o[i]=W.cloneElement(s,{in:!1}):l&&a&&W.isValidElement(u)&&(o[i]=W.cloneElement(s,{onExited:n.bind(null,s),in:u.props.in,exit:oi(s,"exit",e),enter:oi(s,"enter",e)}))}}),o}var NN=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},FN={component:"div",childFactory:function(t){return t}},El=(function(e){Dp(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var s=i.handleExited.bind(ON(i));return i.state={contextValue:{isMounting:!0},handleExited:s,firstRender:!0},i}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,i){var s=i.children,a=i.handleExited,l=i.firstRender;return{children:l?PN(o,a):RN(o,s,a),firstRender:!1}},n.handleExited=function(o,i){var s=Ap(this.props.children);o.key in s||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(a){var l=Y({},a.children);return delete l[o.key],{children:l}}))},n.render=function(){var o=this.props,i=o.component,s=o.childFactory,a=Ze(o,["component","childFactory"]),l=this.state.contextValue,u=NN(this.state.children).map(s);return delete a.appear,delete a.enter,delete a.exit,i===null?W.createElement(Uu.Provider,{value:l},u):W.createElement(Uu.Provider,{value:l},W.createElement(i,a,u))},t})(W.Component);El.propTypes={};El.defaultProps=FN;const LN=[];function _N(e){M.useEffect(e,LN)}class Op{static create(){return new Op}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function Sc(){const e=i2(Op.create).current;return _N(e.disposeEffect),e}function BN(e){const{className:t,classes:n,pulsate:r=!1,rippleX:o,rippleY:i,rippleSize:s,in:a,onExited:l,timeout:u}=e,[d,f]=M.useState(!1),h=Ue(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:s,height:s,top:-(s/2)+i,left:-(s/2)+o},m=Ue(n.child,d&&n.childLeaving,r&&n.childPulsate);return!a&&!d&&f(!0),M.useEffect(()=>{if(!a&&l!=null){const b=setTimeout(l,u);return()=>{clearTimeout(b)}}},[l,a,u]),c.jsx("span",{className:h,style:p,children:c.jsx("span",{className:m})})}const pr=We("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Df=550,jN=80,$N=Ot.keyframes`
|
|
94
|
+
0% {
|
|
95
|
+
transform: scale(0);
|
|
96
|
+
opacity: 0.1;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
100% {
|
|
100
|
+
transform: scale(1);
|
|
101
|
+
opacity: 0.3;
|
|
102
|
+
}
|
|
103
|
+
`,HN=Ot.keyframes`
|
|
104
|
+
0% {
|
|
105
|
+
opacity: 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
100% {
|
|
109
|
+
opacity: 0;
|
|
110
|
+
}
|
|
111
|
+
`,zN=Ot.keyframes`
|
|
112
|
+
0% {
|
|
113
|
+
transform: scale(1);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
50% {
|
|
117
|
+
transform: scale(0.92);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
100% {
|
|
121
|
+
transform: scale(1);
|
|
122
|
+
}
|
|
123
|
+
`,UN=fe("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),VN=fe(BN,{name:"MuiTouchRipple",slot:"Ripple"})`
|
|
124
|
+
opacity: 0;
|
|
125
|
+
position: absolute;
|
|
126
|
+
|
|
127
|
+
&.${pr.rippleVisible} {
|
|
128
|
+
opacity: 0.3;
|
|
129
|
+
transform: scale(1);
|
|
130
|
+
animation-name: ${$N};
|
|
131
|
+
animation-duration: ${Df}ms;
|
|
132
|
+
animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&.${pr.ripplePulsate} {
|
|
136
|
+
animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
& .${pr.child} {
|
|
140
|
+
opacity: 1;
|
|
141
|
+
display: block;
|
|
142
|
+
width: 100%;
|
|
143
|
+
height: 100%;
|
|
144
|
+
border-radius: 50%;
|
|
145
|
+
background-color: currentColor;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
& .${pr.childLeaving} {
|
|
149
|
+
opacity: 0;
|
|
150
|
+
animation-name: ${HN};
|
|
151
|
+
animation-duration: ${Df}ms;
|
|
152
|
+
animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
& .${pr.childPulsate} {
|
|
156
|
+
position: absolute;
|
|
157
|
+
/* @noflip */
|
|
158
|
+
left: 0px;
|
|
159
|
+
top: 0;
|
|
160
|
+
animation-name: ${zN};
|
|
161
|
+
animation-duration: 2500ms;
|
|
162
|
+
animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
|
|
163
|
+
animation-iteration-count: infinite;
|
|
164
|
+
animation-delay: 200ms;
|
|
165
|
+
}
|
|
166
|
+
`,WN=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:s,...a}=r,[l,u]=M.useState([]),d=M.useRef(0),f=M.useRef(null);M.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const h=M.useRef(!1),p=Sc(),m=M.useRef(null),b=M.useRef(null),y=M.useCallback(S=>{const{pulsate:I,rippleX:T,rippleY:N,rippleSize:O,cb:F}=S;u(B=>[...B,c.jsx(VN,{classes:{ripple:Ue(i.ripple,pr.ripple),rippleVisible:Ue(i.rippleVisible,pr.rippleVisible),ripplePulsate:Ue(i.ripplePulsate,pr.ripplePulsate),child:Ue(i.child,pr.child),childLeaving:Ue(i.childLeaving,pr.childLeaving),childPulsate:Ue(i.childPulsate,pr.childPulsate)},timeout:Df,pulsate:I,rippleX:T,rippleY:N,rippleSize:O},d.current)]),d.current+=1,f.current=F},[i]),x=M.useCallback((S={},I={},T=()=>{})=>{const{pulsate:N=!1,center:O=o||I.pulsate,fakeElement:F=!1}=I;if(S?.type==="mousedown"&&h.current){h.current=!1;return}S?.type==="touchstart"&&(h.current=!0);const B=F?null:b.current,j=B?B.getBoundingClientRect():{width:0,height:0,left:0,top:0};let D,H,_;if(O||S===void 0||S.clientX===0&&S.clientY===0||!S.clientX&&!S.touches)D=Math.round(j.width/2),H=Math.round(j.height/2);else{const{clientX:L,clientY:$}=S.touches&&S.touches.length>0?S.touches[0]:S;D=Math.round(L-j.left),H=Math.round($-j.top)}if(O)_=Math.sqrt((2*j.width**2+j.height**2)/3),_%2===0&&(_+=1);else{const L=Math.max(Math.abs((B?B.clientWidth:0)-D),D)*2+2,$=Math.max(Math.abs((B?B.clientHeight:0)-H),H)*2+2;_=Math.sqrt(L**2+$**2)}S?.touches?m.current===null&&(m.current=()=>{y({pulsate:N,rippleX:D,rippleY:H,rippleSize:_,cb:T})},p.start(jN,()=>{m.current&&(m.current(),m.current=null)})):y({pulsate:N,rippleX:D,rippleY:H,rippleSize:_,cb:T})},[o,y,p]),C=M.useCallback(()=>{x({},{pulsate:!0})},[x]),v=M.useCallback((S,I)=>{if(p.clear(),S?.type==="touchend"&&m.current){m.current(),m.current=null,p.start(0,()=>{v(S,I)});return}m.current=null,u(T=>T.length>0?T.slice(1):T),f.current=I},[p]);return M.useImperativeHandle(n,()=>({pulsate:C,start:x,stop:v}),[C,x,v]),c.jsx(UN,{className:Ue(pr.root,i.root,s),ref:b,...a,children:c.jsx(El,{component:null,exit:!0,children:l})})});function qN(e){return Ge("MuiButtonBase",e)}const YN=We("MuiButtonBase",["root","disabled","focusVisible"]),KN=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,s=Ke({root:["root",t&&"disabled",n&&"focusVisible"]},qN,o);return n&&r&&(s.root+=` ${r}`),s},GN=fe("button",{name:"MuiButtonBase",slot:"Root"})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${YN.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),pi=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:s,className:a,component:l="button",disabled:u=!1,disableRipple:d=!1,disableTouchRipple:f=!1,focusRipple:h=!1,focusVisibleClassName:p,LinkComponent:m="a",onBlur:b,onClick:y,onContextMenu:x,onDragLeave:C,onFocus:v,onFocusVisible:S,onKeyDown:I,onKeyUp:T,onMouseDown:N,onMouseLeave:O,onMouseUp:F,onTouchEnd:B,onTouchMove:j,onTouchStart:D,tabIndex:H=0,TouchRippleProps:_,touchRippleRef:L,type:$,...K}=r,G=M.useRef(null),q=SN(),R=vt(q.ref,L),[oe,se]=M.useState(!1);u&&oe&&se(!1),M.useImperativeHandle(o,()=>({focusVisible:()=>{se(!0),G.current.focus()}}),[]);const z=q.shouldMount&&!d&&!u;M.useEffect(()=>{oe&&h&&!d&&q.pulsate()},[d,h,oe,q]);const pe=uo(q,"start",N,f),J=uo(q,"stop",x,f),Q=uo(q,"stop",C,f),re=uo(q,"stop",F,f),ne=uo(q,"stop",_e=>{oe&&_e.preventDefault(),O&&O(_e)},f),ae=uo(q,"start",D,f),ie=uo(q,"stop",B,f),Z=uo(q,"stop",j,f),me=uo(q,"stop",_e=>{dg(_e.target)||se(!1),b&&b(_e)},!1),le=Ve(_e=>{G.current||(G.current=_e.currentTarget),dg(_e.target)&&(se(!0),S&&S(_e)),v&&v(_e)}),ue=()=>{const _e=G.current;return l&&l!=="button"&&!(_e.tagName==="A"&&_e.href)},Ie=Ve(_e=>{h&&!_e.repeat&&oe&&_e.key===" "&&q.stop(_e,()=>{q.start(_e)}),_e.target===_e.currentTarget&&ue()&&_e.key===" "&&_e.preventDefault(),I&&I(_e),_e.target===_e.currentTarget&&ue()&&_e.key==="Enter"&&!u&&(_e.preventDefault(),y&&y(_e))}),Ce=Ve(_e=>{h&&_e.key===" "&&oe&&!_e.defaultPrevented&&q.stop(_e,()=>{q.pulsate(_e)}),T&&T(_e),y&&_e.target===_e.currentTarget&&ue()&&_e.key===" "&&!_e.defaultPrevented&&y(_e)});let we=l;we==="button"&&(K.href||K.to)&&(we=m);const ye={};we==="button"?(ye.type=$===void 0?"button":$,ye.disabled=u):(!K.href&&!K.to&&(ye.role="button"),u&&(ye["aria-disabled"]=u));const ze=vt(n,G),Ne={...r,centerRipple:i,component:l,disabled:u,disableRipple:d,disableTouchRipple:f,focusRipple:h,tabIndex:H,focusVisible:oe},nt=KN(Ne);return c.jsxs(GN,{as:we,className:Ue(nt.root,a),ownerState:Ne,onBlur:me,onClick:y,onContextMenu:J,onFocus:le,onKeyDown:Ie,onKeyUp:Ce,onMouseDown:pe,onMouseLeave:ne,onMouseUp:re,onDragLeave:Q,onTouchEnd:ie,onTouchMove:Z,onTouchStart:ae,ref:ze,tabIndex:u?-1:H,type:$,...ye,...K,children:[s,z?c.jsx(WN,{ref:R,center:i,..._}):null]})});function uo(e,t,n,r=!1){return Ve(o=>(n&&n(o),r||e[t](o),!0))}function QN(e){return typeof e.main=="string"}function XN(e,t=[]){if(!QN(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function Bn(e=[]){return([,t])=>t&&XN(t,e)}function ZN(e){return Ge("MuiCircularProgress",e)}We("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const Io=44,If=Ot.keyframes`
|
|
167
|
+
0% {
|
|
168
|
+
transform: rotate(0deg);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
100% {
|
|
172
|
+
transform: rotate(360deg);
|
|
173
|
+
}
|
|
174
|
+
`,Af=Ot.keyframes`
|
|
175
|
+
0% {
|
|
176
|
+
stroke-dasharray: 1px, 200px;
|
|
177
|
+
stroke-dashoffset: 0;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
50% {
|
|
181
|
+
stroke-dasharray: 100px, 200px;
|
|
182
|
+
stroke-dashoffset: -15px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
100% {
|
|
186
|
+
stroke-dasharray: 1px, 200px;
|
|
187
|
+
stroke-dashoffset: -126px;
|
|
188
|
+
}
|
|
189
|
+
`,JN=typeof If!="string"?Ot.css`
|
|
190
|
+
animation: ${If} 1.4s linear infinite;
|
|
191
|
+
`:null,eF=typeof Af!="string"?Ot.css`
|
|
192
|
+
animation: ${Af} 1.4s ease-in-out infinite;
|
|
193
|
+
`:null,tF=e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e,i={root:["root",n,`color${Fe(r)}`],svg:["svg"],circle:["circle",`circle${Fe(n)}`,o&&"circleDisableShrink"]};return Ke(i,ZN,t)},nF=fe("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${Fe(n.color)}`]]}})(ft(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:JN||{animation:`${If} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),rF=fe("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),oF=fe("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Fe(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(ft(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:eF||{animation:`${Af} 1.4s ease-in-out infinite`}}]}))),Mp=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiCircularProgress"}),{className:o,color:i="primary",disableShrink:s=!1,size:a=40,style:l,thickness:u=3.6,value:d=0,variant:f="indeterminate",...h}=r,p={...r,color:i,disableShrink:s,size:a,thickness:u,value:d,variant:f},m=tF(p),b={},y={},x={};if(f==="determinate"){const C=2*Math.PI*((Io-u)/2);b.strokeDasharray=C.toFixed(3),x["aria-valuenow"]=Math.round(d),b.strokeDashoffset=`${((100-d)/100*C).toFixed(3)}px`,y.transform="rotate(-90deg)"}return c.jsx(nF,{className:Ue(m.root,o),style:{width:a,height:a,...y,...l},ownerState:p,ref:n,role:"progressbar",...x,...h,children:c.jsx(rF,{className:m.svg,ownerState:p,viewBox:`${Io/2} ${Io/2} ${Io} ${Io}`,children:c.jsx(oF,{className:m.circle,style:b,ownerState:p,cx:Io,cy:Io,r:(Io-u)/2,fill:"none",strokeWidth:u})})})});function iF(e){return Ge("MuiButton",e)}const Ko=We("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),sF=M.createContext({}),aF=M.createContext(void 0),lF=e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:i,loading:s,loadingPosition:a,classes:l}=e,u={root:["root",s&&"loading",i,`${i}${Fe(t)}`,`size${Fe(o)}`,`${i}Size${Fe(o)}`,`color${Fe(t)}`,n&&"disableElevation",r&&"fullWidth",s&&`loadingPosition${Fe(a)}`],startIcon:["icon","startIcon",`iconSize${Fe(o)}`],endIcon:["icon","endIcon",`iconSize${Fe(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},d=Ke(u,iF,l);return{...l,...d}},a2=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],uF=fe(pi,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${Fe(n.color)}`],t[`size${Fe(n.size)}`],t[`${n.variant}Size${Fe(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(ft(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${Ko.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${Ko.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${Ko.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${Ko.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(Bn()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(e.vars||e).palette[r].main,"--variant-outlinedColor":(e.vars||e).palette[r].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[r].main,.5),"--variant-containedColor":(e.vars||e).palette[r].contrastText,"--variant-containedBg":(e.vars||e).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[r].dark,"--variant-textBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[r].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Ko.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Ko.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${Ko.loading}`]:{color:"transparent"}}}]}})),cF=fe("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${Fe(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...a2]})),dF=fe("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${Fe(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...a2]})),fF=fe("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),mg=fe("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),tn=M.forwardRef(function(t,n){const r=M.useContext(sF),o=M.useContext(aF),i=Ka(r,t),s=ut({props:i,name:"MuiButton"}),{children:a,color:l="primary",component:u="button",className:d,disabled:f=!1,disableElevation:h=!1,disableFocusRipple:p=!1,endIcon:m,focusVisibleClassName:b,fullWidth:y=!1,id:x,loading:C=null,loadingIndicator:v,loadingPosition:S="center",size:I="medium",startIcon:T,type:N,variant:O="text",...F}=s,B=_r(x),j=v??c.jsx(Mp,{"aria-labelledby":B,color:"inherit",size:16}),D={...s,color:l,component:u,disabled:f,disableElevation:h,disableFocusRipple:p,fullWidth:y,loading:C,loadingIndicator:j,loadingPosition:S,size:I,type:N,variant:O},H=lF(D),_=(T||C&&S==="start")&&c.jsx(cF,{className:H.startIcon,ownerState:D,children:T||c.jsx(mg,{className:H.loadingIconPlaceholder,ownerState:D})}),L=(m||C&&S==="end")&&c.jsx(dF,{className:H.endIcon,ownerState:D,children:m||c.jsx(mg,{className:H.loadingIconPlaceholder,ownerState:D})}),$=o||"",K=typeof C=="boolean"?c.jsx("span",{className:H.loadingWrapper,style:{display:"contents"},children:C&&c.jsx(fF,{className:H.loadingIndicator,ownerState:D,children:j})}):null;return c.jsxs(uF,{ownerState:D,className:Ue(r.className,H.root,d,$),component:u,disabled:f||C,focusRipple:!p,focusVisibleClassName:Ue(H.focusVisible,b),ref:n,type:N,id:C?B:x,...F,classes:H,children:[_,S!=="end"&&K,a,S==="end"&&K,L]})}),kc=M.createContext(void 0);function ar(){return M.useContext(kc)}function pF(e){return Ge("PrivateSwitchBase",e)}We("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);function hs(e){return typeof e=="string"}function l2(e,t,n){return e===void 0||hs(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function br(e,t,n){return typeof e=="function"?e(t,n):e}function Ln(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function gg(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function u2(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:i}=e;if(!t){const p=Ue(n?.className,i,o?.className,r?.className),m={...n?.style,...o?.style,...r?.style},b={...n,...o,...r};return p.length>0&&(b.className=p),Object.keys(m).length>0&&(b.style=m),{props:b,internalRef:void 0}}const s=Ln({...o,...r}),a=gg(r),l=gg(o),u=t(s),d=Ue(u?.className,n?.className,i,o?.className,r?.className),f={...u?.style,...n?.style,...o?.style,...r?.style},h={...u,...n,...l,...a};return d.length>0&&(h.className=d),Object.keys(f).length>0&&(h.style=f),{props:h,internalRef:u.ref}}function kt(e,t){const{className:n,elementType:r,ownerState:o,externalForwardedProps:i,internalForwardedProps:s,shouldForwardComponentProp:a=!1,...l}=t,{component:u,slots:d={[e]:void 0},slotProps:f={[e]:void 0},...h}=i,p=d[e]||r,m=br(f[e],o),{props:{component:b,...y},internalRef:x}=u2({className:n,...l,externalForwardedProps:e==="root"?h:void 0,externalSlotProps:m}),C=vt(x,m?.ref,t.ref),v=e==="root"?b||u:b,S=l2(p,{...e==="root"&&!u&&!d[e]&&s,...e!=="root"&&!d[e]&&s,...y,...v&&!a&&{as:v},...v&&a&&{component:v},ref:C},o);return[p,S]}const hF=e=>{const{classes:t,checked:n,disabled:r,edge:o}=e,i={root:["root",n&&"checked",r&&"disabled",o&&`edge${Fe(o)}`],input:["input"]};return Ke(i,pF,t)},mF=fe(pi,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),gF=fe("input",{name:"MuiSwitchBase",shouldForwardProp:$n})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),bF=M.forwardRef(function(t,n){const{autoFocus:r,checked:o,checkedIcon:i,defaultChecked:s,disabled:a,disableFocusRipple:l=!1,edge:u=!1,icon:d,id:f,inputProps:h,inputRef:p,name:m,onBlur:b,onChange:y,onFocus:x,readOnly:C,required:v=!1,tabIndex:S,type:I,value:T,slots:N={},slotProps:O={},...F}=t,[B,j]=or({controlled:o,default:!!s,name:"SwitchBase",state:"checked"}),D=ar(),H=J=>{x&&x(J),D&&D.onFocus&&D.onFocus(J)},_=J=>{b&&b(J),D&&D.onBlur&&D.onBlur(J)},L=J=>{if(J.nativeEvent.defaultPrevented)return;const Q=J.target.checked;j(Q),y&&y(J,Q)};let $=a;D&&typeof $>"u"&&($=D.disabled);const K=I==="checkbox"||I==="radio",G={...t,checked:B,disabled:$,disableFocusRipple:l,edge:u},q=hF(G),R={slots:N,slotProps:{input:h,...O}},[oe,se]=kt("root",{ref:n,elementType:mF,className:q.root,shouldForwardComponentProp:!0,externalForwardedProps:{...R,component:"span",...F},getSlotProps:J=>({...J,onFocus:Q=>{J.onFocus?.(Q),H(Q)},onBlur:Q=>{J.onBlur?.(Q),_(Q)}}),ownerState:G,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:$,role:void 0,tabIndex:null}}),[z,pe]=kt("input",{ref:p,elementType:gF,className:q.input,externalForwardedProps:R,getSlotProps:J=>({...J,onChange:Q=>{J.onChange?.(Q),L(Q)}}),ownerState:G,additionalProps:{autoFocus:r,checked:o,defaultChecked:s,disabled:$,id:K?f:void 0,name:m,readOnly:C,required:v,tabIndex:S,type:I,...I==="checkbox"&&T===void 0?{}:{value:T}}});return c.jsxs(oe,{...se,children:[c.jsx(z,{...pe}),B?i:d]})}),yF=mt(c.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})),xF=mt(c.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),CF=mt(c.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));function EF(e){return Ge("MuiCheckbox",e)}const Rd=We("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),vF=e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,i={root:["root",n&&"indeterminate",`color${Fe(r)}`,`size${Fe(o)}`]},s=Ke(i,EF,t);return{...t,...s}},TF=fe(bF,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${Fe(n.size)}`],n.color!=="default"&&t[`color${Fe(n.color)}`]]}})(ft(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{[`&.${Rd.checked}, &.${Rd.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${Rd.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),SF=c.jsx(xF,{}),kF=c.jsx(yF,{}),wF=c.jsx(CF,{}),Pp=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiCheckbox"}),{checkedIcon:o=SF,color:i="primary",icon:s=kF,indeterminate:a=!1,indeterminateIcon:l=wF,inputProps:u,size:d="medium",disableRipple:f=!1,className:h,slots:p={},slotProps:m={},...b}=r,y=a?l:s,x=a?l:o,C={...r,disableRipple:f,color:i,indeterminate:a,size:d},v=vF(C),S=m.input??u,[I,T]=kt("root",{ref:n,elementType:TF,className:Ue(v.root,h),shouldForwardComponentProp:!0,externalForwardedProps:{slots:p,slotProps:m,...b},ownerState:C,additionalProps:{type:"checkbox",icon:M.cloneElement(y,{fontSize:y.props.fontSize??d}),checkedIcon:M.cloneElement(x,{fontSize:x.props.fontSize??d}),disableRipple:f,slots:p,slotProps:{input:Eb(typeof S=="function"?S(C):S,{"data-indeterminate":a})}}});return c.jsx(I,{...T,classes:v})});function c2(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}function DF(e){const t=mn(e);return t.body===e?bo(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function Ha(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function bg(e){return parseInt(bo(e).getComputedStyle(e).paddingRight,10)||0}function IF(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||r}function yg(e,t,n,r,o){const i=[t,n,...r];[].forEach.call(e.children,s=>{const a=!i.includes(s),l=!IF(s);a&&l&&Ha(s,o)})}function Nd(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function AF(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(DF(r)){const s=c2(bo(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${bg(r)+s}px`;const a=mn(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${bg(l)+s}px`})}let i;if(r.parentNode instanceof DocumentFragment)i=mn(r).body;else{const s=r.parentElement,a=bo(r);i=s?.nodeName==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:r}n.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{n.forEach(({value:i,el:s,property:a})=>{i?s.style.setProperty(a,i):s.style.removeProperty(a)})}}function OF(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class MF{constructor(){this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&Ha(t.modalRef,!1);const o=OF(n);yg(n,t.mount,t.modalRef,o,!0);const i=Nd(this.containers,s=>s.container===n);return i!==-1?(this.containers[i].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),r)}mount(t,n){const r=Nd(this.containers,i=>i.modals.includes(t)),o=this.containers[r];o.restore||(o.restore=AF(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=Nd(this.containers,s=>s.modals.includes(t)),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(r,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&Ha(t.modalRef,n),yg(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const s=i.modals[i.modals.length-1];s.modalRef&&Ha(s.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function Ms(e){return parseInt(M.version,10)>=19?e?.props?.ref||null:e?.ref||null}const PF=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function RF(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function NF(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function FF(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||NF(e))}function LF(e){const t=[],n=[];return Array.from(e.querySelectorAll(PF)).forEach((r,o)=>{const i=RF(r);i===-1||!FF(r)||(i===0?t.push(r):n.push({documentOrder:o,tabIndex:i,node:r}))}),n.sort((r,o)=>r.tabIndex===o.tabIndex?r.documentOrder-o.documentOrder:r.tabIndex-o.tabIndex).map(r=>r.node).concat(t)}function _F(){return!0}function d2(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:i=LF,isEnabled:s=_F,open:a}=e,l=M.useRef(!1),u=M.useRef(null),d=M.useRef(null),f=M.useRef(null),h=M.useRef(null),p=M.useRef(!1),m=M.useRef(null),b=vt(Ms(t),m),y=M.useRef(null);M.useEffect(()=>{!a||!m.current||(p.current=!n)},[n,a]),M.useEffect(()=>{if(!a||!m.current)return;const v=mn(m.current);return m.current.contains(v.activeElement)||(m.current.hasAttribute("tabIndex")||m.current.setAttribute("tabIndex","-1"),p.current&&m.current.focus()),()=>{o||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[a]),M.useEffect(()=>{if(!a||!m.current)return;const v=mn(m.current),S=N=>{y.current=N,!(r||!s()||N.key!=="Tab")&&v.activeElement===m.current&&N.shiftKey&&(l.current=!0,d.current&&d.current.focus())},I=()=>{const N=m.current;if(N===null)return;if(!v.hasFocus()||!s()||l.current){l.current=!1;return}if(N.contains(v.activeElement)||r&&v.activeElement!==u.current&&v.activeElement!==d.current)return;if(v.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!p.current)return;let O=[];if((v.activeElement===u.current||v.activeElement===d.current)&&(O=i(m.current)),O.length>0){const F=!!(y.current?.shiftKey&&y.current?.key==="Tab"),B=O[0],j=O[O.length-1];typeof B!="string"&&typeof j!="string"&&(F?j.focus():B.focus())}else N.focus()};v.addEventListener("focusin",I),v.addEventListener("keydown",S,!0);const T=setInterval(()=>{v.activeElement&&v.activeElement.tagName==="BODY"&&I()},50);return()=>{clearInterval(T),v.removeEventListener("focusin",I),v.removeEventListener("keydown",S,!0)}},[n,r,o,s,a,i]);const x=v=>{f.current===null&&(f.current=v.relatedTarget),p.current=!0,h.current=v.target;const S=t.props.onFocus;S&&S(v)},C=v=>{f.current===null&&(f.current=v.relatedTarget),p.current=!0};return c.jsxs(M.Fragment,{children:[c.jsx("div",{tabIndex:a?0:-1,onFocus:C,ref:u,"data-testid":"sentinelStart"}),M.cloneElement(t,{ref:b,onFocus:x}),c.jsx("div",{tabIndex:a?0:-1,onFocus:C,ref:d,"data-testid":"sentinelEnd"})]})}function BF(e){return typeof e=="function"?e():e}const f2=M.forwardRef(function(t,n){const{children:r,container:o,disablePortal:i=!1}=t,[s,a]=M.useState(null),l=vt(M.isValidElement(r)?Ms(r):null,n);if(yn(()=>{i||a(BF(o)||document.body)},[o,i]),yn(()=>{if(s&&!i)return Zd(n,s),()=>{Zd(n,null)}},[n,s,i]),i){if(M.isValidElement(r)){const u={ref:l};return M.cloneElement(r,u)}return r}return s&&oT.createPortal(r,s)}),p2=e=>e.scrollTop;function ms(e,t){const{timeout:n,easing:r,style:o={}}=e;return{duration:o.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:o.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:o.transitionDelay}}const jF={entering:{opacity:1},entered:{opacity:1}},hi=M.forwardRef(function(t,n){const r=Lo(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:i,appear:s=!0,children:a,easing:l,in:u,onEnter:d,onEntered:f,onEntering:h,onExit:p,onExited:m,onExiting:b,style:y,timeout:x=o,TransitionComponent:C=Dr,...v}=t,S=M.useRef(null),I=vt(S,Ms(a),n),T=_=>L=>{if(_){const $=S.current;L===void 0?_($):_($,L)}},N=T(h),O=T((_,L)=>{p2(_);const $=ms({style:y,timeout:x,easing:l},{mode:"enter"});_.style.webkitTransition=r.transitions.create("opacity",$),_.style.transition=r.transitions.create("opacity",$),d&&d(_,L)}),F=T(f),B=T(b),j=T(_=>{const L=ms({style:y,timeout:x,easing:l},{mode:"exit"});_.style.webkitTransition=r.transitions.create("opacity",L),_.style.transition=r.transitions.create("opacity",L),p&&p(_)}),D=T(m),H=_=>{i&&i(S.current,_)};return c.jsx(C,{appear:s,in:u,nodeRef:S,onEnter:O,onEntered:F,onEntering:N,onExit:j,onExited:D,onExiting:B,addEndListener:H,timeout:x,...v,children:(_,{ownerState:L,...$})=>M.cloneElement(a,{style:{opacity:0,visibility:_==="exited"&&!u?"hidden":void 0,...jF[_],...y,...a.props.style},ref:I,...$})})});function $F(e){return Ge("MuiBackdrop",e)}We("MuiBackdrop",["root","invisible"]);const HF=e=>{const{classes:t,invisible:n}=e;return Ke({root:["root",n&&"invisible"]},$F,t)},zF=fe("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),h2=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiBackdrop"}),{children:o,className:i,component:s="div",invisible:a=!1,open:l,components:u={},componentsProps:d={},slotProps:f={},slots:h={},TransitionComponent:p,transitionDuration:m,...b}=r,y={...r,component:s,invisible:a},x=HF(y),C={transition:p,root:u.Root,...h},v={...d,...f},S={component:s,slots:C,slotProps:v},[I,T]=kt("root",{elementType:zF,externalForwardedProps:S,className:Ue(x.root,i),ownerState:y}),[N,O]=kt("transition",{elementType:hi,externalForwardedProps:S,ownerState:y});return c.jsx(N,{in:l,timeout:m,...b,...O,children:c.jsx(I,{"aria-hidden":!0,...T,classes:x,ref:n,children:o})})});function UF(e){return typeof e=="function"?e():e}function VF(e){return e?e.props.hasOwnProperty("in"):!1}const xg=()=>{},Ql=new MF;function WF(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:o=!1,onTransitionEnter:i,onTransitionExited:s,children:a,onClose:l,open:u,rootRef:d}=e,f=M.useRef({}),h=M.useRef(null),p=M.useRef(null),m=vt(p,d),[b,y]=M.useState(!u),x=VF(a);let C=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(C=!1);const v=()=>mn(h.current),S=()=>(f.current.modalRef=p.current,f.current.mount=h.current,f.current),I=()=>{Ql.mount(S(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},T=Ve(()=>{const L=UF(t)||v().body;Ql.add(S(),L),p.current&&I()}),N=()=>Ql.isTopModal(S()),O=Ve(L=>{h.current=L,L&&(u&&N()?I():p.current&&Ha(p.current,C))}),F=M.useCallback(()=>{Ql.remove(S(),C)},[C]);M.useEffect(()=>()=>{F()},[F]),M.useEffect(()=>{u?T():(!x||!o)&&F()},[u,F,x,o,T]);const B=L=>$=>{L.onKeyDown?.($),!($.key!=="Escape"||$.which===229||!N())&&(n||($.stopPropagation(),l&&l($,"escapeKeyDown")))},j=L=>$=>{L.onClick?.($),$.target===$.currentTarget&&l&&l($,"backdropClick")};return{getRootProps:(L={})=>{const $=Ln(e);delete $.onTransitionEnter,delete $.onTransitionExited;const K={...$,...L};return{role:"presentation",...K,onKeyDown:B(K),ref:m}},getBackdropProps:(L={})=>{const $=L;return{"aria-hidden":!0,...$,onClick:j($),open:u}},getTransitionProps:()=>{const L=()=>{y(!1),i&&i()},$=()=>{y(!0),s&&s(),o&&F()};return{onEnter:lm(L,a?.props.onEnter??xg),onExited:lm($,a?.props.onExited??xg)}},rootRef:m,portalRef:O,isTopModal:N,exited:b,hasTransition:x}}function qF(e){return Ge("MuiModal",e)}We("MuiModal",["root","hidden","backdrop"]);const YF=e=>{const{open:t,exited:n,classes:r}=e;return Ke({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},qF,r)},KF=fe("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(ft(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),GF=fe(h2,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),m2=M.forwardRef(function(t,n){const r=ut({name:"MuiModal",props:t}),{BackdropComponent:o=GF,BackdropProps:i,classes:s,className:a,closeAfterTransition:l=!1,children:u,container:d,component:f,components:h={},componentsProps:p={},disableAutoFocus:m=!1,disableEnforceFocus:b=!1,disableEscapeKeyDown:y=!1,disablePortal:x=!1,disableRestoreFocus:C=!1,disableScrollLock:v=!1,hideBackdrop:S=!1,keepMounted:I=!1,onClose:T,onTransitionEnter:N,onTransitionExited:O,open:F,slotProps:B={},slots:j={},theme:D,...H}=r,_={...r,closeAfterTransition:l,disableAutoFocus:m,disableEnforceFocus:b,disableEscapeKeyDown:y,disablePortal:x,disableRestoreFocus:C,disableScrollLock:v,hideBackdrop:S,keepMounted:I},{getRootProps:L,getBackdropProps:$,getTransitionProps:K,portalRef:G,isTopModal:q,exited:R,hasTransition:oe}=WF({..._,rootRef:n}),se={..._,exited:R},z=YF(se),pe={};if(u.props.tabIndex===void 0&&(pe.tabIndex="-1"),oe){const{onEnter:ie,onExited:Z}=K();pe.onEnter=ie,pe.onExited=Z}const J={slots:{root:h.Root,backdrop:h.Backdrop,...j},slotProps:{...p,...B}},[Q,re]=kt("root",{ref:n,elementType:KF,externalForwardedProps:{...J,...H,component:f},getSlotProps:L,ownerState:se,className:Ue(a,z?.root,!se.open&&se.exited&&z?.hidden)}),[ne,ae]=kt("backdrop",{ref:i?.ref,elementType:o,externalForwardedProps:J,shouldForwardComponentProp:!0,additionalProps:i,getSlotProps:ie=>$({...ie,onClick:Z=>{ie?.onClick&&ie.onClick(Z)}}),className:Ue(i?.className,z?.backdrop),ownerState:se});return!I&&!F&&(!oe||R)?null:c.jsx(f2,{ref:G,container:d,disablePortal:x,children:c.jsxs(Q,{...re,children:[!S&&o?c.jsx(ne,{...ae}):null,c.jsx(d2,{disableEnforceFocus:b,disableAutoFocus:m,disableRestoreFocus:C,isEnabled:q,open:F,children:M.cloneElement(u,pe)})]})})});function QF(e){return Ge("MuiPaper",e)}We("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const XF=e=>{const{square:t,elevation:n,variant:r,classes:o}=e,i={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return Ke(i,QF,o)},ZF=fe("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(ft(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:t})=>!t.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),Ci=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiPaper"}),o=Lo(),{className:i,component:s="div",elevation:a=1,square:l=!1,variant:u="elevation",...d}=r,f={...r,component:s,elevation:a,square:l,variant:u},h=XF(f);return c.jsx(ZF,{as:s,ownerState:f,className:Ue(h.root,i),ref:n,...d,style:{...u==="elevation"&&{"--Paper-shadow":(o.vars||o).shadows[a],...o.vars&&{"--Paper-overlay":o.vars.overlays?.[a]},...!o.vars&&o.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${Iu("#fff",Xd(a))}, ${Iu("#fff",Xd(a))})`}},...d.style}})});function JF(e){return Ge("MuiDialog",e)}const za=We("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),g2=M.createContext({}),e8=fe(h2,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),t8=e=>{const{classes:t,scroll:n,maxWidth:r,fullWidth:o,fullScreen:i}=e,s={root:["root"],container:["container",`scroll${Fe(n)}`],paper:["paper",`paperScroll${Fe(n)}`,`paperWidth${Fe(String(r))}`,o&&"paperFullWidth",i&&"paperFullScreen"]};return Ke(s,JF,t)},n8=fe(m2,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),r8=fe("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${Fe(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),o8=fe(Ci,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${Fe(n.scroll)}`],t[`paperWidth${Fe(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(ft(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:t})=>!t.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:e.breakpoints.unit==="px"?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${za.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(t=>t!=="xs").map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${za.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:t})=>t.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:t})=>t.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${za.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),no=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialog"}),o=Lo(),i={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{"aria-describedby":s,"aria-labelledby":a,"aria-modal":l=!0,BackdropComponent:u,BackdropProps:d,children:f,className:h,disableEscapeKeyDown:p=!1,fullScreen:m=!1,fullWidth:b=!1,maxWidth:y="sm",onClick:x,onClose:C,open:v,PaperComponent:S=Ci,PaperProps:I={},scroll:T="paper",slots:N={},slotProps:O={},TransitionComponent:F=hi,transitionDuration:B=i,TransitionProps:j,...D}=r,H={...r,disableEscapeKeyDown:p,fullScreen:m,fullWidth:b,maxWidth:y,scroll:T},_=t8(H),L=M.useRef(),$=le=>{L.current=le.target===le.currentTarget},K=le=>{x&&x(le),L.current&&(L.current=null,C&&C(le,"backdropClick"))},G=_r(a),q=M.useMemo(()=>({titleId:G}),[G]),R={transition:F,...N},oe={transition:j,paper:I,backdrop:d,...O},se={slots:R,slotProps:oe},[z,pe]=kt("root",{elementType:n8,shouldForwardComponentProp:!0,externalForwardedProps:se,ownerState:H,className:Ue(_.root,h),ref:n}),[J,Q]=kt("backdrop",{elementType:e8,shouldForwardComponentProp:!0,externalForwardedProps:se,ownerState:H}),[re,ne]=kt("paper",{elementType:o8,shouldForwardComponentProp:!0,externalForwardedProps:se,ownerState:H,className:Ue(_.paper,I.className)}),[ae,ie]=kt("container",{elementType:r8,externalForwardedProps:se,ownerState:H,className:_.container}),[Z,me]=kt("transition",{elementType:hi,externalForwardedProps:se,ownerState:H,additionalProps:{appear:!0,in:v,timeout:B,role:"presentation"}});return c.jsx(z,{closeAfterTransition:!0,slots:{backdrop:J},slotProps:{backdrop:{transitionDuration:B,as:u,...Q}},disableEscapeKeyDown:p,onClose:C,open:v,onClick:K,...pe,...D,children:c.jsx(Z,{...me,children:c.jsx(ae,{onMouseDown:$,...ie,children:c.jsx(re,{as:S,elevation:24,role:"dialog","aria-describedby":s,"aria-labelledby":G,"aria-modal":l,...ne,children:c.jsx(g2.Provider,{value:q,children:f})})})})})});function i8(e){return Ge("MuiDialogActions",e)}We("MuiDialogActions",["root","spacing"]);const s8=e=>{const{classes:t,disableSpacing:n}=e;return Ke({root:["root",!n&&"spacing"]},i8,t)},a8=fe("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),ro=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialogActions"}),{className:o,disableSpacing:i=!1,...s}=r,a={...r,disableSpacing:i},l=s8(a);return c.jsx(a8,{className:Ue(l.root,o),ownerState:a,ref:n,...s})});function l8(e){return Ge("MuiDialogContent",e)}We("MuiDialogContent",["root","dividers"]);function u8(e){return Ge("MuiDialogTitle",e)}const c8=We("MuiDialogTitle",["root"]),d8=e=>{const{classes:t,dividers:n}=e;return Ke({root:["root",n&&"dividers"]},l8,t)},f8=fe("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(ft(({theme:e})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:t})=>t.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>!t.dividers,style:{[`.${c8.root} + &`]:{paddingTop:0}}}]}))),oo=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialogContent"}),{className:o,dividers:i=!1,...s}=r,a={...r,dividers:i},l=d8(a);return c.jsx(f8,{className:Ue(l.root,o),ownerState:a,ref:n,...s})});function p8(e){return Ge("MuiTypography",e)}const Cg=We("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),h8={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},m8=wk(),g8=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:i,classes:s}=e,a={root:["root",i,e.align!=="inherit"&&`align${Fe(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]};return Ke(a,p8,s)},b8=fe("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${Fe(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(ft(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([t,n])=>t!=="inherit"&&n&&typeof n=="object").map(([t,n])=>({props:{variant:t},style:n})),...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,t])=>typeof t=="string").map(([t])=>({props:{color:`text${Fe(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:t})=>t.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:t})=>t.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:t})=>t.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:t})=>t.paragraph,style:{marginBottom:16}}]}))),Eg={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Dt=M.forwardRef(function(t,n){const{color:r,...o}=ut({props:t,name:"MuiTypography"}),i=!h8[r],s=m8({...o,...i&&{color:r}}),{align:a="inherit",className:l,component:u,gutterBottom:d=!1,noWrap:f=!1,paragraph:h=!1,variant:p="body1",variantMapping:m=Eg,...b}=s,y={...s,align:a,color:r,className:l,component:u,gutterBottom:d,noWrap:f,paragraph:h,variant:p,variantMapping:m},x=u||(h?"p":m[p]||Eg[p])||"span",C=g8(y);return c.jsx(b8,{as:x,ref:n,className:Ue(C.root,l),...b,ownerState:y,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...b.style}})}),y8=e=>{const{classes:t}=e;return Ke({root:["root"]},u8,t)},x8=fe(Dt,{name:"MuiDialogTitle",slot:"Root"})({padding:"16px 24px",flex:"0 0 auto"}),Eo=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialogTitle"}),{className:o,id:i,...s}=r,a=r,l=y8(a),{titleId:u=i}=M.useContext(g2);return c.jsx(x8,{component:"h2",className:Ue(l.root,o),ownerState:a,ref:n,variant:"h6",id:i??u,...s})});function vg(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function Vu(e,t=!1){return e&&(vg(e.value)&&e.value!==""||t&&vg(e.defaultValue)&&e.defaultValue!=="")}function C8(e){return e.startAdornment}function E8(e){return Ge("MuiFormControl",e)}We("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const v8=e=>{const{classes:t,margin:n,fullWidth:r}=e,o={root:["root",n!=="none"&&`margin${Fe(n)}`,r&&"fullWidth"]};return Ke(o,E8,t)},T8=fe("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${Fe(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),Wu=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiFormControl"}),{children:o,className:i,color:s="primary",component:a="div",disabled:l=!1,error:u=!1,focused:d,fullWidth:f=!1,hiddenLabel:h=!1,margin:p="none",required:m=!1,size:b="medium",variant:y="outlined",...x}=r,C={...r,color:s,component:a,disabled:l,error:u,fullWidth:f,hiddenLabel:h,margin:p,required:m,size:b,variant:y},v=v8(C),[S,I]=M.useState(()=>{let L=!1;return o&&M.Children.forEach(o,$=>{if(!ou($,["Input","Select"]))return;const K=ou($,["Select"])?$.props.input:$;K&&C8(K.props)&&(L=!0)}),L}),[T,N]=M.useState(()=>{let L=!1;return o&&M.Children.forEach(o,$=>{ou($,["Input","Select"])&&(Vu($.props,!0)||Vu($.props.inputProps,!0))&&(L=!0)}),L}),[O,F]=M.useState(!1);l&&O&&F(!1);const B=d!==void 0&&!l?d:O;let j;M.useRef(!1);const D=M.useCallback(()=>{N(!0)},[]),H=M.useCallback(()=>{N(!1)},[]),_=M.useMemo(()=>({adornedStart:S,setAdornedStart:I,color:s,disabled:l,error:u,filled:T,focused:B,fullWidth:f,hiddenLabel:h,size:b,onBlur:()=>{F(!1)},onFocus:()=>{F(!0)},onEmpty:H,onFilled:D,registerEffect:j,required:m,variant:y}),[S,s,l,u,T,B,f,h,j,H,D,m,b,y]);return c.jsx(kc.Provider,{value:_,children:c.jsx(T8,{as:a,ownerState:C,className:Ue(v.root,i),ref:n,...x,children:o})})});function S8(e){return Ge("MuiFormControlLabel",e)}const Ia=We("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]);function Ei({props:e,states:t,muiFormControl:n}){return t.reduce((r,o)=>(r[o]=e[o],n&&typeof e[o]>"u"&&(r[o]=n[o]),r),{})}const k8=e=>{const{classes:t,disabled:n,labelPlacement:r,error:o,required:i}=e,s={root:["root",n&&"disabled",`labelPlacement${Fe(r)}`,o&&"error",i&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]};return Ke(s,S8,t)},w8=fe("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Ia.label}`]:t.label},t.root,t[`labelPlacement${Fe(n.labelPlacement)}`]]}})(ft(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Ia.disabled}`]:{cursor:"default"},[`& .${Ia.label}`]:{[`&.${Ia.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:t})=>t==="start"||t==="top"||t==="bottom",style:{marginLeft:16}}]}))),D8=fe("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(ft(({theme:e})=>({[`&.${Ia.error}`]:{color:(e.vars||e).palette.error.main}}))),I8=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiFormControlLabel"}),{checked:o,className:i,componentsProps:s={},control:a,disabled:l,disableTypography:u,inputRef:d,label:f,labelPlacement:h="end",name:p,onChange:m,required:b,slots:y={},slotProps:x={},value:C,...v}=r,S=ar(),I=l??a.props.disabled??S?.disabled,T=b??a.props.required,N={disabled:I,required:T};["checked","name","onChange","value","inputRef"].forEach(L=>{typeof a.props[L]>"u"&&typeof r[L]<"u"&&(N[L]=r[L])});const O=Ei({props:r,muiFormControl:S,states:["error"]}),F={...r,disabled:I,labelPlacement:h,required:T,error:O.error},B=k8(F),j={slots:y,slotProps:{...s,...x}},[D,H]=kt("typography",{elementType:Dt,externalForwardedProps:j,ownerState:F});let _=f;return _!=null&&_.type!==Dt&&!u&&(_=c.jsx(D,{component:"span",...H,className:Ue(B.label,H?.className),children:_})),c.jsxs(w8,{className:Ue(B.root,i),ownerState:F,ref:n,...v,children:[M.cloneElement(a,N),T?c.jsxs("div",{children:[_,c.jsxs(D8,{ownerState:F,"aria-hidden":!0,className:B.asterisk,children:[" ","*"]})]}):_]})});function A8(e){return Ge("MuiIconButton",e)}const Tg=We("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),O8=e=>{const{classes:t,disabled:n,color:r,edge:o,size:i,loading:s}=e,a={root:["root",s&&"loading",n&&"disabled",r!=="default"&&`color${Fe(r)}`,o&&`edge${Fe(o)}`,`size${Fe(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Ke(a,A8,t)},M8=fe(pi,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${Fe(n.color)}`],n.edge&&t[`edge${Fe(n.edge)}`],t[`size${Fe(n.size)}`]]}})(ft(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),ft(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${Tg.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${Tg.loading}`]:{color:"transparent"}}))),P8=fe("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),Ir=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiIconButton"}),{edge:o=!1,children:i,className:s,color:a="default",disabled:l=!1,disableFocusRipple:u=!1,size:d="medium",id:f,loading:h=null,loadingIndicator:p,...m}=r,b=_r(f),y=p??c.jsx(Mp,{"aria-labelledby":b,color:"inherit",size:16}),x={...r,edge:o,color:a,disabled:l,disableFocusRipple:u,loading:h,loadingIndicator:y,size:d},C=O8(x);return c.jsxs(M8,{id:h?b:f,className:Ue(C.root,s),centerRipple:!0,focusRipple:!u,disabled:l||h,ref:n,...m,ownerState:x,children:[typeof h=="boolean"&&c.jsx("span",{className:C.loadingWrapper,style:{display:"contents"},children:c.jsx(P8,{className:C.loadingIndicator,ownerState:x,children:h&&y})}),i]})});function R8(e){return Ge("MuiListItemIcon",e)}const Sg=We("MuiListItemIcon",["root","alignItemsFlexStart"]),ho=M.createContext({}),N8=e=>{const{alignItems:t,classes:n}=e;return Ke({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},R8,n)},F8=fe("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(ft(({theme:e})=>({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),Rp=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListItemIcon"}),{className:o,...i}=r,s=M.useContext(ho),a={...r,alignItems:s.alignItems},l=N8(a);return c.jsx(F8,{className:Ue(l.root,o),ownerState:a,ref:n,...i})});function L8(e){return Ge("MuiListItemText",e)}const Zi=We("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),_8=e=>{const{classes:t,inset:n,primary:r,secondary:o,dense:i}=e;return Ke({root:["root",n&&"inset",i&&"dense",r&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},L8,t)},B8=fe("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Zi.primary}`]:t.primary},{[`& .${Zi.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${Cg.root}:where(& .${Zi.primary})`]:{display:"block"},[`.${Cg.root}:where(& .${Zi.secondary})`]:{display:"block"},variants:[{props:({ownerState:e})=>e.primary&&e.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:56}}]}),Np=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListItemText"}),{children:o,className:i,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:u,secondary:d,secondaryTypographyProps:f,slots:h={},slotProps:p={},...m}=r,{dense:b}=M.useContext(ho);let y=l??o,x=d;const C={...r,disableTypography:s,inset:a,primary:!!y,secondary:!!x,dense:b},v=_8(C),S={slots:h,slotProps:{primary:u,secondary:f,...p}},[I,T]=kt("root",{className:Ue(v.root,i),elementType:B8,externalForwardedProps:{...S,...m},ownerState:C,ref:n}),[N,O]=kt("primary",{className:v.primary,elementType:Dt,externalForwardedProps:S,ownerState:C}),[F,B]=kt("secondary",{className:v.secondary,elementType:Dt,externalForwardedProps:S,ownerState:C});return y!=null&&y.type!==Dt&&!s&&(y=c.jsx(N,{variant:b?"body2":"body1",component:O?.variant?void 0:"span",...O,children:y})),x!=null&&x.type!==Dt&&!s&&(x=c.jsx(F,{variant:"body2",color:"textSecondary",...B,children:x})),c.jsxs(I,{...T,children:[y,x]})}),kg=We("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);function j8(e){return Ge("MuiMenuItem",e)}const ra=We("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),$8=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},H8=e=>{const{disabled:t,dense:n,divider:r,disableGutters:o,selected:i,classes:s}=e,l=Ke({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",r&&"divider",i&&"selected"]},j8,s);return{...s,...l}},z8=fe(pi,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:$8})(ft(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${ra.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${ra.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${ra.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${ra.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${ra.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${kg.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${kg.inset}`]:{marginLeft:52},[`& .${Zi.root}`]:{marginTop:0,marginBottom:0},[`& .${Zi.inset}`]:{paddingLeft:36},[`& .${Sg.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${Sg.root} svg`]:{fontSize:"1.25rem"}}}]}))),bn=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:u,role:d="menuitem",tabIndex:f,className:h,...p}=r,m=M.useContext(ho),b=M.useMemo(()=>({dense:s||m.dense||!1,disableGutters:l}),[m.dense,s,l]),y=M.useRef(null);yn(()=>{o&&y.current&&y.current.focus()},[o]);const x={...r,dense:b.dense,divider:a,disableGutters:l},C=H8(r),v=vt(y,n);let S;return r.disabled||(S=f!==void 0?f:-1),c.jsx(ho.Provider,{value:b,children:c.jsx(z8,{ref:v,role:d,tabIndex:S,component:i,focusVisibleClassName:Ue(C.focusVisible,u),className:Ue(C.root,h),...p,ownerState:x,classes:C})})});function U8({materialization:e,onCloseDialog:t,isMutating:n,onDelete:r}){const[o,i]=W.useState(!1),[s,a]=W.useState(!1),l=()=>i(!0),u=()=>{i(!1),a(!1),t()};return c.jsxs(W.Fragment,{children:[c.jsxs(bn,{"aria-label":`Delete materialization ${e?.id??""}`.trim(),onClick:d=>{d.stopPropagation(),l()},sx:{color:"error.main"},children:[c.jsx(Rp,{sx:{color:"inherit"},children:c.jsx(On.Delete,{fontSize:"small"})}),c.jsx(Np,{children:"Delete"})]}),c.jsxs(no,{onClose:u,open:o,"aria-labelledby":"delete-materialization-title",children:[c.jsx(Eo,{sx:{m:0,p:2},id:"delete-materialization-title",children:"Delete Materialization"}),c.jsx(Ir,{"aria-label":"close",onClick:u,sx:d=>({position:"absolute",right:8,top:8,color:d.palette.grey[500]}),children:c.jsx(Fr,{})}),c.jsxs(oo,{dividers:!0,children:[c.jsx(Dt,{gutterBottom:!0,children:"Are you sure you want to delete this materialization record? This action cannot be undone."}),c.jsx(I8,{control:c.jsx(Pp,{checked:s,onChange:d=>a(d.target.checked)}),label:"Also drop the materialized table(s) this run produced"})]}),c.jsx(ro,{children:c.jsx(tn,{loading:n,variant:"contained",autoFocus:!0,onClick:()=>r(s),color:"error",children:"Delete"})})]})]})}function b2({materializations:e,mutable:t,isMutating:n,showPackage:r=!1,onClickPackage:o,onStop:i,onDelete:s,onViewDetails:a}){return e.length===0?c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{py:1,fontStyle:"italic"},children:"No materializations yet."}):c.jsxs(w.Table,{size:"small",children:[c.jsx(w.TableHead,{children:c.jsxs(w.TableRow,{children:[r&&c.jsx(w.TableCell,{children:"Package"}),c.jsx(w.TableCell,{children:"Status"}),c.jsx(w.TableCell,{children:"Trigger"}),c.jsx(w.TableCell,{children:"Started"}),c.jsx(w.TableCell,{children:"Duration"}),c.jsx(w.TableCell,{children:"Sources"}),c.jsx(w.TableCell,{align:"right",children:"Actions"})]})}),c.jsx(w.TableBody,{children:e.map(l=>c.jsx(V8,{materialization:l,mutable:t,isMutating:n,showPackage:r,onClickPackage:o,onStop:i,onDelete:s,onViewDetails:a},l.id))})]})}function V8({materialization:e,mutable:t,isMutating:n,showPackage:r,onClickPackage:o,onStop:i,onDelete:s,onViewDetails:a}){const[l,u]=W.useState(null),d=!!l,f=()=>u(null),h=e2(e),p=h.sourcesBuilt!==void 0||h.sourcesReused!==void 0?`${h.sourcesBuilt??0} built, ${h.sourcesReused??0} reused`:"-",m=Ja(e.status),b=yN(e.status),y=e.error??void 0,x=t&&(m||b);return c.jsxs(w.TableRow,{hover:!0,sx:{cursor:"pointer","&:focus-visible":{outline:"2px solid",outlineColor:"primary.main",outlineOffset:"-2px"}},onClick:()=>a(e),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),a(e))},role:"button",tabIndex:0,"aria-label":`View materialization ${e.id??""} details`.trim(),children:[r&&c.jsx(w.TableCell,{onClick:C=>C.stopPropagation(),children:o?c.jsx(w.Link,{component:"button",underline:"hover",onClick:()=>o(e.packageName??""),sx:{fontWeight:500},children:e.packageName}):e.packageName}),c.jsx(w.TableCell,{children:c.jsxs(w.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[c.jsx(w.Chip,{size:"small",label:Zx(e.status),color:Jx(e.status),variant:m?"filled":"outlined"}),y&&c.jsx(w.Tooltip,{title:y,children:c.jsx(Yx,{fontSize:"small",color:"error"})})]})}),c.jsx(w.TableCell,{children:c.jsx(n2,{meta:h})}),c.jsx(w.TableCell,{children:CN(e.startedAt??e.createdAt)}),c.jsx(w.TableCell,{children:t2(e.startedAt,e.completedAt)}),c.jsx(w.TableCell,{children:p}),c.jsx(w.TableCell,{align:"right",onClick:C=>C.stopPropagation(),children:x&&c.jsxs(c.Fragment,{children:[c.jsx(w.IconButton,{size:"small","aria-label":`Materialization actions for ${e.id??""}`.trim(),onClick:C=>u(C.currentTarget),children:c.jsx(On.MoreVert,{fontSize:"small"})}),c.jsxs(w.Menu,{anchorEl:l,open:d,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[t&&m&&c.jsxs(w.MenuItem,{"aria-label":`Stop materialization ${e.id??""}`.trim(),disabled:n,onClick:()=>{f(),i(e)},children:[c.jsx(w.ListItemIcon,{children:c.jsx(TN,{fontSize:"small"})}),c.jsx(w.ListItemText,{children:"Stop"})]}),t&&b&&c.jsx(U8,{materialization:e,isMutating:n,onCloseDialog:f,onDelete:C=>s(e,C)})]})]})})]})}var Go={},Xn={},oa={},Qo={},Fd={},wg;function W8(){return wg||(wg=1,Object.defineProperty(Fd,"__esModule",{value:!0})),Fd}var ia={},sa={},Dg;function vi(){if(Dg)return sa;Dg=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.CronField=void 0;let e=class y2{#e=!1;#n=!1;#i=!1;#o=[];options={rawValue:""};static get min(){throw new Error("min must be overridden")}static get max(){throw new Error("max must be overridden")}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(n,r={rawValue:""}){if(!Array.isArray(n))throw new Error(`${this.constructor.name} Validation error, values is not an array`);if(!(n.length>0))throw new Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...r,rawValue:r.rawValue??""},this.#o=n.sort(y2.sorter),this.#i=this.options.wildcard!==void 0?this.options.wildcard:this.#r(),this.#e=this.options.rawValue.includes("L")||n.includes("L"),this.#n=this.options.rawValue.includes("?")||n.includes("?")}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return this.#e}get hasQuestionMarkChar(){return this.#n}get isWildcard(){return this.#i}get values(){return this.#o}static sorter(n,r){const o=typeof n=="number",i=typeof r=="number";return o&&i?n-r:!o&&!i?n.localeCompare(r):o?-1:1}static findNearestValueInList(n,r,o){if(o){for(let i=n.length-1;i>=0;i--)if(n[i]<r)return n[i];return null}for(let i=0;i<n.length;i++)if(n[i]>r)return n[i];return null}findNearestValue(n,r){return this.constructor.findNearestValueInList(this.values,n,r)}serialize(){return{wildcard:this.#i,values:this.#o}}validate(){let n;const r=this.chars.length>0?` or chars ${this.chars.join("")}`:"",o=l=>u=>new RegExp(`^\\d{0,2}${u}$`).test(l),i=l=>(n=l,typeof l=="number"?l>=this.min&&l<=this.max:this.chars.some(o(l)));if(!this.#o.every(i))throw new Error(`${this.constructor.name} Validation error, got value ${n} expected range ${this.min}-${this.max}${r}`);const a=this.#o.find((l,u)=>this.#o.indexOf(l)!==u);if(a)throw new Error(`${this.constructor.name} Validation error, duplicate values found: ${a}`)}#r(){return this.options.rawValue.length>0?["*","?"].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(n,r)=>r+this.min).every(n=>this.#o.includes(n))}};return sa.CronField=e,sa}var Ig;function q8(){if(Ig)return ia;Ig=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.CronDayOfMonth=void 0;const e=vi(),t=1,n=31,r=Object.freeze(["L"]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(s,a){super(s,a),this.validate()}get values(){return super.values}};return ia.CronDayOfMonth=o,ia}var aa={},Ag;function Y8(){if(Ag)return aa;Ag=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.CronDayOfWeek=void 0;const e=vi(),t=0,n=7,r=Object.freeze(["L"]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(s,a){super(s,a),this.validate()}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}};return aa.CronDayOfWeek=o,aa}var la={},Og;function K8(){if(Og)return la;Og=1,Object.defineProperty(la,"__esModule",{value:!0}),la.CronHour=void 0;const e=vi(),t=0,n=23,r=Object.freeze([]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}constructor(s,a){super(s,a),this.validate()}get values(){return super.values}};return la.CronHour=o,la}var ua={},Mg;function G8(){if(Mg)return ua;Mg=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.CronMinute=void 0;const e=vi(),t=0,n=59,r=Object.freeze([]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}constructor(s,a){super(s,a),this.validate()}get values(){return super.values}};return ua.CronMinute=o,ua}var ca={},Ld={},Un={},Pg;function Q8(){if(Pg)return Un;Pg=1,Object.defineProperty(Un,"__esModule",{value:!0});class e extends Error{}class t extends e{constructor(g){super(`Invalid DateTime: ${g.toMessage()}`)}}class n extends e{constructor(g){super(`Invalid Interval: ${g.toMessage()}`)}}class r extends e{constructor(g){super(`Invalid Duration: ${g.toMessage()}`)}}class o extends e{}class i extends e{constructor(g){super(`Invalid unit ${g}`)}}class s extends e{}class a extends e{constructor(){super("Zone is an abstract class")}}const l="numeric",u="short",d="long",f={year:l,month:l,day:l},h={year:l,month:u,day:l},p={year:l,month:u,day:l,weekday:u},m={year:l,month:d,day:l},b={year:l,month:d,day:l,weekday:d},y={hour:l,minute:l},x={hour:l,minute:l,second:l},C={hour:l,minute:l,second:l,timeZoneName:u},v={hour:l,minute:l,second:l,timeZoneName:d},S={hour:l,minute:l,hourCycle:"h23"},I={hour:l,minute:l,second:l,hourCycle:"h23"},T={hour:l,minute:l,second:l,hourCycle:"h23",timeZoneName:u},N={hour:l,minute:l,second:l,hourCycle:"h23",timeZoneName:d},O={year:l,month:l,day:l,hour:l,minute:l},F={year:l,month:l,day:l,hour:l,minute:l,second:l},B={year:l,month:u,day:l,hour:l,minute:l},j={year:l,month:u,day:l,hour:l,minute:l,second:l},D={year:l,month:u,day:l,weekday:u,hour:l,minute:l},H={year:l,month:d,day:l,hour:l,minute:l,timeZoneName:u},_={year:l,month:d,day:l,hour:l,minute:l,second:l,timeZoneName:u},L={year:l,month:d,day:l,weekday:d,hour:l,minute:l,timeZoneName:d},$={year:l,month:d,day:l,weekday:d,hour:l,minute:l,second:l,timeZoneName:d};class K{get type(){throw new a}get name(){throw new a}get ianaName(){return this.name}get isUniversal(){throw new a}offsetName(g,k){throw new a}formatOffset(g,k){throw new a}offset(g){throw new a}equals(g){throw new a}get isValid(){throw new a}}let G=null;class q extends K{static get instance(){return G===null&&(G=new q),G}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(g,{format:k,locale:P}){return yh(g,k,P)}formatOffset(g,k){return Ls(this.offset(g),k)}offset(g){return-new Date(g).getTimezoneOffset()}equals(g){return g.type==="system"}get isValid(){return!0}}const R=new Map;function oe(A){let g=R.get(A);return g===void 0&&(g=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:A,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),R.set(A,g)),g}const se={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function z(A,g){const k=A.format(g).replace(/\u200E/g,""),P=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(k),[,U,ee,ce,de,ge,Be,et]=P;return[ce,U,ee,de,ge,Be,et]}function pe(A,g){const k=A.formatToParts(g),P=[];for(let U=0;U<k.length;U++){const{type:ee,value:ce}=k[U],de=se[ee];ee==="era"?P[de]=ce:je(de)||(P[de]=parseInt(ce,10))}return P}const J=new Map;class Q extends K{static create(g){let k=J.get(g);return k===void 0&&J.set(g,k=new Q(g)),k}static resetCache(){J.clear(),R.clear()}static isValidSpecifier(g){return this.isValidZone(g)}static isValidZone(g){if(!g)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:g}).format(),!0}catch{return!1}}constructor(g){super(),this.zoneName=g,this.valid=Q.isValidZone(g)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(g,{format:k,locale:P}){return yh(g,k,P,this.name)}formatOffset(g,k){return Ls(this.offset(g),k)}offset(g){if(!this.valid)return NaN;const k=new Date(g);if(isNaN(k))return NaN;const P=oe(this.name);let[U,ee,ce,de,ge,Be,et]=P.formatToParts?pe(P,k):z(P,k);de==="BC"&&(U=-Math.abs(U)+1);const Ut=Ol({year:U,month:ee,day:ce,hour:ge===24?0:ge,minute:Be,second:et,millisecond:0});let it=+k;const fn=it%1e3;return it-=fn>=0?fn:1e3+fn,(Ut-it)/(60*1e3)}equals(g){return g.type==="iana"&&g.name===this.name}get isValid(){return this.valid}}let re={};function ne(A,g={}){const k=JSON.stringify([A,g]);let P=re[k];return P||(P=new Intl.ListFormat(A,g),re[k]=P),P}const ae=new Map;function ie(A,g={}){const k=JSON.stringify([A,g]);let P=ae.get(k);return P===void 0&&(P=new Intl.DateTimeFormat(A,g),ae.set(k,P)),P}const Z=new Map;function me(A,g={}){const k=JSON.stringify([A,g]);let P=Z.get(k);return P===void 0&&(P=new Intl.NumberFormat(A,g),Z.set(k,P)),P}const le=new Map;function ue(A,g={}){const{base:k,...P}=g,U=JSON.stringify([A,P]);let ee=le.get(U);return ee===void 0&&(ee=new Intl.RelativeTimeFormat(A,g),le.set(U,ee)),ee}let Ie=null;function Ce(){return Ie||(Ie=new Intl.DateTimeFormat().resolvedOptions().locale,Ie)}const we=new Map;function ye(A){let g=we.get(A);return g===void 0&&(g=new Intl.DateTimeFormat(A).resolvedOptions(),we.set(A,g)),g}const ze=new Map;function Ne(A){let g=ze.get(A);if(!g){const k=new Intl.Locale(A);g="getWeekInfo"in k?k.getWeekInfo():k.weekInfo,"minimalDays"in g||(g={...Xe,...g}),ze.set(A,g)}return g}function nt(A){const g=A.indexOf("-x-");g!==-1&&(A=A.substring(0,g));const k=A.indexOf("-u-");if(k===-1)return[A];{let P,U;try{P=ie(A).resolvedOptions(),U=A}catch{const ge=A.substring(0,k);P=ie(ge).resolvedOptions(),U=ge}const{numberingSystem:ee,calendar:ce}=P;return[U,ee,ce]}}function _e(A,g,k){return(k||g)&&(A.includes("-u-")||(A+="-u"),k&&(A+=`-ca-${k}`),g&&(A+=`-nu-${g}`)),A}function Bt(A){const g=[];for(let k=1;k<=12;k++){const P=at.utc(2009,k,1);g.push(A(P))}return g}function yt(A){const g=[];for(let k=1;k<=7;k++){const P=at.utc(2016,11,13+k);g.push(A(P))}return g}function ot(A,g,k,P){const U=A.listingMode();return U==="error"?null:U==="en"?k(g):P(g)}function xe(A){return A.numberingSystem&&A.numberingSystem!=="latn"?!1:A.numberingSystem==="latn"||!A.locale||A.locale.startsWith("en")||ye(A.locale).numberingSystem==="latn"}class Pe{constructor(g,k,P){this.padTo=P.padTo||0,this.floor=P.floor||!1;const{padTo:U,floor:ee,...ce}=P;if(!k||Object.keys(ce).length>0){const de={useGrouping:!1,...P};P.padTo>0&&(de.minimumIntegerDigits=P.padTo),this.inf=me(g,de)}}format(g){if(this.inf){const k=this.floor?Math.floor(g):g;return this.inf.format(k)}else{const k=this.floor?Math.floor(g):jc(g,3);return dn(k,this.padTo)}}}class qe{constructor(g,k,P){this.opts=P,this.originalZone=void 0;let U;if(this.opts.timeZone)this.dt=g;else if(g.zone.type==="fixed"){const ce=-1*(g.offset/60),de=ce>=0?`Etc/GMT+${ce}`:`Etc/GMT${ce}`;g.offset!==0&&Q.create(de).valid?(U=de,this.dt=g):(U="UTC",this.dt=g.offset===0?g:g.setZone("UTC").plus({minutes:g.offset}),this.originalZone=g.zone)}else g.zone.type==="system"?this.dt=g:g.zone.type==="iana"?(this.dt=g,U=g.zone.name):(U="UTC",this.dt=g.setZone("UTC").plus({minutes:g.offset}),this.originalZone=g.zone);const ee={...this.opts};ee.timeZone=ee.timeZone||U,this.dtf=ie(k,ee)}format(){return this.originalZone?this.formatToParts().map(({value:g})=>g).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const g=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?g.map(k=>{if(k.type==="timeZoneName"){const P=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...k,value:P}}else return k}):g}resolvedOptions(){return this.dtf.resolvedOptions()}}class Je{constructor(g,k,P){this.opts={style:"long",...P},!k&&Ps()&&(this.rtf=ue(g,P))}format(g,k){return this.rtf?this.rtf.format(g,k):FE(k,g,this.opts.numeric,this.opts.style!=="long")}formatToParts(g,k){return this.rtf?this.rtf.formatToParts(g,k):[]}}const Xe={firstDay:1,minimalDays:4,weekend:[6,7]};class Re{static fromOpts(g){return Re.create(g.locale,g.numberingSystem,g.outputCalendar,g.weekSettings,g.defaultToEN)}static create(g,k,P,U,ee=!1){const ce=g||Pt.defaultLocale,de=ce||(ee?"en-US":Ce()),ge=k||Pt.defaultNumberingSystem,Be=P||Pt.defaultOutputCalendar,et=io(U)||Pt.defaultWeekSettings;return new Re(de,ge,Be,et,ce)}static resetCache(){Ie=null,ae.clear(),Z.clear(),le.clear(),we.clear(),ze.clear()}static fromObject({locale:g,numberingSystem:k,outputCalendar:P,weekSettings:U}={}){return Re.create(g,k,P,U)}constructor(g,k,P,U,ee){const[ce,de,ge]=nt(g);this.locale=ce,this.numberingSystem=k||de||null,this.outputCalendar=P||ge||null,this.weekSettings=U,this.intl=_e(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=ee,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=xe(this)),this.fastNumbersCached}listingMode(){const g=this.isEnglish(),k=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return g&&k?"en":"intl"}clone(g){return!g||Object.getOwnPropertyNames(g).length===0?this:Re.create(g.locale||this.specifiedLocale,g.numberingSystem||this.numberingSystem,g.outputCalendar||this.outputCalendar,io(g.weekSettings)||this.weekSettings,g.defaultToEN||!1)}redefaultToEN(g={}){return this.clone({...g,defaultToEN:!0})}redefaultToSystem(g={}){return this.clone({...g,defaultToEN:!1})}months(g,k=!1){return ot(this,g,Eh,()=>{const P=this.intl==="ja"||this.intl.startsWith("ja-");k&=!P;const U=k?{month:g,day:"numeric"}:{month:g},ee=k?"format":"standalone";if(!this.monthsCache[ee][g]){const ce=P?de=>this.dtFormatter(de,U).format():de=>this.extract(de,U,"month");this.monthsCache[ee][g]=Bt(ce)}return this.monthsCache[ee][g]})}weekdays(g,k=!1){return ot(this,g,Sh,()=>{const P=k?{weekday:g,year:"numeric",month:"long",day:"numeric"}:{weekday:g},U=k?"format":"standalone";return this.weekdaysCache[U][g]||(this.weekdaysCache[U][g]=yt(ee=>this.extract(ee,P,"weekday"))),this.weekdaysCache[U][g]})}meridiems(){return ot(this,void 0,()=>kh,()=>{if(!this.meridiemCache){const g={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[at.utc(2016,11,13,9),at.utc(2016,11,13,19)].map(k=>this.extract(k,g,"dayperiod"))}return this.meridiemCache})}eras(g){return ot(this,g,wh,()=>{const k={era:g};return this.eraCache[g]||(this.eraCache[g]=[at.utc(-40,1,1),at.utc(2017,1,1)].map(P=>this.extract(P,k,"era"))),this.eraCache[g]})}extract(g,k,P){const U=this.dtFormatter(g,k),ee=U.formatToParts(),ce=ee.find(de=>de.type.toLowerCase()===P);return ce?ce.value:null}numberFormatter(g={}){return new Pe(this.intl,g.forceSimple||this.fastNumbers,g)}dtFormatter(g,k={}){return new qe(g,this.intl,k)}relFormatter(g={}){return new Je(this.intl,this.isEnglish(),g)}listFormatter(g={}){return ne(this.intl,g)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||ye(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Rs()?Ne(this.locale):Xe}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(g){return this.locale===g.locale&&this.numberingSystem===g.numberingSystem&&this.outputCalendar===g.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let ct=null;class lt extends K{static get utcInstance(){return ct===null&&(ct=new lt(0)),ct}static instance(g){return g===0?lt.utcInstance:new lt(g)}static parseSpecifier(g){if(g){const k=g.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(k)return new lt(Ml(k[1],k[2]))}return null}constructor(g){super(),this.fixed=g}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ls(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ls(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(g,k){return Ls(this.fixed,k)}get isUniversal(){return!0}offset(){return this.fixed}equals(g){return g.type==="fixed"&&g.fixed===this.fixed}get isValid(){return!0}}class Mt extends K{constructor(g){super(),this.zoneName=g}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function be(A,g){if(je(A)||A===null)return g;if(A instanceof K)return A;if(Qn(A)){const k=A.toLowerCase();return k==="default"?g:k==="local"||k==="system"?q.instance:k==="utc"||k==="gmt"?lt.utcInstance:lt.parseSpecifier(k)||Q.create(A)}else return zt(A)?lt.instance(A):typeof A=="object"&&"offset"in A&&typeof A.offset=="function"?A:new Mt(A)}const Ae={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Oe={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Qe=Ae.hanidec.replace(/[\[|\]]/g,"").split("");function st(A){let g=parseInt(A,10);if(isNaN(g)){g="";for(let k=0;k<A.length;k++){const P=A.charCodeAt(k);if(A[k].search(Ae.hanidec)!==-1)g+=Qe.indexOf(A[k]);else for(const U in Oe){const[ee,ce]=Oe[U];P>=ee&&P<=ce&&(g+=P-ee)}}return parseInt(g,10)}else return g}const Nt=new Map;function Gt(){Nt.clear()}function bt({numberingSystem:A},g=""){const k=A||"latn";let P=Nt.get(k);P===void 0&&(P=new Map,Nt.set(k,P));let U=P.get(g);return U===void 0&&(U=new RegExp(`${Ae[k]}${g}`),P.set(g,U)),U}let sn=()=>Date.now(),Rn="system",jt=null,gn=null,lr=null,Nn=60,jr,Hn=null;class Pt{static get now(){return sn}static set now(g){sn=g}static set defaultZone(g){Rn=g}static get defaultZone(){return be(Rn,q.instance)}static get defaultLocale(){return jt}static set defaultLocale(g){jt=g}static get defaultNumberingSystem(){return gn}static set defaultNumberingSystem(g){gn=g}static get defaultOutputCalendar(){return lr}static set defaultOutputCalendar(g){lr=g}static get defaultWeekSettings(){return Hn}static set defaultWeekSettings(g){Hn=io(g)}static get twoDigitCutoffYear(){return Nn}static set twoDigitCutoffYear(g){Nn=g%100}static get throwOnInvalid(){return jr}static set throwOnInvalid(g){jr=g}static resetCaches(){Re.resetCache(),Q.resetCache(),at.resetCache(),Gt()}}class xn{constructor(g,k){this.reason=g,this.explanation=k}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const To=[0,31,59,90,120,151,181,212,243,273,304,334],ki=[0,31,60,91,121,152,182,213,244,274,305,335];function wn(A,g){return new xn("unit out of range",`you specified ${g} (of type ${typeof g}) as a ${A}, which is invalid`)}function $o(A,g,k){const P=new Date(Date.UTC(A,g-1,k));A<100&&A>=0&&P.setUTCFullYear(P.getUTCFullYear()-1900);const U=P.getUTCDay();return U===0?7:U}function wi(A,g,k){return k+(Ns(A)?ki:To)[g-1]}function So(A,g){const k=Ns(A)?ki:To,P=k.findIndex(ee=>ee<g),U=g-k[P];return{month:P+1,day:U}}function nn(A,g){return(A-g+7)%7+1}function rn(A,g=4,k=1){const{year:P,month:U,day:ee}=A,ce=wi(P,U,ee),de=nn($o(P,U,ee),k);let ge=Math.floor((ce-de+14-g)/7),Be;return ge<1?(Be=P-1,ge=Fs(Be,g,k)):ge>Fs(P,g,k)?(Be=P+1,ge=1):Be=P,{weekYear:Be,weekNumber:ge,weekday:de,...Rl(A)}}function Ar(A,g=4,k=1){const{weekYear:P,weekNumber:U,weekday:ee}=A,ce=nn($o(P,1,g),k),de=Ii(P);let ge=U*7+ee-ce-7+g,Be;ge<1?(Be=P-1,ge+=Ii(Be)):ge>de?(Be=P+1,ge-=Ii(P)):Be=P;const{month:et,day:pt}=So(Be,ge);return{year:Be,month:et,day:pt,...Rl(A)}}function Ho(A){const{year:g,month:k,day:P}=A,U=wi(g,k,P);return{year:g,ordinal:U,...Rl(A)}}function ko(A){const{year:g,ordinal:k}=A,{month:P,day:U}=So(g,k);return{year:g,month:P,day:U,...Rl(A)}}function zo(A,g){if(!je(A.localWeekday)||!je(A.localWeekNumber)||!je(A.localWeekYear)){if(!je(A.weekday)||!je(A.weekNumber)||!je(A.weekYear))throw new o("Cannot mix locale-based week fields with ISO-based week fields");return je(A.localWeekday)||(A.weekday=A.localWeekday),je(A.localWeekNumber)||(A.weekNumber=A.localWeekNumber),je(A.localWeekYear)||(A.weekYear=A.localWeekYear),delete A.localWeekday,delete A.localWeekNumber,delete A.localWeekYear,{minDaysInFirstWeek:g.getMinDaysInFirstWeek(),startOfWeek:g.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function ke(A,g=4,k=1){const P=Wt(A.weekYear),U=ur(A.weekNumber,1,Fs(A.weekYear,g,k)),ee=ur(A.weekday,1,7);return P?U?ee?!1:wn("weekday",A.weekday):wn("week",A.weekNumber):wn("weekYear",A.weekYear)}function Te(A){const g=Wt(A.year),k=ur(A.ordinal,1,Ii(A.year));return g?k?!1:wn("ordinal",A.ordinal):wn("year",A.year)}function Ye(A){const g=Wt(A.year),k=ur(A.month,1,12),P=ur(A.day,1,Al(A.year,A.month));return g?k?P?!1:wn("day",A.day):wn("month",A.month):wn("year",A.year)}function rt(A){const{hour:g,minute:k,second:P,millisecond:U}=A,ee=ur(g,0,23)||g===24&&k===0&&P===0&&U===0,ce=ur(k,0,59),de=ur(P,0,59),ge=ur(U,0,999);return ee?ce?de?ge?!1:wn("millisecond",U):wn("second",P):wn("minute",k):wn("hour",g)}function je(A){return typeof A>"u"}function zt(A){return typeof A=="number"}function Wt(A){return typeof A=="number"&&A%1===0}function Qn(A){return typeof A=="string"}function Di(A){return Object.prototype.toString.call(A)==="[object Date]"}function Ps(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Rs(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Il(A){return Array.isArray(A)?A:[A]}function wt(A,g,k){if(A.length!==0)return A.reduce((P,U)=>{const ee=[g(U),U];return P&&k(P[0],ee[0])===P[0]?P:ee},null)[1]}function $r(A,g){return g.reduce((k,P)=>(k[P]=A[P],k),{})}function Fn(A,g){return Object.prototype.hasOwnProperty.call(A,g)}function io(A){if(A==null)return null;if(typeof A!="object")throw new s("Week settings must be an object");if(!ur(A.firstDay,1,7)||!ur(A.minimalDays,1,7)||!Array.isArray(A.weekend)||A.weekend.some(g=>!ur(g,1,7)))throw new s("Invalid week settings");return{firstDay:A.firstDay,minimalDays:A.minimalDays,weekend:Array.from(A.weekend)}}function ur(A,g,k){return Wt(A)&&A>=g&&A<=k}function SE(A,g){return A-g*Math.floor(A/g)}function dn(A,g=2){const k=A<0;let P;return k?P="-"+(""+-A).padStart(g,"0"):P=(""+A).padStart(g,"0"),P}function wo(A){if(!(je(A)||A===null||A===""))return parseInt(A,10)}function Uo(A){if(!(je(A)||A===null||A===""))return parseFloat(A)}function Bc(A){if(!(je(A)||A===null||A==="")){const g=parseFloat("0."+A)*1e3;return Math.floor(g)}}function jc(A,g,k="round"){const P=10**g;switch(k){case"expand":return A>0?Math.ceil(A*P)/P:Math.floor(A*P)/P;case"trunc":return Math.trunc(A*P)/P;case"round":return Math.round(A*P)/P;case"floor":return Math.floor(A*P)/P;case"ceil":return Math.ceil(A*P)/P;default:throw new RangeError(`Value rounding ${k} is out of range`)}}function Ns(A){return A%4===0&&(A%100!==0||A%400===0)}function Ii(A){return Ns(A)?366:365}function Al(A,g){const k=SE(g-1,12)+1,P=A+(g-k)/12;return k===2?Ns(P)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][k-1]}function Ol(A){let g=Date.UTC(A.year,A.month-1,A.day,A.hour,A.minute,A.second,A.millisecond);return A.year<100&&A.year>=0&&(g=new Date(g),g.setUTCFullYear(A.year,A.month-1,A.day)),+g}function bh(A,g,k){return-nn($o(A,1,g),k)+g-1}function Fs(A,g=4,k=1){const P=bh(A,g,k),U=bh(A+1,g,k);return(Ii(A)-P+U)/7}function $c(A){return A>99?A:A>Pt.twoDigitCutoffYear?1900+A:2e3+A}function yh(A,g,k,P=null){const U=new Date(A),ee={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};P&&(ee.timeZone=P);const ce={timeZoneName:g,...ee},de=new Intl.DateTimeFormat(k,ce).formatToParts(U).find(ge=>ge.type.toLowerCase()==="timezonename");return de?de.value:null}function Ml(A,g){let k=parseInt(A,10);Number.isNaN(k)&&(k=0);const P=parseInt(g,10)||0,U=k<0||Object.is(k,-0)?-P:P;return k*60+U}function xh(A){const g=Number(A);if(typeof A=="boolean"||A===""||!Number.isFinite(g))throw new s(`Invalid unit value ${A}`);return g}function Pl(A,g){const k={};for(const P in A)if(Fn(A,P)){const U=A[P];if(U==null)continue;k[g(P)]=xh(U)}return k}function Ls(A,g){const k=Math.trunc(Math.abs(A/60)),P=Math.trunc(Math.abs(A%60)),U=A>=0?"+":"-";switch(g){case"short":return`${U}${dn(k,2)}:${dn(P,2)}`;case"narrow":return`${U}${k}${P>0?`:${P}`:""}`;case"techie":return`${U}${dn(k,2)}${dn(P,2)}`;default:throw new RangeError(`Value format ${g} is out of range for property format`)}}function Rl(A){return $r(A,["hour","minute","second","millisecond"])}const kE=["January","February","March","April","May","June","July","August","September","October","November","December"],Ch=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wE=["J","F","M","A","M","J","J","A","S","O","N","D"];function Eh(A){switch(A){case"narrow":return[...wE];case"short":return[...Ch];case"long":return[...kE];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const vh=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Th=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],DE=["M","T","W","T","F","S","S"];function Sh(A){switch(A){case"narrow":return[...DE];case"short":return[...Th];case"long":return[...vh];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const kh=["AM","PM"],IE=["Before Christ","Anno Domini"],AE=["BC","AD"],OE=["B","A"];function wh(A){switch(A){case"narrow":return[...OE];case"short":return[...AE];case"long":return[...IE];default:return null}}function ME(A){return kh[A.hour<12?0:1]}function PE(A,g){return Sh(g)[A.weekday-1]}function RE(A,g){return Eh(g)[A.month-1]}function NE(A,g){return wh(g)[A.year<0?0:1]}function FE(A,g,k="always",P=!1){const U={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},ee=["hours","minutes","seconds"].indexOf(A)===-1;if(k==="auto"&&ee){const pt=A==="days";switch(g){case 1:return pt?"tomorrow":`next ${U[A][0]}`;case-1:return pt?"yesterday":`last ${U[A][0]}`;case 0:return pt?"today":`this ${U[A][0]}`}}const ce=Object.is(g,-0)||g<0,de=Math.abs(g),ge=de===1,Be=U[A],et=P?ge?Be[1]:Be[2]||Be[1]:ge?U[A][0]:A;return ce?`${de} ${et} ago`:`in ${de} ${et}`}function Dh(A,g){let k="";for(const P of A)P.literal?k+=P.val:k+=g(P.val);return k}const LE={D:f,DD:h,DDD:m,DDDD:b,t:y,tt:x,ttt:C,tttt:v,T:S,TT:I,TTT:T,TTTT:N,f:O,ff:B,fff:H,ffff:L,F,FF:j,FFF:_,FFFF:$};class Dn{static create(g,k={}){return new Dn(g,k)}static parseFormat(g){let k=null,P="",U=!1;const ee=[];for(let ce=0;ce<g.length;ce++){const de=g.charAt(ce);de==="'"?((P.length>0||U)&&ee.push({literal:U||/^\s+$/.test(P),val:P===""?"'":P}),k=null,P="",U=!U):U||de===k?P+=de:(P.length>0&&ee.push({literal:/^\s+$/.test(P),val:P}),P=de,k=de)}return P.length>0&&ee.push({literal:U||/^\s+$/.test(P),val:P}),ee}static macroTokenToFormatOpts(g){return LE[g]}constructor(g,k){this.opts=k,this.loc=g,this.systemLoc=null}formatWithSystemDefault(g,k){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(g,{...this.opts,...k}).format()}dtFormatter(g,k={}){return this.loc.dtFormatter(g,{...this.opts,...k})}formatDateTime(g,k){return this.dtFormatter(g,k).format()}formatDateTimeParts(g,k){return this.dtFormatter(g,k).formatToParts()}formatInterval(g,k){return this.dtFormatter(g.start,k).dtf.formatRange(g.start.toJSDate(),g.end.toJSDate())}resolvedOptions(g,k){return this.dtFormatter(g,k).resolvedOptions()}num(g,k=0,P=void 0){if(this.opts.forceSimple)return dn(g,k);const U={...this.opts};return k>0&&(U.padTo=k),P&&(U.signDisplay=P),this.loc.numberFormatter(U).format(g)}formatDateTimeFromString(g,k){const P=this.loc.listingMode()==="en",U=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",ee=(it,fn)=>this.loc.extract(g,it,fn),ce=it=>g.isOffsetFixed&&g.offset===0&&it.allowZ?"Z":g.isValid?g.zone.formatOffset(g.ts,it.format):"",de=()=>P?ME(g):ee({hour:"numeric",hourCycle:"h12"},"dayperiod"),ge=(it,fn)=>P?RE(g,it):ee(fn?{month:it}:{month:it,day:"numeric"},"month"),Be=(it,fn)=>P?PE(g,it):ee(fn?{weekday:it}:{weekday:it,month:"long",day:"numeric"},"weekday"),et=it=>{const fn=Dn.macroTokenToFormatOpts(it);return fn?this.formatWithSystemDefault(g,fn):it},pt=it=>P?NE(g,it):ee({era:it},"era"),Ut=it=>{switch(it){case"S":return this.num(g.millisecond);case"u":case"SSS":return this.num(g.millisecond,3);case"s":return this.num(g.second);case"ss":return this.num(g.second,2);case"uu":return this.num(Math.floor(g.millisecond/10),2);case"uuu":return this.num(Math.floor(g.millisecond/100));case"m":return this.num(g.minute);case"mm":return this.num(g.minute,2);case"h":return this.num(g.hour%12===0?12:g.hour%12);case"hh":return this.num(g.hour%12===0?12:g.hour%12,2);case"H":return this.num(g.hour);case"HH":return this.num(g.hour,2);case"Z":return ce({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return ce({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return ce({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return g.zone.offsetName(g.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return g.zone.offsetName(g.ts,{format:"long",locale:this.loc.locale});case"z":return g.zoneName;case"a":return de();case"d":return U?ee({day:"numeric"},"day"):this.num(g.day);case"dd":return U?ee({day:"2-digit"},"day"):this.num(g.day,2);case"c":return this.num(g.weekday);case"ccc":return Be("short",!0);case"cccc":return Be("long",!0);case"ccccc":return Be("narrow",!0);case"E":return this.num(g.weekday);case"EEE":return Be("short",!1);case"EEEE":return Be("long",!1);case"EEEEE":return Be("narrow",!1);case"L":return U?ee({month:"numeric",day:"numeric"},"month"):this.num(g.month);case"LL":return U?ee({month:"2-digit",day:"numeric"},"month"):this.num(g.month,2);case"LLL":return ge("short",!0);case"LLLL":return ge("long",!0);case"LLLLL":return ge("narrow",!0);case"M":return U?ee({month:"numeric"},"month"):this.num(g.month);case"MM":return U?ee({month:"2-digit"},"month"):this.num(g.month,2);case"MMM":return ge("short",!1);case"MMMM":return ge("long",!1);case"MMMMM":return ge("narrow",!1);case"y":return U?ee({year:"numeric"},"year"):this.num(g.year);case"yy":return U?ee({year:"2-digit"},"year"):this.num(g.year.toString().slice(-2),2);case"yyyy":return U?ee({year:"numeric"},"year"):this.num(g.year,4);case"yyyyyy":return U?ee({year:"numeric"},"year"):this.num(g.year,6);case"G":return pt("short");case"GG":return pt("long");case"GGGGG":return pt("narrow");case"kk":return this.num(g.weekYear.toString().slice(-2),2);case"kkkk":return this.num(g.weekYear,4);case"W":return this.num(g.weekNumber);case"WW":return this.num(g.weekNumber,2);case"n":return this.num(g.localWeekNumber);case"nn":return this.num(g.localWeekNumber,2);case"ii":return this.num(g.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(g.localWeekYear,4);case"o":return this.num(g.ordinal);case"ooo":return this.num(g.ordinal,3);case"q":return this.num(g.quarter);case"qq":return this.num(g.quarter,2);case"X":return this.num(Math.floor(g.ts/1e3));case"x":return this.num(g.ts);default:return et(it)}};return Dh(Dn.parseFormat(k),Ut)}formatDurationFromString(g,k){const P=this.opts.signMode==="negativeLargestOnly"?-1:1,U=et=>{switch(et[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},ee=(et,pt)=>Ut=>{const it=U(Ut);if(it){const fn=pt.isNegativeDuration&&it!==pt.largestUnit?P:1;let Mr;return this.opts.signMode==="negativeLargestOnly"&&it!==pt.largestUnit?Mr="never":this.opts.signMode==="all"?Mr="always":Mr="auto",this.num(et.get(it)*fn,Ut.length,Mr)}else return Ut},ce=Dn.parseFormat(k),de=ce.reduce((et,{literal:pt,val:Ut})=>pt?et:et.concat(Ut),[]),ge=g.shiftTo(...de.map(U).filter(et=>et)),Be={isNegativeDuration:ge<0,largestUnit:Object.keys(ge.values)[0]};return Dh(ce,ee(ge,Be))}}const Ih=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ai(...A){const g=A.reduce((k,P)=>k+P.source,"");return RegExp(`^${g}$`)}function Oi(...A){return g=>A.reduce(([k,P,U],ee)=>{const[ce,de,ge]=ee(g,U);return[{...k,...ce},de||P,ge]},[{},null,1]).slice(0,2)}function Mi(A,...g){if(A==null)return[null,null];for(const[k,P]of g){const U=k.exec(A);if(U)return P(U)}return[null,null]}function Ah(...A){return(g,k)=>{const P={};let U;for(U=0;U<A.length;U++)P[A[U]]=wo(g[k+U]);return[P,null,k+U]}}const Oh=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,_E=`(?:${Oh.source}?(?:\\[(${Ih.source})\\])?)?`,Hc=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Mh=RegExp(`${Hc.source}${_E}`),zc=RegExp(`(?:[Tt]${Mh.source})?`),BE=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,jE=/(\d{4})-?W(\d\d)(?:-?(\d))?/,$E=/(\d{4})-?(\d{3})/,HE=Ah("weekYear","weekNumber","weekDay"),zE=Ah("year","ordinal"),UE=/(\d{4})-(\d\d)-(\d\d)/,Ph=RegExp(`${Hc.source} ?(?:${Oh.source}|(${Ih.source}))?`),VE=RegExp(`(?: ${Ph.source})?`);function Pi(A,g,k){const P=A[g];return je(P)?k:wo(P)}function WE(A,g){return[{year:Pi(A,g),month:Pi(A,g+1,1),day:Pi(A,g+2,1)},null,g+3]}function Ri(A,g){return[{hours:Pi(A,g,0),minutes:Pi(A,g+1,0),seconds:Pi(A,g+2,0),milliseconds:Bc(A[g+3])},null,g+4]}function _s(A,g){const k=!A[g]&&!A[g+1],P=Ml(A[g+1],A[g+2]),U=k?null:lt.instance(P);return[{},U,g+3]}function Bs(A,g){const k=A[g]?Q.create(A[g]):null;return[{},k,g+1]}const qE=RegExp(`^T?${Hc.source}$`),YE=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function KE(A){const[g,k,P,U,ee,ce,de,ge,Be]=A,et=g[0]==="-",pt=ge&&ge[0]==="-",Ut=(it,fn=!1)=>it!==void 0&&(fn||it&&et)?-it:it;return[{years:Ut(Uo(k)),months:Ut(Uo(P)),weeks:Ut(Uo(U)),days:Ut(Uo(ee)),hours:Ut(Uo(ce)),minutes:Ut(Uo(de)),seconds:Ut(Uo(ge),ge==="-0"),milliseconds:Ut(Bc(Be),pt)}]}const GE={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Uc(A,g,k,P,U,ee,ce){const de={year:g.length===2?$c(wo(g)):wo(g),month:Ch.indexOf(k)+1,day:wo(P),hour:wo(U),minute:wo(ee)};return ce&&(de.second=wo(ce)),A&&(de.weekday=A.length>3?vh.indexOf(A)+1:Th.indexOf(A)+1),de}const QE=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function XE(A){const[,g,k,P,U,ee,ce,de,ge,Be,et,pt]=A,Ut=Uc(g,U,P,k,ee,ce,de);let it;return ge?it=GE[ge]:Be?it=0:it=Ml(et,pt),[Ut,new lt(it)]}function ZE(A){return A.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const JE=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,ev=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,tv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Rh(A){const[,g,k,P,U,ee,ce,de]=A;return[Uc(g,U,P,k,ee,ce,de),lt.utcInstance]}function nv(A){const[,g,k,P,U,ee,ce,de]=A;return[Uc(g,de,k,P,U,ee,ce),lt.utcInstance]}const rv=Ai(BE,zc),ov=Ai(jE,zc),iv=Ai($E,zc),sv=Ai(Mh),Nh=Oi(WE,Ri,_s,Bs),av=Oi(HE,Ri,_s,Bs),lv=Oi(zE,Ri,_s,Bs),uv=Oi(Ri,_s,Bs);function cv(A){return Mi(A,[rv,Nh],[ov,av],[iv,lv],[sv,uv])}function dv(A){return Mi(ZE(A),[QE,XE])}function fv(A){return Mi(A,[JE,Rh],[ev,Rh],[tv,nv])}function pv(A){return Mi(A,[YE,KE])}const hv=Oi(Ri);function mv(A){return Mi(A,[qE,hv])}const gv=Ai(UE,VE),bv=Ai(Ph),yv=Oi(Ri,_s,Bs);function xv(A){return Mi(A,[gv,Nh],[bv,yv])}const Fh="Invalid Duration",Lh={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Cv={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...Lh},cr=146097/400,Ni=146097/4800,Ev={years:{quarters:4,months:12,weeks:cr/7,days:cr,hours:cr*24,minutes:cr*24*60,seconds:cr*24*60*60,milliseconds:cr*24*60*60*1e3},quarters:{months:3,weeks:cr/28,days:cr/4,hours:cr*24/4,minutes:cr*24*60/4,seconds:cr*24*60*60/4,milliseconds:cr*24*60*60*1e3/4},months:{weeks:Ni/7,days:Ni,hours:Ni*24,minutes:Ni*24*60,seconds:Ni*24*60*60,milliseconds:Ni*24*60*60*1e3},...Lh},Vo=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],vv=Vo.slice(0).reverse();function so(A,g,k=!1){const P={values:k?g.values:{...A.values,...g.values||{}},loc:A.loc.clone(g.loc),conversionAccuracy:g.conversionAccuracy||A.conversionAccuracy,matrix:g.matrix||A.matrix};return new It(P)}function _h(A,g){var k;let P=(k=g.milliseconds)!=null?k:0;for(const U of vv.slice(1))g[U]&&(P+=g[U]*A[U].milliseconds);return P}function Bh(A,g){const k=_h(A,g)<0?-1:1;Vo.reduceRight((P,U)=>{if(je(g[U]))return P;if(P){const ee=g[P]*k,ce=A[U][P],de=Math.floor(ee/ce);g[U]+=de*k,g[P]-=de*ce*k}return U},null),Vo.reduce((P,U)=>{if(je(g[U]))return P;if(P){const ee=g[P]%1;g[P]-=ee,g[U]+=ee*A[P][U]}return U},null)}function jh(A){const g={};for(const[k,P]of Object.entries(A))P!==0&&(g[k]=P);return g}class It{constructor(g){const k=g.conversionAccuracy==="longterm"||!1;let P=k?Ev:Cv;g.matrix&&(P=g.matrix),this.values=g.values,this.loc=g.loc||Re.create(),this.conversionAccuracy=k?"longterm":"casual",this.invalid=g.invalid||null,this.matrix=P,this.isLuxonDuration=!0}static fromMillis(g,k){return It.fromObject({milliseconds:g},k)}static fromObject(g,k={}){if(g==null||typeof g!="object")throw new s(`Duration.fromObject: argument expected to be an object, got ${g===null?"null":typeof g}`);return new It({values:Pl(g,It.normalizeUnit),loc:Re.fromObject(k),conversionAccuracy:k.conversionAccuracy,matrix:k.matrix})}static fromDurationLike(g){if(zt(g))return It.fromMillis(g);if(It.isDuration(g))return g;if(typeof g=="object")return It.fromObject(g);throw new s(`Unknown duration argument ${g} of type ${typeof g}`)}static fromISO(g,k){const[P]=pv(g);return P?It.fromObject(P,k):It.invalid("unparsable",`the input "${g}" can't be parsed as ISO 8601`)}static fromISOTime(g,k){const[P]=mv(g);return P?It.fromObject(P,k):It.invalid("unparsable",`the input "${g}" can't be parsed as ISO 8601`)}static invalid(g,k=null){if(!g)throw new s("need to specify a reason the Duration is invalid");const P=g instanceof xn?g:new xn(g,k);if(Pt.throwOnInvalid)throw new r(P);return new It({invalid:P})}static normalizeUnit(g){const k={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[g&&g.toLowerCase()];if(!k)throw new i(g);return k}static isDuration(g){return g&&g.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(g,k={}){const P={...k,floor:k.round!==!1&&k.floor!==!1};return this.isValid?Dn.create(this.loc,P).formatDurationFromString(this,g):Fh}toHuman(g={}){if(!this.isValid)return Fh;const k=g.showZeros!==!1,P=Vo.map(U=>{const ee=this.values[U];return je(ee)||ee===0&&!k?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...g,unit:U.slice(0,-1)}).format(ee)}).filter(U=>U);return this.loc.listFormatter({type:"conjunction",style:g.listStyle||"narrow",...g}).format(P)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let g="P";return this.years!==0&&(g+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(g+=this.months+this.quarters*3+"M"),this.weeks!==0&&(g+=this.weeks+"W"),this.days!==0&&(g+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(g+="T"),this.hours!==0&&(g+=this.hours+"H"),this.minutes!==0&&(g+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(g+=jc(this.seconds+this.milliseconds/1e3,3)+"S"),g==="P"&&(g+="T0S"),g}toISOTime(g={}){if(!this.isValid)return null;const k=this.toMillis();return k<0||k>=864e5?null:(g={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...g,includeOffset:!1},at.fromMillis(k,{zone:"UTC"}).toISOTime(g))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?_h(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(g){if(!this.isValid)return this;const k=It.fromDurationLike(g),P={};for(const U of Vo)(Fn(k.values,U)||Fn(this.values,U))&&(P[U]=k.get(U)+this.get(U));return so(this,{values:P},!0)}minus(g){if(!this.isValid)return this;const k=It.fromDurationLike(g);return this.plus(k.negate())}mapUnits(g){if(!this.isValid)return this;const k={};for(const P of Object.keys(this.values))k[P]=xh(g(this.values[P],P));return so(this,{values:k},!0)}get(g){return this[It.normalizeUnit(g)]}set(g){if(!this.isValid)return this;const k={...this.values,...Pl(g,It.normalizeUnit)};return so(this,{values:k})}reconfigure({locale:g,numberingSystem:k,conversionAccuracy:P,matrix:U}={}){const ce={loc:this.loc.clone({locale:g,numberingSystem:k}),matrix:U,conversionAccuracy:P};return so(this,ce)}as(g){return this.isValid?this.shiftTo(g).get(g):NaN}normalize(){if(!this.isValid)return this;const g=this.toObject();return Bh(this.matrix,g),so(this,{values:g},!0)}rescale(){if(!this.isValid)return this;const g=jh(this.normalize().shiftToAll().toObject());return so(this,{values:g},!0)}shiftTo(...g){if(!this.isValid)return this;if(g.length===0)return this;g=g.map(ce=>It.normalizeUnit(ce));const k={},P={},U=this.toObject();let ee;for(const ce of Vo)if(g.indexOf(ce)>=0){ee=ce;let de=0;for(const Be in P)de+=this.matrix[Be][ce]*P[Be],P[Be]=0;zt(U[ce])&&(de+=U[ce]);const ge=Math.trunc(de);k[ce]=ge,P[ce]=(de*1e3-ge*1e3)/1e3}else zt(U[ce])&&(P[ce]=U[ce]);for(const ce in P)P[ce]!==0&&(k[ee]+=ce===ee?P[ce]:P[ce]/this.matrix[ee][ce]);return Bh(this.matrix,k),so(this,{values:k},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const g={};for(const k of Object.keys(this.values))g[k]=this.values[k]===0?0:-this.values[k];return so(this,{values:g},!0)}removeZeros(){if(!this.isValid)return this;const g=jh(this.values);return so(this,{values:g},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(g){if(!this.isValid||!g.isValid||!this.loc.equals(g.loc))return!1;function k(P,U){return P===void 0||P===0?U===void 0||U===0:P===U}for(const P of Vo)if(!k(this.values[P],g.values[P]))return!1;return!0}}const Fi="Invalid Interval";function Tv(A,g){return!A||!A.isValid?on.invalid("missing or invalid start"):!g||!g.isValid?on.invalid("missing or invalid end"):g<A?on.invalid("end before start",`The end of an interval must be after its start, but you had start=${A.toISO()} and end=${g.toISO()}`):null}class on{constructor(g){this.s=g.start,this.e=g.end,this.invalid=g.invalid||null,this.isLuxonInterval=!0}static invalid(g,k=null){if(!g)throw new s("need to specify a reason the Interval is invalid");const P=g instanceof xn?g:new xn(g,k);if(Pt.throwOnInvalid)throw new n(P);return new on({invalid:P})}static fromDateTimes(g,k){const P=zs(g),U=zs(k),ee=Tv(P,U);return ee??new on({start:P,end:U})}static after(g,k){const P=It.fromDurationLike(k),U=zs(g);return on.fromDateTimes(U,U.plus(P))}static before(g,k){const P=It.fromDurationLike(k),U=zs(g);return on.fromDateTimes(U.minus(P),U)}static fromISO(g,k){const[P,U]=(g||"").split("/",2);if(P&&U){let ee,ce;try{ee=at.fromISO(P,k),ce=ee.isValid}catch{ce=!1}let de,ge;try{de=at.fromISO(U,k),ge=de.isValid}catch{ge=!1}if(ce&&ge)return on.fromDateTimes(ee,de);if(ce){const Be=It.fromISO(U,k);if(Be.isValid)return on.after(ee,Be)}else if(ge){const Be=It.fromISO(P,k);if(Be.isValid)return on.before(de,Be)}}return on.invalid("unparsable",`the input "${g}" can't be parsed as ISO 8601`)}static isInterval(g){return g&&g.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(g="milliseconds"){return this.isValid?this.toDuration(g).get(g):NaN}count(g="milliseconds",k){if(!this.isValid)return NaN;const P=this.start.startOf(g,k);let U;return k!=null&&k.useLocaleWeeks?U=this.end.reconfigure({locale:P.locale}):U=this.end,U=U.startOf(g,k),Math.floor(U.diff(P,g).get(g))+(U.valueOf()!==this.end.valueOf())}hasSame(g){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,g):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(g){return this.isValid?this.s>g:!1}isBefore(g){return this.isValid?this.e<=g:!1}contains(g){return this.isValid?this.s<=g&&this.e>g:!1}set({start:g,end:k}={}){return this.isValid?on.fromDateTimes(g||this.s,k||this.e):this}splitAt(...g){if(!this.isValid)return[];const k=g.map(zs).filter(ce=>this.contains(ce)).sort((ce,de)=>ce.toMillis()-de.toMillis()),P=[];let{s:U}=this,ee=0;for(;U<this.e;){const ce=k[ee]||this.e,de=+ce>+this.e?this.e:ce;P.push(on.fromDateTimes(U,de)),U=de,ee+=1}return P}splitBy(g){const k=It.fromDurationLike(g);if(!this.isValid||!k.isValid||k.as("milliseconds")===0)return[];let{s:P}=this,U=1,ee;const ce=[];for(;P<this.e;){const de=this.start.plus(k.mapUnits(ge=>ge*U));ee=+de>+this.e?this.e:de,ce.push(on.fromDateTimes(P,ee)),P=ee,U+=1}return ce}divideEqually(g){return this.isValid?this.splitBy(this.length()/g).slice(0,g):[]}overlaps(g){return this.e>g.s&&this.s<g.e}abutsStart(g){return this.isValid?+this.e==+g.s:!1}abutsEnd(g){return this.isValid?+g.e==+this.s:!1}engulfs(g){return this.isValid?this.s<=g.s&&this.e>=g.e:!1}equals(g){return!this.isValid||!g.isValid?!1:this.s.equals(g.s)&&this.e.equals(g.e)}intersection(g){if(!this.isValid)return this;const k=this.s>g.s?this.s:g.s,P=this.e<g.e?this.e:g.e;return k>=P?null:on.fromDateTimes(k,P)}union(g){if(!this.isValid)return this;const k=this.s<g.s?this.s:g.s,P=this.e>g.e?this.e:g.e;return on.fromDateTimes(k,P)}static merge(g){const[k,P]=g.sort((U,ee)=>U.s-ee.s).reduce(([U,ee],ce)=>ee?ee.overlaps(ce)||ee.abutsStart(ce)?[U,ee.union(ce)]:[U.concat([ee]),ce]:[U,ce],[[],null]);return P&&k.push(P),k}static xor(g){let k=null,P=0;const U=[],ee=g.map(ge=>[{time:ge.s,type:"s"},{time:ge.e,type:"e"}]),ce=Array.prototype.concat(...ee),de=ce.sort((ge,Be)=>ge.time-Be.time);for(const ge of de)P+=ge.type==="s"?1:-1,P===1?k=ge.time:(k&&+k!=+ge.time&&U.push(on.fromDateTimes(k,ge.time)),k=null);return on.merge(U)}difference(...g){return on.xor([this].concat(g)).map(k=>this.intersection(k)).filter(k=>k&&!k.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Fi}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(g=f,k={}){return this.isValid?Dn.create(this.s.loc.clone(k),g).formatInterval(this):Fi}toISO(g){return this.isValid?`${this.s.toISO(g)}/${this.e.toISO(g)}`:Fi}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Fi}toISOTime(g){return this.isValid?`${this.s.toISOTime(g)}/${this.e.toISOTime(g)}`:Fi}toFormat(g,{separator:k=" – "}={}){return this.isValid?`${this.s.toFormat(g)}${k}${this.e.toFormat(g)}`:Fi}toDuration(g,k){return this.isValid?this.e.diff(this.s,g,k):It.invalid(this.invalidReason)}mapEndpoints(g){return on.fromDateTimes(g(this.s),g(this.e))}}class js{static hasDST(g=Pt.defaultZone){const k=at.now().setZone(g).set({month:12});return!g.isUniversal&&k.offset!==k.set({month:6}).offset}static isValidIANAZone(g){return Q.isValidZone(g)}static normalizeZone(g){return be(g,Pt.defaultZone)}static getStartOfWeek({locale:g=null,locObj:k=null}={}){return(k||Re.create(g)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:g=null,locObj:k=null}={}){return(k||Re.create(g)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:g=null,locObj:k=null}={}){return(k||Re.create(g)).getWeekendDays().slice()}static months(g="long",{locale:k=null,numberingSystem:P=null,locObj:U=null,outputCalendar:ee="gregory"}={}){return(U||Re.create(k,P,ee)).months(g)}static monthsFormat(g="long",{locale:k=null,numberingSystem:P=null,locObj:U=null,outputCalendar:ee="gregory"}={}){return(U||Re.create(k,P,ee)).months(g,!0)}static weekdays(g="long",{locale:k=null,numberingSystem:P=null,locObj:U=null}={}){return(U||Re.create(k,P,null)).weekdays(g)}static weekdaysFormat(g="long",{locale:k=null,numberingSystem:P=null,locObj:U=null}={}){return(U||Re.create(k,P,null)).weekdays(g,!0)}static meridiems({locale:g=null}={}){return Re.create(g).meridiems()}static eras(g="short",{locale:k=null}={}){return Re.create(k,null,"gregory").eras(g)}static features(){return{relative:Ps(),localeWeek:Rs()}}}function $h(A,g){const k=U=>U.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),P=k(g)-k(A);return Math.floor(It.fromMillis(P).as("days"))}function Sv(A,g,k){const P=[["years",(ge,Be)=>Be.year-ge.year],["quarters",(ge,Be)=>Be.quarter-ge.quarter+(Be.year-ge.year)*4],["months",(ge,Be)=>Be.month-ge.month+(Be.year-ge.year)*12],["weeks",(ge,Be)=>{const et=$h(ge,Be);return(et-et%7)/7}],["days",$h]],U={},ee=A;let ce,de;for(const[ge,Be]of P)k.indexOf(ge)>=0&&(ce=ge,U[ge]=Be(A,g),de=ee.plus(U),de>g?(U[ge]--,A=ee.plus(U),A>g&&(de=A,U[ge]--,A=ee.plus(U))):A=de);return[A,U,de,ce]}function kv(A,g,k,P){let[U,ee,ce,de]=Sv(A,g,k);const ge=g-U,Be=k.filter(pt=>["hours","minutes","seconds","milliseconds"].indexOf(pt)>=0);Be.length===0&&(ce<g&&(ce=U.plus({[de]:1})),ce!==U&&(ee[de]=(ee[de]||0)+ge/(ce-U)));const et=It.fromObject(ee,P);return Be.length>0?It.fromMillis(ge,P).shiftTo(...Be).plus(et):et}const wv="missing Intl.DateTimeFormat.formatToParts support";function Rt(A,g=k=>k){return{regex:A,deser:([k])=>g(st(k))}}const Hh="[ ]",zh=new RegExp(Hh,"g");function Dv(A){return A.replace(/\./g,"\\.?").replace(zh,Hh)}function Uh(A){return A.replace(/\./g,"").replace(zh," ").toLowerCase()}function Or(A,g){return A===null?null:{regex:RegExp(A.map(Dv).join("|")),deser:([k])=>A.findIndex(P=>Uh(k)===Uh(P))+g}}function Vh(A,g){return{regex:A,deser:([,k,P])=>Ml(k,P),groups:g}}function Nl(A){return{regex:A,deser:([g])=>g}}function Iv(A){return A.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Av(A,g){const k=bt(g),P=bt(g,"{2}"),U=bt(g,"{3}"),ee=bt(g,"{4}"),ce=bt(g,"{6}"),de=bt(g,"{1,2}"),ge=bt(g,"{1,3}"),Be=bt(g,"{1,6}"),et=bt(g,"{1,9}"),pt=bt(g,"{2,4}"),Ut=bt(g,"{4,6}"),it=Hr=>({regex:RegExp(Iv(Hr.val)),deser:([_i])=>_i,literal:!0}),Mr=(Hr=>{if(A.literal)return it(Hr);switch(Hr.val){case"G":return Or(g.eras("short"),0);case"GG":return Or(g.eras("long"),0);case"y":return Rt(Be);case"yy":return Rt(pt,$c);case"yyyy":return Rt(ee);case"yyyyy":return Rt(Ut);case"yyyyyy":return Rt(ce);case"M":return Rt(de);case"MM":return Rt(P);case"MMM":return Or(g.months("short",!0),1);case"MMMM":return Or(g.months("long",!0),1);case"L":return Rt(de);case"LL":return Rt(P);case"LLL":return Or(g.months("short",!1),1);case"LLLL":return Or(g.months("long",!1),1);case"d":return Rt(de);case"dd":return Rt(P);case"o":return Rt(ge);case"ooo":return Rt(U);case"HH":return Rt(P);case"H":return Rt(de);case"hh":return Rt(P);case"h":return Rt(de);case"mm":return Rt(P);case"m":return Rt(de);case"q":return Rt(de);case"qq":return Rt(P);case"s":return Rt(de);case"ss":return Rt(P);case"S":return Rt(ge);case"SSS":return Rt(U);case"u":return Nl(et);case"uu":return Nl(de);case"uuu":return Rt(k);case"a":return Or(g.meridiems(),0);case"kkkk":return Rt(ee);case"kk":return Rt(pt,$c);case"W":return Rt(de);case"WW":return Rt(P);case"E":case"c":return Rt(k);case"EEE":return Or(g.weekdays("short",!1),1);case"EEEE":return Or(g.weekdays("long",!1),1);case"ccc":return Or(g.weekdays("short",!0),1);case"cccc":return Or(g.weekdays("long",!0),1);case"Z":case"ZZ":return Vh(new RegExp(`([+-]${de.source})(?::(${P.source}))?`),2);case"ZZZ":return Vh(new RegExp(`([+-]${de.source})(${P.source})?`),2);case"z":return Nl(/[a-z_+-/]{1,256}?/i);case" ":return Nl(/[^\S\n\r]/);default:return it(Hr)}})(A)||{invalidReason:wv};return Mr.token=A,Mr}const Ov={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Mv(A,g,k){const{type:P,value:U}=A;if(P==="literal"){const ge=/^\s+$/.test(U);return{literal:!ge,val:ge?" ":U}}const ee=g[P];let ce=P;P==="hour"&&(g.hour12!=null?ce=g.hour12?"hour12":"hour24":g.hourCycle!=null?g.hourCycle==="h11"||g.hourCycle==="h12"?ce="hour12":ce="hour24":ce=k.hour12?"hour12":"hour24");let de=Ov[ce];if(typeof de=="object"&&(de=de[ee]),de)return{literal:!1,val:de}}function Pv(A){return[`^${A.map(k=>k.regex).reduce((k,P)=>`${k}(${P.source})`,"")}$`,A]}function Rv(A,g,k){const P=A.match(g);if(P){const U={};let ee=1;for(const ce in k)if(Fn(k,ce)){const de=k[ce],ge=de.groups?de.groups+1:1;!de.literal&&de.token&&(U[de.token.val[0]]=de.deser(P.slice(ee,ee+ge))),ee+=ge}return[P,U]}else return[P,{}]}function Nv(A){const g=ee=>{switch(ee){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let k=null,P;return je(A.z)||(k=Q.create(A.z)),je(A.Z)||(k||(k=new lt(A.Z)),P=A.Z),je(A.q)||(A.M=(A.q-1)*3+1),je(A.h)||(A.h<12&&A.a===1?A.h+=12:A.h===12&&A.a===0&&(A.h=0)),A.G===0&&A.y&&(A.y=-A.y),je(A.u)||(A.S=Bc(A.u)),[Object.keys(A).reduce((ee,ce)=>{const de=g(ce);return de&&(ee[de]=A[ce]),ee},{}),k,P]}let Vc=null;function Fv(){return Vc||(Vc=at.fromMillis(1555555555555)),Vc}function Lv(A,g){if(A.literal)return A;const k=Dn.macroTokenToFormatOpts(A.val),P=Kh(k,g);return P==null||P.includes(void 0)?A:P}function Wh(A,g){return Array.prototype.concat(...A.map(k=>Lv(k,g)))}class qh{constructor(g,k){if(this.locale=g,this.format=k,this.tokens=Wh(Dn.parseFormat(k),g),this.units=this.tokens.map(P=>Av(P,g)),this.disqualifyingUnit=this.units.find(P=>P.invalidReason),!this.disqualifyingUnit){const[P,U]=Pv(this.units);this.regex=RegExp(P,"i"),this.handlers=U}}explainFromTokens(g){if(this.isValid){const[k,P]=Rv(g,this.regex,this.handlers),[U,ee,ce]=P?Nv(P):[null,null,void 0];if(Fn(P,"a")&&Fn(P,"H"))throw new o("Can't include meridiem when specifying 24-hour format");return{input:g,tokens:this.tokens,regex:this.regex,rawMatches:k,matches:P,result:U,zone:ee,specificOffset:ce}}else return{input:g,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Yh(A,g,k){return new qh(A,k).explainFromTokens(g)}function _v(A,g,k){const{result:P,zone:U,specificOffset:ee,invalidReason:ce}=Yh(A,g,k);return[P,U,ee,ce]}function Kh(A,g){if(!A)return null;const P=Dn.create(g,A).dtFormatter(Fv()),U=P.formatToParts(),ee=P.resolvedOptions();return U.map(ce=>Mv(ce,A,ee))}const Wc="Invalid DateTime",Gh=864e13;function $s(A){return new xn("unsupported zone",`the zone "${A.name}" is not supported`)}function qc(A){return A.weekData===null&&(A.weekData=rn(A.c)),A.weekData}function Yc(A){return A.localWeekData===null&&(A.localWeekData=rn(A.c,A.loc.getMinDaysInFirstWeek(),A.loc.getStartOfWeek())),A.localWeekData}function Wo(A,g){const k={ts:A.ts,zone:A.zone,c:A.c,o:A.o,loc:A.loc,invalid:A.invalid};return new at({...k,...g,old:k})}function Qh(A,g,k){let P=A-g*60*1e3;const U=k.offset(P);if(g===U)return[P,g];P-=(U-g)*60*1e3;const ee=k.offset(P);return U===ee?[P,U]:[A-Math.min(U,ee)*60*1e3,Math.max(U,ee)]}function Fl(A,g){A+=g*60*1e3;const k=new Date(A);return{year:k.getUTCFullYear(),month:k.getUTCMonth()+1,day:k.getUTCDate(),hour:k.getUTCHours(),minute:k.getUTCMinutes(),second:k.getUTCSeconds(),millisecond:k.getUTCMilliseconds()}}function Ll(A,g,k){return Qh(Ol(A),g,k)}function Xh(A,g){const k=A.o,P=A.c.year+Math.trunc(g.years),U=A.c.month+Math.trunc(g.months)+Math.trunc(g.quarters)*3,ee={...A.c,year:P,month:U,day:Math.min(A.c.day,Al(P,U))+Math.trunc(g.days)+Math.trunc(g.weeks)*7},ce=It.fromObject({years:g.years-Math.trunc(g.years),quarters:g.quarters-Math.trunc(g.quarters),months:g.months-Math.trunc(g.months),weeks:g.weeks-Math.trunc(g.weeks),days:g.days-Math.trunc(g.days),hours:g.hours,minutes:g.minutes,seconds:g.seconds,milliseconds:g.milliseconds}).as("milliseconds"),de=Ol(ee);let[ge,Be]=Qh(de,k,A.zone);return ce!==0&&(ge+=ce,Be=A.zone.offset(ge)),{ts:ge,o:Be}}function Li(A,g,k,P,U,ee){const{setZone:ce,zone:de}=k;if(A&&Object.keys(A).length!==0||g){const ge=g||de,Be=at.fromObject(A,{...k,zone:ge,specificOffset:ee});return ce?Be:Be.setZone(de)}else return at.invalid(new xn("unparsable",`the input "${U}" can't be parsed as ${P}`))}function _l(A,g,k=!0){return A.isValid?Dn.create(Re.create("en-US"),{allowZ:k,forceSimple:!0}).formatDateTimeFromString(A,g):null}function Kc(A,g,k){const P=A.c.year>9999||A.c.year<0;let U="";if(P&&A.c.year>=0&&(U+="+"),U+=dn(A.c.year,P?6:4),k==="year")return U;if(g){if(U+="-",U+=dn(A.c.month),k==="month")return U;U+="-"}else if(U+=dn(A.c.month),k==="month")return U;return U+=dn(A.c.day),U}function Zh(A,g,k,P,U,ee,ce){let de=!k||A.c.millisecond!==0||A.c.second!==0,ge="";switch(ce){case"day":case"month":case"year":break;default:if(ge+=dn(A.c.hour),ce==="hour")break;if(g){if(ge+=":",ge+=dn(A.c.minute),ce==="minute")break;de&&(ge+=":",ge+=dn(A.c.second))}else{if(ge+=dn(A.c.minute),ce==="minute")break;de&&(ge+=dn(A.c.second))}if(ce==="second")break;de&&(!P||A.c.millisecond!==0)&&(ge+=".",ge+=dn(A.c.millisecond,3))}return U&&(A.isOffsetFixed&&A.offset===0&&!ee?ge+="Z":A.o<0?(ge+="-",ge+=dn(Math.trunc(-A.o/60)),ge+=":",ge+=dn(Math.trunc(-A.o%60))):(ge+="+",ge+=dn(Math.trunc(A.o/60)),ge+=":",ge+=dn(Math.trunc(A.o%60)))),ee&&(ge+="["+A.zone.ianaName+"]"),ge}const Jh={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Bv={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},jv={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Bl=["year","month","day","hour","minute","second","millisecond"],$v=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Hv=["year","ordinal","hour","minute","second","millisecond"];function jl(A){const g={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[A.toLowerCase()];if(!g)throw new i(A);return g}function em(A){switch(A.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return jl(A)}}function zv(A){if(Hs===void 0&&(Hs=Pt.now()),A.type!=="iana")return A.offset(Hs);const g=A.name;let k=Gc.get(g);return k===void 0&&(k=A.offset(Hs),Gc.set(g,k)),k}function tm(A,g){const k=be(g.zone,Pt.defaultZone);if(!k.isValid)return at.invalid($s(k));const P=Re.fromObject(g);let U,ee;if(je(A.year))U=Pt.now();else{for(const ge of Bl)je(A[ge])&&(A[ge]=Jh[ge]);const ce=Ye(A)||rt(A);if(ce)return at.invalid(ce);const de=zv(k);[U,ee]=Ll(A,de,k)}return new at({ts:U,zone:k,loc:P,o:ee})}function nm(A,g,k){const P=je(k.round)?!0:k.round,U=je(k.rounding)?"trunc":k.rounding,ee=(de,ge)=>(de=jc(de,P||k.calendary?0:2,k.calendary?"round":U),g.loc.clone(k).relFormatter(k).format(de,ge)),ce=de=>k.calendary?g.hasSame(A,de)?0:g.startOf(de).diff(A.startOf(de),de).get(de):g.diff(A,de).get(de);if(k.unit)return ee(ce(k.unit),k.unit);for(const de of k.units){const ge=ce(de);if(Math.abs(ge)>=1)return ee(ge,de)}return ee(A>g?-0:0,k.units[k.units.length-1])}function rm(A){let g={},k;return A.length>0&&typeof A[A.length-1]=="object"?(g=A[A.length-1],k=Array.from(A).slice(0,A.length-1)):k=Array.from(A),[g,k]}let Hs;const Gc=new Map;class at{constructor(g){const k=g.zone||Pt.defaultZone;let P=g.invalid||(Number.isNaN(g.ts)?new xn("invalid input"):null)||(k.isValid?null:$s(k));this.ts=je(g.ts)?Pt.now():g.ts;let U=null,ee=null;if(!P)if(g.old&&g.old.ts===this.ts&&g.old.zone.equals(k))[U,ee]=[g.old.c,g.old.o];else{const de=zt(g.o)&&!g.old?g.o:k.offset(this.ts);U=Fl(this.ts,de),P=Number.isNaN(U.year)?new xn("invalid input"):null,U=P?null:U,ee=P?null:de}this._zone=k,this.loc=g.loc||Re.create(),this.invalid=P,this.weekData=null,this.localWeekData=null,this.c=U,this.o=ee,this.isLuxonDateTime=!0}static now(){return new at({})}static local(){const[g,k]=rm(arguments),[P,U,ee,ce,de,ge,Be]=k;return tm({year:P,month:U,day:ee,hour:ce,minute:de,second:ge,millisecond:Be},g)}static utc(){const[g,k]=rm(arguments),[P,U,ee,ce,de,ge,Be]=k;return g.zone=lt.utcInstance,tm({year:P,month:U,day:ee,hour:ce,minute:de,second:ge,millisecond:Be},g)}static fromJSDate(g,k={}){const P=Di(g)?g.valueOf():NaN;if(Number.isNaN(P))return at.invalid("invalid input");const U=be(k.zone,Pt.defaultZone);return U.isValid?new at({ts:P,zone:U,loc:Re.fromObject(k)}):at.invalid($s(U))}static fromMillis(g,k={}){if(zt(g))return g<-Gh||g>Gh?at.invalid("Timestamp out of range"):new at({ts:g,zone:be(k.zone,Pt.defaultZone),loc:Re.fromObject(k)});throw new s(`fromMillis requires a numerical input, but received a ${typeof g} with value ${g}`)}static fromSeconds(g,k={}){if(zt(g))return new at({ts:g*1e3,zone:be(k.zone,Pt.defaultZone),loc:Re.fromObject(k)});throw new s("fromSeconds requires a numerical input")}static fromObject(g,k={}){g=g||{};const P=be(k.zone,Pt.defaultZone);if(!P.isValid)return at.invalid($s(P));const U=Re.fromObject(k),ee=Pl(g,em),{minDaysInFirstWeek:ce,startOfWeek:de}=zo(ee,U),ge=Pt.now(),Be=je(k.specificOffset)?P.offset(ge):k.specificOffset,et=!je(ee.ordinal),pt=!je(ee.year),Ut=!je(ee.month)||!je(ee.day),it=pt||Ut,fn=ee.weekYear||ee.weekNumber;if((it||et)&&fn)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(Ut&&et)throw new o("Can't mix ordinal dates with month/day");const Mr=fn||ee.weekday&&!it;let Hr,_i,Us=Fl(ge,Be);Mr?(Hr=$v,_i=Bv,Us=rn(Us,ce,de)):et?(Hr=Hv,_i=jv,Us=Ho(Us)):(Hr=Bl,_i=Jh);let om=!1;for(const Ws of Hr){const Kv=ee[Ws];je(Kv)?om?ee[Ws]=_i[Ws]:ee[Ws]=Us[Ws]:om=!0}const Vv=Mr?ke(ee,ce,de):et?Te(ee):Ye(ee),im=Vv||rt(ee);if(im)return at.invalid(im);const Wv=Mr?Ar(ee,ce,de):et?ko(ee):ee,[qv,Yv]=Ll(Wv,Be,P),Vs=new at({ts:qv,zone:P,o:Yv,loc:U});return ee.weekday&&it&&g.weekday!==Vs.weekday?at.invalid("mismatched weekday",`you can't specify both a weekday of ${ee.weekday} and a date of ${Vs.toISO()}`):Vs.isValid?Vs:at.invalid(Vs.invalid)}static fromISO(g,k={}){const[P,U]=cv(g);return Li(P,U,k,"ISO 8601",g)}static fromRFC2822(g,k={}){const[P,U]=dv(g);return Li(P,U,k,"RFC 2822",g)}static fromHTTP(g,k={}){const[P,U]=fv(g);return Li(P,U,k,"HTTP",k)}static fromFormat(g,k,P={}){if(je(g)||je(k))throw new s("fromFormat requires an input string and a format");const{locale:U=null,numberingSystem:ee=null}=P,ce=Re.fromOpts({locale:U,numberingSystem:ee,defaultToEN:!0}),[de,ge,Be,et]=_v(ce,g,k);return et?at.invalid(et):Li(de,ge,P,`format ${k}`,g,Be)}static fromString(g,k,P={}){return at.fromFormat(g,k,P)}static fromSQL(g,k={}){const[P,U]=xv(g);return Li(P,U,k,"SQL",g)}static invalid(g,k=null){if(!g)throw new s("need to specify a reason the DateTime is invalid");const P=g instanceof xn?g:new xn(g,k);if(Pt.throwOnInvalid)throw new t(P);return new at({invalid:P})}static isDateTime(g){return g&&g.isLuxonDateTime||!1}static parseFormatForOpts(g,k={}){const P=Kh(g,Re.fromObject(k));return P?P.map(U=>U?U.val:null).join(""):null}static expandFormat(g,k={}){return Wh(Dn.parseFormat(g),Re.fromObject(k)).map(U=>U.val).join("")}static resetCache(){Hs=void 0,Gc.clear()}get(g){return this[g]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?qc(this).weekYear:NaN}get weekNumber(){return this.isValid?qc(this).weekNumber:NaN}get weekday(){return this.isValid?qc(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Yc(this).weekday:NaN}get localWeekNumber(){return this.isValid?Yc(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Yc(this).weekYear:NaN}get ordinal(){return this.isValid?Ho(this.c).ordinal:NaN}get monthShort(){return this.isValid?js.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?js.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?js.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?js.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const g=864e5,k=6e4,P=Ol(this.c),U=this.zone.offset(P-g),ee=this.zone.offset(P+g),ce=this.zone.offset(P-U*k),de=this.zone.offset(P-ee*k);if(ce===de)return[this];const ge=P-ce*k,Be=P-de*k,et=Fl(ge,ce),pt=Fl(Be,de);return et.hour===pt.hour&&et.minute===pt.minute&&et.second===pt.second&&et.millisecond===pt.millisecond?[Wo(this,{ts:ge}),Wo(this,{ts:Be})]:[this]}get isInLeapYear(){return Ns(this.year)}get daysInMonth(){return Al(this.year,this.month)}get daysInYear(){return this.isValid?Ii(this.year):NaN}get weeksInWeekYear(){return this.isValid?Fs(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Fs(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(g={}){const{locale:k,numberingSystem:P,calendar:U}=Dn.create(this.loc.clone(g),g).resolvedOptions(this);return{locale:k,numberingSystem:P,outputCalendar:U}}toUTC(g=0,k={}){return this.setZone(lt.instance(g),k)}toLocal(){return this.setZone(Pt.defaultZone)}setZone(g,{keepLocalTime:k=!1,keepCalendarTime:P=!1}={}){if(g=be(g,Pt.defaultZone),g.equals(this.zone))return this;if(g.isValid){let U=this.ts;if(k||P){const ee=g.offset(this.ts),ce=this.toObject();[U]=Ll(ce,ee,g)}return Wo(this,{ts:U,zone:g})}else return at.invalid($s(g))}reconfigure({locale:g,numberingSystem:k,outputCalendar:P}={}){const U=this.loc.clone({locale:g,numberingSystem:k,outputCalendar:P});return Wo(this,{loc:U})}setLocale(g){return this.reconfigure({locale:g})}set(g){if(!this.isValid)return this;const k=Pl(g,em),{minDaysInFirstWeek:P,startOfWeek:U}=zo(k,this.loc),ee=!je(k.weekYear)||!je(k.weekNumber)||!je(k.weekday),ce=!je(k.ordinal),de=!je(k.year),ge=!je(k.month)||!je(k.day),Be=de||ge,et=k.weekYear||k.weekNumber;if((Be||ce)&&et)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(ge&&ce)throw new o("Can't mix ordinal dates with month/day");let pt;ee?pt=Ar({...rn(this.c,P,U),...k},P,U):je(k.ordinal)?(pt={...this.toObject(),...k},je(k.day)&&(pt.day=Math.min(Al(pt.year,pt.month),pt.day))):pt=ko({...Ho(this.c),...k});const[Ut,it]=Ll(pt,this.o,this.zone);return Wo(this,{ts:Ut,o:it})}plus(g){if(!this.isValid)return this;const k=It.fromDurationLike(g);return Wo(this,Xh(this,k))}minus(g){if(!this.isValid)return this;const k=It.fromDurationLike(g).negate();return Wo(this,Xh(this,k))}startOf(g,{useLocaleWeeks:k=!1}={}){if(!this.isValid)return this;const P={},U=It.normalizeUnit(g);switch(U){case"years":P.month=1;case"quarters":case"months":P.day=1;case"weeks":case"days":P.hour=0;case"hours":P.minute=0;case"minutes":P.second=0;case"seconds":P.millisecond=0;break}if(U==="weeks")if(k){const ee=this.loc.getStartOfWeek(),{weekday:ce}=this;ce<ee&&(P.weekNumber=this.weekNumber-1),P.weekday=ee}else P.weekday=1;if(U==="quarters"){const ee=Math.ceil(this.month/3);P.month=(ee-1)*3+1}return this.set(P)}endOf(g,k){return this.isValid?this.plus({[g]:1}).startOf(g,k).minus(1):this}toFormat(g,k={}){return this.isValid?Dn.create(this.loc.redefaultToEN(k)).formatDateTimeFromString(this,g):Wc}toLocaleString(g=f,k={}){return this.isValid?Dn.create(this.loc.clone(k),g).formatDateTime(this):Wc}toLocaleParts(g={}){return this.isValid?Dn.create(this.loc.clone(g),g).formatDateTimeParts(this):[]}toISO({format:g="extended",suppressSeconds:k=!1,suppressMilliseconds:P=!1,includeOffset:U=!0,extendedZone:ee=!1,precision:ce="milliseconds"}={}){if(!this.isValid)return null;ce=jl(ce);const de=g==="extended";let ge=Kc(this,de,ce);return Bl.indexOf(ce)>=3&&(ge+="T"),ge+=Zh(this,de,k,P,U,ee,ce),ge}toISODate({format:g="extended",precision:k="day"}={}){return this.isValid?Kc(this,g==="extended",jl(k)):null}toISOWeekDate(){return _l(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:g=!1,suppressSeconds:k=!1,includeOffset:P=!0,includePrefix:U=!1,extendedZone:ee=!1,format:ce="extended",precision:de="milliseconds"}={}){return this.isValid?(de=jl(de),(U&&Bl.indexOf(de)>=3?"T":"")+Zh(this,ce==="extended",k,g,P,ee,de)):null}toRFC2822(){return _l(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return _l(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Kc(this,!0):null}toSQLTime({includeOffset:g=!0,includeZone:k=!1,includeOffsetSpace:P=!0}={}){let U="HH:mm:ss.SSS";return(k||g)&&(P&&(U+=" "),k?U+="z":g&&(U+="ZZ")),_l(this,U,!0)}toSQL(g={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(g)}`:null}toString(){return this.isValid?this.toISO():Wc}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(g={}){if(!this.isValid)return{};const k={...this.c};return g.includeConfig&&(k.outputCalendar=this.outputCalendar,k.numberingSystem=this.loc.numberingSystem,k.locale=this.loc.locale),k}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(g,k="milliseconds",P={}){if(!this.isValid||!g.isValid)return It.invalid("created by diffing an invalid DateTime");const U={locale:this.locale,numberingSystem:this.numberingSystem,...P},ee=Il(k).map(It.normalizeUnit),ce=g.valueOf()>this.valueOf(),de=ce?this:g,ge=ce?g:this,Be=kv(de,ge,ee,U);return ce?Be.negate():Be}diffNow(g="milliseconds",k={}){return this.diff(at.now(),g,k)}until(g){return this.isValid?on.fromDateTimes(this,g):this}hasSame(g,k,P){if(!this.isValid)return!1;const U=g.valueOf(),ee=this.setZone(g.zone,{keepLocalTime:!0});return ee.startOf(k,P)<=U&&U<=ee.endOf(k,P)}equals(g){return this.isValid&&g.isValid&&this.valueOf()===g.valueOf()&&this.zone.equals(g.zone)&&this.loc.equals(g.loc)}toRelative(g={}){if(!this.isValid)return null;const k=g.base||at.fromObject({},{zone:this.zone}),P=g.padding?this<k?-g.padding:g.padding:0;let U=["years","months","days","hours","minutes","seconds"],ee=g.unit;return Array.isArray(g.unit)&&(U=g.unit,ee=void 0),nm(k,this.plus(P),{...g,numeric:"always",units:U,unit:ee})}toRelativeCalendar(g={}){return this.isValid?nm(g.base||at.fromObject({},{zone:this.zone}),this,{...g,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...g){if(!g.every(at.isDateTime))throw new s("min requires all arguments be DateTimes");return wt(g,k=>k.valueOf(),Math.min)}static max(...g){if(!g.every(at.isDateTime))throw new s("max requires all arguments be DateTimes");return wt(g,k=>k.valueOf(),Math.max)}static fromFormatExplain(g,k,P={}){const{locale:U=null,numberingSystem:ee=null}=P,ce=Re.fromOpts({locale:U,numberingSystem:ee,defaultToEN:!0});return Yh(ce,g,k)}static fromStringExplain(g,k,P={}){return at.fromFormatExplain(g,k,P)}static buildFormatParser(g,k={}){const{locale:P=null,numberingSystem:U=null}=k,ee=Re.fromOpts({locale:P,numberingSystem:U,defaultToEN:!0});return new qh(ee,g)}static fromFormatParser(g,k,P={}){if(je(g)||je(k))throw new s("fromFormatParser requires an input string and a format parser");const{locale:U=null,numberingSystem:ee=null}=P,ce=Re.fromOpts({locale:U,numberingSystem:ee,defaultToEN:!0});if(!ce.equals(k.locale))throw new s(`fromFormatParser called with a locale of ${ce}, but the format parser was created for ${k.locale}`);const{result:de,zone:ge,specificOffset:Be,invalidReason:et}=k.explainFromTokens(g);return et?at.invalid(et):Li(de,ge,P,`format ${k.format}`,g,Be)}static get DATE_SHORT(){return f}static get DATE_MED(){return h}static get DATE_MED_WITH_WEEKDAY(){return p}static get DATE_FULL(){return m}static get DATE_HUGE(){return b}static get TIME_SIMPLE(){return y}static get TIME_WITH_SECONDS(){return x}static get TIME_WITH_SHORT_OFFSET(){return C}static get TIME_WITH_LONG_OFFSET(){return v}static get TIME_24_SIMPLE(){return S}static get TIME_24_WITH_SECONDS(){return I}static get TIME_24_WITH_SHORT_OFFSET(){return T}static get TIME_24_WITH_LONG_OFFSET(){return N}static get DATETIME_SHORT(){return O}static get DATETIME_SHORT_WITH_SECONDS(){return F}static get DATETIME_MED(){return B}static get DATETIME_MED_WITH_SECONDS(){return j}static get DATETIME_MED_WITH_WEEKDAY(){return D}static get DATETIME_FULL(){return H}static get DATETIME_FULL_WITH_SECONDS(){return _}static get DATETIME_HUGE(){return L}static get DATETIME_HUGE_WITH_SECONDS(){return $}}function zs(A){if(at.isDateTime(A))return A;if(A&&A.valueOf&&zt(A.valueOf()))return at.fromJSDate(A);if(A&&typeof A=="object")return at.fromObject(A);throw new s(`Unknown datetime argument: ${A}, of type ${typeof A}`)}const Uv="3.7.2";return Un.DateTime=at,Un.Duration=It,Un.FixedOffsetZone=lt,Un.IANAZone=Q,Un.Info=js,Un.Interval=on,Un.InvalidZone=Mt,Un.Settings=Pt,Un.SystemZone=q,Un.VERSION=Uv,Un.Zone=K,Un}var Rg;function Fp(){return Rg||(Rg=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CronDate=e.DAYS_IN_MONTH=e.DateMathOp=e.TimeUnit=void 0;const t=Q8();var n;(function(i){i.Second="Second",i.Minute="Minute",i.Hour="Hour",i.Day="Day",i.Month="Month",i.Year="Year"})(n||(e.TimeUnit=n={}));var r;(function(i){i.Add="Add",i.Subtract="Subtract"})(r||(e.DateMathOp=r={})),e.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);class o{#e;#n=null;#i=null;constructor(s,a){const l={zone:a};if(s?s instanceof o?(this.#e=s.#e,this.#n=s.#n,this.#i=s.#i):s instanceof Date?this.#e=t.DateTime.fromJSDate(s,l):typeof s=="number"?this.#e=t.DateTime.fromMillis(s,l):(this.#e=t.DateTime.fromISO(s,l),this.#e.isValid||(this.#e=t.DateTime.fromRFC2822(s,l)),this.#e.isValid||(this.#e=t.DateTime.fromSQL(s,l)),this.#e.isValid||(this.#e=t.DateTime.fromFormat(s,"EEE, d MMM yyyy HH:mm:ss",l))):this.#e=t.DateTime.local(),!this.#e.isValid)throw new Error(`CronDate: unhandled timestamp: ${s}`);a&&a!==this.#e.zoneName&&(this.#e=this.#e.setZone(a))}static#o(s){return s%4===0&&s%100!==0||s%400===0}get dstStart(){return this.#n}set dstStart(s){this.#n=s}get dstEnd(){return this.#i}set dstEnd(s){this.#i=s}addYear(){this.#e=this.#e.plus({years:1})}addMonth(){this.#e=this.#e.plus({months:1}).startOf("month")}addDay(){this.#e=this.#e.plus({days:1}).startOf("day")}addHour(){this.#e=this.#e.plus({hours:1}).startOf("hour")}addMinute(){this.#e=this.#e.plus({minutes:1}).startOf("minute")}addSecond(){this.#e=this.#e.plus({seconds:1})}subtractYear(){this.#e=this.#e.minus({years:1})}subtractMonth(){this.#e=this.#e.minus({months:1}).endOf("month").startOf("second")}subtractDay(){this.#e=this.#e.minus({days:1}).endOf("day").startOf("second")}subtractHour(){this.#e=this.#e.minus({hours:1}).endOf("hour").startOf("second")}subtractMinute(){this.#e=this.#e.minus({minutes:1}).endOf("minute").startOf("second")}subtractSecond(){this.#e=this.#e.minus({seconds:1})}addUnit(s){switch(s){case n.Year:return this.addYear();case n.Month:return this.addMonth();case n.Day:return this.addDay();case n.Hour:return this.addHour();case n.Minute:return this.addMinute();case n.Second:return this.addSecond()}}subtractUnit(s){switch(s){case n.Year:return this.subtractYear();case n.Month:return this.subtractMonth();case n.Day:return this.subtractDay();case n.Hour:return this.subtractHour();case n.Minute:return this.subtractMinute();case n.Second:return this.subtractSecond()}}invokeDateOperation(s,a){if(s===r.Add){this.addUnit(a);return}if(s===r.Subtract){this.subtractUnit(a);return}throw new Error(`Invalid verb: ${s}`)}getDate(){return this.#e.day}getFullYear(){return this.#e.year}getDay(){const s=this.#e.weekday;return s===7?0:s}getMonth(){return this.#e.month-1}getHours(){return this.#e.hour}getMinutes(){return this.#e.minute}getSeconds(){return this.#e.second}getMilliseconds(){return this.#e.millisecond}getUTCOffset(){return this.#e.offset}setStartOfDay(){this.#e=this.#e.startOf("day")}setEndOfDay(){this.#e=this.#e.endOf("day")}getTime(){return this.#e.valueOf()}getUTCDate(){return this.#r().day}getUTCFullYear(){return this.#r().year}getUTCDay(){const s=this.#r().weekday;return s===7?0:s}getUTCMonth(){return this.#r().month-1}getUTCHours(){return this.#r().hour}getUTCMinutes(){return this.#r().minute}getUTCSeconds(){return this.#r().second}toISOString(){return this.#e.toUTC().toISO()}toJSON(){return this.#e.toJSON()}setDate(s){this.#e=this.#e.set({day:s})}setFullYear(s){this.#e=this.#e.set({year:s})}setDay(s){this.#e=this.#e.set({weekday:s})}setMonth(s){this.#e=this.#e.set({month:s+1})}setHours(s){this.#e=this.#e.set({hour:s})}setMinutes(s){this.#e=this.#e.set({minute:s})}setSeconds(s){this.#e=this.#e.set({second:s})}setMilliseconds(s){this.#e=this.#e.set({millisecond:s})}toString(){return this.toDate().toString()}toDate(){return this.#e.toJSDate()}isLastDayOfMonth(){const{day:s,month:a}=this.#e;if(a===2){const l=o.#o(this.#e.year);return s===e.DAYS_IN_MONTH[a-1]-(l?0:1)}return s===e.DAYS_IN_MONTH[a-1]}isLastWeekdayOfMonth(){const{day:s,month:a}=this.#e;let l;return a===2?l=e.DAYS_IN_MONTH[a-1]-(o.#o(this.#e.year)?0:1):l=e.DAYS_IN_MONTH[a-1],s>l-7}applyDateOperation(s,a,l){if(a===n.Month||a===n.Day){this.invokeDateOperation(s,a);return}const u=this.getHours();this.invokeDateOperation(s,a);const d=this.getHours(),f=d-u;f===2?l!==24&&(this.dstStart=u+1):f===0&&this.getMinutes()===0&&this.getSeconds()===0&&l!==24&&(this.dstEnd=d)}#r(){return this.#e.toUTC()}}e.CronDate=o,e.default=o})(Ld)),Ld}var Ng;function X8(){if(Ng)return ca;Ng=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.CronMonth=void 0;const e=Fp(),t=vi(),n=1,r=12,o=Object.freeze([]);let i=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return o}static get daysInMonth(){return e.DAYS_IN_MONTH}constructor(a,l){super(a,l),this.validate()}get values(){return super.values}};return ca.CronMonth=i,ca}var da={},Fg;function Z8(){if(Fg)return da;Fg=1,Object.defineProperty(da,"__esModule",{value:!0}),da.CronSecond=void 0;const e=vi(),t=0,n=59,r=Object.freeze([]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}constructor(s,a){super(s,a),this.validate()}get values(){return super.values}};return da.CronSecond=o,da}var Lg;function Lp(){return Lg||(Lg=1,(function(e){var t=Qo&&Qo.__createBinding||(Object.create?(function(r,o,i,s){s===void 0&&(s=i);var a=Object.getOwnPropertyDescriptor(o,i);(!a||("get"in a?!o.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return o[i]}}),Object.defineProperty(r,s,a)}):(function(r,o,i,s){s===void 0&&(s=i),r[s]=o[i]})),n=Qo&&Qo.__exportStar||function(r,o){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(o,i)&&t(o,r,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(W8(),e),n(q8(),e),n(Y8(),e),n(vi(),e),n(K8(),e),n(G8(),e),n(X8(),e),n(Z8(),e)})(Qo)),Qo}var _g;function x2(){if(_g)return oa;_g=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.CronFieldCollection=void 0;const e=Lp();let t=class Aa{#e;#n;#i;#o;#r;#t;static from(r,o){return new Aa({second:this.resolveField(e.CronSecond,r.second,o.second),minute:this.resolveField(e.CronMinute,r.minute,o.minute),hour:this.resolveField(e.CronHour,r.hour,o.hour),dayOfMonth:this.resolveField(e.CronDayOfMonth,r.dayOfMonth,o.dayOfMonth),month:this.resolveField(e.CronMonth,r.month,o.month),dayOfWeek:this.resolveField(e.CronDayOfWeek,r.dayOfWeek,o.dayOfWeek)})}static resolveField(r,o,i){return i?i instanceof e.CronField?i:new r(i):o}constructor({second:r,minute:o,hour:i,dayOfMonth:s,month:a,dayOfWeek:l}){if(!r)throw new Error("Validation error, Field second is missing");if(!o)throw new Error("Validation error, Field minute is missing");if(!i)throw new Error("Validation error, Field hour is missing");if(!s)throw new Error("Validation error, Field dayOfMonth is missing");if(!a)throw new Error("Validation error, Field month is missing");if(!l)throw new Error("Validation error, Field dayOfWeek is missing");if(a.values.length===1&&!s.hasLastChar&&l.isWildcard&&!(parseInt(s.values[0],10)<=e.CronMonth.daysInMonth[a.values[0]-1]))throw new Error("Invalid explicit day of month definition");this.#e=r,this.#n=o,this.#i=i,this.#r=a,this.#t=l,this.#o=s}get second(){return this.#e}get minute(){return this.#n}get hour(){return this.#i}get dayOfMonth(){return this.#o}get month(){return this.#r}get dayOfWeek(){return this.#t}static compactField(r){if(r.length===0)return[];const o=[];let i;return r.forEach((s,a,l)=>{if(i===void 0){i={start:s,count:1};return}const u=l[a-1]||i.start,d=l[a+1];if(s==="L"||s==="W"){o.push(i),o.push({start:s,count:1}),i=void 0;return}if(i.step===void 0&&d!==void 0){const f=s-u,h=d-s;if(f<=h){i={...i,count:2,end:s,step:f};return}i.step=1}s-(i.end??0)===i.step?(i.count++,i.end=s):(i.count===1?o.push({start:i.start,count:1}):i.count===2?(o.push({start:i.start,count:1}),o.push({start:i.end??u,count:1})):o.push(i),i={start:s,count:1})}),i&&o.push(i),o}static#u(r,o,i){const s=o.step;return s?s===1&&o.start===r.min&&o.end&&o.end>=i?r.hasQuestionMarkChar?"?":"*":s!==1&&o.start===r.min&&o.end&&o.end>=i-s+1?`*/${s}`:null:null}static#l(r,o){const i=r.step;if(i===1)return`${r.start}-${r.end}`;const s=r.start===0?r.count-1:r.count;if(!i)throw new Error("Unexpected range step");if(!r.end)throw new Error("Unexpected range end");if(i*s>r.end){const a=(u,d)=>{if(typeof r.start!="number")throw new Error("Unexpected range start");return d%i===0?r.start+d:null};if(typeof r.start!="number")throw new Error("Unexpected range start");const l={length:r.end-r.start+1};return Array.from(l,a).filter(u=>u!==null).join(",")}return r.end===o-i+1?`${r.start}/${i}`:`${r.start}-${r.end}/${i}`}stringifyField(r){let o=r.max,i=r.values;if(r instanceof e.CronDayOfWeek){o=6;const a=this.#t.values;i=a[a.length-1]===7?a.slice(0,-1):a}r instanceof e.CronDayOfMonth&&(o=this.#r.values.length===1?e.CronMonth.daysInMonth[this.#r.values[0]-1]:r.max);const s=Aa.compactField(i);if(s.length===1){const a=Aa.#u(r,s[0],o);if(a)return a}return s.map(a=>{const l=a.count===1?a.start.toString():Aa.#l(a,o);return r instanceof e.CronDayOfWeek&&r.nthDay>0?`${l}#${r.nthDay}`:l}).join(",")}stringify(r=!1){const o=[];return r&&o.push(this.stringifyField(this.#e)),o.push(this.stringifyField(this.#n),this.stringifyField(this.#i),this.stringifyField(this.#o),this.stringifyField(this.#r),this.stringifyField(this.#t)),o.join(" ")}serialize(){return{second:this.#e.serialize(),minute:this.#n.serialize(),hour:this.#i.serialize(),dayOfMonth:this.#o.serialize(),month:this.#r.serialize(),dayOfWeek:this.#t.serialize()}}};return oa.CronFieldCollection=t,oa}var _d={},Bg;function C2(){return Bg||(Bg=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpression=e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;const t=Fp();e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE="Out of the time span range",e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE="Invalid expression, loop limit exceeded";const n=1e4;class r{#e;#n;#i;#o;#r;#t;#u=null;#l=!1;constructor(i,s){this.#e=s,this.#n=s.tz,this.#o=s.startDate?new t.CronDate(s.startDate,this.#n):null,this.#r=s.endDate?new t.CronDate(s.endDate,this.#n):null;let a=s.currentDate??s.startDate;if(a){const l=new t.CronDate(a,this.#n);this.#o&&l.getTime()<this.#o.getTime()?a=this.#o:this.#r&&l.getTime()>this.#r.getTime()&&(a=this.#r)}this.#i=new t.CronDate(a,this.#n),this.#t=i}get fields(){return this.#t}static fieldsToExpression(i,s){return new r(i,s||{})}static#s(i,s){return s.some(a=>a===i)}#a(i,s){return i[s?i.length-1:0]}#d(i){const s=`${i.getFullYear()}-${i.getMonth()+1}-${i.getDate()}`;if(this.#u===s)return this.#l;const a=new t.CronDate(i);a.setStartOfDay();const l=new t.CronDate(i);return l.setEndOfDay(),this.#u=s,this.#l=a.getUTCOffset()!==l.getUTCOffset(),this.#l}#f(i,s,a){const l=this.#t.second.values,u=i.getSeconds(),d=this.#t.second.findNearestValue(u,a);if(d!==null){i.setSeconds(d);return}i.applyDateOperation(s,t.TimeUnit.Minute,this.#t.hour.values.length),i.setSeconds(this.#a(l,a))}#h(i,s,a){const l=this.#t.minute.values,u=this.#t.second.values,d=i.getMinutes(),f=this.#t.minute.findNearestValue(d,a);if(f!==null){i.setMinutes(f),i.setSeconds(this.#a(u,a));return}i.applyDateOperation(s,t.TimeUnit.Hour,this.#t.hour.values.length),i.setMinutes(this.#a(l,a)),i.setSeconds(this.#a(u,a))}static#m(i,s){const a=s.isLastWeekdayOfMonth();return i.some(l=>{const u=parseInt(l.toString().charAt(0),10)%7;if(Number.isNaN(u))throw new Error(`Invalid last weekday of the month expression: ${l}`);return s.getDay()===u&&a})}next(){return this.#c()}prev(){return this.#c(!0)}hasNext(){const i=this.#i;try{return this.#c(),!0}catch{return!1}finally{this.#i=i}}hasPrev(){const i=this.#i;try{return this.#c(!0),!0}catch{return!1}finally{this.#i=i}}take(i){const s=[];if(i>=0)for(let a=0;a<i;a++)try{s.push(this.next())}catch{return s}else for(let a=0;a>i;a--)try{s.push(this.prev())}catch{return s}return s}reset(i){this.#i=new t.CronDate(i||this.#e.currentDate,this.#n)}stringify(i=!1){return this.#t.stringify(i)}includesDate(i){const{second:s,minute:a,hour:l,month:u}=this.#t,d=new t.CronDate(i,this.#n);return!(!s.values.includes(d.getSeconds())||!a.values.includes(d.getMinutes())||!l.values.includes(d.getHours())||!u.values.includes(d.getMonth()+1)||!this.#p(d)||this.#t.dayOfWeek.nthDay>0&&Math.ceil(d.getDate()/7)!==this.#t.dayOfWeek.nthDay)}toString(){return this.#e.expression||this.stringify(!0)}#p(i){const s=this.#t.dayOfMonth.isWildcard,a=!s,l=this.#t.dayOfWeek.isWildcard,u=!l,d=r.#s(i.getDate(),this.#t.dayOfMonth.values)||this.#t.dayOfMonth.hasLastChar&&i.isLastDayOfMonth(),f=r.#s(i.getDay(),this.#t.dayOfWeek.values)||this.#t.dayOfWeek.hasLastChar&&r.#m(this.#t.dayOfWeek.values,i);return!!(a&&u&&(d||f)||d&&!u||s&&!l&&f)}#g(i,s,a){const l=this.#t.hour.values,u=l,d=i.getHours(),f=r.#s(d,l),h=i.dstEnd===d;if(i.dstStart!==null&&i.dstStart===d-1&&r.#s(i.dstStart,l))return!0;if(h&&!a)return i.dstEnd=null,i.applyDateOperation(t.DateMathOp.Add,t.TimeUnit.Hour,u.length),!1;if(f)return!0;i.dstStart=null;const p=this.#t.hour.findNearestValue(d,a);if(p===null)return i.applyDateOperation(s,t.TimeUnit.Day,u.length),!1;if(this.#d(i)){const m=a?d-p:p-d;for(let b=0;b<m&&(i.applyDateOperation(s,t.TimeUnit.Hour,u.length),!(!a&&i.getHours()>=p||a&&i.getHours()<=p));b++);}else i.setHours(p);return i.setMinutes(this.#a(this.#t.minute.values,a)),i.setSeconds(this.#a(this.#t.second.values,a)),!1}#b(i){if(!this.#o&&!this.#r)return;const s=i.getTime();if(this.#o&&s<this.#o.getTime())throw new Error(e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE);if(this.#r&&s>this.#r.getTime())throw new Error(e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)}#c(i=!1){const s=i?t.DateMathOp.Subtract:t.DateMathOp.Add,a=new t.CronDate(this.#i),l=a.getTime();let u=0;for(;++u<n;){if(this.#b(a),!this.#p(a)){a.applyDateOperation(s,t.TimeUnit.Day,this.#t.hour.values.length);continue}if(!(this.#t.dayOfWeek.nthDay<=0||Math.ceil(a.getDate()/7)===this.#t.dayOfWeek.nthDay)){a.applyDateOperation(s,t.TimeUnit.Day,this.#t.hour.values.length);continue}if(!r.#s(a.getMonth()+1,this.#t.month.values)){a.applyDateOperation(s,t.TimeUnit.Month,this.#t.hour.values.length);continue}if(this.#g(a,s,i)){if(!r.#s(a.getMinutes(),this.#t.minute.values)){this.#h(a,s,i);continue}if(!r.#s(a.getSeconds(),this.#t.second.values)){this.#f(a,s,i);continue}if(l===a.getTime()){(s==="Add"||a.getMilliseconds()===0)&&a.applyDateOperation(s,t.TimeUnit.Second,this.#t.hour.values.length);continue}break}}if(u>n)throw new Error(e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return a.getMilliseconds()!==0&&a.setMilliseconds(0),this.#i=a,a}[Symbol.iterator](){return{next:()=>{try{return{value:this.#c(),done:!1}}catch{return{value:void 0,done:!0}}}}}}e.CronExpression=r,e.default=r})(_d)),_d}var Xl={},jg;function J8(){if(jg)return Xl;jg=1,Object.defineProperty(Xl,"__esModule",{value:!0}),Xl.seededRandom=n;function e(r){let o=2166136261;for(let i=0;i<r.length;i++)o^=r.charCodeAt(i),o=Math.imul(o,16777619);return()=>o>>>0}function t(r){return()=>{let o=r+=1831565813;return o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61),((o^o>>>14)>>>0)/4294967296}}function n(r){const o=r?e(r)():Math.floor(Math.random()*1e10);return t(o)}return Xl}var $g;function Of(){if($g)return Xn;$g=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.CronExpressionParser=Xn.DayOfWeek=Xn.Months=Xn.CronUnit=Xn.PredefinedExpressions=void 0;const e=x2(),t=C2(),n=J8(),r=Lp();var o;(function(u){u["@yearly"]="0 0 0 1 1 *",u["@annually"]="0 0 0 1 1 *",u["@monthly"]="0 0 0 1 * *",u["@weekly"]="0 0 0 * * 0",u["@daily"]="0 0 0 * * *",u["@hourly"]="0 0 * * * *",u["@minutely"]="0 * * * * *",u["@secondly"]="* * * * * *",u["@weekdays"]="0 0 0 * * 1-5",u["@weekends"]="0 0 0 * * 0,6"})(o||(Xn.PredefinedExpressions=o={}));var i;(function(u){u.Second="Second",u.Minute="Minute",u.Hour="Hour",u.DayOfMonth="DayOfMonth",u.Month="Month",u.DayOfWeek="DayOfWeek"})(i||(Xn.CronUnit=i={}));var s;(function(u){u[u.jan=1]="jan",u[u.feb=2]="feb",u[u.mar=3]="mar",u[u.apr=4]="apr",u[u.may=5]="may",u[u.jun=6]="jun",u[u.jul=7]="jul",u[u.aug=8]="aug",u[u.sep=9]="sep",u[u.oct=10]="oct",u[u.nov=11]="nov",u[u.dec=12]="dec"})(s||(Xn.Months=s={}));var a;(function(u){u[u.sun=0]="sun",u[u.mon=1]="mon",u[u.tue=2]="tue",u[u.wed=3]="wed",u[u.thu=4]="thu",u[u.fri=5]="fri",u[u.sat=6]="sat"})(a||(Xn.DayOfWeek=a={}));let l=class er{static parse(d,f={}){const{strict:h=!1,hashSeed:p}=f,m=(0,n.seededRandom)(p);d=o[d]||d;const b=er.#e(d,h);if(!(b.dayOfMonth==="*"||b.dayOfWeek==="*"||!h))throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");const y=er.#n(i.Second,b.second,r.CronSecond.constraints,m),x=er.#n(i.Minute,b.minute,r.CronMinute.constraints,m),C=er.#n(i.Hour,b.hour,r.CronHour.constraints,m),v=er.#n(i.Month,b.month,r.CronMonth.constraints,m),S=er.#n(i.DayOfMonth,b.dayOfMonth,r.CronDayOfMonth.constraints,m),{dayOfWeek:I,nthDayOfWeek:T}=er.#d(b.dayOfWeek),N=er.#n(i.DayOfWeek,I,r.CronDayOfWeek.constraints,m),O=new e.CronFieldCollection({second:new r.CronSecond(y,{rawValue:b.second}),minute:new r.CronMinute(x,{rawValue:b.minute}),hour:new r.CronHour(C,{rawValue:b.hour}),dayOfMonth:new r.CronDayOfMonth(S,{rawValue:b.dayOfMonth}),month:new r.CronMonth(v,{rawValue:b.month}),dayOfWeek:new r.CronDayOfWeek(N,{rawValue:b.dayOfWeek,nthDayOfWeek:T})});return new t.CronExpression(O,{...f,expression:d})}static#e(d,f){if(f&&!d.length)throw new Error("Invalid cron expression");d=d||"0 * * * * *";const h=d.trim().split(/\s+/);if(f&&h.length<6)throw new Error("Invalid cron expression, expected 6 fields");if(h.length>6)throw new Error("Invalid cron expression, too many fields");const p=["*","*","*","*","*","0"];h.length<p.length&&h.unshift(...p.slice(h.length));const[m,b,y,x,C,v]=h;return{second:m,minute:b,hour:y,dayOfMonth:x,month:C,dayOfWeek:v}}static#n(d,f,h,p){if((d===i.Month||d===i.DayOfWeek)&&(f=f.replace(/[a-z]{3}/gi,m=>{m=m.toLowerCase();const b=s[m]||a[m];if(b===void 0)throw new Error(`Validation error, cannot resolve alias "${m}"`);return b.toString()})),!h.validChars.test(f))throw new Error(`Invalid characters, got value: ${f}`);return f=this.#i(f,h),f=this.#o(f,h,p),this.#r(d,f,h)}static#i(d,f){return d.replace(/[*?]/g,f.min+"-"+f.max)}static#o(d,f,h){const p=h();return d.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(m,b,y,x)=>{if(b&&y&&x){const C=parseInt(b,10),v=parseInt(y,10),S=parseInt(x,10);if(C>v)throw new Error(`Invalid range: ${C}-${v}, min > max`);if(S<=0)throw new Error(`Invalid step: ${S}, must be positive`);const I=Math.max(C,f.min),T=Math.floor(p*S),N=[];for(let O=Math.floor(I/S)*S+T;O<=v;O+=S)O>=I&&N.push(O);return N.join(",")}else if(b&&y){const C=parseInt(b,10),v=parseInt(y,10);if(C>v)throw new Error(`Invalid range: ${C}-${v}, min > max`);return String(Math.floor(p*(v-C+1))+C)}else if(x){const C=parseInt(x,10);if(C<=0)throw new Error(`Invalid step: ${C}, must be positive`);const v=Math.floor(p*C),S=[];for(let I=Math.floor(f.min/C)*C+v;I<=f.max;I+=C)I>=f.min&&S.push(I);return S.join(",")}else return String(Math.floor(p*(f.max-f.min+1)+f.min))})}static#r(d,f,h){const p=[];function m(y,x){if(Array.isArray(y))p.push(...y);else if(er.#f(x,y))p.push(y);else{const C=parseInt(y.toString(),10);if(!(C>=x.min&&C<=x.max))throw new Error(`Constraint error, got value ${y} expected range ${x.min}-${x.max}`);p.push(d===i.DayOfWeek?C%7:y)}}return f.split(",").forEach(y=>{if(!(y.length>0))throw new Error("Invalid list value format");m(er.#t(d,y,h),h)}),p}static#t(d,f,h){const p=f.split("/");if(p.length>2)throw new Error(`Invalid repeat: ${f}`);return p.length===2?(p[0].includes("-")||(p[0]=`${p[0]}-${h.max}`),er.#a(d,p[0],parseInt(p[1],10),h)):er.#a(d,f,1,h)}static#u(d,f,h){if(!(!isNaN(d)&&!isNaN(f)&&d>=h.min&&f<=h.max))throw new Error(`Constraint error, got range ${d}-${f} expected range ${h.min}-${h.max}`);if(d>f)throw new Error(`Invalid range: ${d}-${f}, min(${d}) > max(${f})`)}static#l(d){if(!(!isNaN(d)&&d>0))throw new Error(`Constraint error, cannot repeat at every ${d} time.`)}static#s(d,f,h,p){const m=[];d===i.DayOfWeek&&h%7===0&&m.push(0);for(let b=f;b<=h;b+=p)m.indexOf(b)===-1&&m.push(b);return m}static#a(d,f,h,p){const m=f.split("-");if(m.length<=1)return isNaN(+f)?f:+f;const[b,y]=m.map(x=>parseInt(x,10));return this.#u(b,y,p),this.#l(h),this.#s(d,b,y,h)}static#d(d){const f=d.split("#");if(f.length<=1)return{dayOfWeek:f[0]};const h=+f[f.length-1],p=d.match(/([,-/])/);if(p!==null)throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${p?.[0]}\` special characters are incompatible`);if(!(f.length<=2&&!isNaN(h)&&h>=1&&h<=5))throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return{dayOfWeek:f[0],nthDayOfWeek:h}}static#f(d,f){return d.chars.some(h=>f.toString().includes(h))}};return Xn.CronExpressionParser=l,Xn}var Pr={};const eL={},tL=Object.freeze(Object.defineProperty({__proto__:null,default:eL},Symbol.toStringTag,{value:"Module"})),Hg=sT(tL);var zg;function nL(){if(zg)return Pr;zg=1;var e=Pr&&Pr.__createBinding||(Object.create?(function(i,s,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(s,a);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[a]}}),Object.defineProperty(i,l,u)}):(function(i,s,a,l){l===void 0&&(l=a),i[l]=s[a]})),t=Pr&&Pr.__setModuleDefault||(Object.create?(function(i,s){Object.defineProperty(i,"default",{enumerable:!0,value:s})}):function(i,s){i.default=s}),n=Pr&&Pr.__importStar||(function(){var i=function(s){return i=Object.getOwnPropertyNames||function(a){var l=[];for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(l[l.length]=u);return l},i(s)};return function(s){if(s&&s.__esModule)return s;var a={};if(s!=null)for(var l=i(s),u=0;u<l.length;u++)l[u]!=="default"&&e(a,s,l[u]);return t(a,s),a}})();Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.CronFileParser=void 0;const r=Of();let o=class pu{static async parseFile(s){const{readFile:a}=await Promise.resolve().then(()=>n(Hg)),l=await a(s,"utf8");return pu.#e(l)}static parseFileSync(s){const{readFileSync:a}=Hg,l=a(s,"utf8");return pu.#e(l)}static#e(s){const a=s.split(`
|
|
194
|
+
`),l={variables:{},expressions:[],errors:{}};for(const u of a){const d=u.trim();if(d.length===0||d.startsWith("#"))continue;const f=d.match(/^(.*)=(.*)$/);if(f){const[,h,p]=f;l.variables[h]=p.replace(/["']/g,"");continue}try{const h=pu.#n(d);l.expressions.push(h.interval)}catch(h){l.errors[d]=h}}return l}static#n(s){const a=s.split(" ");return{interval:r.CronExpressionParser.parse(a.slice(0,5).join(" ")),command:a.slice(5,a.length)}}};return Pr.CronFileParser=o,Pr}var Ug;function rL(){return Ug||(Ug=1,(function(e){var t=Go&&Go.__createBinding||(Object.create?(function(u,d,f,h){h===void 0&&(h=f);var p=Object.getOwnPropertyDescriptor(d,f);(!p||("get"in p?!d.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(u,h,p)}):(function(u,d,f,h){h===void 0&&(h=f),u[h]=d[f]})),n=Go&&Go.__exportStar||function(u,d){for(var f in u)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&t(d,u,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=e.CronExpressionParser=e.CronExpression=e.CronFieldCollection=e.CronDate=void 0;const r=Of();var o=Fp();Object.defineProperty(e,"CronDate",{enumerable:!0,get:function(){return o.CronDate}});var i=x2();Object.defineProperty(e,"CronFieldCollection",{enumerable:!0,get:function(){return i.CronFieldCollection}});var s=C2();Object.defineProperty(e,"CronExpression",{enumerable:!0,get:function(){return s.CronExpression}});var a=Of();Object.defineProperty(e,"CronExpressionParser",{enumerable:!0,get:function(){return a.CronExpressionParser}});var l=nL();Object.defineProperty(e,"CronFileParser",{enumerable:!0,get:function(){return l.CronFileParser}}),n(Lp(),e),e.default=r.CronExpressionParser})(Go)),Go}var oL=rL(),Bd={exports:{}},Vg;function iL(){return Vg||(Vg=1,(function(e,t){(function(r,o){e.exports=o()})(globalThis,()=>(()=>{var n={949:((s,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CronParser=void 0;var u=l(515),d=(function(){function f(h,p,m){p===void 0&&(p=!0),m===void 0&&(m=!1),this.expression=h,this.dayOfWeekStartIndexZero=p,this.monthStartIndexZero=m}return f.prototype.parse=function(){var h,p,m=(h=this.expression)!==null&&h!==void 0?h:"";if(m==="@reboot")return p=["@reboot","","","","","",""],p;if(m.startsWith("@")){var b=this.parseSpecial(this.expression);p=this.extractParts(b)}else p=this.extractParts(this.expression);return this.normalize(p),this.validate(p),p},f.prototype.parseSpecial=function(h){var p={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},m=p[h];if(!m)throw new Error("Unknown special expression.");return m},f.prototype.extractParts=function(h){if(!this.expression)throw new Error("cron expression is empty");for(var p=h.trim().split(/[ ]+/),m=0;m<p.length;m++)if(p[m].includes(",")){var b=p[m].split(",").map(function(x){return x.trim()}).filter(function(x){return x!==""}).map(function(x){return isNaN(Number(x))?x:Number(x)}).filter(function(x){return x!==null&&x!==""});b.length===0&&b.push("*"),b.sort(function(x,C){return x!==null&&C!==null?x-C:0}),p[m]=b.map(function(x){return x!==null?x.toString():""}).join(",")}if(p.length<5)throw new Error("Expression has only ".concat(p.length," part").concat(p.length==1?"":"s",". At least 5 parts are required."));if(p.length==5)p.unshift(""),p.push("");else if(p.length==6){var y=/\d{4}$/.test(p[5])||p[4]=="?"||p[2]=="?";y?p.unshift(""):p.push("")}else if(p.length>7)throw new Error("Expression has ".concat(p.length," parts; too many!"));return p},f.prototype.normalize=function(h){var p=this;if(h[3]=h[3].replace("?","*"),h[5]=h[5].replace("?","*"),h[2]=h[2].replace("?","*"),h[0].indexOf("0/")==0&&(h[0]=h[0].replace("0/","*/")),h[1].indexOf("0/")==0&&(h[1]=h[1].replace("0/","*/")),h[2].indexOf("0/")==0&&(h[2]=h[2].replace("0/","*/")),h[3].indexOf("1/")==0&&(h[3]=h[3].replace("1/","*/")),h[4].indexOf("1/")==0&&(h[4]=h[4].replace("1/","*/")),h[6].indexOf("1/")==0&&(h[6]=h[6].replace("1/","*/")),h[5]=h[5].replace(/(^\d)|([^#/\s]\d)/g,function(I){var T=I.replace(/\D/,""),N=T;return p.dayOfWeekStartIndexZero?T=="7"&&(N="0"):N=(parseInt(T)-1).toString(),I.replace(T,N)}),h[5]=="L"&&(h[5]="6"),h[3]=="?"&&(h[3]="*"),h[3].indexOf("W")>-1&&(h[3].indexOf(",")>-1||h[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var m={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var b in m)h[5]=h[5].replace(new RegExp(b,"gi"),m[b].toString());h[4]=h[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(I){var T=I.replace(/\D/,""),N=T;return p.monthStartIndexZero&&(N=(parseInt(T)+1).toString()),I.replace(T,N)});var y={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var x in y)h[4]=h[4].replace(new RegExp(x,"gi"),y[x].toString());h[0]=="0"&&(h[0]=""),!/\*|\-|\,|\//.test(h[2])&&(/\*|\//.test(h[1])||/\*|\//.test(h[0]))&&(h[2]+="-".concat(h[2]));for(var C=0;C<h.length;C++)if(h[C].indexOf(",")!=-1&&(h[C]=h[C].split(",").filter(function(I){return I!==""}).join(",")||"*"),h[C]=="*/1"&&(h[C]="*"),h[C].indexOf("/")>-1&&!/^\*|\-|\,/.test(h[C])){var v=null;switch(C){case 4:v="12";break;case 5:v="6";break;case 6:v="9999";break;default:v=null;break}if(v!==null){var S=h[C].split("/");h[C]="".concat(S[0],"-").concat(v,"/").concat(S[1])}}},f.prototype.validate=function(h){var p="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(h[0],p),this.validateOnlyExpectedCharactersFound(h[1],p),this.validateOnlyExpectedCharactersFound(h[2],p),this.validateOnlyExpectedCharactersFound(h[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(h[4],p),this.validateOnlyExpectedCharactersFound(h[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(h[6],p),this.validateAnyRanges(h)},f.prototype.validateAnyRanges=function(h){u.default.secondRange(h[0]),u.default.minuteRange(h[1]),u.default.hourRange(h[2]),u.default.dayOfMonthRange(h[3]),u.default.monthRange(h[4],this.monthStartIndexZero),u.default.dayOfWeekRange(h[5],this.dayOfWeekStartIndexZero)},f.prototype.validateOnlyExpectedCharactersFound=function(h,p){var m=h.match(new RegExp("[^".concat(p,"]+"),"gi"));if(m&&m.length)throw new Error("Expression contains invalid values: '".concat(m.toString(),"'"))},f})();a.CronParser=d}),333:((s,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExpressionDescriptor=void 0;var u=l(823),d=l(949),f=(function(){function h(p,m){if(this.expression=p,this.options=m,this.expressionParts=new Array(5),!this.options.locale&&h.defaultLocale&&(this.options.locale=h.defaultLocale),!h.locales[this.options.locale]){var b=Object.keys(h.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(b,"'.")),this.options.locale=b}this.i18n=h.locales[this.options.locale],m.use24HourTimeFormat===void 0&&(m.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return h.toString=function(p,m){var b=m===void 0?{}:m,y=b.throwExceptionOnParseError,x=y===void 0?!0:y,C=b.verbose,v=C===void 0?!1:C,S=b.dayOfWeekStartIndexZero,I=S===void 0?!0:S,T=b.monthStartIndexZero,N=T===void 0?!1:T,O=b.use24HourTimeFormat,F=b.locale,B=F===void 0?null:F,j={throwExceptionOnParseError:x,verbose:v,dayOfWeekStartIndexZero:I,monthStartIndexZero:N,use24HourTimeFormat:O,locale:B};j.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var D=new h(p,j);return D.getFullDescription()},h.initialize=function(p,m){m===void 0&&(m="en"),h.specialCharacters=["/","-",",","*"],h.defaultLocale=m,p.load(h.locales)},h.prototype.getFullDescription=function(){var p,m,b="";try{var y=new d.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=y.parse(),this.expressionParts[0]==="@reboot")return((m=(p=this.i18n).atReboot)===null||m===void 0?void 0:m.call(p))||"Run once, at startup";var x=this.getTimeOfDayDescription(),C=this.getDayOfMonthDescription(),v=this.getMonthDescription(),S=this.getDayOfWeekDescription(),I=this.getYearDescription();b+=x+C+S+v+I,b=this.transformVerbosity(b,!!this.options.verbose),b=b.charAt(0).toLocaleUpperCase()+b.substr(1)}catch(T){if(!this.options.throwExceptionOnParseError)b=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(T)}return b},h.prototype.getTimeOfDayDescription=function(){var p=this.expressionParts[0],m=this.expressionParts[1],b=this.expressionParts[2],y="";if(!u.StringUtilities.containsAny(m,h.specialCharacters)&&!u.StringUtilities.containsAny(b,h.specialCharacters)&&!u.StringUtilities.containsAny(p,h.specialCharacters))y+=this.i18n.atSpace()+this.formatTime(b,m,p);else if(!p&&m.indexOf("-")>-1&&!(m.indexOf(",")>-1)&&!(m.indexOf("/")>-1)&&!u.StringUtilities.containsAny(b,h.specialCharacters)){var x=m.split("-");y+=u.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(b,x[0],""),this.formatTime(b,x[1],""))}else if(!p&&b.indexOf(",")>-1&&b.indexOf("-")==-1&&b.indexOf("/")==-1&&!u.StringUtilities.containsAny(m,h.specialCharacters)){var C=b.split(",");y+=this.i18n.at();for(var v=0;v<C.length;v++)y+=" ",y+=this.formatTime(C[v],m,""),v<C.length-2&&(y+=","),v==C.length-2&&(y+=this.i18n.spaceAnd())}else{var S=this.getSecondsDescription(),I=this.getMinutesDescription(),T=this.getHoursDescription();if(y+=S,y&&I&&(y+=", "),y+=I,I===T)return y;y&&T&&(y+=", "),y+=T}return y},h.prototype.getSecondsDescription=function(){var p=this,m=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(b){return b},function(b){return u.StringUtilities.format(p.i18n.everyX0Seconds(b),b)},function(b){return p.i18n.secondsX0ThroughX1PastTheMinute()},function(b){return b=="0"?"":parseInt(b)<20?p.i18n.atX0SecondsPastTheMinute(b):p.i18n.atX0SecondsPastTheMinuteGt20()||p.i18n.atX0SecondsPastTheMinute(b)});return m},h.prototype.getMinutesDescription=function(){var p=this,m=this.expressionParts[0],b=this.expressionParts[2],y=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(x){return x},function(x){return u.StringUtilities.format(p.i18n.everyX0Minutes(x),x)},function(x){return p.i18n.minutesX0ThroughX1PastTheHour()},function(x){try{return x=="0"&&b.indexOf("/")==-1&&m==""?p.i18n.everyHour():parseInt(x)<20?p.i18n.atX0MinutesPastTheHour(x):p.i18n.atX0MinutesPastTheHourGt20()||p.i18n.atX0MinutesPastTheHour(x)}catch{return p.i18n.atX0MinutesPastTheHour(x)}});return y},h.prototype.getHoursDescription=function(){var p=this,m=this.expressionParts[2],b=0,y=[];m.split("/")[0].split(",").forEach(function(v){var S=v.split("-");S.length===2&&y.push({value:S[1],index:b+1}),b+=S.length});var x=0,C=this.getSegmentDescription(m,this.i18n.everyHour(),function(v){var S=y.find(function(T){return T.value===v&&T.index===x}),I=S&&p.expressionParts[1]!=="0";return x++,I?p.formatTime(v,"59",""):p.formatTime(v,"0","")},function(v){return u.StringUtilities.format(p.i18n.everyX0Hours(v),v)},function(v){return p.i18n.betweenX0AndX1()},function(v){return p.i18n.atX0()});return C},h.prototype.getDayOfWeekDescription=function(){var p=this,m=this.i18n.daysOfTheWeek(),b=null;return this.expressionParts[5]=="*"?b="":b=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(y,x){var C=y;y.indexOf("#")>-1?C=y.substring(0,y.indexOf("#")):y.indexOf("L")>-1&&(C=C.replace("L",""));var v=parseInt(C),S=p.i18n.daysOfTheWeekInCase?p.i18n.daysOfTheWeekInCase(x)[v]:m[v];if(y.indexOf("#")>-1){var I=null,T=y.substring(y.indexOf("#")+1),N=y.substring(0,y.indexOf("#"));switch(T){case"1":I=p.i18n.first(N);break;case"2":I=p.i18n.second(N);break;case"3":I=p.i18n.third(N);break;case"4":I=p.i18n.fourth(N);break;case"5":I=p.i18n.fifth(N);break}S=I+" "+S}return S},function(y){return parseInt(y)==1?"":u.StringUtilities.format(p.i18n.commaEveryX0DaysOfTheWeek(y),y)},function(y){var x=y.substring(0,y.indexOf("-")),C=p.expressionParts[3]!="*";return C?p.i18n.commaAndX0ThroughX1(x):p.i18n.commaX0ThroughX1(x)},function(y){var x=null;if(y.indexOf("#")>-1){var C=y.substring(y.indexOf("#")+1),v=y.substring(0,y.indexOf("#"));x=p.i18n.commaOnThe(C,v).trim()+p.i18n.spaceX0OfTheMonth()}else if(y.indexOf("L")>-1)x=p.i18n.commaOnTheLastX0OfTheMonth(y.replace("L",""));else{var S=p.expressionParts[3]!="*";x=S?p.i18n.commaAndOnX0():p.i18n.commaOnlyOnX0(y)}return x}),b},h.prototype.getMonthDescription=function(){var p=this,m=this.i18n.monthsOfTheYear(),b=this.getSegmentDescription(this.expressionParts[4],"",function(y,x){return x&&p.i18n.monthsOfTheYearInCase?p.i18n.monthsOfTheYearInCase(x)[parseInt(y)-1]:m[parseInt(y)-1]},function(y){return parseInt(y)==1?"":u.StringUtilities.format(p.i18n.commaEveryX0Months(y),y)},function(y){return p.i18n.commaMonthX0ThroughMonthX1()||p.i18n.commaX0ThroughX1()},function(y){return p.i18n.commaOnlyInMonthX0?p.i18n.commaOnlyInMonthX0():p.i18n.commaOnlyInX0()});return b},h.prototype.getDayOfMonthDescription=function(){var p=this,m=null,b=this.expressionParts[3];switch(b){case"L":m=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":m=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var y=b.match(/(\d{1,2}W)|(W\d{1,2})/);if(y){var x=parseInt(y[0].replace("W","")),C=x==1?this.i18n.firstWeekday():u.StringUtilities.format(this.i18n.weekdayNearestDayX0(),x.toString());m=u.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),C);break}else{var v=b.match(/L-(\d{1,2})/);if(v){var S=v[1];m=u.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(S),S);break}else{if(b=="*"&&this.expressionParts[5]!="*")return"";m=this.getSegmentDescription(b,this.i18n.commaEveryDay(),function(I){return I=="L"?p.i18n.lastDay():p.i18n.dayX0?u.StringUtilities.format(p.i18n.dayX0(),I):I},function(I){return I=="1"?p.i18n.commaEveryDay():p.i18n.commaEveryX0Days(I)},function(I){return p.i18n.commaBetweenDayX0AndX1OfTheMonth(I)},function(I){return p.i18n.commaOnDayX0OfTheMonth(I)})}break}}return m},h.prototype.getYearDescription=function(){var p=this,m=this.getSegmentDescription(this.expressionParts[6],"",function(b){return/^\d+$/.test(b)?new Date(parseInt(b),1).getFullYear().toString():b},function(b){return u.StringUtilities.format(p.i18n.commaEveryX0Years(b),b)},function(b){return p.i18n.commaYearX0ThroughYearX1()||p.i18n.commaX0ThroughX1()},function(b){return p.i18n.commaOnlyInYearX0?p.i18n.commaOnlyInYearX0():p.i18n.commaOnlyInX0()});return m},h.prototype.getSegmentDescription=function(p,m,b,y,x,C){var v=null,S=p.indexOf("/")>-1,I=p.indexOf("-")>-1,T=p.indexOf(",")>-1;if(!p)v="";else if(p==="*")v=m;else if(!S&&!I&&!T)v=u.StringUtilities.format(C(p),b(p));else if(T){for(var N=p.split(","),O="",F=0;F<N.length;F++)if(F>0&&N.length>2&&(O+=",",F<N.length-1&&(O+=" ")),F>0&&N.length>1&&(F==N.length-1||N.length==2)&&(O+="".concat(this.i18n.spaceAnd()," ")),N[F].indexOf("/")>-1||N[F].indexOf("-")>-1){var B=N[F].indexOf("-")>-1&&N[F].indexOf("/")==-1,j=this.getSegmentDescription(N[F],m,b,y,B?this.i18n.commaX0ThroughX1:x,C);B&&(j=j.replace(", ","")),O+=j}else S?O+=this.getSegmentDescription(N[F],m,b,y,x,C):O+=b(N[F]);S?v=O:v=u.StringUtilities.format(C(p),O)}else if(S){var N=p.split("/");if(v=u.StringUtilities.format(y(N[1]),N[1]),N[0].indexOf("-")>-1){var D=this.generateRangeSegmentDescription(N[0],x,b);D.indexOf(", ")!=0&&(v+=", "),v+=D}else if(N[0].indexOf("*")==-1){var H=u.StringUtilities.format(C(N[0]),b(N[0]));H=H.replace(", ",""),v+=u.StringUtilities.format(this.i18n.commaStartingX0(),H)}}else I&&(v=this.generateRangeSegmentDescription(p,x,b));return v},h.prototype.generateRangeSegmentDescription=function(p,m,b){var y="",x=p.split("-"),C=b(x[0],1),v=b(x[1],2),S=m(p);return y+=u.StringUtilities.format(S,C,v),y},h.prototype.formatTime=function(p,m,b){var y=0,x=0,C=parseInt(p)+y,v=parseInt(m)+x;v>=60?(v-=60,C+=1):v<0&&(v+=60,C-=1),C>=24?C=C-24:C<0&&(C=24+C);var S="",I=!1;this.options.use24HourTimeFormat||(I=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),S=I?"".concat(this.getPeriod(C)," "):" ".concat(this.getPeriod(C)),C>12&&(C-=12),C===0&&(C=12));var T="";return b&&(T=":".concat(("00"+b).substring(b.length))),"".concat(I?S:"").concat(("00"+C.toString()).substring(C.toString().length),":").concat(("00"+v.toString()).substring(v.toString().length)).concat(T).concat(I?"":S)},h.prototype.transformVerbosity=function(p,m){if(!m&&(p=p.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),p=p.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),p=p.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),p=p.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var b=0,y=Object.entries(this.i18n.conciseVerbosityReplacements());b<y.length;b++){var x=y[b],C=x[0],v=x[1];p=p.replace(new RegExp(C,"g"),v)}return p},h.prototype.getPeriod=function(p){return p>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},h.locales={},h})();a.ExpressionDescriptor=f}),747:((s,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.enLocaleLoader=void 0;var u=l(486),d=(function(){function f(){}return f.prototype.load=function(h){h.en=new u.en},f})();a.enLocaleLoader=d}),486:((s,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.en=void 0;var l=(function(){function u(){}return u.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},u.prototype.atX0MinutesPastTheHourGt20=function(){return null},u.prototype.commaMonthX0ThroughMonthX1=function(){return null},u.prototype.commaYearX0ThroughYearX1=function(){return null},u.prototype.use24HourTimeFormatByDefault=function(){return!1},u.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},u.prototype.everyMinute=function(){return"every minute"},u.prototype.everyHour=function(){return"every hour"},u.prototype.atSpace=function(){return"At "},u.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},u.prototype.at=function(){return"At"},u.prototype.spaceAnd=function(){return" and"},u.prototype.everySecond=function(){return"every second"},u.prototype.everyX0Seconds=function(){return"every %s seconds"},u.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},u.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},u.prototype.everyX0Minutes=function(){return"every %s minutes"},u.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},u.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},u.prototype.everyX0Hours=function(){return"every %s hours"},u.prototype.betweenX0AndX1=function(){return"between %s and %s"},u.prototype.atX0=function(){return"at %s"},u.prototype.commaEveryDay=function(){return", every day"},u.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},u.prototype.commaX0ThroughX1=function(){return", %s through %s"},u.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},u.prototype.first=function(){return"first"},u.prototype.second=function(){return"second"},u.prototype.third=function(){return"third"},u.prototype.fourth=function(){return"fourth"},u.prototype.fifth=function(){return"fifth"},u.prototype.commaOnThe=function(){return", on the "},u.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},u.prototype.lastDay=function(){return"the last day"},u.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},u.prototype.commaOnlyOnX0=function(){return", only on %s"},u.prototype.commaAndOnX0=function(){return", and on %s"},u.prototype.commaEveryX0Months=function(){return", every %s months"},u.prototype.commaOnlyInX0=function(){return", only in %s"},u.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},u.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},u.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},u.prototype.firstWeekday=function(){return"first weekday"},u.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},u.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},u.prototype.commaEveryX0Days=function(){return", every %s days"},u.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},u.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},u.prototype.commaEveryHour=function(){return", every hour"},u.prototype.commaEveryX0Years=function(){return", every %s years"},u.prototype.commaStartingX0=function(){return", starting %s"},u.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},u.prototype.atReboot=function(){return"Run once, at startup"},u})();a.en=l}),515:((s,a)=>{Object.defineProperty(a,"__esModule",{value:!0});function l(d,f){if(!d)throw new Error(f)}var u=(function(){function d(){}return d.secondRange=function(f){for(var h=f.split(","),p=0;p<h.length;p++)if(!isNaN(parseInt(h[p],10))){var m=parseInt(h[p],10);l(m>=0&&m<=59,"seconds part must be >= 0 and <= 59")}},d.minuteRange=function(f){for(var h=f.split(","),p=0;p<h.length;p++)if(!isNaN(parseInt(h[p],10))){var m=parseInt(h[p],10);l(m>=0&&m<=59,"minutes part must be >= 0 and <= 59")}},d.hourRange=function(f){for(var h=f.split(","),p=0;p<h.length;p++)if(!isNaN(parseInt(h[p],10))){var m=parseInt(h[p],10);l(m>=0&&m<=23,"hours part must be >= 0 and <= 23")}},d.dayOfMonthRange=function(f){for(var h=f.split(","),p=0;p<h.length;p++)if(!isNaN(parseInt(h[p],10))){var m=parseInt(h[p],10);l(m>=1&&m<=31,"DOM part must be >= 1 and <= 31")}},d.monthRange=function(f,h){for(var p=f.split(","),m=0;m<p.length;m++)if(!isNaN(parseInt(p[m],10))){var b=parseInt(p[m],10);l(b>=1&&b<=12,h?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},d.dayOfWeekRange=function(f,h){for(var p=f.split(","),m=0;m<p.length;m++)if(!isNaN(parseInt(p[m],10))){var b=parseInt(p[m],10);l(b>=0&&b<=6,h?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},d})();a.default=u}),823:((s,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.StringUtilities=void 0;var l=(function(){function u(){}return u.format=function(d){for(var f=[],h=1;h<arguments.length;h++)f[h-1]=arguments[h];return d.replace(/%s/g,function(p){return f.shift()})},u.containsAny=function(d,f){return f.some(function(h){return d.indexOf(h)>-1})},u})();a.StringUtilities=l})},r={};function o(s){var a=r[s];if(a!==void 0)return a.exports;var l=r[s]={exports:{}};return n[s](l,l.exports,o),l.exports}var i={};return(()=>{var s=i;Object.defineProperty(s,"__esModule",{value:!0}),s.toString=void 0;var a=o(333),l=o(747);a.ExpressionDescriptor.initialize(new l.enLocaleLoader),s.default=a.ExpressionDescriptor;var u=a.ExpressionDescriptor.toString;s.toString=u})(),i})())})(Bd)),Bd.exports}var sL=iL();const aL=Tr(sL),lL=new Set(["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC","SUN","MON","TUE","WED","THU","FRI","SAT"]);function uL(e){for(const t of e.trim().split(/\s+/)){if(/[#?]/.test(t))return!1;for(const n of t.split(/[,\-/]/))if(!(n===""||n==="*")&&/[A-Za-z]/.test(n)&&!lL.has(n.toUpperCase()))return!1}return!0}function E2(e){const t=(e??"").trim();if(t.split(/\s+/).filter(Boolean).length!==5)return{valid:!1,description:"",nextRun:null,error:"Expected a 5-field UNIX cron: minute hour day-of-month month day-of-week."};if(!uL(t))return{valid:!1,description:"",nextRun:null,error:"Unsupported cron syntax: L, W, #, and ? extensions are not allowed (plain 5-field UNIX cron only)."};try{const n=aL.toString(t,{use24HourTimeFormat:!0,verbose:!1}),r=oL.CronExpressionParser.parse(t,{tz:"UTC"}).next().toDate();return{valid:!0,description:n,nextRun:r}}catch(n){return{valid:!1,description:"",nextRun:null,error:n instanceof Error?n.message:"Invalid cron expression."}}}function v2(e){return e?e.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",timeZone:"UTC",hour12:!1})+" UTC":"—"}const Wg="0 6 * * *";function cL({currentSchedule:e,isSubmitting:t,disabled:n,disabledReason:r,onSubmit:o}){const[i,s]=W.useState(!1),[a,l]=W.useState(e??Wg),u=()=>{l(e??Wg),s(!0)},d=()=>s(!1),f=E2(a),h=async m=>{try{await o(m),s(!1)}catch{}},p=c.jsx("span",{children:c.jsx(w.Button,{variant:"outlined",size:"small",startIcon:c.jsx(Hu,{}),onClick:u,disabled:n,"aria-label":e?"Edit schedule":"Set schedule",children:e?"Edit schedule":"Set schedule"})});return c.jsxs(c.Fragment,{children:[n&&r?c.jsx(w.Tooltip,{title:r,children:p}):p,c.jsxs(w.Dialog,{open:i,onClose:d,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"set-schedule-title",children:[c.jsx(w.DialogTitle,{id:"set-schedule-title",children:e?"Edit schedule":"Set schedule"}),c.jsxs(w.DialogContent,{children:[c.jsx(w.DialogContentText,{sx:{mb:2},children:"The publisher rebuilds the materializations in this package on this cadence. Enter a 5-field UNIX cron, evaluated in UTC. In a hosted deployment, the change takes effect on your next publish."}),c.jsx(w.TextField,{autoFocus:!0,fullWidth:!0,label:"Cron expression",value:a,onChange:m=>l(m.target.value),error:a.trim()!==""&&!f.valid,slotProps:{htmlInput:{style:{fontFamily:De.MONO_FONT_FAMILY}}}}),c.jsx(w.Box,{sx:{mt:1.5,minHeight:48},children:f.valid?c.jsxs(c.Fragment,{children:[c.jsx(w.Typography,{variant:"body2",children:f.description}),c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["Next run: ",v2(f.nextRun)]})]}):c.jsx(w.Typography,{variant:"body2",color:"error",children:f.error})}),c.jsxs(w.Alert,{severity:"info",sx:{mt:2},children:["A schedule runs only on version-scoped packages, so saving one sets ",c.jsx("code",{children:"scope: version"})," for this package."]})]}),c.jsxs(w.DialogActions,{sx:{justifyContent:"space-between",px:3},children:[c.jsx(w.Box,{children:e&&c.jsx(w.Button,{color:"error",loading:t,onClick:()=>h(null),children:"Clear schedule"})}),c.jsxs(w.Box,{children:[c.jsx(w.Button,{onClick:d,children:"Cancel"}),c.jsx(w.Button,{variant:"contained",loading:t,disabled:!f.valid,onClick:()=>h(a.trim()),sx:{ml:1},children:"Save"})]})]})]})]})}function dL({schedule:e,scope:t,manifestLocation:n,hasFreshness:r,mutable:o,isSubmitting:i,isScopeMutating:s,onSubmit:a,onScopeChange:l}){const u=!!n,d=e?E2(e):null,f=!!e;return c.jsx(w.Card,{variant:"outlined",sx:{borderRadius:2,mb:6},children:c.jsx(w.CardContent,{children:c.jsxs(w.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",spacing:2,children:[c.jsxs(w.Box,{sx:{minWidth:0},children:[c.jsxs(w.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[c.jsx(Hu,{fontSize:"small",color:"action"}),c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Schedule"})]}),u?c.jsxs(w.Box,{children:[c.jsx(w.Chip,{size:"small",color:"default",variant:"outlined",label:"Control-plane managed",sx:{mb:1}}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Refresh is driven by the control plane; the built-in scheduler does not fire this package."})]}):d?c.jsxs(w.Box,{children:[c.jsxs(w.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.5,flexWrap:"wrap"},children:[c.jsx(w.Chip,{size:"small",color:"success",variant:"outlined",icon:c.jsx(Hu,{fontSize:"small"}),label:"Active"}),c.jsx(w.Box,{component:"code",sx:{fontFamily:De.MONO_FONT_FAMILY,fontSize:"0.8125rem",px:.75,py:.25,borderRadius:1,bgcolor:"action.hover"},children:e})]}),c.jsx(w.Typography,{variant:"body2",children:d.valid?d.description:"Unrecognized cron expression."}),d.valid&&c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["Next run: ",v2(d.nextRun)]})]}):r?c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"This package uses a freshness policy; a cron schedule is not applicable."}):c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"On-demand only — no schedule set."}),!u&&c.jsxs(w.Box,{sx:{mt:2},children:[c.jsx(w.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Scope"}),c.jsx(w.Tooltip,{title:f?"A schedule requires version scope. Clear the schedule to change it.":"",children:c.jsx("span",{children:c.jsxs(w.ToggleButtonGroup,{size:"small",exclusive:!0,value:t,disabled:!o||!l||f||!!s,onChange:(h,p)=>{p&&p!==t&&l?.(p)},children:[c.jsx(w.ToggleButton,{value:"package",children:"package"}),c.jsx(w.ToggleButton,{value:"version",children:"version"})]})})}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:.5},children:t==="version"?"Materialized artifacts are per version (required for a schedule).":"Materialized artifacts are shared across versions."})]}),c.jsxs(w.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:1.5},children:["Declared in ",c.jsx("code",{children:"publisher.json"}),".",!u&&c.jsxs(c.Fragment,{children:[" ","In a hosted deployment, a change takes effect on your next publish."]})]})]}),o&&!u&&c.jsx(cL,{currentSchedule:e,isSubmitting:i,disabled:r,disabledReason:"This package declares a freshness policy; a schedule and freshness are mutually exclusive.",onSubmit:a})]})})})}const fL=3e3;function pL({resourceUri:e,onClickPackageFile:t}){const{apiClients:n,mutable:r}=De.useServer(),o=Lr.useQueryClient(),{environmentName:i,packageName:s}=Ht(e),[a,l]=W.useState(""),[u,d]=W.useState(null),f=t??(F=>{window.location.href=F});if(!s)throw new Error("Materializations requires a package in the resource URI");const h=Xt({queryKey:["materializations",i,s],queryFn:()=>n.materializations.listMaterializations(i,s),refetchInterval:F=>(F.state.data?.data??[]).some(D=>Ja(D.status))?fL:!1}),p=Xt({queryKey:["package",i,s],queryFn:()=>n.packages.getPackage(i,s)}),m=()=>o.invalidateQueries({queryKey:["materializations",i,s]}),b=vn({mutationFn:F=>n.materializations.createMaterialization(i,s,{forceRefresh:F.forceRefresh}),onSuccess(){l("Materialization requested"),m()},onError(F){l(F.message),m()}}),y=vn({mutationFn:F=>n.materializations.materializationAction(i,s,F.id,De.MaterializationActionActionEnum.Stop),onSuccess(){l("Materialization stopped"),m()},onError(F){l(F.message)}}),x=vn({mutationFn:({materialization:F,dropTables:B})=>n.materializations.deleteMaterialization(i,s,F.id,B),onSuccess(){l("Materialization deleted"),m()},onError(F){l(F.message)}}),C=p.data?.data,v=vn({mutationFn:F=>n.packages.updatePackage(i,s,{name:s,description:C?.description,...F?{scope:De.PackageScopeEnum.Version}:{},materialization:{schedule:F}}),onSuccess(F,B){l(B?"Schedule updated":"Schedule cleared"),o.invalidateQueries({queryKey:["package",i,s]})},onError(F){l(F.message)}}),S=vn({mutationFn:F=>n.packages.updatePackage(i,s,{name:s,description:C?.description,scope:F}),onSuccess(){l("Scope updated"),o.invalidateQueries({queryKey:["package",i,s]})},onError(F){l(F.message)}}),I=h.data?.data??[],T=I.find(F=>F.id===u)??null,N=I.some(F=>Ja(F.status)),O=b.isPending||y.isPending||x.isPending;return c.jsxs(w.Container,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:3,py:6},children:[c.jsxs(w.Box,{sx:{mb:4},children:[c.jsxs(w.Link,{onClick:F=>f(`/${i}/${s}`,F),underline:"none",sx:{display:"inline-flex",alignItems:"center",gap:.5,cursor:"pointer",color:"text.secondary",fontSize:"0.875rem",mb:2,"&:hover":{color:"primary.main"}},children:[c.jsx(Xx,{sx:{fontSize:18}}),"Back to ",s]}),c.jsxs(w.Stack,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:"Materializations"}),c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["Materialize the persist sources in ",s," into tables and serve queries from them"]})]}),r&&c.jsx(bN,{onSubmit:F=>b.mutateAsync(F),isSubmitting:b.isPending,disabled:N,disabledReason:"A materialization is already pending or running for this package."})]})]}),p.isSuccess&&c.jsx(dL,{schedule:C?.materialization?.schedule??null,scope:C?.scope===De.PackageScopeEnum.Version?"version":"package",manifestLocation:C?.manifestLocation??null,hasFreshness:!!C?.materialization?.freshness,mutable:r,isSubmitting:v.isPending,isScopeMutating:S.isPending,onSubmit:F=>v.mutateAsync(F),onScopeChange:F=>S.mutateAsync(F==="version"?De.PackageScopeEnum.Version:De.PackageScopeEnum.Package)}),c.jsxs(w.Box,{sx:{mb:6},children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:1},children:"Runs"}),h.isError&&c.jsx(kn,{error:h.error,context:`${i} > ${s} > Materializations`}),!h.isSuccess&&!h.isError&&c.jsx(Sn,{text:"Loading materializations..."}),h.isSuccess&&c.jsx(b2,{materializations:I,mutable:r,isMutating:O,onStop:F=>y.mutate(F),onDelete:(F,B)=>x.mutate({materialization:F,dropTables:B}),onViewDetails:F=>d(F.id??null)})]}),c.jsx(r2,{materialization:T,buildPlan:p.data?.data?.buildPlan??null,onClose:()=>d(null)}),c.jsx(w.Snackbar,{open:a!=="",autoHideDuration:6e3,onClose:()=>l(""),message:a})]})}function hL({packages:e,onSubmit:t,isSubmitting:n,disabled:r}){const[o,i]=W.useState(!1),[s,a]=W.useState({}),[l,u]=W.useState(!1),d=()=>{a({}),u(!1),i(!0)},f=()=>i(!1),h=e.map(y=>y.name).filter(y=>s[y]),p=y=>a(x=>({...x,[y]:!x[y]})),m=e.length>0&&h.length===e.length,b=async()=>{try{await t({packageNames:h,forceRefresh:l}),i(!1)}catch{}};return c.jsxs(c.Fragment,{children:[c.jsx(w.Button,{variant:"contained",startIcon:c.jsx(fl,{}),onClick:d,disabled:r,"aria-label":"New materialization",children:"New materialization"}),c.jsxs(w.Dialog,{open:o,onClose:f,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"create-env-materialization-title",children:[c.jsx(w.DialogTitle,{id:"create-env-materialization-title",children:"New materialization"}),c.jsxs(w.DialogContent,{children:[c.jsx(w.DialogContentText,{sx:{mb:1},children:"Pick the packages to materialize. Each runs an independent build of every persist source in that package."}),e.length===0?c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"No packages in this environment."}):c.jsxs(c.Fragment,{children:[c.jsx(w.FormControlLabel,{control:c.jsx(w.Checkbox,{checked:m,indeterminate:h.length>0&&!m,onChange:y=>{const x={};y.target.checked&&e.forEach(C=>x[C.name]=!0),a(x)}}),label:c.jsx(w.Typography,{variant:"body2",children:"Select all"})}),c.jsx(w.Box,{sx:{maxHeight:240,overflowY:"auto",pl:1,borderLeft:"2px solid",borderColor:"divider"},children:c.jsx(w.FormGroup,{children:e.map(y=>c.jsx(w.FormControlLabel,{control:c.jsx(w.Checkbox,{checked:!!s[y.name],onChange:()=>p(y.name)}),label:y.name},y.name))})}),c.jsx(w.FormControlLabel,{sx:{mt:1},control:c.jsx(w.Switch,{checked:l,onChange:y=>u(y.target.checked)}),label:"Force refresh (rebuild even if unchanged)"})]})]}),c.jsxs(w.DialogActions,{children:[c.jsx(w.Button,{onClick:f,children:"Cancel"}),c.jsxs(w.Button,{variant:"contained",loading:n,disabled:h.length===0,onClick:b,children:["Materialize",h.length>0?` (${h.length})`:""]})]})]})]})}const mL=3e3,qg=10;function T2({resourceUri:e,onClickPackageFile:t}){const{apiClients:n,mutable:r}=De.useServer(),o=Lr.useQueryClient(),{environmentName:i}=Ht(e),[s,a]=W.useState(""),[l,u]=W.useState(null),[d,f]=W.useState(qg),h=t??(O=>{window.location.href=O}),p=Xt({queryKey:["env-materializations",i,d],queryFn:()=>n.materializations.listEnvironmentMaterializations(i,d),placeholderData:O=>O,refetchInterval:O=>(O.state.data?.data??[]).some(j=>Ja(j.status))?mL:!1}),m=Xt({queryKey:["packages",i],queryFn:()=>n.packages.listPackages(i)}),b=()=>o.invalidateQueries({queryKey:["env-materializations",i]}),y=vn({mutationFn:async O=>{const B=(await Promise.allSettled(O.packageNames.map(j=>n.materializations.createMaterialization(i,j,{forceRefresh:O.forceRefresh})))).filter(j=>j.status==="rejected").length;return{total:O.packageNames.length,failed:B}},onSuccess(O){const F=O.total-O.failed;a(O.failed===0?`Started ${F} materialization${F===1?"":"s"}`:`Started ${F} of ${O.total} (${O.failed} could not start — a build may already be active)`),b()},onError(O){a(O.message),b()}}),x=vn({mutationFn:O=>n.materializations.materializationAction(i,O.packageName,O.id,De.MaterializationActionActionEnum.Stop),onSuccess(){a("Materialization stopped"),b()},onError(O){a(O.message)}}),C=vn({mutationFn:({materialization:O,dropTables:F})=>n.materializations.deleteMaterialization(i,O.packageName,O.id,F),onSuccess(){a("Materialization deleted"),b()},onError(O){a(O.message)}}),v=p.data?.data??[],S=m.data?.data??[],I=v.find(O=>O.id===l)??null,T=y.isPending||x.isPending||C.isPending,N=v.length>=d;return c.jsxs(w.Box,{children:[c.jsxs(w.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",mb:3},children:[c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Materializations"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"All materialization builds across the packages in this environment"})]}),r&&c.jsx(hL,{packages:S,onSubmit:O=>y.mutateAsync(O),isSubmitting:y.isPending})]}),p.isError&&c.jsx(kn,{error:p.error,context:`${i} > Materializations`}),!p.isSuccess&&!p.isError&&c.jsx(Sn,{text:"Loading materializations..."}),p.isSuccess&&c.jsx(b2,{materializations:v,mutable:r,isMutating:T,showPackage:!0,onClickPackage:O=>h(`/${i}/${O}/materializations`),onStop:O=>x.mutate(O),onDelete:(O,F)=>C.mutate({materialization:O,dropTables:F}),onViewDetails:O=>u(O.id??null)}),p.isSuccess&&v.length>0&&c.jsxs(w.Stack,{direction:"row",alignItems:"center",justifyContent:"center",spacing:2,sx:{mt:2},children:[c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:N?`Showing ${v.length} most recent`:`${v.length} materialization${v.length===1?"":"s"}`}),N&&c.jsx(w.Button,{size:"small",onClick:()=>f(O=>O+qg),disabled:p.isFetching,children:"Show more"})]}),c.jsx(r2,{materialization:I,buildPlan:null,showBuildPlan:!1,onClose:()=>u(null)}),c.jsx(w.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})}function gL({resourceUri:e}){const{environmentName:t}=Ht(e),{apiClients:n}=De.useServer(),[r,o]=W.useState(!1),i=90,{data:s,isSuccess:a,isError:l,error:u}=Xt({queryKey:["about",t],queryFn:()=>n.environments.getEnvironment(t,!1)}),d=s?.data?.readme||"",f=d.split(/\s+/),h=f.length>i,p=f.slice(0,i).join(" ");return c.jsxs(c.Fragment,{children:[!a&&!l&&c.jsx(Sn,{text:"Fetching About..."}),a&&d&&c.jsx(De.PackageCard,{children:c.jsxs(De.PackageCardContent,{children:[c.jsx(De.PackageSectionTitle,{children:"Readme"}),c.jsxs(w.Box,{sx:{mt:1,fontSize:"0.875rem",lineHeight:1.6},children:[c.jsx(wu,{options:{overrides:{h1:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}},h2:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}},h3:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}}}},children:r||!h?d:p}),h&&c.jsxs(w.Box,{sx:{mt:1},children:[" ",c.jsx(w.Button,{variant:"text",size:"small",onClick:()=>o(!r),children:r?"Read less":"Read more"})]})]})]})}),l&&c.jsx(kn,{error:u,context:`${t} > About`})]})}const S2="https://docs.malloydata.dev/documentation",jd=`${S2}/user_guides/publishing`,ss={docsHome:`${S2}/`,publishing:`${jd}/publishing`,explorer:`${jd}/explorer`,mcpAgents:`${jd}/mcp_agents`};function bL({resourceUri:e}){const[t,n]=W.useState(!1),{apiClients:r}=De.useServer(),o=Lr.useQueryClient(),[i,s]=W.useState(""),{environmentName:a}=Ht(e),l=vn({async mutationFn(d){return r.packages.createPackage(a,{name:d.name,description:d.description,location:d.location})},onSuccess(){n(!1),s("Package created successfully"),o.invalidateQueries({queryKey:["packages",a]})},onError(d){s(d instanceof Error?d.message:"An unknown error occurred")}}),u=d=>{d.preventDefault();const f=new FormData(d.currentTarget),h=f.get("name")?.toString(),p=f.get("description")?.toString(),m=f.get("location")?.toString();l.mutate({name:h,description:p,location:m})};return c.jsxs(c.Fragment,{children:[c.jsx(w.Button,{onClick:()=>n(!0),variant:"contained",color:"primary",startIcon:c.jsx(On.Add,{}),children:"Add Package"}),c.jsxs(w.Dialog,{open:t,onClose:()=>n(!1),maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[c.jsx(w.DialogTitle,{sx:{fontSize:"1.25rem",fontWeight:600,letterSpacing:"-0.025em",pt:3,pb:1,px:3},children:"Create New Package"}),c.jsxs(w.DialogContent,{sx:{px:3,pb:0},children:[c.jsxs(w.Box,{sx:{mb:3},children:[c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:"Create a new Malloy package to start exploring your data."}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:"The location can be a GitHub/S3/GCP URL containing a package (zipped or unzipped), or an absolute path to a directory the publisher server has access to."}),c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["Make sure to conform to the"," ",c.jsx(w.Box,{component:"a",href:ss.publishing,target:"_blank",rel:"noopener noreferrer",sx:{color:"text.primary",textDecoration:"underline"},children:"Malloy Package Format"}),"."]})]}),c.jsx("form",{onSubmit:u,id:"package-form",children:c.jsxs(w.Stack,{spacing:2.5,children:[c.jsx(w.TextField,{autoFocus:!0,required:!0,id:"name",name:"name",label:"Package Name",type:"text",fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}}),c.jsx(w.TextField,{id:"description",name:"description",label:"Description",multiline:!0,rows:3,fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}}),c.jsx(w.TextField,{id:"location",name:"location",label:"Location",type:"text",placeholder:"e.g. s3://my-bucket/my-package.zip",fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}})]})})]}),c.jsxs(w.DialogActions,{sx:{px:3,pt:2,pb:3,gap:1},children:[c.jsx(w.Button,{variant:"outlined",disabled:l.isPending,onClick:()=>n(!1),children:"Cancel"}),c.jsx(w.Button,{type:"submit",form:"package-form",variant:"contained",loading:l.isPending,children:"Save Changes"})]})]}),c.jsx(w.Snackbar,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i})]})}const yL=mt(c.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"})),k2=mt(c.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}));function w2(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:Ka(t.components[n].defaultProps,r)}function xL({props:e,name:t,defaultTheme:n,themeId:r}){let o=jS(n);return o=o[r]||o,w2({theme:o,name:t,props:e})}function Kt({props:e,name:t}){return xL({props:e,name:t,defaultTheme:uc,themeId:Cs})}const CL=We("MuiBox",["root"]),EL=bb(),Qt=Ot.createBox({themeId:Cs,defaultTheme:EL,defaultClassName:CL.root,generateClassName:nb.generate});function vL(e){return Ge("MuiDialogContentText",e)}We("MuiDialogContentText",["root"]);const TL=e=>{const{classes:t}=e,r=Ke({root:["root"]},vL,t);return{...t,...r}},SL=fe(Dt,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiDialogContentText",slot:"Root"})({}),vl=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialogContentText"}),{children:o,className:i,...s}=r,a=TL(s);return c.jsx(SL,{component:"p",variant:"body1",color:"textSecondary",ref:n,ownerState:s,className:Ue(a.root,i),...r,classes:a})});function Zl(e){return parseInt(e,10)||0}const kL={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function wL(e){for(const t in e)return!1;return!0}function Yg(e){return wL(e)||e.outerHeightStyle===0&&!e.overflowing}const DL=M.forwardRef(function(t,n){const{onChange:r,maxRows:o,minRows:i=1,style:s,value:a,...l}=t,{current:u}=M.useRef(a!=null),d=M.useRef(null),f=vt(n,d),h=M.useRef(null),p=M.useRef(null),m=M.useCallback(()=>{const v=d.current,S=p.current;if(!v||!S)return;const T=bo(v).getComputedStyle(v);if(T.width==="0px")return{outerHeightStyle:0,overflowing:!1};S.style.width=T.width,S.value=v.value||t.placeholder||"x",S.value.slice(-1)===`
|
|
195
|
+
`&&(S.value+=" ");const N=T.boxSizing,O=Zl(T.paddingBottom)+Zl(T.paddingTop),F=Zl(T.borderBottomWidth)+Zl(T.borderTopWidth),B=S.scrollHeight;S.value="x";const j=S.scrollHeight;let D=B;i&&(D=Math.max(Number(i)*j,D)),o&&(D=Math.min(Number(o)*j,D)),D=Math.max(D,j);const H=D+(N==="border-box"?O+F:0),_=Math.abs(D-B)<=1;return{outerHeightStyle:H,overflowing:_}},[o,i,t.placeholder]),b=Ve(()=>{const v=d.current,S=m();if(!v||!S||Yg(S))return!1;const I=S.outerHeightStyle;return h.current!=null&&h.current!==I}),y=M.useCallback(()=>{const v=d.current,S=m();if(!v||!S||Yg(S))return;const I=S.outerHeightStyle;h.current!==I&&(h.current=I,v.style.height=`${I}px`),v.style.overflow=S.overflowing?"hidden":""},[m]),x=M.useRef(-1);yn(()=>{const v=Cb(y),S=d?.current;if(!S)return;const I=bo(S);I.addEventListener("resize",v);let T;return typeof ResizeObserver<"u"&&(T=new ResizeObserver(()=>{b()&&(T.unobserve(S),cancelAnimationFrame(x.current),y(),x.current=requestAnimationFrame(()=>{T.observe(S)}))}),T.observe(S)),()=>{v.clear(),cancelAnimationFrame(x.current),I.removeEventListener("resize",v),T&&T.disconnect()}},[m,y,b]),yn(()=>{y()});const C=v=>{u||y();const S=v.target,I=S.value.length,T=S.value.endsWith(`
|
|
196
|
+
`),N=S.selectionStart===I;T&&N&&S.setSelectionRange(I,I),r&&r(v)};return c.jsxs(M.Fragment,{children:[c.jsx("textarea",{value:a,onChange:C,ref:f,rows:i,style:s,...l}),c.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:p,tabIndex:-1,style:{...kL.shadow,...s,paddingTop:0,paddingBottom:0}})]})});function IL(e){return Ge("MuiInputBase",e)}const tr=We("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Kg;const wc=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${Fe(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},Dc=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},AL=e=>{const{classes:t,color:n,disabled:r,error:o,endAdornment:i,focused:s,formControl:a,fullWidth:l,hiddenLabel:u,multiline:d,readOnly:f,size:h,startAdornment:p,type:m}=e,b={root:["root",`color${Fe(n)}`,r&&"disabled",o&&"error",l&&"fullWidth",s&&"focused",a&&"formControl",h&&h!=="medium"&&`size${Fe(h)}`,d&&"multiline",p&&"adornedStart",i&&"adornedEnd",u&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",m==="search"&&"inputTypeSearch",d&&"inputMultiline",h==="small"&&"inputSizeSmall",u&&"inputHiddenLabel",p&&"inputAdornedStart",i&&"inputAdornedEnd",f&&"readOnly"]};return Ke(b,IL,t)},Ic=fe("div",{name:"MuiInputBase",slot:"Root",overridesResolver:wc})(ft(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${tr.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:t})=>t.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:t,size:n})=>t.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:t})=>t.fullWidth,style:{width:"100%"}}]}))),Ac=fe("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Dc})(ft(({theme:e})=>{const t=e.palette.mode==="light",n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},o=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${tr.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${tr.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:i})=>!i.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:i})=>i.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),Gg=kk({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),_p=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:i,autoFocus:s,className:a,color:l,components:u={},componentsProps:d={},defaultValue:f,disabled:h,disableInjectingGlobalStyles:p,endAdornment:m,error:b,fullWidth:y=!1,id:x,inputComponent:C="input",inputProps:v={},inputRef:S,margin:I,maxRows:T,minRows:N,multiline:O=!1,name:F,onBlur:B,onChange:j,onClick:D,onFocus:H,onKeyDown:_,onKeyUp:L,placeholder:$,readOnly:K,renderSuffix:G,rows:q,size:R,slotProps:oe={},slots:se={},startAdornment:z,type:pe="text",value:J,...Q}=r,re=v.value!=null?v.value:J,{current:ne}=M.useRef(re!=null),ae=M.useRef(),ie=M.useCallback(Re=>{},[]),Z=vt(ae,S,v.ref,ie),[me,le]=M.useState(!1),ue=ar(),Ie=Ei({props:r,muiFormControl:ue,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Ie.focused=ue?ue.focused:me,M.useEffect(()=>{!ue&&h&&me&&(le(!1),B&&B())},[ue,h,me,B]);const Ce=ue&&ue.onFilled,we=ue&&ue.onEmpty,ye=M.useCallback(Re=>{Vu(Re)?Ce&&Ce():we&&we()},[Ce,we]);yn(()=>{ne&&ye({value:re})},[re,ye,ne]);const ze=Re=>{H&&H(Re),v.onFocus&&v.onFocus(Re),ue&&ue.onFocus?ue.onFocus(Re):le(!0)},Ne=Re=>{B&&B(Re),v.onBlur&&v.onBlur(Re),ue&&ue.onBlur?ue.onBlur(Re):le(!1)},nt=(Re,...ct)=>{if(!ne){const lt=Re.target||ae.current;if(lt==null)throw new Error(mo(1));ye({value:lt.value})}v.onChange&&v.onChange(Re,...ct),j&&j(Re,...ct)};M.useEffect(()=>{ye(ae.current)},[]);const _e=Re=>{ae.current&&Re.currentTarget===Re.target&&ae.current.focus(),D&&D(Re)};let Bt=C,yt=v;O&&Bt==="input"&&(q?yt={type:void 0,minRows:q,maxRows:q,...yt}:yt={type:void 0,maxRows:T,minRows:N,...yt},Bt=DL);const ot=Re=>{ye(Re.animationName==="mui-auto-fill-cancel"?ae.current:{value:"x"})};M.useEffect(()=>{ue&&ue.setAdornedStart(!!z)},[ue,z]);const xe={...r,color:Ie.color||"primary",disabled:Ie.disabled,endAdornment:m,error:Ie.error,focused:Ie.focused,formControl:ue,fullWidth:y,hiddenLabel:Ie.hiddenLabel,multiline:O,size:Ie.size,startAdornment:z,type:pe},Pe=AL(xe),qe=se.root||u.Root||Ic,Je=oe.root||d.root||{},Xe=se.input||u.Input||Ac;return yt={...yt,...oe.input??d.input},c.jsxs(M.Fragment,{children:[!p&&typeof Gg=="function"&&(Kg||(Kg=c.jsx(Gg,{}))),c.jsxs(qe,{...Je,ref:n,onClick:_e,...Q,...!hs(qe)&&{ownerState:{...xe,...Je.ownerState}},className:Ue(Pe.root,Je.className,a,K&&"MuiInputBase-readOnly"),children:[z,c.jsx(kc.Provider,{value:null,children:c.jsx(Xe,{"aria-invalid":Ie.error,"aria-describedby":o,autoComplete:i,autoFocus:s,defaultValue:f,disabled:Ie.disabled,id:x,onAnimationStart:ot,name:F,placeholder:$,readOnly:K,required:Ie.required,rows:q,value:re,onKeyDown:_,onKeyUp:L,type:pe,...yt,...!hs(Xe)&&{as:Bt,ownerState:{...xe,...yt.ownerState}},ref:Z,className:Ue(Pe.input,yt.className,K&&"MuiInputBase-readOnly"),onBlur:Ne,onChange:nt,onFocus:ze})}),m,G?G({...Ie,startAdornment:z}):null]})]})});function OL(e){return Ge("MuiInput",e)}const Mo={...tr,...We("MuiInput",["root","underline","input"])},ML=e=>{const{classes:t,disableUnderline:n}=e,o=Ke({root:["root",!n&&"underline"],input:["input"]},OL,t);return{...t,...o}},PL=fe(Ic,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...wc(e,t),!n.disableUnderline&&t.underline]}})(ft(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline)),{position:"relative",variants:[{props:({ownerState:r})=>r.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:r})=>!r.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Mo.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Mo.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Mo.disabled}, .${Mo.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${Mo.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(Bn()).map(([r])=>({props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}}))]}})),RL=fe(Ac,{name:"MuiInput",slot:"Input",overridesResolver:Dc})({}),Bp=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiInput"}),{disableUnderline:o=!1,components:i={},componentsProps:s,fullWidth:a=!1,inputComponent:l="input",multiline:u=!1,slotProps:d,slots:f={},type:h="text",...p}=r,m=ML(r),y={root:{ownerState:{disableUnderline:o}}},x=d??s?An(d??s,y):y,C=f.root??i.Root??PL,v=f.input??i.Input??RL;return c.jsx(_p,{slots:{root:C,input:v},slotProps:x,fullWidth:a,inputComponent:l,multiline:u,ref:n,type:h,...p,classes:m})});Bp.muiName="Input";function NL(e){return Ge("MuiFilledInput",e)}const nr={...tr,...We("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},FL=e=>{const{classes:t,disableUnderline:n,startAdornment:r,endAdornment:o,size:i,hiddenLabel:s,multiline:a}=e,l={root:["root",!n&&"underline",r&&"adornedStart",o&&"adornedEnd",i==="small"&&`size${Fe(i)}`,s&&"hiddenLabel",a&&"multiline"],input:["input"]},u=Ke(l,NL,t);return{...t,...u}},LL=fe(Ic,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...wc(e,t),!n.disableUnderline&&t.underline]}})(ft(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${nr.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${nr.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i},variants:[{props:({ownerState:s})=>!s.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${nr.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${nr.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline):n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${nr.disabled}, .${nr.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${nr.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(Bn()).map(([s])=>({props:{disableUnderline:!1,color:s},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[s]?.main}`}}})),{props:({ownerState:s})=>s.startAdornment,style:{paddingLeft:12}},{props:({ownerState:s})=>s.endAdornment,style:{paddingRight:12}},{props:({ownerState:s})=>s.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:s,size:a})=>s.multiline&&a==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel&&s.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),_L=fe(Ac,{name:"MuiFilledInput",slot:"Input",overridesResolver:Dc})(ft(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),jp=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiFilledInput"}),{disableUnderline:o=!1,components:i={},componentsProps:s,fullWidth:a=!1,hiddenLabel:l,inputComponent:u="input",multiline:d=!1,slotProps:f,slots:h={},type:p="text",...m}=r,b={...r,disableUnderline:o,fullWidth:a,inputComponent:u,multiline:d,type:p},y=FL(r),x={root:{ownerState:b},input:{ownerState:b}},C=f??s?An(x,f??s):x,v=h.root??i.Root??LL,S=h.input??i.Input??_L;return c.jsx(_p,{slots:{root:v,input:S},slotProps:C,fullWidth:a,inputComponent:u,multiline:d,ref:n,type:p,...m,classes:y})});jp.muiName="Input";var Qg;const BL=fe("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:$n})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),jL=fe("legend",{name:"MuiNotchedOutlined",shouldForwardProp:$n})(ft(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:t})=>!t.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:t})=>t.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:t})=>t.withLabel&&t.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function $L(e){const{children:t,classes:n,className:r,label:o,notched:i,...s}=e,a=o!=null&&o!=="",l={...e,notched:i,withLabel:a};return c.jsx(BL,{"aria-hidden":!0,className:r,ownerState:l,...s,children:c.jsx(jL,{ownerState:l,children:a?c.jsx("span",{children:o}):Qg||(Qg=c.jsx("span",{className:"notranslate","aria-hidden":!0,children:""}))})})}function HL(e){return Ge("MuiOutlinedInput",e)}const fr={...tr,...We("MuiOutlinedInput",["root","notchedOutline","input"])},zL=e=>{const{classes:t}=e,r=Ke({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},HL,t);return{...t,...r}},UL=fe(Ic,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:wc})(ft(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${fr.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${fr.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${fr.focused} .${fr.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(Bn()).map(([n])=>({props:{color:n},style:{[`&.${fr.focused} .${fr.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}})),{props:{},style:{[`&.${fr.error} .${fr.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${fr.disabled} .${fr.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),VL=fe($L,{name:"MuiOutlinedInput",slot:"NotchedOutline"})(ft(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}})),WL=fe(Ac,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Dc})(ft(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:t})=>t.multiline,style:{padding:0}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}}]}))),$p=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiOutlinedInput"}),{components:o={},fullWidth:i=!1,inputComponent:s="input",label:a,multiline:l=!1,notched:u,slots:d={},slotProps:f={},type:h="text",...p}=r,m=zL(r),b=ar(),y=Ei({props:r,muiFormControl:b,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),x={...r,color:y.color||"primary",disabled:y.disabled,error:y.error,focused:y.focused,formControl:b,fullWidth:i,hiddenLabel:y.hiddenLabel,multiline:l,size:y.size,type:h},C=d.root??o.Root??UL,v=d.input??o.Input??WL,[S,I]=kt("notchedOutline",{elementType:VL,className:m.notchedOutline,shouldForwardComponentProp:!0,ownerState:x,externalForwardedProps:{slots:d,slotProps:f},additionalProps:{label:a!=null&&a!==""&&y.required?c.jsxs(M.Fragment,{children:[a," ","*"]}):a}});return c.jsx(_p,{slots:{root:C,input:v},slotProps:f,renderSuffix:T=>c.jsx(S,{...I,notched:typeof u<"u"?u:!!(T.startAdornment||T.filled||T.focused)}),fullWidth:i,inputComponent:s,multiline:l,ref:n,type:h,...p,classes:{...m,notchedOutline:null}})});$p.muiName="Input";function qL(e){return Ge("MuiFormLabel",e)}const Ua=We("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),YL=e=>{const{classes:t,color:n,focused:r,disabled:o,error:i,filled:s,required:a}=e,l={root:["root",`color${Fe(n)}`,o&&"disabled",i&&"error",s&&"filled",r&&"focused",a&&"required"],asterisk:["asterisk",i&&"error"]};return Ke(l,qL,t)},KL=fe("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color==="secondary"&&t.colorSecondary,n.filled&&t.filled]}})(ft(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{[`&.${Ua.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${Ua.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Ua.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),GL=fe("span",{name:"MuiFormLabel",slot:"Asterisk"})(ft(({theme:e})=>({[`&.${Ua.error}`]:{color:(e.vars||e).palette.error.main}}))),QL=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiFormLabel"}),{children:o,className:i,color:s,component:a="label",disabled:l,error:u,filled:d,focused:f,required:h,...p}=r,m=ar(),b=Ei({props:r,muiFormControl:m,states:["color","required","focused","disabled","error","filled"]}),y={...r,color:b.color||"primary",component:a,disabled:b.disabled,error:b.error,filled:b.filled,focused:b.focused,required:b.required},x=YL(y);return c.jsxs(KL,{as:a,ownerState:y,className:Ue(x.root,i),ref:n,...p,children:[o,b.required&&c.jsxs(GL,{ownerState:y,"aria-hidden":!0,className:x.asterisk,children:[" ","*"]})]})});function XL(e){return Ge("MuiInputLabel",e)}We("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const ZL=e=>{const{classes:t,formControl:n,size:r,shrink:o,disableAnimation:i,variant:s,required:a}=e,l={root:["root",n&&"formControl",!i&&"animated",o&&"shrink",r&&r!=="medium"&&`size${Fe(r)}`,s],asterisk:[a&&"asterisk"]},u=Ke(l,XL,t);return{...t,...u}},JL=fe(QL,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Ua.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(ft(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:t})=>t.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:t})=>t.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:t})=>!t.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:t,ownerState:n,size:r})=>t==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),qu=M.forwardRef(function(t,n){const r=ut({name:"MuiInputLabel",props:t}),{disableAnimation:o=!1,margin:i,shrink:s,variant:a,className:l,...u}=r,d=ar();let f=s;typeof f>"u"&&d&&(f=d.filled||d.focused||d.adornedStart);const h=Ei({props:r,muiFormControl:d,states:["size","variant","required","focused"]}),p={...r,disableAnimation:o,formControl:d,shrink:f,size:h.size,variant:h.variant,required:h.required,focused:h.focused},m=ZL(p);return c.jsx(JL,{"data-shrink":f,ref:n,className:Ue(m.root,l),...u,ownerState:p,classes:m})});function e_(e){return Ge("MuiFormHelperText",e)}const Xg=We("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Zg;const t_=e=>{const{classes:t,contained:n,size:r,disabled:o,error:i,filled:s,focused:a,required:l}=e,u={root:["root",o&&"disabled",i&&"error",r&&`size${Fe(r)}`,n&&"contained",a&&"focused",s&&"filled",l&&"required"]};return Ke(u,e_,t)},n_=fe("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${Fe(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(ft(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${Xg.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Xg.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:t})=>t.contained,style:{marginLeft:14,marginRight:14}}]}))),D2=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiFormHelperText"}),{children:o,className:i,component:s="p",disabled:a,error:l,filled:u,focused:d,margin:f,required:h,variant:p,...m}=r,b=ar(),y=Ei({props:r,muiFormControl:b,states:["variant","size","disabled","error","filled","focused","required"]}),x={...r,component:s,contained:y.variant==="filled"||y.variant==="outlined",variant:y.variant,size:y.size,disabled:y.disabled,error:y.error,filled:y.filled,focused:y.focused,required:y.required};delete x.ownerState;const C=t_(x);return c.jsx(n_,{as:s,className:Ue(C.root,i),ref:n,...m,ownerState:x,children:o===" "?Zg||(Zg=c.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):o})});function Et(e){const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:o=!1,...i}=e,s=o?{}:br(n,r),{props:a,internalRef:l}=u2({...i,externalSlotProps:s}),u=vt(l,s?.ref,e.additionalProps?.ref);return l2(t,{...a,ref:u},r)}function r_(e){return Ge("MuiList",e)}We("MuiList",["root","padding","dense","subheader"]);const o_=e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e;return Ke({root:["root",!n&&"padding",r&&"dense",o&&"subheader"]},r_,t)},i_=fe("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),I2=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiList"}),{children:o,className:i,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:u,...d}=r,f=M.useMemo(()=>({dense:a}),[a]),h={...r,component:s,dense:a,disablePadding:l},p=o_(h);return c.jsx(ho.Provider,{value:f,children:c.jsxs(i_,{as:s,className:Ue(p.root,i),ref:n,ownerState:h,...d,children:[u,o]})})});function $d(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function Jg(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function A2(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(""))}function fa(e,t,n,r,o,i){let s=!1,a=o(e,t,t?n:!1);for(;a;){if(a===e.firstChild){if(s)return!1;s=!0}const l=r?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!A2(a,i)||l)a=o(e,a,n);else return a.focus(),!0}return!1}const s_=M.forwardRef(function(t,n){const{actions:r,autoFocus:o=!1,autoFocusItem:i=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:u=!1,onKeyDown:d,variant:f="selectedMenu",...h}=t,p=M.useRef(null),m=M.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});yn(()=>{o&&p.current.focus()},[o]),M.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(v,{direction:S})=>{const I=!p.current.style.width;if(v.clientHeight<p.current.clientHeight&&I){const T=`${c2(bo(v))}px`;p.current.style[S==="rtl"?"paddingLeft":"paddingRight"]=T,p.current.style.width=`calc(100% + ${T})`}return p.current}}),[]);const b=v=>{const S=p.current,I=v.key;if(v.ctrlKey||v.metaKey||v.altKey){d&&d(v);return}const N=mn(S).activeElement;if(I==="ArrowDown")v.preventDefault(),fa(S,N,u,l,$d);else if(I==="ArrowUp")v.preventDefault(),fa(S,N,u,l,Jg);else if(I==="Home")v.preventDefault(),fa(S,null,u,l,$d);else if(I==="End")v.preventDefault(),fa(S,null,u,l,Jg);else if(I.length===1){const O=m.current,F=I.toLowerCase(),B=performance.now();O.keys.length>0&&(B-O.lastTime>500?(O.keys=[],O.repeating=!0,O.previousKeyMatched=!0):O.repeating&&F!==O.keys[0]&&(O.repeating=!1)),O.lastTime=B,O.keys.push(F);const j=N&&!O.repeating&&A2(N,O);O.previousKeyMatched&&(j||fa(S,N,!1,l,$d,O))?v.preventDefault():O.previousKeyMatched=!1}d&&d(v)},y=vt(p,n);let x=-1;M.Children.forEach(s,(v,S)=>{if(!M.isValidElement(v)){x===S&&(x+=1,x>=s.length&&(x=-1));return}v.props.disabled||(f==="selectedMenu"&&v.props.selected||x===-1)&&(x=S),x===S&&(v.props.disabled||v.props.muiSkipListHighlight||v.type.muiSkipListHighlight)&&(x+=1,x>=s.length&&(x=-1))});const C=M.Children.map(s,(v,S)=>{if(S===x){const I={};return i&&(I.autoFocus=!0),v.props.tabIndex===void 0&&f==="selectedMenu"&&(I.tabIndex=0),M.cloneElement(v,I)}return v});return c.jsx(I2,{role:"menu",ref:y,className:a,onKeyDown:b,tabIndex:o?0:-1,...h,children:C})});function Mf(e){return`scale(${e}, ${e**2})`}const a_={entering:{opacity:1,transform:Mf(1)},entered:{opacity:1,transform:"none"}},Hd=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),el=M.forwardRef(function(t,n){const{addEndListener:r,appear:o=!0,children:i,easing:s,in:a,onEnter:l,onEntered:u,onEntering:d,onExit:f,onExited:h,onExiting:p,style:m,timeout:b="auto",TransitionComponent:y=Dr,...x}=t,C=Sc(),v=M.useRef(),S=Lo(),I=M.useRef(null),T=vt(I,Ms(i),n),N=L=>$=>{if(L){const K=I.current;$===void 0?L(K):L(K,$)}},O=N(d),F=N((L,$)=>{p2(L);const{duration:K,delay:G,easing:q}=ms({style:m,timeout:b,easing:s},{mode:"enter"});let R;b==="auto"?(R=S.transitions.getAutoHeightDuration(L.clientHeight),v.current=R):R=K,L.style.transition=[S.transitions.create("opacity",{duration:R,delay:G}),S.transitions.create("transform",{duration:Hd?R:R*.666,delay:G,easing:q})].join(","),l&&l(L,$)}),B=N(u),j=N(p),D=N(L=>{const{duration:$,delay:K,easing:G}=ms({style:m,timeout:b,easing:s},{mode:"exit"});let q;b==="auto"?(q=S.transitions.getAutoHeightDuration(L.clientHeight),v.current=q):q=$,L.style.transition=[S.transitions.create("opacity",{duration:q,delay:K}),S.transitions.create("transform",{duration:Hd?q:q*.666,delay:Hd?K:K||q*.333,easing:G})].join(","),L.style.opacity=0,L.style.transform=Mf(.75),f&&f(L)}),H=N(h),_=L=>{b==="auto"&&C.start(v.current||0,L),r&&r(I.current,L)};return c.jsx(y,{appear:o,in:a,nodeRef:I,onEnter:F,onEntered:B,onEntering:O,onExit:D,onExited:H,onExiting:j,addEndListener:_,timeout:b==="auto"?null:b,...x,children:(L,{ownerState:$,...K})=>M.cloneElement(i,{style:{opacity:0,transform:Mf(.75),visibility:L==="exited"&&!a?"hidden":void 0,...a_[L],...m,...i.props.style},ref:T,...K})})});el&&(el.muiSupportAuto=!0);function l_(e){return Ge("MuiPopover",e)}We("MuiPopover",["root","paper"]);function e1(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function t1(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function n1(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function Jl(e){return typeof e=="function"?e():e}const u_=e=>{const{classes:t}=e;return Ke({root:["root"],paper:["paper"]},l_,t)},c_=fe(m2,{name:"MuiPopover",slot:"Root"})({}),O2=fe(Ci,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),d_=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiPopover"}),{action:o,anchorEl:i,anchorOrigin:s={vertical:"top",horizontal:"left"},anchorPosition:a,anchorReference:l="anchorEl",children:u,className:d,container:f,elevation:h=8,marginThreshold:p=16,open:m,PaperProps:b={},slots:y={},slotProps:x={},transformOrigin:C={vertical:"top",horizontal:"left"},TransitionComponent:v,transitionDuration:S="auto",TransitionProps:I={},disableScrollLock:T=!1,...N}=r,O=M.useRef(),F={...r,anchorOrigin:s,anchorReference:l,elevation:h,marginThreshold:p,transformOrigin:C,TransitionComponent:v,transitionDuration:S,TransitionProps:I},B=u_(F),j=M.useCallback(()=>{if(l==="anchorPosition")return a;const ie=Jl(i),me=(ie&&ie.nodeType===1?ie:mn(O.current).body).getBoundingClientRect();return{top:me.top+e1(me,s.vertical),left:me.left+t1(me,s.horizontal)}},[i,s.horizontal,s.vertical,a,l]),D=M.useCallback(ie=>({vertical:e1(ie,C.vertical),horizontal:t1(ie,C.horizontal)}),[C.horizontal,C.vertical]),H=M.useCallback(ie=>{const Z={width:ie.offsetWidth,height:ie.offsetHeight},me=D(Z);if(l==="none")return{top:null,left:null,transformOrigin:n1(me)};const le=j();let ue=le.top-me.vertical,Ie=le.left-me.horizontal;const Ce=ue+Z.height,we=Ie+Z.width,ye=bo(Jl(i)),ze=ye.innerHeight-p,Ne=ye.innerWidth-p;if(p!==null&&ue<p){const nt=ue-p;ue-=nt,me.vertical+=nt}else if(p!==null&&Ce>ze){const nt=Ce-ze;ue-=nt,me.vertical+=nt}if(p!==null&&Ie<p){const nt=Ie-p;Ie-=nt,me.horizontal+=nt}else if(we>Ne){const nt=we-Ne;Ie-=nt,me.horizontal+=nt}return{top:`${Math.round(ue)}px`,left:`${Math.round(Ie)}px`,transformOrigin:n1(me)}},[i,l,j,D,p]),[_,L]=M.useState(m),$=M.useCallback(()=>{const ie=O.current;if(!ie)return;const Z=H(ie);Z.top!==null&&ie.style.setProperty("top",Z.top),Z.left!==null&&(ie.style.left=Z.left),ie.style.transformOrigin=Z.transformOrigin,L(!0)},[H]);M.useEffect(()=>(T&&window.addEventListener("scroll",$),()=>window.removeEventListener("scroll",$)),[i,T,$]);const K=()=>{$()},G=()=>{L(!1)};M.useEffect(()=>{m&&$()}),M.useImperativeHandle(o,()=>m?{updatePosition:()=>{$()}}:null,[m,$]),M.useEffect(()=>{if(!m)return;const ie=Cb(()=>{$()}),Z=bo(Jl(i));return Z.addEventListener("resize",ie),()=>{ie.clear(),Z.removeEventListener("resize",ie)}},[i,m,$]);let q=S;const R={slots:{transition:v,...y},slotProps:{transition:I,paper:b,...x}},[oe,se]=kt("transition",{elementType:el,externalForwardedProps:R,ownerState:F,getSlotProps:ie=>({...ie,onEntering:(Z,me)=>{ie.onEntering?.(Z,me),K()},onExited:Z=>{ie.onExited?.(Z),G()}}),additionalProps:{appear:!0,in:m}});S==="auto"&&!oe.muiSupportAuto&&(q=void 0);const z=f||(i?mn(Jl(i)).body:void 0),[pe,{slots:J,slotProps:Q,...re}]=kt("root",{ref:n,elementType:c_,externalForwardedProps:{...R,...N},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:y.backdrop},slotProps:{backdrop:Eb(typeof x.backdrop=="function"?x.backdrop(F):x.backdrop,{invisible:!0})},container:z,open:m},ownerState:F,className:Ue(B.root,d)}),[ne,ae]=kt("paper",{ref:O,className:B.paper,elementType:O2,externalForwardedProps:R,shouldForwardComponentProp:!0,additionalProps:{elevation:h,style:_?void 0:{opacity:0}},ownerState:F});return c.jsx(pe,{...re,...!hs(pe)&&{slots:J,slotProps:Q,disableScrollLock:T},children:c.jsx(oe,{...se,timeout:q,children:c.jsx(ne,{...ae,children:u})})})});function f_(e){return Ge("MuiMenu",e)}We("MuiMenu",["root","paper","list"]);const p_={vertical:"top",horizontal:"right"},h_={vertical:"top",horizontal:"left"},m_=e=>{const{classes:t}=e;return Ke({root:["root"],paper:["paper"],list:["list"]},f_,t)},g_=fe(d_,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiMenu",slot:"Root"})({}),b_=fe(O2,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),y_=fe(s_,{name:"MuiMenu",slot:"List"})({outline:0}),x_=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiMenu"}),{autoFocus:o=!0,children:i,className:s,disableAutoFocusItem:a=!1,MenuListProps:l={},onClose:u,open:d,PaperProps:f={},PopoverClasses:h,transitionDuration:p="auto",TransitionProps:{onEntering:m,...b}={},variant:y="selectedMenu",slots:x={},slotProps:C={},...v}=r,S=kr(),I={...r,autoFocus:o,disableAutoFocusItem:a,MenuListProps:l,onEntering:m,PaperProps:f,transitionDuration:p,TransitionProps:b,variant:y},T=m_(I),N=o&&!a&&d,O=M.useRef(null),F=(q,R)=>{O.current&&O.current.adjustStyleForScrollbar(q,{direction:S?"rtl":"ltr"}),m&&m(q,R)},B=q=>{q.key==="Tab"&&(q.preventDefault(),u&&u(q,"tabKeyDown"))};let j=-1;M.Children.map(i,(q,R)=>{M.isValidElement(q)&&(q.props.disabled||(y==="selectedMenu"&&q.props.selected||j===-1)&&(j=R))});const D={slots:x,slotProps:{list:l,transition:b,paper:f,...C}},H=Et({elementType:x.root,externalSlotProps:C.root,ownerState:I,className:[T.root,s]}),[_,L]=kt("paper",{className:T.paper,elementType:b_,externalForwardedProps:D,shouldForwardComponentProp:!0,ownerState:I}),[$,K]=kt("list",{className:Ue(T.list,l.className),elementType:y_,shouldForwardComponentProp:!0,externalForwardedProps:D,getSlotProps:q=>({...q,onKeyDown:R=>{B(R),q.onKeyDown?.(R)}}),ownerState:I}),G=typeof D.slotProps.transition=="function"?D.slotProps.transition(I):D.slotProps.transition;return c.jsx(g_,{onClose:u,anchorOrigin:{vertical:"bottom",horizontal:S?"right":"left"},transformOrigin:S?p_:h_,slots:{root:x.root,paper:_,backdrop:x.backdrop,...x.transition&&{transition:x.transition}},slotProps:{root:H,paper:L,backdrop:typeof C.backdrop=="function"?C.backdrop(I):C.backdrop,transition:{...G,onEntering:(...q)=>{F(...q),G?.onEntering?.(...q)}}},open:d,ref:n,transitionDuration:p,ownerState:I,...v,classes:h,children:c.jsx($,{actions:O,autoFocus:o&&(j===-1||a),autoFocusItem:N,variant:y,...K,children:i})})});function C_(e){return Ge("MuiNativeSelect",e)}const Hp=We("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),E_=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:s}=e,a={select:["select",n,r&&"disabled",o&&"multiple",s&&"error"],icon:["icon",`icon${Fe(n)}`,i&&"iconOpen",r&&"disabled"]};return Ke(a,C_,t)},M2=fe("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${Hp.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:t})=>t.variant!=="filled"&&t.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),v_=fe(M2,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:$n,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${Hp.multiple}`]:t.multiple}]}})({}),P2=fe("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${Hp.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:t})=>t.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),T_=fe(P2,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Fe(n.variant)}`],n.open&&t.iconOpen]}})({}),S_=M.forwardRef(function(t,n){const{className:r,disabled:o,error:i,IconComponent:s,inputRef:a,variant:l="standard",...u}=t,d={...t,disabled:o,variant:l,error:i},f=E_(d);return c.jsxs(M.Fragment,{children:[c.jsx(v_,{ownerState:d,className:Ue(f.select,r),disabled:o,ref:a||n,...u}),t.multiple?null:c.jsx(T_,{as:s,ownerState:d,className:f.icon})]})});function R2(e){return Ge("MuiSelect",e)}const pa=We("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var r1;const k_=fe(M2,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${pa.select}`]:t.select},{[`&.${pa.select}`]:t[n.variant]},{[`&.${pa.error}`]:t.error},{[`&.${pa.multiple}`]:t.multiple}]}})({[`&.${pa.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),w_=fe(P2,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Fe(n.variant)}`],n.open&&t.iconOpen]}})({}),D_=fe("input",{shouldForwardProp:e=>xb(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function o1(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function I_(e){return e==null||typeof e=="string"&&!e.trim()}const A_=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:s}=e,a={select:["select",n,r&&"disabled",o&&"multiple",s&&"error"],icon:["icon",`icon${Fe(n)}`,i&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ke(a,R2,t)},O_=M.forwardRef(function(t,n){const{"aria-describedby":r,"aria-label":o,autoFocus:i,autoWidth:s,children:a,className:l,defaultOpen:u,defaultValue:d,disabled:f,displayEmpty:h,error:p=!1,IconComponent:m,inputRef:b,labelId:y,MenuProps:x={},multiple:C,name:v,onBlur:S,onChange:I,onClose:T,onFocus:N,onOpen:O,open:F,readOnly:B,renderValue:j,required:D,SelectDisplayProps:H={},tabIndex:_,type:L,value:$,variant:K="standard",...G}=t,[q,R]=or({controlled:$,default:d,name:"Select"}),[oe,se]=or({controlled:F,default:u,name:"Select"}),z=M.useRef(null),pe=M.useRef(null),[J,Q]=M.useState(null),{current:re}=M.useRef(F!=null),[ne,ae]=M.useState(),ie=vt(n,b),Z=M.useCallback(be=>{pe.current=be,be&&Q(be)},[]),me=J?.parentNode;M.useImperativeHandle(ie,()=>({focus:()=>{pe.current.focus()},node:z.current,value:q}),[q]),M.useEffect(()=>{u&&oe&&J&&!re&&(ae(s?null:me.clientWidth),pe.current.focus())},[J,s]),M.useEffect(()=>{i&&pe.current.focus()},[i]),M.useEffect(()=>{if(!y)return;const be=mn(pe.current).getElementById(y);if(be){const Ae=()=>{getSelection().isCollapsed&&pe.current.focus()};return be.addEventListener("click",Ae),()=>{be.removeEventListener("click",Ae)}}},[y]);const le=(be,Ae)=>{be?O&&O(Ae):T&&T(Ae),re||(ae(s?null:me.clientWidth),se(be))},ue=be=>{be.button===0&&(be.preventDefault(),pe.current.focus(),le(!0,be))},Ie=be=>{le(!1,be)},Ce=M.Children.toArray(a),we=be=>{const Ae=Ce.find(Oe=>Oe.props.value===be.target.value);Ae!==void 0&&(R(Ae.props.value),I&&I(be,Ae))},ye=be=>Ae=>{let Oe;if(Ae.currentTarget.hasAttribute("tabindex")){if(C){Oe=Array.isArray(q)?q.slice():[];const Qe=q.indexOf(be.props.value);Qe===-1?Oe.push(be.props.value):Oe.splice(Qe,1)}else Oe=be.props.value;if(be.props.onClick&&be.props.onClick(Ae),q!==Oe&&(R(Oe),I)){const Qe=Ae.nativeEvent||Ae,st=new Qe.constructor(Qe.type,Qe);Object.defineProperty(st,"target",{writable:!0,value:{value:Oe,name:v}}),I(st,be)}C||le(!1,Ae)}},ze=be=>{B||[" ","ArrowUp","ArrowDown","Enter"].includes(be.key)&&(be.preventDefault(),le(!0,be))},Ne=J!==null&&oe,nt=be=>{!Ne&&S&&(Object.defineProperty(be,"target",{writable:!0,value:{value:q,name:v}}),S(be))};delete G["aria-invalid"];let _e,Bt;const yt=[];let ot=!1;(Vu({value:q})||h)&&(j?_e=j(q):ot=!0);const xe=Ce.map(be=>{if(!M.isValidElement(be))return null;let Ae;if(C){if(!Array.isArray(q))throw new Error(mo(2));Ae=q.some(Oe=>o1(Oe,be.props.value)),Ae&&ot&&yt.push(be.props.children)}else Ae=o1(q,be.props.value),Ae&&ot&&(Bt=be.props.children);return M.cloneElement(be,{"aria-selected":Ae?"true":"false",onClick:ye(be),onKeyUp:Oe=>{Oe.key===" "&&Oe.preventDefault(),be.props.onKeyUp&&be.props.onKeyUp(Oe)},role:"option",selected:Ae,value:void 0,"data-value":be.props.value})});ot&&(C?yt.length===0?_e=null:_e=yt.reduce((be,Ae,Oe)=>(be.push(Ae),Oe<yt.length-1&&be.push(", "),be),[]):_e=Bt);let Pe=ne;!s&&re&&J&&(Pe=me.clientWidth);let qe;typeof _<"u"?qe=_:qe=f?null:0;const Je=H.id||(v?`mui-component-select-${v}`:void 0),Xe={...t,variant:K,value:q,open:Ne,error:p},Re=A_(Xe),ct={...x.PaperProps,...typeof x.slotProps?.paper=="function"?x.slotProps.paper(Xe):x.slotProps?.paper},lt={...x.MenuListProps,...typeof x.slotProps?.list=="function"?x.slotProps.list(Xe):x.slotProps?.list},Mt=_r();return c.jsxs(M.Fragment,{children:[c.jsx(k_,{as:"div",ref:Z,tabIndex:qe,role:"combobox","aria-controls":Ne?Mt:void 0,"aria-disabled":f?"true":void 0,"aria-expanded":Ne?"true":"false","aria-haspopup":"listbox","aria-label":o,"aria-labelledby":[y,Je].filter(Boolean).join(" ")||void 0,"aria-describedby":r,"aria-required":D?"true":void 0,"aria-invalid":p?"true":void 0,onKeyDown:ze,onMouseDown:f||B?null:ue,onBlur:nt,onFocus:N,...H,ownerState:Xe,className:Ue(H.className,Re.select,l),id:Je,children:I_(_e)?r1||(r1=c.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):_e}),c.jsx(D_,{"aria-invalid":p,value:Array.isArray(q)?q.join(","):q,name:v,ref:z,"aria-hidden":!0,onChange:we,tabIndex:-1,disabled:f,className:Re.nativeInput,autoFocus:i,required:D,...G,ownerState:Xe}),c.jsx(w_,{as:m,className:Re.icon,ownerState:Xe}),c.jsx(x_,{id:`menu-${v||""}`,anchorEl:me,open:Ne,onClose:Ie,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...x,slotProps:{...x.slotProps,list:{"aria-labelledby":y,role:"listbox","aria-multiselectable":C?"true":void 0,disableListWrap:!0,id:Mt,...lt},paper:{...ct,style:{minWidth:Pe,...ct!=null?ct.style:null}}},children:xe})]})}),N2=mt(c.jsx("path",{d:"M7 10l5 5 5-5z"})),M_=e=>{const{classes:t}=e,r=Ke({root:["root"]},R2,t);return{...t,...r}},zp={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>$n(e)&&e!=="variant"},P_=fe(Bp,zp)(""),R_=fe($p,zp)(""),N_=fe(jp,zp)(""),Yu=M.forwardRef(function(t,n){const r=ut({name:"MuiSelect",props:t}),{autoWidth:o=!1,children:i,classes:s={},className:a,defaultOpen:l=!1,displayEmpty:u=!1,IconComponent:d=N2,id:f,input:h,inputProps:p,label:m,labelId:b,MenuProps:y,multiple:x=!1,native:C=!1,onClose:v,onOpen:S,open:I,renderValue:T,SelectDisplayProps:N,variant:O="outlined",...F}=r,B=C?S_:O_,j=ar(),D=Ei({props:r,muiFormControl:j,states:["variant","error"]}),H=D.variant||O,_={...r,variant:H,classes:s},L=M_(_),{root:$,...K}=L,G=h||{standard:c.jsx(P_,{ownerState:_}),outlined:c.jsx(R_,{label:m,ownerState:_}),filled:c.jsx(N_,{ownerState:_})}[H],q=vt(n,Ms(G));return c.jsx(M.Fragment,{children:M.cloneElement(G,{inputComponent:B,inputProps:{children:i,error:D.error,IconComponent:d,variant:H,type:void 0,multiple:x,...C?{id:f}:{autoWidth:o,defaultOpen:l,displayEmpty:u,labelId:b,MenuProps:y,onClose:v,onOpen:S,open:I,renderValue:T,SelectDisplayProps:{id:f,...N}},...p,classes:p?An(K,p.classes):K,...h?h.props.inputProps:{}},...(x&&C||u)&&H==="outlined"?{notched:!0}:{},ref:q,className:Ue(G.props.className,a,L.root),...!h&&{variant:H},...F})})});Yu.muiName="Select";function F_(e){return Ge("MuiTextField",e)}We("MuiTextField",["root"]);const L_={standard:Bp,filled:jp,outlined:$p},__=e=>{const{classes:t}=e;return Ke({root:["root"]},F_,t)},B_=fe(Wu,{name:"MuiTextField",slot:"Root"})({}),Ct=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiTextField"}),{autoComplete:o,autoFocus:i=!1,children:s,className:a,color:l="primary",defaultValue:u,disabled:d=!1,error:f=!1,FormHelperTextProps:h,fullWidth:p=!1,helperText:m,id:b,InputLabelProps:y,inputProps:x,InputProps:C,inputRef:v,label:S,maxRows:I,minRows:T,multiline:N=!1,name:O,onBlur:F,onChange:B,onFocus:j,placeholder:D,required:H=!1,rows:_,select:L=!1,SelectProps:$,slots:K={},slotProps:G={},type:q,value:R,variant:oe="outlined",...se}=r,z={...r,autoFocus:i,color:l,disabled:d,error:f,fullWidth:p,multiline:N,required:H,select:L,variant:oe},pe=__(z),J=_r(b),Q=m&&J?`${J}-helper-text`:void 0,re=S&&J?`${J}-label`:void 0,ne=L_[oe],ae={slots:K,slotProps:{input:C,inputLabel:y,htmlInput:x,formHelperText:h,select:$,...G}},ie={},Z=ae.slotProps.inputLabel;oe==="outlined"&&(Z&&typeof Z.shrink<"u"&&(ie.notched=Z.shrink),ie.label=S),L&&((!$||!$.native)&&(ie.id=void 0),ie["aria-describedby"]=void 0);const[me,le]=kt("root",{elementType:B_,shouldForwardComponentProp:!0,externalForwardedProps:{...ae,...se},ownerState:z,className:Ue(pe.root,a),ref:n,additionalProps:{disabled:d,error:f,fullWidth:p,required:H,color:l,variant:oe}}),[ue,Ie]=kt("input",{elementType:ne,externalForwardedProps:ae,additionalProps:ie,ownerState:z}),[Ce,we]=kt("inputLabel",{elementType:qu,externalForwardedProps:ae,ownerState:z}),[ye,ze]=kt("htmlInput",{elementType:"input",externalForwardedProps:ae,ownerState:z}),[Ne,nt]=kt("formHelperText",{elementType:D2,externalForwardedProps:ae,ownerState:z}),[_e,Bt]=kt("select",{elementType:Yu,externalForwardedProps:ae,ownerState:z}),yt=c.jsx(ue,{"aria-describedby":Q,autoComplete:o,autoFocus:i,defaultValue:u,fullWidth:p,multiline:N,name:O,rows:_,maxRows:I,minRows:T,type:q,value:R,id:J,inputRef:v,onBlur:F,onChange:B,onFocus:j,placeholder:D,inputProps:ze,slots:{input:K.htmlInput?ye:void 0},...Ie});return c.jsxs(me,{...le,children:[S!=null&&S!==""&&c.jsx(Ce,{htmlFor:J,id:re,...we,children:S}),L?c.jsx(_e,{"aria-describedby":Q,id:J,labelId:re,value:R,input:yt,...Bt,children:s}):yt,m&&c.jsx(Ne,{id:Q,...nt,children:m})]})}),po={postgres:[{label:"Host",name:"host",type:"text",required:!1},{label:"Port",name:"port",type:"number",required:!1},{label:"Database Name",name:"databaseName",type:"text",required:!1},{label:"User Name",name:"userName",type:"text",required:!1},{label:"Password",name:"password",type:"password",required:!1},{label:"Connection String",name:"connectionString",type:"text",required:!1}],bigquery:[{label:"Project ID",name:"defaultProjectId",type:"text",required:!1},{label:"Billing Project ID",name:"billingProjectId",type:"text",required:!1},{label:"Location",name:"location",type:"text",required:!1},{label:"Service Account Key JSON",name:"serviceAccountKeyJson",type:"text",required:!0},{label:"Maximum Bytes Billed",name:"maximumBytesBilled",type:"text",required:!1},{label:"Query Timeout Milliseconds",name:"queryTimeoutMilliseconds",type:"text",required:!1}],snowflake:[{label:"Account",name:"account",type:"text",required:!0},{label:"Username",name:"username",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!1},{label:"Role",name:"role",type:"text",required:!1},{label:"Warehouse",name:"warehouse",type:"text",required:!0},{label:"Database",name:"database",type:"text",required:!1},{label:"Schema",name:"schema",type:"text",required:!1},{label:"Response Timeout Milliseconds",name:"responseTimeoutMilliseconds",type:"text",required:!1},{label:"Private Key",name:"privateKey",type:"password",required:!1},{label:"Private Key Passphrase",name:"privateKeyPass",type:"password",required:!1}],trino:[{label:"Server",name:"server",type:"text",required:!0},{label:"Port",name:"port",type:"number",required:!1},{label:"Catalog",name:"catalog",type:"text",required:!1},{label:"Schema",name:"schema",type:"text",required:!1},{label:"User",name:"user",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!1},{label:"Peaka Key",name:"peakaKey",type:"password",required:!1}],databricks:[{label:"Host",name:"host",type:"text",required:!0},{label:"HTTP Path",name:"path",type:"text",required:!0},{label:"Access Token",name:"token",type:"password",required:!1},{label:"OAuth Client ID",name:"oauthClientId",type:"text",required:!1},{label:"OAuth Client Secret",name:"oauthClientSecret",type:"password",required:!1},{label:"Default Catalog",name:"defaultCatalog",type:"text",required:!1},{label:"Default Schema",name:"defaultSchema",type:"text",required:!1}],mysql:[{label:"Host",name:"host",type:"text",required:!0},{label:"Port",name:"port",type:"number",required:!0},{label:"User",name:"user",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!0},{label:"Database",name:"database",type:"text",required:!0}],duckdb:[],motherduck:[{label:"Access Token",name:"accessToken",type:"text",required:!0},{label:"Database",name:"database",type:"text",required:!1}],ducklake:[],publisher:[]},hu={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",trino:"trinoConnection",databricks:"databricksConnection",mysql:"mysqlConnection",duckdb:"duckdbConnection",motherduck:"motherduckConnection",ducklake:"ducklakeConnection",publisher:"publisherConnection"},F2=Object.values(De.ConnectionTypeEnum).filter(e=>e!==De.ConnectionTypeEnum.Publisher),Pf={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",gcs:"gcsConnection",s3:"s3Connection",azure:"azureConnection"},tl=[{label:"Access Key ID",name:"accessKeyId",type:"text",required:!0},{label:"Secret Access Key",name:"secretAccessKey",type:"password",required:!0},{label:"Region",name:"region",type:"text",required:!1},{label:"Endpoint",name:"endpoint",type:"text",required:!1},{label:"Session Token",name:"sessionToken",type:"password",required:!1}],nl=[{label:"Key ID",name:"keyId",type:"text",required:!0},{label:"Secret",name:"secret",type:"password",required:!0}],j_=[{label:"Auth Type",name:"authType",type:"text",required:!0,selectOptions:[{label:"SAS Token",value:"sas_token"},{label:"Service Principal (SPN)",value:"service_principal"}]},{label:"SAS URL (e.g. https://account.blob.core.windows.net/container/file.parquet?sp=r&st=...)",name:"sasUrl",type:"text",required:!1,visibleWhen:{field:"authType",value:"sas_token"}},{label:"Tenant ID",name:"tenantId",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Client ID",name:"clientId",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Client Secret",name:"clientSecret",type:"password",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Account Name",name:"accountName",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"File URL (e.g. abfss://container/path/file.parquet)",name:"fileUrl",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}}];function Ku(e){return e==="postgres"||e==="bigquery"||e==="snowflake"?po[e]||[]:e==="s3"?tl:e==="gcs"?nl:e==="azure"?j_:[]}function $_({onSubmit:e,isSubmitting:t}){const[n,r]=W.useState(!1),[o,i]=W.useState("postgres"),[s,a]=W.useState([]),[l,u]=W.useState("postgres"),[d,f]=W.useState("s3"),h=()=>{r(!0)},p=()=>{r(!1),a([]),i("postgres"),u("postgres"),f("s3")},m=async C=>{C.preventDefault();const v=new FormData(C.currentTarget),S=v.get("name")?.toString(),I=v.get("type")?.toString(),T=po[I];if(!S)throw new Error("Name is required");if(!I)throw new Error("Type is required");let N;if(I==="ducklake"){const O={};if(l==="postgres"){const j=po.postgres,D={};if(j.forEach(H=>{const _=v.get(`ducklake_pg_${H.name}`)?.toString();_&&(D[H.name]=_)}),Object.keys(D).length===0)throw new Error("DuckLake requires catalog connection");O.postgresConnection=D}const F=v.get("ducklake_bucketUrl")?.toString();if(!F)throw new Error("DuckLake requires a bucket URL");const B={bucketUrl:F};if(d==="s3"){const j={};if(tl.forEach(D=>{const H=v.get(`ducklake_s3_${D.name}`)?.toString();H&&(j[D.name]=H)}),!j.accessKeyId)throw new Error("S3 Access Key ID is required");if(!j.secretAccessKey)throw new Error("S3 Secret Access Key is required");Object.keys(j).length>0&&(B.s3Connection=j)}else if(d==="gcs"){const j={};if(nl.forEach(D=>{const H=v.get(`ducklake_gcs_${D.name}`)?.toString();H&&(j[D.name]=H)}),!j.keyId)throw new Error("GCS Key ID is required");if(!j.secret)throw new Error("GCS Secret is required");Object.keys(j).length>0&&(B.gcsConnection=j)}N={name:S,type:I,ducklakeConnection:{catalog:O,storage:B}}}else if(I==="duckdb"){if(s.length===0)throw new Error("DuckDB connection must have at least one attached database");const O=s.map((F,B)=>{const j=F.dbType,D=v.get(`attachedDb_${B}_name`)?.toString();if(!D)throw new Error(`Attached database at index ${B} must have a name`);const H={name:D,type:j},_=Ku(j);if(_&&_.length>0){const L={};_.forEach(K=>{const G=v.get(`attachedDb_${B}_${K.name}`)?.toString();G&&(L[K.name]=G)});const $=Pf[j];$&&(H[$]=L)}return H});N={name:S,type:I,duckdbConnection:{attachedDatabases:O}}}else{const O={};if(T.forEach(F=>{const B=v.get(F.name)?.toString();B&&(O[F.name]=B)}),I==="postgres"){if(!!!O.connectionString?.trim()){const B=["host","port","databaseName","userName","password"];for(const j of B)if(!O[j])throw new Error(`${T.find(D=>D.name===j)?.label||j} is required`)}}else if(I==="bigquery"){if(!O.serviceAccountKeyJson)throw new Error("Service Account Key JSON is required")}else if(I==="snowflake"){if(!O.account)throw new Error("Account is required");if(!O.username)throw new Error("Username is required");if(!O.warehouse)throw new Error("Warehouse is required");if(!O.password&&!O.privateKey)throw new Error("Either password or private key is required")}else if(I==="trino"){if(!O.server)throw new Error("Server is required");if(!O.user)throw new Error("User is required");if(O.server.trim().startsWith("https://")&&!O.password&&!O.peakaKey)throw new Error("Password is required for HTTPS connections (or use Peaka Key)")}else if(I==="mysql"){const F=["host","port","database","user","password"];for(const B of F)if(!O[B])throw new Error(`${T.find(j=>j.name===B)?.label||B} is required`)}else if(I==="motherduck"){if(!O.accessToken)throw new Error("Access Token is required")}else if(I==="databricks"){if(!O.host)throw new Error("Host is required");if(!O.path)throw new Error("HTTP Path is required");const F=O.oauthClientId&&O.oauthClientSecret;if(!O.token&&!F)throw new Error("Either Access Token or OAuth Client ID + Secret is required")}N={name:S,type:I,[hu[I]]:O}}await e(N),p()},b=()=>{a([...s,{name:"",dbType:"postgres"}])},y=C=>{a(s.filter((v,S)=>S!==C))},x=(C,v)=>{const S=[...s];S[C]={...S[C],dbType:v},a(S)};return c.jsxs(W.Fragment,{children:[c.jsx(tn,{variant:"outlined",onClick:h,children:"Add Connection"}),c.jsxs(no,{open:n,onClose:p,children:[c.jsx(Eo,{children:"Create New Connection"}),c.jsxs(oo,{children:[c.jsx(vl,{children:"Add a new connection to query your data database using Malloy."}),c.jsxs("form",{onSubmit:m,id:"connection-form",children:[c.jsx(Ct,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard"}),c.jsx(Ct,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:o,select:!0,onChange:C=>i(C.target.value),children:F2.map(C=>c.jsx(bn,{value:C,children:C},C))}),o==="ducklake"?c.jsxs(Qt,{sx:{mt:2},children:[c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsx(Dt,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Catalog"}),c.jsx(Ct,{margin:"dense",id:"ducklake_catalogType",label:"Catalog Type",fullWidth:!0,variant:"standard",value:l,select:!0,onChange:C=>u(C.target.value),children:c.jsx(bn,{value:"postgres",children:"PostgreSQL"})}),l==="postgres"&&c.jsx(c.Fragment,{children:po.postgres.map(C=>c.jsx(Ct,{margin:"dense",id:`ducklake_pg_${C.name}`,name:`ducklake_pg_${C.name}`,label:C.label,type:C.type,fullWidth:!0,variant:"standard"},`pg_${C.name}`))})]}),c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsx(Dt,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Storage"}),c.jsxs(Ct,{margin:"dense",id:"ducklake_storageType",label:"Storage Type",fullWidth:!0,variant:"standard",value:d,select:!0,onChange:C=>f(C.target.value),children:[c.jsx(bn,{value:"s3",children:"S3"}),c.jsx(bn,{value:"gcs",children:"GCS"})]}),c.jsx(Ct,{margin:"dense",required:!0,id:"ducklake_bucketUrl",name:"ducklake_bucketUrl",label:d==="s3"?"Bucket URL (e.g. s3://my-bucket/path)":"Bucket URL (e.g. gs://my-bucket/path)",type:"text",fullWidth:!0,variant:"standard"}),d==="s3"&&c.jsxs(c.Fragment,{children:[c.jsx(Dt,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"S3 Credentials"}),tl.map(C=>c.jsx(Ct,{margin:"dense",id:`ducklake_s3_${C.name}`,name:`ducklake_s3_${C.name}`,label:C.label,type:C.type,fullWidth:!0,variant:"standard",required:C.required,placeholder:C.name==="region"?"us-east-1":void 0},`s3_${C.name}`))]}),d==="gcs"&&c.jsxs(c.Fragment,{children:[c.jsx(Dt,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"GCS Credentials"}),nl.map(C=>c.jsx(Ct,{margin:"dense",id:`ducklake_gcs_${C.name}`,name:`ducklake_gcs_${C.name}`,label:C.label,type:C.type,fullWidth:!0,variant:"standard",required:C.required},`gcs_${C.name}`))]})]})]}):o==="duckdb"?c.jsxs(Qt,{sx:{mt:2},children:[c.jsxs(Qt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[c.jsx(Dt,{variant:"subtitle1",fontWeight:500,children:"Attached Databases"}),c.jsx(tn,{startIcon:c.jsx(fl,{}),onClick:b,size:"small",variant:"outlined",children:"Add Database"})]}),s.length===0&&c.jsx(Dt,{variant:"body2",color:"text.secondary",sx:{mb:2},children:'DuckDB connections require at least one attached database. Click "Add Database" to get started.'}),s.map((C,v)=>{const S=Ku(C.dbType);return c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsxs(Qt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[c.jsxs(Dt,{variant:"subtitle2",children:["Database ",v+1]}),c.jsx(Ir,{onClick:()=>y(v),size:"small",color:"error",children:c.jsx(k2,{fontSize:"small"})})]}),c.jsx(Ct,{margin:"dense",required:!0,id:`attachedDb_${v}_name`,name:`attachedDb_${v}_name`,label:"Database Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:C.name}),c.jsx(Ct,{margin:"dense",id:`attachedDb_${v}_type`,name:`attachedDb_${v}_type`,label:"Database Type",fullWidth:!0,variant:"standard",value:C.dbType,select:!0,onChange:I=>x(v,I.target.value),children:Object.values(De.AttachedDatabaseTypeEnum).map(I=>c.jsx(bn,{value:I,children:I},I))}),S.filter(I=>I.visibleWhen?(C[I.visibleWhen.field]||S.find(N=>N.name===I.visibleWhen?.field)?.selectOptions?.[0]?.value)===I.visibleWhen.value:!0).map(I=>c.jsx(Ct,{margin:"dense",id:`attachedDb_${v}_${I.name}`,name:`attachedDb_${v}_${I.name}`,label:I.label,type:I.selectOptions?void 0:I.type,fullWidth:!0,variant:"standard",required:I.required,select:!!I.selectOptions,defaultValue:I.selectOptions?.[0]?.value,onChange:I.selectOptions?T=>{const N=[...s];N[v]={...N[v],[I.name]:T.target.value},a(N)}:void 0,children:I.selectOptions?.map(T=>c.jsx(bn,{value:T.value,children:T.label},T.value))},I.name))]},v)})]}):po[o].map(C=>c.jsx(Ct,{margin:"dense",id:C.name,name:C.name,label:C.label,type:C.type,fullWidth:!0,variant:"standard",required:C.required},C.name))]})]}),c.jsxs(ro,{children:[c.jsx(tn,{disabled:t,onClick:p,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"connection-form",loading:t,children:"Create Connection"})]})]})]})}function H_({connection:e,onCloseDialog:t,isMutating:n,onDelete:r}){const[o,i]=W.useState(!1),[s,a]=W.useState(""),l=()=>{i(!0)},u=()=>{i(!1),t()};return c.jsxs(W.Fragment,{children:[c.jsxs(bn,{"aria-label":`Delete connection ${e?.name??""}`.trim(),onClick:d=>{d.stopPropagation(),l()},sx:{color:"error.main"},children:[c.jsx(Rp,{sx:{color:"inherit"},children:c.jsx(On.Delete,{fontSize:"small"})}),c.jsx(Np,{children:"Delete"})]}),c.jsxs(no,{onClose:u,"aria-labelledby":"customized-dialog-title",open:o,children:[c.jsx(Eo,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Connection"}),c.jsx(Ir,{"aria-label":"close",onClick:u,sx:d=>({position:"absolute",right:8,top:8,color:d.palette.grey[500]}),children:c.jsx(Fr,{})}),c.jsx(oo,{dividers:!0,children:c.jsxs(Dt,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),c.jsx(ro,{children:c.jsx(tn,{loading:n,variant:"contained",autoFocus:!0,onClick:()=>r(),color:"error",children:"Delete"})}),c.jsx(w.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})]})}function i1(e){const t=e.duckdbConnection?.attachedDatabases;return!t||t.length===0?[]:t.map(n=>({name:n.name||"",dbType:n.type||"postgres"}))}function s1(e){const t=e.ducklakeConnection;return t&&t.storage?.gcsConnection?"gcs":"s3"}function z_({connection:e,onSubmit:t,isSubmitting:n,onCloseDialog:r}){const[o,i]=W.useState(!1),[s,a]=W.useState(e.type),[l,u]=W.useState(()=>i1(e)),[d,f]=W.useState("postgres"),[h,p]=W.useState(()=>s1(e)),m=()=>{u(i1(e)),a(e.type),f("postgres"),p(s1(e)),i(!0)},b=()=>{i(!1),r?.()},y=async T=>{T.preventDefault();const N=new FormData(T.currentTarget),O=N.get("name")?.toString(),F=N.get("type")?.toString(),B=po[F];if(!O)throw new Error("Name is required");if(!F)throw new Error("Type is required");let j;if(F==="ducklake"){const D={};if(d==="postgres"){const L=po.postgres,$={};if(L.forEach(K=>{const G=N.get(`ducklake_pg_${K.name}`)?.toString();G&&($[K.name]=G)}),Object.keys($).length===0)throw new Error("DuckLake requires catalog connection");D.postgresConnection=$}const H=N.get("ducklake_bucketUrl")?.toString();if(!H)throw new Error("DuckLake requires a bucket URL");const _={bucketUrl:H};if(h==="s3"){const L={};tl.forEach(K=>{const G=N.get(`ducklake_s3_${K.name}`)?.toString();G&&(L[K.name]=G)});const $=e.ducklakeConnection?.storage?.s3Connection;if($&&(!L.accessKeyId&&$.accessKeyId&&(L.accessKeyId=$.accessKeyId),!L.secretAccessKey&&$.secretAccessKey&&(L.secretAccessKey=$.secretAccessKey)),!L.accessKeyId)throw new Error("S3 Access Key ID is required");if(!L.secretAccessKey)throw new Error("S3 Secret Access Key is required");Object.keys(L).length>0&&(_.s3Connection=L)}else if(h==="gcs"){const L={};nl.forEach(K=>{const G=N.get(`ducklake_gcs_${K.name}`)?.toString();G&&(L[K.name]=G)});const $=e.ducklakeConnection?.storage?.gcsConnection;if($&&(!L.keyId&&$.keyId&&(L.keyId=$.keyId),!L.secret&&$.secret&&(L.secret=$.secret)),!L.keyId)throw new Error("GCS Key ID is required");if(!L.secret)throw new Error("GCS Secret is required");Object.keys(L).length>0&&(_.gcsConnection=L)}j={name:O,type:F,ducklakeConnection:{catalog:D,storage:_}}}else if(F==="duckdb"){if(l.length===0)throw new Error("DuckDB connection must have at least one attached database");const D=l.map((H,_)=>{const L=H.dbType,$=N.get(`attachedDb_${_}_name`)?.toString();if(!$)throw new Error(`Attached database at index ${_} must have a name`);const K={name:$,type:L},G=Ku(L);if(G&&G.length>0){const q={};G.forEach(oe=>{const se=N.get(`attachedDb_${_}_${oe.name}`)?.toString();se&&(q[oe.name]=se)});const R=Pf[L];R&&(K[R]=q)}return K});j={name:O,type:F,duckdbConnection:{attachedDatabases:D}}}else{const D=e[hu[F]]||{},H={};if(B.forEach(_=>{const L=N.get(_.name)?.toString(),$=D[_.name],K=_.type==="password"||_.name==="password"||_.name==="secretAccessKey"||_.name==="secret"||_.name==="accessToken"||_.name==="privateKey";L?H[_.name]=L:K&&$?H[_.name]=$:L!==void 0?H[_.name]=L:$&&(H[_.name]=$)}),F==="postgres"){if(!!!H.connectionString?.trim()){const L=["host","port","databaseName","userName","password"];for(const $ of L)if(!H[$])throw new Error(`${B.find(K=>K.name===$)?.label||$} is required`)}}else if(F==="bigquery"){if(!H.serviceAccountKeyJson)throw new Error("Service Account Key JSON is required")}else if(F==="snowflake"){if(!H.account)throw new Error("Account is required");if(!H.username)throw new Error("Username is required");if(!H.warehouse)throw new Error("Warehouse is required");if(!H.password&&!H.privateKey)throw new Error("Either password or private key is required")}else if(F==="trino"){if(!H.server)throw new Error("Server is required");if(!H.user)throw new Error("User is required");if(H.server.trim().startsWith("https://")&&!H.password&&!H.peakaKey)throw new Error("Password is required for HTTPS connections (or use Peaka Key)")}else if(F==="mysql"){const _=["host","port","database","user","password"];for(const L of _)if(!H[L])throw new Error(`${B.find($=>$.name===L)?.label||L} is required`)}else if(F==="motherduck"){if(!H.accessToken)throw new Error("Access Token is required")}else if(F==="databricks"){if(!H.host)throw new Error("Host is required");if(!H.path)throw new Error("HTTP Path is required");const _=H.oauthClientId&&H.oauthClientSecret;if(!H.token&&!_)throw new Error("Either Access Token or OAuth Client ID + Secret is required")}j={name:O,type:F,[hu[F]]:H}}await t(j),b()},x=()=>{u([...l,{name:"",dbType:"postgres"}])},C=T=>{u(l.filter((N,O)=>O!==T))},v=(T,N)=>{const O=[...l];O[T]={...O[T],dbType:N},u(O)},S=(T,N)=>{const O=e.duckdbConnection?.attachedDatabases;if(!O||!O[T])return"";const F=O[T],B=Pf[F.type||""];return B&&F[B]?F[B][N]??"":""},I=T=>{const N=e.ducklakeConnection;if(!N)return"";if(T.startsWith("pg_")){const O=T.replace("pg_","");return N.catalog?.postgresConnection?.[O]??""}if(T==="bucketUrl")return N.storage?.bucketUrl??"";if(T.startsWith("s3_")){const O=T.replace("s3_","");return N.storage?.s3Connection?.[O]??""}if(T.startsWith("gcs_")){const O=T.replace("gcs_","");return N.storage?.gcsConnection?.[O]??""}return""};return c.jsxs(W.Fragment,{children:[c.jsxs(bn,{"aria-label":`Edit connection ${e?.name??""}`.trim(),onClick:T=>{T.preventDefault(),T.stopPropagation(),m()},children:[c.jsx(Rp,{children:c.jsx(On.Edit,{fontSize:"small"})}),c.jsx(Np,{children:"Edit"})]}),c.jsxs(no,{open:o,onClose:b,children:[c.jsx(Eo,{onClick:T=>{T.stopPropagation()},children:"Edit Connection"}),c.jsxs(oo,{onClick:T=>{T.stopPropagation()},children:[c.jsx(vl,{children:"Edit a connection to query your data database using Malloy."}),c.jsxs("form",{onSubmit:y,id:"connection-form",children:[c.jsx(Ct,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),c.jsx(Ct,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:s,select:!0,onChange:T=>a(T.target.value),children:F2.map(T=>c.jsx(bn,{value:T,children:T},T))}),s==="ducklake"?c.jsxs(Qt,{sx:{mt:2},children:[c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsx(Dt,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Catalog"}),c.jsx(Ct,{margin:"dense",id:"ducklake_catalogType",label:"Catalog Type",fullWidth:!0,variant:"standard",value:d,select:!0,onChange:T=>f(T.target.value),children:c.jsx(bn,{value:"postgres",children:"PostgreSQL"})}),d==="postgres"&&c.jsx(c.Fragment,{children:po.postgres.map(T=>c.jsx(Ct,{margin:"dense",id:`ducklake_pg_${T.name}`,name:`ducklake_pg_${T.name}`,label:T.label,type:T.type,fullWidth:!0,variant:"standard",defaultValue:I(`pg_${T.name}`)},`pg_${T.name}`))})]}),c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsx(Dt,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Storage"}),c.jsxs(Ct,{margin:"dense",id:"ducklake_storageType",label:"Storage Type",fullWidth:!0,variant:"standard",value:h,select:!0,onChange:T=>p(T.target.value),children:[c.jsx(bn,{value:"s3",children:"S3"}),c.jsx(bn,{value:"gcs",children:"GCS"})]}),c.jsx(Ct,{margin:"dense",required:!0,id:"ducklake_bucketUrl",name:"ducklake_bucketUrl",label:h==="s3"?"Bucket URL (e.g. s3://my-bucket/path)":"Bucket URL (e.g. gs://my-bucket/path)",type:"text",fullWidth:!0,variant:"standard",defaultValue:I("bucketUrl")}),h==="s3"&&c.jsxs(c.Fragment,{children:[c.jsx(Dt,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"S3 Credentials"}),tl.map(T=>c.jsx(Ct,{margin:"dense",id:`ducklake_s3_${T.name}`,name:`ducklake_s3_${T.name}`,label:T.label,type:T.type,fullWidth:!0,variant:"standard",required:T.required&&T.name!=="secretAccessKey",defaultValue:I(`s3_${T.name}`),placeholder:T.name==="region"?"us-east-1":T.name==="secretAccessKey"?"Leave empty to keep existing":void 0},`s3_${T.name}`))]}),h==="gcs"&&c.jsxs(c.Fragment,{children:[c.jsx(Dt,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"GCS Credentials"}),nl.map(T=>c.jsx(Ct,{margin:"dense",id:`ducklake_gcs_${T.name}`,name:`ducklake_gcs_${T.name}`,label:T.label,type:T.type,fullWidth:!0,variant:"standard",required:T.required&&T.name!=="secret",defaultValue:I(`gcs_${T.name}`),placeholder:T.name==="secret"?"Leave empty to keep existing":void 0},`gcs_${T.name}`))]})]})]}):s==="duckdb"?c.jsxs(Qt,{sx:{mt:2},children:[c.jsxs(Qt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[c.jsx(Dt,{variant:"subtitle1",fontWeight:500,children:"Attached Databases"}),c.jsx(tn,{startIcon:c.jsx(fl,{}),onClick:x,size:"small",variant:"outlined",children:"Add Database"})]}),l.length===0&&c.jsx(Dt,{variant:"body2",color:"text.secondary",sx:{mb:2},children:'DuckDB connections require at least one attached database. Click "Add Database" to get started.'}),l.map((T,N)=>{const O=Ku(T.dbType);return c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsxs(Qt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[c.jsxs(Dt,{variant:"subtitle2",children:["Database ",N+1]}),c.jsx(Ir,{"aria-label":`Remove attached database ${N+1}`,onClick:()=>C(N),size:"small",color:"error",children:c.jsx(k2,{fontSize:"small"})})]}),c.jsx(Ct,{margin:"dense",required:!0,id:`attachedDb_${N}_name`,name:`attachedDb_${N}_name`,label:"Database Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:T.name}),c.jsx(Ct,{margin:"dense",id:`attachedDb_${N}_type`,name:`attachedDb_${N}_type`,label:"Database Type",fullWidth:!0,variant:"standard",value:T.dbType,select:!0,onChange:F=>v(N,F.target.value),children:Object.values(De.AttachedDatabaseTypeEnum).map(F=>c.jsx(bn,{value:F,children:F},F))}),O.filter(F=>F.visibleWhen?(T[F.visibleWhen.field]||S(N,F.visibleWhen.field)||O.find(j=>j.name===F.visibleWhen?.field)?.selectOptions?.[0]?.value)===F.visibleWhen.value:!0).map(F=>c.jsx(Ct,{margin:"dense",id:`attachedDb_${N}_${F.name}`,name:`attachedDb_${N}_${F.name}`,label:F.label,type:F.selectOptions?void 0:F.type,fullWidth:!0,variant:"standard",required:F.required,select:!!F.selectOptions,defaultValue:S(N,F.name)||F.selectOptions?.[0]?.value,onChange:F.selectOptions?B=>{const j=[...l];j[N]={...j[N],[F.name]:B.target.value},u(j)}:void 0,children:F.selectOptions?.map(B=>c.jsx(bn,{value:B.value,children:B.label},B.value))},F.name))]},N)})]}):po[s].map(T=>{const N=e?.[hu[s]??""]?.[T.name??""]??"",O=T.type==="password"||T.name==="password"||T.name==="secretAccessKey"||T.name==="secret"||T.name==="accessToken"||T.name==="privateKey";return c.jsx(Ct,{margin:"dense",id:T.name,name:T.name,label:T.label,type:T.type,fullWidth:!0,variant:"standard",required:T.required&&!O&&!N,defaultValue:N,placeholder:O&&N?"Leave empty to keep existing":void 0},T.name)})]})]}),c.jsxs(ro,{onClick:T=>{T.stopPropagation()},children:[c.jsx(tn,{disabled:n,onClick:b,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"connection-form",loading:n,children:"Edit Connection"})]})]})]})}function a1(e,t){return!e||e.type!=="duckdb"?!1:(e.duckdbConnection?.attachedDatabases||[]).some(r=>r.type==="azure"&&r.name===t)}function U_(e){return e.startsWith("gs://")||e.startsWith("s3://")||e.startsWith("https://")||e.startsWith("abfss://")||e.startsWith("az://")}function L2({connectionName:e,resourceUri:t,schema:n,connection:r}){const{apiClients:o}=De.useServer(),{environmentName:i}=Ht(t),[s,a]=W.useState(null),[l,u]=W.useState(n||null),[d,f]=W.useState(!1),{data:h,isError:p,isLoading:m,error:b}=Xt({queryKey:["schemas",i,e],queryFn:()=>o.connections.listSchemas(i,e)}),y=h?.data||[];return c.jsxs(w.Grid,{container:!0,spacing:1,children:[!n&&c.jsx(w.Grid,{size:{xs:12,md:4},children:c.jsxs(w.Paper,{sx:{p:1,m:0},children:[c.jsxs(w.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:0},children:[c.jsx(w.Typography,{variant:"overline",fontWeight:"bold",children:"Table Paths"}),c.jsx(w.FormControlLabel,{control:c.jsx(w.Switch,{checked:d,onChange:x=>f(x.target.checked)}),label:"Hidden Schemas"})]}),c.jsx(w.Divider,{sx:{mt:"2px"}}),c.jsxs(w.Box,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[m&&c.jsx(Sn,{text:"Loading schemas..."}),p&&c.jsx(kn,{error:b,context:`${i} > ${e} > Schemas`}),!m&&!p&&y.length===0&&c.jsx(w.Typography,{variant:"body2",children:"No Schemas"}),!m&&!p&&y.length>0&&c.jsx(w.List,{dense:!0,disablePadding:!0,children:y.map(x=>{const C=x.name;if(x.isHidden&&!d)return null;const S=l===C;return c.jsx(w.ListItemButton,{selected:S,onClick:()=>{u(C),a(null)},children:c.jsx(w.ListItemText,{primary:C})},C)})})]})]})}),c.jsx(w.Grid,{size:{xs:12,md:n?6:4},children:l&&c.jsx(w.Paper,{sx:{p:1,m:0},children:c.jsx(q_,{connectionName:e,schemaName:l,onTableSelect:x=>{a(x)},resourceUri:t,connection:r})})}),c.jsx(w.Grid,{size:{xs:12,md:n?6:4},children:l&&s&&c.jsx(V_,{environmentName:i,connectionName:e,schemaName:l,tableResource:s})})]})}function V_({environmentName:e,connectionName:t,schemaName:n,tableResource:r}){const{apiClients:o}=De.useServer(),{data:i,isLoading:s,isError:a,error:l}=Xt({queryKey:["connectionTableDetail",e,t,n,r],queryFn:()=>o.connections.getTable(e,t,n,r),enabled:!!n&&!!r}),u={resource:i?.data?.resource??r,columns:i?.data?.columns??[]};return c.jsxs(w.Paper,{sx:{p:1,m:0},children:[a&&c.jsx(kn,{error:l,context:`${e} > ${t} > ${n} > ${r}`}),!a&&c.jsx(W_,{table:u,loading:s})]})}function W_({table:e,loading:t}){return t?c.jsx(Sn,{text:"Loading columns..."}):c.jsxs(c.Fragment,{children:[c.jsxs(w.Typography,{variant:"overline",fontWeight:"bold",sx:{display:"block",wordBreak:"break-all"},children:[e.resource.includes("://")||/\.(parquet|csv|json|tsv|ndjson)$/i.test(e.resource)?"File":"Table",": ",e.resource]}),c.jsx(w.Divider,{}),c.jsx(w.Box,{sx:{mt:"10px",maxHeight:"600px",overflowY:"auto"},children:c.jsx(w.TableContainer,{children:c.jsxs(w.Table,{size:"small",sx:{"& .MuiTableCell-root":{padding:"10px"}},children:[c.jsx(w.TableHead,{children:c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{children:"NAME"}),c.jsx(w.TableCell,{children:"TYPE"})]})}),c.jsx(w.TableBody,{children:e.columns?.sort((n,r)=>n.name.localeCompare(r.name))?.map(n=>c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{children:n.name}),c.jsx(w.TableCell,{children:n.type})]},n.name))})]})})})]})}function q_({connectionName:e,schemaName:t,onTableSelect:n,resourceUri:r,connection:o}){const{environmentName:i}=Ht(r),{apiClients:s}=De.useServer(),[a,l]=W.useState(""),{data:u,isSuccess:d,isError:f,error:h,isLoading:p}=Xt({queryKey:["tablesInSchema",i,e,t],queryFn:()=>s.connections.listTables(i,e,t)}),m=a1(o,t),b=x=>m?x:x.split(".").pop()||x,y=d&&u?.data?u.data.filter(x=>b(x.resource).toLowerCase().includes(a.toLowerCase())).sort((x,C)=>b(x.resource).localeCompare(b(C.resource))):[];return c.jsxs(c.Fragment,{children:[c.jsx(w.Typography,{variant:"overline",fontWeight:"bold",children:U_(t)||a1(o,t)?`Files in ${t}`:`Tables in ${t}`}),c.jsx(w.Divider,{}),c.jsx(w.Box,{sx:{mt:1,mb:1},children:c.jsx(w.TextField,{size:"small",fullWidth:!0,placeholder:"Search tables...",value:a,onChange:x=>l(x.target.value),variant:"outlined"})}),c.jsx(w.Divider,{}),c.jsxs(w.Box,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[p&&c.jsx(Sn,{text:"Fetching Tables..."}),f&&c.jsx(kn,{error:h,context:`${i} > ${e} > ${t}`}),d&&y.length===0&&c.jsx(w.Typography,{variant:"body2",children:"No Tables"}),d&&u?.data&&u.data.length>0&&c.jsx(w.List,{dense:!0,disablePadding:!0,children:y.map(x=>{let C=b(x.resource);return!m&&x.resource.includes("://")&&(C=x.resource.split("/").pop()||x.resource),c.jsx(w.ListItemButton,{onClick:()=>n(x.resource),children:c.jsx(w.ListItemText,{primary:C,secondary:x.columns.length>0?`${x.columns.length} columns`:void 0})},x.resource)})})]})]})}const Y_={bigquery:"BigQuery",snowflake:"Snowflake",postgres:"PostgreSQL",mysql:"MySQL",trino:"Trino",databricks:"Databricks",duckdb:"DuckDB",ducklake:"DuckLake",s3:"S3",gcs:"GCS",azure:"Azure"};function K_(e){return e?Y_[e]??e:""}function G_({resourceUri:e}){const{apiClients:t,mutable:n}=De.useServer(),r=Lr.useQueryClient(),{environmentName:o}=Ht(e),[i,s]=W.useState(""),[a,l]=W.useState(null),u=Cl({environmentName:o,connectionName:a}),{data:d,isSuccess:f,isError:h,error:p}=Xt({queryKey:["connections",o],queryFn:()=>t.connections.listConnections(o)}),m=()=>{l(null)},b=vn({mutationFn:S=>t.environments.updateEnvironment(o,{name:o,connections:[...d.data,S]}),onSuccess(){s("Connection added successfully"),r.invalidateQueries({queryKey:["connections",o]})},onError(S){s(S.message)}}),y=vn({mutationFn:S=>t.environments.updateEnvironment(o,{name:o,connections:d.data.map(I=>I.name===S.name?S:I)}),onSuccess(S,I){s(`Connection ${I.name} updated successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(S){s(S.message)}}),x=vn({mutationFn:S=>t.environments.updateEnvironment(o,{name:o,connections:d.data.filter(I=>I.name!==S.name)}),onSuccess(S,I){s(`Connection ${I.name} deleted successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(S){s(S.message)}}),C=f?[...d.data].sort((S,I)=>(S.name??"").localeCompare(I.name??"")):[],v=b.isPending||y.isPending||x.isPending;return c.jsxs(w.Box,{children:[c.jsxs(w.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",mb:3},children:[c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Connections"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Database connections available to packages in this environment"})]}),n&&f&&c.jsx($_,{onSubmit:S=>b.mutateAsync(S),isSubmitting:b.isPending})]}),!f&&!h&&c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Fetching Connections..."}),h&&c.jsx(kn,{error:p,context:`${o} > Connections`}),f&&C.length===0&&c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"No connections yet."}),f&&C.length>0&&c.jsx(w.Grid,{container:!0,spacing:2,children:C.map(S=>c.jsx(w.Grid,{size:{xs:12,sm:6,md:4},children:c.jsx(Q_,{connection:S,mutable:n,isMutating:v,onOpenExplorer:()=>l(S.name??null),onEdit:I=>y.mutateAsync(I),onDelete:I=>{S.resource?s("Cannot delete this connection"):x.mutateAsync(I)}})},S.name))}),c.jsx(w.Snackbar,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i}),c.jsxs(w.Dialog,{open:a!==null,onClose:m,maxWidth:"lg",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{children:["Connection Explorer: ",a,c.jsx(w.IconButton,{"aria-label":"close",onClick:m,sx:{position:"absolute",right:8,top:8},children:c.jsx(w.Box,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),c.jsx(w.DialogContent,{children:a&&c.jsx(L2,{resourceUri:u,connectionName:a,connection:d?.data?.find(S=>S.name===a)})})]})]})}function Q_({connection:e,mutable:t,isMutating:n,onOpenExplorer:r,onEdit:o,onDelete:i}){const[s,a]=W.useState(null),l=!!s,u=f=>{f.stopPropagation(),a(f.currentTarget)},d=()=>{a(null)};return c.jsx(w.Card,{variant:"outlined",onClick:r,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:c.jsx(w.CardContent,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:c.jsxs(w.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[c.jsx(w.Box,{sx:{width:36,height:36,borderRadius:1.5,bgcolor:"warning.light",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"warning.main"},children:c.jsx(yL,{sx:{fontSize:20}})}),c.jsxs(w.Box,{sx:{flex:1,minWidth:0},children:[c.jsx(w.Typography,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",noWrap:!0,children:K_(e.type)})]}),t&&c.jsxs(c.Fragment,{children:[c.jsx(w.IconButton,{size:"small",onClick:u,"aria-label":`Connection actions for ${e.name??""}`.trim(),sx:{flexShrink:0,mt:-.5,mr:-.5},children:c.jsx(On.MoreVert,{fontSize:"small"})}),c.jsxs(w.Menu,{anchorEl:s,open:l,onClose:d,onClick:f=>f.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(z_,{connection:e,onSubmit:o,isSubmitting:n,onCloseDialog:d}),c.jsx(H_,{connection:e,onCloseDialog:d,isMutating:n,onDelete:()=>i(e)})]})]})]})})})}const X_=mt([c.jsx("path",{d:"M20 2H4c-1 0-2 .9-2 2v3.01c0 .72.43 1.34 1 1.69V20c0 1.1 1.1 2 2 2h14c.9 0 2-.9 2-2V8.7c.57-.35 1-.97 1-1.69V4c0-1.1-1-2-2-2m-1 18H5V9h14zm1-13H4V4h16z"},"0"),c.jsx("path",{d:"M9 12h6v2H9z"},"1")]);function Z_({resourceUri:e,onCloseDialog:t}){const[n,r]=W.useState(!1),{apiClients:o}=De.useServer(),i=Lr.useQueryClient(),[s,a]=W.useState(""),l=()=>{r(!0)},u=()=>{r(!1),t()},{environmentName:d,packageName:f}=Ht(e),h=vn({mutationFn:()=>o.packages.deletePackage(d,f),onSuccess(){u(),i.invalidateQueries({queryKey:["packages"]}),a("Package deleted successfully")},onError(p){a(p instanceof Error?p.message:"An unknown error occurred")}});return c.jsxs(W.Fragment,{children:[c.jsxs(w.MenuItem,{onClick:l,children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Delete,{fontSize:"small"})}),c.jsx(w.ListItemText,{children:"Delete"})]}),c.jsxs(no,{onClose:u,"aria-labelledby":"customized-dialog-title",open:n,children:[c.jsx(Eo,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Package"}),c.jsx(Ir,{"aria-label":"close",onClick:u,sx:p=>({position:"absolute",right:8,top:8,color:p.palette.grey[500]}),children:c.jsx(Fr,{})}),c.jsx(oo,{dividers:!0,children:c.jsxs(Dt,{gutterBottom:!0,children:['Are you sure you want to delete "',f,'"? This action cannot be undone.']})}),c.jsxs(ro,{children:[c.jsx(tn,{variant:"outlined",onClick:u,style:{borderColor:De.MALLOY_BRAND.teal,color:De.MALLOY_BRAND.teal},children:"Cancel"}),c.jsx(tn,{variant:"contained",autoFocus:!0,onClick:()=>h.mutate(),color:"error",loading:h.isPending,children:"Delete"})]}),c.jsx(w.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})]})}function J_({package:e,resourceUri:t,onCloseDialog:n}){const[r,o]=W.useState(!1),{apiClients:i}=De.useServer(),s=Lr.useQueryClient(),[a,l]=W.useState(""),u=()=>{o(!0)},d=()=>{o(!1),n()},{packageName:f,environmentName:h}=Ht(t),p=vn({async mutationFn(b){return i.packages.updatePackage(h,f,{name:f,description:b.description})},onSuccess(){d(),l("Package updated successfully"),s.invalidateQueries({queryKey:["packages",h]})},onError(b){l(b instanceof Error?b.message:"An unknown error occurred")}}),m=b=>{b.preventDefault();const x=new FormData(b.currentTarget).get("description")?.toString();p.mutate({description:x})};return c.jsxs(W.Fragment,{children:[c.jsxs(w.MenuItem,{onClick:u,children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Edit,{fontSize:"small"})}),c.jsx(w.ListItemText,{children:"Edit"})]}),c.jsxs(no,{open:r,onClose:d,children:[c.jsx(Eo,{children:"Edit Package"}),c.jsxs(oo,{children:[c.jsxs(vl,{children:['Update the details for "',e.name,'".']}),c.jsxs("form",{onSubmit:m,id:"package-form",children:[c.jsx(Ct,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Package Name",disabled:!0,type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),c.jsx(Ct,{id:"description",name:"description",label:"Description",multiline:!0,fullWidth:!0,rows:4,defaultValue:e.description,variant:"standard"})]})]}),c.jsxs(ro,{children:[c.jsx(tn,{disabled:p.isPending,onClick:d,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"package-form",loading:p.isPending,children:"Save Changes"})]})]}),c.jsx(w.Snackbar,{open:a!=="",autoHideDuration:6e3,onClose:()=>l(""),message:a})]})}function _2({onSelectPackage:e,resourceUri:t}){const{apiClients:n}=De.useServer(),{environmentName:r}=Ht(t),{data:o,isSuccess:i,isError:s,error:a}=Xt({queryKey:["packages",r],queryFn:()=>n.packages.listPackages(r)});if(s)return c.jsx(kn,{error:a,context:`${r} > Packages`});if(!i)return c.jsx(Sn,{text:"Fetching Packages..."});const l=[...o.data].sort((u,d)=>u.name.localeCompare(d.name));return c.jsx(w.Grid,{container:!0,spacing:2,children:l.map(u=>{const d=Cl({environmentName:r,packageName:u.name});return c.jsx(w.Grid,{size:{xs:12,sm:6,md:4},children:c.jsx(e7,{pkg:u,packageResourceUri:d,onSelectPackage:e})},u.name)})})}function e7({pkg:e,packageResourceUri:t,onSelectPackage:n}){const{mutable:r}=De.useServer(),[o,i]=W.useState(null),s=!!o,a=f=>{n(e.name,f)},l=f=>{f.stopPropagation(),i(f.currentTarget)},u=()=>{i(null)},d=e.description??"";return c.jsx(w.Card,{variant:"outlined",onClick:a,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:c.jsx(w.CardContent,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:c.jsxs(w.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[c.jsx(w.Box,{sx:f=>({width:36,height:36,borderRadius:1.5,bgcolor:f.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"text.primary"}),children:c.jsx(X_,{sx:{fontSize:20}})}),c.jsxs(w.Box,{sx:{flex:1,minWidth:0},children:[c.jsx(w.Typography,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),c.jsx(w.Tooltip,{title:d,followCursor:!0,enterDelay:1e3,children:c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.5},children:d})})]}),r&&c.jsxs(c.Fragment,{children:[c.jsx(w.IconButton,{size:"small",onClick:l,"aria-label":`Package actions for ${e.name}`,sx:{flexShrink:0,mt:-.5,mr:-.5},children:c.jsx(On.MoreVert,{fontSize:"small"})}),c.jsxs(w.Menu,{anchorEl:o,open:s,onClose:u,onClick:f=>f.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(J_,{package:e,resourceUri:t,onCloseDialog:u}),c.jsx(Z_,{resourceUri:t,onCloseDialog:u})]})]})]})})})}function t7({onSelectPackage:e,resourceUri:t}){const{mutable:n}=De.useServer(),{environmentName:r}=Ht(t);return W.useEffect(()=>{window.scrollTo({top:0,behavior:"auto"})},[]),c.jsxs(w.Container,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:4,py:3},children:[c.jsxs(w.Box,{sx:{mb:5},children:[c.jsx(w.Typography,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:r}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Manage packages and database connections in this environment. Open a package to explore its models and notebooks."})]}),c.jsxs(w.Box,{sx:{mb:5},children:[c.jsxs(w.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:3},children:[c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Packages"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Published packages available for use in this environment"})]}),n&&c.jsx(bL,{resourceUri:t})]}),c.jsx(_2,{onSelectPackage:e,resourceUri:t})]}),c.jsx(w.Box,{sx:{mb:5},children:c.jsx(G_,{resourceUri:t})}),c.jsx(w.Box,{sx:{mb:5},children:c.jsx(T2,{resourceUri:t,onClickPackageFile:e})}),c.jsx(gL,{resourceUri:t})]})}const n7=e=>{const t=M.useRef({});return M.useEffect(()=>{t.current=e}),t.current};function l1({array1:e,array2:t,parser:n=r=>r}){return e&&t&&e.length===t.length&&e.every((r,o)=>n(r)===n(t[o]))}function u1(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function r7(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:o="any",stringify:i,trim:s=!1}=e;return(a,{inputValue:l,getOptionLabel:u})=>{let d=s?l.trim():l;n&&(d=d.toLowerCase()),t&&(d=u1(d));const f=d?a.filter(h=>{let p=(i||u)(h);return n&&(p=p.toLowerCase()),t&&(p=u1(p)),o==="start"?p.startsWith(d):p.includes(d)}):a;return typeof r=="number"?f.slice(0,r):f}}const o7=r7(),c1=5,i7=e=>e.current!==null&&e.current.parentElement?.contains(document.activeElement),s7=[];function d1(e,t,n,r){if(t||e==null||r)return"";const o=n(e);return typeof o=="string"?o:""}function a7(e){const{unstable_isActiveElementInListbox:t=i7,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:o=!1,autoSelect:i=!1,blurOnSelect:s=!1,clearOnBlur:a=!e.freeSolo,clearOnEscape:l=!1,componentName:u="useAutocomplete",defaultValue:d=e.multiple?s7:null,disableClearable:f=!1,disableCloseOnSelect:h=!1,disabled:p,disabledItemsFocusable:m=!1,disableListWrap:b=!1,filterOptions:y=o7,filterSelectedOptions:x=!1,freeSolo:C=!1,getOptionDisabled:v,getOptionKey:S,getOptionLabel:I=ke=>ke.label??ke,groupBy:T,handleHomeEndKeys:N=!e.freeSolo,id:O,includeInputInList:F=!1,inputValue:B,isOptionEqualToValue:j=(ke,Te)=>ke===Te,multiple:D=!1,onChange:H,onClose:_,onHighlightChange:L,onInputChange:$,onOpen:K,open:G,openOnFocus:q=!1,options:R,readOnly:oe=!1,renderValue:se,selectOnFocus:z=!e.freeSolo,value:pe}=e,J=_r(O);let Q=I;Q=ke=>{const Te=I(ke);return typeof Te!="string"?String(Te):Te};const re=M.useRef(!1),ne=M.useRef(!0),ae=M.useRef(null),ie=M.useRef(null),[Z,me]=M.useState(null),[le,ue]=M.useState(-1),Ie=o?0:-1,Ce=M.useRef(Ie),we=M.useRef(d1(d??pe,D,Q)).current,[ye,ze]=or({controlled:pe,default:d,name:u}),[Ne,nt]=or({controlled:B,default:we,name:u,state:"inputValue"}),[_e,Bt]=M.useState(!1),yt=M.useCallback((ke,Te,Ye)=>{if(!(D?ye.length<Te.length:Te!==null)&&!a)return;const je=d1(Te,D,Q,se);Ne!==je&&(nt(je),$&&$(ke,je,Ye))},[Q,Ne,D,$,nt,a,ye,se]),[ot,xe]=or({controlled:G,default:!1,name:u,state:"open"}),[Pe,qe]=M.useState(!0),Je=!D&&ye!=null&&Ne===Q(ye),Xe=ot&&!oe,Re=Xe?y(R.filter(ke=>!(x&&(D?ye:[ye]).some(Te=>Te!==null&&j(ke,Te)))),{inputValue:Je&&Pe?"":Ne,getOptionLabel:Q}):[],ct=n7({filteredOptions:Re,value:ye,inputValue:Ne});M.useEffect(()=>{const ke=ye!==ct.value;_e&&!ke||C&&!ke||yt(null,ye,"reset")},[ye,yt,_e,ct.value,C]);const lt=ot&&Re.length>0&&!oe,Mt=Ve(ke=>{if(ke===-1)ae.current.focus();else{const Te=se?"data-item-index":"data-tag-index";Z.querySelector(`[${Te}="${ke}"]`).focus()}});M.useEffect(()=>{D&&le>ye.length-1&&(ue(-1),Mt(-1))},[ye,D,le,Mt]);function be(ke,Te){if(!ie.current||ke<0||ke>=Re.length)return-1;let Ye=ke;for(;;){const rt=ie.current.querySelector(`[data-option-index="${Ye}"]`),je=m?!1:!rt||rt.disabled||rt.getAttribute("aria-disabled")==="true";if(rt&&rt.hasAttribute("tabindex")&&!je)return Ye;if(Te==="next"?Ye=(Ye+1)%Re.length:Ye=(Ye-1+Re.length)%Re.length,Ye===ke)return-1}}const Ae=Ve(({event:ke,index:Te,reason:Ye})=>{if(Ce.current=Te,Te===-1?ae.current.removeAttribute("aria-activedescendant"):ae.current.setAttribute("aria-activedescendant",`${J}-option-${Te}`),L&&["mouse","keyboard","touch"].includes(Ye)&&L(ke,Te===-1?null:Re[Te],Ye),!ie.current)return;const rt=ie.current.querySelector(`[role="option"].${n}-focused`);rt&&(rt.classList.remove(`${n}-focused`),rt.classList.remove(`${n}-focusVisible`));let je=ie.current;if(ie.current.getAttribute("role")!=="listbox"&&(je=ie.current.parentElement.querySelector('[role="listbox"]')),!je)return;if(Te===-1){je.scrollTop=0;return}const zt=ie.current.querySelector(`[data-option-index="${Te}"]`);if(zt&&(zt.classList.add(`${n}-focused`),Ye==="keyboard"&&zt.classList.add(`${n}-focusVisible`),je.scrollHeight>je.clientHeight&&Ye!=="mouse"&&Ye!=="touch")){const Wt=zt,Qn=je.clientHeight+je.scrollTop,Di=Wt.offsetTop+Wt.offsetHeight;Di>Qn?je.scrollTop=Di-je.clientHeight:Wt.offsetTop-Wt.offsetHeight*(T?1.3:0)<je.scrollTop&&(je.scrollTop=Wt.offsetTop-Wt.offsetHeight*(T?1.3:0))}}),Oe=Ve(({event:ke,diff:Te,direction:Ye="next",reason:rt})=>{if(!Xe)return;const zt=be((()=>{const Wt=Re.length-1;if(Te==="reset")return Ie;if(Te==="start")return 0;if(Te==="end")return Wt;const Qn=Ce.current+Te;return Qn<0?Qn===-1&&F?-1:b&&Ce.current!==-1||Math.abs(Te)>1?0:Wt:Qn>Wt?Qn===Wt+1&&F?-1:b||Math.abs(Te)>1?Wt:0:Qn})(),Ye);if(Ae({index:zt,reason:rt,event:ke}),r&&Te!=="reset")if(zt===-1)ae.current.value=Ne;else{const Wt=Q(Re[zt]);ae.current.value=Wt,Wt.toLowerCase().indexOf(Ne.toLowerCase())===0&&Ne.length>0&&ae.current.setSelectionRange(Ne.length,Wt.length)}}),Qe=!l1({array1:ct.filteredOptions,array2:Re,parser:Q}),st=()=>{const ke=(Te,Ye)=>{const rt=Te?Q(Te):"",je=Ye?Q(Ye):"";return rt===je};if(Ce.current!==-1&&!l1({array1:ct.filteredOptions,array2:Re,parser:Q})&&ct.inputValue===Ne&&(D?ye.length===ct.value.length&&ct.value.every((Te,Ye)=>Q(ye[Ye])===Q(Te)):ke(ct.value,ye))){const Te=ct.filteredOptions[Ce.current];if(Te)return Re.findIndex(Ye=>Q(Ye)===Q(Te))}return-1},Nt=M.useCallback(()=>{if(!Xe)return;const ke=st();if(ke!==-1){Ce.current=ke;return}const Te=D?ye[0]:ye;if(Re.length===0||Te==null){Oe({diff:"reset"});return}if(ie.current){if(Te!=null){const Ye=Re[Ce.current];if(D&&Ye&&ye.findIndex(je=>j(Ye,je))!==-1)return;const rt=Re.findIndex(je=>j(je,Te));rt===-1?Oe({diff:"reset"}):Ae({index:rt});return}if(Ce.current>=Re.length-1){Ae({index:Re.length-1});return}Ae({index:Ce.current})}},[Re.length,D?!1:ye,x,Oe,Ae,Xe,Ne,D]),Gt=Ve(ke=>{Zd(ie,ke),ke&&Nt()});M.useEffect(()=>{Qe&&Nt()},[Nt,Qe]);const bt=ke=>{ot||(xe(!0),qe(!0),K&&K(ke))},sn=(ke,Te)=>{ot&&(xe(!1),_&&_(ke,Te))},Rn=(ke,Te,Ye,rt)=>{if(D){if(ye.length===Te.length&&ye.every((je,zt)=>je===Te[zt]))return}else if(ye===Te)return;H&&H(ke,Te,Ye,rt),ze(Te)},jt=M.useRef(!1),gn=(ke,Te,Ye="selectOption",rt="options")=>{let je=Ye,zt=Te;if(D){zt=Array.isArray(ye)?ye.slice():[];const Wt=zt.findIndex(Qn=>j(Te,Qn));Wt===-1?zt.push(Te):rt!=="freeSolo"&&(zt.splice(Wt,1),je="removeOption")}yt(ke,zt,je),Rn(ke,zt,je,{option:Te}),!h&&(!ke||!ke.ctrlKey&&!ke.metaKey)&&sn(ke,je),(s===!0||s==="touch"&&jt.current||s==="mouse"&&!jt.current)&&ae.current.blur()};function lr(ke,Te){if(ke===-1)return-1;let Ye=ke;for(;;){if(Te==="next"&&Ye===ye.length||Te==="previous"&&Ye===-1)return-1;const rt=se?"data-item-index":"data-tag-index",je=Z.querySelector(`[${rt}="${Ye}"]`);if(!je||!je.hasAttribute("tabindex")||je.disabled||je.getAttribute("aria-disabled")==="true")Ye+=Te==="next"?1:-1;else return Ye}}const Nn=(ke,Te)=>{if(!D)return;Ne===""&&sn(ke,"toggleInput");let Ye=le;le===-1?Ne===""&&Te==="previous"&&(Ye=ye.length-1):(Ye+=Te==="next"?1:-1,Ye<0&&(Ye=0),Ye===ye.length&&(Ye=-1)),Ye=lr(Ye,Te),ue(Ye),Mt(Ye)},jr=ke=>{re.current=!0,nt(""),$&&$(ke,"","clear"),Rn(ke,D?[]:null,"clear")},Hn=ke=>Te=>{if(ke.onKeyDown&&ke.onKeyDown(Te),!Te.defaultMuiPrevented&&(le!==-1&&!["ArrowLeft","ArrowRight"].includes(Te.key)&&(ue(-1),Mt(-1)),Te.which!==229))switch(Te.key){case"Home":Xe&&N&&(Te.preventDefault(),Oe({diff:"start",direction:"next",reason:"keyboard",event:Te}));break;case"End":Xe&&N&&(Te.preventDefault(),Oe({diff:"end",direction:"previous",reason:"keyboard",event:Te}));break;case"PageUp":Te.preventDefault(),Oe({diff:-c1,direction:"previous",reason:"keyboard",event:Te}),bt(Te);break;case"PageDown":Te.preventDefault(),Oe({diff:c1,direction:"next",reason:"keyboard",event:Te}),bt(Te);break;case"ArrowDown":Te.preventDefault(),Oe({diff:1,direction:"next",reason:"keyboard",event:Te}),bt(Te);break;case"ArrowUp":Te.preventDefault(),Oe({diff:-1,direction:"previous",reason:"keyboard",event:Te}),bt(Te);break;case"ArrowLeft":!D&&se?Mt(0):Nn(Te,"previous");break;case"ArrowRight":!D&&se?Mt(-1):Nn(Te,"next");break;case"Enter":if(Ce.current!==-1&&Xe){const Ye=Re[Ce.current],rt=v?v(Ye):!1;if(Te.preventDefault(),rt)return;gn(Te,Ye,"selectOption"),r&&ae.current.setSelectionRange(ae.current.value.length,ae.current.value.length)}else C&&Ne!==""&&Je===!1&&(D&&Te.preventDefault(),gn(Te,Ne,"createOption","freeSolo"));break;case"Escape":Xe?(Te.preventDefault(),Te.stopPropagation(),sn(Te,"escape")):l&&(Ne!==""||D&&ye.length>0||se)&&(Te.preventDefault(),Te.stopPropagation(),jr(Te));break;case"Backspace":if(D&&!oe&&Ne===""&&ye.length>0){const Ye=le===-1?ye.length-1:le,rt=ye.slice();rt.splice(Ye,1),Rn(Te,rt,"removeOption",{option:ye[Ye]})}!D&&se&&!oe&&(ze(null),Mt(-1));break;case"Delete":if(D&&!oe&&Ne===""&&ye.length>0&&le!==-1){const Ye=le,rt=ye.slice();rt.splice(Ye,1),Rn(Te,rt,"removeOption",{option:ye[Ye]})}!D&&se&&!oe&&(ze(null),Mt(-1));break}},Pt=ke=>{Bt(!0),q&&!re.current&&bt(ke)},xn=ke=>{if(t(ie)){ae.current.focus();return}Bt(!1),ne.current=!0,re.current=!1,i&&Ce.current!==-1&&Xe?gn(ke,Re[Ce.current],"blur"):i&&C&&Ne!==""?gn(ke,Ne,"blur","freeSolo"):a&&yt(ke,ye,"blur"),sn(ke,"blur")},To=ke=>{const Te=ke.target.value;Ne!==Te&&(nt(Te),qe(!1),$&&$(ke,Te,"input")),Te===""?!f&&!D&&Rn(ke,null,"clear"):bt(ke)},ki=ke=>{const Te=Number(ke.currentTarget.getAttribute("data-option-index"));Ce.current!==Te&&Ae({event:ke,index:Te,reason:"mouse"})},wn=ke=>{Ae({event:ke,index:Number(ke.currentTarget.getAttribute("data-option-index")),reason:"touch"}),jt.current=!0},$o=ke=>{const Te=Number(ke.currentTarget.getAttribute("data-option-index"));gn(ke,Re[Te],"selectOption"),jt.current=!1},wi=ke=>Te=>{const Ye=ye.slice();Ye.splice(ke,1),Rn(Te,Ye,"removeOption",{option:ye[ke]})},So=ke=>{Rn(ke,null,"removeOption",{option:ye})},nn=ke=>{ot?sn(ke,"toggleInput"):bt(ke)},rn=ke=>{ke.currentTarget.contains(ke.target)&&ke.target.getAttribute("id")!==J&&ke.preventDefault()},Ar=ke=>{ke.currentTarget.contains(ke.target)&&(ae.current.focus(),z&&ne.current&&ae.current.selectionEnd-ae.current.selectionStart===0&&ae.current.select(),ne.current=!1)},Ho=ke=>{!p&&(Ne===""||!ot)&&nn(ke)};let ko=C&&Ne.length>0;ko=ko||(D?ye.length>0:ye!==null);let zo=Re;return T&&(zo=Re.reduce((ke,Te,Ye)=>{const rt=T(Te);return ke.length>0&&ke[ke.length-1].group===rt?ke[ke.length-1].options.push(Te):ke.push({key:Ye,index:Ye,group:rt,options:[Te]}),ke},[])),p&&_e&&xn(),{getRootProps:(ke={})=>({...ke,onKeyDown:Hn(ke),onMouseDown:rn,onClick:Ar}),getInputLabelProps:()=>({id:`${J}-label`,htmlFor:J}),getInputProps:()=>({id:J,value:Ne,onBlur:xn,onFocus:Pt,onChange:To,onMouseDown:Ho,"aria-activedescendant":Xe?"":null,"aria-autocomplete":r?"both":"list","aria-controls":lt?`${J}-listbox`:void 0,"aria-expanded":lt,autoComplete:"off",ref:ae,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:p}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:jr}),getItemProps:({index:ke=0}={})=>({...D&&{key:ke},...se?{"data-item-index":ke}:{"data-tag-index":ke},tabIndex:-1,...!oe&&{onDelete:D?wi(ke):So}}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:nn}),getTagProps:({index:ke})=>({key:ke,"data-tag-index":ke,tabIndex:-1,...!oe&&{onDelete:wi(ke)}}),getListboxProps:()=>({role:"listbox",id:`${J}-listbox`,"aria-labelledby":`${J}-label`,ref:Gt,onMouseDown:ke=>{ke.preventDefault()}}),getOptionProps:({index:ke,option:Te})=>{const Ye=(D?ye:[ye]).some(je=>je!=null&&j(Te,je)),rt=v?v(Te):!1;return{key:S?.(Te)??Q(Te),tabIndex:-1,role:"option",id:`${J}-option-${ke}`,onMouseMove:ki,onClick:$o,onTouchStart:wn,"data-option-index":ke,"aria-disabled":rt,"aria-selected":Ye}},id:J,inputValue:Ne,value:ye,dirty:ko,expanded:Xe&&Z,popupOpen:Xe,focused:_e||le!==-1,anchorEl:Z,setAnchorEl:me,focusedItem:le,focusedTag:le,groupedOptions:zo}}var qn="top",Cr="bottom",Er="right",Yn="left",Up="auto",Tl=[qn,Cr,Er,Yn],gs="start",rl="end",l7="clippingParents",B2="viewport",ha="popper",u7="reference",f1=Tl.reduce(function(e,t){return e.concat([t+"-"+gs,t+"-"+rl])},[]),j2=[].concat(Tl,[Up]).reduce(function(e,t){return e.concat([t,t+"-"+gs,t+"-"+rl])},[]),c7="beforeRead",d7="read",f7="afterRead",p7="beforeMain",h7="main",m7="afterMain",g7="beforeWrite",b7="write",y7="afterWrite",x7=[c7,d7,f7,p7,h7,m7,g7,b7,y7];function Xr(e){return e?(e.nodeName||"").toLowerCase():null}function sr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function mi(e){var t=sr(e).Element;return e instanceof t||e instanceof Element}function yr(e){var t=sr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Vp(e){if(typeof ShadowRoot>"u")return!1;var t=sr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function C7(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!yr(i)||!Xr(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function E7(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=s.reduce(function(l,u){return l[u]="",l},{});!yr(o)||!Xr(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const v7={name:"applyStyles",enabled:!0,phase:"write",fn:C7,effect:E7,requires:["computeStyles"]};function Qr(e){return e.split("-")[0]}var li=Math.max,Gu=Math.min,bs=Math.round;function Rf(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function $2(){return!/^((?!chrome|android).)*safari/i.test(Rf())}function ys(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&yr(e)&&(o=e.offsetWidth>0&&bs(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&bs(r.height)/e.offsetHeight||1);var s=mi(e)?sr(e):window,a=s.visualViewport,l=!$2()&&n,u=(r.left+(l&&a?a.offsetLeft:0))/o,d=(r.top+(l&&a?a.offsetTop:0))/i,f=r.width/o,h=r.height/i;return{width:f,height:h,top:d,right:u+f,bottom:d+h,left:u,x:u,y:d}}function Wp(e){var t=ys(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function H2(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Vp(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function yo(e){return sr(e).getComputedStyle(e)}function T7(e){return["table","td","th"].indexOf(Xr(e))>=0}function jo(e){return((mi(e)?e.ownerDocument:e.document)||window.document).documentElement}function Oc(e){return Xr(e)==="html"?e:e.assignedSlot||e.parentNode||(Vp(e)?e.host:null)||jo(e)}function p1(e){return!yr(e)||yo(e).position==="fixed"?null:e.offsetParent}function S7(e){var t=/firefox/i.test(Rf()),n=/Trident/i.test(Rf());if(n&&yr(e)){var r=yo(e);if(r.position==="fixed")return null}var o=Oc(e);for(Vp(o)&&(o=o.host);yr(o)&&["html","body"].indexOf(Xr(o))<0;){var i=yo(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Sl(e){for(var t=sr(e),n=p1(e);n&&T7(n)&&yo(n).position==="static";)n=p1(n);return n&&(Xr(n)==="html"||Xr(n)==="body"&&yo(n).position==="static")?t:n||S7(e)||t}function qp(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Va(e,t,n){return li(e,Gu(t,n))}function k7(e,t,n){var r=Va(e,t,n);return r>n?n:r}function z2(){return{top:0,right:0,bottom:0,left:0}}function U2(e){return Object.assign({},z2(),e)}function V2(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var w7=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,U2(typeof t!="number"?t:V2(t,Tl))};function D7(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Qr(n.placement),l=qp(a),u=[Yn,Er].indexOf(a)>=0,d=u?"height":"width";if(!(!i||!s)){var f=w7(o.padding,n),h=Wp(i),p=l==="y"?qn:Yn,m=l==="y"?Cr:Er,b=n.rects.reference[d]+n.rects.reference[l]-s[l]-n.rects.popper[d],y=s[l]-n.rects.reference[l],x=Sl(i),C=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0,v=b/2-y/2,S=f[p],I=C-h[d]-f[m],T=C/2-h[d]/2+v,N=Va(S,T,I),O=l;n.modifiersData[r]=(t={},t[O]=N,t.centerOffset=N-T,t)}}function I7(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||H2(t.elements.popper,o)&&(t.elements.arrow=o))}const A7={name:"arrow",enabled:!0,phase:"main",fn:D7,effect:I7,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function xs(e){return e.split("-")[1]}var O7={top:"auto",right:"auto",bottom:"auto",left:"auto"};function M7(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:bs(n*o)/o||0,y:bs(r*o)/o||0}}function h1(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,f=e.isFixed,h=s.x,p=h===void 0?0:h,m=s.y,b=m===void 0?0:m,y=typeof d=="function"?d({x:p,y:b}):{x:p,y:b};p=y.x,b=y.y;var x=s.hasOwnProperty("x"),C=s.hasOwnProperty("y"),v=Yn,S=qn,I=window;if(u){var T=Sl(n),N="clientHeight",O="clientWidth";if(T===sr(n)&&(T=jo(n),yo(T).position!=="static"&&a==="absolute"&&(N="scrollHeight",O="scrollWidth")),T=T,o===qn||(o===Yn||o===Er)&&i===rl){S=Cr;var F=f&&T===I&&I.visualViewport?I.visualViewport.height:T[N];b-=F-r.height,b*=l?1:-1}if(o===Yn||(o===qn||o===Cr)&&i===rl){v=Er;var B=f&&T===I&&I.visualViewport?I.visualViewport.width:T[O];p-=B-r.width,p*=l?1:-1}}var j=Object.assign({position:a},u&&O7),D=d===!0?M7({x:p,y:b},sr(n)):{x:p,y:b};if(p=D.x,b=D.y,l){var H;return Object.assign({},j,(H={},H[S]=C?"0":"",H[v]=x?"0":"",H.transform=(I.devicePixelRatio||1)<=1?"translate("+p+"px, "+b+"px)":"translate3d("+p+"px, "+b+"px, 0)",H))}return Object.assign({},j,(t={},t[S]=C?b+"px":"",t[v]=x?p+"px":"",t.transform="",t))}function P7(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:Qr(t.placement),variation:xs(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,h1(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,h1(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const R7={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:P7,data:{}};var eu={passive:!0};function N7(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=sr(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",n.update,eu)}),a&&l.addEventListener("resize",n.update,eu),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",n.update,eu)}),a&&l.removeEventListener("resize",n.update,eu)}}const F7={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:N7,data:{}};var L7={left:"right",right:"left",bottom:"top",top:"bottom"};function mu(e){return e.replace(/left|right|bottom|top/g,function(t){return L7[t]})}var _7={start:"end",end:"start"};function m1(e){return e.replace(/start|end/g,function(t){return _7[t]})}function Yp(e){var t=sr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Kp(e){return ys(jo(e)).left+Yp(e).scrollLeft}function B7(e,t){var n=sr(e),r=jo(e),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var u=$2();(u||!u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Kp(e),y:l}}function j7(e){var t,n=jo(e),r=Yp(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=li(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=li(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+Kp(e),l=-r.scrollTop;return yo(o||n).direction==="rtl"&&(a+=li(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Gp(e){var t=yo(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function W2(e){return["html","body","#document"].indexOf(Xr(e))>=0?e.ownerDocument.body:yr(e)&&Gp(e)?e:W2(Oc(e))}function Wa(e,t){var n;t===void 0&&(t=[]);var r=W2(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=sr(r),s=o?[i].concat(i.visualViewport||[],Gp(r)?r:[]):r,a=t.concat(s);return o?a:a.concat(Wa(Oc(s)))}function Nf(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function $7(e,t){var n=ys(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function g1(e,t,n){return t===B2?Nf(B7(e,n)):mi(t)?$7(t,n):Nf(j7(jo(e)))}function H7(e){var t=Wa(Oc(e)),n=["absolute","fixed"].indexOf(yo(e).position)>=0,r=n&&yr(e)?Sl(e):e;return mi(r)?t.filter(function(o){return mi(o)&&H2(o,r)&&Xr(o)!=="body"}):[]}function z7(e,t,n,r){var o=t==="clippingParents"?H7(e):[].concat(t),i=[].concat(o,[n]),s=i[0],a=i.reduce(function(l,u){var d=g1(e,u,r);return l.top=li(d.top,l.top),l.right=Gu(d.right,l.right),l.bottom=Gu(d.bottom,l.bottom),l.left=li(d.left,l.left),l},g1(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function q2(e){var t=e.reference,n=e.element,r=e.placement,o=r?Qr(r):null,i=r?xs(r):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(o){case qn:l={x:s,y:t.y-n.height};break;case Cr:l={x:s,y:t.y+t.height};break;case Er:l={x:t.x+t.width,y:a};break;case Yn:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var u=o?qp(o):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case gs:l[u]=l[u]-(t[d]/2-n[d]/2);break;case rl:l[u]=l[u]+(t[d]/2-n[d]/2);break}}return l}function ol(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,s=i===void 0?e.strategy:i,a=n.boundary,l=a===void 0?l7:a,u=n.rootBoundary,d=u===void 0?B2:u,f=n.elementContext,h=f===void 0?ha:f,p=n.altBoundary,m=p===void 0?!1:p,b=n.padding,y=b===void 0?0:b,x=U2(typeof y!="number"?y:V2(y,Tl)),C=h===ha?u7:ha,v=e.rects.popper,S=e.elements[m?C:h],I=z7(mi(S)?S:S.contextElement||jo(e.elements.popper),l,d,s),T=ys(e.elements.reference),N=q2({reference:T,element:v,placement:o}),O=Nf(Object.assign({},v,N)),F=h===ha?O:T,B={top:I.top-F.top+x.top,bottom:F.bottom-I.bottom+x.bottom,left:I.left-F.left+x.left,right:F.right-I.right+x.right},j=e.modifiersData.offset;if(h===ha&&j){var D=j[o];Object.keys(B).forEach(function(H){var _=[Er,Cr].indexOf(H)>=0?1:-1,L=[qn,Cr].indexOf(H)>=0?"y":"x";B[H]+=D[L]*_})}return B}function U7(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?j2:l,d=xs(r),f=d?a?f1:f1.filter(function(m){return xs(m)===d}):Tl,h=f.filter(function(m){return u.indexOf(m)>=0});h.length===0&&(h=f);var p=h.reduce(function(m,b){return m[b]=ol(e,{placement:b,boundary:o,rootBoundary:i,padding:s})[Qr(b)],m},{});return Object.keys(p).sort(function(m,b){return p[m]-p[b]})}function V7(e){if(Qr(e)===Up)return[];var t=mu(e);return[m1(e),t,m1(t)]}function W7(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,d=n.boundary,f=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,b=n.allowedAutoPlacements,y=t.options.placement,x=Qr(y),C=x===y,v=l||(C||!m?[mu(y)]:V7(y)),S=[y].concat(v).reduce(function(pe,J){return pe.concat(Qr(J)===Up?U7(t,{placement:J,boundary:d,rootBoundary:f,padding:u,flipVariations:m,allowedAutoPlacements:b}):J)},[]),I=t.rects.reference,T=t.rects.popper,N=new Map,O=!0,F=S[0],B=0;B<S.length;B++){var j=S[B],D=Qr(j),H=xs(j)===gs,_=[qn,Cr].indexOf(D)>=0,L=_?"width":"height",$=ol(t,{placement:j,boundary:d,rootBoundary:f,altBoundary:h,padding:u}),K=_?H?Er:Yn:H?Cr:qn;I[L]>T[L]&&(K=mu(K));var G=mu(K),q=[];if(i&&q.push($[D]<=0),a&&q.push($[K]<=0,$[G]<=0),q.every(function(pe){return pe})){F=j,O=!1;break}N.set(j,q)}if(O)for(var R=m?3:1,oe=function(J){var Q=S.find(function(re){var ne=N.get(re);if(ne)return ne.slice(0,J).every(function(ae){return ae})});if(Q)return F=Q,"break"},se=R;se>0;se--){var z=oe(se);if(z==="break")break}t.placement!==F&&(t.modifiersData[r]._skip=!0,t.placement=F,t.reset=!0)}}const q7={name:"flip",enabled:!0,phase:"main",fn:W7,requiresIfExists:["offset"],data:{_skip:!1}};function b1(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function y1(e){return[qn,Er,Cr,Yn].some(function(t){return e[t]>=0})}function Y7(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=ol(t,{elementContext:"reference"}),a=ol(t,{altBoundary:!0}),l=b1(s,r),u=b1(a,o,i),d=y1(l),f=y1(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const K7={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Y7};function G7(e,t,n){var r=Qr(e),o=[Yn,qn].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Yn,Er].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function Q7(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,s=j2.reduce(function(d,f){return d[f]=G7(f,t.rects,i),d},{}),a=s[t.placement],l=a.x,u=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}const X7={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Q7};function Z7(e){var t=e.state,n=e.name;t.modifiersData[n]=q2({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const J7={name:"popperOffsets",enabled:!0,phase:"read",fn:Z7,data:{}};function e9(e){return e==="x"?"y":"x"}function t9(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,f=n.padding,h=n.tether,p=h===void 0?!0:h,m=n.tetherOffset,b=m===void 0?0:m,y=ol(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:d}),x=Qr(t.placement),C=xs(t.placement),v=!C,S=qp(x),I=e9(S),T=t.modifiersData.popperOffsets,N=t.rects.reference,O=t.rects.popper,F=typeof b=="function"?b(Object.assign({},t.rects,{placement:t.placement})):b,B=typeof F=="number"?{mainAxis:F,altAxis:F}:Object.assign({mainAxis:0,altAxis:0},F),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,D={x:0,y:0};if(T){if(i){var H,_=S==="y"?qn:Yn,L=S==="y"?Cr:Er,$=S==="y"?"height":"width",K=T[S],G=K+y[_],q=K-y[L],R=p?-O[$]/2:0,oe=C===gs?N[$]:O[$],se=C===gs?-O[$]:-N[$],z=t.elements.arrow,pe=p&&z?Wp(z):{width:0,height:0},J=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:z2(),Q=J[_],re=J[L],ne=Va(0,N[$],pe[$]),ae=v?N[$]/2-R-ne-Q-B.mainAxis:oe-ne-Q-B.mainAxis,ie=v?-N[$]/2+R+ne+re+B.mainAxis:se+ne+re+B.mainAxis,Z=t.elements.arrow&&Sl(t.elements.arrow),me=Z?S==="y"?Z.clientTop||0:Z.clientLeft||0:0,le=(H=j?.[S])!=null?H:0,ue=K+ae-le-me,Ie=K+ie-le,Ce=Va(p?Gu(G,ue):G,K,p?li(q,Ie):q);T[S]=Ce,D[S]=Ce-K}if(a){var we,ye=S==="x"?qn:Yn,ze=S==="x"?Cr:Er,Ne=T[I],nt=I==="y"?"height":"width",_e=Ne+y[ye],Bt=Ne-y[ze],yt=[qn,Yn].indexOf(x)!==-1,ot=(we=j?.[I])!=null?we:0,xe=yt?_e:Ne-N[nt]-O[nt]-ot+B.altAxis,Pe=yt?Ne+N[nt]+O[nt]-ot-B.altAxis:Bt,qe=p&&yt?k7(xe,Ne,Pe):Va(p?xe:_e,Ne,p?Pe:Bt);T[I]=qe,D[I]=qe-Ne}t.modifiersData[r]=D}}const n9={name:"preventOverflow",enabled:!0,phase:"main",fn:t9,requiresIfExists:["offset"]};function r9(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function o9(e){return e===sr(e)||!yr(e)?Yp(e):r9(e)}function i9(e){var t=e.getBoundingClientRect(),n=bs(t.width)/e.offsetWidth||1,r=bs(t.height)/e.offsetHeight||1;return n!==1||r!==1}function s9(e,t,n){n===void 0&&(n=!1);var r=yr(t),o=yr(t)&&i9(t),i=jo(t),s=ys(e,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Xr(t)!=="body"||Gp(i))&&(a=o9(t)),yr(t)?(l=ys(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Kp(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function a9(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&o(l)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function l9(e){var t=a9(e);return x7.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function u9(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function c9(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var x1={placement:"bottom",modifiers:[],strategy:"absolute"};function C1(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function d9(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,i=o===void 0?x1:o;return function(a,l,u){u===void 0&&(u=i);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},x1,i),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},f=[],h=!1,p={state:d,setOptions:function(x){var C=typeof x=="function"?x(d.options):x;b(),d.options=Object.assign({},i,d.options,C),d.scrollParents={reference:mi(a)?Wa(a):a.contextElement?Wa(a.contextElement):[],popper:Wa(l)};var v=l9(c9([].concat(r,d.options.modifiers)));return d.orderedModifiers=v.filter(function(S){return S.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var x=d.elements,C=x.reference,v=x.popper;if(C1(C,v)){d.rects={reference:s9(C,Sl(v),d.options.strategy==="fixed"),popper:Wp(v)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(B){return d.modifiersData[B.name]=Object.assign({},B.data)});for(var S=0;S<d.orderedModifiers.length;S++){if(d.reset===!0){d.reset=!1,S=-1;continue}var I=d.orderedModifiers[S],T=I.fn,N=I.options,O=N===void 0?{}:N,F=I.name;typeof T=="function"&&(d=T({state:d,options:O,name:F,instance:p})||d)}}}},update:u9(function(){return new Promise(function(y){p.forceUpdate(),y(d)})}),destroy:function(){b(),h=!0}};if(!C1(a,l))return p;p.setOptions(u).then(function(y){!h&&u.onFirstUpdate&&u.onFirstUpdate(y)});function m(){d.orderedModifiers.forEach(function(y){var x=y.name,C=y.options,v=C===void 0?{}:C,S=y.effect;if(typeof S=="function"){var I=S({state:d,name:x,instance:p,options:v}),T=function(){};f.push(I||T)}})}function b(){f.forEach(function(y){return y()}),f=[]}return p}}var f9=[F7,J7,R7,v7,X7,q7,n9,A7,K7],p9=d9({defaultModifiers:f9});function h9(e){return Ge("MuiPopper",e)}We("MuiPopper",["root"]);function m9(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function Ff(e){return typeof e=="function"?e():e}function g9(e){return e.nodeType!==void 0}const b9=e=>{const{classes:t}=e;return Ke({root:["root"]},h9,t)},y9={},x9=M.forwardRef(function(t,n){const{anchorEl:r,children:o,direction:i,disablePortal:s,modifiers:a,open:l,placement:u,popperOptions:d,popperRef:f,slotProps:h={},slots:p={},TransitionProps:m,ownerState:b,...y}=t,x=M.useRef(null),C=vt(x,n),v=M.useRef(null),S=vt(v,f),I=M.useRef(S);yn(()=>{I.current=S},[S]),M.useImperativeHandle(f,()=>v.current,[]);const T=m9(u,i),[N,O]=M.useState(T),[F,B]=M.useState(Ff(r));M.useEffect(()=>{v.current&&v.current.forceUpdate()}),M.useEffect(()=>{r&&B(Ff(r))},[r]),yn(()=>{if(!F||!l)return;const L=G=>{O(G.placement)};let $=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:G})=>{L(G)}}];a!=null&&($=$.concat(a)),d&&d.modifiers!=null&&($=$.concat(d.modifiers));const K=p9(F,x.current,{placement:T,...d,modifiers:$});return I.current(K),()=>{K.destroy(),I.current(null)}},[F,s,a,l,d,T]);const j={placement:N};m!==null&&(j.TransitionProps=m);const D=b9(t),H=p.root??"div",_=Et({elementType:H,externalSlotProps:h.root,externalForwardedProps:y,additionalProps:{role:"tooltip",ref:C},ownerState:t,className:D.root});return c.jsx(H,{..._,children:typeof o=="function"?o(j):o})}),C9=M.forwardRef(function(t,n){const{anchorEl:r,children:o,container:i,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:u,open:d,placement:f="bottom",popperOptions:h=y9,popperRef:p,style:m,transition:b=!1,slotProps:y={},slots:x={},...C}=t,[v,S]=M.useState(!0),I=()=>{S(!1)},T=()=>{S(!0)};if(!l&&!d&&(!b||v))return null;let N;if(i)N=i;else if(r){const B=Ff(r);N=B&&g9(B)?mn(B).body:mn(null).body}const O=!d&&l&&(!b||v)?"none":void 0,F=b?{in:d,onEnter:I,onExited:T}:void 0;return c.jsx(f2,{disablePortal:a,container:N,children:c.jsx(x9,{anchorEl:r,direction:s,disablePortal:a,modifiers:u,ref:n,open:b?!v:d,placement:f,popperOptions:h,popperRef:p,slotProps:y,slots:x,...C,style:{position:"fixed",top:0,left:0,display:O,...m},TransitionProps:F,children:o})})}),E9=fe(C9,{name:"MuiPopper",slot:"Root"})({}),Qp=M.forwardRef(function(t,n){const r=kr(),o=ut({props:t,name:"MuiPopper"}),{anchorEl:i,component:s,components:a,componentsProps:l,container:u,disablePortal:d,keepMounted:f,modifiers:h,open:p,placement:m,popperOptions:b,popperRef:y,transition:x,slots:C,slotProps:v,...S}=o,I=C?.root??a?.Root,T={anchorEl:i,container:u,disablePortal:d,keepMounted:f,modifiers:h,open:p,placement:m,popperOptions:b,popperRef:y,transition:x,...S};return c.jsx(E9,{as:s,direction:r?"rtl":"ltr",slots:{root:I},slotProps:v??l,...T,ref:n})});function v9(e){return Ge("MuiListSubheader",e)}We("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const T9=e=>{const{classes:t,color:n,disableGutters:r,inset:o,disableSticky:i}=e,s={root:["root",n!=="default"&&`color${Fe(n)}`,!r&&"gutters",o&&"inset",!i&&"sticky"]};return Ke(s,v9,t)},S9=fe("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${Fe(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})(ft(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:72}},{props:({ownerState:t})=>!t.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),Lf=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListSubheader"}),{className:o,color:i="default",component:s="li",disableGutters:a=!1,disableSticky:l=!1,inset:u=!1,...d}=r,f={...r,color:i,component:s,disableGutters:a,disableSticky:l,inset:u},h=T9(f);return c.jsx(S9,{as:s,className:Ue(h.root,o),ref:n,ownerState:f,...d})});Lf&&(Lf.muiSkipListHighlight=!0);const k9=mt(c.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}));function w9(e){return Ge("MuiChip",e)}const Tt=We("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),D9=e=>{const{classes:t,disabled:n,size:r,color:o,iconColor:i,onDelete:s,clickable:a,variant:l}=e,u={root:["root",l,n&&"disabled",`size${Fe(r)}`,`color${Fe(o)}`,a&&"clickable",a&&`clickableColor${Fe(o)}`,s&&"deletable",s&&`deletableColor${Fe(o)}`,`${l}${Fe(o)}`],label:["label",`label${Fe(r)}`],avatar:["avatar",`avatar${Fe(r)}`,`avatarColor${Fe(o)}`],icon:["icon",`icon${Fe(r)}`,`iconColor${Fe(i)}`],deleteIcon:["deleteIcon",`deleteIcon${Fe(r)}`,`deleteIconColor${Fe(o)}`,`deleteIcon${Fe(l)}Color${Fe(o)}`]};return Ke(u,w9,t)},I9=fe("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:o,clickable:i,onDelete:s,size:a,variant:l}=n;return[{[`& .${Tt.avatar}`]:t.avatar},{[`& .${Tt.avatar}`]:t[`avatar${Fe(a)}`]},{[`& .${Tt.avatar}`]:t[`avatarColor${Fe(r)}`]},{[`& .${Tt.icon}`]:t.icon},{[`& .${Tt.icon}`]:t[`icon${Fe(a)}`]},{[`& .${Tt.icon}`]:t[`iconColor${Fe(o)}`]},{[`& .${Tt.deleteIcon}`]:t.deleteIcon},{[`& .${Tt.deleteIcon}`]:t[`deleteIcon${Fe(a)}`]},{[`& .${Tt.deleteIcon}`]:t[`deleteIconColor${Fe(r)}`]},{[`& .${Tt.deleteIcon}`]:t[`deleteIcon${Fe(l)}Color${Fe(r)}`]},t.root,t[`size${Fe(a)}`],t[`color${Fe(r)}`],i&&t.clickable,i&&r!=="default"&&t[`clickableColor${Fe(r)})`],s&&t.deletable,s&&r!=="default"&&t[`deletableColor${Fe(r)}`],t[l],t[`${l}${Fe(r)}`]]}})(ft(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,lineHeight:1.5,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Tt.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Tt.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${Tt.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${Tt.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${Tt.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${Tt.icon}`]:{marginLeft:5,marginRight:-6},[`& .${Tt.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.alpha((e.vars||e).palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.alpha((e.vars||e).palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${Tt.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${Tt.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(Bn(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText,[`& .${Tt.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${Tt.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${Tt.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${Tt.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}},...Object.entries(e.palette).filter(Bn(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${Tt.focusVisible}`]:{background:(e.vars||e).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)},[`&.${Tt.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(Bn(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${Tt.focusVisible}`]:{backgroundColor:(e.vars||e).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${Tt.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${Tt.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${Tt.avatar}`]:{marginLeft:4},[`& .${Tt.avatarSmall}`]:{marginLeft:2},[`& .${Tt.icon}`]:{marginLeft:4},[`& .${Tt.iconSmall}`]:{marginLeft:2},[`& .${Tt.deleteIcon}`]:{marginRight:5},[`& .${Tt.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(Bn()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(e.vars||e).palette[n].main,border:`1px solid ${e.alpha((e.vars||e).palette[n].main,.7)}`,[`&.${Tt.clickable}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.hoverOpacity)},[`&.${Tt.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.focusOpacity)},[`& .${Tt.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].main}}}}))]}})),A9=fe("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${Fe(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function E1(e){return e.key==="Backspace"||e.key==="Delete"}const Y2=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiChip"}),{avatar:o,className:i,clickable:s,color:a="default",component:l,deleteIcon:u,disabled:d=!1,icon:f,label:h,onClick:p,onDelete:m,onKeyDown:b,onKeyUp:y,size:x="medium",variant:C="filled",tabIndex:v,skipFocusWhenDisabled:S=!1,slots:I={},slotProps:T={},...N}=r,O=M.useRef(null),F=vt(O,n),B=Q=>{Q.stopPropagation(),m&&m(Q)},j=Q=>{Q.currentTarget===Q.target&&E1(Q)&&Q.preventDefault(),b&&b(Q)},D=Q=>{Q.currentTarget===Q.target&&m&&E1(Q)&&m(Q),y&&y(Q)},H=s!==!1&&p?!0:s,_=H||m?pi:l||"div",L={...r,component:_,disabled:d,size:x,color:a,iconColor:M.isValidElement(f)&&f.props.color||a,onDelete:!!m,clickable:H,variant:C},$=D9(L),K=_===pi?{component:l||"div",focusVisibleClassName:$.focusVisible,...m&&{disableRipple:!0}}:{};let G=null;m&&(G=u&&M.isValidElement(u)?M.cloneElement(u,{className:Ue(u.props.className,$.deleteIcon),onClick:B}):c.jsx(k9,{className:$.deleteIcon,onClick:B}));let q=null;o&&M.isValidElement(o)&&(q=M.cloneElement(o,{className:Ue($.avatar,o.props.className)}));let R=null;f&&M.isValidElement(f)&&(R=M.cloneElement(f,{className:Ue($.icon,f.props.className)}));const oe={slots:I,slotProps:T},[se,z]=kt("root",{elementType:I9,externalForwardedProps:{...oe,...N},ownerState:L,shouldForwardComponentProp:!0,ref:F,className:Ue($.root,i),additionalProps:{disabled:H&&d?!0:void 0,tabIndex:S&&d?-1:v,...K},getSlotProps:Q=>({...Q,onClick:re=>{Q.onClick?.(re),p?.(re)},onKeyDown:re=>{Q.onKeyDown?.(re),j(re)},onKeyUp:re=>{Q.onKeyUp?.(re),D(re)}})}),[pe,J]=kt("label",{elementType:A9,externalForwardedProps:oe,ownerState:L,className:$.label});return c.jsxs(se,{as:_,...z,children:[q||R,c.jsx(pe,{...J,children:h}),G]})}),O9=mt(c.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));function M9(e){return Ge("MuiAutocomplete",e)}const gt=We("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var v1,T1;const P9=e=>{const{classes:t,disablePortal:n,expanded:r,focused:o,fullWidth:i,hasClearIcon:s,hasPopupIcon:a,inputFocused:l,popupOpen:u,size:d}=e,f={root:["root",r&&"expanded",o&&"focused",i&&"fullWidth",s&&"hasClearIcon",a&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${Fe(d)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Ke(f,M9,t)},R9=fe("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:o,hasPopupIcon:i,inputFocused:s,size:a}=n;return[{[`& .${gt.tag}`]:t.tag},{[`& .${gt.tag}`]:t[`tagSize${Fe(a)}`]},{[`& .${gt.inputRoot}`]:t.inputRoot},{[`& .${gt.input}`]:t.input},{[`& .${gt.input}`]:s&&t.inputFocused},t.root,r&&t.fullWidth,i&&t.hasPopupIcon,o&&t.hasClearIcon]}})({[`&.${gt.focused} .${gt.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${gt.clearIndicator}`]:{visibility:"visible"}},[`& .${gt.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${gt.inputRoot}`]:{[`.${gt.hasPopupIcon}&, .${gt.hasClearIcon}&`]:{paddingRight:30},[`.${gt.hasPopupIcon}.${gt.hasClearIcon}&`]:{paddingRight:56},[`& .${gt.input}`]:{width:0,minWidth:30}},[`& .${Mo.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Mo.root}.${tr.sizeSmall}`]:{[`& .${Mo.input}`]:{padding:"2px 4px 3px 0"}},[`& .${fr.root}`]:{padding:9,[`.${gt.hasPopupIcon}&, .${gt.hasClearIcon}&`]:{paddingRight:39},[`.${gt.hasPopupIcon}.${gt.hasClearIcon}&`]:{paddingRight:65},[`& .${gt.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${gt.endAdornment}`]:{right:9}},[`& .${fr.root}.${tr.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${gt.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${nr.root}`]:{paddingTop:19,paddingLeft:8,[`.${gt.hasPopupIcon}&, .${gt.hasClearIcon}&`]:{paddingRight:39},[`.${gt.hasPopupIcon}.${gt.hasClearIcon}&`]:{paddingRight:65},[`& .${nr.input}`]:{padding:"7px 4px"},[`& .${gt.endAdornment}`]:{right:9}},[`& .${nr.root}.${tr.sizeSmall}`]:{paddingBottom:1,[`& .${nr.input}`]:{padding:"2.5px 4px"}},[`& .${tr.hiddenLabel}`]:{paddingTop:8},[`& .${nr.root}.${tr.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${gt.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${nr.root}.${tr.hiddenLabel}.${tr.sizeSmall}`]:{[`& .${gt.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${gt.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${gt.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${gt.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${gt.inputRoot}`]:{flexWrap:"wrap"}}}]}),N9=fe("div",{name:"MuiAutocomplete",slot:"EndAdornment"})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),F9=fe(Ir,{name:"MuiAutocomplete",slot:"ClearIndicator"})({marginRight:-2,padding:4,visibility:"hidden"}),L9=fe(Ir,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),_9=fe(Qp,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${gt.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(ft(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),B9=fe(Ci,{name:"MuiAutocomplete",slot:"Paper"})(ft(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),j9=fe("div",{name:"MuiAutocomplete",slot:"Loading"})(ft(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),$9=fe("div",{name:"MuiAutocomplete",slot:"NoOptions"})(ft(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),H9=fe("ul",{name:"MuiAutocomplete",slot:"Listbox"})(ft(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${gt.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${gt.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${gt.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${gt.focused}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${gt.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}}}))),z9=fe(Lf,{name:"MuiAutocomplete",slot:"GroupLabel"})(ft(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),U9=fe("ul",{name:"MuiAutocomplete",slot:"GroupUl"})({padding:0,[`& .${gt.option}`]:{paddingLeft:24}}),_f=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiAutocomplete"}),{autoComplete:o=!1,autoHighlight:i=!1,autoSelect:s=!1,blurOnSelect:a=!1,ChipProps:l,className:u,clearIcon:d=v1||(v1=c.jsx(O9,{fontSize:"small"})),clearOnBlur:f=!r.freeSolo,clearOnEscape:h=!1,clearText:p="Clear",closeText:m="Close",componentsProps:b,defaultValue:y=r.multiple?[]:null,disableClearable:x=!1,disableCloseOnSelect:C=!1,disabled:v=!1,disabledItemsFocusable:S=!1,disableListWrap:I=!1,disablePortal:T=!1,filterOptions:N,filterSelectedOptions:O=!1,forcePopupIcon:F="auto",freeSolo:B=!1,fullWidth:j=!1,getLimitTagsText:D=wt=>`+${wt}`,getOptionDisabled:H,getOptionKey:_,getOptionLabel:L,isOptionEqualToValue:$,groupBy:K,handleHomeEndKeys:G=!r.freeSolo,id:q,includeInputInList:R=!1,inputValue:oe,limitTags:se=-1,ListboxComponent:z,ListboxProps:pe,loading:J=!1,loadingText:Q="Loading…",multiple:re=!1,noOptionsText:ne="No options",onChange:ae,onClose:ie,onHighlightChange:Z,onInputChange:me,onOpen:le,open:ue,openOnFocus:Ie=!1,openText:Ce="Open",options:we,PaperComponent:ye,PopperComponent:ze,popupIcon:Ne=T1||(T1=c.jsx(N2,{})),readOnly:nt=!1,renderGroup:_e,renderInput:Bt,renderOption:yt,renderTags:ot,renderValue:xe,selectOnFocus:Pe=!r.freeSolo,size:qe="medium",slots:Je={},slotProps:Xe={},value:Re,...ct}=r,{getRootProps:lt,getInputProps:Mt,getInputLabelProps:be,getPopupIndicatorProps:Ae,getClearProps:Oe,getItemProps:Qe,getListboxProps:st,getOptionProps:Nt,value:Gt,dirty:bt,expanded:sn,id:Rn,popupOpen:jt,focused:gn,focusedItem:lr,anchorEl:Nn,setAnchorEl:jr,inputValue:Hn,groupedOptions:Pt}=a7({...r,componentName:"Autocomplete"}),xn=!x&&!v&&bt&&!nt,To=(!B||F===!0)&&F!==!1,{onMouseDown:ki}=Mt(),{ref:wn,...$o}=st(),So=L||(wt=>wt.label??wt),nn={...r,disablePortal:T,expanded:sn,focused:gn,fullWidth:j,getOptionLabel:So,hasClearIcon:xn,hasPopupIcon:To,inputFocused:lr===-1,popupOpen:jt,size:qe},rn=P9(nn),Ar={slots:{paper:ye,popper:ze,...Je},slotProps:{chip:l,listbox:pe,...b,...Xe}},[Ho,ko]=kt("listbox",{elementType:H9,externalForwardedProps:Ar,ownerState:nn,className:rn.listbox,additionalProps:$o,ref:wn}),[zo,ke]=kt("paper",{elementType:Ci,externalForwardedProps:Ar,ownerState:nn,className:rn.paper}),[Te,Ye]=kt("popper",{elementType:Qp,externalForwardedProps:Ar,ownerState:nn,className:rn.popper,additionalProps:{disablePortal:T,style:{width:Nn?Nn.clientWidth:null},role:"presentation",anchorEl:Nn,open:jt}});let rt;const je=wt=>({className:rn.tag,disabled:v,...Qe(wt)});if(re?Gt.length>0&&(ot?rt=ot(Gt,je,nn):xe?rt=xe(Gt,je,nn):rt=Gt.map((wt,$r)=>{const{key:Fn,...io}=je({index:$r});return c.jsx(Y2,{label:So(wt),size:qe,...io,...Ar.slotProps.chip},Fn)})):xe&&Gt!=null&&(rt=xe(Gt,je,nn)),se>-1&&Array.isArray(rt)){const wt=rt.length-se;!gn&&wt>0&&(rt=rt.splice(0,se),rt.push(c.jsx("span",{className:rn.tag,children:D(wt)},rt.length)))}const Wt=_e||(wt=>c.jsxs("li",{children:[c.jsx(z9,{className:rn.groupLabel,ownerState:nn,component:"div",children:wt.group}),c.jsx(U9,{className:rn.groupUl,ownerState:nn,children:wt.children})]},wt.key)),Di=yt||((wt,$r)=>{const{key:Fn,...io}=wt;return c.jsx("li",{...io,children:So($r)},Fn)}),Ps=(wt,$r)=>{const Fn=Nt({option:wt,index:$r});return Di({...Fn,className:rn.option},wt,{selected:Fn["aria-selected"],index:$r,inputValue:Hn},nn)},Rs=Ar.slotProps.clearIndicator,Il=Ar.slotProps.popupIndicator;return c.jsxs(M.Fragment,{children:[c.jsx(R9,{ref:n,className:Ue(rn.root,u),ownerState:nn,...lt(ct),children:Bt({id:Rn,disabled:v,fullWidth:!0,size:qe==="small"?"small":void 0,InputLabelProps:be(),InputProps:{ref:jr,className:rn.inputRoot,startAdornment:rt,onMouseDown:wt=>{wt.target===wt.currentTarget&&ki(wt)},...(xn||To)&&{endAdornment:c.jsxs(N9,{className:rn.endAdornment,ownerState:nn,children:[xn?c.jsx(F9,{...Oe(),"aria-label":p,title:p,ownerState:nn,...Rs,className:Ue(rn.clearIndicator,Rs?.className),children:d}):null,To?c.jsx(L9,{...Ae(),disabled:v,"aria-label":jt?m:Ce,title:jt?m:Ce,ownerState:nn,...Il,className:Ue(rn.popupIndicator,Il?.className),children:Ne}):null]})}},inputProps:{className:rn.input,disabled:v,readOnly:nt,...Mt()}})}),Nn?c.jsx(_9,{as:Te,...Ye,children:c.jsxs(B9,{as:zo,...ke,children:[J&&Pt.length===0?c.jsx(j9,{className:rn.loading,ownerState:nn,children:Q}):null,Pt.length===0&&!B&&!J?c.jsx($9,{className:rn.noOptions,ownerState:nn,role:"presentation",onMouseDown:wt=>{wt.preventDefault()},children:ne}):null,Pt.length>0?c.jsx(Ho,{as:z,...ko,children:Pt.map((wt,$r)=>K?Wt({key:wt.key,group:wt.group,children:wt.options.map((Fn,io)=>Ps(Fn,wt.index+io))}):Ps(wt,$r))}):null]})}):null]})});var gu={exports:{}},V9=gu.exports,S1;function W9(){return S1||(S1=1,(function(e,t){(function(n,r){e.exports=r()})(V9,(function(){var n=1e3,r=6e4,o=36e5,i="millisecond",s="second",a="minute",l="hour",u="day",d="week",f="month",h="quarter",p="year",m="date",b="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var L=["th","st","nd","rd"],$=_%100;return"["+_+(L[($-20)%10]||L[$]||L[0])+"]"}},v=function(_,L,$){var K=String(_);return!K||K.length>=L?_:""+Array(L+1-K.length).join($)+_},S={s:v,z:function(_){var L=-_.utcOffset(),$=Math.abs(L),K=Math.floor($/60),G=$%60;return(L<=0?"+":"-")+v(K,2,"0")+":"+v(G,2,"0")},m:function _(L,$){if(L.date()<$.date())return-_($,L);var K=12*($.year()-L.year())+($.month()-L.month()),G=L.clone().add(K,f),q=$-G<0,R=L.clone().add(K+(q?-1:1),f);return+(-(K+($-G)/(q?G-R:R-G))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:f,y:p,w:d,d:u,D:m,h:l,m:a,s,ms:i,Q:h}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},I="en",T={};T[I]=C;var N="$isDayjsObject",O=function(_){return _ instanceof D||!(!_||!_[N])},F=function _(L,$,K){var G;if(!L)return I;if(typeof L=="string"){var q=L.toLowerCase();T[q]&&(G=q),$&&(T[q]=$,G=q);var R=L.split("-");if(!G&&R.length>1)return _(R[0])}else{var oe=L.name;T[oe]=L,G=oe}return!K&&G&&(I=G),G||!K&&I},B=function(_,L){if(O(_))return _.clone();var $=typeof L=="object"?L:{};return $.date=_,$.args=arguments,new D($)},j=S;j.l=F,j.i=O,j.w=function(_,L){return B(_,{locale:L.$L,utc:L.$u,x:L.$x,$offset:L.$offset})};var D=(function(){function _($){this.$L=F($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[N]=!0}var L=_.prototype;return L.parse=function($){this.$d=(function(K){var G=K.date,q=K.utc;if(G===null)return new Date(NaN);if(j.u(G))return new Date;if(G instanceof Date)return new Date(G);if(typeof G=="string"&&!/Z$/i.test(G)){var R=G.match(y);if(R){var oe=R[2]-1||0,se=(R[7]||"0").substring(0,3);return q?new Date(Date.UTC(R[1],oe,R[3]||1,R[4]||0,R[5]||0,R[6]||0,se)):new Date(R[1],oe,R[3]||1,R[4]||0,R[5]||0,R[6]||0,se)}}return new Date(G)})($),this.init()},L.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},L.$utils=function(){return j},L.isValid=function(){return this.$d.toString()!==b},L.isSame=function($,K){var G=B($);return this.startOf(K)<=G&&G<=this.endOf(K)},L.isAfter=function($,K){return B($)<this.startOf(K)},L.isBefore=function($,K){return this.endOf(K)<B($)},L.$g=function($,K,G){return j.u($)?this[K]:this.set(G,$)},L.unix=function(){return Math.floor(this.valueOf()/1e3)},L.valueOf=function(){return this.$d.getTime()},L.startOf=function($,K){var G=this,q=!!j.u(K)||K,R=j.p($),oe=function(ae,ie){var Z=j.w(G.$u?Date.UTC(G.$y,ie,ae):new Date(G.$y,ie,ae),G);return q?Z:Z.endOf(u)},se=function(ae,ie){return j.w(G.toDate()[ae].apply(G.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(ie)),G)},z=this.$W,pe=this.$M,J=this.$D,Q="set"+(this.$u?"UTC":"");switch(R){case p:return q?oe(1,0):oe(31,11);case f:return q?oe(1,pe):oe(0,pe+1);case d:var re=this.$locale().weekStart||0,ne=(z<re?z+7:z)-re;return oe(q?J-ne:J+(6-ne),pe);case u:case m:return se(Q+"Hours",0);case l:return se(Q+"Minutes",1);case a:return se(Q+"Seconds",2);case s:return se(Q+"Milliseconds",3);default:return this.clone()}},L.endOf=function($){return this.startOf($,!1)},L.$set=function($,K){var G,q=j.p($),R="set"+(this.$u?"UTC":""),oe=(G={},G[u]=R+"Date",G[m]=R+"Date",G[f]=R+"Month",G[p]=R+"FullYear",G[l]=R+"Hours",G[a]=R+"Minutes",G[s]=R+"Seconds",G[i]=R+"Milliseconds",G)[q],se=q===u?this.$D+(K-this.$W):K;if(q===f||q===p){var z=this.clone().set(m,1);z.$d[oe](se),z.init(),this.$d=z.set(m,Math.min(this.$D,z.daysInMonth())).$d}else oe&&this.$d[oe](se);return this.init(),this},L.set=function($,K){return this.clone().$set($,K)},L.get=function($){return this[j.p($)]()},L.add=function($,K){var G,q=this;$=Number($);var R=j.p(K),oe=function(pe){var J=B(q);return j.w(J.date(J.date()+Math.round(pe*$)),q)};if(R===f)return this.set(f,this.$M+$);if(R===p)return this.set(p,this.$y+$);if(R===u)return oe(1);if(R===d)return oe(7);var se=(G={},G[a]=r,G[l]=o,G[s]=n,G)[R]||1,z=this.$d.getTime()+$*se;return j.w(z,this)},L.subtract=function($,K){return this.add(-1*$,K)},L.format=function($){var K=this,G=this.$locale();if(!this.isValid())return G.invalidDate||b;var q=$||"YYYY-MM-DDTHH:mm:ssZ",R=j.z(this),oe=this.$H,se=this.$m,z=this.$M,pe=G.weekdays,J=G.months,Q=G.meridiem,re=function(ie,Z,me,le){return ie&&(ie[Z]||ie(K,q))||me[Z].slice(0,le)},ne=function(ie){return j.s(oe%12||12,ie,"0")},ae=Q||function(ie,Z,me){var le=ie<12?"AM":"PM";return me?le.toLowerCase():le};return q.replace(x,(function(ie,Z){return Z||(function(me){switch(me){case"YY":return String(K.$y).slice(-2);case"YYYY":return j.s(K.$y,4,"0");case"M":return z+1;case"MM":return j.s(z+1,2,"0");case"MMM":return re(G.monthsShort,z,J,3);case"MMMM":return re(J,z);case"D":return K.$D;case"DD":return j.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return re(G.weekdaysMin,K.$W,pe,2);case"ddd":return re(G.weekdaysShort,K.$W,pe,3);case"dddd":return pe[K.$W];case"H":return String(oe);case"HH":return j.s(oe,2,"0");case"h":return ne(1);case"hh":return ne(2);case"a":return ae(oe,se,!0);case"A":return ae(oe,se,!1);case"m":return String(se);case"mm":return j.s(se,2,"0");case"s":return String(K.$s);case"ss":return j.s(K.$s,2,"0");case"SSS":return j.s(K.$ms,3,"0");case"Z":return R}return null})(ie)||R.replace(":","")}))},L.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},L.diff=function($,K,G){var q,R=this,oe=j.p(K),se=B($),z=(se.utcOffset()-this.utcOffset())*r,pe=this-se,J=function(){return j.m(R,se)};switch(oe){case p:q=J()/12;break;case f:q=J();break;case h:q=J()/3;break;case d:q=(pe-z)/6048e5;break;case u:q=(pe-z)/864e5;break;case l:q=pe/o;break;case a:q=pe/r;break;case s:q=pe/n;break;default:q=pe}return G?q:j.a(q)},L.daysInMonth=function(){return this.endOf(f).$D},L.$locale=function(){return T[this.$L]},L.locale=function($,K){if(!$)return this.$L;var G=this.clone(),q=F($,K,!0);return q&&(G.$L=q),G},L.clone=function(){return j.w(this.$d,this)},L.toDate=function(){return new Date(this.valueOf())},L.toJSON=function(){return this.isValid()?this.toISOString():null},L.toISOString=function(){return this.$d.toISOString()},L.toString=function(){return this.$d.toUTCString()},_})(),H=D.prototype;return B.prototype=H,[["$ms",i],["$s",s],["$m",a],["$H",l],["$W",u],["$M",f],["$y",p],["$D",m]].forEach((function(_){H[_[1]]=function(L){return this.$g(L,_[0],_[1])}})),B.extend=function(_,L){return _.$i||(_(L,D,B),_.$i=!0),B},B.locale=F,B.isDayjs=O,B.unix=function(_){return B(1e3*_)},B.en=T[I],B.Ls=T,B.p={},B}))})(gu)),gu.exports}var q9=W9();const _t=Tr(q9);var bu={exports:{}},Y9=bu.exports,k1;function K9(){return k1||(k1=1,(function(e,t){(function(n,r){e.exports=r()})(Y9,(function(){var n="week",r="year";return function(o,i,s){var a=i.prototype;a.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var u=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var d=s(this).startOf(r).add(1,r).date(u),f=s(this).endOf(n);if(d.isBefore(f))return 1}var h=s(this).startOf(r).date(u).startOf(n).subtract(1,"millisecond"),p=this.diff(h,n,!0);return p<0?s(this).startOf("week").week():Math.ceil(p)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}}))})(bu)),bu.exports}var G9=K9();const Q9=Tr(G9);var yu={exports:{}},X9=yu.exports,w1;function Z9(){return w1||(w1=1,(function(e,t){(function(n,r){e.exports=r()})(X9,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,o=/\d/,i=/\d\d/,s=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},u=function(y){return(y=+y)+(y>68?1900:2e3)},d=function(y){return function(x){this[y]=+x}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=(function(x){if(!x||x==="Z")return 0;var C=x.match(/([+-]|\d\d)/g),v=60*C[1]+(+C[2]||0);return v===0?0:C[0]==="+"?-v:v})(y)}],h=function(y){var x=l[y];return x&&(x.indexOf?x:x.s.concat(x.f))},p=function(y,x){var C,v=l.meridiem;if(v){for(var S=1;S<=24;S+=1)if(y.indexOf(v(S,0,x))>-1){C=S>12;break}}else C=y===(x?"pm":"PM");return C},m={A:[a,function(y){this.afternoon=p(y,!1)}],a:[a,function(y){this.afternoon=p(y,!0)}],Q:[o,function(y){this.month=3*(y-1)+1}],S:[o,function(y){this.milliseconds=100*+y}],SS:[i,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[s,d("seconds")],ss:[s,d("seconds")],m:[s,d("minutes")],mm:[s,d("minutes")],H:[s,d("hours")],h:[s,d("hours")],HH:[s,d("hours")],hh:[s,d("hours")],D:[s,d("day")],DD:[i,d("day")],Do:[a,function(y){var x=l.ordinal,C=y.match(/\d+/);if(this.day=C[0],x)for(var v=1;v<=31;v+=1)x(v).replace(/\[|\]/g,"")===y&&(this.day=v)}],w:[s,d("week")],ww:[i,d("week")],M:[s,d("month")],MM:[i,d("month")],MMM:[a,function(y){var x=h("months"),C=(h("monthsShort")||x.map((function(v){return v.slice(0,3)}))).indexOf(y)+1;if(C<1)throw new Error;this.month=C%12||C}],MMMM:[a,function(y){var x=h("months").indexOf(y)+1;if(x<1)throw new Error;this.month=x%12||x}],Y:[/[+-]?\d+/,d("year")],YY:[i,function(y){this.year=u(y)}],YYYY:[/\d{4}/,d("year")],Z:f,ZZ:f};function b(y){var x,C;x=y,C=l&&l.formats;for(var v=(y=x.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(B,j,D){var H=D&&D.toUpperCase();return j||C[D]||n[D]||C[H].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(_,L,$){return L||$.slice(1)}))}))).match(r),S=v.length,I=0;I<S;I+=1){var T=v[I],N=m[T],O=N&&N[0],F=N&&N[1];v[I]=F?{regex:O,parser:F}:T.replace(/^\[|\]$/g,"")}return function(B){for(var j={},D=0,H=0;D<S;D+=1){var _=v[D];if(typeof _=="string")H+=_.length;else{var L=_.regex,$=_.parser,K=B.slice(H),G=L.exec(K)[0];$.call(j,G),B=B.replace(G,"")}}return(function(q){var R=q.afternoon;if(R!==void 0){var oe=q.hours;R?oe<12&&(q.hours+=12):oe===12&&(q.hours=0),delete q.afternoon}})(j),j}}return function(y,x,C){C.p.customParseFormat=!0,y&&y.parseTwoDigitYear&&(u=y.parseTwoDigitYear);var v=x.prototype,S=v.parse;v.parse=function(I){var T=I.date,N=I.utc,O=I.args;this.$u=N;var F=O[1];if(typeof F=="string"){var B=O[2]===!0,j=O[3]===!0,D=B||j,H=O[2];j&&(H=O[2]),l=this.$locale(),!B&&H&&(l=C.Ls[H]),this.$d=(function(K,G,q,R){try{if(["x","X"].indexOf(G)>-1)return new Date((G==="X"?1e3:1)*K);var oe=b(G)(K),se=oe.year,z=oe.month,pe=oe.day,J=oe.hours,Q=oe.minutes,re=oe.seconds,ne=oe.milliseconds,ae=oe.zone,ie=oe.week,Z=new Date,me=pe||(se||z?1:Z.getDate()),le=se||Z.getFullYear(),ue=0;se&&!z||(ue=z>0?z-1:Z.getMonth());var Ie,Ce=J||0,we=Q||0,ye=re||0,ze=ne||0;return ae?new Date(Date.UTC(le,ue,me,Ce,we,ye,ze+60*ae.offset*1e3)):q?new Date(Date.UTC(le,ue,me,Ce,we,ye,ze)):(Ie=new Date(le,ue,me,Ce,we,ye,ze),ie&&(Ie=R(Ie).week(ie).toDate()),Ie)}catch{return new Date("")}})(T,F,N,C),this.init(),H&&H!==!0&&(this.$L=this.locale(H).$L),D&&T!=this.format(F)&&(this.$d=new Date("")),l={}}else if(F instanceof Array)for(var _=F.length,L=1;L<=_;L+=1){O[1]=F[L-1];var $=C.apply(this,O);if($.isValid()){this.$d=$.$d,this.$L=$.$L,this.init();break}L===_&&(this.$d=new Date(""))}else S.call(this,I)}}}))})(yu)),yu.exports}var J9=Z9();const eB=Tr(J9);var xu={exports:{}},tB=xu.exports,D1;function nB(){return D1||(D1=1,(function(e,t){(function(n,r){e.exports=r()})(tB,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,i){var s=o.prototype,a=s.format;i.en.formats=n,s.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var u=this.$locale().formats,d=(function(f,h){return f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(p,m,b){var y=b&&b.toUpperCase();return m||h[b]||n[b]||h[y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(x,C,v){return C||v.slice(1)}))}))})(l,u===void 0?{}:u);return a.call(this,d)}}}))})(xu)),xu.exports}var rB=nB();const oB=Tr(rB);var Cu={exports:{}},iB=Cu.exports,I1;function sB(){return I1||(I1=1,(function(e,t){(function(n,r){e.exports=r()})(iB,(function(){return function(n,r,o){r.prototype.isBetween=function(i,s,a,l){var u=o(i),d=o(s),f=(l=l||"()")[0]==="(",h=l[1]===")";return(f?this.isAfter(u,a):!this.isBefore(u,a))&&(h?this.isBefore(d,a):!this.isAfter(d,a))||(f?this.isBefore(u,a):!this.isAfter(u,a))&&(h?this.isAfter(d,a):!this.isBefore(d,a))}}}))})(Cu)),Cu.exports}var aB=sB();const lB=Tr(aB);var Eu={exports:{}},uB=Eu.exports,A1;function cB(){return A1||(A1=1,(function(e,t){(function(n,r){e.exports=r()})(uB,(function(){return function(n,r){var o=r.prototype,i=o.format;o.format=function(s){var a=this,l=this.$locale();if(!this.isValid())return i.bind(this)(s);var u=this.$utils(),d=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(f){switch(f){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return l.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return l.ordinal(a.week(),"W");case"w":case"ww":return u.s(a.week(),f==="w"?1:2,"0");case"W":case"WW":return u.s(a.isoWeek(),f==="W"?1:2,"0");case"k":case"kk":return u.s(String(a.$H===0?24:a.$H),f==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return f}}));return i.bind(this)(d)}}}))})(Eu)),Eu.exports}var dB=cB();const fB=Tr(dB);_t.extend(oB);_t.extend(Q9);_t.extend(lB);_t.extend(fB);const pB={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},hB={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",dayOfMonthFull:"Do",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},zd=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(`
|
|
197
|
+
`),O1=["Missing timezone plugin","To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join(`
|
|
198
|
+
`),mB=(e,t)=>t?(...n)=>e(...n).locale(t):e;class Bf{constructor({locale:t,formats:n}={}){this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="dayjs",this.dayjs=void 0,this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"[",end:"]"},this.formatTokenMap=pB,this.setLocaleToValue=r=>{const o=this.getCurrentLocaleCode();return o===r.locale()?r:r.locale(o)},this.hasUTCPlugin=()=>typeof _t.utc<"u",this.hasTimezonePlugin=()=>typeof _t.tz<"u",this.isSame=(r,o,i)=>{const s=this.setTimezone(o,this.getTimezone(r));return r.format(i)===s.format(i)},this.cleanTimezone=r=>{switch(r){case"default":return;case"system":return _t.tz.guess();default:return r}},this.createSystemDate=r=>{if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const o=_t.tz.guess();return o!=="UTC"?_t.tz(r,o):_t(r)}return _t(r)},this.createUTCDate=r=>{if(!this.hasUTCPlugin())throw new Error(zd);return _t.utc(r)},this.createTZDate=(r,o)=>{if(!this.hasUTCPlugin())throw new Error(zd);if(!this.hasTimezonePlugin())throw new Error(O1);const i=r!==void 0&&!r.endsWith("Z");return _t(r).tz(this.cleanTimezone(o),i)},this.getLocaleFormats=()=>{const r=_t.Ls,o=this.locale||"en";let i=r[o];return i===void 0&&(i=r.en),i.formats},this.adjustOffset=r=>{if(!this.hasTimezonePlugin())return r;const o=this.getTimezone(r);if(o!=="UTC"){const i=r.tz(this.cleanTimezone(o),!0);if(i.$offset===(r.$offset??0))return r;r.$offset=i.$offset}return r},this.date=(r,o="default")=>{if(r===null)return null;let i;return o==="UTC"?i=this.createUTCDate(r):o==="system"||o==="default"&&!this.hasTimezonePlugin()?i=this.createSystemDate(r):i=this.createTZDate(r,o),this.locale===void 0?i:i.locale(this.locale)},this.getInvalidDate=()=>_t(new Date("Invalid date")),this.getTimezone=r=>{if(this.hasTimezonePlugin()){const o=r.$x?.$timezone;if(o)return o}return this.hasUTCPlugin()&&r.isUTC()?"UTC":"system"},this.setTimezone=(r,o)=>{if(this.getTimezone(r)===o)return r;if(o==="UTC"){if(!this.hasUTCPlugin())throw new Error(zd);return r.utc()}if(o==="system")return r.local();if(!this.hasTimezonePlugin()){if(o==="default")return r;throw new Error(O1)}return _t.tz(r,this.cleanTimezone(o))},this.toJsDate=r=>r.toDate(),this.parse=(r,o)=>r===""?null:this.dayjs(r,o,this.locale,!0),this.getCurrentLocaleCode=()=>this.locale||"en",this.is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||""),this.expandFormat=r=>{const o=this.getLocaleFormats(),i=s=>s.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(a,l,u)=>l||u.slice(1));return r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(s,a,l)=>{const u=l&&l.toUpperCase();return a||o[l]||i(o[u])})},this.isValid=r=>r==null?!1:r.isValid(),this.format=(r,o)=>this.formatByString(r,this.formats[o]),this.formatByString=(r,o)=>this.dayjs(r).format(o),this.formatNumber=r=>r,this.isEqual=(r,o)=>r===null&&o===null?!0:r===null||o===null?!1:r.toDate().getTime()===o.toDate().getTime(),this.isSameYear=(r,o)=>this.isSame(r,o,"YYYY"),this.isSameMonth=(r,o)=>this.isSame(r,o,"YYYY-MM"),this.isSameDay=(r,o)=>this.isSame(r,o,"YYYY-MM-DD"),this.isSameHour=(r,o)=>r.isSame(o,"hour"),this.isAfter=(r,o)=>r>o,this.isAfterYear=(r,o)=>this.hasUTCPlugin()?!this.isSameYear(r,o)&&r.utc()>o.utc():r.isAfter(o,"year"),this.isAfterDay=(r,o)=>this.hasUTCPlugin()?!this.isSameDay(r,o)&&r.utc()>o.utc():r.isAfter(o,"day"),this.isBefore=(r,o)=>r<o,this.isBeforeYear=(r,o)=>this.hasUTCPlugin()?!this.isSameYear(r,o)&&r.utc()<o.utc():r.isBefore(o,"year"),this.isBeforeDay=(r,o)=>this.hasUTCPlugin()?!this.isSameDay(r,o)&&r.utc()<o.utc():r.isBefore(o,"day"),this.isWithinRange=(r,[o,i])=>r>=o&&r<=i,this.startOfYear=r=>this.adjustOffset(r.startOf("year")),this.startOfMonth=r=>this.adjustOffset(r.startOf("month")),this.startOfWeek=r=>this.adjustOffset(this.setLocaleToValue(r).startOf("week")),this.startOfDay=r=>this.adjustOffset(r.startOf("day")),this.endOfYear=r=>this.adjustOffset(r.endOf("year")),this.endOfMonth=r=>this.adjustOffset(r.endOf("month")),this.endOfWeek=r=>this.adjustOffset(this.setLocaleToValue(r).endOf("week")),this.endOfDay=r=>this.adjustOffset(r.endOf("day")),this.addYears=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"year"):r.add(o,"year")),this.addMonths=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"month"):r.add(o,"month")),this.addWeeks=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"week"):r.add(o,"week")),this.addDays=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"day"):r.add(o,"day")),this.addHours=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"hour"):r.add(o,"hour")),this.addMinutes=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"minute"):r.add(o,"minute")),this.addSeconds=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"second"):r.add(o,"second")),this.getYear=r=>r.year(),this.getMonth=r=>r.month(),this.getDate=r=>r.date(),this.getHours=r=>r.hour(),this.getMinutes=r=>r.minute(),this.getSeconds=r=>r.second(),this.getMilliseconds=r=>r.millisecond(),this.setYear=(r,o)=>this.adjustOffset(r.set("year",o)),this.setMonth=(r,o)=>this.adjustOffset(r.set("month",o)),this.setDate=(r,o)=>this.adjustOffset(r.set("date",o)),this.setHours=(r,o)=>this.adjustOffset(r.set("hour",o)),this.setMinutes=(r,o)=>this.adjustOffset(r.set("minute",o)),this.setSeconds=(r,o)=>this.adjustOffset(r.set("second",o)),this.setMilliseconds=(r,o)=>this.adjustOffset(r.set("millisecond",o)),this.getDaysInMonth=r=>r.daysInMonth(),this.getWeekArray=r=>{const o=this.startOfWeek(this.startOfMonth(r)),i=this.endOfWeek(this.endOfMonth(r));let s=0,a=o;const l=[];for(;a<i;){const u=Math.floor(s/7);l[u]=l[u]||[],l[u].push(a),a=this.addDays(a,1),s+=1}return l},this.getWeekNumber=r=>r.week(),this.getYearRange=([r,o])=>{const i=this.startOfYear(r),s=this.endOfYear(o),a=[];let l=i;for(;this.isBefore(l,s);)a.push(l),l=this.addYears(l,1);return a},this.dayjs=mB(_t,t),this.locale=t,this.formats=Y({},hB,n),_t.extend(eB)}getDayOfWeek(t){return t.day()+1}}function gB(e,t,n,r,o){const[i,s]=M.useState(()=>o&&n?n(e).matches:r?r(e).matches:t);return yn(()=>{if(!n)return;const a=n(e),l=()=>{s(a.matches)};return l(),a.addEventListener("change",l),()=>{a.removeEventListener("change",l)}},[e,n]),i}const bB={...M},K2=bB.useSyncExternalStore;function yB(e,t,n,r,o){const i=M.useCallback(()=>t,[t]),s=M.useMemo(()=>{if(o&&n)return()=>n(e).matches;if(r!==null){const{matches:d}=r(e);return()=>d}return i},[i,e,r,o,n]),[a,l]=M.useMemo(()=>{if(n===null)return[i,()=>()=>{}];const d=n(e);return[()=>d.matches,f=>(d.addEventListener("change",f),()=>{d.removeEventListener("change",f)})]},[i,n,e]);return K2(l,a,s)}function G2(e={}){const{themeId:t}=e;return function(r,o={}){let i=fb();i&&t&&(i=i[t]||i);const s=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:a=!1,matchMedia:l=s?window.matchMedia:null,ssrMatchMedia:u=null,noSsr:d=!1}=w2({name:"MuiUseMediaQuery",props:o,theme:i});let f=typeof r=="function"?r(i):r;return f=f.replace(/^@media( ?)/m,""),f.includes("print")&&console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.","Using the print media query to modify print styles can lead to unexpected results.","Consider using the `displayPrint` field in the `sx` prop instead.","More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(`
|
|
199
|
+
`)),(K2!==void 0?yB:gB)(f,a,l,u,d)}}G2();const Q2=G2({themeId:Cs}),xB={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},ma=(e,t)=>e.length!==t.length?!1:t.every(n=>e.includes(n)),CB=({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{const o=n??r;let i;if(e!=null)i=e;else if(o.includes(t))i=t;else if(o.length>0)i=o[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:o,openTo:i}},Qu=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n)),r},qa=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:o,isDateDisabled:i,utils:s,timezone:a})=>{const l=Qu(s,s.date(void 0,a),e);n&&s.isBefore(o,l)&&(o=l),t&&s.isAfter(r,l)&&(r=l);let u=e,d=e;for(s.isBefore(e,o)&&(u=o,d=null),s.isAfter(e,r)&&(d&&(d=r),u=null);u||d;){if(u&&s.isAfter(u,r)&&(u=null),d&&s.isBefore(d,o)&&(d=null),u){if(!i(u))return u;u=s.addDays(u,1)}if(d){if(!i(d))return d;d=s.addDays(d,-1)}}return null},EB=(e,t)=>t==null||!e.isValid(t)?null:t,vr=(e,t,n)=>t==null||!e.isValid(t)?n:t,vB=(e,t,n)=>!e.isValid(t)&&t!=null&&!e.isValid(n)&&n!=null?!0:e.isEqual(t,n),Xp=(e,t)=>{const r=[e.startOfYear(t)];for(;r.length<12;){const o=r[r.length-1];r.push(e.addMonths(o,1))}return r},X2=(e,t,n)=>n==="date"?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),TB=["year","month","day"],M1=e=>TB.includes(e),Zp=(e,{format:t,views:n},r)=>{if(t!=null)return t;const o=e.formats;return ma(n,["year"])?o.year:ma(n,["month"])?o.month:ma(n,["day"])?o.dayOfMonth:ma(n,["month","year"])?`${o.month} ${o.year}`:ma(n,["day","month"])?`${o.month} ${o.dayOfMonth}`:r?/en/.test(e.getCurrentLocaleCode())?o.normalDateWithWeekday:o.normalDate:o.keyboardDate},SB=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(r=>e.addDays(n,r))},kB=["hours","minutes","seconds"],wB=e=>kB.includes(e),P1=(e,t)=>t.getHours(e)*3600+t.getMinutes(e)*60+t.getSeconds(e),DB=(e,t)=>(n,r)=>e?t.isAfter(n,r):P1(n,t)>P1(r,t),Kr={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},IB=e=>Math.max(...e.map(t=>Kr[t.type]??1)),ga=(e,t,n)=>{if(t===Kr.year)return e.startOfYear(n);if(t===Kr.month)return e.startOfMonth(n);if(t===Kr.day)return e.startOfDay(n);let r=n;return t<Kr.minutes&&(r=e.setMinutes(r,0)),t<Kr.seconds&&(r=e.setSeconds(r,0)),t<Kr.milliseconds&&(r=e.setMilliseconds(r,0)),r},AB=({props:e,utils:t,granularity:n,timezone:r,getTodayDate:o})=>{let i=o?o():ga(t,n,X2(t,r));e.minDate!=null&&t.isAfterDay(e.minDate,i)&&(i=ga(t,n,e.minDate)),e.maxDate!=null&&t.isBeforeDay(e.maxDate,i)&&(i=ga(t,n,e.maxDate));const s=DB(e.disableIgnoringDatePartForTimeValidation??!1,t);return e.minTime!=null&&s(e.minTime,i)&&(i=ga(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:Qu(t,i,e.minTime))),e.maxTime!=null&&s(i,e.maxTime)&&(i=ga(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:Qu(t,i,e.maxTime))),i},Z2=(e,t)=>{const n=e.formatTokenMap[t];if(n==null)throw new Error([`MUI X: The token "${t}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(`
|
|
200
|
+
`));return typeof n=="string"?{type:n,contentType:n==="meridiem"?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},OB=e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},Mc=(e,t)=>{const n=[],r=e.date(void 0,"default"),o=e.startOfWeek(r),i=e.endOfWeek(r);let s=o;for(;e.isBefore(s,i);)n.push(s),s=e.addDays(s,1);return n.map(a=>e.formatByString(a,t))},J2=(e,t,n,r)=>{switch(n){case"month":return Xp(e,e.date(void 0,t)).map(o=>e.formatByString(o,r));case"weekDay":return Mc(e,r);case"meridiem":{const o=e.date(void 0,t);return[e.startOfDay(o),e.endOfDay(o)].map(i=>e.formatByString(i,r))}default:return[]}},R1="s",MB=["0","1","2","3","4","5","6","7","8","9"],PB=e=>{const t=e.date(void 0);return e.formatByString(e.setSeconds(t,0),R1)==="0"?MB:Array.from({length:10}).map((r,o)=>e.formatByString(e.setSeconds(t,o),R1))},gi=(e,t)=>{if(t[0]==="0")return e;const n=[];let r="";for(let o=0;o<e.length;o+=1){r+=e[o];const i=t.indexOf(r);i>-1&&(n.push(i.toString()),r="")}return n.join("")},Jp=(e,t)=>t[0]==="0"?e:e.split("").map(n=>t[Number(n)]).join(""),N1=(e,t)=>{const n=gi(e,t);return n!==" "&&!Number.isNaN(Number(n))},eC=(e,t)=>{let n=e;for(n=Number(n).toString();n.length<t;)n=`0${n}`;return n},tC=(e,t,n,r,o)=>{if(o.type==="day"&&o.contentType==="digit-with-letter"){const s=e.setDate(n.longestMonth,t);return e.formatByString(s,o.format)}let i=t.toString();return o.hasLeadingZerosInInput&&(i=eC(i,o.maxLength)),Jp(i,r)},RB=(e,t,n,r,o,i,s,a)=>{const l=OB(r),u=r==="Home",d=r==="End",f=n.value===""||u||d,h=()=>{const m=o[n.type]({currentDate:s,format:n.format,contentType:n.contentType}),b=C=>tC(e,C,m,i,n),y=n.type==="minutes"&&a?.minutesStep?a.minutesStep:1;let x;if(f){if(n.type==="year"&&!d&&!u)return e.formatByString(e.date(void 0,t),n.format);l>0||u?x=m.minimum:x=m.maximum}else x=parseInt(gi(n.value,i),10)+l*y;return x%y!==0&&((l<0||u)&&(x+=y-(y+x)%y),(l>0||d)&&(x-=x%y)),x>m.maximum?b(m.minimum+(x-m.maximum-1)%(m.maximum-m.minimum+1)):x<m.minimum?b(m.maximum-(m.minimum-x-1)%(m.maximum-m.minimum+1)):b(x)},p=()=>{const m=J2(e,t,n.type,n.format);if(m.length===0)return n.value;if(f)return l>0||u?m[0]:m[m.length-1];const x=((m.indexOf(n.value)+l)%m.length+m.length)%m.length;return m[x]};return n.contentType==="digit"||n.contentType==="digit-with-letter"?h():p()},eh=(e,t,n)=>{let r=e.value||e.placeholder;const o=t==="non-input"?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return t==="non-input"&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(r=Number(gi(r,n)).toString()),["input-rtl","input-ltr"].includes(t)&&e.contentType==="digit"&&!o&&r.length===1&&(r=`${r}`),t==="input-rtl"&&(r=`${r}`),r},F1=(e,t,n,r)=>e.formatByString(e.parse(t,n),r),NB=(e,t)=>e.formatByString(e.date(void 0,"system"),t).length===4,nC=(e,t,n,r)=>{if(t!=="digit")return!1;const o=e.date(void 0,"default");switch(n){case"year":return e.lib==="dayjs"&&r==="YY"?!0:e.formatByString(e.setYear(o,1),r).startsWith("0");case"month":return e.formatByString(e.startOfYear(o),r).length>1;case"day":return e.formatByString(e.startOfMonth(o),r).length>1;case"weekDay":return e.formatByString(e.startOfWeek(o),r).length>1;case"hours":return e.formatByString(e.setHours(o,1),r).length>1;case"minutes":return e.formatByString(e.setMinutes(o,1),r).length>1;case"seconds":return e.formatByString(e.setSeconds(o,1),r).length>1;default:throw new Error("Invalid section type")}},FB=(e,t,n)=>{const r=t.some(l=>l.type==="day"),o=[],i=[];for(let l=0;l<t.length;l+=1){const u=t[l];r&&u.type==="weekDay"||(o.push(u.format),i.push(eh(u,"non-input",n)))}const s=o.join(" "),a=i.join(" ");return e.parse(a,s)},LB=e=>e.map(t=>`${t.startSeparator}${t.value||t.placeholder}${t.endSeparator}`).join(""),_B=(e,t,n)=>{const o=e.map(i=>{const s=eh(i,n?"input-rtl":"input-ltr",t);return`${i.startSeparator}${s}${i.endSeparator}`}).join("");return n?`${o}`:o},BB=(e,t,n)=>{const r=e.date(void 0,n),o=e.endOfYear(r),i=e.endOfDay(r),{maxDaysInMonth:s,longestMonth:a}=Xp(e,r).reduce((l,u)=>{const d=e.getDaysInMonth(u);return d>l.maxDaysInMonth?{maxDaysInMonth:d,longestMonth:u}:l},{maxDaysInMonth:0,longestMonth:null});return{year:({format:l})=>({minimum:0,maximum:NB(e,l)?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(o)+1}),day:({currentDate:l})=>({minimum:1,maximum:l!=null&&e.isValid(l)?e.getDaysInMonth(l):s,longestMonth:a}),weekDay:({format:l,contentType:u})=>{if(u==="digit"){const d=Mc(e,l).map(Number);return{minimum:Math.min(...d),maximum:Math.max(...d)}}return{minimum:1,maximum:7}},hours:({format:l})=>{const u=e.getHours(i);return gi(e.formatByString(e.endOfDay(r),l),t)!==u.toString()?{minimum:1,maximum:Number(gi(e.formatByString(e.startOfDay(r),l),t))}:{minimum:0,maximum:u}},minutes:()=>({minimum:0,maximum:e.getMinutes(i)}),seconds:()=>({minimum:0,maximum:e.getSeconds(i)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},jB=(e,t,n,r)=>{switch(t.type){case"year":return e.setYear(r,e.getYear(n));case"month":return e.setMonth(r,e.getMonth(n));case"weekDay":{const o=Mc(e,t.format),i=e.formatByString(n,t.format),s=o.indexOf(i),l=o.indexOf(t.value)-s;return e.addDays(n,l)}case"day":return e.setDate(r,e.getDate(n));case"meridiem":{const o=e.getHours(n)<12,i=e.getHours(r);return o&&i>=12?e.addHours(r,-12):!o&&i<12?e.addHours(r,12):r}case"hours":return e.setHours(r,e.getHours(n));case"minutes":return e.setMinutes(r,e.getMinutes(n));case"seconds":return e.setSeconds(r,e.getSeconds(n));default:return r}},L1={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},_1=(e,t,n,r,o)=>[...n].sort((i,s)=>L1[i.type]-L1[s.type]).reduce((i,s)=>!o||s.modified?jB(e,s,t,i):i,r),$B=()=>navigator.userAgent.toLowerCase().includes("android"),HB=(e,t)=>{const n={};if(!t)return e.forEach((l,u)=>{const d=u===0?null:u-1,f=u===e.length-1?null:u+1;n[u]={leftIndex:d,rightIndex:f}}),{neighbors:n,startIndex:0,endIndex:e.length-1};const r={},o={};let i=0,s=0,a=e.length-1;for(;a>=0;){s=e.findIndex((l,u)=>u>=i&&l.endSeparator?.includes(" ")&&l.endSeparator!==" / "),s===-1&&(s=e.length-1);for(let l=s;l>=i;l-=1)o[l]=a,r[a]=l,a-=1;i=s+1}return e.forEach((l,u)=>{const d=o[u],f=d===0?null:r[d-1],h=d===e.length-1?null:r[d+1];n[u]={leftIndex:f,rightIndex:h}}),{neighbors:n,startIndex:r[0],endIndex:r[e.length-1]}},jf=(e,t)=>{if(e==null)return null;if(e==="all")return"all";if(typeof e=="string"){const n=t.findIndex(r=>r.type===e);return n===-1?null:n}return e},zB=(e,t)=>{if(e.value)switch(e.type){case"month":{if(e.contentType==="digit")return t.format(t.setMonth(t.date(),Number(e.value)-1),"month");const n=t.parse(e.value,e.format);return n?t.format(n,"month"):void 0}case"day":return e.contentType==="digit"?t.format(t.setDate(t.startOfYear(t.date()),Number(e.value)),"dayOfMonthFull"):e.value;case"weekDay":return;default:return}},UB=(e,t)=>{if(e.value)switch(e.type){case"weekDay":return e.contentType==="letter"?void 0:Number(e.value);case"meridiem":{const n=t.parse(`01:00 ${e.value}`,`${t.formats.hours12h}:${t.formats.minutes} ${e.format}`);return n?t.getHours(n)>=12?1:0:void 0}case"day":return e.contentType==="digit-with-letter"?parseInt(e.value,10):Number(e.value);case"month":{if(e.contentType==="digit")return Number(e.value);const n=t.parse(e.value,e.format);return n?t.getMonth(n)+1:void 0}default:return e.contentType!=="letter"?Number(e.value):void 0}},VB=["value","referenceDate"],Zr={emptyValue:null,getTodayValue:X2,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=Ze(e,VB);return t!=null&&r.utils.isValid(t)?t:n??AB(r)},cleanValue:EB,areValuesEqual:vB,isSameError:(e,t)=>e===t,hasError:e=>e!=null,defaultErrorState:null,getTimezone:(e,t)=>t==null||!e.isValid(t)?null:e.getTimezone(t),setTimezone:(e,t,n)=>n==null?null:e.setTimezone(n,t)},WB={updateReferenceValue:(e,t,n)=>t==null||!e.isValid(t)?n:t,getSectionsFromValue:(e,t,n,r)=>!e.isValid(t)&&!!n?n:r(t),getV7HiddenInputValueFromSections:LB,getV6InputValueFromSections:_B,getActiveDateManager:(e,t)=>({date:t.value,referenceDate:t.referenceValue,getSections:n=>n,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:n==null||!e.isValid(n)?t.referenceValue:n})}),parseValueStr:(e,t,n)=>n(e.trim(),t)},qB=["localeText"],$f=M.createContext(null),Xu=function(t){const{localeText:n}=t,r=Ze(t,qB),{utils:o,localeText:i}=M.useContext($f)??{utils:void 0,localeText:void 0},s=Kt({props:r,name:"MuiLocalizationProvider"}),{children:a,dateAdapter:l,dateFormats:u,dateLibInstance:d,adapterLocale:f,localeText:h}=s,p=M.useMemo(()=>Y({},h,i,n),[h,i,n]),m=M.useMemo(()=>{if(!l)return o||null;const x=new l({locale:f,formats:u,instance:d});if(!x.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(`
|
|
201
|
+
`));return x},[l,f,u,d,o]),b=M.useMemo(()=>m?{minDate:m.date("1900-01-01T00:00:00.000"),maxDate:m.date("2099-12-31T00:00:00.000")}:null,[m]),y=M.useMemo(()=>({utils:m,defaultDates:b,localeText:p}),[b,m,p]);return c.jsx($f.Provider,{value:y,children:a})},YB=e=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:Y({},e)}}}}),rC=e=>{const{utils:t,formatKey:n,contextTranslation:r,propsTranslation:o}=e;return i=>{const s=i!==null&&t.isValid(i)?t.format(i,n):null;return(o??r)(i,t,s)}},oC={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:e=>e==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(e,t,n,r)=>`Select ${e}. ${!r&&(t===null||!n.isValid(t))?"No time selected":`Selected time is ${r??n.format(t,"fullTime")}`}`,hoursClockNumberText:e=>`${e} hours`,minutesClockNumberText:e=>`${e} minutes`,secondsClockNumberText:e=>`${e} seconds`,selectViewText:e=>`Select ${e}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:e=>`Week ${e}`,calendarWeekNumberText:e=>`${e}`,openDatePickerDialogue:(e,t,n)=>n||e!==null&&t.isValid(e)?`Choose date, selected date is ${n??t.format(e,"fullDate")}`:"Choose date",openTimePickerDialogue:(e,t,n)=>n||e!==null&&t.isValid(e)?`Choose time, selected time is ${n??t.format(e,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:e=>"Y".repeat(e.digitAmount),fieldMonthPlaceholder:e=>e.contentType==="letter"?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:e=>e.contentType==="letter"?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"},KB=oC;YB(oC);const Ti=()=>{const e=M.useContext($f);if(e===null)throw new Error(["MUI X: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join(`
|
|
202
|
+
`));if(e.utils===null)throw new Error(["MUI X: Can not find the date and time pickers adapter from its localization context.","It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider."].join(`
|
|
203
|
+
`));const t=M.useMemo(()=>Y({},KB,e.localeText),[e.localeText]);return M.useMemo(()=>Y({},e,{localeText:t}),[e,t])},Zt=()=>Ti().utils,kl=()=>Ti().defaultDates,Pc=e=>{const t=Zt(),n=M.useRef(void 0);return n.current===void 0&&(n.current=t.date(void 0,e)),n.current};function GB(e){return Ge("MuiPickersToolbar",e)}We("MuiPickersToolbar",["root","content"]);const QB=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],XB=e=>{const{classes:t}=e;return Ke({root:["root"],content:["content"]},GB,t)},ZB=fe("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),JB=fe("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),ej=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersToolbar"}),{children:o,className:i,toolbarTitle:s,hidden:a,titleId:l}=r,u=Ze(r,QB),d=r,f=XB(d);return a?null:c.jsxs(ZB,Y({ref:n,className:Ue(f.root,i),ownerState:d},u,{children:[c.jsx(Dt,{color:"text.secondary",variant:"overline",id:l,children:s}),c.jsx(JB,{className:f.content,ownerState:d,children:o})]}))}),vo=()=>Ti().localeText;function tj(e){return Ge("MuiDatePickerToolbar",e)}We("MuiDatePickerToolbar",["root","title"]);const nj=["value","isLandscape","onChange","toolbarFormat","toolbarPlaceholder","views","className","onViewChange","view"],rj=e=>{const{classes:t}=e;return Ke({root:["root"],title:["title"]},tj,t)},oj=fe(ej,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),ij=fe(Dt,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(e,t)=>t.title})({variants:[{props:{isLandscape:!0},style:{margin:"auto 16px auto auto"}}]}),sj=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiDatePickerToolbar"}),{value:o,isLandscape:i,toolbarFormat:s,toolbarPlaceholder:a="––",views:l,className:u}=r,d=Ze(r,nj),f=Zt(),h=vo(),p=rj(r),m=M.useMemo(()=>{if(!o)return a;const y=Zp(f,{format:s,views:l},!0);return f.formatByString(o,y)},[o,s,a,f,l]),b=r;return c.jsx(oj,Y({ref:n,toolbarTitle:h.datePickerToolbarTitle,isLandscape:i,className:Ue(p.root,u)},d,{children:c.jsx(ij,{variant:"h4",align:i?"left":"center",ownerState:b,className:p.title,children:m})}))});function iC(e,t){const n=Zt(),r=kl(),o=Kt({props:e,name:t}),i=M.useMemo(()=>o.localeText?.toolbarTitle==null?o.localeText:Y({},o.localeText,{datePickerToolbarTitle:o.localeText.toolbarTitle}),[o.localeText]);return Y({},o,{localeText:i},CB({views:o.views,openTo:o.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{disableFuture:o.disableFuture??!1,disablePast:o.disablePast??!1,minDate:vr(n,o.minDate,r.minDate),maxDate:vr(n,o.maxDate,r.maxDate),slots:Y({toolbar:sj},o.slots)})}const wl=({props:e,value:t,timezone:n,adapter:r})=>{if(t===null)return null;const{shouldDisableDate:o,shouldDisableMonth:i,shouldDisableYear:s,disablePast:a,disableFuture:l}=e,u=r.utils.date(void 0,n),d=vr(r.utils,e.minDate,r.defaultDates.minDate),f=vr(r.utils,e.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(t):return"invalidDate";case!!(o&&o(t)):return"shouldDisableDate";case!!(i&&i(t)):return"shouldDisableMonth";case!!(s&&s(t)):return"shouldDisableYear";case!!(l&&r.utils.isAfterDay(t,u)):return"disableFuture";case!!(a&&r.utils.isBeforeDay(t,u)):return"disablePast";case!!(d&&r.utils.isBeforeDay(t,d)):return"minDate";case!!(f&&r.utils.isAfterDay(t,f)):return"maxDate";default:return null}};wl.valueManager=Zr;const sC=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],aj=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],lj=["minDateTime","maxDateTime"],uj=[...sC,...aj,...lj],aC=e=>uj.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{});function lC(e){const{props:t,validator:n,value:r,timezone:o,onError:i}=e,s=Ti(),a=M.useRef(n.valueManager.defaultErrorState),l=n({adapter:s,value:r,timezone:o,props:t}),u=n.valueManager.hasError(l);M.useEffect(()=>{i&&!n.valueManager.isSameError(l,a.current)&&i(l,r),a.current=l},[n,i,l,r]);const d=Ve(f=>n({adapter:s,value:f,timezone:o,props:t}));return{validationError:l,hasValidationError:u,getValidationErrorForNewValue:d}}function cj(e){return Ge("MuiInputAdornment",e)}const B1=We("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var j1;const dj=(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${Fe(n.position)}`],n.disablePointerEvents===!0&&t.disablePointerEvents,t[n.variant]]},fj=e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:r,position:o,size:i,variant:s}=e,a={root:["root",n&&"disablePointerEvents",o&&`position${Fe(o)}`,s,r&&"hiddenLabel",i&&`size${Fe(i)}`]};return Ke(a,cj,t)},pj=fe("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:dj})(ft(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${B1.positionStart}&:not(.${B1.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),uC=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiInputAdornment"}),{children:o,className:i,component:s="div",disablePointerEvents:a=!1,disableTypography:l=!1,position:u,variant:d,...f}=r,h=ar()||{};let p=d;d&&h.variant,h&&!p&&(p=h.variant);const m={...r,hiddenLabel:h.hiddenLabel,size:h.size,disablePointerEvents:a,position:u,variant:p},b=fj(m);return c.jsx(kc.Provider,{value:null,children:c.jsx(pj,{as:s,ownerState:m,className:Ue(b.root,i),ref:n,...f,children:typeof o=="string"&&!l?c.jsx(Dt,{color:"textSecondary",children:o}):c.jsxs(M.Fragment,{children:[u==="start"?j1||(j1=c.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):null,o]})})})});function hj(e){return Ge("MuiPickersPopper",e)}We("MuiPickersPopper",["root","paper"]);function mj(e,t){return Array.isArray(t)?t.every(n=>e.indexOf(n)!==-1):e.indexOf(t)!==-1}const gj=(e,t)=>n=>{(n.key==="Enter"||n.key===" ")&&(e(n),n.preventDefault(),n.stopPropagation())},Wn=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?Wn(t.shadowRoot):t:null},bj="@media (pointer: fine)",yj="@media (prefers-reduced-motion: reduce)",as=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),$1=as&&as[1]?parseInt(as[1],10):null,H1=as&&as[2]?parseInt(as[2],10):null,xj=$1&&$1<10||H1&&H1<13||!1,cC=()=>Q2(yj,{defaultMatches:!1})||xj,Cj=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],Ej=e=>{const{classes:t}=e;return Ke({root:["root"],paper:["paper"]},hj,t)},vj=fe(Qp,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({zIndex:e.zIndex.modal})),Tj=fe(Ci,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(e,t)=>t.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:e})=>["top","top-start","top-end"].includes(e),style:{transformOrigin:"bottom center"}}]});function Sj(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function kj(e,t){const n=M.useRef(!1),r=M.useRef(!1),o=M.useRef(null),i=M.useRef(!1);M.useEffect(()=>{if(!e)return;function l(){i.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),i.current=!1}},[e]);const s=Ve(l=>{if(!i.current)return;const u=r.current;r.current=!1;const d=mn(o.current);if(!o.current||"clientX"in l&&Sj(l,d))return;if(n.current){n.current=!1;return}let f;l.composedPath?f=l.composedPath().indexOf(o.current)>-1:f=!d.documentElement.contains(l.target)||o.current.contains(l.target),!f&&!u&&t(l)}),a=()=>{r.current=!0};return M.useEffect(()=>{if(e){const l=mn(o.current),u=()=>{n.current=!0};return l.addEventListener("touchstart",s),l.addEventListener("touchmove",u),()=>{l.removeEventListener("touchstart",s),l.removeEventListener("touchmove",u)}}},[e,s]),M.useEffect(()=>{if(e){const l=mn(o.current);return l.addEventListener("click",s),()=>{l.removeEventListener("click",s),r.current=!1}}},[e,s]),[o,a,a]}const wj=M.forwardRef((e,t)=>{const{PaperComponent:n,popperPlacement:r,ownerState:o,children:i,paperSlotProps:s,paperClasses:a,onPaperClick:l,onPaperTouchStart:u}=e,d=Ze(e,Cj),f=Y({},o,{placement:r}),h=Et({elementType:n,externalSlotProps:s,additionalProps:{tabIndex:-1,elevation:8,ref:t},className:a,ownerState:f});return c.jsx(n,Y({},d,h,{onClick:p=>{l(p),h.onClick?.(p)},onTouchStart:p=>{u(p),h.onTouchStart?.(p)},ownerState:f,children:i}))});function Dj(e){const t=Kt({props:e,name:"MuiPickersPopper"}),{anchorEl:n,children:r,containerRef:o=null,shouldRestoreFocus:i,onBlur:s,onDismiss:a,open:l,role:u,placement:d,slots:f,slotProps:h,reduceAnimations:p}=t;M.useEffect(()=>{function L($){l&&$.key==="Escape"&&a()}return document.addEventListener("keydown",L),()=>{document.removeEventListener("keydown",L)}},[a,l]);const m=M.useRef(null);M.useEffect(()=>{u==="tooltip"||i&&!i()||(l?m.current=Wn(document):m.current&&m.current instanceof HTMLElement&&setTimeout(()=>{m.current instanceof HTMLElement&&m.current.focus()}))},[l,u,i]);const[b,y,x]=kj(l,s??a),C=M.useRef(null),v=vt(C,o),S=vt(v,b),I=t,T=Ej(I),N=cC(),O=p??N,F=L=>{L.key==="Escape"&&(L.stopPropagation(),a())},B=f?.desktopTransition??O?hi:el,j=f?.desktopTrapFocus??d2,D=f?.desktopPaper??Tj,H=f?.popper??vj,_=Et({elementType:H,externalSlotProps:h?.popper,additionalProps:{transition:!0,role:u,open:l,anchorEl:n,placement:d,onKeyDown:F},className:T.root,ownerState:t});return c.jsx(H,Y({},_,{children:({TransitionProps:L,placement:$})=>c.jsx(j,Y({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:u==="tooltip",isEnabled:()=>!0},h?.desktopTrapFocus,{children:c.jsx(B,Y({},L,h?.desktopTransition,{children:c.jsx(wj,{PaperComponent:D,ownerState:I,popperPlacement:$,ref:S,onPaperClick:y,onPaperTouchStart:x,paperClasses:T.paper,paperSlotProps:h?.desktopPaper,children:r})}))}))}))}const Ij=({open:e,onOpen:t,onClose:n})=>{const r=M.useRef(typeof e=="boolean").current,[o,i]=M.useState(!1);M.useEffect(()=>{if(r){if(typeof e!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");i(e)}},[r,e]);const s=M.useCallback(a=>{r||i(a),a&&t&&t(),!a&&n&&n()},[r,t,n]);return{isOpen:o,setIsOpen:s}},th=({timezone:e,value:t,defaultValue:n,referenceDate:r,onChange:o,valueManager:i})=>{const s=Zt(),a=M.useRef(n),l=t??a.current??i.emptyValue,u=M.useMemo(()=>i.getTimezone(s,l),[s,i,l]),d=Ve(m=>u==null?m:i.setTimezone(s,u,m));let f;e?f=e:u?f=u:r?f=s.getTimezone(r):f="default";const h=M.useMemo(()=>i.setTimezone(s,f,l),[i,s,f,l]),p=Ve((m,...b)=>{const y=d(m);o?.(y,...b)});return{value:h,handleValueChange:p,timezone:f}},nh=({name:e,timezone:t,value:n,defaultValue:r,referenceDate:o,onChange:i,valueManager:s})=>{const[a,l]=or({name:e,state:"value",controlled:n,default:r??s.emptyValue}),u=Ve((d,...f)=>{l(d),i?.(d,...f)});return th({timezone:t,value:a,defaultValue:void 0,referenceDate:o,onChange:u,valueManager:s})},Aj=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:o}=e,i=!o&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromField"?!0:t.name==="setValueFromAction"?i&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastPublishedValue):t.name==="setValueFromView"&&t.selectionState!=="shallow"||t.name==="setValueFromShortcut"?i?!0:n(r.lastPublishedValue):!1},Oj=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:o,closeOnSelect:i}=e,s=!o&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromAction"?s&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastCommittedValue):t.name==="setValueFromView"&&t.selectionState==="finish"&&i?s?!0:n(r.lastCommittedValue):t.name==="setValueFromShortcut"?t.changeImportance==="accept"&&n(r.lastCommittedValue):!1},Mj=e=>{const{action:t,closeOnSelect:n}=e;return t.name==="setValueFromAction"?!0:t.name==="setValueFromView"?t.selectionState==="finish"&&n:t.name==="setValueFromShortcut"?t.changeImportance==="accept":!1},Pj=({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:o})=>{const{onAccept:i,onChange:s,value:a,defaultValue:l,closeOnSelect:u=r==="desktop",timezone:d,referenceDate:f}=e,{current:h}=M.useRef(l),{current:p}=M.useRef(a!==void 0),[m,b]=M.useState(d),y=Zt(),x=Ti(),{isOpen:C,setIsOpen:v}=Ij(e),{timezone:S,value:I,handleValueChange:T}=th({timezone:d,value:a,defaultValue:h,referenceDate:f,onChange:s,valueManager:t}),[N,O]=M.useState(()=>{let ae;return I!==void 0?ae=I:h!==void 0?ae=h:ae=t.emptyValue,{draft:ae,lastPublishedValue:ae,lastCommittedValue:ae,lastControlledValue:a,hasBeenModifiedSinceMount:!1}}),F=t.getTimezone(y,N.draft);m!==d&&(b(d),d&&F&&d!==F&&O(ae=>Y({},ae,{draft:t.setTimezone(y,d,ae.draft)})));const{getValidationErrorForNewValue:B}=lC({props:e,validator:o,timezone:S,value:N.draft,onError:e.onError}),j=Ve(ae=>{const ie={action:ae,dateState:N,hasChanged:Ce=>!t.areValuesEqual(y,ae.value,Ce),isControlled:p,closeOnSelect:u},Z=Aj(ie),me=Oj(ie),le=Mj(ie);O(Ce=>Y({},Ce,{draft:ae.value,lastPublishedValue:Z?ae.value:Ce.lastPublishedValue,lastCommittedValue:me?ae.value:Ce.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let ue=null;const Ie=()=>(ue||(ue={validationError:ae.name==="setValueFromField"?ae.context.validationError:B(ae.value)},ae.name==="setValueFromShortcut"&&(ue.shortcut=ae.shortcut)),ue);Z&&T(ae.value,Ie()),me&&i&&i(ae.value,Ie()),le&&v(!1)});if(N.lastControlledValue!==a){const ae=t.areValuesEqual(y,N.draft,I);O(ie=>Y({},ie,{lastControlledValue:a},ae?{}:{lastCommittedValue:I,lastPublishedValue:I,draft:I,hasBeenModifiedSinceMount:!0}))}const D=Ve(()=>{j({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),H=Ve(()=>{j({value:N.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),_=Ve(()=>{j({value:N.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),L=Ve(()=>{j({value:N.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),$=Ve(()=>{j({value:t.getTodayValue(y,S,n),name:"setValueFromAction",pickerAction:"today"})}),K=Ve(ae=>{ae.preventDefault(),v(!0)}),G=Ve(ae=>{ae?.preventDefault(),v(!1)}),q=Ve((ae,ie="partial")=>j({name:"setValueFromView",value:ae,selectionState:ie})),R=Ve((ae,ie,Z)=>j({name:"setValueFromShortcut",value:ae,changeImportance:ie,shortcut:Z})),oe=Ve((ae,ie)=>j({name:"setValueFromField",value:ae,context:ie})),se={onClear:D,onAccept:H,onDismiss:_,onCancel:L,onSetToday:$,onOpen:K,onClose:G},z={value:N.draft,onChange:oe},pe=M.useMemo(()=>t.cleanValue(y,N.draft),[y,t,N.draft]),J={value:pe,onChange:q,onClose:G,open:C},re=Y({},se,{value:pe,onChange:q,onSelectShortcut:R,isValid:ae=>{const ie=o({adapter:x,value:ae,timezone:S,props:e});return!t.hasError(ie)}}),ne=M.useMemo(()=>({onOpen:K,onClose:G,open:C}),[C,G,K]);return{open:C,fieldProps:z,viewProps:J,layoutProps:re,actions:se,contextValue:ne}};function dC({onChange:e,onViewChange:t,openTo:n,view:r,views:o,autoFocus:i,focusedView:s,onFocusedViewChange:a}){const l=M.useRef(n),u=M.useRef(o),d=M.useRef(o.includes(n)?n:o[0]),[f,h]=or({name:"useViews",state:"view",controlled:r,default:d.current}),p=M.useRef(i?f:null),[m,b]=or({name:"useViews",state:"focusedView",controlled:s,default:p.current});M.useEffect(()=>{(l.current&&l.current!==n||u.current&&u.current.some(N=>!o.includes(N)))&&(h(o.includes(n)?n:o[0]),u.current=o,l.current=n)},[n,h,f,o]);const y=o.indexOf(f),x=o[y-1]??null,C=o[y+1]??null,v=Ve((N,O)=>{b(O?N:F=>N===F?null:F),a?.(N,O)}),S=Ve(N=>{v(N,!0),N!==f&&(h(N),t&&t(N))}),I=Ve(()=>{C&&S(C)}),T=Ve((N,O,F)=>{const B=O==="finish",j=F?o.indexOf(F)<o.length-1:!!C;if(e(N,B&&j?"partial":O,F),F&&F!==f){const H=o[o.indexOf(F)+1];H&&S(H)}else B&&I()});return{view:f,setView:S,focusedView:m,setFocusedView:v,nextView:C,previousView:x,defaultView:o.includes(n)?n:o[0],goToNextView:I,setValueAndGoToNextView:T}}const Rj=["className","sx"],Nj=({props:e,propsFromPickerValue:t,additionalViewProps:n,autoFocusView:r,rendererInterceptor:o,fieldRef:i})=>{const{onChange:s,open:a,onClose:l}=t,{view:u,views:d,openTo:f,onViewChange:h,viewRenderers:p,timezone:m}=e,b=Ze(e,Rj),{view:y,setView:x,defaultView:C,focusedView:v,setFocusedView:S,setValueAndGoToNextView:I}=dC({view:u,views:d,openTo:f,onChange:s,onViewChange:h,autoFocus:r}),{hasUIView:T,viewModeLookup:N}=M.useMemo(()=>d.reduce((_,L)=>{let $;return p[L]!=null?$="UI":$="field",_.viewModeLookup[L]=$,$==="UI"&&(_.hasUIView=!0),_},{hasUIView:!1,viewModeLookup:{}}),[p,d]),O=M.useMemo(()=>d.reduce((_,L)=>p[L]!=null&&wB(L)?_+1:_,0),[p,d]),F=N[y],B=Ve(()=>F==="UI"),[j,D]=M.useState(F==="UI"?y:null);return j!==y&&N[y]==="UI"&&D(y),yn(()=>{F==="field"&&a&&(l(),setTimeout(()=>{i?.current?.setSelectedSections(y),i?.current?.focusField(y)}))},[y]),yn(()=>{if(!a)return;let _=y;F==="field"&&j!=null&&(_=j),_!==C&&N[_]==="UI"&&N[C]==="UI"&&(_=C),_!==y&&x(_),S(_,!0)},[a]),{hasUIView:T,shouldRestoreFocus:B,layoutProps:{views:d,view:j,onViewChange:x},renderCurrentView:()=>{if(j==null)return null;const _=p[j];if(_==null)return null;const L=Y({},b,n,t,{views:d,timezone:m,onChange:I,view:j,onViewChange:x,focusedView:v,onFocusedViewChange:S,showViewSwitcher:O>1,timeViewsCount:O});return o?o(p,j,L):_(L)}}};function z1(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const Fj=(e,t)=>{const[n,r]=M.useState(z1);return yn(()=>{const i=()=>{r(z1())};return window.addEventListener("orientationchange",i),()=>{window.removeEventListener("orientationchange",i)}},[]),mj(e,["hours","minutes","seconds"])?!1:(t||n)==="landscape"},Lj=({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:r})=>{const{orientation:o}=e,i=Fj(n.views,o),s=kr();return{layoutProps:Y({},n,t,{isLandscape:i,isRtl:s,wrapperVariant:r,disabled:e.disabled,readOnly:e.readOnly})}};function _j(e){const{props:t,pickerValueResponse:n}=e;return M.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:t.disabled??!1,readOnly:t.readOnly??!1}),[n.viewProps.value,n.open,t.disabled,t.readOnly])}const fC=({props:e,valueManager:t,valueType:n,wrapperVariant:r,additionalViewProps:o,validator:i,autoFocusView:s,rendererInterceptor:a,fieldRef:l})=>{const u=Pj({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:i}),d=Nj({props:e,additionalViewProps:o,autoFocusView:s,fieldRef:l,propsFromPickerValue:u.viewProps,rendererInterceptor:a}),f=Lj({props:e,wrapperVariant:r,propsFromPickerValue:u.layoutProps,propsFromPickerViews:d.layoutProps}),h=_j({props:e,pickerValueResponse:u});return{open:u.open,actions:u.actions,fieldProps:u.fieldProps,renderCurrentView:d.renderCurrentView,hasUIView:d.hasUIView,shouldRestoreFocus:d.shouldRestoreFocus,layoutProps:f.layoutProps,contextValue:u.contextValue,ownerState:h}};function pC(e){return Ge("MuiPickersLayout",e)}const Xo=We("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),Bj=["onAccept","onClear","onCancel","onSetToday","actions"];function jj(e){const{onAccept:t,onClear:n,onCancel:r,onSetToday:o,actions:i}=e,s=Ze(e,Bj),a=vo();if(i==null||i.length===0)return null;const l=i?.map(u=>{switch(u){case"clear":return c.jsx(tn,{onClick:n,children:a.clearButtonLabel},u);case"cancel":return c.jsx(tn,{onClick:r,children:a.cancelButtonLabel},u);case"accept":return c.jsx(tn,{onClick:t,children:a.okButtonLabel},u);case"today":return c.jsx(tn,{onClick:o,children:a.todayButtonLabel},u);default:return null}});return c.jsx(ro,Y({},s,{children:l}))}function $j(e){return Ge("MuiListItem",e)}We("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);const Hj=We("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]);function zj(e){return Ge("MuiListItemSecondaryAction",e)}We("MuiListItemSecondaryAction",["root","disableGutters"]);const Uj=e=>{const{disableGutters:t,classes:n}=e;return Ke({root:["root",t&&"disableGutters"]},zj,n)},Vj=fe("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),hC=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListItemSecondaryAction"}),{className:o,...i}=r,s=M.useContext(ho),a={...r,disableGutters:s.disableGutters},l=Uj(a);return c.jsx(Vj,{className:Ue(l.root,o),ownerState:a,ref:n,...i})});hC.muiName="ListItemSecondaryAction";const Wj=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems==="flex-start"&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]},qj=e=>{const{alignItems:t,classes:n,dense:r,disableGutters:o,disablePadding:i,divider:s,hasSecondaryAction:a}=e;return Ke({root:["root",r&&"dense",!o&&"gutters",!i&&"padding",s&&"divider",t==="flex-start"&&"alignItemsFlexStart",a&&"secondaryAction"],container:["container"]},$j,n)},Yj=fe("div",{name:"MuiListItem",slot:"Root",overridesResolver:Wj})(ft(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>!t.disablePadding&&t.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:t})=>!t.disablePadding&&!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>!t.disablePadding&&!!t.secondaryAction,style:{paddingRight:48}},{props:({ownerState:t})=>!!t.secondaryAction,style:{[`& > .${Hj.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>t.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:t})=>t.hasSecondaryAction,style:{paddingRight:48}}]}))),Kj=fe("li",{name:"MuiListItem",slot:"Container"})({position:"relative"}),Gj=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListItem"}),{alignItems:o="center",children:i,className:s,component:a,components:l={},componentsProps:u={},ContainerComponent:d="li",ContainerProps:{className:f,...h}={},dense:p=!1,disableGutters:m=!1,disablePadding:b=!1,divider:y=!1,secondaryAction:x,slotProps:C={},slots:v={},...S}=r,I=M.useContext(ho),T=M.useMemo(()=>({dense:p||I.dense||!1,alignItems:o,disableGutters:m}),[o,I.dense,p,m]),N=M.useRef(null),O=M.Children.toArray(i),F=O.length&&ou(O[O.length-1],["ListItemSecondaryAction"]),B={...r,alignItems:o,dense:T.dense,disableGutters:m,disablePadding:b,divider:y,hasSecondaryAction:F},j=qj(B),D=vt(N,n),H=v.root||l.Root||Yj,_=C.root||u.root||{},L={className:Ue(j.root,_.className,s),...S};let $=a||"li";return F?($=!L.component&&!a?"div":$,d==="li"&&($==="li"?$="div":L.component==="li"&&(L.component="div")),c.jsx(ho.Provider,{value:T,children:c.jsxs(Kj,{as:d,className:Ue(j.container,f),ref:D,ownerState:B,...h,children:[c.jsx(H,{..._,...!hs(H)&&{as:$,ownerState:{...B,..._.ownerState}},...L,children:O}),O.pop()]})})):c.jsx(ho.Provider,{value:T,children:c.jsxs(H,{..._,as:$,ref:D,...!hs(H)&&{ownerState:{...B,..._.ownerState}},...L,children:[O,x&&c.jsx(hC,{children:x})]})})}),il=36,Rc=2,Nc=320,Qj=280,rh=336,Xj=["items","changeImportance","isLandscape","onChange","isValid"],Zj=["getValue"];function Jj(e){const{items:t,changeImportance:n="accept",onChange:r,isValid:o}=e,i=Ze(e,Xj);if(t==null||t.length===0)return null;const s=t.map(a=>{let{getValue:l}=a,u=Ze(a,Zj);const d=l({isValid:o});return Y({},u,{label:u.label,onClick:()=>{r(d,n,u)},disabled:!o(d)})});return c.jsx(I2,Y({dense:!0,sx:[{maxHeight:rh,maxWidth:200,overflow:"auto"},...Array.isArray(i.sx)?i.sx:[i.sx]]},i,{children:s.map(a=>c.jsx(Gj,{children:c.jsx(Y2,Y({},a))},a.id??a.label))}))}function e$(e){return e.view!==null}const t$=e=>{const{classes:t,isLandscape:n}=e;return Ke({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},pC,t)},n$=e=>{const{wrapperVariant:t,onAccept:n,onClear:r,onCancel:o,onSetToday:i,view:s,views:a,onViewChange:l,value:u,onChange:d,onSelectShortcut:f,isValid:h,isLandscape:p,disabled:m,readOnly:b,children:y,slots:x,slotProps:C}=e,v=t$(e),S=x?.actionBar??jj,I=Et({elementType:S,externalSlotProps:C?.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:o,onSetToday:i,actions:t==="desktop"?[]:["cancel","accept"]},className:v.actionBar,ownerState:Y({},e,{wrapperVariant:t})}),T=c.jsx(S,Y({},I)),N=x?.toolbar,O=Et({elementType:N,externalSlotProps:C?.toolbar,additionalProps:{isLandscape:p,onChange:d,value:u,view:s,onViewChange:l,views:a,disabled:m,readOnly:b},className:v.toolbar,ownerState:Y({},e,{wrapperVariant:t})}),F=e$(O)&&N?c.jsx(N,Y({},O)):null,B=y,j=x?.tabs,D=s&&j?c.jsx(j,Y({view:s,onViewChange:l,className:v.tabs},C?.tabs)):null,H=x?.shortcuts??Jj,_=Et({elementType:H,externalSlotProps:C?.shortcuts,additionalProps:{isValid:h,isLandscape:p,onChange:f},className:v.shortcuts,ownerState:{isValid:h,isLandscape:p,onChange:f,wrapperVariant:t}}),L=s&&H?c.jsx(H,Y({},_)):null;return{toolbar:F,content:B,tabs:D,actionBar:T,shortcuts:L}},r$=e=>{const{isLandscape:t,classes:n}=e;return Ke({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},pC,n)},o$=fe("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${Xo.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${Xo.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${Xo.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${Xo.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${Xo.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${Xo.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${Xo.shortcuts}`]:{gridColumn:3}}}]}),i$=fe("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),mC=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersLayout"}),{toolbar:o,content:i,tabs:s,actionBar:a,shortcuts:l}=n$(r),{sx:u,className:d,isLandscape:f,wrapperVariant:h}=r,p=r$(r);return c.jsxs(o$,{ref:n,sx:u,className:Ue(p.root,d),ownerState:r,children:[f?l:o,f?o:l,c.jsx(i$,{className:p.contentWrapper,children:h==="desktop"?c.jsxs(M.Fragment,{children:[i,s]}):c.jsxs(M.Fragment,{children:[s,i]})}),a]})}),s$=M.createContext(null);function gC(e){const{contextValue:t,localeText:n,children:r}=e;return c.jsx(s$.Provider,{value:t,children:c.jsx(Xu,{localeText:n,children:r})})}const a$=["props","getOpenDialogAriaText"],l$=["ownerState"],u$=["ownerState"],c$=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=Ze(e,a$);const{slots:o,slotProps:i,className:s,sx:a,format:l,formatDensity:u,enableAccessibleFieldDOMStructure:d,selectedSections:f,onSelectedSectionsChange:h,timezone:p,name:m,label:b,inputRef:y,readOnly:x,disabled:C,autoFocus:v,localeText:S,reduceAnimations:I}=t,T=M.useRef(null),N=M.useRef(null),O=_r(),F=i?.toolbar?.hidden??!1,{open:B,actions:j,hasUIView:D,layoutProps:H,renderCurrentView:_,shouldRestoreFocus:L,fieldProps:$,contextValue:K,ownerState:G}=fC(Y({},r,{props:t,fieldRef:N,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),q=o.inputAdornment??uC,R=Et({elementType:q,externalSlotProps:i?.inputAdornment,additionalProps:{position:"end"},ownerState:t}),oe=Ze(R,l$),se=o.openPickerButton??Ir,z=Et({elementType:se,externalSlotProps:i?.openPickerButton,additionalProps:{disabled:C||x,onClick:B?j.onClose:j.onOpen,"aria-label":n($.value),edge:oe.position},ownerState:t}),pe=Ze(z,u$),J=o.openPickerIcon,Q=Et({elementType:J,externalSlotProps:i?.openPickerIcon,ownerState:G}),re=o.field,ne=Et({elementType:re,externalSlotProps:i?.field,additionalProps:Y({},$,F&&{id:O},{readOnly:x,disabled:C,className:s,sx:a,format:l,formatDensity:u,enableAccessibleFieldDOMStructure:d,selectedSections:f,onSelectedSectionsChange:h,timezone:p,label:b,name:m,autoFocus:v&&!t.open,focused:B?!0:void 0},y?{inputRef:y}:{}),ownerState:t});D&&(ne.InputProps=Y({},ne.InputProps,{ref:T},!t.disableOpenPicker&&{[`${oe.position}Adornment`]:c.jsx(q,Y({},oe,{children:c.jsx(se,Y({},pe,{children:c.jsx(J,Y({},Q))}))}))}));const ae=Y({textField:o.textField,clearIcon:o.clearIcon,clearButton:o.clearButton},ne.slots),ie=o.layout??mC;let Z=O;F&&(b?Z=`${O}-label`:Z=void 0);const me=Y({},i,{toolbar:Y({},i?.toolbar,{titleId:O}),popper:Y({"aria-labelledby":Z},i?.popper)}),le=vt(N,ne.unstableFieldRef);return{renderPicker:()=>c.jsxs(gC,{contextValue:K,localeText:S,children:[c.jsx(re,Y({},ne,{slots:ae,slotProps:me,unstableFieldRef:le})),c.jsx(Dj,Y({role:"dialog",placement:"bottom-start",anchorEl:T.current},j,{open:B,slots:o,slotProps:me,shouldRestoreFocus:L,reduceAnimations:I,children:c.jsx(ie,Y({},H,me?.layout,{slots:o,slotProps:me,children:_()}))}))]})}},d$=mt(c.jsx("path",{d:"M7 10l5 5 5-5z"})),f$=mt(c.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})),p$=mt(c.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})),h$=mt(c.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}));mt(c.jsxs(M.Fragment,{children:[c.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),c.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}));mt(c.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}));mt(c.jsxs(M.Fragment,{children:[c.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),c.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}));const m$=mt(c.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),g$=({utils:e,format:t})=>{let n=10,r=t,o=e.expandFormat(t);for(;o!==r;)if(r=o,o=e.expandFormat(r),n-=1,n<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return o},b$=({utils:e,expandedFormat:t})=>{const n=[],{start:r,end:o}=e.escapedCharacters,i=new RegExp(`(\\${r}[^\\${o}]*\\${o})+`,"g");let s=null;for(;s=i.exec(t);)n.push({start:s.index,end:i.lastIndex-1});return n},y$=(e,t,n,r)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),r).length,format:r});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return t.fieldDayPlaceholder({format:r});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return t.fieldHoursPlaceholder({format:r});case"minutes":return t.fieldMinutesPlaceholder({format:r});case"seconds":return t.fieldSecondsPlaceholder({format:r});case"meridiem":return t.fieldMeridiemPlaceholder({format:r});default:return r}},x$=({utils:e,date:t,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:o,now:i,token:s,startSeparator:a})=>{if(s==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const l=Z2(e,s),u=nC(e,l.contentType,l.type,s),d=n?u:l.contentType==="digit",f=t!=null&&e.isValid(t);let h=f?e.formatByString(t,s):"",p=null;if(d)if(u)p=h===""?e.formatByString(i,s).length:h.length;else{if(l.maxLength==null)throw new Error(`MUI X: The token ${s} should have a 'maxDigitNumber' property on it's adapter`);p=l.maxLength,f&&(h=Jp(eC(gi(h,o),p),o))}return Y({},l,{format:s,maxLength:p,value:h,placeholder:y$(e,r,l,s),hasLeadingZerosInFormat:u,hasLeadingZerosInInput:d,startSeparator:a,endSeparator:"",modified:!1})},C$=e=>{const{utils:t,expandedFormat:n,escapedParts:r}=e,o=t.date(void 0),i=[];let s="";const a=Object.keys(t.formatTokenMap).sort((p,m)=>m.length-p.length),l=/^([a-zA-Z]+)/,u=new RegExp(`^(${a.join("|")})*$`),d=new RegExp(`^(${a.join("|")})`),f=p=>r.find(m=>m.start<=p&&m.end>=p);let h=0;for(;h<n.length;){const p=f(h),m=p!=null,b=l.exec(n.slice(h))?.[1];if(!m&&b!=null&&u.test(b)){let y=b;for(;y.length>0;){const x=d.exec(y)[1];y=y.slice(x.length),i.push(x$(Y({},e,{now:o,token:x,startSeparator:s}))),s=""}h+=b.length}else{const y=n[h];m&&p?.start===h||p?.end===h||(i.length===0?s+=y:i[i.length-1].endSeparator+=y),h+=1}}return i.length===0&&s.length>0&&i.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:s,endSeparator:"",modified:!1}),i},E$=({isRtl:e,formatDensity:t,sections:n})=>n.map(r=>{const o=i=>{let s=i;return e&&s!==null&&s.includes(" ")&&(s=`${s}`),t==="spacious"&&["/",".","-"].includes(s)&&(s=` ${s} `),s};return r.startSeparator=o(r.startSeparator),r.endSeparator=o(r.endSeparator),r}),U1=e=>{let t=g$(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));const n=b$(Y({},e,{expandedFormat:t})),r=C$(Y({},e,{expandedFormat:t,escapedParts:n}));return E$(Y({},e,{sections:r}))},v$=e=>{const t=Zt(),n=vo(),r=Ti(),o=kr(),{valueManager:i,fieldValueManager:s,valueType:a,validator:l,internalProps:u,internalProps:{value:d,defaultValue:f,referenceDate:h,onChange:p,format:m,formatDensity:b="dense",selectedSections:y,onSelectedSectionsChange:x,shouldRespectLeadingZeros:C=!1,timezone:v,enableAccessibleFieldDOMStructure:S=!1}}=e,{timezone:I,value:T,handleValueChange:N}=th({timezone:v,value:d,defaultValue:f,referenceDate:h,onChange:p,valueManager:i}),O=M.useMemo(()=>PB(t),[t]),F=M.useMemo(()=>BB(t,O,I),[t,O,I]),B=M.useCallback((J,Q=null)=>s.getSectionsFromValue(t,J,Q,re=>U1({utils:t,localeText:n,localizedDigits:O,format:m,date:re,formatDensity:b,shouldRespectLeadingZeros:C,enableAccessibleFieldDOMStructure:S,isRtl:o})),[s,m,n,O,o,C,t,b,S]),[j,D]=M.useState(()=>{const J=B(T),Q={sections:J,value:T,referenceValue:i.emptyValue,tempValueStrAndroid:null},re=IB(J),ne=i.getInitialReferenceValue({referenceDate:h,value:T,utils:t,props:u,granularity:re,timezone:I});return Y({},Q,{referenceValue:ne})}),[H,_]=or({controlled:y,default:null,name:"useField",state:"selectedSections"}),L=J=>{_(J),x?.(J)},$=M.useMemo(()=>jf(H,j.sections),[H,j.sections]),K=$==="all"?0:$,G=({value:J,referenceValue:Q,sections:re})=>{if(D(ae=>Y({},ae,{sections:re,value:J,referenceValue:Q,tempValueStrAndroid:null})),i.areValuesEqual(t,j.value,J))return;const ne={validationError:l({adapter:r,value:J,timezone:I,props:u})};N(J,ne)},q=(J,Q)=>{const re=[...j.sections];return re[J]=Y({},re[J],{value:Q,modified:!0}),re},R=()=>{G({value:i.emptyValue,referenceValue:j.referenceValue,sections:B(i.emptyValue)})},oe=()=>{if(K==null)return;const J=j.sections[K],Q=s.getActiveDateManager(t,j,J),ne=Q.getSections(j.sections).filter(me=>me.value!=="").length===(J.value===""?0:1),ae=q(K,""),ie=ne?null:t.getInvalidDate(),Z=Q.getNewValuesFromNewActiveDate(ie);G(Y({},Z,{sections:ae}))},se=J=>{const Q=(ae,ie)=>{const Z=t.parse(ae,m);if(Z==null||!t.isValid(Z))return null;const me=U1({utils:t,localeText:n,localizedDigits:O,format:m,date:Z,formatDensity:b,shouldRespectLeadingZeros:C,enableAccessibleFieldDOMStructure:S,isRtl:o});return _1(t,Z,me,ie,!1)},re=s.parseValueStr(J,j.referenceValue,Q),ne=s.updateReferenceValue(t,re,j.referenceValue);G({value:re,referenceValue:ne,sections:B(re,j.sections)})},z=({activeSection:J,newSectionValue:Q,shouldGoToNextSection:re})=>{re&&K<j.sections.length-1&&L(K+1);const ne=s.getActiveDateManager(t,j,J),ae=q(K,Q),ie=ne.getSections(ae),Z=FB(t,ie,O);let me,le;if(Z!=null&&t.isValid(Z)){const ue=_1(t,Z,ie,ne.referenceDate,!0);me=ne.getNewValuesFromNewActiveDate(ue),le=!0}else me=ne.getNewValuesFromNewActiveDate(Z),le=(Z!=null&&!t.isValid(Z))!=(ne.date!=null&&!t.isValid(ne.date));return le?G(Y({},me,{sections:ae})):D(ue=>Y({},ue,me,{sections:ae,tempValueStrAndroid:null}))},pe=J=>D(Q=>Y({},Q,{tempValueStrAndroid:J}));return M.useEffect(()=>{const J=B(j.value);D(Q=>Y({},Q,{sections:J}))},[m,t.locale,o]),M.useEffect(()=>{let J;i.areValuesEqual(t,j.value,T)?J=i.getTimezone(t,j.value)!==i.getTimezone(t,T):J=!0,J&&D(Q=>Y({},Q,{value:T,referenceValue:s.updateReferenceValue(t,T,Q.referenceValue),sections:B(T)}))},[T]),{state:j,activeSectionIndex:K,parsedSelectedSections:$,setSelectedSections:L,clearValue:R,clearActiveSection:oe,updateSectionValue:z,updateValueFromValueStr:se,setTempAndroidValueStr:pe,getSectionsFromValue:B,sectionsValueBoundaries:F,localizedDigits:O,timezone:I}},T$=5e3,Ki=e=>e.saveQuery!=null,S$=({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:r,setTempAndroidValueStr:o,timezone:i})=>{const s=Zt(),[a,l]=M.useState(null),u=Ve(()=>l(null));M.useEffect(()=>{a!=null&&e[a.sectionIndex]?.type!==a.sectionType&&u()},[e,a,u]),M.useEffect(()=>{if(a!=null){const m=setTimeout(()=>u(),T$);return()=>{clearTimeout(m)}}return()=>{}},[a,u]);const d=({keyPressed:m,sectionIndex:b},y,x)=>{const C=m.toLowerCase(),v=e[b];if(a!=null&&(!x||x(a.value))&&a.sectionIndex===b){const I=`${a.value}${C}`,T=y(I,v);if(!Ki(T))return l({sectionIndex:b,value:I,sectionType:v.type}),T}const S=y(C,v);return Ki(S)&&!S.saveQuery?(u(),null):(l({sectionIndex:b,value:C,sectionType:v.type}),Ki(S)?null:S)},f=m=>{const b=(C,v,S)=>{const I=v.filter(T=>T.toLowerCase().startsWith(S));return I.length===0?{saveQuery:!1}:{sectionValue:I[0],shouldGoToNextSection:I.length===1}},y=(C,v,S,I)=>{const T=N=>J2(s,i,v.type,N);if(v.contentType==="letter")return b(v.format,T(v.format),C);if(S&&I!=null&&Z2(s,S).contentType==="letter"){const N=T(S),O=b(S,N,C);return Ki(O)?{saveQuery:!1}:Y({},O,{sectionValue:I(O.sectionValue,N)})}return{saveQuery:!1}};return d(m,(C,v)=>{switch(v.type){case"month":{const S=I=>F1(s,I,s.formats.month,v.format);return y(C,v,s.formats.month,S)}case"weekDay":{const S=(I,T)=>T.indexOf(I).toString();return y(C,v,s.formats.weekday,S)}case"meridiem":return y(C,v);default:return{saveQuery:!1}}})},h=m=>{const b=(x,C)=>{const v=gi(x,r),S=Number(v),I=n[C.type]({currentDate:null,format:C.format,contentType:C.contentType});if(S>I.maximum)return{saveQuery:!1};if(S<I.minimum)return{saveQuery:!0};const T=S*10>I.maximum||v.length===I.maximum.toString().length;return{sectionValue:tC(s,S,I,r,C),shouldGoToNextSection:T}};return d(m,(x,C)=>{if(C.contentType==="digit"||C.contentType==="digit-with-letter")return b(x,C);if(C.type==="month"){nC(s,"digit","month","MM");const v=b(x,{type:C.type,format:"MM",hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(Ki(v))return v;const S=F1(s,v.sectionValue,"MM",C.format);return Y({},v,{sectionValue:S})}if(C.type==="weekDay"){const v=b(x,C);if(Ki(v))return v;const S=Mc(s,C.format)[Number(v.sectionValue)-1];return Y({},v,{sectionValue:S})}return{saveQuery:!1}},x=>N1(x,r))};return{applyCharacterEditing:Ve(m=>{const b=e[m.sectionIndex],x=N1(m.keyPressed,r)?h(Y({},m,{keyPressed:Jp(m.keyPressed,r)})):f(m);if(x==null){o(null);return}t({activeSection:b,newSectionValue:x.sectionValue,shouldGoToNextSection:x.shouldGoToNextSection})}),resetCharacterQuery:u}},k$=e=>{const{internalProps:{disabled:t,readOnly:n=!1},forwardedProps:{sectionListRef:r,onBlur:o,onClick:i,onFocus:s,onInput:a,onPaste:l,focused:u,autoFocus:d=!1},fieldValueManager:f,applyCharacterEditing:h,resetCharacterQuery:p,setSelectedSections:m,parsedSelectedSections:b,state:y,clearActiveSection:x,clearValue:C,updateSectionValue:v,updateValueFromValueStr:S,sectionOrder:I,areAllSectionsEmpty:T,sectionsValueBoundaries:N}=e,O=M.useRef(null),F=vt(r,O),B=vo(),j=Zt(),D=_r(),[H,_]=M.useState(!1),L=M.useMemo(()=>({syncSelectionToDOM:()=>{if(!O.current)return;const le=document.getSelection();if(!le)return;if(b==null){le.rangeCount>0&&O.current.getRoot().contains(le.getRangeAt(0).startContainer)&&le.removeAllRanges(),H&&O.current.getRoot().blur();return}if(!O.current.getRoot().contains(Wn(document)))return;const ue=new window.Range;let Ie;b==="all"?Ie=O.current.getRoot():y.sections[b].type==="empty"?Ie=O.current.getSectionContainer(b):Ie=O.current.getSectionContent(b),ue.selectNodeContents(Ie),Ie.focus(),le.removeAllRanges(),le.addRange(ue)},getActiveSectionIndexFromDOM:()=>{const le=Wn(document);return!le||!O.current||!O.current.getRoot().contains(le)?null:O.current.getSectionIndexFromDOMElement(le)},focusField:(le=0)=>{if(!O.current||L.getActiveSectionIndexFromDOM()!=null)return;const ue=jf(le,y.sections);_(!0),O.current.getSectionContent(ue).focus()},setSelectedSections:le=>{if(!O.current)return;const ue=jf(le,y.sections);_((ue==="all"?0:ue)!==null),m(le)},isFieldFocused:()=>{const le=Wn(document);return!!O.current&&O.current.getRoot().contains(le)}}),[b,m,y.sections,H]),$=Ve(le=>{if(!O.current)return;const ue=y.sections[le];O.current.getSectionContent(le).innerHTML=ue.value||ue.placeholder,L.syncSelectionToDOM()}),K=Ve((le,...ue)=>{le.isDefaultPrevented()||!O.current||(_(!0),i?.(le,...ue),b==="all"?setTimeout(()=>{const Ie=document.getSelection().getRangeAt(0).startOffset;if(Ie===0){m(I.startIndex);return}let Ce=0,we=0;for(;we<Ie&&Ce<y.sections.length;){const ye=y.sections[Ce];Ce+=1,we+=`${ye.startSeparator}${ye.value||ye.placeholder}${ye.endSeparator}`.length}m(Ce-1)}):H?O.current.getRoot().contains(le.target)||m(I.startIndex):(_(!0),m(I.startIndex)))}),G=Ve(le=>{if(a?.(le),!O.current||b!=="all")return;const Ie=le.target.textContent??"";O.current.getRoot().innerHTML=y.sections.map(Ce=>`${Ce.startSeparator}${Ce.value||Ce.placeholder}${Ce.endSeparator}`).join(""),L.syncSelectionToDOM(),Ie.length===0||Ie.charCodeAt(0)===10?(p(),C(),m("all")):Ie.length>1?S(Ie):(b==="all"&&m(0),h({keyPressed:Ie,sectionIndex:0}))}),q=Ve(le=>{if(l?.(le),n||b!=="all"){le.preventDefault();return}const ue=le.clipboardData.getData("text");le.preventDefault(),p(),S(ue)}),R=Ve((...le)=>{if(s?.(...le),H||!O.current)return;_(!0),O.current.getSectionIndexFromDOMElement(Wn(document))!=null||m(I.startIndex)}),oe=Ve((...le)=>{o?.(...le),setTimeout(()=>{if(!O.current)return;const ue=Wn(document);!O.current.getRoot().contains(ue)&&(_(!1),m(null))})}),se=Ve(le=>ue=>{ue.isDefaultPrevented()||m(le)}),z=Ve(le=>{le.preventDefault()}),pe=Ve(le=>()=>{m(le)}),J=Ve(le=>{if(le.preventDefault(),n||t||typeof b!="number")return;const ue=y.sections[b],Ie=le.clipboardData.getData("text"),Ce=/^[a-zA-Z]+$/.test(Ie),we=/^[0-9]+$/.test(Ie),ye=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(Ie);ue.contentType==="letter"&&Ce||ue.contentType==="digit"&&we||ue.contentType==="digit-with-letter"&&ye?(p(),v({activeSection:ue,newSectionValue:Ie,shouldGoToNextSection:!0})):!Ce&&!we&&(p(),S(Ie))}),Q=Ve(le=>{le.preventDefault(),le.dataTransfer.dropEffect="none"}),re=Ve(le=>{if(!O.current)return;const ue=le.target,Ie=ue.textContent??"",Ce=O.current.getSectionIndexFromDOMElement(ue),we=y.sections[Ce];if(n||!O.current){$(Ce);return}if(Ie.length===0){if(we.value===""){$(Ce);return}const ye=le.nativeEvent.inputType;if(ye==="insertParagraph"||ye==="insertLineBreak"){$(Ce);return}p(),x();return}h({keyPressed:Ie,sectionIndex:Ce}),$(Ce)});yn(()=>{if(!(!H||!O.current)){if(b==="all")O.current.getRoot().focus();else if(typeof b=="number"){const le=O.current.getSectionContent(b);le&&le.focus()}}},[b,H]);const ne=M.useMemo(()=>y.sections.reduce((le,ue)=>(le[ue.type]=N[ue.type]({currentDate:null,contentType:ue.contentType,format:ue.format}),le),{}),[N,y.sections]),ae=b==="all",ie=M.useMemo(()=>y.sections.map((le,ue)=>{const Ie=!ae&&!t&&!n;return{container:{"data-sectionindex":ue,onClick:se(ue)},content:{tabIndex:ae||ue>0?-1:0,contentEditable:!ae&&!t&&!n,role:"spinbutton",id:`${D}-${le.type}`,"aria-labelledby":`${D}-${le.type}`,"aria-readonly":n,"aria-valuenow":UB(le,j),"aria-valuemin":ne[le.type].minimum,"aria-valuemax":ne[le.type].maximum,"aria-valuetext":le.value?zB(le,j):B.empty,"aria-label":B[le.type],"aria-disabled":t,spellCheck:Ie?!1:void 0,autoCapitalize:Ie?"off":void 0,autoCorrect:Ie?"off":void 0,[parseInt(M.version,10)>=17?"enterKeyHint":"enterkeyhint"]:Ie?"next":void 0,children:le.value||le.placeholder,onInput:re,onPaste:J,onFocus:pe(ue),onDragOver:Q,onMouseUp:z,inputMode:le.contentType==="letter"?"text":"numeric"},before:{children:le.startSeparator},after:{children:le.endSeparator}}}),[y.sections,pe,J,Q,re,se,z,t,n,ae,B,j,ne,D]),Z=Ve(le=>{S(le.target.value)}),me=M.useMemo(()=>T?"":f.getV7HiddenInputValueFromSections(y.sections),[T,y.sections,f]);return M.useEffect(()=>{if(O.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.","","If you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","<DatePicker slots={{ textField: MyCustomTextField }} />","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(`
|
|
204
|
+
`));d&&O.current&&O.current.getSectionContent(I.startIndex).focus()},[]),{interactions:L,returnedValue:{autoFocus:d,readOnly:n,focused:u??H,sectionListRef:F,onBlur:oe,onClick:K,onFocus:R,onInput:G,onPaste:q,enableAccessibleFieldDOMStructure:!0,elements:ie,tabIndex:b===0?-1:0,contentEditable:ae,value:me,onChange:Z,areAllSectionsEmpty:T}}},Ji=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),w$=(e,t,n)=>{let r=0,o=n?1:0;const i=[];for(let s=0;s<e.length;s+=1){const a=e[s],l=eh(a,n?"input-rtl":"input-ltr",t),u=`${a.startSeparator}${l}${a.endSeparator}`,d=Ji(u).length,f=u.length,h=Ji(l),p=o+(h===""?0:l.indexOf(h[0]))+a.startSeparator.length,m=p+h.length;i.push(Y({},a,{start:r,end:r+d,startInInput:p,endInInput:m})),r+=d,o+=f}return i},D$=e=>{const t=kr(),n=M.useRef(void 0),r=M.useRef(void 0),{forwardedProps:{onFocus:o,onClick:i,onPaste:s,onBlur:a,inputRef:l,placeholder:u},internalProps:{readOnly:d=!1,disabled:f=!1},parsedSelectedSections:h,activeSectionIndex:p,state:m,fieldValueManager:b,valueManager:y,applyCharacterEditing:x,resetCharacterQuery:C,updateSectionValue:v,updateValueFromValueStr:S,clearActiveSection:I,clearValue:T,setTempAndroidValueStr:N,setSelectedSections:O,getSectionsFromValue:F,areAllSectionsEmpty:B,localizedDigits:j}=e,D=M.useRef(null),H=vt(l,D),_=M.useMemo(()=>w$(m.sections,j,t),[m.sections,j,t]),L=M.useMemo(()=>({syncSelectionToDOM:()=>{if(!D.current)return;if(h==null){D.current.scrollLeft&&(D.current.scrollLeft=0);return}if(D.current!==Wn(document))return;const re=D.current.scrollTop;if(h==="all")D.current.select();else{const ne=_[h],ae=ne.type==="empty"?ne.startInInput-ne.startSeparator.length:ne.startInInput,ie=ne.type==="empty"?ne.endInInput+ne.endSeparator.length:ne.endInInput;(ae!==D.current.selectionStart||ie!==D.current.selectionEnd)&&D.current===Wn(document)&&D.current.setSelectionRange(ae,ie),clearTimeout(r.current),r.current=setTimeout(()=>{D.current&&D.current===Wn(document)&&D.current.selectionStart===D.current.selectionEnd&&(D.current.selectionStart!==ae||D.current.selectionEnd!==ie)&&L.syncSelectionToDOM()})}D.current.scrollTop=re},getActiveSectionIndexFromDOM:()=>{const re=D.current.selectionStart??0,ne=D.current.selectionEnd??0;if(re===0&&ne===0)return null;const ae=re<=_[0].startInInput?1:_.findIndex(ie=>ie.startInInput-ie.startSeparator.length>re);return ae===-1?_.length-1:ae-1},focusField:(re=0)=>{Wn(document)!==D.current&&(D.current?.focus(),O(re))},setSelectedSections:re=>O(re),isFieldFocused:()=>D.current===Wn(document)}),[D,h,_,O]),$=()=>{const re=D.current.selectionStart??0;let ne;re<=_[0].startInInput||re>=_[_.length-1].endInInput?ne=1:ne=_.findIndex(ie=>ie.startInInput-ie.startSeparator.length>re);const ae=ne===-1?_.length-1:ne-1;O(ae)},K=Ve((...re)=>{o?.(...re);const ne=D.current;clearTimeout(n.current),n.current=setTimeout(()=>{!ne||ne!==D.current||p==null&&(ne.value.length&&Number(ne.selectionEnd)-Number(ne.selectionStart)===ne.value.length?O("all"):$())})}),G=Ve((re,...ne)=>{re.isDefaultPrevented()||(i?.(re,...ne),$())}),q=Ve(re=>{if(s?.(re),re.preventDefault(),d||f)return;const ne=re.clipboardData.getData("text");if(typeof h=="number"){const ae=m.sections[h],ie=/^[a-zA-Z]+$/.test(ne),Z=/^[0-9]+$/.test(ne),me=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(ne);if(ae.contentType==="letter"&&ie||ae.contentType==="digit"&&Z||ae.contentType==="digit-with-letter"&&me){C(),v({activeSection:ae,newSectionValue:ne,shouldGoToNextSection:!0});return}if(ie||Z)return}C(),S(ne)}),R=Ve((...re)=>{a?.(...re),O(null)}),oe=Ve(re=>{if(d)return;const ne=re.target.value;if(ne===""){C(),T();return}const ae=re.nativeEvent.data,ie=ae&&ae.length>1,Z=ie?ae:ne,me=Ji(Z);if(h==="all"&&O(p),p==null||ie){S(ie?ae:me);return}let le;if(h==="all"&&me.length===1)le=me;else{const ue=Ji(b.getV6InputValueFromSections(_,j,t));let Ie=-1,Ce=-1;for(let Ne=0;Ne<ue.length;Ne+=1)Ie===-1&&ue[Ne]!==me[Ne]&&(Ie=Ne),Ce===-1&&ue[ue.length-Ne-1]!==me[me.length-Ne-1]&&(Ce=Ne);const we=_[p];if(Ie<we.start||ue.length-Ce-1>we.end)return;const ze=me.length-ue.length+we.end-Ji(we.endSeparator||"").length;le=me.slice(we.start+Ji(we.startSeparator||"").length,ze)}if(le.length===0){$B()&&N(Z),C(),I();return}x({keyPressed:le,sectionIndex:p})}),se=M.useMemo(()=>u!==void 0?u:b.getV6InputValueFromSections(F(y.emptyValue),j,t),[u,b,F,y.emptyValue,j,t]),z=M.useMemo(()=>m.tempValueStrAndroid??b.getV6InputValueFromSections(m.sections,j,t),[m.sections,b,m.tempValueStrAndroid,j,t]);M.useEffect(()=>(D.current&&D.current===Wn(document)&&O("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);const pe=M.useMemo(()=>p==null||m.sections[p].contentType==="letter"?"text":"numeric",[p,m.sections]),Q=!(D.current&&D.current===Wn(document))&&B;return{interactions:L,returnedValue:{readOnly:d,onBlur:R,onClick:G,onFocus:K,onPaste:q,inputRef:H,enableAccessibleFieldDOMStructure:!1,placeholder:se,inputMode:pe,autoComplete:"off",value:Q?"":z,onChange:oe}}},I$=e=>{const t=Zt(),{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:o,enableAccessibleFieldDOMStructure:i=!1,disabled:s=!1,readOnly:a=!1},forwardedProps:{onKeyDown:l,error:u,clearable:d,onClear:f},fieldValueManager:h,valueManager:p,validator:m}=e,b=kr(),y=v$(e),{state:x,activeSectionIndex:C,parsedSelectedSections:v,setSelectedSections:S,clearValue:I,clearActiveSection:T,updateSectionValue:N,setTempAndroidValueStr:O,sectionsValueBoundaries:F,localizedDigits:B,timezone:j}=y,D=S$({sections:x.sections,updateSectionValue:N,sectionsValueBoundaries:F,localizedDigits:B,setTempAndroidValueStr:O,timezone:j}),{resetCharacterQuery:H}=D,_=p.areValuesEqual(t,x.value,p.emptyValue),L=i?k$:D$,$=M.useMemo(()=>HB(x.sections,b&&!i),[x.sections,b,i]),{returnedValue:K,interactions:G}=L(Y({},e,y,D,{areAllSectionsEmpty:_,sectionOrder:$})),q=Ve(J=>{if(l?.(J),!s)switch(!0){case((J.ctrlKey||J.metaKey)&&String.fromCharCode(J.keyCode)==="A"&&!J.shiftKey&&!J.altKey):{J.preventDefault(),S("all");break}case J.key==="ArrowRight":{if(J.preventDefault(),v==null)S($.startIndex);else if(v==="all")S($.endIndex);else{const Q=$.neighbors[v].rightIndex;Q!==null&&S(Q)}break}case J.key==="ArrowLeft":{if(J.preventDefault(),v==null)S($.endIndex);else if(v==="all")S($.startIndex);else{const Q=$.neighbors[v].leftIndex;Q!==null&&S(Q)}break}case J.key==="Delete":{if(J.preventDefault(),a)break;v==null||v==="all"?I():T(),H();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(J.key):{if(J.preventDefault(),a||C==null)break;v==="all"&&S(C);const Q=x.sections[C],re=h.getActiveDateManager(t,x,Q),ne=RB(t,j,Q,J.key,F,B,re.date,{minutesStep:o});N({activeSection:Q,newSectionValue:ne,shouldGoToNextSection:!1});break}}});yn(()=>{G.syncSelectionToDOM()});const{hasValidationError:R}=lC({props:n,validator:m,timezone:j,value:x.value,onError:n.onError}),oe=M.useMemo(()=>u!==void 0?u:R,[R,u]);M.useEffect(()=>{!oe&&C==null&&H()},[x.referenceValue,C,oe]),M.useEffect(()=>{x.tempValueStrAndroid!=null&&C!=null&&(H(),T())},[x.sections]),M.useImperativeHandle(r,()=>({getSections:()=>x.sections,getActiveSectionIndex:G.getActiveSectionIndexFromDOM,setSelectedSections:G.setSelectedSections,focusField:G.focusField,isFieldFocused:G.isFieldFocused}));const se=Ve((J,...Q)=>{J.preventDefault(),f?.(J,...Q),I(),G.isFieldFocused()?S($.startIndex):G.focusField(0)}),z={onKeyDown:q,onClear:se,error:oe,clearable:!!(d&&!_&&!a&&!s)},pe={disabled:s,readOnly:a};return Y({},e.forwardedProps,z,pe,K)},A$=["clearable","onClear","InputProps","sx","slots","slotProps"],O$=["ownerState"],M$=e=>{const t=vo(),{clearable:n,onClear:r,InputProps:o,sx:i,slots:s,slotProps:a}=e,l=Ze(e,A$),u=s?.clearButton??Ir,d=Et({elementType:u,externalSlotProps:a?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),f=Ze(d,O$),h=s?.clearIcon??m$,p=Et({elementType:h,externalSlotProps:a?.clearIcon,ownerState:{}});return Y({},l,{InputProps:Y({},o,{endAdornment:c.jsxs(M.Fragment,{children:[n&&c.jsx(uC,{position:"end",sx:{marginRight:o?.endAdornment?-1:-1.5},children:c.jsx(u,Y({},f,{onClick:r,children:c.jsx(h,Y({fontSize:"small"},p))}))}),o?.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(i)?i:[i]]})},P$=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],R$=(e,t)=>M.useMemo(()=>{const n=Y({},e),r={},o=i=>{n.hasOwnProperty(i)&&(r[i]=n[i],delete n[i])};return P$.forEach(o),sC.forEach(o),{forwardedProps:n,internalProps:r}},[e,t]),N$=e=>{const t=Zt(),n=kl();return Y({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??t.formats.keyboardDate,minDate:vr(t,e.minDate,n.minDate),maxDate:vr(t,e.maxDate,n.maxDate)})},F$=e=>{const t=N$(e),{forwardedProps:n,internalProps:r}=R$(t,"date");return I$({forwardedProps:n,internalProps:r,valueManager:Zr,fieldValueManager:WB,validator:wl,valueType:"date"})};function L$(e){return Ge("MuiPickersTextField",e)}We("MuiPickersTextField",["root","focused","disabled","error","required"]);function _$(e){return Ge("MuiPickersInputBase",e)}const ls=We("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function B$(e){return Ge("MuiPickersSectionList",e)}const ba=We("MuiPickersSectionList",["root","section","sectionContent"]),j$=["slots","slotProps","elements","sectionListRef"],bC=fe("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),yC=fe("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),xC=fe("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),CC=fe("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"}),$$=e=>{const{classes:t}=e;return Ke({root:["root"],section:["section"],sectionContent:["sectionContent"]},B$,t)};function H$(e){const{slots:t,slotProps:n,element:r,classes:o}=e,i=t?.section??yC,s=Et({elementType:i,externalSlotProps:n?.section,externalForwardedProps:r.container,className:o.section,ownerState:{}}),a=t?.sectionContent??CC,l=Et({elementType:a,externalSlotProps:n?.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:o.sectionContent,ownerState:{}}),u=t?.sectionSeparator??xC,d=Et({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),f=Et({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return c.jsxs(i,Y({},s,{children:[c.jsx(u,Y({},d)),c.jsx(a,Y({},l)),c.jsx(u,Y({},f))]}))}const z$=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersSectionList"}),{slots:o,slotProps:i,elements:s,sectionListRef:a}=r,l=Ze(r,j$),u=$$(r),d=M.useRef(null),f=vt(n,d),h=b=>{if(!d.current)throw new Error(`MUI X: Cannot call sectionListRef.${b} before the mount of the component.`);return d.current};M.useImperativeHandle(a,()=>({getRoot(){return h("getRoot")},getSectionContainer(b){return h("getSectionContainer").querySelector(`.${ba.section}[data-sectionindex="${b}"]`)},getSectionContent(b){return h("getSectionContent").querySelector(`.${ba.section}[data-sectionindex="${b}"] .${ba.sectionContent}`)},getSectionIndexFromDOMElement(b){const y=h("getSectionIndexFromDOMElement");if(b==null||!y.contains(b))return null;let x=null;return b.classList.contains(ba.section)?x=b:b.classList.contains(ba.sectionContent)&&(x=b.parentElement),x==null?null:Number(x.dataset.sectionindex)}}));const p=o?.root??bC,m=Et({elementType:p,externalSlotProps:i?.root,externalForwardedProps:l,additionalProps:{ref:f,suppressContentEditableWarning:!0},className:u.root,ownerState:{}});return c.jsx(p,Y({},m,{children:m.contentEditable?s.map(({content:b,before:y,after:x})=>`${y.children}${b.children}${x.children}`).join(""):c.jsx(M.Fragment,{children:s.map((b,y)=>c.jsx(H$,{slots:o,slotProps:i,element:b,classes:u},y))})}))}),U$=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],V$=e=>Math.round(e*1e5)/1e5,Fc=fe("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>Y({},e.typography.body1,{color:(e.vars||e).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${V$(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),oh=fe(bC,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})(({theme:e})=>({padding:"4px 0 5px",fontFamily:e.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:t,focused:n,filled:r,label:o})=>!t&&!n&&!r&&o==null,style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:e.palette.mode==="light"?.42:.5}}]})),W$=fe(yC,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(e,t)=>t.section})(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),q$=fe(CC,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(e,t)=>t.content})(({theme:e})=>({fontFamily:e.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),Y$=fe(xC,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),K$=fe("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})(Y({},xB)),G$=e=>{const{focused:t,disabled:n,error:r,classes:o,fullWidth:i,readOnly:s,color:a,size:l,endAdornment:u,startAdornment:d}=e,f={root:["root",t&&!n&&"focused",n&&"disabled",s&&"readOnly",r&&"error",i&&"fullWidth",`color${Fe(a)}`,l==="small"&&"inputSizeSmall",!!d&&"adornedStart",!!u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return Ke(f,_$,o)},ih=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersInputBase"}),{elements:o,areAllSectionsEmpty:i,value:s,onChange:a,id:l,endAdornment:u,startAdornment:d,renderSuffix:f,slots:h,slotProps:p,contentEditable:m,tabIndex:b,onInput:y,onPaste:x,onKeyDown:C,name:v,readOnly:S,inputProps:I,inputRef:T,sectionListRef:N}=r,O=Ze(r,U$),F=M.useRef(null),B=vt(n,F),j=vt(I?.ref,T),D=kr(),H=ar();if(!H)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const _=R=>{if(H.disabled){R.stopPropagation();return}H.onFocus?.(R)};M.useEffect(()=>{H&&H.setAdornedStart(!!d)},[H,d]),M.useEffect(()=>{H&&(i?H.onEmpty():H.onFilled())},[H,i]);const L=Y({},r,H,{isRtl:D}),$=G$(L),K=h?.root||Fc,G=Et({elementType:K,externalSlotProps:p?.root,externalForwardedProps:O,additionalProps:{"aria-invalid":H.error,ref:B},className:$.root,ownerState:L}),q=h?.input||oh;return c.jsxs(K,Y({},G,{children:[d,c.jsx(z$,{sectionListRef:N,elements:o,contentEditable:m,tabIndex:b,className:$.sectionsContainer,onFocus:_,onBlur:H.onBlur,onInput:y,onPaste:x,onKeyDown:C,slots:{root:q,section:W$,sectionContent:q$,sectionSeparator:Y$},slotProps:{root:{ownerState:L},sectionContent:{className:ls.sectionContent},sectionSeparator:({position:R})=>({className:R==="before"?ls.sectionBefore:ls.sectionAfter})}}),u,f?f(Y({},H)):null,c.jsx(K$,Y({name:v,className:$.input,value:s,onChange:a,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:S,required:H.required,disabled:H.disabled},I,{ref:j}))]}))});function Q$(e){return Ge("MuiPickersOutlinedInput",e)}const Rr=Y({},ls,We("MuiPickersOutlinedInput",["root","notchedOutline","input"])),X$=["children","className","label","notched","shrink"],Z$=fe("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),V1=fe("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),J$=fe("legend")(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]}));function eH(e){const{className:t,label:n}=e,r=Ze(e,X$),o=n!=null&&n!=="",i=Y({},e,{withLabel:o});return c.jsx(Z$,Y({"aria-hidden":!0,className:t},r,{ownerState:i,children:c.jsx(J$,{ownerState:i,children:o?c.jsx(V1,{children:n}):c.jsx(V1,{className:"notranslate",children:""})})}))}const tH=["label","autoFocus","ownerState","notched"],nH=fe(Fc,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Rr.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Rr.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${Rr.focused} .${Rr.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${Rr.disabled}`]:{[`& .${Rr.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${Rr.error} .${Rr.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},variants:Object.keys((e.vars??e).palette).filter(n=>(e.vars??e).palette[n]?.main??!1).map(n=>({props:{color:n},style:{[`&.${Rr.focused}:not(.${Rr.error}) .${Rr.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}}))}}),rH=fe(oh,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),oH=e=>{const{classes:t}=e,r=Ke({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Q$,t);return Y({},t,r)},EC=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersOutlinedInput"}),{label:o,ownerState:i,notched:s}=r,a=Ze(r,tH),l=ar(),u=Y({},r,i,l,{color:l?.color||"primary"}),d=oH(u);return c.jsx(ih,Y({slots:{root:nH,input:rH},renderSuffix:f=>c.jsx(eH,{shrink:!!(s||f.adornedStart||f.focused||f.filled),notched:!!(s||f.adornedStart||f.focused||f.filled),className:d.notchedOutline,label:o!=null&&o!==""&&l?.required?c.jsxs(M.Fragment,{children:[o," ","*"]}):o,ownerState:u})},a,{label:o,classes:d,ref:n}))});EC.muiName="Input";function iH(e){return Ge("MuiPickersFilledInput",e)}const Zo=Y({},ls,We("MuiPickersFilledInput",["root","underline","input"])),sH=["label","autoFocus","disableUnderline","ownerState"],aH=fe(Fc,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>Ot.shouldForwardProp(e)&&e!=="disableUnderline"})(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${Zo.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${Zo.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i},variants:[...Object.keys((e.vars??e).palette).filter(s=>(e.vars??e).palette[s].main).map(s=>({props:{color:s,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[s]?.main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Zo.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Zo.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Zo.disabled}, .${Zo.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${Zo.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:s})=>!!s,style:{paddingLeft:12}},{props:({endAdornment:s})=>!!s,style:{paddingRight:12}}]}}),lH=fe(oh,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:0}},{props:({endAdornment:e})=>!!e,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),uH=e=>{const{classes:t,disableUnderline:n}=e,o=Ke({root:["root",!n&&"underline"],input:["input"]},iH,t);return Y({},t,o)},vC=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersFilledInput"}),{label:o,disableUnderline:i=!1,ownerState:s}=r,a=Ze(r,sH),l=ar(),u=Y({},r,s,l,{color:l?.color||"primary"}),d=uH(u);return c.jsx(ih,Y({slots:{root:aH,input:lH},slotProps:{root:{disableUnderline:i}}},a,{label:o,classes:d,ref:n}))});vC.muiName="Input";function cH(e){return Ge("MuiPickersFilledInput",e)}const ya=Y({},ls,We("MuiPickersInput",["root","input"])),dH=["label","autoFocus","disableUnderline","ownerState"],fH=fe(Fc,{name:"MuiPickersInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(r=>(e.vars??e).palette[r].main).map(r=>({props:{color:r},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${ya.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${ya.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${ya.disabled}, .${ya.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${ya.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),pH=e=>{const{classes:t,disableUnderline:n}=e,o=Ke({root:["root",!n&&"underline"],input:["input"]},cH,t);return Y({},t,o)},TC=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersInput"}),{label:o,disableUnderline:i=!1,ownerState:s}=r,a=Ze(r,dH),l=ar(),u=Y({},r,s,l,{disableUnderline:i,color:l?.color||"primary"}),d=pH(u);return c.jsx(ih,Y({slots:{root:fH}},a,{label:o,classes:d,ref:n}))});TC.muiName="Input";const hH=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],mH={standard:TC,filled:vC,outlined:EC},gH=fe(Wu,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({maxWidth:"100%"}),bH=e=>{const{focused:t,disabled:n,classes:r,required:o}=e;return Ke({root:["root",t&&!n&&"focused",n&&"disabled",o&&"required"]},L$,r)},yH=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersTextField"}),{onFocus:o,onBlur:i,className:s,color:a="primary",disabled:l=!1,error:u=!1,variant:d="outlined",required:f=!1,InputProps:h,inputProps:p,inputRef:m,sectionListRef:b,elements:y,areAllSectionsEmpty:x,onClick:C,onKeyDown:v,onKeyUp:S,onPaste:I,onInput:T,endAdornment:N,startAdornment:O,tabIndex:F,contentEditable:B,focused:j,value:D,onChange:H,fullWidth:_,id:L,name:$,helperText:K,FormHelperTextProps:G,label:q,InputLabelProps:R}=r,oe=Ze(r,hH),se=M.useRef(null),z=vt(n,se),pe=_r(L),J=K&&pe?`${pe}-helper-text`:void 0,Q=q&&pe?`${pe}-label`:void 0,re=Y({},r,{color:a,disabled:l,error:u,focused:j,required:f,variant:d}),ne=bH(re),ae=mH[d];return c.jsxs(gH,Y({className:Ue(ne.root,s),ref:z,focused:j,onFocus:o,onBlur:i,disabled:l,variant:d,error:u,color:a,fullWidth:_,required:f,ownerState:re},oe,{children:[c.jsx(qu,Y({htmlFor:pe,id:Q},R,{children:q})),c.jsx(ae,Y({elements:y,areAllSectionsEmpty:x,onClick:C,onKeyDown:v,onKeyUp:S,onInput:T,onPaste:I,endAdornment:N,startAdornment:O,tabIndex:F,contentEditable:B,value:D,onChange:H,id:pe,fullWidth:_,inputProps:p,inputRef:m,sectionListRef:b,label:q,name:$,role:"group","aria-labelledby":Q,"aria-describedby":J,"aria-live":J?"polite":void 0},h)),K&&c.jsx(D2,Y({id:J},G,{children:K}))]}))}),xH=["enableAccessibleFieldDOMStructure"],CH=["InputProps","readOnly"],EH=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],vH=e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=Ze(e,xH);if(t){const{InputProps:f,readOnly:h}=n,p=Ze(n,CH);return Y({},p,{InputProps:Y({},f??{},{readOnly:h})})}const{onPaste:r,onKeyDown:o,inputMode:i,readOnly:s,InputProps:a,inputProps:l,inputRef:u}=n,d=Ze(n,EH);return Y({},d,{InputProps:Y({},a??{},{readOnly:s}),inputProps:Y({},l??{},{inputMode:i,onPaste:r,onKeyDown:o,ref:u})})},TH=["slots","slotProps","InputProps","inputProps"],SC=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiDateField"}),{slots:o,slotProps:i,InputProps:s,inputProps:a}=r,l=Ze(r,TH),u=r,d=o?.textField??(t.enableAccessibleFieldDOMStructure?yH:Ct),f=Et({elementType:d,externalSlotProps:i?.textField,externalForwardedProps:l,additionalProps:{ref:n},ownerState:u});f.inputProps=Y({},a,f.inputProps),f.InputProps=Y({},s,f.InputProps);const h=F$(f),p=vH(h),m=M$(Y({},p,{slots:o,slotProps:i}));return c.jsx(d,Y({},m))}),kC=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:s,timezone:a})=>{const l=Ti();return M.useCallback(u=>wl({adapter:l,value:u,timezone:a,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:s}})!==null,[l,e,t,n,r,o,i,s,a])},SH=(e,t,n)=>(r,o)=>{switch(o.type){case"changeMonth":return Y({},r,{slideDirection:o.direction,currentMonth:o.newMonth,isMonthSwitchingAnimating:!e});case"changeMonthTimezone":{const i=o.newTimezone;if(n.getTimezone(r.currentMonth)===i)return r;let s=n.setTimezone(r.currentMonth,i);return n.getMonth(s)!==n.getMonth(r.currentMonth)&&(s=n.setMonth(s,n.getMonth(r.currentMonth))),Y({},r,{currentMonth:s})}case"finishMonthSwitchingAnimation":return Y({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&o.focusedDay!=null&&n.isSameDay(o.focusedDay,r.focusedDay))return r;const i=o.focusedDay!=null&&!t&&!n.isSameMonth(r.currentMonth,o.focusedDay);return Y({},r,{focusedDay:o.focusedDay,isMonthSwitchingAnimating:i&&!e&&!o.withoutMonthSwitchingAnimation,currentMonth:i?n.startOfMonth(o.focusedDay):r.currentMonth,slideDirection:o.focusedDay!=null&&n.isAfterDay(o.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},kH=e=>{const{value:t,referenceDate:n,disableFuture:r,disablePast:o,disableSwitchToMonthOnDayFocus:i=!1,maxDate:s,minDate:a,onMonthChange:l,reduceAnimations:u,shouldDisableDate:d,timezone:f}=e,h=Zt(),p=M.useRef(SH(!!u,i,h)).current,m=M.useMemo(()=>Zr.getInitialReferenceValue({value:t,utils:h,timezone:f,props:e,referenceDate:n,granularity:Kr.day}),[n,f]),[b,y]=M.useReducer(p,{isMonthSwitchingAnimating:!1,focusedDay:m,currentMonth:h.startOfMonth(m),slideDirection:"left"});M.useEffect(()=>{y({type:"changeMonthTimezone",newTimezone:h.getTimezone(m)})},[m,h]);const x=M.useCallback(T=>{y(Y({type:"changeMonth"},T)),l&&l(T.newMonth)},[l]),C=M.useCallback(T=>{const N=T;h.isSameMonth(N,b.currentMonth)||x({newMonth:h.startOfMonth(N),direction:h.isAfterDay(N,b.currentMonth)?"left":"right"})},[b.currentMonth,x,h]),v=kC({shouldDisableDate:d,minDate:a,maxDate:s,disableFuture:r,disablePast:o,timezone:f}),S=M.useCallback(()=>{y({type:"finishMonthSwitchingAnimation"})},[]),I=Ve((T,N)=>{v(T)||y({type:"changeFocusedDay",focusedDay:T,withoutMonthSwitchingAnimation:N})});return{referenceDate:m,calendarState:b,changeMonth:C,changeFocusedDay:I,isDateDisabled:v,onMonthSwitchingAnimationEnd:S,handleChangeMonth:x}},wH=e=>Ge("MuiPickersFadeTransitionGroup",e);We("MuiPickersFadeTransitionGroup",["root"]);const DH=e=>{const{classes:t}=e;return Ke({root:["root"]},wH,t)},IH=fe(El,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function wC(e){const t=Kt({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:o,transKey:i}=t,s=DH(t),a=Lo();return o?n:c.jsx(IH,{className:Ue(s.root,r),children:c.jsx(hi,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:a.transitions.duration.enteringScreen,enter:a.transitions.duration.enteringScreen,exit:0},children:n},i)})}function AH(e){return Ge("MuiPickersDay",e)}const Jo=We("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),OH=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],MH=e=>{const{selected:t,disableMargin:n,disableHighlightToday:r,today:o,disabled:i,outsideCurrentMonth:s,showDaysOutsideCurrentMonth:a,classes:l}=e,u=s&&!a;return Ke({root:["root",t&&!u&&"selected",i&&"disabled",!n&&"dayWithMargin",!r&&o&&"today",s&&a&&"dayOutsideMonth",u&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},AH,l)},DC=({theme:e})=>Y({},e.typography.caption,{width:il,height:il,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),color:(e.vars||e).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${Jo.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Jo.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Jo.disabled}:not(.${Jo.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${Jo.disabled}&.${Jo.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${Rc}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${Jo.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),IC=(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.today&&t.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},PH=fe(pi,{name:"MuiPickersDay",slot:"Root",overridesResolver:IC})(DC),RH=fe("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:IC})(({theme:e})=>Y({},DC({theme:e}),{opacity:0,pointerEvents:"none"})),xa=()=>{},NH=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersDay"}),{autoFocus:o=!1,className:i,day:s,disabled:a=!1,disableHighlightToday:l=!1,disableMargin:u=!1,isAnimating:d,onClick:f,onDaySelect:h,onFocus:p=xa,onBlur:m=xa,onKeyDown:b=xa,onMouseDown:y=xa,onMouseEnter:x=xa,outsideCurrentMonth:C,selected:v=!1,showDaysOutsideCurrentMonth:S=!1,children:I,today:T=!1}=r,N=Ze(r,OH),O=Y({},r,{autoFocus:o,disabled:a,disableHighlightToday:l,disableMargin:u,selected:v,showDaysOutsideCurrentMonth:S,today:T}),F=MH(O),B=Zt(),j=M.useRef(null),D=vt(j,n);yn(()=>{o&&!a&&!d&&!C&&j.current.focus()},[o,a,d,C]);const H=L=>{y(L),C&&L.preventDefault()},_=L=>{a||h(s),C&&L.currentTarget.focus(),f&&f(L)};return C&&!S?c.jsx(RH,{className:Ue(F.root,F.hiddenDaySpacingFiller,i),ownerState:O,role:N.role}):c.jsx(PH,Y({className:Ue(F.root,i),ref:D,centerRipple:!0,disabled:a,tabIndex:v?0:-1,onKeyDown:L=>b(L,s),onFocus:L=>p(L,s),onBlur:L=>m(L,s),onMouseEnter:L=>x(L,s),onClick:_,onMouseDown:H},N,{ownerState:O,children:I||B.format(s,"dayOfMonth")}))}),FH=M.memo(NH),LH=e=>Ge("MuiPickersSlideTransition",e),dr=We("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),_H=["children","className","reduceAnimations","slideDirection","transKey","classes"],BH=e=>{const{classes:t,slideDirection:n}=e,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return Ke(r,LH,t)},jH=fe(El,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${dr["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${dr["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${dr.slideEnterActive}`]:t.slideEnterActive},{[`.${dr.slideExit}`]:t.slideExit},{[`.${dr["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${dr["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{const t=e.transitions.create("transform",{duration:e.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${dr["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${dr["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${dr.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${dr.slideExit}`]:{transform:"translate(0%)"},[`& .${dr["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${dr["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}});function $H(e){const t=Kt({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:o,transKey:i}=t,s=Ze(t,_H),a=BH(t),l=Lo();if(o)return c.jsx("div",{className:Ue(a.root,r),children:n});const u={exit:a.exit,enterActive:a.enterActive,enter:a.enter,exitActive:a.exitActive};return c.jsx(jH,{className:Ue(a.root,r),childFactory:d=>M.cloneElement(d,{classNames:u}),role:"presentation",children:c.jsx(Ip,Y({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:u},s,{children:n}),i)})}const HH=e=>Ge("MuiDayCalendar",e);We("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const zH=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],UH=["ownerState"],VH=e=>{const{classes:t}=e;return Ke({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},HH,t)},AC=(il+Rc*2)*6,WH=fe("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),qH=fe("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),YH=fe(Dt,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(e,t)=>t.weekDayLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.secondary})),KH=fe(Dt,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(e,t)=>t.weekNumberLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.disabled})),GH=fe(Dt,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>Y({},e.typography.caption,{width:il,height:il,padding:0,margin:`0 ${Rc}px`,color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),QH=fe("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:AC}),XH=fe($H,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:AC}),ZH=fe("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),JH=fe("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:`${Rc}px 0`,display:"flex",justifyContent:"center"});function ez(e){let{parentProps:t,day:n,focusableDay:r,selectedDays:o,isDateDisabled:i,currentMonthNumber:s,isViewFocused:a}=e,l=Ze(e,zH);const{disabled:u,disableHighlightToday:d,isMonthSwitchingAnimating:f,showDaysOutsideCurrentMonth:h,slots:p,slotProps:m,timezone:b}=t,y=Zt(),x=Pc(b),C=r!==null&&y.isSameDay(n,r),v=o.some(D=>y.isSameDay(D,n)),S=y.isSameDay(n,x),I=p?.day??FH,T=Et({elementType:I,externalSlotProps:m?.day,additionalProps:Y({disableHighlightToday:d,showDaysOutsideCurrentMonth:h,role:"gridcell",isAnimating:f,"data-timestamp":y.toJsDate(n).valueOf()},l),ownerState:Y({},t,{day:n,selected:v})}),N=Ze(T,UH),O=M.useMemo(()=>u||i(n),[u,i,n]),F=M.useMemo(()=>y.getMonth(n)!==s,[y,n,s]),B=M.useMemo(()=>{const D=y.startOfMonth(y.setMonth(n,s));return h?y.isSameDay(n,y.startOfWeek(D)):y.isSameDay(n,D)},[s,n,h,y]),j=M.useMemo(()=>{const D=y.endOfMonth(y.setMonth(n,s));return h?y.isSameDay(n,y.endOfWeek(D)):y.isSameDay(n,D)},[s,n,h,y]);return c.jsx(I,Y({},N,{day:n,disabled:O,autoFocus:a&&C,today:S,outsideCurrentMonth:F,isFirstVisibleCell:B,isLastVisibleCell:j,selected:v,tabIndex:C?0:-1,"aria-selected":v,"aria-current":S?"date":void 0}))}function tz(e){const t=Kt({props:e,name:"MuiDayCalendar"}),n=Zt(),{onFocusedDayChange:r,className:o,currentMonth:i,selectedDays:s,focusedDay:a,loading:l,onSelectedDaysChange:u,onMonthSwitchingAnimationEnd:d,readOnly:f,reduceAnimations:h,renderLoading:p=()=>c.jsx("span",{children:"..."}),slideDirection:m,TransitionProps:b,disablePast:y,disableFuture:x,minDate:C,maxDate:v,shouldDisableDate:S,shouldDisableMonth:I,shouldDisableYear:T,dayOfWeekFormatter:N=Ce=>n.format(Ce,"weekdayShort").charAt(0).toUpperCase(),hasFocus:O,onFocusedViewChange:F,gridLabelId:B,displayWeekNumber:j,fixedWeekNumber:D,autoFocus:H,timezone:_}=t,L=Pc(_),$=VH(t),K=kr(),G=kC({shouldDisableDate:S,shouldDisableMonth:I,shouldDisableYear:T,minDate:C,maxDate:v,disablePast:y,disableFuture:x,timezone:_}),q=vo(),[R,oe]=or({name:"DayCalendar",state:"hasFocus",controlled:O,default:H??!1}),[se,z]=M.useState(()=>a||L),pe=Ve(Ce=>{f||u(Ce)}),J=Ce=>{G(Ce)||(r(Ce),z(Ce),F?.(!0),oe(!0))},Q=Ve((Ce,we)=>{switch(Ce.key){case"ArrowUp":J(n.addDays(we,-7)),Ce.preventDefault();break;case"ArrowDown":J(n.addDays(we,7)),Ce.preventDefault();break;case"ArrowLeft":{const ye=n.addDays(we,K?1:-1),ze=n.addMonths(we,K?1:-1),Ne=qa({utils:n,date:ye,minDate:K?ye:n.startOfMonth(ze),maxDate:K?n.endOfMonth(ze):ye,isDateDisabled:G,timezone:_});J(Ne||ye),Ce.preventDefault();break}case"ArrowRight":{const ye=n.addDays(we,K?-1:1),ze=n.addMonths(we,K?-1:1),Ne=qa({utils:n,date:ye,minDate:K?n.startOfMonth(ze):ye,maxDate:K?ye:n.endOfMonth(ze),isDateDisabled:G,timezone:_});J(Ne||ye),Ce.preventDefault();break}case"Home":J(n.startOfWeek(we)),Ce.preventDefault();break;case"End":J(n.endOfWeek(we)),Ce.preventDefault();break;case"PageUp":J(n.addMonths(we,1)),Ce.preventDefault();break;case"PageDown":J(n.addMonths(we,-1)),Ce.preventDefault();break}}),re=Ve((Ce,we)=>J(we)),ne=Ve((Ce,we)=>{R&&n.isSameDay(se,we)&&F?.(!1)}),ae=n.getMonth(i),ie=n.getYear(i),Z=M.useMemo(()=>s.filter(Ce=>!!Ce).map(Ce=>n.startOfDay(Ce)),[n,s]),me=`${ie}-${ae}`,le=M.useMemo(()=>M.createRef(),[me]),ue=M.useMemo(()=>{const Ce=n.startOfMonth(i),we=n.endOfMonth(i);return G(se)||n.isAfterDay(se,we)||n.isBeforeDay(se,Ce)?qa({utils:n,date:se,minDate:Ce,maxDate:we,disablePast:y,disableFuture:x,isDateDisabled:G,timezone:_}):se},[i,x,y,se,G,n,_]),Ie=M.useMemo(()=>{const Ce=n.getWeekArray(i);let we=n.addMonths(i,1);for(;D&&Ce.length<D;){const ye=n.getWeekArray(we),ze=n.isSameDay(Ce[Ce.length-1][0],ye[0][0]);ye.slice(ze?1:0).forEach(Ne=>{Ce.length<D&&Ce.push(Ne)}),we=n.addMonths(we,1)}return Ce},[i,D,n]);return c.jsxs(WH,{role:"grid","aria-labelledby":B,className:$.root,children:[c.jsxs(qH,{role:"row",className:$.header,children:[j&&c.jsx(KH,{variant:"caption",role:"columnheader","aria-label":q.calendarWeekNumberHeaderLabel,className:$.weekNumberLabel,children:q.calendarWeekNumberHeaderText}),SB(n,L).map((Ce,we)=>c.jsx(YH,{variant:"caption",role:"columnheader","aria-label":n.format(Ce,"weekday"),className:$.weekDayLabel,children:N(Ce)},we.toString()))]}),l?c.jsx(QH,{className:$.loadingContainer,children:p()}):c.jsx(XH,Y({transKey:me,onExited:d,reduceAnimations:h,slideDirection:m,className:Ue(o,$.slideTransition)},b,{nodeRef:le,children:c.jsx(ZH,{ref:le,role:"rowgroup",className:$.monthContainer,children:Ie.map((Ce,we)=>c.jsxs(JH,{role:"row",className:$.weekContainer,"aria-rowindex":we+1,children:[j&&c.jsx(GH,{className:$.weekNumber,role:"rowheader","aria-label":q.calendarWeekNumberAriaLabelText(n.getWeekNumber(Ce[0])),children:q.calendarWeekNumberText(n.getWeekNumber(Ce[0]))}),Ce.map((ye,ze)=>c.jsx(ez,{parentProps:t,day:ye,selectedDays:Z,focusableDay:ue,onKeyDown:Q,onFocus:re,onBlur:ne,onDaySelect:pe,isDateDisabled:G,currentMonthNumber:ae,isViewFocused:R,"aria-colindex":ze+1},ye.toString()))]},`week-${Ce[0]}`))})}))]})}function nz(e){return Ge("MuiPickersMonth",e)}const tu=We("MuiPickersMonth",["root","monthButton","disabled","selected"]),rz=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],oz=e=>{const{disabled:t,selected:n,classes:r}=e;return Ke({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},nz,r)},iz=fe("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),sz=fe("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${tu.disabled}`]:t.disabled},{[`&.${tu.selected}`]:t.selected}]})(({theme:e})=>Y({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ot.alpha(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ot.alpha(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${tu.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${tu.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),az=M.memo(function(t){const n=Kt({props:t,name:"MuiPickersMonth"}),{autoFocus:r,className:o,children:i,disabled:s,selected:a,value:l,tabIndex:u,onClick:d,onKeyDown:f,onFocus:h,onBlur:p,"aria-current":m,"aria-label":b,slots:y,slotProps:x}=n,C=Ze(n,rz),v=M.useRef(null),S=oz(n);yn(()=>{r&&v.current?.focus()},[r]);const I=y?.monthButton??sz,T=Et({elementType:I,externalSlotProps:x?.monthButton,additionalProps:{children:i,disabled:s,tabIndex:u,ref:v,type:"button",role:"radio","aria-current":m,"aria-checked":a,"aria-label":b,onClick:N=>d(N,l),onKeyDown:N=>f(N,l),onFocus:N=>h(N,l),onBlur:N=>p(N,l)},ownerState:n,className:S.monthButton});return c.jsx(iz,Y({className:Ue(S.root,o),ownerState:n},C,{children:c.jsx(I,Y({},T))}))});function lz(e){return Ge("MuiMonthCalendar",e)}We("MuiMonthCalendar",["root"]);const uz=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],cz=e=>{const{classes:t}=e;return Ke({root:["root"]},lz,t)};function dz(e,t){const n=Zt(),r=kl(),o=Kt({props:e,name:t});return Y({disableFuture:!1,disablePast:!1},o,{minDate:vr(n,o.minDate,r.minDate),maxDate:vr(n,o.maxDate,r.maxDate)})}const fz=fe("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:Nc,boxSizing:"border-box"}),pz=M.forwardRef(function(t,n){const r=dz(t,"MuiMonthCalendar"),{className:o,value:i,defaultValue:s,referenceDate:a,disabled:l,disableFuture:u,disablePast:d,maxDate:f,minDate:h,onChange:p,shouldDisableMonth:m,readOnly:b,autoFocus:y=!1,onMonthFocus:x,hasFocus:C,onFocusedViewChange:v,monthsPerRow:S=3,timezone:I,gridLabelId:T,slots:N,slotProps:O}=r,F=Ze(r,uz),{value:B,handleValueChange:j,timezone:D}=nh({name:"MonthCalendar",timezone:I,value:i,defaultValue:s,referenceDate:a,onChange:p,valueManager:Zr}),H=Pc(D),_=kr(),L=Zt(),$=M.useMemo(()=>Zr.getInitialReferenceValue({value:B,utils:L,props:r,timezone:D,referenceDate:a,granularity:Kr.month}),[]),K=r,G=cz(K),q=M.useMemo(()=>L.getMonth(H),[L,H]),R=M.useMemo(()=>B!=null?L.getMonth(B):null,[B,L]),[oe,se]=M.useState(()=>R||L.getMonth($)),[z,pe]=or({name:"MonthCalendar",state:"hasFocus",controlled:C,default:y??!1}),J=Ve(me=>{pe(me),v&&v(me)}),Q=M.useCallback(me=>{const le=L.startOfMonth(d&&L.isAfter(H,h)?H:h),ue=L.startOfMonth(u&&L.isBefore(H,f)?H:f),Ie=L.startOfMonth(me);return L.isBefore(Ie,le)||L.isAfter(Ie,ue)?!0:m?m(Ie):!1},[u,d,f,h,H,m,L]),re=Ve((me,le)=>{if(b)return;const ue=L.setMonth(B??$,le);j(ue)}),ne=Ve(me=>{Q(L.setMonth(B??$,me))||(se(me),J(!0),x&&x(me))});M.useEffect(()=>{se(me=>R!==null&&me!==R?R:me)},[R]);const ae=Ve((me,le)=>{switch(me.key){case"ArrowUp":ne((12+le-3)%12),me.preventDefault();break;case"ArrowDown":ne((12+le+3)%12),me.preventDefault();break;case"ArrowLeft":ne((12+le+(_?1:-1))%12),me.preventDefault();break;case"ArrowRight":ne((12+le+(_?-1:1))%12),me.preventDefault();break}}),ie=Ve((me,le)=>{ne(le)}),Z=Ve((me,le)=>{oe===le&&J(!1)});return c.jsx(fz,Y({ref:n,className:Ue(G.root,o),ownerState:K,role:"radiogroup","aria-labelledby":T},F,{children:Xp(L,B??$).map(me=>{const le=L.getMonth(me),ue=L.format(me,"monthShort"),Ie=L.format(me,"month"),Ce=le===R,we=l||Q(me);return c.jsx(az,{selected:Ce,value:le,onClick:re,onKeyDown:ae,autoFocus:z&&le===oe,disabled:we,tabIndex:le===oe&&!we?0:-1,onFocus:ie,onBlur:Z,"aria-current":q===le?"date":void 0,"aria-label":Ie,monthsPerRow:S,slots:N,slotProps:O,children:ue},ue)})}))});function hz(e){return Ge("MuiPickersYear",e)}const nu=We("MuiPickersYear",["root","yearButton","selected","disabled"]),mz=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],gz=e=>{const{disabled:t,selected:n,classes:r}=e;return Ke({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},hz,r)},bz=fe("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),yz=fe("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${nu.disabled}`]:t.disabled},{[`&.${nu.selected}`]:t.selected}]})(({theme:e})=>Y({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:Ot.alpha(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ot.alpha(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${nu.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${nu.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),xz=M.memo(function(t){const n=Kt({props:t,name:"MuiPickersYear"}),{autoFocus:r,className:o,children:i,disabled:s,selected:a,value:l,tabIndex:u,onClick:d,onKeyDown:f,onFocus:h,onBlur:p,"aria-current":m,slots:b,slotProps:y}=n,x=Ze(n,mz),C=M.useRef(null),v=gz(n);yn(()=>{r&&C.current?.focus()},[r]);const S=b?.yearButton??yz,I=Et({elementType:S,externalSlotProps:y?.yearButton,additionalProps:{children:i,disabled:s,tabIndex:u,ref:C,type:"button",role:"radio","aria-current":m,"aria-checked":a,onClick:T=>d(T,l),onKeyDown:T=>f(T,l),onFocus:T=>h(T,l),onBlur:T=>p(T,l)},ownerState:n,className:v.yearButton});return c.jsx(bz,Y({className:Ue(v.root,o),ownerState:n},x,{children:c.jsx(S,Y({},I))}))});function Cz(e){return Ge("MuiYearCalendar",e)}We("MuiYearCalendar",["root"]);const Ez=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],vz=e=>{const{classes:t}=e;return Ke({root:["root"]},Cz,t)};function Tz(e,t){const n=Zt(),r=kl(),o=Kt({props:e,name:t});return Y({disablePast:!1,disableFuture:!1},o,{yearsPerRow:o.yearsPerRow??3,minDate:vr(n,o.minDate,r.minDate),maxDate:vr(n,o.maxDate,r.maxDate)})}const Sz=fe("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:Nc,maxHeight:Qj,boxSizing:"border-box",position:"relative"}),kz=M.forwardRef(function(t,n){const r=Tz(t,"MuiYearCalendar"),{autoFocus:o,className:i,value:s,defaultValue:a,referenceDate:l,disabled:u,disableFuture:d,disablePast:f,maxDate:h,minDate:p,onChange:m,readOnly:b,shouldDisableYear:y,onYearFocus:x,hasFocus:C,onFocusedViewChange:v,yearsOrder:S="asc",yearsPerRow:I,timezone:T,gridLabelId:N,slots:O,slotProps:F}=r,B=Ze(r,Ez),{value:j,handleValueChange:D,timezone:H}=nh({name:"YearCalendar",timezone:T,value:s,defaultValue:a,referenceDate:l,onChange:m,valueManager:Zr}),_=Pc(H),L=kr(),$=Zt(),K=M.useMemo(()=>Zr.getInitialReferenceValue({value:j,utils:$,props:r,timezone:H,referenceDate:l,granularity:Kr.year}),[]),G=r,q=vz(G),R=M.useMemo(()=>$.getYear(_),[$,_]),oe=M.useMemo(()=>j!=null?$.getYear(j):null,[j,$]),[se,z]=M.useState(()=>oe||$.getYear(K)),[pe,J]=or({name:"YearCalendar",state:"hasFocus",controlled:C,default:o??!1}),Q=Ve(ye=>{J(ye),v&&v(ye)}),re=M.useCallback(ye=>{if(f&&$.isBeforeYear(ye,_)||d&&$.isAfterYear(ye,_)||p&&$.isBeforeYear(ye,p)||h&&$.isAfterYear(ye,h))return!0;if(!y)return!1;const ze=$.startOfYear(ye);return y(ze)},[d,f,h,p,_,y,$]),ne=Ve((ye,ze)=>{if(b)return;const Ne=$.setYear(j??K,ze);D(Ne)}),ae=Ve(ye=>{re($.setYear(j??K,ye))||(z(ye),Q(!0),x?.(ye))});M.useEffect(()=>{z(ye=>oe!==null&&ye!==oe?oe:ye)},[oe]);const ie=S!=="desc"?I*1:I*-1,Z=L&&S==="asc"||!L&&S==="desc"?-1:1,me=Ve((ye,ze)=>{switch(ye.key){case"ArrowUp":ae(ze-ie),ye.preventDefault();break;case"ArrowDown":ae(ze+ie),ye.preventDefault();break;case"ArrowLeft":ae(ze-Z),ye.preventDefault();break;case"ArrowRight":ae(ze+Z),ye.preventDefault();break}}),le=Ve((ye,ze)=>{ae(ze)}),ue=Ve((ye,ze)=>{se===ze&&Q(!1)}),Ie=M.useRef(null),Ce=vt(n,Ie);M.useEffect(()=>{if(o||Ie.current===null)return;const ye=Ie.current.querySelector('[tabindex="0"]');if(!ye)return;const ze=ye.offsetHeight,Ne=ye.offsetTop,nt=Ie.current.clientHeight,_e=Ie.current.scrollTop,Bt=Ne+ze;ze>nt||Ne<_e||(Ie.current.scrollTop=Bt-nt/2-ze/2)},[o]);const we=$.getYearRange([p,h]);return S==="desc"&&we.reverse(),c.jsx(Sz,Y({ref:Ce,className:Ue(q.root,i),ownerState:G,role:"radiogroup","aria-labelledby":N},B,{children:we.map(ye=>{const ze=$.getYear(ye),Ne=ze===oe,nt=u||re(ye);return c.jsx(xz,{selected:Ne,value:ze,onClick:ne,onKeyDown:me,autoFocus:pe&&ze===se,disabled:nt,tabIndex:ze===se&&!nt?0:-1,onFocus:le,onBlur:ue,"aria-current":R===ze?"date":void 0,yearsPerRow:I,slots:O,slotProps:F,children:$.format(ye,"year")},$.format(ye,"year"))})}))}),wz=e=>Ge("MuiPickersCalendarHeader",e),Dz=We("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);function Iz(e){return Ge("MuiPickersArrowSwitcher",e)}We("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const Az=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],Oz=["ownerState"],Mz=["ownerState"],Pz=fe("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),Rz=fe("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),W1=fe(Ir,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),Nz=e=>{const{classes:t}=e;return Ke({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},Iz,t)},Fz=M.forwardRef(function(t,n){const r=kr(),o=Kt({props:t,name:"MuiPickersArrowSwitcher"}),{children:i,className:s,slots:a,slotProps:l,isNextDisabled:u,isNextHidden:d,onGoToNext:f,nextLabel:h,isPreviousDisabled:p,isPreviousHidden:m,onGoToPrevious:b,previousLabel:y,labelId:x}=o,C=Ze(o,Az),v=o,S=Nz(v),I={isDisabled:u,isHidden:d,goTo:f,label:h},T={isDisabled:p,isHidden:m,goTo:b,label:y},N=a?.previousIconButton??W1,O=Et({elementType:N,externalSlotProps:l?.previousIconButton,additionalProps:{size:"medium",title:T.label,"aria-label":T.label,disabled:T.isDisabled,edge:"end",onClick:T.goTo},ownerState:Y({},v,{hidden:T.isHidden}),className:Ue(S.button,S.previousIconButton)}),F=a?.nextIconButton??W1,B=Et({elementType:F,externalSlotProps:l?.nextIconButton,additionalProps:{size:"medium",title:I.label,"aria-label":I.label,disabled:I.isDisabled,edge:"start",onClick:I.goTo},ownerState:Y({},v,{hidden:I.isHidden}),className:Ue(S.button,S.nextIconButton)}),j=a?.leftArrowIcon??f$,D=Et({elementType:j,externalSlotProps:l?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:v,className:S.leftArrowIcon}),H=Ze(D,Oz),_=a?.rightArrowIcon??p$,L=Et({elementType:_,externalSlotProps:l?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:v,className:S.rightArrowIcon}),$=Ze(L,Mz);return c.jsxs(Pz,Y({ref:n,className:Ue(S.root,s),ownerState:v},C,{children:[c.jsx(N,Y({},O,{children:r?c.jsx(_,Y({},$)):c.jsx(j,Y({},H))})),i?c.jsx(Dt,{variant:"subtitle1",component:"span",id:x,children:i}):c.jsx(Rz,{className:S.spacer,ownerState:v}),c.jsx(F,Y({},B,{children:r?c.jsx(j,Y({},H)):c.jsx(_,Y({},$))}))]}))});function Lz(e,{disableFuture:t,maxDate:n,timezone:r}){const o=Zt();return M.useMemo(()=>{const i=o.date(void 0,r),s=o.startOfMonth(t&&o.isBefore(i,n)?i:n);return!o.isAfter(s,e)},[t,n,e,o,r])}function _z(e,{disablePast:t,minDate:n,timezone:r}){const o=Zt();return M.useMemo(()=>{const i=o.date(void 0,r),s=o.startOfMonth(t&&o.isAfter(i,n)?i:n);return!o.isBefore(s,e)},[t,n,e,o,r])}const Bz=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],jz=["ownerState"],$z=e=>{const{classes:t}=e;return Ke({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},wz,t)},Hz=fe("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),zz=fe("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>Y({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),Uz=fe("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),Vz=fe(Ir,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${Dz.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),Wz=fe(d$,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),qz=M.forwardRef(function(t,n){const r=vo(),o=Zt(),i=Kt({props:t,name:"MuiPickersCalendarHeader"}),{slots:s,slotProps:a,currentMonth:l,disabled:u,disableFuture:d,disablePast:f,maxDate:h,minDate:p,onMonthChange:m,onViewChange:b,view:y,reduceAnimations:x,views:C,labelId:v,className:S,timezone:I,format:T=`${o.formats.month} ${o.formats.year}`}=i,N=Ze(i,Bz),O=i,F=$z(i),B=s?.switchViewButton??Vz,j=Et({elementType:B,externalSlotProps:a?.switchViewButton,additionalProps:{size:"small","aria-label":r.calendarViewSwitchingButtonAriaLabel(y)},ownerState:O,className:F.switchViewButton}),D=s?.switchViewIcon??Wz,H=Et({elementType:D,externalSlotProps:a?.switchViewIcon,ownerState:O,className:F.switchViewIcon}),_=Ze(H,jz),L=()=>m(o.addMonths(l,1),"left"),$=()=>m(o.addMonths(l,-1),"right"),K=Lz(l,{disableFuture:d,maxDate:h,timezone:I}),G=_z(l,{disablePast:f,minDate:p,timezone:I}),q=()=>{if(!(C.length===1||!b||u))if(C.length===2)b(C.find(oe=>oe!==y)||C[0]);else{const oe=C.indexOf(y)!==0?0:1;b(C[oe])}};if(C.length===1&&C[0]==="year")return null;const R=o.formatByString(l,T);return c.jsxs(Hz,Y({},N,{ownerState:O,className:Ue(F.root,S),ref:n,children:[c.jsxs(zz,{role:"presentation",onClick:q,ownerState:O,"aria-live":"polite",className:F.labelContainer,children:[c.jsx(wC,{reduceAnimations:x,transKey:R,children:c.jsx(Uz,{id:v,ownerState:O,className:F.label,children:R})}),C.length>1&&!u&&c.jsx(B,Y({},j,{children:c.jsx(D,Y({},_))}))]}),c.jsx(hi,{in:y==="day",appear:!x,enter:!x,children:c.jsx(Fz,{slots:s,slotProps:a,onGoToPrevious:$,isPreviousDisabled:G,previousLabel:r.previousMonth,onGoToNext:L,isNextDisabled:K,nextLabel:r.nextMonth})})]}))}),Yz=fe("div")({overflow:"hidden",width:Nc,maxHeight:rh,display:"flex",flexDirection:"column",margin:"0 auto"}),Kz=e=>Ge("MuiDateCalendar",e);We("MuiDateCalendar",["root","viewTransitionContainer"]);const Gz=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],Qz=e=>{const{classes:t}=e;return Ke({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},Kz,t)};function Xz(e,t){const n=Zt(),r=kl(),o=cC(),i=Kt({props:e,name:t});return Y({},i,{loading:i.loading??!1,disablePast:i.disablePast??!1,disableFuture:i.disableFuture??!1,openTo:i.openTo??"day",views:i.views??["year","day"],reduceAnimations:i.reduceAnimations??o,renderLoading:i.renderLoading??(()=>c.jsx("span",{children:"..."})),minDate:vr(n,i.minDate,r.minDate),maxDate:vr(n,i.maxDate,r.maxDate)})}const Zz=fe(Yz,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:rh}),Jz=fe(wC,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),eU=M.forwardRef(function(t,n){const r=Zt(),o=_r(),i=Xz(t,"MuiDateCalendar"),{autoFocus:s,onViewChange:a,value:l,defaultValue:u,referenceDate:d,disableFuture:f,disablePast:h,onChange:p,onYearChange:m,onMonthChange:b,reduceAnimations:y,shouldDisableDate:x,shouldDisableMonth:C,shouldDisableYear:v,view:S,views:I,openTo:T,className:N,disabled:O,readOnly:F,minDate:B,maxDate:j,disableHighlightToday:D,focusedView:H,onFocusedViewChange:_,showDaysOutsideCurrentMonth:L,fixedWeekNumber:$,dayOfWeekFormatter:K,slots:G,slotProps:q,loading:R,renderLoading:oe,displayWeekNumber:se,yearsOrder:z,yearsPerRow:pe,monthsPerRow:J,timezone:Q}=i,re=Ze(i,Gz),{value:ne,handleValueChange:ae,timezone:ie}=nh({name:"DateCalendar",timezone:Q,value:l,defaultValue:u,referenceDate:d,onChange:p,valueManager:Zr}),{view:Z,setView:me,focusedView:le,setFocusedView:ue,goToNextView:Ie,setValueAndGoToNextView:Ce}=dC({view:S,views:I,openTo:T,onChange:ae,onViewChange:a,autoFocus:s,focusedView:H,onFocusedViewChange:_}),{referenceDate:we,calendarState:ye,changeFocusedDay:ze,changeMonth:Ne,handleChangeMonth:nt,isDateDisabled:_e,onMonthSwitchingAnimationEnd:Bt}=kH({value:ne,referenceDate:d,reduceAnimations:y,onMonthChange:b,minDate:B,maxDate:j,shouldDisableDate:x,disablePast:h,disableFuture:f,timezone:ie}),yt=O&&ne||B,ot=O&&ne||j,xe=`${o}-grid-label`,Pe=le!==null,qe=G?.calendarHeader??qz,Je=Et({elementType:qe,externalSlotProps:q?.calendarHeader,additionalProps:{views:I,view:Z,currentMonth:ye.currentMonth,onViewChange:me,onMonthChange:(st,Nt)=>nt({newMonth:st,direction:Nt}),minDate:yt,maxDate:ot,disabled:O,disablePast:h,disableFuture:f,reduceAnimations:y,timezone:ie,labelId:xe},ownerState:i}),Xe=Ve(st=>{const Nt=r.startOfMonth(st),Gt=r.endOfMonth(st),bt=_e(st)?qa({utils:r,date:st,minDate:r.isBefore(B,Nt)?Nt:B,maxDate:r.isAfter(j,Gt)?Gt:j,disablePast:h,disableFuture:f,isDateDisabled:_e,timezone:ie}):st;bt?(Ce(bt,"finish"),b?.(Nt)):(Ie(),Ne(Nt)),ze(bt,!0)}),Re=Ve(st=>{const Nt=r.startOfYear(st),Gt=r.endOfYear(st),bt=_e(st)?qa({utils:r,date:st,minDate:r.isBefore(B,Nt)?Nt:B,maxDate:r.isAfter(j,Gt)?Gt:j,disablePast:h,disableFuture:f,isDateDisabled:_e,timezone:ie}):st;bt?(Ce(bt,"finish"),m?.(bt)):(Ie(),Ne(Nt)),ze(bt,!0)}),ct=Ve(st=>ae(st&&Qu(r,st,ne??we),"finish",Z));M.useEffect(()=>{ne!=null&&r.isValid(ne)&&Ne(ne)},[ne]);const lt=i,Mt=Qz(lt),be={disablePast:h,disableFuture:f,maxDate:j,minDate:B},Ae={disableHighlightToday:D,readOnly:F,disabled:O,timezone:ie,gridLabelId:xe,slots:G,slotProps:q},Oe=M.useRef(Z);M.useEffect(()=>{Oe.current!==Z&&(le===Oe.current&&ue(Z,!0),Oe.current=Z)},[le,ue,Z]);const Qe=M.useMemo(()=>[ne],[ne]);return c.jsxs(Zz,Y({ref:n,className:Ue(Mt.root,N),ownerState:lt},re,{children:[c.jsx(qe,Y({},Je,{slots:G,slotProps:q})),c.jsx(Jz,{reduceAnimations:y,className:Mt.viewTransitionContainer,transKey:Z,ownerState:lt,children:c.jsxs("div",{children:[Z==="year"&&c.jsx(kz,Y({},be,Ae,{value:ne,onChange:Re,shouldDisableYear:v,hasFocus:Pe,onFocusedViewChange:st=>ue("year",st),yearsOrder:z,yearsPerRow:pe,referenceDate:we})),Z==="month"&&c.jsx(pz,Y({},be,Ae,{hasFocus:Pe,className:N,value:ne,onChange:Xe,shouldDisableMonth:C,onFocusedViewChange:st=>ue("month",st),monthsPerRow:J,referenceDate:we})),Z==="day"&&c.jsx(tz,Y({},ye,be,Ae,{onMonthSwitchingAnimationEnd:Bt,onFocusedDayChange:ze,reduceAnimations:y,selectedDays:Qe,onSelectedDaysChange:ct,shouldDisableDate:x,shouldDisableMonth:C,shouldDisableYear:v,hasFocus:Pe,onFocusedViewChange:st=>ue("day",st),showDaysOutsideCurrentMonth:L,fixedWeekNumber:$,dayOfWeekFormatter:K,displayWeekNumber:se,loading:R,renderLoading:oe}))]})})]}))}),us=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:o,value:i,defaultValue:s,referenceDate:a,onChange:l,className:u,classes:d,disableFuture:f,disablePast:h,minDate:p,maxDate:m,shouldDisableDate:b,shouldDisableMonth:y,shouldDisableYear:x,reduceAnimations:C,onMonthChange:v,monthsPerRow:S,onYearChange:I,yearsOrder:T,yearsPerRow:N,slots:O,slotProps:F,loading:B,renderLoading:j,disableHighlightToday:D,readOnly:H,disabled:_,showDaysOutsideCurrentMonth:L,dayOfWeekFormatter:$,sx:K,autoFocus:G,fixedWeekNumber:q,displayWeekNumber:R,timezone:oe})=>c.jsx(eU,{view:e,onViewChange:t,views:n.filter(M1),focusedView:r&&M1(r)?r:null,onFocusedViewChange:o,value:i,defaultValue:s,referenceDate:a,onChange:l,className:u,classes:d,disableFuture:f,disablePast:h,minDate:p,maxDate:m,shouldDisableDate:b,shouldDisableMonth:y,shouldDisableYear:x,reduceAnimations:C,onMonthChange:v,monthsPerRow:S,onYearChange:I,yearsOrder:T,yearsPerRow:N,slots:O,slotProps:F,loading:B,renderLoading:j,disableHighlightToday:D,readOnly:H,disabled:_,showDaysOutsideCurrentMonth:L,dayOfWeekFormatter:$,sx:K,autoFocus:G,fixedWeekNumber:q,displayWeekNumber:R,timezone:oe}),OC=M.forwardRef(function(t,n){const r=vo(),o=Zt(),i=iC(t,"MuiDesktopDatePicker"),s=Y({day:us,month:us,year:us},i.viewRenderers),a=Y({},i,{viewRenderers:s,format:Zp(o,i,!1),yearsPerRow:i.yearsPerRow??4,slots:Y({openPickerIcon:h$,field:SC},i.slots),slotProps:Y({},i.slotProps,{field:u=>Y({},br(i.slotProps?.field,u),aC(i),{ref:n}),toolbar:Y({hidden:!0},i.slotProps?.toolbar)})}),{renderPicker:l}=c$({props:a,valueManager:Zr,valueType:"date",getOpenDialogAriaText:rC({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:a.localeText?.openDatePickerDialogue}),validator:wl});return l()});OC.propTypes={autoFocus:Ee.bool,className:Ee.string,closeOnSelect:Ee.bool,dayOfWeekFormatter:Ee.func,defaultValue:Ee.object,disabled:Ee.bool,disableFuture:Ee.bool,disableHighlightToday:Ee.bool,disableOpenPicker:Ee.bool,disablePast:Ee.bool,displayWeekNumber:Ee.bool,enableAccessibleFieldDOMStructure:Ee.any,fixedWeekNumber:Ee.number,format:Ee.string,formatDensity:Ee.oneOf(["dense","spacious"]),inputRef:o2,label:Ee.node,loading:Ee.bool,localeText:Ee.object,maxDate:Ee.object,minDate:Ee.object,monthsPerRow:Ee.oneOf([3,4]),name:Ee.string,onAccept:Ee.func,onChange:Ee.func,onClose:Ee.func,onError:Ee.func,onMonthChange:Ee.func,onOpen:Ee.func,onSelectedSectionsChange:Ee.func,onViewChange:Ee.func,onYearChange:Ee.func,open:Ee.bool,openTo:Ee.oneOf(["day","month","year"]),orientation:Ee.oneOf(["landscape","portrait"]),readOnly:Ee.bool,reduceAnimations:Ee.bool,referenceDate:Ee.object,renderLoading:Ee.func,selectedSections:Ee.oneOfType([Ee.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),Ee.number]),shouldDisableDate:Ee.func,shouldDisableMonth:Ee.func,shouldDisableYear:Ee.func,showDaysOutsideCurrentMonth:Ee.bool,slotProps:Ee.object,slots:Ee.object,sx:Ee.oneOfType([Ee.arrayOf(Ee.oneOfType([Ee.func,Ee.object,Ee.bool])),Ee.func,Ee.object]),timezone:Ee.string,value:Ee.object,view:Ee.oneOf(["day","month","year"]),viewRenderers:Ee.shape({day:Ee.func,month:Ee.func,year:Ee.func}),views:Ee.arrayOf(Ee.oneOf(["day","month","year"]).isRequired),yearsOrder:Ee.oneOf(["asc","desc"]),yearsPerRow:Ee.oneOf([3,4])};const tU=fe(no)({[`& .${za.container}`]:{outline:0},[`& .${za.paper}`]:{outline:0,minWidth:Nc}}),nU=fe(oo)({"&:first-of-type":{padding:0}});function rU(e){const{children:t,onDismiss:n,open:r,slots:o,slotProps:i}=e,s=o?.dialog??tU,a=o?.mobileTransition??hi;return c.jsx(s,Y({open:r,onClose:n},i?.dialog,{TransitionComponent:a,TransitionProps:i?.mobileTransition,PaperComponent:o?.mobilePaper,PaperProps:i?.mobilePaper,children:c.jsx(nU,{children:t})}))}const oU=["props","getOpenDialogAriaText"],iU=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=Ze(e,oU);const{slots:o,slotProps:i,className:s,sx:a,format:l,formatDensity:u,enableAccessibleFieldDOMStructure:d,selectedSections:f,onSelectedSectionsChange:h,timezone:p,name:m,label:b,inputRef:y,readOnly:x,disabled:C,localeText:v}=t,S=M.useRef(null),I=_r(),T=i?.toolbar?.hidden??!1,{open:N,actions:O,layoutProps:F,renderCurrentView:B,fieldProps:j,contextValue:D}=fC(Y({},r,{props:t,fieldRef:S,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),H=o.field,_=Et({elementType:H,externalSlotProps:i?.field,additionalProps:Y({},j,T&&{id:I},!(C||x)&&{onClick:O.onOpen,onKeyDown:gj(O.onOpen)},{readOnly:x??!0,disabled:C,className:s,sx:a,format:l,formatDensity:u,enableAccessibleFieldDOMStructure:d,selectedSections:f,onSelectedSectionsChange:h,timezone:p,label:b,name:m},y?{inputRef:y}:{}),ownerState:t});_.inputProps=Y({},_.inputProps,{"aria-label":n(j.value)});const L=Y({textField:o.textField},_.slots),$=o.layout??mC;let K=I;T&&(b?K=`${I}-label`:K=void 0);const G=Y({},i,{toolbar:Y({},i?.toolbar,{titleId:I}),mobilePaper:Y({"aria-labelledby":K},i?.mobilePaper)}),q=vt(S,_.unstableFieldRef);return{renderPicker:()=>c.jsxs(gC,{contextValue:D,localeText:v,children:[c.jsx(H,Y({},_,{slots:L,slotProps:G,unstableFieldRef:q})),c.jsx(rU,Y({},O,{open:N,slots:o,slotProps:G,children:c.jsx($,Y({},F,G?.layout,{slots:o,slotProps:G,children:B()}))}))]})}},MC=M.forwardRef(function(t,n){const r=vo(),o=Zt(),i=iC(t,"MuiMobileDatePicker"),s=Y({day:us,month:us,year:us},i.viewRenderers),a=Y({},i,{viewRenderers:s,format:Zp(o,i,!1),slots:Y({field:SC},i.slots),slotProps:Y({},i.slotProps,{field:u=>Y({},br(i.slotProps?.field,u),aC(i),{ref:n}),toolbar:Y({hidden:!1},i.slotProps?.toolbar)})}),{renderPicker:l}=iU({props:a,valueManager:Zr,valueType:"date",getOpenDialogAriaText:rC({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:a.localeText?.openDatePickerDialogue}),validator:wl});return l()});MC.propTypes={autoFocus:Ee.bool,className:Ee.string,closeOnSelect:Ee.bool,dayOfWeekFormatter:Ee.func,defaultValue:Ee.object,disabled:Ee.bool,disableFuture:Ee.bool,disableHighlightToday:Ee.bool,disableOpenPicker:Ee.bool,disablePast:Ee.bool,displayWeekNumber:Ee.bool,enableAccessibleFieldDOMStructure:Ee.any,fixedWeekNumber:Ee.number,format:Ee.string,formatDensity:Ee.oneOf(["dense","spacious"]),inputRef:o2,label:Ee.node,loading:Ee.bool,localeText:Ee.object,maxDate:Ee.object,minDate:Ee.object,monthsPerRow:Ee.oneOf([3,4]),name:Ee.string,onAccept:Ee.func,onChange:Ee.func,onClose:Ee.func,onError:Ee.func,onMonthChange:Ee.func,onOpen:Ee.func,onSelectedSectionsChange:Ee.func,onViewChange:Ee.func,onYearChange:Ee.func,open:Ee.bool,openTo:Ee.oneOf(["day","month","year"]),orientation:Ee.oneOf(["landscape","portrait"]),readOnly:Ee.bool,reduceAnimations:Ee.bool,referenceDate:Ee.object,renderLoading:Ee.func,selectedSections:Ee.oneOfType([Ee.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),Ee.number]),shouldDisableDate:Ee.func,shouldDisableMonth:Ee.func,shouldDisableYear:Ee.func,showDaysOutsideCurrentMonth:Ee.bool,slotProps:Ee.object,slots:Ee.object,sx:Ee.oneOfType([Ee.arrayOf(Ee.oneOfType([Ee.func,Ee.object,Ee.bool])),Ee.func,Ee.object]),timezone:Ee.string,value:Ee.object,view:Ee.oneOf(["day","month","year"]),viewRenderers:Ee.shape({day:Ee.func,month:Ee.func,year:Ee.func}),views:Ee.arrayOf(Ee.oneOf(["day","month","year"]).isRequired),yearsOrder:Ee.oneOf(["asc","desc"]),yearsPerRow:Ee.oneOf([3,4])};const sU=["desktopModeMediaQuery"],vu=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiDatePicker"}),{desktopModeMediaQuery:o=bj}=r,i=Ze(r,sU);return Q2(o,{defaultMatches:!0})?c.jsx(OC,Y({ref:n},i)):c.jsx(MC,Y({ref:n},i))});var Tu={exports:{}},aU=Tu.exports,q1;function lU(){return q1||(q1=1,(function(e,t){(function(n,r){e.exports=r()})(aU,(function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,o=/([+-]|\d\d)/g;return function(i,s,a){var l=s.prototype;a.utc=function(b){var y={date:b,utc:!0,args:arguments};return new s(y)},l.utc=function(b){var y=a(this.toDate(),{locale:this.$L,utc:!0});return b?y.add(this.utcOffset(),n):y},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var u=l.parse;l.parse=function(b){b.utc&&(this.$u=!0),this.$utils().u(b.$offset)||(this.$offset=b.$offset),u.call(this,b)};var d=l.init;l.init=function(){if(this.$u){var b=this.$d;this.$y=b.getUTCFullYear(),this.$M=b.getUTCMonth(),this.$D=b.getUTCDate(),this.$W=b.getUTCDay(),this.$H=b.getUTCHours(),this.$m=b.getUTCMinutes(),this.$s=b.getUTCSeconds(),this.$ms=b.getUTCMilliseconds()}else d.call(this)};var f=l.utcOffset;l.utcOffset=function(b,y){var x=this.$utils().u;if(x(b))return this.$u?0:x(this.$offset)?f.call(this):this.$offset;if(typeof b=="string"&&(b=(function(I){I===void 0&&(I="");var T=I.match(r);if(!T)return null;var N=(""+T[0]).match(o)||["-",0,0],O=N[0],F=60*+N[1]+ +N[2];return F===0?0:O==="+"?F:-F})(b),b===null))return this;var C=Math.abs(b)<=16?60*b:b;if(C===0)return this.utc(y);var v=this.clone();if(y)return v.$offset=C,v.$u=!1,v;var S=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(v=this.local().add(C+S,n)).$offset=C,v.$x.$localOffset=S,v};var h=l.format;l.format=function(b){var y=b||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,y)},l.valueOf=function(){var b=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*b},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var p=l.toDate;l.toDate=function(b){return b==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():p.call(this)};var m=l.diff;l.diff=function(b,y,x){if(b&&this.$u===b.$u)return m.call(this,b,y,x);var C=this.local(),v=a(b).local();return m.call(C,v,y,x)}}}))})(Tu)),Tu.exports}var uU=lU();const PC=Tr(uU);_t.extend(PC);function Ud(e){switch(e){case"Star":return["Equals","Contains"];case"MinMax":return["Equals","Less Than","Greater Than","Between"];case"DateMinMax":return["Equals","Before","After","Between"];case"Retrieval":return["Semantic Search"];case"Boolean":return["Equals"];case"NONE":default:return[]}}function cU(e){return e==="DateMinMax"}function Vd(e){return e==="Between"}function RC({spec:e,values:t,selection:n,onChange:r,retrievalFn:o}){const i=()=>n?.matchType?n.matchType:e.defaultMatchType?e.defaultMatchType:e.filterType==="DateMinMax"?"Between":Ud(e.filterType)[0]||"Equals",[s,a]=W.useState(i()),[l,u]=W.useState(n?.value??""),[d,f]=W.useState(n?.value2??""),[h,p]=W.useState([]),[m,b]=W.useState(!1),[y,x]=W.useState(""),[C,v]=W.useState(!1),[S,I]=W.useState(!1),T=W.useRef(null),N=W.useRef(0),[O,F]=W.useState(!1);W.useEffect(()=>{if(e.filterType!=="Retrieval"||!o)return;const R=y.trim();if(R.length<=2){p([]),v(!1);return}return T.current&&clearTimeout(T.current),T.current=setTimeout(async()=>{N.current+=1;const oe=N.current;b(!0);try{const se=await o(R,e);oe===N.current&&p(se)}catch(se){oe===N.current&&(console.error("Retrieval failed",se),p([]))}finally{oe===N.current&&(b(!1),v(!0))}},500),()=>{T.current&&clearTimeout(T.current)}},[y,e,o]),W.useEffect(()=>{n===null?(u(""),f(""),a(e.defaultMatchType??(e.filterType==="DateMinMax"?"Between":Ud(e.filterType)[0]||"Equals"))):n&&(a(n.matchType),u(n.value??""),f(n.value2??""))},[n,e.filterType,e.defaultMatchType]);const B=Ud(e.filterType),j=cU(e.filterType),D=Vd(s),H=j&&t.length>=2&&t[0].value instanceof Date?_t.utc(t[0].value):void 0,_=j&&t.length>=2&&t[1].value instanceof Date?_t.utc(t[1].value):void 0,L=e.filterType==="MinMax"&&t.length>=2&&typeof t[0].value=="number"?t[0].value:void 0,$=e.filterType==="MinMax"&&t.length>=2&&typeof t[1].value=="number"?t[1].value:void 0;if(B.length===0)return null;const K=R=>{const oe=R.target.value;a(oe),Vd(oe)||f(""),l&&r({dimensionName:e.dimensionName,source:e.source,filterName:e.filterName,matchType:oe,value:l,...Vd(oe)&&d&&{value2:d}})},G=(R,oe)=>{u(R??""),oe!==void 0&&f(oe??"");const se=Array.isArray(R)&&R.length===0;r(!se&&R!==""&&R!==null&&R!==void 0?{dimensionName:e.dimensionName,source:e.source,filterName:e.filterName,matchType:s,value:R,...D&&oe&&{value2:oe}}:null)},q=()=>{u(""),f(""),r(null)};return c.jsxs(Qt,{sx:{display:"flex",flexDirection:"column",gap:1.5,fontSize:"0.75rem","& .MuiInputBase-root":{fontSize:"0.75rem"},"& .MuiInputBase-input":{padding:"6px 10px"},"& .MuiSelect-select":{padding:"6px 10px !important"},"& .MuiAutocomplete-input":{padding:"0 !important"},"& .MuiAutocomplete-root .MuiInputBase-root":{padding:"5px 10px",minHeight:"29.5px",boxSizing:"border-box",flexWrap:"wrap"},"& .MuiChip-root":{height:"16px",margin:"0 2px 0 0"},"& .MuiChip-label":{fontSize:"0.7rem",padding:"0 6px"},"& .MuiChip-deleteIcon":{fontSize:"14px",margin:"0 2px 0 -4px"},"& .MuiInputLabel-root":{fontSize:"0.75rem",transform:"translate(10px, 6px) scale(1)"},"& .MuiInputLabel-shrink":{fontSize:"0.85rem",transform:"translate(14px, -9px) scale(0.75)"},"& .MuiOutlinedInput-notchedOutline legend":{fontSize:"0.65rem"},"& .MuiFormHelperText-root":{fontSize:"0.65rem",marginTop:"2px"},"& .MuiSvgIcon-root":{fontSize:"1.25rem"}},children:[c.jsxs(Qt,{sx:{fontWeight:600,color:e.required&&!n?"error.main":"text.primary"},children:[e.label??e.dimensionName,e.required&&c.jsx(Qt,{component:"span",sx:{color:n?"text.secondary":"error.main",fontWeight:400,fontSize:"0.7rem",ml:.5},children:"(required)"})]}),e.filterType!=="Boolean"&&!e.defaultMatchType&&B.length>1&&c.jsxs(Wu,{size:"small",fullWidth:!0,children:[c.jsx(qu,{children:"Match Type"}),c.jsx(Yu,{value:s,label:"Match Type",onChange:K,MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}},children:B.map(R=>c.jsx(bn,{value:R,children:R},R))})]}),e.filterType==="Star"&&s==="Equals"&&c.jsx(_f,{multiple:!0,size:"small",options:t,getOptionLabel:R=>typeof R=="string"?R:typeof R=="object"&&R!==null&&"value"in R?String(R.value):String(R),value:Array.isArray(l)?l.map(R=>t.find(oe=>oe.value===R)||R):l?[t.find(R=>R.value===l)||l]:[],onChange:(R,oe)=>{const se=oe.map(z=>typeof z=="string"?z:z&&typeof z=="object"&&"value"in z?z.value:z);G(se)},noOptionsText:"No matches found",renderInput:R=>c.jsx(Ct,{...R,size:"small",label:"Values",placeholder:"Select values..."}),freeSolo:!e.values||e.values.length===0,slotProps:{paper:{sx:{"& .MuiAutocomplete-option":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}}}),e.filterType==="Star"&&s==="Contains"&&c.jsx(Ct,{size:"small",label:"Search Text",value:l,onChange:R=>u(R.target.value),onBlur:()=>G(l),onKeyDown:R=>{R.key==="Enter"&&G(l)},placeholder:"Enter text to search...",fullWidth:!0}),e.filterType==="Boolean"&&c.jsxs(Wu,{size:"small",fullWidth:!0,children:[c.jsx(qu,{children:"Value"}),c.jsxs(Yu,{value:l===!0?"true":l===!1?"false":"",label:"Value",onChange:R=>{const oe=R.target.value;oe==="true"?G(!0):oe==="false"?G(!1):q()},MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}},children:[c.jsx(bn,{value:"",children:c.jsx("em",{children:"Blank"})}),c.jsx(bn,{value:"true",children:"True"}),c.jsx(bn,{value:"false",children:"False"})]})]}),e.filterType==="Retrieval"&&s==="Semantic Search"&&c.jsx(_f,{multiple:!0,size:"small",options:h,loading:m,getOptionLabel:R=>typeof R=="string"?R:typeof R=="object"&&R!==null&&"value"in R?String(R.value):String(R),value:Array.isArray(l)?l.map(R=>h.find(se=>se.value===R)||{value:R}):l?[{value:l}]:[],onInputChange:(R,oe)=>{x(oe)},onChange:(R,oe)=>{const se=oe.map(z=>typeof z=="string"?z:z&&typeof z=="object"&&"value"in z?z.value:z);G(se)},noOptionsText:y.trim().length<=2?"Type at least 3 characters to search":"No matches found",renderInput:R=>c.jsx(Ct,{...R,size:"small",label:"Search Values",placeholder:"Type to search...",onFocus:()=>I(!0),onBlur:()=>I(!1),helperText:S&&!m&&C&&h.length===0?"No matches found":void 0,InputProps:{...R.InputProps,endAdornment:c.jsxs(c.Fragment,{children:[m?c.jsx(Mp,{color:"inherit",size:20}):null,R.InputProps.endAdornment]})}}),freeSolo:!0,filterOptions:R=>R,slotProps:{paper:{sx:{"& .MuiAutocomplete-option":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}}}),e.filterType==="MinMax"&&!D&&c.jsx(Ct,{size:"small",type:"number",label:"Value",value:l,onChange:R=>G(parseFloat(R.target.value)||""),onFocus:()=>F(!0),onBlur:()=>F(!1),placeholder:"Enter number...",fullWidth:!0,inputProps:{min:L,max:$},helperText:O&&L!==void 0&&$!==void 0?`Valid range: [${L} - ${$}]`:void 0}),e.filterType==="MinMax"&&D&&c.jsxs(Qt,{sx:{display:"flex",flexDirection:"column",gap:1},children:[c.jsxs(Qt,{sx:{display:"flex",gap:1,alignItems:"center"},children:[c.jsx(Ct,{size:"small",type:"number",label:"From",value:l,onChange:R=>G(parseFloat(R.target.value)||"",d),onFocus:()=>F(!0),onBlur:()=>F(!1),placeholder:"Min...",fullWidth:!0,inputProps:{min:L,max:d||$}}),c.jsx(Qt,{children:"to"}),c.jsx(Ct,{size:"small",type:"number",label:"To",value:d,onChange:R=>G(l,parseFloat(R.target.value)||""),onFocus:()=>F(!0),onBlur:()=>F(!1),placeholder:"Max...",fullWidth:!0,inputProps:{min:l||L,max:$}})]}),O&&L!==void 0&&$!==void 0&&c.jsxs(Dt,{variant:"caption",color:"text.secondary",sx:{mt:-.5,ml:1.5},children:["Valid range: [",L," - ",$,"]"]})]}),j&&!D&&c.jsx(Xu,{dateAdapter:Bf,children:c.jsx(vu,{label:"Date",value:l instanceof Date?_t.utc(l):null,onChange:R=>{R===null?G(null):R.isValid()&&G(R.utc().toDate())},timezone:"UTC",minDate:l instanceof Date?void 0:H,maxDate:l instanceof Date?void 0:_,referenceDate:s==="After"&&H?H:void 0,slotProps:{textField:{size:"small",fullWidth:!0,sx:{minWidth:150},onFocus:()=>F(!0),onBlur:()=>F(!1),helperText:O&&H&&_?`Valid range: [${H.format("YYYY-MM-DD")} - ${_.format("YYYY-MM-DD")}]`:void 0},openPickerButton:{sx:{backgroundColor:"transparent"}}}})}),j&&D&&c.jsx(Xu,{dateAdapter:Bf,children:c.jsxs(Qt,{sx:{display:"flex",flexDirection:"column",gap:1},children:[c.jsxs(Qt,{sx:{display:"flex",gap:1,alignItems:"center"},children:[c.jsx(Qt,{sx:{flex:1,minWidth:0},children:c.jsx(vu,{label:"From",value:l instanceof Date?_t.utc(l):null,onChange:R=>{R===null?G(null,d):R.isValid()&&G(R.utc().toDate(),d)},timezone:"UTC",minDate:l instanceof Date?void 0:H,maxDate:d instanceof Date?_t.utc(d):l instanceof Date?void 0:_,referenceDate:H,slotProps:{textField:{size:"small",fullWidth:!0,onFocus:()=>F(!0),onBlur:()=>F(!1)},openPickerButton:{sx:{backgroundColor:"transparent"}}}})}),c.jsx(Qt,{children:"to"}),c.jsx(Qt,{sx:{flex:1,minWidth:0},children:c.jsx(vu,{label:"To",value:d instanceof Date?_t.utc(d):null,onChange:R=>{R===null?G(l,null):R.isValid()&&G(l,R.utc().toDate())},timezone:"UTC",minDate:l instanceof Date?_t.utc(l):d instanceof Date?void 0:H,maxDate:d instanceof Date?void 0:_,referenceDate:l instanceof Date?_t.utc(l):H,slotProps:{textField:{size:"small",fullWidth:!0,onFocus:()=>F(!0),onBlur:()=>F(!1)},openPickerButton:{sx:{backgroundColor:"transparent"}}}})})]}),O&&H&&_&&c.jsxs(Dt,{variant:"caption",color:"text.secondary",sx:{mt:-.5,ml:1.5},children:["Valid range: [",H.format("YYYY-MM-DD")," -"," ",_.format("YYYY-MM-DD"),"]"]})]})})]})}function dU(e){const t=new Set,n=e.schema?.fields;if(!n)return t;for(const r of n)"kind"in r&&r.kind==="join"&&r.name&&t.add(r.name);return t}function NC(e){if(!e)return null;for(const t of e)if(t.startsWith("##(filters)")){const n=t.slice(11).trim();try{const r=JSON.parse(n);if(Array.isArray(r)){const o=[];for(const i of r)if(typeof i=="string"){const s=i.indexOf(".");s>0&&s<i.length-1&&o.push({source:i.substring(0,s),dimension:i.substring(s+1)})}if(o.length>0)return{filters:o}}}catch(r){console.error(`Failed to parse "${t}" annotation:`,r)}}return null}function FC(e){if(e.startsWith("#(filter)")){const t=e.slice(9).trim();try{const n=JSON.parse(t);if(n.type)return n}catch(n){console.error(`Failed to parse "${e}" annotation:`,n)}}return null}function fU(e){const t=e.match(/^#\s*label\s*=\s*"([^"]+)"/);return t?t[1]:null}function LC(e){const t=new Map;let n="";for(const r of e)if(r.type==="code"){if(!n&&r.text){const o=r.text.match(/import\s+(?:\{[^}]*\}\s+from\s+)?['"]([^'"]+)['"]/);o&&(n=o[1])}if(r.newSources&&r.newSources.length>0)for(const o of r.newSources)try{const i=JSON.parse(o);i.name&&t.set(i.name,i)}catch(i){console.error("Failed to parse SourceInfo:",i)}}return{sourceInfoMap:t,modelPath:n}}function _C(e,t,n){const r=[];for(const{source:o,dimension:i}of t){const s=e.get(o);if(!s){console.warn(`Source "${o}" not found in notebook sources`),r.push({source:o,model:n,dimensionName:i,filterType:"Star"});continue}const a=s.schema?.fields;if(!a){r.push({source:o,model:n,dimensionName:i,filterType:"Star"});continue}const l=a.find(f=>f.name===i);if(!l){console.warn(`Dimension "${i}" not found in source "${o}"`),r.push({source:o,model:n,dimensionName:i,filterType:"Star"});continue}let u="Star",d;if("annotations"in l&&l.annotations){for(const f of l.annotations)if(f.value){const h=FC(f.value);h&&(u=h.type);const p=fU(f.value);p&&(d=p)}}r.push({source:o,model:n,dimensionName:i,filterType:u,label:d})}return r}function pU(e,t,n){return e.length===0?"":e.map(o=>{const{dimensionName:i,source:s,matchType:a,value:l,value2:u}=o,f=s&&s!==n?`\`${s}\`.\`${i}\``:`\`${i}\``,h=l instanceof Date,p=(m,b=!1)=>m==null?"null":b&&m instanceof Date?`@${m.getFullYear()}-${String(m.getMonth()+1).padStart(2,"0")}-${String(m.getDate()).padStart(2,"0")}`:typeof m=="string"?`'${m.replace(/'/g,"\\'")}'`:typeof m=="boolean"?m?"true":"false":String(m);switch(a){case"Equals":case"Semantic Search":return Array.isArray(l)&&l.length>0?`(${l.map(b=>`${f} = ${p(b,h)}`).join(" or ")})`:`${f} = ${p(l,h)}`;case"Contains":return typeof l=="string"?`${f} ~ f'%${l.replace(/'/g,"\\'")}%'`:`${f} = ${p(l)}`;case"After":case"Greater Than":return`${f} > ${p(l,h)}`;case"Before":case"Less Than":return`${f} < ${p(l,h)}`;case"Between":return u!==void 0?`${f} >= ${p(l,h)} and ${f} <= ${p(u,h)}`:`${f} >= ${p(l,h)}`;default:return""}}).filter(o=>o.length>0).join(" and ")}function hU(e){const t=e.match(/run\s*:\s*(\w+)\s*->/);if(t)return t[1];const n=e.match(/^\s*(\w+)\s*->/m);return n?n[1]:null}function mU(e,t){return`${e.trimEnd()} + {where: ${t}}`}const BC=mt(c.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),jC=e=>{if(!e)return"Explore semantic models, run queries, and build dashboards";const t=e.replace(/^#+\s+/gm,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/`([^`]+)`/g,"$1").trim(),r=t.split(/\n\s*\n/)[1]||t;if(r.length<=120)return r;const o=r.substring(0,120).split(" ");return o.pop(),o.join(" ")+"..."},$C=(e,t)=>{const n=(e.readme||void 0)?.split(`
|
|
205
|
+
`)??[];return n.length===0&&(n.push(`# ${e.name}`),n.push("")),(e.readme?.length??0)>0&&t?n.splice(2,1,t):t&&n.push(t),n.join(`
|
|
206
|
+
`)};function gU(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:o,resumeHideDuration:i}=e,s=Sc();M.useEffect(()=>{if(!o)return;function x(C){C.defaultPrevented||C.key==="Escape"&&r?.(C,"escapeKeyDown")}return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[o,r]);const a=Ve((x,C)=>{r?.(x,C)}),l=Ve(x=>{!r||x==null||s.start(x,()=>{a(null,"timeout")})});M.useEffect(()=>(o&&l(t),s.clear),[o,t,l,s]);const u=x=>{r?.(x,"clickaway")},d=s.clear,f=M.useCallback(()=>{t!=null&&l(i??t*.5)},[t,i,l]),h=x=>C=>{const v=x.onBlur;v?.(C),f()},p=x=>C=>{const v=x.onFocus;v?.(C),d()},m=x=>C=>{const v=x.onMouseEnter;v?.(C),d()},b=x=>C=>{const v=x.onMouseLeave;v?.(C),f()};return M.useEffect(()=>{if(!n&&o)return window.addEventListener("focus",f),window.addEventListener("blur",d),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",d)}},[n,o,f,d]),{getRootProps:(x={})=>{const C={...Ln(e),...Ln(x)};return{role:"presentation",...x,...C,onBlur:h(C),onFocus:p(C),onMouseEnter:m(C),onMouseLeave:b(C)}},onClickAway:u}}function Y1(e){return e.substring(2).toLowerCase()}function bU(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function yU(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:o,touchEvent:i="onTouchEnd"}=e,s=M.useRef(!1),a=M.useRef(null),l=M.useRef(!1),u=M.useRef(!1);M.useEffect(()=>(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const d=vt(Ms(t),a),f=Ve(m=>{const b=u.current;u.current=!1;const y=mn(a.current);if(!l.current||!a.current||"clientX"in m&&bU(m,y))return;if(s.current){s.current=!1;return}let x;m.composedPath?x=m.composedPath().includes(a.current):x=!y.documentElement.contains(m.target)||a.current.contains(m.target),!x&&(n||!b)&&o(m)}),h=m=>b=>{u.current=!0;const y=t.props[m];y&&y(b)},p={ref:d};return i!==!1&&(p[i]=h(i)),M.useEffect(()=>{if(i!==!1){const m=Y1(i),b=mn(a.current),y=()=>{s.current=!0};return b.addEventListener(m,f),b.addEventListener("touchmove",y),()=>{b.removeEventListener(m,f),b.removeEventListener("touchmove",y)}}},[f,i]),r!==!1&&(p[r]=h(r)),M.useEffect(()=>{if(r!==!1){const m=Y1(r),b=mn(a.current);return b.addEventListener(m,f),()=>{b.removeEventListener(m,f)}}},[f,r]),M.cloneElement(t,p)}function xU(e){return Ge("MuiSnackbarContent",e)}We("MuiSnackbarContent",["root","message","action"]);const CU=e=>{const{classes:t}=e;return Ke({root:["root"],action:["action"],message:["message"]},xU,t)},EU=fe(Ci,{name:"MuiSnackbarContent",slot:"Root"})(ft(({theme:e})=>{const t=e.palette.mode==="light"?.8:.98;return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(Kd(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:Kd(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),vU=fe("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),TU=fe("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),SU=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiSnackbarContent"}),{action:o,className:i,message:s,role:a="alert",...l}=r,u=r,d=CU(u);return c.jsxs(EU,{role:a,elevation:6,className:Ue(d.root,i),ownerState:u,ref:n,...l,children:[c.jsx(vU,{className:d.message,ownerState:u,children:s}),o?c.jsx(TU,{className:d.action,ownerState:u,children:o}):null]})});function kU(e){return Ge("MuiSnackbar",e)}We("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const wU=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${Fe(n.vertical)}${Fe(n.horizontal)}`]};return Ke(r,kU,t)},DU=fe("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${Fe(n.anchorOrigin.vertical)}${Fe(n.anchorOrigin.horizontal)}`]]}})(ft(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:t})=>t.anchorOrigin.vertical==="top",style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:t})=>t.anchorOrigin.vertical!=="top",style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="center",style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),IU=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiSnackbar"}),o=Lo(),i={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{action:s,anchorOrigin:{vertical:a,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:u=null,children:d,className:f,ClickAwayListenerProps:h,ContentProps:p,disableWindowBlurListener:m=!1,message:b,onBlur:y,onClose:x,onFocus:C,onMouseEnter:v,onMouseLeave:S,open:I,resumeHideDuration:T,slots:N={},slotProps:O={},TransitionComponent:F,transitionDuration:B=i,TransitionProps:{onEnter:j,onExited:D,...H}={},..._}=r,L={...r,anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:u,disableWindowBlurListener:m,TransitionComponent:F,transitionDuration:B},$=wU(L),{getRootProps:K,onClickAway:G}=gU({...L}),[q,R]=M.useState(!0),oe=le=>{R(!0),D&&D(le)},se=(le,ue)=>{R(!1),j&&j(le,ue)},z={slots:{transition:F,...N},slotProps:{content:p,clickAwayListener:h,transition:H,...O}},[pe,J]=kt("root",{ref:n,className:[$.root,f],elementType:DU,getSlotProps:K,externalForwardedProps:{...z,..._},ownerState:L}),[Q,{ownerState:re,...ne}]=kt("clickAwayListener",{elementType:yU,externalForwardedProps:z,getSlotProps:le=>({onClickAway:(...ue)=>{const Ie=ue[0];le.onClickAway?.(...ue),!Ie?.defaultMuiPrevented&&G(...ue)}}),ownerState:L}),[ae,ie]=kt("content",{elementType:SU,shouldForwardComponentProp:!0,externalForwardedProps:z,additionalProps:{message:b,action:s},ownerState:L}),[Z,me]=kt("transition",{elementType:el,externalForwardedProps:z,getSlotProps:le=>({onEnter:(...ue)=>{le.onEnter?.(...ue),se(...ue)},onExited:(...ue)=>{le.onExited?.(...ue),oe(...ue)}}),additionalProps:{appear:!0,in:I,timeout:B,direction:a==="top"?"down":"up"},ownerState:L});return!I&&q?null:c.jsx(Q,{...ne,...N.clickAwayListener&&{ownerState:re},children:c.jsx(pe,{...J,children:c.jsx(Z,{...me,children:d||c.jsx(ae,{...ie})})})})});function K1(){const[e,t]=W.useState(!1),{apiClients:n}=De.useServer(),[r,o]=W.useState(""),i=()=>{t(!0)},s=()=>{t(!1)},a=Lr.useQueryClient(),l=vn({async mutationFn(d){return n.environments.createEnvironment({name:d.name,readme:$C({name:d.name,readme:""},d.description)})},onSuccess(){s(),a.invalidateQueries({queryKey:["environments"]}),o("Environment created successfully")},onError(d){o(d instanceof Error?d.message:"An unknown error occurred")}}),u=async d=>{d.preventDefault();const f=new FormData(d.currentTarget),h=f.get("name")?.toString(),p=f.get("description")?.toString();if(!h)throw new Error("Name is required");l.mutate({name:h,description:p})};return c.jsxs(W.Fragment,{children:[c.jsx(tn,{variant:"contained",onClick:i,startIcon:c.jsx(On.AddCircleRounded,{}),sx:{mt:2},children:"Create New Environment"}),c.jsxs(no,{open:e,onClose:s,children:[c.jsx(Eo,{children:"Create New Environment"}),c.jsxs(oo,{children:[c.jsx(vl,{children:"Add a new environment to start exploring semantic models and analyzing data."}),c.jsxs("form",{onSubmit:u,id:"environment-form",children:[c.jsx(Ct,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Environment Name",type:"text",fullWidth:!0,variant:"standard"}),c.jsx(Ct,{margin:"dense",id:"description",name:"description",label:"Environment Description",placeholder:"Explore semantic models, run queries, and build dashboards",type:"text",fullWidth:!0,variant:"standard"})]})]}),c.jsxs(ro,{children:[c.jsx(tn,{disabled:l.isPending,onClick:s,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"environment-form",loading:l.isPending,children:"Create Environment"})]})]}),c.jsx(IU,{open:r!=="",autoHideDuration:6e3,onClose:()=>o(""),message:r})]})}function AU({environment:e,onCloseDialog:t}){const[n,r]=W.useState(!1),{apiClients:o}=De.useServer(),i=Lr.useQueryClient(),[s,a]=W.useState(""),l=()=>{r(!0)},u=()=>{r(!1),t()},d=vn({mutationFn:()=>o.environments.deleteEnvironment(e.name),onSuccess(){u(),i.invalidateQueries({queryKey:["environments"]}),a("Environment deleted successfully")},onError(f){a(f instanceof Error?f.message:"An unknown error occurred")}});return c.jsxs(W.Fragment,{children:[c.jsxs(w.MenuItem,{onClick:l,children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Delete,{fontSize:"small"})}),c.jsx(w.ListItemText,{children:"Delete"})]}),c.jsxs(no,{onClose:u,"aria-labelledby":"customized-dialog-title",open:n,children:[c.jsx(Eo,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Environment"}),c.jsx(Ir,{"aria-label":"close",onClick:u,sx:f=>({position:"absolute",right:8,top:8,color:f.palette.grey[500]}),children:c.jsx(Fr,{})}),c.jsx(oo,{dividers:!0,children:c.jsxs(Dt,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),c.jsxs(ro,{children:[c.jsx(tn,{variant:"outlined",onClick:u,style:{borderColor:De.MALLOY_BRAND.teal,color:De.MALLOY_BRAND.teal},children:"Cancel"}),c.jsx(tn,{loading:d.isPending,variant:"contained",autoFocus:!0,onClick:()=>d.mutate(),color:"error",children:"Delete"})]}),c.jsx(w.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})]})}function OU({environment:e,onCloseDialog:t}){const[n,r]=W.useState(!1),{apiClients:o}=De.useServer(),i=Lr.useQueryClient(),[s,a]=W.useState(""),l=()=>{r(!0)},u=()=>{r(!1),t()},d=vn({async mutationFn(h){return o.environments.updateEnvironment(e.name,{name:e.name,readme:$C({name:e.name,readme:e.readme},h.description)})},onSuccess(){u(),i.invalidateQueries({queryKey:["environments"]}),a("Environment updated successfully")},onError(h){a(h instanceof Error?h.message:"An unknown error occurred")}}),f=h=>{h.preventDefault();const m=new FormData(h.currentTarget).get("description")?.toString();d.mutate({description:m})};return c.jsxs(W.Fragment,{children:[c.jsxs(w.MenuItem,{onClick:l,children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Edit,{fontSize:"small"})}),c.jsx(w.ListItemText,{children:"Edit"})]}),c.jsxs(no,{open:n,onClose:u,children:[c.jsx(Eo,{children:"Edit Environment"}),c.jsxs(oo,{children:[c.jsx(vl,{children:"Edit this environment's description."}),c.jsxs("form",{onSubmit:f,id:"environment-form",children:[c.jsx(Ct,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Environment Name",disabled:!0,type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),c.jsx(Ct,{margin:"dense",id:"description",name:"description",label:"Environment Description",type:"text",fullWidth:!0,variant:"standard",defaultValue:jC(e.readme)})]})]}),c.jsxs(ro,{children:[c.jsx(tn,{disabled:d.isPending,onClick:u,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"environment-form",loading:d.isPending,children:"Save Changes"})]})]}),c.jsx(w.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})}const MU=[{title:"Ad-hoc analysis",body:"Browse semantic sources, build queries, and run nested logic in Explorer — no code.",href:ss.explorer},{title:"Notebook dashboards",body:"Code-first dashboards using Malloy notebooks. Versioned alongside your models.",href:ss.publishing},{title:"AI data agents",body:"Expose models via MCP so agents can discover sources and ask well-formed questions.",href:ss.mcpAgents}];function PU({onClickEnvironment:e}){const{apiClients:t,mutable:n}=De.useServer(),{data:r,isSuccess:o,isError:i,error:s}=Xt({queryKey:["environments"],queryFn:()=>t.environments.listEnvironments()});if(i)return c.jsx(kn,{error:s,context:"Environments List"});if(!o)return c.jsx(Sn,{text:"Loading environments..."});const a=r.data??[];return c.jsxs(w.Container,{maxWidth:"md",sx:{py:6},children:[c.jsxs(w.Box,{sx:{mb:5},children:[c.jsx(w.Typography,{variant:"h3",component:"h1",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:1},children:"Publisher"}),c.jsx(w.Typography,{variant:"body1",color:"text.secondary",sx:{mb:3},children:"The open-source semantic model server for the Malloy data language."}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{maxWidth:720,lineHeight:1.6},children:"Define semantic models once — and use them everywhere. Publisher serves Malloy models through clean APIs, enabling consistent, interpretable, and AI-ready data access for tools, applications, and agents."})]}),c.jsx(w.Grid,{container:!0,spacing:4,sx:{mb:5},children:MU.map(l=>c.jsx(w.Grid,{size:{xs:12,md:4},children:c.jsxs(w.Stack,{spacing:1,children:[c.jsx(w.Typography,{variant:"body2",component:"a",href:l.href,target:"_blank",rel:"noopener noreferrer",sx:{fontWeight:500,color:"text.primary",textDecoration:"none","&:hover":{textDecoration:"underline"}},children:l.title}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{lineHeight:1.6},children:l.body})]})},l.title))}),c.jsx(w.Divider,{sx:{my:4}}),a.length>0?c.jsxs(w.Box,{sx:{mb:4},children:[c.jsxs(w.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:3},children:[c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"h5",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:.5},children:"Environments"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Published environments available on this server"})]}),n&&c.jsx(K1,{})]}),c.jsx(w.Grid,{container:!0,spacing:2,children:a.map(l=>c.jsx(w.Grid,{size:{xs:12,sm:6,md:4},children:c.jsx(RU,{environment:l,onClickEnvironment:e})},l.name))})]}):c.jsxs(w.Box,{sx:{mb:4},children:[c.jsx(w.Typography,{variant:"h5",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:1},children:"Get started"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{mb:3,maxWidth:600},children:"Create your first Malloy environment to start exploring semantic models and building data experiences."}),n?c.jsx(K1,{}):c.jsx(w.Button,{variant:"contained",color:"primary",href:ss.publishing,target:"_blank",rel:"noopener noreferrer",children:"Learn how to create models"})]}),c.jsx(w.Divider,{sx:{my:4}}),c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["Publisher is built on fully open infrastructure and designed for the AI era. Join the"," ",c.jsx(w.Box,{component:"a",href:"https://join.slack.com/t/malloy-community/shared_invite/zt-1kgfwgi5g-CrsdaRqs81QY67QW0~t_uw",target:"_blank",rel:"noopener noreferrer",sx:{color:"text.primary",textDecoration:"underline"},children:"Malloy Slack community"})," ","to ask questions, share ideas, and contribute."]})]})}function RU({environment:e,onClickEnvironment:t}){const{mutable:n}=De.useServer(),[r,o]=W.useState(null),i=!!r,s=jC(e.readme),a=d=>{e.name&&t&&t(`/${e.name}/`,d)},l=d=>{d.stopPropagation(),o(d.currentTarget)},u=()=>{o(null)};return c.jsx(w.Card,{variant:"outlined",onClick:a,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:c.jsx(w.CardContent,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:c.jsxs(w.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[c.jsx(w.Box,{sx:d=>({width:36,height:36,borderRadius:1.5,bgcolor:d.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"text.primary"}),children:c.jsx(BC,{sx:{fontSize:20}})}),c.jsxs(w.Box,{sx:{flex:1,minWidth:0},children:[c.jsx(w.Typography,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),c.jsx(w.Tooltip,{title:s,followCursor:!0,enterDelay:1e3,children:c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.5},children:s})})]}),n&&c.jsxs(c.Fragment,{children:[c.jsx(w.IconButton,{size:"small",onClick:l,"aria-label":`Environment actions for ${e.name}`,sx:{flexShrink:0,mt:-.5,mr:-.5},children:c.jsx(On.MoreVert,{fontSize:"small"})}),c.jsxs(w.Menu,{anchorEl:r,open:i,onClose:u,onClick:d=>d.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(OU,{environment:e,onCloseDialog:u}),c.jsx(AU,{environment:e,onCloseDialog:u})]})]})]})})})}const Zu=mt(c.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"})),NU=mt(c.jsx("path",{d:"M8 5v14l11-7z"}));function HC({open:e,onClose:t,result:n,title:r="Results",renderLogs:o}){return c.jsxs(w.Dialog,{open:e,onClose:t,maxWidth:!1,fullWidth:!0,sx:{"& .MuiDialog-paper":{width:"95vw",height:"95vh",maxWidth:"none"}},children:[c.jsxs(w.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r,c.jsx(w.IconButton,{onClick:t,sx:{color:"text.secondary"},children:c.jsx(Fr,{})})]}),c.jsx(w.DialogContent,{sx:{height:"calc(95vh - 120px)",overflow:"auto",padding:"0 16px"},children:c.jsx(Os,{result:n,maxHeight:800,maxResultSize:1e6,renderLogs:o})})]})}function FU({queryName:e,annotations:t,resourceUri:n,runOnDemand:r=!1,maxResultSize:o=0}){const[i,s]=W.useState(),[a,l]=W.useState(!1),[u,d]=W.useState(!1),{packageName:f,environmentName:h,versionId:p,modelPath:m}=Ht(n),{apiClients:b}=De.useServer(),{data:y,isSuccess:x,isLoading:C}=Xt({queryKey:["namedQueryResult",n,e],queryFn:()=>b.models.executeQueryModel(h,f,m,{query:void 0,sourceName:void 0,queryName:e,versionId:p}),enabled:r?u:!0,...De.CHART_RESULT_QUERY_OPTIONS}),{mode:v}=De.usePublisherTheme();return W.useEffect(()=>{if(t&&t.length>0){const S=t.map(I=>`// ${I}`).join(`
|
|
207
|
+
`);$u(S,"typescript",v).then(I=>{s(I)})}},[t,v]),c.jsxs(De.CleanNotebookCell,{children:[i&&c.jsx(w.Box,{sx:{marginBottom:"16px"},children:c.jsx(w.Typography,{fontSize:"12px",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},children:c.jsx("div",{className:"content",dangerouslySetInnerHTML:{__html:i}})})}),c.jsxs(w.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[c.jsx(w.Typography,{variant:"body2",sx:{fontSize:"15px",fontWeight:"600",color:"#495057",padding:"8px 16px",backgroundColor:"#f8f9fa",borderRadius:"6px",border:"1px solid #e9ecef"},children:e}),c.jsx(w.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:()=>l(!0),children:c.jsx(Zu,{sx:{fontSize:"18px",color:"text.secondary"}})})]}),c.jsxs(De.CleanMetricCard,{sx:{position:"relative"},children:[r&&!u&&c.jsxs(w.Box,{sx:{padding:"40px 20px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Click Run to execute the query"}),c.jsx(w.Button,{variant:"contained",startIcon:c.jsx(NU,{}),onClick:()=>d(!0),sx:{backgroundColor:"#1976d2","&:hover":{backgroundColor:"#1565c0"},textTransform:"none",fontSize:"14px",fontWeight:600,padding:"8px 24px"},children:"Run Query"})]}),(!r||u)&&C&&c.jsx(w.Box,{sx:{padding:"20px",textAlign:"center"},children:c.jsx(w.Typography,{children:"Loading results..."})}),(!r||u)&&x&&y?.data?.result&&c.jsx(Os,{result:y.data.result,maxHeight:600,maxResultSize:o,renderLogs:y.data.renderLogs})]}),c.jsx(HC,{open:a,onClose:()=>l(!1),result:y?.data?.result||"",renderLogs:y?.data?.renderLogs,title:`Query: ${e}`})]})}function sh(e,t=!0){const{modelPath:n,environmentName:r,packageName:o,versionId:i}=Ht(e),{apiClients:s}=De.useServer();return Xt({queryKey:["package",r,o,n,i],queryFn:async()=>(await s.models.getModel(r,o,n,i)).data,enabled:t})}function ah({data:e,onChange:t,existingQuery:n,initialSelectedSourceIndex:r=0,onSourceChange:o,resourceUri:i}){const[s,a]=W.useState(r);W.useEffect(()=>{a(r)},[r]);const{data:l,isError:u,isLoading:d,error:f}=sh(i,!e),{modelPath:h}=Ht(i),p=e||l;if(d&&!e)return c.jsx(Sn,{text:"Fetching Model..."});if(u&&!e)return console.log("error",f),c.jsx(kn,{error:f,context:`ModelExplorer > ${h}`});if(!p)return c.jsx(Sn,{text:"Loading..."});const m=(p?.sourceInfos||[]).map((y,x)=>{try{return JSON.parse(y)?.name||`Source ${x+1}`}catch{return`Source ${x+1}`}}),b=m[s]||"";return c.jsxs(De.StyledCard,{variant:"outlined",children:[c.jsx(De.StyledCardContent,{children:c.jsx(w.Stack,{sx:{flexDirection:"row"},children:c.jsx(_f,{size:"small",id:"size-small-standard",disablePortal:!0,options:m,value:b,onChange:(y,x)=>{if(!x)return;const C=m.indexOf(x);C>=0&&(a(C),o?.(C))},renderInput:y=>c.jsx(Ct,{...y}),style:{width:350,marginTop:"3px",marginLeft:"6px",marginBottom:"8px"}})})}),c.jsx(De.StyledCardMedia,{children:c.jsxs(w.Stack,{spacing:2,component:"section",children:[Array.isArray(p.sourceInfos)&&p.sourceInfos.length>0&&c.jsx(kp,{sourceAndPaths:p.sourceInfos.map(y=>({sourceInfo:JSON.parse(y),modelPath:h})),selectedSourceIndex:s,existingQuery:n,onQueryChange:t,resourceUri:i}),c.jsx(w.Box,{height:"5px"})]})})]})}function lh({open:e,onClose:t,resourceUri:n,data:r,title:o="Data Sources",hasValidImport:i=!0,existingQuery:s,initialSelectedSourceIndex:a,onChange:l,onSourceChange:u}){return c.jsxs(w.Dialog,{open:e,onClose:t,fullScreen:!0,children:[c.jsxs(w.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o,c.jsx(w.IconButton,{onClick:t,sx:{color:"text.secondary"},children:c.jsx(Fr,{})})]}),c.jsx(w.DialogContent,{children:i?c.jsx(ah,{resourceUri:n,data:r,existingQuery:s,initialSelectedSourceIndex:a,onChange:l,onSourceChange:u}):c.jsx("div",{children:"No valid import statement found in cell"})})]})}function LU({onChange:e,resourceUri:t,runOnDemand:n=!1,maxResultSize:r=0}){const{modelPath:o}=Ht(t),{data:i,isError:s,isLoading:a,error:l}=sh(t),[u,d]=W.useState(!1),[f,h]=W.useState(),[p,m]=W.useState(0),[b,y]=W.useState(""),x=i?.modelDef,C=W.useMemo(()=>{if(!x)return!1;try{const T=JSON.parse(x);return Array.isArray(T.imports)&&T.imports.length>0}catch{return!1}},[x]);if(a)return c.jsx(Sn,{text:"Fetching Model..."});if(s)return console.log("error",l),c.jsx(kn,{error:l,context:`Model > ${o}`});const v=T=>{h(T),e&&e(T)},S=T=>{m(T)},I=()=>{const T=window.location.href;navigator.clipboard.writeText(T).then(()=>y("URL copied to clipboard!")).catch(()=>y("Failed to copy URL"))};return c.jsxs(c.Fragment,{children:[c.jsxs(w.Box,{sx:{position:"relative",maxWidth:"1200px",margin:"0 auto",paddingTop:"24px"},children:[Array.isArray(i?.sourceInfos)&&i.sourceInfos.length>0&&c.jsxs(w.Stack,{spacing:2,component:"section",children:[c.jsxs(w.Box,{sx:{padding:"0 0 16px 0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c.jsx(w.Typography,{variant:"h1",sx:{fontSize:"28px",fontWeight:"600",color:"#1a1a1a",marginBottom:"8px",marginTop:"0",paddingLeft:"0"},children:"Sources"}),c.jsx(w.Tooltip,{title:"Click to copy link",children:c.jsx(Kf,{sx:{fontSize:"24px",color:"text.secondary",cursor:"pointer"},onClick:I})})]}),c.jsx(ah,{data:i,onChange:v,onSourceChange:S,existingQuery:f,initialSelectedSourceIndex:p,resourceUri:t}),c.jsx(w.IconButton,{sx:{position:"absolute",top:"90px",right:"4px",backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",zIndex:2},onClick:()=>d(!0),children:c.jsx(Zu,{sx:{fontSize:"18px",color:"text.secondary",marginBottom:"5px"}})})]}),i?.queries?.length>0&&c.jsxs(w.Stack,{spacing:2,component:"section",sx:{marginTop:"24px"},children:[c.jsx(w.Box,{sx:{padding:"0 0 16px 0"},children:c.jsx(w.Typography,{variant:"h2",sx:{fontSize:"24px",fontWeight:"600",color:"#1a1a1a",marginBottom:"0",marginTop:"8px",paddingLeft:"0"},children:"Named Queries"})}),i.queries.map(T=>c.jsx(FU,{queryName:T.name,annotations:T.annotations,resourceUri:t,runOnDemand:n,maxResultSize:r},T.name))]}),(!Array.isArray(i?.sourceInfos)||i.sourceInfos.length===0)&&!(i?.queries&&i.queries.length>0)&&c.jsxs(w.Box,{sx:{textAlign:"center",py:6},children:[c.jsx(w.Typography,{variant:"body1",sx:{color:"text.secondary",marginBottom:"8px"},children:"This model exposes no sources or queries."}),C&&c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["It imports other files but re-exports nothing. Add"," ",c.jsxs("code",{children:["export ","{ source_name }"]})," to surface imported sources here."]})]}),c.jsx(lh,{open:u,onClose:()=>d(!1),resourceUri:t,data:i,title:`Model: ${o.split("/").pop()}`,existingQuery:f,initialSelectedSourceIndex:p,onChange:v,onSourceChange:S})]}),c.jsx(w.Snackbar,{open:b!=="",autoHideDuration:6e3,onClose:()=>y(""),message:b})]})}function zC(e,t){return`${e}:${t}`}function xo(e){return zC(e.source,e.filterName??e.dimensionName)}function UC(e){return e.replace(/'/g,"\\'").replace(/\\/g,"\\\\")}function Ur(e,t=!1){return e==null?"null":t?e instanceof Date?`@${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:`@${e}`:typeof e=="string"?`'${UC(e)}'`:typeof e=="number"?String(e):typeof e=="boolean"?e?"true":"false":String(e)}function _U(e){const{dimensionName:t,matchType:n,value:r,value2:o}=e,i=`\`${t}\``,s=r instanceof Date;switch(n){case"Equals":case"Semantic Search":return Array.isArray(r)&&r.length>0?`(${r.map(l=>`${i} = ${Ur(l,s)}`).join(" or ")})`:Array.isArray(r)?"":`${i} = ${Ur(r,s)}`;case"Contains":return typeof r=="string"?`${i} ~ f'%${UC(r)}%'`:Array.isArray(r)?"":`${i} = ${Ur(r)}`;case"After":return Array.isArray(r)?"":`${i} > ${Ur(r,s)}`;case"Before":return Array.isArray(r)?"":`${i} < ${Ur(r,s)}`;case"Greater Than":return Array.isArray(r)?"":`${i} > ${Ur(r)}`;case"Less Than":return Array.isArray(r)?"":`${i} < ${Ur(r)}`;case"Between":return Array.isArray(r)?"":o!==void 0?`${i} >= ${Ur(r,s)} and ${i} <= ${Ur(o,s)}`:`${i} >= ${Ur(r,s)}`;default:return""}}function BU(e){const t=new Map;for(const n of e){const r=`${n.source}|${n.model}`,o=t.get(r)||[];o.push(n),t.set(r,o)}return t}function jU(e,t,n,r){const o=t.filter(u=>(u.filterType==="Star"||u.filterType==="MinMax"||u.filterType==="DateMinMax")&&!u.values);if(o.length===0)return"";const s=[...new Set(o.map(u=>u.dimensionName))].map(u=>`\`${u}\``).join(", "),a=r?.filter(u=>u.source===e)||[],l=a.length>0?a.map(u=>_U(u)).filter(u=>u.length>0).join(" and "):"";return`
|
|
208
|
+
run: ${e} -> {
|
|
209
|
+
${l?`where: ${l}`:""}
|
|
210
|
+
index: ${s}
|
|
211
|
+
} -> {
|
|
212
|
+
select: *
|
|
213
|
+
order_by: weight desc
|
|
214
|
+
|
|
215
|
+
limit: ${n}
|
|
216
|
+
}
|
|
217
|
+
`}function $U(e,t){const n=new Map;for(const d of t){const f=xo(d);n.set(f,[])}const r=JSON.parse(e),o=r.schema.fields,i=new Map;o.forEach((d,f)=>{i.set(d.name,f)});const s=d=>{if(!d)return null;switch(d.kind){case"string_cell":return d.string_value??null;case"number_cell":return d.number_value??null;case"boolean_cell":return d.boolean_value??null;case"null_cell":return null;default:return console.log("Unknown cell kind: "+d.kind),null}},l=(r.data?.array_value||[]).map(d=>{const f={};return d.kind==="record_cell"&&d.record_value&&d.record_value.forEach((h,p)=>{const m=o[p]?.name;if(m){const b=s(h);m==="fieldName"&&typeof b=="string"?f.fieldName=b:m==="fieldPath"&&typeof b=="string"?f.fieldPath=b:m==="fieldType"&&typeof b=="string"?f.fieldType=b:m==="fieldValue"&&typeof b=="string"?f.fieldValue=b:m==="weight"&&typeof b=="number"&&(f.weight=b)}}),f}),u=l.length===0||l.every(d=>!d.fieldName);for(const d of t){if(d.filterType==="NONE"||d.filterType==="Retrieval")continue;const f=l.filter(p=>{const m=p.fieldName||"",b=p.fieldPath||"";if(m===d.dimensionName||b===d.dimensionName||m.toLowerCase()===d.dimensionName.toLowerCase()||b.toLowerCase()===d.dimensionName.toLowerCase())return!0;const y=b.split(".").pop()||"";return y===d.dimensionName||y.toLowerCase()===d.dimensionName.toLowerCase()});if(f.length===0)continue;const h=xo(d);if(d.filterType==="Star"){const p=f.filter(m=>m.fieldType==="string").map(m=>({value:m.fieldValue??"",count:m.weight})).sort((m,b)=>(b.count??0)-(m.count??0));n.set(h,p)}else if(d.filterType==="MinMax"){console.log("MinMax dimensionEntries: "+JSON.stringify(f,null,2)),console.log("All MinMax dimension entries fieldTypes:",f.map(m=>m.fieldType));const p=f.find(m=>m.fieldType==="number");if(console.log("numericEntry: "+JSON.stringify(p,null,2)),p?.fieldValue){const m=p.fieldValue,b=m.split(" to ");if(console.log("rangeParts: "+b),b.length===2){const y=[{value:parseFloat(b[0])},{value:parseFloat(b[1])}];n.set(h,y)}else console.warn(`Could not parse numeric range for ${d.dimensionName}: ${m}`)}else console.warn(`No numeric entry found for ${d.dimensionName}. Available entries:`,f)}else if(d.filterType==="DateMinMax"){const p=f.find(m=>m.fieldType==="date"||m.fieldType==="timestamp"||m.fieldType==="string");if(console.log("dateEntry: "+JSON.stringify(p,null,2)),console.log("All date dimension entries fieldTypes:",f.map(m=>m.fieldType)),p?.fieldValue){const m=p.fieldValue,b=m.split(" to ");if(console.log("date rangeParts: "+b),b.length===2){const y=[{value:new Date(b[0].trim())},{value:new Date(b[1].trim())}];n.set(h,y)}else console.warn(`Could not parse date range for ${d.dimensionName}: ${m}`)}else console.warn(`No date entry found for ${d.dimensionName}. Available entries:`,f)}}return{values:n,noRowsMatchedFilter:u}}function uh(e){const{environment:t,package:n,dimensionSpecs:r,versionId:o,enabled:i=!0,indexLimit:s=1e4,activeFilters:a=[]}=e,l=W.useMemo(()=>BU(r),[r]),u=W.useMemo(()=>{const b=[];for(const[y,x]of l){const[C,v]=y.split("|"),S=jU(C,x,s,a);S?b.push({key:y,source:C,model:v,query:S,specs:x}):console.log("No query for source: ",C,"model: ",v)}return b},[l,s,a]),d=W.useMemo(()=>i&&u.length>0&&r.some(b=>b.filterType==="Star"||b.filterType==="MinMax"||b.filterType==="DateMinMax"),[i,u,r]),{apiClients:f}=De.useServer(),h=Xt({queryKey:["dimensionalFilter",t,n,r,o,a],queryFn:async()=>{if(!d){const C=new Map;for(const v of r){const S=xo(v);C.set(S,[])}return{values:C,noRowsMatchedFilter:!1}}const b=await Promise.all(u.map(async C=>{const v=await f.models.executeQueryModel(t,n,C.model,{query:C.query,versionId:o,bypassFilters:!0});return{config:C,result:$U(v.data.result,C.specs)}})),y=new Map;let x=!1;for(const{result:C}of b){for(const[v,S]of C.values)y.set(v,S);C.noRowsMatchedFilter&&(x=!0)}return{values:y,noRowsMatchedFilter:x}},enabled:d,staleTime:300*1e3,placeholderData:b=>b}),p=h.data?.values;return{data:W.useMemo(()=>{const b=new Map;for(const y of r){const x=xo(y);y.values?b.set(x,y.values.map(C=>({value:C}))):b.set(x,[])}if(p)for(const[y,x]of p)x.length>0&&b.set(y,x);return b},[r,p]),noRowsMatchedFilter:h.data?.noRowsMatchedFilter??!1,isLoading:d?h.isPending:!1,isError:d?h.isError:!1,error:d?h.error:null,refetch:h.refetch}}function VC(e){return e.replace(/'/g,"\\'").replace(/\\/g,"\\\\")}function Vr(e,t=!1){return e==null?"null":t?e instanceof Date?`@${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:`@${e}`:typeof e=="string"?`'${VC(e)}'`:typeof e=="number"?String(e):typeof e=="boolean"?e?"true":"false":String(e)}function HU(e){const{dimensionName:t,matchType:n,value:r,value2:o}=e,i=`\`${t}\``,s=r instanceof Date;switch(n){case"Equals":case"Semantic Search":return Array.isArray(r)&&r.length>0?`(${r.map(l=>`${i} = ${Vr(l,s)}`).join(" or ")})`:Array.isArray(r)?"":`${i} = ${Vr(r,s)}`;case"Contains":return typeof r=="string"?`${i} ~ f'%${VC(r)}%'`:Array.isArray(r)?"":`${i} = ${Vr(r)}`;case"After":return Array.isArray(r)?"":`${i} > ${Vr(r,s)}`;case"Before":return Array.isArray(r)?"":`${i} < ${Vr(r,s)}`;case"Greater Than":return Array.isArray(r)?"":`${i} > ${Vr(r)}`;case"Less Than":return Array.isArray(r)?"":`${i} < ${Vr(r)}`;case"Between":return Array.isArray(r)?"":o!==void 0?`${i} >= ${Vr(r,s)} and ${i} <= ${Vr(o,s)}`:`${i} >= ${Vr(r,s)}`;default:return""}}function ch(e){const{dimensionSpecs:t}=e,[n,r]=W.useState(()=>{const u=new Map;return t.forEach(d=>{const f=xo(d);u.set(f,{spec:d,selection:null})}),u});W.useEffect(()=>{r(u=>{const d=new Map;return t.forEach(f=>{const h=xo(f),p=u.get(h);d.set(h,{spec:f,selection:p?.selection??null})}),d})},[t]);const o=W.useCallback((u,d)=>{r(f=>{const h=new Map(f),p=h.get(u);return p&&h.set(u,{...p,selection:d}),h})},[]),i=W.useCallback(u=>{o(u,null)},[o]),s=W.useCallback(()=>{r(u=>{const d=new Map(u);return d.forEach((f,h)=>{d.set(h,{...f,selection:null})}),d})},[]),a=W.useCallback(()=>{const u=[];return n.forEach(d=>{d.selection&&u.push(d.selection)}),u},[n]),l=W.useCallback(()=>{const u=a();if(u.length===0)return"";const d=u.map(f=>HU(f)).filter(f=>f.length>0);return d.length===0?"":`where ${d.join(" and ")}`},[a]);return{filterStates:n,updateFilter:o,clearFilter:i,clearAllFilters:s,getActiveFilters:a,generateWhereClause:l}}function WC(e){const[t,n]=W.useState(()=>new Map);W.useEffect(()=>{n(s=>{const a=new Set(e.map(u=>u.name).filter(u=>!!u)),l=new Map;return s.forEach((u,d)=>{a.has(d)&&l.set(d,u)}),l})},[e]);const r=W.useCallback((s,a)=>{n(l=>{const u=new Map(l);return a===null?u.delete(s):u.set(s,a),u})},[]),o=W.useCallback(()=>{n(s=>s.size===0?s:new Map)},[]),i=W.useCallback(()=>{const s=new Map;return t.forEach((a,l)=>{a!=null&&s.set(l,a)}),s},[t]);return{givenValues:t,updateGiven:r,clearAll:o,getActiveGivens:i}}function qC(e){return W.useMemo(()=>{if(!e?.sources?.length)return[];const t=new Map;for(const n of e.sources)if(n.givens?.length)for(const r of n.givens)r.name&&!t.has(r.name)&&t.set(r.name,r);return Array.from(t.values())},[e])}const YC=mt(c.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));function zU(e,t){if(!t)return;const n=t.trim();if(!n)return;const r=e??"string";if(r==="date"||r==="timestamp"||r==="timestamptz")return n.replace(/^@/,"");if(r.startsWith("filter<")){const o=n.replace(/^f/,""),i=o.match(/^'([^'\\]*)'$/)??o.match(/^"([^"\\]*)"$/);return i?i[1]:o}return r==="string"?UU(n):n}function UU(e){const t=e[0];return e.length>=2&&(t==="'"||t==='"')&&e[e.length-1]===t?e.slice(1,-1).replace(/\\(["'\\ntr])/g,(n,r)=>r==="n"?`
|
|
218
|
+
`:r==="t"?" ":r==="r"?"\r":r):e}_t.extend(PC);function VU(e){const t=(e.annotations??[]).filter(r=>r.trim().startsWith("#("));if(t.length===0)return;const n=[];for(const r of t){const o=r.trim(),i=o.match(/description="([^"]*)"/);if(i){n.push(i[1]);continue}const s=o.replace(/^#\(/,"").replace(/\)\s*$/,"").trim();s&&n.push(s)}return n.length>0?n.join(`
|
|
219
|
+
`):void 0}function WU({given:e,value:t,onChange:n}){const r=e.name??"",o=e.type??"string",i=VU(e),s=zU(o,e.default),a=s!==void 0?`Default: ${s===""?"(empty)":s}`:void 0,l=i||a?c.jsxs(c.Fragment,{children:[i,i&&a?c.jsx("br",{}):null,a]}):void 0;if(o==="boolean"){const f=typeof t=="boolean",h=e.default?.trim()==="true",p=f?t:h;return c.jsxs(w.FormControl,{children:[c.jsxs(w.Stack,{direction:"row",alignItems:"center",children:[c.jsx(w.FormControlLabel,{control:c.jsx(w.Checkbox,{checked:p,onChange:m=>n(m.target.checked)}),label:r}),f&&c.jsx(w.IconButton,{size:"small","aria-label":"clear value",onClick:()=>n(null),edge:"end",children:c.jsx(YC,{fontSize:"small"})})]}),l&&c.jsx(w.FormHelperText,{children:l})]})}if(o==="number"){const f=typeof t=="number"?t:"";return c.jsx(w.TextField,{label:r,type:"number",value:f,onChange:h=>{const p=h.target.value;n(p===""?null:Number(p))},placeholder:s,helperText:l,slotProps:{input:{endAdornment:f!==""&&c.jsx(G1,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"})}if(o==="date"||o==="timestamp"||o==="timestamptz"){const f=t instanceof Date?_t.utc(t):null;return c.jsx(Xu,{dateAdapter:Bf,children:c.jsx(vu,{label:r,value:f,onChange:h=>n(h?h.toDate():null),slotProps:{textField:{fullWidth:!0,size:"small",helperText:l},field:{clearable:!0,onClear:()=>n(null)}}})})}if(o.startsWith("array<")){const f=Array.isArray(t)?t.map(String):[];return c.jsx(w.Autocomplete,{multiple:!0,freeSolo:!0,options:[],value:f,onChange:(h,p)=>n(p.length===0?null:p),renderInput:h=>c.jsx(w.TextField,{...h,label:r,size:"small",placeholder:f.length===0?s:void 0,helperText:l}),fullWidth:!0})}const u=typeof t=="string"?t:"",d=t!=null;return c.jsx(w.TextField,{label:r,value:u,onChange:f=>n(f.target.value),placeholder:d?void 0:s??(o.startsWith("filter<")?o:void 0),helperText:l,slotProps:{input:{endAdornment:d&&c.jsx(G1,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"})}function G1({onClear:e}){return c.jsx(w.InputAdornment,{position:"end",children:c.jsx(w.IconButton,{size:"small","aria-label":"clear value",onClick:e,edge:"end",children:c.jsx(YC,{fontSize:"small"})})})}function qU({givens:e,values:t,onChange:n,onClearAll:r}){if(e.length===0)return null;const o=t.size>0;return c.jsxs(w.Paper,{elevation:0,sx:{p:3,backgroundColor:"transparent",border:"none",boxShadow:"none"},children:[c.jsxs(w.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:2},children:[c.jsx(w.Typography,{variant:"subtitle2",sx:{fontWeight:600,color:"#333"},children:"Parameters"}),o&&c.jsx(w.Button,{variant:"text",size:"small",onClick:r,sx:{textTransform:"none"},children:"Reset"})]}),c.jsx(w.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:3},children:e.map(i=>c.jsx(w.Box,{children:c.jsx(WU,{given:i,value:i.name?t.get(i.name):void 0,onChange:s=>i.name&&n(i.name,s)})},i.name))})]})}const YU=mt(c.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}));function dh(e){const{environmentName:t,packageName:n}=Ht(e.resourceUri);if(!t||!n)throw new Error("Environment and Package name must be provided for query embedding.");return JSON.stringify({...e})}function KU({embeddedQueryResult:e}){const{query:t,sourceName:n,queryName:r,resourceUri:o,height:i}=JSON.parse(e),{modelPath:s}=Ht(o);if(!s||!t&&(!r||!n)||typeof s!="string")throw new Error("Invalid embedded query result: "+e);return c.jsx(KC,{query:t,sourceName:n,queryName:r,resourceUri:o,height:i})}function KC({query:e,sourceName:t,queryName:n,resourceUri:r,height:o=400}){const{modelPath:i,environmentName:s,packageName:a,versionId:l}=Ht(r),{apiClients:u}=De.useServer();if(!s||!a)throw new Error("No environment or package name provided. A resource URI must be provided.");const{data:d,isSuccess:f,isError:h,error:p}=Xt({queryKey:[r,e,t,n],queryFn:()=>u.models.executeQueryModel(s,a,i,{query:e,sourceName:t,queryName:n,versionId:l}),...De.CHART_RESULT_QUERY_OPTIONS});return c.jsxs(c.Fragment,{children:[!f&&!h&&c.jsx(Sn,{text:"Fetching Query Results..."}),f&&c.jsx(W.Suspense,{fallback:c.jsx("div",{children:"Loading..."}),children:c.jsx(Os,{result:d.data.result,maxHeight:o,renderLogs:d.data.renderLogs})}),h&&c.jsx(kn,{context:`${s} > ${a} > ${i}`,error:p})]})}function GU({href:e,title:t,children:n,envName:r,pkgName:o,sourceDir:i,onNavigate:s}){const a=!!e&&/^[a-z][a-z0-9+.-]*:/i.test(e);if(!(!!e&&!a&&!e.startsWith("/")&&!e.startsWith("#"))||!e){const h=a&&!/^(https?|mailto|tel):/i.test(e??"");return c.jsx("a",{href:h?void 0:e,title:t,...a?{target:"_blank",rel:"noopener noreferrer"}:{},children:n})}const u=new URL(e,`https://malloy.invalid/${i}`),d=u.pathname.slice(1)+u.search+u.hash,f=`/${r}/${o}/${d}`;return c.jsx("a",{href:f,title:t,onClick:s?h=>{h.preventDefault(),s(f,h)}:void 0,children:n})}function QU({cell:e,hideCodeCellIcon:t,hideEmbeddingIcon:n,resourceUri:r,index:o,maxResultSize:i,isExecuting:s,onNavigate:a}){const[l,u]=W.useState(!1),[d,f]=W.useState(!1),[h,p]=W.useState(!1),[m,b]=W.useState(),[y,x]=W.useState(),[C,v]=W.useState(!1),[S,I]=W.useState(""),{environmentName:T,packageName:N,modelPath:O}=Ht(r),F=O&&O.includes("/")?O.slice(0,O.lastIndexOf("/")+1):"",B={overrides:{a:{component:GU,props:{envName:T,pkgName:N,sourceDir:F,onNavigate:a}}}},j=/import\s*\{([^}]+)\}\s*from\s*['"`][^'"`]+['"`]/,D=/import\s*(?:\{[^}]*\}\s*from\s*)?['"`]([^'"`]+)['"`]/,H=R=>R.split(`
|
|
220
|
+
`).filter(oe=>!oe.trimStart().startsWith("##")).join(`
|
|
221
|
+
`),_=!!e.text&&(j.test(e.text)||D.test(e.text)),L=()=>{if(!e.newSources||e.newSources.length===0)return 0;let R=[],oe="";if(e.text){const se=e.text.match(j);se&&(R=se[1].split(",").map(pe=>pe.trim()));const z=e.text.match(D);z&&(oe=z[1].trim())}for(let se=0;se<e.newSources.length;se++)try{const z=JSON.parse(e.newSources[se]);if(R.length>0&&R.includes(z.name)||oe&&oe===z.path)return se}catch{continue}return 0},$=e.newSources&&e.newSources.length>0?{sourceInfos:e.newSources,resource:r}:void 0,K=dh({query:e.text,resourceUri:r}),{mode:G}=De.usePublisherTheme();W.useEffect(()=>{e.type==="code"&&$u(H(e.text),"malloy",G).then(R=>{b(R)})},[e,G]),W.useEffect(()=>{$u(K,"typescript",G).then(R=>{x(R)})},[K,G]);const q=()=>{const R=window.location.href;navigator.clipboard.writeText(R).then(()=>I("URL copied to clipboard!")).catch(()=>I("Failed to copy URL"))};return e.type==="markdown"&&c.jsx(De.CleanNotebookCell,{children:c.jsxs(w.Box,{sx:R=>({"& h1, & h2, & h3, & h4, & h5, & h6":{fontWeight:"600",color:R.palette.text.primary,marginBottom:"8px",marginTop:"16px"},"& h1":{fontSize:"28px"},"& h2":{fontSize:"24px"},"& h3":{fontSize:"20px"},"& p":{color:R.palette.text.primary,lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& ul, & ol":{color:R.palette.text.primary,lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& li":{marginBottom:"4px"}}),children:[o===0?c.jsxs(w.Stack,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[c.jsx(wu,{options:B,children:e.text}),c.jsx(w.Tooltip,{title:"Click to copy link",children:c.jsx(Kf,{sx:{fontSize:"24px",color:"text.secondary",cursor:"pointer",marginTop:"26px"},onClick:q})})]}):c.jsx(wu,{options:B,children:e.text}),c.jsx(w.Snackbar,{open:S!=="",autoHideDuration:6e3,onClose:()=>I(""),message:S})]})})||e.type==="code"&&c.jsxs(De.CleanNotebookCell,{children:[(!t||!n&&e.result||e.newSources&&e.newSources.length>0)&&c.jsx(w.Stack,{sx:{flexDirection:"column",gap:"8px",marginBottom:"2px"},children:e.newSources&&e.newSources.length>0&&c.jsx(De.CleanMetricCard,{sx:{position:"relative",padding:"0"},children:c.jsxs(w.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"24px",paddingRight:"8px"},children:[m&&c.jsx("span",{dangerouslySetInnerHTML:{__html:m},style:{fontFamily:"monospace",fontSize:"14px",flex:1,marginRight:"8px"}}),_&&c.jsx(w.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",flexShrink:0},onClick:()=>v(!0),children:c.jsx(Zu,{sx:{fontSize:"18px",color:"grey.700"}})})]})})}),c.jsx(lh,{open:C,onClose:()=>v(!1),title:"Data Sources",hasValidImport:_,resourceUri:r,data:$,initialSelectedSourceIndex:L()}),c.jsxs(w.Dialog,{open:l,onClose:()=>u(!1),maxWidth:"lg",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Malloy Code",c.jsx(w.IconButton,{onClick:()=>u(!1),sx:{color:"text.secondary"},children:c.jsx(Fr,{})})]}),c.jsx(w.DialogContent,{children:c.jsx(w.Box,{sx:R=>({border:`1px solid ${R.palette.divider}`,borderRadius:"8px",padding:"16px",fontFamily:"monospace",fontSize:"14px",lineHeight:"1.5",overflow:"auto",maxHeight:"70vh",backgroundColor:R.palette.background.paper,color:R.palette.text.primary}),children:c.jsx("pre",{className:"code-display",style:{margin:0},dangerouslySetInnerHTML:{__html:m}})})})]}),c.jsxs(w.Dialog,{open:d,onClose:()=>f(!1),maxWidth:"lg",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Embeddable Code",c.jsx(w.IconButton,{onClick:()=>f(!1),sx:{color:"text.secondary"},children:c.jsx(Fr,{})})]}),c.jsx(w.DialogContent,{children:c.jsxs(w.Stack,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},children:[c.jsx(w.Typography,{component:"div",sx:{fontSize:"12px",fontFamily:"monospace","& .line":{textWrap:"wrap"},flex:1},dangerouslySetInnerHTML:{__html:y}}),c.jsx(w.Tooltip,{title:"Copy Embeddable Code",children:c.jsx(w.IconButton,{sx:{width:"24px",height:"24px",marginLeft:"8px",color:"text.secondary"},onClick:()=>{navigator.clipboard.writeText(K)},children:c.jsx(YU,{})})})]})})]}),c.jsx(HC,{open:h,onClose:()=>p(!1),result:e.result||"",title:"Results"}),s&&!e.result&&!_&&!(e.newSources&&e.newSources.length>0)&&c.jsx(De.CleanMetricCard,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:200},children:c.jsx(w.CircularProgress,{size:32})}),e.result&&c.jsxs(De.CleanMetricCard,{sx:{position:"relative"},children:[c.jsx(w.Box,{sx:{paddingTop:"24px"},children:c.jsx(Os,{result:e.result,maxHeight:700,maxResultSize:i})}),c.jsxs(w.Stack,{sx:{position:"absolute",top:"-12px",right:"8px",flexDirection:"row",gap:"8px",alignItems:"center",zIndex:2},children:[!t&&c.jsx(w.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:R=>{R.stopPropagation(),u(!0)},children:c.jsx(vb,{sx:{fontSize:"18px",color:"grey.700"}})}),c.jsx(w.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:()=>p(!0),children:c.jsx(Zu,{sx:{fontSize:"18px",color:"grey.700"}})})]})]})]})}const XU=4;function GC({resourceUri:e,maxResultSize:t=0,retrievalFn:n,onNavigate:r}){const{apiClients:o}=De.useServer(),{environmentName:i,packageName:s,versionId:a,modelPath:l}=Ht(e),{data:u,isSuccess:d,isError:f,error:h}=Xt({queryKey:[e],queryFn:async()=>(await o.notebooks.getNotebook(i,s,l,a)).data}),[p,m]=W.useState([]),[b,y]=W.useState(!1),[x,C]=W.useState(null),v=W.useMemo(()=>u?NC(u.annotations):null,[u]),S=W.useMemo(()=>u?.notebookCells?LC(u.notebookCells):null,[u]),I=W.useMemo(()=>S?.sourceInfoMap??new Map,[S]),T=S?.modelPath??null,N=W.useMemo(()=>{const pe=new Map;if(!u?.sources)return pe;for(const J of u.sources)if(J.name&&J.filters&&J.filters.length>0){const Q=J.filters.filter(re=>!re.implicit);Q.length>0&&pe.set(J.name,Q)}return pe},[u]),O=N.size>0,F=W.useMemo(()=>{if(O&&T){const pe=[];for(const[J,Q]of N)for(const re of Q??[]){if(!re.dimension||!re.type)continue;let ne;const ae=re.dimensionType;ae==="boolean"?ne="Boolean":ae==="date"||ae==="timestamp"||ae==="timestamptz"?ne="DateMinMax":ae==="number"?ne=re.type==="equal"||re.type==="in"?"Star":"MinMax":ne={equal:"Star",in:"Star",like:"Star",greater_than:"MinMax",less_than:"MinMax"}[re.type]??"Star";const Z={equal:"Equals",in:"Equals",like:"Contains",greater_than:ne==="DateMinMax"?"After":"Greater Than",less_than:ne==="DateMinMax"?"Before":"Less Than"}[re.type],me=re.name!==re.dimension?re.name:void 0;pe.push({source:J,model:T,dimensionName:re.dimension,filterType:ne,label:me,filterName:re.name??re.dimension,defaultMatchType:Z,required:re.required??!1})}return pe}return!v||I.size===0||!T?[]:_C(I,v.filters,T)},[O,N,v,I,T]),{filterStates:B,updateFilter:j,getActiveFilters:D}=ch({dimensionSpecs:F}),H=W.useMemo(()=>D(),[B,D]),_=qC(u),{givenValues:L,updateGiven:$,clearAll:K}=WC(_);W.useMemo(()=>{const pe=new Map;for(const J of F){const Q=xo(J);pe.set(Q,J.source)}return pe},[F]);const{data:G}=uh({environment:i,package:s,dimensionSpecs:F,versionId:a,enabled:F.length>0}),q=W.useCallback(pe=>{if(pe.length===0)return;const J=re=>re instanceof Date?re.toISOString().slice(0,10):String(re),Q={};for(const re of pe){const ne=re.filterName??re.dimensionName,ae=re.value;Array.isArray(ae)?Q[ne]=ae.map(J):ae!=null&&(Q[ne]=J(ae))}return Object.keys(Q).length>0?JSON.stringify(Q):void 0},[]),R=W.useCallback(pe=>{if(pe.size===0)return;const J=re=>re instanceof Date?re.toISOString().slice(0,10):Array.isArray(re)?re.map(ne=>J(ne)):re,Q={};return pe.forEach((re,ne)=>{re!=null&&(Q[ne]=J(re))}),Object.keys(Q).length>0?JSON.stringify(Q):void 0},[]),oe=W.useCallback(async(pe=[],J=new Map)=>{if(!d||!u?.notebookCells)return;m(ne=>ne.length===0?u.notebookCells.map(ae=>({...ae})):ne.map(ae=>({...ae,result:void 0}))),y(!0),C(null);const Q=O?q(pe):void 0,re=R(J);try{const ne=[];for(let ie=0;ie<u.notebookCells.length;ie++){const Z=u.notebookCells[ie];if(Z.type==="markdown")continue;const me=ie,le=async()=>{try{const Ie=(await o.notebooks.executeNotebookCell(i,s,l,me,a,Q,void 0,re)).data,Ce=Ie.result,we=Z.newSources||Ie.newSources;m(ye=>{const ze=[...ye];return ze[me]||(ze[me]={...Z}),ze[me]={...ze[me],result:Ce,newSources:we},ze})}catch(ue){console.error(`Error executing cell ${me}:`,ue)}};ne.push(le)}const ae=[];for(const ie of ne){const Z=ie().then(()=>{ae.splice(ae.indexOf(Z),1)});ae.push(Z),ae.length>=XU&&await Promise.race(ae)}await Promise.all(ae)}catch(ne){console.error("Error executing notebook cells:",ne),C(ne)}finally{y(!1)}},[d,u,O,q,R,i,s,l,a,o.notebooks]);W.useEffect(()=>{!d||!u?.notebookCells||oe([],new Map)},[d,u,oe]);const se=W.useRef("");W.useEffect(()=>{const pe=JSON.stringify({filters:H.map(J=>({dim:J.dimensionName,type:J.matchType,val:J.value,val2:J.value2})),givens:Array.from(L.entries()).sort(([J],[Q])=>J.localeCompare(Q)).map(([J,Q])=>[J,Q instanceof Date?Q.toISOString().slice(0,10):Q])});if(pe!==se.current){if(se.current===""&&H.length===0&&L.size===0){se.current=pe;return}b||(se.current=pe,oe(H,L))}},[H,L,b,oe]);const z=W.useCallback(pe=>J=>{j(pe,J)},[j]);return F.some(pe=>pe.filterType==="Retrieval"),c.jsx(De.CleanNotebookContainer,{children:c.jsx(De.CleanNotebookSection,{children:c.jsxs(w.Stack,{spacing:3,component:"section",children:[c.jsx(qU,{givens:_,values:L,onChange:$,onClearAll:K}),F.length>0&&G&&c.jsxs(w.Paper,{elevation:0,sx:{p:3,backgroundColor:"transparent",border:"none",boxShadow:"none"},children:[c.jsx(w.Typography,{variant:"subtitle2",sx:{fontWeight:600,mb:2,color:"#333"},children:"Filters"}),c.jsx(w.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:3},children:F.map(pe=>{const J=xo(pe),Q=G.get(J)||[],re=B.get(J);return pe.filterType==="Retrieval"&&!n?null:c.jsx(w.Box,{children:c.jsx(RC,{spec:pe,values:Q,selection:re?.selection,onChange:z(J),retrievalFn:n})},J)})})]}),!d&&!f&&c.jsx(Sn,{text:"Fetching Notebook..."}),d&&(p.length>0?p:u?.notebookCells||[]).map((pe,J)=>c.jsx(QU,{cell:pe,index:J,resourceUri:e,maxResultSize:t,isExecuting:b,onNavigate:r},J)),f&&h.status===404&&c.jsxs(w.Typography,{variant:"body2",sx:{color:"text.secondary"},children:[c.jsx("code",{children:`${i} > ${s} > ${l}`})," ","not found."]}),f&&h.status!==404&&c.jsx(kn,{error:h,context:`${i} > ${s} > ${l}`}),x&&c.jsx(kn,{error:{message:x.message,status:500,name:"ExecutionError"},context:"Notebook Execution"})]})})})}const QC=mt(c.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),ZU="publisher:resize";function JU(e){return typeof e=="object"&&e!==null&&e.type===ZU&&typeof e.height=="number"}function XC(e){return e.replace(/\/api\/v0\/?$/,"")}function Ca({type:e,size:t=18,sx:n,...r}){return c.jsxs(Ou,{...r,viewBox:"0 0 24 24",sx:{width:t,height:t,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...n},children:[e==="report"&&c.jsx(eV,{}),e==="model"&&c.jsx(tV,{}),e==="data"&&c.jsx(nV,{}),e==="materialization"&&c.jsx(rV,{}),e==="page"&&c.jsx(oV,{})]})}function eV(){return c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M14 3 H6 a2 2 0 0 0 -2 2 v14 a2 2 0 0 0 2 2 h12 a2 2 0 0 0 2 -2 V9 z"}),c.jsx("path",{d:"M14 3 v4 a2 2 0 0 0 2 2 h4"}),c.jsx("path",{d:"M8 17 v-3"}),c.jsx("path",{d:"M12 17 v-6"}),c.jsx("path",{d:"M16 17 v-4"})]})}function tV(){return c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 3 L4 7 v10 l8 4 l8 -4 V7 z"}),c.jsx("path",{d:"M4 7 l8 4 l8 -4"}),c.jsx("path",{d:"M12 11 v10"})]})}function nV(){return c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"2"}),c.jsx("path",{d:"M3.5 9.5 H20.5"}),c.jsx("path",{d:"M9.5 3.5 V20.5"})]})}function rV(){return c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 3 L21 7.5 L12 12 L3 7.5 Z"}),c.jsx("path",{d:"M3 12 L12 16.5 L21 12"}),c.jsx("path",{d:"M3 16.5 L12 21 L21 16.5"})]})}function oV(){return c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2"}),c.jsx("path",{d:"M3.5 9.5 H20.5"}),c.jsx("path",{d:"M7 13.5 H17"}),c.jsx("path",{d:"M7 16.5 H13"})]})}const Q1="README.malloynb";function iV({onClickPackageFile:e,resourceUri:t,retrievalFn:n}){const{apiClients:r,server:o}=De.useServer(),i=e??(O=>{window.location.href=O}),{environmentName:s,packageName:a,versionId:l}=Ht(t),[u,d]=W.useState(null),f=Xt({queryKey:["package",s,a,l],queryFn:()=>r.packages.getPackage(s,a,l,!1)}),h=Xt({queryKey:["notebooks",s,a,l],queryFn:()=>r.notebooks.listNotebooks(s,a,l)}),p=Xt({queryKey:["models",s,a,l],queryFn:()=>r.models.listModels(s,a,l)}),m=Xt({queryKey:["databases",s,a,l],queryFn:()=>r.databases.listDatabases(s,a,l)}),y=Xt({queryKey:["pages",s,a],queryFn:async()=>{try{return await r.pages.listPages(s,a)}catch(O){const F=O?.response?.status;if(F===404||F===void 0)return{data:[]};throw O}}}).data?.data??[],x=(h.data?.data??[]).slice().sort((O,F)=>O.path.localeCompare(F.path)),C=(p.data?.data??[]).slice().sort((O,F)=>O.path.localeCompare(F.path)),v=(m.data?.data??[]).slice().sort((O,F)=>O.path.localeCompare(F.path)),S=f.data?.data?.description??"",I=x.some(O=>O.path===Q1),T=Cl({environmentName:s,packageName:a,versionId:l,modelPath:Q1}),N=!h.isSuccess&&!h.isError;return f.isError?c.jsx(kn,{error:f.error,context:`${s} > ${a}`}):c.jsxs(w.Container,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:3,py:6},children:[c.jsxs(w.Box,{sx:{mb:4},children:[c.jsxs(w.Link,{onClick:O=>i(`/${s}/`,O),underline:"none",sx:{display:"inline-flex",alignItems:"center",gap:.5,cursor:"pointer",color:"text.secondary",fontSize:"0.875rem",mb:2,"&:hover":{color:"primary.main"}},children:[c.jsx(Xx,{sx:{fontSize:18}}),"Back to ",s]}),c.jsx(w.Typography,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:a}),S&&c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:S})]}),N&&c.jsx(Sn,{text:"Loading package..."}),!N&&c.jsxs(c.Fragment,{children:[c.jsxs(Ea,{title:"Governed Reports",count:x.length,children:[x.map(O=>c.jsx(va,{icon:c.jsx(Ca,{type:"report"}),tint:De.MALLOY_BRAND.teal,label:O.path,onClick:F=>i(`/${s}/${a}/${O.path}`,F)},O.path)),x.length===0&&c.jsx(Wd,{label:"No notebooks"})]}),y.length>0&&c.jsx(Ea,{title:"Pages",count:y.length,children:y.map(O=>{const F=!!O.title&&O.title!==O.path,B=`${XC(o)}${O.resource}`;return c.jsx(va,{icon:c.jsx(Ca,{type:"page"}),tint:De.MALLOY_BRAND.teal,label:F?O.title:O.path,rightLabel:F?O.path:void 0,onClick:j=>{e?e(`/${s}/${a}/pages/${O.path}`,j):j&&(j.metaKey||j.ctrlKey)?window.open(B,"_blank"):window.location.href=B},trailingAction:c.jsx(w.Tooltip,{title:"Open standalone in new tab",children:c.jsx(w.IconButton,{size:"small",href:B,target:"_blank",rel:"noopener noreferrer","aria-label":"Open standalone in new tab",onClick:j=>j.stopPropagation(),sx:{color:"text.secondary"},children:c.jsx(QC,{fontSize:"small"})})})},O.path)})}),c.jsxs(Ea,{title:"Semantic Models",count:C.length,children:[C.map(O=>c.jsx(va,{icon:c.jsx(Ca,{type:"model"}),tint:De.MALLOY_BRAND.orange,label:O.path,onClick:F=>i(`/${s}/${a}/${O.path}`,F)},O.path)),C.length===0&&c.jsx(Wd,{label:"No models"})]}),c.jsxs(Ea,{title:"Package Data",count:v.length,children:[v.map(O=>c.jsx(va,{icon:c.jsx(Ca,{type:"data"}),tint:De.MALLOY_BRAND.darkBlue,label:O.path,rightLabel:sV(O.info.rowCount),onClick:()=>d(O)},O.path)),v.length===0&&c.jsx(Wd,{label:"No data files"})]}),c.jsx(Ea,{title:"Materializations",children:c.jsx(va,{icon:c.jsx(Ca,{type:"materialization"}),tint:De.MALLOY_BRAND.teal,label:"Materializations",onClick:O=>i(`/${s}/${a}/materializations`,O)})}),I&&c.jsx(w.Box,{sx:{mt:6},children:c.jsx(GC,{resourceUri:T,retrievalFn:n,onNavigate:i})})]}),c.jsxs(w.Dialog,{open:u!==null,onClose:()=>d(null),maxWidth:"sm",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{pr:6},children:[u?.path,c.jsx(w.IconButton,{"aria-label":"close",onClick:()=>d(null),sx:{position:"absolute",right:8,top:8},children:c.jsx(Fr,{fontSize:"small"})})]}),c.jsx(w.DialogContent,{children:u?.info?.columns&&c.jsxs(w.Table,{size:"small",children:[c.jsx(w.TableHead,{children:c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{children:"Column"}),c.jsx(w.TableCell,{children:"Type"})]})}),c.jsx(w.TableBody,{children:u.info.columns.map(O=>c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{component:"th",scope:"row",children:O.name}),c.jsx(w.TableCell,{children:O.type})]},O.name))})]})})]})]})}function Ea({title:e,count:t,children:n}){return c.jsxs(w.Box,{sx:{mb:4},children:[c.jsxs(w.Stack,{direction:"row",alignItems:"baseline",spacing:1,sx:{mb:1},children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:e}),t!==void 0&&c.jsxs(w.Typography,{variant:"caption",color:"text.secondary",children:["(",t,")"]})]}),c.jsx(w.Box,{children:n})]})}function va({icon:e,tint:t,label:n,rightLabel:r,onClick:o,trailingAction:i}){const s=!!o,a=l=>{o&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),o(l))};return c.jsxs(w.Box,{onClick:o,onKeyDown:s?a:void 0,role:s?"button":void 0,tabIndex:s?0:void 0,sx:l=>({display:"flex",alignItems:"center",gap:1.5,py:1,px:1,mx:-1,cursor:s?"pointer":"default",borderRadius:1.5,transition:"background-color 0.1s","&:hover":s?{backgroundColor:l.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}:void 0,"&:focus-visible":s?{outline:"2px solid",outlineColor:"primary.main",outlineOffset:2}:void 0}),children:[c.jsx(w.Box,{sx:{width:32,height:32,borderRadius:1,bgcolor:t,color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e}),c.jsx(w.Typography,{variant:"body2",sx:{fontFamily:De.MONO_FONT_FAMILY,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),r&&c.jsx(w.Typography,{variant:"caption",color:"text.secondary",sx:{flexShrink:0},children:r}),i&&c.jsx(w.Box,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:i})]})}function Wd({label:e}){return c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{py:1,fontStyle:"italic"},children:e})}function sV(e){return e>=1e9?`${(e/1e9).toFixed(1)} B rows`:e>=1e6?`${(e/1e6).toFixed(1)} M rows`:e>=1e3?`${(e/1e3).toFixed(1)} K rows`:`${e} rows`}function aV(e){return Ge("MuiCollapse",e)}We("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const lV=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return Ke(r,aV,n)},uV=fe("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(ft(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),cV=fe("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),dV=fe("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),sl=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiCollapse"}),{addEndListener:o,children:i,className:s,collapsedSize:a="0px",component:l,easing:u,in:d,onEnter:f,onEntered:h,onEntering:p,onExit:m,onExited:b,onExiting:y,orientation:x="vertical",style:C,timeout:v=pb.standard,TransitionComponent:S=Dr,...I}=r,T={...r,orientation:x,collapsedSize:a},N=lV(T),O=Lo(),F=Sc(),B=M.useRef(null),j=M.useRef(),D=typeof a=="number"?`${a}px`:a,H=x==="horizontal",_=H?"width":"height",L=M.useRef(null),$=vt(n,L),K=Q=>re=>{if(Q){const ne=L.current;re===void 0?Q(ne):Q(ne,re)}},G=()=>B.current?B.current[H?"clientWidth":"clientHeight"]:0,q=K((Q,re)=>{B.current&&H&&(B.current.style.position="absolute"),Q.style[_]=D,f&&f(Q,re)}),R=K((Q,re)=>{const ne=G();B.current&&H&&(B.current.style.position="");const{duration:ae,easing:ie}=ms({style:C,timeout:v,easing:u},{mode:"enter"});if(v==="auto"){const Z=O.transitions.getAutoHeightDuration(ne);Q.style.transitionDuration=`${Z}ms`,j.current=Z}else Q.style.transitionDuration=typeof ae=="string"?ae:`${ae}ms`;Q.style[_]=`${ne}px`,Q.style.transitionTimingFunction=ie,p&&p(Q,re)}),oe=K((Q,re)=>{Q.style[_]="auto",h&&h(Q,re)}),se=K(Q=>{Q.style[_]=`${G()}px`,m&&m(Q)}),z=K(b),pe=K(Q=>{const re=G(),{duration:ne,easing:ae}=ms({style:C,timeout:v,easing:u},{mode:"exit"});if(v==="auto"){const ie=O.transitions.getAutoHeightDuration(re);Q.style.transitionDuration=`${ie}ms`,j.current=ie}else Q.style.transitionDuration=typeof ne=="string"?ne:`${ne}ms`;Q.style[_]=D,Q.style.transitionTimingFunction=ae,y&&y(Q)}),J=Q=>{v==="auto"&&F.start(j.current||0,Q),o&&o(L.current,Q)};return c.jsx(S,{in:d,onEnter:q,onEntered:oe,onEntering:R,onExit:se,onExited:z,onExiting:pe,addEndListener:J,nodeRef:L,timeout:v==="auto"?null:v,...I,children:(Q,{ownerState:re,...ne})=>c.jsx(uV,{as:l,className:Ue(N.root,s,{entered:N.entered,exited:!d&&D==="0px"&&N.hidden}[Q]),style:{[H?"minWidth":"minHeight"]:D,...C},ref:$,ownerState:{...T,state:Q},...ne,children:c.jsx(cV,{ownerState:{...T,state:Q},className:N.wrapper,ref:B,children:c.jsx(dV,{ownerState:{...T,state:Q},className:N.wrapperInner,children:i})})})})});sl&&(sl.muiSupportAuto=!0);function ZC(e){return Kt}const JC=M.createContext(null);function fV(e){const{value:t,children:n}=e;return c.jsx(JC.Provider,{value:t,children:t.wrapRoot({children:n,instance:t.instance})})}const Si=()=>{const e=M.useContext(JC);if(e==null)throw new Error(["MUI X: Could not find the Tree View context.","It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.","This can also happen if you are bundling multiple versions of the Tree View."].join(`
|
|
222
|
+
`));return e},pV=({props:e})=>{const{instance:t}=Si(),{label:n,itemId:r}=e,[o,i]=M.useState(n),s=t.isItemBeingEdited(r);return M.useEffect(()=>{s||i(n)},[s,n]),{propsEnhancers:{labelInput:({externalEventHandlers:a,interactions:l})=>t.isItemEditable(r)?{value:o??"","data-element":"labelInput",onChange:p=>{a.onChange?.(p),i(p.target.value)},onKeyDown:p=>{if(a.onKeyDown?.(p),p.defaultMuiPrevented)return;const m=p.target;p.key==="Enter"&&m.value?l.handleSaveItemLabel(p,m.value):p.key==="Escape"&&l.handleCancelItemLabelEditing(p)},onBlur:p=>{a.onBlur?.(p),!p.defaultMuiPrevented&&p.target.value&&l.handleSaveItemLabel(p,p.target.value)},autoFocus:!0,type:"text"}:{}}}},xr=({instance:e,state:t,setState:n,params:r})=>{const o=M.useRef(t.editedItemId),i=f=>o.current===f,s=f=>{n(h=>Y({},h,{editedItemId:f})),o.current=f},a=f=>f===t.editedItemId,l=!!r.isItemEditable,u=f=>{if(f==null||!l)return!1;const h=e.getItem(f);return h?typeof r.isItemEditable=="function"?r.isItemEditable(h):!!r.isItemEditable:!1},d=(f,h)=>{if(!h)throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.","The label of an item cannot be empty.",f].join(`
|
|
223
|
+
`));n(p=>{const m=p.items.itemMetaMap[f];return m.label!==h?Y({},p,{items:Y({},p.items,{itemMetaMap:Y({},p.items.itemMetaMap,{[f]:Y({},m,{label:h})})})}):p}),r.onItemLabelChange&&r.onItemLabelChange(f,h)};return{instance:{setEditedItemId:s,isItemBeingEdited:a,updateItemLabel:d,isItemEditable:u,isTreeViewEditable:l,isItemBeingEditedRef:i},publicAPI:{updateItemLabel:d}}};xr.itemPlugin=pV;xr.getDefaultizedParams=({params:e,experimentalFeatures:t})=>{const n=t?.labelEditing;return Y({},e,{isItemEditable:n?e.isItemEditable??!1:!1})};xr.getInitialState=()=>({editedItemId:null});xr.params={onItemLabelChange:!0,isItemEditable:!0};const ui=(e,t)=>e.getAvailablePlugins().has(t),eE=e=>Array.isArray(e)?e.length>0&&e.some(eE):!!e,hV=({itemId:e,children:t})=>{const{instance:n,selection:{multiSelect:r},publicAPI:o}=Si(),i={expandable:eE(t),expanded:n.isItemExpanded(e),focused:n.isItemFocused(e),selected:n.isItemSelected(e),disabled:n.isItemDisabled(e),editing:n?.isItemBeingEdited?n?.isItemBeingEdited(e):!1,editable:n.isItemEditable?n.isItemEditable(e):!1},s=p=>{if(i.disabled)return;i.focused||n.focusItem(p,e);const m=r&&(p.shiftKey||p.ctrlKey||p.metaKey);i.expandable&&!(m&&n.isItemExpanded(e))&&n.toggleItemExpansion(p,e)},a=p=>{if(i.disabled)return;!i.focused&&!i.editing&&n.focusItem(p,e),r&&(p.shiftKey||p.ctrlKey||p.metaKey)?p.shiftKey?n.expandSelectionRange(p,e):n.selectItem({event:p,itemId:e,keepExistingSelection:!0}):n.selectItem({event:p,itemId:e,shouldBeSelected:!0})},l=p=>{const m=p.nativeEvent.shiftKey;r&&m?n.expandSelectionRange(p,e):n.selectItem({event:p,itemId:e,keepExistingSelection:r,shouldBeSelected:p.target.checked})},u=()=>{ui(n,xr)&&n.isItemEditable(e)&&(n.isItemBeingEdited(e)?n.setEditedItemId(null):n.setEditedItemId(e))};return{interactions:{handleExpansion:s,handleSelection:a,handleCheckboxSelection:l,toggleItemEditing:u,handleSaveItemLabel:(p,m)=>{ui(n,xr)&&n.isItemBeingEditedRef(e)&&(n.updateItemLabel(e,m),u(),n.focusItem(p,e))},handleCancelItemLabelEditing:p=>{ui(n,xr)&&n.isItemBeingEditedRef(e)&&(u(),n.focusItem(p,e))}},status:i,publicAPI:o}},fh=M.createContext(()=>-1),tE=(e,t)=>{let n=t.length-1;for(;n>=0&&!e.isItemNavigable(t[n]);)n-=1;if(n!==-1)return t[n]},nE=(e,t)=>{const n=e.getItemMeta(t),r=e.getItemOrderedChildrenIds(n.parentId),o=e.getItemIndex(t);if(o===0)return n.parentId;let i=o-1;for(;!e.isItemNavigable(r[i])&&i>=0;)i-=1;if(i===-1)return n.parentId==null?null:nE(e,n.parentId);let s=r[i],a=tE(e,e.getItemOrderedChildrenIds(s));for(;e.isItemExpanded(s)&&a!=null;)s=a,a=e.getItemOrderedChildrenIds(s).find(e.isItemNavigable);return s},Su=(e,t)=>{if(e.isItemExpanded(t)){const r=e.getItemOrderedChildrenIds(t).find(e.isItemNavigable);if(r!=null)return r}let n=e.getItemMeta(t);for(;n!=null;){const r=e.getItemOrderedChildrenIds(n.parentId),o=e.getItemIndex(n.id);if(o<r.length-1){let i=o+1;for(;!e.isItemNavigable(r[i])&&i<r.length-1;)i+=1;if(e.isItemNavigable(r[i]))return r[i]}n=e.getItemMeta(n.parentId)}return null},rE=e=>{let t=null;for(;t==null||e.isItemExpanded(t);){const n=e.getItemOrderedChildrenIds(t),r=tE(e,n);if(r==null)return t;t=r}return t},al=e=>e.getItemOrderedChildrenIds(null).find(e.isItemNavigable),oE=(e,t,n)=>{if(t===n)return[t,n];const r=e.getItemMeta(t),o=e.getItemMeta(n);if(r.parentId===o.id||o.parentId===r.id)return o.parentId===r.id?[r.id,o.id]:[o.id,r.id];const i=[r.id],s=[o.id];let a=r.parentId,l=o.parentId,u=s.indexOf(a)!==-1,d=i.indexOf(l)!==-1,f=!0,h=!0;for(;!d&&!u;)f&&(i.push(a),u=s.indexOf(a)!==-1,f=a!==null,!u&&f&&(a=e.getItemMeta(a).parentId)),h&&!u&&(s.push(l),d=i.indexOf(l)!==-1,h=l!==null,!d&&h&&(l=e.getItemMeta(l).parentId));const p=u?a:l,m=e.getItemOrderedChildrenIds(p),b=i[i.indexOf(p)-1],y=s[s.indexOf(p)-1];return m.indexOf(b)<m.indexOf(y)?[t,n]:[n,t]},mV=(e,t,n)=>{const r=l=>{if(e.isItemExpandable(l)&&e.isItemExpanded(l))return e.getItemOrderedChildrenIds(l)[0];let u=e.getItemMeta(l);for(;u!=null;){const d=e.getItemOrderedChildrenIds(u.parentId),f=e.getItemIndex(u.id);if(f<d.length-1)return d[f+1];u=e.getItemMeta(u.parentId)}throw new Error("Invalid range")},[o,i]=oE(e,t,n),s=[o];let a=o;for(;a!==i;)a=r(a),e.isItemDisabled(a)||s.push(a);return s},gV=e=>{let t=al(e);const n=[];for(;t!=null;)n.push(t),t=Su(e,t);return n},ll=(e,t)=>t!==e.closest('*[role="treeitem"]');let X1=0;const bV=()=>(X1+=1,`mui-tree-view-${X1}`),ph=({id:e,treeId:t="",itemId:n})=>e??`${t}-${n}`,yV=e=>{const{runItemPlugins:t,items:{onItemClick:n,disabledItemsFocusable:r,indentationAtItemLevel:o},selection:{disableSelection:i,checkboxSelection:s},expansion:{expansionTrigger:a},treeId:l,instance:u,publicAPI:d}=Si(),f=M.useContext(fh),{id:h,itemId:p,label:m,children:b,rootRef:y}=e,{rootRef:x,contentRef:C,propsEnhancers:v}=t(e),{interactions:S,status:I}=hV({itemId:p,children:b}),T=M.useRef(null),N=M.useRef(null),O=vt(y,x,T),F=vt(C,N),B=M.useRef(null),j=ph({itemId:p,treeId:l,id:h}),D=u.canItemBeTabbed(p)?0:-1,H={rootRefObject:T,contentRefObject:N,interactions:S},_=ie=>Z=>{if(ie.onFocus?.(Z),Z.defaultMuiPrevented)return;const me=!I.disabled||r;!I.focused&&me&&Z.currentTarget===Z.target&&u.focusItem(Z,p)},L=ie=>Z=>{if(ie.onBlur?.(Z),Z.defaultMuiPrevented)return;const me=u.getItemDOMElement(p);I.editing||Z.relatedTarget&&ll(Z.relatedTarget,me)&&(Z.target&&Z.target?.dataset?.element==="labelInput"&&ll(Z.target,me)||Z.relatedTarget?.dataset?.element==="labelInput")||u.removeFocusedItem()},$=ie=>Z=>{ie.onKeyDown?.(Z),!(Z.defaultMuiPrevented||Z.target?.dataset?.element==="labelInput")&&u.handleItemKeyDown(Z,p)},K=ie=>Z=>{ie.onDoubleClick?.(Z),!Z.defaultMuiPrevented&&S.toggleItemEditing()},G=ie=>Z=>{ie.onClick?.(Z),n?.(Z,p),!(Z.defaultMuiPrevented||B.current?.contains(Z.target))&&(a==="content"&&S.handleExpansion(Z),s||S.handleSelection(Z))},q=ie=>Z=>{ie.onMouseDown?.(Z),!Z.defaultMuiPrevented&&(Z.shiftKey||Z.ctrlKey||Z.metaKey||I.disabled)&&Z.preventDefault()},R=ie=>Z=>{ie.onChange?.(Z),!Z.defaultMuiPrevented&&(i||I.disabled||S.handleCheckboxSelection(Z))},oe=ie=>Z=>{ie.onClick?.(Z),!Z.defaultMuiPrevented&&a==="iconContainer"&&S.handleExpansion(Z)};return{getRootProps:(ie={})=>{const Z=Y({},Ln(e),Ln(ie));let me;I.selected?me=!0:i||I.disabled?me=void 0:me=!1;const le=Y({},Z,{ref:O,role:"treeitem",tabIndex:D,id:j,"aria-expanded":I.expandable?I.expanded:void 0,"aria-selected":me,"aria-disabled":I.disabled||void 0},ie,{onFocus:_(Z),onBlur:L(Z),onKeyDown:$(Z)});o&&(le.style={"--TreeView-itemDepth":typeof f=="function"?f(p):f});const ue=v.root?.(Y({},H,{externalEventHandlers:Z}))??{};return Y({},le,ue)},getContentProps:(ie={})=>{const Z=Ln(ie),me=Y({},Z,ie,{ref:F,onClick:G(Z),onMouseDown:q(Z),status:I});o&&(me.indentationAtItemLevel=!0);const le=v.content?.(Y({},H,{externalEventHandlers:Z}))??{};return Y({},me,le)},getGroupTransitionProps:(ie={})=>{const Z=Ln(ie),me=Y({},Z,{unmountOnExit:!0,component:"ul",role:"group",in:I.expanded,children:b},ie);return o&&(me.indentationAtItemLevel=!0),me},getIconContainerProps:(ie={})=>{const Z=Ln(ie);return Y({},Z,ie,{onClick:oe(Z)})},getCheckboxProps:(ie={})=>{const Z=Ln(ie);return Y({},Z,{visible:s,ref:B,checked:I.selected,disabled:i||I.disabled,tabIndex:-1},ie,{onChange:R(Z)})},getLabelProps:(ie={})=>{const Z=Y({},Ln(ie)),me=Y({},Z,{children:m},ie,{onDoubleClick:K(Z)});return u.isTreeViewEditable&&(me.editable=I.editable),me},getLabelInputProps:(ie={})=>{const Z=Ln(ie),me=v.labelInput?.({rootRefObject:T,contentRefObject:N,externalEventHandlers:Z,interactions:S})??{};return Y({},ie,me)},getDragAndDropOverlayProps:(ie={})=>{const Z=Ln(ie),me=v.dragAndDropOverlay?.(Y({},H,{externalEventHandlers:Z}))??{};return Y({},ie,me)},rootRef:O,status:I,publicAPI:d}},xV=yV;function iE(e){const{instance:t,items:{onItemClick:n},selection:{multiSelect:r,checkboxSelection:o,disableSelection:i},expansion:{expansionTrigger:s}}=Si(),a=t.isItemExpandable(e),l=t.isItemExpanded(e),u=t.isItemFocused(e),d=t.isItemSelected(e),f=t.isItemDisabled(e),h=t?.isItemBeingEdited?t?.isItemBeingEdited(e):!1,p=t.isItemEditable?t.isItemEditable(e):!1,m=I=>{if(!f){u||t.focusItem(I,e);const T=r&&(I.shiftKey||I.ctrlKey||I.metaKey);a&&!(T&&t.isItemExpanded(e))&&t.toggleItemExpansion(I,e)}},b=I=>{f||(!u&&!h&&t.focusItem(I,e),r&&(I.shiftKey||I.ctrlKey||I.metaKey)?I.shiftKey?t.expandSelectionRange(I,e):t.selectItem({event:I,itemId:e,keepExistingSelection:!0}):t.selectItem({event:I,itemId:e,shouldBeSelected:!0}))},y=I=>{if(i||f)return;const T=I.nativeEvent.shiftKey;r&&T?t.expandSelectionRange(I,e):t.selectItem({event:I,itemId:e,keepExistingSelection:r,shouldBeSelected:I.target.checked})},x=I=>{(I.shiftKey||I.ctrlKey||I.metaKey||f)&&I.preventDefault()},C=()=>{ui(t,xr)&&t.isItemEditable(e)&&(t.isItemBeingEdited(e)?t.setEditedItemId(null):t.setEditedItemId(e))};return{disabled:f,expanded:l,selected:d,focused:u,editable:p,editing:h,disableSelection:i,checkboxSelection:o,handleExpansion:m,handleSelection:b,handleCheckboxSelection:y,handleContentClick:n,preventSelection:x,expansionTrigger:s,toggleItemEditing:C,handleSaveItemLabel:(I,T)=>{ui(t,xr)&&t.isItemBeingEditedRef(e)&&(t.updateItemLabel(e,T),C(),t.focusItem(I,e))},handleCancelItemLabelEditing:I=>{ui(t,xr)&&t.isItemBeingEditedRef(e)&&(C(),t.focusItem(I,e))}}}const CV=fe("div",{name:"MuiTreeItem2DragAndDropOverlay",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>Ot.shouldForwardProp(e)&&e!=="action"})(({theme:e})=>({position:"absolute",left:0,display:"flex",top:0,bottom:0,right:0,pointerEvents:"none",variants:[{props:{action:"make-child"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderRadius:e.shape.borderRadius,backgroundColor:e.vars?`rgba(${e.vars.palette.primary.darkChannel} / ${e.vars.palette.action.focusOpacity})`:Ot.alpha(e.palette.primary.dark,e.palette.action.focusOpacity)}},{props:{action:"reorder-above"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderTop:`1px solid ${(e.vars||e).palette.action.active}`}},{props:{action:"reorder-below"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderBottom:`1px solid ${(e.vars||e).palette.action.active}`}},{props:{action:"move-to-parent"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",borderBottom:`1px solid ${(e.vars||e).palette.action.active}`}}]}));function EV(e){return e.action==null?null:c.jsx(CV,Y({},e))}const vV=fe("input",{name:"MuiTreeItem2",slot:"LabelInput",overridesResolver:(e,t)=>t.labelInput})(({theme:e})=>Y({},e.typography.body1,{width:"100%",backgroundColor:e.palette.background.paper,borderRadius:e.shape.borderRadius,border:"none",padding:"0 2px",boxSizing:"border-box","&:focus":{outline:`1px solid ${e.palette.primary.main}`}})),TV=["classes","className","displayIcon","expansionIcon","icon","label","itemId","onClick","onMouseDown","dragAndDropOverlayProps","labelInputProps"],sE=M.forwardRef(function(t,n){const{classes:r,className:o,displayIcon:i,expansionIcon:s,icon:a,label:l,itemId:u,onClick:d,onMouseDown:f,dragAndDropOverlayProps:h,labelInputProps:p}=t,m=Ze(t,TV),{disabled:b,expanded:y,selected:x,focused:C,editing:v,editable:S,disableSelection:I,checkboxSelection:T,handleExpansion:N,handleSelection:O,handleCheckboxSelection:F,handleContentClick:B,preventSelection:j,expansionTrigger:D,toggleItemEditing:H}=iE(u),_=a||s||i,L=M.useRef(null),$=q=>{j(q),f&&f(q)},K=q=>{B?.(q,u),!L.current?.contains(q.target)&&(D==="content"&&N(q),T||O(q),d&&d(q))},G=q=>{q.defaultMuiPrevented||H()};return c.jsxs("div",Y({},m,{className:Ue(r.root,o,y&&r.expanded,x&&r.selected,C&&r.focused,b&&r.disabled,v&&r.editing,S&&r.editable),onClick:K,onMouseDown:$,ref:n,children:[c.jsx("div",{className:r.iconContainer,children:_}),T&&c.jsx(Pp,{className:r.checkbox,checked:x,onChange:F,disabled:b||I,ref:L,tabIndex:-1}),v?c.jsx(vV,Y({},p,{className:r.labelInput})):c.jsx("div",Y({className:r.label},S&&{onDoubleClick:G},{children:l})),h&&c.jsx(EV,Y({},h))]}))});function SV(e){return Ge("MuiTreeItem",e)}const co=We("MuiTreeItem",["root","groupTransition","content","expanded","selected","focused","disabled","iconContainer","label","checkbox","labelInput","editable","editing","dragAndDropOverlay"]),aE=mt(c.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),lE=mt(c.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}));function hh(e){const{children:t,itemId:n}=e,{wrapItem:r,instance:o}=Si();return r({children:t,itemId:n,instance:o})}hh.propTypes={children:Ee.node,itemId:Ee.string.isRequired};const kV=["children","className","slots","slotProps","ContentComponent","ContentProps","itemId","id","label","onClick","onMouseDown","onFocus","onBlur","onKeyDown"],wV=["ownerState"],DV=["ownerState"],IV=["ownerState"],AV=ZC(),OV=e=>{const{classes:t}=e;return Ke({root:["root"],content:["content"],expanded:["expanded"],selected:["selected"],focused:["focused"],disabled:["disabled"],iconContainer:["iconContainer"],checkbox:["checkbox"],label:["label"],labelInput:["labelInput"],editing:["editing"],editable:["editable"],groupTransition:["groupTransition"]},SV,t)},MV=fe("li",{name:"MuiTreeItem",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),PV=fe(sE,{name:"MuiTreeItem",slot:"Content",overridesResolver:(e,t)=>[t.content,t.iconContainer&&{[`& .${co.iconContainer}`]:t.iconContainer},t.label&&{[`& .${co.label}`]:t.label}],shouldForwardProp:e=>No(e)&&e!=="indentationAtItemLevel"})(({theme:e})=>({padding:e.spacing(.5,1),borderRadius:e.shape.borderRadius,width:"100%",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",gap:e.spacing(1),cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${co.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"},[`&.${co.focused}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${co.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${co.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`& .${co.iconContainer}`]:{width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},[`& .${co.label}`]:Y({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative"},e.typography.body1),[`& .${co.checkbox}`]:{padding:0},variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:`calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`}}]})),RV=fe(sl,{name:"MuiTreeItem",slot:"GroupTransition",overridesResolver:(e,t)=>t.groupTransition,shouldForwardProp:e=>No(e)&&e!=="indentationAtItemLevel"})({margin:0,padding:0,paddingLeft:"var(--TreeView-itemChildrenIndentation)",variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:0}}]}),NV=M.forwardRef(function(t,n){const{icons:r,runItemPlugins:o,items:{disabledItemsFocusable:i,indentationAtItemLevel:s},selection:{disableSelection:a},expansion:{expansionTrigger:l},treeId:u,instance:d}=Si(),f=M.useContext(fh),h=AV({props:t,name:"MuiTreeItem"}),{children:p,className:m,slots:b,slotProps:y,ContentComponent:x=sE,ContentProps:C,itemId:v,id:S,label:I,onClick:T,onMouseDown:N,onBlur:O,onKeyDown:F}=h,B=Ze(h,kV),{expanded:j,focused:D,selected:H,disabled:_,editing:L,handleExpansion:$,handleCancelItemLabelEditing:K,handleSaveItemLabel:G}=iE(v),{contentRef:q,rootRef:R,propsEnhancers:oe}=o(h),se=M.useRef(null),z=M.useRef(null),pe=vt(n,R,se),J=vt(C?.ref,q,z),Q={expandIcon:b?.expandIcon??r.slots.expandIcon??aE,collapseIcon:b?.collapseIcon??r.slots.collapseIcon??lE,endIcon:b?.endIcon??r.slots.endIcon,icon:b?.icon,groupTransition:b?.groupTransition},re=Oe=>Array.isArray(Oe)?Oe.length>0&&Oe.some(re):!!Oe,ne=re(p),ae=Y({},h,{expanded:j,focused:D,selected:H,disabled:_,indentationAtItemLevel:s}),ie=OV(ae),Z=Q.groupTransition??void 0,me=Et({elementType:Z,ownerState:{},externalSlotProps:y?.groupTransition,additionalProps:Y({unmountOnExit:!0,in:j,component:"ul",role:"group"},s?{indentationAtItemLevel:!0}:{}),className:ie.groupTransition}),le=Oe=>{l==="iconContainer"&&$(Oe)},ue=j?Q.collapseIcon:Q.expandIcon,Ie=Et({elementType:ue,ownerState:{},externalSlotProps:Oe=>j?Y({},br(r.slotProps.collapseIcon,Oe),br(y?.collapseIcon,Oe)):Y({},br(r.slotProps.expandIcon,Oe),br(y?.expandIcon,Oe)),additionalProps:{onClick:le}}),Ce=Ze(Ie,wV),we=ne&&ue?c.jsx(ue,Y({},Ce)):null,ye=ne?void 0:Q.endIcon,ze=Et({elementType:ye,ownerState:{},externalSlotProps:Oe=>ne?{}:Y({},br(r.slotProps.endIcon,Oe),br(y?.endIcon,Oe))}),Ne=Ze(ze,DV),nt=ye?c.jsx(ye,Y({},Ne)):null,_e=Q.icon,Bt=Et({elementType:_e,ownerState:{},externalSlotProps:y?.icon}),yt=Ze(Bt,IV),ot=_e?c.jsx(_e,Y({},yt)):null;let xe;H?xe=!0:a||_?xe=void 0:xe=!1;function Pe(Oe){!D&&(!_||i)&&Oe.currentTarget===Oe.target&&d.focusItem(Oe,v)}function qe(Oe){O?.(Oe),!(L||Oe.relatedTarget&&ll(Oe.relatedTarget,se.current)&&(Oe.target&&Oe.target?.dataset?.element==="labelInput"&&ll(Oe.target,se.current)||Oe.relatedTarget?.dataset?.element==="labelInput"))&&d.removeFocusedItem()}const Je=Oe=>{F?.(Oe),Oe.target?.dataset?.element!=="labelInput"&&d.handleItemKeyDown(Oe,v)},Xe=ph({itemId:v,treeId:u,id:S}),Re=d.canItemBeTabbed(v)?0:-1,ct={rootRefObject:se,contentRefObject:z,interactions:{handleSaveItemLabel:G,handleCancelItemLabelEditing:K}},lt=oe.root?.(Y({},ct,{externalEventHandlers:Ln(B)}))??{},Mt=oe.content?.(Y({},ct,{externalEventHandlers:Ln(C)}))??{},be=oe.dragAndDropOverlay?.(Y({},ct,{externalEventHandlers:{}}))??{},Ae=oe.labelInput?.(Y({},ct,{externalEventHandlers:{}}))??{};return c.jsx(hh,{itemId:v,children:c.jsxs(MV,Y({className:Ue(ie.root,m),role:"treeitem","aria-expanded":ne?j:void 0,"aria-selected":xe,"aria-disabled":_||void 0,id:Xe,tabIndex:Re},B,{ownerState:ae,onFocus:Pe,onBlur:qe,onKeyDown:Je,ref:pe,style:s?Y({},B.style,{"--TreeView-itemDepth":typeof f=="function"?f(v):f}):B.style},lt,{children:[c.jsx(PV,Y({as:x,classes:{root:ie.content,expanded:ie.expanded,selected:ie.selected,focused:ie.focused,disabled:ie.disabled,editable:ie.editable,editing:ie.editing,iconContainer:ie.iconContainer,label:ie.label,labelInput:ie.labelInput,checkbox:ie.checkbox},label:I,itemId:v,onClick:T,onMouseDown:N,icon:ot,expansionIcon:we,displayIcon:nt,ownerState:ae},C,Mt,be.action==null?{}:{dragAndDropOverlayProps:be},Ae.value==null?{}:{labelInputProps:Ae},{ref:J})),p&&c.jsx(RV,Y({as:Z},me,{children:p}))]}))})});function FV(e){const{slots:t,slotProps:n,status:r}=e,o=Si(),i=Y({},o.icons.slots,{expandIcon:o.icons.slots.expandIcon??aE,collapseIcon:o.icons.slots.collapseIcon??lE}),s=o.icons.slotProps;let a;t?.icon?a="icon":r.expandable?r.expanded?a="collapseIcon":a="expandIcon":a="endIcon";const l=t?.[a]??i[a],u=Et({elementType:l,externalSlotProps:d=>Y({},br(s[a],d),br(n?.[a],d)),ownerState:{}});return l?c.jsx(l,Y({},u)):null}const LV=["visible"],_V=fe("li",{name:"MuiTreeItem2",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),BV=fe("div",{name:"MuiTreeItem2",slot:"Content",overridesResolver:(e,t)=>t.content,shouldForwardProp:e=>No(e)&&e!=="status"&&e!=="indentationAtItemLevel"})(({theme:e})=>({padding:e.spacing(.5,1),borderRadius:e.shape.borderRadius,width:"100%",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",gap:e.spacing(1),cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:`calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`}},{props:({status:t})=>t.disabled,style:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"}},{props:({status:t})=>t.focused,style:{backgroundColor:(e.vars||e).palette.action.focus}},{props:({status:t})=>t.selected,style:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity)}}}},{props:({status:t})=>t.selected&&t.focused,style:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}]})),jV=fe("div",{name:"MuiTreeItem2",slot:"Label",overridesResolver:(e,t)=>t.label,shouldForwardProp:e=>No(e)&&e!=="editable"})(({theme:e})=>Y({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative",overflow:"hidden"},e.typography.body1,{variants:[{props:({editable:t})=>t,style:{paddingLeft:"2px"}}]})),$V=fe("div",{name:"MuiTreeItem2",slot:"IconContainer",overridesResolver:(e,t)=>t.iconContainer})({width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}});fe(sl,{name:"MuiTreeItem2",slot:"GroupTransition",overridesResolver:(e,t)=>t.groupTransition,shouldForwardProp:e=>No(e)&&e!=="indentationAtItemLevel"})({margin:0,padding:0,paddingLeft:"var(--TreeView-itemChildrenIndentation)",variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:0}}]});fe(M.forwardRef((e,t)=>{const{visible:n}=e,r=Ze(e,LV);return n?c.jsx(Pp,Y({},r,{ref:t})):null}),{name:"MuiTreeItem2",slot:"Checkbox",overridesResolver:(e,t)=>t.checkbox})({padding:0});function HV(e){return Ge("MuiRichTreeView",e)}We("MuiRichTreeView",["root"]);const zV=(e,t)=>{const n=M.useRef({}),[r,o]=M.useState(()=>{const s={};return e.forEach(a=>{a.models&&Object.entries(a.models).forEach(([l,u])=>{n.current[l]={isControlled:t[l]!==void 0,getDefaultValue:u.getDefaultValue},s[l]=u.getDefaultValue(t)})}),s});return Object.fromEntries(Object.entries(n.current).map(([s,a])=>{const l=t[s]??r[s];return[s,{value:l,setControlledValue:u=>{a.isControlled||o(d=>Y({},d,{[s]:u}))}}]}))};class UV{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,n,r={}){let o=this.events[t];o||(o={highPriority:new Map,regular:new Map},this.events[t]=o),r.isFirst?o.highPriority.set(n,!0):o.regular.set(n,!0)}removeListener(t,n){this.events[t]&&(this.events[t].regular.delete(n),this.events[t].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(t,...n){const r=this.events[t];if(!r)return;const o=Array.from(r.highPriority.keys()),i=Array.from(r.regular.keys());for(let s=o.length-1;s>=0;s-=1){const a=o[s];r.highPriority.has(a)&&a.apply(this,n)}for(let s=0;s<i.length;s+=1){const a=i[s];r.regular.has(a)&&a.apply(this,n)}}once(t,n){const r=this;this.on(t,function o(...i){r.removeListener(t,o),n.apply(r,i)})}}const VV=e=>e.isPropagationStopped!==void 0,uE=()=>{const[e]=M.useState(()=>new UV),t=M.useCallback((...r)=>{const[o,i,s={}]=r;s.defaultMuiPrevented=!1,!(VV(s)&&s.isPropagationStopped())&&e.emit(o,i,s)},[e]),n=M.useCallback((r,o)=>(e.on(r,o),()=>{e.removeListener(r,o)}),[e]);return{instance:{$$publishEvent:t,$$subscribeEvent:n}}};uE.params={};const cE=({plugins:e})=>{const t=new Set(e);return{instance:{getAvailablePlugins:()=>t}}};cE.params={};const mh=({params:e,state:t,setState:n})=>{M.useEffect(()=>{n(o=>o.id.treeId===e.id&&o.id.treeId!==void 0?o:Y({},o,{id:Y({},o.id,{treeId:e.id??bV()})}))},[n,e.id]);const r=e.id??t.id.treeId;return{getRootProps:()=>({id:r}),contextValue:{treeId:r}}};mh.params={id:!0};mh.getInitialState=({id:e})=>({id:{treeId:e??void 0}});const WV=[uE,cE,mh],qV=["slots","slotProps","apiRef","experimentalFeatures"],YV=e=>{let{props:{slots:t,slotProps:n,apiRef:r,experimentalFeatures:o},plugins:i}=e,s=Ze(e.props,qV);const a={};i.forEach(h=>{Object.assign(a,h.params)});const l={},u={};Object.keys(s).forEach(h=>{const p=s[h];a[h]?l[h]=p:u[h]=p});const d=o??{},f=i.reduce((h,p)=>p.getDefaultizedParams?p.getDefaultizedParams({params:h,experimentalFeatures:d}):h,l);return{apiRef:r,forwardedProps:u,pluginParams:f,slots:t??{},slotProps:n??{},experimentalFeatures:d}},KV=({plugins:e,instance:t,publicAPI:n,rootRef:r})=>({runItemPlugins:a=>{let l=null,u=null;const d=[],f={};e.forEach(m=>{if(!m.itemPlugin)return;const b=m.itemPlugin({props:a,rootRef:l,contentRef:u});b?.rootRef&&(l=b.rootRef),b?.contentRef&&(u=b.contentRef),b?.propsEnhancers&&(d.push(b.propsEnhancers),Object.keys(b.propsEnhancers).forEach(y=>{f[y]=!0}))});const h=m=>b=>{const y={};return d.forEach(x=>{const C=x[m];C!=null&&Object.assign(y,C(b))}),y},p=Object.fromEntries(Object.keys(f).map(m=>[m,h(m)]));return{contentRef:u,rootRef:l,propsEnhancers:p}},wrapItem:({itemId:a,children:l})=>{let u=l;for(let d=e.length-1;d>=0;d-=1){const f=e[d];f.wrapItem&&(u=f.wrapItem({itemId:a,children:u,instance:t}))}return u},wrapRoot:({children:a})=>{let l=a;for(let u=e.length-1;u>=0;u-=1){const d=e[u];d.wrapRoot&&(l=d.wrapRoot({children:l,instance:t}))}return l},instance:t,rootRef:r,publicAPI:n});function GV(e){const t=M.useRef({});return e?(e.current==null&&(e.current={}),e.current):t.current}const QV=({plugins:e,rootRef:t,props:n})=>{const r=[...WV,...e],{pluginParams:o,forwardedProps:i,apiRef:s,experimentalFeatures:a,slots:l,slotProps:u}=YV({plugins:r,props:n}),d=zV(r,o),h=M.useRef({}).current,p=GV(s),m=M.useRef(null),b=vt(m,t),y=KV({plugins:r,instance:h,publicAPI:p,rootRef:m}),[x,C]=M.useState(()=>{const T={};return r.forEach(N=>{N.getInitialState&&Object.assign(T,N.getInitialState(o))}),T}),v=[],S=T=>{const N=T({instance:h,params:o,slots:l,slotProps:u,experimentalFeatures:a,state:x,setState:C,rootRef:m,models:d,plugins:r});N.getRootProps&&v.push(N.getRootProps),N.publicAPI&&Object.assign(p,N.publicAPI),N.instance&&Object.assign(h,N.instance),N.contextValue&&Object.assign(y,N.contextValue)};return r.forEach(S),{getRootProps:(T={})=>{const N=Y({role:"tree"},i,T,{ref:b});return v.forEach(O=>{Object.assign(N,O(T))}),N},rootRef:b,contextValue:y,instance:h}},XV=(e,t,n)=>{e.$$publishEvent(t,n)},es="__TREE_VIEW_ROOT_PARENT_ID__",ZV=e=>{const t={};return e.forEach((n,r)=>{t[n]=r}),t},JV=["children"],dE=({items:e,isItemDisabled:t,getItemLabel:n,getItemId:r})=>{const o={},i={},s={[es]:[]},a=(u,d,f)=>{const h=r?r(u):u.id;if(h==null)throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.","Alternatively, you can use the `getItemId` prop to specify a custom id for each item.","An item was provided without id in the `items` prop:",JSON.stringify(u)].join(`
|
|
224
|
+
`));if(o[h]!=null)throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.","Alternatively, you can use the `getItemId` prop to specify a custom id for each item.",`Two items were provided with the same id in the \`items\` prop: "${h}"`].join(`
|
|
225
|
+
`));const p=n?n(u):u.label;if(p==null)throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.","Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.","An item was provided without label in the `items` prop:",JSON.stringify(u)].join(`
|
|
226
|
+
`));o[h]={id:h,label:p,parentId:f,idAttribute:void 0,expandable:!!u.children?.length,disabled:t?t(u):!1,depth:d},i[h]=u;const m=f??es;s[m]||(s[m]=[]),s[m].push(h),u.children?.forEach(b=>a(b,d+1,h))};e.forEach(u=>a(u,0,null));const l={};return Object.keys(s).forEach(u=>{l[u]=ZV(s[u])}),{itemMetaMap:o,itemMap:i,itemOrderedChildrenIds:s,itemChildrenIndexes:l}},Dl=({instance:e,params:t,state:n,setState:r,experimentalFeatures:o})=>{const i=M.useCallback(x=>n.items.itemMetaMap[x],[n.items.itemMetaMap]),s=M.useCallback(x=>n.items.itemMap[x],[n.items.itemMap]),a=M.useCallback(()=>{const x=C=>{const v=n.items.itemMap[C],S=Ze(v,JV),I=n.items.itemOrderedChildrenIds[C];return I&&(S.children=I.map(x)),S};return n.items.itemOrderedChildrenIds[es].map(x)},[n.items.itemMap,n.items.itemOrderedChildrenIds]),l=M.useCallback(x=>{if(x==null)return!1;let C=e.getItemMeta(x);if(!C)return!1;if(C.disabled)return!0;for(;C.parentId!=null;)if(C=e.getItemMeta(C.parentId),C.disabled)return!0;return!1},[e]),u=M.useCallback(x=>{const C=e.getItemMeta(x).parentId??es;return n.items.itemChildrenIndexes[C][x]},[e,n.items.itemChildrenIndexes]),d=M.useCallback(x=>n.items.itemOrderedChildrenIds[x??es]??[],[n.items.itemOrderedChildrenIds]),f=x=>{const C=e.getItemMeta(x);return C==null?null:document.getElementById(ph({treeId:n.id.treeId,itemId:x,id:C.idAttribute}))},h=x=>t.disabledItemsFocusable?!0:!e.isItemDisabled(x),p=M.useRef(!1),m=M.useCallback(()=>{p.current=!0},[]),b=M.useCallback(()=>p.current,[]);return M.useEffect(()=>{e.areItemUpdatesPrevented()||r(x=>{const C=dE({items:t.items,isItemDisabled:t.isItemDisabled,getItemId:t.getItemId,getItemLabel:t.getItemLabel});return Object.values(x.items.itemMetaMap).forEach(v=>{C.itemMetaMap[v.id]||XV(e,"removeItem",{id:v.id})}),Y({},x,{items:C})})},[e,r,t.items,t.isItemDisabled,t.getItemId,t.getItemLabel]),{getRootProps:()=>({style:{"--TreeView-itemChildrenIndentation":typeof t.itemChildrenIndentation=="number"?`${t.itemChildrenIndentation}px`:t.itemChildrenIndentation}}),publicAPI:{getItem:s,getItemDOMElement:f,getItemTree:a,getItemOrderedChildrenIds:d},instance:{getItemMeta:i,getItem:s,getItemTree:a,getItemsToRender:()=>{const x=C=>{const v=n.items.itemMetaMap[C];return{label:v.label,itemId:v.id,id:v.idAttribute,children:n.items.itemOrderedChildrenIds[C]?.map(x)}};return n.items.itemOrderedChildrenIds[es].map(x)},getItemIndex:u,getItemDOMElement:f,getItemOrderedChildrenIds:d,isItemDisabled:l,isItemNavigable:h,preventItemUpdates:m,areItemUpdatesPrevented:b},contextValue:{items:{onItemClick:t.onItemClick,disabledItemsFocusable:t.disabledItemsFocusable,indentationAtItemLevel:o.indentationAtItemLevel??!1}}}};Dl.getInitialState=e=>({items:dE({items:e.items,isItemDisabled:e.isItemDisabled,getItemId:e.getItemId,getItemLabel:e.getItemLabel})});Dl.getDefaultizedParams=({params:e})=>Y({},e,{disabledItemsFocusable:e.disabledItemsFocusable??!1,itemChildrenIndentation:e.itemChildrenIndentation??"12px"});Dl.wrapRoot=({children:e,instance:t})=>c.jsx(fh.Provider,{value:n=>t.getItemMeta(n)?.depth??0,children:e});Dl.params={disabledItemsFocusable:!0,items:!0,isItemDisabled:!0,getItemLabel:!0,getItemId:!0,onItemClick:!0,itemChildrenIndentation:!0};const Lc=({instance:e,params:t,models:n})=>{const r=M.useMemo(()=>{const f=new Map;return n.expandedItems.value.forEach(h=>{f.set(h,!0)}),f},[n.expandedItems.value]),o=(f,h)=>{t.onExpandedItemsChange?.(f,h),n.expandedItems.setControlledValue(h)},i=M.useCallback(f=>r.has(f),[r]),s=M.useCallback(f=>!!e.getItemMeta(f)?.expandable,[e]),a=Ve((f,h)=>{const p=e.isItemExpanded(h);e.setItemExpansion(f,h,!p)}),l=Ve((f,h,p)=>{if(e.isItemExpanded(h)===p)return;let b;p?b=[h].concat(n.expandedItems.value):b=n.expandedItems.value.filter(y=>y!==h),t.onItemExpansionToggle&&t.onItemExpansionToggle(f,h,p),o(f,b)}),u=(f,h)=>{const p=e.getItemMeta(h),b=e.getItemOrderedChildrenIds(p.parentId).filter(x=>e.isItemExpandable(x)&&!e.isItemExpanded(x)),y=n.expandedItems.value.concat(b);b.length>0&&(t.onItemExpansionToggle&&b.forEach(x=>{t.onItemExpansionToggle(f,x,!0)}),o(f,y))},d=M.useMemo(()=>t.expansionTrigger?t.expansionTrigger:e.isTreeViewEditable?"iconContainer":"content",[t.expansionTrigger,e.isTreeViewEditable]);return{publicAPI:{setItemExpansion:l},instance:{isItemExpanded:i,isItemExpandable:s,setItemExpansion:l,toggleItemExpansion:a,expandAllSiblings:u},contextValue:{expansion:{expansionTrigger:d}}}};Lc.models={expandedItems:{getDefaultValue:e=>e.defaultExpandedItems}};const eW=[];Lc.getDefaultizedParams=({params:e})=>Y({},e,{defaultExpandedItems:e.defaultExpandedItems??eW});Lc.params={expandedItems:!0,defaultExpandedItems:!0,onExpandedItemsChange:!0,onItemExpansionToggle:!0,expansionTrigger:!0};const ku=e=>Array.isArray(e)?e:e!=null?[e]:[],qd=e=>{const t={};return e.forEach(n=>{t[n]=!0}),t},_c=({instance:e,params:t,models:n})=>{const r=M.useRef(null),o=M.useRef({}),i=M.useMemo(()=>{const b=new Map;return Array.isArray(n.selectedItems.value)?n.selectedItems.value.forEach(y=>{b.set(y,!0)}):n.selectedItems.value!=null&&b.set(n.selectedItems.value,!0),b},[n.selectedItems.value]),s=(b,y)=>{if(t.onItemSelectionToggle)if(t.multiSelect){const x=y.filter(v=>!e.isItemSelected(v)),C=n.selectedItems.value.filter(v=>!y.includes(v));x.forEach(v=>{t.onItemSelectionToggle(b,v,!0)}),C.forEach(v=>{t.onItemSelectionToggle(b,v,!1)})}else y!==n.selectedItems.value&&(n.selectedItems.value!=null&&t.onItemSelectionToggle(b,n.selectedItems.value,!1),y!=null&&t.onItemSelectionToggle(b,y,!0));t.onSelectedItemsChange&&t.onSelectedItemsChange(b,y),n.selectedItems.setControlledValue(y)},a=b=>i.has(b),l=({event:b,itemId:y,keepExistingSelection:x=!1,shouldBeSelected:C})=>{if(t.disableSelection)return;let v;if(x){const S=ku(n.selectedItems.value),I=e.isItemSelected(y);I&&(C===!1||C==null)?v=S.filter(T=>T!==y):!I&&(C===!0||C==null)?v=[y].concat(S):v=S}else C===!1||C==null&&e.isItemSelected(y)?v=t.multiSelect?[]:null:v=t.multiSelect?[y]:y;s(b,v),r.current=y,o.current={}},u=(b,[y,x])=>{if(t.disableSelection||!t.multiSelect)return;let C=ku(n.selectedItems.value).slice();Object.keys(o.current).length>0&&(C=C.filter(T=>!o.current[T]));const v=qd(C),S=mV(e,y,x),I=S.filter(T=>!v[T]);C=C.concat(I),s(b,C),o.current=qd(S)};return{getRootProps:()=>({"aria-multiselectable":t.multiSelect}),publicAPI:{selectItem:l},instance:{isItemSelected:a,selectItem:l,selectAllNavigableItems:b=>{if(t.disableSelection||!t.multiSelect)return;const y=gV(e);s(b,y),o.current=qd(y)},expandSelectionRange:(b,y)=>{if(r.current!=null){const[x,C]=oE(e,y,r.current);u(b,[x,C])}},selectRangeFromStartToItem:(b,y)=>{u(b,[al(e),y])},selectRangeFromItemToEnd:(b,y)=>{u(b,[y,rE(e)])},selectItemFromArrowNavigation:(b,y,x)=>{if(t.disableSelection||!t.multiSelect)return;let C=ku(n.selectedItems.value).slice();Object.keys(o.current).length===0?(C.push(x),o.current={[y]:!0,[x]:!0}):(o.current[y]||(o.current={}),o.current[x]?(C=C.filter(v=>v!==y),delete o.current[y]):(C.push(x),o.current[x]=!0)),s(b,C)}},contextValue:{selection:{multiSelect:t.multiSelect,checkboxSelection:t.checkboxSelection,disableSelection:t.disableSelection}}}};_c.models={selectedItems:{getDefaultValue:e=>e.defaultSelectedItems}};const tW=[];_c.getDefaultizedParams=({params:e})=>Y({},e,{disableSelection:e.disableSelection??!1,multiSelect:e.multiSelect??!1,checkboxSelection:e.checkboxSelection??!1,defaultSelectedItems:e.defaultSelectedItems??(e.multiSelect?tW:null)});_c.params={disableSelection:!0,multiSelect:!0,checkboxSelection:!0,defaultSelectedItems:!0,selectedItems:!0,onSelectedItemsChange:!0,onItemSelectionToggle:!0};const Z1=1e3;class nW{constructor(t=Z1){this.timeouts=new Map,this.cleanupTimeout=Z1,this.cleanupTimeout=t}register(t,n,r){this.timeouts||(this.timeouts=new Map);const o=setTimeout(()=>{typeof n=="function"&&n(),this.timeouts.delete(r.cleanupToken)},this.cleanupTimeout);this.timeouts.set(r.cleanupToken,o)}unregister(t){const n=this.timeouts.get(t.cleanupToken);n&&(this.timeouts.delete(t.cleanupToken),clearTimeout(n))}reset(){this.timeouts&&(this.timeouts.forEach((t,n)=>{this.unregister({cleanupToken:n})}),this.timeouts=void 0)}}class rW{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,n,r){this.registry.register(t,n,r)}unregister(t){this.registry.unregister(t)}reset(){}}class oW{}function iW(e){let t=0;return function(r,o,i){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new rW:new nW);const[s]=M.useState(new oW),a=M.useRef(null),l=M.useRef(void 0);l.current=i;const u=M.useRef(null);if(!a.current&&l.current){const d=(f,h)=>{h.defaultMuiPrevented||l.current?.(f,h)};a.current=r.$$subscribeEvent(o,d),t+=1,u.current={cleanupToken:t},e.registry.register(s,()=>{a.current?.(),a.current=null,u.current=null},u.current)}else!l.current&&a.current&&(a.current(),a.current=null,u.current&&(e.registry.unregister(u.current),u.current=null));M.useEffect(()=>{if(!a.current&&l.current){const d=(f,h)=>{h.defaultMuiPrevented||l.current?.(f,h)};a.current=r.$$subscribeEvent(o,d)}return u.current&&e.registry&&(e.registry.unregister(u.current),u.current=null),()=>{a.current?.(),a.current=null}},[r,o])}}const sW={registry:null},aW=iW(sW),fE=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?fE(t.shadowRoot):t:null},lW=(e,t)=>{let n=ku(t).find(r=>{if(!e.isItemNavigable(r))return!1;const o=e.getItemMeta(r);return o&&(o.parentId==null||e.isItemExpanded(o.parentId))});return n==null&&(n=al(e)),n},gh=({instance:e,params:t,state:n,setState:r,models:o,rootRef:i})=>{const s=lW(e,o.selectedItems.value),a=Ve(y=>{const x=typeof y=="function"?y(n.focusedItemId):y;n.focusedItemId!==x&&r(C=>Y({},C,{focusedItemId:x}))}),l=M.useCallback(()=>!!i.current&&i.current.contains(fE(mn(i.current))),[i]),u=M.useCallback(y=>n.focusedItemId===y&&l(),[n.focusedItemId,l]),d=y=>{const x=e.getItemMeta(y);return x&&(x.parentId==null||e.isItemExpanded(x.parentId))},f=(y,x)=>{const C=e.getItemDOMElement(x);C&&C.focus(),a(x),t.onItemFocus&&t.onItemFocus(y,x)},h=Ve((y,x)=>{d(x)&&f(y,x)}),p=Ve(()=>{if(n.focusedItemId==null)return;if(e.getItemMeta(n.focusedItemId)){const x=e.getItemDOMElement(n.focusedItemId);x&&x.blur()}a(null)}),m=y=>y===s;aW(e,"removeItem",({id:y})=>{n.focusedItemId===y&&f(null,s)});const b=y=>x=>{y.onFocus?.(x),!x.defaultMuiPrevented&&x.target===x.currentTarget&&f(x,s)};return{getRootProps:y=>({onFocus:b(y)}),publicAPI:{focusItem:h},instance:{isItemFocused:u,canItemBeTabbed:m,focusItem:h,removeFocusedItem:p}}};gh.getInitialState=()=>({focusedItemId:null});gh.params={onItemFocus:!0};function uW(e){return!!e&&e.length===1&&!!e.match(/\S/)}const pE=({instance:e,params:t,state:n})=>{const r=kr(),o=M.useRef({}),i=Ve(d=>{o.current=d(o.current)});M.useEffect(()=>{if(e.areItemUpdatesPrevented())return;const d={},f=h=>{d[h.id]=h.label.substring(0,1).toLowerCase()};Object.values(n.items.itemMetaMap).forEach(f),o.current=d},[n.items.itemMetaMap,t.getItemId,e]);const s=(d,f)=>{const h=f.toLowerCase(),p=x=>{const C=Su(e,x);return C===null?al(e):C};let m=null,b=p(d);const y={};for(;m==null&&!y[b];)o.current[b]===h?m=b:(y[b]=!0,b=p(b));return m},a=d=>!t.disableSelection&&!e.isItemDisabled(d),l=d=>!e.isItemDisabled(d)&&e.isItemExpandable(d);return{instance:{updateFirstCharMap:i,handleItemKeyDown:(d,f)=>{if(d.defaultMuiPrevented||d.altKey||ll(d.target,d.currentTarget))return;const h=d.ctrlKey||d.metaKey,p=d.key;switch(!0){case(p===" "&&a(f)):{d.preventDefault(),t.multiSelect&&d.shiftKey?e.expandSelectionRange(d,f):e.selectItem({event:d,itemId:f,keepExistingSelection:t.multiSelect,shouldBeSelected:t.multiSelect?void 0:!0});break}case p==="Enter":{ui(e,xr)&&e.isItemEditable(f)&&!e.isItemBeingEdited(f)?e.setEditedItemId(f):l(f)?(e.toggleItemExpansion(d,f),d.preventDefault()):a(f)&&(t.multiSelect?(d.preventDefault(),e.selectItem({event:d,itemId:f,keepExistingSelection:!0})):e.isItemSelected(f)||(e.selectItem({event:d,itemId:f}),d.preventDefault()));break}case p==="ArrowDown":{const m=Su(e,f);m&&(d.preventDefault(),e.focusItem(d,m),t.multiSelect&&d.shiftKey&&a(m)&&e.selectItemFromArrowNavigation(d,f,m));break}case p==="ArrowUp":{const m=nE(e,f);m&&(d.preventDefault(),e.focusItem(d,m),t.multiSelect&&d.shiftKey&&a(m)&&e.selectItemFromArrowNavigation(d,f,m));break}case(p==="ArrowRight"&&!r||p==="ArrowLeft"&&r):{if(h)return;if(e.isItemExpanded(f)){const m=Su(e,f);m&&(e.focusItem(d,m),d.preventDefault())}else l(f)&&(e.toggleItemExpansion(d,f),d.preventDefault());break}case(p==="ArrowLeft"&&!r||p==="ArrowRight"&&r):{if(h)return;if(l(f)&&e.isItemExpanded(f))e.toggleItemExpansion(d,f),d.preventDefault();else{const m=e.getItemMeta(f).parentId;m&&(e.focusItem(d,m),d.preventDefault())}break}case p==="Home":{a(f)&&t.multiSelect&&h&&d.shiftKey?e.selectRangeFromStartToItem(d,f):e.focusItem(d,al(e)),d.preventDefault();break}case p==="End":{a(f)&&t.multiSelect&&h&&d.shiftKey?e.selectRangeFromItemToEnd(d,f):e.focusItem(d,rE(e)),d.preventDefault();break}case p==="*":{e.expandAllSiblings(d,f),d.preventDefault();break}case(String.fromCharCode(d.keyCode)==="A"&&h&&t.multiSelect&&!t.disableSelection):{e.selectAllNavigableItems(d),d.preventDefault();break}case(!h&&!d.shiftKey&&uW(p)):{const m=s(f,p);m!=null&&(e.focusItem(d,m),d.preventDefault());break}}}}}};pE.params={};const hE=({slots:e,slotProps:t})=>({contextValue:{icons:{slots:{collapseIcon:e.collapseIcon,expandIcon:e.expandIcon,endIcon:e.endIcon},slotProps:{collapseIcon:t.collapseIcon,expandIcon:t.expandIcon,endIcon:t.endIcon}}}});hE.params={};const cW=[Dl,Lc,_c,gh,pE,hE,xr],dW=["ownerState"];function fW({slots:e,slotProps:t,label:n,id:r,itemId:o,itemsToRender:i}){const s=e?.item??NV,a=Et({elementType:s,externalSlotProps:t?.item,additionalProps:{itemId:o,id:r,label:n},ownerState:{itemId:o,label:n}}),l=Ze(a,dW),u=M.useMemo(()=>i?c.jsx(mE,{itemsToRender:i,slots:e,slotProps:t}):null,[i,e,t]);return c.jsx(s,Y({},l,{children:u}))}function mE(e){const{itemsToRender:t,slots:n,slotProps:r}=e;return c.jsx(M.Fragment,{children:t.map(o=>c.jsx(fW,{slots:n,slotProps:r,label:o.label,id:o.id,itemId:o.itemId,itemsToRender:o.children},o.itemId))})}const pW=ZC(),hW=e=>{const{classes:t}=e;return Ke({root:["root"]},HV,t)},mW=fe("ul",{name:"MuiRichTreeView",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,margin:0,listStyle:"none",outline:0,position:"relative"}),gW=M.forwardRef(function(t,n){const r=pW({props:t,name:"MuiRichTreeView"}),{getRootProps:o,contextValue:i,instance:s}=QV({plugins:cW,rootRef:n,props:r}),{slots:a,slotProps:l}=r,u=hW(r),d=a?.root??mW,f=Et({elementType:d,externalSlotProps:l?.root,className:u.root,getSlotProps:o,ownerState:r});return c.jsx(fV,{value:i,children:c.jsx(d,Y({},f,{children:c.jsx(mE,{slots:a,slotProps:l,itemsToRender:s.getItemsToRender()})}))})}),bW=mt([c.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),c.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),yW=mt(c.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"})),xW=mt(c.jsx("path",{d:"M19 15v4H5v-4zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1M7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M19 5v4H5V5zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1M7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5"})),CW=mt(c.jsx("path",{d:"M15 4v2h3v12h-3v2h5V4zM4 20h5v-2H6V6h3V4H4z"}));function EW({items:e,defaultExpandedItems:t,onClickTreeNode:n}){return c.jsx(gW,{items:wW(e,n),defaultExpandedItems:t,slots:{item:kW}})}const vW=eb.animated(sl);function TW(e){const t=eb.useSpring({to:{opacity:e.in?1:0,transform:`translate3d(0,${e.in?0:20}px,0)`}});return c.jsx(vW,{style:t,...e})}function SW({item:e,...t}){const n=c.jsxs(jV,{...t,sx:{display:"flex",alignItems:"center",color:e.error?"error.main":"grey.600"},children:[e.fileType==="directory"&&c.jsx(BC,{})||e.fileType==="notebook"&&c.jsx(bW,{})||e.fileType==="model"&&c.jsx(CW,{})||e.fileType=="database"&&c.jsx(xW,{})||c.jsx(yW,{}),c.jsx(w.Typography,{variant:"body2",sx:{marginLeft:"5px"},color:e.error?"error.main":e.link?"primary.main":"grey.600",children:e.label})]});return e.error?c.jsx(w.Tooltip,{title:e.error,placement:"right",children:n}):n}const kW=M.forwardRef(function(t,n){const{id:r,itemId:o,label:i,children:s,disabled:a,...l}=t,{getRootProps:u,getContentProps:d,getLabelProps:f,getIconContainerProps:h,getGroupTransitionProps:p,status:m,publicAPI:b}=xV({id:r,itemId:o,children:s,label:i,disabled:a,rootRef:n}),y=b.getItem(o);return m.selected=!1,m.focused=!1,c.jsx(hh,{itemId:o,children:c.jsxs(_V,{...u(l),children:[c.jsxs(BV,{...d(),...y.link&&{onClick:x=>y.link(x)},sx:{pointerEvents:!y.selectable&&"none"},children:[c.jsx($V,{...h(),children:c.jsx(FV,{status:m})}),c.jsx(SW,{...f({item:y})})]}),s&&c.jsx(TW,{...p()})]})})});function wW(e,t){const n=new Map;return e.map(r=>{let o=n;const i=r.path.split("/");i.forEach((s,a)=>{a===i.length-1?o.set(s,r):(o.has(s)||o.set(s,new Map),o=o.get(s))})}),gE(n,"",t)}function gE(e,t,n){const r=[];return e.forEach((o,i)=>{const s=i.endsWith(".malloy")&&"model"||i.endsWith(".malloynb")&&"notebook"||i.endsWith(".parquet")&&"database"||"unknown";if(s!=="unknown"){const a=o;r.push({id:t+i,label:i,fileType:s,link:s==="model"||s==="notebook"?l=>n(t+i,l):void 0,selectable:s==="model"||s==="notebook",error:"error"in a?a.error:void 0})}else{const a=t+i+"/";r.push({id:a,label:i,fileType:"directory",selectable:!0,link:void 0,children:gE(o,a,n)})}}),r}const DW=["notebooks/","models/"];function IW({onClickModelFile:e,resourceUri:t}){const{environmentName:n,packageName:r,versionId:o}=Ht(t),{apiClients:i}=De.useServer(),{data:s,isError:a,error:l,isSuccess:u}=Xt({queryKey:["models",n,r,o],queryFn:()=>i.models.listModels(n,r,o)});return c.jsx(De.PackageCard,{children:c.jsxs(De.PackageCardContent,{children:[c.jsx(De.PackageSectionTitle,{children:"Semantic Models"}),c.jsxs(w.Box,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!u&&!a&&c.jsx(Sn,{text:"Fetching Models..."}),a&&c.jsx(kn,{error:l,context:`${n} > ${r} > Models`}),u&&s.data.length>0&&c.jsx(EW,{items:s.data.sort((d,f)=>d.path.localeCompare(f.path)),onClickTreeNode:e,defaultExpandedItems:DW}),u&&s.data.length===0&&c.jsx(w.Typography,{variant:"body2",children:"No models found"})]})]})})}function AW(e){try{const{environmentName:t,packageName:n,modelPath:r}=Ht(e);return!t||!n||!r?null:{environmentName:t,packageName:n,pagePath:r}}catch{return null}}function OW({resourceUri:e}){const{server:t,apiClients:n}=De.useServer(),r=AW(e),o=r?.environmentName??"",i=r?.packageName??"",s=r?.pagePath??"",a=W.useMemo(()=>`${XC(t)}/environments/${encodeURIComponent(o)}/packages/${encodeURIComponent(i)}/${s}`,[t,o,i,s]),u=Xt({queryKey:["pages",o,i],queryFn:()=>n.pages.listPages(o,i),enabled:!!r}).data?.data?.find(b=>b.path===s),d=u?.title??s,f=u?.fit==="viewport",h=W.useRef(null),[p,m]=W.useState(120);return W.useEffect(()=>{if(f)return;function b(y){JU(y.data)&&y.source===h.current?.contentWindow&&y.data.height>0&&m(Math.ceil(y.data.height))}return window.addEventListener("message",b),()=>window.removeEventListener("message",b)},[f]),r?c.jsxs(w.Box,{sx:{p:3,...f?{height:"100%",display:"flex",flexDirection:"column"}:{maxWidth:1200,mx:"auto"}},children:[c.jsxs(w.Stack,{direction:"row",alignItems:"baseline",spacing:1,sx:{mb:1,flexShrink:0},children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:d}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",sx:{fontFamily:De.MONO_FONT_FAMILY},children:s}),c.jsx(w.Box,{sx:{flex:1}}),c.jsx(w.Tooltip,{title:"Open standalone in new tab",children:c.jsx(w.IconButton,{size:"small",href:a,target:"_blank",rel:"noopener noreferrer","aria-label":"Open standalone in new tab",sx:{color:"text.secondary"},children:c.jsx(QC,{fontSize:"small"})})})]}),c.jsx(w.Box,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",backgroundColor:"background.paper",...f?{flex:1,minHeight:0}:{}},children:c.jsx("iframe",{ref:h,src:a,title:d,sandbox:"allow-scripts allow-same-origin allow-forms",style:{display:"block",width:"100%",height:f?"100%":p,border:0}})})]}):c.jsxs(w.Box,{sx:{p:3,maxWidth:1200,mx:"auto"},children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600},children:"Can't open page"}),c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["This page link is missing an environment, package, or path:",c.jsx(w.Box,{component:"span",sx:{fontFamily:De.MONO_FONT_FAMILY,ml:1},children:e})]})]})}function bE(e){return{background:e.dashboardRoot,tableBackground:e.tableBackground,tableHeaderColor:e.tableHeader,tableBodyColor:e.tableBody,tableBorder:e.border,tablePinnedBackground:e.tableHeaderBackground,tablePinnedBorder:e.pinnedBorder,tableFontSize:`${e.font.size}px`,fontFamily:e.font.family,mapColor:e.mapColor}}function yE(e){return{"--malloy-render--font-family":e.font.family,"--malloy-render--table-font-size":`${e.font.size}px`,"--malloy-render--table-header-color":e.tableHeader,"--malloy-render--table-body-color":e.tableBody,"--malloy-render--table-border":e.border,"--malloy-render--table-pinned-border":e.pinnedBorder,"--malloy-render--tile-background":e.tile,"--publisher-dashboard-root":e.dashboardRoot,"--malloy-render--label-color":e.tileTitle,"--malloy-render--value-color":e.valueColor}}function xE(e){const{foreground:t,axisFaint:n,font:r}=e,o={background:e.background,font:r.family,title:{color:t,font:r.family},axis:{labelColor:t,titleColor:t,domainColor:n,tickColor:n,gridColor:n,labelFont:r.family,titleFont:r.family},legend:{labelColor:t,titleColor:t,labelFont:r.family,titleFont:r.family},header:{labelColor:t,titleColor:t},range:{category:e.series}};return i=>o}function CE(e){if(!e)return;const t=e.tag("theme");if(!t)return;const n={},r=t.tag("palette");if(r){const i={},s=r.textArray("series");s&&s.length>0&&(i.series=s);for(const a of De.PER_MODE_COLOR_KEYS){const l=r.tag(a);if(!l)continue;const u={},d=l.text("light"),f=l.text("dark");d&&(u.light=d),f&&(u.dark=f),Object.keys(u).length>0&&(i[a]=u)}Object.keys(i).length>0&&(n.palette=i)}const o=t.tag("font");if(o){const i={},s=o.text("family");s&&(i.family=s);const a=o.numeric("size");typeof a=="number"&&Number.isFinite(a)&&(i.size=a),Object.keys(i).length>0&&(n.font=i)}return Object.keys(n).length>0?n:void 0}const MW=async(e,t)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:n}=await import("@malloydata/render");return new n({onClick:t,vegaConfigOverride:xE(e),theme:bE(e),onError:o=>{console.error("Error rendering visualization:",typeof o,o)}}).createViz()};typeof window<"u"&&import("@malloydata/render");async function PW(e){if(!e||typeof e!="object")return;const t=e,n=[...Array.isArray(t.model_annotations)?t.model_annotations:[],...Array.isArray(t.source_annotations)?t.source_annotations:[],...Array.isArray(t.annotations)?t.annotations:[]].map(o=>typeof o?.value=="string"?o.value:void 0).filter(o=>!!o);if(n.length===0)return;let r;try{({parseAnnotation:r}=await import("@malloydata/malloy-tag"))}catch{return}try{const{tag:o}=r(n);return CE(o)}catch(o){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:o,lines:n});return}}function RW(e,t){const n=yE(t);for(const[r,o]of Object.entries(n))e.style.setProperty(r,o)}const NW=`
|
|
227
|
+
/* dashboard.css hardcodes background: #f7f9fc on .malloy-dashboard
|
|
228
|
+
and .dashboard-row-header, which would paint light grey in dark
|
|
229
|
+
mode and also bleed an operator-picked palette.background across
|
|
230
|
+
the panel chrome in light. Both surfaces use
|
|
231
|
+
--malloy-render--background here, which buildMalloyExplicitTheme
|
|
232
|
+
wires to dashboardRoot: a mode-keyed neutral that stays decoupled
|
|
233
|
+
from palette.background (the chart canvas) on purpose. Selectors
|
|
234
|
+
are duplicated at higher specificity to beat the renderer s own
|
|
235
|
+
scoped rules. */
|
|
236
|
+
.malloy-render .malloy-dashboard,
|
|
237
|
+
.malloy-render.malloy-render .malloy-dashboard,
|
|
238
|
+
div.malloy-render .malloy-dashboard {
|
|
239
|
+
/* --publisher-dashboard-root is set on the outer Publisher wrapper
|
|
240
|
+
(see buildTableCssVars) and stays decoupled from
|
|
241
|
+
--malloy-render--background, which gets shadowed inside the
|
|
242
|
+
renderer when a theme.background annotation is present. The
|
|
243
|
+
dedicated var means the panel between tiles always paints the
|
|
244
|
+
operator neutral dashboardRoot regardless of annotations. */
|
|
245
|
+
background: var(--publisher-dashboard-root) !important;
|
|
246
|
+
background-color: var(--publisher-dashboard-root) !important;
|
|
247
|
+
color: var(--malloy-render--table-body-color) !important;
|
|
248
|
+
}
|
|
249
|
+
.malloy-render .malloy-dashboard .dashboard-row,
|
|
250
|
+
.malloy-render .malloy-dashboard .dashboard-row-body,
|
|
251
|
+
.malloy-render .malloy-dashboard .dashboard-row-header,
|
|
252
|
+
.malloy-render.malloy-render .malloy-dashboard .dashboard-row-header,
|
|
253
|
+
div.malloy-render .malloy-dashboard .dashboard-row-header {
|
|
254
|
+
/* Belt + suspenders: dashboard.css hardcodes .dashboard-row-header
|
|
255
|
+
to #f7f9fc, and row / row-body have no explicit background but
|
|
256
|
+
get caught in any annotation-driven inline writes. Force all of
|
|
257
|
+
them to the neutral panel colour. */
|
|
258
|
+
background: var(--publisher-dashboard-root) !important;
|
|
259
|
+
background-color: var(--publisher-dashboard-root) !important;
|
|
260
|
+
}
|
|
261
|
+
.malloy-render .malloy-dashboard .dashboard-item {
|
|
262
|
+
/* Tile padding around each chart / table. Uses our custom
|
|
263
|
+
--malloy-render--tile-background so the operator can theme the
|
|
264
|
+
tile separately from the table header row (which paints from
|
|
265
|
+
--malloy-render--table-pinned-background below). */
|
|
266
|
+
background: var(--malloy-render--tile-background) !important;
|
|
267
|
+
color: var(--malloy-render--table-body-color) !important;
|
|
268
|
+
box-shadow: none !important;
|
|
269
|
+
border: var(--malloy-render--table-border) !important;
|
|
270
|
+
}
|
|
271
|
+
.malloy-render .malloy-dashboard .dashboard-row-header-separator {
|
|
272
|
+
background: var(--malloy-render--table-border) !important;
|
|
273
|
+
}
|
|
274
|
+
.malloy-render .malloy-table .th.column-cell {
|
|
275
|
+
/* Non-pinned tables have no header background in the renderer's
|
|
276
|
+
own CSS (only pinned scrolled tables paint the pinned-header
|
|
277
|
+
with this var). Force the same value here so every table has a
|
|
278
|
+
visible header band reflecting the operator's choice. */
|
|
279
|
+
background: var(--malloy-render--table-pinned-background) !important;
|
|
280
|
+
}
|
|
281
|
+
.malloy-render .dashboard-item-title,
|
|
282
|
+
.malloy-render .dashboard-dimension-name {
|
|
283
|
+
color: var(--malloy-render--label-color) !important;
|
|
284
|
+
}
|
|
285
|
+
.malloy-render .dashboard-item-value,
|
|
286
|
+
.malloy-render .dashboard-item-value-measure,
|
|
287
|
+
.malloy-render .dashboard-dimension-value {
|
|
288
|
+
color: var(--malloy-render--value-color) !important;
|
|
289
|
+
}
|
|
290
|
+
.malloy-render .malloy-table,
|
|
291
|
+
.malloy-render .malloy-list {
|
|
292
|
+
color: var(--malloy-render--table-body-color) !important;
|
|
293
|
+
}
|
|
294
|
+
.malloy-render .column-cell.th,
|
|
295
|
+
.malloy-render .cell-content.header {
|
|
296
|
+
color: var(--malloy-render--table-header-color) !important;
|
|
297
|
+
}
|
|
298
|
+
`,J1="publisher-malloy-renderer-overrides";function FW(){if(typeof document>"u"||document.getElementById(J1))return;const e=document.createElement("style");e.id=J1,e.textContent=NW,document.head.appendChild(e)}function LW({result:e,height:t,onDrill:n,onSizeChange:r}){const o=W.useRef(null),i=W.useRef(!1),s=W.useRef(null),a=W.useRef(0),{theme:l,layers:u,mode:d}=De.usePublisherTheme();return W.useEffect(()=>()=>{a.current+=1,s.current?.viz.remove(),s.current=null},[]),W.useLayoutEffect(()=>{if(!o.current||!e)return;FW();const f=o.current,h=a.current+=1;let p=!1;const m=()=>!p&&h===a.current;let b,y,x=null,C=null,v=null;i.current=!1;const S=I=>{if(i.current||p||!I.firstElementChild)return;const N=I.firstElementChild.firstElementChild;if(!N)return;const O=N.firstElementChild;let F=N.scrollHeight||N.offsetHeight||0;O&&N.classList.contains("malloy-dashboard")&&(F=O.scrollHeight||O.offsetHeight||0),F>0&&(i.current=!0,r&&r(F))};return(async()=>{let I;try{I=JSON.parse(e)}catch(H){console.error("Error parsing visualization result:",H);return}const T=await PW(I),N=T?De.resolveTheme([...u,T],d):l;if(!m())return;try{y=await MW(N,n)}catch(H){console.error("Failed to create renderer:",H);return}if(!m()){y.remove(),y=void 0;return}const O=s.current;b=document.createElement("div"),b.style.width="100%",b.style.height="100%",RW(b,N),O&&(f.style.position="relative",b.style.position="absolute",b.style.inset="0",b.style.visibility="hidden"),f.appendChild(b);const F=b;x=new MutationObserver(()=>{C&&clearTimeout(C),C=setTimeout(()=>{S(F),x?.disconnect()},100)}),x.observe(b,{childList:!0,subtree:!0,attributes:!0});const B=y;let j=!1;const D=()=>{j||!m()||(j=!0,v&&(clearTimeout(v),v=null),O&&(O.viz.remove(),O.node.parentNode===f&&f.removeChild(O.node)),F.style.position="",F.style.inset="",F.style.visibility="",f.style.position="",s.current={viz:B,node:F},S(F))};try{y.setResult(I),y.render(b),y.onReady(D),v=setTimeout(D,1e4)}catch(H){console.error("Error rendering visualization:",H),x?.disconnect(),y.remove(),y=void 0,F.parentNode===f&&f.removeChild(F)}})(),()=>{p=!0,x?.disconnect(),C&&clearTimeout(C),v&&clearTimeout(v),b&&s.current?.node!==b&&(y?.remove(),b.parentNode===f&&f.removeChild(b),f.style.position="")}},[e,n,r,l,u,d]),c.jsx("div",{ref:o,style:{width:"100%",height:t?`${t}px`:"400px"}})}function EE(e){return typeof window>"u"?c.jsx(w.Box,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading..."}):c.jsx(W.Suspense,{fallback:c.jsx(w.Box,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading visualization..."}),children:c.jsx(LW,{...e})})}const _W=Object.freeze(Object.defineProperty({__proto__:null,default:EE},Symbol.toStringTag,{value:"Module"}));function vE(e){return e.replace(/'/g,"\\'").replace(/\\/g,"\\\\")}function Wr(e,t=!1){return e==null?"null":t?e instanceof Date?`@${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:`@${e}`:typeof e=="string"?`'${vE(e)}'`:typeof e=="number"?String(e):typeof e=="boolean"?e?"true":"false":String(e)}function BW(e){const{dimensionName:t,matchType:n,value:r,value2:o}=e,i=`\`${t}\``,s=r instanceof Date;switch(n){case"Equals":case"Semantic Search":return Array.isArray(r)&&r.length>0?`(${r.map(l=>`${i} = ${Wr(l,s)}`).join(" or ")})`:Array.isArray(r)?"":`${i} = ${Wr(r,s)}`;case"Contains":return typeof r=="string"?`${i} ~ f'%${vE(r)}%'`:Array.isArray(r)?"":`${i} = ${Wr(r)}`;case"After":return Array.isArray(r)?"":`${i} > ${Wr(r,s)}`;case"Before":return Array.isArray(r)?"":`${i} < ${Wr(r,s)}`;case"Greater Than":return Array.isArray(r)?"":`${i} > ${Wr(r)}`;case"Less Than":return Array.isArray(r)?"":`${i} < ${Wr(r)}`;case"Between":return Array.isArray(r)?"":o!==void 0?`${i} >= ${Wr(r,s)} and ${i} <= ${Wr(o,s)}`:`${i} >= ${Wr(r,s)}`;default:return""}}function jW(e){if(e.length===0)return"";const t=e.map(n=>BW(n)).filter(n=>n.length>0);return t.length===0?"":t.join(" and ")}function $W(e,t,n,r=1e3){const o=jW(t),s=n&&n.length>0?`group_by: ${n.map(a=>`\`${a}\``).join(", ")}`:"select: *";return o?`
|
|
299
|
+
run: ${e} -> {
|
|
300
|
+
where: ${o}
|
|
301
|
+
${s}
|
|
302
|
+
limit: ${r}
|
|
303
|
+
}
|
|
304
|
+
`:`
|
|
305
|
+
run: ${e} -> {
|
|
306
|
+
${s}
|
|
307
|
+
limit: ${r}
|
|
308
|
+
}
|
|
309
|
+
`}function TE(e){const{environment:t,package:n,model:r,source:o,filterSelections:i,fields:s,limit:a=1e3}=e,[l,u]=W.useState(null),d=W.useMemo(()=>$W(o,i,s,a),[o,i,s,a]),f=W.useMemo(()=>Cl({environmentName:t,packageName:n,modelPath:r}),[t,n,r]),h=i.length>0,p=W.useCallback(()=>{if(!h){u(null);return}const m=dh({resourceUri:f,query:d});u(m)},[h,f,d]);return{embeddedQueryResult:l,queryString:d,resourceUri:f,executeQuery:p,canExecute:h}}function HW(e,t=5e3){const n=e.dimensionSpecs[0]?.source??"",r=e.dimensionSpecs[0]?.model??"",{filterStates:o,updateFilter:i,clearAllFilters:s,getActiveFilters:a}=ch({dimensionSpecs:e.dimensionSpecs}),l=W.useMemo(()=>a(),[o,a]),{data:u,noRowsMatchedFilter:d,isLoading:f,isError:h,error:p,refetch:m}=uh({environment:e.environment,package:e.package,indexLimit:e.indexLimit,dimensionSpecs:e.dimensionSpecs,versionId:e.versionId,activeFilters:l}),b=f&&!u,{embeddedQueryResult:y,queryString:x,executeQuery:C,canExecute:v}=TE({environment:e.environment,package:e.package,model:r,source:n,filterSelections:l,limit:t,fields:e.selectFields});return{filterStates:o,updateFilter:i,clearAllFilters:s,activeFilters:l,data:u,noRowsMatchedFilter:d,isLoading:f,isInitialLoading:b,isError:h,error:p,refetch:m,embeddedQueryResult:y,queryString:x,executeQuery:C,canExecute:v}}function zW({modelPath:e,query:t,sourceName:n,queryName:r,enabled:o=!0,resourceUri:i}){const{environmentName:s,packageName:a,versionId:l}=Ht(i),{apiClients:u}=De.useServer(),{data:d,isSuccess:f,isError:h,error:p,isLoading:m}=Xt({queryKey:["rawQueryData",s,a,e,l,t,n,r],queryFn:()=>u.models.executeQueryModel(s,a,e,{query:t,sourceName:n,queryName:r,versionId:l}),enabled:o});return{data:f&&d?.data?.result?(()=>{try{return JSON.parse(d.data.result).data?.array_value||[]}catch(y){return console.error("Failed to parse query result:",y),[]}})():[],isSuccess:f,isError:h,error:p,isLoading:m}}exports.AnalyzePackageButton=gN;exports.BrowserWorkbookStorage=mN;exports.ConnectionExplorer=L2;exports.DOC_LINKS=ss;exports.DimensionFilter=RC;exports.EmbeddedQueryResult=KU;exports.Environment=t7;exports.EnvironmentMaterializations=T2;exports.Home=PU;exports.Loading=Sn;exports.Materializations=pL;exports.Model=LU;exports.ModelExplorer=ah;exports.ModelExplorerDialog=lh;exports.Models=IW;exports.Notebook=GC;exports.Package=iV;exports.Packages=_2;exports.PageViewer=OW;exports.QueryResult=KC;exports.RenderedResult=EE;exports.ResultContainer=Os;exports.SourceExplorerComponent=qx;exports.SourcesExplorer=kp;exports.Workbook=pN;exports.WorkbookList=Qx;exports.WorkbookManager=ns;exports.WorkbookStorageProvider=cN;exports.buildMalloyExplicitTheme=bE;exports.buildTableCssVars=yE;exports.buildVegaThemeOverride=xE;exports.ccount=cf;exports.createEmbeddedQueryResult=dh;exports.encodeResourceUri=Cl;exports.extractDimensionSpecs=_C;exports.extractSourceFromQuery=hU;exports.find=hl;exports.generateFilterClause=pU;exports.getDimensionKey=xo;exports.getJoinedSources=dU;exports.html=vs;exports.htmlVoidElements=jy;exports.injectWhereClause=mU;exports.makeDimensionKey=zC;exports.parseAllSourceInfos=LC;exports.parseDimensionFilterAnnotation=FC;exports.parseNotebookFilterAnnotation=NC;exports.parseResourceUri=Ht;exports.readChartAnnotations=CE;exports.stringify=cc;exports.stringify$1=dc;exports.svg=_o;exports.useDimensionFilters=ch;exports.useDimensionFiltersFromSpec=HW;exports.useDimensionFiltersQuery=TE;exports.useDimensionalFilterRangeData=uh;exports.useGivensForm=WC;exports.useModelData=sh;exports.useModelGivens=qC;exports.useRawQueryData=zW;exports.useRouterClickHandler=Gx;exports.whitespace=Gf;exports.zwitch=yc;
|