corekit-ui 0.1.29 → 0.1.32

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.
@@ -1,663 +1,10 @@
1
- (function(Q,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],a):(Q=typeof globalThis<"u"?globalThis:Q||self,a(Q.CoreKitUI={},Q.jsxRuntime,Q.React,Q.ReactDOM))})(this,(function(Q,a,v,Dn){"use strict";function Vs(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const N=Vs(v),dr=Vs(Dn);function js(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=js(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function W(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=js(e))&&(o&&(o+=" "),o+=t);return o}const qs=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Hs=W,wc=(e,t)=>n=>{var o;if(t?.variants==null)return Hs(e,n?.class,n?.className);const{variants:r,defaultVariants:s}=t,i=Object.keys(r).map(d=>{const _=n?.[d],g=s?.[d];if(_===null)return null;const f=qs(_)||qs(g);return r[d][f]}),l=n&&Object.entries(n).reduce((d,_)=>{let[g,f]=_;return f===void 0||(d[g]=f),d},{}),c=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((d,_)=>{let{class:g,className:f,...u}=_;return Object.entries(u).every(p=>{let[h,m]=p;return Array.isArray(m)?m.includes({...s,...l}[h]):{...s,...l}[h]===m})?[...d,g,f]:d},[]);return Hs(e,i,c,n?.class,n?.className)},Ie={boton:"_boton_18943_1",animated:"_animated_18943_59",disabled:"_disabled_18943_59",loading:"_loading_18943_59",content:"_content_18943_67",spinner:"_spinner_18943_69",start_content:"_start_content_18943_71",end_content:"_end_content_18943_73",content_item:"_content_item_18943_101",spinner_icon:"_spinner_icon_18943_123",ripple:"_ripple_18943_159",solid:"_solid_18943_211",bordered:"_bordered_18943_231",ghost:"_ghost_18943_251",light:"_light_18943_275",faded:"_faded_18943_295",shadow:"_shadow_18943_315",only_loading:"_only_loading_18943_367",sm:"_sm_18943_385",md:"_md_18943_401",lg:"_lg_18943_417",full_width:"_full_width_18943_433",icon_only:"_icon_only_18943_441",radius_none:"_radius_none_18943_483",radius_sm:"_radius_sm_18943_551",radius_md:"_radius_md_18943_559",radius_lg:"_radius_lg_18943_567",radius_full:"_radius_full_18943_575",primary:"_primary_18943_583",secondary:"_secondary_18943_593",success:"_success_18943_603",warning:"_warning_18943_613",danger:"_danger_18943_623",default:"_default_18943_633"},yc=wc(Ie.boton,{variants:{variant:{solid:Ie.solid,bordered:Ie.bordered,ghost:Ie.ghost,light:Ie.light,faded:Ie.faded,shadow:Ie.shadow},color:{default:Ie.default,primary:Ie.primary,secondary:Ie.secondary,success:Ie.success,warning:Ie.warning,danger:Ie.danger},size:{sm:Ie.sm,md:Ie.md,lg:Ie.lg},radius:{none:Ie.radius_none,sm:Ie.radius_sm,md:Ie.radius_md,lg:Ie.radius_lg,full:Ie.radius_full},fullWidth:{true:Ie.full_width},isIconOnly:{true:Ie.icon_only},isLoading:{true:Ie.loading},onlyLoading:{true:Ie.only_loading},isDisabled:{true:Ie.disabled},disableAnimation:{false:Ie.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md",disableAnimation:!0}}),st=v.forwardRef(({variant:e="solid",color:t="default",size:n="md",radius:o="md",fullWidth:r=!1,isLoading:s=!1,onlyLoading:i=!1,isDisabled:l=!1,isIconOnly:c=!1,disableRipple:d=!1,disableAnimation:_=!0,customColor:g,startContent:f,endContent:u,spinner:p,spinnerPlacement:h="end",permisos:m,permiso:y,children:w,className:C,onClick:k,style:A,type:T="button","aria-label":M,...P},L)=>{const E=y&&m?!m.includes(y):!1,B=l||s||E,V=D=>{if(B){D.preventDefault();return}if(k?.(D),d||B||!(D.currentTarget instanceof HTMLElement))return;const x=D.currentTarget,I=document.createElement("span"),F=x.getBoundingClientRect(),j=Math.max(F.width,F.height);I.className=Ie.ripple,I.style.width=`${j}px`,I.style.height=`${j}px`,I.style.left=`${D.clientX-F.left}px`,I.style.top=`${D.clientY-F.top}px`,I.addEventListener("animationend",()=>I.remove(),{once:!0}),x.appendChild(I)},$=g?{"--btn-color":g,"--btn-text-color":g,...A}:A,b=yc({variant:e,color:g?void 0:t,size:n,radius:o,fullWidth:r,isIconOnly:c,isLoading:s,onlyLoading:i,isDisabled:B,disableAnimation:_}),S=s&&a.jsx("span",{className:Ie.spinner,"aria-hidden":i?void 0:"true",children:p||a.jsx("span",{className:Ie.spinner_icon})}),O=i&&!M?"Cargando":M;return a.jsxs("button",{...P,ref:L,type:T,"aria-label":O,"aria-busy":s,className:W(b,C),disabled:B,onClick:V,style:$,children:[h==="start"&&S,f&&!i&&a.jsx("span",{className:W(Ie.start_content,Ie.content_item),children:f}),w&&!i&&a.jsx("span",{className:Ie.content,children:w}),u&&!i&&a.jsx("span",{className:W(Ie.end_content,Ie.content_item),children:u}),h==="end"&&S]})});st.displayName="Boton";/**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */const Cc=()=>{};/**
17
- * @license
18
- * Copyright 2017 Google LLC
19
- *
20
- * Licensed under the Apache License, Version 2.0 (the "License");
21
- * you may not use this file except in compliance with the License.
22
- * You may obtain a copy of the License at
23
- *
24
- * http://www.apache.org/licenses/LICENSE-2.0
25
- *
26
- * Unless required by applicable law or agreed to in writing, software
27
- * distributed under the License is distributed on an "AS IS" BASIS,
28
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29
- * See the License for the specific language governing permissions and
30
- * limitations under the License.
31
- */const Rs=function(e){const t=[];let n=0;for(let o=0;o<e.length;o++){let r=e.charCodeAt(o);r<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=r&63|128):(r&64512)===55296&&o+1<e.length&&(e.charCodeAt(o+1)&64512)===56320?(r=65536+((r&1023)<<10)+(e.charCodeAt(++o)&1023),t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=r&63|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=r&63|128)}return t},xc=function(e){const t=[];let n=0,o=0;for(;n<e.length;){const r=e[n++];if(r<128)t[o++]=String.fromCharCode(r);else if(r>191&&r<224){const s=e[n++];t[o++]=String.fromCharCode((r&31)<<6|s&63)}else if(r>239&&r<365){const s=e[n++],i=e[n++],l=e[n++],c=((r&7)<<18|(s&63)<<12|(i&63)<<6|l&63)-65536;t[o++]=String.fromCharCode(55296+(c>>10)),t[o++]=String.fromCharCode(56320+(c&1023))}else{const s=e[n++],i=e[n++];t[o++]=String.fromCharCode((r&15)<<12|(s&63)<<6|i&63)}}return t.join("")},Us={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,o=[];for(let r=0;r<e.length;r+=3){const s=e[r],i=r+1<e.length,l=i?e[r+1]:0,c=r+2<e.length,d=c?e[r+2]:0,_=s>>2,g=(s&3)<<4|l>>4;let f=(l&15)<<2|d>>6,u=d&63;c||(u=64,i||(f=64)),o.push(n[_],n[g],n[f],n[u])}return o.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(Rs(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):xc(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,o=[];for(let r=0;r<e.length;){const s=n[e.charAt(r++)],l=r<e.length?n[e.charAt(r)]:0;++r;const d=r<e.length?n[e.charAt(r)]:64;++r;const g=r<e.length?n[e.charAt(r)]:64;if(++r,s==null||l==null||d==null||g==null)throw new Sc;const f=s<<2|l>>4;if(o.push(f),d!==64){const u=l<<4&240|d>>2;if(o.push(u),g!==64){const p=d<<6&192|g;o.push(p)}}}return o},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class Sc extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const $c=function(e){const t=Rs(e);return Us.encodeByteArray(t,!0)},io=function(e){return $c(e).replace(/\./g,"")},kc=function(e){try{return Us.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
32
- * @license
33
- * Copyright 2022 Google LLC
34
- *
35
- * Licensed under the Apache License, Version 2.0 (the "License");
36
- * you may not use this file except in compliance with the License.
37
- * You may obtain a copy of the License at
38
- *
39
- * http://www.apache.org/licenses/LICENSE-2.0
40
- *
41
- * Unless required by applicable law or agreed to in writing, software
42
- * distributed under the License is distributed on an "AS IS" BASIS,
43
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44
- * See the License for the specific language governing permissions and
45
- * limitations under the License.
46
- */function Ec(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
47
- * @license
48
- * Copyright 2022 Google LLC
49
- *
50
- * Licensed under the Apache License, Version 2.0 (the "License");
51
- * you may not use this file except in compliance with the License.
52
- * You may obtain a copy of the License at
53
- *
54
- * http://www.apache.org/licenses/LICENSE-2.0
55
- *
56
- * Unless required by applicable law or agreed to in writing, software
57
- * distributed under the License is distributed on an "AS IS" BASIS,
58
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
59
- * See the License for the specific language governing permissions and
60
- * limitations under the License.
61
- */const Ic=()=>Ec().__FIREBASE_DEFAULTS__,Nc=()=>{if(typeof process>"u"||typeof process.env>"u")return;const e=process.env.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},Mc=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&kc(e[1]);return t&&JSON.parse(t)},Ws=()=>{try{return Cc()||Ic()||Nc()||Mc()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},Ac=e=>Ws()?.emulatorHosts?.[e],Dc=e=>{const t=Ac(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const o=parseInt(t.substring(n+1),10);return t[0]==="["?[t.substring(1,n-1),o]:[t.substring(0,n),o]},Gs=()=>Ws()?.config;/**
62
- * @license
63
- * Copyright 2017 Google LLC
64
- *
65
- * Licensed under the Apache License, Version 2.0 (the "License");
66
- * you may not use this file except in compliance with the License.
67
- * You may obtain a copy of the License at
68
- *
69
- * http://www.apache.org/licenses/LICENSE-2.0
70
- *
71
- * Unless required by applicable law or agreed to in writing, software
72
- * distributed under the License is distributed on an "AS IS" BASIS,
73
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
74
- * See the License for the specific language governing permissions and
75
- * limitations under the License.
76
- */class Tc{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}wrapCallback(t){return(n,o)=>{n?this.reject(n):this.resolve(o),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(n):t(n,o))}}}/**
77
- * @license
78
- * Copyright 2025 Google LLC
79
- *
80
- * Licensed under the Apache License, Version 2.0 (the "License");
81
- * you may not use this file except in compliance with the License.
82
- * You may obtain a copy of the License at
83
- *
84
- * http://www.apache.org/licenses/LICENSE-2.0
85
- *
86
- * Unless required by applicable law or agreed to in writing, software
87
- * distributed under the License is distributed on an "AS IS" BASIS,
88
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
89
- * See the License for the specific language governing permissions and
90
- * limitations under the License.
91
- */function ur(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function Fc(e){return(await fetch(e,{credentials:"include"})).ok}/**
92
- * @license
93
- * Copyright 2021 Google LLC
94
- *
95
- * Licensed under the Apache License, Version 2.0 (the "License");
96
- * you may not use this file except in compliance with the License.
97
- * You may obtain a copy of the License at
98
- *
99
- * http://www.apache.org/licenses/LICENSE-2.0
100
- *
101
- * Unless required by applicable law or agreed to in writing, software
102
- * distributed under the License is distributed on an "AS IS" BASIS,
103
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
104
- * See the License for the specific language governing permissions and
105
- * limitations under the License.
106
- */function Pc(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},o=t||"demo-project",r=e.iat||0,s=e.sub||e.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const i={iss:`https://securetoken.google.com/${o}`,aud:o,iat:r,exp:r+3600,auth_time:r,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}},...e};return[io(JSON.stringify(n)),io(JSON.stringify(i)),""].join(".")}const Tn={};function Lc(){const e={prod:[],emulator:[]};for(const t of Object.keys(Tn))Tn[t]?e.emulator.push(t):e.prod.push(t);return e}function Oc(e){let t=document.getElementById(e),n=!1;return t||(t=document.createElement("div"),t.setAttribute("id",e),n=!0),{created:n,element:t}}let Ks=!1;function zc(e,t){if(typeof window>"u"||typeof document>"u"||!ur(window.location.host)||Tn[e]===t||Tn[e]||Ks)return;Tn[e]=t;function n(f){return`__firebase__banner__${f}`}const o="__firebase__banner",s=Lc().prod.length>0;function i(){const f=document.getElementById(o);f&&f.remove()}function l(f){f.style.display="flex",f.style.background="#7faaf0",f.style.position="fixed",f.style.bottom="5px",f.style.left="5px",f.style.padding=".5em",f.style.borderRadius="5px",f.style.alignItems="center"}function c(f,u){f.setAttribute("width","24"),f.setAttribute("id",u),f.setAttribute("height","24"),f.setAttribute("viewBox","0 0 24 24"),f.setAttribute("fill","none"),f.style.marginLeft="-6px"}function d(){const f=document.createElement("span");return f.style.cursor="pointer",f.style.marginLeft="16px",f.style.fontSize="24px",f.innerHTML=" &times;",f.onclick=()=>{Ks=!0,i()},f}function _(f,u){f.setAttribute("id",u),f.innerText="Learn more",f.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",f.setAttribute("target","__blank"),f.style.paddingLeft="5px",f.style.textDecoration="underline"}function g(){const f=Oc(o),u=n("text"),p=document.getElementById(u)||document.createElement("span"),h=n("learnmore"),m=document.getElementById(h)||document.createElement("a"),y=n("preprendIcon"),w=document.getElementById(y)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(f.created){const C=f.element;l(C),_(m,h);const k=d();c(w,y),C.append(w,p,m,k),document.body.appendChild(C)}s?(p.innerText="Preview backend disconnected.",w.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
107
- <path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
108
- </g>
109
- <defs>
110
- <clipPath id="clip0_6013_33858">
111
- <rect width="24" height="24" fill="white"/>
112
- </clipPath>
113
- </defs>`):(w.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
114
- <path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
115
- </g>
116
- <defs>
117
- <clipPath id="clip0_6083_34804">
118
- <rect width="24" height="24" fill="white"/>
119
- </clipPath>
120
- </defs>`,p.innerText="Preview backend running in this workspace."),p.setAttribute("id",u)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",g):g()}function Bc(){try{return typeof indexedDB=="object"}catch{return!1}}function Vc(){return new Promise((e,t)=>{try{let n=!0;const o="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(o);r.onsuccess=()=>{r.result.close(),n||self.indexedDB.deleteDatabase(o),e(!0)},r.onupgradeneeded=()=>{n=!1},r.onerror=()=>{t(r.error?.message||"")}}catch(n){t(n)}})}/**
121
- * @license
122
- * Copyright 2017 Google LLC
123
- *
124
- * Licensed under the Apache License, Version 2.0 (the "License");
125
- * you may not use this file except in compliance with the License.
126
- * You may obtain a copy of the License at
127
- *
128
- * http://www.apache.org/licenses/LICENSE-2.0
129
- *
130
- * Unless required by applicable law or agreed to in writing, software
131
- * distributed under the License is distributed on an "AS IS" BASIS,
132
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
133
- * See the License for the specific language governing permissions and
134
- * limitations under the License.
135
- */const jc="FirebaseError";class vn extends Error{constructor(t,n,o){super(n),this.code=t,this.customData=o,this.name=jc,Object.setPrototypeOf(this,vn.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Xs.prototype.create)}}class Xs{constructor(t,n,o){this.service=t,this.serviceName=n,this.errors=o}create(t,...n){const o=n[0]||{},r=`${this.service}/${t}`,s=this.errors[t],i=s?qc(s,o):"Error",l=`${this.serviceName}: ${i} (${r}).`;return new vn(r,l,o)}}function qc(e,t){return e.replace(Hc,(n,o)=>{const r=t[o];return r!=null?String(r):`<${o}?>`})}const Hc=/\{\$([^}]+)}/g;function fr(e,t){if(e===t)return!0;const n=Object.keys(e),o=Object.keys(t);for(const r of n){if(!o.includes(r))return!1;const s=e[r],i=t[r];if(Ys(s)&&Ys(i)){if(!fr(s,i))return!1}else if(s!==i)return!1}for(const r of o)if(!n.includes(r))return!1;return!0}function Ys(e){return e!==null&&typeof e=="object"}/**
136
- * @license
137
- * Copyright 2021 Google LLC
138
- *
139
- * Licensed under the Apache License, Version 2.0 (the "License");
140
- * you may not use this file except in compliance with the License.
141
- * You may obtain a copy of the License at
142
- *
143
- * http://www.apache.org/licenses/LICENSE-2.0
144
- *
145
- * Unless required by applicable law or agreed to in writing, software
146
- * distributed under the License is distributed on an "AS IS" BASIS,
147
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
148
- * See the License for the specific language governing permissions and
149
- * limitations under the License.
150
- */function ao(e){return e&&e._delegate?e._delegate:e}class Fn{constructor(t,n,o){this.name=t,this.instanceFactory=n,this.type=o,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/**
151
- * @license
152
- * Copyright 2019 Google LLC
153
- *
154
- * Licensed under the Apache License, Version 2.0 (the "License");
155
- * you may not use this file except in compliance with the License.
156
- * You may obtain a copy of the License at
157
- *
158
- * http://www.apache.org/licenses/LICENSE-2.0
159
- *
160
- * Unless required by applicable law or agreed to in writing, software
161
- * distributed under the License is distributed on an "AS IS" BASIS,
162
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
163
- * See the License for the specific language governing permissions and
164
- * limitations under the License.
165
- */const rn="[DEFAULT]";/**
166
- * @license
167
- * Copyright 2019 Google LLC
168
- *
169
- * Licensed under the Apache License, Version 2.0 (the "License");
170
- * you may not use this file except in compliance with the License.
171
- * You may obtain a copy of the License at
172
- *
173
- * http://www.apache.org/licenses/LICENSE-2.0
174
- *
175
- * Unless required by applicable law or agreed to in writing, software
176
- * distributed under the License is distributed on an "AS IS" BASIS,
177
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
178
- * See the License for the specific language governing permissions and
179
- * limitations under the License.
180
- */class Rc{constructor(t,n){this.name=t,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const n=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(n)){const o=new Tc;if(this.instancesDeferred.set(n,o),this.isInitialized(n)||this.shouldAutoInitialize())try{const r=this.getOrInitializeService({instanceIdentifier:n});r&&o.resolve(r)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(t){const n=this.normalizeInstanceIdentifier(t?.identifier),o=t?.optional??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(r){if(o)return null;throw r}else{if(o)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(Wc(t))try{this.getOrInitializeService({instanceIdentifier:rn})}catch{}for(const[n,o]of this.instancesDeferred.entries()){const r=this.normalizeInstanceIdentifier(n);try{const s=this.getOrInitializeService({instanceIdentifier:r});o.resolve(s)}catch{}}}}clearInstance(t=rn){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...t.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(t=rn){return this.instances.has(t)}getOptions(t=rn){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:n={}}=t,o=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(o))throw Error(`${this.name}(${o}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:o,options:n});for(const[s,i]of this.instancesDeferred.entries()){const l=this.normalizeInstanceIdentifier(s);o===l&&i.resolve(r)}return r}onInit(t,n){const o=this.normalizeInstanceIdentifier(n),r=this.onInitCallbacks.get(o)??new Set;r.add(t),this.onInitCallbacks.set(o,r);const s=this.instances.get(o);return s&&t(s,o),()=>{r.delete(t)}}invokeOnInitCallbacks(t,n){const o=this.onInitCallbacks.get(n);if(o)for(const r of o)try{r(t,n)}catch{}}getOrInitializeService({instanceIdentifier:t,options:n={}}){let o=this.instances.get(t);if(!o&&this.component&&(o=this.component.instanceFactory(this.container,{instanceIdentifier:Uc(t),options:n}),this.instances.set(t,o),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(o,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,o)}catch{}return o||null}normalizeInstanceIdentifier(t=rn){return this.component?this.component.multipleInstances?t:rn:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Uc(e){return e===rn?void 0:e}function Wc(e){return e.instantiationMode==="EAGER"}/**
181
- * @license
182
- * Copyright 2019 Google LLC
183
- *
184
- * Licensed under the Apache License, Version 2.0 (the "License");
185
- * you may not use this file except in compliance with the License.
186
- * You may obtain a copy of the License at
187
- *
188
- * http://www.apache.org/licenses/LICENSE-2.0
189
- *
190
- * Unless required by applicable law or agreed to in writing, software
191
- * distributed under the License is distributed on an "AS IS" BASIS,
192
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
193
- * See the License for the specific language governing permissions and
194
- * limitations under the License.
195
- */class Gc{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const n=this.getProvider(t.name);if(n.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);n.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const n=new Rc(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/**
196
- * @license
197
- * Copyright 2017 Google LLC
198
- *
199
- * Licensed under the Apache License, Version 2.0 (the "License");
200
- * you may not use this file except in compliance with the License.
201
- * You may obtain a copy of the License at
202
- *
203
- * http://www.apache.org/licenses/LICENSE-2.0
204
- *
205
- * Unless required by applicable law or agreed to in writing, software
206
- * distributed under the License is distributed on an "AS IS" BASIS,
207
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
208
- * See the License for the specific language governing permissions and
209
- * limitations under the License.
210
- */var Be;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(Be||(Be={}));const Kc={debug:Be.DEBUG,verbose:Be.VERBOSE,info:Be.INFO,warn:Be.WARN,error:Be.ERROR,silent:Be.SILENT},Xc=Be.INFO,Yc={[Be.DEBUG]:"log",[Be.VERBOSE]:"log",[Be.INFO]:"info",[Be.WARN]:"warn",[Be.ERROR]:"error"},Zc=(e,t,...n)=>{if(t<e.logLevel)return;const o=new Date().toISOString(),r=Yc[t];if(r)console[r](`[${o}] ${e.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class Jc{constructor(t){this.name=t,this._logLevel=Xc,this._logHandler=Zc,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in Be))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?Kc[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,Be.DEBUG,...t),this._logHandler(this,Be.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,Be.VERBOSE,...t),this._logHandler(this,Be.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,Be.INFO,...t),this._logHandler(this,Be.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,Be.WARN,...t),this._logHandler(this,Be.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,Be.ERROR,...t),this._logHandler(this,Be.ERROR,...t)}}const Qc=(e,t)=>t.some(n=>e instanceof n);let Zs,Js;function ed(){return Zs||(Zs=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function td(){return Js||(Js=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Qs=new WeakMap,_r=new WeakMap,ei=new WeakMap,gr=new WeakMap,hr=new WeakMap;function nd(e){const t=new Promise((n,o)=>{const r=()=>{e.removeEventListener("success",s),e.removeEventListener("error",i)},s=()=>{n(Wt(e.result)),r()},i=()=>{o(e.error),r()};e.addEventListener("success",s),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&Qs.set(n,e)}).catch(()=>{}),hr.set(t,e),t}function od(e){if(_r.has(e))return;const t=new Promise((n,o)=>{const r=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",i),e.removeEventListener("abort",i)},s=()=>{n(),r()},i=()=>{o(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",s),e.addEventListener("error",i),e.addEventListener("abort",i)});_r.set(e,t)}let pr={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return _r.get(e);if(t==="objectStoreNames")return e.objectStoreNames||ei.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Wt(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function rd(e){pr=e(pr)}function sd(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const o=e.call(mr(this),t,...n);return ei.set(o,t.sort?t.sort():[t]),Wt(o)}:td().includes(e)?function(...t){return e.apply(mr(this),t),Wt(Qs.get(this))}:function(...t){return Wt(e.apply(mr(this),t))}}function id(e){return typeof e=="function"?sd(e):(e instanceof IDBTransaction&&od(e),Qc(e,ed())?new Proxy(e,pr):e)}function Wt(e){if(e instanceof IDBRequest)return nd(e);if(gr.has(e))return gr.get(e);const t=id(e);return t!==e&&(gr.set(e,t),hr.set(t,e)),t}const mr=e=>hr.get(e);function ad(e,t,{blocked:n,upgrade:o,blocking:r,terminated:s}={}){const i=indexedDB.open(e,t),l=Wt(i);return o&&i.addEventListener("upgradeneeded",c=>{o(Wt(i.result),c.oldVersion,c.newVersion,Wt(i.transaction),c)}),n&&i.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),l.then(c=>{s&&c.addEventListener("close",()=>s()),r&&c.addEventListener("versionchange",d=>r(d.oldVersion,d.newVersion,d))}).catch(()=>{}),l}const ld=["get","getKey","getAll","getAllKeys","count"],cd=["put","add","delete","clear"],vr=new Map;function ti(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(vr.get(t))return vr.get(t);const n=t.replace(/FromIndex$/,""),o=t!==n,r=cd.includes(n);if(!(n in(o?IDBIndex:IDBObjectStore).prototype)||!(r||ld.includes(n)))return;const s=async function(i,...l){const c=this.transaction(i,r?"readwrite":"readonly");let d=c.store;return o&&(d=d.index(l.shift())),(await Promise.all([d[n](...l),r&&c.done]))[0]};return vr.set(t,s),s}rd(e=>({...e,get:(t,n,o)=>ti(t,n)||e.get(t,n,o),has:(t,n)=>!!ti(t,n)||e.has(t,n)}));/**
211
- * @license
212
- * Copyright 2019 Google LLC
213
- *
214
- * Licensed under the Apache License, Version 2.0 (the "License");
215
- * you may not use this file except in compliance with the License.
216
- * You may obtain a copy of the License at
217
- *
218
- * http://www.apache.org/licenses/LICENSE-2.0
219
- *
220
- * Unless required by applicable law or agreed to in writing, software
221
- * distributed under the License is distributed on an "AS IS" BASIS,
222
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
223
- * See the License for the specific language governing permissions and
224
- * limitations under the License.
225
- */class dd{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(ud(n)){const o=n.getImmediate();return`${o.library}/${o.version}`}else return null}).filter(n=>n).join(" ")}}function ud(e){return e.getComponent()?.type==="VERSION"}const br="@firebase/app",ni="0.14.9";/**
226
- * @license
227
- * Copyright 2019 Google LLC
228
- *
229
- * Licensed under the Apache License, Version 2.0 (the "License");
230
- * you may not use this file except in compliance with the License.
231
- * You may obtain a copy of the License at
232
- *
233
- * http://www.apache.org/licenses/LICENSE-2.0
234
- *
235
- * Unless required by applicable law or agreed to in writing, software
236
- * distributed under the License is distributed on an "AS IS" BASIS,
237
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
238
- * See the License for the specific language governing permissions and
239
- * limitations under the License.
240
- */const Lt=new Jc("@firebase/app"),fd="@firebase/app-compat",_d="@firebase/analytics-compat",gd="@firebase/analytics",hd="@firebase/app-check-compat",pd="@firebase/app-check",md="@firebase/auth",vd="@firebase/auth-compat",bd="@firebase/database",wd="@firebase/data-connect",yd="@firebase/database-compat",Cd="@firebase/functions",xd="@firebase/functions-compat",Sd="@firebase/installations",$d="@firebase/installations-compat",kd="@firebase/messaging",Ed="@firebase/messaging-compat",Id="@firebase/performance",Nd="@firebase/performance-compat",Md="@firebase/remote-config",Ad="@firebase/remote-config-compat",Dd="@firebase/storage",Td="@firebase/storage-compat",Fd="@firebase/firestore",Pd="@firebase/ai",Ld="@firebase/firestore-compat",Od="firebase",zd="12.10.0";/**
241
- * @license
242
- * Copyright 2019 Google LLC
243
- *
244
- * Licensed under the Apache License, Version 2.0 (the "License");
245
- * you may not use this file except in compliance with the License.
246
- * You may obtain a copy of the License at
247
- *
248
- * http://www.apache.org/licenses/LICENSE-2.0
249
- *
250
- * Unless required by applicable law or agreed to in writing, software
251
- * distributed under the License is distributed on an "AS IS" BASIS,
252
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
253
- * See the License for the specific language governing permissions and
254
- * limitations under the License.
255
- */const wr="[DEFAULT]",Bd={[br]:"fire-core",[fd]:"fire-core-compat",[gd]:"fire-analytics",[_d]:"fire-analytics-compat",[pd]:"fire-app-check",[hd]:"fire-app-check-compat",[md]:"fire-auth",[vd]:"fire-auth-compat",[bd]:"fire-rtdb",[wd]:"fire-data-connect",[yd]:"fire-rtdb-compat",[Cd]:"fire-fn",[xd]:"fire-fn-compat",[Sd]:"fire-iid",[$d]:"fire-iid-compat",[kd]:"fire-fcm",[Ed]:"fire-fcm-compat",[Id]:"fire-perf",[Nd]:"fire-perf-compat",[Md]:"fire-rc",[Ad]:"fire-rc-compat",[Dd]:"fire-gcs",[Td]:"fire-gcs-compat",[Fd]:"fire-fst",[Ld]:"fire-fst-compat",[Pd]:"fire-vertex","fire-js":"fire-js",[Od]:"fire-js-all"};/**
256
- * @license
257
- * Copyright 2019 Google LLC
258
- *
259
- * Licensed under the Apache License, Version 2.0 (the "License");
260
- * you may not use this file except in compliance with the License.
261
- * You may obtain a copy of the License at
262
- *
263
- * http://www.apache.org/licenses/LICENSE-2.0
264
- *
265
- * Unless required by applicable law or agreed to in writing, software
266
- * distributed under the License is distributed on an "AS IS" BASIS,
267
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
268
- * See the License for the specific language governing permissions and
269
- * limitations under the License.
270
- */const lo=new Map,Vd=new Map,yr=new Map;function oi(e,t){try{e.container.addComponent(t)}catch(n){Lt.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function co(e){const t=e.name;if(yr.has(t))return Lt.debug(`There were multiple attempts to register component ${t}.`),!1;yr.set(t,e);for(const n of lo.values())oi(n,e);for(const n of Vd.values())oi(n,e);return!0}function jd(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function qd(e){return e==null?!1:e.settings!==void 0}/**
271
- * @license
272
- * Copyright 2019 Google LLC
273
- *
274
- * Licensed under the Apache License, Version 2.0 (the "License");
275
- * you may not use this file except in compliance with the License.
276
- * You may obtain a copy of the License at
277
- *
278
- * http://www.apache.org/licenses/LICENSE-2.0
279
- *
280
- * Unless required by applicable law or agreed to in writing, software
281
- * distributed under the License is distributed on an "AS IS" BASIS,
282
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
283
- * See the License for the specific language governing permissions and
284
- * limitations under the License.
285
- */const Hd={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Gt=new Xs("app","Firebase",Hd);/**
286
- * @license
287
- * Copyright 2019 Google LLC
288
- *
289
- * Licensed under the Apache License, Version 2.0 (the "License");
290
- * you may not use this file except in compliance with the License.
291
- * You may obtain a copy of the License at
292
- *
293
- * http://www.apache.org/licenses/LICENSE-2.0
294
- *
295
- * Unless required by applicable law or agreed to in writing, software
296
- * distributed under the License is distributed on an "AS IS" BASIS,
297
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
298
- * See the License for the specific language governing permissions and
299
- * limitations under the License.
300
- */class Rd{constructor(t,n,o){this._isDeleted=!1,this._options={...t},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=o,this.container.addComponent(new Fn("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw Gt.create("app-deleted",{appName:this._name})}}/**
301
- * @license
302
- * Copyright 2019 Google LLC
303
- *
304
- * Licensed under the Apache License, Version 2.0 (the "License");
305
- * you may not use this file except in compliance with the License.
306
- * You may obtain a copy of the License at
307
- *
308
- * http://www.apache.org/licenses/LICENSE-2.0
309
- *
310
- * Unless required by applicable law or agreed to in writing, software
311
- * distributed under the License is distributed on an "AS IS" BASIS,
312
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
313
- * See the License for the specific language governing permissions and
314
- * limitations under the License.
315
- */const Ud=zd;function Wd(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const o={name:wr,automaticDataCollectionEnabled:!0,...t},r=o.name;if(typeof r!="string"||!r)throw Gt.create("bad-app-name",{appName:String(r)});if(n||(n=Gs()),!n)throw Gt.create("no-options");const s=lo.get(r);if(s){if(fr(n,s.options)&&fr(o,s.config))return s;throw Gt.create("duplicate-app",{appName:r})}const i=new Gc(r);for(const c of yr.values())i.addComponent(c);const l=new Rd(n,o,i);return lo.set(r,l),l}function Gd(e=wr){const t=lo.get(e);if(!t&&e===wr&&Gs())return Wd();if(!t)throw Gt.create("no-app",{appName:e});return t}function Pn(e,t,n){let o=Bd[e]??e;n&&(o+=`-${n}`);const r=o.match(/\s|\//),s=t.match(/\s|\//);if(r||s){const i=[`Unable to register library "${o}" with version "${t}":`];r&&i.push(`library name "${o}" contains illegal characters (whitespace or "/")`),r&&s&&i.push("and"),s&&i.push(`version name "${t}" contains illegal characters (whitespace or "/")`),Lt.warn(i.join(" "));return}co(new Fn(`${o}-version`,()=>({library:o,version:t}),"VERSION"))}/**
316
- * @license
317
- * Copyright 2021 Google LLC
318
- *
319
- * Licensed under the Apache License, Version 2.0 (the "License");
320
- * you may not use this file except in compliance with the License.
321
- * You may obtain a copy of the License at
322
- *
323
- * http://www.apache.org/licenses/LICENSE-2.0
324
- *
325
- * Unless required by applicable law or agreed to in writing, software
326
- * distributed under the License is distributed on an "AS IS" BASIS,
327
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
328
- * See the License for the specific language governing permissions and
329
- * limitations under the License.
330
- */const Kd="firebase-heartbeat-database",Xd=1,Ln="firebase-heartbeat-store";let Cr=null;function ri(){return Cr||(Cr=ad(Kd,Xd,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(Ln)}catch(n){console.warn(n)}}}}).catch(e=>{throw Gt.create("idb-open",{originalErrorMessage:e.message})})),Cr}async function Yd(e){try{const n=(await ri()).transaction(Ln),o=await n.objectStore(Ln).get(ii(e));return await n.done,o}catch(t){if(t instanceof vn)Lt.warn(t.message);else{const n=Gt.create("idb-get",{originalErrorMessage:t?.message});Lt.warn(n.message)}}}async function si(e,t){try{const o=(await ri()).transaction(Ln,"readwrite");await o.objectStore(Ln).put(t,ii(e)),await o.done}catch(n){if(n instanceof vn)Lt.warn(n.message);else{const o=Gt.create("idb-set",{originalErrorMessage:n?.message});Lt.warn(o.message)}}}function ii(e){return`${e.name}!${e.options.appId}`}/**
331
- * @license
332
- * Copyright 2021 Google LLC
333
- *
334
- * Licensed under the Apache License, Version 2.0 (the "License");
335
- * you may not use this file except in compliance with the License.
336
- * You may obtain a copy of the License at
337
- *
338
- * http://www.apache.org/licenses/LICENSE-2.0
339
- *
340
- * Unless required by applicable law or agreed to in writing, software
341
- * distributed under the License is distributed on an "AS IS" BASIS,
342
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
343
- * See the License for the specific language governing permissions and
344
- * limitations under the License.
345
- */const Zd=1024,Jd=30;class Qd{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new tu(n),this._heartbeatsCachePromise=this._storage.read().then(o=>(this._heartbeatsCache=o,o))}async triggerHeartbeat(){try{const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=ai();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(r=>r.date===o))return;if(this._heartbeatsCache.heartbeats.push({date:o,agent:n}),this._heartbeatsCache.heartbeats.length>Jd){const r=nu(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(r,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(t){Lt.warn(t)}}async getHeartbeatsHeader(){try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||this._heartbeatsCache.heartbeats.length===0)return"";const t=ai(),{heartbeatsToSend:n,unsentEntries:o}=eu(this._heartbeatsCache.heartbeats),r=io(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=t,o.length>0?(this._heartbeatsCache.heartbeats=o,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),r}catch(t){return Lt.warn(t),""}}}function ai(){return new Date().toISOString().substring(0,10)}function eu(e,t=Zd){const n=[];let o=e.slice();for(const r of e){const s=n.find(i=>i.agent===r.agent);if(s){if(s.dates.push(r.date),li(n)>t){s.dates.pop();break}}else if(n.push({agent:r.agent,dates:[r.date]}),li(n)>t){n.pop();break}o=o.slice(1)}return{heartbeatsToSend:n,unsentEntries:o}}class tu{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Bc()?Vc().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await Yd(this.app);return n?.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){if(await this._canUseIndexedDBPromise){const o=await this.read();return si(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??o.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){if(await this._canUseIndexedDBPromise){const o=await this.read();return si(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??o.lastSentHeartbeatDate,heartbeats:[...o.heartbeats,...t.heartbeats]})}else return}}function li(e){return io(JSON.stringify({version:2,heartbeats:e})).length}function nu(e){if(e.length===0)return-1;let t=0,n=e[0].date;for(let o=1;o<e.length;o++)e[o].date<n&&(n=e[o].date,t=o);return t}/**
346
- * @license
347
- * Copyright 2019 Google LLC
348
- *
349
- * Licensed under the Apache License, Version 2.0 (the "License");
350
- * you may not use this file except in compliance with the License.
351
- * You may obtain a copy of the License at
352
- *
353
- * http://www.apache.org/licenses/LICENSE-2.0
354
- *
355
- * Unless required by applicable law or agreed to in writing, software
356
- * distributed under the License is distributed on an "AS IS" BASIS,
357
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
358
- * See the License for the specific language governing permissions and
359
- * limitations under the License.
360
- */function ou(e){co(new Fn("platform-logger",t=>new dd(t),"PRIVATE")),co(new Fn("heartbeat",t=>new Qd(t),"PRIVATE")),Pn(br,ni,e),Pn(br,ni,"esm2020"),Pn("fire-js","")}ou("");/**
361
- * @license
362
- * Copyright 2017 Google LLC
363
- *
364
- * Licensed under the Apache License, Version 2.0 (the "License");
365
- * you may not use this file except in compliance with the License.
366
- * You may obtain a copy of the License at
367
- *
368
- * http://www.apache.org/licenses/LICENSE-2.0
369
- *
370
- * Unless required by applicable law or agreed to in writing, software
371
- * distributed under the License is distributed on an "AS IS" BASIS,
372
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
373
- * See the License for the specific language governing permissions and
374
- * limitations under the License.
375
- */const ci="firebasestorage.googleapis.com",di="storageBucket",ru=120*1e3,su=600*1e3;/**
376
- * @license
377
- * Copyright 2017 Google LLC
378
- *
379
- * Licensed under the Apache License, Version 2.0 (the "License");
380
- * you may not use this file except in compliance with the License.
381
- * You may obtain a copy of the License at
382
- *
383
- * http://www.apache.org/licenses/LICENSE-2.0
384
- *
385
- * Unless required by applicable law or agreed to in writing, software
386
- * distributed under the License is distributed on an "AS IS" BASIS,
387
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
388
- * See the License for the specific language governing permissions and
389
- * limitations under the License.
390
- */class We extends vn{constructor(t,n,o=0){super(xr(t),`Firebase Storage: ${n} (${xr(t)})`),this.status_=o,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,We.prototype)}get status(){return this.status_}set status(t){this.status_=t}_codeEquals(t){return xr(t)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(t){this.customData.serverResponse=t,this.customData.serverResponse?this.message=`${this._baseMessage}
391
- ${this.customData.serverResponse}`:this.message=this._baseMessage}}var Ge;(function(e){e.UNKNOWN="unknown",e.OBJECT_NOT_FOUND="object-not-found",e.BUCKET_NOT_FOUND="bucket-not-found",e.PROJECT_NOT_FOUND="project-not-found",e.QUOTA_EXCEEDED="quota-exceeded",e.UNAUTHENTICATED="unauthenticated",e.UNAUTHORIZED="unauthorized",e.UNAUTHORIZED_APP="unauthorized-app",e.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",e.INVALID_CHECKSUM="invalid-checksum",e.CANCELED="canceled",e.INVALID_EVENT_NAME="invalid-event-name",e.INVALID_URL="invalid-url",e.INVALID_DEFAULT_BUCKET="invalid-default-bucket",e.NO_DEFAULT_BUCKET="no-default-bucket",e.CANNOT_SLICE_BLOB="cannot-slice-blob",e.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",e.NO_DOWNLOAD_URL="no-download-url",e.INVALID_ARGUMENT="invalid-argument",e.INVALID_ARGUMENT_COUNT="invalid-argument-count",e.APP_DELETED="app-deleted",e.INVALID_ROOT_OPERATION="invalid-root-operation",e.INVALID_FORMAT="invalid-format",e.INTERNAL_ERROR="internal-error",e.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(Ge||(Ge={}));function xr(e){return"storage/"+e}function Sr(){const e="An unknown error occurred, please check the error payload for server response.";return new We(Ge.UNKNOWN,e)}function iu(e){return new We(Ge.OBJECT_NOT_FOUND,"Object '"+e+"' does not exist.")}function au(e){return new We(Ge.QUOTA_EXCEEDED,"Quota for bucket '"+e+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function lu(){const e="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new We(Ge.UNAUTHENTICATED,e)}function cu(){return new We(Ge.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function du(e){return new We(Ge.UNAUTHORIZED,"User does not have permission to access '"+e+"'.")}function uu(){return new We(Ge.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function fu(){return new We(Ge.CANCELED,"User canceled the upload/download.")}function _u(e){return new We(Ge.INVALID_URL,"Invalid URL '"+e+"'.")}function gu(e){return new We(Ge.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+e+"'.")}function hu(){return new We(Ge.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+di+"' property when initializing the app?")}function pu(){return new We(Ge.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function mu(){return new We(Ge.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function vu(e){return new We(Ge.UNSUPPORTED_ENVIRONMENT,`${e} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function $r(e){return new We(Ge.INVALID_ARGUMENT,e)}function ui(){return new We(Ge.APP_DELETED,"The Firebase app was deleted.")}function bu(e){return new We(Ge.INVALID_ROOT_OPERATION,"The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function On(e,t){return new We(Ge.INVALID_FORMAT,"String does not match format '"+e+"': "+t)}function zn(e){throw new We(Ge.INTERNAL_ERROR,"Internal error: "+e)}/**
392
- * @license
393
- * Copyright 2017 Google LLC
394
- *
395
- * Licensed under the Apache License, Version 2.0 (the "License");
396
- * you may not use this file except in compliance with the License.
397
- * You may obtain a copy of the License at
398
- *
399
- * http://www.apache.org/licenses/LICENSE-2.0
400
- *
401
- * Unless required by applicable law or agreed to in writing, software
402
- * distributed under the License is distributed on an "AS IS" BASIS,
403
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
404
- * See the License for the specific language governing permissions and
405
- * limitations under the License.
406
- */class Ct{constructor(t,n){this.bucket=t,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const t=encodeURIComponent;return"/b/"+t(this.bucket)+"/o/"+t(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(t,n){let o;try{o=Ct.makeFromUrl(t,n)}catch{return new Ct(t,"")}if(o.path==="")return o;throw gu(t)}static makeFromUrl(t,n){let o=null;const r="([A-Za-z0-9.\\-_]+)";function s(k){k.path.charAt(k.path.length-1)==="/"&&(k.path_=k.path_.slice(0,-1))}const i="(/(.*))?$",l=new RegExp("^gs://"+r+i,"i"),c={bucket:1,path:3};function d(k){k.path_=decodeURIComponent(k.path)}const _="v[A-Za-z0-9_]+",g=n.replace(/[.]/g,"\\."),f="(/([^?#]*).*)?$",u=new RegExp(`^https?://${g}/${_}/b/${r}/o${f}`,"i"),p={bucket:1,path:3},h=n===ci?"(?:storage.googleapis.com|storage.cloud.google.com)":n,m="([^?#]*)",y=new RegExp(`^https?://${h}/${r}/${m}`,"i"),C=[{regex:l,indices:c,postModify:s},{regex:u,indices:p,postModify:d},{regex:y,indices:{bucket:1,path:2},postModify:d}];for(let k=0;k<C.length;k++){const A=C[k],T=A.regex.exec(t);if(T){const M=T[A.indices.bucket];let P=T[A.indices.path];P||(P=""),o=new Ct(M,P),A.postModify(o);break}}if(o==null)throw _u(t);return o}}class wu{constructor(t){this.promise_=Promise.reject(t)}getPromise(){return this.promise_}cancel(t=!1){}}/**
407
- * @license
408
- * Copyright 2017 Google LLC
409
- *
410
- * Licensed under the Apache License, Version 2.0 (the "License");
411
- * you may not use this file except in compliance with the License.
412
- * You may obtain a copy of the License at
413
- *
414
- * http://www.apache.org/licenses/LICENSE-2.0
415
- *
416
- * Unless required by applicable law or agreed to in writing, software
417
- * distributed under the License is distributed on an "AS IS" BASIS,
418
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
419
- * See the License for the specific language governing permissions and
420
- * limitations under the License.
421
- */function yu(e,t,n){let o=1,r=null,s=null,i=!1,l=0;function c(){return l===2}let d=!1;function _(...m){d||(d=!0,t.apply(null,m))}function g(m){r=setTimeout(()=>{r=null,e(u,c())},m)}function f(){s&&clearTimeout(s)}function u(m,...y){if(d){f();return}if(m){f(),_.call(null,m,...y);return}if(c()||i){f(),_.call(null,m,...y);return}o<64&&(o*=2);let C;l===1?(l=2,C=0):C=(o+Math.random())*1e3,g(C)}let p=!1;function h(m){p||(p=!0,f(),!d&&(r!==null?(m||(l=2),clearTimeout(r),g(0)):m||(l=1)))}return g(0),s=setTimeout(()=>{i=!0,h(!0)},n),h}function Cu(e){e(!1)}/**
422
- * @license
423
- * Copyright 2017 Google LLC
424
- *
425
- * Licensed under the Apache License, Version 2.0 (the "License");
426
- * you may not use this file except in compliance with the License.
427
- * You may obtain a copy of the License at
428
- *
429
- * http://www.apache.org/licenses/LICENSE-2.0
430
- *
431
- * Unless required by applicable law or agreed to in writing, software
432
- * distributed under the License is distributed on an "AS IS" BASIS,
433
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
434
- * See the License for the specific language governing permissions and
435
- * limitations under the License.
436
- */function xu(e){return e!==void 0}function Su(e){return typeof e=="object"&&!Array.isArray(e)}function kr(e){return typeof e=="string"||e instanceof String}function fi(e){return Er()&&e instanceof Blob}function Er(){return typeof Blob<"u"}function _i(e,t,n,o){if(o<t)throw $r(`Invalid value for '${e}'. Expected ${t} or greater.`);if(o>n)throw $r(`Invalid value for '${e}'. Expected ${n} or less.`)}/**
437
- * @license
438
- * Copyright 2017 Google LLC
439
- *
440
- * Licensed under the Apache License, Version 2.0 (the "License");
441
- * you may not use this file except in compliance with the License.
442
- * You may obtain a copy of the License at
443
- *
444
- * http://www.apache.org/licenses/LICENSE-2.0
445
- *
446
- * Unless required by applicable law or agreed to in writing, software
447
- * distributed under the License is distributed on an "AS IS" BASIS,
448
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
449
- * See the License for the specific language governing permissions and
450
- * limitations under the License.
451
- */function Ir(e,t,n){let o=t;return n==null&&(o=`https://${t}`),`${n}://${o}/v0${e}`}function gi(e){const t=encodeURIComponent;let n="?";for(const o in e)if(e.hasOwnProperty(o)){const r=t(o)+"="+t(e[o]);n=n+r+"&"}return n=n.slice(0,-1),n}var sn;(function(e){e[e.NO_ERROR=0]="NO_ERROR",e[e.NETWORK_ERROR=1]="NETWORK_ERROR",e[e.ABORT=2]="ABORT"})(sn||(sn={}));/**
452
- * @license
453
- * Copyright 2022 Google LLC
454
- *
455
- * Licensed under the Apache License, Version 2.0 (the "License");
456
- * you may not use this file except in compliance with the License.
457
- * You may obtain a copy of the License at
458
- *
459
- * http://www.apache.org/licenses/LICENSE-2.0
460
- *
461
- * Unless required by applicable law or agreed to in writing, software
462
- * distributed under the License is distributed on an "AS IS" BASIS,
463
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
464
- * See the License for the specific language governing permissions and
465
- * limitations under the License.
466
- */function $u(e,t){const n=e>=500&&e<600,r=[408,429].indexOf(e)!==-1,s=t.indexOf(e)!==-1;return n||r||s}/**
467
- * @license
468
- * Copyright 2017 Google LLC
469
- *
470
- * Licensed under the Apache License, Version 2.0 (the "License");
471
- * you may not use this file except in compliance with the License.
472
- * You may obtain a copy of the License at
473
- *
474
- * http://www.apache.org/licenses/LICENSE-2.0
475
- *
476
- * Unless required by applicable law or agreed to in writing, software
477
- * distributed under the License is distributed on an "AS IS" BASIS,
478
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
479
- * See the License for the specific language governing permissions and
480
- * limitations under the License.
481
- */class ku{constructor(t,n,o,r,s,i,l,c,d,_,g,f=!0,u=!1){this.url_=t,this.method_=n,this.headers_=o,this.body_=r,this.successCodes_=s,this.additionalRetryCodes_=i,this.callback_=l,this.errorCallback_=c,this.timeout_=d,this.progressCallback_=_,this.connectionFactory_=g,this.retry=f,this.isUsingEmulator=u,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((p,h)=>{this.resolve_=p,this.reject_=h,this.start_()})}start_(){const t=(o,r)=>{if(r){o(!1,new uo(!1,null,!0));return}const s=this.connectionFactory_();this.pendingConnection_=s;const i=l=>{const c=l.loaded,d=l.lengthComputable?l.total:-1;this.progressCallback_!==null&&this.progressCallback_(c,d)};this.progressCallback_!==null&&s.addUploadProgressListener(i),s.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&s.removeUploadProgressListener(i),this.pendingConnection_=null;const l=s.getErrorCode()===sn.NO_ERROR,c=s.getStatus();if(!l||$u(c,this.additionalRetryCodes_)&&this.retry){const _=s.getErrorCode()===sn.ABORT;o(!1,new uo(!1,null,_));return}const d=this.successCodes_.indexOf(c)!==-1;o(!0,new uo(d,s))})},n=(o,r)=>{const s=this.resolve_,i=this.reject_,l=r.connection;if(r.wasSuccessCode)try{const c=this.callback_(l,l.getResponse());xu(c)?s(c):s()}catch(c){i(c)}else if(l!==null){const c=Sr();c.serverResponse=l.getErrorText(),this.errorCallback_?i(this.errorCallback_(l,c)):i(c)}else if(r.canceled){const c=this.appDelete_?ui():fu();i(c)}else{const c=uu();i(c)}};this.canceled_?n(!1,new uo(!1,null,!0)):this.backoffId_=yu(t,n,this.timeout_)}getPromise(){return this.promise_}cancel(t){this.canceled_=!0,this.appDelete_=t||!1,this.backoffId_!==null&&Cu(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class uo{constructor(t,n,o){this.wasSuccessCode=t,this.connection=n,this.canceled=!!o}}function Eu(e,t){t!==null&&t.length>0&&(e.Authorization="Firebase "+t)}function Iu(e,t){e["X-Firebase-Storage-Version"]="webjs/"+(t??"AppManager")}function Nu(e,t){t&&(e["X-Firebase-GMPID"]=t)}function Mu(e,t){t!==null&&(e["X-Firebase-AppCheck"]=t)}function Au(e,t,n,o,r,s,i=!0,l=!1){const c=gi(e.urlParams),d=e.url+c,_=Object.assign({},e.headers);return Nu(_,t),Eu(_,n),Iu(_,s),Mu(_,o),new ku(d,e.method,_,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,r,i,l)}/**
482
- * @license
483
- * Copyright 2017 Google LLC
484
- *
485
- * Licensed under the Apache License, Version 2.0 (the "License");
486
- * you may not use this file except in compliance with the License.
487
- * You may obtain a copy of the License at
488
- *
489
- * http://www.apache.org/licenses/LICENSE-2.0
490
- *
491
- * Unless required by applicable law or agreed to in writing, software
492
- * distributed under the License is distributed on an "AS IS" BASIS,
493
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
494
- * See the License for the specific language governing permissions and
495
- * limitations under the License.
496
- */function Du(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function Tu(...e){const t=Du();if(t!==void 0){const n=new t;for(let o=0;o<e.length;o++)n.append(e[o]);return n.getBlob()}else{if(Er())return new Blob(e);throw new We(Ge.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}}function Fu(e,t,n){return e.webkitSlice?e.webkitSlice(t,n):e.mozSlice?e.mozSlice(t,n):e.slice?e.slice(t,n):null}/**
497
- * @license
498
- * Copyright 2021 Google LLC
499
- *
500
- * Licensed under the Apache License, Version 2.0 (the "License");
501
- * you may not use this file except in compliance with the License.
502
- * You may obtain a copy of the License at
503
- *
504
- * http://www.apache.org/licenses/LICENSE-2.0
505
- *
506
- * Unless required by applicable law or agreed to in writing, software
507
- * distributed under the License is distributed on an "AS IS" BASIS,
508
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
509
- * See the License for the specific language governing permissions and
510
- * limitations under the License.
511
- */function Pu(e){if(typeof atob>"u")throw vu("base-64");return atob(e)}/**
512
- * @license
513
- * Copyright 2017 Google LLC
514
- *
515
- * Licensed under the Apache License, Version 2.0 (the "License");
516
- * you may not use this file except in compliance with the License.
517
- * You may obtain a copy of the License at
518
- *
519
- * http://www.apache.org/licenses/LICENSE-2.0
520
- *
521
- * Unless required by applicable law or agreed to in writing, software
522
- * distributed under the License is distributed on an "AS IS" BASIS,
523
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
524
- * See the License for the specific language governing permissions and
525
- * limitations under the License.
526
- */const It={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class Nr{constructor(t,n){this.data=t,this.contentType=n||null}}function hi(e,t){switch(e){case It.RAW:return new Nr(pi(t));case It.BASE64:case It.BASE64URL:return new Nr(mi(e,t));case It.DATA_URL:return new Nr(Ou(t),zu(t))}throw Sr()}function pi(e){const t=[];for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);if(o<=127)t.push(o);else if(o<=2047)t.push(192|o>>6,128|o&63);else if((o&64512)===55296)if(!(n<e.length-1&&(e.charCodeAt(n+1)&64512)===56320))t.push(239,191,189);else{const s=o,i=e.charCodeAt(++n);o=65536|(s&1023)<<10|i&1023,t.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|o&63)}else(o&64512)===56320?t.push(239,191,189):t.push(224|o>>12,128|o>>6&63,128|o&63)}return new Uint8Array(t)}function Lu(e){let t;try{t=decodeURIComponent(e)}catch{throw On(It.DATA_URL,"Malformed data URL.")}return pi(t)}function mi(e,t){switch(e){case It.BASE64:{const r=t.indexOf("-")!==-1,s=t.indexOf("_")!==-1;if(r||s)throw On(e,"Invalid character '"+(r?"-":"_")+"' found: is it base64url encoded?");break}case It.BASE64URL:{const r=t.indexOf("+")!==-1,s=t.indexOf("/")!==-1;if(r||s)throw On(e,"Invalid character '"+(r?"+":"/")+"' found: is it base64 encoded?");t=t.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=Pu(t)}catch(r){throw r.message.includes("polyfill")?r:On(e,"Invalid character found")}const o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return o}class vi{constructor(t){this.base64=!1,this.contentType=null;const n=t.match(/^data:([^,]+)?,/);if(n===null)throw On(It.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");const o=n[1]||null;o!=null&&(this.base64=Bu(o,";base64"),this.contentType=this.base64?o.substring(0,o.length-7):o),this.rest=t.substring(t.indexOf(",")+1)}}function Ou(e){const t=new vi(e);return t.base64?mi(It.BASE64,t.rest):Lu(t.rest)}function zu(e){return new vi(e).contentType}function Bu(e,t){return e.length>=t.length?e.substring(e.length-t.length)===t:!1}/**
527
- * @license
528
- * Copyright 2017 Google LLC
529
- *
530
- * Licensed under the Apache License, Version 2.0 (the "License");
531
- * you may not use this file except in compliance with the License.
532
- * You may obtain a copy of the License at
533
- *
534
- * http://www.apache.org/licenses/LICENSE-2.0
535
- *
536
- * Unless required by applicable law or agreed to in writing, software
537
- * distributed under the License is distributed on an "AS IS" BASIS,
538
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
539
- * See the License for the specific language governing permissions and
540
- * limitations under the License.
541
- */class Kt{constructor(t,n){let o=0,r="";fi(t)?(this.data_=t,o=t.size,r=t.type):t instanceof ArrayBuffer?(n?this.data_=new Uint8Array(t):(this.data_=new Uint8Array(t.byteLength),this.data_.set(new Uint8Array(t))),o=this.data_.length):t instanceof Uint8Array&&(n?this.data_=t:(this.data_=new Uint8Array(t.length),this.data_.set(t)),o=t.length),this.size_=o,this.type_=r}size(){return this.size_}type(){return this.type_}slice(t,n){if(fi(this.data_)){const o=this.data_,r=Fu(o,t,n);return r===null?null:new Kt(r)}else{const o=new Uint8Array(this.data_.buffer,t,n-t);return new Kt(o,!0)}}static getBlob(...t){if(Er()){const n=t.map(o=>o instanceof Kt?o.data_:o);return new Kt(Tu.apply(null,n))}else{const n=t.map(i=>kr(i)?hi(It.RAW,i).data:i.data_);let o=0;n.forEach(i=>{o+=i.byteLength});const r=new Uint8Array(o);let s=0;return n.forEach(i=>{for(let l=0;l<i.length;l++)r[s++]=i[l]}),new Kt(r,!0)}}uploadData(){return this.data_}}/**
542
- * @license
543
- * Copyright 2017 Google LLC
544
- *
545
- * Licensed under the Apache License, Version 2.0 (the "License");
546
- * you may not use this file except in compliance with the License.
547
- * You may obtain a copy of the License at
548
- *
549
- * http://www.apache.org/licenses/LICENSE-2.0
550
- *
551
- * Unless required by applicable law or agreed to in writing, software
552
- * distributed under the License is distributed on an "AS IS" BASIS,
553
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
554
- * See the License for the specific language governing permissions and
555
- * limitations under the License.
556
- */function bi(e){let t;try{t=JSON.parse(e)}catch{return null}return Su(t)?t:null}/**
557
- * @license
558
- * Copyright 2017 Google LLC
559
- *
560
- * Licensed under the Apache License, Version 2.0 (the "License");
561
- * you may not use this file except in compliance with the License.
562
- * You may obtain a copy of the License at
563
- *
564
- * http://www.apache.org/licenses/LICENSE-2.0
565
- *
566
- * Unless required by applicable law or agreed to in writing, software
567
- * distributed under the License is distributed on an "AS IS" BASIS,
568
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
569
- * See the License for the specific language governing permissions and
570
- * limitations under the License.
571
- */function Vu(e){if(e.length===0)return null;const t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function ju(e,t){const n=t.split("/").filter(o=>o.length>0).join("/");return e.length===0?n:e+"/"+n}function wi(e){const t=e.lastIndexOf("/",e.length-2);return t===-1?e:e.slice(t+1)}/**
572
- * @license
573
- * Copyright 2017 Google LLC
574
- *
575
- * Licensed under the Apache License, Version 2.0 (the "License");
576
- * you may not use this file except in compliance with the License.
577
- * You may obtain a copy of the License at
578
- *
579
- * http://www.apache.org/licenses/LICENSE-2.0
580
- *
581
- * Unless required by applicable law or agreed to in writing, software
582
- * distributed under the License is distributed on an "AS IS" BASIS,
583
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
584
- * See the License for the specific language governing permissions and
585
- * limitations under the License.
586
- */function qu(e,t){return t}class ht{constructor(t,n,o,r){this.server=t,this.local=n||t,this.writable=!!o,this.xform=r||qu}}let fo=null;function Hu(e){return!kr(e)||e.length<2?e:wi(e)}function yi(){if(fo)return fo;const e=[];e.push(new ht("bucket")),e.push(new ht("generation")),e.push(new ht("metageneration")),e.push(new ht("name","fullPath",!0));function t(s,i){return Hu(i)}const n=new ht("name");n.xform=t,e.push(n);function o(s,i){return i!==void 0?Number(i):i}const r=new ht("size");return r.xform=o,e.push(r),e.push(new ht("timeCreated")),e.push(new ht("updated")),e.push(new ht("md5Hash",null,!0)),e.push(new ht("cacheControl",null,!0)),e.push(new ht("contentDisposition",null,!0)),e.push(new ht("contentEncoding",null,!0)),e.push(new ht("contentLanguage",null,!0)),e.push(new ht("contentType",null,!0)),e.push(new ht("metadata","customMetadata",!0)),fo=e,fo}function Ru(e,t){function n(){const o=e.bucket,r=e.fullPath,s=new Ct(o,r);return t._makeStorageReference(s)}Object.defineProperty(e,"ref",{get:n})}function Uu(e,t,n){const o={};o.type="file";const r=n.length;for(let s=0;s<r;s++){const i=n[s];o[i.local]=i.xform(o,t[i.server])}return Ru(o,e),o}function Ci(e,t,n){const o=bi(t);return o===null?null:Uu(e,o,n)}function Wu(e,t,n,o){const r=bi(t);if(r===null||!kr(r.downloadTokens))return null;const s=r.downloadTokens;if(s.length===0)return null;const i=encodeURIComponent;return s.split(",").map(d=>{const _=e.bucket,g=e.fullPath,f="/b/"+i(_)+"/o/"+i(g),u=Ir(f,n,o),p=gi({alt:"media",token:d});return u+p})[0]}function Gu(e,t){const n={},o=t.length;for(let r=0;r<o;r++){const s=t[r];s.writable&&(n[s.server]=e[s.local])}return JSON.stringify(n)}class xi{constructor(t,n,o,r){this.url=t,this.method=n,this.handler=o,this.timeout=r,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}/**
587
- * @license
588
- * Copyright 2017 Google LLC
589
- *
590
- * Licensed under the Apache License, Version 2.0 (the "License");
591
- * you may not use this file except in compliance with the License.
592
- * You may obtain a copy of the License at
593
- *
594
- * http://www.apache.org/licenses/LICENSE-2.0
595
- *
596
- * Unless required by applicable law or agreed to in writing, software
597
- * distributed under the License is distributed on an "AS IS" BASIS,
598
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
599
- * See the License for the specific language governing permissions and
600
- * limitations under the License.
601
- */function Si(e){if(!e)throw Sr()}function Ku(e,t){function n(o,r){const s=Ci(e,r,t);return Si(s!==null),s}return n}function Xu(e,t){function n(o,r){const s=Ci(e,r,t);return Si(s!==null),Wu(s,r,e.host,e._protocol)}return n}function $i(e){function t(n,o){let r;return n.getStatus()===401?n.getErrorText().includes("Firebase App Check token is invalid")?r=cu():r=lu():n.getStatus()===402?r=au(e.bucket):n.getStatus()===403?r=du(e.path):r=o,r.status=n.getStatus(),r.serverResponse=o.serverResponse,r}return t}function Yu(e){const t=$i(e);function n(o,r){let s=t(o,r);return o.getStatus()===404&&(s=iu(e.path)),s.serverResponse=r.serverResponse,s}return n}function Zu(e,t,n){const o=t.fullServerUrl(),r=Ir(o,e.host,e._protocol),s="GET",i=e.maxOperationRetryTime,l=new xi(r,s,Xu(e,n),i);return l.errorHandler=Yu(t),l}function Ju(e,t){return e&&e.contentType||t&&t.type()||"application/octet-stream"}function Qu(e,t,n){const o=Object.assign({},n);return o.fullPath=e.path,o.size=t.size(),o.contentType||(o.contentType=Ju(null,t)),o}function ef(e,t,n,o,r){const s=t.bucketOnlyServerUrl(),i={"X-Goog-Upload-Protocol":"multipart"};function l(){let C="";for(let k=0;k<2;k++)C=C+Math.random().toString().slice(2);return C}const c=l();i["Content-Type"]="multipart/related; boundary="+c;const d=Qu(t,o,r),_=Gu(d,n),g="--"+c+`\r
602
- Content-Type: application/json; charset=utf-8\r
603
- \r
604
- `+_+`\r
605
- --`+c+`\r
606
- Content-Type: `+d.contentType+`\r
607
- \r
608
- `,f=`\r
609
- --`+c+"--",u=Kt.getBlob(g,o,f);if(u===null)throw pu();const p={name:d.fullPath},h=Ir(s,e.host,e._protocol),m="POST",y=e.maxUploadRetryTime,w=new xi(h,m,Ku(e,n),y);return w.urlParams=p,w.headers=i,w.body=u.uploadData(),w.errorHandler=$i(t),w}class tf{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=sn.NO_ERROR,this.sendPromise_=new Promise(t=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=sn.ABORT,t()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=sn.NETWORK_ERROR,t()}),this.xhr_.addEventListener("load",()=>{t()})})}send(t,n,o,r,s){if(this.sent_)throw zn("cannot .send() more than once");if(ur(t)&&o&&(this.xhr_.withCredentials=!0),this.sent_=!0,this.xhr_.open(n,t,!0),s!==void 0)for(const i in s)s.hasOwnProperty(i)&&this.xhr_.setRequestHeader(i,s[i].toString());return r!==void 0?this.xhr_.send(r):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw zn("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw zn("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw zn("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw zn("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(t){return this.xhr_.getResponseHeader(t)}addUploadProgressListener(t){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",t)}removeUploadProgressListener(t){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",t)}}class nf extends tf{initXhr(){this.xhr_.responseType="text"}}function ki(){return new nf}/**
610
- * @license
611
- * Copyright 2019 Google LLC
612
- *
613
- * Licensed under the Apache License, Version 2.0 (the "License");
614
- * you may not use this file except in compliance with the License.
615
- * You may obtain a copy of the License at
616
- *
617
- * http://www.apache.org/licenses/LICENSE-2.0
618
- *
619
- * Unless required by applicable law or agreed to in writing, software
620
- * distributed under the License is distributed on an "AS IS" BASIS,
621
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
622
- * See the License for the specific language governing permissions and
623
- * limitations under the License.
624
- */class an{constructor(t,n){this._service=t,n instanceof Ct?this._location=n:this._location=Ct.makeFromUrl(n,t.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(t,n){return new an(t,n)}get root(){const t=new Ct(this._location.bucket,"");return this._newRef(this._service,t)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return wi(this._location.path)}get storage(){return this._service}get parent(){const t=Vu(this._location.path);if(t===null)return null;const n=new Ct(this._location.bucket,t);return new an(this._service,n)}_throwIfRoot(t){if(this._location.path==="")throw bu(t)}}function of(e,t,n){e._throwIfRoot("uploadBytes");const o=ef(e.storage,e._location,yi(),new Kt(t,!0),n);return e.storage.makeRequestWithTokens(o,ki).then(r=>({metadata:r,ref:e}))}function rf(e,t,n=It.RAW,o){e._throwIfRoot("uploadString");const r=hi(n,t),s={...o};return s.contentType==null&&r.contentType!=null&&(s.contentType=r.contentType),of(e,r.data,s)}function sf(e){e._throwIfRoot("getDownloadURL");const t=Zu(e.storage,e._location,yi());return e.storage.makeRequestWithTokens(t,ki).then(n=>{if(n===null)throw mu();return n})}function af(e,t){const n=ju(e._location.path,t),o=new Ct(e._location.bucket,n);return new an(e.storage,o)}/**
625
- * @license
626
- * Copyright 2017 Google LLC
627
- *
628
- * Licensed under the Apache License, Version 2.0 (the "License");
629
- * you may not use this file except in compliance with the License.
630
- * You may obtain a copy of the License at
631
- *
632
- * http://www.apache.org/licenses/LICENSE-2.0
633
- *
634
- * Unless required by applicable law or agreed to in writing, software
635
- * distributed under the License is distributed on an "AS IS" BASIS,
636
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
637
- * See the License for the specific language governing permissions and
638
- * limitations under the License.
639
- */function lf(e){return/^[A-Za-z]+:\/\//.test(e)}function cf(e,t){return new an(e,t)}function Ei(e,t){if(e instanceof Mr){const n=e;if(n._bucket==null)throw hu();const o=new an(n,n._bucket);return t!=null?Ei(o,t):o}else return t!==void 0?af(e,t):e}function df(e,t){if(t&&lf(t)){if(e instanceof Mr)return cf(e,t);throw $r("To use ref(service, url), the first argument must be a Storage instance.")}else return Ei(e,t)}function Ii(e,t){const n=t?.[di];return n==null?null:Ct.makeFromBucketSpec(n,e)}function uf(e,t,n,o={}){e.host=`${t}:${n}`;const r=ur(t);r&&(Fc(`https://${e.host}/b`),zc("Storage",!0)),e._isUsingEmulator=!0,e._protocol=r?"https":"http";const{mockUserToken:s}=o;s&&(e._overrideAuthToken=typeof s=="string"?s:Pc(s,e.app.options.projectId))}class Mr{constructor(t,n,o,r,s,i=!1){this.app=t,this._authProvider=n,this._appCheckProvider=o,this._url=r,this._firebaseVersion=s,this._isUsingEmulator=i,this._bucket=null,this._host=ci,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=ru,this._maxUploadRetryTime=su,this._requests=new Set,r!=null?this._bucket=Ct.makeFromBucketSpec(r,this._host):this._bucket=Ii(this._host,this.app.options)}get host(){return this._host}set host(t){this._host=t,this._url!=null?this._bucket=Ct.makeFromBucketSpec(this._url,t):this._bucket=Ii(t,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(t){_i("time",0,Number.POSITIVE_INFINITY,t),this._maxUploadRetryTime=t}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(t){_i("time",0,Number.POSITIVE_INFINITY,t),this._maxOperationRetryTime=t}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const t=this._authProvider.getImmediate({optional:!0});if(t){const n=await t.getToken();if(n!==null)return n.accessToken}return null}async _getAppCheckToken(){if(qd(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=this._appCheckProvider.getImmediate({optional:!0});return t?(await t.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(t=>t.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(t){return new an(this,t)}_makeRequest(t,n,o,r,s=!0){if(this._deleted)return new wu(ui());{const i=Au(t,this._appId,o,r,n,this._firebaseVersion,s,this._isUsingEmulator);return this._requests.add(i),i.getPromise().then(()=>this._requests.delete(i),()=>this._requests.delete(i)),i}}async makeRequestWithTokens(t,n){const[o,r]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(t,n,o,r).getPromise()}}const Ni="@firebase/storage",Mi="0.14.1";/**
640
- * @license
641
- * Copyright 2020 Google LLC
642
- *
643
- * Licensed under the Apache License, Version 2.0 (the "License");
644
- * you may not use this file except in compliance with the License.
645
- * You may obtain a copy of the License at
646
- *
647
- * http://www.apache.org/licenses/LICENSE-2.0
648
- *
649
- * Unless required by applicable law or agreed to in writing, software
650
- * distributed under the License is distributed on an "AS IS" BASIS,
651
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
652
- * See the License for the specific language governing permissions and
653
- * limitations under the License.
654
- */const Ai="storage";function ff(e,t,n,o){return e=ao(e),rf(e,t,n,o)}function _f(e){return e=ao(e),sf(e)}function gf(e,t){return e=ao(e),df(e,t)}function hf(e=Gd(),t){e=ao(e);const o=jd(e,Ai).getImmediate({identifier:t}),r=Dc("storage");return r&&pf(o,...r),o}function pf(e,t,n,o={}){uf(e,t,n,o)}function mf(e,{instanceIdentifier:t}){const n=e.getProvider("app").getImmediate(),o=e.getProvider("auth-internal"),r=e.getProvider("app-check-internal");return new Mr(n,o,r,t,Ud)}function vf(){co(new Fn(Ai,mf,"PUBLIC").setMultipleInstances(!0)),Pn(Ni,Mi,""),Pn(Ni,Mi,"esm2020")}vf();const Nt={badge:"_badge_jvdik_1",badge_clickable:"_badge_clickable_jvdik_41",size_sm:"_size_sm_jvdik_65",size_md:"_size_md_jvdik_77",size_lg:"_size_lg_jvdik_89",radius_none:"_radius_none_jvdik_101",radius_sm:"_radius_sm_jvdik_109",radius_md:"_radius_md_jvdik_117",radius_lg:"_radius_lg_jvdik_125",radius_full:"_radius_full_jvdik_133",dot:"_dot_jvdik_141",pulse:"_pulse_jvdik_1",icon:"_icon_jvdik_187",dismiss_button:"_dismiss_button_jvdik_199",variant_solid:"_variant_solid_jvdik_259",color_default:"_color_default_jvdik_267",color_primary:"_color_primary_jvdik_277",color_secondary:"_color_secondary_jvdik_287",color_success:"_color_success_jvdik_297",color_warning:"_color_warning_jvdik_307",color_danger:"_color_danger_jvdik_317",color_info:"_color_info_jvdik_327",color_brand:"_color_brand_jvdik_337",variant_subtle:"_variant_subtle_jvdik_347",variant_outline:"_variant_outline_jvdik_427",variant_soft:"_variant_soft_jvdik_523",badge_custom:"_badge_custom_jvdik_603"},bf=()=>a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:a.jsx("path",{d:"M2 2L8 8M8 2L2 8"})}),Di=({variant:e="solid",color:t="default",size:n="md",radius:o="md",children:r,startIcon:s,endIcon:i,dot:l,dismissible:c,onDismiss:d,customColor:_,className:g="",onClick:f})=>{const u=!!f,p=v.useMemo(()=>{if(!_)return;const y=_,w=`color-mix(in oklab, ${y} 15%, transparent)`;return{solid:{"--badge-custom-bg":y,"--badge-custom-text":"white","--badge-custom-border":"transparent"},subtle:{"--badge-custom-bg":w,"--badge-custom-text":y,"--badge-custom-border":"transparent"},outline:{"--badge-custom-bg":"transparent","--badge-custom-text":y,"--badge-custom-border":y},soft:{"--badge-custom-bg":`color-mix(in oklab, ${y} 10%, var(--surface-first))`,"--badge-custom-text":y,"--badge-custom-border":"transparent"}}[e]},[_,e]),h=[Nt.badge,Nt[`size_${n}`],Nt[`radius_${o}`],Nt[`variant_${e}`],!_&&Nt[`color_${t}`],_&&Nt.badge_custom,u&&Nt.badge_clickable,g].filter(Boolean).join(" "),m=v.useMemo(()=>_||{default:"var(--gray-11)",primary:"var(--brand-6)",secondary:"var(--brand-6-secondary)",success:"var(--color-add-green-6)",warning:"var(--color-add-orange-6)",danger:"var(--color-add-red-6)",info:"var(--color-add-blue-6)",brand:"var(--brand-6)"}[t],[t,_]);return a.jsxs("span",{className:h,style:p,onClick:f,role:u?"button":void 0,tabIndex:u?0:void 0,children:[l&&a.jsx("span",{className:Nt.dot,style:{backgroundColor:m}}),s&&a.jsx("span",{className:Nt.icon,children:s}),r,i&&a.jsx("span",{className:Nt.icon,children:i}),c&&a.jsx("button",{type:"button",className:Nt.dismiss_button,onClick:y=>{y.stopPropagation(),d?.()},"aria-label":"Eliminar badge",children:a.jsx(bf,{})})]})},Ve={contenedor_toggle:"_contenedor_toggle_1ow2e_5",envoltorio_toggle:"_envoltorio_toggle_1ow2e_19",contenedor_label:"_contenedor_label_1ow2e_37",texto_label:"_texto_label_1ow2e_49",texto_descripcion:"_texto_descripcion_1ow2e_65",marca_requerido:"_marca_requerido_1ow2e_75",pista_toggle:"_pista_toggle_1ow2e_83",input:"_input_1ow2e_117",fondo_pista:"_fondo_pista_1ow2e_143",pulgar_toggle:"_pulgar_toggle_1ow2e_171",icono_check:"_icono_check_1ow2e_205",icono_x:"_icono_x_1ow2e_207",seleccionado:"_seleccionado_1ow2e_275",con_iconos:"_con_iconos_1ow2e_307",tam_sm:"_tam_sm_1ow2e_317",icono_moon:"_icono_moon_1ow2e_321",tam_lg:"_tam_lg_1ow2e_371",color_primary:"_color_primary_1ow2e_415",color_secondary:"_color_secondary_1ow2e_423",color_success:"_color_success_1ow2e_431",color_warning:"_color_warning_1ow2e_439",color_danger:"_color_danger_1ow2e_447",label_left:"_label_left_1ow2e_455",deshabilitado:"_deshabilitado_1ow2e_463",solo_lectura:"_solo_lectura_1ow2e_531",invalido:"_invalido_1ow2e_597",variante_moon:"_variante_moon_1ow2e_663",posicion_top:"_posicion_top_1ow2e_709",justify_end:"_justify_end_1ow2e_727",posicion_inline:"_posicion_inline_1ow2e_737"},Ar=v.forwardRef(({isSelected:e,defaultSelected:t=!1,onChange:n,label:o,description:r,size:s="md",color:i="primary",customColor:l,variant:c="default",isDisabled:d=!1,isReadOnly:_=!1,isInvalid:g=!1,isRequired:f=!1,showIcons:u=!1,labelPlacement:p="right",labelPosition:h="inline",justifyEnd:m=!1,children:y,className:w="",...C},k)=>{const[A,T]=v.useState(t),M=v.useId(),P=C.id||M,L=e!==void 0?e:A,E=D=>{if(d||_)return;const x=D.target.checked;e===void 0&&T(x),n&&n(x)},B=y||o,V=[Ve.contenedor_toggle,Ve[`tam_${s}`],!l&&Ve[`color_${i}`],Ve[`variante_${c}`],Ve[`label_${p}`],Ve[`posicion_${h}`],L&&Ve.seleccionado,d&&Ve.deshabilitado,_&&Ve.solo_lectura,g&&Ve.invalido,u&&Ve.con_iconos,m&&Ve.justify_end,w].filter(Boolean).join(" "),$=l?{"--toggle-custom-color":l}:void 0,b=()=>B?a.jsxs("div",{className:Ve.contenedor_label,children:[a.jsxs("span",{className:Ve.texto_label,children:[B,f&&a.jsx("span",{className:Ve.marca_requerido,children:" *"})]}),r&&a.jsx("span",{className:Ve.texto_descripcion,children:r})]}):null,S=()=>c!=="moon"?null:a.jsx("div",{className:Ve.icono_moon,children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:a.jsx("path",{d:"M5,1 L5,1 C2.790861,1 1,2.790861 1,5 L1,5 C1,7.209139 2.790861,9 5,9 L5,9 C7.209139,9 9,7.209139 9,5 L9,5 C9,2.790861 7.209139,1 5,1 L5,9 L5,1 Z"})})}),O=()=>!u||c==="moon"?null:a.jsxs(a.Fragment,{children:[a.jsx("svg",{className:Ve.icono_check,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"2,6 5,9 10,3"})}),a.jsxs("svg",{className:Ve.icono_x,width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"2",y1:"2",x2:"8",y2:"8"}),a.jsx("line",{x1:"8",y1:"2",x2:"2",y2:"8"})]})]});return a.jsxs("div",{className:V,style:$,children:[h==="top"&&b(),a.jsxs("label",{className:Ve.envoltorio_toggle,htmlFor:P,children:[h==="inline"&&p==="left"&&b(),a.jsxs("div",{className:Ve.pista_toggle,children:[a.jsx("input",{ref:k,type:"checkbox",id:P,checked:L,disabled:d,readOnly:_,required:f,"aria-invalid":g,className:Ve.input,onChange:E,...C}),a.jsx("div",{className:Ve.fondo_pista,children:a.jsxs("div",{className:Ve.pulgar_toggle,children:[S(),O()]})})]}),h==="inline"&&p==="right"&&b()]})]})});Ar.displayName="Toggle";const wf=({className:e})=>a.jsx("svg",{className:e,width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),Ti=({className:e})=>a.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6"})}),yf=({className:e})=>a.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M3 7v6h6M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})}),Cf=({className:e})=>a.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"})}),xf=({className:e})=>a.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M12 20h9M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})}),Sf=({className:e})=>a.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"}),a.jsx("path",{d:"M15 19h6"}),a.jsx("path",{d:"M18 16v6"})]}),$f=({className:e})=>a.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9"}),a.jsx("path",{d:"m8.5 12 2.3 2.3 4.7-4.7"})]}),se={backdrop:"_backdrop_155e9_1",visible:"_visible_155e9_37",modal:"_modal_155e9_61",cuerpo_modal:"_cuerpo_modal_155e9_103",encabezado:"_encabezado_155e9_145",titulo:"_titulo_155e9_159",boton_cerrar:"_boton_cerrar_155e9_173",texto_esc:"_texto_esc_155e9_209",icono_x:"_icono_x_155e9_223",contenedor_lienzo:"_contenedor_lienzo_155e9_233",area_firma:"_area_firma_155e9_243",superficie_lienzo:"_superficie_lienzo_155e9_257",lienzo:"_lienzo_155e9_265",lienzo_deshabilitado:"_lienzo_deshabilitado_155e9_295",barra_acciones:"_barra_acciones_155e9_305",grupo_izquierda:"_grupo_izquierda_155e9_325",grupo_derecha:"_grupo_derecha_155e9_337",separador:"_separador_155e9_349",boton_accion:"_boton_accion_155e9_361",contenedor_guardar:"_contenedor_guardar_155e9_417",boton_texto_con_icono:"_boton_texto_con_icono_155e9_429",accion_texto:"_accion_texto_155e9_441",icono_boton_accion:"_icono_boton_accion_155e9_451",icono:"_icono_155e9_223",contenedor_consentimiento:"_contenedor_consentimiento_155e9_477",texto_consentimiento:"_texto_consentimiento_155e9_491",consentimiento_fila:"_consentimiento_fila_155e9_507",toggle_consentimiento:"_toggle_consentimiento_155e9_521",contenedor_subir_oculto:"_contenedor_subir_oculto_155e9_529",boton_adjuntar:"_boton_adjuntar_155e9_541",input_archivo:"_input_archivo_155e9_577",input_validacion_firma:"_input_validacion_firma_155e9_585",bloque_firma:"_bloque_firma_155e9_613",bloque_encabezado:"_bloque_encabezado_155e9_635",bloque_titulo:"_bloque_titulo_155e9_647",marca_requerido:"_marca_requerido_155e9_663",bloque_preview:"_bloque_preview_155e9_673",bloque_preview_imagen:"_bloque_preview_imagen_155e9_701",bloque_preview_placeholder:"_bloque_preview_placeholder_155e9_715",bloque_acciones:"_bloque_acciones_155e9_729",accion_agregar_firma:"_accion_agregar_firma_155e9_743",accion_eliminar_firma:"_accion_eliminar_firma_155e9_745"},kf=8,Ef=1.2,ln=4.2,If=1.8,Fi=(e,t,n)=>Math.max(t,Math.min(n,e)),Nf=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)},Pi=e=>Number.isFinite(e)?e:performance.now(),Mf=()=>{const e=v.useRef(null),[t,n]=v.useState(!0),[o,r]=v.useState(!1),[s,i]=v.useState([]),l=v.useRef([]),c=v.useRef({color:"#111827",enabled:!0}),d=v.useRef(null),_=v.useRef([]),g=v.useRef(0),f=v.useRef(ln),u=v.useRef(!1),p=v.useCallback(()=>e.current?.getContext("2d")??null,[]),h=v.useCallback(()=>p(),[p]),m=v.useCallback(()=>{const $=e.current,b=p();$&&b&&b.clearRect(0,0,$.width,$.height),n(!0),l.current=[],i([]),_.current=[],d.current=null,f.current=ln,u.current=!1},[p]),y=v.useCallback(()=>{u.current=!0,n(!1)},[]),w=v.useCallback(($,b)=>{const S=Math.max(1,b.t-$.t),D=Nf($,b)/S,I=(ln-D*If)*Fi(b.pressure||.5,.35,1),F=Fi(I,Ef,ln),z=f.current+(F-f.current)*.25;return f.current=z,z},[]),C=v.useCallback(($,b)=>{$.strokeStyle=c.current.color,$.lineWidth=b,$.lineCap="round",$.lineJoin="round"},[]),k=v.useCallback(($,b)=>{const S=h();if(!S)return;const O=w($,b);C(S,O),S.beginPath(),S.moveTo($.x,$.y),S.quadraticCurveTo($.x,$.y,b.x,b.y),S.stroke(),n(!1)},[w,h,C]),A=v.useCallback($=>{const b=e.current;if(!b)return{pressure:.5,t:performance.now(),x:0,y:0};const S=b.getBoundingClientRect(),O=b.width/S.width,D=b.height/S.height;return{pressure:$.pressure&&$.pressure>0?$.pressure:.5,t:$.timeStamp||performance.now(),x:($.clientX-S.left)*O,y:($.clientY-S.top)*D}},[]),T=v.useCallback($=>{if(!c.current.enabled)return;$.preventDefault();const b=e.current;if(!b)return;b.setPointerCapture($.pointerId);const S=A($);r(!0),d.current=S,_.current=[S],g.current=Pi($.timeStamp)},[A]),M=v.useCallback($=>{if(!o||!c.current.enabled)return;$.preventDefault();const b=Pi($.timeStamp);if(b-g.current<kf)return;g.current=b;const S=A($),O=d.current;O&&(k(O,S),d.current=S,_.current.push(S))},[k,o,A]),P=v.useCallback($=>{if($&&e.current?.hasPointerCapture($.pointerId)&&e.current.releasePointerCapture($.pointerId),o&&_.current.length>0){const b=[...l.current,{puntos:[..._.current]}];l.current=b,i(b)}r(!1),d.current=null,_.current=[]},[o]),L=v.useCallback(($,b,S)=>{if(!(b.puntos.length<2))for(let O=1;O<b.puntos.length;O++){const D=b.puntos[O-1],x=b.puntos[O],I=w(D,x);$.strokeStyle=S??c.current.color,$.lineWidth=I,$.lineCap="round",$.lineJoin="round",$.beginPath(),$.moveTo(D.x,D.y),$.quadraticCurveTo(D.x,D.y,x.x,x.y),$.stroke()}},[w]),E=v.useCallback(()=>{if(l.current.length===0)return;const $=l.current.slice(0,-1);l.current=$,i($);const b=e.current;if(!b)return;const S=p();S&&(S.clearRect(0,0,b.width,b.height),f.current=ln,$.forEach(O=>L(S,O)),n($.length===0&&!u.current))},[p,L]),B=v.useCallback(($={})=>{const b=e.current;if(!b||t&&l.current.length===0&&!u.current)return null;const{backgroundColor:S,format:O,quality:D,strokeColor:x}=$;if(!S&&!x)return b.toDataURL("image/png");const I=document.createElement("canvas");I.width=b.width,I.height=b.height;const F=I.getContext("2d");if(!F)return null;S&&(F.fillStyle=S,F.fillRect(0,0,I.width,I.height)),x&&l.current.length>0&&!u.current?(f.current=ln,l.current.forEach(H=>L(F,H,x))):F.drawImage(b,0,0);const j=O??"image/png",z=D??.85;return j==="image/png"?I.toDataURL(j):I.toDataURL(j,z)},[t,L]),V=v.useCallback($=>{const b=e.current,S=p();if(!b||!S)return;if(c.current={color:$.color,enabled:$.enabled??!0},b.style.touchAction="none",b.style.userSelect="none",!c.current.enabled)return()=>{};const O=F=>T(F),D=F=>M(F),x=F=>P(F),I=F=>P(F);return b.addEventListener("pointerdown",O,{passive:!1}),b.addEventListener("pointermove",D,{passive:!1}),b.addEventListener("pointerup",x,{passive:!1}),b.addEventListener("pointerleave",x,{passive:!1}),b.addEventListener("pointercancel",I,{passive:!1}),()=>{b.removeEventListener("pointerdown",O),b.removeEventListener("pointermove",D),b.removeEventListener("pointerup",x),b.removeEventListener("pointerleave",x),b.removeEventListener("pointercancel",I)}},[P,T,M,p]);return v.useEffect(()=>{f.current=ln},[s.length]),{canvasRef:e,configurarCanvas:V,deshacerUltimoTrazo:E,estaVacio:t,limpiarCanvas:m,marcarConContenido:y,obtenerDatosFirma:B,puedeDeshacer:s.length>0}},Li=v.forwardRef(({alto:e=200,ancho:t=700,aspectRatio:n,className:o,closeOnBackdropClick:r=!1,firmaInicial:s=null,isOpen:i=!1,isRequired:l=!1,mostrarBotonSubir:c=!0,name:d,onClose:_,onConfirm:g,readonly:f=!1,readonlyPostGuardado:u=!1,requiredMessage:p="Se debe registrar una firma para continuar",textoAdjuntar:h="Adjuntar firma",textoConsentimiento:m="Al firmar, confirmo que he leído y acepto todos los términos contractuales",textoDeshacer:y="Deshacer",textoEliminarFirma:w="Eliminar firma",textoEstadoGuardada:C="Guardada",textoEstadoPendiente:k="Pendiente",textoGuardar:A="Guardar firma",textoLimpiar:T="Limpiar",textoModificar:M="Modificar firma",textoReemplazarFirma:P="Reemplazar firma",textoSolicitarFirma:L="Agregar firma",tituloBloque:E="Firma del responsable",titulo:B="Firmar el contrato",mostrarBotonAgregarFirma:V=!0,mostrarBotonEliminarFirma:$=!0,firebasePath:b,onFirebaseUploadSuccess:S,onFirebaseUploadError:O},D)=>{const{canvasRef:x,configurarCanvas:I,deshacerUltimoTrazo:F,estaVacio:j,limpiarCanvas:z,marcarConContenido:H,obtenerDatosFirma:X,puedeDeshacer:G}=Mf(),ue=v.useRef(null),oe=v.useRef(null),ie=v.useRef(null),_e=v.useId(),ge=`${_e}-toggle`,ke=`${_e}-texto`,J=`${_e}-dialog-title`,re=`${_e}-dialog-description`,[Y,ye]=v.useState(!!i),[ce,ee]=v.useState(!1),[ne,xe]=v.useState(s),[de,Se]=v.useState(t),[U,q]=v.useState(!1),[R,fe]=v.useState(!!s),[he,pe]=v.useState(!1),[Ue,Je]=v.useState(!1),nt=Math.round(de*e/Math.max(1,t)),ve=f||u&&R,Ze=!f&&!(u&&R),ot=v.useCallback(me=>{const we=x.current,vt=we?.getContext("2d");if(!we||!vt)return;const yt=new Image;yt.onload=()=>{vt.clearRect(0,0,we.width,we.height);const Mn=we.width/we.height,oo=yt.width/yt.height;let An=we.width,ro=we.height,ar=0,lr=0;oo>Mn?(ro=we.width/oo,lr=(we.height-ro)/2):(An=we.height*oo,ar=(we.width-An)/2),vt.drawImage(yt,ar,lr,An,ro),H(),pe(!0)},yt.src=me},[x,H]),be=v.useCallback(()=>{ve||(z(),xe(null),pe(!1),fe(!1))},[ve,z]),Ce=v.useCallback(()=>{f||(z(),fe(!1),pe(!1),q(!1))},[z,f]),Re=v.useCallback(me=>{if(ve)return;const we=me.target.files?.[0];if(!we)return;const vt=new FileReader;vt.onload=yt=>{const Mn=yt.target?.result;typeof Mn=="string"&&(z(),ot(Mn))},vt.readAsDataURL(we)},[ve,ot,z]),Ae=v.useCallback(()=>{ve||ue.current?.click()},[ve]),rt=v.useCallback(()=>{q(!1),pe(!1),z()},[z]),te=v.useCallback(me=>{ce||(ee(!0),setTimeout(()=>{ye(!1),ee(!1),me?.()},650))},[ce]),Ee=v.useCallback(()=>{te(()=>{rt(),_?.()})},[te,rt,_]),ze=v.useCallback(async()=>{if(ve||ce||Ue)return;const me=X({backgroundColor:"#ffffff",format:"image/jpeg",quality:.82,strokeColor:"#111827"});if(!me||!U)return;let we=me;try{if(b){Je(!0);const vt=hf(),yt=gf(vt,b);await ff(yt,me,"data_url"),we=await _f(yt),S?.(we)}te(()=>{xe(we),fe(!0),g?.(we),rt(),_?.()})}catch(vt){console.error("Error al subir la firma a Firebase:",vt),O?.(vt instanceof Error?vt:new Error(String(vt)))}finally{b&&Je(!1)}},[U,ve,te,b,rt,X,_,g,O,S,ce,Ue]);v.useEffect(()=>{i&&(ye(!0),ee(!1))},[i]),v.useEffect(()=>{xe(s),fe(!!s)},[s]),v.useEffect(()=>{if(!Y)return;const me=()=>{const we=ie.current;we&&Se(Math.max(1,Math.floor(we.clientWidth)))};return me(),window.addEventListener("resize",me),()=>window.removeEventListener("resize",me)},[t,Y]),v.useImperativeHandle(D,()=>({limpiar:z,obtenerDatosFirma:X,estaVacio:()=>j}),[j,z,X]),v.useEffect(()=>{if(!Y)return;const me=I({color:"#111827",enabled:!ve});return()=>{me?.()}},[ve,I,Y]),v.useEffect(()=>{if(!Y){document.body.style.overflow="";return}const me=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",me>0&&(document.body.style.paddingRight=`${me}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[Y]),v.useEffect(()=>{Y||rt()},[rt,Y]),v.useEffect(()=>{if(!Y)return;const me=we=>{if(we.key==="Escape"){Ee();return}if(we.ctrlKey&&we.key.toLowerCase()==="z"){we.preventDefault(),!ve&&G&&F();return}we.ctrlKey&&we.key==="Enter"&&(we.preventDefault(),ve||ze())};return document.addEventListener("keydown",me),()=>document.removeEventListener("keydown",me)},[ve,F,Ee,ze,Y,G]),v.useEffect(()=>{const me=oe.current;if(!me)return;if(l&&!!!ne){me.setCustomValidity(p);return}me.setCustomValidity("")},[ne,l,p]);const Oe=v.useCallback(me=>{ce||!r||me.target===me.currentTarget&&Ee()},[r,ce,Ee]),pt=ve,wt=ve||he,mt=ve||!R&&(j&&!he||!U),Pt=()=>{f||(ne&&Ce(),ee(!1),ye(!0))};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${se.bloque_firma} ${o||""}`,children:[a.jsxs("div",{className:se.bloque_encabezado,children:[a.jsxs("span",{className:se.bloque_titulo,children:[E,l&&a.jsx("span",{className:se.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsx(Di,{color:ne?"success":"warning",size:"sm",variant:"outline",children:ne?C:k})]}),a.jsxs("div",{className:se.bloque_preview,style:n?{aspectRatio:n}:void 0,children:[(l||d)&&a.jsx("input",{ref:oe,className:se.input_validacion_firma,"aria-hidden":"true",name:d,required:l,tabIndex:-1,type:"text",value:ne?"signed":"",onChange:()=>{},onInvalid:me=>{l&&!ne&&me.currentTarget.setCustomValidity(p)},onInput:me=>{me.currentTarget.setCustomValidity("")}}),ne?a.jsx("img",{src:ne,alt:"Firma guardada",className:se.bloque_preview_imagen}):a.jsx("span",{className:se.bloque_preview_placeholder,children:"Sin firma registrada"})]}),!f&&(V||$&&!!ne)&&a.jsxs("div",{className:se.bloque_acciones,children:[V&&a.jsx(st,{color:"primary",size:"sm",variant:"solid",onClick:Pt,className:se.accion_agregar_firma,isDisabled:ve||ce,children:a.jsxs("span",{className:se.boton_texto_con_icono,children:[ne?a.jsx(xf,{className:se.icono_boton_accion}):a.jsx(Sf,{className:se.icono_boton_accion}),a.jsx("span",{className:se.accion_texto,children:ne?P:L})]})}),$&&ne&&a.jsx(st,{color:"default",size:"sm",variant:"bordered",onClick:be,className:se.accion_eliminar_firma,isDisabled:ve||ce,children:a.jsxs("span",{className:se.boton_texto_con_icono,children:[a.jsx(Ti,{className:se.icono_boton_accion}),a.jsx("span",{className:se.accion_texto,children:w})]})})]})]}),Y&&a.jsx("div",{className:`${se.backdrop} ${ce?"":se.visible}`,onClick:Oe,children:a.jsxs("div",{className:`${se.modal} ${ce?"":se.visible}`,role:"dialog","aria-modal":"true","aria-labelledby":J,"aria-describedby":re,children:[a.jsxs("header",{className:se.encabezado,children:[a.jsx("h2",{id:J,className:se.titulo,children:B}),a.jsxs("button",{className:se.boton_cerrar,onClick:Ee,type:"button","aria-label":"Cerrar",children:[a.jsx("span",{className:se.texto_esc,children:"ESC"}),a.jsx(wf,{className:se.icono_x})]})]}),a.jsxs("div",{className:se.cuerpo_modal,children:[a.jsx("div",{className:se.contenedor_lienzo,ref:ie,children:a.jsxs("div",{className:se.area_firma,children:[a.jsx("div",{className:se.superficie_lienzo,children:a.jsx("canvas",{ref:x,className:`${se.lienzo} ${pt?se.lienzo_deshabilitado:""}`,width:de,height:nt,style:{height:`${nt}px`,pointerEvents:wt?"none":"auto",width:"100%"},"aria-label":"Area de firma"})}),Ze&&a.jsxs("div",{className:se.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[a.jsxs("div",{className:se.grupo_izquierda,children:[a.jsxs("button",{className:se.boton_accion,onClick:F,type:"button",disabled:!G||pt,"aria-label":y,children:[a.jsx(yf,{className:se.icono,"aria-hidden":"true"}),a.jsx("span",{children:y})]}),a.jsx("span",{className:se.separador,"aria-hidden":"true",children:"|"}),a.jsxs("button",{className:se.boton_accion,onClick:be,type:"button",disabled:j&&!he||pt,"aria-label":T,children:[a.jsx(Ti,{className:se.icono,"aria-hidden":"true"}),a.jsx("span",{children:T})]})]}),c&&a.jsx("div",{className:se.grupo_derecha,children:a.jsxs("button",{className:se.boton_adjuntar,onClick:Ae,type:"button",disabled:ve,children:[a.jsx(Cf,{className:se.icono,"aria-hidden":"true"}),h]})})]})]})}),Ze&&a.jsxs(a.Fragment,{children:[a.jsx("div",{id:re,className:se.contenedor_consentimiento,children:a.jsxs("div",{className:se.consentimiento_fila,children:[a.jsx(Ar,{id:ge,isSelected:U,onChange:q,color:"primary",size:"md",isDisabled:ve,"aria-describedby":ke,className:se.toggle_consentimiento}),a.jsx("label",{htmlFor:ge,id:ke,className:se.texto_consentimiento,children:m})]})}),a.jsx("div",{className:se.contenedor_guardar,children:a.jsx(st,{color:"primary",variant:"solid",radius:"full",size:"md",onClick:R&&!u?Ce:ze,type:"button",isLoading:Ue,isDisabled:mt||Ue,startContent:Ue?void 0:a.jsx($f,{className:se.icono,"aria-hidden":"true"}),children:Ue?"Guardando...":R&&!u?M:A})})]}),Ze&&c&&a.jsx("div",{className:se.contenedor_subir_oculto,children:a.jsx("input",{ref:ue,type:"file",accept:"image/*",className:se.input_archivo,onChange:Re,"aria-label":"Subir imagen de firma"})})]})]})})]})});Li.displayName="Signature";const Af="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let _o=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Af[n[e]&63];return t};const Df=({size:e="1em",...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("path",{d:"M18 6 6 18"}),a.jsx("path",{d:"m6 6 12 12"})]}),Tf=({size:e="1em",...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),a.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),Ff=({size:e="1em",...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),a.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),a.jsx("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),a.jsx("path",{d:"m2 2 20 20"})]}),je={contenedor_base:"_contenedor_base_lcpd6_1",tam_sm:"_tam_sm_lcpd6_37",tam_lg:"_tam_lg_lcpd6_49",radio_none:"_radio_none_lcpd6_61",radio_sm:"_radio_sm_lcpd6_69",radio_md:"_radio_md_lcpd6_77",radio_lg:"_radio_lg_lcpd6_85",radio_full:"_radio_full_lcpd6_93",color_default:"_color_default_lcpd6_101",color_primary:"_color_primary_lcpd6_103",color_secondary:"_color_secondary_lcpd6_111",color_success:"_color_success_lcpd6_119",color_warning:"_color_warning_lcpd6_127",color_danger:"_color_danger_lcpd6_135",etiqueta:"_etiqueta_lcpd6_143",marca_requerido:"_marca_requerido_lcpd6_159",envoltorio_input:"_envoltorio_input_lcpd6_169",envoltorio_interno:"_envoltorio_interno_lcpd6_197",entrada:"_entrada_lcpd6_213",contenido_inicio:"_contenido_inicio_lcpd6_267",contenido_final:"_contenido_final_lcpd6_269",boton_limpiar:"_boton_limpiar_lcpd6_287",tiene_contenido:"_tiene_contenido_lcpd6_343",boton_password:"_boton_password_lcpd6_353",descripcion:"_descripcion_lcpd6_405",mensaje_error:"_mensaje_error_lcpd6_417",ancho_total:"_ancho_total_lcpd6_429",variante_bordered:"_variante_bordered_lcpd6_437",variante_faded:"_variante_faded_lcpd6_447",variante_underlined:"_variante_underlined_lcpd6_457",variante_ghost:"_variante_ghost_lcpd6_481",deshabilitado:"_deshabilitado_lcpd6_493",solo_lectura:"_solo_lectura_lcpd6_527",enfocado:"_enfocado_lcpd6_581",valido:"_valido_lcpd6_589",invalido:"_invalido_lcpd6_597",sin_animacion:"_sin_animacion_lcpd6_629"},Oi=v.forwardRef((e,t)=>{const{type:n="text",value:o,defaultValue:r,placeholder:s,variant:i="bordered",color:l="default",size:c="md",radius:d="md",fullWidth:_=!0,disableAnimation:g=!1,label:f,description:u,errorMessage:p,startContent:h,endContent:m,isRequired:y=!1,isReadOnly:w=!1,isDisabled:C=!1,isClearable:k=!1,isInvalid:A,validationState:T,validate:M,className:P,classNames:L,style:E,onChange:B,onClear:V,onValueChange:$,onFocus:b,onBlur:S,onKeyDown:O,id:D,name:x,autoComplete:I,autoFocus:F,maxLength:j,minLength:z,pattern:H,...X}=e,G=v.useRef(null),oe=v.useRef(D??`input-text-${_o(8)}`).current;v.useImperativeHandle(t,()=>G.current);const ie=o!==void 0,[_e,ge]=v.useState(r??""),ke=ie?o:_e,[J,re]=v.useState(!1),[Y,ye]=v.useState(!1),ce=v.useMemo(()=>{if(!M)return null;const Ce=M(ke);return Ce===!0||Ce==null?null:typeof Ce=="string"?Ce:typeof Ce=="object"&&"message"in Ce?Ce.message??"Entrada inválida":"Entrada inválida"},[ke,M]),ee=v.useMemo(()=>A!==void 0?A:T==="invalid"?!0:T==="valid"?!1:!!ce,[A,T,ce]),ne=T==="valid"&&!ee,xe={invalido:ee,mensaje:ce},de=ke.length>0,Se=n==="password",U=Se&&Y?"text":n,q=k&&de&&!w&&!C,R=v.useCallback(Ce=>{if(C||w)return;const Re=Ce.target.value;ie||ge(Re),B?.(Re),$?.(Re)},[ie,C,w,B,$]),fe=v.useCallback(Ce=>{re(!0),b?.(Ce)},[b]),he=v.useCallback(Ce=>{re(!1),S?.(Ce)},[S]),pe=v.useCallback(()=>{C||w||(ie||ge(""),B?.(""),$?.(""),V?.(),G.current?.focus())},[ie,C,w,B,$,V]),Ue=v.useCallback(Ce=>{Ce.key==="Escape"&&k&&de&&pe(),O?.(Ce)},[k,de,pe,O]),Je=v.useCallback(()=>{ye(Ce=>!Ce),requestAnimationFrame(()=>G.current?.focus())},[]),nt=u?`${oe}-desc`:void 0,ve=ee?`${oe}-err`:void 0,Ze=[nt,ve].filter(Boolean).join(" ")||void 0,ot=typeof p=="function"?p(xe):p??ce,be=W(je.contenedor_base,je[`variante_${i}`],je[`tam_${c}`],je[`radio_${d}`],je[`color_${l}`],{[je.ancho_total]:_,[je.sin_animacion]:g,[je.deshabilitado]:C,[je.solo_lectura]:w,[je.invalido]:ee,[je.valido]:ne,[je.enfocado]:J,[je.tiene_contenido]:de},P,L?.base);return a.jsxs("div",{className:be,style:E,children:[f&&a.jsxs("label",{className:W(je.etiqueta,L?.label),htmlFor:oe,children:[f,y&&a.jsx("span",{className:je.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:W(je.envoltorio_input,L?.inputWrapper),children:[h&&a.jsx("span",{className:je.contenido_inicio,children:h}),a.jsx("div",{className:W(je.envoltorio_interno,L?.innerWrapper),children:a.jsx("input",{...X,ref:G,id:oe,name:x,type:U,value:ie?ke:void 0,defaultValue:ie?void 0:r,placeholder:s,disabled:C,readOnly:w,required:y,autoComplete:I,autoFocus:F,maxLength:j,minLength:z,pattern:H,"aria-invalid":ee||void 0,"aria-describedby":Ze,"aria-required":y,className:W(je.entrada,L?.input),onChange:R,onFocus:fe,onBlur:he,onKeyDown:Ue})}),q&&a.jsx("button",{type:"button",className:W(je.boton_limpiar,L?.clearButton),onClick:pe,tabIndex:-1,"aria-label":"Limpiar campo",children:a.jsx(Df,{size:"0.75em"})}),Se&&a.jsx("button",{type:"button",className:je.boton_password,onClick:Je,tabIndex:-1,"aria-label":Y?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":Y,children:Y?a.jsx(Ff,{}):a.jsx(Tf,{})}),m&&a.jsx("span",{className:je.contenido_final,children:m})]}),u&&!ee&&a.jsx("div",{id:nt,className:W(je.descripcion,L?.description),children:u}),ee&&ot&&a.jsx("div",{id:ve,className:W(je.mensaje_error,L?.errorMessage),role:"alert",children:ot})]})});Oi.displayName="InputText";function go(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bn(e,t){if(e==null||Number.isNaN(e))return"";const{separadorMiles:n=!1,separadorDecimal:o=".",escalaDecimal:r,decimalesFijos:s=!1,prefijo:i="",sufijo:l=""}=t;let c;r!==void 0?c=s?e.toFixed(r):String(Math.round(e*Math.pow(10,r))/Math.pow(10,r)):c=String(e);const[d,_]=c.split(".");let g=d;if(n){const u=typeof n=="string"?n:",";g=d.replace(/\B(?=(\d{3})+(?!\d))/g,u)}let f=g;return _!==void 0?f+=o+_:s&&r&&r>0&&(f+=o+"0".repeat(r)),`${i}${f}${l}`}function zi(e,t){if(!e||e.trim()==="")return;const{separadorMiles:n=!1,separadorDecimal:o=".",prefijo:r="",sufijo:s="",permitirNegativo:i=!0}=t;let l=e;if(r&&(l=l.replace(new RegExp(`^${go(r)}`),"")),s&&(l=l.replace(new RegExp(`${go(s)}$`),"")),n){const d=typeof n=="string"?n:",";l=l.replace(new RegExp(go(d),"g"),"")}o!=="."&&(l=l.replace(new RegExp(go(o)),".")),i||(l=l.replace(/-/g,""));const c=parseFloat(l);return Number.isNaN(c)?void 0:c}function ho(e,t,n){let o=e;return t!==void 0&&o<t&&(o=t),n!==void 0&&o>n&&(o=n),o}function Bi(e){return e===!0||e===null||e===void 0?{invalido:!1,mensaje:null}:e===!1?{invalido:!0,mensaje:null}:typeof e=="string"?{invalido:!0,mensaje:e}:typeof e=="object"&&e.message?{invalido:!0,mensaje:e.message}:{invalido:!1,mensaje:null}}function Vi(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}const Pf=e=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[a.jsx("path",{d:"M5 12h14"}),a.jsx("path",{d:"M12 5v14"})]}),Lf=e=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:a.jsx("path",{d:"M5 12h14"})}),qe={contenedor_base:"_contenedor_base_1i8i2_1",tam_sm:"_tam_sm_1i8i2_37",tam_lg:"_tam_lg_1i8i2_49",radio_none:"_radio_none_1i8i2_61",radio_sm:"_radio_sm_1i8i2_69",radio_md:"_radio_md_1i8i2_77",radio_lg:"_radio_lg_1i8i2_85",radio_full:"_radio_full_1i8i2_93",color_default:"_color_default_1i8i2_101",color_primary:"_color_primary_1i8i2_103",color_secondary:"_color_secondary_1i8i2_111",color_success:"_color_success_1i8i2_119",color_warning:"_color_warning_1i8i2_127",color_danger:"_color_danger_1i8i2_135",etiqueta:"_etiqueta_1i8i2_143",marca_requerido:"_marca_requerido_1i8i2_159",envoltorio_input:"_envoltorio_input_1i8i2_169",envoltorio_interno:"_envoltorio_interno_1i8i2_195",entrada:"_entrada_1i8i2_213",contenido_inicio:"_contenido_inicio_1i8i2_279",contenido_final:"_contenido_final_1i8i2_281",controles:"_controles_1i8i2_299",boton_control:"_boton_control_1i8i2_315",variante_bordered:"_variante_bordered_1i8i2_369",variante_faded:"_variante_faded_1i8i2_377",variante_underlined:"_variante_underlined_1i8i2_385",variante_ghost:"_variante_ghost_1i8i2_397",descripcion:"_descripcion_1i8i2_445",mensaje_error:"_mensaje_error_1i8i2_457",ancho_total:"_ancho_total_1i8i2_469",deshabilitado:"_deshabilitado_1i8i2_533",solo_lectura:"_solo_lectura_1i8i2_567",enfocado:"_enfocado_1i8i2_621",valido:"_valido_1i8i2_629",invalido:"_invalido_1i8i2_637",sin_animacion:"_sin_animacion_1i8i2_669"},ji=v.forwardRef((e,t)=>{const{value:n,defaultValue:o,placeholder:r,variant:s="bordered",color:i="default",size:l="md",radius:c="md",fullWidth:d=!0,disableAnimation:_=!1,label:g,description:f,errorMessage:u,startContent:p,endContent:h,isRequired:m=!1,isReadOnly:y=!1,isDisabled:w=!1,isInvalid:C,validationState:k,validate:A,className:T,classNames:M,style:P,min:L,max:E,step:B=1,decimalScale:V,fixedDecimalScale:$=!1,thousandSeparator:b=!1,decimalSeparator:S=".",prefix:O="",suffix:D="",allowNegative:x=!0,allowDecimal:I=!0,hideControls:F=!1,clampBehavior:j="blur",onChange:z,onValueChange:H,onFocus:X,onBlur:G,onKeyDown:ue,id:oe,name:ie,..._e}=e,ge=v.useRef(null),J=v.useRef(oe??`input-numeric-${_o(8)}`).current;v.useImperativeHandle(t,()=>ge.current);const re=n!==void 0,[Y,ye]=v.useState(o!==void 0?o:void 0),[ce,ee]=v.useState(""),[ne,xe]=v.useState(!1),de=re?n===""?void 0:n:Y,Se=v.useMemo(()=>({separadorMiles:b,separadorDecimal:S,escalaDecimal:I?V:0,decimalesFijos:$,prefijo:O,sufijo:D,permitirNegativo:x}),[b,S,V,$,O,D,x,I]),U=v.useMemo(()=>{if(!A)return null;const te=Bi(A(de));return te.invalido?te.mensaje:null},[de,A]),q=v.useMemo(()=>C!==void 0?C:k==="invalid"?!0:k==="valid"?!1:!!U,[C,k,U]),R=k==="valid"&&!q,fe={invalido:q,mensaje:U},he=v.useCallback(te=>{re||ye(te),z?.(te),H?.(Bn(te,Se),te)},[re,z,H,Se]),pe=v.useCallback(te=>{let ze=(de??0)+B*te;j!=="none"&&(ze=ho(ze,L,E)),V!==void 0&&(ze=Vi(ze,V)),he(ze),ee(Bn(ze,Se))},[de,B,L,E,j,V,he,Se]),Ue=v.useCallback(te=>{if(w||y)return;const Ee=te.target.value,ze=S===","?",":".";let Oe="0-9";I&&(Oe+=ze),x&&(Oe+="-");const pt=new RegExp(`[^${Oe}]`,"g");let mt=Ee.replace(pt,"");if(I){const me=mt.split(ze);me.length>2&&(mt=me[0]+ze+me.slice(1).join(""))}if(x&&mt.includes("-")){const me=mt.replace(/-/g,"");mt=mt.startsWith("-")?"-"+me:me}ee(mt);const Pt=zi(mt,Se);if(j==="strict"&&Pt!==void 0){const me=ho(Pt,L,E);he(me)}else he(Pt)},[w,y,Se,j,L,E,he,S,x,I]),Je=v.useCallback(te=>{if(xe(!0),de!==void 0){let Ee=String(de);S!=="."&&(Ee=Ee.replace(".",S)),ee(Ee)}X?.(te)},[de,S,X]),nt=v.useCallback(te=>{if(xe(!1),j==="blur"&&de!==void 0){const Ee=ho(de,L,E);Ee!==de&&he(Ee)}ee(Bn(de,Se)),G?.(te)},[de,j,L,E,he,Se,G]),ve=v.useCallback(te=>{te.key==="ArrowUp"?(te.preventDefault(),pe(1)):te.key==="ArrowDown"&&(te.preventDefault(),pe(-1));const Ee=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],ze=te.ctrlKey||te.metaKey,Oe=I&&(te.key===S||te.key==="."||te.key===","),pt=te.key==="-"&&x,wt=/^[0-9]$/.test(te.key);!Ee.includes(te.key)&&!ze&&!Oe&&!pt&&!wt&&te.preventDefault(),ue?.(te)},[pe,ue,S,x,I]);v.useEffect(()=>{ne||ee(Bn(de,Se))},[de,ne,Se]);const Ze=f?`${J}-desc`:void 0,ot=q?`${J}-err`:void 0,be=[Ze,ot].filter(Boolean).join(" ")||void 0,Ce=typeof u=="function"?u(fe):u??U,Re=E===void 0||(de??0)<E,Ae=L===void 0||(de??0)>L,rt=W(qe.contenedor_base,qe[`variante_${s}`],qe[`tam_${l}`],qe[`radio_${c}`],qe[`color_${i}`],{[qe.ancho_total]:d,[qe.sin_animacion]:_,[qe.deshabilitado]:w,[qe.solo_lectura]:y,[qe.invalido]:q,[qe.valido]:R,[qe.enfocado]:ne},T,M?.base);return a.jsxs("div",{className:rt,style:P,children:[g&&a.jsxs("label",{className:W(qe.etiqueta,M?.label),htmlFor:J,children:[g,m&&a.jsx("span",{className:qe.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:W(qe.envoltorio_input,M?.inputWrapper),children:[a.jsxs("div",{className:W(qe.envoltorio_interno,M?.innerWrapper),children:[p&&a.jsx("span",{className:qe.contenido_inicio,children:p}),a.jsx("input",{..._e,ref:ge,id:J,name:ie,type:"text",inputMode:"decimal",value:ce,placeholder:r,disabled:w,readOnly:y,required:m,"aria-invalid":q||void 0,"aria-describedby":be,"aria-required":m,className:W(qe.entrada,M?.input),onChange:Ue,onFocus:Je,onBlur:nt,onKeyDown:ve}),h&&a.jsx("span",{className:qe.contenido_final,children:h})]}),!F&&!y&&!w&&a.jsxs("div",{className:W(qe.controles,M?.controls),children:[a.jsx("button",{type:"button",tabIndex:-1,className:W(qe.boton_control,M?.controlButton),disabled:!Ae,onClick:()=>pe(-1),"aria-label":"Decrementar valor",children:a.jsx(Lf,{})}),a.jsx("button",{type:"button",tabIndex:-1,className:W(qe.boton_control,M?.controlButton),disabled:!Re,onClick:()=>pe(1),"aria-label":"Incrementar valor",children:a.jsx(Pf,{})})]})]}),f&&!q&&a.jsx("div",{id:Ze,className:W(qe.descripcion,M?.description),children:f}),q&&Ce&&a.jsx("div",{id:ot,className:W(qe.mensaje_error,M?.errorMessage),role:"alert",children:Ce})]})});ji.displayName="InputNumeric";function Of(e){return e===!0||e===null||e===void 0?{invalido:!1,mensaje:null}:e===!1?{invalido:!0,mensaje:null}:typeof e=="string"?{invalido:!0,mensaje:e}:typeof e=="object"&&e.message?{invalido:!0,mensaje:e.message}:{invalido:!1,mensaje:null}}function Dr(e,t="es-CO"){if(!e)return"";const n=new Date(e+"T00:00:00");return Number.isNaN(n.getTime())?"":n.toLocaleDateString(t,{year:"numeric",month:"long",day:"numeric"})}function zf(){return new Date().toISOString().split("T")[0]}function Bf(e,t,n){if(!e)return!0;const o=new Date(e).getTime();return!(t&&o<new Date(t).getTime()||n&&o>new Date(n).getTime())}const Ke={contenedor_base:"_contenedor_base_12h7l_1",tam_sm:"_tam_sm_12h7l_37",tam_lg:"_tam_lg_12h7l_49",radio_none:"_radio_none_12h7l_61",radio_sm:"_radio_sm_12h7l_69",radio_md:"_radio_md_12h7l_77",radio_lg:"_radio_lg_12h7l_85",radio_full:"_radio_full_12h7l_93",color_default:"_color_default_12h7l_101",color_primary:"_color_primary_12h7l_103",color_secondary:"_color_secondary_12h7l_111",color_success:"_color_success_12h7l_119",color_warning:"_color_warning_12h7l_127",color_danger:"_color_danger_12h7l_135",etiqueta:"_etiqueta_12h7l_143",marca_requerido:"_marca_requerido_12h7l_159",envoltorio_input:"_envoltorio_input_12h7l_169",envoltorio_interno:"_envoltorio_interno_12h7l_195",entrada:"_entrada_12h7l_215",boton_icono:"_boton_icono_12h7l_267",enfocado:"_enfocado_12h7l_323",deshabilitado:"_deshabilitado_12h7l_331",solo_lectura:"_solo_lectura_12h7l_333",boton_limpiar:"_boton_limpiar_12h7l_343",contenido_inicio:"_contenido_inicio_12h7l_401",descripcion:"_descripcion_12h7l_419",mensaje_error:"_mensaje_error_12h7l_431",ancho_total:"_ancho_total_12h7l_443",variante_bordered:"_variante_bordered_12h7l_451",variante_faded:"_variante_faded_12h7l_461",variante_underlined:"_variante_underlined_12h7l_471",variante_ghost:"_variante_ghost_12h7l_487",valido:"_valido_12h7l_597",invalido:"_invalido_12h7l_605",sin_animacion:"_sin_animacion_12h7l_637"},Vf=()=>a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]}),jf=()=>a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M8 2v4"}),a.jsx("path",{d:"M16 2v4"}),a.jsx("rect",{height:"18",rx:"2",width:"18",x:"3",y:"4"}),a.jsx("path",{d:"M3 10h18"}),a.jsx("circle",{cx:"8",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"12",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"16",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"8",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"12",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"16",cy:"18",r:"1",fill:"currentColor",stroke:"none"})]}),qf=()=>a.jsxs("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M18 6 6 18"}),a.jsx("path",{d:"m6 6 12 12"})]}),Hf=({tipo:e,onClick:t,onMouseDown:n})=>a.jsx("button",{type:"button",tabIndex:-1,className:Ke.boton_icono,onMouseDown:n,onClick:t,"aria-label":e==="time"?"Abrir selector de hora":"Abrir selector de fecha",children:e==="time"?a.jsx(Vf,{}):a.jsx(jf,{})}),qi=v.forwardRef((e,t)=>{const{type:n="date",value:o,defaultValue:r,placeholder:s,variant:i="bordered",color:l="default",size:c="md",radius:d="md",fullWidth:_=!0,disableAnimation:g=!1,label:f,description:u,errorMessage:p,startContent:h,isRequired:m=!1,isReadOnly:y=!1,isDisabled:w=!1,isInvalid:C,validationState:k,validate:A,className:T,classNames:M,style:P,min:L,max:E,isClearable:B=!1,onChange:V,onFocus:$,onBlur:b,id:S,name:O,...D}=e,x=v.useRef(null),F=v.useRef(S??`input-date-${_o(8)}`).current;v.useImperativeHandle(t,()=>x.current);const j=o!==void 0,[z,H]=v.useState(r??""),X=j?o:z,[G,ue]=v.useState(!1),oe=v.useRef(!1),ie=v.useMemo(()=>{if(X&&n!=="time"&&(L||E)){if(L&&X<L)return`La fecha debe ser ${n==="date"?Dr(L):L} o posterior`;if(E&&X>E)return`La fecha debe ser ${n==="date"?Dr(E):E} o anterior`}if(!A)return null;const q=Of(A(X));return q.invalido?q.mensaje:null},[X,A,L,E,n]),_e=v.useMemo(()=>C!==void 0?C:k==="invalid"?!0:k==="valid"?!1:!!ie,[C,k,ie]),ge=k==="valid"&&!_e,ke={invalido:_e,mensaje:ie},J=v.useCallback(q=>{if(w||y)return;oe.current=!1;const R=q.target.value;j||H(R),V?.(R)},[j,w,y,V]),re=v.useCallback(q=>{ue(!0),$?.(q)},[$]),Y=v.useCallback(q=>{ue(!1),oe.current=!1,b?.(q)},[b]),ye=v.useCallback(q=>{q.preventDefault()},[]),ce=v.useCallback(q=>{if(q.preventDefault(),q.stopPropagation(),!(!x.current||w||y)){if(oe.current){oe.current=!1,x.current.blur();return}x.current.focus();try{x.current.showPicker?.(),oe.current=!0}catch{}}},[w,y]),ee=v.useCallback(q=>{q.preventDefault(),q.stopPropagation(),oe.current=!1,j||H(""),V?.(""),x.current?.focus()},[j,V]),ne=u?`${F}-desc`:void 0,xe=_e?`${F}-err`:void 0,de=[ne,xe].filter(Boolean).join(" ")||void 0,Se=typeof p=="function"?p(ke):p??ie,U=W(Ke.contenedor_base,Ke[`variante_${i}`],Ke[`tam_${c}`],Ke[`radio_${d}`],Ke[`color_${l}`],{[Ke.ancho_total]:_,[Ke.sin_animacion]:g,[Ke.deshabilitado]:w,[Ke.solo_lectura]:y,[Ke.invalido]:_e,[Ke.valido]:ge,[Ke.enfocado]:G},T,M?.base);return a.jsxs("div",{className:U,style:P,children:[f&&a.jsxs("label",{className:W(Ke.etiqueta,M?.label),htmlFor:F,children:[f,m&&a.jsx("span",{className:Ke.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsx("div",{className:W(Ke.envoltorio_input,M?.inputWrapper),children:a.jsxs("div",{className:W(Ke.envoltorio_interno,M?.innerWrapper),children:[h&&a.jsx("span",{className:Ke.contenido_inicio,children:h}),a.jsx("input",{...D,ref:x,id:F,name:O,type:n,value:j?X:void 0,defaultValue:j?void 0:r,placeholder:s,disabled:w,readOnly:y,required:m,min:L,max:E,"aria-invalid":_e||void 0,"aria-describedby":de,"aria-required":m,className:W(Ke.entrada,M?.input),onChange:J,onFocus:re,onBlur:Y}),B&&X&&!w&&!y&&a.jsx("button",{type:"button",tabIndex:-1,className:W(Ke.boton_limpiar,M?.clearButton),onMouseDown:q=>q.preventDefault(),onClick:ee,"aria-label":"Limpiar fecha",children:a.jsx(qf,{})}),a.jsx(Hf,{tipo:n,onClick:ce,onMouseDown:ye})]})}),u&&!_e&&a.jsx("div",{id:ne,className:W(Ke.descripcion,M?.description),children:u}),_e&&Se&&a.jsx("div",{id:xe,className:W(Ke.mensaje_error,M?.errorMessage),role:"alert",children:Se})]})});qi.displayName="InputDate";const Rf={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function po({mostrar:e,children:t,tipo:n="desvanecerDeslizar",className:o,...r}){const[s,i]=v.useState(e),[l,c]=v.useState(e?"entrada":null);e&&!s?(i(!0),c("entrada")):!e&&s&&l!=="salida"&&c("salida");const d=()=>{l==="entrada"?c(null):l==="salida"&&(i(!1),c(null))};if(!s)return null;const _=Rf[n||"desvanecer"],g=l?`transicion_${_}_${l}`:"";return a.jsx("div",{...r,onAnimationEnd:d,className:`${g} ${o||""}`.trim(),children:t})}const Ot={badges_wrap:"_badges_wrap_asqih_15",badges_wrap_visible:"_badges_wrap_visible_asqih_23",acciones_grupo:"_acciones_grupo_asqih_33",badge_voz:"_badge_voz_asqih_41",badge_sm:"_badge_sm_asqih_73",badge_md:"_badge_md_asqih_85",badge_lg:"_badge_lg_asqih_97",badge_estirada:"_badge_estirada_asqih_109",badge_icono:"_badge_icono_asqih_129",badge_texto:"_badge_texto_asqih_155",badge_mic:"_badge_mic_asqih_165",badge_tts:"_badge_tts_asqih_173",badge_ondas:"_badge_ondas_asqih_181",badgeOnda:"_badgeOnda_asqih_1",badge_eq:"_badge_eq_asqih_219",badgeEq:"_badgeEq_asqih_1"};function Tr(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:a.jsxs("g",{fill:"currentColor",children:[a.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),a.jsx("path",{d:"M8 11a4 4 0 0 1-4-4H2a6 6 0 0 0 5 5.917V14H5v2h6v-2H9v-1.083A6 6 0 0 0 14 7h-2a4 4 0 0 1-4 4"})]})})}function Fr(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...e,children:a.jsx("path",{fill:"currentColor",d:"M18 5.433c0-1.398-1.742-2.036-2.645-.97l-4.086 4.83A2 2 0 0 1 9.743 10H6a4 4 0 0 0-4 4v4a4 4 0 0 0 4 4h3.743a2 2 0 0 1 1.526.708l4.086 4.829c.902 1.066 2.645.428 2.645-.97zm3.433 3.743a1 1 0 0 1 1.391.258c1.465 2.13 2.238 4.324 2.238 6.566s-.773 4.436-2.238 6.567a1 1 0 1 1-1.648-1.133c1.285-1.87 1.887-3.676 1.887-5.434s-.602-3.564-1.887-5.433a1 1 0 0 1 .258-1.39m4.257-3.9a1 1 0 0 0-1.38 1.448c2.387 2.273 3.628 5.739 3.628 9.276s-1.241 7.003-3.628 9.276a1 1 0 0 0 1.38 1.448c2.863-2.727 4.247-6.761 4.247-10.724S28.554 8.003 25.69 5.276"})})}function Hi(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...e,children:[a.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),a.jsx("path",{fill:"currentColor",d:"M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2m0 16a6 6 0 1 1 6-6a6.007 6.007 0 0 1-6 6"})]})}function Pr({tipo:e,texto:t,size:n="md",estirar:o}){const r=e==="mic";return a.jsxs("span",{className:W(Ot.badge_voz,r?Ot.badge_mic:Ot.badge_tts,Ot[`badge_${n}`],o&&Ot.badge_estirada),"data-tipo":e,children:[a.jsx("span",{className:Ot.badge_icono,children:r?a.jsx(Tr,{}):a.jsx(Fr,{})}),a.jsx("span",{className:Ot.badge_texto,children:t}),r?a.jsxs("span",{className:Ot.badge_ondas,"aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{})]}):a.jsxs("span",{className:Ot.badge_eq,"aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{})]})]})}function Ri({value:e,onChange:t,isDisabled:n,isReadOnly:o,onDictadoCompleto:r,idioma:s="es-ES"}){const[i,l]=v.useState(!1),[c,d]=v.useState(!1),[_,g]=v.useState(null),f=v.useRef(null),u=v.useRef(null),p=v.useRef(null),h=v.useRef(""),m=typeof window<"u"&&"speechSynthesis"in window,y=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),w=v.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),m&&window.speechSynthesis.cancel(),u.current=null,l(!1)},[m]),C=v.useCallback(()=>{if(!m||!e)return;if(w(),f.current){try{f.current.stop()}catch(M){console.error("Error stopping recognition:",M)}f.current=null,d(!1)}const T=new SpeechSynthesisUtterance(e);T.lang=s,T.onstart=()=>l(!0),T.onend=()=>{l(!1),u.current=null},T.onerror=()=>{l(!1),u.current=null},u.current=T,window.speechSynthesis.speak(T)},[m,e,s,w]),k=v.useCallback(()=>{if(f.current)try{f.current.stop()}catch(T){console.error("Error stopping recognition:",T)}d(!1),g(null)},[]),A=v.useCallback(()=>{if(!y||n||o)return;w();const T=window,M=T.SpeechRecognition||T.webkitSpeechRecognition;if(!M){g("Navegador no compatible");return}try{const P=new M;P.continuous=!0,P.interimResults=!0,P.lang=s,P.onstart=()=>{d(!0),g(null),h.current=e||""},P.onend=()=>{d(!1),f.current=null,r?.()},P.onerror=L=>{L.error!=="no-speech"&&(d(!1),f.current=null,L.error!=="aborted"&&g("Error al reconocer voz"))},P.onresult=L=>{try{let E="";for(let $=0;$<L.results.length;$++)E+=L.results[$][0].transcript;const B=h.current&&E?" ":"",V=h.current+B+E;t(V)}catch{g("Error procesando dictado")}},f.current=P,P.start()}catch{g("No se pudo iniciar dictado"),d(!1)}},[y,n,o,e,t,s,w,r]);return v.useEffect(()=>()=>{p.current&&clearTimeout(p.current),m&&window.speechSynthesis.cancel(),f.current&&f.current.abort()},[m]),{puedeHablar:m,puedeEscuchar:y,hablando:i,escuchando:c,errorDictado:_,escuchar:C,detenerHablar:w,dictar:A,detenerDictado:k}}function Uf({size:e="1em",className:t}){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:e,height:e,className:t,"aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}const Fe={contenedor_base:"_contenedor_base_126y1_1",tam_sm:"_tam_sm_126y1_29",tam_lg:"_tam_lg_126y1_41",radio_none:"_radio_none_126y1_53",radio_sm:"_radio_sm_126y1_61",radio_md:"_radio_md_126y1_69",radio_lg:"_radio_lg_126y1_77",radio_full:"_radio_full_126y1_85",color_default:"_color_default_126y1_93",color_primary:"_color_primary_126y1_95",color_secondary:"_color_secondary_126y1_103",color_success:"_color_success_126y1_111",color_warning:"_color_warning_126y1_119",color_danger:"_color_danger_126y1_127",etiqueta:"_etiqueta_126y1_135",marca_requerido:"_marca_requerido_126y1_151",envoltorio_input:"_envoltorio_input_126y1_161",entrada:"_entrada_126y1_187",sin_autosize:"_sin_autosize_126y1_237",barra_acciones:"_barra_acciones_126y1_245",badges_contenedor:"_badges_contenedor_126y1_265",botones_grupo:"_botones_grupo_126y1_279",boton_accion:"_boton_accion_126y1_291",boton_activo_tts:"_boton_activo_tts_126y1_353",haloTts:"_haloTts_126y1_1",boton_activo_mic:"_boton_activo_mic_126y1_383",haloMic:"_haloMic_126y1_1",boton_limpiar:"_boton_limpiar_126y1_471",descripcion:"_descripcion_126y1_519",mensaje_error:"_mensaje_error_126y1_531",ancho_total:"_ancho_total_126y1_543",variante_bordered:"_variante_bordered_126y1_551",variante_faded:"_variante_faded_126y1_561",variante_underlined:"_variante_underlined_126y1_581",variante_ghost:"_variante_ghost_126y1_615",deshabilitado:"_deshabilitado_126y1_635",solo_lectura:"_solo_lectura_126y1_669",enfocado:"_enfocado_126y1_729",valido:"_valido_126y1_737",invalido:"_invalido_126y1_745",sin_animacion:"_sin_animacion_126y1_777"},Ui=v.forwardRef((e,t)=>{const{children:n,variant:o="bordered",color:r="default",size:s="md",radius:i="md",fullWidth:l=!0,disableAnimation:c=!1,label:d,description:_,errorMessage:g,value:f,defaultValue:u,placeholder:p,isRequired:h=!1,isReadOnly:m=!1,isDisabled:y=!1,isClearable:w=!1,isInvalid:C,validationState:k,validate:A,minRows:T=4,maxRows:M=10,disableAutosize:P=!1,hideVoiceActions:L=!1,className:E,classNames:B,style:V,onChange:$,onClear:b,onFocus:S,onBlur:O,id:D,name:x,rows:I,...F}=e,j=v.useRef(null),H=v.useRef(D??`textarea-${_o(8)}`).current;v.useImperativeHandle(t,()=>j.current);const X=f!==void 0,[G,ue]=v.useState(u??""),oe=X?f:G,[ie,_e]=v.useState(!1),ge=v.useMemo(()=>{if(!A)return null;const te=A(oe);return te===!0||te==null?null:typeof te=="string"?te:typeof te=="object"&&"message"in te?te.message??"Entrada inválida":"Entrada inválida"},[oe,A]),ke=v.useMemo(()=>C!==void 0?C:k==="invalid"?!0:k==="valid"?!1:!!ge,[C,k,ge]),J=k==="valid"&&!ke,re={invalido:ke,mensaje:ge},Y=oe.length>0,ye=v.useCallback(()=>{if(!j.current||P)return;const te=j.current,Ee=window.getComputedStyle(te),ze=parseFloat(Ee.lineHeight)||parseFloat(Ee.fontSize)*1.5,Oe=parseFloat(Ee.paddingTop)||0,pt=parseFloat(Ee.paddingBottom)||0,wt=parseFloat(Ee.borderTopWidth)||0,mt=parseFloat(Ee.borderBottomWidth)||0,Pt=T*ze+Oe+pt+wt+mt,me=M*ze+Oe+pt+wt+mt;te.style.height="auto";const we=te.scrollHeight;te.style.height=`${Math.min(Math.max(we,Pt),me)}px`},[P,T,M]);v.useEffect(()=>{P||ye()},[oe,ye,P]);const ce=v.useCallback(te=>{X||ue(te),$?.(te)},[X,$]),{puedeHablar:ee,hablando:ne,escuchar:xe,detenerHablar:de,puedeEscuchar:Se,escuchando:U,errorDictado:q,dictar:R,detenerDictado:fe}=Ri({isDisabled:y||L,isReadOnly:m,value:oe,onChange:ce}),he=v.useCallback(te=>{if(y||m)return;const Ee=te.target.value;X||ue(Ee),$?.(Ee)},[X,y,m,$]),pe=v.useCallback(te=>{_e(!0),S?.(te)},[S]),Ue=v.useCallback(te=>{_e(!1),O?.(te)},[O]),Je=v.useCallback(()=>{y||m||(X||ue(""),$?.(""),b?.(),j.current?.focus())},[X,y,m,$,b]),nt=v.useCallback(()=>{ne?de():xe()},[ne,xe,de]),ve=v.useCallback(()=>{U?fe():R()},[U,R,fe]),Ze=_?`${H}-desc`:void 0,ot=ke||q?`${H}-err`:void 0,be=[Ze,ot].filter(Boolean).join(" ")||void 0,Ce=typeof g=="function"?g(re):g??ge,Re=w&&Y&&!m&&!y,Ae=!L||Re,rt=W(Fe.contenedor_base,Fe[`variante_${o}`],Fe[`tam_${s}`],Fe[`radio_${i}`],Fe[`color_${r}`],{[Fe.ancho_total]:l,[Fe.sin_animacion]:c,[Fe.deshabilitado]:y,[Fe.solo_lectura]:m,[Fe.invalido]:ke,[Fe.valido]:J,[Fe.enfocado]:ie},E,B?.base);return a.jsxs("div",{className:rt,style:V,children:[d&&a.jsxs("label",{className:W(Fe.etiqueta,B?.label),htmlFor:H,children:[d,h&&a.jsx("span",{className:Fe.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:W(Fe.envoltorio_input,B?.inputWrapper),children:[a.jsx("textarea",{...F,ref:j,id:H,name:x,placeholder:p,value:X?oe:void 0,defaultValue:X?void 0:u,onChange:he,onFocus:pe,onBlur:Ue,className:W(Fe.entrada,P&&Fe.sin_autosize,B?.input),readOnly:m,disabled:y,rows:I??T,"aria-invalid":ke||void 0,"aria-describedby":be,"aria-required":h,required:h}),Ae&&a.jsxs("div",{className:W(Fe.barra_acciones,B?.actions),children:[a.jsxs("div",{className:Fe.badges_contenedor,"aria-live":"polite",role:"status",children:[a.jsx(po,{mostrar:U,children:a.jsx(Pr,{tipo:"mic",texto:"Escuchando...",size:s==="lg"?"md":"sm"})}),a.jsx(po,{mostrar:ne,children:a.jsx(Pr,{tipo:"tts",texto:"Leyendo...",size:s==="lg"?"md":"sm"})})]}),a.jsxs("div",{className:Fe.botones_grupo,children:[!L&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:W(Fe.boton_accion,ne&&Fe.boton_activo_tts),onClick:nt,disabled:!ee||!ne&&(!oe||U),title:ne?"Detener lectura":"Leer texto","aria-pressed":ne,"aria-label":ne?"Detener lectura":"Leer texto",children:a.jsx(Fr,{})}),Se&&a.jsx("button",{type:"button",className:W(Fe.boton_accion,U&&Fe.boton_activo_mic),onClick:ve,disabled:y||m||ne,title:U?"Detener dictado":"Dictar texto","aria-pressed":U,"aria-label":U?"Detener dictado":"Dictar texto",children:U?a.jsx(Hi,{}):a.jsx(Tr,{})})]}),Re&&a.jsx("button",{type:"button",className:Fe.boton_limpiar,onClick:Je,title:"Limpiar campo","aria-label":"Limpiar campo",children:a.jsx(Uf,{size:"0.75em"})})]})]})]}),_&&!ke&&a.jsx("div",{id:Ze,className:W(Fe.descripcion,B?.description),children:_}),ke&&Ce||q?a.jsxs("div",{id:ot,className:W(Fe.mensaje_error,B?.errorMessage),role:"alert",children:[Ce,Ce&&q&&a.jsx("br",{}),q&&a.jsxs("span",{children:["Error de voz: ",q]})]}):null,n]})});Ui.displayName="TextArea";function mo(){return typeof window<"u"}function Xt(e){return Lr(e)?(e.nodeName||"").toLowerCase():"#document"}function bt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function At(e){var t;return(t=(Lr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Lr(e){return mo()?e instanceof Node||e instanceof bt(e).Node:!1}function Pe(e){return mo()?e instanceof Element||e instanceof bt(e).Element:!1}function Xe(e){return mo()?e instanceof HTMLElement||e instanceof bt(e).HTMLElement:!1}function vo(e){return!mo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof bt(e).ShadowRoot}const Wf=new Set(["inline","contents"]);function Vn(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=xt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Wf.has(r)}const Gf=new Set(["table","td","th"]);function Kf(e){return Gf.has(Xt(e))}const Xf=[":popover-open",":modal"];function bo(e){return Xf.some(t=>{try{return e.matches(t)}catch{return!1}})}const Yf=["transform","translate","scale","rotate","perspective"],Zf=["transform","translate","scale","rotate","perspective","filter"],Jf=["paint","layout","strict","content"];function Or(e){const t=wo(),n=Pe(e)?xt(e):e;return Yf.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Zf.some(o=>(n.willChange||"").includes(o))||Jf.some(o=>(n.contain||"").includes(o))}function Qf(e){let t=Bt(e);for(;Xe(t)&&!zt(t);){if(Or(t))return t;if(bo(t))return null;t=Bt(t)}return null}function wo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const e_=new Set(["html","body","#document"]);function zt(e){return e_.has(Xt(e))}function xt(e){return bt(e).getComputedStyle(e)}function yo(e){return Pe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bt(e){if(Xt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vo(e)&&e.host||At(e);return vo(t)?t.host:t}function Wi(e){const t=Bt(e);return zt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xe(t)&&Vn(t)?t:Wi(t)}function Yt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Wi(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=bt(r);if(s){const l=zr(i);return t.concat(i,i.visualViewport||[],Vn(r)?r:[],l&&n?Yt(l):[])}return t.concat(r,Yt(r,[],n))}function zr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Zt=Math.min,St=Math.max,Co=Math.round,bn=Math.floor,Dt=e=>({x:e,y:e}),t_={left:"right",right:"left",bottom:"top",top:"bottom"},n_={start:"end",end:"start"};function Br(e,t,n){return St(e,Zt(t,n))}function wn(e,t){return typeof e=="function"?e(t):e}function Jt(e){return e.split("-")[0]}function yn(e){return e.split("-")[1]}function Gi(e){return e==="x"?"y":"x"}function Vr(e){return e==="y"?"height":"width"}const o_=new Set(["top","bottom"]);function Vt(e){return o_.has(Jt(e))?"y":"x"}function jr(e){return Gi(Vt(e))}function r_(e,t,n){n===void 0&&(n=!1);const o=yn(e),r=jr(e),s=Vr(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=xo(i)),[i,xo(i)]}function s_(e){const t=xo(e);return[qr(e),t,qr(t)]}function qr(e){return e.replace(/start|end/g,t=>n_[t])}const Ki=["left","right"],Xi=["right","left"],i_=["top","bottom"],a_=["bottom","top"];function l_(e,t,n){switch(e){case"top":case"bottom":return n?t?Xi:Ki:t?Ki:Xi;case"left":case"right":return t?i_:a_;default:return[]}}function c_(e,t,n,o){const r=yn(e);let s=l_(Jt(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(qr)))),s}function xo(e){return e.replace(/left|right|bottom|top/g,t=>t_[t])}function d_(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yi(e){return typeof e!="number"?d_(e):{top:e,right:e,bottom:e,left:e}}function So(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}/*!
1
+ (function(Y,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react/jsx-runtime"),require("react"),require("firebase/app"),require("firebase/storage"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","firebase/app","firebase/storage","react-dom"],s):(Y=typeof globalThis<"u"?globalThis:Y||self,s(Y.CoreKitUI={},Y.jsxRuntime,Y.React,Y.app,Y.storage,Y.ReactDOM))})(this,(function(Y,s,m,Wa,Jn,Ct){"use strict";function ni(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const M=ni(m),Go=ni(Ct);function ti(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=ti(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function K(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=ti(e))&&(o&&(o+=" "),o+=t);return o}const oi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ri=K,Ka=(e,t)=>n=>{var o;if(t?.variants==null)return ri(e,n?.class,n?.className);const{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(u=>{const _=n?.[u],g=i?.[u];if(_===null)return null;const f=oi(_)||oi(g);return r[u][f]}),l=n&&Object.entries(n).reduce((u,_)=>{let[g,f]=_;return f===void 0||(u[g]=f),u},{}),d=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((u,_)=>{let{class:g,className:f,...c}=_;return Object.entries(c).every(h=>{let[p,v]=h;return Array.isArray(v)?v.includes({...i,...l}[p]):{...i,...l}[p]===v})?[...u,g,f]:u},[]);return ri(e,a,d,n?.class,n?.className)},Ie={boton:"_boton_14vy4_1",animated:"_animated_14vy4_71",disabled:"_disabled_14vy4_71",loading:"_loading_14vy4_71",content:"_content_14vy4_79",spinner:"_spinner_14vy4_81",start_content:"_start_content_14vy4_83",end_content:"_end_content_14vy4_85",content_item:"_content_item_14vy4_113",spinner_icon:"_spinner_icon_14vy4_135",ripple:"_ripple_14vy4_171",solid:"_solid_14vy4_223",bordered:"_bordered_14vy4_243",ghost:"_ghost_14vy4_263",light:"_light_14vy4_287",faded:"_faded_14vy4_307",shadow:"_shadow_14vy4_327",only_loading:"_only_loading_14vy4_379",sm:"_sm_14vy4_397",md:"_md_14vy4_413",lg:"_lg_14vy4_429",full_width:"_full_width_14vy4_445",icon_only:"_icon_only_14vy4_453",radius_none:"_radius_none_14vy4_495",radius_sm:"_radius_sm_14vy4_563",radius_md:"_radius_md_14vy4_571",radius_lg:"_radius_lg_14vy4_579",radius_full:"_radius_full_14vy4_587",primary:"_primary_14vy4_595",secondary:"_secondary_14vy4_605",success:"_success_14vy4_615",warning:"_warning_14vy4_625",danger:"_danger_14vy4_635",default:"_default_14vy4_645"},Ua=Ka(Ie.boton,{variants:{variant:{solid:Ie.solid,bordered:Ie.bordered,ghost:Ie.ghost,light:Ie.light,faded:Ie.faded,shadow:Ie.shadow},color:{default:Ie.default,primary:Ie.primary,secondary:Ie.secondary,success:Ie.success,warning:Ie.warning,danger:Ie.danger},size:{sm:Ie.sm,md:Ie.md,lg:Ie.lg},radius:{none:Ie.radius_none,sm:Ie.radius_sm,md:Ie.radius_md,lg:Ie.radius_lg,full:Ie.radius_full},fullWidth:{true:Ie.full_width},isIconOnly:{true:Ie.icon_only},isLoading:{true:Ie.loading},onlyLoading:{true:Ie.only_loading},isDisabled:{true:Ie.disabled},disableAnimation:{false:Ie.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md",disableAnimation:!0}}),tn=m.forwardRef(({variant:e="solid",color:t="default",size:n="md",radius:o="md",fullWidth:r=!1,isLoading:i=!1,onlyLoading:a=!1,isDisabled:l=!1,isIconOnly:d=!1,disableRipple:u=!1,disableAnimation:_=!0,customColor:g,startContent:f,endContent:c,spinner:h,spinnerPlacement:p="end",permisos:v,permiso:w,children:C,className:x,onClick:I,style:z,type:A="button","aria-label":N,...L},P)=>{const k=w&&v?!v.includes(w):!1,O=l||i||k,j=F=>{if(O){F.preventDefault();return}if(I?.(F),u||O||!(F.currentTarget instanceof HTMLElement))return;const y=F.currentTarget,E=document.createElement("span"),D=y.getBoundingClientRect(),B=Math.max(D.width,D.height);E.className=Ie.ripple,E.style.width=`${B}px`,E.style.height=`${B}px`,E.style.left=`${F.clientX-D.left}px`,E.style.top=`${F.clientY-D.top}px`,E.addEventListener("animationend",()=>E.remove(),{once:!0}),y.appendChild(E)},$=g?{"--btn-color":g,"--btn-text-color":g,...z}:z,b=Ua({variant:e,color:g?void 0:t,size:n,radius:o,fullWidth:r,isIconOnly:d,isLoading:i,onlyLoading:a,isDisabled:O,disableAnimation:_}),S=i&&s.jsx("span",{className:Ie.spinner,"aria-hidden":a?void 0:"true",children:h||s.jsx("span",{className:Ie.spinner_icon})}),T=a&&!N?"Cargando":N;return s.jsxs("button",{...L,ref:P,type:A,"aria-label":T,"aria-busy":i,className:K(b,x),disabled:O,onClick:j,style:$,children:[p==="start"&&S,f&&!a&&s.jsx("span",{className:K(Ie.start_content,Ie.content_item),children:f}),C&&!a&&s.jsx("span",{className:Ie.content,children:C}),c&&!a&&s.jsx("span",{className:K(Ie.end_content,Ie.content_item),children:c}),p==="end"&&S]})});tn.displayName="Boton";const Sn={badge:"_badge_jvdik_1",badge_clickable:"_badge_clickable_jvdik_41",size_sm:"_size_sm_jvdik_65",size_md:"_size_md_jvdik_77",size_lg:"_size_lg_jvdik_89",radius_none:"_radius_none_jvdik_101",radius_sm:"_radius_sm_jvdik_109",radius_md:"_radius_md_jvdik_117",radius_lg:"_radius_lg_jvdik_125",radius_full:"_radius_full_jvdik_133",dot:"_dot_jvdik_141",pulse:"_pulse_jvdik_1",icon:"_icon_jvdik_187",dismiss_button:"_dismiss_button_jvdik_199",variant_solid:"_variant_solid_jvdik_259",color_default:"_color_default_jvdik_267",color_primary:"_color_primary_jvdik_277",color_secondary:"_color_secondary_jvdik_287",color_success:"_color_success_jvdik_297",color_warning:"_color_warning_jvdik_307",color_danger:"_color_danger_jvdik_317",color_info:"_color_info_jvdik_327",color_brand:"_color_brand_jvdik_337",variant_subtle:"_variant_subtle_jvdik_347",variant_outline:"_variant_outline_jvdik_427",variant_soft:"_variant_soft_jvdik_523",badge_custom:"_badge_custom_jvdik_603"},Xa=()=>s.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:s.jsx("path",{d:"M2 2L8 8M8 2L2 8"})}),ii=({variant:e="solid",color:t="default",size:n="md",radius:o="md",children:r,startIcon:i,endIcon:a,dot:l,dismissible:d,onDismiss:u,customColor:_,className:g="",onClick:f})=>{const c=!!f,h=m.useMemo(()=>{if(!_)return;const w=_,C=`color-mix(in oklab, ${w} 15%, transparent)`;return{solid:{"--badge-custom-bg":w,"--badge-custom-text":"white","--badge-custom-border":"transparent"},subtle:{"--badge-custom-bg":C,"--badge-custom-text":w,"--badge-custom-border":"transparent"},outline:{"--badge-custom-bg":"transparent","--badge-custom-text":w,"--badge-custom-border":w},soft:{"--badge-custom-bg":`color-mix(in oklab, ${w} 10%, var(--surface-first))`,"--badge-custom-text":w,"--badge-custom-border":"transparent"}}[e]},[_,e]),p=[Sn.badge,Sn[`size_${n}`],Sn[`radius_${o}`],Sn[`variant_${e}`],!_&&Sn[`color_${t}`],_&&Sn.badge_custom,c&&Sn.badge_clickable,g].filter(Boolean).join(" "),v=m.useMemo(()=>_||{default:"var(--gray-11)",primary:"var(--brand-6)",secondary:"var(--brand-6-secondary)",success:"var(--color-add-green-6)",warning:"var(--color-add-orange-6)",danger:"var(--color-add-red-6)",info:"var(--color-add-blue-6)",brand:"var(--brand-6)"}[t],[t,_]);return s.jsxs("span",{className:p,style:h,onClick:f,role:c?"button":void 0,tabIndex:c?0:void 0,children:[l&&s.jsx("span",{className:Sn.dot,style:{backgroundColor:v}}),i&&s.jsx("span",{className:Sn.icon,children:i}),r,a&&s.jsx("span",{className:Sn.icon,children:a}),d&&s.jsx("button",{type:"button",className:Sn.dismiss_button,onClick:w=>{w.stopPropagation(),u?.()},"aria-label":"Eliminar badge",children:s.jsx(Xa,{})})]})},Be={contenedor_toggle:"_contenedor_toggle_1ow2e_5",envoltorio_toggle:"_envoltorio_toggle_1ow2e_19",contenedor_label:"_contenedor_label_1ow2e_37",texto_label:"_texto_label_1ow2e_49",texto_descripcion:"_texto_descripcion_1ow2e_65",marca_requerido:"_marca_requerido_1ow2e_75",pista_toggle:"_pista_toggle_1ow2e_83",input:"_input_1ow2e_117",fondo_pista:"_fondo_pista_1ow2e_143",pulgar_toggle:"_pulgar_toggle_1ow2e_171",icono_check:"_icono_check_1ow2e_205",icono_x:"_icono_x_1ow2e_207",seleccionado:"_seleccionado_1ow2e_275",con_iconos:"_con_iconos_1ow2e_307",tam_sm:"_tam_sm_1ow2e_317",icono_moon:"_icono_moon_1ow2e_321",tam_lg:"_tam_lg_1ow2e_371",color_primary:"_color_primary_1ow2e_415",color_secondary:"_color_secondary_1ow2e_423",color_success:"_color_success_1ow2e_431",color_warning:"_color_warning_1ow2e_439",color_danger:"_color_danger_1ow2e_447",label_left:"_label_left_1ow2e_455",deshabilitado:"_deshabilitado_1ow2e_463",solo_lectura:"_solo_lectura_1ow2e_531",invalido:"_invalido_1ow2e_597",variante_moon:"_variante_moon_1ow2e_663",posicion_top:"_posicion_top_1ow2e_709",justify_end:"_justify_end_1ow2e_727",posicion_inline:"_posicion_inline_1ow2e_737"},Wo=m.forwardRef(({isSelected:e,defaultSelected:t=!1,onChange:n,label:o,description:r,size:i="md",color:a="primary",customColor:l,variant:d="default",isDisabled:u=!1,isReadOnly:_=!1,isInvalid:g=!1,isRequired:f=!1,showIcons:c=!1,labelPlacement:h="right",labelPosition:p="inline",justifyEnd:v=!1,children:w,className:C="",...x},I)=>{const[z,A]=m.useState(t),N=m.useId(),L=x.id||N,P=e!==void 0?e:z,k=F=>{if(u||_)return;const y=F.target.checked;e===void 0&&A(y),n&&n(y)},O=w||o,j=[Be.contenedor_toggle,Be[`tam_${i}`],!l&&Be[`color_${a}`],Be[`variante_${d}`],Be[`label_${h}`],Be[`posicion_${p}`],P&&Be.seleccionado,u&&Be.deshabilitado,_&&Be.solo_lectura,g&&Be.invalido,c&&Be.con_iconos,v&&Be.justify_end,C].filter(Boolean).join(" "),$=l?{"--toggle-custom-color":l}:void 0,b=()=>O?s.jsxs("div",{className:Be.contenedor_label,children:[s.jsxs("span",{className:Be.texto_label,children:[O,f&&s.jsx("span",{className:Be.marca_requerido,children:" *"})]}),r&&s.jsx("span",{className:Be.texto_descripcion,children:r})]}):null,S=()=>d!=="moon"?null:s.jsx("div",{className:Be.icono_moon,children:s.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:s.jsx("path",{d:"M5,1 L5,1 C2.790861,1 1,2.790861 1,5 L1,5 C1,7.209139 2.790861,9 5,9 L5,9 C7.209139,9 9,7.209139 9,5 L9,5 C9,2.790861 7.209139,1 5,1 L5,9 L5,1 Z"})})}),T=()=>!c||d==="moon"?null:s.jsxs(s.Fragment,{children:[s.jsx("svg",{className:Be.icono_check,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"2,6 5,9 10,3"})}),s.jsxs("svg",{className:Be.icono_x,width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[s.jsx("line",{x1:"2",y1:"2",x2:"8",y2:"8"}),s.jsx("line",{x1:"8",y1:"2",x2:"2",y2:"8"})]})]});return s.jsxs("div",{className:j,style:$,children:[p==="top"&&b(),s.jsxs("label",{className:Be.envoltorio_toggle,htmlFor:L,children:[p==="inline"&&h==="left"&&b(),s.jsxs("div",{className:Be.pista_toggle,children:[s.jsx("input",{ref:I,type:"checkbox",id:L,checked:P,disabled:u,readOnly:_,required:f,"aria-invalid":g,className:Be.input,onChange:k,...x}),s.jsx("div",{className:Be.fondo_pista,children:s.jsxs("div",{className:Be.pulgar_toggle,children:[S(),T()]})})]}),p==="inline"&&h==="right"&&b()]})]})});Wo.displayName="Toggle";const Ya=({className:e})=>s.jsx("svg",{className:e,width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),si=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6"})}),Ra=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M3 7v6h6M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})}),Za=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"})}),Ja=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M12 20h9M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})}),Qa=({className:e})=>s.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"}),s.jsx("path",{d:"M15 19h6"}),s.jsx("path",{d:"M18 16v6"})]}),el=({className:e})=>s.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("path",{d:"m8.5 12 2.3 2.3 4.7-4.7"})]}),re={backdrop:"_backdrop_155e9_1",visible:"_visible_155e9_37",modal:"_modal_155e9_61",cuerpo_modal:"_cuerpo_modal_155e9_103",encabezado:"_encabezado_155e9_145",titulo:"_titulo_155e9_159",boton_cerrar:"_boton_cerrar_155e9_173",texto_esc:"_texto_esc_155e9_209",icono_x:"_icono_x_155e9_223",contenedor_lienzo:"_contenedor_lienzo_155e9_233",area_firma:"_area_firma_155e9_243",superficie_lienzo:"_superficie_lienzo_155e9_257",lienzo:"_lienzo_155e9_265",lienzo_deshabilitado:"_lienzo_deshabilitado_155e9_295",barra_acciones:"_barra_acciones_155e9_305",grupo_izquierda:"_grupo_izquierda_155e9_325",grupo_derecha:"_grupo_derecha_155e9_337",separador:"_separador_155e9_349",boton_accion:"_boton_accion_155e9_361",contenedor_guardar:"_contenedor_guardar_155e9_417",boton_texto_con_icono:"_boton_texto_con_icono_155e9_429",accion_texto:"_accion_texto_155e9_441",icono_boton_accion:"_icono_boton_accion_155e9_451",icono:"_icono_155e9_223",contenedor_consentimiento:"_contenedor_consentimiento_155e9_477",texto_consentimiento:"_texto_consentimiento_155e9_491",consentimiento_fila:"_consentimiento_fila_155e9_507",toggle_consentimiento:"_toggle_consentimiento_155e9_521",contenedor_subir_oculto:"_contenedor_subir_oculto_155e9_529",boton_adjuntar:"_boton_adjuntar_155e9_541",input_archivo:"_input_archivo_155e9_577",input_validacion_firma:"_input_validacion_firma_155e9_585",bloque_firma:"_bloque_firma_155e9_613",bloque_encabezado:"_bloque_encabezado_155e9_635",bloque_titulo:"_bloque_titulo_155e9_647",marca_requerido:"_marca_requerido_155e9_663",bloque_preview:"_bloque_preview_155e9_673",bloque_preview_imagen:"_bloque_preview_imagen_155e9_701",bloque_preview_placeholder:"_bloque_preview_placeholder_155e9_715",bloque_acciones:"_bloque_acciones_155e9_729",accion_agregar_firma:"_accion_agregar_firma_155e9_743",accion_eliminar_firma:"_accion_eliminar_firma_155e9_745"},nl=8,tl=1.2,Qn=4.2,ol=1.8,ai=(e,t,n)=>Math.max(t,Math.min(n,e)),rl=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)},li=e=>Number.isFinite(e)?e:performance.now(),il=()=>{const e=m.useRef(null),[t,n]=m.useState(!0),[o,r]=m.useState(!1),[i,a]=m.useState([]),l=m.useRef([]),d=m.useRef({color:"#111827",enabled:!0}),u=m.useRef(null),_=m.useRef([]),g=m.useRef(0),f=m.useRef(Qn),c=m.useRef(!1),h=m.useCallback(()=>e.current?.getContext("2d")??null,[]),p=m.useCallback(()=>h(),[h]),v=m.useCallback(()=>{const $=e.current,b=h();$&&b&&b.clearRect(0,0,$.width,$.height),n(!0),l.current=[],a([]),_.current=[],u.current=null,f.current=Qn,c.current=!1},[h]),w=m.useCallback(()=>{c.current=!0,n(!1)},[]),C=m.useCallback(($,b)=>{const S=Math.max(1,b.t-$.t),F=rl($,b)/S,E=(Qn-F*ol)*ai(b.pressure||.5,.35,1),D=ai(E,tl,Qn),H=f.current+(D-f.current)*.25;return f.current=H,H},[]),x=m.useCallback(($,b)=>{$.strokeStyle=d.current.color,$.lineWidth=b,$.lineCap="round",$.lineJoin="round"},[]),I=m.useCallback(($,b)=>{const S=p();if(!S)return;const T=C($,b);x(S,T),S.beginPath(),S.moveTo($.x,$.y),S.quadraticCurveTo($.x,$.y,b.x,b.y),S.stroke(),n(!1)},[C,p,x]),z=m.useCallback($=>{const b=e.current;if(!b)return{pressure:.5,t:performance.now(),x:0,y:0};const S=b.getBoundingClientRect(),T=b.width/S.width,F=b.height/S.height;return{pressure:$.pressure&&$.pressure>0?$.pressure:.5,t:$.timeStamp||performance.now(),x:($.clientX-S.left)*T,y:($.clientY-S.top)*F}},[]),A=m.useCallback($=>{if(!d.current.enabled)return;$.preventDefault();const b=e.current;if(!b)return;b.setPointerCapture($.pointerId);const S=z($);r(!0),u.current=S,_.current=[S],g.current=li($.timeStamp)},[z]),N=m.useCallback($=>{if(!o||!d.current.enabled)return;$.preventDefault();const b=li($.timeStamp);if(b-g.current<nl)return;g.current=b;const S=z($),T=u.current;T&&(I(T,S),u.current=S,_.current.push(S))},[I,o,z]),L=m.useCallback($=>{if($&&e.current?.hasPointerCapture($.pointerId)&&e.current.releasePointerCapture($.pointerId),o&&_.current.length>0){const b=[...l.current,{puntos:[..._.current]}];l.current=b,a(b)}r(!1),u.current=null,_.current=[]},[o]),P=m.useCallback(($,b,S)=>{if(!(b.puntos.length<2))for(let T=1;T<b.puntos.length;T++){const F=b.puntos[T-1],y=b.puntos[T],E=C(F,y);$.strokeStyle=S??d.current.color,$.lineWidth=E,$.lineCap="round",$.lineJoin="round",$.beginPath(),$.moveTo(F.x,F.y),$.quadraticCurveTo(F.x,F.y,y.x,y.y),$.stroke()}},[C]),k=m.useCallback(()=>{if(l.current.length===0)return;const $=l.current.slice(0,-1);l.current=$,a($);const b=e.current;if(!b)return;const S=h();S&&(S.clearRect(0,0,b.width,b.height),f.current=Qn,$.forEach(T=>P(S,T)),n($.length===0&&!c.current))},[h,P]),O=m.useCallback(($={})=>{const b=e.current;if(!b||t&&l.current.length===0&&!c.current)return null;const{backgroundColor:S,format:T,quality:F,strokeColor:y}=$;if(!S&&!y)return b.toDataURL("image/png");const E=document.createElement("canvas");E.width=b.width,E.height=b.height;const D=E.getContext("2d");if(!D)return null;S&&(D.fillStyle=S,D.fillRect(0,0,E.width,E.height)),y&&l.current.length>0&&!c.current?(f.current=Qn,l.current.forEach(V=>P(D,V,y))):D.drawImage(b,0,0);const B=T??"image/png",H=F??.85;return B==="image/png"?E.toDataURL(B):E.toDataURL(B,H)},[t,P]),j=m.useCallback($=>{const b=e.current,S=h();if(!b||!S)return;if(d.current={color:$.color,enabled:$.enabled??!0},b.style.touchAction="none",b.style.userSelect="none",!d.current.enabled)return()=>{};const T=D=>A(D),F=D=>N(D),y=D=>L(D),E=D=>L(D);return b.addEventListener("pointerdown",T,{passive:!1}),b.addEventListener("pointermove",F,{passive:!1}),b.addEventListener("pointerup",y,{passive:!1}),b.addEventListener("pointerleave",y,{passive:!1}),b.addEventListener("pointercancel",E,{passive:!1}),()=>{b.removeEventListener("pointerdown",T),b.removeEventListener("pointermove",F),b.removeEventListener("pointerup",y),b.removeEventListener("pointerleave",y),b.removeEventListener("pointercancel",E)}},[L,A,N,h]);return m.useEffect(()=>{f.current=Qn},[i.length]),{canvasRef:e,configurarCanvas:j,deshacerUltimoTrazo:k,estaVacio:t,limpiarCanvas:v,marcarConContenido:w,obtenerDatosFirma:O,puedeDeshacer:i.length>0}},ci=m.forwardRef(({alto:e=200,ancho:t=700,aspectRatio:n,className:o,closeOnBackdropClick:r=!1,firmaInicial:i=null,isOpen:a=!1,isRequired:l=!1,mostrarBotonSubir:d=!0,name:u,onClose:_,onConfirm:g,readonly:f=!1,readonlyPostGuardado:c=!1,requiredMessage:h="Se debe registrar una firma para continuar",textoAdjuntar:p="Adjuntar firma",textoConsentimiento:v="Al firmar, confirmo que he leído y acepto todos los términos contractuales",textoDeshacer:w="Deshacer",textoEliminarFirma:C="Eliminar firma",textoEstadoGuardada:x="Guardada",textoEstadoPendiente:I="Pendiente",textoGuardar:z="Guardar firma",textoLimpiar:A="Limpiar",textoModificar:N="Modificar firma",textoReemplazarFirma:L="Reemplazar firma",textoSolicitarFirma:P="Agregar firma",tituloBloque:k="Firma del responsable",titulo:O="Firmar el contrato",mostrarBotonAgregarFirma:j=!0,mostrarBotonEliminarFirma:$=!0,firebasePath:b,firebaseStorage:S,onFirebaseUploadSuccess:T,onFirebaseUploadError:F},y)=>{const{canvasRef:E,configurarCanvas:D,deshacerUltimoTrazo:B,estaVacio:H,limpiarCanvas:V,marcarConContenido:J,obtenerDatosFirma:U,puedeDeshacer:pe}=il(),ce=m.useRef(null),ie=m.useRef(null),ge=m.useRef(null),de=m.useId(),$e=`${de}-toggle`,Z=`${de}-texto`,oe=`${de}-dialog-title`,ne=`${de}-dialog-description`,[ue,ve]=m.useState(!!a),[X,he]=m.useState(!1),[te,se]=m.useState(i),[Ce,W]=m.useState(t),[q,G]=m.useState(!1),[fe,_e]=m.useState(!!i),[me,Xe]=m.useState(!1),[Oe,Ze]=m.useState(!1),Ve=Math.round(Ce*e/Math.max(1,t)),ye=f||c&&fe,Qe=!f&&!(c&&fe),be=m.useCallback(ke=>{const xe=E.current,qe=xe?.getContext("2d");if(!xe||!qe)return;const Cn=new Image;Cn.onload=()=>{qe.clearRect(0,0,xe.width,xe.height);const zn=xe.width/xe.height,ct=Cn.width/Cn.height;let qt=xe.width,Bt=xe.height,Ht=0,qo=0;ct>zn?(Bt=xe.width/ct,qo=(xe.height-Bt)/2):(qt=xe.height*ct,Ht=(xe.width-qt)/2),qe.drawImage(Cn,Ht,qo,qt,Bt),J(),Xe(!0)},Cn.src=ke},[E,J]),we=m.useCallback(()=>{if(S&&typeof S=="object")return S;if(!Wa.getApps().length)throw new Error("Firebase no esta inicializado. Inicializa la app y el almacenamiento antes de usar firebasePath o pasa firebaseStorage al componente.");return Jn.getStorage()},[S]),je=m.useCallback(()=>{V(),se(null),Xe(!1),_e(!1)},[V]),De=m.useCallback(()=>{ye||(V(),Xe(!1))},[ye,V]),yn=m.useCallback(async()=>{if(ye||Oe)return;const ke=we(),xe=typeof te=="string"&&/^https?:\/\//i.test(te)?Jn.ref(ke,te):b?Jn.ref(ke,b):null;try{xe&&(Ze(!0),await Jn.deleteObject(xe)),je(),g?.("")}catch(qe){if(typeof qe=="object"&&qe!==null&&"code"in qe&&String(qe.code)==="storage/object-not-found"){je(),g?.("");return}console.error("Error al eliminar la firma de Firebase:",qe),F?.(qe instanceof Error?qe:new Error(String(qe)))}finally{xe&&Ze(!1)}},[ye,te,b,we,je,g,F,Oe]),ee=m.useCallback(()=>{f||(V(),_e(!1),Xe(!1),G(!1))},[V,f]),Ne=m.useCallback(ke=>{if(ye)return;const xe=ke.target.files?.[0];if(!xe)return;const qe=new FileReader;qe.onload=Cn=>{const zn=Cn.target?.result;typeof zn=="string"&&(V(),be(zn))},qe.readAsDataURL(xe)},[ye,be,V]),Ke=m.useCallback(()=>{ye||ce.current?.click()},[ye]),Me=m.useCallback(()=>{G(!1),Xe(!1),V()},[V]),gn=m.useCallback(ke=>{X||(he(!0),setTimeout(()=>{ve(!1),he(!1),ke?.()},650))},[X]),nn=m.useCallback(()=>{gn(()=>{Me(),_?.()})},[gn,Me,_]),ln=m.useCallback(async()=>{if(ye||X||Oe)return;const ke=U({backgroundColor:"#ffffff",format:"image/jpeg",quality:.82,strokeColor:"#111827"});if(!ke||!q)return;let xe=ke;try{if(b){Ze(!0);const qe=we();let Cn;try{Cn=Jn.ref(qe,b)}catch(zn){const ct=zn instanceof Error?zn.message:String(zn);throw new Error(`No se pudo crear la referencia de Firebase Storage para "${b}". Posible conflicto por dos copias de Firebase (la app y la libreria). Verifica que firebase este externalizado en corekit-ui y que la app use una sola instancia del SDK. Detalle: ${ct}`)}await Jn.uploadString(Cn,ke,"data_url"),xe=await Jn.getDownloadURL(Cn),T?.(xe)}gn(()=>{se(xe),_e(!0),g?.(xe),Me(),_?.()})}catch(qe){console.error("Error al subir la firma a Firebase:",qe),F?.(qe instanceof Error?qe:new Error(String(qe)))}finally{b&&Ze(!1)}},[q,ye,gn,b,we,Me,U,_,g,F,T,X,Oe]);m.useEffect(()=>{a&&(ve(!0),he(!1))},[a]),m.useEffect(()=>{se(i),_e(!!i)},[i]),m.useEffect(()=>{if(!ue)return;const ke=()=>{const xe=ge.current;xe&&W(Math.max(1,Math.floor(xe.clientWidth)))};return ke(),window.addEventListener("resize",ke),()=>window.removeEventListener("resize",ke)},[t,ue]),m.useImperativeHandle(y,()=>({limpiar:V,obtenerDatosFirma:U,estaVacio:()=>H}),[H,V,U]),m.useEffect(()=>{if(!ue)return;const ke=D({color:"#111827",enabled:!ye});return()=>{ke?.()}},[ye,D,ue]),m.useEffect(()=>{if(!ue){document.body.style.overflow="";return}const ke=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",ke>0&&(document.body.style.paddingRight=`${ke}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[ue]),m.useEffect(()=>{ue||Me()},[Me,ue]),m.useEffect(()=>{if(!ue)return;const ke=xe=>{if(xe.key==="Escape"){nn();return}if(xe.ctrlKey&&xe.key.toLowerCase()==="z"){xe.preventDefault(),!ye&&pe&&B();return}xe.ctrlKey&&xe.key==="Enter"&&(xe.preventDefault(),ye||ln())};return document.addEventListener("keydown",ke),()=>document.removeEventListener("keydown",ke)},[ye,B,nn,ln,ue,pe]),m.useEffect(()=>{const ke=ie.current;if(!ke)return;if(l&&!!!te){ke.setCustomValidity(h);return}ke.setCustomValidity("")},[te,l,h]);const Fn=m.useCallback(ke=>{X||!r||ke.target===ke.currentTarget&&nn()},[r,X,nn]),pn=ye,kn=ye||me,ei=ye||!fe&&(H&&!me||!q),jt=()=>{f||(te&&ee(),he(!1),ve(!0))};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`${re.bloque_firma} ${o||""}`,children:[s.jsxs("div",{className:re.bloque_encabezado,children:[s.jsxs("span",{className:re.bloque_titulo,children:[k,l&&s.jsx("span",{className:re.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsx(ii,{color:te?"success":"warning",size:"sm",variant:"outline",children:te?x:I})]}),s.jsxs("div",{className:re.bloque_preview,style:n?{aspectRatio:n}:void 0,children:[(l||u)&&s.jsx("input",{ref:ie,className:re.input_validacion_firma,"aria-hidden":"true",name:u,required:l,tabIndex:-1,type:"text",value:te?"signed":"",onChange:()=>{},onInvalid:ke=>{l&&!te&&ke.currentTarget.setCustomValidity(h)},onInput:ke=>{ke.currentTarget.setCustomValidity("")}}),te?s.jsx("img",{src:te,alt:"Firma guardada",className:re.bloque_preview_imagen}):s.jsx("span",{className:re.bloque_preview_placeholder,children:"Sin firma registrada"})]}),!f&&(j||$&&!!te)&&s.jsxs("div",{className:re.bloque_acciones,children:[j&&s.jsx(tn,{color:"primary",size:"sm",variant:"solid",onClick:jt,className:re.accion_agregar_firma,isDisabled:ye||X,children:s.jsxs("span",{className:re.boton_texto_con_icono,children:[te?s.jsx(Ja,{className:re.icono_boton_accion}):s.jsx(Qa,{className:re.icono_boton_accion}),s.jsx("span",{className:re.accion_texto,children:te?L:P})]})}),$&&te&&s.jsx(tn,{color:"default",size:"sm",variant:"bordered",onClick:yn,className:re.accion_eliminar_firma,isDisabled:ye||X||Oe,children:s.jsxs("span",{className:re.boton_texto_con_icono,children:[s.jsx(si,{className:re.icono_boton_accion}),s.jsx("span",{className:re.accion_texto,children:C})]})})]})]}),ue&&s.jsx("div",{className:`${re.backdrop} ${X?"":re.visible}`,onClick:Fn,children:s.jsxs("div",{className:`${re.modal} ${X?"":re.visible}`,role:"dialog","aria-modal":"true","aria-labelledby":oe,"aria-describedby":ne,children:[s.jsxs("header",{className:re.encabezado,children:[s.jsx("h2",{id:oe,className:re.titulo,children:O}),s.jsxs("button",{className:re.boton_cerrar,onClick:nn,type:"button","aria-label":"Cerrar",children:[s.jsx("span",{className:re.texto_esc,children:"ESC"}),s.jsx(Ya,{className:re.icono_x})]})]}),s.jsxs("div",{className:re.cuerpo_modal,children:[s.jsx("div",{className:re.contenedor_lienzo,ref:ge,children:s.jsxs("div",{className:re.area_firma,children:[s.jsx("div",{className:re.superficie_lienzo,children:s.jsx("canvas",{ref:E,className:`${re.lienzo} ${pn?re.lienzo_deshabilitado:""}`,width:Ce,height:Ve,style:{height:`${Ve}px`,pointerEvents:kn?"none":"auto",width:"100%"},"aria-label":"Area de firma"})}),Qe&&s.jsxs("div",{className:re.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[s.jsxs("div",{className:re.grupo_izquierda,children:[s.jsxs("button",{className:re.boton_accion,onClick:B,type:"button",disabled:!pe||pn,"aria-label":w,children:[s.jsx(Ra,{className:re.icono,"aria-hidden":"true"}),s.jsx("span",{children:w})]}),s.jsx("span",{className:re.separador,"aria-hidden":"true",children:"|"}),s.jsxs("button",{className:re.boton_accion,onClick:De,type:"button",disabled:H&&!me||pn,"aria-label":A,children:[s.jsx(si,{className:re.icono,"aria-hidden":"true"}),s.jsx("span",{children:A})]})]}),d&&s.jsx("div",{className:re.grupo_derecha,children:s.jsxs("button",{className:re.boton_adjuntar,onClick:Ke,type:"button",disabled:ye,children:[s.jsx(Za,{className:re.icono,"aria-hidden":"true"}),p]})})]})]})}),Qe&&s.jsxs(s.Fragment,{children:[s.jsx("div",{id:ne,className:re.contenedor_consentimiento,children:s.jsxs("div",{className:re.consentimiento_fila,children:[s.jsx(Wo,{id:$e,isSelected:q,onChange:G,color:"primary",size:"md",isDisabled:ye,"aria-describedby":Z,className:re.toggle_consentimiento}),s.jsx("label",{htmlFor:$e,id:Z,className:re.texto_consentimiento,children:v})]})}),s.jsx("div",{className:re.contenedor_guardar,children:s.jsx(tn,{color:"primary",variant:"solid",radius:"full",size:"md",onClick:fe&&!c?ee:ln,type:"button",isLoading:Oe,isDisabled:ei||Oe,startContent:Oe?void 0:s.jsx(el,{className:re.icono,"aria-hidden":"true"}),children:Oe?"Guardando...":fe&&!c?N:z})})]}),Qe&&d&&s.jsx("div",{className:re.contenedor_subir_oculto,children:s.jsx("input",{ref:ce,type:"file",accept:"image/*",className:re.input_archivo,onChange:Ne,"aria-label":"Subir imagen de firma"})})]})]})})]})});ci.displayName="Signature";const sl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Gt=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=sl[n[e]&63];return t};const al=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[s.jsx("path",{d:"M18 6 6 18"}),s.jsx("path",{d:"m6 6 12 12"})]}),ll=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[s.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),s.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),cl=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[s.jsx("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),s.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),s.jsx("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),s.jsx("path",{d:"m2 2 20 20"})]}),He={contenedor_base:"_contenedor_base_lcpd6_1",tam_sm:"_tam_sm_lcpd6_37",tam_lg:"_tam_lg_lcpd6_49",radio_none:"_radio_none_lcpd6_61",radio_sm:"_radio_sm_lcpd6_69",radio_md:"_radio_md_lcpd6_77",radio_lg:"_radio_lg_lcpd6_85",radio_full:"_radio_full_lcpd6_93",color_default:"_color_default_lcpd6_101",color_primary:"_color_primary_lcpd6_103",color_secondary:"_color_secondary_lcpd6_111",color_success:"_color_success_lcpd6_119",color_warning:"_color_warning_lcpd6_127",color_danger:"_color_danger_lcpd6_135",etiqueta:"_etiqueta_lcpd6_143",marca_requerido:"_marca_requerido_lcpd6_159",envoltorio_input:"_envoltorio_input_lcpd6_169",envoltorio_interno:"_envoltorio_interno_lcpd6_197",entrada:"_entrada_lcpd6_213",contenido_inicio:"_contenido_inicio_lcpd6_267",contenido_final:"_contenido_final_lcpd6_269",boton_limpiar:"_boton_limpiar_lcpd6_287",tiene_contenido:"_tiene_contenido_lcpd6_343",boton_password:"_boton_password_lcpd6_353",descripcion:"_descripcion_lcpd6_405",mensaje_error:"_mensaje_error_lcpd6_417",ancho_total:"_ancho_total_lcpd6_429",variante_bordered:"_variante_bordered_lcpd6_437",variante_faded:"_variante_faded_lcpd6_447",variante_underlined:"_variante_underlined_lcpd6_457",variante_ghost:"_variante_ghost_lcpd6_481",deshabilitado:"_deshabilitado_lcpd6_493",solo_lectura:"_solo_lectura_lcpd6_527",enfocado:"_enfocado_lcpd6_581",valido:"_valido_lcpd6_589",invalido:"_invalido_lcpd6_597",sin_animacion:"_sin_animacion_lcpd6_629"},di=m.forwardRef((e,t)=>{const{type:n="text",value:o,defaultValue:r,placeholder:i,variant:a="bordered",color:l="default",size:d="md",radius:u="md",fullWidth:_=!0,disableAnimation:g=!1,label:f,description:c,errorMessage:h,startContent:p,endContent:v,isRequired:w=!1,isReadOnly:C=!1,isDisabled:x=!1,isClearable:I=!1,isInvalid:z,validationState:A,validate:N,className:L,classNames:P,style:k,onChange:O,onClear:j,onValueChange:$,onFocus:b,onBlur:S,onKeyDown:T,id:F,name:y,autoComplete:E,autoFocus:D,maxLength:B,minLength:H,pattern:V,...J}=e,U=m.useRef(null),ce=m.useRef(F??`input-text-${Gt(8)}`).current;m.useImperativeHandle(t,()=>U.current);const ie=o!==void 0,[ge,de]=m.useState(r??""),$e=ie?o:ge,[Z,oe]=m.useState(!1),[ne,ue]=m.useState(!1),ve=m.useMemo(()=>{if(!N)return null;const we=N($e);return we===!0||we==null?null:typeof we=="string"?we:typeof we=="object"&&"message"in we?we.message??"Entrada inválida":"Entrada inválida"},[$e,N]),X=m.useMemo(()=>z!==void 0?z:A==="invalid"?!0:A==="valid"?!1:!!ve,[z,A,ve]),he=A==="valid"&&!X,te={invalido:X,mensaje:ve},se=$e.length>0,Ce=n==="password",W=Ce&&ne?"text":n,q=I&&se&&!C&&!x,G=m.useCallback(we=>{if(x||C)return;const je=we.target.value;ie||de(je),O?.(je),$?.(je)},[ie,x,C,O,$]),fe=m.useCallback(we=>{oe(!0),b?.(we)},[b]),_e=m.useCallback(we=>{oe(!1),S?.(we)},[S]),me=m.useCallback(()=>{x||C||(ie||de(""),O?.(""),$?.(""),j?.(),U.current?.focus())},[ie,x,C,O,$,j]),Xe=m.useCallback(we=>{we.key==="Escape"&&I&&se&&me(),T?.(we)},[I,se,me,T]),Oe=m.useCallback(()=>{ue(we=>!we),requestAnimationFrame(()=>U.current?.focus())},[]),Ze=c?`${ce}-desc`:void 0,Ve=X?`${ce}-err`:void 0,ye=[Ze,Ve].filter(Boolean).join(" ")||void 0,Qe=typeof h=="function"?h(te):h??ve,be=K(He.contenedor_base,He[`variante_${a}`],He[`tam_${d}`],He[`radio_${u}`],He[`color_${l}`],{[He.ancho_total]:_,[He.sin_animacion]:g,[He.deshabilitado]:x,[He.solo_lectura]:C,[He.invalido]:X,[He.valido]:he,[He.enfocado]:Z,[He.tiene_contenido]:se},L,P?.base);return s.jsxs("div",{className:be,style:k,children:[f&&s.jsxs("label",{className:K(He.etiqueta,P?.label),htmlFor:ce,children:[f,w&&s.jsx("span",{className:He.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsxs("div",{className:K(He.envoltorio_input,P?.inputWrapper),children:[p&&s.jsx("span",{className:He.contenido_inicio,children:p}),s.jsx("div",{className:K(He.envoltorio_interno,P?.innerWrapper),children:s.jsx("input",{...J,ref:U,id:ce,name:y,type:W,value:ie?$e:void 0,defaultValue:ie?void 0:r,placeholder:i,disabled:x,readOnly:C,required:w,autoComplete:E,autoFocus:D,maxLength:B,minLength:H,pattern:V,"aria-invalid":X||void 0,"aria-describedby":ye,"aria-required":w,className:K(He.entrada,P?.input),onChange:G,onFocus:fe,onBlur:_e,onKeyDown:Xe})}),q&&s.jsx("button",{type:"button",className:K(He.boton_limpiar,P?.clearButton),onClick:me,tabIndex:-1,"aria-label":"Limpiar campo",children:s.jsx(al,{size:"0.75em"})}),Ce&&s.jsx("button",{type:"button",className:He.boton_password,onClick:Oe,tabIndex:-1,"aria-label":ne?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":ne,children:ne?s.jsx(cl,{}):s.jsx(ll,{})}),v&&s.jsx("span",{className:He.contenido_final,children:v})]}),c&&!X&&s.jsx("div",{id:Ze,className:K(He.descripcion,P?.description),children:c}),X&&Qe&&s.jsx("div",{id:Ve,className:K(He.mensaje_error,P?.errorMessage),role:"alert",children:Qe})]})});di.displayName="InputText";function Wt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xt(e,t){if(e==null||Number.isNaN(e))return"";const{separadorMiles:n=!1,separadorDecimal:o=".",escalaDecimal:r,decimalesFijos:i=!1,prefijo:a="",sufijo:l=""}=t;let d;r!==void 0?d=i?e.toFixed(r):String(Math.round(e*Math.pow(10,r))/Math.pow(10,r)):d=String(e);const[u,_]=d.split(".");let g=u;if(n){const c=typeof n=="string"?n:",";g=u.replace(/\B(?=(\d{3})+(?!\d))/g,c)}let f=g;return _!==void 0?f+=o+_:i&&r&&r>0&&(f+=o+"0".repeat(r)),`${a}${f}${l}`}function ui(e,t){if(!e||e.trim()==="")return;const{separadorMiles:n=!1,separadorDecimal:o=".",prefijo:r="",sufijo:i="",permitirNegativo:a=!0}=t;let l=e;if(r&&(l=l.replace(new RegExp(`^${Wt(r)}`),"")),i&&(l=l.replace(new RegExp(`${Wt(i)}$`),"")),n){const u=typeof n=="string"?n:",";l=l.replace(new RegExp(Wt(u),"g"),"")}o!=="."&&(l=l.replace(new RegExp(Wt(o)),".")),a||(l=l.replace(/-/g,""));const d=parseFloat(l);return Number.isNaN(d)?void 0:d}function Kt(e,t,n){let o=e;return t!==void 0&&o<t&&(o=t),n!==void 0&&o>n&&(o=n),o}function fi(e){return e===!0||e===null||e===void 0?{invalido:!1,mensaje:null}:e===!1?{invalido:!0,mensaje:null}:typeof e=="string"?{invalido:!0,mensaje:e}:typeof e=="object"&&e.message?{invalido:!0,mensaje:e.message}:{invalido:!1,mensaje:null}}function _i(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}const dl=e=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[s.jsx("path",{d:"M5 12h14"}),s.jsx("path",{d:"M12 5v14"})]}),ul=e=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:s.jsx("path",{d:"M5 12h14"})}),Ge={contenedor_base:"_contenedor_base_1i8i2_1",tam_sm:"_tam_sm_1i8i2_37",tam_lg:"_tam_lg_1i8i2_49",radio_none:"_radio_none_1i8i2_61",radio_sm:"_radio_sm_1i8i2_69",radio_md:"_radio_md_1i8i2_77",radio_lg:"_radio_lg_1i8i2_85",radio_full:"_radio_full_1i8i2_93",color_default:"_color_default_1i8i2_101",color_primary:"_color_primary_1i8i2_103",color_secondary:"_color_secondary_1i8i2_111",color_success:"_color_success_1i8i2_119",color_warning:"_color_warning_1i8i2_127",color_danger:"_color_danger_1i8i2_135",etiqueta:"_etiqueta_1i8i2_143",marca_requerido:"_marca_requerido_1i8i2_159",envoltorio_input:"_envoltorio_input_1i8i2_169",envoltorio_interno:"_envoltorio_interno_1i8i2_195",entrada:"_entrada_1i8i2_213",contenido_inicio:"_contenido_inicio_1i8i2_279",contenido_final:"_contenido_final_1i8i2_281",controles:"_controles_1i8i2_299",boton_control:"_boton_control_1i8i2_315",variante_bordered:"_variante_bordered_1i8i2_369",variante_faded:"_variante_faded_1i8i2_377",variante_underlined:"_variante_underlined_1i8i2_385",variante_ghost:"_variante_ghost_1i8i2_397",descripcion:"_descripcion_1i8i2_445",mensaje_error:"_mensaje_error_1i8i2_457",ancho_total:"_ancho_total_1i8i2_469",deshabilitado:"_deshabilitado_1i8i2_533",solo_lectura:"_solo_lectura_1i8i2_567",enfocado:"_enfocado_1i8i2_621",valido:"_valido_1i8i2_629",invalido:"_invalido_1i8i2_637",sin_animacion:"_sin_animacion_1i8i2_669"},gi=m.forwardRef((e,t)=>{const{value:n,defaultValue:o,placeholder:r,variant:i="bordered",color:a="default",size:l="md",radius:d="md",fullWidth:u=!0,disableAnimation:_=!1,label:g,description:f,errorMessage:c,startContent:h,endContent:p,isRequired:v=!1,isReadOnly:w=!1,isDisabled:C=!1,isInvalid:x,validationState:I,validate:z,className:A,classNames:N,style:L,min:P,max:k,step:O=1,decimalScale:j,fixedDecimalScale:$=!1,thousandSeparator:b=!1,decimalSeparator:S=".",prefix:T="",suffix:F="",allowNegative:y=!0,allowDecimal:E=!0,hideControls:D=!1,clampBehavior:B="blur",onChange:H,onValueChange:V,onFocus:J,onBlur:U,onKeyDown:pe,id:ce,name:ie,...ge}=e,de=m.useRef(null),Z=m.useRef(ce??`input-numeric-${Gt(8)}`).current;m.useImperativeHandle(t,()=>de.current);const oe=n!==void 0,[ne,ue]=m.useState(o!==void 0?o:void 0),[ve,X]=m.useState(""),[he,te]=m.useState(!1),se=oe?n===""?void 0:n:ne,Ce=m.useMemo(()=>({separadorMiles:b,separadorDecimal:S,escalaDecimal:E?j:0,decimalesFijos:$,prefijo:T,sufijo:F,permitirNegativo:y}),[b,S,j,$,T,F,y,E]),W=m.useMemo(()=>{if(!z)return null;const ee=fi(z(se));return ee.invalido?ee.mensaje:null},[se,z]),q=m.useMemo(()=>x!==void 0?x:I==="invalid"?!0:I==="valid"?!1:!!W,[x,I,W]),G=I==="valid"&&!q,fe={invalido:q,mensaje:W},_e=m.useCallback(ee=>{oe||ue(ee),H?.(ee),V?.(xt(ee,Ce),ee)},[oe,H,V,Ce]),me=m.useCallback(ee=>{let Ke=(se??0)+O*ee;B!=="none"&&(Ke=Kt(Ke,P,k)),j!==void 0&&(Ke=_i(Ke,j)),_e(Ke),X(xt(Ke,Ce))},[se,O,P,k,B,j,_e,Ce]),Xe=m.useCallback(ee=>{if(C||w)return;const Ne=ee.target.value,Ke=S===","?",":".";let Me="0-9";E&&(Me+=Ke),y&&(Me+="-");const gn=new RegExp(`[^${Me}]`,"g");let ln=Ne.replace(gn,"");if(E){const pn=ln.split(Ke);pn.length>2&&(ln=pn[0]+Ke+pn.slice(1).join(""))}if(y&&ln.includes("-")){const pn=ln.replace(/-/g,"");ln=ln.startsWith("-")?"-"+pn:pn}X(ln);const Fn=ui(ln,Ce);if(B==="strict"&&Fn!==void 0){const pn=Kt(Fn,P,k);_e(pn)}else _e(Fn)},[C,w,Ce,B,P,k,_e,S,y,E]),Oe=m.useCallback(ee=>{if(te(!0),se!==void 0){let Ne=String(se);S!=="."&&(Ne=Ne.replace(".",S)),X(Ne)}J?.(ee)},[se,S,J]),Ze=m.useCallback(ee=>{if(te(!1),B==="blur"&&se!==void 0){const Ne=Kt(se,P,k);Ne!==se&&_e(Ne)}X(xt(se,Ce)),U?.(ee)},[se,B,P,k,_e,Ce,U]),Ve=m.useCallback(ee=>{ee.key==="ArrowUp"?(ee.preventDefault(),me(1)):ee.key==="ArrowDown"&&(ee.preventDefault(),me(-1));const Ne=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],Ke=ee.ctrlKey||ee.metaKey,Me=E&&(ee.key===S||ee.key==="."||ee.key===","),gn=ee.key==="-"&&y,nn=/^[0-9]$/.test(ee.key);!Ne.includes(ee.key)&&!Ke&&!Me&&!gn&&!nn&&ee.preventDefault(),pe?.(ee)},[me,pe,S,y,E]);m.useEffect(()=>{he||X(xt(se,Ce))},[se,he,Ce]);const ye=f?`${Z}-desc`:void 0,Qe=q?`${Z}-err`:void 0,be=[ye,Qe].filter(Boolean).join(" ")||void 0,we=typeof c=="function"?c(fe):c??W,je=k===void 0||(se??0)<k,De=P===void 0||(se??0)>P,yn=K(Ge.contenedor_base,Ge[`variante_${i}`],Ge[`tam_${l}`],Ge[`radio_${d}`],Ge[`color_${a}`],{[Ge.ancho_total]:u,[Ge.sin_animacion]:_,[Ge.deshabilitado]:C,[Ge.solo_lectura]:w,[Ge.invalido]:q,[Ge.valido]:G,[Ge.enfocado]:he},A,N?.base);return s.jsxs("div",{className:yn,style:L,children:[g&&s.jsxs("label",{className:K(Ge.etiqueta,N?.label),htmlFor:Z,children:[g,v&&s.jsx("span",{className:Ge.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsxs("div",{className:K(Ge.envoltorio_input,N?.inputWrapper),children:[s.jsxs("div",{className:K(Ge.envoltorio_interno,N?.innerWrapper),children:[h&&s.jsx("span",{className:Ge.contenido_inicio,children:h}),s.jsx("input",{...ge,ref:de,id:Z,name:ie,type:"text",inputMode:"decimal",value:ve,placeholder:r,disabled:C,readOnly:w,required:v,"aria-invalid":q||void 0,"aria-describedby":be,"aria-required":v,className:K(Ge.entrada,N?.input),onChange:Xe,onFocus:Oe,onBlur:Ze,onKeyDown:Ve}),p&&s.jsx("span",{className:Ge.contenido_final,children:p})]}),!D&&!w&&!C&&s.jsxs("div",{className:K(Ge.controles,N?.controls),children:[s.jsx("button",{type:"button",tabIndex:-1,className:K(Ge.boton_control,N?.controlButton),disabled:!De,onClick:()=>me(-1),"aria-label":"Decrementar valor",children:s.jsx(ul,{})}),s.jsx("button",{type:"button",tabIndex:-1,className:K(Ge.boton_control,N?.controlButton),disabled:!je,onClick:()=>me(1),"aria-label":"Incrementar valor",children:s.jsx(dl,{})})]})]}),f&&!q&&s.jsx("div",{id:ye,className:K(Ge.descripcion,N?.description),children:f}),q&&we&&s.jsx("div",{id:Qe,className:K(Ge.mensaje_error,N?.errorMessage),role:"alert",children:we})]})});gi.displayName="InputNumeric";function fl(e){return e===!0||e===null||e===void 0?{invalido:!1,mensaje:null}:e===!1?{invalido:!0,mensaje:null}:typeof e=="string"?{invalido:!0,mensaje:e}:typeof e=="object"&&e.message?{invalido:!0,mensaje:e.message}:{invalido:!1,mensaje:null}}function Ko(e,t="es-CO"){if(!e)return"";const n=new Date(e+"T00:00:00");return Number.isNaN(n.getTime())?"":n.toLocaleDateString(t,{year:"numeric",month:"long",day:"numeric"})}function _l(){return new Date().toISOString().split("T")[0]}function gl(e,t,n){if(!e)return!0;const o=new Date(e).getTime();return!(t&&o<new Date(t).getTime()||n&&o>new Date(n).getTime())}const Ue={contenedor_base:"_contenedor_base_12h7l_1",tam_sm:"_tam_sm_12h7l_37",tam_lg:"_tam_lg_12h7l_49",radio_none:"_radio_none_12h7l_61",radio_sm:"_radio_sm_12h7l_69",radio_md:"_radio_md_12h7l_77",radio_lg:"_radio_lg_12h7l_85",radio_full:"_radio_full_12h7l_93",color_default:"_color_default_12h7l_101",color_primary:"_color_primary_12h7l_103",color_secondary:"_color_secondary_12h7l_111",color_success:"_color_success_12h7l_119",color_warning:"_color_warning_12h7l_127",color_danger:"_color_danger_12h7l_135",etiqueta:"_etiqueta_12h7l_143",marca_requerido:"_marca_requerido_12h7l_159",envoltorio_input:"_envoltorio_input_12h7l_169",envoltorio_interno:"_envoltorio_interno_12h7l_195",entrada:"_entrada_12h7l_215",boton_icono:"_boton_icono_12h7l_267",enfocado:"_enfocado_12h7l_323",deshabilitado:"_deshabilitado_12h7l_331",solo_lectura:"_solo_lectura_12h7l_333",boton_limpiar:"_boton_limpiar_12h7l_343",contenido_inicio:"_contenido_inicio_12h7l_401",descripcion:"_descripcion_12h7l_419",mensaje_error:"_mensaje_error_12h7l_431",ancho_total:"_ancho_total_12h7l_443",variante_bordered:"_variante_bordered_12h7l_451",variante_faded:"_variante_faded_12h7l_461",variante_underlined:"_variante_underlined_12h7l_471",variante_ghost:"_variante_ghost_12h7l_487",valido:"_valido_12h7l_597",invalido:"_invalido_12h7l_605",sin_animacion:"_sin_animacion_12h7l_637"},pl=()=>s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("polyline",{points:"12 6 12 12 16 14"})]}),hl=()=>s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("path",{d:"M8 2v4"}),s.jsx("path",{d:"M16 2v4"}),s.jsx("rect",{height:"18",rx:"2",width:"18",x:"3",y:"4"}),s.jsx("path",{d:"M3 10h18"}),s.jsx("circle",{cx:"8",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"12",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"16",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"8",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"12",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"16",cy:"18",r:"1",fill:"currentColor",stroke:"none"})]}),ml=()=>s.jsxs("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("path",{d:"M18 6 6 18"}),s.jsx("path",{d:"m6 6 12 12"})]}),vl=({tipo:e,onClick:t,onMouseDown:n})=>s.jsx("button",{type:"button",tabIndex:-1,className:Ue.boton_icono,onMouseDown:n,onClick:t,"aria-label":e==="time"?"Abrir selector de hora":"Abrir selector de fecha",children:e==="time"?s.jsx(pl,{}):s.jsx(hl,{})}),pi=m.forwardRef((e,t)=>{const{type:n="date",value:o,defaultValue:r,placeholder:i,variant:a="bordered",color:l="default",size:d="md",radius:u="md",fullWidth:_=!0,disableAnimation:g=!1,label:f,description:c,errorMessage:h,startContent:p,isRequired:v=!1,isReadOnly:w=!1,isDisabled:C=!1,isInvalid:x,validationState:I,validate:z,className:A,classNames:N,style:L,min:P,max:k,isClearable:O=!1,onChange:j,onFocus:$,onBlur:b,id:S,name:T,...F}=e,y=m.useRef(null),D=m.useRef(S??`input-date-${Gt(8)}`).current;m.useImperativeHandle(t,()=>y.current);const B=o!==void 0,[H,V]=m.useState(r??""),J=B?o:H,[U,pe]=m.useState(!1),ce=m.useRef(!1),ie=m.useMemo(()=>{if(J&&n!=="time"&&(P||k)){if(P&&J<P)return`La fecha debe ser ${n==="date"?Ko(P):P} o posterior`;if(k&&J>k)return`La fecha debe ser ${n==="date"?Ko(k):k} o anterior`}if(!z)return null;const q=fl(z(J));return q.invalido?q.mensaje:null},[J,z,P,k,n]),ge=m.useMemo(()=>x!==void 0?x:I==="invalid"?!0:I==="valid"?!1:!!ie,[x,I,ie]),de=I==="valid"&&!ge,$e={invalido:ge,mensaje:ie},Z=m.useCallback(q=>{if(C||w)return;ce.current=!1;const G=q.target.value;B||V(G),j?.(G)},[B,C,w,j]),oe=m.useCallback(q=>{pe(!0),$?.(q)},[$]),ne=m.useCallback(q=>{pe(!1),ce.current=!1,b?.(q)},[b]),ue=m.useCallback(q=>{q.preventDefault()},[]),ve=m.useCallback(q=>{if(q.preventDefault(),q.stopPropagation(),!(!y.current||C||w)){if(ce.current){ce.current=!1,y.current.blur();return}y.current.focus();try{y.current.showPicker?.(),ce.current=!0}catch{}}},[C,w]),X=m.useCallback(q=>{q.preventDefault(),q.stopPropagation(),ce.current=!1,B||V(""),j?.(""),y.current?.focus()},[B,j]),he=c?`${D}-desc`:void 0,te=ge?`${D}-err`:void 0,se=[he,te].filter(Boolean).join(" ")||void 0,Ce=typeof h=="function"?h($e):h??ie,W=K(Ue.contenedor_base,Ue[`variante_${a}`],Ue[`tam_${d}`],Ue[`radio_${u}`],Ue[`color_${l}`],{[Ue.ancho_total]:_,[Ue.sin_animacion]:g,[Ue.deshabilitado]:C,[Ue.solo_lectura]:w,[Ue.invalido]:ge,[Ue.valido]:de,[Ue.enfocado]:U},A,N?.base);return s.jsxs("div",{className:W,style:L,children:[f&&s.jsxs("label",{className:K(Ue.etiqueta,N?.label),htmlFor:D,children:[f,v&&s.jsx("span",{className:Ue.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsx("div",{className:K(Ue.envoltorio_input,N?.inputWrapper),children:s.jsxs("div",{className:K(Ue.envoltorio_interno,N?.innerWrapper),children:[p&&s.jsx("span",{className:Ue.contenido_inicio,children:p}),s.jsx("input",{...F,ref:y,id:D,name:T,type:n,value:B?J:void 0,defaultValue:B?void 0:r,placeholder:i,disabled:C,readOnly:w,required:v,min:P,max:k,"aria-invalid":ge||void 0,"aria-describedby":se,"aria-required":v,className:K(Ue.entrada,N?.input),onChange:Z,onFocus:oe,onBlur:ne}),O&&J&&!C&&!w&&s.jsx("button",{type:"button",tabIndex:-1,className:K(Ue.boton_limpiar,N?.clearButton),onMouseDown:q=>q.preventDefault(),onClick:X,"aria-label":"Limpiar fecha",children:s.jsx(ml,{})}),s.jsx(vl,{tipo:n,onClick:ve,onMouseDown:ue})]})}),c&&!ge&&s.jsx("div",{id:he,className:K(Ue.descripcion,N?.description),children:c}),ge&&Ce&&s.jsx("div",{id:te,className:K(Ue.mensaje_error,N?.errorMessage),role:"alert",children:Ce})]})});pi.displayName="InputDate";const bl={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function Ut({mostrar:e,children:t,tipo:n="desvanecerDeslizar",className:o,...r}){const[i,a]=m.useState(e),[l,d]=m.useState(e?"entrada":null);e&&!i?(a(!0),d("entrada")):!e&&i&&l!=="salida"&&d("salida");const u=()=>{l==="entrada"?d(null):l==="salida"&&(a(!1),d(null))};if(!i)return null;const _=bl[n||"desvanecer"],g=l?`transicion_${_}_${l}`:"";return s.jsx("div",{...r,onAnimationEnd:u,className:`${g} ${o||""}`.trim(),children:t})}const An={badges_wrap:"_badges_wrap_asqih_15",badges_wrap_visible:"_badges_wrap_visible_asqih_23",acciones_grupo:"_acciones_grupo_asqih_33",badge_voz:"_badge_voz_asqih_41",badge_sm:"_badge_sm_asqih_73",badge_md:"_badge_md_asqih_85",badge_lg:"_badge_lg_asqih_97",badge_estirada:"_badge_estirada_asqih_109",badge_icono:"_badge_icono_asqih_129",badge_texto:"_badge_texto_asqih_155",badge_mic:"_badge_mic_asqih_165",badge_tts:"_badge_tts_asqih_173",badge_ondas:"_badge_ondas_asqih_181",badgeOnda:"_badgeOnda_asqih_1",badge_eq:"_badge_eq_asqih_219",badgeEq:"_badgeEq_asqih_1"};function Uo(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:s.jsxs("g",{fill:"currentColor",children:[s.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),s.jsx("path",{d:"M8 11a4 4 0 0 1-4-4H2a6 6 0 0 0 5 5.917V14H5v2h6v-2H9v-1.083A6 6 0 0 0 14 7h-2a4 4 0 0 1-4 4"})]})})}function Xo(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...e,children:s.jsx("path",{fill:"currentColor",d:"M18 5.433c0-1.398-1.742-2.036-2.645-.97l-4.086 4.83A2 2 0 0 1 9.743 10H6a4 4 0 0 0-4 4v4a4 4 0 0 0 4 4h3.743a2 2 0 0 1 1.526.708l4.086 4.829c.902 1.066 2.645.428 2.645-.97zm3.433 3.743a1 1 0 0 1 1.391.258c1.465 2.13 2.238 4.324 2.238 6.566s-.773 4.436-2.238 6.567a1 1 0 1 1-1.648-1.133c1.285-1.87 1.887-3.676 1.887-5.434s-.602-3.564-1.887-5.433a1 1 0 0 1 .258-1.39m4.257-3.9a1 1 0 0 0-1.38 1.448c2.387 2.273 3.628 5.739 3.628 9.276s-1.241 7.003-3.628 9.276a1 1 0 0 0 1.38 1.448c2.863-2.727 4.247-6.761 4.247-10.724S28.554 8.003 25.69 5.276"})})}function hi(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...e,children:[s.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),s.jsx("path",{fill:"currentColor",d:"M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2m0 16a6 6 0 1 1 6-6a6.007 6.007 0 0 1-6 6"})]})}function Yo({tipo:e,texto:t,size:n="md",estirar:o}){const r=e==="mic";return s.jsxs("span",{className:K(An.badge_voz,r?An.badge_mic:An.badge_tts,An[`badge_${n}`],o&&An.badge_estirada),"data-tipo":e,children:[s.jsx("span",{className:An.badge_icono,children:r?s.jsx(Uo,{}):s.jsx(Xo,{})}),s.jsx("span",{className:An.badge_texto,children:t}),r?s.jsxs("span",{className:An.badge_ondas,"aria-hidden":"true",children:[s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{})]}):s.jsxs("span",{className:An.badge_eq,"aria-hidden":"true",children:[s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{})]})]})}function mi({value:e,onChange:t,isDisabled:n,isReadOnly:o,onDictadoCompleto:r,idioma:i="es-ES"}){const[a,l]=m.useState(!1),[d,u]=m.useState(!1),[_,g]=m.useState(null),f=m.useRef(null),c=m.useRef(null),h=m.useRef(null),p=m.useRef(""),v=typeof window<"u"&&"speechSynthesis"in window,w=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),C=m.useCallback(()=>{h.current&&(clearTimeout(h.current),h.current=null),v&&window.speechSynthesis.cancel(),c.current=null,l(!1)},[v]),x=m.useCallback(()=>{if(!v||!e)return;if(C(),f.current){try{f.current.stop()}catch(N){console.error("Error stopping recognition:",N)}f.current=null,u(!1)}const A=new SpeechSynthesisUtterance(e);A.lang=i,A.onstart=()=>l(!0),A.onend=()=>{l(!1),c.current=null},A.onerror=()=>{l(!1),c.current=null},c.current=A,window.speechSynthesis.speak(A)},[v,e,i,C]),I=m.useCallback(()=>{if(f.current)try{f.current.stop()}catch(A){console.error("Error stopping recognition:",A)}u(!1),g(null)},[]),z=m.useCallback(()=>{if(!w||n||o)return;C();const A=window,N=A.SpeechRecognition||A.webkitSpeechRecognition;if(!N){g("Navegador no compatible");return}try{const L=new N;L.continuous=!0,L.interimResults=!0,L.lang=i,L.onstart=()=>{u(!0),g(null),p.current=e||""},L.onend=()=>{u(!1),f.current=null,r?.()},L.onerror=P=>{P.error!=="no-speech"&&(u(!1),f.current=null,P.error!=="aborted"&&g("Error al reconocer voz"))},L.onresult=P=>{try{let k="";for(let $=0;$<P.results.length;$++)k+=P.results[$][0].transcript;const O=p.current&&k?" ":"",j=p.current+O+k;t(j)}catch{g("Error procesando dictado")}},f.current=L,L.start()}catch{g("No se pudo iniciar dictado"),u(!1)}},[w,n,o,e,t,i,C,r]);return m.useEffect(()=>()=>{h.current&&clearTimeout(h.current),v&&window.speechSynthesis.cancel(),f.current&&f.current.abort()},[v]),{puedeHablar:v,puedeEscuchar:w,hablando:a,escuchando:d,errorDictado:_,escuchar:x,detenerHablar:C,dictar:z,detenerDictado:I}}function wl({size:e="1em",className:t}){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:e,height:e,className:t,"aria-hidden":"true",children:[s.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}const Le={contenedor_base:"_contenedor_base_126y1_1",tam_sm:"_tam_sm_126y1_29",tam_lg:"_tam_lg_126y1_41",radio_none:"_radio_none_126y1_53",radio_sm:"_radio_sm_126y1_61",radio_md:"_radio_md_126y1_69",radio_lg:"_radio_lg_126y1_77",radio_full:"_radio_full_126y1_85",color_default:"_color_default_126y1_93",color_primary:"_color_primary_126y1_95",color_secondary:"_color_secondary_126y1_103",color_success:"_color_success_126y1_111",color_warning:"_color_warning_126y1_119",color_danger:"_color_danger_126y1_127",etiqueta:"_etiqueta_126y1_135",marca_requerido:"_marca_requerido_126y1_151",envoltorio_input:"_envoltorio_input_126y1_161",entrada:"_entrada_126y1_187",sin_autosize:"_sin_autosize_126y1_237",barra_acciones:"_barra_acciones_126y1_245",badges_contenedor:"_badges_contenedor_126y1_265",botones_grupo:"_botones_grupo_126y1_279",boton_accion:"_boton_accion_126y1_291",boton_activo_tts:"_boton_activo_tts_126y1_353",haloTts:"_haloTts_126y1_1",boton_activo_mic:"_boton_activo_mic_126y1_383",haloMic:"_haloMic_126y1_1",boton_limpiar:"_boton_limpiar_126y1_471",descripcion:"_descripcion_126y1_519",mensaje_error:"_mensaje_error_126y1_531",ancho_total:"_ancho_total_126y1_543",variante_bordered:"_variante_bordered_126y1_551",variante_faded:"_variante_faded_126y1_561",variante_underlined:"_variante_underlined_126y1_581",variante_ghost:"_variante_ghost_126y1_615",deshabilitado:"_deshabilitado_126y1_635",solo_lectura:"_solo_lectura_126y1_669",enfocado:"_enfocado_126y1_729",valido:"_valido_126y1_737",invalido:"_invalido_126y1_745",sin_animacion:"_sin_animacion_126y1_777"},vi=m.forwardRef((e,t)=>{const{children:n,variant:o="bordered",color:r="default",size:i="md",radius:a="md",fullWidth:l=!0,disableAnimation:d=!1,label:u,description:_,errorMessage:g,value:f,defaultValue:c,placeholder:h,isRequired:p=!1,isReadOnly:v=!1,isDisabled:w=!1,isClearable:C=!1,isInvalid:x,validationState:I,validate:z,minRows:A=4,maxRows:N=10,disableAutosize:L=!1,hideVoiceActions:P=!1,className:k,classNames:O,style:j,onChange:$,onClear:b,onFocus:S,onBlur:T,id:F,name:y,rows:E,...D}=e,B=m.useRef(null),V=m.useRef(F??`textarea-${Gt(8)}`).current;m.useImperativeHandle(t,()=>B.current);const J=f!==void 0,[U,pe]=m.useState(c??""),ce=J?f:U,[ie,ge]=m.useState(!1),de=m.useMemo(()=>{if(!z)return null;const ee=z(ce);return ee===!0||ee==null?null:typeof ee=="string"?ee:typeof ee=="object"&&"message"in ee?ee.message??"Entrada inválida":"Entrada inválida"},[ce,z]),$e=m.useMemo(()=>x!==void 0?x:I==="invalid"?!0:I==="valid"?!1:!!de,[x,I,de]),Z=I==="valid"&&!$e,oe={invalido:$e,mensaje:de},ne=ce.length>0,ue=m.useCallback(()=>{if(!B.current||L)return;const ee=B.current,Ne=window.getComputedStyle(ee),Ke=parseFloat(Ne.lineHeight)||parseFloat(Ne.fontSize)*1.5,Me=parseFloat(Ne.paddingTop)||0,gn=parseFloat(Ne.paddingBottom)||0,nn=parseFloat(Ne.borderTopWidth)||0,ln=parseFloat(Ne.borderBottomWidth)||0,Fn=A*Ke+Me+gn+nn+ln,pn=N*Ke+Me+gn+nn+ln;ee.style.height="auto";const kn=ee.scrollHeight;ee.style.height=`${Math.min(Math.max(kn,Fn),pn)}px`},[L,A,N]);m.useEffect(()=>{L||ue()},[ce,ue,L]);const ve=m.useCallback(ee=>{J||pe(ee),$?.(ee)},[J,$]),{puedeHablar:X,hablando:he,escuchar:te,detenerHablar:se,puedeEscuchar:Ce,escuchando:W,errorDictado:q,dictar:G,detenerDictado:fe}=mi({isDisabled:w||P,isReadOnly:v,value:ce,onChange:ve}),_e=m.useCallback(ee=>{if(w||v)return;const Ne=ee.target.value;J||pe(Ne),$?.(Ne)},[J,w,v,$]),me=m.useCallback(ee=>{ge(!0),S?.(ee)},[S]),Xe=m.useCallback(ee=>{ge(!1),T?.(ee)},[T]),Oe=m.useCallback(()=>{w||v||(J||pe(""),$?.(""),b?.(),B.current?.focus())},[J,w,v,$,b]),Ze=m.useCallback(()=>{he?se():te()},[he,te,se]),Ve=m.useCallback(()=>{W?fe():G()},[W,G,fe]),ye=_?`${V}-desc`:void 0,Qe=$e||q?`${V}-err`:void 0,be=[ye,Qe].filter(Boolean).join(" ")||void 0,we=typeof g=="function"?g(oe):g??de,je=C&&ne&&!v&&!w,De=!P||je,yn=K(Le.contenedor_base,Le[`variante_${o}`],Le[`tam_${i}`],Le[`radio_${a}`],Le[`color_${r}`],{[Le.ancho_total]:l,[Le.sin_animacion]:d,[Le.deshabilitado]:w,[Le.solo_lectura]:v,[Le.invalido]:$e,[Le.valido]:Z,[Le.enfocado]:ie},k,O?.base);return s.jsxs("div",{className:yn,style:j,children:[u&&s.jsxs("label",{className:K(Le.etiqueta,O?.label),htmlFor:V,children:[u,p&&s.jsx("span",{className:Le.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsxs("div",{className:K(Le.envoltorio_input,O?.inputWrapper),children:[s.jsx("textarea",{...D,ref:B,id:V,name:y,placeholder:h,value:J?ce:void 0,defaultValue:J?void 0:c,onChange:_e,onFocus:me,onBlur:Xe,className:K(Le.entrada,L&&Le.sin_autosize,O?.input),readOnly:v,disabled:w,rows:E??A,"aria-invalid":$e||void 0,"aria-describedby":be,"aria-required":p,required:p}),De&&s.jsxs("div",{className:K(Le.barra_acciones,O?.actions),children:[s.jsxs("div",{className:Le.badges_contenedor,"aria-live":"polite",role:"status",children:[s.jsx(Ut,{mostrar:W,children:s.jsx(Yo,{tipo:"mic",texto:"Escuchando...",size:i==="lg"?"md":"sm"})}),s.jsx(Ut,{mostrar:he,children:s.jsx(Yo,{tipo:"tts",texto:"Leyendo...",size:i==="lg"?"md":"sm"})})]}),s.jsxs("div",{className:Le.botones_grupo,children:[!P&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:K(Le.boton_accion,he&&Le.boton_activo_tts),onClick:Ze,disabled:!X||!he&&(!ce||W),title:he?"Detener lectura":"Leer texto","aria-pressed":he,"aria-label":he?"Detener lectura":"Leer texto",children:s.jsx(Xo,{})}),Ce&&s.jsx("button",{type:"button",className:K(Le.boton_accion,W&&Le.boton_activo_mic),onClick:Ve,disabled:w||v||he,title:W?"Detener dictado":"Dictar texto","aria-pressed":W,"aria-label":W?"Detener dictado":"Dictar texto",children:W?s.jsx(hi,{}):s.jsx(Uo,{})})]}),je&&s.jsx("button",{type:"button",className:Le.boton_limpiar,onClick:Oe,title:"Limpiar campo","aria-label":"Limpiar campo",children:s.jsx(wl,{size:"0.75em"})})]})]})]}),_&&!$e&&s.jsx("div",{id:ye,className:K(Le.descripcion,O?.description),children:_}),$e&&we||q?s.jsxs("div",{id:Qe,className:K(Le.mensaje_error,O?.errorMessage),role:"alert",children:[we,we&&q&&s.jsx("br",{}),q&&s.jsxs("span",{children:["Error de voz: ",q]})]}):null,n]})});vi.displayName="TextArea";function Xt(){return typeof window<"u"}function Hn(e){return Ro(e)?(e.nodeName||"").toLowerCase():"#document"}function mn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function In(e){var t;return(t=(Ro(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ro(e){return Xt()?e instanceof Node||e instanceof mn(e).Node:!1}function Pe(e){return Xt()?e instanceof Element||e instanceof mn(e).Element:!1}function Ye(e){return Xt()?e instanceof HTMLElement||e instanceof mn(e).HTMLElement:!1}function Yt(e){return!Xt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof mn(e).ShadowRoot}const yl=new Set(["inline","contents"]);function St(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=vn(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!yl.has(r)}const Cl=new Set(["table","td","th"]);function xl(e){return Cl.has(Hn(e))}const Sl=[":popover-open",":modal"];function Rt(e){return Sl.some(t=>{try{return e.matches(t)}catch{return!1}})}const $l=["transform","translate","scale","rotate","perspective"],kl=["transform","translate","scale","rotate","perspective","filter"],Il=["paint","layout","strict","content"];function Zo(e){const t=Zt(),n=Pe(e)?vn(e):e;return $l.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||kl.some(o=>(n.willChange||"").includes(o))||Il.some(o=>(n.contain||"").includes(o))}function El(e){let t=Pn(e);for(;Ye(t)&&!Ln(t);){if(Zo(t))return t;if(Rt(t))return null;t=Pn(t)}return null}function Zt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ml=new Set(["html","body","#document"]);function Ln(e){return Ml.has(Hn(e))}function vn(e){return mn(e).getComputedStyle(e)}function Jt(e){return Pe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pn(e){if(Hn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yt(e)&&e.host||In(e);return Yt(t)?t.host:t}function bi(e){const t=Pn(e);return Ln(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ye(t)&&St(t)?t:bi(t)}function Gn(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=bi(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),a=mn(r);if(i){const l=Jo(a);return t.concat(a,a.visualViewport||[],St(r)?r:[],l&&n?Gn(l):[])}return t.concat(r,Gn(r,[],n))}function Jo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Wn=Math.min,bn=Math.max,Qt=Math.round,dt=Math.floor,En=e=>({x:e,y:e}),Nl={left:"right",right:"left",bottom:"top",top:"bottom"},Fl={start:"end",end:"start"};function Qo(e,t,n){return bn(e,Wn(t,n))}function ut(e,t){return typeof e=="function"?e(t):e}function Kn(e){return e.split("-")[0]}function ft(e){return e.split("-")[1]}function wi(e){return e==="x"?"y":"x"}function er(e){return e==="y"?"height":"width"}const zl=new Set(["top","bottom"]);function Tn(e){return zl.has(Kn(e))?"y":"x"}function nr(e){return wi(Tn(e))}function Dl(e,t,n){n===void 0&&(n=!1);const o=ft(e),r=nr(e),i=er(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=eo(a)),[a,eo(a)]}function Al(e){const t=eo(e);return[tr(e),t,tr(t)]}function tr(e){return e.replace(/start|end/g,t=>Fl[t])}const yi=["left","right"],Ci=["right","left"],Ll=["top","bottom"],Pl=["bottom","top"];function Tl(e,t,n){switch(e){case"top":case"bottom":return n?t?Ci:yi:t?yi:Ci;case"left":case"right":return t?Ll:Pl;default:return[]}}function Ol(e,t,n,o){const r=ft(e);let i=Tl(Kn(e),n==="start",o);return r&&(i=i.map(a=>a+"-"+r),t&&(i=i.concat(i.map(tr)))),i}function eo(e){return e.replace(/left|right|bottom|top/g,t=>Nl[t])}function Vl(e){return{top:0,right:0,bottom:0,left:0,...e}}function xi(e){return typeof e!="number"?Vl(e):{top:e,right:e,bottom:e,left:e}}function no(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}/*!
655
2
  * tabbable 6.3.0
656
3
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
657
- */var u_=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],$o=u_.join(","),Zi=typeof Element>"u",Cn=Zi?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ko=!Zi&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},jn=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),s=r===""||r==="true",i=s||n&&t&&jn(t.parentNode);return i},f_=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},Ji=function(t,n,o){if(jn(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll($o));return n&&Cn.call(t,$o)&&r.unshift(t),r=r.filter(o),r},Eo=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!jn(i,!1))if(i.tagName==="SLOT"){var l=i.assignedElements(),c=l.length?l:i.children,d=Eo(c,!0,o);o.flatten?r.push.apply(r,d):r.push({scopeParent:i,candidates:d})}else{var _=Cn.call(i,$o);_&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var g=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),f=!jn(g,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(g&&f){var u=Eo(g===!0?i.children:g.children,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:i,candidates:u})}else s.unshift.apply(s,i.children)}}return r},Qi=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ea=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||f_(t))&&!Qi(t)?0:t.tabIndex},__=function(t,n){var o=ea(t);return o<0&&n&&!Qi(t)?0:o},g_=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ta=function(t){return t.tagName==="INPUT"},h_=function(t){return ta(t)&&t.type==="hidden"},p_=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},m_=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},v_=function(t){if(!t.name)return!0;var n=t.form||ko(t),o=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=m_(r,t.form);return!s||s===t},b_=function(t){return ta(t)&&t.type==="radio"},w_=function(t){return b_(t)&&!v_(t)},y_=function(t){var n,o=t&&ko(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var i,l,c;for(s=!!((i=r)!==null&&i!==void 0&&(l=i.ownerDocument)!==null&&l!==void 0&&l.contains(r)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!s&&r;){var d,_,g;o=ko(r),r=(d=o)===null||d===void 0?void 0:d.host,s=!!((_=r)!==null&&_!==void 0&&(g=_.ownerDocument)!==null&&g!==void 0&&g.contains(r))}}return s},na=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},C_=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Cn.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(Cn.call(l,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var c=t;t;){var d=t.parentElement,_=ko(t);if(d&&!d.shadowRoot&&r(d)===!0)return na(t);t.assignedSlot?t=t.assignedSlot:!d&&_!==t.ownerDocument?t=_.host:t=d}t=c}if(y_(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return na(t);return!1},x_=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return Cn.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},Hr=function(t,n){return!(n.disabled||jn(n)||h_(n)||C_(n,t)||p_(n)||x_(n))},Rr=function(t,n){return!(w_(n)||ea(n)<0||!Hr(t,n))},S_=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},oa=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,l=i?r.scopeParent:r,c=__(l,i),d=i?oa(r.candidates):l;c===0?i?n.push.apply(n,d):n.push(l):o.push({documentOrder:s,tabIndex:c,item:r,isScope:i,content:d})}),o.sort(g_).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},Io=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Eo([t],n.includeContainer,{filter:Rr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:S_}):o=Ji(t,n.includeContainer,Rr.bind(null,n)),oa(o)},$_=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Eo([t],n.includeContainer,{filter:Hr.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=Ji(t,n.includeContainer,Hr.bind(null,n)),o},ra=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Cn.call(t,$o)===!1?!1:Rr(n,t)};function sa(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function ia(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:o}=t;return n+"/"+o}).join(" "):navigator.userAgent}function aa(){return/apple/i.test(navigator.vendor)}function Ur(){const e=/android/i;return e.test(sa())||e.test(ia())}function k_(){return sa().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function la(){return ia().includes("jsdom/")}const ca="data-floating-ui-focusable",E_="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Wr="ArrowLeft",Gr="ArrowRight",I_="ArrowUp",N_="ArrowDown";function Tt(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function it(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&vo(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function jt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Kr(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function M_(e){return e.matches("html,body")}function at(e){return e?.ownerDocument||document}function Xr(e){return Xe(e)&&e.matches(E_)}function Yr(e){return e?e.getAttribute("role")==="combobox"&&Xr(e):!1}function A_(e){if(!e||la())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function No(e){return e?e.hasAttribute(ca)?e:e.querySelector("["+ca+"]")||e:null}function cn(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var s;return r.parentId===t&&(!n||((s=r.context)==null?void 0:s.open))}).flatMap(r=>[r,...cn(e,r.id,n)])}function D_(e,t){let n,o=-1;function r(s,i){i>o&&(n=s,o=i),cn(e,s).forEach(c=>{r(c.id,i+1)})}return r(t,0),e.find(s=>s.id===n)}function da(e,t){var n;let o=[],r=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;r;){const s=e.find(i=>i.id===r);r=s?.parentId,s&&(o=o.concat(s))}return o}function lt(e){e.preventDefault(),e.stopPropagation()}function T_(e){return"nativeEvent"in e}function ua(e){return e.mozInputSource===0&&e.isTrusted?!0:Ur()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function fa(e){return la()?!1:!Ur()&&e.width===0&&e.height===0||Ur()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function qn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var F_=typeof document<"u",P_=function(){},Le=F_?v.useLayoutEffect:P_;const L_={...N};function et(e){const t=N.useRef(e);return Le(()=>{t.current=e}),t}const O_=L_.useInsertionEffect||(e=>e());function Ye(e){const t=N.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return O_(()=>{t.current=e}),N.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function Mo(e,t,n){return Math.floor(e/t)!==n}function Hn(e,t){return t<0||t>=e.current.length}function Zr(e,t){return ut(e,{disabledIndices:t})}function _a(e,t){return ut(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ut(e,t){let{startingIndex:n=-1,decrement:o=!1,disabledIndices:r,amount:s=1}=t===void 0?{}:t,i=n;do i+=o?-s:s;while(i>=0&&i<=e.current.length-1&&Ao(e,i,r));return i}function z_(e,t){let{event:n,orientation:o,loop:r,rtl:s,cols:i,disabledIndices:l,minIndex:c,maxIndex:d,prevIndex:_,stopEvent:g=!1}=t,f=_;if(n.key===I_){if(g&&lt(n),_===-1)f=d;else if(f=ut(e,{startingIndex:f,amount:i,decrement:!0,disabledIndices:l}),r&&(_-i<c||f<0)){const u=_%i,p=d%i,h=d-(p-u);p===u?f=d:f=p>u?h:h-i}Hn(e,f)&&(f=_)}if(n.key===N_&&(g&&lt(n),_===-1?f=c:(f=ut(e,{startingIndex:_,amount:i,disabledIndices:l}),r&&_+i>d&&(f=ut(e,{startingIndex:_%i-i,amount:i,disabledIndices:l}))),Hn(e,f)&&(f=_)),o==="both"){const u=bn(_/i);n.key===(s?Wr:Gr)&&(g&&lt(n),_%i!==i-1?(f=ut(e,{startingIndex:_,disabledIndices:l}),r&&Mo(f,i,u)&&(f=ut(e,{startingIndex:_-_%i-1,disabledIndices:l}))):r&&(f=ut(e,{startingIndex:_-_%i-1,disabledIndices:l})),Mo(f,i,u)&&(f=_)),n.key===(s?Gr:Wr)&&(g&&lt(n),_%i!==0?(f=ut(e,{startingIndex:_,decrement:!0,disabledIndices:l}),r&&Mo(f,i,u)&&(f=ut(e,{startingIndex:_+(i-_%i),decrement:!0,disabledIndices:l}))):r&&(f=ut(e,{startingIndex:_+(i-_%i),decrement:!0,disabledIndices:l})),Mo(f,i,u)&&(f=_));const p=bn(d/i)===u;Hn(e,f)&&(r&&p?f=n.key===(s?Gr:Wr)?d:ut(e,{startingIndex:_-_%i-1,disabledIndices:l}):f=_)}return f}function B_(e,t,n){const o=[];let r=0;return e.forEach((s,i)=>{let{width:l,height:c}=s;if(l>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+i+" is greater than grid columns");let d=!1;for(n&&(r=0);!d;){const _=[];for(let g=0;g<l;g++)for(let f=0;f<c;f++)_.push(r+g+f*t);r%t+l<=t&&_.every(g=>o[g]==null)?(_.forEach(g=>{o[g]=i}),d=!0):r++}}),[...o]}function V_(e,t,n,o,r){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(r){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*o:s;case"br":return n.lastIndexOf(e)}}function j_(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function Ao(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const o=e.current[t];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}const Rn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ga(e,t){const n=Io(e,Rn()),o=n.length;if(o===0)return;const r=Tt(at(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function ha(e){return ga(at(e).body,1)||e}function pa(e){return ga(at(e).body,-1)||e}function Un(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!it(n,o)}function q_(e){Io(e,Rn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ma(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}function va(e,t,n){let{reference:o,floating:r}=e;const s=Vt(t),i=jr(t),l=Vr(i),c=Jt(t),d=s==="y",_=o.x+o.width/2-r.width/2,g=o.y+o.height/2-r.height/2,f=o[l]/2-r[l]/2;let u;switch(c){case"top":u={x:_,y:o.y-r.height};break;case"bottom":u={x:_,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:g};break;case"left":u={x:o.x-r.width,y:g};break;default:u={x:o.x,y:o.y}}switch(yn(t)){case"start":u[i]-=f*(n&&d?-1:1);break;case"end":u[i]+=f*(n&&d?-1:1);break}return u}const H_=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:_,y:g}=va(d,o,c),f=o,u={},p=0;for(let h=0;h<l.length;h++){const{name:m,fn:y}=l[h],{x:w,y:C,data:k,reset:A}=await y({x:_,y:g,initialPlacement:o,placement:f,strategy:r,middlewareData:u,rects:d,platform:i,elements:{reference:e,floating:t}});_=w??_,g=C??g,u={...u,[m]:{...u[m],...k}},A&&p<=50&&(p++,typeof A=="object"&&(A.placement&&(f=A.placement),A.rects&&(d=A.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):A.rects),{x:_,y:g}=va(d,f,c)),h=-1)}return{x:_,y:g,placement:f,strategy:r,middlewareData:u}};async function Jr(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:_="viewport",elementContext:g="floating",altBoundary:f=!1,padding:u=0}=wn(t,e),p=Yi(u),m=l[f?g==="floating"?"reference":"floating":g],y=So(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:_,strategy:c})),w=g==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),k=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},A=So(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:C,strategy:c}):w);return{top:(y.top-A.top+p.top)/k.y,bottom:(A.bottom-y.bottom+p.bottom)/k.y,left:(y.left-A.left+p.left)/k.x,right:(A.right-y.right+p.right)/k.x}}const R_=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:l,middlewareData:c}=t,{element:d,padding:_=0}=wn(e,t)||{};if(d==null)return{};const g=Yi(_),f={x:n,y:o},u=jr(r),p=Vr(u),h=await i.getDimensions(d),m=u==="y",y=m?"top":"left",w=m?"bottom":"right",C=m?"clientHeight":"clientWidth",k=s.reference[p]+s.reference[u]-f[u]-s.floating[p],A=f[u]-s.reference[u],T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let M=T?T[C]:0;(!M||!await(i.isElement==null?void 0:i.isElement(T)))&&(M=l.floating[C]||s.floating[p]);const P=k/2-A/2,L=M/2-h[p]/2-1,E=Zt(g[y],L),B=Zt(g[w],L),V=E,$=M-h[p]-B,b=M/2-h[p]/2+P,S=Br(V,b,$),O=!c.arrow&&yn(r)!=null&&b!==S&&s.reference[p]/2-(b<V?E:B)-h[p]/2<0,D=O?b<V?b-V:b-$:0;return{[u]:f[u]+D,data:{[u]:S,centerOffset:b-S-D,...O&&{alignmentOffset:D}},reset:O}}}),U_=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:_=!0,crossAxis:g=!0,fallbackPlacements:f,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...m}=wn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=Jt(r),w=Vt(l),C=Jt(l)===l,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),A=f||(C||!h?[xo(l)]:s_(l)),T=p!=="none";!f&&T&&A.push(...c_(l,h,p,k));const M=[l,...A],P=await Jr(t,m),L=[];let E=((o=s.flip)==null?void 0:o.overflows)||[];if(_&&L.push(P[y]),g){const b=r_(r,i,k);L.push(P[b[0]],P[b[1]])}if(E=[...E,{placement:r,overflows:L}],!L.every(b=>b<=0)){var B,V;const b=(((B=s.flip)==null?void 0:B.index)||0)+1,S=M[b];if(S&&(!(g==="alignment"?w!==Vt(S):!1)||E.every(x=>Vt(x.placement)===w?x.overflows[0]>0:!0)))return{data:{index:b,overflows:E},reset:{placement:S}};let O=(V=E.filter(D=>D.overflows[0]<=0).sort((D,x)=>D.overflows[1]-x.overflows[1])[0])==null?void 0:V.placement;if(!O)switch(u){case"bestFit":{var $;const D=($=E.filter(x=>{if(T){const I=Vt(x.placement);return I===w||I==="y"}return!0}).map(x=>[x.placement,x.overflows.filter(I=>I>0).reduce((I,F)=>I+F,0)]).sort((x,I)=>x[1]-I[1])[0])==null?void 0:$[0];D&&(O=D);break}case"initialPlacement":O=l;break}if(r!==O)return{reset:{placement:O}}}return{}}}},W_=new Set(["left","top"]);async function G_(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=Jt(n),l=yn(n),c=Vt(n)==="y",d=W_.has(i)?-1:1,_=s&&c?-1:1,g=wn(t,e);let{mainAxis:f,crossAxis:u,alignmentAxis:p}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof p=="number"&&(u=l==="end"?p*-1:p),c?{x:u*_,y:f*d}:{x:f*d,y:u*_}}const K_=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:l}=t,c=await G_(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},X_=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:m=>{let{x:y,y:w}=m;return{x:y,y:w}}},...c}=wn(e,t),d={x:n,y:o},_=await Jr(t,c),g=Vt(Jt(r)),f=Gi(g);let u=d[f],p=d[g];if(s){const m=f==="y"?"top":"left",y=f==="y"?"bottom":"right",w=u+_[m],C=u-_[y];u=Br(w,u,C)}if(i){const m=g==="y"?"top":"left",y=g==="y"?"bottom":"right",w=p+_[m],C=p-_[y];p=Br(w,p,C)}const h=l.fn({...t,[f]:u,[g]:p});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[f]:s,[g]:i}}}}}},Y_=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:l}=t,{apply:c=()=>{},...d}=wn(e,t),_=await Jr(t,d),g=Jt(r),f=yn(r),u=Vt(r)==="y",{width:p,height:h}=s.floating;let m,y;g==="top"||g==="bottom"?(m=g,y=f===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(y=g,m=f==="end"?"top":"bottom");const w=h-_.top-_.bottom,C=p-_.left-_.right,k=Zt(h-_[m],w),A=Zt(p-_[y],C),T=!t.middlewareData.shift;let M=k,P=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=C),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(M=w),T&&!f){const E=St(_.left,0),B=St(_.right,0),V=St(_.top,0),$=St(_.bottom,0);u?P=p-2*(E!==0||B!==0?E+B:St(_.left,_.right)):M=h-2*(V!==0||$!==0?V+$:St(_.top,_.bottom))}await c({...t,availableWidth:P,availableHeight:M});const L=await i.getDimensions(l.floating);return p!==L.width||h!==L.height?{reset:{rects:!0}}:{}}}};function ba(e){const t=xt(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Xe(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,l=Co(n)!==s||Co(o)!==i;return l&&(n=s,o=i),{width:n,height:o,$:l}}function Qr(e){return Pe(e)?e:e.contextElement}function xn(e){const t=Qr(e);if(!Xe(t))return Dt(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=ba(t);let i=(s?Co(n.width):n.width)/o,l=(s?Co(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Z_=Dt(0);function wa(e){const t=bt(e);return!wo()||!t.visualViewport?Z_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function J_(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==bt(e)?!1:t}function dn(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Qr(e);let i=Dt(1);t&&(o?Pe(o)&&(i=xn(o)):i=xn(e));const l=J_(s,n,o)?wa(s):Dt(0);let c=(r.left+l.x)/i.x,d=(r.top+l.y)/i.y,_=r.width/i.x,g=r.height/i.y;if(s){const f=bt(s),u=o&&Pe(o)?bt(o):o;let p=f,h=zr(p);for(;h&&o&&u!==p;){const m=xn(h),y=h.getBoundingClientRect(),w=xt(h),C=y.left+(h.clientLeft+parseFloat(w.paddingLeft))*m.x,k=y.top+(h.clientTop+parseFloat(w.paddingTop))*m.y;c*=m.x,d*=m.y,_*=m.x,g*=m.y,c+=C,d+=k,p=bt(h),h=zr(p)}}return So({width:_,height:g,x:c,y:d})}function Do(e,t){const n=yo(e).scrollLeft;return t?t.left+n:dn(At(e)).left+n}function ya(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Do(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Q_(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=At(o),l=t?bo(t.floating):!1;if(o===i||l&&s)return n;let c={scrollLeft:0,scrollTop:0},d=Dt(1);const _=Dt(0),g=Xe(o);if((g||!g&&!s)&&((Xt(o)!=="body"||Vn(i))&&(c=yo(o)),Xe(o))){const u=dn(o);d=xn(o),_.x=u.x+o.clientLeft,_.y=u.y+o.clientTop}const f=i&&!g&&!s?ya(i,c):Dt(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+_.x+f.x,y:n.y*d.y-c.scrollTop*d.y+_.y+f.y}}function eg(e){return Array.from(e.getClientRects())}function tg(e){const t=At(e),n=yo(e),o=e.ownerDocument.body,r=St(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=St(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Do(e);const l=-n.scrollTop;return xt(o).direction==="rtl"&&(i+=St(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:l}}const Ca=25;function ng(e,t){const n=bt(e),o=At(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,l=0,c=0;if(r){s=r.width,i=r.height;const _=wo();(!_||_&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const d=Do(o);if(d<=0){const _=o.ownerDocument,g=_.body,f=getComputedStyle(g),u=_.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,p=Math.abs(o.clientWidth-g.clientWidth-u);p<=Ca&&(s-=p)}else d<=Ca&&(s+=d);return{width:s,height:i,x:l,y:c}}const og=new Set(["absolute","fixed"]);function rg(e,t){const n=dn(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=Xe(e)?xn(e):Dt(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,d=o*s.y;return{width:i,height:l,x:c,y:d}}function xa(e,t,n){let o;if(t==="viewport")o=ng(e,n);else if(t==="document")o=tg(At(e));else if(Pe(t))o=rg(t,n);else{const r=wa(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return So(o)}function Sa(e,t){const n=Bt(e);return n===t||!Pe(n)||zt(n)?!1:xt(n).position==="fixed"||Sa(n,t)}function sg(e,t){const n=t.get(e);if(n)return n;let o=Yt(e,[],!1).filter(l=>Pe(l)&&Xt(l)!=="body"),r=null;const s=xt(e).position==="fixed";let i=s?Bt(e):e;for(;Pe(i)&&!zt(i);){const l=xt(i),c=Or(i);!c&&l.position==="fixed"&&(r=null),(s?!c&&!r:!c&&l.position==="static"&&!!r&&og.has(r.position)||Vn(i)&&!c&&Sa(e,i))?o=o.filter(_=>_!==i):r=l,i=Bt(i)}return t.set(e,o),o}function ig(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?bo(t)?[]:sg(t,this._c):[].concat(n),o],l=i[0],c=i.reduce((d,_)=>{const g=xa(t,_,r);return d.top=St(g.top,d.top),d.right=Zt(g.right,d.right),d.bottom=Zt(g.bottom,d.bottom),d.left=St(g.left,d.left),d},xa(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ag(e){const{width:t,height:n}=ba(e);return{width:t,height:n}}function lg(e,t,n){const o=Xe(t),r=At(t),s=n==="fixed",i=dn(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=Dt(0);function d(){c.x=Do(r)}if(o||!o&&!s)if((Xt(t)!=="body"||Vn(r))&&(l=yo(t)),o){const u=dn(t,!0,s,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}else r&&d();s&&!o&&r&&d();const _=r&&!o&&!s?ya(r,l):Dt(0),g=i.left+l.scrollLeft-c.x-_.x,f=i.top+l.scrollTop-c.y-_.y;return{x:g,y:f,width:i.width,height:i.height}}function es(e){return xt(e).position==="static"}function $a(e,t){if(!Xe(e)||xt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return At(e)===n&&(n=n.ownerDocument.body),n}function ka(e,t){const n=bt(e);if(bo(e))return n;if(!Xe(e)){let r=Bt(e);for(;r&&!zt(r);){if(Pe(r)&&!es(r))return r;r=Bt(r)}return n}let o=$a(e,t);for(;o&&Kf(o)&&es(o);)o=$a(o,t);return o&&zt(o)&&es(o)&&!Or(o)?n:o||Qf(e)||n}const cg=async function(e){const t=this.getOffsetParent||ka,n=this.getDimensions,o=await n(e.floating);return{reference:lg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function dg(e){return xt(e).direction==="rtl"}const ug={convertOffsetParentRelativeRectToViewportRelativeRect:Q_,getDocumentElement:At,getClippingRect:ig,getOffsetParent:ka,getElementRects:cg,getClientRects:eg,getDimensions:ag,getScale:xn,isElement:Pe,isRTL:dg};function Ea(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fg(e,t){let n=null,o;const r=At(e);function s(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:_,top:g,width:f,height:u}=d;if(l||t(),!f||!u)return;const p=bn(g),h=bn(r.clientWidth-(_+f)),m=bn(r.clientHeight-(g+u)),y=bn(_),C={rootMargin:-p+"px "+-h+"px "+-m+"px "+-y+"px",threshold:St(0,Zt(1,c))||1};let k=!0;function A(T){const M=T[0].intersectionRatio;if(M!==c){if(!k)return i();M?i(!1,M):o=setTimeout(()=>{i(!1,1e-7)},1e3)}M===1&&!Ea(d,e.getBoundingClientRect())&&i(),k=!1}try{n=new IntersectionObserver(A,{...C,root:r.ownerDocument})}catch{n=new IntersectionObserver(A,C)}n.observe(e)}return i(!0),s}function To(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,d=Qr(e),_=r||s?[...d?Yt(d):[],...Yt(t)]:[];_.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const g=d&&l?fg(d,n):null;let f=-1,u=null;i&&(u=new ResizeObserver(y=>{let[w]=y;w&&w.target===d&&u&&(u.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var C;(C=u)==null||C.observe(t)})),n()}),d&&!c&&u.observe(d),u.observe(t));let p,h=c?dn(e):null;c&&m();function m(){const y=dn(e);h&&!Ea(h,y)&&n(),h=y,p=requestAnimationFrame(m)}return n(),()=>{var y;_.forEach(w=>{r&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),g?.(),(y=u)==null||y.disconnect(),u=null,c&&cancelAnimationFrame(p)}}const _g=K_,gg=X_,hg=U_,pg=Y_,Ia=R_,mg=(e,t,n)=>{const o=new Map,r={platform:ug,...n},s={...r.platform,_c:o};return H_(e,t,{...r,platform:s})};var vg=typeof document<"u",bg=function(){},Fo=vg?v.useLayoutEffect:bg;function Po(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Po(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!Po(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Na(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ma(e,t){const n=Na(e);return Math.round(t*n)/n}function ts(e){const t=N.useRef(e);return Fo(()=>{t.current=e}),t}function wg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[_,g]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,u]=N.useState(o);Po(f,o)||u(o);const[p,h]=N.useState(null),[m,y]=N.useState(null),w=N.useCallback(x=>{x!==T.current&&(T.current=x,h(x))},[]),C=N.useCallback(x=>{x!==M.current&&(M.current=x,y(x))},[]),k=s||p,A=i||m,T=N.useRef(null),M=N.useRef(null),P=N.useRef(_),L=c!=null,E=ts(c),B=ts(r),V=ts(d),$=N.useCallback(()=>{if(!T.current||!M.current)return;const x={placement:t,strategy:n,middleware:f};B.current&&(x.platform=B.current),mg(T.current,M.current,x).then(I=>{const F={...I,isPositioned:V.current!==!1};b.current&&!Po(P.current,F)&&(P.current=F,dr.flushSync(()=>{g(F)}))})},[f,t,n,B,V]);Fo(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g(x=>({...x,isPositioned:!1})))},[d]);const b=N.useRef(!1);Fo(()=>(b.current=!0,()=>{b.current=!1}),[]),Fo(()=>{if(k&&(T.current=k),A&&(M.current=A),k&&A){if(E.current)return E.current(k,A,$);$()}},[k,A,$,E,L]);const S=N.useMemo(()=>({reference:T,floating:M,setReference:w,setFloating:C}),[w,C]),O=N.useMemo(()=>({reference:k,floating:A}),[k,A]),D=N.useMemo(()=>{const x={position:n,left:0,top:0};if(!O.floating)return x;const I=Ma(O.floating,_.x),F=Ma(O.floating,_.y);return l?{...x,transform:"translate("+I+"px, "+F+"px)",...Na(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:F}},[n,l,O.floating,_.x,_.y]);return N.useMemo(()=>({..._,update:$,refs:S,elements:O,floatingStyles:D}),[_,$,S,O,D])}const yg=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Ia({element:o.current,padding:r}).fn(n):{}:o?Ia({element:o,padding:r}).fn(n):{}}}},Lo=(e,t)=>({..._g(e),options:[e,t]}),Oo=(e,t)=>({...gg(e),options:[e,t]}),zo=(e,t)=>({...hg(e),options:[e,t]}),Aa=(e,t)=>({...pg(e),options:[e,t]}),Cg=(e,t)=>({...yg(e),options:[e,t]});function Da(e){const t=N.useRef(void 0),n=N.useCallback(o=>{const r=e.map(s=>{if(s!=null){if(typeof s=="function"){const i=s,l=i(o);return typeof l=="function"?l:()=>{i(null)}}return s.current=o,()=>{s.current=null}}});return()=>{r.forEach(s=>s?.())}},e);return N.useMemo(()=>e.every(o=>o==null)?null:o=>{t.current&&(t.current(),t.current=void 0),o!=null&&(t.current=n(o))},e)}const xg="data-floating-ui-focusable",Ta="active",Fa="selected",Wn="ArrowLeft",Gn="ArrowRight",Pa="ArrowUp",Bo="ArrowDown",Sg={...N};let La=!1,$g=0;const Oa=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+$g++;function kg(){const[e,t]=N.useState(()=>La?Oa():void 0);return Le(()=>{e==null&&t(Oa())},[]),N.useEffect(()=>{La=!0},[]),e}const Kn=Sg.useId||kg;let Xn;process.env.NODE_ENV!=="production"&&(Xn=new Set);function Vo(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");if(!((e=Xn)!=null&&e.has(r))){var s;(s=Xn)==null||s.add(r),console.warn(r)}}function Eg(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");if(!((e=Xn)!=null&&e.has(r))){var s;(s=Xn)==null||s.add(r),console.error(r)}}const Ig=N.forwardRef(function(t,n){const{context:{placement:o,elements:{floating:r},middlewareData:{arrow:s,shift:i}},width:l=14,height:c=7,tipRadius:d=0,strokeWidth:_=0,staticOffset:g,stroke:f,d:u,style:{transform:p,...h}={},...m}=t;process.env.NODE_ENV!=="production"&&(n||Vo("The `ref` prop is required for `FloatingArrow`."));const y=Kn(),[w,C]=N.useState(!1);if(Le(()=>{if(!r)return;xt(r).direction==="rtl"&&C(!0)},[r]),!r)return null;const[k,A]=o.split("-"),T=k==="top"||k==="bottom";let M=g;(T&&i!=null&&i.x||!T&&i!=null&&i.y)&&(M=null);const P=_*2,L=P/2,E=l/2*(d/-8+1),B=c/2*d/4,V=!!u,$=M&&A==="end"?"bottom":"top";let b=M&&A==="end"?"right":"left";M&&w&&(b=A==="end"?"left":"right");const S=s?.x!=null?M||s.x:"",O=s?.y!=null?M||s.y:"",D=u||"M0,0"+(" H"+l)+(" L"+(l-E)+","+(c-B))+(" Q"+l/2+","+c+" "+E+","+(c-B))+" Z",x={top:V?"rotate(180deg)":"",left:V?"rotate(90deg)":"rotate(-90deg)",bottom:V?"":"rotate(180deg)",right:V?"rotate(-90deg)":"rotate(90deg)"}[k];return a.jsxs("svg",{...m,"aria-hidden":!0,ref:n,width:V?l:l+P,height:l,viewBox:"0 0 "+l+" "+(c>l?c:l),style:{position:"absolute",pointerEvents:"none",[b]:S,[$]:O,[k]:T||V?"100%":"calc(100% - "+P/2+"px)",transform:[x,p].filter(I=>!!I).join(" "),...h},children:[P>0&&a.jsx("path",{clipPath:"url(#"+y+")",fill:"none",stroke:f,strokeWidth:P+(u?0:1),d:D}),a.jsx("path",{stroke:P&&!u?m.fill:"none",d:D}),a.jsx("clipPath",{id:y,children:a.jsx("rect",{x:-L,y:L*(V?-1:1),width:l+P,height:l})})]})});function za(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var o;(o=e.get(t))==null||o.delete(n)}}}const Ba=N.createContext(null),Va=N.createContext(null),Sn=()=>{var e;return((e=N.useContext(Ba))==null?void 0:e.id)||null},un=()=>N.useContext(Va);function ja(e){const t=Kn(),n=un(),r=Sn();return Le(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function qa(e){const{children:t,id:n}=e,o=Sn();return a.jsx(Ba.Provider,{value:N.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function Ng(e){const{children:t}=e,n=N.useRef([]),o=N.useCallback(i=>{n.current=[...n.current,i]},[]),r=N.useCallback(i=>{n.current=n.current.filter(l=>l!==i)},[]),[s]=N.useState(()=>za());return a.jsx(Va.Provider,{value:N.useMemo(()=>({nodesRef:n,addNode:o,removeNode:r,events:s}),[o,r,s]),children:t})}function fn(e){return"data-floating-ui-"+e}function ct(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Ha=fn("safe-polygon");function ns(e,t,n){if(n&&!qn(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function os(e){return typeof e=="function"?e():e}function rs(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,events:s,elements:i}=e,{enabled:l=!0,delay:c=0,handleClose:d=null,mouseOnly:_=!1,restMs:g=0,move:f=!0}=t,u=un(),p=Sn(),h=et(d),m=et(c),y=et(n),w=et(g),C=N.useRef(),k=N.useRef(-1),A=N.useRef(),T=N.useRef(-1),M=N.useRef(!0),P=N.useRef(!1),L=N.useRef(()=>{}),E=N.useRef(!1),B=Ye(()=>{var D;const x=(D=r.current.openEvent)==null?void 0:D.type;return x?.includes("mouse")&&x!=="mousedown"});N.useEffect(()=>{if(!l)return;function D(x){let{open:I}=x;I||(ct(k),ct(T),M.current=!0,E.current=!1)}return s.on("openchange",D),()=>{s.off("openchange",D)}},[l,s]),N.useEffect(()=>{if(!l||!h.current||!n)return;function D(I){B()&&o(!1,I,"hover")}const x=at(i.floating).documentElement;return x.addEventListener("mouseleave",D),()=>{x.removeEventListener("mouseleave",D)}},[i.floating,n,o,l,h,B]);const V=N.useCallback(function(D,x,I){x===void 0&&(x=!0),I===void 0&&(I="hover");const F=ns(m.current,"close",C.current);F&&!A.current?(ct(k),k.current=window.setTimeout(()=>o(!1,D,I),F)):x&&(ct(k),o(!1,D,I))},[m,o]),$=Ye(()=>{L.current(),A.current=void 0}),b=Ye(()=>{if(P.current){const D=at(i.floating).body;D.style.pointerEvents="",D.removeAttribute(Ha),P.current=!1}}),S=Ye(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);N.useEffect(()=>{if(!l)return;function D(z){if(ct(k),M.current=!1,_&&!qn(C.current)||os(w.current)>0&&!ns(m.current,"open"))return;const H=ns(m.current,"open",C.current);H?k.current=window.setTimeout(()=>{y.current||o(!0,z,"hover")},H):n||o(!0,z,"hover")}function x(z){if(S()){b();return}L.current();const H=at(i.floating);if(ct(T),E.current=!1,h.current&&r.current.floatingContext){n||ct(k),A.current=h.current({...r.current.floatingContext,tree:u,x:z.clientX,y:z.clientY,onClose(){b(),$(),S()||V(z,!0,"safe-polygon")}});const G=A.current;H.addEventListener("mousemove",G),L.current=()=>{H.removeEventListener("mousemove",G)};return}(C.current==="touch"?!it(i.floating,z.relatedTarget):!0)&&V(z)}function I(z){S()||r.current.floatingContext&&(h.current==null||h.current({...r.current.floatingContext,tree:u,x:z.clientX,y:z.clientY,onClose(){b(),$(),S()||V(z)}})(z))}function F(){ct(k)}function j(z){S()||V(z,!1)}if(Pe(i.domReference)){const z=i.domReference,H=i.floating;return n&&z.addEventListener("mouseleave",I),f&&z.addEventListener("mousemove",D,{once:!0}),z.addEventListener("mouseenter",D),z.addEventListener("mouseleave",x),H&&(H.addEventListener("mouseleave",I),H.addEventListener("mouseenter",F),H.addEventListener("mouseleave",j)),()=>{n&&z.removeEventListener("mouseleave",I),f&&z.removeEventListener("mousemove",D),z.removeEventListener("mouseenter",D),z.removeEventListener("mouseleave",x),H&&(H.removeEventListener("mouseleave",I),H.removeEventListener("mouseenter",F),H.removeEventListener("mouseleave",j))}}},[i,l,e,_,f,V,$,b,o,n,y,u,m,h,r,S,w]),Le(()=>{var D;if(l&&n&&(D=h.current)!=null&&(D=D.__options)!=null&&D.blockPointerEvents&&B()){P.current=!0;const I=i.floating;if(Pe(i.domReference)&&I){var x;const F=at(i.floating).body;F.setAttribute(Ha,"");const j=i.domReference,z=u==null||(x=u.nodesRef.current.find(H=>H.id===p))==null||(x=x.context)==null?void 0:x.elements.floating;return z&&(z.style.pointerEvents=""),F.style.pointerEvents="none",j.style.pointerEvents="auto",I.style.pointerEvents="auto",()=>{F.style.pointerEvents="",j.style.pointerEvents="",I.style.pointerEvents=""}}}},[l,n,p,i,u,h,B]),Le(()=>{n||(C.current=void 0,E.current=!1,$(),b())},[n,$,b]),N.useEffect(()=>()=>{$(),ct(k),ct(T),b()},[l,i.domReference,$,b]);const O=N.useMemo(()=>{function D(x){C.current=x.pointerType}return{onPointerDown:D,onPointerEnter:D,onMouseMove(x){const{nativeEvent:I}=x;function F(){!M.current&&!y.current&&o(!0,I,"hover")}_&&!qn(C.current)||n||os(w.current)===0||E.current&&x.movementX**2+x.movementY**2<2||(ct(T),C.current==="touch"?F():(E.current=!0,T.current=window.setTimeout(F,os(w.current))))}}},[_,o,n,y,w]);return N.useMemo(()=>l?{reference:O}:{},[l,O])}let Ra=0;function _n(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(Ra);const s=()=>e?.focus({preventScroll:n});r?s():Ra=requestAnimationFrame(s)}function ss(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&vo(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Mg(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ag(e){return e?.ownerDocument||document}const $n={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Ua(e){return e==="inert"?$n.inert:e==="aria-hidden"?$n["aria-hidden"]:$n.none}let jo=new WeakSet,qo={},is=0;const Dg=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Wa=e=>e&&(e.host||Wa(e.parentNode)),Tg=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=Wa(n);return e.contains(o)?o:null}).filter(n=>n!=null);function Fg(e,t,n,o){const r="data-floating-ui-inert",s=o?"inert":n?"aria-hidden":null,i=Tg(t,e),l=new Set,c=new Set(i),d=[];qo[r]||(qo[r]=new WeakMap);const _=qo[r];i.forEach(g),f(t),l.clear();function g(u){!u||l.has(u)||(l.add(u),u.parentNode&&g(u.parentNode))}function f(u){!u||c.has(u)||[].forEach.call(u.children,p=>{if(Xt(p)!=="script")if(l.has(p))f(p);else{const h=s?p.getAttribute(s):null,m=h!==null&&h!=="false",y=Ua(s),w=(y.get(p)||0)+1,C=(_.get(p)||0)+1;y.set(p,w),_.set(p,C),d.push(p),w===1&&m&&jo.add(p),C===1&&p.setAttribute(r,""),!m&&s&&p.setAttribute(s,s==="inert"?"":"true")}})}return is++,()=>{d.forEach(u=>{const p=Ua(s),m=(p.get(u)||0)-1,y=(_.get(u)||0)-1;p.set(u,m),_.set(u,y),m||(!jo.has(u)&&s&&u.removeAttribute(s),jo.delete(u)),y||u.removeAttribute(r)}),is--,is||($n.inert=new WeakMap,$n["aria-hidden"]=new WeakMap,$n.none=new WeakMap,jo=new WeakSet,qo={})}}function Ga(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=Ag(e[0]).body;return Fg(e.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,t,n)}const Ho={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Ro=N.forwardRef(function(t,n){const[o,r]=N.useState();Le(()=>{aa()&&r("button")},[]);const s={ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[fn("focus-guard")]:"",style:Ho};return a.jsx("span",{...t,...s})}),Ka=N.createContext(null),Xa=fn("portal");function Pg(e){e===void 0&&(e={});const{id:t,root:n}=e,o=Kn(),r=Ya(),[s,i]=N.useState(null),l=N.useRef(null);return Le(()=>()=>{s?.remove(),queueMicrotask(()=>{l.current=null})},[s]),Le(()=>{if(!o||l.current)return;const c=t?document.getElementById(t):null;if(!c)return;const d=document.createElement("div");d.id=o,d.setAttribute(Xa,""),c.appendChild(d),l.current=d,i(d)},[t,o]),Le(()=>{if(n===null||!o||l.current)return;let c=n||r?.portalNode;c&&!Lr(c)&&(c=c.current),c=c||document.body;let d=null;t&&(d=document.createElement("div"),d.id=t,c.appendChild(d));const _=document.createElement("div");_.id=o,_.setAttribute(Xa,""),c=d||c,c.appendChild(_),l.current=_,i(_)},[t,n,o,r]),s}function Uo(e){const{children:t,id:n,root:o,preserveTabOrder:r=!0}=e,s=Pg({id:n,root:o}),[i,l]=N.useState(null),c=N.useRef(null),d=N.useRef(null),_=N.useRef(null),g=N.useRef(null),f=i?.modal,u=i?.open,p=!!i&&!i.modal&&i.open&&r&&!!(o||s);return N.useEffect(()=>{if(!s||!r||f)return;function h(m){s&&Un(m)&&(m.type==="focusin"?ma:q_)(s)}return s.addEventListener("focusin",h,!0),s.addEventListener("focusout",h,!0),()=>{s.removeEventListener("focusin",h,!0),s.removeEventListener("focusout",h,!0)}},[s,r,f]),N.useEffect(()=>{s&&(u||ma(s))},[u,s]),a.jsxs(Ka.Provider,{value:N.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:c,afterOutsideRef:d,beforeInsideRef:_,afterInsideRef:g,portalNode:s,setFocusManagerState:l}),[r,s]),children:[p&&s&&a.jsx(Ro,{"data-type":"outside",ref:c,onFocus:h=>{if(Un(h,s)){var m;(m=_.current)==null||m.focus()}else{const y=i?i.domReference:null,w=pa(y);w?.focus()}}}),p&&s&&a.jsx("span",{"aria-owns":s.id,style:Ho}),s&&dr.createPortal(t,s),p&&s&&a.jsx(Ro,{"data-type":"outside",ref:d,onFocus:h=>{if(Un(h,s)){var m;(m=g.current)==null||m.focus()}else{const y=i?i.domReference:null,w=ha(y);w?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,h.nativeEvent,"focus-out")}}})]})}const Ya=()=>N.useContext(Ka);function Za(e){return N.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const Lg=20;let Qt=[];function as(){Qt=Qt.filter(e=>e.isConnected)}function Og(e){as(),e&&Xt(e)!=="body"&&(Qt.push(e),Qt.length>Lg&&(Qt=Qt.slice(-20)))}function Ja(){return as(),Qt[Qt.length-1]}function zg(e){const t=Rn();return ra(e,t)?e:Io(e,t)[0]||e}function Qa(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const o=Rn(),s=$_(e,o).filter(l=>{const c=l.getAttribute("data-tabindex")||"";return ra(l,o)||l.hasAttribute("data-tabindex")&&!c.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||s.length===0?i!=="0"&&e.setAttribute("tabindex","0"):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const Bg=N.forwardRef(function(t,n){return a.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:Ho})});function ls(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],guards:s=!0,initialFocus:i=0,returnFocus:l=!0,restoreFocus:c=!1,modal:d=!0,visuallyHiddenDismiss:_=!1,closeOnFocusOut:g=!0,outsideElementsInert:f=!1,getInsideElements:u=()=>[]}=e,{open:p,onOpenChange:h,events:m,dataRef:y,elements:{domReference:w,floating:C}}=t,k=Ye(()=>{var J;return(J=y.current.floatingContext)==null?void 0:J.nodeId}),A=Ye(u),T=typeof i=="number"&&i<0,M=Yr(w)&&T,P=Dg(),L=P?s:!0,E=!L||P&&f,B=et(r),V=et(i),$=et(l),b=un(),S=Ya(),O=N.useRef(null),D=N.useRef(null),x=N.useRef(!1),I=N.useRef(!1),F=N.useRef(-1),j=N.useRef(-1),z=S!=null,H=No(C),X=Ye(function(J){return J===void 0&&(J=H),J?Io(J,Rn()):[]}),G=Ye(J=>{const re=X(J);return B.current.map(Y=>w&&Y==="reference"?w:H&&Y==="floating"?H:re).filter(Boolean).flat()});N.useEffect(()=>{if(o||!d)return;function J(Y){if(Y.key==="Tab"){it(H,Tt(at(H)))&&X().length===0&&!M&&lt(Y);const ye=G(),ce=jt(Y);B.current[0]==="reference"&&ce===w&&(lt(Y),Y.shiftKey?_n(ye[ye.length-1]):_n(ye[1])),B.current[1]==="floating"&&ce===H&&Y.shiftKey&&(lt(Y),_n(ye[0]))}}const re=at(H);return re.addEventListener("keydown",J),()=>{re.removeEventListener("keydown",J)}},[o,w,H,d,B,M,X,G]),N.useEffect(()=>{if(o||!C)return;function J(re){const Y=jt(re),ce=X().indexOf(Y);ce!==-1&&(F.current=ce)}return C.addEventListener("focusin",J),()=>{C.removeEventListener("focusin",J)}},[o,C,X]),N.useEffect(()=>{if(o||!g)return;function J(){I.current=!0,setTimeout(()=>{I.current=!1})}function re(ce){const ee=ce.relatedTarget,ne=ce.currentTarget,xe=jt(ce);queueMicrotask(()=>{const de=k(),Se=!(it(w,ee)||it(C,ee)||it(ee,C)||it(S?.portalNode,ee)||ee!=null&&ee.hasAttribute(fn("focus-guard"))||b&&(cn(b.nodesRef.current,de).find(U=>{var q,R;return it((q=U.context)==null?void 0:q.elements.floating,ee)||it((R=U.context)==null?void 0:R.elements.domReference,ee)})||da(b.nodesRef.current,de).find(U=>{var q,R,fe;return[(q=U.context)==null?void 0:q.elements.floating,No((R=U.context)==null?void 0:R.elements.floating)].includes(ee)||((fe=U.context)==null?void 0:fe.elements.domReference)===ee})));if(ne===w&&H&&Qa(H,B),c&&ne!==w&&!(xe!=null&&xe.isConnected)&&Tt(at(H))===at(H).body){Xe(H)&&H.focus();const U=F.current,q=X(),R=q[U]||q[q.length-1]||H;Xe(R)&&R.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(M||!d)&&ee&&Se&&!I.current&&ee!==Ja()&&(x.current=!0,h(!1,ce,"focus-out"))})}const Y=!!(!b&&S);function ye(){ct(j),y.current.insideReactTree=!0,j.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}if(C&&Xe(w))return w.addEventListener("focusout",re),w.addEventListener("pointerdown",J),C.addEventListener("focusout",re),Y&&C.addEventListener("focusout",ye,!0),()=>{w.removeEventListener("focusout",re),w.removeEventListener("pointerdown",J),C.removeEventListener("focusout",re),Y&&C.removeEventListener("focusout",ye,!0)}},[o,w,C,H,d,b,S,h,g,c,X,M,k,B,y]);const ue=N.useRef(null),oe=N.useRef(null),ie=Za([ue,S?.beforeInsideRef]),_e=Za([oe,S?.afterInsideRef]);N.useEffect(()=>{var J,re;if(o||!C)return;const Y=Array.from((S==null||(J=S.portalNode)==null?void 0:J.querySelectorAll("["+fn("portal")+"]"))||[]),ce=(re=(b?da(b.nodesRef.current,k()):[]).find(xe=>{var de;return Yr(((de=xe.context)==null?void 0:de.elements.domReference)||null)}))==null||(re=re.context)==null?void 0:re.elements.domReference,ee=[C,ce,...Y,...A(),O.current,D.current,ue.current,oe.current,S?.beforeOutsideRef.current,S?.afterOutsideRef.current,B.current.includes("reference")||M?w:null].filter(xe=>xe!=null),ne=d||M?Ga(ee,!E,E):Ga(ee);return()=>{ne()}},[o,w,C,d,B,S,M,L,E,b,k,A]),Le(()=>{if(o||!Xe(H))return;const J=at(H),re=Tt(J);queueMicrotask(()=>{const Y=G(H),ye=V.current,ce=(typeof ye=="number"?Y[ye]:ye.current)||H,ee=it(H,re);!T&&!ee&&p&&_n(ce,{preventScroll:ce===H})})},[o,p,H,T,G,V]),Le(()=>{if(o||!H)return;const J=at(H),re=Tt(J);Og(re);function Y(ee){let{reason:ne,event:xe,nested:de}=ee;if(["hover","safe-polygon"].includes(ne)&&xe.type==="mouseleave"&&(x.current=!0),ne==="outside-press")if(de)x.current=!1;else if(ua(xe)||fa(xe))x.current=!1;else{let Se=!1;document.createElement("div").focus({get preventScroll(){return Se=!0,!1}}),Se?x.current=!1:x.current=!0}}m.on("openchange",Y);const ye=J.createElement("span");ye.setAttribute("tabindex","-1"),ye.setAttribute("aria-hidden","true"),Object.assign(ye.style,Ho),z&&w&&w.insertAdjacentElement("afterend",ye);function ce(){if(typeof $.current=="boolean"){const ee=w||Ja();return ee&&ee.isConnected?ee:ye}return $.current.current||ye}return()=>{m.off("openchange",Y);const ee=Tt(J),ne=it(C,ee)||b&&cn(b.nodesRef.current,k(),!1).some(de=>{var Se;return it((Se=de.context)==null?void 0:Se.elements.floating,ee)}),xe=ce();queueMicrotask(()=>{const de=zg(xe);$.current&&!x.current&&Xe(de)&&(!(de!==ee&&ee!==J.body)||ne)&&de.focus({preventScroll:!0}),ye.remove()})}},[o,C,H,$,y,m,b,z,w,k]),N.useEffect(()=>(queueMicrotask(()=>{x.current=!1}),()=>{queueMicrotask(as)}),[o]),Le(()=>{if(!o&&S)return S.setFocusManagerState({modal:d,closeOnFocusOut:g,open:p,onOpenChange:h,domReference:w}),()=>{S.setFocusManagerState(null)}},[o,S,d,p,h,g,w]),Le(()=>{o||H&&Qa(H,B)},[o,H,B]);function ge(J){return o||!_||!d?null:a.jsx(Bg,{ref:J==="start"?O:D,onClick:re=>h(!1,re.nativeEvent),children:typeof _=="string"?_:"Dismiss"})}const ke=!o&&L&&(d?!M:!0)&&(z||d);return a.jsxs(a.Fragment,{children:[ke&&a.jsx(Ro,{"data-type":"inside",ref:ie,onFocus:J=>{if(d){const Y=G();_n(r[0]==="reference"?Y[0]:Y[Y.length-1])}else if(S!=null&&S.preserveTabOrder&&S.portalNode)if(x.current=!1,Un(J,S.portalNode)){const Y=ha(w);Y?.focus()}else{var re;(re=S.beforeOutsideRef.current)==null||re.focus()}}}),!M&&ge("start"),n,ge("end"),ke&&a.jsx(Ro,{"data-type":"inside",ref:_e,onFocus:J=>{if(d)_n(G()[0]);else if(S!=null&&S.preserveTabOrder&&S.portalNode)if(g&&(x.current=!0),Un(J,S.portalNode)){const Y=pa(w);Y?.focus()}else{var re;(re=S.afterOutsideRef.current)==null||re.focus()}}})]})}function el(e){return Xe(e.target)&&e.target.tagName==="BUTTON"}function Vg(e){return Xe(e.target)&&e.target.tagName==="A"}function tl(e){return Xr(e)}function nl(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,elements:{domReference:s}}=e,{enabled:i=!0,event:l="click",toggle:c=!0,ignoreMouse:d=!1,keyboardHandlers:_=!0,stickIfOpen:g=!0}=t,f=N.useRef(),u=N.useRef(!1),p=N.useMemo(()=>({onPointerDown(h){f.current=h.pointerType},onMouseDown(h){const m=f.current;h.button===0&&l!=="click"&&(qn(m,!0)&&d||(n&&c&&(!(r.current.openEvent&&g)||r.current.openEvent.type==="mousedown")?o(!1,h.nativeEvent,"click"):(h.preventDefault(),o(!0,h.nativeEvent,"click"))))},onClick(h){const m=f.current;if(l==="mousedown"&&f.current){f.current=void 0;return}qn(m,!0)&&d||(n&&c&&(!(r.current.openEvent&&g)||r.current.openEvent.type==="click")?o(!1,h.nativeEvent,"click"):o(!0,h.nativeEvent,"click"))},onKeyDown(h){f.current=void 0,!(h.defaultPrevented||!_||el(h))&&(h.key===" "&&!tl(s)&&(h.preventDefault(),u.current=!0),!Vg(h)&&h.key==="Enter"&&o(!(n&&c),h.nativeEvent,"click"))},onKeyUp(h){h.defaultPrevented||!_||el(h)||tl(s)||h.key===" "&&u.current&&(u.current=!1,o(!(n&&c),h.nativeEvent,"click"))}}),[r,s,l,d,_,o,n,g,c]);return N.useMemo(()=>i?{reference:p}:{},[i,p])}const jg={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},qg={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ol=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function Wo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,elements:r,dataRef:s}=e,{enabled:i=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:d="pointerdown",referencePress:_=!1,referencePressEvent:g="pointerdown",ancestorScroll:f=!1,bubbles:u,capture:p}=t,h=un(),m=Ye(typeof c=="function"?c:()=>!1),y=typeof c=="function"?m:c,w=N.useRef(!1),{escapeKey:C,outsidePress:k}=ol(u),{escapeKey:A,outsidePress:T}=ol(p),M=N.useRef(!1),P=Ye(b=>{var S;if(!n||!i||!l||b.key!=="Escape"||M.current)return;const O=(S=s.current.floatingContext)==null?void 0:S.nodeId,D=h?cn(h.nodesRef.current,O):[];if(!C&&(b.stopPropagation(),D.length>0)){let x=!0;if(D.forEach(I=>{var F;if((F=I.context)!=null&&F.open&&!I.context.dataRef.current.__escapeKeyBubbles){x=!1;return}}),!x)return}o(!1,T_(b)?b.nativeEvent:b,"escape-key")}),L=Ye(b=>{var S;const O=()=>{var D;P(b),(D=jt(b))==null||D.removeEventListener("keydown",O)};(S=jt(b))==null||S.addEventListener("keydown",O)}),E=Ye(b=>{var S;const O=s.current.insideReactTree;s.current.insideReactTree=!1;const D=w.current;if(w.current=!1,d==="click"&&D||O||typeof y=="function"&&!y(b))return;const x=jt(b),I="["+fn("inert")+"]",F=at(r.floating).querySelectorAll(I);let j=Pe(x)?x:null;for(;j&&!zt(j);){const G=Bt(j);if(zt(G)||!Pe(G))break;j=G}if(F.length&&Pe(x)&&!M_(x)&&!it(x,r.floating)&&Array.from(F).every(G=>!it(j,G)))return;if(Xe(x)&&$){const G=zt(x),ue=xt(x),oe=/auto|scroll/,ie=G||oe.test(ue.overflowX),_e=G||oe.test(ue.overflowY),ge=ie&&x.clientWidth>0&&x.scrollWidth>x.clientWidth,ke=_e&&x.clientHeight>0&&x.scrollHeight>x.clientHeight,J=ue.direction==="rtl",re=ke&&(J?b.offsetX<=x.offsetWidth-x.clientWidth:b.offsetX>x.clientWidth),Y=ge&&b.offsetY>x.clientHeight;if(re||Y)return}const z=(S=s.current.floatingContext)==null?void 0:S.nodeId,H=h&&cn(h.nodesRef.current,z).some(G=>{var ue;return Kr(b,(ue=G.context)==null?void 0:ue.elements.floating)});if(Kr(b,r.floating)||Kr(b,r.domReference)||H)return;const X=h?cn(h.nodesRef.current,z):[];if(X.length>0){let G=!0;if(X.forEach(ue=>{var oe;if((oe=ue.context)!=null&&oe.open&&!ue.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}o(!1,b,"outside-press")}),B=Ye(b=>{var S;const O=()=>{var D;E(b),(D=jt(b))==null||D.removeEventListener(d,O)};(S=jt(b))==null||S.addEventListener(d,O)});N.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=C,s.current.__outsidePressBubbles=k;let b=-1;function S(F){o(!1,F,"ancestor-scroll")}function O(){window.clearTimeout(b),M.current=!0}function D(){b=window.setTimeout(()=>{M.current=!1},wo()?5:0)}const x=at(r.floating);l&&(x.addEventListener("keydown",A?L:P,A),x.addEventListener("compositionstart",O),x.addEventListener("compositionend",D)),y&&x.addEventListener(d,T?B:E,T);let I=[];return f&&(Pe(r.domReference)&&(I=Yt(r.domReference)),Pe(r.floating)&&(I=I.concat(Yt(r.floating))),!Pe(r.reference)&&r.reference&&r.reference.contextElement&&(I=I.concat(Yt(r.reference.contextElement)))),I=I.filter(F=>{var j;return F!==((j=x.defaultView)==null?void 0:j.visualViewport)}),I.forEach(F=>{F.addEventListener("scroll",S,{passive:!0})}),()=>{l&&(x.removeEventListener("keydown",A?L:P,A),x.removeEventListener("compositionstart",O),x.removeEventListener("compositionend",D)),y&&x.removeEventListener(d,T?B:E,T),I.forEach(F=>{F.removeEventListener("scroll",S)}),window.clearTimeout(b)}},[s,r,l,y,d,n,o,f,i,C,k,P,A,L,E,T,B]),N.useEffect(()=>{s.current.insideReactTree=!1},[s,y,d]);const V=N.useMemo(()=>({onKeyDown:P,..._&&{[jg[g]]:b=>{o(!1,b.nativeEvent,"reference-press")},...g!=="click"&&{onClick(b){o(!1,b.nativeEvent,"reference-press")}}}}),[P,o,_,g]),$=N.useMemo(()=>({onKeyDown:P,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[qg[d]]:()=>{s.current.insideReactTree=!0}}),[P,d,s]);return N.useMemo(()=>i?{reference:V,floating:$}:{},[i,V,$])}function Hg(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=Kn(),s=N.useRef({}),[i]=N.useState(()=>za()),l=Sn()!=null;if(process.env.NODE_ENV!=="production"){const u=o.reference;u&&!Pe(u)&&Eg("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,d]=N.useState(o.reference),_=Ye((u,p,h)=>{s.current.openEvent=u?p:void 0,i.emit("openchange",{open:u,event:p,reason:h,nested:l}),n?.(u,p,h)}),g=N.useMemo(()=>({setPositionReference:d}),[]),f=N.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return N.useMemo(()=>({dataRef:s,open:t,onOpenChange:_,elements:f,events:i,floatingId:r,refs:g}),[t,_,f,i,r,g])}function Go(e){e===void 0&&(e={});const{nodeId:t}=e,n=Hg({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,r=o.elements,[s,i]=N.useState(null),[l,c]=N.useState(null),_=r?.domReference||s,g=N.useRef(null),f=un();Le(()=>{_&&(g.current=_)},[_]);const u=wg({...e,elements:{...r,...l&&{reference:l}}}),p=N.useCallback(C=>{const k=Pe(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;c(k),u.refs.setReference(k)},[u.refs]),h=N.useCallback(C=>{(Pe(C)||C===null)&&(g.current=C,i(C)),(Pe(u.refs.reference.current)||u.refs.reference.current===null||C!==null&&!Pe(C))&&u.refs.setReference(C)},[u.refs]),m=N.useMemo(()=>({...u.refs,setReference:h,setPositionReference:p,domReference:g}),[u.refs,h,p]),y=N.useMemo(()=>({...u.elements,domReference:_}),[u.elements,_]),w=N.useMemo(()=>({...u,...o,refs:m,elements:y,nodeId:t}),[u,m,y,t,o]);return Le(()=>{o.dataRef.current.floatingContext=w;const C=f?.nodesRef.current.find(k=>k.id===t);C&&(C.context=w)}),N.useMemo(()=>({...u,context:w,refs:m,elements:y}),[u,m,y,w])}function cs(){return k_()&&aa()}function Rg(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,events:r,dataRef:s,elements:i}=e,{enabled:l=!0,visibleOnly:c=!0}=t,d=N.useRef(!1),_=N.useRef(-1),g=N.useRef(!0);N.useEffect(()=>{if(!l)return;const u=bt(i.domReference);function p(){!n&&Xe(i.domReference)&&i.domReference===Tt(at(i.domReference))&&(d.current=!0)}function h(){g.current=!0}function m(){g.current=!1}return u.addEventListener("blur",p),cs()&&(u.addEventListener("keydown",h,!0),u.addEventListener("pointerdown",m,!0)),()=>{u.removeEventListener("blur",p),cs()&&(u.removeEventListener("keydown",h,!0),u.removeEventListener("pointerdown",m,!0))}},[i.domReference,n,l]),N.useEffect(()=>{if(!l)return;function u(p){let{reason:h}=p;(h==="reference-press"||h==="escape-key")&&(d.current=!0)}return r.on("openchange",u),()=>{r.off("openchange",u)}},[r,l]),N.useEffect(()=>()=>{ct(_)},[]);const f=N.useMemo(()=>({onMouseLeave(){d.current=!1},onFocus(u){if(d.current)return;const p=jt(u.nativeEvent);if(c&&Pe(p)){if(cs()&&!u.relatedTarget){if(!g.current&&!Xr(p))return}else if(!A_(p))return}o(!0,u.nativeEvent,"focus")},onBlur(u){d.current=!1;const p=u.relatedTarget,h=u.nativeEvent,m=Pe(p)&&p.hasAttribute(fn("focus-guard"))&&p.getAttribute("data-type")==="outside";_.current=window.setTimeout(()=>{var y;const w=Tt(i.domReference?i.domReference.ownerDocument:document);!p&&w===i.domReference||it((y=s.current.floatingContext)==null?void 0:y.refs.floating.current,w)||it(i.domReference,w)||m||o(!1,h,"focus")})}}),[s,i.domReference,o,c]);return N.useMemo(()=>l?{reference:f}:{},[l,f])}function ds(e,t,n){const o=new Map,r=n==="item";let s=e;if(r&&e){const{[Ta]:i,[Fa]:l,...c}=e;s=c}return{...n==="floating"&&{tabIndex:-1,[xg]:""},...s,...t.map(i=>{const l=i?i[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((i,l)=>(l&&Object.entries(l).forEach(c=>{let[d,_]=c;if(!(r&&[Ta,Fa].includes(d)))if(d.indexOf("on")===0){if(o.has(d)||o.set(d,[]),typeof _=="function"){var g;(g=o.get(d))==null||g.push(_),i[d]=function(){for(var f,u=arguments.length,p=new Array(u),h=0;h<u;h++)p[h]=arguments[h];return(f=o.get(d))==null?void 0:f.map(m=>m(...p)).find(m=>m!==void 0)}}}else i[d]=_}),i),{})}}function Ko(e){e===void 0&&(e=[]);const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=N.useCallback(l=>ds(l,e,"reference"),t),s=N.useCallback(l=>ds(l,e,"floating"),n),i=N.useCallback(l=>ds(l,e,"item"),o);return N.useMemo(()=>({getReferenceProps:r,getFloatingProps:s,getItemProps:i}),[r,s,i])}const Ug="Escape";function Xo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Yo(e,t){return Xo(t,e===Pa||e===Bo,e===Wn||e===Gn)}function us(e,t,n){return Xo(t,e===Bo,n?e===Wn:e===Gn)||e==="Enter"||e===" "||e===""}function rl(e,t,n){return Xo(t,n?e===Wn:e===Gn,e===Bo)}function sl(e,t,n,o){const r=n?e===Gn:e===Wn,s=e===Pa;return t==="both"||t==="horizontal"&&o&&o>1?e===Ug:Xo(t,r,s)}function fs(e,t){const{open:n,onOpenChange:o,elements:r,floatingId:s}=e,{listRef:i,activeIndex:l,onNavigate:c=()=>{},enabled:d=!0,selectedIndex:_=null,allowEscape:g=!1,loop:f=!1,nested:u=!1,rtl:p=!1,virtual:h=!1,focusItemOnOpen:m="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:w=!0,disabledIndices:C=void 0,orientation:k="vertical",parentOrientation:A,cols:T=1,scrollItemIntoView:M=!0,virtualItemRef:P,itemSizes:L,dense:E=!1}=t;process.env.NODE_ENV!=="production"&&(g&&(f||Vo("`useListNavigation` looping must be enabled to allow escaping."),h||Vo("`useListNavigation` must be virtual to allow escaping.")),k==="vertical"&&T>1&&Vo("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const B=No(r.floating),V=et(B),$=Sn(),b=un();Le(()=>{e.dataRef.current.orientation=k},[e,k]);const S=Ye(()=>{c(x.current===-1?null:x.current)}),O=Yr(r.domReference),D=N.useRef(m),x=N.useRef(_??-1),I=N.useRef(null),F=N.useRef(!0),j=N.useRef(S),z=N.useRef(!!r.floating),H=N.useRef(n),X=N.useRef(!1),G=N.useRef(!1),ue=et(C),oe=et(n),ie=et(M),_e=et(_),[ge,ke]=N.useState(),[J,re]=N.useState(),Y=Ye(()=>{function U(he){if(h){var pe;(pe=he.id)!=null&&pe.endsWith("-fui-option")&&(he.id=s+"-"+Math.random().toString(16).slice(2,10)),ke(he.id),b?.events.emit("virtualfocus",he),P&&(P.current=he)}else _n(he,{sync:X.current,preventScroll:!0})}const q=i.current[x.current],R=G.current;q&&U(q),(X.current?he=>he():requestAnimationFrame)(()=>{const he=i.current[x.current]||q;if(!he)return;q||U(he);const pe=ie.current;pe&&ce&&(R||!F.current)&&(he.scrollIntoView==null||he.scrollIntoView(typeof pe=="boolean"?{block:"nearest",inline:"nearest"}:pe))})});Le(()=>{d&&(n&&r.floating?D.current&&_!=null&&(G.current=!0,x.current=_,S()):z.current&&(x.current=-1,j.current()))},[d,n,r.floating,_,S]),Le(()=>{if(d&&n&&r.floating)if(l==null){if(X.current=!1,_e.current!=null)return;if(z.current&&(x.current=-1,Y()),(!H.current||!z.current)&&D.current&&(I.current!=null||D.current===!0&&I.current==null)){let U=0;const q=()=>{i.current[0]==null?(U<2&&(U?requestAnimationFrame:queueMicrotask)(q),U++):(x.current=I.current==null||us(I.current,k,p)||u?Zr(i,ue.current):_a(i,ue.current),I.current=null,S())};q()}}else Hn(i,l)||(x.current=l,Y(),G.current=!1)},[d,n,r.floating,l,_e,u,i,k,p,S,Y,ue]),Le(()=>{var U;if(!d||r.floating||!b||h||!z.current)return;const q=b.nodesRef.current,R=(U=q.find(pe=>pe.id===$))==null||(U=U.context)==null?void 0:U.elements.floating,fe=Tt(at(r.floating)),he=q.some(pe=>pe.context&&it(pe.context.elements.floating,fe));R&&!he&&F.current&&R.focus({preventScroll:!0})},[d,r.floating,b,$,h]),Le(()=>{if(!d||!b||!h||$)return;function U(q){re(q.id),P&&(P.current=q)}return b.events.on("virtualfocus",U),()=>{b.events.off("virtualfocus",U)}},[d,b,h,$,P]),Le(()=>{j.current=S,H.current=n,z.current=!!r.floating}),Le(()=>{n||(I.current=null,D.current=m)},[n,m]);const ye=l!=null,ce=N.useMemo(()=>{function U(R){if(!oe.current)return;const fe=i.current.indexOf(R);fe!==-1&&x.current!==fe&&(x.current=fe,S())}return{onFocus(R){let{currentTarget:fe}=R;X.current=!0,U(fe)},onClick:R=>{let{currentTarget:fe}=R;return fe.focus({preventScroll:!0})},onMouseMove(R){let{currentTarget:fe}=R;X.current=!0,G.current=!1,y&&U(fe)},onPointerLeave(R){let{pointerType:fe}=R;if(!(!F.current||fe==="touch")&&(X.current=!0,!!y&&(x.current=-1,S(),!h))){var he;(he=V.current)==null||he.focus({preventScroll:!0})}}}},[oe,V,y,i,S,h]),ee=N.useCallback(()=>{var U;return A??(b==null||(U=b.nodesRef.current.find(q=>q.id===$))==null||(U=U.context)==null||(U=U.dataRef)==null?void 0:U.current.orientation)},[$,b,A]),ne=Ye(U=>{if(F.current=!1,X.current=!0,U.which===229||!oe.current&&U.currentTarget===V.current)return;if(u&&sl(U.key,k,p,T)){Yo(U.key,ee())||lt(U),o(!1,U.nativeEvent,"list-navigation"),Xe(r.domReference)&&(h?b?.events.emit("virtualfocus",r.domReference):r.domReference.focus());return}const q=x.current,R=Zr(i,C),fe=_a(i,C);if(O||(U.key==="Home"&&(lt(U),x.current=R,S()),U.key==="End"&&(lt(U),x.current=fe,S())),T>1){const he=L||Array.from({length:i.current.length},()=>({width:1,height:1})),pe=B_(he,T,E),Ue=pe.findIndex(ve=>ve!=null&&!Ao(i,ve,C)),Je=pe.reduce((ve,Ze,ot)=>Ze!=null&&!Ao(i,Ze,C)?ot:ve,-1),nt=pe[z_({current:pe.map(ve=>ve!=null?i.current[ve]:null)},{event:U,orientation:k,loop:f,rtl:p,cols:T,disabledIndices:j_([...(typeof C!="function"?C:null)||i.current.map((ve,Ze)=>Ao(i,Ze,C)?Ze:void 0),void 0],pe),minIndex:Ue,maxIndex:Je,prevIndex:V_(x.current>fe?R:x.current,he,pe,T,U.key===Bo?"bl":U.key===(p?Wn:Gn)?"tr":"tl"),stopEvent:!0})];if(nt!=null&&(x.current=nt,S()),k==="both")return}if(Yo(U.key,k)){if(lt(U),n&&!h&&Tt(U.currentTarget.ownerDocument)===U.currentTarget){x.current=us(U.key,k,p)?R:fe,S();return}us(U.key,k,p)?f?x.current=q>=fe?g&&q!==i.current.length?-1:R:ut(i,{startingIndex:q,disabledIndices:C}):x.current=Math.min(fe,ut(i,{startingIndex:q,disabledIndices:C})):f?x.current=q<=R?g&&q!==-1?i.current.length:fe:ut(i,{startingIndex:q,decrement:!0,disabledIndices:C}):x.current=Math.max(R,ut(i,{startingIndex:q,decrement:!0,disabledIndices:C})),Hn(i,x.current)&&(x.current=-1),S()}}),xe=N.useMemo(()=>h&&n&&ye&&{"aria-activedescendant":J||ge},[h,n,ye,J,ge]),de=N.useMemo(()=>({"aria-orientation":k==="both"?void 0:k,...O?{}:xe,onKeyDown:ne,onPointerMove(){F.current=!0}}),[xe,ne,k,O]),Se=N.useMemo(()=>{function U(R){m==="auto"&&ua(R.nativeEvent)&&(D.current=!0)}function q(R){D.current=m,m==="auto"&&fa(R.nativeEvent)&&(D.current=!0)}return{...xe,onKeyDown(R){F.current=!1;const fe=R.key.startsWith("Arrow"),he=["Home","End"].includes(R.key),pe=fe||he,Ue=rl(R.key,k,p),Je=sl(R.key,k,p,T),nt=rl(R.key,ee(),p),ve=Yo(R.key,k),Ze=(u?nt:ve)||R.key==="Enter"||R.key.trim()==="";if(h&&n){const Re=b?.nodesRef.current.find(rt=>rt.parentId==null),Ae=b&&Re?D_(b.nodesRef.current,Re.id):null;if(pe&&Ae&&P){const rt=new KeyboardEvent("keydown",{key:R.key,bubbles:!0});if(Ue||Je){var ot,be;const te=((ot=Ae.context)==null?void 0:ot.elements.domReference)===R.currentTarget,Ee=Je&&!te?(be=Ae.context)==null?void 0:be.elements.domReference:Ue?i.current.find(ze=>ze?.id===ge):null;Ee&&(lt(R),Ee.dispatchEvent(rt),re(void 0))}if((ve||he)&&Ae.context&&Ae.context.open&&Ae.parentId&&R.currentTarget!==Ae.context.elements.domReference){var Ce;lt(R),(Ce=Ae.context.elements.domReference)==null||Ce.dispatchEvent(rt);return}}return ne(R)}if(!(!n&&!w&&fe)){if(Ze){const Re=Yo(R.key,ee());I.current=u&&Re?null:R.key}if(u){nt&&(lt(R),n?(x.current=Zr(i,ue.current),S()):o(!0,R.nativeEvent,"list-navigation"));return}ve&&(_!=null&&(x.current=_),lt(R),!n&&w?o(!0,R.nativeEvent,"list-navigation"):ne(R),n&&S())}},onFocus(){n&&!h&&(x.current=-1,S())},onPointerDown:q,onPointerEnter:q,onMouseDown:U,onClick:U}},[ge,xe,T,ne,ue,m,i,u,S,o,n,w,k,ee,p,_,b,h,P]);return N.useMemo(()=>d?{reference:Se,floating:de,item:ce}:{},[d,Se,de,ce])}const Wg=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Zo(e,t){var n,o;t===void 0&&(t={});const{open:r,elements:s,floatingId:i}=e,{enabled:l=!0,role:c="dialog"}=t,d=Kn(),_=((n=s.domReference)==null?void 0:n.id)||d,g=N.useMemo(()=>{var w;return((w=No(s.floating))==null?void 0:w.id)||i},[s.floating,i]),f=(o=Wg.get(c))!=null?o:c,p=Sn()!=null,h=N.useMemo(()=>f==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:r?g:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":f==="alertdialog"?"dialog":f,"aria-controls":r?g:void 0,...f==="listbox"&&{role:"combobox"},...f==="menu"&&{id:_},...f==="menu"&&p&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[f,g,p,r,_,c]),m=N.useMemo(()=>{const w={id:g,...f&&{role:f}};return f==="tooltip"||c==="label"?w:{...w,...f==="menu"&&{"aria-labelledby":_}}},[f,g,_,c]),y=N.useCallback(w=>{let{active:C,selected:k}=w;const A={role:"option",...C&&{id:g+"-fui-option"}};switch(c){case"select":case"combobox":return{...A,"aria-selected":k}}return{}},[g,c]);return N.useMemo(()=>l?{reference:h,floating:m,item:y}:{},[l,h,m,y])}const il=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function kn(e,t){return typeof e=="function"?e(t):e}function Gg(e,t){const[n,o]=N.useState(e);return e&&!n&&o(!0),N.useEffect(()=>{if(!e&&n){const r=setTimeout(()=>o(!1),t);return()=>clearTimeout(r)}},[e,n,t]),n}function Kg(e,t){t===void 0&&(t={});const{open:n,elements:{floating:o}}=e,{duration:r=250}=t,i=(typeof r=="number"?r:r.close)||0,[l,c]=N.useState("unmounted"),d=Gg(n,i);return!d&&l==="close"&&c("unmounted"),Le(()=>{if(o){if(n){c("initial");const _=requestAnimationFrame(()=>{dr.flushSync(()=>{c("open")})});return()=>{cancelAnimationFrame(_)}}c("close")}},[n,o]),{isMounted:d,status:l}}function Jo(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:o,close:r,common:s,duration:i=250}=t,l=e.placement,c=l.split("-")[0],d=N.useMemo(()=>({side:c,placement:l}),[c,l]),_=typeof i=="number",g=(_?i:i.open)||0,f=(_?i:i.close)||0,[u,p]=N.useState(()=>({...kn(s,d),...kn(n,d)})),{isMounted:h,status:m}=Kg(e,{duration:i}),y=et(n),w=et(o),C=et(r),k=et(s);return Le(()=>{const A=kn(y.current,d),T=kn(C.current,d),M=kn(k.current,d),P=kn(w.current,d)||Object.keys(A).reduce((L,E)=>(L[E]="",L),{});if(m==="initial"&&p(L=>({transitionProperty:L.transitionProperty,...M,...A})),m==="open"&&p({transitionProperty:Object.keys(P).map(il).join(","),transitionDuration:g+"ms",...M,...P}),m==="close"){const L=T||A;p({transitionProperty:Object.keys(L).map(il).join(","),transitionDuration:f+"ms",...M,...L})}},[f,C,y,w,k,g,m,d]),{isMounted:h,styles:u}}function al(e,t){var n;const{open:o,dataRef:r}=e,{listRef:s,activeIndex:i,onMatch:l,onTypingChange:c,enabled:d=!0,findMatch:_=null,resetMs:g=750,ignoreKeys:f=[],selectedIndex:u=null}=t,p=N.useRef(-1),h=N.useRef(""),m=N.useRef((n=u??i)!=null?n:-1),y=N.useRef(null),w=Ye(l),C=Ye(c),k=et(_),A=et(f);Le(()=>{o&&(ct(p),y.current=null,h.current="")},[o]),Le(()=>{if(o&&h.current===""){var E;m.current=(E=u??i)!=null?E:-1}},[o,u,i]);const T=Ye(E=>{E?r.current.typing||(r.current.typing=E,C(E)):r.current.typing&&(r.current.typing=E,C(E))}),M=Ye(E=>{function B(O,D,x){const I=k.current?k.current(D,x):D.find(F=>F?.toLocaleLowerCase().indexOf(x.toLocaleLowerCase())===0);return I?O.indexOf(I):-1}const V=s.current;if(h.current.length>0&&h.current[0]!==" "&&(B(V,V,h.current)===-1?T(!1):E.key===" "&&lt(E)),V==null||A.current.includes(E.key)||E.key.length!==1||E.ctrlKey||E.metaKey||E.altKey)return;o&&E.key!==" "&&(lt(E),T(!0)),V.every(O=>{var D,x;return O?((D=O[0])==null?void 0:D.toLocaleLowerCase())!==((x=O[1])==null?void 0:x.toLocaleLowerCase()):!0})&&h.current===E.key&&(h.current="",m.current=y.current),h.current+=E.key,ct(p),p.current=window.setTimeout(()=>{h.current="",m.current=y.current,T(!1)},g);const b=m.current,S=B(V,[...V.slice((b||0)+1),...V.slice(0,(b||0)+1)],h.current);S!==-1?(w(S),y.current=S):E.key!==" "&&(h.current="",T(!1))}),P=N.useMemo(()=>({onKeyDown:M}),[M]),L=N.useMemo(()=>({onKeyDown:M,onKeyUp(E){E.key===" "&&T(!1)}}),[M,T]);return N.useMemo(()=>d?{reference:P,floating:L}:{},[d,P,L])}function ll(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var s;return r.parentId===t&&(!n||((s=r.context)==null?void 0:s.open))}).flatMap(r=>[r,...ll(e,r.id,n)])}function cl(e,t){const[n,o]=e;let r=!1;const s=t.length;for(let i=0,l=s-1;i<s;l=i++){const[c,d]=t[i]||[0,0],[_,g]=t[l]||[0,0];d>=o!=g>=o&&n<=(_-c)*(o-d)/(g-d)+c&&(r=!r)}return r}function Xg(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function dl(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r={current:-1};let s=!1,i=null,l=null,c=typeof performance<"u"?performance.now():0;function d(g,f){const u=performance.now(),p=u-c;if(i===null||l===null||p===0)return i=g,l=f,c=u,null;const h=g-i,m=f-l,w=Math.sqrt(h*h+m*m)/p;return i=g,l=f,c=u,w}const _=g=>{let{x:f,y:u,placement:p,elements:h,onClose:m,nodeId:y,tree:w}=g;return function(k){function A(){ct(r),m()}if(ct(r),!h.domReference||!h.floating||p==null||f==null||u==null)return;const{clientX:T,clientY:M}=k,P=[T,M],L=Mg(k),E=k.type==="mouseleave",B=ss(h.floating,L),V=ss(h.domReference,L),$=h.domReference.getBoundingClientRect(),b=h.floating.getBoundingClientRect(),S=p.split("-")[0],O=f>b.right-b.width/2,D=u>b.bottom-b.height/2,x=Xg(P,$),I=b.width>$.width,F=b.height>$.height,j=(I?$:b).left,z=(I?$:b).right,H=(F?$:b).top,X=(F?$:b).bottom;if(B&&(s=!0,!E))return;if(V&&(s=!1),V&&!E){s=!0;return}if(E&&Pe(k.relatedTarget)&&ss(h.floating,k.relatedTarget)||w&&ll(w.nodesRef.current,y).length)return;if(S==="top"&&u>=$.bottom-1||S==="bottom"&&u<=$.top+1||S==="left"&&f>=$.right-1||S==="right"&&f<=$.left+1)return A();let G=[];switch(S){case"top":G=[[j,$.top+1],[j,b.bottom-1],[z,b.bottom-1],[z,$.top+1]];break;case"bottom":G=[[j,b.top+1],[j,$.bottom-1],[z,$.bottom-1],[z,b.top+1]];break;case"left":G=[[b.right-1,X],[b.right-1,H],[$.left+1,H],[$.left+1,X]];break;case"right":G=[[$.right-1,X],[$.right-1,H],[b.left+1,H],[b.left+1,X]];break}function ue(oe){let[ie,_e]=oe;switch(S){case"top":{const ge=[I?ie+t/2:O?ie+t*4:ie-t*4,_e+t+1],ke=[I?ie-t/2:O?ie+t*4:ie-t*4,_e+t+1],J=[[b.left,O||I?b.bottom-t:b.top],[b.right,O?I?b.bottom-t:b.top:b.bottom-t]];return[ge,ke,...J]}case"bottom":{const ge=[I?ie+t/2:O?ie+t*4:ie-t*4,_e-t],ke=[I?ie-t/2:O?ie+t*4:ie-t*4,_e-t],J=[[b.left,O||I?b.top+t:b.bottom],[b.right,O?I?b.top+t:b.bottom:b.top+t]];return[ge,ke,...J]}case"left":{const ge=[ie+t+1,F?_e+t/2:D?_e+t*4:_e-t*4],ke=[ie+t+1,F?_e-t/2:D?_e+t*4:_e-t*4];return[...[[D||F?b.right-t:b.left,b.top],[D?F?b.right-t:b.left:b.right-t,b.bottom]],ge,ke]}case"right":{const ge=[ie-t,F?_e+t/2:D?_e+t*4:_e-t*4],ke=[ie-t,F?_e-t/2:D?_e+t*4:_e-t*4],J=[[D||F?b.left+t:b.right,b.top],[D?F?b.left+t:b.right:b.left+t,b.bottom]];return[ge,ke,...J]}}}if(!cl([T,M],G)){if(s&&!x)return A();if(!E&&o){const oe=d(k.clientX,k.clientY);if(oe!==null&&oe<.1)return A()}cl([T,M],ue([f,u]))?!s&&o&&(r.current=window.setTimeout(A,40)):A()}}};return _.__options={blockPointerEvents:n},_}function En(e,t,n){let o=n.initialDeps??[],r;function s(){var i,l,c,d;let _;n.key&&((i=n.debug)!=null&&i.call(n))&&(_=Date.now());const g=e();if(!(g.length!==o.length||g.some((p,h)=>o[h]!==p)))return r;o=g;let u;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(u=Date.now()),r=t(...g),n.key&&((c=n.debug)!=null&&c.call(n))){const p=Math.round((Date.now()-_)*100)/100,h=Math.round((Date.now()-u)*100)/100,m=h/16,y=(w,C)=>{for(w=String(w);w.length<C;)w=" "+w;return w};console.info(`%c⏱ ${y(h,5)} /${y(p,5)} ms`,`
4
+ */var jl=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],to=jl.join(","),Si=typeof Element>"u",_t=Si?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,oo=!Si&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},$t=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),i=r===""||r==="true",a=i||n&&t&&$t(t.parentNode);return a},ql=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},$i=function(t,n,o){if($t(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(to));return n&&_t.call(t,to)&&r.unshift(t),r=r.filter(o),r},ro=function(t,n,o){for(var r=[],i=Array.from(t);i.length;){var a=i.shift();if(!$t(a,!1))if(a.tagName==="SLOT"){var l=a.assignedElements(),d=l.length?l:a.children,u=ro(d,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else{var _=_t.call(a,to);_&&o.filter(a)&&(n||!t.includes(a))&&r.push(a);var g=a.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(a),f=!$t(g,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(g&&f){var c=ro(g===!0?a.children:g.children,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:a,candidates:c})}else i.unshift.apply(i,a.children)}}return r},ki=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Ii=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ql(t))&&!ki(t)?0:t.tabIndex},Bl=function(t,n){var o=Ii(t);return o<0&&n&&!ki(t)?0:o},Hl=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Ei=function(t){return t.tagName==="INPUT"},Gl=function(t){return Ei(t)&&t.type==="hidden"},Wl=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Kl=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Ul=function(t){if(!t.name)return!0;var n=t.form||oo(t),o=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var i=Kl(r,t.form);return!i||i===t},Xl=function(t){return Ei(t)&&t.type==="radio"},Yl=function(t){return Xl(t)&&!Ul(t)},Rl=function(t){var n,o=t&&oo(t),r=(n=o)===null||n===void 0?void 0:n.host,i=!1;if(o&&o!==t){var a,l,d;for(i=!!((a=r)!==null&&a!==void 0&&(l=a.ownerDocument)!==null&&l!==void 0&&l.contains(r)||t!=null&&(d=t.ownerDocument)!==null&&d!==void 0&&d.contains(t));!i&&r;){var u,_,g;o=oo(r),r=(u=o)===null||u===void 0?void 0:u.host,i=!!((_=r)!==null&&_!==void 0&&(g=_.ownerDocument)!==null&&g!==void 0&&g.contains(r))}}return i},Mi=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},Zl=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(t).visibility==="hidden")return!0;var a=_t.call(t,"details>summary:first-of-type"),l=a?t.parentElement:t;if(_t.call(l,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var d=t;t;){var u=t.parentElement,_=oo(t);if(u&&!u.shadowRoot&&r(u)===!0)return Mi(t);t.assignedSlot?t=t.assignedSlot:!u&&_!==t.ownerDocument?t=_.host:t=u}t=d}if(Rl(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Mi(t);return!1},Jl=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return _t.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},or=function(t,n){return!(n.disabled||$t(n)||Gl(n)||Zl(n,t)||Wl(n)||Jl(n))},rr=function(t,n){return!(Yl(n)||Ii(n)<0||!or(t,n))},Ql=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ni=function(t){var n=[],o=[];return t.forEach(function(r,i){var a=!!r.scopeParent,l=a?r.scopeParent:r,d=Bl(l,a),u=a?Ni(r.candidates):l;d===0?a?n.push.apply(n,u):n.push(l):o.push({documentOrder:i,tabIndex:d,item:r,isScope:a,content:u})}),o.sort(Hl).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(n)},io=function(t,n){n=n||{};var o;return n.getShadowRoot?o=ro([t],n.includeContainer,{filter:rr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ql}):o=$i(t,n.includeContainer,rr.bind(null,n)),Ni(o)},ec=function(t,n){n=n||{};var o;return n.getShadowRoot?o=ro([t],n.includeContainer,{filter:or.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=$i(t,n.includeContainer,or.bind(null,n)),o},Fi=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return _t.call(t,to)===!1?!1:rr(n,t)};function zi(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Di(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:o}=t;return n+"/"+o}).join(" "):navigator.userAgent}function Ai(){return/apple/i.test(navigator.vendor)}function ir(){const e=/android/i;return e.test(zi())||e.test(Di())}function nc(){return zi().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Li(){return Di().includes("jsdom/")}const Pi="data-floating-ui-focusable",tc="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",sr="ArrowLeft",ar="ArrowRight",oc="ArrowUp",rc="ArrowDown";function Mn(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function on(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Yt(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function On(e){return"composedPath"in e?e.composedPath()[0]:e.target}function lr(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function ic(e){return e.matches("html,body")}function rn(e){return e?.ownerDocument||document}function cr(e){return Ye(e)&&e.matches(tc)}function dr(e){return e?e.getAttribute("role")==="combobox"&&cr(e):!1}function sc(e){if(!e||Li())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function so(e){return e?e.hasAttribute(Pi)?e:e.querySelector("["+Pi+"]")||e:null}function et(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var i;return r.parentId===t&&(!n||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...et(e,r.id,n)])}function ac(e,t){let n,o=-1;function r(i,a){a>o&&(n=i,o=a),et(e,i).forEach(d=>{r(d.id,a+1)})}return r(t,0),e.find(i=>i.id===n)}function Ti(e,t){var n;let o=[],r=(n=e.find(i=>i.id===t))==null?void 0:n.parentId;for(;r;){const i=e.find(a=>a.id===r);r=i?.parentId,i&&(o=o.concat(i))}return o}function sn(e){e.preventDefault(),e.stopPropagation()}function lc(e){return"nativeEvent"in e}function Oi(e){return e.mozInputSource===0&&e.isTrusted?!0:ir()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Vi(e){return Li()?!1:!ir()&&e.width===0&&e.height===0||ir()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function kt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var cc=typeof document<"u",dc=function(){},Te=cc?m.useLayoutEffect:dc;const uc={...M};function en(e){const t=M.useRef(e);return Te(()=>{t.current=e}),t}const fc=uc.useInsertionEffect||(e=>e());function Re(e){const t=M.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return fc(()=>{t.current=e}),M.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function ao(e,t,n){return Math.floor(e/t)!==n}function It(e,t){return t<0||t>=e.current.length}function ur(e,t){return cn(e,{disabledIndices:t})}function ji(e,t){return cn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function cn(e,t){let{startingIndex:n=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=t===void 0?{}:t,a=n;do a+=o?-i:i;while(a>=0&&a<=e.current.length-1&&lo(e,a,r));return a}function _c(e,t){let{event:n,orientation:o,loop:r,rtl:i,cols:a,disabledIndices:l,minIndex:d,maxIndex:u,prevIndex:_,stopEvent:g=!1}=t,f=_;if(n.key===oc){if(g&&sn(n),_===-1)f=u;else if(f=cn(e,{startingIndex:f,amount:a,decrement:!0,disabledIndices:l}),r&&(_-a<d||f<0)){const c=_%a,h=u%a,p=u-(h-c);h===c?f=u:f=h>c?p:p-a}It(e,f)&&(f=_)}if(n.key===rc&&(g&&sn(n),_===-1?f=d:(f=cn(e,{startingIndex:_,amount:a,disabledIndices:l}),r&&_+a>u&&(f=cn(e,{startingIndex:_%a-a,amount:a,disabledIndices:l}))),It(e,f)&&(f=_)),o==="both"){const c=dt(_/a);n.key===(i?sr:ar)&&(g&&sn(n),_%a!==a-1?(f=cn(e,{startingIndex:_,disabledIndices:l}),r&&ao(f,a,c)&&(f=cn(e,{startingIndex:_-_%a-1,disabledIndices:l}))):r&&(f=cn(e,{startingIndex:_-_%a-1,disabledIndices:l})),ao(f,a,c)&&(f=_)),n.key===(i?ar:sr)&&(g&&sn(n),_%a!==0?(f=cn(e,{startingIndex:_,decrement:!0,disabledIndices:l}),r&&ao(f,a,c)&&(f=cn(e,{startingIndex:_+(a-_%a),decrement:!0,disabledIndices:l}))):r&&(f=cn(e,{startingIndex:_+(a-_%a),decrement:!0,disabledIndices:l})),ao(f,a,c)&&(f=_));const h=dt(u/a)===c;It(e,f)&&(r&&h?f=n.key===(i?ar:sr)?u:cn(e,{startingIndex:_-_%a-1,disabledIndices:l}):f=_)}return f}function gc(e,t,n){const o=[];let r=0;return e.forEach((i,a)=>{let{width:l,height:d}=i;if(l>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+a+" is greater than grid columns");let u=!1;for(n&&(r=0);!u;){const _=[];for(let g=0;g<l;g++)for(let f=0;f<d;f++)_.push(r+g+f*t);r%t+l<=t&&_.every(g=>o[g]==null)?(_.forEach(g=>{o[g]=a}),u=!0):r++}}),[...o]}function pc(e,t,n,o,r){if(e===-1)return-1;const i=n.indexOf(e),a=t[e];switch(r){case"tl":return i;case"tr":return a?i+a.width-1:i;case"bl":return a?i+(a.height-1)*o:i;case"br":return n.lastIndexOf(e)}}function hc(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function lo(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const o=e.current[t];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}const Et=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function qi(e,t){const n=io(e,Et()),o=n.length;if(o===0)return;const r=Mn(rn(e)),i=n.indexOf(r),a=i===-1?t===1?0:o-1:i+t;return n[a]}function Bi(e){return qi(rn(e).body,1)||e}function Hi(e){return qi(rn(e).body,-1)||e}function Mt(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!on(n,o)}function mc(e){io(e,Et()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Gi(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}function Wi(e,t,n){let{reference:o,floating:r}=e;const i=Tn(t),a=nr(t),l=er(a),d=Kn(t),u=i==="y",_=o.x+o.width/2-r.width/2,g=o.y+o.height/2-r.height/2,f=o[l]/2-r[l]/2;let c;switch(d){case"top":c={x:_,y:o.y-r.height};break;case"bottom":c={x:_,y:o.y+o.height};break;case"right":c={x:o.x+o.width,y:g};break;case"left":c={x:o.x-r.width,y:g};break;default:c={x:o.x,y:o.y}}switch(ft(t)){case"start":c[a]-=f*(n&&u?-1:1);break;case"end":c[a]+=f*(n&&u?-1:1);break}return c}const vc=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:_,y:g}=Wi(u,o,d),f=o,c={},h=0;for(let p=0;p<l.length;p++){const{name:v,fn:w}=l[p],{x:C,y:x,data:I,reset:z}=await w({x:_,y:g,initialPlacement:o,placement:f,strategy:r,middlewareData:c,rects:u,platform:a,elements:{reference:e,floating:t}});_=C??_,g=x??g,c={...c,[v]:{...c[v],...I}},z&&h<=50&&(h++,typeof z=="object"&&(z.placement&&(f=z.placement),z.rects&&(u=z.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:r}):z.rects),{x:_,y:g}=Wi(u,f,d)),p=-1)}return{x:_,y:g,placement:f,strategy:r,middlewareData:c}};async function fr(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:a,elements:l,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:_="viewport",elementContext:g="floating",altBoundary:f=!1,padding:c=0}=ut(t,e),h=xi(c),v=l[f?g==="floating"?"reference":"floating":g],w=no(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:_,strategy:d})),C=g==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),I=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},z=no(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:x,strategy:d}):C);return{top:(w.top-z.top+h.top)/I.y,bottom:(z.bottom-w.bottom+h.bottom)/I.y,left:(w.left-z.left+h.left)/I.x,right:(z.right-w.right+h.right)/I.x}}const bc=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:a,elements:l,middlewareData:d}=t,{element:u,padding:_=0}=ut(e,t)||{};if(u==null)return{};const g=xi(_),f={x:n,y:o},c=nr(r),h=er(c),p=await a.getDimensions(u),v=c==="y",w=v?"top":"left",C=v?"bottom":"right",x=v?"clientHeight":"clientWidth",I=i.reference[h]+i.reference[c]-f[c]-i.floating[h],z=f[c]-i.reference[c],A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let N=A?A[x]:0;(!N||!await(a.isElement==null?void 0:a.isElement(A)))&&(N=l.floating[x]||i.floating[h]);const L=I/2-z/2,P=N/2-p[h]/2-1,k=Wn(g[w],P),O=Wn(g[C],P),j=k,$=N-p[h]-O,b=N/2-p[h]/2+L,S=Qo(j,b,$),T=!d.arrow&&ft(r)!=null&&b!==S&&i.reference[h]/2-(b<j?k:O)-p[h]/2<0,F=T?b<j?b-j:b-$:0;return{[c]:f[c]+F,data:{[c]:S,centerOffset:b-S-F,...T&&{alignmentOffset:F}},reset:T}}}),wc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:l,platform:d,elements:u}=t,{mainAxis:_=!0,crossAxis:g=!0,fallbackPlacements:f,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...v}=ut(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=Kn(r),C=Tn(l),x=Kn(l)===l,I=await(d.isRTL==null?void 0:d.isRTL(u.floating)),z=f||(x||!p?[eo(l)]:Al(l)),A=h!=="none";!f&&A&&z.push(...Ol(l,p,h,I));const N=[l,...z],L=await fr(t,v),P=[];let k=((o=i.flip)==null?void 0:o.overflows)||[];if(_&&P.push(L[w]),g){const b=Dl(r,a,I);P.push(L[b[0]],L[b[1]])}if(k=[...k,{placement:r,overflows:P}],!P.every(b=>b<=0)){var O,j;const b=(((O=i.flip)==null?void 0:O.index)||0)+1,S=N[b];if(S&&(!(g==="alignment"?C!==Tn(S):!1)||k.every(y=>Tn(y.placement)===C?y.overflows[0]>0:!0)))return{data:{index:b,overflows:k},reset:{placement:S}};let T=(j=k.filter(F=>F.overflows[0]<=0).sort((F,y)=>F.overflows[1]-y.overflows[1])[0])==null?void 0:j.placement;if(!T)switch(c){case"bestFit":{var $;const F=($=k.filter(y=>{if(A){const E=Tn(y.placement);return E===C||E==="y"}return!0}).map(y=>[y.placement,y.overflows.filter(E=>E>0).reduce((E,D)=>E+D,0)]).sort((y,E)=>y[1]-E[1])[0])==null?void 0:$[0];F&&(T=F);break}case"initialPlacement":T=l;break}if(r!==T)return{reset:{placement:T}}}return{}}}},yc=new Set(["left","top"]);async function Cc(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=Kn(n),l=ft(n),d=Tn(n)==="y",u=yc.has(a)?-1:1,_=i&&d?-1:1,g=ut(t,e);let{mainAxis:f,crossAxis:c,alignmentAxis:h}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof h=="number"&&(c=l==="end"?h*-1:h),d?{x:c*_,y:f*u}:{x:f*u,y:c*_}}const xc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:a,middlewareData:l}=t,d=await Cc(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+d.x,y:i+d.y,data:{...d,placement:a}}}}},Sc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:w,y:C}=v;return{x:w,y:C}}},...d}=ut(e,t),u={x:n,y:o},_=await fr(t,d),g=Tn(Kn(r)),f=wi(g);let c=u[f],h=u[g];if(i){const v=f==="y"?"top":"left",w=f==="y"?"bottom":"right",C=c+_[v],x=c-_[w];c=Qo(C,c,x)}if(a){const v=g==="y"?"top":"left",w=g==="y"?"bottom":"right",C=h+_[v],x=h-_[w];h=Qo(C,h,x)}const p=l.fn({...t,[f]:c,[g]:h});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[f]:i,[g]:a}}}}}},$c=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:a,elements:l}=t,{apply:d=()=>{},...u}=ut(e,t),_=await fr(t,u),g=Kn(r),f=ft(r),c=Tn(r)==="y",{width:h,height:p}=i.floating;let v,w;g==="top"||g==="bottom"?(v=g,w=f===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(w=g,v=f==="end"?"top":"bottom");const C=p-_.top-_.bottom,x=h-_.left-_.right,I=Wn(p-_[v],C),z=Wn(h-_[w],x),A=!t.middlewareData.shift;let N=I,L=z;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(N=C),A&&!f){const k=bn(_.left,0),O=bn(_.right,0),j=bn(_.top,0),$=bn(_.bottom,0);c?L=h-2*(k!==0||O!==0?k+O:bn(_.left,_.right)):N=p-2*(j!==0||$!==0?j+$:bn(_.top,_.bottom))}await d({...t,availableWidth:L,availableHeight:N});const P=await a.getDimensions(l.floating);return h!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function Ki(e){const t=vn(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Ye(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:o,l=Qt(n)!==i||Qt(o)!==a;return l&&(n=i,o=a),{width:n,height:o,$:l}}function _r(e){return Pe(e)?e:e.contextElement}function gt(e){const t=_r(e);if(!Ye(t))return En(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Ki(t);let a=(i?Qt(n.width):n.width)/o,l=(i?Qt(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const kc=En(0);function Ui(e){const t=mn(e);return!Zt()||!t.visualViewport?kc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ic(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==mn(e)?!1:t}function nt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=_r(e);let a=En(1);t&&(o?Pe(o)&&(a=gt(o)):a=gt(e));const l=Ic(i,n,o)?Ui(i):En(0);let d=(r.left+l.x)/a.x,u=(r.top+l.y)/a.y,_=r.width/a.x,g=r.height/a.y;if(i){const f=mn(i),c=o&&Pe(o)?mn(o):o;let h=f,p=Jo(h);for(;p&&o&&c!==h;){const v=gt(p),w=p.getBoundingClientRect(),C=vn(p),x=w.left+(p.clientLeft+parseFloat(C.paddingLeft))*v.x,I=w.top+(p.clientTop+parseFloat(C.paddingTop))*v.y;d*=v.x,u*=v.y,_*=v.x,g*=v.y,d+=x,u+=I,h=mn(p),p=Jo(h)}}return no({width:_,height:g,x:d,y:u})}function co(e,t){const n=Jt(e).scrollLeft;return t?t.left+n:nt(In(e)).left+n}function Xi(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-co(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Ec(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",a=In(o),l=t?Rt(t.floating):!1;if(o===a||l&&i)return n;let d={scrollLeft:0,scrollTop:0},u=En(1);const _=En(0),g=Ye(o);if((g||!g&&!i)&&((Hn(o)!=="body"||St(a))&&(d=Jt(o)),Ye(o))){const c=nt(o);u=gt(o),_.x=c.x+o.clientLeft,_.y=c.y+o.clientTop}const f=a&&!g&&!i?Xi(a,d):En(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-d.scrollLeft*u.x+_.x+f.x,y:n.y*u.y-d.scrollTop*u.y+_.y+f.y}}function Mc(e){return Array.from(e.getClientRects())}function Nc(e){const t=In(e),n=Jt(e),o=e.ownerDocument.body,r=bn(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=bn(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+co(e);const l=-n.scrollTop;return vn(o).direction==="rtl"&&(a+=bn(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:a,y:l}}const Yi=25;function Fc(e,t){const n=mn(e),o=In(e),r=n.visualViewport;let i=o.clientWidth,a=o.clientHeight,l=0,d=0;if(r){i=r.width,a=r.height;const _=Zt();(!_||_&&t==="fixed")&&(l=r.offsetLeft,d=r.offsetTop)}const u=co(o);if(u<=0){const _=o.ownerDocument,g=_.body,f=getComputedStyle(g),c=_.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,h=Math.abs(o.clientWidth-g.clientWidth-c);h<=Yi&&(i-=h)}else u<=Yi&&(i+=u);return{width:i,height:a,x:l,y:d}}const zc=new Set(["absolute","fixed"]);function Dc(e,t){const n=nt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Ye(e)?gt(e):En(1),a=e.clientWidth*i.x,l=e.clientHeight*i.y,d=r*i.x,u=o*i.y;return{width:a,height:l,x:d,y:u}}function Ri(e,t,n){let o;if(t==="viewport")o=Fc(e,n);else if(t==="document")o=Nc(In(e));else if(Pe(t))o=Dc(t,n);else{const r=Ui(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return no(o)}function Zi(e,t){const n=Pn(e);return n===t||!Pe(n)||Ln(n)?!1:vn(n).position==="fixed"||Zi(n,t)}function Ac(e,t){const n=t.get(e);if(n)return n;let o=Gn(e,[],!1).filter(l=>Pe(l)&&Hn(l)!=="body"),r=null;const i=vn(e).position==="fixed";let a=i?Pn(e):e;for(;Pe(a)&&!Ln(a);){const l=vn(a),d=Zo(a);!d&&l.position==="fixed"&&(r=null),(i?!d&&!r:!d&&l.position==="static"&&!!r&&zc.has(r.position)||St(a)&&!d&&Zi(e,a))?o=o.filter(_=>_!==a):r=l,a=Pn(a)}return t.set(e,o),o}function Lc(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?Rt(t)?[]:Ac(t,this._c):[].concat(n),o],l=a[0],d=a.reduce((u,_)=>{const g=Ri(t,_,r);return u.top=bn(g.top,u.top),u.right=Wn(g.right,u.right),u.bottom=Wn(g.bottom,u.bottom),u.left=bn(g.left,u.left),u},Ri(t,l,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Pc(e){const{width:t,height:n}=Ki(e);return{width:t,height:n}}function Tc(e,t,n){const o=Ye(t),r=In(t),i=n==="fixed",a=nt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const d=En(0);function u(){d.x=co(r)}if(o||!o&&!i)if((Hn(t)!=="body"||St(r))&&(l=Jt(t)),o){const c=nt(t,!0,i,t);d.x=c.x+t.clientLeft,d.y=c.y+t.clientTop}else r&&u();i&&!o&&r&&u();const _=r&&!o&&!i?Xi(r,l):En(0),g=a.left+l.scrollLeft-d.x-_.x,f=a.top+l.scrollTop-d.y-_.y;return{x:g,y:f,width:a.width,height:a.height}}function gr(e){return vn(e).position==="static"}function Ji(e,t){if(!Ye(e)||vn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return In(e)===n&&(n=n.ownerDocument.body),n}function Qi(e,t){const n=mn(e);if(Rt(e))return n;if(!Ye(e)){let r=Pn(e);for(;r&&!Ln(r);){if(Pe(r)&&!gr(r))return r;r=Pn(r)}return n}let o=Ji(e,t);for(;o&&xl(o)&&gr(o);)o=Ji(o,t);return o&&Ln(o)&&gr(o)&&!Zo(o)?n:o||El(e)||n}const Oc=async function(e){const t=this.getOffsetParent||Qi,n=this.getDimensions,o=await n(e.floating);return{reference:Tc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Vc(e){return vn(e).direction==="rtl"}const jc={convertOffsetParentRelativeRectToViewportRelativeRect:Ec,getDocumentElement:In,getClippingRect:Lc,getOffsetParent:Qi,getElementRects:Oc,getClientRects:Mc,getDimensions:Pc,getScale:gt,isElement:Pe,isRTL:Vc};function es(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qc(e,t){let n=null,o;const r=In(e);function i(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function a(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),i();const u=e.getBoundingClientRect(),{left:_,top:g,width:f,height:c}=u;if(l||t(),!f||!c)return;const h=dt(g),p=dt(r.clientWidth-(_+f)),v=dt(r.clientHeight-(g+c)),w=dt(_),x={rootMargin:-h+"px "+-p+"px "+-v+"px "+-w+"px",threshold:bn(0,Wn(1,d))||1};let I=!0;function z(A){const N=A[0].intersectionRatio;if(N!==d){if(!I)return a();N?a(!1,N):o=setTimeout(()=>{a(!1,1e-7)},1e3)}N===1&&!es(u,e.getBoundingClientRect())&&a(),I=!1}try{n=new IntersectionObserver(z,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(z,x)}n.observe(e)}return a(!0),i}function uo(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,u=_r(e),_=r||i?[...u?Gn(u):[],...Gn(t)]:[];_.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const g=u&&l?qc(u,n):null;let f=-1,c=null;a&&(c=new ResizeObserver(w=>{let[C]=w;C&&C.target===u&&c&&(c.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=c)==null||x.observe(t)})),n()}),u&&!d&&c.observe(u),c.observe(t));let h,p=d?nt(e):null;d&&v();function v(){const w=nt(e);p&&!es(p,w)&&n(),p=w,h=requestAnimationFrame(v)}return n(),()=>{var w;_.forEach(C=>{r&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),g?.(),(w=c)==null||w.disconnect(),c=null,d&&cancelAnimationFrame(h)}}const Bc=xc,Hc=Sc,Gc=wc,Wc=$c,ns=bc,Kc=(e,t,n)=>{const o=new Map,r={platform:jc,...n},i={...r.platform,_c:o};return vc(e,t,{...r,platform:i})};var Uc=typeof document<"u",Xc=function(){},fo=Uc?m.useLayoutEffect:Xc;function _o(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!_o(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!_o(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function ts(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function os(e,t){const n=ts(e);return Math.round(t*n)/n}function pr(e){const t=M.useRef(e);return fo(()=>{t.current=e}),t}function Yc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:d,open:u}=e,[_,g]=M.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,c]=M.useState(o);_o(f,o)||c(o);const[h,p]=M.useState(null),[v,w]=M.useState(null),C=M.useCallback(y=>{y!==A.current&&(A.current=y,p(y))},[]),x=M.useCallback(y=>{y!==N.current&&(N.current=y,w(y))},[]),I=i||h,z=a||v,A=M.useRef(null),N=M.useRef(null),L=M.useRef(_),P=d!=null,k=pr(d),O=pr(r),j=pr(u),$=M.useCallback(()=>{if(!A.current||!N.current)return;const y={placement:t,strategy:n,middleware:f};O.current&&(y.platform=O.current),Kc(A.current,N.current,y).then(E=>{const D={...E,isPositioned:j.current!==!1};b.current&&!_o(L.current,D)&&(L.current=D,Go.flushSync(()=>{g(D)}))})},[f,t,n,O,j]);fo(()=>{u===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,g(y=>({...y,isPositioned:!1})))},[u]);const b=M.useRef(!1);fo(()=>(b.current=!0,()=>{b.current=!1}),[]),fo(()=>{if(I&&(A.current=I),z&&(N.current=z),I&&z){if(k.current)return k.current(I,z,$);$()}},[I,z,$,k,P]);const S=M.useMemo(()=>({reference:A,floating:N,setReference:C,setFloating:x}),[C,x]),T=M.useMemo(()=>({reference:I,floating:z}),[I,z]),F=M.useMemo(()=>{const y={position:n,left:0,top:0};if(!T.floating)return y;const E=os(T.floating,_.x),D=os(T.floating,_.y);return l?{...y,transform:"translate("+E+"px, "+D+"px)",...ts(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:E,top:D}},[n,l,T.floating,_.x,_.y]);return M.useMemo(()=>({..._,update:$,refs:S,elements:T,floatingStyles:F}),[_,$,S,T,F])}const Rc=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?ns({element:o.current,padding:r}).fn(n):{}:o?ns({element:o,padding:r}).fn(n):{}}}},go=(e,t)=>({...Bc(e),options:[e,t]}),po=(e,t)=>({...Hc(e),options:[e,t]}),ho=(e,t)=>({...Gc(e),options:[e,t]}),rs=(e,t)=>({...Wc(e),options:[e,t]}),Zc=(e,t)=>({...Rc(e),options:[e,t]});function is(e){const t=M.useRef(void 0),n=M.useCallback(o=>{const r=e.map(i=>{if(i!=null){if(typeof i=="function"){const a=i,l=a(o);return typeof l=="function"?l:()=>{a(null)}}return i.current=o,()=>{i.current=null}}});return()=>{r.forEach(i=>i?.())}},e);return M.useMemo(()=>e.every(o=>o==null)?null:o=>{t.current&&(t.current(),t.current=void 0),o!=null&&(t.current=n(o))},e)}const Jc="data-floating-ui-focusable",ss="active",as="selected",Nt="ArrowLeft",Ft="ArrowRight",ls="ArrowUp",mo="ArrowDown",Qc={...M};let cs=!1,ed=0;const ds=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ed++;function nd(){const[e,t]=M.useState(()=>cs?ds():void 0);return Te(()=>{e==null&&t(ds())},[]),M.useEffect(()=>{cs=!0},[]),e}const zt=Qc.useId||nd;let Dt;process.env.NODE_ENV!=="production"&&(Dt=new Set);function vo(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");if(!((e=Dt)!=null&&e.has(r))){var i;(i=Dt)==null||i.add(r),console.warn(r)}}function td(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");if(!((e=Dt)!=null&&e.has(r))){var i;(i=Dt)==null||i.add(r),console.error(r)}}const od=M.forwardRef(function(t,n){const{context:{placement:o,elements:{floating:r},middlewareData:{arrow:i,shift:a}},width:l=14,height:d=7,tipRadius:u=0,strokeWidth:_=0,staticOffset:g,stroke:f,d:c,style:{transform:h,...p}={},...v}=t;process.env.NODE_ENV!=="production"&&(n||vo("The `ref` prop is required for `FloatingArrow`."));const w=zt(),[C,x]=M.useState(!1);if(Te(()=>{if(!r)return;vn(r).direction==="rtl"&&x(!0)},[r]),!r)return null;const[I,z]=o.split("-"),A=I==="top"||I==="bottom";let N=g;(A&&a!=null&&a.x||!A&&a!=null&&a.y)&&(N=null);const L=_*2,P=L/2,k=l/2*(u/-8+1),O=d/2*u/4,j=!!c,$=N&&z==="end"?"bottom":"top";let b=N&&z==="end"?"right":"left";N&&C&&(b=z==="end"?"left":"right");const S=i?.x!=null?N||i.x:"",T=i?.y!=null?N||i.y:"",F=c||"M0,0"+(" H"+l)+(" L"+(l-k)+","+(d-O))+(" Q"+l/2+","+d+" "+k+","+(d-O))+" Z",y={top:j?"rotate(180deg)":"",left:j?"rotate(90deg)":"rotate(-90deg)",bottom:j?"":"rotate(180deg)",right:j?"rotate(-90deg)":"rotate(90deg)"}[I];return s.jsxs("svg",{...v,"aria-hidden":!0,ref:n,width:j?l:l+L,height:l,viewBox:"0 0 "+l+" "+(d>l?d:l),style:{position:"absolute",pointerEvents:"none",[b]:S,[$]:T,[I]:A||j?"100%":"calc(100% - "+L/2+"px)",transform:[y,h].filter(E=>!!E).join(" "),...p},children:[L>0&&s.jsx("path",{clipPath:"url(#"+w+")",fill:"none",stroke:f,strokeWidth:L+(c?0:1),d:F}),s.jsx("path",{stroke:L&&!c?v.fill:"none",d:F}),s.jsx("clipPath",{id:w,children:s.jsx("rect",{x:-P,y:P*(j?-1:1),width:l+L,height:l})})]})});function us(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var o;(o=e.get(t))==null||o.delete(n)}}}const fs=M.createContext(null),_s=M.createContext(null),pt=()=>{var e;return((e=M.useContext(fs))==null?void 0:e.id)||null},tt=()=>M.useContext(_s);function gs(e){const t=zt(),n=tt(),r=pt();return Te(()=>{if(!t)return;const i={id:t,parentId:r};return n?.addNode(i),()=>{n?.removeNode(i)}},[n,t,r]),t}function ps(e){const{children:t,id:n}=e,o=pt();return s.jsx(fs.Provider,{value:M.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function rd(e){const{children:t}=e,n=M.useRef([]),o=M.useCallback(a=>{n.current=[...n.current,a]},[]),r=M.useCallback(a=>{n.current=n.current.filter(l=>l!==a)},[]),[i]=M.useState(()=>us());return s.jsx(_s.Provider,{value:M.useMemo(()=>({nodesRef:n,addNode:o,removeNode:r,events:i}),[o,r,i]),children:t})}function ot(e){return"data-floating-ui-"+e}function an(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const hs=ot("safe-polygon");function hr(e,t,n){if(n&&!kt(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function mr(e){return typeof e=="function"?e():e}function vr(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,events:i,elements:a}=e,{enabled:l=!0,delay:d=0,handleClose:u=null,mouseOnly:_=!1,restMs:g=0,move:f=!0}=t,c=tt(),h=pt(),p=en(u),v=en(d),w=en(n),C=en(g),x=M.useRef(),I=M.useRef(-1),z=M.useRef(),A=M.useRef(-1),N=M.useRef(!0),L=M.useRef(!1),P=M.useRef(()=>{}),k=M.useRef(!1),O=Re(()=>{var F;const y=(F=r.current.openEvent)==null?void 0:F.type;return y?.includes("mouse")&&y!=="mousedown"});M.useEffect(()=>{if(!l)return;function F(y){let{open:E}=y;E||(an(I),an(A),N.current=!0,k.current=!1)}return i.on("openchange",F),()=>{i.off("openchange",F)}},[l,i]),M.useEffect(()=>{if(!l||!p.current||!n)return;function F(E){O()&&o(!1,E,"hover")}const y=rn(a.floating).documentElement;return y.addEventListener("mouseleave",F),()=>{y.removeEventListener("mouseleave",F)}},[a.floating,n,o,l,p,O]);const j=M.useCallback(function(F,y,E){y===void 0&&(y=!0),E===void 0&&(E="hover");const D=hr(v.current,"close",x.current);D&&!z.current?(an(I),I.current=window.setTimeout(()=>o(!1,F,E),D)):y&&(an(I),o(!1,F,E))},[v,o]),$=Re(()=>{P.current(),z.current=void 0}),b=Re(()=>{if(L.current){const F=rn(a.floating).body;F.style.pointerEvents="",F.removeAttribute(hs),L.current=!1}}),S=Re(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);M.useEffect(()=>{if(!l)return;function F(H){if(an(I),N.current=!1,_&&!kt(x.current)||mr(C.current)>0&&!hr(v.current,"open"))return;const V=hr(v.current,"open",x.current);V?I.current=window.setTimeout(()=>{w.current||o(!0,H,"hover")},V):n||o(!0,H,"hover")}function y(H){if(S()){b();return}P.current();const V=rn(a.floating);if(an(A),k.current=!1,p.current&&r.current.floatingContext){n||an(I),z.current=p.current({...r.current.floatingContext,tree:c,x:H.clientX,y:H.clientY,onClose(){b(),$(),S()||j(H,!0,"safe-polygon")}});const U=z.current;V.addEventListener("mousemove",U),P.current=()=>{V.removeEventListener("mousemove",U)};return}(x.current==="touch"?!on(a.floating,H.relatedTarget):!0)&&j(H)}function E(H){S()||r.current.floatingContext&&(p.current==null||p.current({...r.current.floatingContext,tree:c,x:H.clientX,y:H.clientY,onClose(){b(),$(),S()||j(H)}})(H))}function D(){an(I)}function B(H){S()||j(H,!1)}if(Pe(a.domReference)){const H=a.domReference,V=a.floating;return n&&H.addEventListener("mouseleave",E),f&&H.addEventListener("mousemove",F,{once:!0}),H.addEventListener("mouseenter",F),H.addEventListener("mouseleave",y),V&&(V.addEventListener("mouseleave",E),V.addEventListener("mouseenter",D),V.addEventListener("mouseleave",B)),()=>{n&&H.removeEventListener("mouseleave",E),f&&H.removeEventListener("mousemove",F),H.removeEventListener("mouseenter",F),H.removeEventListener("mouseleave",y),V&&(V.removeEventListener("mouseleave",E),V.removeEventListener("mouseenter",D),V.removeEventListener("mouseleave",B))}}},[a,l,e,_,f,j,$,b,o,n,w,c,v,p,r,S,C]),Te(()=>{var F;if(l&&n&&(F=p.current)!=null&&(F=F.__options)!=null&&F.blockPointerEvents&&O()){L.current=!0;const E=a.floating;if(Pe(a.domReference)&&E){var y;const D=rn(a.floating).body;D.setAttribute(hs,"");const B=a.domReference,H=c==null||(y=c.nodesRef.current.find(V=>V.id===h))==null||(y=y.context)==null?void 0:y.elements.floating;return H&&(H.style.pointerEvents=""),D.style.pointerEvents="none",B.style.pointerEvents="auto",E.style.pointerEvents="auto",()=>{D.style.pointerEvents="",B.style.pointerEvents="",E.style.pointerEvents=""}}}},[l,n,h,a,c,p,O]),Te(()=>{n||(x.current=void 0,k.current=!1,$(),b())},[n,$,b]),M.useEffect(()=>()=>{$(),an(I),an(A),b()},[l,a.domReference,$,b]);const T=M.useMemo(()=>{function F(y){x.current=y.pointerType}return{onPointerDown:F,onPointerEnter:F,onMouseMove(y){const{nativeEvent:E}=y;function D(){!N.current&&!w.current&&o(!0,E,"hover")}_&&!kt(x.current)||n||mr(C.current)===0||k.current&&y.movementX**2+y.movementY**2<2||(an(A),x.current==="touch"?D():(k.current=!0,A.current=window.setTimeout(D,mr(C.current))))}}},[_,o,n,w,C]);return M.useMemo(()=>l?{reference:T}:{},[l,T])}let ms=0;function rt(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(ms);const i=()=>e?.focus({preventScroll:n});r?i():ms=requestAnimationFrame(i)}function br(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Yt(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function id(e){return"composedPath"in e?e.composedPath()[0]:e.target}function sd(e){return e?.ownerDocument||document}const ht={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function vs(e){return e==="inert"?ht.inert:e==="aria-hidden"?ht["aria-hidden"]:ht.none}let bo=new WeakSet,wo={},wr=0;const ad=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,bs=e=>e&&(e.host||bs(e.parentNode)),ld=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=bs(n);return e.contains(o)?o:null}).filter(n=>n!=null);function cd(e,t,n,o){const r="data-floating-ui-inert",i=o?"inert":n?"aria-hidden":null,a=ld(t,e),l=new Set,d=new Set(a),u=[];wo[r]||(wo[r]=new WeakMap);const _=wo[r];a.forEach(g),f(t),l.clear();function g(c){!c||l.has(c)||(l.add(c),c.parentNode&&g(c.parentNode))}function f(c){!c||d.has(c)||[].forEach.call(c.children,h=>{if(Hn(h)!=="script")if(l.has(h))f(h);else{const p=i?h.getAttribute(i):null,v=p!==null&&p!=="false",w=vs(i),C=(w.get(h)||0)+1,x=(_.get(h)||0)+1;w.set(h,C),_.set(h,x),u.push(h),C===1&&v&&bo.add(h),x===1&&h.setAttribute(r,""),!v&&i&&h.setAttribute(i,i==="inert"?"":"true")}})}return wr++,()=>{u.forEach(c=>{const h=vs(i),v=(h.get(c)||0)-1,w=(_.get(c)||0)-1;h.set(c,v),_.set(c,w),v||(!bo.has(c)&&i&&c.removeAttribute(i),bo.delete(c)),w||c.removeAttribute(r)}),wr--,wr||(ht.inert=new WeakMap,ht["aria-hidden"]=new WeakMap,ht.none=new WeakMap,bo=new WeakSet,wo={})}}function ws(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=sd(e[0]).body;return cd(e.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,t,n)}const yo={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Co=M.forwardRef(function(t,n){const[o,r]=M.useState();Te(()=>{Ai()&&r("button")},[]);const i={ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[ot("focus-guard")]:"",style:yo};return s.jsx("span",{...t,...i})}),ys=M.createContext(null),Cs=ot("portal");function dd(e){e===void 0&&(e={});const{id:t,root:n}=e,o=zt(),r=xs(),[i,a]=M.useState(null),l=M.useRef(null);return Te(()=>()=>{i?.remove(),queueMicrotask(()=>{l.current=null})},[i]),Te(()=>{if(!o||l.current)return;const d=t?document.getElementById(t):null;if(!d)return;const u=document.createElement("div");u.id=o,u.setAttribute(Cs,""),d.appendChild(u),l.current=u,a(u)},[t,o]),Te(()=>{if(n===null||!o||l.current)return;let d=n||r?.portalNode;d&&!Ro(d)&&(d=d.current),d=d||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,d.appendChild(u));const _=document.createElement("div");_.id=o,_.setAttribute(Cs,""),d=u||d,d.appendChild(_),l.current=_,a(_)},[t,n,o,r]),i}function xo(e){const{children:t,id:n,root:o,preserveTabOrder:r=!0}=e,i=dd({id:n,root:o}),[a,l]=M.useState(null),d=M.useRef(null),u=M.useRef(null),_=M.useRef(null),g=M.useRef(null),f=a?.modal,c=a?.open,h=!!a&&!a.modal&&a.open&&r&&!!(o||i);return M.useEffect(()=>{if(!i||!r||f)return;function p(v){i&&Mt(v)&&(v.type==="focusin"?Gi:mc)(i)}return i.addEventListener("focusin",p,!0),i.addEventListener("focusout",p,!0),()=>{i.removeEventListener("focusin",p,!0),i.removeEventListener("focusout",p,!0)}},[i,r,f]),M.useEffect(()=>{i&&(c||Gi(i))},[c,i]),s.jsxs(ys.Provider,{value:M.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:d,afterOutsideRef:u,beforeInsideRef:_,afterInsideRef:g,portalNode:i,setFocusManagerState:l}),[r,i]),children:[h&&i&&s.jsx(Co,{"data-type":"outside",ref:d,onFocus:p=>{if(Mt(p,i)){var v;(v=_.current)==null||v.focus()}else{const w=a?a.domReference:null,C=Hi(w);C?.focus()}}}),h&&i&&s.jsx("span",{"aria-owns":i.id,style:yo}),i&&Go.createPortal(t,i),h&&i&&s.jsx(Co,{"data-type":"outside",ref:u,onFocus:p=>{if(Mt(p,i)){var v;(v=g.current)==null||v.focus()}else{const w=a?a.domReference:null,C=Bi(w);C?.focus(),a?.closeOnFocusOut&&a?.onOpenChange(!1,p.nativeEvent,"focus-out")}}})]})}const xs=()=>M.useContext(ys);function Ss(e){return M.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const ud=20;let Un=[];function yr(){Un=Un.filter(e=>e.isConnected)}function fd(e){yr(),e&&Hn(e)!=="body"&&(Un.push(e),Un.length>ud&&(Un=Un.slice(-20)))}function $s(){return yr(),Un[Un.length-1]}function _d(e){const t=Et();return Fi(e,t)?e:io(e,t)[0]||e}function ks(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const o=Et(),i=ec(e,o).filter(l=>{const d=l.getAttribute("data-tabindex")||"";return Fi(l,o)||l.hasAttribute("data-tabindex")&&!d.startsWith("-")}),a=e.getAttribute("tabindex");t.current.includes("floating")||i.length===0?a!=="0"&&e.setAttribute("tabindex","0"):(a!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const gd=M.forwardRef(function(t,n){return s.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:yo})});function Cr(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:a=0,returnFocus:l=!0,restoreFocus:d=!1,modal:u=!0,visuallyHiddenDismiss:_=!1,closeOnFocusOut:g=!0,outsideElementsInert:f=!1,getInsideElements:c=()=>[]}=e,{open:h,onOpenChange:p,events:v,dataRef:w,elements:{domReference:C,floating:x}}=t,I=Re(()=>{var Z;return(Z=w.current.floatingContext)==null?void 0:Z.nodeId}),z=Re(c),A=typeof a=="number"&&a<0,N=dr(C)&&A,L=ad(),P=L?i:!0,k=!P||L&&f,O=en(r),j=en(a),$=en(l),b=tt(),S=xs(),T=M.useRef(null),F=M.useRef(null),y=M.useRef(!1),E=M.useRef(!1),D=M.useRef(-1),B=M.useRef(-1),H=S!=null,V=so(x),J=Re(function(Z){return Z===void 0&&(Z=V),Z?io(Z,Et()):[]}),U=Re(Z=>{const oe=J(Z);return O.current.map(ne=>C&&ne==="reference"?C:V&&ne==="floating"?V:oe).filter(Boolean).flat()});M.useEffect(()=>{if(o||!u)return;function Z(ne){if(ne.key==="Tab"){on(V,Mn(rn(V)))&&J().length===0&&!N&&sn(ne);const ue=U(),ve=On(ne);O.current[0]==="reference"&&ve===C&&(sn(ne),ne.shiftKey?rt(ue[ue.length-1]):rt(ue[1])),O.current[1]==="floating"&&ve===V&&ne.shiftKey&&(sn(ne),rt(ue[0]))}}const oe=rn(V);return oe.addEventListener("keydown",Z),()=>{oe.removeEventListener("keydown",Z)}},[o,C,V,u,O,N,J,U]),M.useEffect(()=>{if(o||!x)return;function Z(oe){const ne=On(oe),ve=J().indexOf(ne);ve!==-1&&(D.current=ve)}return x.addEventListener("focusin",Z),()=>{x.removeEventListener("focusin",Z)}},[o,x,J]),M.useEffect(()=>{if(o||!g)return;function Z(){E.current=!0,setTimeout(()=>{E.current=!1})}function oe(ve){const X=ve.relatedTarget,he=ve.currentTarget,te=On(ve);queueMicrotask(()=>{const se=I(),Ce=!(on(C,X)||on(x,X)||on(X,x)||on(S?.portalNode,X)||X!=null&&X.hasAttribute(ot("focus-guard"))||b&&(et(b.nodesRef.current,se).find(W=>{var q,G;return on((q=W.context)==null?void 0:q.elements.floating,X)||on((G=W.context)==null?void 0:G.elements.domReference,X)})||Ti(b.nodesRef.current,se).find(W=>{var q,G,fe;return[(q=W.context)==null?void 0:q.elements.floating,so((G=W.context)==null?void 0:G.elements.floating)].includes(X)||((fe=W.context)==null?void 0:fe.elements.domReference)===X})));if(he===C&&V&&ks(V,O),d&&he!==C&&!(te!=null&&te.isConnected)&&Mn(rn(V))===rn(V).body){Ye(V)&&V.focus();const W=D.current,q=J(),G=q[W]||q[q.length-1]||V;Ye(G)&&G.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(N||!u)&&X&&Ce&&!E.current&&X!==$s()&&(y.current=!0,p(!1,ve,"focus-out"))})}const ne=!!(!b&&S);function ue(){an(B),w.current.insideReactTree=!0,B.current=window.setTimeout(()=>{w.current.insideReactTree=!1})}if(x&&Ye(C))return C.addEventListener("focusout",oe),C.addEventListener("pointerdown",Z),x.addEventListener("focusout",oe),ne&&x.addEventListener("focusout",ue,!0),()=>{C.removeEventListener("focusout",oe),C.removeEventListener("pointerdown",Z),x.removeEventListener("focusout",oe),ne&&x.removeEventListener("focusout",ue,!0)}},[o,C,x,V,u,b,S,p,g,d,J,N,I,O,w]);const pe=M.useRef(null),ce=M.useRef(null),ie=Ss([pe,S?.beforeInsideRef]),ge=Ss([ce,S?.afterInsideRef]);M.useEffect(()=>{var Z,oe;if(o||!x)return;const ne=Array.from((S==null||(Z=S.portalNode)==null?void 0:Z.querySelectorAll("["+ot("portal")+"]"))||[]),ve=(oe=(b?Ti(b.nodesRef.current,I()):[]).find(te=>{var se;return dr(((se=te.context)==null?void 0:se.elements.domReference)||null)}))==null||(oe=oe.context)==null?void 0:oe.elements.domReference,X=[x,ve,...ne,...z(),T.current,F.current,pe.current,ce.current,S?.beforeOutsideRef.current,S?.afterOutsideRef.current,O.current.includes("reference")||N?C:null].filter(te=>te!=null),he=u||N?ws(X,!k,k):ws(X);return()=>{he()}},[o,C,x,u,O,S,N,P,k,b,I,z]),Te(()=>{if(o||!Ye(V))return;const Z=rn(V),oe=Mn(Z);queueMicrotask(()=>{const ne=U(V),ue=j.current,ve=(typeof ue=="number"?ne[ue]:ue.current)||V,X=on(V,oe);!A&&!X&&h&&rt(ve,{preventScroll:ve===V})})},[o,h,V,A,U,j]),Te(()=>{if(o||!V)return;const Z=rn(V),oe=Mn(Z);fd(oe);function ne(X){let{reason:he,event:te,nested:se}=X;if(["hover","safe-polygon"].includes(he)&&te.type==="mouseleave"&&(y.current=!0),he==="outside-press")if(se)y.current=!1;else if(Oi(te)||Vi(te))y.current=!1;else{let Ce=!1;document.createElement("div").focus({get preventScroll(){return Ce=!0,!1}}),Ce?y.current=!1:y.current=!0}}v.on("openchange",ne);const ue=Z.createElement("span");ue.setAttribute("tabindex","-1"),ue.setAttribute("aria-hidden","true"),Object.assign(ue.style,yo),H&&C&&C.insertAdjacentElement("afterend",ue);function ve(){if(typeof $.current=="boolean"){const X=C||$s();return X&&X.isConnected?X:ue}return $.current.current||ue}return()=>{v.off("openchange",ne);const X=Mn(Z),he=on(x,X)||b&&et(b.nodesRef.current,I(),!1).some(se=>{var Ce;return on((Ce=se.context)==null?void 0:Ce.elements.floating,X)}),te=ve();queueMicrotask(()=>{const se=_d(te);$.current&&!y.current&&Ye(se)&&(!(se!==X&&X!==Z.body)||he)&&se.focus({preventScroll:!0}),ue.remove()})}},[o,x,V,$,w,v,b,H,C,I]),M.useEffect(()=>(queueMicrotask(()=>{y.current=!1}),()=>{queueMicrotask(yr)}),[o]),Te(()=>{if(!o&&S)return S.setFocusManagerState({modal:u,closeOnFocusOut:g,open:h,onOpenChange:p,domReference:C}),()=>{S.setFocusManagerState(null)}},[o,S,u,h,p,g,C]),Te(()=>{o||V&&ks(V,O)},[o,V,O]);function de(Z){return o||!_||!u?null:s.jsx(gd,{ref:Z==="start"?T:F,onClick:oe=>p(!1,oe.nativeEvent),children:typeof _=="string"?_:"Dismiss"})}const $e=!o&&P&&(u?!N:!0)&&(H||u);return s.jsxs(s.Fragment,{children:[$e&&s.jsx(Co,{"data-type":"inside",ref:ie,onFocus:Z=>{if(u){const ne=U();rt(r[0]==="reference"?ne[0]:ne[ne.length-1])}else if(S!=null&&S.preserveTabOrder&&S.portalNode)if(y.current=!1,Mt(Z,S.portalNode)){const ne=Bi(C);ne?.focus()}else{var oe;(oe=S.beforeOutsideRef.current)==null||oe.focus()}}}),!N&&de("start"),n,de("end"),$e&&s.jsx(Co,{"data-type":"inside",ref:ge,onFocus:Z=>{if(u)rt(U()[0]);else if(S!=null&&S.preserveTabOrder&&S.portalNode)if(g&&(y.current=!0),Mt(Z,S.portalNode)){const ne=Hi(C);ne?.focus()}else{var oe;(oe=S.afterOutsideRef.current)==null||oe.focus()}}})]})}function Is(e){return Ye(e.target)&&e.target.tagName==="BUTTON"}function pd(e){return Ye(e.target)&&e.target.tagName==="A"}function Es(e){return cr(e)}function Ms(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,elements:{domReference:i}}=e,{enabled:a=!0,event:l="click",toggle:d=!0,ignoreMouse:u=!1,keyboardHandlers:_=!0,stickIfOpen:g=!0}=t,f=M.useRef(),c=M.useRef(!1),h=M.useMemo(()=>({onPointerDown(p){f.current=p.pointerType},onMouseDown(p){const v=f.current;p.button===0&&l!=="click"&&(kt(v,!0)&&u||(n&&d&&(!(r.current.openEvent&&g)||r.current.openEvent.type==="mousedown")?o(!1,p.nativeEvent,"click"):(p.preventDefault(),o(!0,p.nativeEvent,"click"))))},onClick(p){const v=f.current;if(l==="mousedown"&&f.current){f.current=void 0;return}kt(v,!0)&&u||(n&&d&&(!(r.current.openEvent&&g)||r.current.openEvent.type==="click")?o(!1,p.nativeEvent,"click"):o(!0,p.nativeEvent,"click"))},onKeyDown(p){f.current=void 0,!(p.defaultPrevented||!_||Is(p))&&(p.key===" "&&!Es(i)&&(p.preventDefault(),c.current=!0),!pd(p)&&p.key==="Enter"&&o(!(n&&d),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!_||Is(p)||Es(i)||p.key===" "&&c.current&&(c.current=!1,o(!(n&&d),p.nativeEvent,"click"))}}),[r,i,l,u,_,o,n,g,d]);return M.useMemo(()=>a?{reference:h}:{},[a,h])}const hd={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},md={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ns=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function So(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,elements:r,dataRef:i}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:d=!0,outsidePressEvent:u="pointerdown",referencePress:_=!1,referencePressEvent:g="pointerdown",ancestorScroll:f=!1,bubbles:c,capture:h}=t,p=tt(),v=Re(typeof d=="function"?d:()=>!1),w=typeof d=="function"?v:d,C=M.useRef(!1),{escapeKey:x,outsidePress:I}=Ns(c),{escapeKey:z,outsidePress:A}=Ns(h),N=M.useRef(!1),L=Re(b=>{var S;if(!n||!a||!l||b.key!=="Escape"||N.current)return;const T=(S=i.current.floatingContext)==null?void 0:S.nodeId,F=p?et(p.nodesRef.current,T):[];if(!x&&(b.stopPropagation(),F.length>0)){let y=!0;if(F.forEach(E=>{var D;if((D=E.context)!=null&&D.open&&!E.context.dataRef.current.__escapeKeyBubbles){y=!1;return}}),!y)return}o(!1,lc(b)?b.nativeEvent:b,"escape-key")}),P=Re(b=>{var S;const T=()=>{var F;L(b),(F=On(b))==null||F.removeEventListener("keydown",T)};(S=On(b))==null||S.addEventListener("keydown",T)}),k=Re(b=>{var S;const T=i.current.insideReactTree;i.current.insideReactTree=!1;const F=C.current;if(C.current=!1,u==="click"&&F||T||typeof w=="function"&&!w(b))return;const y=On(b),E="["+ot("inert")+"]",D=rn(r.floating).querySelectorAll(E);let B=Pe(y)?y:null;for(;B&&!Ln(B);){const U=Pn(B);if(Ln(U)||!Pe(U))break;B=U}if(D.length&&Pe(y)&&!ic(y)&&!on(y,r.floating)&&Array.from(D).every(U=>!on(B,U)))return;if(Ye(y)&&$){const U=Ln(y),pe=vn(y),ce=/auto|scroll/,ie=U||ce.test(pe.overflowX),ge=U||ce.test(pe.overflowY),de=ie&&y.clientWidth>0&&y.scrollWidth>y.clientWidth,$e=ge&&y.clientHeight>0&&y.scrollHeight>y.clientHeight,Z=pe.direction==="rtl",oe=$e&&(Z?b.offsetX<=y.offsetWidth-y.clientWidth:b.offsetX>y.clientWidth),ne=de&&b.offsetY>y.clientHeight;if(oe||ne)return}const H=(S=i.current.floatingContext)==null?void 0:S.nodeId,V=p&&et(p.nodesRef.current,H).some(U=>{var pe;return lr(b,(pe=U.context)==null?void 0:pe.elements.floating)});if(lr(b,r.floating)||lr(b,r.domReference)||V)return;const J=p?et(p.nodesRef.current,H):[];if(J.length>0){let U=!0;if(J.forEach(pe=>{var ce;if((ce=pe.context)!=null&&ce.open&&!pe.context.dataRef.current.__outsidePressBubbles){U=!1;return}}),!U)return}o(!1,b,"outside-press")}),O=Re(b=>{var S;const T=()=>{var F;k(b),(F=On(b))==null||F.removeEventListener(u,T)};(S=On(b))==null||S.addEventListener(u,T)});M.useEffect(()=>{if(!n||!a)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=I;let b=-1;function S(D){o(!1,D,"ancestor-scroll")}function T(){window.clearTimeout(b),N.current=!0}function F(){b=window.setTimeout(()=>{N.current=!1},Zt()?5:0)}const y=rn(r.floating);l&&(y.addEventListener("keydown",z?P:L,z),y.addEventListener("compositionstart",T),y.addEventListener("compositionend",F)),w&&y.addEventListener(u,A?O:k,A);let E=[];return f&&(Pe(r.domReference)&&(E=Gn(r.domReference)),Pe(r.floating)&&(E=E.concat(Gn(r.floating))),!Pe(r.reference)&&r.reference&&r.reference.contextElement&&(E=E.concat(Gn(r.reference.contextElement)))),E=E.filter(D=>{var B;return D!==((B=y.defaultView)==null?void 0:B.visualViewport)}),E.forEach(D=>{D.addEventListener("scroll",S,{passive:!0})}),()=>{l&&(y.removeEventListener("keydown",z?P:L,z),y.removeEventListener("compositionstart",T),y.removeEventListener("compositionend",F)),w&&y.removeEventListener(u,A?O:k,A),E.forEach(D=>{D.removeEventListener("scroll",S)}),window.clearTimeout(b)}},[i,r,l,w,u,n,o,f,a,x,I,L,z,P,k,A,O]),M.useEffect(()=>{i.current.insideReactTree=!1},[i,w,u]);const j=M.useMemo(()=>({onKeyDown:L,..._&&{[hd[g]]:b=>{o(!1,b.nativeEvent,"reference-press")},...g!=="click"&&{onClick(b){o(!1,b.nativeEvent,"reference-press")}}}}),[L,o,_,g]),$=M.useMemo(()=>({onKeyDown:L,onMouseDown(){C.current=!0},onMouseUp(){C.current=!0},[md[u]]:()=>{i.current.insideReactTree=!0}}),[L,u,i]);return M.useMemo(()=>a?{reference:j,floating:$}:{},[a,j,$])}function vd(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=zt(),i=M.useRef({}),[a]=M.useState(()=>us()),l=pt()!=null;if(process.env.NODE_ENV!=="production"){const c=o.reference;c&&!Pe(c)&&td("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[d,u]=M.useState(o.reference),_=Re((c,h,p)=>{i.current.openEvent=c?h:void 0,a.emit("openchange",{open:c,event:h,reason:p,nested:l}),n?.(c,h,p)}),g=M.useMemo(()=>({setPositionReference:u}),[]),f=M.useMemo(()=>({reference:d||o.reference||null,floating:o.floating||null,domReference:o.reference}),[d,o.reference,o.floating]);return M.useMemo(()=>({dataRef:i,open:t,onOpenChange:_,elements:f,events:a,floatingId:r,refs:g}),[t,_,f,a,r,g])}function $o(e){e===void 0&&(e={});const{nodeId:t}=e,n=vd({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,r=o.elements,[i,a]=M.useState(null),[l,d]=M.useState(null),_=r?.domReference||i,g=M.useRef(null),f=tt();Te(()=>{_&&(g.current=_)},[_]);const c=Yc({...e,elements:{...r,...l&&{reference:l}}}),h=M.useCallback(x=>{const I=Pe(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;d(I),c.refs.setReference(I)},[c.refs]),p=M.useCallback(x=>{(Pe(x)||x===null)&&(g.current=x,a(x)),(Pe(c.refs.reference.current)||c.refs.reference.current===null||x!==null&&!Pe(x))&&c.refs.setReference(x)},[c.refs]),v=M.useMemo(()=>({...c.refs,setReference:p,setPositionReference:h,domReference:g}),[c.refs,p,h]),w=M.useMemo(()=>({...c.elements,domReference:_}),[c.elements,_]),C=M.useMemo(()=>({...c,...o,refs:v,elements:w,nodeId:t}),[c,v,w,t,o]);return Te(()=>{o.dataRef.current.floatingContext=C;const x=f?.nodesRef.current.find(I=>I.id===t);x&&(x.context=C)}),M.useMemo(()=>({...c,context:C,refs:v,elements:w}),[c,v,w,C])}function xr(){return nc()&&Ai()}function bd(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,events:r,dataRef:i,elements:a}=e,{enabled:l=!0,visibleOnly:d=!0}=t,u=M.useRef(!1),_=M.useRef(-1),g=M.useRef(!0);M.useEffect(()=>{if(!l)return;const c=mn(a.domReference);function h(){!n&&Ye(a.domReference)&&a.domReference===Mn(rn(a.domReference))&&(u.current=!0)}function p(){g.current=!0}function v(){g.current=!1}return c.addEventListener("blur",h),xr()&&(c.addEventListener("keydown",p,!0),c.addEventListener("pointerdown",v,!0)),()=>{c.removeEventListener("blur",h),xr()&&(c.removeEventListener("keydown",p,!0),c.removeEventListener("pointerdown",v,!0))}},[a.domReference,n,l]),M.useEffect(()=>{if(!l)return;function c(h){let{reason:p}=h;(p==="reference-press"||p==="escape-key")&&(u.current=!0)}return r.on("openchange",c),()=>{r.off("openchange",c)}},[r,l]),M.useEffect(()=>()=>{an(_)},[]);const f=M.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(c){if(u.current)return;const h=On(c.nativeEvent);if(d&&Pe(h)){if(xr()&&!c.relatedTarget){if(!g.current&&!cr(h))return}else if(!sc(h))return}o(!0,c.nativeEvent,"focus")},onBlur(c){u.current=!1;const h=c.relatedTarget,p=c.nativeEvent,v=Pe(h)&&h.hasAttribute(ot("focus-guard"))&&h.getAttribute("data-type")==="outside";_.current=window.setTimeout(()=>{var w;const C=Mn(a.domReference?a.domReference.ownerDocument:document);!h&&C===a.domReference||on((w=i.current.floatingContext)==null?void 0:w.refs.floating.current,C)||on(a.domReference,C)||v||o(!1,p,"focus")})}}),[i,a.domReference,o,d]);return M.useMemo(()=>l?{reference:f}:{},[l,f])}function Sr(e,t,n){const o=new Map,r=n==="item";let i=e;if(r&&e){const{[ss]:a,[as]:l,...d}=e;i=d}return{...n==="floating"&&{tabIndex:-1,[Jc]:""},...i,...t.map(a=>{const l=a?a[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((a,l)=>(l&&Object.entries(l).forEach(d=>{let[u,_]=d;if(!(r&&[ss,as].includes(u)))if(u.indexOf("on")===0){if(o.has(u)||o.set(u,[]),typeof _=="function"){var g;(g=o.get(u))==null||g.push(_),a[u]=function(){for(var f,c=arguments.length,h=new Array(c),p=0;p<c;p++)h[p]=arguments[p];return(f=o.get(u))==null?void 0:f.map(v=>v(...h)).find(v=>v!==void 0)}}}else a[u]=_}),a),{})}}function ko(e){e===void 0&&(e=[]);const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=M.useCallback(l=>Sr(l,e,"reference"),t),i=M.useCallback(l=>Sr(l,e,"floating"),n),a=M.useCallback(l=>Sr(l,e,"item"),o);return M.useMemo(()=>({getReferenceProps:r,getFloatingProps:i,getItemProps:a}),[r,i,a])}const wd="Escape";function Io(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Eo(e,t){return Io(t,e===ls||e===mo,e===Nt||e===Ft)}function $r(e,t,n){return Io(t,e===mo,n?e===Nt:e===Ft)||e==="Enter"||e===" "||e===""}function Fs(e,t,n){return Io(t,n?e===Nt:e===Ft,e===mo)}function zs(e,t,n,o){const r=n?e===Ft:e===Nt,i=e===ls;return t==="both"||t==="horizontal"&&o&&o>1?e===wd:Io(t,r,i)}function kr(e,t){const{open:n,onOpenChange:o,elements:r,floatingId:i}=e,{listRef:a,activeIndex:l,onNavigate:d=()=>{},enabled:u=!0,selectedIndex:_=null,allowEscape:g=!1,loop:f=!1,nested:c=!1,rtl:h=!1,virtual:p=!1,focusItemOnOpen:v="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:C=!0,disabledIndices:x=void 0,orientation:I="vertical",parentOrientation:z,cols:A=1,scrollItemIntoView:N=!0,virtualItemRef:L,itemSizes:P,dense:k=!1}=t;process.env.NODE_ENV!=="production"&&(g&&(f||vo("`useListNavigation` looping must be enabled to allow escaping."),p||vo("`useListNavigation` must be virtual to allow escaping.")),I==="vertical"&&A>1&&vo("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const O=so(r.floating),j=en(O),$=pt(),b=tt();Te(()=>{e.dataRef.current.orientation=I},[e,I]);const S=Re(()=>{d(y.current===-1?null:y.current)}),T=dr(r.domReference),F=M.useRef(v),y=M.useRef(_??-1),E=M.useRef(null),D=M.useRef(!0),B=M.useRef(S),H=M.useRef(!!r.floating),V=M.useRef(n),J=M.useRef(!1),U=M.useRef(!1),pe=en(x),ce=en(n),ie=en(N),ge=en(_),[de,$e]=M.useState(),[Z,oe]=M.useState(),ne=Re(()=>{function W(_e){if(p){var me;(me=_e.id)!=null&&me.endsWith("-fui-option")&&(_e.id=i+"-"+Math.random().toString(16).slice(2,10)),$e(_e.id),b?.events.emit("virtualfocus",_e),L&&(L.current=_e)}else rt(_e,{sync:J.current,preventScroll:!0})}const q=a.current[y.current],G=U.current;q&&W(q),(J.current?_e=>_e():requestAnimationFrame)(()=>{const _e=a.current[y.current]||q;if(!_e)return;q||W(_e);const me=ie.current;me&&ve&&(G||!D.current)&&(_e.scrollIntoView==null||_e.scrollIntoView(typeof me=="boolean"?{block:"nearest",inline:"nearest"}:me))})});Te(()=>{u&&(n&&r.floating?F.current&&_!=null&&(U.current=!0,y.current=_,S()):H.current&&(y.current=-1,B.current()))},[u,n,r.floating,_,S]),Te(()=>{if(u&&n&&r.floating)if(l==null){if(J.current=!1,ge.current!=null)return;if(H.current&&(y.current=-1,ne()),(!V.current||!H.current)&&F.current&&(E.current!=null||F.current===!0&&E.current==null)){let W=0;const q=()=>{a.current[0]==null?(W<2&&(W?requestAnimationFrame:queueMicrotask)(q),W++):(y.current=E.current==null||$r(E.current,I,h)||c?ur(a,pe.current):ji(a,pe.current),E.current=null,S())};q()}}else It(a,l)||(y.current=l,ne(),U.current=!1)},[u,n,r.floating,l,ge,c,a,I,h,S,ne,pe]),Te(()=>{var W;if(!u||r.floating||!b||p||!H.current)return;const q=b.nodesRef.current,G=(W=q.find(me=>me.id===$))==null||(W=W.context)==null?void 0:W.elements.floating,fe=Mn(rn(r.floating)),_e=q.some(me=>me.context&&on(me.context.elements.floating,fe));G&&!_e&&D.current&&G.focus({preventScroll:!0})},[u,r.floating,b,$,p]),Te(()=>{if(!u||!b||!p||$)return;function W(q){oe(q.id),L&&(L.current=q)}return b.events.on("virtualfocus",W),()=>{b.events.off("virtualfocus",W)}},[u,b,p,$,L]),Te(()=>{B.current=S,V.current=n,H.current=!!r.floating}),Te(()=>{n||(E.current=null,F.current=v)},[n,v]);const ue=l!=null,ve=M.useMemo(()=>{function W(G){if(!ce.current)return;const fe=a.current.indexOf(G);fe!==-1&&y.current!==fe&&(y.current=fe,S())}return{onFocus(G){let{currentTarget:fe}=G;J.current=!0,W(fe)},onClick:G=>{let{currentTarget:fe}=G;return fe.focus({preventScroll:!0})},onMouseMove(G){let{currentTarget:fe}=G;J.current=!0,U.current=!1,w&&W(fe)},onPointerLeave(G){let{pointerType:fe}=G;if(!(!D.current||fe==="touch")&&(J.current=!0,!!w&&(y.current=-1,S(),!p))){var _e;(_e=j.current)==null||_e.focus({preventScroll:!0})}}}},[ce,j,w,a,S,p]),X=M.useCallback(()=>{var W;return z??(b==null||(W=b.nodesRef.current.find(q=>q.id===$))==null||(W=W.context)==null||(W=W.dataRef)==null?void 0:W.current.orientation)},[$,b,z]),he=Re(W=>{if(D.current=!1,J.current=!0,W.which===229||!ce.current&&W.currentTarget===j.current)return;if(c&&zs(W.key,I,h,A)){Eo(W.key,X())||sn(W),o(!1,W.nativeEvent,"list-navigation"),Ye(r.domReference)&&(p?b?.events.emit("virtualfocus",r.domReference):r.domReference.focus());return}const q=y.current,G=ur(a,x),fe=ji(a,x);if(T||(W.key==="Home"&&(sn(W),y.current=G,S()),W.key==="End"&&(sn(W),y.current=fe,S())),A>1){const _e=P||Array.from({length:a.current.length},()=>({width:1,height:1})),me=gc(_e,A,k),Xe=me.findIndex(Ve=>Ve!=null&&!lo(a,Ve,x)),Oe=me.reduce((Ve,ye,Qe)=>ye!=null&&!lo(a,ye,x)?Qe:Ve,-1),Ze=me[_c({current:me.map(Ve=>Ve!=null?a.current[Ve]:null)},{event:W,orientation:I,loop:f,rtl:h,cols:A,disabledIndices:hc([...(typeof x!="function"?x:null)||a.current.map((Ve,ye)=>lo(a,ye,x)?ye:void 0),void 0],me),minIndex:Xe,maxIndex:Oe,prevIndex:pc(y.current>fe?G:y.current,_e,me,A,W.key===mo?"bl":W.key===(h?Nt:Ft)?"tr":"tl"),stopEvent:!0})];if(Ze!=null&&(y.current=Ze,S()),I==="both")return}if(Eo(W.key,I)){if(sn(W),n&&!p&&Mn(W.currentTarget.ownerDocument)===W.currentTarget){y.current=$r(W.key,I,h)?G:fe,S();return}$r(W.key,I,h)?f?y.current=q>=fe?g&&q!==a.current.length?-1:G:cn(a,{startingIndex:q,disabledIndices:x}):y.current=Math.min(fe,cn(a,{startingIndex:q,disabledIndices:x})):f?y.current=q<=G?g&&q!==-1?a.current.length:fe:cn(a,{startingIndex:q,decrement:!0,disabledIndices:x}):y.current=Math.max(G,cn(a,{startingIndex:q,decrement:!0,disabledIndices:x})),It(a,y.current)&&(y.current=-1),S()}}),te=M.useMemo(()=>p&&n&&ue&&{"aria-activedescendant":Z||de},[p,n,ue,Z,de]),se=M.useMemo(()=>({"aria-orientation":I==="both"?void 0:I,...T?{}:te,onKeyDown:he,onPointerMove(){D.current=!0}}),[te,he,I,T]),Ce=M.useMemo(()=>{function W(G){v==="auto"&&Oi(G.nativeEvent)&&(F.current=!0)}function q(G){F.current=v,v==="auto"&&Vi(G.nativeEvent)&&(F.current=!0)}return{...te,onKeyDown(G){D.current=!1;const fe=G.key.startsWith("Arrow"),_e=["Home","End"].includes(G.key),me=fe||_e,Xe=Fs(G.key,I,h),Oe=zs(G.key,I,h,A),Ze=Fs(G.key,X(),h),Ve=Eo(G.key,I),ye=(c?Ze:Ve)||G.key==="Enter"||G.key.trim()==="";if(p&&n){const je=b?.nodesRef.current.find(yn=>yn.parentId==null),De=b&&je?ac(b.nodesRef.current,je.id):null;if(me&&De&&L){const yn=new KeyboardEvent("keydown",{key:G.key,bubbles:!0});if(Xe||Oe){var Qe,be;const ee=((Qe=De.context)==null?void 0:Qe.elements.domReference)===G.currentTarget,Ne=Oe&&!ee?(be=De.context)==null?void 0:be.elements.domReference:Xe?a.current.find(Ke=>Ke?.id===de):null;Ne&&(sn(G),Ne.dispatchEvent(yn),oe(void 0))}if((Ve||_e)&&De.context&&De.context.open&&De.parentId&&G.currentTarget!==De.context.elements.domReference){var we;sn(G),(we=De.context.elements.domReference)==null||we.dispatchEvent(yn);return}}return he(G)}if(!(!n&&!C&&fe)){if(ye){const je=Eo(G.key,X());E.current=c&&je?null:G.key}if(c){Ze&&(sn(G),n?(y.current=ur(a,pe.current),S()):o(!0,G.nativeEvent,"list-navigation"));return}Ve&&(_!=null&&(y.current=_),sn(G),!n&&C?o(!0,G.nativeEvent,"list-navigation"):he(G),n&&S())}},onFocus(){n&&!p&&(y.current=-1,S())},onPointerDown:q,onPointerEnter:q,onMouseDown:W,onClick:W}},[de,te,A,he,pe,v,a,c,S,o,n,C,I,X,h,_,b,p,L]);return M.useMemo(()=>u?{reference:Ce,floating:se,item:ve}:{},[u,Ce,se,ve])}const yd=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Mo(e,t){var n,o;t===void 0&&(t={});const{open:r,elements:i,floatingId:a}=e,{enabled:l=!0,role:d="dialog"}=t,u=zt(),_=((n=i.domReference)==null?void 0:n.id)||u,g=M.useMemo(()=>{var C;return((C=so(i.floating))==null?void 0:C.id)||a},[i.floating,a]),f=(o=yd.get(d))!=null?o:d,h=pt()!=null,p=M.useMemo(()=>f==="tooltip"||d==="label"?{["aria-"+(d==="label"?"labelledby":"describedby")]:r?g:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":f==="alertdialog"?"dialog":f,"aria-controls":r?g:void 0,...f==="listbox"&&{role:"combobox"},...f==="menu"&&{id:_},...f==="menu"&&h&&{role:"menuitem"},...d==="select"&&{"aria-autocomplete":"none"},...d==="combobox"&&{"aria-autocomplete":"list"}},[f,g,h,r,_,d]),v=M.useMemo(()=>{const C={id:g,...f&&{role:f}};return f==="tooltip"||d==="label"?C:{...C,...f==="menu"&&{"aria-labelledby":_}}},[f,g,_,d]),w=M.useCallback(C=>{let{active:x,selected:I}=C;const z={role:"option",...x&&{id:g+"-fui-option"}};switch(d){case"select":case"combobox":return{...z,"aria-selected":I}}return{}},[g,d]);return M.useMemo(()=>l?{reference:p,floating:v,item:w}:{},[l,p,v,w])}const Ds=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function mt(e,t){return typeof e=="function"?e(t):e}function Cd(e,t){const[n,o]=M.useState(e);return e&&!n&&o(!0),M.useEffect(()=>{if(!e&&n){const r=setTimeout(()=>o(!1),t);return()=>clearTimeout(r)}},[e,n,t]),n}function xd(e,t){t===void 0&&(t={});const{open:n,elements:{floating:o}}=e,{duration:r=250}=t,a=(typeof r=="number"?r:r.close)||0,[l,d]=M.useState("unmounted"),u=Cd(n,a);return!u&&l==="close"&&d("unmounted"),Te(()=>{if(o){if(n){d("initial");const _=requestAnimationFrame(()=>{Go.flushSync(()=>{d("open")})});return()=>{cancelAnimationFrame(_)}}d("close")}},[n,o]),{isMounted:u,status:l}}function No(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:o,close:r,common:i,duration:a=250}=t,l=e.placement,d=l.split("-")[0],u=M.useMemo(()=>({side:d,placement:l}),[d,l]),_=typeof a=="number",g=(_?a:a.open)||0,f=(_?a:a.close)||0,[c,h]=M.useState(()=>({...mt(i,u),...mt(n,u)})),{isMounted:p,status:v}=xd(e,{duration:a}),w=en(n),C=en(o),x=en(r),I=en(i);return Te(()=>{const z=mt(w.current,u),A=mt(x.current,u),N=mt(I.current,u),L=mt(C.current,u)||Object.keys(z).reduce((P,k)=>(P[k]="",P),{});if(v==="initial"&&h(P=>({transitionProperty:P.transitionProperty,...N,...z})),v==="open"&&h({transitionProperty:Object.keys(L).map(Ds).join(","),transitionDuration:g+"ms",...N,...L}),v==="close"){const P=A||z;h({transitionProperty:Object.keys(P).map(Ds).join(","),transitionDuration:f+"ms",...N,...P})}},[f,x,w,C,I,g,v,u]),{isMounted:p,styles:c}}function As(e,t){var n;const{open:o,dataRef:r}=e,{listRef:i,activeIndex:a,onMatch:l,onTypingChange:d,enabled:u=!0,findMatch:_=null,resetMs:g=750,ignoreKeys:f=[],selectedIndex:c=null}=t,h=M.useRef(-1),p=M.useRef(""),v=M.useRef((n=c??a)!=null?n:-1),w=M.useRef(null),C=Re(l),x=Re(d),I=en(_),z=en(f);Te(()=>{o&&(an(h),w.current=null,p.current="")},[o]),Te(()=>{if(o&&p.current===""){var k;v.current=(k=c??a)!=null?k:-1}},[o,c,a]);const A=Re(k=>{k?r.current.typing||(r.current.typing=k,x(k)):r.current.typing&&(r.current.typing=k,x(k))}),N=Re(k=>{function O(T,F,y){const E=I.current?I.current(F,y):F.find(D=>D?.toLocaleLowerCase().indexOf(y.toLocaleLowerCase())===0);return E?T.indexOf(E):-1}const j=i.current;if(p.current.length>0&&p.current[0]!==" "&&(O(j,j,p.current)===-1?A(!1):k.key===" "&&sn(k)),j==null||z.current.includes(k.key)||k.key.length!==1||k.ctrlKey||k.metaKey||k.altKey)return;o&&k.key!==" "&&(sn(k),A(!0)),j.every(T=>{var F,y;return T?((F=T[0])==null?void 0:F.toLocaleLowerCase())!==((y=T[1])==null?void 0:y.toLocaleLowerCase()):!0})&&p.current===k.key&&(p.current="",v.current=w.current),p.current+=k.key,an(h),h.current=window.setTimeout(()=>{p.current="",v.current=w.current,A(!1)},g);const b=v.current,S=O(j,[...j.slice((b||0)+1),...j.slice(0,(b||0)+1)],p.current);S!==-1?(C(S),w.current=S):k.key!==" "&&(p.current="",A(!1))}),L=M.useMemo(()=>({onKeyDown:N}),[N]),P=M.useMemo(()=>({onKeyDown:N,onKeyUp(k){k.key===" "&&A(!1)}}),[N,A]);return M.useMemo(()=>u?{reference:L,floating:P}:{},[u,L,P])}function Ls(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var i;return r.parentId===t&&(!n||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...Ls(e,r.id,n)])}function Ps(e,t){const[n,o]=e;let r=!1;const i=t.length;for(let a=0,l=i-1;a<i;l=a++){const[d,u]=t[a]||[0,0],[_,g]=t[l]||[0,0];u>=o!=g>=o&&n<=(_-d)*(o-u)/(g-u)+d&&(r=!r)}return r}function Sd(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Ts(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r={current:-1};let i=!1,a=null,l=null,d=typeof performance<"u"?performance.now():0;function u(g,f){const c=performance.now(),h=c-d;if(a===null||l===null||h===0)return a=g,l=f,d=c,null;const p=g-a,v=f-l,C=Math.sqrt(p*p+v*v)/h;return a=g,l=f,d=c,C}const _=g=>{let{x:f,y:c,placement:h,elements:p,onClose:v,nodeId:w,tree:C}=g;return function(I){function z(){an(r),v()}if(an(r),!p.domReference||!p.floating||h==null||f==null||c==null)return;const{clientX:A,clientY:N}=I,L=[A,N],P=id(I),k=I.type==="mouseleave",O=br(p.floating,P),j=br(p.domReference,P),$=p.domReference.getBoundingClientRect(),b=p.floating.getBoundingClientRect(),S=h.split("-")[0],T=f>b.right-b.width/2,F=c>b.bottom-b.height/2,y=Sd(L,$),E=b.width>$.width,D=b.height>$.height,B=(E?$:b).left,H=(E?$:b).right,V=(D?$:b).top,J=(D?$:b).bottom;if(O&&(i=!0,!k))return;if(j&&(i=!1),j&&!k){i=!0;return}if(k&&Pe(I.relatedTarget)&&br(p.floating,I.relatedTarget)||C&&Ls(C.nodesRef.current,w).length)return;if(S==="top"&&c>=$.bottom-1||S==="bottom"&&c<=$.top+1||S==="left"&&f>=$.right-1||S==="right"&&f<=$.left+1)return z();let U=[];switch(S){case"top":U=[[B,$.top+1],[B,b.bottom-1],[H,b.bottom-1],[H,$.top+1]];break;case"bottom":U=[[B,b.top+1],[B,$.bottom-1],[H,$.bottom-1],[H,b.top+1]];break;case"left":U=[[b.right-1,J],[b.right-1,V],[$.left+1,V],[$.left+1,J]];break;case"right":U=[[$.right-1,J],[$.right-1,V],[b.left+1,V],[b.left+1,J]];break}function pe(ce){let[ie,ge]=ce;switch(S){case"top":{const de=[E?ie+t/2:T?ie+t*4:ie-t*4,ge+t+1],$e=[E?ie-t/2:T?ie+t*4:ie-t*4,ge+t+1],Z=[[b.left,T||E?b.bottom-t:b.top],[b.right,T?E?b.bottom-t:b.top:b.bottom-t]];return[de,$e,...Z]}case"bottom":{const de=[E?ie+t/2:T?ie+t*4:ie-t*4,ge-t],$e=[E?ie-t/2:T?ie+t*4:ie-t*4,ge-t],Z=[[b.left,T||E?b.top+t:b.bottom],[b.right,T?E?b.top+t:b.bottom:b.top+t]];return[de,$e,...Z]}case"left":{const de=[ie+t+1,D?ge+t/2:F?ge+t*4:ge-t*4],$e=[ie+t+1,D?ge-t/2:F?ge+t*4:ge-t*4];return[...[[F||D?b.right-t:b.left,b.top],[F?D?b.right-t:b.left:b.right-t,b.bottom]],de,$e]}case"right":{const de=[ie-t,D?ge+t/2:F?ge+t*4:ge-t*4],$e=[ie-t,D?ge-t/2:F?ge+t*4:ge-t*4],Z=[[F||D?b.left+t:b.right,b.top],[F?D?b.left+t:b.right:b.left+t,b.bottom]];return[de,$e,...Z]}}}if(!Ps([A,N],U)){if(i&&!y)return z();if(!k&&o){const ce=u(I.clientX,I.clientY);if(ce!==null&&ce<.1)return z()}Ps([A,N],pe([f,c]))?!i&&o&&(r.current=window.setTimeout(z,40)):z()}}};return _.__options={blockPointerEvents:n},_}function vt(e,t,n){let o=n.initialDeps??[],r;function i(){var a,l,d,u;let _;n.key&&((a=n.debug)!=null&&a.call(n))&&(_=Date.now());const g=e();if(!(g.length!==o.length||g.some((h,p)=>o[p]!==h)))return r;o=g;let c;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(c=Date.now()),r=t(...g),n.key&&((d=n.debug)!=null&&d.call(n))){const h=Math.round((Date.now()-_)*100)/100,p=Math.round((Date.now()-c)*100)/100,v=p/16,w=(C,x)=>{for(C=String(C);C.length<x;)C=" "+C;return C};console.info(`%c⏱ ${w(p,5)} /${w(h,5)} ms`,`
658
5
  font-size: .6rem;
659
6
  font-weight: bold;
660
- color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n?.key)}return(d=n?.onChange)==null||d.call(n,r),r}return s.updateDeps=i=>{o=i},s}function ul(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Yg=(e,t)=>Math.abs(e-t)<1.01,Zg=(e,t,n)=>{let o;return function(...r){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,r),n)}},fl=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Jg=e=>e,Qg=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let r=t;r<=n;r++)o.push(r);return o},eh=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;const r=i=>{const{width:l,height:c}=i;t({width:Math.round(l),height:Math.round(c)})};if(r(fl(n)),!o.ResizeObserver)return()=>{};const s=new o.ResizeObserver(i=>{const l=()=>{const c=i[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){r({width:d.inlineSize,height:d.blockSize});return}}r(fl(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},_l={passive:!0},gl=typeof window>"u"?!0:"onscrollend"in window,th=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;let r=0;const s=e.options.useScrollendEvent&&gl?()=>{}:Zg(o,()=>{t(r,!1)},e.options.isScrollingResetDelay),i=_=>()=>{const{horizontal:g,isRtl:f}=e.options;r=g?n.scrollLeft*(f&&-1||1):n.scrollTop,s(),t(r,_)},l=i(!0),c=i(!1);c(),n.addEventListener("scroll",l,_l);const d=e.options.useScrollendEvent&&gl;return d&&n.addEventListener("scrollend",c,_l),()=>{n.removeEventListener("scroll",l),d&&n.removeEventListener("scrollend",c)}},nh=(e,t,n)=>{if(t?.borderBoxSize){const o=t.borderBoxSize[0];if(o)return Math.round(o[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},oh=(e,{adjustments:t=0,behavior:n},o)=>{var r,s;const i=e+t;(s=(r=o.scrollElement)==null?void 0:r.scrollTo)==null||s.call(r,{[o.options.horizontal?"left":"top"]:i,behavior:n})};class rh{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const o=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(s=>{const i=()=>{this._measureElement(s.target,s)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var r;(r=o())==null||r.disconnect(),n=null},observe:r=>{var s;return(s=o())==null?void 0:s.observe(r,{box:"border-box"})},unobserve:r=>{var s;return(s=o())==null?void 0:s.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([o,r])=>{typeof r>"u"&&delete n[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Jg,rangeExtractor:Qg,onChange:()=>{},measureElement:nh,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var o,r;(r=(o=this.options).onChange)==null||r.call(o,this,n)},this.maybeNotify=En(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=s,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,o)=>{const r=new Map,s=new Map;for(let i=o-1;i>=0;i--){const l=n[i];if(r.has(l.lane))continue;const c=s.get(l.lane);if(c==null||l.end>c.end?s.set(l.lane,l):l.end<c.end&&r.set(l.lane,!0),r.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((i,l)=>i.end===l.end?i.index-l.index:i.end-l.end)[0]:void 0},this.getMeasurementOptions=En(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,o,r,s,i)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:o,scrollMargin:r,getItemKey:s,enabled:i}),{key:!1}),this.getMeasurements=En(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:o,scrollMargin:r,getItemKey:s,enabled:i},l)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(_=>{this.itemSizeCache.set(_.key,_.size)}));const c=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const d=this.measurementsCache.slice(0,c);for(let _=c;_<n;_++){const g=s(_),f=this.options.lanes===1?d[_-1]:this.getFurthestMeasurement(d,_),u=f?f.end+this.options.gap:o+r,p=l.get(g),h=typeof p=="number"?p:this.options.estimateSize(_),m=u+h,y=f?f.lane:_%this.options.lanes;d[_]={index:_,start:u,size:h,end:m,key:g,lane:y}}return this.measurementsCache=d,d},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=En(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,o,r,s)=>this.range=n.length>0&&o>0?sh({measurements:n,outerSize:o,scrollOffset:r,lanes:s}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=En(()=>{let n=null,o=null;const r=this.calculateRange();return r&&(n=r.startIndex,o=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,o]},(n,o,r,s,i)=>s===null||i===null?[]:n({startIndex:s,endIndex:i,overscan:o,count:r}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const o=this.options.indexAttribute,r=n.getAttribute(o);return r?parseInt(r,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(n,o)=>{const r=this.indexFromElement(n),s=this.measurementsCache[r];if(!s)return;const i=s.key,l=this.elementsCache.get(i);l!==n&&(l&&this.observer.unobserve(l),this.observer.observe(n),this.elementsCache.set(i,n)),n.isConnected&&this.resizeItem(r,this.options.measureElement(n,o,this))},this.resizeItem=(n,o)=>{const r=this.measurementsCache[n];if(!r)return;const s=this.itemSizeCache.get(r.key)??r.size,i=o-s;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,i,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,o)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((o,r)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(r))});return}this._measureElement(n,void 0)},this.getVirtualItems=En(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,o)=>{const r=[];for(let s=0,i=n.length;s<i;s++){const l=n[s],c=o[l];r.push(c)}return r},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const o=this.getMeasurements();if(o.length!==0)return ul(o[hl(0,o.length-1,r=>ul(o[r]).start,n)])},this.getOffsetForAlignment=(n,o,r=0)=>{const s=this.getSize(),i=this.getScrollOffset();o==="auto"&&(o=n>=i+s?"end":"start"),o==="center"?n+=(r-s)/2:o==="end"&&(n-=s);const l=this.getTotalSize()+this.options.scrollMargin-s;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,o="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.measurementsCache[n];if(!r)return;const s=this.getSize(),i=this.getScrollOffset();if(o==="auto")if(r.end>=i+s-this.options.scrollPaddingEnd)o="end";else if(r.start<=i+this.options.scrollPaddingStart)o="start";else return[i,o];const l=o==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,o,r.size),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:o="start",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,o),{adjustments:void 0,behavior:r})},this.scrollToIndex=(n,{align:o="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let s=0;const i=10,l=d=>{if(!this.targetWindow)return;const _=this.getOffsetForIndex(n,d);if(!_){console.warn("Failed to get offset for index:",n);return}const[g,f]=_;this._scrollToOffset(g,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const u=this.getScrollOffset(),p=this.getOffsetForIndex(n,f);if(!p){console.warn("Failed to get offset for index:",n);return}Yg(p[0],u)||c(f)})},c=d=>{this.targetWindow&&(s++,s<i?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",s,i),this.targetWindow.requestAnimationFrame(()=>l(d))):console.warn(`Failed to scroll to index ${n} after ${i} attempts.`))};l(o)},this.scrollBy=(n,{behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var n;const o=this.getMeasurements();let r;if(o.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((n=o[o.length-1])==null?void 0:n.end)??0;else{const s=Array(this.options.lanes).fill(null);let i=o.length-1;for(;i>=0&&s.some(l=>l===null);){const l=o[i];s[l.lane]===null&&(s[l.lane]=l.end),i--}r=Math.max(...s.filter(l=>l!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:o,behavior:r})=>{this.options.scrollToFn(n,{behavior:r,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const hl=(e,t,n,o)=>{for(;e<=t;){const r=(e+t)/2|0,s=n(r);if(s<o)e=r+1;else if(s>o)t=r-1;else return r}return e>0?e-1:0};function sh({measurements:e,outerSize:t,scrollOffset:n,lanes:o}){const r=e.length-1,s=c=>e[c].start;if(e.length<=o)return{startIndex:0,endIndex:r};let i=hl(0,r,s,n),l=i;if(o===1)for(;l<r&&e[l].end<n+t;)l++;else if(o>1){const c=Array(o).fill(0);for(;l<r&&c.some(_=>_<n+t);){const _=e[l];c[_.lane]=_.end,l++}const d=Array(o).fill(n+t);for(;i>=0&&d.some(_=>_>=n);){const _=e[i];d[_.lane]=_.start,i--}i=Math.max(0,i-i%o),l=Math.min(r,l+(o-1-l%o))}return{startIndex:i,endIndex:l}}const pl=typeof document<"u"?N.useLayoutEffect:N.useEffect;function ih(e){const t=N.useReducer(()=>({}),{})[1],n={...e,onChange:(r,s)=>{var i;s?Dn.flushSync(t):t(),(i=e.onChange)==null||i.call(e,r,s)}},[o]=N.useState(()=>new rh(n));return o.setOptions(n),pl(()=>o._didMount(),[]),pl(()=>o._willUpdate()),o}function ah(e){return ih({observeElementRect:eh,observeElementOffset:th,scrollToFn:oh,...e})}function lh(e,t){const[n,o]=N.useState(e);return N.useEffect(()=>{const r=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(r)}},[e,t]),n}function Qo(e){const t=N.useCallback(r=>{const s=window.matchMedia(e);return s.addEventListener("change",r),()=>{s.removeEventListener("change",r)}},[e]),n=()=>window.matchMedia(e).matches,o=()=>{throw Error("useMediaQuery is a client-only hook")};return N.useSyncExternalStore(t,n,o)}function _s(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function Yn(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function er(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function ml(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function vl(e,t,n,o){if(!t.trim())return e;const r=ml(t.trim());return o?e.filter(s=>o(s,t)):e.filter(s=>ml(_s(s,n)).includes(r))}function ch(e){if(e.length===0)return!1;const t=e[0];return typeof t=="object"&&t!==null&&"grupo"in t&&"opciones"in t&&Array.isArray(t.opciones)}function dh(e){const t=[];let n=0;for(const o of e){t.push({tipo:"grupo",datos:null,nombreGrupo:o.grupo,indice:n++});for(const r of o.opciones)t.push({tipo:"opcion",datos:r,indice:n++})}return t}function uh(e,t,n,o){return t.trim()?e.map(r=>({...r,opciones:vl(r.opciones,t,n,o)})).filter(r=>r.opciones.length>0):e}function fh(e){return e.map((t,n)=>t.tipo==="grupo"||t.datos&&er(t.datos)?n:null).filter(t=>t!==null)}function _h(e,t){if(!t)return null;const n=t(e);return n===!0||n==null?null:typeof n=="string"?n:typeof n=="object"&&"message"in n?n.message??"Selección inválida":"Selección inválida"}function gh(e,t,n){return e!==void 0?e:t==="invalid"?!0:t==="valid"?!1:!!n}function hh(e,t="Opción"){return Array.from({length:e},(n,o)=>`${t} ${o+1}`)}function ph(e){return Array.from({length:e},(t,n)=>({id:`usr-${n+1}`,nombre:`Usuario ${n+1}`,email:`usuario${n+1}@test.com`}))}const bl=({size:e="1em",...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:a.jsx("path",{d:"m6 9 6 6 6-6"})}),wl=({size:e="1em",...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("path",{d:"M18 6 6 18"}),a.jsx("path",{d:"m6 6 12 12"})]}),mh=({size:e="1em",...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:a.jsx("path",{d:"M20 6 9 17l-5-5"})});function vh(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.5 18a8.5 8.5 0 1 0 0-17a8.5 8.5 0 0 0 0 17m0-3a5.5 5.5 0 1 0 0-11a5.5 5.5 0 0 0 0 11m4.205 3l3.032 5h3.51l-3.034-5z",clipRule:"evenodd"})})}const bh=({size:e="1em",...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:a.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),Z={contenedor_base:"_contenedor_base_kbtyg_1",tam_sm:"_tam_sm_kbtyg_41",tam_lg:"_tam_lg_kbtyg_55",radio_none:"_radio_none_kbtyg_69",radio_sm:"_radio_sm_kbtyg_77",radio_md:"_radio_md_kbtyg_85",radio_lg:"_radio_lg_kbtyg_93",radio_full:"_radio_full_kbtyg_101",color_default:"_color_default_kbtyg_109",color_primary:"_color_primary_kbtyg_111",color_secondary:"_color_secondary_kbtyg_119",color_success:"_color_success_kbtyg_127",color_warning:"_color_warning_kbtyg_135",color_danger:"_color_danger_kbtyg_143",etiqueta:"_etiqueta_kbtyg_151",marca_requerido:"_marca_requerido_kbtyg_167",trigger:"_trigger_kbtyg_177",trigger_expandido:"_trigger_expandido_kbtyg_213",variante_bordered:"_variante_bordered_kbtyg_223",variante_faded:"_variante_faded_kbtyg_233",variante_underlined:"_variante_underlined_kbtyg_243",variante_ghost:"_variante_ghost_kbtyg_259",deshabilitado:"_deshabilitado_kbtyg_271",solo_lectura:"_solo_lectura_kbtyg_291",valor_texto:"_valor_texto_kbtyg_307",abierto:"_abierto_kbtyg_335",valido:"_valido_kbtyg_343",invalido:"_invalido_kbtyg_351",contenido_inicio:"_contenido_inicio_kbtyg_403",contenido_final:"_contenido_final_kbtyg_405",valor_wrapper:"_valor_wrapper_kbtyg_423",mostrar_todos:"_mostrar_todos_kbtyg_443",valor_wrapper_expandido:"_valor_wrapper_expandido_kbtyg_453",placeholder:"_placeholder_kbtyg_469",chip_multi:"_chip_multi_kbtyg_479",chip_texto:"_chip_texto_kbtyg_513",chip_cerrar:"_chip_cerrar_kbtyg_525",contador_multi:"_contador_multi_kbtyg_565",acciones:"_acciones_kbtyg_579",boton_limpiar:"_boton_limpiar_kbtyg_593",tiene_valor:"_tiene_valor_kbtyg_645",icono_chevron:"_icono_chevron_kbtyg_655",icono_spinner:"_icono_spinner_kbtyg_677",girarSpinner:"_girarSpinner_kbtyg_1",menu:"_menu_kbtyg_711",buscador_wrapper:"_buscador_wrapper_kbtyg_739",buscador_interno:"_buscador_interno_kbtyg_753",icono_buscar:"_icono_buscar_kbtyg_801",input_busqueda:"_input_busqueda_kbtyg_823",lista_opciones:"_lista_opciones_kbtyg_871",lista_virtual:"_lista_virtual_kbtyg_903",contenedor_virtual:"_contenedor_virtual_kbtyg_919",encabezado_grupo:"_encabezado_grupo_kbtyg_927",opcion:"_opcion_kbtyg_959",opcion_virtual:"_opcion_virtual_kbtyg_985",activo:"_activo_kbtyg_993",seleccionado:"_seleccionado_kbtyg_1003",opcion_check:"_opcion_check_kbtyg_1037",opcion_contenido:"_opcion_contenido_kbtyg_1065",sin_resultados:"_sin_resultados_kbtyg_1081",descripcion:"_descripcion_kbtyg_1105",mensaje_error:"_mensaje_error_kbtyg_1117",ancho_total:"_ancho_total_kbtyg_1129",sin_animacion:"_sin_animacion_kbtyg_1137",contenedor_nativo:"_contenedor_nativo_kbtyg_1147",select_nativo:"_select_nativo_kbtyg_1155",input_validacion:"_input_validacion_kbtyg_1183"};function wh(e){const{options:t=[],value:n,onChange:o,onValueChange:r,optionLabelKey:s="label",optionValueKey:i="id",label:l,placeholder:c="Seleccione una opción",description:d,errorMessage:_,isRequired:g=!1,isInvalid:f,id:u,name:p,classNames:h,startContent:m,endContent:y,esInvalido:w,estaDeshabilitadoReal:C,clasesBase:k,renderizarValorMostrado:A}=e,T=v.useId(),M=u??`select-nativo-${T}`,P=d?`${M}-desc`:void 0,L=w?`${M}-err`:void 0,E=v.useCallback(O=>_s(O,s),[s]),B=v.useCallback(O=>Yn(O,i),[i]),V=v.useCallback(O=>{o?.(O),r?.(O)},[o,r]),$=v.useCallback(O=>{const D=O.target.value;if(!D){V(null);return}const x=t.find(I=>B(I)===D);x&&V(x)},[t,B,V]),b=typeof f=="string"?f:null,S=typeof _=="function"?_({invalido:w,mensaje:b}):_??b;return a.jsxs("div",{className:k,children:[l&&a.jsxs("label",{className:W(Z.etiqueta,h?.label),htmlFor:M,children:[l,g&&a.jsx("span",{className:Z.marca_requerido,children:"*"})]}),a.jsxs("div",{className:Z.contenedor_nativo,children:[a.jsxs("div",{className:W(Z.trigger,h?.trigger),children:[m&&a.jsx("span",{className:Z.contenido_inicio,children:m}),a.jsx("div",{className:W(Z.valor_wrapper,h?.value),children:A()}),a.jsxs("div",{className:Z.acciones,children:[y&&a.jsx("span",{className:Z.contenido_final,children:y}),a.jsx("span",{className:Z.icono_chevron,children:a.jsx(bl,{size:"1em"})})]})]}),a.jsxs("select",{id:M,name:p,className:Z.select_nativo,value:n?B(n):"",onChange:$,disabled:C,required:g,children:[a.jsx("option",{value:"",children:c}),t.map(O=>a.jsx("option",{value:B(O),disabled:er(O),children:E(O)},B(O)))]})]}),d&&!w&&a.jsx("div",{id:P,className:W(Z.descripcion,h?.description),children:d}),w&&S&&a.jsx("div",{id:L,className:W(Z.mensaje_error,h?.errorMessage),children:S})]})}const yh="(max-width: 768px)",Ch=40,xh=480,gs=100,Sh=200,$h=5;function kh(e,t){const{options:n=[],value:o,defaultValue:r,onChange:s,onValueChange:i,optionLabelKey:l="label",optionValueKey:c="id",renderOption:d,renderValue:_,variant:g="bordered",color:f="default",size:u="md",radius:p="md",fullWidth:h=!0,disableAnimation:m=!1,label:y,placeholder:w="",description:C,errorMessage:k,emptyMessage:A="No hay opciones",noResultsMessage:T="Sin resultados",isRequired:M=!1,isDisabled:P=!1,isReadOnly:L=!1,isLoading:E=!1,isClearable:B=!0,isInvalid:V,validationState:$,isMultiple:b=!1,mostrarTodos:S=!1,isSearchable:O,isVirtualized:D=!1,estimatedOptionHeight:x=Ch,filterFn:I,validate:F,onOpen:j,onClose:z,onSearchChange:H,onClear:X,onFocus:G,onBlur:ue,id:oe,name:ie,className:_e,classNames:ge,style:ke,startContent:J,endContent:re,menuZIndex:Y,portalContainer:ye}=e,ce=v.useRef(null),ee=v.useRef([]),ne=v.useRef(null),xe=v.useRef(null),de=v.useId(),Se=oe??`select-${de}`,U=Qo(yh),q=O!==!1&&n.length>4,R=U&&!b,[fe,he]=v.useState(!1),[pe,Ue]=v.useState(null),[Je,nt]=v.useState(""),ve=o!==void 0,[Ze,ot]=v.useState(r??null),be=ve?o:Ze,Ce=P||E,Re=v.useCallback(K=>_s(K,l),[l]),Ae=v.useCallback(K=>Yn(K,c),[c]),rt=v.useMemo(()=>{const K=new Set;if(!be)return K;try{if(b&&Array.isArray(be))for(const De of be)K.add(Yn(De,c));else be&&K.add(Yn(be,c))}catch{}return K},[be,b,c]),te=v.useCallback(K=>{try{return rt.has(Yn(K,c))}catch{return!1}},[rt,c]),Ee=v.useMemo(()=>ch(n),[n]),ze=v.useMemo(()=>{if(!q||!Je.trim())return n;try{return Ee?uh(n,Je,l,I):vl(n,Je,l,I)}catch{return n}},[n,Je,q,I,l,Ee]),Oe=v.useMemo(()=>Ee?dh(ze):ze.map((K,De)=>({tipo:"opcion",datos:K,indice:De})),[ze,Ee]),pt=v.useMemo(()=>_h(be,F),[be,F]),wt=v.useMemo(()=>gh(V,$,pt),[V,$,pt]),mt=$==="valid"&&!wt,{refs:Pt,floatingStyles:me,context:we,placement:vt}=Go({open:fe,onOpenChange:K=>{Ce||L||(he(K),K?(j?.(),nt(""),Ue(null)):z?.())},strategy:"fixed",transform:!1,placement:"bottom-start",middleware:[Lo(4),zo({padding:8}),Oo({padding:8}),Aa({apply({availableHeight:K,rects:De,elements:Et}){const dt=Math.max(Math.min(K,xh),150);Object.assign(Et.floating.style,{width:`${De.reference.width}px`,maxHeight:`${dt}px`,display:"flex",flexDirection:"column"})},padding:8})],whileElementsMounted:To}),yt=vt.startsWith("top"),{isMounted:Mn,styles:oo}=Jo(we,{duration:m||Oe.length>Sh?0:200,initial:{opacity:0,transform:yt?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},open:{opacity:1,transform:"translateY(0) scale(1)"},close:{opacity:0,transform:yt?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},common:{transformOrigin:yt?"bottom":"top"}}),An=ah({count:Oe.length,getScrollElement:()=>ne.current,estimateSize:()=>x,overscan:$h,enabled:D&&fe&&Oe.length>gs}),ro=nl(we,{enabled:!Ce&&!L}),ar=Wo(we),lr=Zo(we,{role:"listbox"}),vm=v.useMemo(()=>{try{return fh(Oe)}catch{return[]}},[Oe]),bm=fs(we,{listRef:ee,activeIndex:pe,onNavigate:Ue,loop:!0,virtual:D,disabledIndices:vm,focusItemOnHover:!1}),uc=v.useRef([]);v.useEffect(()=>{uc.current=Oe.map(K=>K.tipo==="opcion"&&K.datos?Re(K.datos):null)},[Oe,Re]);const wm=al(we,{listRef:uc,activeIndex:pe,onMatch:fe?Ue:void 0,enabled:!q}),{getReferenceProps:ym,getFloatingProps:Cm,getItemProps:fc}=Ko([ro,ar,lr,bm,wm]),on=v.useCallback(K=>{ve||ot(K),s?.(K),i?.(K)},[ve,s,i]),cr=v.useCallback(K=>{if(!er(K))if(b){const De=Array.isArray(be)?be:[],Et=De.some(dt=>Ae(dt)===Ae(K));on(Et?De.filter(dt=>Ae(dt)!==Ae(K)):[...De,K])}else on(K),he(!1)},[b,be,Ae,on]),xm=v.useCallback(K=>{K.stopPropagation(),on(b?[]:null),X?.(),ce.current?.focus()},[b,on,X]),_c=v.useCallback((K,De)=>{De.stopPropagation(),!(!b||!Array.isArray(be))&&on(be.filter(Et=>Ae(Et)!==Ae(K)))},[b,be,Ae,on]),Sm=v.useCallback(K=>{const De=K.target.value;nt(De),H?.(De),Ue(0)},[H]),$m=v.useCallback(K=>{if(K.key==="Enter"&&pe!==null){K.preventDefault();const De=Oe[pe];De?.tipo==="opcion"&&De.datos&&cr(De.datos)}},[pe,Oe,cr]);v.useEffect(()=>{fe&&q&&requestAnimationFrame(()=>{xe.current?.focus({preventScroll:!0})})},[fe,q]),v.useEffect(()=>()=>{ee.current=[]},[Oe.length]),v.useImperativeHandle(t,()=>({focus:()=>ce.current?.focus(),blur:()=>ce.current?.blur(),open:()=>he(!0),close:()=>he(!1),clear:()=>on(b?[]:null)}));const so=b?Array.isArray(be)&&be.length>0:be!=null&&be!=="",gc=v.useCallback(()=>{if(_)return _(be??null);if(!so)return a.jsx("span",{className:Z.placeholder,children:w});if(b&&Array.isArray(be)){if(be.length===0)return a.jsx("span",{className:Z.placeholder,children:w});const K=S?be:be.slice(0,2),De=S?0:Math.max(0,be.length-2);return a.jsxs(a.Fragment,{children:[K.map(Et=>a.jsxs("span",{className:Z.chip_multi,children:[a.jsx("span",{className:Z.chip_texto,children:Re(Et)}),!L&&!Ce&&a.jsx("button",{type:"button",className:Z.chip_cerrar,onClick:dt=>_c(Et,dt),children:a.jsx(wl,{size:"1em"})})]},Ae(Et))),De>0&&a.jsxs("span",{className:Z.contador_multi,children:["+",De]})]})}return a.jsx("span",{className:Z.valor_texto,children:Re(be)})},[_,be,so,w,b,S,L,Ce,Ae,Re,_c]),hc=v.useCallback((K,De,Et)=>{try{if(K.tipo==="grupo")return a.jsx("li",{className:W(Z.encabezado_grupo,D&&Z.opcion_virtual),style:Et,children:K.nombreGrupo},`grupo-${K.nombreGrupo}`);const dt=K.datos;if(!dt)return null;const vc=te(dt),bc=pe===De,km=er(dt),Em=d?d(dt,{isSelected:vc,isActive:bc}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:Z.opcion_check,children:a.jsx(mh,{size:"1em"})}),a.jsx("span",{className:Z.opcion_contenido,children:Re(dt)})]}),Im=Ae(dt);return a.jsx("li",{ref:Nm=>{ee.current[De]=Nm},className:W(Z.opcion,D&&Z.opcion_virtual,{[Z.activo]:bc,[Z.seleccionado]:vc,[Z.deshabilitado]:km},ge?.option),style:Et,...fc({onClick:()=>cr(dt)}),children:Em},Im)}catch(dt){return console.error("Error rendering select item:",dt),null}},[D,pe,te,d,Re,Ae,ge?.option,fc,cr]),pc=typeof k=="function"?k({invalido:wt,mensaje:pt}):k??pt,mc=W(Z.contenedor_base,Z[`variante_${g}`],Z[`tam_${u}`],Z[`radio_${p}`],Z[`color_${f}`],{[Z.ancho_total]:h,[Z.sin_animacion]:m,[Z.deshabilitado]:Ce,[Z.solo_lectura]:L,[Z.invalido]:wt,[Z.valido]:mt,[Z.abierto]:fe,[Z.tiene_valor]:so},ge?.base,_e);return R&&!Ee?a.jsx(wh,{...e,esInvalido:wt,estaDeshabilitadoReal:Ce,clasesBase:mc,renderizarValorMostrado:gc}):a.jsxs("div",{className:mc,style:ke,children:[y&&a.jsxs("label",{id:`${Se}-label`,className:W(Z.etiqueta,ge?.label),children:[y,M&&a.jsx("span",{className:Z.marca_requerido,children:"*"})]}),a.jsxs("div",{ref:K=>{Pt.setReference(K),ce.current=K},id:Se,tabIndex:Ce?-1:0,className:W(Z.trigger,S&&b&&Z.trigger_expandido,ge?.trigger),"aria-labelledby":y?`${Se}-label`:void 0,onFocus:G,onBlur:ue,...ym(),children:[J&&a.jsx("span",{className:Z.contenido_inicio,children:J}),a.jsx("div",{className:W(Z.valor_wrapper,S&&b&&Z.mostrar_todos,S&&b&&Z.valor_wrapper_expandido,ge?.value),children:gc()}),a.jsxs("div",{className:Z.acciones,children:[B&&so&&!L&&!Ce&&a.jsx("button",{type:"button",className:W(Z.boton_limpiar,ge?.clearButton),onClick:xm,tabIndex:-1,children:a.jsx(wl,{size:"1em"})}),re&&a.jsx("span",{className:Z.contenido_final,children:re}),E?a.jsx("span",{className:Z.icono_spinner,children:a.jsx(bh,{size:"1em"})}):a.jsx("span",{className:Z.icono_chevron,children:a.jsx(bl,{size:"1em"})})]})]}),(ie||M)&&a.jsxs("select",{"aria-hidden":!0,tabIndex:-1,name:ie,required:M,value:b&&Array.isArray(be)?be.map(K=>String(Ae(K))):be?String(Ae(be)):b?[]:"",onChange:()=>{},onFocus:K=>K.target.blur(),className:Z.input_validacion,multiple:b,"data-testid":`select-native-${Se}`,children:[!b&&(B||!so)&&a.jsxs("option",{value:"",children:["— ",w||"Seleccionar"]}),Oe.map(K=>K.datos!==null&&a.jsx("option",{value:String(Ae(K.datos)),children:Re(K.datos)},`opcion-${Ae(K.datos)}`))]}),Mn&&a.jsx(Uo,{root:ye,children:a.jsx(ls,{context:we,modal:!1,initialFocus:q?xe:-1,children:a.jsxs("div",{ref:Pt.setFloating,style:{...me,...oo,zIndex:Y??"var(--z-popover)"},className:W(Z.menu,ge?.menu),...Cm(),children:[q&&a.jsx("div",{className:Z.buscador_wrapper,children:a.jsxs("div",{className:Z.buscador_interno,children:[a.jsx("span",{className:Z.icono_buscar,children:a.jsx(vh,{})}),a.jsx("input",{ref:xe,type:"text",className:W(Z.input_busqueda,ge?.searchInput),placeholder:"Buscar...",value:Je,onChange:Sm,onKeyDown:$m})]})}),a.jsx("ul",{ref:ne,className:W(Z.lista_opciones,D&&Z.lista_virtual),style:{flex:1,maxHeight:"100%",overflowY:"auto",position:D&&Oe.length>gs?"relative":void 0},children:Oe.length===0?a.jsx("li",{className:Z.sin_resultados,children:Je?T:A}):D&&Oe.length>gs?a.jsx(a.Fragment,{children:a.jsx("div",{style:{height:`${An.getTotalSize()}px`,position:"relative",width:"100%"},children:An.getVirtualItems().map(K=>{const De=Oe[K.index];return De?a.jsx("div",{style:{position:"absolute",top:0,left:"var(--gaps-1)",right:"var(--gaps-1)",width:"auto",height:`${Math.max(K.size-2,1)}px`,transform:`translateY(${K.start+1}px)`},children:hc(De,K.index)},`virtual-${K.index}`):null})})}):Oe.map((K,De)=>hc(K,De))})]})})}),C&&!wt&&a.jsx("div",{className:W(Z.descripcion,ge?.description),children:C}),wt&&pc&&a.jsx("div",{className:W(Z.mensaje_error,ge?.errorMessage),children:pc})]})}const Eh=v.forwardRef(kh),yl=v.memo(Eh);yl.displayName="SelectBase";function Ih(e,t){const{options:n=[],value:o,onChange:r,onValueChange:s,optionValueKey:i,optionLabelKey:l="label",isMultiple:c=!1,devolverObjeto:d=!1,..._}=e,g=v.useMemo(()=>n.length>0&&typeof n[0]=="object",[n]),f=v.useMemo(()=>{if(!g||!i)return null;const h=new Map;for(const m of n)h.set(String(m[i]),m);return h},[n,i,g]),u=v.useMemo(()=>{if(o==null||!g||d)return o;const h=m=>f?.get(String(m));return c&&Array.isArray(o)?o.map(h).filter(m=>m!==void 0):h(o)??null},[o,f,c,d,g]),p=v.useCallback(h=>{const m=r||s;if(!m)return;if(h===null){m(c?[]:d||!g?null:"");return}if(d||!g){m(h);return}const y=w=>typeof w=="string"?w:w[i];m(c&&Array.isArray(h)?h.map(y):y(h))},[r,s,d,c,i,g]);return a.jsx(yl,{..._,ref:t,options:n,value:u,onChange:p,optionValueKey:i,optionLabelKey:l,isMultiple:c})}const Cl=v.forwardRef(Ih);Cl.displayName="Select";const Zn={tooltip:"_tooltip_myw27_1",tooltip_positioner:"_tooltip_positioner_myw27_53",enterAnimation:"_enterAnimation_myw27_1",exitAnimation:"_exitAnimation_myw27_1",arrow:"_arrow_myw27_81",size_sm:"_size_sm_myw27_91",size_md:"_size_md_myw27_101",size_lg:"_size_lg_myw27_111",variant_default:"_variant_default_myw27_121",variant_dark:"_variant_dark_myw27_141",variant_light:"_variant_light_myw27_153",variant_brand:"_variant_brand_myw27_165",variant_success:"_variant_success_myw27_181",variant_warning:"_variant_warning_myw27_193",variant_danger:"_variant_danger_myw27_205",variant_info:"_variant_info_myw27_217",fadeOnly:"_fadeOnly_myw27_1"};function gn({content:e,children:t,placement:n="top",variant:o="default",size:r="md",offset:s=8,delayShow:i=100,delayHide:l=0,isDisabled:c=!1,showArrow:d=!1,maxWidth:_="320px",isInteractive:g=!1,className:f="",onOpen:u,onClose:p,isOpen:h,onOpenChange:m}){const[y,w]=v.useState(!1),C=v.useRef(null),k=h!==void 0?h:y,A=v.useCallback(F=>{c||(m?m(F):w(F),F?u?.():p?.())},[c,m,u,p]),{refs:T,floatingStyles:M,context:P,isPositioned:L}=Go({open:k,onOpenChange:A,placement:n,strategy:"fixed",middleware:[Lo(s+(d?8:0)),zo({fallbackAxisSideDirection:"start",padding:8}),Oo({padding:8}),d?Cg({element:C}):void 0].filter(Boolean),whileElementsMounted:To}),E=rs(P,{delay:{open:i,close:g?200:l||100},enabled:!c,move:!1,handleClose:null}),B=Rg(P,{enabled:!c}),V=Wo(P,{enabled:!c}),$=Zo(P,{role:"tooltip"}),{getReferenceProps:b,getFloatingProps:S}=Ko([E,B,V,$]),{isMounted:O,styles:D}=Jo(P,{duration:{open:250,close:150},initial:{opacity:0,transform:"scale(0.95)"},open:{opacity:1,transform:"scale(1)"},close:{opacity:0,transform:"scale(0.95)"},common:{transitionTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)"}}),x=v.useMemo(()=>[Zn.tooltip,Zn[`size_${r}`],Zn[`variant_${o}`],f].filter(Boolean).join(" "),[r,o,f]),I=v.useMemo(()=>v.cloneElement(t,b({ref:T.setReference,...t.props})),[t,b,T.setReference]);return!e||c?t:a.jsxs(a.Fragment,{children:[I,O&&a.jsx(Uo,{children:a.jsx("div",{ref:T.setFloating,className:Zn.tooltip_positioner,style:{...M,maxWidth:_,zIndex:9999,pointerEvents:"none"},children:a.jsxs("div",{className:x,style:{...D,pointerEvents:g?"auto":"none",visibility:L||!k?"visible":"hidden"},...S(),children:[e,d&&a.jsx(Ig,{ref:C,context:P,className:Zn.arrow})]})})})]})}/**
7
+ color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n?.key)}return(u=n?.onChange)==null||u.call(n,r),r}return i.updateDeps=a=>{o=a},i}function Os(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const $d=(e,t)=>Math.abs(e-t)<1.01,kd=(e,t,n)=>{let o;return function(...r){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,r),n)}},Vs=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Id=e=>e,Ed=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let r=t;r<=n;r++)o.push(r);return o},Md=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;const r=a=>{const{width:l,height:d}=a;t({width:Math.round(l),height:Math.round(d)})};if(r(Vs(n)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver(a=>{const l=()=>{const d=a[0];if(d?.borderBoxSize){const u=d.borderBoxSize[0];if(u){r({width:u.inlineSize,height:u.blockSize});return}}r(Vs(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},js={passive:!0},qs=typeof window>"u"?!0:"onscrollend"in window,Nd=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;let r=0;const i=e.options.useScrollendEvent&&qs?()=>{}:kd(o,()=>{t(r,!1)},e.options.isScrollingResetDelay),a=_=>()=>{const{horizontal:g,isRtl:f}=e.options;r=g?n.scrollLeft*(f&&-1||1):n.scrollTop,i(),t(r,_)},l=a(!0),d=a(!1);d(),n.addEventListener("scroll",l,js);const u=e.options.useScrollendEvent&&qs;return u&&n.addEventListener("scrollend",d,js),()=>{n.removeEventListener("scroll",l),u&&n.removeEventListener("scrollend",d)}},Fd=(e,t,n)=>{if(t?.borderBoxSize){const o=t.borderBoxSize[0];if(o)return Math.round(o[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},zd=(e,{adjustments:t=0,behavior:n},o)=>{var r,i;const a=e+t;(i=(r=o.scrollElement)==null?void 0:r.scrollTo)==null||i.call(r,{[o.options.horizontal?"left":"top"]:a,behavior:n})};class Dd{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const o=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(i=>{const a=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var r;(r=o())==null||r.disconnect(),n=null},observe:r=>{var i;return(i=o())==null?void 0:i.observe(r,{box:"border-box"})},unobserve:r=>{var i;return(i=o())==null?void 0:i.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([o,r])=>{typeof r>"u"&&delete n[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Id,rangeExtractor:Ed,onChange:()=>{},measureElement:Fd,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var o,r;(r=(o=this.options).onChange)==null||r.call(o,this,n)},this.maybeNotify=vt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,o)=>{const r=new Map,i=new Map;for(let a=o-1;a>=0;a--){const l=n[a];if(r.has(l.lane))continue;const d=i.get(l.lane);if(d==null||l.end>d.end?i.set(l.lane,l):l.end<d.end&&r.set(l.lane,!0),r.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((a,l)=>a.end===l.end?a.index-l.index:a.end-l.end)[0]:void 0},this.getMeasurementOptions=vt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,o,r,i,a)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:a}),{key:!1}),this.getMeasurements=vt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:a},l)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(_=>{this.itemSizeCache.set(_.key,_.size)}));const d=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,d);for(let _=d;_<n;_++){const g=i(_),f=this.options.lanes===1?u[_-1]:this.getFurthestMeasurement(u,_),c=f?f.end+this.options.gap:o+r,h=l.get(g),p=typeof h=="number"?h:this.options.estimateSize(_),v=c+p,w=f?f.lane:_%this.options.lanes;u[_]={index:_,start:c,size:p,end:v,key:g,lane:w}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=vt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,o,r,i)=>this.range=n.length>0&&o>0?Ad({measurements:n,outerSize:o,scrollOffset:r,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=vt(()=>{let n=null,o=null;const r=this.calculateRange();return r&&(n=r.startIndex,o=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,o]},(n,o,r,i,a)=>i===null||a===null?[]:n({startIndex:i,endIndex:a,overscan:o,count:r}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const o=this.options.indexAttribute,r=n.getAttribute(o);return r?parseInt(r,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(n,o)=>{const r=this.indexFromElement(n),i=this.measurementsCache[r];if(!i)return;const a=i.key,l=this.elementsCache.get(a);l!==n&&(l&&this.observer.unobserve(l),this.observer.observe(n),this.elementsCache.set(a,n)),n.isConnected&&this.resizeItem(r,this.options.measureElement(n,o,this))},this.resizeItem=(n,o)=>{const r=this.measurementsCache[n];if(!r)return;const i=this.itemSizeCache.get(r.key)??r.size,a=o-i;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,a,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",a),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,o)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((o,r)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(r))});return}this._measureElement(n,void 0)},this.getVirtualItems=vt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,o)=>{const r=[];for(let i=0,a=n.length;i<a;i++){const l=n[i],d=o[l];r.push(d)}return r},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const o=this.getMeasurements();if(o.length!==0)return Os(o[Bs(0,o.length-1,r=>Os(o[r]).start,n)])},this.getOffsetForAlignment=(n,o,r=0)=>{const i=this.getSize(),a=this.getScrollOffset();o==="auto"&&(o=n>=a+i?"end":"start"),o==="center"?n+=(r-i)/2:o==="end"&&(n-=i);const l=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,o="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.measurementsCache[n];if(!r)return;const i=this.getSize(),a=this.getScrollOffset();if(o==="auto")if(r.end>=a+i-this.options.scrollPaddingEnd)o="end";else if(r.start<=a+this.options.scrollPaddingStart)o="start";else return[a,o];const l=o==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,o,r.size),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:o="start",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,o),{adjustments:void 0,behavior:r})},this.scrollToIndex=(n,{align:o="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let i=0;const a=10,l=u=>{if(!this.targetWindow)return;const _=this.getOffsetForIndex(n,u);if(!_){console.warn("Failed to get offset for index:",n);return}const[g,f]=_;this._scrollToOffset(g,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const c=this.getScrollOffset(),h=this.getOffsetForIndex(n,f);if(!h){console.warn("Failed to get offset for index:",n);return}$d(h[0],c)||d(f)})},d=u=>{this.targetWindow&&(i++,i<a?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,a),this.targetWindow.requestAnimationFrame(()=>l(u))):console.warn(`Failed to scroll to index ${n} after ${a} attempts.`))};l(o)},this.scrollBy=(n,{behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var n;const o=this.getMeasurements();let r;if(o.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((n=o[o.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let a=o.length-1;for(;a>=0&&i.some(l=>l===null);){const l=o[a];i[l.lane]===null&&(i[l.lane]=l.end),a--}r=Math.max(...i.filter(l=>l!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:o,behavior:r})=>{this.options.scrollToFn(n,{behavior:r,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const Bs=(e,t,n,o)=>{for(;e<=t;){const r=(e+t)/2|0,i=n(r);if(i<o)e=r+1;else if(i>o)t=r-1;else return r}return e>0?e-1:0};function Ad({measurements:e,outerSize:t,scrollOffset:n,lanes:o}){const r=e.length-1,i=d=>e[d].start;if(e.length<=o)return{startIndex:0,endIndex:r};let a=Bs(0,r,i,n),l=a;if(o===1)for(;l<r&&e[l].end<n+t;)l++;else if(o>1){const d=Array(o).fill(0);for(;l<r&&d.some(_=>_<n+t);){const _=e[l];d[_.lane]=_.end,l++}const u=Array(o).fill(n+t);for(;a>=0&&u.some(_=>_>=n);){const _=e[a];u[_.lane]=_.start,a--}a=Math.max(0,a-a%o),l=Math.min(r,l+(o-1-l%o))}return{startIndex:a,endIndex:l}}const Hs=typeof document<"u"?M.useLayoutEffect:M.useEffect;function Ld(e){const t=M.useReducer(()=>({}),{})[1],n={...e,onChange:(r,i)=>{var a;i?Ct.flushSync(t):t(),(a=e.onChange)==null||a.call(e,r,i)}},[o]=M.useState(()=>new Dd(n));return o.setOptions(n),Hs(()=>o._didMount(),[]),Hs(()=>o._willUpdate()),o}function Pd(e){return Ld({observeElementRect:Md,observeElementOffset:Nd,scrollToFn:zd,...e})}function Td(e,t){const[n,o]=M.useState(e);return M.useEffect(()=>{const r=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(r)}},[e,t]),n}function Fo(e){const t=M.useCallback(r=>{const i=window.matchMedia(e);return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[e]),n=()=>window.matchMedia(e).matches,o=()=>{throw Error("useMediaQuery is a client-only hook")};return M.useSyncExternalStore(t,n,o)}function Ir(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function At(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function zo(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function Gs(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function Ws(e,t,n,o){if(!t.trim())return e;const r=Gs(t.trim());return o?e.filter(i=>o(i,t)):e.filter(i=>Gs(Ir(i,n)).includes(r))}function Od(e){if(e.length===0)return!1;const t=e[0];return typeof t=="object"&&t!==null&&"grupo"in t&&"opciones"in t&&Array.isArray(t.opciones)}function Vd(e){const t=[];let n=0;for(const o of e){t.push({tipo:"grupo",datos:null,nombreGrupo:o.grupo,indice:n++});for(const r of o.opciones)t.push({tipo:"opcion",datos:r,indice:n++})}return t}function jd(e,t,n,o){return t.trim()?e.map(r=>({...r,opciones:Ws(r.opciones,t,n,o)})).filter(r=>r.opciones.length>0):e}function qd(e){return e.map((t,n)=>t.tipo==="grupo"||t.datos&&zo(t.datos)?n:null).filter(t=>t!==null)}function Bd(e,t){if(!t)return null;const n=t(e);return n===!0||n==null?null:typeof n=="string"?n:typeof n=="object"&&"message"in n?n.message??"Selección inválida":"Selección inválida"}function Hd(e,t,n){return e!==void 0?e:t==="invalid"?!0:t==="valid"?!1:!!n}function Gd(e,t="Opción"){return Array.from({length:e},(n,o)=>`${t} ${o+1}`)}function Wd(e){return Array.from({length:e},(t,n)=>({id:`usr-${n+1}`,nombre:`Usuario ${n+1}`,email:`usuario${n+1}@test.com`}))}const Ks=({size:e="1em",...t})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:s.jsx("path",{d:"m6 9 6 6 6-6"})}),Us=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[s.jsx("path",{d:"M18 6 6 18"}),s.jsx("path",{d:"m6 6 12 12"})]}),Kd=({size:e="1em",...t})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:s.jsx("path",{d:"M20 6 9 17l-5-5"})}),Ud=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",...t,children:[s.jsx("path",{fill:"currentColor",d:"M10 18a7.95 7.95 0 0 0 4.897-1.688l4.396 4.396l1.414-1.414l-4.396-4.396A7.95 7.95 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8s3.589 8 8 8m0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6s-6-2.691-6-6s2.691-6 6-6"}),s.jsx("path",{fill:"currentColor",d:"M11.412 8.586c.379.38.588.882.588 1.414h2a3.98 3.98 0 0 0-1.174-2.828c-1.514-1.512-4.139-1.512-5.652 0l1.412 1.416c.76-.758 2.07-.756 2.826-.002"})]}),Xd=({size:e="1em",...t})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:s.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),R={contenedor_base:"_contenedor_base_1uead_1",tam_sm:"_tam_sm_1uead_41",tam_lg:"_tam_lg_1uead_55",radio_none:"_radio_none_1uead_69",radio_sm:"_radio_sm_1uead_77",radio_md:"_radio_md_1uead_85",radio_lg:"_radio_lg_1uead_93",radio_full:"_radio_full_1uead_101",color_default:"_color_default_1uead_109",color_primary:"_color_primary_1uead_111",color_secondary:"_color_secondary_1uead_119",color_success:"_color_success_1uead_127",color_warning:"_color_warning_1uead_135",color_danger:"_color_danger_1uead_143",etiqueta:"_etiqueta_1uead_151",marca_requerido:"_marca_requerido_1uead_167",trigger:"_trigger_1uead_177",trigger_expandido:"_trigger_expandido_1uead_213",variante_bordered:"_variante_bordered_1uead_223",variante_faded:"_variante_faded_1uead_233",variante_underlined:"_variante_underlined_1uead_243",variante_ghost:"_variante_ghost_1uead_259",deshabilitado:"_deshabilitado_1uead_271",solo_lectura:"_solo_lectura_1uead_291",valor_texto:"_valor_texto_1uead_307",abierto:"_abierto_1uead_335",valido:"_valido_1uead_343",invalido:"_invalido_1uead_351",contenido_inicio:"_contenido_inicio_1uead_403",contenido_final:"_contenido_final_1uead_405",valor_wrapper:"_valor_wrapper_1uead_423",mostrar_todos:"_mostrar_todos_1uead_443",valor_wrapper_expandido:"_valor_wrapper_expandido_1uead_453",placeholder:"_placeholder_1uead_469",chip_multi:"_chip_multi_1uead_479",chip_texto:"_chip_texto_1uead_513",chip_cerrar:"_chip_cerrar_1uead_525",contador_multi:"_contador_multi_1uead_565",acciones:"_acciones_1uead_579",boton_limpiar:"_boton_limpiar_1uead_593",tiene_valor:"_tiene_valor_1uead_645",icono_chevron:"_icono_chevron_1uead_655",icono_spinner:"_icono_spinner_1uead_677",girarSpinner:"_girarSpinner_1uead_1",menu:"_menu_1uead_711",buscador_wrapper:"_buscador_wrapper_1uead_741",buscador_interno:"_buscador_interno_1uead_755",icono_buscar:"_icono_buscar_1uead_807",input_busqueda:"_input_busqueda_1uead_859",lista_opciones:"_lista_opciones_1uead_899",lista_virtual:"_lista_virtual_1uead_927",contenedor_virtual:"_contenedor_virtual_1uead_939",encabezado_grupo:"_encabezado_grupo_1uead_947",opcion_virtual:"_opcion_virtual_1uead_979",opcion:"_opcion_1uead_979",activo:"_activo_1uead_1023",seleccionado:"_seleccionado_1uead_1039",opcion_check:"_opcion_check_1uead_1079",opcion_contenido:"_opcion_contenido_1uead_1107",sin_resultados:"_sin_resultados_1uead_1123",descripcion:"_descripcion_1uead_1147",mensaje_error:"_mensaje_error_1uead_1159",ancho_total:"_ancho_total_1uead_1171",sin_animacion:"_sin_animacion_1uead_1179",contenedor_nativo:"_contenedor_nativo_1uead_1189",select_nativo:"_select_nativo_1uead_1197",input_validacion:"_input_validacion_1uead_1225"};function Yd(e){const{options:t=[],value:n,onChange:o,onValueChange:r,optionLabelKey:i="label",optionValueKey:a="id",label:l,placeholder:d="Seleccione una opción",description:u,errorMessage:_,isRequired:g=!1,isInvalid:f,id:c,name:h,classNames:p,startContent:v,endContent:w,esInvalido:C,estaDeshabilitadoReal:x,clasesBase:I,renderizarValorMostrado:z}=e,A=m.useId(),N=c??`select-nativo-${A}`,L=u?`${N}-desc`:void 0,P=C?`${N}-err`:void 0,k=m.useCallback(T=>Ir(T,i),[i]),O=m.useCallback(T=>At(T,a),[a]),j=m.useCallback(T=>{o?.(T),r?.(T)},[o,r]),$=m.useCallback(T=>{const F=T.target.value;if(!F){j(null);return}const y=t.find(E=>O(E)===F);y&&j(y)},[t,O,j]),b=typeof f=="string"?f:null,S=typeof _=="function"?_({invalido:C,mensaje:b}):_??b;return s.jsxs("div",{className:I,children:[l&&s.jsxs("label",{className:K(R.etiqueta,p?.label),htmlFor:N,children:[l,g&&s.jsx("span",{className:R.marca_requerido,children:"*"})]}),s.jsxs("div",{className:R.contenedor_nativo,children:[s.jsxs("div",{className:K(R.trigger,p?.trigger),children:[v&&s.jsx("span",{className:R.contenido_inicio,children:v}),s.jsx("div",{className:K(R.valor_wrapper,p?.value),children:z()}),s.jsxs("div",{className:R.acciones,children:[w&&s.jsx("span",{className:R.contenido_final,children:w}),s.jsx("span",{className:R.icono_chevron,children:s.jsx(Ks,{size:"1em"})})]})]}),s.jsxs("select",{id:N,name:h,className:R.select_nativo,value:n?O(n):"",onChange:$,disabled:x,required:g,children:[s.jsx("option",{value:"",children:d}),t.map(T=>s.jsx("option",{value:O(T),disabled:zo(T),children:k(T)},O(T)))]})]}),u&&!C&&s.jsx("div",{id:L,className:K(R.descripcion,p?.description),children:u}),C&&S&&s.jsx("div",{id:P,className:K(R.mensaje_error,p?.errorMessage),children:S})]})}const Rd="(max-width: 768px)",Zd=44,Er=320,Do=100,Jd=200,Qd=5;function eu(e,t){const{options:n=[],value:o,defaultValue:r,onChange:i,onValueChange:a,optionLabelKey:l="label",optionValueKey:d="id",renderOption:u,renderValue:_,variant:g="bordered",color:f="default",size:c="md",radius:h="md",fullWidth:p=!0,disableAnimation:v=!1,label:w,placeholder:C="",description:x,errorMessage:I,emptyMessage:z="No hay opciones",noResultsMessage:A="Sin resultados",isRequired:N=!1,isDisabled:L=!1,isReadOnly:P=!1,isLoading:k=!1,isClearable:O=!0,isInvalid:j,validationState:$,isMultiple:b=!1,mostrarTodos:S=!1,isSearchable:T,isVirtualized:F=!1,estimatedOptionHeight:y=Zd,filterFn:E,validate:D,onOpen:B,onClose:H,onSearchChange:V,onClear:J,onFocus:U,onBlur:pe,id:ce,name:ie,className:ge,classNames:de,style:$e,startContent:Z,endContent:oe,menuZIndex:ne,portalContainer:ue}=e,ve=m.useRef(null),X=m.useRef([]),he=m.useRef(null),te=m.useRef(null),se=m.useId(),Ce=ce??`select-${se}`,W=Fo(Rd),q=T??!W,G=W&&!q&&!b,[fe,_e]=m.useState(!1),[me,Xe]=m.useState(null),[Oe,Ze]=m.useState(""),Ve=o!==void 0,[ye,Qe]=m.useState(r??null),be=Ve?o:ye,we=L||k,je=m.useCallback(Q=>Ir(Q,l),[l]),De=m.useCallback(Q=>At(Q,d),[d]),yn=m.useMemo(()=>{const Q=new Set;if(!be)return Q;try{if(b&&Array.isArray(be))for(const ze of be)Q.add(At(ze,d));else be&&Q.add(At(be,d))}catch{}return Q},[be,b,d]),ee=m.useCallback(Q=>{try{return yn.has(At(Q,d))}catch{return!1}},[yn,d]),Ne=m.useMemo(()=>Od(n),[n]),Ke=m.useMemo(()=>{if(!q||!Oe.trim())return n;try{return Ne?jd(n,Oe,l,E):Ws(n,Oe,l,E)}catch{return n}},[n,Oe,q,E,l,Ne]),Me=m.useMemo(()=>Ne?Vd(Ke):Ke.map((Q,ze)=>({tipo:"opcion",datos:Q,indice:ze})),[Ke,Ne]),gn=m.useMemo(()=>Bd(be,D),[be,D]),nn=m.useMemo(()=>Hd(j,$,gn),[j,$,gn]),ln=$==="valid"&&!nn,{refs:Fn,floatingStyles:pn,context:kn,placement:ei}=$o({open:fe,onOpenChange:Q=>{we||P||(_e(Q),Q?(B?.(),Ze(""),Xe(null)):H?.())},strategy:"fixed",transform:!1,placement:"bottom-start",middleware:[go(4),ho({padding:8}),po({padding:8}),rs({apply({rects:Q,elements:ze}){Object.assign(ze.floating.style,{width:`${Q.reference.width}px`})},padding:8})],whileElementsMounted:uo}),jt=ei.startsWith("top"),{isMounted:ke,styles:xe}=No(kn,{duration:v||Me.length>Jd?0:200,initial:{opacity:0,transform:jt?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},open:{opacity:1,transform:"translateY(0) scale(1)"},close:{opacity:0,transform:jt?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},common:{transformOrigin:jt?"bottom":"top"}}),qe=Pd({count:Me.length,getScrollElement:()=>he.current,estimateSize:()=>y,overscan:Qd,enabled:F&&fe&&Me.length>Do}),Cn=Ms(kn,{enabled:!we&&!P}),zn=So(kn),ct=Mo(kn,{role:"listbox"}),qt=m.useMemo(()=>{try{return qd(Me)}catch{return[]}},[Me]),Bt=kr(kn,{listRef:X,activeIndex:me,onNavigate:Xe,loop:!0,virtual:F,focusItemOnHover:!q,disabledIndices:qt}),Ht=m.useRef([]);m.useEffect(()=>{Ht.current=Me.map(Q=>Q.tipo==="opcion"&&Q.datos?je(Q.datos):null)},[Me,je]);const qo=As(kn,{listRef:Ht,activeIndex:me,onMatch:fe?Xe:void 0,enabled:!q}),{getReferenceProps:Uf,getFloatingProps:Xf,getItemProps:Ta}=ko([Cn,zn,ct,Bt,qo]),Zn=m.useCallback(Q=>{Ve||Qe(Q),i?.(Q),a?.(Q)},[Ve,i,a]),Bo=m.useCallback(Q=>{if(!zo(Q))if(b){const ze=Array.isArray(be)?be:[],Dn=ze.some(hn=>De(hn)===De(Q));Zn(Dn?ze.filter(hn=>De(hn)!==De(Q)):[...ze,Q])}else Zn(Q),_e(!1)},[b,be,De,Zn]),Yf=m.useCallback(Q=>{Q.stopPropagation(),Zn(b?[]:null),J?.(),ve.current?.focus()},[b,Zn,J]),Oa=m.useCallback((Q,ze)=>{ze.stopPropagation(),!(!b||!Array.isArray(be))&&Zn(be.filter(Dn=>De(Dn)!==De(Q)))},[b,be,De,Zn]),Rf=m.useCallback(Q=>{const ze=Q.target.value;Ze(ze),V?.(ze),Xe(0)},[V]),Zf=m.useCallback(Q=>{if(Q.key==="Enter"&&me!==null){Q.preventDefault();const ze=Me[me];ze?.tipo==="opcion"&&ze.datos&&Bo(ze.datos)}},[me,Me,Bo]);m.useEffect(()=>{fe&&q&&requestAnimationFrame(()=>te.current?.focus())},[fe,q]),m.useEffect(()=>()=>{X.current=[]},[Me.length]),m.useImperativeHandle(t,()=>({focus:()=>ve.current?.focus(),blur:()=>ve.current?.blur(),open:()=>_e(!0),close:()=>_e(!1),clear:()=>Zn(b?[]:null)}));const Ho=b?Array.isArray(be)&&be.length>0:be!=null&&be!=="",Va=m.useCallback(()=>{if(_)return _(be??null);if(!Ho)return s.jsx("span",{className:R.placeholder,children:C});if(b&&Array.isArray(be)){if(be.length===0)return s.jsx("span",{className:R.placeholder,children:C});const Q=S?be:be.slice(0,2),ze=S?0:Math.max(0,be.length-2);return s.jsxs(s.Fragment,{children:[Q.map(Dn=>s.jsxs("span",{className:R.chip_multi,children:[s.jsx("span",{className:R.chip_texto,children:je(Dn)}),!P&&!we&&s.jsx("button",{type:"button",className:R.chip_cerrar,onClick:hn=>Oa(Dn,hn),children:s.jsx(Us,{size:"1em"})})]},De(Dn))),ze>0&&s.jsxs("span",{className:R.contador_multi,children:["+",ze]})]})}return s.jsx("span",{className:R.valor_texto,children:je(be)})},[_,be,Ho,C,b,S,P,we,De,je,Oa]),ja=m.useCallback((Q,ze,Dn)=>{try{if(Q.tipo==="grupo")return s.jsx("li",{className:K(R.encabezado_grupo,F&&R.opcion_virtual),style:Dn,children:Q.nombreGrupo},`grupo-${Q.nombreGrupo}`);const hn=Q.datos;if(!hn)return null;const Ha=ee(hn),Ga=me===ze,Jf=zo(hn),Qf=u?u(hn,{isSelected:Ha,isActive:Ga}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:R.opcion_check,children:s.jsx(Kd,{size:"1em"})}),s.jsx("span",{className:R.opcion_contenido,children:je(hn)})]}),e_=De(hn);return s.jsx("li",{ref:n_=>{X.current[ze]=n_},className:K(R.opcion,F&&R.opcion_virtual,{[R.activo]:Ga,[R.seleccionado]:Ha,[R.deshabilitado]:Jf},de?.option),style:Dn,...Ta({onClick:()=>Bo(hn)}),children:Qf},e_)}catch(hn){return console.error("Error rendering select item:",hn),null}},[F,me,ee,u,je,De,de?.option,Ta,Bo]),qa=typeof I=="function"?I({invalido:nn,mensaje:gn}):I??gn,Ba=K(R.contenedor_base,R[`variante_${g}`],R[`tam_${c}`],R[`radio_${h}`],R[`color_${f}`],{[R.ancho_total]:p,[R.sin_animacion]:v,[R.deshabilitado]:we,[R.solo_lectura]:P,[R.invalido]:nn,[R.valido]:ln,[R.abierto]:fe,[R.tiene_valor]:Ho},de?.base,ge);return G&&!Ne?s.jsx(Yd,{...e,esInvalido:nn,estaDeshabilitadoReal:we,clasesBase:Ba,renderizarValorMostrado:Va}):s.jsxs("div",{className:Ba,style:$e,children:[w&&s.jsxs("label",{id:`${Ce}-label`,className:K(R.etiqueta,de?.label),children:[w,N&&s.jsx("span",{className:R.marca_requerido,children:"*"})]}),s.jsxs("div",{ref:Q=>{Fn.setReference(Q),ve.current=Q},id:Ce,tabIndex:we?-1:0,className:K(R.trigger,S&&b&&R.trigger_expandido,de?.trigger),"aria-labelledby":w?`${Ce}-label`:void 0,onFocus:U,onBlur:pe,...Uf(),children:[Z&&s.jsx("span",{className:R.contenido_inicio,children:Z}),s.jsx("div",{className:K(R.valor_wrapper,S&&b&&R.mostrar_todos,S&&b&&R.valor_wrapper_expandido,de?.value),children:Va()}),s.jsxs("div",{className:R.acciones,children:[O&&Ho&&!P&&!we&&s.jsx("button",{type:"button",className:K(R.boton_limpiar,de?.clearButton),onClick:Yf,tabIndex:-1,children:s.jsx(Us,{size:"1em"})}),oe&&s.jsx("span",{className:R.contenido_final,children:oe}),k?s.jsx("span",{className:R.icono_spinner,children:s.jsx(Xd,{size:"1em"})}):s.jsx("span",{className:R.icono_chevron,children:s.jsx(Ks,{size:"1em"})})]})]}),(ie||N)&&s.jsx("input",{type:"text",name:ie,required:N,value:b&&Array.isArray(be)?be.map(De).join(","):be?De(be):"",onChange:()=>{},onFocus:Q=>Q.target.blur(),"aria-hidden":"true",className:R.input_validacion}),ke&&s.jsx(xo,{root:ue,children:s.jsx(Cr,{context:kn,modal:!1,initialFocus:q?te:-1,children:s.jsxs("div",{ref:Fn.setFloating,style:{...pn,...xe,zIndex:ne??"var(--z-popover)"},className:K(R.menu,de?.menu),...Xf(),children:[q&&s.jsx("div",{className:R.buscador_wrapper,children:s.jsxs("div",{className:R.buscador_interno,children:[s.jsx("span",{className:R.icono_buscar,children:s.jsx(Ud,{size:"1.6em"})}),s.jsx("input",{ref:te,type:"text",className:K(R.input_busqueda,de?.searchInput),placeholder:"Buscar...",value:Oe,onChange:Rf,onKeyDown:Zf})]})}),s.jsx("ul",{ref:he,className:K(R.lista_opciones,F&&R.lista_virtual),style:{height:F&&Me.length>Do?`${Er}px`:`${Math.min(Me.length*y,Er)}px`,maxHeight:`${Er}px`,overflow:"auto",position:F&&Me.length>Do?"relative":void 0},children:Me.length===0?s.jsx("li",{className:R.sin_resultados,children:Oe?A:z}):F&&Me.length>Do?s.jsx(s.Fragment,{children:s.jsx("div",{style:{height:`${qe.getTotalSize()}px`,position:"relative",width:"100%"},children:qe.getVirtualItems().map(Q=>{const ze=Me[Q.index];return ze?s.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,width:"100%",height:`${Q.size}px`,transform:`translateY(${Q.start}px)`},children:ja(ze,Q.index)},`virtual-${Q.index}`):null})})}):Me.map((Q,ze)=>ja(Q,ze))})]})})}),x&&!nn&&s.jsx("div",{className:K(R.descripcion,de?.description),children:x}),nn&&qa&&s.jsx("div",{className:K(R.mensaje_error,de?.errorMessage),children:qa})]})}const nu=m.forwardRef(eu),Xs=m.memo(nu);Xs.displayName="SelectBase";function tu(e,t){const{options:n=[],value:o,onChange:r,onValueChange:i,optionValueKey:a,optionLabelKey:l="label",isMultiple:d=!1,devolverObjeto:u=!1,..._}=e,g=m.useMemo(()=>n.length>0&&typeof n[0]=="object",[n]),f=m.useMemo(()=>{if(!g||!a)return null;const p=new Map;for(const v of n)p.set(String(v[a]),v);return p},[n,a,g]),c=m.useMemo(()=>{if(o==null||!g||u)return o;const p=v=>f?.get(String(v));return d&&Array.isArray(o)?o.map(p).filter(v=>v!==void 0):p(o)??null},[o,f,d,u,g]),h=m.useCallback(p=>{const v=r||i;if(!v)return;if(p===null){v(d?[]:u||!g?null:"");return}if(u||!g){v(p);return}const w=C=>typeof C=="string"?C:C[a];v(d&&Array.isArray(p)?p.map(w):w(p))},[r,i,u,d,a,g]);return s.jsx(Xs,{..._,ref:t,options:n,value:c,onChange:h,optionValueKey:a,optionLabelKey:l,isMultiple:d})}const Ys=m.forwardRef(tu);Ys.displayName="Select";const Lt={tooltip:"_tooltip_myw27_1",tooltip_positioner:"_tooltip_positioner_myw27_53",enterAnimation:"_enterAnimation_myw27_1",exitAnimation:"_exitAnimation_myw27_1",arrow:"_arrow_myw27_81",size_sm:"_size_sm_myw27_91",size_md:"_size_md_myw27_101",size_lg:"_size_lg_myw27_111",variant_default:"_variant_default_myw27_121",variant_dark:"_variant_dark_myw27_141",variant_light:"_variant_light_myw27_153",variant_brand:"_variant_brand_myw27_165",variant_success:"_variant_success_myw27_181",variant_warning:"_variant_warning_myw27_193",variant_danger:"_variant_danger_myw27_205",variant_info:"_variant_info_myw27_217",fadeOnly:"_fadeOnly_myw27_1"};function it({content:e,children:t,placement:n="top",variant:o="default",size:r="md",offset:i=8,delayShow:a=100,delayHide:l=0,isDisabled:d=!1,showArrow:u=!1,maxWidth:_="320px",isInteractive:g=!1,className:f="",onOpen:c,onClose:h,isOpen:p,onOpenChange:v}){const[w,C]=m.useState(!1),x=m.useRef(null),I=p!==void 0?p:w,z=m.useCallback(D=>{d||(v?v(D):C(D),D?c?.():h?.())},[d,v,c,h]),{refs:A,floatingStyles:N,context:L,isPositioned:P}=$o({open:I,onOpenChange:z,placement:n,strategy:"fixed",middleware:[go(i+(u?8:0)),ho({fallbackAxisSideDirection:"start",padding:8}),po({padding:8}),u?Zc({element:x}):void 0].filter(Boolean),whileElementsMounted:uo}),k=vr(L,{delay:{open:a,close:g?200:l||100},enabled:!d,move:!1,handleClose:null}),O=bd(L,{enabled:!d}),j=So(L,{enabled:!d}),$=Mo(L,{role:"tooltip"}),{getReferenceProps:b,getFloatingProps:S}=ko([k,O,j,$]),{isMounted:T,styles:F}=No(L,{duration:{open:250,close:150},initial:{opacity:0,transform:"scale(0.95)"},open:{opacity:1,transform:"scale(1)"},close:{opacity:0,transform:"scale(0.95)"},common:{transitionTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)"}}),y=m.useMemo(()=>[Lt.tooltip,Lt[`size_${r}`],Lt[`variant_${o}`],f].filter(Boolean).join(" "),[r,o,f]),E=m.useMemo(()=>m.cloneElement(t,b({ref:A.setReference,...t.props})),[t,b,A.setReference]);return!e||d?t:s.jsxs(s.Fragment,{children:[E,T&&s.jsx(xo,{children:s.jsx("div",{ref:A.setFloating,className:Lt.tooltip_positioner,style:{...N,maxWidth:_,zIndex:9999,pointerEvents:"none"},children:s.jsxs("div",{className:y,style:{...F,pointerEvents:g?"auto":"none",visibility:P||!I?"visible":"hidden"},...S(),children:[e,u&&s.jsx(od,{ref:x,context:L,className:Lt.arrow})]})})})]})}/**
661
8
  * table-core
662
9
  *
663
10
  * Copyright (c) TanStack
@@ -666,10 +13,10 @@ Content-Type: `+d.contentType+`\r
666
13
  * LICENSE.md file in the root directory of this source tree.
667
14
  *
668
15
  * @license MIT
669
- */function en(e,t){return typeof e=="function"?e(t):e}function $t(e,t){return n=>{t.setState(o=>({...o,[e]:en(n,o[e])}))}}function tr(e){return e instanceof Function}function Nh(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Mh(e,t){const n=[],o=r=>{r.forEach(s=>{n.push(s);const i=t(s);i!=null&&i.length&&o(i)})};return o(e),n}function ae(e,t,n){let o=[],r;return s=>{let i;n.key&&n.debug&&(i=Date.now());const l=e(s);if(!(l.length!==o.length||l.some((_,g)=>o[g]!==_)))return r;o=l;let d;if(n.key&&n.debug&&(d=Date.now()),r=t(...l),n==null||n.onChange==null||n.onChange(r),n.key&&n.debug&&n!=null&&n.debug()){const _=Math.round((Date.now()-i)*100)/100,g=Math.round((Date.now()-d)*100)/100,f=g/16,u=(p,h)=>{for(p=String(p);p.length<h;)p=" "+p;return p};console.info(`%c⏱ ${u(g,5)} /${u(_,5)} ms`,`
16
+ */function Xn(e,t){return typeof e=="function"?e(t):e}function wn(e,t){return n=>{t.setState(o=>({...o,[e]:Xn(n,o[e])}))}}function Ao(e){return e instanceof Function}function ou(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function ru(e,t){const n=[],o=r=>{r.forEach(i=>{n.push(i);const a=t(i);a!=null&&a.length&&o(a)})};return o(e),n}function ae(e,t,n){let o=[],r;return i=>{let a;n.key&&n.debug&&(a=Date.now());const l=e(i);if(!(l.length!==o.length||l.some((_,g)=>o[g]!==_)))return r;o=l;let u;if(n.key&&n.debug&&(u=Date.now()),r=t(...l),n==null||n.onChange==null||n.onChange(r),n.key&&n.debug&&n!=null&&n.debug()){const _=Math.round((Date.now()-a)*100)/100,g=Math.round((Date.now()-u)*100)/100,f=g/16,c=(h,p)=>{for(h=String(h);h.length<p;)h=" "+h;return h};console.info(`%c⏱ ${c(g,5)} /${c(_,5)} ms`,`
670
17
  font-size: .6rem;
671
18
  font-weight: bold;
672
- color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n?.key)}return r}}function le(e,t,n,o){return{debug:()=>{var r;return(r=e?.debugAll)!=null?r:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:o}}function Ah(e,t,n,o){const r=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:r,getContext:ae(()=>[e,n,t,s],(i,l,c,d)=>({table:i,column:l,row:c,cell:d,getValue:d.getValue,renderValue:d.renderValue}),le(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function Dh(e,t,n,o){var r,s;const l={...e._getDefaultColumnDef(),...t},c=l.accessorKey;let d=(r=(s=l.id)!=null?s:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?r:typeof l.header=="string"?l.header:void 0,_;if(l.accessorFn?_=l.accessorFn:c&&(c.includes(".")?_=f=>{let u=f;for(const h of c.split(".")){var p;u=(p=u)==null?void 0:p[h],process.env.NODE_ENV!=="production"&&u===void 0&&console.warn(`"${h}" in deeply nested key "${c}" returned undefined.`)}return u}:_=f=>f[l.accessorKey]),!d)throw process.env.NODE_ENV!=="production"?new Error(l.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let g={id:`${String(d)}`,accessorFn:_,parent:o,depth:n,columnDef:l,columns:[],getFlatColumns:ae(()=>[!0],()=>{var f;return[g,...(f=g.columns)==null?void 0:f.flatMap(u=>u.getFlatColumns())]},le(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ae(()=>[e._getOrderColumnsFn()],f=>{var u;if((u=g.columns)!=null&&u.length){let p=g.columns.flatMap(h=>h.getLeafColumns());return f(p)}return[g]},le(e.options,"debugColumns","column.getLeafColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(g,e);return g}const ft="debugHeaders";function xl(e,t,n){var o;let s={id:(o=n.id)!=null?o:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],l=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(l),i.push(c)};return l(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const Th={createTable:e=>{e.getHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>{var s,i;const l=(s=o?.map(g=>n.find(f=>f.id===g)).filter(Boolean))!=null?s:[],c=(i=r?.map(g=>n.find(f=>f.id===g)).filter(Boolean))!=null?i:[],d=n.filter(g=>!(o!=null&&o.includes(g.id))&&!(r!=null&&r.includes(g.id)));return nr(t,[...l,...d,...c],e)},le(e.options,ft,"getHeaderGroups")),e.getCenterHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>(n=n.filter(s=>!(o!=null&&o.includes(s.id))&&!(r!=null&&r.includes(s.id))),nr(t,n,e,"center")),le(e.options,ft,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var r;const s=(r=o?.map(i=>n.find(l=>l.id===i)).filter(Boolean))!=null?r:[];return nr(t,s,e,"left")},le(e.options,ft,"getLeftHeaderGroups")),e.getRightHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var r;const s=(r=o?.map(i=>n.find(l=>l.id===i)).filter(Boolean))!=null?r:[];return nr(t,s,e,"right")},le(e.options,ft,"getRightHeaderGroups")),e.getFooterGroups=ae(()=>[e.getHeaderGroups()],t=>[...t].reverse(),le(e.options,ft,"getFooterGroups")),e.getLeftFooterGroups=ae(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),le(e.options,ft,"getLeftFooterGroups")),e.getCenterFooterGroups=ae(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),le(e.options,ft,"getCenterFooterGroups")),e.getRightFooterGroups=ae(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),le(e.options,ft,"getRightFooterGroups")),e.getFlatHeaders=ae(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,ft,"getFlatHeaders")),e.getLeftFlatHeaders=ae(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,ft,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ae(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,ft,"getCenterFlatHeaders")),e.getRightFlatHeaders=ae(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,ft,"getRightFlatHeaders")),e.getCenterLeafHeaders=ae(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),le(e.options,ft,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ae(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),le(e.options,ft,"getLeftLeafHeaders")),e.getRightLeafHeaders=ae(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),le(e.options,ft,"getRightLeafHeaders")),e.getLeafHeaders=ae(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,o)=>{var r,s,i,l,c,d;return[...(r=(s=t[0])==null?void 0:s.headers)!=null?r:[],...(i=(l=n[0])==null?void 0:l.headers)!=null?i:[],...(c=(d=o[0])==null?void 0:d.headers)!=null?c:[]].map(_=>_.getLeafHeaders()).flat()},le(e.options,ft,"getLeafHeaders"))}};function nr(e,t,n,o){var r,s;let i=0;const l=function(f,u){u===void 0&&(u=1),i=Math.max(i,u),f.filter(p=>p.getIsVisible()).forEach(p=>{var h;(h=p.columns)!=null&&h.length&&l(p.columns,u+1)},0)};l(e);let c=[];const d=(f,u)=>{const p={depth:u,id:[o,`${u}`].filter(Boolean).join("_"),headers:[]},h=[];f.forEach(m=>{const y=[...h].reverse()[0],w=m.column.depth===p.depth;let C,k=!1;if(w&&m.column.parent?C=m.column.parent:(C=m.column,k=!0),y&&y?.column===C)y.subHeaders.push(m);else{const A=xl(n,C,{id:[o,u,C.id,m?.id].filter(Boolean).join("_"),isPlaceholder:k,placeholderId:k?`${h.filter(T=>T.column===C).length}`:void 0,depth:u,index:h.length});A.subHeaders.push(m),h.push(A)}p.headers.push(m),m.headerGroup=p}),c.push(p),u>0&&d(h,u-1)},_=t.map((f,u)=>xl(n,f,{depth:i,index:u}));d(_,i-1),c.reverse();const g=f=>f.filter(p=>p.column.getIsVisible()).map(p=>{let h=0,m=0,y=[0];p.subHeaders&&p.subHeaders.length?(y=[],g(p.subHeaders).forEach(C=>{let{colSpan:k,rowSpan:A}=C;h+=k,y.push(A)})):h=1;const w=Math.min(...y);return m=m+w,p.colSpan=h,p.rowSpan=m,{colSpan:h,rowSpan:m}});return g((r=(s=c[0])==null?void 0:s.headers)!=null?r:[]),c}const hs=(e,t,n,o,r,s,i)=>{let l={id:t,index:o,original:n,depth:r,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(l._valuesCache.hasOwnProperty(c))return l._valuesCache[c];const d=e.getColumn(c);if(d!=null&&d.accessorFn)return l._valuesCache[c]=d.accessorFn(l.original,o),l._valuesCache[c]},getUniqueValues:c=>{if(l._uniqueValuesCache.hasOwnProperty(c))return l._uniqueValuesCache[c];const d=e.getColumn(c);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(l._uniqueValuesCache[c]=d.columnDef.getUniqueValues(l.original,o),l._uniqueValuesCache[c]):(l._uniqueValuesCache[c]=[l.getValue(c)],l._uniqueValuesCache[c])},renderValue:c=>{var d;return(d=l.getValue(c))!=null?d:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Mh(l.subRows,c=>c.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let c=[],d=l;for(;;){const _=d.getParentRow();if(!_)break;c.push(_),d=_}return c.reverse()},getAllCells:ae(()=>[e.getAllLeafColumns()],c=>c.map(d=>Ah(e,l,d,d.id)),le(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ae(()=>[l.getAllCells()],c=>c.reduce((d,_)=>(d[_.column.id]=_,d),{}),le(e.options,"debugRows","getAllCellsByColumnId"))};for(let c=0;c<e._features.length;c++){const d=e._features[c];d==null||d.createRow==null||d.createRow(l,e)}return l},Fh={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Sl=(e,t,n)=>{var o,r;const s=n==null||(o=n.toString())==null?void 0:o.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(s))};Sl.autoRemove=e=>Mt(e);const $l=(e,t,n)=>{var o;return!!(!((o=e.getValue(t))==null||(o=o.toString())==null)&&o.includes(n))};$l.autoRemove=e=>Mt(e);const kl=(e,t,n)=>{var o;return((o=e.getValue(t))==null||(o=o.toString())==null?void 0:o.toLowerCase())===n?.toLowerCase()};kl.autoRemove=e=>Mt(e);const El=(e,t,n)=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(n)};El.autoRemove=e=>Mt(e);const Il=(e,t,n)=>!n.some(o=>{var r;return!((r=e.getValue(t))!=null&&r.includes(o))});Il.autoRemove=e=>Mt(e)||!(e!=null&&e.length);const Nl=(e,t,n)=>n.some(o=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(o)});Nl.autoRemove=e=>Mt(e)||!(e!=null&&e.length);const Ml=(e,t,n)=>e.getValue(t)===n;Ml.autoRemove=e=>Mt(e);const Al=(e,t,n)=>e.getValue(t)==n;Al.autoRemove=e=>Mt(e);const ps=(e,t,n)=>{let[o,r]=n;const s=e.getValue(t);return s>=o&&s<=r};ps.resolveFilterValue=e=>{let[t,n]=e,o=typeof t!="number"?parseFloat(t):t,r=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(o)?-1/0:o,i=n===null||Number.isNaN(r)?1/0:r;if(s>i){const l=s;s=i,i=l}return[s,i]},ps.autoRemove=e=>Mt(e)||Mt(e[0])&&Mt(e[1]);const qt={includesString:Sl,includesStringSensitive:$l,equalsString:kl,arrIncludes:El,arrIncludesAll:Il,arrIncludesSome:Nl,equals:Ml,weakEquals:Al,inNumberRange:ps};function Mt(e){return e==null||e===""}const Ph={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:$t("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=n?.getValue(e.id);return typeof o=="string"?qt.includesString:typeof o=="number"?qt.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?qt.equals:Array.isArray(o)?qt.arrIncludes:qt.weakEquals},e.getFilterFn=()=>{var n,o;return tr(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(o=t.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?n:qt[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,r;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((o=t.options.enableColumnFilters)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(o=>o.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,o;return(n=(o=t.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(o=>{const r=e.getFilterFn(),s=o?.find(_=>_.id===e.id),i=en(n,s?s.value:void 0);if(Dl(r,i,e)){var l;return(l=o?.filter(_=>_.id!==e.id))!=null?l:[]}const c={id:e.id,value:i};if(s){var d;return(d=o?.map(_=>_.id===e.id?c:_))!=null?d:[]}return o!=null&&o.length?[...o,c]:[c]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),o=r=>{var s;return(s=en(t,r))==null?void 0:s.filter(i=>{const l=n.find(c=>c.id===i.id);if(l){const c=l.getFilterFn();if(Dl(c,i.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=t=>{var n,o;e.setColumnFilters(t?[]:(n=(o=e.initialState)==null?void 0:o.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Dl(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const ms={sum:(e,t,n)=>n.reduce((o,r)=>{const s=r.getValue(e);return o+(typeof s=="number"?s:0)},0),min:(e,t,n)=>{let o;return n.forEach(r=>{const s=r.getValue(e);s!=null&&(o>s||o===void 0&&s>=s)&&(o=s)}),o},max:(e,t,n)=>{let o;return n.forEach(r=>{const s=r.getValue(e);s!=null&&(o<s||o===void 0&&s>=s)&&(o=s)}),o},extent:(e,t,n)=>{let o,r;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(o===void 0?i>=i&&(o=r=i):(o>i&&(o=i),r<i&&(r=i)))}),[o,r]},mean:(e,t)=>{let n=0,o=0;if(t.forEach(r=>{let s=r.getValue(e);s!=null&&(s=+s)>=s&&(++n,o+=s)}),n)return o/n},median:(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!Nh(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),r=n.sort((s,i)=>s-i);return n.length%2!==0?r[o]:(r[o-1]+r[o])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},Lh={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:$t("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(o=>o!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,o;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((o=t.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=n?.getValue(e.id);if(typeof o=="number")return ms.sum;if(Object.prototype.toString.call(o)==="[object Date]")return ms.extent},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return tr(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(o=t.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?n:ms[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,o;e.setGrouping(t?[]:(n=(o=e.initialState)==null?void 0:o.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const o=t.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,o)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=n.subRows)!=null&&r.length)}}};function Oh(e,t,n){if(!(t!=null&&t.length)||!n)return e;const o=e.filter(s=>!t.includes(s.id));return n==="remove"?o:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...o]}const zh={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$t("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ae(n=>[Jn(t,n)],n=>n.findIndex(o=>o.id===e.id),le(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var o;return((o=Jn(t,n)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;const r=Jn(t,n);return((o=r[r.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ae(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,o)=>r=>{let s=[];if(!(t!=null&&t.length))s=r;else{const i=[...t],l=[...r];for(;l.length&&i.length;){const c=i.shift(),d=l.findIndex(_=>_.id===c);d>-1&&s.push(l.splice(d,1)[0])}s=[...s,...l]}return Oh(s,n,o)},le(e.options,"debugTable","_getOrderColumnsFn"))}},vs=()=>({left:[],right:[]}),Bh={getInitialState:e=>({columnPinning:vs(),...e}),getDefaultOptions:e=>({onColumnPinningChange:$t("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);t.setColumnPinning(r=>{var s,i;if(n==="right"){var l,c;return{left:((l=r?.left)!=null?l:[]).filter(g=>!(o!=null&&o.includes(g))),right:[...((c=r?.right)!=null?c:[]).filter(g=>!(o!=null&&o.includes(g))),...o]}}if(n==="left"){var d,_;return{left:[...((d=r?.left)!=null?d:[]).filter(g=>!(o!=null&&o.includes(g))),...o],right:((_=r?.right)!=null?_:[]).filter(g=>!(o!=null&&o.includes(g)))}}return{left:((s=r?.left)!=null?s:[]).filter(g=>!(o!=null&&o.includes(g))),right:((i=r?.right)!=null?i:[]).filter(g=>!(o!=null&&o.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,s,i;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(l=>l.id),{left:o,right:r}=t.getState().columnPinning,s=n.some(l=>o?.includes(l)),i=n.some(l=>r?.includes(l));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();return r?(n=(o=t.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,o,r)=>{const s=[...o??[],...r??[]];return n.filter(i=>!s.includes(i.column.id))},le(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,o)=>(o??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),le(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,o)=>(o??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),le(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,o;return e.setColumnPinning(t?vs():(n=(o=e.initialState)==null?void 0:o.columnPinning)!=null?n:vs())},e.getIsSomeColumnsPinned=t=>{var n;const o=e.getState().columnPinning;if(!t){var r,s;return!!((r=o.left)!=null&&r.length||(s=o.right)!=null&&s.length)}return!!((n=o[t])!=null&&n.length)},e.getLeftLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),le(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),le(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o)=>{const r=[...n??[],...o??[]];return t.filter(s=>!r.includes(s.id))},le(e.options,"debugColumns","getCenterLeafColumns"))}};function Vh(e){return e||(typeof document<"u"?document:null)}const or={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},bs=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),jh={getDefaultColumnDef:()=>or,getInitialState:e=>({columnSizing:{},columnSizingInfo:bs(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:$t("columnSizing",e),onColumnSizingInfoChange:$t("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,r;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:or.minSize,(o=s??e.columnDef.size)!=null?o:or.size),(r=e.columnDef.maxSize)!=null?r:or.maxSize)},e.getStart=ae(n=>[n,Jn(t,n),t.getState().columnSizing],(n,o)=>o.slice(0,e.getIndex(n)).reduce((r,s)=>r+s.getSize(),0),le(t.options,"debugColumns","getStart")),e.getAfter=ae(n=>[n,Jn(t,n),t.getState().columnSizing],(n,o)=>o.slice(e.getIndex(n)+1).reduce((r,s)=>r+s.getSize(),0),le(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:o,...r}=n;return r})},e.getCanResize=()=>{var n,o;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((o=t.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var s;n+=(s=r.column.getSize())!=null?s:0}};return o(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const o=t.getColumn(e.column.id),r=o?.getCanResize();return s=>{if(!o||!r||(s.persist==null||s.persist(),ws(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),l=e?e.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[o.id,o.getSize()]],c=ws(s)?Math.round(s.touches[0].clientX):s.clientX,d={},_=(y,w)=>{typeof w=="number"&&(t.setColumnSizingInfo(C=>{var k,A;const T=t.options.columnResizeDirection==="rtl"?-1:1,M=(w-((k=C?.startOffset)!=null?k:0))*T,P=Math.max(M/((A=C?.startSize)!=null?A:0),-.999999);return C.columnSizingStart.forEach(L=>{let[E,B]=L;d[E]=Math.round(Math.max(B+B*P,0)*100)/100}),{...C,deltaOffset:M,deltaPercentage:P}}),(t.options.columnResizeMode==="onChange"||y==="end")&&t.setColumnSizing(C=>({...C,...d})))},g=y=>_("move",y),f=y=>{_("end",y),t.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},u=Vh(n),p={moveHandler:y=>g(y.clientX),upHandler:y=>{u?.removeEventListener("mousemove",p.moveHandler),u?.removeEventListener("mouseup",p.upHandler),f(y.clientX)}},h={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),g(y.touches[0].clientX),!1),upHandler:y=>{var w;u?.removeEventListener("touchmove",h.moveHandler),u?.removeEventListener("touchend",h.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),f((w=y.touches[0])==null?void 0:w.clientX)}},m=qh()?{passive:!1}:!1;ws(s)?(u?.addEventListener("touchmove",h.moveHandler,m),u?.addEventListener("touchend",h.upHandler,m)):(u?.addEventListener("mousemove",p.moveHandler,m),u?.addEventListener("mouseup",p.upHandler,m)),t.setColumnSizingInfo(y=>({...y,startOffset:c,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?bs():(n=e.initialState.columnSizingInfo)!=null?n:bs())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0}}};let rr=null;function qh(){if(typeof rr=="boolean")return rr;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return rr=e,rr}function ws(e){return e.type==="touchstart"}const Hh={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:$t("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(o=>({...o,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,o;const r=e.columns;return(n=r.length?r.some(s=>s.getIsVisible()):(o=t.getState().columnVisibility)==null?void 0:o[e.id])!=null?n:!0},e.getCanHide=()=>{var n,o;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((o=t.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ae(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),le(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ae(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,o,r)=>[...n,...o,...r],le(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,o)=>ae(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),le(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var o;e.setColumnVisibility(n?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,s)=>({...r,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;e.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}};function Jn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Rh={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Uh={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:$t("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const o=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,o,r,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=t.options.enableGlobalFilter)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>qt.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return tr(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[o])!=null?t:qt[o]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Wh={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:$t("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var r,s;e.setExpanded(o?{}:(r=(s=e.initialState)==null?void 0:s.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const i=s.split(".");o=Math.max(o,i.length)}),o},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(o=>{var r;const s=o===!0?!0:!!(o!=null&&o[e.id]);let i={};if(o===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{i[l]=!0}):i=o,n=(r=n)!=null?r:!s,!s&&n)return{...i,[e.id]:!0};if(s&&!n){const{[e.id]:l,...c}=i;return c}return o})},e.getIsExpanded=()=>{var n;const o=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:o===!0||o?.[e.id])},e.getCanExpand=()=>{var n,o,r;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((o=t.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)o=t.getRow(o.parentId,!0),n=o.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},ys=0,Cs=10,xs=()=>({pageIndex:ys,pageSize:Cs}),Gh={getInitialState:e=>({...e,pagination:{...xs(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:$t("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=o=>{const r=s=>en(o,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?xs():(r=e.initialState.pagination)!=null?r:xs())},e.setPageIndex=o=>{e.setPagination(r=>{let s=en(o,r.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...r,pageIndex:s}})},e.resetPageIndex=o=>{var r,s;e.setPageIndex(o?ys:(r=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?r:ys)},e.resetPageSize=o=>{var r,s;e.setPageSize(o?Cs:(r=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?r:Cs)},e.setPageSize=o=>{e.setPagination(r=>{const s=Math.max(1,en(o,r.pageSize)),i=r.pageSize*r.pageIndex,l=Math.floor(i/s);return{...r,pageIndex:l,pageSize:s}})},e.setPageCount=o=>e.setPagination(r=>{var s;let i=en(o,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...r,pageCount:i}}),e.getPageOptions=ae(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((s,i)=>i)),r},le(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:o}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:o<r-1},e.previousPage=()=>e.setPageIndex(o=>o-1),e.nextPage=()=>e.setPageIndex(o=>o+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var o;return(o=e.options.rowCount)!=null?o:e.getPrePaginationRowModel().rows.length}}},Ss=()=>({top:[],bottom:[]}),Kh={getInitialState:e=>({rowPinning:Ss(),...e}),getDefaultOptions:e=>({onRowPinningChange:$t("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,o,r)=>{const s=o?e.getLeafRows().map(c=>{let{id:d}=c;return d}):[],i=r?e.getParentRows().map(c=>{let{id:d}=c;return d}):[],l=new Set([...i,e.id,...s]);t.setRowPinning(c=>{var d,_;if(n==="bottom"){var g,f;return{top:((g=c?.top)!=null?g:[]).filter(h=>!(l!=null&&l.has(h))),bottom:[...((f=c?.bottom)!=null?f:[]).filter(h=>!(l!=null&&l.has(h))),...Array.from(l)]}}if(n==="top"){var u,p;return{top:[...((u=c?.top)!=null?u:[]).filter(h=>!(l!=null&&l.has(h))),...Array.from(l)],bottom:((p=c?.bottom)!=null?p:[]).filter(h=>!(l!=null&&l.has(h)))}}return{top:((d=c?.top)!=null?d:[]).filter(h=>!(l!=null&&l.has(h))),bottom:((_=c?.bottom)!=null?_:[]).filter(h=>!(l!=null&&l.has(h)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:r}=t.options;return typeof o=="function"?o(e):(n=o??r)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:o,bottom:r}=t.getState().rowPinning,s=n.some(l=>o?.includes(l)),i=n.some(l=>r?.includes(l));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();if(!r)return-1;const s=(n=r==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(i=>{let{id:l}=i;return l});return(o=s?.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?Ss():(n=(o=e.initialState)==null?void 0:o.rowPinning)!=null?n:Ss())},e.getIsSomeRowsPinned=t=>{var n;const o=e.getState().rowPinning;if(!t){var r,s;return!!((r=o.top)!=null&&r.length||(s=o.bottom)!=null&&s.length)}return!!((n=o[t])!=null&&n.length)},e._getPinnedRows=(t,n,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(n??[]).map(i=>{const l=e.getRow(i,!0);return l.getIsAllParentsExpanded()?l:null}):(n??[]).map(i=>t.find(l=>l.id===i))).filter(Boolean).map(i=>({...i,position:o}))},e.getTopRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),le(e.options,"debugRows","getTopRows")),e.getBottomRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),le(e.options,"debugRows","getBottomRows")),e.getCenterRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,o)=>{const r=new Set([...n??[],...o??[]]);return t.filter(s=>!r.has(s.id))},le(e.options,"debugRows","getCenterRows"))}},Xh={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:$t("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const o={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(s=>{s.getCanSelect()&&(o[s.id]=!0)}):r.forEach(s=>{delete o[s.id]}),o})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const o=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(s=>{$s(r,s.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?ks(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?ks(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?ks(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=!!(t.length&&Object.keys(n).length);return o&&t.some(r=>r.getCanSelect()&&!n[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some(r=>!n[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,o)=>{const r=e.getIsSelected();t.setRowSelection(s=>{var i;if(n=typeof n<"u"?n:!r,e.getCanSelect()&&r===n)return s;const l={...s};return $s(l,e.id,n,(i=o?.selectChildren)!=null?i:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Es(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Is(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Is(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return o=>{var r;n&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}}},$s=(e,t,n,o,r)=>{var s;const i=r.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),i.getCanSelect()&&(e[t]=!0)):delete e[t],o&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(l=>$s(e,l.id,n,o,r))};function ks(e,t){const n=e.getState().rowSelection,o=[],r={},s=function(i,l){return i.map(c=>{var d;const _=Es(c,n);if(_&&(o.push(c),r[c.id]=c),(d=c.subRows)!=null&&d.length&&(c={...c,subRows:s(c.subRows)}),_)return c}).filter(Boolean)};return{rows:s(t.rows),flatRows:o,rowsById:r}}function Es(e,t){var n;return(n=t[e.id])!=null?n:!1}function Is(e,t,n){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!r)&&(i.getCanSelect()&&(Es(i,t)?s=!0:r=!1),i.subRows&&i.subRows.length)){const l=Is(i,t);l==="all"?s=!0:(l==="some"&&(s=!0),r=!1)}}),r?"all":s?"some":!1}const Ns=/([0-9]+)/gm,Yh=(e,t,n)=>Tl(tn(e.getValue(n)).toLowerCase(),tn(t.getValue(n)).toLowerCase()),Zh=(e,t,n)=>Tl(tn(e.getValue(n)),tn(t.getValue(n))),Jh=(e,t,n)=>Ms(tn(e.getValue(n)).toLowerCase(),tn(t.getValue(n)).toLowerCase()),Qh=(e,t,n)=>Ms(tn(e.getValue(n)),tn(t.getValue(n))),ep=(e,t,n)=>{const o=e.getValue(n),r=t.getValue(n);return o>r?1:o<r?-1:0},tp=(e,t,n)=>Ms(e.getValue(n),t.getValue(n));function Ms(e,t){return e===t?0:e>t?1:-1}function tn(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Tl(e,t){const n=e.split(Ns).filter(Boolean),o=t.split(Ns).filter(Boolean);for(;n.length&&o.length;){const r=n.shift(),s=o.shift(),i=parseInt(r,10),l=parseInt(s,10),c=[i,l].sort();if(isNaN(c[0])){if(r>s)return 1;if(s>r)return-1;continue}if(isNaN(c[1]))return isNaN(i)?-1:1;if(i>l)return 1;if(l>i)return-1}return n.length-o.length}const Qn={alphanumeric:Yh,alphanumericCaseSensitive:Zh,text:Jh,textCaseSensitive:Qh,datetime:ep,basic:tp},np=[Th,Hh,zh,Bh,Fh,Ph,Rh,Uh,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:$t("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const r of n){const s=r?.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return Qn.datetime;if(typeof s=="string"&&(o=!0,s.split(Ns).length>1))return Qn.alphanumeric}return o?Qn.text:Qn.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw new Error;return tr(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(o=t.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?n:Qn[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{const r=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const l=i?.find(u=>u.id===e.id),c=i?.findIndex(u=>u.id===e.id);let d=[],_,g=s?n:r==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&o?l?_="toggle":_="add":i!=null&&i.length&&c!==i.length-1?_="replace":l?_="toggle":_="replace",_==="toggle"&&(s||r||(_="remove")),_==="add"){var f;d=[...i,{id:e.id,desc:g}],d.splice(0,d.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else _==="toggle"?d=i.map(u=>u.id===e.id?{...u,desc:g}:u):_==="remove"?d=i.filter(u=>u.id!==e.id):d=[{id:e.id,desc:g}];return d})},e.getFirstSortDir=()=>{var n,o;return((n=(o=e.columnDef.sortDescFirst)!=null?o:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var o,r;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((o=t.options.enableSortingRemoval)==null||o)&&(!(n&&(r=t.options.enableMultiRemove)!=null)||r)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var n,o;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((o=t.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return(n=(o=e.columnDef.enableMultiSort)!=null?o:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const o=(n=t.getState().sorting)==null?void 0:n.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,o;return(n=(o=t.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return o=>{n&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:(n=(o=e.initialState)==null?void 0:o.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Lh,Wh,Gh,Kh,Xh,jh];function op(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...np,...(t=e._features)!=null?t:[]];let r={_features:o};const s=r._features.reduce((f,u)=>Object.assign(f,u.getDefaultOptions==null?void 0:u.getDefaultOptions(r)),{}),i=f=>r.options.mergeOptions?r.options.mergeOptions(s,f):{...s,...f};let c={...{},...(n=e.initialState)!=null?n:{}};r._features.forEach(f=>{var u;c=(u=f.getInitialState==null?void 0:f.getInitialState(c))!=null?u:c});const d=[];let _=!1;const g={_features:o,options:{...s,...e},initialState:c,_queue:f=>{d.push(f),_||(_=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();_=!1}).catch(u=>setTimeout(()=>{throw u})))},reset:()=>{r.setState(r.initialState)},setOptions:f=>{const u=en(f,r.options);r.options=i(u)},getState:()=>r.options.state,setState:f=>{r.options.onStateChange==null||r.options.onStateChange(f)},_getRowId:(f,u,p)=>{var h;return(h=r.options.getRowId==null?void 0:r.options.getRowId(f,u,p))!=null?h:`${p?[p.id,u].join("."):u}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(f,u)=>{let p=(u?r.getPrePaginationRowModel():r.getRowModel()).rowsById[f];if(!p&&(p=r.getCoreRowModel().rowsById[f],!p))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${f}`):new Error;return p},_getDefaultColumnDef:ae(()=>[r.options.defaultColumn],f=>{var u;return f=(u=f)!=null?u:{},{header:p=>{const h=p.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:p=>{var h,m;return(h=(m=p.renderValue())==null||m.toString==null?void 0:m.toString())!=null?h:null},...r._features.reduce((p,h)=>Object.assign(p,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...f}},le(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:ae(()=>[r._getColumnDefs()],f=>{const u=function(p,h,m){return m===void 0&&(m=0),p.map(y=>{const w=Dh(r,y,m,h),C=y;return w.columns=C.columns?u(C.columns,w,m+1):[],w})};return u(f)},le(e,"debugColumns","getAllColumns")),getAllFlatColumns:ae(()=>[r.getAllColumns()],f=>f.flatMap(u=>u.getFlatColumns()),le(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ae(()=>[r.getAllFlatColumns()],f=>f.reduce((u,p)=>(u[p.id]=p,u),{}),le(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ae(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(f,u)=>{let p=f.flatMap(h=>h.getLeafColumns());return u(p)},le(e,"debugColumns","getAllLeafColumns")),getColumn:f=>{const u=r._getAllFlatColumnsById()[f];return process.env.NODE_ENV!=="production"&&!u&&console.error(`[Table] Column with id '${f}' does not exist.`),u}};Object.assign(r,g);for(let f=0;f<r._features.length;f++){const u=r._features[f];u==null||u.createTable==null||u.createTable(r)}return r}function rp(){return e=>ae(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(r,s,i){s===void 0&&(s=0);const l=[];for(let d=0;d<r.length;d++){const _=hs(e,e._getRowId(r[d],d,i),r[d],d,s,void 0,i?.id);if(n.flatRows.push(_),n.rowsById[_.id]=_,l.push(_),e.options.getSubRows){var c;_.originalSubRows=e.options.getSubRows(r[d],d),(c=_.originalSubRows)!=null&&c.length&&(_.subRows=o(_.originalSubRows,s+1,_))}}return l};return n.rows=o(t),n},le(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function sp(e){const t=[],n=o=>{var r;t.push(o),(r=o.subRows)!=null&&r.length&&o.getIsExpanded()&&o.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function ip(e,t,n){return n.options.filterFromLeafRows?ap(e,t,n):lp(e,t,n)}function ap(e,t,n){var o;const r=[],s={},i=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,l=function(c,d){d===void 0&&(d=0);const _=[];for(let f=0;f<c.length;f++){var g;let u=c[f];const p=hs(n,u.id,u.original,u.index,u.depth,void 0,u.parentId);if(p.columnFilters=u.columnFilters,(g=u.subRows)!=null&&g.length&&d<i){if(p.subRows=l(u.subRows,d+1),u=p,t(u)&&!p.subRows.length){_.push(u),s[u.id]=u,r.push(u);continue}if(t(u)||p.subRows.length){_.push(u),s[u.id]=u,r.push(u);continue}}else u=p,t(u)&&(_.push(u),s[u.id]=u,r.push(u))}return _};return{rows:l(e),flatRows:r,rowsById:s}}function lp(e,t,n){var o;const r=[],s={},i=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,l=function(c,d){d===void 0&&(d=0);const _=[];for(let f=0;f<c.length;f++){let u=c[f];if(t(u)){var g;if((g=u.subRows)!=null&&g.length&&d<i){const h=hs(n,u.id,u.original,u.index,u.depth,void 0,u.parentId);h.subRows=l(u.subRows,d+1),u=h}_.push(u),r.push(u),s[u.id]=u}}return _};return{rows:l(e),flatRows:r,rowsById:s}}function cp(){return e=>ae(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,o)=>{if(!t.rows.length||!(n!=null&&n.length)&&!o){for(let f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const r=[],s=[];(n??[]).forEach(f=>{var u;const p=e.getColumn(f.id);if(!p)return;const h=p.getFilterFn();if(!h){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${p.id}.`);return}r.push({id:f.id,filterFn:h,resolvedValue:(u=h.resolveFilterValue==null?void 0:h.resolveFilterValue(f.value))!=null?u:f.value})});const i=(n??[]).map(f=>f.id),l=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());o&&l&&c.length&&(i.push("__global__"),c.forEach(f=>{var u;s.push({id:f.id,filterFn:l,resolvedValue:(u=l.resolveFilterValue==null?void 0:l.resolveFilterValue(o))!=null?u:o})}));let d,_;for(let f=0;f<t.flatRows.length;f++){const u=t.flatRows[f];if(u.columnFilters={},r.length)for(let p=0;p<r.length;p++){d=r[p];const h=d.id;u.columnFilters[h]=d.filterFn(u,h,d.resolvedValue,m=>{u.columnFiltersMeta[h]=m})}if(s.length){for(let p=0;p<s.length;p++){_=s[p];const h=_.id;if(_.filterFn(u,h,_.resolvedValue,m=>{u.columnFiltersMeta[h]=m})){u.columnFilters.__global__=!0;break}}u.columnFilters.__global__!==!0&&(u.columnFilters.__global__=!1)}}const g=f=>{for(let u=0;u<i.length;u++)if(f.columnFilters[i[u]]===!1)return!1;return!0};return ip(t.rows,g,e)},le(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function dp(e){return t=>ae(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,o)=>{if(!o.rows.length)return o;const{pageSize:r,pageIndex:s}=n;let{rows:i,flatRows:l,rowsById:c}=o;const d=r*s,_=d+r;i=i.slice(d,_);let g;t.options.paginateExpandedRows?g={rows:i,flatRows:l,rowsById:c}:g=sp({rows:i,flatRows:l,rowsById:c}),g.flatRows=[];const f=u=>{g.flatRows.push(u),u.subRows.length&&u.subRows.forEach(f)};return g.rows.forEach(f),g},le(t.options,"debugTable","getPaginationRowModel"))}function up(){return e=>ae(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const o=e.getState().sorting,r=[],s=o.filter(c=>{var d;return(d=e.getColumn(c.id))==null?void 0:d.getCanSort()}),i={};s.forEach(c=>{const d=e.getColumn(c.id);d&&(i[c.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const l=c=>{const d=c.map(_=>({..._}));return d.sort((_,g)=>{for(let u=0;u<s.length;u+=1){var f;const p=s[u],h=i[p.id],m=h.sortUndefined,y=(f=p?.desc)!=null?f:!1;let w=0;if(m){const C=_.getValue(p.id),k=g.getValue(p.id),A=C===void 0,T=k===void 0;if(A||T){if(m==="first")return A?-1:1;if(m==="last")return A?1:-1;w=A&&T?0:A?m:-m}}if(w===0&&(w=h.sortingFn(_,g,p.id)),w!==0)return y&&(w*=-1),h.invertSorting&&(w*=-1),w}return _.index-g.index}),d.forEach(_=>{var g;r.push(_),(g=_.subRows)!=null&&g.length&&(_.subRows=l(_.subRows))}),d};return{rows:l(n.rows),flatRows:r,rowsById:n.rowsById}},le(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
19
+ color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n?.key)}return r}}function le(e,t,n,o){return{debug:()=>{var r;return(r=e?.debugAll)!=null?r:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:o}}function iu(e,t,n,o){const r=()=>{var a;return(a=i.getValue())!=null?a:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:r,getContext:ae(()=>[e,n,t,i],(a,l,d,u)=>({table:a,column:l,row:d,cell:u,getValue:u.getValue,renderValue:u.renderValue}),le(e.options,"debugCells","cell.getContext"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(i,n,t,e)},{}),i}function su(e,t,n,o){var r,i;const l={...e._getDefaultColumnDef(),...t},d=l.accessorKey;let u=(r=(i=l.id)!=null?i:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?r:typeof l.header=="string"?l.header:void 0,_;if(l.accessorFn?_=l.accessorFn:d&&(d.includes(".")?_=f=>{let c=f;for(const p of d.split(".")){var h;c=(h=c)==null?void 0:h[p],process.env.NODE_ENV!=="production"&&c===void 0&&console.warn(`"${p}" in deeply nested key "${d}" returned undefined.`)}return c}:_=f=>f[l.accessorKey]),!u)throw process.env.NODE_ENV!=="production"?new Error(l.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let g={id:`${String(u)}`,accessorFn:_,parent:o,depth:n,columnDef:l,columns:[],getFlatColumns:ae(()=>[!0],()=>{var f;return[g,...(f=g.columns)==null?void 0:f.flatMap(c=>c.getFlatColumns())]},le(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ae(()=>[e._getOrderColumnsFn()],f=>{var c;if((c=g.columns)!=null&&c.length){let h=g.columns.flatMap(p=>p.getLeafColumns());return f(h)}return[g]},le(e.options,"debugColumns","column.getLeafColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(g,e);return g}const dn="debugHeaders";function Rs(e,t,n){var o;let i={id:(o=n.id)!=null?o:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],l=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(l),a.push(d)};return l(i),a},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(i,e)}),i}const au={createTable:e=>{e.getHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>{var i,a;const l=(i=o?.map(g=>n.find(f=>f.id===g)).filter(Boolean))!=null?i:[],d=(a=r?.map(g=>n.find(f=>f.id===g)).filter(Boolean))!=null?a:[],u=n.filter(g=>!(o!=null&&o.includes(g.id))&&!(r!=null&&r.includes(g.id)));return Lo(t,[...l,...u,...d],e)},le(e.options,dn,"getHeaderGroups")),e.getCenterHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>(n=n.filter(i=>!(o!=null&&o.includes(i.id))&&!(r!=null&&r.includes(i.id))),Lo(t,n,e,"center")),le(e.options,dn,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var r;const i=(r=o?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?r:[];return Lo(t,i,e,"left")},le(e.options,dn,"getLeftHeaderGroups")),e.getRightHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var r;const i=(r=o?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?r:[];return Lo(t,i,e,"right")},le(e.options,dn,"getRightHeaderGroups")),e.getFooterGroups=ae(()=>[e.getHeaderGroups()],t=>[...t].reverse(),le(e.options,dn,"getFooterGroups")),e.getLeftFooterGroups=ae(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),le(e.options,dn,"getLeftFooterGroups")),e.getCenterFooterGroups=ae(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),le(e.options,dn,"getCenterFooterGroups")),e.getRightFooterGroups=ae(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),le(e.options,dn,"getRightFooterGroups")),e.getFlatHeaders=ae(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,dn,"getFlatHeaders")),e.getLeftFlatHeaders=ae(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,dn,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ae(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,dn,"getCenterFlatHeaders")),e.getRightFlatHeaders=ae(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,dn,"getRightFlatHeaders")),e.getCenterLeafHeaders=ae(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),le(e.options,dn,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ae(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),le(e.options,dn,"getLeftLeafHeaders")),e.getRightLeafHeaders=ae(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),le(e.options,dn,"getRightLeafHeaders")),e.getLeafHeaders=ae(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,o)=>{var r,i,a,l,d,u;return[...(r=(i=t[0])==null?void 0:i.headers)!=null?r:[],...(a=(l=n[0])==null?void 0:l.headers)!=null?a:[],...(d=(u=o[0])==null?void 0:u.headers)!=null?d:[]].map(_=>_.getLeafHeaders()).flat()},le(e.options,dn,"getLeafHeaders"))}};function Lo(e,t,n,o){var r,i;let a=0;const l=function(f,c){c===void 0&&(c=1),a=Math.max(a,c),f.filter(h=>h.getIsVisible()).forEach(h=>{var p;(p=h.columns)!=null&&p.length&&l(h.columns,c+1)},0)};l(e);let d=[];const u=(f,c)=>{const h={depth:c,id:[o,`${c}`].filter(Boolean).join("_"),headers:[]},p=[];f.forEach(v=>{const w=[...p].reverse()[0],C=v.column.depth===h.depth;let x,I=!1;if(C&&v.column.parent?x=v.column.parent:(x=v.column,I=!0),w&&w?.column===x)w.subHeaders.push(v);else{const z=Rs(n,x,{id:[o,c,x.id,v?.id].filter(Boolean).join("_"),isPlaceholder:I,placeholderId:I?`${p.filter(A=>A.column===x).length}`:void 0,depth:c,index:p.length});z.subHeaders.push(v),p.push(z)}h.headers.push(v),v.headerGroup=h}),d.push(h),c>0&&u(p,c-1)},_=t.map((f,c)=>Rs(n,f,{depth:a,index:c}));u(_,a-1),d.reverse();const g=f=>f.filter(h=>h.column.getIsVisible()).map(h=>{let p=0,v=0,w=[0];h.subHeaders&&h.subHeaders.length?(w=[],g(h.subHeaders).forEach(x=>{let{colSpan:I,rowSpan:z}=x;p+=I,w.push(z)})):p=1;const C=Math.min(...w);return v=v+C,h.colSpan=p,h.rowSpan=v,{colSpan:p,rowSpan:v}});return g((r=(i=d[0])==null?void 0:i.headers)!=null?r:[]),d}const Mr=(e,t,n,o,r,i,a)=>{let l={id:t,index:o,original:n,depth:r,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(l._valuesCache.hasOwnProperty(d))return l._valuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return l._valuesCache[d]=u.accessorFn(l.original,o),l._valuesCache[d]},getUniqueValues:d=>{if(l._uniqueValuesCache.hasOwnProperty(d))return l._uniqueValuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(l._uniqueValuesCache[d]=u.columnDef.getUniqueValues(l.original,o),l._uniqueValuesCache[d]):(l._uniqueValuesCache[d]=[l.getValue(d)],l._uniqueValuesCache[d])},renderValue:d=>{var u;return(u=l.getValue(d))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>ru(l.subRows,d=>d.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let d=[],u=l;for(;;){const _=u.getParentRow();if(!_)break;d.push(_),u=_}return d.reverse()},getAllCells:ae(()=>[e.getAllLeafColumns()],d=>d.map(u=>iu(e,l,u,u.id)),le(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ae(()=>[l.getAllCells()],d=>d.reduce((u,_)=>(u[_.column.id]=_,u),{}),le(e.options,"debugRows","getAllCellsByColumnId"))};for(let d=0;d<e._features.length;d++){const u=e._features[d];u==null||u.createRow==null||u.createRow(l,e)}return l},lu={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Zs=(e,t,n)=>{var o,r;const i=n==null||(o=n.toString())==null?void 0:o.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(i))};Zs.autoRemove=e=>$n(e);const Js=(e,t,n)=>{var o;return!!(!((o=e.getValue(t))==null||(o=o.toString())==null)&&o.includes(n))};Js.autoRemove=e=>$n(e);const Qs=(e,t,n)=>{var o;return((o=e.getValue(t))==null||(o=o.toString())==null?void 0:o.toLowerCase())===n?.toLowerCase()};Qs.autoRemove=e=>$n(e);const ea=(e,t,n)=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(n)};ea.autoRemove=e=>$n(e);const na=(e,t,n)=>!n.some(o=>{var r;return!((r=e.getValue(t))!=null&&r.includes(o))});na.autoRemove=e=>$n(e)||!(e!=null&&e.length);const ta=(e,t,n)=>n.some(o=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(o)});ta.autoRemove=e=>$n(e)||!(e!=null&&e.length);const oa=(e,t,n)=>e.getValue(t)===n;oa.autoRemove=e=>$n(e);const ra=(e,t,n)=>e.getValue(t)==n;ra.autoRemove=e=>$n(e);const Nr=(e,t,n)=>{let[o,r]=n;const i=e.getValue(t);return i>=o&&i<=r};Nr.resolveFilterValue=e=>{let[t,n]=e,o=typeof t!="number"?parseFloat(t):t,r=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(o)?-1/0:o,a=n===null||Number.isNaN(r)?1/0:r;if(i>a){const l=i;i=a,a=l}return[i,a]},Nr.autoRemove=e=>$n(e)||$n(e[0])&&$n(e[1]);const Vn={includesString:Zs,includesStringSensitive:Js,equalsString:Qs,arrIncludes:ea,arrIncludesAll:na,arrIncludesSome:ta,equals:oa,weakEquals:ra,inNumberRange:Nr};function $n(e){return e==null||e===""}const cu={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:wn("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=n?.getValue(e.id);return typeof o=="string"?Vn.includesString:typeof o=="number"?Vn.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Vn.equals:Array.isArray(o)?Vn.arrIncludes:Vn.weakEquals},e.getFilterFn=()=>{var n,o;return Ao(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(o=t.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?n:Vn[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,r;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((o=t.options.enableColumnFilters)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(o=>o.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,o;return(n=(o=t.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(o=>{const r=e.getFilterFn(),i=o?.find(_=>_.id===e.id),a=Xn(n,i?i.value:void 0);if(ia(r,a,e)){var l;return(l=o?.filter(_=>_.id!==e.id))!=null?l:[]}const d={id:e.id,value:a};if(i){var u;return(u=o?.map(_=>_.id===e.id?d:_))!=null?u:[]}return o!=null&&o.length?[...o,d]:[d]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),o=r=>{var i;return(i=Xn(t,r))==null?void 0:i.filter(a=>{const l=n.find(d=>d.id===a.id);if(l){const d=l.getFilterFn();if(ia(d,a.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=t=>{var n,o;e.setColumnFilters(t?[]:(n=(o=e.initialState)==null?void 0:o.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function ia(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Fr={sum:(e,t,n)=>n.reduce((o,r)=>{const i=r.getValue(e);return o+(typeof i=="number"?i:0)},0),min:(e,t,n)=>{let o;return n.forEach(r=>{const i=r.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},max:(e,t,n)=>{let o;return n.forEach(r=>{const i=r.getValue(e);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},extent:(e,t,n)=>{let o,r;return n.forEach(i=>{const a=i.getValue(e);a!=null&&(o===void 0?a>=a&&(o=r=a):(o>a&&(o=a),r<a&&(r=a)))}),[o,r]},mean:(e,t)=>{let n=0,o=0;if(t.forEach(r=>{let i=r.getValue(e);i!=null&&(i=+i)>=i&&(++n,o+=i)}),n)return o/n},median:(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!ou(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),r=n.sort((i,a)=>i-a);return n.length%2!==0?r[o]:(r[o-1]+r[o])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},du={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:wn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(o=>o!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,o;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((o=t.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=n?.getValue(e.id);if(typeof o=="number")return Fr.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Fr.extent},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return Ao(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(o=t.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?n:Fr[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,o;e.setGrouping(t?[]:(n=(o=e.initialState)==null?void 0:o.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const o=t.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,o)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=n.subRows)!=null&&r.length)}}};function uu(e,t,n){if(!(t!=null&&t.length)||!n)return e;const o=e.filter(i=>!t.includes(i.id));return n==="remove"?o:[...t.map(i=>e.find(a=>a.id===i)).filter(Boolean),...o]}const fu={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:wn("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ae(n=>[Pt(t,n)],n=>n.findIndex(o=>o.id===e.id),le(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var o;return((o=Pt(t,n)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;const r=Pt(t,n);return((o=r[r.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ae(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,o)=>r=>{let i=[];if(!(t!=null&&t.length))i=r;else{const a=[...t],l=[...r];for(;l.length&&a.length;){const d=a.shift(),u=l.findIndex(_=>_.id===d);u>-1&&i.push(l.splice(u,1)[0])}i=[...i,...l]}return uu(i,n,o)},le(e.options,"debugTable","_getOrderColumnsFn"))}},zr=()=>({left:[],right:[]}),_u={getInitialState:e=>({columnPinning:zr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:wn("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);t.setColumnPinning(r=>{var i,a;if(n==="right"){var l,d;return{left:((l=r?.left)!=null?l:[]).filter(g=>!(o!=null&&o.includes(g))),right:[...((d=r?.right)!=null?d:[]).filter(g=>!(o!=null&&o.includes(g))),...o]}}if(n==="left"){var u,_;return{left:[...((u=r?.left)!=null?u:[]).filter(g=>!(o!=null&&o.includes(g))),...o],right:((_=r?.right)!=null?_:[]).filter(g=>!(o!=null&&o.includes(g)))}}return{left:((i=r?.left)!=null?i:[]).filter(g=>!(o!=null&&o.includes(g))),right:((a=r?.right)!=null?a:[]).filter(g=>!(o!=null&&o.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,i,a;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((i=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(l=>l.id),{left:o,right:r}=t.getState().columnPinning,i=n.some(l=>o?.includes(l)),a=n.some(l=>r?.includes(l));return i?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();return r?(n=(o=t.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,o,r)=>{const i=[...o??[],...r??[]];return n.filter(a=>!i.includes(a.column.id))},le(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,o)=>(o??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),le(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,o)=>(o??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),le(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,o;return e.setColumnPinning(t?zr():(n=(o=e.initialState)==null?void 0:o.columnPinning)!=null?n:zr())},e.getIsSomeColumnsPinned=t=>{var n;const o=e.getState().columnPinning;if(!t){var r,i;return!!((r=o.left)!=null&&r.length||(i=o.right)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},e.getLeftLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),le(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),le(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o)=>{const r=[...n??[],...o??[]];return t.filter(i=>!r.includes(i.id))},le(e.options,"debugColumns","getCenterLeafColumns"))}};function gu(e){return e||(typeof document<"u"?document:null)}const Po={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Dr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),pu={getDefaultColumnDef:()=>Po,getInitialState:e=>({columnSizing:{},columnSizingInfo:Dr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:wn("columnSizing",e),onColumnSizingInfoChange:wn("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,r;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Po.minSize,(o=i??e.columnDef.size)!=null?o:Po.size),(r=e.columnDef.maxSize)!=null?r:Po.maxSize)},e.getStart=ae(n=>[n,Pt(t,n),t.getState().columnSizing],(n,o)=>o.slice(0,e.getIndex(n)).reduce((r,i)=>r+i.getSize(),0),le(t.options,"debugColumns","getStart")),e.getAfter=ae(n=>[n,Pt(t,n),t.getState().columnSizing],(n,o)=>o.slice(e.getIndex(n)+1).reduce((r,i)=>r+i.getSize(),0),le(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:o,...r}=n;return r})},e.getCanResize=()=>{var n,o;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((o=t.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var i;n+=(i=r.column.getSize())!=null?i:0}};return o(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const o=t.getColumn(e.column.id),r=o?.getCanResize();return i=>{if(!o||!r||(i.persist==null||i.persist(),Ar(i)&&i.touches&&i.touches.length>1))return;const a=e.getSize(),l=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[o.id,o.getSize()]],d=Ar(i)?Math.round(i.touches[0].clientX):i.clientX,u={},_=(w,C)=>{typeof C=="number"&&(t.setColumnSizingInfo(x=>{var I,z;const A=t.options.columnResizeDirection==="rtl"?-1:1,N=(C-((I=x?.startOffset)!=null?I:0))*A,L=Math.max(N/((z=x?.startSize)!=null?z:0),-.999999);return x.columnSizingStart.forEach(P=>{let[k,O]=P;u[k]=Math.round(Math.max(O+O*L,0)*100)/100}),{...x,deltaOffset:N,deltaPercentage:L}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(x=>({...x,...u})))},g=w=>_("move",w),f=w=>{_("end",w),t.setColumnSizingInfo(C=>({...C,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},c=gu(n),h={moveHandler:w=>g(w.clientX),upHandler:w=>{c?.removeEventListener("mousemove",h.moveHandler),c?.removeEventListener("mouseup",h.upHandler),f(w.clientX)}},p={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),g(w.touches[0].clientX),!1),upHandler:w=>{var C;c?.removeEventListener("touchmove",p.moveHandler),c?.removeEventListener("touchend",p.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),f((C=w.touches[0])==null?void 0:C.clientX)}},v=hu()?{passive:!1}:!1;Ar(i)?(c?.addEventListener("touchmove",p.moveHandler,v),c?.addEventListener("touchend",p.upHandler,v)):(c?.addEventListener("mousemove",h.moveHandler,v),c?.addEventListener("mouseup",h.upHandler,v)),t.setColumnSizingInfo(w=>({...w,startOffset:d,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Dr():(n=e.initialState.columnSizingInfo)!=null?n:Dr())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0}}};let To=null;function hu(){if(typeof To=="boolean")return To;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return To=e,To}function Ar(e){return e.type==="touchstart"}const mu={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:wn("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(o=>({...o,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,o;const r=e.columns;return(n=r.length?r.some(i=>i.getIsVisible()):(o=t.getState().columnVisibility)==null?void 0:o[e.id])!=null?n:!0},e.getCanHide=()=>{var n,o;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((o=t.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ae(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),le(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ae(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,o,r)=>[...n,...o,...r],le(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,o)=>ae(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),le(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var o;e.setColumnVisibility(n?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,i)=>({...r,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;e.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}};function Pt(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const vu={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},bu={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:wn("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const o=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,o,r,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=t.options.enableGlobalFilter)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Vn.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return Ao(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[o])!=null?t:Vn[o]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},wu={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:wn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var r,i;e.setExpanded(o?{}:(r=(i=e.initialState)==null?void 0:i.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const a=i.split(".");o=Math.max(o,a.length)}),o},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(o=>{var r;const i=o===!0?!0:!!(o!=null&&o[e.id]);let a={};if(o===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{a[l]=!0}):a=o,n=(r=n)!=null?r:!i,!i&&n)return{...a,[e.id]:!0};if(i&&!n){const{[e.id]:l,...d}=a;return d}return o})},e.getIsExpanded=()=>{var n;const o=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:o===!0||o?.[e.id])},e.getCanExpand=()=>{var n,o,r;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((o=t.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)o=t.getRow(o.parentId,!0),n=o.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Lr=0,Pr=10,Tr=()=>({pageIndex:Lr,pageSize:Pr}),yu={getInitialState:e=>({...e,pagination:{...Tr(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:wn("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=o=>{const r=i=>Xn(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?Tr():(r=e.initialState.pagination)!=null?r:Tr())},e.setPageIndex=o=>{e.setPagination(r=>{let i=Xn(o,r.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,a)),{...r,pageIndex:i}})},e.resetPageIndex=o=>{var r,i;e.setPageIndex(o?Lr:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:Lr)},e.resetPageSize=o=>{var r,i;e.setPageSize(o?Pr:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:Pr)},e.setPageSize=o=>{e.setPagination(r=>{const i=Math.max(1,Xn(o,r.pageSize)),a=r.pageSize*r.pageIndex,l=Math.floor(a/i);return{...r,pageIndex:l,pageSize:i}})},e.setPageCount=o=>e.setPagination(r=>{var i;let a=Xn(o,(i=e.options.pageCount)!=null?i:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...r,pageCount:a}}),e.getPageOptions=ae(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((i,a)=>a)),r},le(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:o}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:o<r-1},e.previousPage=()=>e.setPageIndex(o=>o-1),e.nextPage=()=>e.setPageIndex(o=>o+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var o;return(o=e.options.rowCount)!=null?o:e.getPrePaginationRowModel().rows.length}}},Or=()=>({top:[],bottom:[]}),Cu={getInitialState:e=>({rowPinning:Or(),...e}),getDefaultOptions:e=>({onRowPinningChange:wn("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,o,r)=>{const i=o?e.getLeafRows().map(d=>{let{id:u}=d;return u}):[],a=r?e.getParentRows().map(d=>{let{id:u}=d;return u}):[],l=new Set([...a,e.id,...i]);t.setRowPinning(d=>{var u,_;if(n==="bottom"){var g,f;return{top:((g=d?.top)!=null?g:[]).filter(p=>!(l!=null&&l.has(p))),bottom:[...((f=d?.bottom)!=null?f:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)]}}if(n==="top"){var c,h;return{top:[...((c=d?.top)!=null?c:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)],bottom:((h=d?.bottom)!=null?h:[]).filter(p=>!(l!=null&&l.has(p)))}}return{top:((u=d?.top)!=null?u:[]).filter(p=>!(l!=null&&l.has(p))),bottom:((_=d?.bottom)!=null?_:[]).filter(p=>!(l!=null&&l.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:r}=t.options;return typeof o=="function"?o(e):(n=o??r)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:o,bottom:r}=t.getState().rowPinning,i=n.some(l=>o?.includes(l)),a=n.some(l=>r?.includes(l));return i?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();if(!r)return-1;const i=(n=r==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:l}=a;return l});return(o=i?.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?Or():(n=(o=e.initialState)==null?void 0:o.rowPinning)!=null?n:Or())},e.getIsSomeRowsPinned=t=>{var n;const o=e.getState().rowPinning;if(!t){var r,i;return!!((r=o.top)!=null&&r.length||(i=o.bottom)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},e._getPinnedRows=(t,n,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(n??[]).map(a=>{const l=e.getRow(a,!0);return l.getIsAllParentsExpanded()?l:null}):(n??[]).map(a=>t.find(l=>l.id===a))).filter(Boolean).map(a=>({...a,position:o}))},e.getTopRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),le(e.options,"debugRows","getTopRows")),e.getBottomRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),le(e.options,"debugRows","getBottomRows")),e.getCenterRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,o)=>{const r=new Set([...n??[],...o??[]]);return t.filter(i=>!r.has(i.id))},le(e.options,"debugRows","getCenterRows"))}},xu={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:wn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const o={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):r.forEach(i=>{delete o[i.id]}),o})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const o=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(i=>{Vr(r,i.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?jr(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?jr(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?jr(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=!!(t.length&&Object.keys(n).length);return o&&t.some(r=>r.getCanSelect()&&!n[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some(r=>!n[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,o)=>{const r=e.getIsSelected();t.setRowSelection(i=>{var a;if(n=typeof n<"u"?n:!r,e.getCanSelect()&&r===n)return i;const l={...i};return Vr(l,e.id,n,(a=o?.selectChildren)!=null?a:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return qr(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Br(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Br(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return o=>{var r;n&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}}},Vr=(e,t,n,o,r)=>{var i;const a=r.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),a.getCanSelect()&&(e[t]=!0)):delete e[t],o&&(i=a.subRows)!=null&&i.length&&a.getCanSelectSubRows()&&a.subRows.forEach(l=>Vr(e,l.id,n,o,r))};function jr(e,t){const n=e.getState().rowSelection,o=[],r={},i=function(a,l){return a.map(d=>{var u;const _=qr(d,n);if(_&&(o.push(d),r[d.id]=d),(u=d.subRows)!=null&&u.length&&(d={...d,subRows:i(d.subRows)}),_)return d}).filter(Boolean)};return{rows:i(t.rows),flatRows:o,rowsById:r}}function qr(e,t){var n;return(n=t[e.id])!=null?n:!1}function Br(e,t,n){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,i=!1;return e.subRows.forEach(a=>{if(!(i&&!r)&&(a.getCanSelect()&&(qr(a,t)?i=!0:r=!1),a.subRows&&a.subRows.length)){const l=Br(a,t);l==="all"?i=!0:(l==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}const Hr=/([0-9]+)/gm,Su=(e,t,n)=>sa(Yn(e.getValue(n)).toLowerCase(),Yn(t.getValue(n)).toLowerCase()),$u=(e,t,n)=>sa(Yn(e.getValue(n)),Yn(t.getValue(n))),ku=(e,t,n)=>Gr(Yn(e.getValue(n)).toLowerCase(),Yn(t.getValue(n)).toLowerCase()),Iu=(e,t,n)=>Gr(Yn(e.getValue(n)),Yn(t.getValue(n))),Eu=(e,t,n)=>{const o=e.getValue(n),r=t.getValue(n);return o>r?1:o<r?-1:0},Mu=(e,t,n)=>Gr(e.getValue(n),t.getValue(n));function Gr(e,t){return e===t?0:e>t?1:-1}function Yn(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function sa(e,t){const n=e.split(Hr).filter(Boolean),o=t.split(Hr).filter(Boolean);for(;n.length&&o.length;){const r=n.shift(),i=o.shift(),a=parseInt(r,10),l=parseInt(i,10),d=[a,l].sort();if(isNaN(d[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(d[1]))return isNaN(a)?-1:1;if(a>l)return 1;if(l>a)return-1}return n.length-o.length}const Tt={alphanumeric:Su,alphanumericCaseSensitive:$u,text:ku,textCaseSensitive:Iu,datetime:Eu,basic:Mu},Nu=[au,mu,fu,_u,lu,cu,vu,bu,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:wn("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const r of n){const i=r?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Tt.datetime;if(typeof i=="string"&&(o=!0,i.split(Hr).length>1))return Tt.alphanumeric}return o?Tt.text:Tt.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw new Error;return Ao(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(o=t.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?n:Tt[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{const r=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(a=>{const l=a?.find(c=>c.id===e.id),d=a?.findIndex(c=>c.id===e.id);let u=[],_,g=i?n:r==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&o?l?_="toggle":_="add":a!=null&&a.length&&d!==a.length-1?_="replace":l?_="toggle":_="replace",_==="toggle"&&(i||r||(_="remove")),_==="add"){var f;u=[...a,{id:e.id,desc:g}],u.splice(0,u.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else _==="toggle"?u=a.map(c=>c.id===e.id?{...c,desc:g}:c):_==="remove"?u=a.filter(c=>c.id!==e.id):u=[{id:e.id,desc:g}];return u})},e.getFirstSortDir=()=>{var n,o;return((n=(o=e.columnDef.sortDescFirst)!=null?o:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var o,r;const i=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==i&&((o=t.options.enableSortingRemoval)==null||o)&&(!(n&&(r=t.options.enableMultiRemove)!=null)||r)?!1:a==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,o;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((o=t.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return(n=(o=e.columnDef.enableMultiSort)!=null?o:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const o=(n=t.getState().sorting)==null?void 0:n.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,o;return(n=(o=t.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return o=>{n&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:(n=(o=e.initialState)==null?void 0:o.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},du,wu,yu,Cu,xu,pu];function Fu(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...Nu,...(t=e._features)!=null?t:[]];let r={_features:o};const i=r._features.reduce((f,c)=>Object.assign(f,c.getDefaultOptions==null?void 0:c.getDefaultOptions(r)),{}),a=f=>r.options.mergeOptions?r.options.mergeOptions(i,f):{...i,...f};let d={...{},...(n=e.initialState)!=null?n:{}};r._features.forEach(f=>{var c;d=(c=f.getInitialState==null?void 0:f.getInitialState(d))!=null?c:d});const u=[];let _=!1;const g={_features:o,options:{...i,...e},initialState:d,_queue:f=>{u.push(f),_||(_=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();_=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{r.setState(r.initialState)},setOptions:f=>{const c=Xn(f,r.options);r.options=a(c)},getState:()=>r.options.state,setState:f=>{r.options.onStateChange==null||r.options.onStateChange(f)},_getRowId:(f,c,h)=>{var p;return(p=r.options.getRowId==null?void 0:r.options.getRowId(f,c,h))!=null?p:`${h?[h.id,c].join("."):c}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(f,c)=>{let h=(c?r.getPrePaginationRowModel():r.getRowModel()).rowsById[f];if(!h&&(h=r.getCoreRowModel().rowsById[f],!h))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${f}`):new Error;return h},_getDefaultColumnDef:ae(()=>[r.options.defaultColumn],f=>{var c;return f=(c=f)!=null?c:{},{header:h=>{const p=h.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:h=>{var p,v;return(p=(v=h.renderValue())==null||v.toString==null?void 0:v.toString())!=null?p:null},...r._features.reduce((h,p)=>Object.assign(h,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...f}},le(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:ae(()=>[r._getColumnDefs()],f=>{const c=function(h,p,v){return v===void 0&&(v=0),h.map(w=>{const C=su(r,w,v,p),x=w;return C.columns=x.columns?c(x.columns,C,v+1):[],C})};return c(f)},le(e,"debugColumns","getAllColumns")),getAllFlatColumns:ae(()=>[r.getAllColumns()],f=>f.flatMap(c=>c.getFlatColumns()),le(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ae(()=>[r.getAllFlatColumns()],f=>f.reduce((c,h)=>(c[h.id]=h,c),{}),le(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ae(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(f,c)=>{let h=f.flatMap(p=>p.getLeafColumns());return c(h)},le(e,"debugColumns","getAllLeafColumns")),getColumn:f=>{const c=r._getAllFlatColumnsById()[f];return process.env.NODE_ENV!=="production"&&!c&&console.error(`[Table] Column with id '${f}' does not exist.`),c}};Object.assign(r,g);for(let f=0;f<r._features.length;f++){const c=r._features[f];c==null||c.createTable==null||c.createTable(r)}return r}function zu(){return e=>ae(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(r,i,a){i===void 0&&(i=0);const l=[];for(let u=0;u<r.length;u++){const _=Mr(e,e._getRowId(r[u],u,a),r[u],u,i,void 0,a?.id);if(n.flatRows.push(_),n.rowsById[_.id]=_,l.push(_),e.options.getSubRows){var d;_.originalSubRows=e.options.getSubRows(r[u],u),(d=_.originalSubRows)!=null&&d.length&&(_.subRows=o(_.originalSubRows,i+1,_))}}return l};return n.rows=o(t),n},le(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Du(e){const t=[],n=o=>{var r;t.push(o),(r=o.subRows)!=null&&r.length&&o.getIsExpanded()&&o.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Au(e,t,n){return n.options.filterFromLeafRows?Lu(e,t,n):Pu(e,t,n)}function Lu(e,t,n){var o;const r=[],i={},a=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,u){u===void 0&&(u=0);const _=[];for(let f=0;f<d.length;f++){var g;let c=d[f];const h=Mr(n,c.id,c.original,c.index,c.depth,void 0,c.parentId);if(h.columnFilters=c.columnFilters,(g=c.subRows)!=null&&g.length&&u<a){if(h.subRows=l(c.subRows,u+1),c=h,t(c)&&!h.subRows.length){_.push(c),i[c.id]=c,r.push(c);continue}if(t(c)||h.subRows.length){_.push(c),i[c.id]=c,r.push(c);continue}}else c=h,t(c)&&(_.push(c),i[c.id]=c,r.push(c))}return _};return{rows:l(e),flatRows:r,rowsById:i}}function Pu(e,t,n){var o;const r=[],i={},a=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,u){u===void 0&&(u=0);const _=[];for(let f=0;f<d.length;f++){let c=d[f];if(t(c)){var g;if((g=c.subRows)!=null&&g.length&&u<a){const p=Mr(n,c.id,c.original,c.index,c.depth,void 0,c.parentId);p.subRows=l(c.subRows,u+1),c=p}_.push(c),r.push(c),i[c.id]=c}}return _};return{rows:l(e),flatRows:r,rowsById:i}}function Tu(){return e=>ae(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,o)=>{if(!t.rows.length||!(n!=null&&n.length)&&!o){for(let f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const r=[],i=[];(n??[]).forEach(f=>{var c;const h=e.getColumn(f.id);if(!h)return;const p=h.getFilterFn();if(!p){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${h.id}.`);return}r.push({id:f.id,filterFn:p,resolvedValue:(c=p.resolveFilterValue==null?void 0:p.resolveFilterValue(f.value))!=null?c:f.value})});const a=(n??[]).map(f=>f.id),l=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());o&&l&&d.length&&(a.push("__global__"),d.forEach(f=>{var c;i.push({id:f.id,filterFn:l,resolvedValue:(c=l.resolveFilterValue==null?void 0:l.resolveFilterValue(o))!=null?c:o})}));let u,_;for(let f=0;f<t.flatRows.length;f++){const c=t.flatRows[f];if(c.columnFilters={},r.length)for(let h=0;h<r.length;h++){u=r[h];const p=u.id;c.columnFilters[p]=u.filterFn(c,p,u.resolvedValue,v=>{c.columnFiltersMeta[p]=v})}if(i.length){for(let h=0;h<i.length;h++){_=i[h];const p=_.id;if(_.filterFn(c,p,_.resolvedValue,v=>{c.columnFiltersMeta[p]=v})){c.columnFilters.__global__=!0;break}}c.columnFilters.__global__!==!0&&(c.columnFilters.__global__=!1)}}const g=f=>{for(let c=0;c<a.length;c++)if(f.columnFilters[a[c]]===!1)return!1;return!0};return Au(t.rows,g,e)},le(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Ou(e){return t=>ae(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,o)=>{if(!o.rows.length)return o;const{pageSize:r,pageIndex:i}=n;let{rows:a,flatRows:l,rowsById:d}=o;const u=r*i,_=u+r;a=a.slice(u,_);let g;t.options.paginateExpandedRows?g={rows:a,flatRows:l,rowsById:d}:g=Du({rows:a,flatRows:l,rowsById:d}),g.flatRows=[];const f=c=>{g.flatRows.push(c),c.subRows.length&&c.subRows.forEach(f)};return g.rows.forEach(f),g},le(t.options,"debugTable","getPaginationRowModel"))}function Vu(){return e=>ae(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const o=e.getState().sorting,r=[],i=o.filter(d=>{var u;return(u=e.getColumn(d.id))==null?void 0:u.getCanSort()}),a={};i.forEach(d=>{const u=e.getColumn(d.id);u&&(a[d.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const l=d=>{const u=d.map(_=>({..._}));return u.sort((_,g)=>{for(let c=0;c<i.length;c+=1){var f;const h=i[c],p=a[h.id],v=p.sortUndefined,w=(f=h?.desc)!=null?f:!1;let C=0;if(v){const x=_.getValue(h.id),I=g.getValue(h.id),z=x===void 0,A=I===void 0;if(z||A){if(v==="first")return z?-1:1;if(v==="last")return z?1:-1;C=z&&A?0:z?v:-v}}if(C===0&&(C=p.sortingFn(_,g,h.id)),C!==0)return w&&(C*=-1),p.invertSorting&&(C*=-1),C}return _.index-g.index}),u.forEach(_=>{var g;r.push(_),(g=_.subRows)!=null&&g.length&&(_.subRows=l(_.subRows))}),u};return{rows:l(n.rows),flatRows:r,rowsById:n.rowsById}},le(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
673
20
  * react-table
674
21
  *
675
22
  * Copyright (c) TanStack
@@ -678,5 +25,5 @@ Content-Type: `+d.contentType+`\r
678
25
  * LICENSE.md file in the root directory of this source tree.
679
26
  *
680
27
  * @license MIT
681
- */function In(e,t){return e?fp(e)?N.createElement(e,t):e:null}function fp(e){return _p(e)||typeof e=="function"||gp(e)}function _p(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function gp(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function hp(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=N.useState(()=>({current:op(t)})),[o,r]=N.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...o,...e.state},onStateChange:i=>{r(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}const Me={checkbox_container:"_checkbox_container_17g3o_1",checkbox_wrapper:"_checkbox_wrapper_17g3o_13",label_text:"_label_text_17g3o_33",hint_text:"_hint_text_17g3o_51",checkbox:"_checkbox_17g3o_1",input:"_input_17g3o_99",checkbox_svg:"_checkbox_svg_17g3o_153",custom_icon:"_custom_icon_17g3o_195",checked:"_checked_17g3o_225",indeterminate:"_indeterminate_17g3o_227",radius_none:"_radius_none_17g3o_235",radius_sm:"_radius_sm_17g3o_243",radius_md:"_radius_md_17g3o_251",radius_lg:"_radius_lg_17g3o_259",radius_full:"_radius_full_17g3o_267",sm:"_sm_17g3o_275",lg:"_lg_17g3o_301",secondary:"_secondary_17g3o_327",success:"_success_17g3o_335",warning:"_warning_17g3o_343",danger:"_danger_17g3o_351",solid:"_solid_17g3o_377",outline:"_outline_17g3o_391",disabled:"_disabled_17g3o_439",readonly:"_readonly_17g3o_521",no_animation:"_no_animation_17g3o_597",line_through:"_line_through_17g3o_615",lineThrough:"_lineThrough_17g3o_1",checkbox_group:"_checkbox_group_17g3o_659",label:"_label_17g3o_33",marca_requerido:"_marca_requerido_17g3o_689",description:"_description_17g3o_697",checkboxes:"_checkboxes_17g3o_711",vertical:"_vertical_17g3o_721",horizontal:"_horizontal_17g3o_729",error_message:"_error_message_17g3o_739",input_validacion:"_input_validacion_17g3o_795"},Fl=v.createContext(null),Pl=()=>v.useContext(Fl),Ll=v.forwardRef((e,t)=>{const{children:n,label:o,hint:r,isSelected:s,defaultChecked:i,isIndeterminate:l=!1,isDisabled:c=!1,isReadOnly:d=!1,isRequired:_=!1,lineThrough:g=!1,onlyIcon:f=!1,disableAnimation:u=!1,customCheckIcon:p,size:h="md",color:m="primary",customColor:y,radius:w="md",variant:C="solid",className:k="",classNames:A={},onChange:T,value:M,name:P,...L}=e,E=Pl(),B=v.useId(),V=v.useRef(null),$=s!==void 0,[b,S]=v.useState(i??!1),O=!!E,D=O&&M?E.value.includes(M):!1,x=O?D:$?s:b,I=c||E?.isDisabled,F=d||E?.isReadOnly,j=_||E?.isRequired,z=P||E?.name,H=O?!1:j;v.useEffect(()=>{V.current&&(V.current.indeterminate=l)},[l]);const X=ue=>{if(I||F)return;const oe=ue.target.checked;O&&M?E.onChange(M):($||S(oe),T?.(oe))},G=o||n;return a.jsxs("div",{className:W(Me.checkbox_container,{[Me.disabled]:I,[Me.readonly]:F},A.base,k),children:[a.jsxs("label",{className:W(Me.checkbox_wrapper,Me[h],!y&&Me[m],Me[C],Me[`radius_${w}`],{[Me.checked]:x,[Me.indeterminate]:l,[Me.disabled]:I,[Me.readonly]:F,[Me.line_through]:g&&x,[Me.no_animation]:u}),style:y?{"--checkbox-custom-color":y}:void 0,children:[a.jsxs("span",{className:Me.checkbox,children:[a.jsx("input",{ref:ue=>{V.current=ue,typeof t=="function"?t(ue):t&&(t.current=ue)},id:B,type:"checkbox",className:Me.input,checked:x,onChange:X,disabled:I,readOnly:F,required:H,value:M,name:z,...L}),p?a.jsx("span",{className:Me.custom_icon,children:p}):a.jsx("svg",{className:Me.checkbox_svg,viewBox:"0 0 22 22","aria-hidden":"true",children:a.jsx("path",{fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:l?"M6,11 L16,11":"M5.5,11.3L9,14.8L20.2,3.3l0,0c-0.5-1-1.5-1.8-2.7-1.8h-13c-1.7,0-3,1.3-3,3v13c0,1.7,1.3,3,3,3h13 c1.7,0,3-1.3,3-3v-13c0-0.4-0.1-0.8-0.3-1.2"})})]}),!f&&G&&a.jsx("span",{className:W(Me.label_text,A.label),children:G})]}),r&&a.jsx("span",{className:W(Me.hint_text,A.label),children:r})]})});Ll.displayName="Checkbox";const eo=v.memo(Ll),Ol=({label:e,children:t,description:n,errorMessage:o,isInvalid:r=!1,orientation:s="vertical",className:i,value:l,defaultValue:c=[],onChange:d,isDisabled:_=!1,isReadOnly:g=!1,isRequired:f=!1,name:u,justifyContent:p="flex-start",options:h,optionValueKey:m,optionLabelKey:y,optionDisabledKey:w,optionDescriptionKey:C})=>{const k=l!==void 0,[A,T]=v.useState(c),M=k?l:A,P=f&&M.length===0,L=r||P,E=P&&!o?"Selecciona al menos una opción":o,B=$=>{if(_||g)return;const b=M.includes($)?M.filter(S=>S!==$):[...M,$];k||T(b),d?.(b)},V=p==="center"?"center":p==="flex-end"?"right":"left";return a.jsxs("div",{className:W(Me.checkbox_group,Me[s],{[Me.invalid]:L,[Me.disabled]:_,[Me.readonly]:g},i),role:"group","aria-required":f,"aria-invalid":L,style:{textAlign:V},children:[e&&a.jsxs("div",{className:Me.label,children:[e,f&&a.jsx("span",{className:Me.marca_requerido,children:" *"})]}),n&&a.jsx("div",{className:Me.description,children:n}),a.jsx(Fl.Provider,{value:{value:M,onChange:B,isDisabled:_,isReadOnly:g,isRequired:f,name:u},children:a.jsx("div",{className:W(Me.checkboxes,Me[s]),style:{justifyContent:p},children:h&&h.length>0?h.map(($,b)=>{let S,O,D=!1,x;if(typeof $=="object"&&$!==null){const I=m??"value",F=y??"label",j=w??"isDisabled",z=C??"description",H=$[I],X=$[F];S=String(H!==void 0?H:b),O=X;const G=$[j];D=typeof G=="boolean"?G:!1;const ue=$[z];x=typeof ue=="string"?ue:void 0}else S=String($),O=$;return a.jsx(eo,{value:S,isDisabled:D,hint:x,children:O},S)}):t})}),f&&a.jsx("input",{type:"checkbox",required:f,checked:M.length>0,readOnly:!0,tabIndex:-1,"aria-hidden":"true",className:Me.input_validacion}),E&&L&&a.jsx("div",{className:Me.error_message,children:E})]})};Ol.displayName="CheckboxGroup";const He={contenedor:"_contenedor_kj261_1",contenedor_superior:"_contenedor_superior_kj261_17",input_con_icono:"_input_con_icono_kj261_35",icono_busqueda:"_icono_busqueda_kj261_49",input_busqueda:"_input_busqueda_kj261_75",contenedor_acciones_botones:"_contenedor_acciones_botones_kj261_147",contenedor_acciones:"_contenedor_acciones_kj261_147",columna:"_columna_kj261_183",encabezados:"_encabezados_kj261_201",boton_basico:"_boton_basico_kj261_265",texto_filtros:"_texto_filtros_kj261_289",menu_configuraciones:"_menu_configuraciones_kj261_321",boton_excel:"_boton_excel_kj261_349",contenedor_tabla:"_contenedor_tabla_kj261_369",contenedor_datos:"_contenedor_datos_kj261_387",datos:"_datos_kj261_395",seleccionada:"_seleccionada_kj261_431",boton_acciones:"_boton_acciones_kj261_475"};function pp(e,t,n=3){const o=Math.floor(n/2);let r=e-o;r<1&&(r=1),r+n-1>t&&(r=Math.max(1,t-n+1));const s=Math.min(n,t);return Array.from({length:s},(i,l)=>r+l)}function mp(e,t){return t===0?0:e>=t?t-1:e<0?0:e}function vp(e){return e?{asc:" ↑",desc:" ↓"}[e]??null:null}function Nn(e,t){const n=new Map;t.getFlatHeaders().forEach(i=>n.set(i.column.id,i));const o=n.get(e);if(o)return In(o.column.columnDef.header,o.getContext());const r=t.getAllLeafColumns().find(i=>i.id===e),s=r?.columnDef.header;return typeof s=="string"||typeof s=="number"?s:r?.id??e}function zl(e,t){const n=e.getVisibleCells().find(o=>o.column.id===t);return n?In(n.column.columnDef.cell,n.getContext()):null}function Bl(e,t){return t?e.getVisibleCells().map(o=>o.column.id).includes(t):!1}function bp(e,t,n){return e.getVisibleCells().filter(o=>o.column.id!=="actions"&&o.column.id!==t&&o.column.id!==n)}function wp(e,t){if(t===0)return"";if(t===1)return As(e[0].nombre.toLowerCase());if(t===2)return`${As(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const n=e.slice(0,2).map(r=>r.nombre.toLowerCase()),o=t-2;return`${As(n.join(", "))} y ${o>1?`otros ${o}`:"otro"} más`}function As(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Vl(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}const jl=v.createContext(null),Ds=jl;function yp({children:e,data:t,columns:n,controls:o,loading:r,primerasColumnas:s,tamanioPaginaInicial:i=10,filtros:l,descargarExcel:c,actualizarTabla:d,selectorFilas:_=[],sinDatosProps:g,...f}){const[u,p]=v.useState(""),h=lh(u,200),m=Qo("only screen and (max-width: 830px)"),[y,w]=v.useState({pageIndex:0,pageSize:i}),[C,k]=v.useState({}),A=v.useMemo(()=>{const I=[];if(_.length>0&&!m){const F={id:"select",header:({table:j})=>a.jsx(eo,{color:"secondary",isSelected:j.getIsAllPageRowsSelected(),isIndeterminate:j.getIsSomePageRowsSelected()&&!j.getIsAllPageRowsSelected(),onChange:z=>j.toggleAllPageRowsSelected(!!z)}),cell:({row:j})=>a.jsx(eo,{color:"primary",isSelected:j.getIsSelected(),isDisabled:!j.getCanSelect(),onChange:z=>j.toggleSelected(z)}),enableSorting:!1,enableHiding:!1};I.push(F)}if(I.push(...n),o?.length){const F={id:"actions",header:"Acciones",cell:j=>a.jsx("div",{className:He.contenedor_acciones,children:o.map(z=>"contenido"in z?a.jsx(gn,{content:z.nombre,variant:"default",size:"sm",placement:"top",children:a.jsx("span",{children:z.contenido(j.row.original,He.boton_acciones)},z.id)},z.id):a.jsx(gn,{content:z.nombre,variant:"default",size:"sm",placement:"top",children:a.jsx(st,{id:z.id,size:"sm",radius:"md",variant:"light",isIconOnly:!0,onClick:()=>z.evento(j.row.original),className:He.boton_acciones,children:z.icono})},z.id))}),enableSorting:!1,enableHiding:!1};I.push(F)}return I},[n,o,_,m]),T=v.useMemo(()=>{const I=A.map(j=>"accessorKey"in j?String(j.accessorKey):"id"in j?String(j.id):"").filter(Boolean),F=I.indexOf("actions");return F>-1&&F<I.length-1&&(I.splice(F,1),I.push("actions")),I},[A]),[M,P]=v.useState(T),L=v.useCallback((I,F,j)=>{if(!j)return!0;const z=Vl(j),H=I.getValue(F);return H==null?!1:Vl(String(H)).includes(z)},[]),E=hp({data:t,columns:A,state:{pagination:y,globalFilter:h,columnOrder:M,rowSelection:C},globalFilterFn:L,enableRowSelection:_.length>0,onRowSelectionChange:k,onPaginationChange:w,onColumnOrderChange:P,getCoreRowModel:rp(),getSortedRowModel:up(),getFilteredRowModel:cp(),getPaginationRowModel:dp(),autoResetPageIndex:!1}),B=E.getPageCount();v.useEffect(()=>{const I=mp(y.pageIndex,B);I!==y.pageIndex&&w(F=>({...F,pageIndex:I}))},[B]),v.useEffect(()=>{h!==void 0&&E.setPageIndex(0)},[h]);const V=v.useMemo(()=>E.getAllLeafColumns().filter(I=>I.id!=="actions"&&I.id!=="select"&&I.getCanHide?.()),[E]),$=v.useCallback(I=>{const j=n.find(z=>"accessorKey"in z?z.accessorKey===I:z.id===I)?.header;return typeof j=="string"||typeof j=="number"?String(j):I},[n]),b=v.useCallback(()=>{E.setColumnVisibility({}),E.setPageSize(i),E.setPageIndex(0),E.resetRowSelection(),P(T)},[E,i,T]),S=v.useCallback(I=>{const F=Math.max(1,Math.min(200,I));E.setPageSize(F),E.setPageIndex(0)},[E]),O=v.useCallback(I=>{P(F=>typeof I=="function"?I(F):I)},[]),x={state:{ordenColumnas:M,table:E,columns:A,controls:o,loading:r,primerasColumnas:[String(s[0]),String(s[1])],inputBusqueda:u,setInputBusqueda:p,filtros:l,descargarExcel:c,actualizarTabla:d,selectorFilas:_,sinDatosProps:g,...f},todasLasColumnas:V,etiquetaColumna:$,restaurarConfiguracion:b,cambiarPageSize:S,cambiarOrdenColumnas:O};return a.jsx(jl.Provider,{value:x,children:e})}function Cp(){const e=v.useContext(Ds);if(!e)throw new Error("useTablaContext debe usarse dentro de TablaDatosProvider");return e}function nn(){const e=v.useContext(Ds);return e||null}const Ht={contenedor:"_contenedor_1dhtd_1",popover:"_popover_1dhtd_9",popover_entrada:"_popover_entrada_1dhtd_45",popoverEntrada:"_popoverEntrada_1dhtd_1",popover_salida:"_popover_salida_1dhtd_53",popoverSalida:"_popoverSalida_1dhtd_1",ventana:"_ventana_1dhtd_109",panel:"_panel_1dhtd_127",panel_forward:"_panel_forward_1dhtd_145",panelForwardIn:"_panelForwardIn_1dhtd_1",panel_backward:"_panel_backward_1dhtd_153",panelBackwardIn:"_panelBackwardIn_1dhtd_1",header:"_header_1dhtd_209",titulo:"_titulo_1dhtd_233"};function ql(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function Hl(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M9.29 15.88L13.17 12L9.29 8.12a.996.996 0 1 1 1.41-1.41l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3a.996.996 0 0 1-1.41 0c-.38-.39-.39-1.03 0-1.42"})})}function xp(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M21.71 20.29L18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.39M11 18a7 7 0 1 1 7-7a7 7 0 0 1-7 7"})})}function Sp(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"m2.859 2.877l12.57-1.795a.5.5 0 0 1 .571.494v20.848a.5.5 0 0 1-.57.494L2.858 21.123a1 1 0 0 1-.859-.99V3.867a1 1 0 0 1 .859-.99M17 3h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4zm-6.8 9L13 8h-2.4L9 10.286L7.4 8H5l2.8 4L5 16h2.4L9 13.714L10.6 16H13z"})})}function $p(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9.145 17.704v-3.976c0-.381 0-.572-.044-.75a1.5 1.5 0 0 0-.192-.446c-.1-.155-.238-.286-.515-.548L3.578 7.43a2.648 2.648 0 0 1 1.82-4.572h13.189a2.664 2.664 0 0 1 1.852 4.579l-4.765 4.607c-.27.261-.405.392-.501.545a1.5 1.5 0 0 0-.187.441c-.044.176-.044.364-.044.74v3.935c0 .542 0 .813-.062 1.057a2 2 0 0 1-.641 1.027c-.192.163-.436.282-.923.52c-1.14.557-1.709.835-2.172.835a2 2 0 0 1-1.795-1.121c-.204-.416-.204-1.05-.204-2.318"})})}function kp(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[a.jsx("path",{fill:"currentColor",d:"M12.079 2.25c-4.794 0-8.734 3.663-9.118 8.333H2a.75.75 0 0 0-.528 1.283l1.68 1.666a.75.75 0 0 0 1.056 0l1.68-1.666a.75.75 0 0 0-.528-1.283h-.893c.38-3.831 3.638-6.833 7.612-6.833a7.66 7.66 0 0 1 6.537 3.643a.75.75 0 1 0 1.277-.786A9.16 9.16 0 0 0 12.08 2.25"}),a.jsx("path",{fill:"currentColor",d:"M20.841 10.467a.75.75 0 0 0-1.054 0L18.1 12.133a.75.75 0 0 0 .527 1.284h.899c-.381 3.83-3.651 6.833-7.644 6.833a7.7 7.7 0 0 1-6.565-3.644a.75.75 0 1 0-1.276.788a9.2 9.2 0 0 0 7.84 4.356c4.809 0 8.766-3.66 9.151-8.333H22a.75.75 0 0 0 .527-1.284z",opacity:".5"})]})}function Ep(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[a.jsx("circle",{cx:"12",cy:"12",r:"3"}),a.jsx("path",{d:"M13.765 2.152C13.398 2 12.932 2 12 2s-1.398 0-1.765.152a2 2 0 0 0-1.083 1.083c-.092.223-.129.484-.143.863a1.62 1.62 0 0 1-.79 1.353a1.62 1.62 0 0 1-1.567.008c-.336-.178-.579-.276-.82-.308a2 2 0 0 0-1.478.396C4.04 5.79 3.806 6.193 3.34 7s-.7 1.21-.751 1.605a2 2 0 0 0 .396 1.479c.148.192.355.353.676.555c.473.297.777.803.777 1.361s-.304 1.064-.777 1.36c-.321.203-.529.364-.676.556a2 2 0 0 0-.396 1.479c.052.394.285.798.75 1.605c.467.807.7 1.21 1.015 1.453a2 2 0 0 0 1.479.396c.24-.032.483-.13.819-.308a1.62 1.62 0 0 1 1.567.008c.483.28.77.795.79 1.353c.014.38.05.64.143.863a2 2 0 0 0 1.083 1.083C10.602 22 11.068 22 12 22s1.398 0 1.765-.152a2 2 0 0 0 1.083-1.083c.092-.223.129-.483.143-.863c.02-.558.307-1.074.79-1.353a1.62 1.62 0 0 1 1.567-.008c.336.178.579.276.819.308a2 2 0 0 0 1.479-.396c.315-.242.548-.646 1.014-1.453s.7-1.21.751-1.605a2 2 0 0 0-.396-1.479c-.148-.192-.355-.353-.676-.555A1.62 1.62 0 0 1 19.562 12c0-.558.304-1.064.777-1.36c.321-.203.529-.364.676-.556a2 2 0 0 0 .396-1.479c-.052-.394-.285-.798-.75-1.605c-.467-.807-.7-1.21-1.015-1.453a2 2 0 0 0-1.479-.396c-.24.032-.483.13-.82.308a1.62 1.62 0 0 1-1.566-.008a1.62 1.62 0 0 1-.79-1.353c-.014-.38-.05-.64-.143-.863a2 2 0 0 0-1.083-1.083Z"})]})})}function Ip(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:a.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M256 448c-97.974 0-178.808-73.383-190.537-168.183l42.341-5.293c9.123 73.734 71.994 130.809 148.196 130.809c82.475 0 149.333-66.858 149.333-149.333S338.475 106.667 256 106.667c-50.747 0-95.581 25.312-122.567 64h79.9v42.666H64V64h42.667v71.31C141.866 91.812 195.685 64 256 64c106.039 0 192 85.961 192 192s-85.961 192-192 192",clipRule:"evenodd"})})}function Np(e){return a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",...e,children:[a.jsx("rect",{x:"6",y:"3.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),a.jsx("rect",{x:"6",y:"7.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),a.jsx("rect",{x:"6",y:"11.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"})]})}function Mp(e){return a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[a.jsx("rect",{x:"3",y:"3",width:"4",height:"14",rx:"1",fill:"currentColor"}),a.jsx("rect",{x:"8",y:"3",width:"9",height:"14",rx:"1",fill:"currentColor",opacity:".3"})]})}function Ap(e){return a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[a.jsx("rect",{x:"3",y:"3",width:"14",height:"4",rx:"1",fill:"currentColor"}),a.jsx("rect",{x:"3",y:"8",width:"14",height:"9",rx:"1",fill:"currentColor",opacity:".3"})]})}function Dp(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M11 13H6q-.425 0-.712-.288T5 12t.288-.712T6 11h5V6q0-.425.288-.712T12 5t.713.288T13 6v5h5q.425 0 .713.288T19 12t-.288.713T18 13h-5v5q0 .425-.288.713T12 19t-.712-.288T11 18z"})})}function Tp(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M7.5 12.5q-.213 0-.356-.144T7 11.999t.144-.356t.356-.143h9q.213 0 .356.144t.144.357t-.144.356t-.356.143z"})})}function Fp(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:a.jsx("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"})})}function Pp(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none",children:[a.jsx("path",{fill:"currentColor",d:"M7.378 11.63h-.75zm0 .926l-.562.497a.75.75 0 0 0 1.08.044zm2.141-1.015a.75.75 0 0 0-1.038-1.082zm-2.958-1.038a.75.75 0 1 0-1.122.994zm8.37-1.494a.75.75 0 1 0 1.102-1.018zM12.045 6.25c-2.986 0-5.416 2.403-5.416 5.38h1.5c0-2.137 1.747-3.88 3.916-3.88zm-5.416 5.38v.926h1.5v-.926zm1.269 1.467l1.622-1.556l-1.038-1.082l-1.622 1.555zm.042-1.039l-1.378-1.555l-1.122.994l1.377 1.556zm8.094-4.067a5.42 5.42 0 0 0-3.99-1.741v1.5a3.92 3.92 0 0 1 2.889 1.26zm.585 3.453l.56-.498a.75.75 0 0 0-1.08-.043zm-2.139 1.014a.75.75 0 1 0 1.04 1.082zm2.96 1.04a.75.75 0 0 0 1.12-.997zm-8.393 1.507a.75.75 0 0 0-1.094 1.026zm2.888 2.745c2.993 0 5.434-2.4 5.434-5.38h-1.5c0 2.135-1.753 3.88-3.934 3.88zm5.434-5.38v-.926h-1.5v.926zm-1.27-1.467l-1.619 1.555l1.04 1.082l1.618-1.555zm-.04 1.04l1.38 1.554l1.122-.996l-1.381-1.555zM7.952 16.03a5.45 5.45 0 0 0 3.982 1.719v-1.5c-1.143 0-2.17-.48-2.888-1.245z"}),a.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",opacity:".5"})]})})}function Lp(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:a.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"})})}function Op(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:a.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"})})}const zp=({titulo:e,onBack:t})=>a.jsxs("header",{className:Ht.header,children:[a.jsx(st,{isIconOnly:!0,variant:"light",onClick:t,"aria-label":"Regresar",children:a.jsx(ql,{})}),a.jsx("h3",{className:Ht.titulo,children:e})]}),hn={contenedor:"_contenedor_1qz45_1",lista:"_lista_1qz45_13",item:"_item_1qz45_45",item_dragging:"_item_dragging_1qz45_75",icono_drag:"_icono_drag_1qz45_93",nombre:"_nombre_1qz45_129",checkbox:"_checkbox_1qz45_159"};function Bp(){const e=nn(),[t,n]=v.useState(null);if(!e)return null;const{state:o,todasLasColumnas:r,etiquetaColumna:s,cambiarOrdenColumnas:i}=e,{ordenColumnas:l}=o,c=g=>f=>{n(g),f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",g)},d=g=>f=>{f.preventDefault(),!(!t||t===g)&&i?.(u=>{const p=[...u],h=p.indexOf(t),m=p.indexOf(g);return h===-1||m===-1?u:(p.splice(h,1),p.splice(m,0,t),p)})},_=()=>n(null);return a.jsx("div",{className:hn.contenedor,children:a.jsx("ul",{className:hn.lista,children:l.map(g=>{const f=r.find(m=>m.id===g);if(!f)return null;const u=f.getCanHide?.()??!0,p=f.getIsVisible(),h=t===f.id;return a.jsxs("li",{className:`${hn.item} ${h?hn.item_dragging:""}`,draggable:!0,onDragStart:c(f.id),onDragOver:d(f.id),onDrop:_,onDragEnd:_,children:[a.jsx("span",{className:hn.icono_drag,"aria-label":"Arrastrar columna",children:a.jsx(Np,{})}),a.jsx("span",{className:hn.nombre,children:s(f.id)}),a.jsx(eo,{size:"md",color:"primary",isSelected:p,isDisabled:!u,onChange:m=>f.toggleVisibility(m),className:hn.checkbox})]},f.id)})})})}const to={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function Vp(){const e=nn(),[t,n]=v.useState(""),o=v.useRef(null),r=e?.state.table?.getState().pagination.pageSize??10;if(v.useEffect(()=>n(String(r)),[r]),!e)return null;const{cambiarPageSize:s}=e,i=g=>Math.max(Ts,Math.min(Fs,g)),l=g=>{const f=r+g;f>=Ts&&f<=Fs&&s?.(f)},c=()=>{const g=parseInt(t,10),f=!isNaN(g)&&g>0?i(g):r;s?.(f),n(String(f))},d=g=>{({Enter:()=>{c(),o.current?.blur()},Escape:()=>{n(String(r)),o.current?.blur()},ArrowUp:()=>{g.preventDefault(),l(1),setTimeout(()=>o.current?.select(),0)},ArrowDown:()=>{g.preventDefault(),l(-1),setTimeout(()=>o.current?.select(),0)}})[g.key]?.()},_=g=>{const f=g.target.value;(f===""||/^\d+$/.test(f))&&n(f)};return a.jsxs("div",{className:to.contenido,children:[a.jsx("p",{className:to.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),a.jsxs("div",{className:to.control,children:[a.jsx(st,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(-1),"aria-label":"Disminuir filas",disabled:r<=Ts,children:a.jsx(Tp,{style:{fontSize:"var(--gaps-6)"}})}),a.jsx("div",{className:to.valor,children:a.jsx("input",{ref:o,type:"text",inputMode:"numeric",value:t,onChange:_,onKeyDown:d,onFocus:()=>o.current?.select(),onBlur:c,className:to.input,"aria-label":"Número de filas por página"})}),a.jsx(st,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(1),"aria-label":"Aumentar filas",disabled:r>=Fs,children:a.jsx(Dp,{})})]})]})}const _t={contenedor:"_contenedor_1lwmx_1",menu:"_menu_1lwmx_11",item:"_item_1lwmx_25",icono_contenedor:"_icono_contenedor_1lwmx_111",icono_restaurar:"_icono_restaurar_1lwmx_143",texto:"_texto_1lwmx_153",nombre:"_nombre_1lwmx_165",descripcion:"_descripcion_1lwmx_183",chevron:"_chevron_1lwmx_201",divider:"_divider_1lwmx_227"};function jp({navegar:e}){const t=nn();return a.jsxs("div",{className:_t.contenedor,children:[a.jsx("nav",{className:_t.menu,children:Rp.map(({id:n,icono:o,nombre:r,descripcion:s})=>a.jsxs("button",{className:_t.item,onClick:()=>e(n),children:[a.jsx("div",{className:_t.icono_contenedor,children:a.jsx(o,{})}),a.jsxs("div",{className:_t.texto,children:[a.jsx("span",{className:_t.nombre,children:r}),a.jsx("span",{className:_t.descripcion,children:s})]}),a.jsx(Hl,{className:_t.chevron})]},n))}),a.jsx("div",{className:_t.divider}),a.jsx("div",{className:_t.menu,children:a.jsxs("button",{className:_t.item,onClick:t?.restaurarConfiguracion,children:[a.jsx("div",{className:_t.icono_contenedor,children:a.jsx(Ip,{className:_t.icono_restaurar})}),a.jsxs("div",{className:_t.texto,children:[a.jsx("span",{className:_t.nombre,children:"Restaurar configuración"}),a.jsx("span",{className:_t.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const Ts=1,Fs=200,Rl=250,qp=200,Hp={panelPrincipal:{component:jp},panelColumnas:{component:Bp,titulo:"Columnas visibles"},panelFilas:{component:Vp,titulo:"Filas por página"}},Rp=[{id:"panelColumnas",icono:Mp,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:Ap,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}];function Up(e,t,n){const o=v.useRef(n);o.current=n;const r=v.useRef(e);r.current=e;const s=v.useCallback(i=>{const l=i.target;o.current.some(d=>d.current?.contains(l))||r.current()},[]);v.useEffect(()=>{if(!t)return;const i=setTimeout(()=>{document.addEventListener("mousedown",s)},100);return()=>{clearTimeout(i),document.removeEventListener("mousedown",s)}},[t,s])}function Ul(e,t){v.useEffect(()=>{if(!t)return;const n=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t,e])}function Wp(e,t,n,{width:o,offsetRight:r=0,offsetLeft:s=0,offsetTop:i=0,offsetBottom:l=0,shiftPadding:c=8}){const[d,_]=v.useState({top:0,left:0}),g=Qo("only screen and (max-width: 480px)"),f=v.useCallback(()=>{if(!e.current)return{top:0,left:0};const u=e.current.getBoundingClientRect(),p=c;let h=u.bottom+i,m=0;g?m=u.right-o-s+r:m=u.right-o+r-s;const y=t.current?.offsetHeight||400;h+y>window.innerHeight-p&&(h=u.top-y-l,h<p&&(h=p));const w=p,C=window.innerWidth-o-p;return m=Math.max(w,Math.min(m,C)),{top:h,left:m}},[g,o,r,s,i,l,c,e,t]);return v.useEffect(()=>{if(!n||!e.current)return;const u=()=>{_(f())};return u(),window.addEventListener("resize",u),window.addEventListener("scroll",u,!0),()=>{window.removeEventListener("resize",u),window.removeEventListener("scroll",u,!0)}},[n,f,e]),d}function Gp(e){v.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function Kp(){const[e,t]=v.useState(!1),[n,o]=v.useState(!1),[r,s]=v.useState("panelPrincipal"),[i,l]=v.useState(null),c=v.useRef(null),d=v.useRef(null),_=v.useRef(null);Gp(n),Up(()=>f(),n,[c,d]),Ul(()=>f(),n);const g=Wp(c,d,n,{width:Rl,offsetRight:6,offsetTop:-2,shiftPadding:8});v.useEffect(()=>{e&&(o(!0),l(null))},[e]),v.useEffect(()=>()=>{_.current&&clearTimeout(_.current)},[]);function f(){n&&(t(!1),_.current=window.setTimeout(()=>{o(!1),s("panelPrincipal"),l(null)},qp))}function u(m){l(m==="panelPrincipal"?"backward":"forward"),s(m)}const p=Hp[r],h=p.component;return a.jsxs("div",{className:Ht.contenedor,children:[a.jsx(st,{isIconOnly:!0,ref:c,variant:"light",onClick:()=>t(m=>!m),"aria-haspopup":"dialog","aria-expanded":e,children:a.jsx(Ep,{})}),n&&c.current&&Dn.createPortal(a.jsx("div",{ref:d,className:`${Ht.popover} ${e?Ht.popover_entrada:Ht.popover_salida}`,role:"dialog",style:{top:`${g.top}px`,left:`${g.left}px`,width:Rl},children:a.jsx("div",{className:Ht.ventana,children:a.jsxs("div",{className:W([Ht.panel,Ht[`panel_${i}`]]),children:[p.titulo&&a.jsx(zp,{titulo:p.titulo,onBack:()=>u("panelPrincipal")}),a.jsx(h,{navegar:u})]},r)})}),document.body)]})}function Xp(){const e=nn();if(!e)return null;const{state:t}=e,{inputBusqueda:n,setInputBusqueda:o,loading:r,filtros:s,actualizarTabla:i,descargarExcel:l,paginacion:c}=t,{abrirFiltros:d,filtrosAplicados:_=[]}=s||{},g=_?.length||0;return a.jsxs("section",{className:He.contenedor_superior,children:[a.jsxs("div",{className:He.input_con_icono,id:"buscador-tabla",children:[a.jsx(xp,{className:He.icono_busqueda}),a.jsx("input",{type:"text",placeholder:"Buscar en tabla...",value:n??"",onChange:f=>o&&o(f.target.value),className:He.input_busqueda})]}),a.jsxs("div",{className:He.contenedor_acciones_botones,children:[a.jsxs("div",{className:He.contenedor_acciones,children:[c?.hayMasDatos&&a.jsxs(st,{id:"cargar-mas-datos",variant:"light",className:He.boton_basico,disabled:r,onClick:c.onCargarMasDatos,children:[a.jsx(Pp,{}),r?"Actualizando...":"Más datos"]}),d!==void 0&&a.jsxs(st,{id:"boton-filtros",onClick:d,variant:"light",className:He.boton_basico,children:[a.jsx($p,{})," Filtros"]}),g>0?a.jsxs("div",{className:He.texto_filtros,id:"filtros-aplicados",children:[a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:a.jsx("path",{d:"M2 4h12M4 8h8M6 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),a.jsx("p",{children:wp(_,g)})]}):null]}),l!==void 0?a.jsxs(st,{onClick:l,className:`${He.boton_basico} ${He.boton_excel}`,children:[a.jsx(Sp,{})," Excel"]}):null]}),a.jsxs("div",{className:He.contenedor_acciones,children:[i!==void 0&&a.jsx(gn,{content:"Actualiza los últimos datos guardados",children:a.jsx(st,{id:"actualizar-tabla",variant:"light",isIconOnly:!0,className:He.boton_basico,disabled:i?.cargando,onClick:i?.onClick,children:a.jsx(kp,{})})}),a.jsx("div",{className:He.menu_configuraciones,id:"configuraciones-tabla",children:a.jsx(Kp,{})})]})]})}const Ft={contenedor_paginacion:"_contenedor_paginacion_1l3vz_1",info_paginacion:"_info_paginacion_1l3vz_19",contenedor_botones:"_contenedor_botones_1l3vz_37",boton_paginacion:"_boton_paginacion_1l3vz_87",pagina_activa:"_pagina_activa_1l3vz_107",boton_num_paginacion:"_boton_num_paginacion_1l3vz_117"};function Yp(){const e=nn();if(!e)return null;const{state:t}=e,{table:n}=t,o=n.getPrePaginationRowModel().rows.length,r=n.getPageCount()||1,{pageIndex:s}=n.getState().pagination,i=s+1,l=pp(i,r),c=n.getCanPreviousPage(),d=n.getCanNextPage(),_=r>1,g=s===0,f=s===r-1,u=()=>{c&&n.previousPage()},p=()=>{d&&n.nextPage()},h=w=>{n.setPageIndex(w-1)},m=()=>{g||n.firstPage()},y=()=>{f||n.lastPage()};return a.jsxs("section",{className:Ft.contenedor_paginacion,id:"paginacion-tabla",children:[a.jsxs("p",{className:Ft.info_paginacion,id:"paginacion-total-documentos",children:["Documentos: ",o]}),_&&a.jsxs("div",{className:Ft.contenedor_botones,id:"paginacion-numerador-pags",children:[!g&&a.jsx(Lp,{id:"paginacion-flecha-inicio",onClick:m,"aria-label":"Ir a la primera página","aria-disabled":g,className:Ft.boton_paginacion}),c&&a.jsx(ql,{id:"paginacion-flecha-izq",onClick:u,"aria-disabled":!c,className:Ft.boton_paginacion}),a.jsx("div",{id:"paginacion-numero-pag",children:l.map(w=>a.jsx("button",{type:"button",onClick:()=>h(w),"aria-current":w===i?"page":void 0,className:w===i?Ft.pagina_activa:Ft.boton_num_paginacion,children:w},w))}),d&&a.jsx(Hl,{id:"paginacion-flecha-der",onClick:p,"aria-disabled":!d,className:Ft.boton_paginacion}),!f&&a.jsx(Op,{id:"paginacion-flecha-fin",onClick:y,"aria-label":"Ir a la última página","aria-disabled":f,className:Ft.boton_paginacion})]}),a.jsxs("p",{className:Ft.info_paginacion,id:"paginacion-total-pags",children:["Página ",i," de ",r]})]})}const Ne={contenedor_tabla_cards:"_contenedor_tabla_cards_zuvsb_1",contenedor_card:"_contenedor_card_zuvsb_11",contenedor_encabezado_card:"_contenedor_encabezado_card_zuvsb_25",contenedor_columna_card:"_contenedor_columna_card_zuvsb_47",card_label:"_card_label_zuvsb_57",card_valor:"_card_valor_zuvsb_69",card_segundo_valor:"_card_segundo_valor_zuvsb_83",contenedor_contenido_cards:"_contenedor_contenido_cards_zuvsb_93",contenedor_fila_card:"_contenedor_fila_card_zuvsb_105",card_fila_label:"_card_fila_label_zuvsb_119",card_fila_valor:"_card_fila_valor_zuvsb_137",contenedor_acciones_card:"_contenedor_acciones_card_zuvsb_153",boton_acciones:"_boton_acciones_zuvsb_171",boton_card:"_boton_card_zuvsb_207",boton_personalizado:"_boton_personalizado_zuvsb_237"};function Wl(e,t){if(t)return e.find(n=>n.accessorKey===t||n.id!==void 0&&n.id===String(t))}function Gl(e){if(e)return e.id??e.accessorKey}const Rt={skeleton_elemento:"_skeleton_elemento_5jnrx_1",skeleton_elemento_encabezado:"_skeleton_elemento_encabezado_5jnrx_23",skeleton_elemento_encabezado_segundo:"_skeleton_elemento_encabezado_segundo_5jnrx_73",skeleton_elemento_contenido:"_skeleton_elemento_contenido_5jnrx_99",skeleton_accion:"_skeleton_accion_5jnrx_107"};function Zp({filas:e,cantidadControles:t=0,table:n,idPrimeraColumna:o,idSegundaColumna:r}){const i=n.getAllLeafColumns().filter(c=>c.id!=="actions"&&c.id!==o&&c.id!==r),l=["25vw","30vw","20vw","28vw","22vw","26vw"];return a.jsx("section",{className:Ne.contenedor_tabla_cards,children:Array.from({length:e}).map((c,d)=>a.jsxs("article",{className:Ne.contenedor_card,children:[a.jsxs("div",{className:Ne.contenedor_encabezado_card,children:[a.jsx("div",{className:Ne.contenedor_columna_card,children:o&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ne.card_label,children:Nn(o,n)}),a.jsx("div",{className:Ne.card_valor,children:a.jsx("div",{className:`${Rt.skeleton_elemento} ${Rt.skeleton_elemento_encabezado}`})})]})}),a.jsx("div",{className:Ne.contenedor_columna_card,children:r&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ne.card_label,children:Nn(r,n)}),a.jsx("div",{className:Ne.card_segundo_valor,children:a.jsx("div",{className:`${Rt.skeleton_elemento} ${Rt.skeleton_elemento_encabezado_segundo}`})})]})})]}),a.jsx("div",{className:Ne.contenedor_contenido_cards,children:i.map((_,g)=>a.jsxs("div",{className:Ne.contenedor_fila_card,children:[a.jsx("div",{className:Ne.card_fila_label,children:Nn(_.id,n)}),a.jsx("div",{className:Ne.card_fila_valor,children:a.jsx("div",{className:`${Rt.skeleton_elemento} ${Rt.skeleton_elemento_contenido}`,style:{width:l[g%l.length]}})})]},_.id))}),t>0&&a.jsx("div",{className:Ne.contenedor_acciones_card,children:Array.from({length:Math.min(t,3)}).map((_,g)=>a.jsx("div",{className:Rt.skeleton_accion,children:a.jsx("div",{className:`${Rt.skeleton_elemento} ${Rt.skeleton_elemento_encabezado}`})},`accion-${g}`))})]},`skeleton-card-${d}`))})}const pn={contenedor:"_contenedor_53kvd_1",envolvedor_cuadricula:"_envolvedor_cuadricula_53kvd_33",svg_cuadricula:"_svg_cuadricula_53kvd_61",envolvedor_contenido:"_envolvedor_contenido_53kvd_77",icono_carpeta:"_icono_carpeta_53kvd_97",titulo:"_titulo_53kvd_111",descripcion:"_descripcion_53kvd_129"};function Kl(){const e=v.useContext(Ds),{sinDatosProps:t}=e?.state||{},{botonAccion:n,titulo:o="No se encontraron coincidencias",descripcion:r='Usa el botón "Filtros" para ampliar tu búsqueda.'}=t||{};return a.jsxs("div",{className:pn.contenedor,children:[a.jsx(Jp,{}),a.jsxs("div",{className:pn.envolvedor_contenido,children:[a.jsx(Qp,{}),a.jsx("h3",{className:pn.titulo,children:o}),a.jsx("p",{className:pn.descripcion,children:r}),n]})]})}function Jp(){return a.jsx("div",{className:pn.envolvedor_cuadricula,children:a.jsxs("svg",{className:pn.svg_cuadricula,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("defs",{children:a.jsx("pattern",{id:"patronCuadricula",width:"40",height:"40",patternUnits:"userSpaceOnUse",children:a.jsx("path",{d:"M 40 0 L 0 0 0 40",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),a.jsx("rect",{width:"100%",height:"100%",fill:"url(#patronCuadricula)"})]})})}function Qp(){return a.jsxs("svg",{className:pn.icono_carpeta,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M10 25C10 22.2386 12.2386 20 15 20H40L50 30H85C87.7614 30 90 32.2386 90 35V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V25Z",fill:"var(--color-placeholder)"}),a.jsx("path",{d:"M10 40C10 37.2386 12.2386 35 15 35H85C87.7614 35 90 37.2386 90 40V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V40Z",fill:"var(--base)",stroke:"var(--color-placeholder)",strokeWidth:"2"}),a.jsx("circle",{cx:"35",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),a.jsx("circle",{cx:"55",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),a.jsx("path",{d:"M42 65H48",stroke:"var(--color-primary-text)",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("circle",{cx:"78",cy:"78",r:"14",fill:"var(--brand-primary)"}),a.jsx("path",{d:"M78 71V85M71 78H85",stroke:"var(--base)",strokeWidth:"2.5",strokeLinecap:"round"})]})}const em=({fila:e,controls:t})=>(t?.length??0)>0?a.jsx("div",{className:Ne.contenedor_acciones_card,children:t?.map(o=>"contenido"in o?a.jsxs("span",{className:`${Ne.boton_personalizado} ${Ne.boton_acciones} ${Ne.boton_card}`,onClick:r=>{const s=r.currentTarget.querySelector("button");s&&!s.contains(r.target)&&s.click()},children:[o.contenido(e.original)," ",o.nombre]},o.id):a.jsxs("button",{id:o.id,type:"button",title:o.nombre,onClick:()=>o.evento(e.original),className:`${Ne.boton_acciones} ${Ne.boton_card}`,children:[o.icono," ",o.nombre]},o.id))}):null,tm=({columnasRestantes:e,table:t})=>e.length===0?null:a.jsx("div",{className:Ne.contenedor_contenido_cards,children:e.map(n=>a.jsxs("div",{className:Ne.contenedor_fila_card,children:[a.jsx("div",{className:Ne.card_fila_label,children:Nn(n.column.id,t)}),a.jsx("div",{className:Ne.card_fila_valor,children:In(n.column.columnDef.cell,n.getContext())})]},n.id))}),nm=({fila:e,table:t,idPrimeraColumna:n,idSegundaColumna:o})=>{const r=Bl(e,n),s=Bl(e,o);return a.jsxs("div",{className:Ne.contenedor_encabezado_card,children:[a.jsx("div",{className:Ne.contenedor_columna_card,children:n&&r&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ne.card_label,children:Nn(n,t)}),a.jsx("div",{className:Ne.card_valor,children:zl(e,n)})]})}),a.jsx("div",{className:Ne.contenedor_columna_card,children:o&&s&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ne.card_label,children:Nn(o,t)}),a.jsx("div",{className:Ne.card_segundo_valor,children:zl(e,o)})]})})]})};function om(){const e=nn();if(!e)return null;const{state:t}=e,{table:n,controls:o,primerasColumnas:r,loading:s,columns:i}=t;if(!n)return null;const l=i&&r?Wl(i,r[0]):void 0,c=i&&r?Wl(i,r[1]):void 0,d=Gl(l),_=Gl(c);if(s)return a.jsx(Zp,{filas:3,cantidadControles:o?.length??0,table:n,idPrimeraColumna:d,idSegundaColumna:_});const g=n.getRowModel().rows;return g.length===0?a.jsx("article",{className:Ne.contenedor_card,children:a.jsx(Kl,{})}):a.jsx("section",{className:Ne.contenedor_tabla_cards,children:g.map(f=>{const u=bp(f,d,_);return a.jsxs("article",{className:Ne.contenedor_card,children:[a.jsx(nm,{fila:f,table:n,idPrimeraColumna:d,idSegundaColumna:_}),a.jsx(tm,{columnasRestantes:u,table:n}),a.jsx(em,{fila:f,controls:o})]},f.id)})})}const Xl={filas:"_filas_un2v3_1",columnas:"_columnas_un2v3_43"},rm=({columnas:e,filas:t})=>a.jsx(a.Fragment,{children:Array.from({length:t}).map((n,o)=>a.jsx("tr",{className:Xl.filas,children:Array.from({length:e}).map((r,s)=>a.jsx("td",{className:Xl.columnas},`sk-cell-${o}-${s}`))},`sk-row-${o}`))}),mn={contenedor:"_contenedor_1mvgy_1",barra:"_barra_1mvgy_17",info:"_info_1mvgy_39",btn_cerrar:"_btn_cerrar_1mvgy_51",contador:"_contador_1mvgy_67",separador:"_separador_1mvgy_83",acciones:"_acciones_1mvgy_97"};function sm({totalSeleccionadas:e,acciones:t,filasSeleccionadas:n,onLimpiarSeleccion:o}){const[r,s]=v.useState(0),[i,l]=v.useState([]),[c,d]=v.useState([]),_=e>0,g=v.useRef(null);return Ul(o,_),v.useEffect(()=>{_&&(s(e),l(t),d(n))},[e,t,n,_]),a.jsx(po,{mostrar:_,tipo:"escalar",className:mn.contenedor,children:a.jsxs("div",{ref:g,className:mn.barra,children:[a.jsxs("div",{className:mn.info,children:[a.jsx(st,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:o,"aria-label":"Limpiar selección",className:mn.btn_cerrar,children:a.jsx(Fp,{})}),a.jsxs("p",{className:mn.contador,children:[r," filas seleccionadas"]})]}),a.jsx("div",{className:mn.separador}),a.jsx("div",{className:mn.acciones,children:i.map(f=>a.jsx("div",{children:f.componente(c)},f.id))})]})})}function im(){const e=nn();if(!e)return null;const{state:t}=e,{table:n,loading:o,columns:r,selectorFilas:s=[]}=t;if(!n)return null;const i=n.getHeaderGroups(),l=n.getRowModel().rows,c=r?.length??0,d=n.getSelectedRowModel().rows,_=d.length,g=()=>{n.resetRowSelection()};return a.jsxs(a.Fragment,{children:[a.jsxs("table",{className:He.contenedor_tabla,children:[a.jsx("thead",{children:i.map(f=>a.jsx("tr",{children:f.headers.map(u=>{const p=u.column.columnDef.meta?.style;return a.jsx("th",{className:He.encabezados,style:p,"data-columna":u.id,children:u.id==="select"?a.jsx("div",{children:In(u.column.columnDef.header,u.getContext())}):a.jsxs("div",{onClick:u.column.getToggleSortingHandler(),children:[In(u.column.columnDef.header,u.getContext()),vp(u.column.getIsSorted())]})},u.id)})},f.id))}),a.jsx("tbody",{className:He.contenedor_datos,children:o?a.jsx(rm,{columnas:c,filas:10}):l.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:c,style:{backgroundColor:"var(--base)"},children:a.jsx(Kl,{})})}):l.map(f=>a.jsx("tr",{className:`${He.datos} ${f.getIsSelected()?He.seleccionada:""}`,children:f.getVisibleCells().map(u=>{const p=u.column.columnDef.meta?.style;return a.jsx("td",{className:He.columna,style:p,"data-columna":u.column.id,children:In(u.column.columnDef.cell,u.getContext())},u.id)})},f.id))})]}),s?.length>0?a.jsx(sm,{totalSeleccionadas:_,acciones:s,filasSeleccionadas:d.map(f=>f.original),onLimpiarSeleccion:g}):null]})}function am({id:e}){const t=Qo("only screen and (max-width: 830px)");return a.jsxs("main",{className:He.contenedor,id:e,children:[a.jsx(Xp,{}),t?a.jsx(om,{}):a.jsx(im,{}),a.jsx(Yp,{})]})}function lm({id:e,...t}){return a.jsx(yp,{...t,children:a.jsx(am,{id:e})})}const Te={contenedor_radio:"_contenedor_radio_87ox4_1",envoltorio_radio:"_envoltorio_radio_87ox4_15",contenedor_label:"_contenedor_label_87ox4_33",texto_label:"_texto_label_87ox4_47",texto_descripcion:"_texto_descripcion_87ox4_65",marca_requerido:"_marca_requerido_87ox4_77",radio:"_radio_87ox4_85",input:"_input_87ox4_115",circulo_radio:"_circulo_radio_87ox4_141",punto_radio:"_punto_radio_87ox4_177",invalido:"_invalido_87ox4_207",solo_lectura:"_solo_lectura_87ox4_215",deshabilitado:"_deshabilitado_87ox4_227",tam_sm:"_tam_sm_87ox4_289",tam_lg:"_tam_lg_87ox4_315",color_primary:"_color_primary_87ox4_341",color_secondary:"_color_secondary_87ox4_349",color_success:"_color_success_87ox4_357",color_warning:"_color_warning_87ox4_365",color_danger:"_color_danger_87ox4_373",variante_card:"_variante_card_87ox4_381",grupo_radio:"_grupo_radio_87ox4_531",encabezado_grupo:"_encabezado_grupo_87ox4_545",label_grupo:"_label_grupo_87ox4_559",descripcion_grupo:"_descripcion_grupo_87ox4_573",contenedor_radios:"_contenedor_radios_87ox4_583",orientacion_vertical:"_orientacion_vertical_87ox4_593",orientacion_horizontal:"_orientacion_horizontal_87ox4_601",mensaje_error:"_mensaje_error_87ox4_609",grupo_invalido:"_grupo_invalido_87ox4_621",grupo_deshabilitado:"_grupo_deshabilitado_87ox4_629",grupo_solo_lectura:"_grupo_solo_lectura_87ox4_653",seleccionado:"_seleccionado_87ox4_679"},Yl=v.createContext(void 0),cm=()=>v.useContext(Yl),Ps=v.memo(v.forwardRef(({value:e,label:t,description:n,size:o="md",color:r="primary",customColor:s,variant:i="default",isDisabled:l=!1,isReadOnly:c=!1,isInvalid:d=!1,isRequired:_=!1,children:g,className:f="",onChange:u,...p},h)=>{const m=cm(),y=v.useId(),w=p.id||y,C=m?.name||p.name,k=m?.size||o,A=m?.color||r,T=m?.customColor||s,M=m?.variant||i,P=m?.isDisabled||l,L=m?.isReadOnly||c,E=m?.isInvalid||d,B=m?.isRequired||_,V=m?.value!==void 0?m.value===e:void 0,$=g||t,b=D=>{P||L||(m?.onChange&&m.onChange(e),u&&u(D))},S=[Te.contenedor_radio,Te[`tam_${k}`],!T&&Te[`color_${A}`],Te[`variante_${M}`],P&&Te.deshabilitado,L&&Te.solo_lectura,E&&Te.invalido,V&&Te.seleccionado,f].filter(Boolean).join(" "),O=T?{"--radio-custom-color":T}:void 0;return a.jsx("div",{className:S,style:O,children:a.jsxs("label",{className:Te.envoltorio_radio,htmlFor:w,children:[a.jsxs("div",{className:Te.radio,children:[a.jsx("input",{ref:h,type:"radio",id:w,name:C,value:e,checked:V,disabled:P,readOnly:L,required:B,"aria-invalid":E,className:Te.input,onChange:b,...p}),a.jsx("div",{className:Te.circulo_radio,children:a.jsx("div",{className:Te.punto_radio})})]})," ",$&&a.jsxs("div",{className:Te.contenedor_label,children:[a.jsxs("span",{className:Te.texto_label,children:[$,_&&!m&&a.jsx("span",{className:Te.marca_requerido,children:" *"})]}),n&&a.jsx("span",{className:Te.texto_descripcion,children:n})]})]})})}));Ps.displayName="Radio";const Zl=({name:e,value:t,defaultValue:n,onChange:o,orientation:r="horizontal",label:s,description:i,isDisabled:l=!1,isReadOnly:c=!1,isRequired:d=!1,isInvalid:_=!1,errorMessage:g,size:f,color:u,customColor:p,variant:h,justifyContent:m="flex-start",children:y,className:w="",options:C,optionValueKey:k,optionLabelKey:A,optionDisabledKey:T,optionDescriptionKey:M})=>{const[P,L]=v.useState(String(n??"")),E=t!==void 0?String(t):P,V={name:e,value:E,onChange:S=>{l||c||(t===void 0&&L(S),o&&o(S))},size:f,color:u,customColor:p,variant:h,isDisabled:l,isReadOnly:c,isInvalid:_,isRequired:d},$=[Te.grupo_radio,Te[`orientacion_${r}`],_&&Te.grupo_invalido,l&&Te.grupo_deshabilitado,c&&Te.grupo_solo_lectura,w].filter(Boolean).join(" "),b=m==="center"?"center":m==="flex-end"?"right":"left";return a.jsx(Yl.Provider,{value:V,children:a.jsxs("div",{className:$,role:"radiogroup","aria-required":d,"aria-invalid":_,style:{textAlign:b},children:[s&&a.jsxs("div",{className:Te.encabezado_grupo,children:[a.jsxs("label",{className:Te.label_grupo,children:[s,d&&a.jsx("span",{className:Te.marca_requerido,children:" *"})]}),i&&a.jsx("span",{className:Te.descripcion_grupo,children:i})]}),a.jsx("div",{className:Te.contenedor_radios,style:{justifyContent:m},children:C&&C.length>0?C.map((S,O)=>{let D,x,I=!1,F;if(typeof S=="object"&&S!==null){const j=k??"value",z=A??"label",H=T??"isDisabled",X=M??"description",G=S[j],ue=S[z];D=String(G!==void 0?G:O),x=ue;const oe=S[H];I=typeof oe=="boolean"?oe:!1;const ie=S[X];F=typeof ie=="string"?ie:void 0}else D=String(S),x=S;return a.jsx(Ps,{value:D,isDisabled:I,description:F,children:x},D)}):y}),_&&g&&a.jsx("span",{className:Te.mensaje_error,children:g})]})})};Zl.displayName="RadioGroup";const gt={backdrop:"_backdrop_1fyqe_1",visible:"_visible_1fyqe_37",drawer:"_drawer_1fyqe_57",posicion_right:"_posicion_right_1fyqe_123",drawer_detras:"_drawer_detras_1fyqe_155",posicion_left:"_posicion_left_1fyqe_163",posicion_top:"_posicion_top_1fyqe_203",posicion_bottom:"_posicion_bottom_1fyqe_243",radio_none:"_radio_none_1fyqe_283",radio_sm:"_radio_sm_1fyqe_291",radio_md:"_radio_md_1fyqe_311",radio_lg:"_radio_lg_1fyqe_331",radio_xl:"_radio_xl_1fyqe_351",tamano_sm:"_tamano_sm_1fyqe_451",tamano_md:"_tamano_md_1fyqe_461",tamano_lg:"_tamano_lg_1fyqe_471",tamano_xl:"_tamano_xl_1fyqe_481",tamano_full:"_tamano_full_1fyqe_491",encabezado:"_encabezado_1fyqe_551",titulo:"_titulo_1fyqe_571",boton_cerrar:"_boton_cerrar_1fyqe_591",contenido:"_contenido_1fyqe_645",pie:"_pie_1fyqe_657",loading_overlay:"_loading_overlay_1fyqe_677",spinner:"_spinner_1fyqe_701",spin:"_spin_1fyqe_701",loading_text:"_loading_text_1fyqe_731",resize_handle:"_resize_handle_1fyqe_743"},Jl=v.forwardRef(({isOpen:e,onClose:t,position:n="right",size:o="md",title:r,showCloseButton:s=!0,closeOnBackdropClick:i=!0,closeOnEscape:l=!0,preventScroll:c=!0,header:d,footer:_,children:g,className:f="",contentClassName:u="",isLoading:p=!1,loadingMessage:h="Cargando...",onOpen:m,backdropVariant:y="normal",borderRadius:w,resizable:C=!1,zIndex:k,getContainer:A},T)=>{const M=v.useRef(null),[P,L]=v.useState(!1),E=v.useCallback(()=>{P||(L(!0),setTimeout(()=>{t?.(),L(!1)},650))},[t,P]);v.useEffect(()=>{e&&L(!1)},[e]),v.useEffect(()=>{if(e){if(m?.(),c){const H=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",H>0&&(document.body.style.paddingRight=`${H}px`)}if(l){const H=X=>{X.key==="Escape"&&E()};return document.addEventListener("keydown",H),()=>{document.removeEventListener("keydown",H),c&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{c&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,E,l,c,m]);const B=H=>{i&&H.target===M.current&&E()},V=w?gt[`radio_${w}`]:void 0,$=e&&!P,b=[gt.drawer,gt[`posicion_${n}`],gt[`tamano_${o}`],$&&gt.visible,V,f].filter(Boolean).join(" "),S=[gt.contenido,u].filter(Boolean).join(" "),O=[gt.backdrop,$&&gt.visible].filter(Boolean).join(" "),D=k||500,x={transparente:{opacity:0},sutil:{opacity:.2},normal:{opacity:.4},intermedio:{opacity:.6},intenso:{opacity:.8}},I=x[y]||x.normal,{opacity:F}=I,j={background:`rgb(0 0 0 / ${F})`,zIndex:D,...A&&{position:"absolute"}},z=a.jsx("div",{className:O,ref:M,onClick:B,style:j,children:a.jsxs("div",{ref:T,className:b,role:"dialog","aria-modal":"true","aria-labelledby":"drawer-title",children:[(r||d)&&a.jsx("div",{className:gt.encabezado,children:d||a.jsxs(a.Fragment,{children:[a.jsx("h2",{id:"drawer-title",className:gt.titulo,children:r}),s&&a.jsx("button",{type:"button",className:gt.boton_cerrar,onClick:E,"aria-label":"Cerrar",children:a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:a.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}),a.jsx("div",{className:S,children:g}),_&&a.jsx("div",{className:gt.pie,children:_}),p&&a.jsxs("div",{className:gt.loading_overlay,children:[a.jsx("div",{className:gt.spinner}),a.jsx("span",{className:gt.loading_text,children:h})]}),C&&a.jsx("div",{className:gt.resize_handle})]})});if(A){const H=typeof A=="function"?A():A;if(H&&H instanceof HTMLElement)return Dn.createPortal(z,H)}return z});Jl.displayName="Drawer";const tt={backdrop:"_backdrop_1rfkw_1",visible:"_visible_1rfkw_37",centrado:"_centrado_1rfkw_61",modal:"_modal_1rfkw_69",tamano_sm:"_tamano_sm_1rfkw_143",tamano_md:"_tamano_md_1rfkw_151",tamano_lg:"_tamano_lg_1rfkw_159",tamano_xl:"_tamano_xl_1rfkw_167",tamano_formulario:"_tamano_formulario_1rfkw_175",tamano_full:"_tamano_full_1rfkw_183",tamano_auto:"_tamano_auto_1rfkw_191",encabezado:"_encabezado_1rfkw_201",encabezado_personalizado:"_encabezado_personalizado_1rfkw_221",contenedor_titulo_completo:"_contenedor_titulo_completo_1rfkw_233",header_extra:"_header_extra_1rfkw_243",contenedor_titulo_icono:"_contenedor_titulo_icono_1rfkw_261",icono_titulo:"_icono_titulo_1rfkw_273",titulo:"_titulo_1rfkw_287",contenido:"_contenido_1rfkw_307",pie:"_pie_1rfkw_319",loading_overlay:"_loading_overlay_1rfkw_339",spinner:"_spinner_1rfkw_363",spin:"_spin_1rfkw_363",loading_text:"_loading_text_1rfkw_393"},Ql=v.forwardRef(({isOpen:e,onClose:t,size:n="md",title:o,titleIcon:r,closeOnBackdropClick:s=!1,closeOnEscape:i=!0,preventScroll:l=!0,isCentered:c=!0,header:d,footer:_,children:g,className:f="",contentClassName:u="",isLoading:p=!1,loadingMessage:h="Cargando...",backdropVariant:m="normal",showIconTitle:y=!1,onOpen:w},C)=>{const k=v.useId(),A=v.useRef(null),T=v.useCallback(()=>{p||t?.()},[t,p]);v.useEffect(()=>{if(e){if(w?.(),l){const b=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",b>0&&(document.body.style.paddingRight=`${b}px`)}if(i){const b=S=>{S.key==="Escape"&&T()};return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b),l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,T,i,l,w]);const M=b=>{s&&b.target===A.current&&T()},P=[tt.backdrop,c&&tt.centrado,e&&tt.visible].filter(Boolean).join(" "),L=[tt.modal,tt[`tamano_${n}`],f].filter(Boolean).join(" "),E=[tt.contenido,u].filter(Boolean).join(" "),B={transparente:{opacity:0},sutil:{opacity:.3},normal:{opacity:.5},intermedio:{opacity:.7},intenso:{opacity:.9}},{opacity:V}=B[m]||B.normal,$={background:`rgb(0 0 0 / ${V})`};return a.jsx("div",{className:P,ref:A,onClick:M,style:$,children:a.jsxs("div",{ref:C,className:L,role:"dialog","aria-modal":"true","aria-labelledby":o?k:void 0,children:[(o||d)&&a.jsx("div",{className:[tt.encabezado,d&&tt.encabezado_personalizado].filter(Boolean).join(" "),children:d?a.jsx("div",{className:tt.header_extra,children:d}):a.jsx("div",{className:tt.contenedor_titulo_completo,children:a.jsxs("div",{className:tt.contenedor_titulo_icono,children:[y&&r!==void 0&&(typeof r=="string"?a.jsx("span",{className:tt.icono_titulo,children:r}):r),y&&r===void 0&&a.jsx("span",{className:tt.icono_titulo,children:"📄"}),o&&a.jsx("h2",{id:k,className:tt.titulo,children:o})]})})}),a.jsx("div",{className:E,children:g}),_&&a.jsx("div",{className:tt.pie,children:_}),p&&a.jsxs("div",{className:tt.loading_overlay,children:[a.jsx("div",{className:tt.spinner}),a.jsx("span",{className:tt.loading_text,children:h})]})]})})});Ql.displayName="Modal";const kt={overlay:"_overlay_1jsdb_1",container:"_container_1jsdb_47",modal:"_modal_1jsdb_65",modal_closing:"_modal_closing_1jsdb_125",modal_detras:"_modal_detras_1jsdb_143",header:"_header_1jsdb_217",button_back:"_button_back_1jsdb_233",title_container:"_title_container_1jsdb_289",title_icon:"_title_icon_1jsdb_305",title:"_title_1jsdb_289",content:"_content_1jsdb_337",footer:"_footer_1jsdb_349"};function dm({modals:e,onClose:t}){const[n,o]=v.useState([]),[r,s]=v.useState(!1);v.useEffect(()=>{const f=()=>{s(window.innerWidth<=768)};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]);const i=f=>{o(u=>[...u,f]),setTimeout(()=>{t(f),o(u=>u.filter(p=>p!==f))},300)};if(e.length===0)return null;const l=e.length-1,c=500,d=24,_=e.length*c+(e.length-1)*d,g=e.length>1?_/2-c/2-l*(c+d):0;return a.jsx("div",{className:kt.overlay,children:a.jsx("div",{className:kt.container,style:r?void 0:{transform:`translateX(${g}px)`},children:e.map((f,u)=>{const p=n.includes(f.id),h=u===e.length-1,m=[kt.modal,p&&kt.modal_closing,!h&&kt.modal_detras].filter(Boolean).join(" ");return a.jsxs("div",{className:m,children:[a.jsxs("div",{className:kt.header,children:[a.jsx("button",{type:"button",className:kt.button_back,onClick:()=>i(f.id),"aria-label":"Volver",children:a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:a.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),a.jsxs("div",{className:kt.title_container,children:[f.titleIcon&&a.jsx("span",{className:kt.title_icon,children:f.titleIcon}),a.jsx("h2",{className:kt.title,children:f.title})]})]}),a.jsx("div",{className:kt.content,children:f.content}),f.footer&&a.jsx("div",{className:kt.footer,children:f.footer})]},f.id)})})})}const Ls=v.createContext(null),Os=()=>{const e=v.useContext(Ls);if(!e)throw new Error("useDropdownContext debe usarse dentro de DropdownMenu o ContextMenu");return e},no=e=>e.type==="separator"||e.type==="label"?!1:"children"in e&&Array.isArray(e.children)&&e.children.length>0,ec=e=>e.type==="checkbox",tc=e=>e.type==="radio",nc=e=>e.type==="separator",oc=e=>e.type==="label",$e={menu:"_menu_1v23n_1",variant_default:"_variant_default_1v23n_49",variant_elevated:"_variant_elevated_1v23n_59",variant_bordered:"_variant_bordered_1v23n_69",variant_glass:"_variant_glass_1v23n_83",size_sm:"_size_sm_1v23n_97",size_md:"_size_md_1v23n_113",size_lg:"_size_lg_1v23n_127",item:"_item_1v23n_143",disabled:"_disabled_1v23n_201",active:"_active_1v23n_203",loading:"_loading_1v23n_249",spinner_item:"_spinner_item_1v23n_261",spinItem:"_spinItem_1v23n_1",danger:"_danger_1v23n_293",has_submenu:"_has_submenu_1v23n_307",submenu_open:"_submenu_open_1v23n_315",indicator:"_indicator_1v23n_323",start_icon:"_start_icon_1v23n_353",content:"_content_1v23n_395",label_text:"_label_text_1v23n_413",description:"_description_1v23n_425",shortcut:"_shortcut_1v23n_443",end_icon:"_end_icon_1v23n_467",submenu_arrow:"_submenu_arrow_1v23n_497",separator:"_separator_1v23n_533",label:"_label_1v23n_413",menuEnter:"_menuEnter_1v23n_1",context_menu_trigger:"_context_menu_trigger_1v23n_667"},um=()=>a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}),fm=()=>a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),_m=({marcado:e})=>a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),e&&a.jsx("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"})]}),zs=v.forwardRef(({item:e,index:t,activeIndex:n,getItemProps:o},r)=>{const s=Os();if(nc(e))return a.jsx("div",{className:W($e.separator,s.classNames?.separator),role:"separator"});if(oc(e))return a.jsx("div",{className:W($e.label,s.classNames?.label),role:"presentation","data-testid":"dropdown-label",children:e.label});const i=t===n,l=ec(e),c=tc(e),d=M=>{"isDisabled"in e&&e.isDisabled||(l?e.onCheckedChange?.(!e.isChecked):c&&s.onRadioChange?.(e.value),"onSelect"in e&&e.onSelect&&e.onSelect(M),s.closeOnSelect&&!no(e)&&s.cerrarMenu())},_=M=>{d(M)},g=M=>{"isDisabled"in e&&e.isDisabled||(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),d(M))},f=l?e.isChecked:!1,u=c?s.radioValue===e.value:!1,p="label"in e?e.label:void 0,h="description"in e?e.description:void 0,m="shortcut"in e?e.shortcut:void 0,y="startIcon"in e?e.startIcon:void 0,w="endIcon"in e?e.endIcon:void 0,C="isDisabled"in e?e.isDisabled:!1,k="isLoading"in e?e.isLoading:!1,A="isDanger"in e?e.isDanger:!1,T="className"in e?e.className:void 0;return a.jsxs("div",{ref:r,role:l?"menuitemcheckbox":c?"menuitemradio":"menuitem","aria-checked":l?f:c?u:void 0,"aria-disabled":C||k,tabIndex:i?0:-1,className:W($e.item,$e[`size_${s.size}`],i&&$e.active,C&&$e.disabled,k&&$e.loading,A&&$e.danger,no(e)&&$e.has_submenu,T,s.classNames?.item),onClick:_,onKeyDown:g,...o(),children:[k?a.jsx("span",{className:$e.indicator,children:a.jsx("span",{className:$e.spinner_item})}):(l||c)&&a.jsxs("span",{className:$e.indicator,children:[l&&f&&a.jsx(um,{}),c&&a.jsx(_m,{marcado:u})]}),!k&&y&&a.jsx("span",{className:$e.start_icon,children:y}),a.jsxs("span",{className:$e.content,children:[a.jsx("span",{className:$e.label_text,children:p}),h&&a.jsx("span",{className:$e.description,children:h})]}),m&&a.jsx("kbd",{className:$e.shortcut,children:m}),w&&a.jsx("span",{className:$e.end_icon,children:w}),no(e)&&a.jsx("span",{className:$e.submenu_arrow,children:a.jsx(fm,{})})]})});zs.displayName="MenuItem";const gm=()=>a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),sr=({items:e,activeIndex:t,getItemProps:n,listRef:o})=>a.jsx(a.Fragment,{children:e.map((r,s)=>no(r)?a.jsx(Bs,{ref:i=>{o.current[s]=i},item:r,index:s,activeIndex:t,getItemProps:n},r.id):a.jsx(zs,{ref:i=>{o.current[s]=i},item:r,index:s,activeIndex:t,getItemProps:n},r.id))});sr.displayName="MenuList";const Bs=v.forwardRef(({item:e,index:t,activeIndex:n,getItemProps:o},r)=>{const s=Os(),[i,l]=v.useState(!1),c=un(),d=ja(),_=v.useRef([]),[g,f]=v.useState(null),{refs:u,floatingStyles:p,context:h,isPositioned:m}=Go({nodeId:d,open:i,onOpenChange:l,placement:"right-start",middleware:[Lo({mainAxis:4,alignmentAxis:-4}),zo(),Oo({padding:8})],whileElementsMounted:To}),{isMounted:y,styles:w}=Jo(h,{duration:s.disableAnimation?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(2px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(2px)"},common:{transitionTimingFunction:s.disableAnimation?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}}),C=rs(h,{enabled:!e.isDisabled,delay:{open:75},handleClose:dl({blockPointerEvents:!0})}),k=Zo(h,{role:"menu"}),A=Wo(h,{bubbles:!0}),T=fs(h,{listRef:_,activeIndex:g,onNavigate:f,nested:!0}),{getReferenceProps:M,getFloatingProps:P,getItemProps:L}=Ko([C,k,A,T]);v.useEffect(()=>{if(!c)return;const V=()=>l(!1);return c.events.on("click",V),()=>{c.events.off("click",V)}},[c]);const E=t===n,B=Da([u.setReference,r]);return a.jsxs(qa,{id:d,children:[a.jsxs("div",{ref:B,role:"menuitem","aria-haspopup":"menu","aria-expanded":i,"aria-disabled":e.isDisabled,tabIndex:E?0:-1,className:W($e.item,$e[`size_${s.size}`],E&&$e.active,e.isDisabled&&$e.disabled,e.isDanger&&$e.danger,$e.has_submenu,i&&$e.submenu_open,e.className,s.classNames?.item),...M(o()),children:[e.startIcon&&a.jsx("span",{className:$e.start_icon,children:e.startIcon}),a.jsxs("span",{className:$e.content,children:[a.jsx("span",{className:$e.label_text,children:e.label}),e.description&&a.jsx("span",{className:$e.description,children:e.description})]}),e.shortcut&&a.jsx("kbd",{className:$e.shortcut,children:e.shortcut}),a.jsx("span",{className:$e.submenu_arrow,children:a.jsx(gm,{})})]}),y&&a.jsx(Uo,{root:s.portalContainer,children:a.jsx(ls,{context:h,modal:!1,initialFocus:-1,returnFocus:!1,children:a.jsx("div",{ref:u.setFloating,style:{...p,pointerEvents:"none",zIndex:s.zIndex??"var(--z-dropdown)"},children:a.jsx("div",{className:W($e.menu,$e[`variant_${s.variant}`],s.classNames?.menu),style:{...w,pointerEvents:"auto",visibility:m||!i?"visible":"hidden"},...P(),children:a.jsx(sr,{items:e.children,activeIndex:g,getItemProps:L,listRef:_})})})})})]})});Bs.displayName="Submenu";const rc=v.forwardRef(({children:e,items:t,triggerAction:n="click",placement:o="bottom-start",variant:r="default",size:s="md",isDisabled:i=!1,offset:l=4,minWidth:c="180px",matchTriggerWidth:d=!1,disableAnimation:_=!1,closeOnClickOutside:g=!0,closeOnEscape:f=!0,closeOnSelect:u=!0,className:p,classNames:h,style:m,onOpen:y,onClose:w,onOpenChange:C,onContextMenu:k,isOpen:A,zIndex:T,portalContainer:M,radioValue:P,onRadioChange:L},E)=>{const[B,V]=v.useState(!1),[$,b]=v.useState(null),[S,O]=v.useState(0),D=v.useRef([]),x=v.useRef([]),I=ja(),F=A!==void 0,j=F?A:B,z=v.useCallback(q=>{i&&q||(F||V(q),C?.(q),q?y?.():w?.())},[i,F,C,y,w]);v.useEffect(()=>{x.current=t.filter(q=>q.type!=="separator"&&q.type!=="label").map(q=>"label"in q&&typeof q.label=="string"?q.label:"")},[t]);const{refs:H,floatingStyles:X,context:G,isPositioned:ue}=Go({nodeId:I,open:j,onOpenChange:z,placement:o,strategy:"fixed",middleware:[Lo(l),zo({fallbackAxisSideDirection:"start",padding:8}),Oo({padding:8}),d?Aa({apply({rects:q,elements:R}){Object.assign(R.floating.style,{minWidth:`${q.reference.width}px`})}}):void 0].filter(Boolean),whileElementsMounted:To}),oe=nl(G,{enabled:!i&&(n==="click"||n==="both"),toggle:!0}),ie=rs(G,{enabled:!i&&n==="hover",delay:{open:150,close:150},handleClose:dl()}),_e=Wo(G,{enabled:f||g,escapeKey:f,outsidePress:g}),ge=Zo(G,{role:"menu"}),ke=fs(G,{listRef:D,activeIndex:$,onNavigate:b,loop:!0}),J=al(G,{listRef:x,activeIndex:$,onMatch:b,enabled:j}),{getReferenceProps:re,getFloatingProps:Y,getItemProps:ye}=Ko([oe,ie,_e,ge,ke,J]),{isMounted:ce,styles:ee}=Jo(G,{duration:_?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(4px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(4px)"},common:{transitionTimingFunction:_?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}});v.useImperativeHandle(E,()=>({open:()=>z(!0),close:()=>z(!1),toggle:()=>z(!j),isOpen:j}),[z,j]);const ne=v.useMemo(()=>({radioValue:P,onRadioChange:L,cerrarMenu:()=>z(!1),closeOnSelect:u,size:s,variant:r,disableAnimation:_,classNames:h,portalContainer:M,zIndex:T}),[P,L,z,u,s,r,_,h,M,T]),xe=v.isValidElement(e)?e:null,de=Da([H.setReference,xe?.ref||null]);if(!xe)return e!=null&&console.error("DropdownMenu: children debe ser un elemento React válido"),null;const Se=n==="contextmenu"||n==="both"?{onContextMenu:q=>{q.preventDefault();const R={x:q.clientX,y:q.clientY};k?.(q,R),z(!1),O(fe=>fe+1),requestAnimationFrame(()=>{H.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:R.x,y:R.y,top:R.y,left:R.x,right:R.x,bottom:R.y}}}),z(!0)})},onClick:()=>{j&&n==="contextmenu"&&z(!1)}}:{},U=v.cloneElement(e,re({...e.props,...Se,ref:de,"aria-haspopup":"menu","aria-expanded":j}));return a.jsx(Ls.Provider,{value:ne,children:a.jsxs(qa,{id:I,children:[U,ce&&a.jsx(Uo,{root:M,children:a.jsx(ls,{context:G,modal:!1,initialFocus:-1,returnFocus:!0,children:a.jsx("div",{ref:H.setFloating,style:{...X,zIndex:T??"var(--z-dropdown)",outline:"none",pointerEvents:"none"},children:a.jsx("div",{role:"menu","aria-orientation":"vertical",className:W($e.menu,$e[`variant_${r}`],$e[`size_${s}`],p,h?.menu),style:{...ee,minWidth:c,...m,transform:[ee.transform,m?.transform].filter(Boolean).join(" "),pointerEvents:"auto",visibility:ue||!j?"visible":"hidden"},...Y(),children:a.jsx(sr,{items:t,activeIndex:$,getItemProps:ye,listRef:D})},S)})})})]})})});rc.displayName="DropdownMenuInner";const ir=v.forwardRef((e,t)=>a.jsx(Ng,{children:a.jsx(rc,{...e,ref:t})}));ir.displayName="DropdownMenu";const sc=v.forwardRef(({isEnabled:e=!0,children:t,...n},o)=>a.jsx(ir,{...n,ref:o,triggerAction:"contextmenu",isDisabled:!e||n.isDisabled,children:t}));sc.displayName="ContextMenu";const Ut={group_button:"_group_button_wgdis_1",full_width:"_full_width_wgdis_17",main_button:"_main_button_wgdis_27",dropdown_trigger:"_dropdown_trigger_wgdis_35",first_item:"_first_item_wgdis_45",last_item:"_last_item_wgdis_55",variant_bordered:"_variant_bordered_wgdis_65",variant_ghost:"_variant_ghost_wgdis_67",variant_faded:"_variant_faded_wgdis_69",disabled:"_disabled_wgdis_93",loading:"_loading_wgdis_93",chevron:"_chevron_wgdis_111",chevron_open:"_chevron_open_wgdis_123"},hm=({label:e,onClick:t,items:n,variant:o="solid",color:r="primary",size:s="md",radius:i="md",isLoading:l=!1,isDisabled:c=!1,dropdownIcon:d,className:_,fullWidth:g=!1,...f})=>{const[u,p]=v.useState(!1),h=W(Ut.group_button,Ut[`variant_${o}`],g&&Ut.full_width,_),m=()=>a.jsx("div",{className:W(Ut.chevron,u&&Ut.chevron_open),children:a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:a.jsx("path",{d:"m6 9 6 6 6-6"})})});return a.jsxs("div",{className:h,children:[a.jsx(st,{variant:o,color:r,size:s,radius:i,isLoading:l,isDisabled:c,onClick:t,className:W(Ut.main_button,Ut.first_item),...f,children:e}),n&&a.jsx(ir,{items:n,triggerAction:"click",onOpenChange:p,placement:"bottom-end",isDisabled:c||l,variant:"default",size:s,matchTriggerWidth:!1,children:a.jsx(st,{variant:o,color:r,size:s,radius:i,isDisabled:c||l,isIconOnly:!0,className:W(Ut.dropdown_trigger,Ut.last_item),"aria-label":"M�s acciones",children:d||m()})})]})},ic=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),ac=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12zm5.75 9L15 18l1.16-1.16l1.59 1.59l3.59-3.59l1.16 1.41z"})}),lc=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M14.76 20.83L17.6 18l-2.84-2.83l1.41-1.41L19 16.57l2.83-2.81l1.41 1.41L20.43 18l2.81 2.83l-1.41 1.41L19 19.4l-2.83 2.84zM12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12z"})}),cc=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"15 18 9 12 15 6"})}),dc=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),Qe={overlay:"_overlay_1llsm_1",backdrop:"_backdrop_1llsm_25",visible:"_visible_1llsm_47",layout:"_layout_1llsm_71",columna_acciones:"_columna_acciones_1llsm_139",boton_flotante:"_boton_flotante_1llsm_159",boton_primario:"_boton_primario_1llsm_233",boton_peligro:"_boton_peligro_1llsm_243",panel:"_panel_1llsm_261",encabezado:"_encabezado_1llsm_289",titulo:"_titulo_1llsm_307",contenido:"_contenido_1llsm_323",paginacion:"_paginacion_1llsm_337",texto_paginacion:"_texto_paginacion_1llsm_363"},pm={transparente:{background:"transparent"},sutil:{background:"rgb(0 0 0 / 20%)"},normal:{background:"rgb(0 0 0 / 40%)"},intenso:{background:"rgb(0 0 0 / 60%)"}},mm=({isOpen:e,onClose:t,onApply:n,onClear:o,title:r="Filtros",backdropVariant:s="sutil",closeOnBackdropClick:i=!0,allowBackdropInteraction:l=!1,getContainer:c,children:d})=>{const[_,g]=v.useState(!1),[f,u]=v.useState(0),p=l||s==="transparente",h=v.useCallback(()=>{_||(g(!0),setTimeout(()=>{t(),g(!1),u(0)},650))},[t,_]);v.useEffect(()=>{e&&g(!1)},[e]),v.useEffect(()=>{if(!e)return;const E=B=>B.key==="Escape"&&h();return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[e,h]);const m=v.useCallback(E=>{i&&E.target===E.currentTarget&&h()},[i,h]),y=v.useCallback(E=>{document.activeElement?.blur(),E?.()},[]),{pages:w,totalPages:C,hasPagination:k}=v.useMemo(()=>{const E=Array.isArray(d)?d:[d];return{pages:E,totalPages:E.length,hasPagination:E.length>1}},[d]),{background:A}=pm[s],T={background:A,pointerEvents:p?"none":"auto"},M=c?{position:"absolute"}:{},P=c?{position:"relative"}:{},L=a.jsxs("div",{className:Qe.overlay,role:"dialog","aria-modal":"true",style:M,children:[a.jsx("div",{className:`${Qe.backdrop} ${e&&!_?Qe.visible:""}`,style:T,onClick:m}),a.jsxs("div",{className:`${Qe.layout} ${e&&!_?Qe.visible:""}`,style:P,children:[a.jsxs("aside",{className:Qe.columna_acciones,children:[a.jsx(gn,{content:"Cerrar",placement:"left",children:a.jsx("button",{className:Qe.boton_flotante,onClick:()=>y(h),"aria-label":"Cerrar panel",children:a.jsx(ic,{})})}),a.jsx(gn,{content:"Aplicar filtros",placement:"left",children:a.jsx("button",{className:`${Qe.boton_flotante} ${Qe.boton_primario}`,onClick:()=>y(n),children:a.jsx(ac,{})})}),a.jsx(gn,{content:"Limpiar filtros",placement:"left",children:a.jsx("button",{className:`${Qe.boton_flotante} ${Qe.boton_peligro}`,onClick:()=>y(o),children:a.jsx(lc,{})})}),k&&a.jsxs("div",{className:Qe.paginacion,children:[a.jsx("button",{className:Qe.boton_flotante,style:{width:36,height:36},onClick:()=>u(E=>Math.max(0,E-1)),disabled:f===0,"aria-label":"Página anterior",children:a.jsx(cc,{})}),a.jsxs("span",{className:Qe.texto_paginacion,children:[f+1," / ",C]}),a.jsx("button",{className:Qe.boton_flotante,style:{width:36,height:36},onClick:()=>u(E=>Math.min(C-1,E+1)),disabled:f===C-1,"aria-label":"Página siguiente",children:a.jsx(dc,{})})]})]}),a.jsxs("main",{className:Qe.panel,children:[a.jsx("header",{className:Qe.encabezado,children:a.jsx("h2",{className:Qe.titulo,children:r})}),a.jsx("div",{className:Qe.contenido,children:a.jsx("div",{style:{animation:"fadeIn 0.3s ease"},children:w[f]},f)})]})]})]});if(c){const E=typeof c=="function"?c():c;if(E&&E instanceof HTMLElement)return Dn.createPortal(L,E)}return L};Q.Badge=Di,Q.BadgeVoz=Pr,Q.Boton=st,Q.Checkbox=eo,Q.CheckboxGroup=Ol,Q.ContextMenu=sc,Q.Drawer=Jl,Q.DropdownContext=Ls,Q.DropdownMenu=ir,Q.GrabacionIcono=Hi,Q.GroupButton=hm,Q.IconoCerrar=ic,Q.IconoDerecha=dc,Q.IconoFiltroAplicar=ac,Q.IconoFiltroLimpiar=lc,Q.IconoIzquierda=cc,Q.InputDate=qi,Q.InputNumeric=ji,Q.InputText=Oi,Q.MenuItem=zs,Q.MenuList=sr,Q.MicrofonoIcono=Tr,Q.Modal=Ql,Q.ModalStack=dm,Q.PanelFiltros=mm,Q.Radio=Ps,Q.RadioGroup=Zl,Q.Select=Cl,Q.Signature=Li,Q.SonidoIcono=Fr,Q.Submenu=Bs,Q.TablaDatos=lm,Q.TextArea=Ui,Q.Toggle=Ar,Q.Tooltip=gn,Q.Transicion=po,Q.esCheckbox=ec,Q.esLabel=oc,Q.esRadio=tc,Q.esSeparador=nc,Q.fechaEnRango=Bf,Q.formatearFecha=Dr,Q.formatearNumero=Bn,Q.generarOpcionesAleatorias=hh,Q.generarUsuariosPrueba=ph,Q.obtenerFechaHoy=zf,Q.parsearNumero=zi,Q.procesarValidacion=Bi,Q.redondearDecimales=Vi,Q.restringirRango=ho,Q.tieneHijos=no,Q.useCheckboxGroupContext=Pl,Q.useDropdownContext=Os,Q.useReconocimientoVoz=Ri,Q.useTablaContext=Cp,Q.useTablaContextSafe=nn,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})}));
28
+ */function bt(e,t){return e?ju(e)?M.createElement(e,t):e:null}function ju(e){return qu(e)||typeof e=="function"||Bu(e)}function qu(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Bu(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Hu(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=M.useState(()=>({current:Fu(t)})),[o,r]=M.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:a=>{r(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}const Fe={checkbox_container:"_checkbox_container_3vmyh_1",checkbox_wrapper:"_checkbox_wrapper_3vmyh_13",label_text:"_label_text_3vmyh_33",hint_text:"_hint_text_3vmyh_51",checkbox:"_checkbox_3vmyh_1",input:"_input_3vmyh_99",checkbox_svg:"_checkbox_svg_3vmyh_153",custom_icon:"_custom_icon_3vmyh_195",checked:"_checked_3vmyh_225",indeterminate:"_indeterminate_3vmyh_227",radius_none:"_radius_none_3vmyh_235",radius_sm:"_radius_sm_3vmyh_243",radius_md:"_radius_md_3vmyh_251",radius_lg:"_radius_lg_3vmyh_259",radius_full:"_radius_full_3vmyh_267",sm:"_sm_3vmyh_275",lg:"_lg_3vmyh_301",secondary:"_secondary_3vmyh_327",success:"_success_3vmyh_335",warning:"_warning_3vmyh_343",danger:"_danger_3vmyh_351",solid:"_solid_3vmyh_377",outline:"_outline_3vmyh_391",disabled:"_disabled_3vmyh_439",readonly:"_readonly_3vmyh_509",no_animation:"_no_animation_3vmyh_589",line_through:"_line_through_3vmyh_607",lineThrough:"_lineThrough_3vmyh_1",checkbox_group:"_checkbox_group_3vmyh_651",label:"_label_3vmyh_33",marca_requerido:"_marca_requerido_3vmyh_677",description:"_description_3vmyh_685",checkboxes:"_checkboxes_3vmyh_699",vertical:"_vertical_3vmyh_709",horizontal:"_horizontal_3vmyh_717",error_message:"_error_message_3vmyh_725",invalid:"_invalid_3vmyh_737"},aa=m.createContext(null),la=()=>m.useContext(aa),wt=m.forwardRef((e,t)=>{const{children:n,label:o,hint:r,isSelected:i,defaultChecked:a,isIndeterminate:l=!1,isDisabled:d=!1,isReadOnly:u=!1,isRequired:_=!1,lineThrough:g=!1,onlyIcon:f=!1,disableAnimation:c=!1,customCheckIcon:h,size:p="md",color:v="primary",customColor:w,radius:C="md",variant:x="solid",className:I="",classNames:z={},onChange:A,value:N,name:L,...P}=e,k=la(),O=m.useId(),j=m.useRef(null),$=i!==void 0,[b,S]=m.useState(a??!1),T=!!k,F=T&&N?k.value.includes(N):!1,y=T?F:$?i:b,E=d||k?.isDisabled,D=u||k?.isReadOnly,B=_||k?.isRequired,H=L||k?.name;m.useEffect(()=>{const U=j.current||(t&&typeof t=="object"?t.current:null);U&&(U.indeterminate=l??!1)},[l,t]);const V=U=>{if(E||D)return;const pe=U.target.checked;T&&N?k.onChange(N):($||S(pe),A?.(pe))},J=o||n;return s.jsxs("div",{className:K(Fe.checkbox_container,{[Fe.disabled]:E,[Fe.readonly]:D},z.base,I),children:[s.jsxs("label",{className:K(Fe.checkbox_wrapper,Fe[p],!w&&Fe[v],Fe[x],Fe[`radius_${C}`],{[Fe.checked]:y,[Fe.indeterminate]:l,[Fe.disabled]:E,[Fe.readonly]:D,[Fe.line_through]:g&&y,[Fe.no_animation]:c}),style:w?{"--checkbox-custom-color":w}:void 0,children:[s.jsxs("span",{className:Fe.checkbox,children:[s.jsx("input",{ref:U=>{j.current=U,typeof t=="function"?t(U):t&&(t.current=U)},id:O,type:"checkbox",className:Fe.input,checked:y,onChange:V,disabled:E,readOnly:D,required:B,value:N,name:H,...P}),h?s.jsx("span",{className:Fe.custom_icon,children:h}):s.jsx("svg",{className:Fe.checkbox_svg,viewBox:"0 0 22 22","aria-hidden":"true",children:s.jsx("path",{fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:l?"M6,11 L16,11":"M5.5,11.3L9,14.8L20.2,3.3l0,0c-0.5-1-1.5-1.8-2.7-1.8h-13c-1.7,0-3,1.3-3,3v13c0,1.7,1.3,3,3,3h13 c1.7,0,3-1.3,3-3v-13c0-0.4-0.1-0.8-0.3-1.2"})})]}),!f&&J&&s.jsx("span",{className:K(Fe.label_text,z.label),children:J})]}),r&&s.jsx("span",{className:K(Fe.hint_text,z.label),children:r})]})});wt.displayName="Checkbox";const ca=({label:e,children:t,description:n,errorMessage:o,isInvalid:r=!1,orientation:i="vertical",className:a,value:l,defaultValue:d=[],onChange:u,isDisabled:_=!1,isReadOnly:g=!1,isRequired:f=!1,name:c,options:h,optionValueKey:p,optionLabelKey:v,optionDisabledKey:w,optionDescriptionKey:C})=>{const x=l!==void 0,[I,z]=m.useState(d),A=x?l:I,N=L=>{if(_||g)return;const P=A.includes(L)?A.filter(k=>k!==L):[...A,L];x||z(P),u?.(P)};return s.jsxs("div",{className:K(Fe.checkbox_group,Fe[i],{[Fe.invalid]:r,[Fe.disabled]:_,[Fe.readonly]:g},a),role:"group","aria-required":f,"aria-invalid":r,children:[e&&s.jsxs("div",{className:Fe.label,children:[e,f&&s.jsx("span",{className:Fe.marca_requerido,children:" *"})]}),n&&s.jsx("div",{className:Fe.description,children:n}),s.jsx(aa.Provider,{value:{value:A,onChange:N,isDisabled:_,isReadOnly:g,isRequired:f,name:c},children:s.jsx("div",{className:K(Fe.checkboxes,Fe[i]),children:h&&h.length>0?h.map((L,P)=>{let k,O,j=!1,$;if(typeof L=="object"&&L!==null){const b=p??"value",S=v??"label",T=w??"isDisabled",F=C??"description",y=L[b],E=L[S];k=String(y!==void 0?y:P),O=E;const D=L[T];j=typeof D=="boolean"?D:!1;const B=L[F];$=typeof B=="string"?B:void 0}else k=String(L),O=L;return s.jsx(wt,{value:k,isDisabled:j,hint:$,children:O},k)}):t})}),o&&r&&s.jsx("div",{className:Fe.error_message,children:o})]})};ca.displayName="CheckboxGroup";const We={contenedor:"_contenedor_kj261_1",contenedor_superior:"_contenedor_superior_kj261_17",input_con_icono:"_input_con_icono_kj261_35",icono_busqueda:"_icono_busqueda_kj261_49",input_busqueda:"_input_busqueda_kj261_75",contenedor_acciones_botones:"_contenedor_acciones_botones_kj261_147",contenedor_acciones:"_contenedor_acciones_kj261_147",columna:"_columna_kj261_183",encabezados:"_encabezados_kj261_201",boton_basico:"_boton_basico_kj261_265",texto_filtros:"_texto_filtros_kj261_289",menu_configuraciones:"_menu_configuraciones_kj261_321",boton_excel:"_boton_excel_kj261_349",contenedor_tabla:"_contenedor_tabla_kj261_369",contenedor_datos:"_contenedor_datos_kj261_387",datos:"_datos_kj261_395",seleccionada:"_seleccionada_kj261_431",boton_acciones:"_boton_acciones_kj261_475"};function Gu(e,t,n=3){const o=Math.floor(n/2);let r=e-o;r<1&&(r=1),r+n-1>t&&(r=Math.max(1,t-n+1));const i=Math.min(n,t);return Array.from({length:i},(a,l)=>r+l)}function Wu(e,t){return t===0?0:e>=t?t-1:e<0?0:e}function Ku(e){return e?{asc:" ↑",desc:" ↓"}[e]??null:null}function yt(e,t){const n=new Map;t.getFlatHeaders().forEach(a=>n.set(a.column.id,a));const o=n.get(e);if(o)return bt(o.column.columnDef.header,o.getContext());const r=t.getAllLeafColumns().find(a=>a.id===e),i=r?.columnDef.header;return typeof i=="string"||typeof i=="number"?i:r?.id??e}function da(e,t){const n=e.getVisibleCells().find(o=>o.column.id===t);return n?bt(n.column.columnDef.cell,n.getContext()):null}function ua(e,t){return t?e.getVisibleCells().map(o=>o.column.id).includes(t):!1}function Uu(e,t,n){return e.getVisibleCells().filter(o=>o.column.id!=="actions"&&o.column.id!==t&&o.column.id!==n)}function Xu(e,t){if(t===0)return"";if(t===1)return Wr(e[0].nombre.toLowerCase());if(t===2)return`${Wr(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const n=e.slice(0,2).map(r=>r.nombre.toLowerCase()),o=t-2;return`${Wr(n.join(", "))} y ${o>1?`otros ${o}`:"otro"} más`}function Wr(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function fa(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}const _a=m.createContext(null),Kr=_a;function Oo(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Yu({children:e,data:t,columns:n,controls:o,loading:r,primerasColumnas:i,tamanioPaginaInicial:a=10,filtros:l,descargarExcel:d,actualizarTabla:u,selectorFilas:_=[],sinDatosProps:g,...f}){const[c,h]=m.useState(""),p=Td(c,200),v=Fo("only screen and (max-width: 830px)"),[w,C]=m.useState({pageIndex:0,pageSize:a}),[x,I]=m.useState({}),z=m.useMemo(()=>{const y=[];if(_.length>0&&!v){const E={id:"select",header:({table:D})=>s.jsx(wt,{color:"secondary",isSelected:D.getIsAllPageRowsSelected(),isIndeterminate:D.getIsSomePageRowsSelected()&&!D.getIsAllPageRowsSelected(),onChange:B=>D.toggleAllPageRowsSelected(!!B)}),cell:({row:D})=>s.jsx(wt,{color:"primary",isSelected:D.getIsSelected(),isDisabled:!D.getCanSelect(),onChange:B=>D.toggleSelected(B)}),enableSorting:!1,enableHiding:!1};y.push(E)}if(y.push(...n),o?.length){const E={id:"actions",header:"Acciones",cell:D=>s.jsx("div",{className:We.contenedor_acciones,children:o.map(B=>"contenido"in B?s.jsx(it,{content:B.nombre,variant:"default",size:"sm",placement:"top",children:s.jsx("span",{children:B.contenido(D.row.original,We.boton_acciones)})},B.id):s.jsx(it,{content:B.nombre,variant:"default",size:"sm",placement:"top",children:s.jsx(tn,{id:B.id,size:"sm",radius:"md",variant:"light",isIconOnly:!0,onClick:()=>B.evento(D.row.original),className:We.boton_acciones,children:B.icono})},B.id))}),enableSorting:!1,enableHiding:!1};y.push(E)}return y},[n,o,_.length,v]),A=m.useMemo(()=>{const y=z.map(D=>"accessorKey"in D&&D.accessorKey!=null?String(D.accessorKey):"id"in D&&D.id!=null?String(D.id):"").filter(Boolean),E=y.indexOf("actions");return E>-1&&E<y.length-1&&(y.splice(E,1),y.push("actions")),y},[z]),[N,L]=m.useState(()=>A);m.useEffect(()=>{L(y=>Oo(y,A)?y:A)},[A]);const P=m.useCallback((y,E,D)=>{if(!D)return!0;const B=fa(String(D)),H=y.getValue(E);return H==null?!1:fa(String(H)).includes(B)},[]),k=Hu({data:t,columns:z,state:{pagination:w,globalFilter:p,columnOrder:N,rowSelection:x},globalFilterFn:P,enableRowSelection:_.length>0,onRowSelectionChange:I,onPaginationChange:C,onColumnOrderChange:y=>{L(E=>{const D=typeof y=="function"?y(E):y;return Oo(E,D)?E:D})},getCoreRowModel:zu(),getSortedRowModel:Vu(),getFilteredRowModel:Tu(),getPaginationRowModel:Ou(),autoResetPageIndex:!1}),O=k.getPageCount();m.useEffect(()=>{const y=Wu(w.pageIndex,O);y!==w.pageIndex&&C(E=>E.pageIndex===y?E:{...E,pageIndex:y})},[w.pageIndex,O]),m.useEffect(()=>{w.pageIndex!==0&&k.setPageIndex(0)},[p,w.pageIndex,k]);const j=m.useMemo(()=>k.getAllLeafColumns().filter(y=>y.id!=="actions"&&y.id!=="select"&&y.getCanHide?.()),[k]),$=m.useCallback(y=>{const D=n.find(B=>"accessorKey"in B?String(B.accessorKey)===y:String(B.id)===y)?.header;return typeof D=="string"||typeof D=="number"?String(D):y},[n]),b=m.useCallback(()=>{k.setColumnVisibility({}),k.setPageSize(a),k.setPageIndex(0),k.resetRowSelection(),L(y=>Oo(y,A)?y:A)},[k,a,A]),S=m.useCallback(y=>{const E=Math.max(1,Math.min(200,y));k.setPageSize(E),k.setPageIndex(0)},[k]),T=m.useCallback(y=>{L(E=>{const D=typeof y=="function"?y(E):y;return Oo(E,D)?E:D})},[]),F=m.useMemo(()=>({state:{ordenColumnas:N,table:k,columns:z,controls:o,loading:r,primerasColumnas:[String(i[0]),String(i[1])],inputBusqueda:c,setInputBusqueda:h,filtros:l,descargarExcel:d,actualizarTabla:u,selectorFilas:_,sinDatosProps:g,...f},todasLasColumnas:j,etiquetaColumna:$,restaurarConfiguracion:b,cambiarPageSize:S,cambiarOrdenColumnas:T}),[N,k,z,o,r,c,l,i,d,u,_,g,f,j,$,b,S,T]);return s.jsx(_a.Provider,{value:F,children:e})}function Ru(){const e=m.useContext(Kr);if(!e)throw new Error("useTablaContext debe usarse dentro de TablaDatosProvider");return e}function Rn(){const e=m.useContext(Kr);return e||null}const jn={contenedor:"_contenedor_1dhtd_1",popover:"_popover_1dhtd_9",popover_entrada:"_popover_entrada_1dhtd_45",popoverEntrada:"_popoverEntrada_1dhtd_1",popover_salida:"_popover_salida_1dhtd_53",popoverSalida:"_popoverSalida_1dhtd_1",ventana:"_ventana_1dhtd_109",panel:"_panel_1dhtd_127",panel_forward:"_panel_forward_1dhtd_145",panelForwardIn:"_panelForwardIn_1dhtd_1",panel_backward:"_panel_backward_1dhtd_153",panelBackwardIn:"_panelBackwardIn_1dhtd_1",header:"_header_1dhtd_209",titulo:"_titulo_1dhtd_233"};function ga(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function pa(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"M9.29 15.88L13.17 12L9.29 8.12a.996.996 0 1 1 1.41-1.41l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3a.996.996 0 0 1-1.41 0c-.38-.39-.39-1.03 0-1.42"})})}function Zu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"M21.71 20.29L18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.39M11 18a7 7 0 1 1 7-7a7 7 0 0 1-7 7"})})}function Ju(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"m2.859 2.877l12.57-1.795a.5.5 0 0 1 .571.494v20.848a.5.5 0 0 1-.57.494L2.858 21.123a1 1 0 0 1-.859-.99V3.867a1 1 0 0 1 .859-.99M17 3h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4zm-6.8 9L13 8h-2.4L9 10.286L7.4 8H5l2.8 4L5 16h2.4L9 13.714L10.6 16H13z"})})}function Qu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9.145 17.704v-3.976c0-.381 0-.572-.044-.75a1.5 1.5 0 0 0-.192-.446c-.1-.155-.238-.286-.515-.548L3.578 7.43a2.648 2.648 0 0 1 1.82-4.572h13.189a2.664 2.664 0 0 1 1.852 4.579l-4.765 4.607c-.27.261-.405.392-.501.545a1.5 1.5 0 0 0-.187.441c-.044.176-.044.364-.044.74v3.935c0 .542 0 .813-.062 1.057a2 2 0 0 1-.641 1.027c-.192.163-.436.282-.923.52c-1.14.557-1.709.835-2.172.835a2 2 0 0 1-1.795-1.121c-.204-.416-.204-1.05-.204-2.318"})})}function ef(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[s.jsx("path",{fill:"currentColor",d:"M12.079 2.25c-4.794 0-8.734 3.663-9.118 8.333H2a.75.75 0 0 0-.528 1.283l1.68 1.666a.75.75 0 0 0 1.056 0l1.68-1.666a.75.75 0 0 0-.528-1.283h-.893c.38-3.831 3.638-6.833 7.612-6.833a7.66 7.66 0 0 1 6.537 3.643a.75.75 0 1 0 1.277-.786A9.16 9.16 0 0 0 12.08 2.25"}),s.jsx("path",{fill:"currentColor",d:"M20.841 10.467a.75.75 0 0 0-1.054 0L18.1 12.133a.75.75 0 0 0 .527 1.284h.899c-.381 3.83-3.651 6.833-7.644 6.833a7.7 7.7 0 0 1-6.565-3.644a.75.75 0 1 0-1.276.788a9.2 9.2 0 0 0 7.84 4.356c4.809 0 8.766-3.66 9.151-8.333H22a.75.75 0 0 0 .527-1.284z",opacity:".5"})]})}function nf(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[s.jsx("circle",{cx:"12",cy:"12",r:"3"}),s.jsx("path",{d:"M13.765 2.152C13.398 2 12.932 2 12 2s-1.398 0-1.765.152a2 2 0 0 0-1.083 1.083c-.092.223-.129.484-.143.863a1.62 1.62 0 0 1-.79 1.353a1.62 1.62 0 0 1-1.567.008c-.336-.178-.579-.276-.82-.308a2 2 0 0 0-1.478.396C4.04 5.79 3.806 6.193 3.34 7s-.7 1.21-.751 1.605a2 2 0 0 0 .396 1.479c.148.192.355.353.676.555c.473.297.777.803.777 1.361s-.304 1.064-.777 1.36c-.321.203-.529.364-.676.556a2 2 0 0 0-.396 1.479c.052.394.285.798.75 1.605c.467.807.7 1.21 1.015 1.453a2 2 0 0 0 1.479.396c.24-.032.483-.13.819-.308a1.62 1.62 0 0 1 1.567.008c.483.28.77.795.79 1.353c.014.38.05.64.143.863a2 2 0 0 0 1.083 1.083C10.602 22 11.068 22 12 22s1.398 0 1.765-.152a2 2 0 0 0 1.083-1.083c.092-.223.129-.483.143-.863c.02-.558.307-1.074.79-1.353a1.62 1.62 0 0 1 1.567-.008c.336.178.579.276.819.308a2 2 0 0 0 1.479-.396c.315-.242.548-.646 1.014-1.453s.7-1.21.751-1.605a2 2 0 0 0-.396-1.479c-.148-.192-.355-.353-.676-.555A1.62 1.62 0 0 1 19.562 12c0-.558.304-1.064.777-1.36c.321-.203.529-.364.676-.556a2 2 0 0 0 .396-1.479c-.052-.394-.285-.798-.75-1.605c-.467-.807-.7-1.21-1.015-1.453a2 2 0 0 0-1.479-.396c-.24.032-.483.13-.82.308a1.62 1.62 0 0 1-1.566-.008a1.62 1.62 0 0 1-.79-1.353c-.014-.38-.05-.64-.143-.863a2 2 0 0 0-1.083-1.083Z"})]})})}function tf(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:s.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M256 448c-97.974 0-178.808-73.383-190.537-168.183l42.341-5.293c9.123 73.734 71.994 130.809 148.196 130.809c82.475 0 149.333-66.858 149.333-149.333S338.475 106.667 256 106.667c-50.747 0-95.581 25.312-122.567 64h79.9v42.666H64V64h42.667v71.31C141.866 91.812 195.685 64 256 64c106.039 0 192 85.961 192 192s-85.961 192-192 192",clipRule:"evenodd"})})}function of(e){return s.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",...e,children:[s.jsx("rect",{x:"6",y:"3.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),s.jsx("rect",{x:"6",y:"7.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),s.jsx("rect",{x:"6",y:"11.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"})]})}function rf(e){return s.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[s.jsx("rect",{x:"3",y:"3",width:"4",height:"14",rx:"1",fill:"currentColor"}),s.jsx("rect",{x:"8",y:"3",width:"9",height:"14",rx:"1",fill:"currentColor",opacity:".3"})]})}function sf(e){return s.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[s.jsx("rect",{x:"3",y:"3",width:"14",height:"4",rx:"1",fill:"currentColor"}),s.jsx("rect",{x:"3",y:"8",width:"14",height:"9",rx:"1",fill:"currentColor",opacity:".3"})]})}function af(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"M11 13H6q-.425 0-.712-.288T5 12t.288-.712T6 11h5V6q0-.425.288-.712T12 5t.713.288T13 6v5h5q.425 0 .713.288T19 12t-.288.713T18 13h-5v5q0 .425-.288.713T12 19t-.712-.288T11 18z"})})}function lf(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"M7.5 12.5q-.213 0-.356-.144T7 11.999t.144-.356t.356-.143h9q.213 0 .356.144t.144.357t-.144.356t-.356.143z"})})}function cf(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:s.jsx("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"})})}function df(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsxs("g",{fill:"none",children:[s.jsx("path",{fill:"currentColor",d:"M7.378 11.63h-.75zm0 .926l-.562.497a.75.75 0 0 0 1.08.044zm2.141-1.015a.75.75 0 0 0-1.038-1.082zm-2.958-1.038a.75.75 0 1 0-1.122.994zm8.37-1.494a.75.75 0 1 0 1.102-1.018zM12.045 6.25c-2.986 0-5.416 2.403-5.416 5.38h1.5c0-2.137 1.747-3.88 3.916-3.88zm-5.416 5.38v.926h1.5v-.926zm1.269 1.467l1.622-1.556l-1.038-1.082l-1.622 1.555zm.042-1.039l-1.378-1.555l-1.122.994l1.377 1.556zm8.094-4.067a5.42 5.42 0 0 0-3.99-1.741v1.5a3.92 3.92 0 0 1 2.889 1.26zm.585 3.453l.56-.498a.75.75 0 0 0-1.08-.043zm-2.139 1.014a.75.75 0 1 0 1.04 1.082zm2.96 1.04a.75.75 0 0 0 1.12-.997zm-8.393 1.507a.75.75 0 0 0-1.094 1.026zm2.888 2.745c2.993 0 5.434-2.4 5.434-5.38h-1.5c0 2.135-1.753 3.88-3.934 3.88zm5.434-5.38v-.926h-1.5v.926zm-1.27-1.467l-1.619 1.555l1.04 1.082l1.618-1.555zm-.04 1.04l1.38 1.554l1.122-.996l-1.381-1.555zM7.952 16.03a5.45 5.45 0 0 0 3.982 1.719v-1.5c-1.143 0-2.17-.48-2.888-1.245z"}),s.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",opacity:".5"})]})})}function uf(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:s.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"})})}function ff(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:s.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"})})}const _f=({titulo:e,onBack:t})=>s.jsxs("header",{className:jn.header,children:[s.jsx(tn,{isIconOnly:!0,variant:"light",onClick:t,"aria-label":"Regresar",children:s.jsx(ga,{})}),s.jsx("h3",{className:jn.titulo,children:e})]}),st={contenedor:"_contenedor_1qz45_1",lista:"_lista_1qz45_13",item:"_item_1qz45_45",item_dragging:"_item_dragging_1qz45_75",icono_drag:"_icono_drag_1qz45_93",nombre:"_nombre_1qz45_129",checkbox:"_checkbox_1qz45_159"};function gf(){const e=Rn(),[t,n]=m.useState(null);if(!e)return null;const{state:o,todasLasColumnas:r,etiquetaColumna:i,cambiarOrdenColumnas:a}=e,{ordenColumnas:l}=o,d=g=>f=>{n(g),f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",g)},u=g=>f=>{f.preventDefault(),!(!t||t===g)&&a?.(c=>{const h=[...c],p=h.indexOf(t),v=h.indexOf(g);return p===-1||v===-1?c:(h.splice(p,1),h.splice(v,0,t),h)})},_=()=>n(null);return s.jsx("div",{className:st.contenedor,children:s.jsx("ul",{className:st.lista,children:l.map(g=>{const f=r.find(v=>v.id===g);if(!f)return null;const c=f.getCanHide?.()??!0,h=f.getIsVisible(),p=t===f.id;return s.jsxs("li",{className:`${st.item} ${p?st.item_dragging:""}`,draggable:!0,onDragStart:d(f.id),onDragOver:u(f.id),onDrop:_,onDragEnd:_,children:[s.jsx("span",{className:st.icono_drag,"aria-label":"Arrastrar columna",children:s.jsx(of,{})}),s.jsx("span",{className:st.nombre,children:i(f.id)}),s.jsx(wt,{size:"md",color:"primary",isSelected:h,isDisabled:!c,onChange:v=>f.toggleVisibility(v),className:st.checkbox})]},f.id)})})})}const Ot={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function pf(){const e=Rn(),[t,n]=m.useState(""),o=m.useRef(null),r=e?.state.table?.getState().pagination.pageSize??10;if(m.useEffect(()=>n(String(r)),[r]),!e)return null;const{cambiarPageSize:i}=e,a=g=>Math.max(Ur,Math.min(Xr,g)),l=g=>{const f=r+g;f>=Ur&&f<=Xr&&i?.(f)},d=()=>{const g=parseInt(t,10),f=!isNaN(g)&&g>0?a(g):r;i?.(f),n(String(f))},u=g=>{({Enter:()=>{d(),o.current?.blur()},Escape:()=>{n(String(r)),o.current?.blur()},ArrowUp:()=>{g.preventDefault(),l(1),setTimeout(()=>o.current?.select(),0)},ArrowDown:()=>{g.preventDefault(),l(-1),setTimeout(()=>o.current?.select(),0)}})[g.key]?.()},_=g=>{const f=g.target.value;(f===""||/^\d+$/.test(f))&&n(f)};return s.jsxs("div",{className:Ot.contenido,children:[s.jsx("p",{className:Ot.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),s.jsxs("div",{className:Ot.control,children:[s.jsx(tn,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(-1),"aria-label":"Disminuir filas",disabled:r<=Ur,children:s.jsx(lf,{style:{fontSize:"var(--gaps-6)"}})}),s.jsx("div",{className:Ot.valor,children:s.jsx("input",{ref:o,type:"text",inputMode:"numeric",value:t,onChange:_,onKeyDown:u,onFocus:()=>o.current?.select(),onBlur:d,className:Ot.input,"aria-label":"Número de filas por página"})}),s.jsx(tn,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(1),"aria-label":"Aumentar filas",disabled:r>=Xr,children:s.jsx(af,{})})]})]})}const un={contenedor:"_contenedor_1lwmx_1",menu:"_menu_1lwmx_11",item:"_item_1lwmx_25",icono_contenedor:"_icono_contenedor_1lwmx_111",icono_restaurar:"_icono_restaurar_1lwmx_143",texto:"_texto_1lwmx_153",nombre:"_nombre_1lwmx_165",descripcion:"_descripcion_1lwmx_183",chevron:"_chevron_1lwmx_201",divider:"_divider_1lwmx_227"};function hf({navegar:e}){const t=Rn();return s.jsxs("div",{className:un.contenedor,children:[s.jsx("nav",{className:un.menu,children:bf.map(({id:n,icono:o,nombre:r,descripcion:i})=>s.jsxs("button",{className:un.item,onClick:()=>e(n),children:[s.jsx("div",{className:un.icono_contenedor,children:s.jsx(o,{})}),s.jsxs("div",{className:un.texto,children:[s.jsx("span",{className:un.nombre,children:r}),s.jsx("span",{className:un.descripcion,children:i})]}),s.jsx(pa,{className:un.chevron})]},n))}),s.jsx("div",{className:un.divider}),s.jsx("div",{className:un.menu,children:s.jsxs("button",{className:un.item,onClick:t?.restaurarConfiguracion,children:[s.jsx("div",{className:un.icono_contenedor,children:s.jsx(tf,{className:un.icono_restaurar})}),s.jsxs("div",{className:un.texto,children:[s.jsx("span",{className:un.nombre,children:"Restaurar configuración"}),s.jsx("span",{className:un.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const Ur=1,Xr=200,ha=250,mf=200,vf={panelPrincipal:{component:hf},panelColumnas:{component:gf,titulo:"Columnas visibles"},panelFilas:{component:pf,titulo:"Filas por página"}},bf=[{id:"panelColumnas",icono:rf,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:sf,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}];function wf(e,t,n){const o=m.useRef(n);o.current=n;const r=m.useRef(e);r.current=e;const i=m.useCallback(a=>{const l=a.target;o.current.some(u=>u.current?.contains(l))||r.current()},[]);m.useEffect(()=>{if(!t)return;const a=setTimeout(()=>{document.addEventListener("mousedown",i)},100);return()=>{clearTimeout(a),document.removeEventListener("mousedown",i)}},[t,i])}function ma(e,t){m.useEffect(()=>{if(!t)return;const n=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t,e])}function yf(e,t,n,{width:o,offsetRight:r=0,offsetLeft:i=0,offsetTop:a=0,offsetBottom:l=0,shiftPadding:d=8}){const[u,_]=m.useState({top:0,left:0}),g=Fo("only screen and (max-width: 480px)"),f=m.useCallback(()=>{if(!e.current)return{top:0,left:0};const c=e.current.getBoundingClientRect(),h=d;let p=c.bottom+a,v=0;g?v=c.right-o-i+r:v=c.right-o+r-i;const w=t.current?.offsetHeight||400;p+w>window.innerHeight-h&&(p=c.top-w-l,p<h&&(p=h));const C=h,x=window.innerWidth-o-h;return v=Math.max(C,Math.min(v,x)),{top:p,left:v}},[g,o,r,i,a,l,d,e,t]);return m.useEffect(()=>{if(!n||!e.current)return;const c=()=>{_(f())};return c(),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)}},[n,f,e]),u}function Cf(e){m.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function xf(){const[e,t]=m.useState(!1),[n,o]=m.useState(!1),[r,i]=m.useState("panelPrincipal"),[a,l]=m.useState(null),d=m.useRef(null),u=m.useRef(null),_=m.useRef(null);Cf(n),wf(()=>f(),n,[d,u]),ma(()=>f(),n);const g=yf(d,u,n,{width:ha,offsetRight:6,offsetTop:-2,shiftPadding:8});m.useEffect(()=>{e&&(o(!0),l(null))},[e]),m.useEffect(()=>()=>{_.current&&clearTimeout(_.current)},[]);function f(){n&&(t(!1),_.current=window.setTimeout(()=>{o(!1),i("panelPrincipal"),l(null)},mf))}function c(v){l(v==="panelPrincipal"?"backward":"forward"),i(v)}const h=vf[r],p=h.component;return s.jsxs("div",{className:jn.contenedor,children:[s.jsx(tn,{isIconOnly:!0,ref:d,variant:"light",onClick:()=>t(v=>!v),"aria-haspopup":"dialog","aria-expanded":e,children:s.jsx(nf,{})}),n&&d.current&&Ct.createPortal(s.jsx("div",{ref:u,className:`${jn.popover} ${e?jn.popover_entrada:jn.popover_salida}`,role:"dialog",style:{top:`${g.top}px`,left:`${g.left}px`,width:ha},children:s.jsx("div",{className:jn.ventana,children:s.jsxs("div",{className:K([jn.panel,jn[`panel_${a}`]]),children:[h.titulo&&s.jsx(_f,{titulo:h.titulo,onBack:()=>c("panelPrincipal")}),s.jsx(p,{navegar:c})]},r)})}),document.body)]})}function Sf(){const e=Rn();if(!e)return null;const{state:t}=e,{inputBusqueda:n,setInputBusqueda:o,loading:r,filtros:i,actualizarTabla:a,descargarExcel:l,paginacion:d}=t,{abrirFiltros:u,filtrosAplicados:_=[]}=i||{},g=_?.length||0;return s.jsxs("section",{className:We.contenedor_superior,children:[s.jsxs("div",{className:We.input_con_icono,id:"buscador-tabla",children:[s.jsx(Zu,{className:We.icono_busqueda}),s.jsx("input",{type:"text",placeholder:"Buscar en tabla...",value:n??"",onChange:f=>o&&o(f.target.value),className:We.input_busqueda})]}),s.jsxs("div",{className:We.contenedor_acciones_botones,children:[s.jsxs("div",{className:We.contenedor_acciones,children:[d?.hayMasDatos&&s.jsxs(tn,{id:"cargar-mas-datos",variant:"light",className:We.boton_basico,disabled:r,onClick:d.onCargarMasDatos,children:[s.jsx(df,{}),r?"Actualizando...":"Más datos"]}),u!==void 0&&s.jsxs(tn,{id:"boton-filtros",onClick:u,variant:"light",className:We.boton_basico,children:[s.jsx(Qu,{})," Filtros"]}),g>0?s.jsxs("div",{className:We.texto_filtros,id:"filtros-aplicados",children:[s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:s.jsx("path",{d:"M2 4h12M4 8h8M6 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),s.jsx("p",{children:Xu(_,g)})]}):null]}),l!==void 0?s.jsxs(tn,{onClick:l,className:`${We.boton_basico} ${We.boton_excel}`,children:[s.jsx(Ju,{})," Excel"]}):null]}),s.jsxs("div",{className:We.contenedor_acciones,children:[a!==void 0&&s.jsx(it,{content:"Actualiza los últimos datos guardados",children:s.jsx(tn,{id:"actualizar-tabla",variant:"light",isIconOnly:!0,className:We.boton_basico,disabled:a?.cargando,onClick:a?.onClick,children:s.jsx(ef,{})})}),s.jsx("div",{className:We.menu_configuraciones,id:"configuraciones-tabla",children:s.jsx(xf,{})})]})]})}const Nn={contenedor_paginacion:"_contenedor_paginacion_1l3vz_1",info_paginacion:"_info_paginacion_1l3vz_19",contenedor_botones:"_contenedor_botones_1l3vz_37",boton_paginacion:"_boton_paginacion_1l3vz_87",pagina_activa:"_pagina_activa_1l3vz_107",boton_num_paginacion:"_boton_num_paginacion_1l3vz_117"};function $f(){const e=Rn();if(!e)return null;const{state:t}=e,{table:n}=t,o=n.getPrePaginationRowModel().rows.length,r=n.getPageCount()||1,{pageIndex:i}=n.getState().pagination,a=i+1,l=Gu(a,r),d=n.getCanPreviousPage(),u=n.getCanNextPage(),_=r>1,g=i===0,f=i===r-1,c=()=>{d&&n.previousPage()},h=()=>{u&&n.nextPage()},p=C=>{n.setPageIndex(C-1)},v=()=>{g||n.firstPage()},w=()=>{f||n.lastPage()};return s.jsxs("section",{className:Nn.contenedor_paginacion,id:"paginacion-tabla",children:[s.jsxs("p",{className:Nn.info_paginacion,id:"paginacion-total-documentos",children:["Documentos: ",o]}),_&&s.jsxs("div",{className:Nn.contenedor_botones,id:"paginacion-numerador-pags",children:[!g&&s.jsx(uf,{id:"paginacion-flecha-inicio",onClick:v,"aria-label":"Ir a la primera página","aria-disabled":g,className:Nn.boton_paginacion}),d&&s.jsx(ga,{id:"paginacion-flecha-izq",onClick:c,"aria-disabled":!d,className:Nn.boton_paginacion}),s.jsx("div",{id:"paginacion-numero-pag",children:l.map(C=>s.jsx("button",{type:"button",onClick:()=>p(C),"aria-current":C===a?"page":void 0,className:C===a?Nn.pagina_activa:Nn.boton_num_paginacion,children:C},C))}),u&&s.jsx(pa,{id:"paginacion-flecha-der",onClick:h,"aria-disabled":!u,className:Nn.boton_paginacion}),!f&&s.jsx(ff,{id:"paginacion-flecha-fin",onClick:w,"aria-label":"Ir a la última página","aria-disabled":f,className:Nn.boton_paginacion})]}),s.jsxs("p",{className:Nn.info_paginacion,id:"paginacion-total-pags",children:["Página ",a," de ",r]})]})}const Ee={contenedor_tabla_cards:"_contenedor_tabla_cards_zuvsb_1",contenedor_card:"_contenedor_card_zuvsb_11",contenedor_encabezado_card:"_contenedor_encabezado_card_zuvsb_25",contenedor_columna_card:"_contenedor_columna_card_zuvsb_47",card_label:"_card_label_zuvsb_57",card_valor:"_card_valor_zuvsb_69",card_segundo_valor:"_card_segundo_valor_zuvsb_83",contenedor_contenido_cards:"_contenedor_contenido_cards_zuvsb_93",contenedor_fila_card:"_contenedor_fila_card_zuvsb_105",card_fila_label:"_card_fila_label_zuvsb_119",card_fila_valor:"_card_fila_valor_zuvsb_137",contenedor_acciones_card:"_contenedor_acciones_card_zuvsb_153",boton_acciones:"_boton_acciones_zuvsb_171",boton_card:"_boton_card_zuvsb_207",boton_personalizado:"_boton_personalizado_zuvsb_237"};function va(e,t){if(t)return e.find(n=>n.accessorKey===t||n.id!==void 0&&n.id===String(t))}function ba(e){if(e)return e.id??e.accessorKey}const qn={skeleton_elemento:"_skeleton_elemento_5jnrx_1",skeleton_elemento_encabezado:"_skeleton_elemento_encabezado_5jnrx_23",skeleton_elemento_encabezado_segundo:"_skeleton_elemento_encabezado_segundo_5jnrx_73",skeleton_elemento_contenido:"_skeleton_elemento_contenido_5jnrx_99",skeleton_accion:"_skeleton_accion_5jnrx_107"};function kf({filas:e,cantidadControles:t=0,table:n,idPrimeraColumna:o,idSegundaColumna:r}){const a=n.getAllLeafColumns().filter(d=>d.id!=="actions"&&d.id!==o&&d.id!==r),l=["25vw","30vw","20vw","28vw","22vw","26vw"];return s.jsx("section",{className:Ee.contenedor_tabla_cards,children:Array.from({length:e}).map((d,u)=>s.jsxs("article",{className:Ee.contenedor_card,children:[s.jsxs("div",{className:Ee.contenedor_encabezado_card,children:[s.jsx("div",{className:Ee.contenedor_columna_card,children:o&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ee.card_label,children:yt(o,n)}),s.jsx("div",{className:Ee.card_valor,children:s.jsx("div",{className:`${qn.skeleton_elemento} ${qn.skeleton_elemento_encabezado}`})})]})}),s.jsx("div",{className:Ee.contenedor_columna_card,children:r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ee.card_label,children:yt(r,n)}),s.jsx("div",{className:Ee.card_segundo_valor,children:s.jsx("div",{className:`${qn.skeleton_elemento} ${qn.skeleton_elemento_encabezado_segundo}`})})]})})]}),s.jsx("div",{className:Ee.contenedor_contenido_cards,children:a.map((_,g)=>s.jsxs("div",{className:Ee.contenedor_fila_card,children:[s.jsx("div",{className:Ee.card_fila_label,children:yt(_.id,n)}),s.jsx("div",{className:Ee.card_fila_valor,children:s.jsx("div",{className:`${qn.skeleton_elemento} ${qn.skeleton_elemento_contenido}`,style:{width:l[g%l.length]}})})]},_.id))}),t>0&&s.jsx("div",{className:Ee.contenedor_acciones_card,children:Array.from({length:Math.min(t,3)}).map((_,g)=>s.jsx("div",{className:qn.skeleton_accion,children:s.jsx("div",{className:`${qn.skeleton_elemento} ${qn.skeleton_elemento_encabezado}`})},`accion-${g}`))})]},`skeleton-card-${u}`))})}const at={contenedor:"_contenedor_53kvd_1",envolvedor_cuadricula:"_envolvedor_cuadricula_53kvd_33",svg_cuadricula:"_svg_cuadricula_53kvd_61",envolvedor_contenido:"_envolvedor_contenido_53kvd_77",icono_carpeta:"_icono_carpeta_53kvd_97",titulo:"_titulo_53kvd_111",descripcion:"_descripcion_53kvd_129"};function wa(){const e=m.useContext(Kr),{sinDatosProps:t}=e?.state||{},{botonAccion:n,titulo:o="No se encontraron coincidencias",descripcion:r='Usa el botón "Filtros" para ampliar tu búsqueda.'}=t||{};return s.jsxs("div",{className:at.contenedor,children:[s.jsx(If,{}),s.jsxs("div",{className:at.envolvedor_contenido,children:[s.jsx(Ef,{}),s.jsx("h3",{className:at.titulo,children:o}),s.jsx("p",{className:at.descripcion,children:r}),n]})]})}function If(){return s.jsx("div",{className:at.envolvedor_cuadricula,children:s.jsxs("svg",{className:at.svg_cuadricula,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("defs",{children:s.jsx("pattern",{id:"patronCuadricula",width:"40",height:"40",patternUnits:"userSpaceOnUse",children:s.jsx("path",{d:"M 40 0 L 0 0 0 40",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),s.jsx("rect",{width:"100%",height:"100%",fill:"url(#patronCuadricula)"})]})})}function Ef(){return s.jsxs("svg",{className:at.icono_carpeta,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M10 25C10 22.2386 12.2386 20 15 20H40L50 30H85C87.7614 30 90 32.2386 90 35V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V25Z",fill:"var(--color-placeholder)"}),s.jsx("path",{d:"M10 40C10 37.2386 12.2386 35 15 35H85C87.7614 35 90 37.2386 90 40V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V40Z",fill:"var(--base)",stroke:"var(--color-placeholder)",strokeWidth:"2"}),s.jsx("circle",{cx:"35",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),s.jsx("circle",{cx:"55",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),s.jsx("path",{d:"M42 65H48",stroke:"var(--color-primary-text)",strokeWidth:"1.5",strokeLinecap:"round"}),s.jsx("circle",{cx:"78",cy:"78",r:"14",fill:"var(--brand-primary)"}),s.jsx("path",{d:"M78 71V85M71 78H85",stroke:"var(--base)",strokeWidth:"2.5",strokeLinecap:"round"})]})}const Mf=({fila:e,controls:t})=>(t?.length??0)>0?s.jsx("div",{className:Ee.contenedor_acciones_card,children:t?.map(o=>"contenido"in o?s.jsxs("span",{className:`${Ee.boton_personalizado} ${Ee.boton_acciones} ${Ee.boton_card}`,onClick:r=>{const i=r.currentTarget.querySelector("button");i&&!i.contains(r.target)&&i.click()},children:[o.contenido(e.original)," ",o.nombre]},o.id):s.jsxs("button",{id:o.id,type:"button",title:o.nombre,onClick:()=>o.evento(e.original),className:`${Ee.boton_acciones} ${Ee.boton_card}`,children:[o.icono," ",o.nombre]},o.id))}):null,Nf=({columnasRestantes:e,table:t})=>e.length===0?null:s.jsx("div",{className:Ee.contenedor_contenido_cards,children:e.map(n=>s.jsxs("div",{className:Ee.contenedor_fila_card,children:[s.jsx("div",{className:Ee.card_fila_label,children:yt(n.column.id,t)}),s.jsx("div",{className:Ee.card_fila_valor,children:bt(n.column.columnDef.cell,n.getContext())})]},n.id))}),Ff=({fila:e,table:t,idPrimeraColumna:n,idSegundaColumna:o})=>{const r=ua(e,n),i=ua(e,o);return s.jsxs("div",{className:Ee.contenedor_encabezado_card,children:[s.jsx("div",{className:Ee.contenedor_columna_card,children:n&&r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ee.card_label,children:yt(n,t)}),s.jsx("div",{className:Ee.card_valor,children:da(e,n)})]})}),s.jsx("div",{className:Ee.contenedor_columna_card,children:o&&i&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ee.card_label,children:yt(o,t)}),s.jsx("div",{className:Ee.card_segundo_valor,children:da(e,o)})]})})]})};function zf(){const e=Rn();if(!e)return null;const{state:t}=e,{table:n,controls:o,primerasColumnas:r,loading:i,columns:a}=t;if(!n)return null;const l=a&&r?va(a,r[0]):void 0,d=a&&r?va(a,r[1]):void 0,u=ba(l),_=ba(d);if(i)return s.jsx(kf,{filas:3,cantidadControles:o?.length??0,table:n,idPrimeraColumna:u,idSegundaColumna:_});const g=n.getRowModel().rows;return g.length===0?s.jsx("article",{className:Ee.contenedor_card,children:s.jsx(wa,{})}):s.jsx("section",{className:Ee.contenedor_tabla_cards,children:g.map(f=>{const c=Uu(f,u,_);return s.jsxs("article",{id:`tabla-card-${f.id}`,className:Ee.contenedor_card,children:[s.jsx(Ff,{fila:f,table:n,idPrimeraColumna:u,idSegundaColumna:_}),s.jsx(Nf,{columnasRestantes:c,table:n}),s.jsx(Mf,{fila:f,controls:o})]},f.id)})})}const ya={filas:"_filas_un2v3_1",columnas:"_columnas_un2v3_43"},Df=({columnas:e,filas:t})=>s.jsx(s.Fragment,{children:Array.from({length:t}).map((n,o)=>s.jsx("tr",{className:ya.filas,children:Array.from({length:e}).map((r,i)=>s.jsx("td",{className:ya.columnas},`sk-cell-${o}-${i}`))},`sk-row-${o}`))}),lt={contenedor:"_contenedor_1mvgy_1",barra:"_barra_1mvgy_17",info:"_info_1mvgy_39",btn_cerrar:"_btn_cerrar_1mvgy_51",contador:"_contador_1mvgy_67",separador:"_separador_1mvgy_83",acciones:"_acciones_1mvgy_97"};function Af({totalSeleccionadas:e,acciones:t,filasSeleccionadas:n,onLimpiarSeleccion:o}){const[r,i]=m.useState(0),[a,l]=m.useState([]),[d,u]=m.useState([]),_=e>0,g=m.useRef(null);return ma(o,_),m.useEffect(()=>{_&&(i(e),l(t),u(n))},[e,t,n,_]),s.jsx(Ut,{mostrar:_,tipo:"escalar",className:lt.contenedor,children:s.jsxs("div",{ref:g,className:lt.barra,children:[s.jsxs("div",{className:lt.info,children:[s.jsx(tn,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:o,"aria-label":"Limpiar selección",className:lt.btn_cerrar,children:s.jsx(cf,{})}),s.jsxs("p",{className:lt.contador,children:[r," filas seleccionadas"]})]}),s.jsx("div",{className:lt.separador}),s.jsx("div",{className:lt.acciones,children:a.map(f=>s.jsx("div",{children:f.componente(d)},f.id))})]})})}function Lf(){const e=Rn();if(!e)return null;const{state:t}=e,{table:n,loading:o,columns:r,selectorFilas:i=[]}=t;if(!n)return null;const a=n.getHeaderGroups(),l=n.getRowModel().rows,d=r?.length??0,u=n.getSelectedRowModel().rows,_=u.length,g=()=>{n.resetRowSelection()};return s.jsxs(s.Fragment,{children:[s.jsxs("table",{className:We.contenedor_tabla,children:[s.jsx("thead",{children:a.map(f=>s.jsx("tr",{children:f.headers.map(c=>{const h=c.column.columnDef.meta?.style;return s.jsx("th",{id:`tabla-col-${c.id}`,className:We.encabezados,style:h,"data-columna":c.id,children:c.id==="select"?s.jsx("div",{children:bt(c.column.columnDef.header,c.getContext())}):s.jsxs("div",{onClick:c.column.getToggleSortingHandler(),children:[bt(c.column.columnDef.header,c.getContext()),Ku(c.column.getIsSorted())]})},c.id)})},f.id))}),s.jsx("tbody",{className:We.contenedor_datos,children:o?s.jsx(Df,{columnas:d,filas:10}):l.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:d,style:{backgroundColor:"var(--base)"},children:s.jsx(wa,{})})}):l.map(f=>s.jsx("tr",{id:`tabla-fila-${f.id}`,className:`${We.datos} ${f.getIsSelected()?We.seleccionada:""}`,"data-fila-index":f.index,children:f.getVisibleCells().map(c=>{const h=c.column.columnDef.meta?.style;return s.jsx("td",{className:We.columna,style:h,"data-columna":c.column.id,children:bt(c.column.columnDef.cell,c.getContext())},c.id)})},f.id))})]}),i?.length>0?s.jsx(Af,{totalSeleccionadas:_,acciones:i,filasSeleccionadas:u.map(f=>f.original),onLimpiarSeleccion:g}):null]})}function Pf({id:e}){const t=Fo("only screen and (max-width: 830px)");return s.jsxs("main",{className:We.contenedor,id:e,children:[s.jsx(Sf,{}),t?s.jsx(zf,{}):s.jsx(Lf,{}),s.jsx($f,{})]})}function Tf({id:e,...t}){return s.jsx(Yu,{...t,children:s.jsx(Pf,{id:e})})}const Ae={contenedor_radio:"_contenedor_radio_87ox4_1",envoltorio_radio:"_envoltorio_radio_87ox4_15",contenedor_label:"_contenedor_label_87ox4_33",texto_label:"_texto_label_87ox4_47",texto_descripcion:"_texto_descripcion_87ox4_65",marca_requerido:"_marca_requerido_87ox4_77",radio:"_radio_87ox4_85",input:"_input_87ox4_115",circulo_radio:"_circulo_radio_87ox4_141",punto_radio:"_punto_radio_87ox4_177",invalido:"_invalido_87ox4_207",solo_lectura:"_solo_lectura_87ox4_215",deshabilitado:"_deshabilitado_87ox4_227",tam_sm:"_tam_sm_87ox4_289",tam_lg:"_tam_lg_87ox4_315",color_primary:"_color_primary_87ox4_341",color_secondary:"_color_secondary_87ox4_349",color_success:"_color_success_87ox4_357",color_warning:"_color_warning_87ox4_365",color_danger:"_color_danger_87ox4_373",variante_card:"_variante_card_87ox4_381",grupo_radio:"_grupo_radio_87ox4_531",encabezado_grupo:"_encabezado_grupo_87ox4_545",label_grupo:"_label_grupo_87ox4_559",descripcion_grupo:"_descripcion_grupo_87ox4_573",contenedor_radios:"_contenedor_radios_87ox4_583",orientacion_vertical:"_orientacion_vertical_87ox4_593",orientacion_horizontal:"_orientacion_horizontal_87ox4_601",mensaje_error:"_mensaje_error_87ox4_609",grupo_invalido:"_grupo_invalido_87ox4_621",grupo_deshabilitado:"_grupo_deshabilitado_87ox4_629",grupo_solo_lectura:"_grupo_solo_lectura_87ox4_653",seleccionado:"_seleccionado_87ox4_679"},Ca=m.createContext(void 0),Of=()=>m.useContext(Ca),Yr=m.memo(m.forwardRef(({value:e,label:t,description:n,size:o="md",color:r="primary",customColor:i,variant:a="default",isDisabled:l=!1,isReadOnly:d=!1,isInvalid:u=!1,isRequired:_=!1,children:g,className:f="",onChange:c,...h},p)=>{const v=Of(),w=m.useId(),C=h.id||w,x=v?.name||h.name,I=v?.size||o,z=v?.color||r,A=v?.customColor||i,N=v?.variant||a,L=v?.isDisabled||l,P=v?.isReadOnly||d,k=v?.isInvalid||u,O=v?.isRequired||_,j=v?.value!==void 0?v.value===e:void 0,$=g||t,b=F=>{L||P||(v?.onChange&&v.onChange(e),c&&c(F))},S=[Ae.contenedor_radio,Ae[`tam_${I}`],!A&&Ae[`color_${z}`],Ae[`variante_${N}`],L&&Ae.deshabilitado,P&&Ae.solo_lectura,k&&Ae.invalido,j&&Ae.seleccionado,f].filter(Boolean).join(" "),T=A?{"--radio-custom-color":A}:void 0;return s.jsx("div",{className:S,style:T,children:s.jsxs("label",{className:Ae.envoltorio_radio,htmlFor:C,children:[s.jsxs("div",{className:Ae.radio,children:[s.jsx("input",{ref:p,type:"radio",id:C,name:x,value:e,checked:j,disabled:L,readOnly:P,required:O,"aria-invalid":k,className:Ae.input,onChange:b,...h}),s.jsx("div",{className:Ae.circulo_radio,children:s.jsx("div",{className:Ae.punto_radio})})]})," ",$&&s.jsxs("div",{className:Ae.contenedor_label,children:[s.jsxs("span",{className:Ae.texto_label,children:[$,_&&!v&&s.jsx("span",{className:Ae.marca_requerido,children:" *"})]}),n&&s.jsx("span",{className:Ae.texto_descripcion,children:n})]})]})})}));Yr.displayName="Radio";const xa=({name:e,value:t,defaultValue:n,onChange:o,orientation:r="horizontal",label:i,description:a,isDisabled:l=!1,isReadOnly:d=!1,isRequired:u=!1,isInvalid:_=!1,errorMessage:g,size:f,color:c,customColor:h,variant:p,justifyContent:v="flex-start",children:w,className:C="",options:x,optionValueKey:I,optionLabelKey:z,optionDisabledKey:A,optionDescriptionKey:N})=>{const[L,P]=m.useState(String(n??"")),k=t!==void 0?String(t):L,j={name:e,value:k,onChange:S=>{l||d||(t===void 0&&P(S),o&&o(S))},size:f,color:c,customColor:h,variant:p,isDisabled:l,isReadOnly:d,isInvalid:_,isRequired:u},$=[Ae.grupo_radio,Ae[`orientacion_${r}`],_&&Ae.grupo_invalido,l&&Ae.grupo_deshabilitado,d&&Ae.grupo_solo_lectura,C].filter(Boolean).join(" "),b=v==="center"?"center":v==="flex-end"?"right":"left";return s.jsx(Ca.Provider,{value:j,children:s.jsxs("div",{className:$,role:"radiogroup","aria-required":u,"aria-invalid":_,style:{textAlign:b},children:[i&&s.jsxs("div",{className:Ae.encabezado_grupo,children:[s.jsxs("label",{className:Ae.label_grupo,children:[i,u&&s.jsx("span",{className:Ae.marca_requerido,children:" *"})]}),a&&s.jsx("span",{className:Ae.descripcion_grupo,children:a})]}),s.jsx("div",{className:Ae.contenedor_radios,style:{justifyContent:v},children:x&&x.length>0?x.map((S,T)=>{let F,y,E=!1,D;if(typeof S=="object"&&S!==null){const B=I??"value",H=z??"label",V=A??"isDisabled",J=N??"description",U=S[B],pe=S[H];F=String(U!==void 0?U:T),y=pe;const ce=S[V];E=typeof ce=="boolean"?ce:!1;const ie=S[J];D=typeof ie=="string"?ie:void 0}else F=String(S),y=S;return s.jsx(Yr,{value:F,isDisabled:E,description:D,children:y},F)}):w}),_&&g&&s.jsx("span",{className:Ae.mensaje_error,children:g})]})})};xa.displayName="RadioGroup";const fn={backdrop:"_backdrop_1fyqe_1",visible:"_visible_1fyqe_37",drawer:"_drawer_1fyqe_57",posicion_right:"_posicion_right_1fyqe_123",drawer_detras:"_drawer_detras_1fyqe_155",posicion_left:"_posicion_left_1fyqe_163",posicion_top:"_posicion_top_1fyqe_203",posicion_bottom:"_posicion_bottom_1fyqe_243",radio_none:"_radio_none_1fyqe_283",radio_sm:"_radio_sm_1fyqe_291",radio_md:"_radio_md_1fyqe_311",radio_lg:"_radio_lg_1fyqe_331",radio_xl:"_radio_xl_1fyqe_351",tamano_sm:"_tamano_sm_1fyqe_451",tamano_md:"_tamano_md_1fyqe_461",tamano_lg:"_tamano_lg_1fyqe_471",tamano_xl:"_tamano_xl_1fyqe_481",tamano_full:"_tamano_full_1fyqe_491",encabezado:"_encabezado_1fyqe_551",titulo:"_titulo_1fyqe_571",boton_cerrar:"_boton_cerrar_1fyqe_591",contenido:"_contenido_1fyqe_645",pie:"_pie_1fyqe_657",loading_overlay:"_loading_overlay_1fyqe_677",spinner:"_spinner_1fyqe_701",spin:"_spin_1fyqe_701",loading_text:"_loading_text_1fyqe_731",resize_handle:"_resize_handle_1fyqe_743"},Sa=m.forwardRef(({isOpen:e,onClose:t,position:n="right",size:o="md",title:r,showCloseButton:i=!0,closeOnBackdropClick:a=!0,closeOnEscape:l=!0,preventScroll:d=!0,header:u,footer:_,children:g,className:f="",contentClassName:c="",isLoading:h=!1,loadingMessage:p="Cargando...",onOpen:v,backdropVariant:w="normal",borderRadius:C,resizable:x=!1,zIndex:I,getContainer:z},A)=>{const N=m.useRef(null),[L,P]=m.useState(!1),k=m.useCallback(()=>{L||(P(!0),setTimeout(()=>{t?.(),P(!1)},650))},[t,L]);m.useEffect(()=>{e&&P(!1)},[e]),m.useEffect(()=>{if(e){if(v?.(),d){const V=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",V>0&&(document.body.style.paddingRight=`${V}px`)}if(l){const V=J=>{J.key==="Escape"&&k()};return document.addEventListener("keydown",V),()=>{document.removeEventListener("keydown",V),d&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{d&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,k,l,d,v]);const O=V=>{a&&V.target===N.current&&k()},j=C?fn[`radio_${C}`]:void 0,$=e&&!L,b=[fn.drawer,fn[`posicion_${n}`],fn[`tamano_${o}`],$&&fn.visible,j,f].filter(Boolean).join(" "),S=[fn.contenido,c].filter(Boolean).join(" "),T=[fn.backdrop,$&&fn.visible].filter(Boolean).join(" "),F=I||500,y={transparente:{opacity:0},sutil:{opacity:.2},normal:{opacity:.4},intermedio:{opacity:.6},intenso:{opacity:.8}},E=y[w]||y.normal,{opacity:D}=E,B={background:`rgb(0 0 0 / ${D})`,zIndex:F,...z&&{position:"absolute"}},H=s.jsx("div",{className:T,ref:N,onClick:O,style:B,children:s.jsxs("div",{ref:A,className:b,role:"dialog","aria-modal":"true","aria-labelledby":"drawer-title",children:[(r||u)&&s.jsx("div",{className:fn.encabezado,children:u||s.jsxs(s.Fragment,{children:[s.jsx("h2",{id:"drawer-title",className:fn.titulo,children:r}),i&&s.jsx("button",{type:"button",className:fn.boton_cerrar,onClick:k,"aria-label":"Cerrar",children:s.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:s.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}),s.jsx("div",{className:S,children:g}),_&&s.jsx("div",{className:fn.pie,children:_}),h&&s.jsxs("div",{className:fn.loading_overlay,children:[s.jsx("div",{className:fn.spinner}),s.jsx("span",{className:fn.loading_text,children:p})]}),x&&s.jsx("div",{className:fn.resize_handle})]})});if(z){const V=typeof z=="function"?z():z;if(V&&V instanceof HTMLElement)return Ct.createPortal(H,V)}return H});Sa.displayName="Drawer";const _n={backdrop:"_backdrop_mpzhi_1",visible:"_visible_mpzhi_37",centrado:"_centrado_mpzhi_61",modal:"_modal_mpzhi_69",tamano_sm:"_tamano_sm_mpzhi_143",tamano_md:"_tamano_md_mpzhi_151",tamano_lg:"_tamano_lg_mpzhi_159",tamano_xl:"_tamano_xl_mpzhi_167",tamano_formulario:"_tamano_formulario_mpzhi_175",tamano_full:"_tamano_full_mpzhi_183",tamano_auto:"_tamano_auto_mpzhi_191",encabezado:"_encabezado_mpzhi_201",contenedor_titulo_completo:"_contenedor_titulo_completo_mpzhi_215",contenedor_titulo_icono:"_contenedor_titulo_icono_mpzhi_225",boton_atras:"_boton_atras_mpzhi_237",icono_titulo:"_icono_titulo_mpzhi_279",titulo:"_titulo_mpzhi_293",contenido:"_contenido_mpzhi_313",pie:"_pie_mpzhi_325",loading_overlay:"_loading_overlay_mpzhi_345",spinner:"_spinner_mpzhi_369",spin:"_spin_mpzhi_369",loading_text:"_loading_text_mpzhi_399"},$a=m.forwardRef(({isOpen:e,onClose:t,size:n="md",title:o,titleIcon:r,closeOnBackdropClick:i=!1,closeOnEscape:a=!0,preventScroll:l=!0,isCentered:d=!0,header:u,footer:_,children:g,className:f="",contentClassName:c="",isLoading:h=!1,loadingMessage:p="Cargando...",backdropVariant:v="normal",showIconTitle:w=!1,onOpen:C},x)=>{const I=m.useRef(null),z=m.useCallback(()=>{h||t?.()},[t,h]);m.useEffect(()=>{if(e){if(C?.(),l){const $=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",$>0&&(document.body.style.paddingRight=`${$}px`)}if(a){const $=b=>{b.key==="Escape"&&z()};return document.addEventListener("keydown",$),()=>{document.removeEventListener("keydown",$),l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,z,a,l,C]);const A=$=>{i&&$.target===I.current&&z()},N=[_n.backdrop,d&&_n.centrado,e&&_n.visible].filter(Boolean).join(" "),L=[_n.modal,_n[`tamano_${n}`],f].filter(Boolean).join(" "),P=[_n.contenido,c].filter(Boolean).join(" "),k={transparente:{opacity:0},sutil:{opacity:.3},normal:{opacity:.5},intermedio:{opacity:.7},intenso:{opacity:.9}},{opacity:O}=k[v]||k.normal,j={background:`rgb(0 0 0 / ${O})`};return s.jsx("div",{className:N,ref:I,onClick:A,style:j,children:s.jsxs("div",{ref:x,className:L,role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",children:[(o||u)&&s.jsx("div",{className:_n.encabezado,children:s.jsx("div",{className:_n.contenedor_titulo_completo,children:u||s.jsx(s.Fragment,{children:s.jsxs("div",{className:_n.contenedor_titulo_icono,children:[w&&r!==void 0&&(typeof r=="string"?s.jsx("span",{className:_n.icono_titulo,children:r}):r),w&&r===void 0&&s.jsx("span",{className:_n.icono_titulo,children:"📄"}),s.jsx("h2",{id:"modal-title",className:_n.titulo,children:o})]})})})}),s.jsx("div",{className:P,children:g}),_&&s.jsx("div",{className:_n.pie,children:_}),h&&s.jsxs("div",{className:_n.loading_overlay,children:[s.jsx("div",{className:_n.spinner}),s.jsx("span",{className:_n.loading_text,children:p})]})]})})});$a.displayName="Modal";const xn={overlay:"_overlay_1jsdb_1",container:"_container_1jsdb_47",modal:"_modal_1jsdb_65",modal_closing:"_modal_closing_1jsdb_125",modal_detras:"_modal_detras_1jsdb_143",header:"_header_1jsdb_217",button_back:"_button_back_1jsdb_233",title_container:"_title_container_1jsdb_289",title_icon:"_title_icon_1jsdb_305",title:"_title_1jsdb_289",content:"_content_1jsdb_337",footer:"_footer_1jsdb_349"};function Vf({modals:e,onClose:t}){const[n,o]=m.useState([]),[r,i]=m.useState(!1);m.useEffect(()=>{const f=()=>{i(window.innerWidth<=768)};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]);const a=f=>{o(c=>[...c,f]),setTimeout(()=>{t(f),o(c=>c.filter(h=>h!==f))},300)};if(e.length===0)return null;const l=e.length-1,d=500,u=24,_=e.length*d+(e.length-1)*u,g=e.length>1?_/2-d/2-l*(d+u):0;return s.jsx("div",{className:xn.overlay,children:s.jsx("div",{className:xn.container,style:r?void 0:{transform:`translateX(${g}px)`},children:e.map((f,c)=>{const h=n.includes(f.id),p=c===e.length-1,v=[xn.modal,h&&xn.modal_closing,!p&&xn.modal_detras].filter(Boolean).join(" ");return s.jsxs("div",{className:v,children:[s.jsxs("div",{className:xn.header,children:[s.jsx("button",{type:"button",className:xn.button_back,onClick:()=>a(f.id),"aria-label":"Volver",children:s.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:s.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),s.jsxs("div",{className:xn.title_container,children:[f.titleIcon&&s.jsx("span",{className:xn.title_icon,children:f.titleIcon}),s.jsx("h2",{className:xn.title,children:f.title})]})]}),s.jsx("div",{className:xn.content,children:f.content}),f.footer&&s.jsx("div",{className:xn.footer,children:f.footer})]},f.id)})})})}const Rr=m.createContext(null),Zr=()=>{const e=m.useContext(Rr);if(!e)throw new Error("useDropdownContext debe usarse dentro de DropdownMenu o ContextMenu");return e},Vt=e=>e.type==="separator"||e.type==="label"?!1:"children"in e&&Array.isArray(e.children)&&e.children.length>0,ka=e=>e.type==="checkbox",Ia=e=>e.type==="radio",Ea=e=>e.type==="separator",Ma=e=>e.type==="label",Se={menu:"_menu_1v23n_1",variant_default:"_variant_default_1v23n_49",variant_elevated:"_variant_elevated_1v23n_59",variant_bordered:"_variant_bordered_1v23n_69",variant_glass:"_variant_glass_1v23n_83",size_sm:"_size_sm_1v23n_97",size_md:"_size_md_1v23n_113",size_lg:"_size_lg_1v23n_127",item:"_item_1v23n_143",disabled:"_disabled_1v23n_201",active:"_active_1v23n_203",loading:"_loading_1v23n_249",spinner_item:"_spinner_item_1v23n_261",spinItem:"_spinItem_1v23n_1",danger:"_danger_1v23n_293",has_submenu:"_has_submenu_1v23n_307",submenu_open:"_submenu_open_1v23n_315",indicator:"_indicator_1v23n_323",start_icon:"_start_icon_1v23n_353",content:"_content_1v23n_395",label_text:"_label_text_1v23n_413",description:"_description_1v23n_425",shortcut:"_shortcut_1v23n_443",end_icon:"_end_icon_1v23n_467",submenu_arrow:"_submenu_arrow_1v23n_497",separator:"_separator_1v23n_533",label:"_label_1v23n_413",menuEnter:"_menuEnter_1v23n_1",context_menu_trigger:"_context_menu_trigger_1v23n_667"},jf=()=>s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:s.jsx("polyline",{points:"20 6 9 17 4 12"})}),qf=()=>s.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.jsx("polyline",{points:"9 18 15 12 9 6"})}),Bf=({marcado:e})=>s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),e&&s.jsx("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"})]}),Jr=m.forwardRef(({item:e,index:t,activeIndex:n,getItemProps:o},r)=>{const i=Zr();if(Ea(e))return s.jsx("div",{className:K(Se.separator,i.classNames?.separator),role:"separator"});if(Ma(e))return s.jsx("div",{className:K(Se.label,i.classNames?.label),role:"presentation","data-testid":"dropdown-label",children:e.label});const a=t===n,l=ka(e),d=Ia(e),u=N=>{"isDisabled"in e&&e.isDisabled||(l?e.onCheckedChange?.(!e.isChecked):d&&i.onRadioChange?.(e.value),"onSelect"in e&&e.onSelect&&e.onSelect(N),i.closeOnSelect&&!Vt(e)&&i.cerrarMenu())},_=N=>{u(N)},g=N=>{"isDisabled"in e&&e.isDisabled||(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),u(N))},f=l?e.isChecked:!1,c=d?i.radioValue===e.value:!1,h="label"in e?e.label:void 0,p="description"in e?e.description:void 0,v="shortcut"in e?e.shortcut:void 0,w="startIcon"in e?e.startIcon:void 0,C="endIcon"in e?e.endIcon:void 0,x="isDisabled"in e?e.isDisabled:!1,I="isLoading"in e?e.isLoading:!1,z="isDanger"in e?e.isDanger:!1,A="className"in e?e.className:void 0;return s.jsxs("div",{ref:r,role:l?"menuitemcheckbox":d?"menuitemradio":"menuitem","aria-checked":l?f:d?c:void 0,"aria-disabled":x||I,tabIndex:a?0:-1,className:K(Se.item,Se[`size_${i.size}`],a&&Se.active,x&&Se.disabled,I&&Se.loading,z&&Se.danger,Vt(e)&&Se.has_submenu,A,i.classNames?.item),onClick:_,onKeyDown:g,...o(),children:[I?s.jsx("span",{className:Se.indicator,children:s.jsx("span",{className:Se.spinner_item})}):(l||d)&&s.jsxs("span",{className:Se.indicator,children:[l&&f&&s.jsx(jf,{}),d&&s.jsx(Bf,{marcado:c})]}),!I&&w&&s.jsx("span",{className:Se.start_icon,children:w}),s.jsxs("span",{className:Se.content,children:[s.jsx("span",{className:Se.label_text,children:h}),p&&s.jsx("span",{className:Se.description,children:p})]}),v&&s.jsx("kbd",{className:Se.shortcut,children:v}),C&&s.jsx("span",{className:Se.end_icon,children:C}),Vt(e)&&s.jsx("span",{className:Se.submenu_arrow,children:s.jsx(qf,{})})]})});Jr.displayName="MenuItem";const Hf=()=>s.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.jsx("polyline",{points:"9 18 15 12 9 6"})}),Vo=({items:e,activeIndex:t,getItemProps:n,listRef:o})=>s.jsx(s.Fragment,{children:e.map((r,i)=>Vt(r)?s.jsx(Qr,{ref:a=>{o.current[i]=a},item:r,index:i,activeIndex:t,getItemProps:n},r.id):s.jsx(Jr,{ref:a=>{o.current[i]=a},item:r,index:i,activeIndex:t,getItemProps:n},r.id))});Vo.displayName="MenuList";const Qr=m.forwardRef(({item:e,index:t,activeIndex:n,getItemProps:o},r)=>{const i=Zr(),[a,l]=m.useState(!1),d=tt(),u=gs(),_=m.useRef([]),[g,f]=m.useState(null),{refs:c,floatingStyles:h,context:p,isPositioned:v}=$o({nodeId:u,open:a,onOpenChange:l,placement:"right-start",middleware:[go({mainAxis:4,alignmentAxis:-4}),ho(),po({padding:8})],whileElementsMounted:uo}),{isMounted:w,styles:C}=No(p,{duration:i.disableAnimation?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(2px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(2px)"},common:{transitionTimingFunction:i.disableAnimation?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}}),x=vr(p,{enabled:!e.isDisabled,delay:{open:75},handleClose:Ts({blockPointerEvents:!0})}),I=Mo(p,{role:"menu"}),z=So(p,{bubbles:!0}),A=kr(p,{listRef:_,activeIndex:g,onNavigate:f,nested:!0}),{getReferenceProps:N,getFloatingProps:L,getItemProps:P}=ko([x,I,z,A]);m.useEffect(()=>{if(!d)return;const j=()=>l(!1);return d.events.on("click",j),()=>{d.events.off("click",j)}},[d]);const k=t===n,O=is([c.setReference,r]);return s.jsxs(ps,{id:u,children:[s.jsxs("div",{ref:O,role:"menuitem","aria-haspopup":"menu","aria-expanded":a,"aria-disabled":e.isDisabled,tabIndex:k?0:-1,className:K(Se.item,Se[`size_${i.size}`],k&&Se.active,e.isDisabled&&Se.disabled,e.isDanger&&Se.danger,Se.has_submenu,a&&Se.submenu_open,e.className,i.classNames?.item),...N(o()),children:[e.startIcon&&s.jsx("span",{className:Se.start_icon,children:e.startIcon}),s.jsxs("span",{className:Se.content,children:[s.jsx("span",{className:Se.label_text,children:e.label}),e.description&&s.jsx("span",{className:Se.description,children:e.description})]}),e.shortcut&&s.jsx("kbd",{className:Se.shortcut,children:e.shortcut}),s.jsx("span",{className:Se.submenu_arrow,children:s.jsx(Hf,{})})]}),w&&s.jsx(xo,{root:i.portalContainer,children:s.jsx(Cr,{context:p,modal:!1,initialFocus:-1,returnFocus:!1,children:s.jsx("div",{ref:c.setFloating,style:{...h,pointerEvents:"none",zIndex:i.zIndex??"var(--z-dropdown)"},children:s.jsx("div",{className:K(Se.menu,Se[`variant_${i.variant}`],i.classNames?.menu),style:{...C,pointerEvents:"auto",visibility:v||!a?"visible":"hidden"},...L(),children:s.jsx(Vo,{items:e.children,activeIndex:g,getItemProps:P,listRef:_})})})})})]})});Qr.displayName="Submenu";const Na=m.forwardRef(({children:e,items:t,triggerAction:n="click",placement:o="bottom-start",variant:r="default",size:i="md",isDisabled:a=!1,offset:l=4,minWidth:d="180px",matchTriggerWidth:u=!1,disableAnimation:_=!1,closeOnClickOutside:g=!0,closeOnEscape:f=!0,closeOnSelect:c=!0,className:h,classNames:p,style:v,onOpen:w,onClose:C,onOpenChange:x,onContextMenu:I,isOpen:z,zIndex:A,portalContainer:N,radioValue:L,onRadioChange:P},k)=>{const[O,j]=m.useState(!1),[$,b]=m.useState(null),[S,T]=m.useState(0),F=m.useRef([]),y=m.useRef([]),E=gs(),D=z!==void 0,B=D?z:O,H=m.useCallback(q=>{a&&q||(D||j(q),x?.(q),q?w?.():C?.())},[a,D,x,w,C]);m.useEffect(()=>{y.current=t.filter(q=>q.type!=="separator"&&q.type!=="label").map(q=>"label"in q&&typeof q.label=="string"?q.label:"")},[t]);const{refs:V,floatingStyles:J,context:U,isPositioned:pe}=$o({nodeId:E,open:B,onOpenChange:H,placement:o,strategy:"fixed",middleware:[go(l),ho({fallbackAxisSideDirection:"start",padding:8}),po({padding:8}),u?rs({apply({rects:q,elements:G}){Object.assign(G.floating.style,{minWidth:`${q.reference.width}px`})}}):void 0].filter(Boolean),whileElementsMounted:uo}),ce=Ms(U,{enabled:!a&&(n==="click"||n==="both"),toggle:!0}),ie=vr(U,{enabled:!a&&n==="hover",delay:{open:150,close:150},handleClose:Ts()}),ge=So(U,{enabled:f||g,escapeKey:f,outsidePress:g}),de=Mo(U,{role:"menu"}),$e=kr(U,{listRef:F,activeIndex:$,onNavigate:b,loop:!0}),Z=As(U,{listRef:y,activeIndex:$,onMatch:b,enabled:B}),{getReferenceProps:oe,getFloatingProps:ne,getItemProps:ue}=ko([ce,ie,ge,de,$e,Z]),{isMounted:ve,styles:X}=No(U,{duration:_?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(4px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(4px)"},common:{transitionTimingFunction:_?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}});m.useImperativeHandle(k,()=>({open:()=>H(!0),close:()=>H(!1),toggle:()=>H(!B),isOpen:B}),[H,B]);const he=m.useMemo(()=>({radioValue:L,onRadioChange:P,cerrarMenu:()=>H(!1),closeOnSelect:c,size:i,variant:r,disableAnimation:_,classNames:p,portalContainer:N,zIndex:A}),[L,P,H,c,i,r,_,p,N,A]),te=m.isValidElement(e)?e:null,se=is([V.setReference,te?.ref||null]);if(!te)return e!=null&&console.error("DropdownMenu: children debe ser un elemento React válido"),null;const Ce=n==="contextmenu"||n==="both"?{onContextMenu:q=>{q.preventDefault();const G={x:q.clientX,y:q.clientY};I?.(q,G),H(!1),T(fe=>fe+1),requestAnimationFrame(()=>{V.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:G.x,y:G.y,top:G.y,left:G.x,right:G.x,bottom:G.y}}}),H(!0)})},onClick:()=>{B&&n==="contextmenu"&&H(!1)}}:{},W=m.cloneElement(e,oe({...e.props,...Ce,ref:se,"aria-haspopup":"menu","aria-expanded":B}));return s.jsx(Rr.Provider,{value:he,children:s.jsxs(ps,{id:E,children:[W,ve&&s.jsx(xo,{root:N,children:s.jsx(Cr,{context:U,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:V.setFloating,style:{...J,zIndex:A??"var(--z-dropdown)",outline:"none",pointerEvents:"none"},children:s.jsx("div",{role:"menu","aria-orientation":"vertical",className:K(Se.menu,Se[`variant_${r}`],Se[`size_${i}`],h,p?.menu),style:{...X,minWidth:d,...v,transform:[X.transform,v?.transform].filter(Boolean).join(" "),pointerEvents:"auto",visibility:pe||!B?"visible":"hidden"},...ne(),children:s.jsx(Vo,{items:t,activeIndex:$,getItemProps:ue,listRef:F})},S)})})})]})})});Na.displayName="DropdownMenuInner";const jo=m.forwardRef((e,t)=>s.jsx(rd,{children:s.jsx(Na,{...e,ref:t})}));jo.displayName="DropdownMenu";const Fa=m.forwardRef(({isEnabled:e=!0,children:t,...n},o)=>s.jsx(jo,{...n,ref:o,triggerAction:"contextmenu",isDisabled:!e||n.isDisabled,children:t}));Fa.displayName="ContextMenu";const Bn={group_button:"_group_button_wgdis_1",full_width:"_full_width_wgdis_17",main_button:"_main_button_wgdis_27",dropdown_trigger:"_dropdown_trigger_wgdis_35",first_item:"_first_item_wgdis_45",last_item:"_last_item_wgdis_55",variant_bordered:"_variant_bordered_wgdis_65",variant_ghost:"_variant_ghost_wgdis_67",variant_faded:"_variant_faded_wgdis_69",disabled:"_disabled_wgdis_93",loading:"_loading_wgdis_93",chevron:"_chevron_wgdis_111",chevron_open:"_chevron_open_wgdis_123"},Gf=({label:e,onClick:t,items:n,variant:o="solid",color:r="primary",size:i="md",radius:a="md",isLoading:l=!1,isDisabled:d=!1,dropdownIcon:u,className:_,fullWidth:g=!1,...f})=>{const[c,h]=m.useState(!1),p=K(Bn.group_button,Bn[`variant_${o}`],g&&Bn.full_width,_),v=()=>s.jsx("div",{className:K(Bn.chevron,c&&Bn.chevron_open),children:s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:s.jsx("path",{d:"m6 9 6 6 6-6"})})});return s.jsxs("div",{className:p,children:[s.jsx(tn,{variant:o,color:r,size:i,radius:a,isLoading:l,isDisabled:d,onClick:t,className:K(Bn.main_button,Bn.first_item),...f,children:e}),n&&s.jsx(jo,{items:n,triggerAction:"click",onOpenChange:h,placement:"bottom-end",isDisabled:d||l,variant:"default",size:i,matchTriggerWidth:!1,children:s.jsx(tn,{variant:o,color:r,size:i,radius:a,isDisabled:d||l,isIconOnly:!0,className:K(Bn.dropdown_trigger,Bn.last_item),"aria-label":"M�s acciones",children:u||v()})})]})},za=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),Da=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12zm5.75 9L15 18l1.16-1.16l1.59 1.59l3.59-3.59l1.16 1.41z"})}),Aa=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M14.76 20.83L17.6 18l-2.84-2.83l1.41-1.41L19 16.57l2.83-2.81l1.41 1.41L20.43 18l2.81 2.83l-1.41 1.41L19 19.4l-2.83 2.84zM12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12z"})}),La=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"15 18 9 12 15 6"})}),Pa=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"9 18 15 12 9 6"})}),Je={overlay:"_overlay_1esoc_1",backdrop:"_backdrop_1esoc_25",visible:"_visible_1esoc_47",layout:"_layout_1esoc_71",columna_acciones:"_columna_acciones_1esoc_139",boton_flotante:"_boton_flotante_1esoc_159",boton_primario:"_boton_primario_1esoc_233",boton_peligro:"_boton_peligro_1esoc_243",panel:"_panel_1esoc_261",encabezado:"_encabezado_1esoc_289",titulo:"_titulo_1esoc_307",contenido:"_contenido_1esoc_323",paginacion:"_paginacion_1esoc_337",texto_paginacion:"_texto_paginacion_1esoc_363"},Wf={transparente:{background:"transparent"},sutil:{background:"rgb(0 0 0 / 20%)"},normal:{background:"rgb(0 0 0 / 40%)"},intenso:{background:"rgb(0 0 0 / 60%)"}},Kf=({isOpen:e,onClose:t,onApply:n,onClear:o,title:r="Filtros",backdropVariant:i="sutil",closeOnBackdropClick:a=!0,allowBackdropInteraction:l=!1,getContainer:d,children:u})=>{const[_,g]=m.useState(!1),[f,c]=m.useState(0),h=l||i==="transparente",p=m.useCallback(()=>{_||(g(!0),setTimeout(()=>{t(),g(!1),c(0)},650))},[t,_]);m.useEffect(()=>{e&&g(!1)},[e]),m.useEffect(()=>{if(!e)return;const k=O=>O.key==="Escape"&&p();return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[e,p]);const v=m.useCallback(k=>{a&&k.target===k.currentTarget&&p()},[a,p]),w=m.useCallback(k=>{document.activeElement?.blur(),k?.()},[]),{pages:C,totalPages:x,hasPagination:I}=m.useMemo(()=>{const k=Array.isArray(u)?u:[u];return{pages:k,totalPages:k.length,hasPagination:k.length>1}},[u]),{background:z}=Wf[i],A={background:z,pointerEvents:h?"none":"auto"},N=d?{position:"absolute"}:{},L=d?{position:"relative"}:{},P=s.jsxs("div",{className:Je.overlay,role:"dialog","aria-modal":"true",style:N,children:[s.jsx("div",{className:`${Je.backdrop} ${e&&!_?Je.visible:""}`,style:A,onClick:v}),s.jsxs("div",{className:`${Je.layout} ${e&&!_?Je.visible:""}`,style:L,children:[s.jsxs("aside",{className:Je.columna_acciones,children:[s.jsx(it,{content:"Cerrar",placement:"left",children:s.jsx("button",{className:Je.boton_flotante,onClick:()=>w(p),"aria-label":"Cerrar panel",children:s.jsx(za,{})})}),s.jsx(it,{content:"Aplicar filtros",placement:"left",children:s.jsx("button",{className:`${Je.boton_flotante} ${Je.boton_primario}`,onClick:()=>w(n),children:s.jsx(Da,{})})}),s.jsx(it,{content:"Limpiar filtros",placement:"left",children:s.jsx("button",{className:`${Je.boton_flotante} ${Je.boton_peligro}`,onClick:()=>w(o),children:s.jsx(Aa,{})})}),I&&s.jsxs("div",{className:Je.paginacion,children:[s.jsx("button",{className:Je.boton_flotante,style:{width:36,height:36},onClick:()=>c(k=>Math.max(0,k-1)),disabled:f===0,"aria-label":"Página anterior",children:s.jsx(La,{})}),s.jsxs("span",{className:Je.texto_paginacion,children:[f+1," / ",x]}),s.jsx("button",{className:Je.boton_flotante,style:{width:36,height:36},onClick:()=>c(k=>Math.min(x-1,k+1)),disabled:f===x-1,"aria-label":"Página siguiente",children:s.jsx(Pa,{})})]})]}),s.jsxs("main",{className:Je.panel,children:[s.jsx("header",{className:Je.encabezado,children:s.jsx("h2",{className:Je.titulo,children:r})}),s.jsx("div",{className:Je.contenido,children:s.jsx("div",{style:{animation:"fadeIn 0.3s ease"},children:C[f]},f)})]})]})]});if(d){const k=typeof d=="function"?d():d;if(k&&k instanceof HTMLElement)return Ct.createPortal(P,k)}return P};Y.Badge=ii,Y.BadgeVoz=Yo,Y.Boton=tn,Y.Checkbox=wt,Y.CheckboxGroup=ca,Y.ContextMenu=Fa,Y.Drawer=Sa,Y.DropdownContext=Rr,Y.DropdownMenu=jo,Y.GrabacionIcono=hi,Y.GroupButton=Gf,Y.IconoCerrar=za,Y.IconoDerecha=Pa,Y.IconoFiltroAplicar=Da,Y.IconoFiltroLimpiar=Aa,Y.IconoIzquierda=La,Y.InputDate=pi,Y.InputNumeric=gi,Y.InputText=di,Y.MenuItem=Jr,Y.MenuList=Vo,Y.MicrofonoIcono=Uo,Y.Modal=$a,Y.ModalStack=Vf,Y.PanelFiltros=Kf,Y.Radio=Yr,Y.RadioGroup=xa,Y.Select=Ys,Y.Signature=ci,Y.SonidoIcono=Xo,Y.Submenu=Qr,Y.TablaDatos=Tf,Y.TextArea=vi,Y.Toggle=Wo,Y.Tooltip=it,Y.Transicion=Ut,Y.esCheckbox=ka,Y.esLabel=Ma,Y.esRadio=Ia,Y.esSeparador=Ea,Y.fechaEnRango=gl,Y.formatearFecha=Ko,Y.formatearNumero=xt,Y.generarOpcionesAleatorias=Gd,Y.generarUsuariosPrueba=Wd,Y.obtenerFechaHoy=_l,Y.parsearNumero=ui,Y.procesarValidacion=fi,Y.redondearDecimales=_i,Y.restringirRango=Kt,Y.tieneHijos=Vt,Y.useCheckboxGroupContext=la,Y.useDropdownContext=Zr,Y.useReconocimientoVoz=mi,Y.useTablaContext=Ru,Y.useTablaContextSafe=Rn,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})}));
682
29
  //# sourceMappingURL=index.umd.cjs.map