corekit-ui 0.1.21 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -39
- package/dist/corekit-ui.css +1 -1
- package/dist/index.d.ts +4276 -21
- package/dist/index.js +10821 -7096
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +659 -6
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +145 -132
- package/dist/animations/Transiciones.d.ts +0 -9
- package/dist/animations/index.d.ts +0 -1
- package/dist/badge/Badge.d.ts +0 -3
- package/dist/badge/index.d.ts +0 -2
- package/dist/badge/types.d.ts +0 -62
- package/dist/boton/Boton.d.ts +0 -2
- package/dist/boton/index.d.ts +0 -2
- package/dist/boton/typesButton.d.ts +0 -35
- package/dist/checkbox/Checkbox.d.ts +0 -25
- package/dist/checkbox/CheckboxContext.d.ts +0 -3
- package/dist/checkbox/CheckboxGroup.d.ts +0 -11
- package/dist/checkbox/index.d.ts +0 -4
- package/dist/checkbox/types.d.ts +0 -108
- package/dist/drawer/Drawer.d.ts +0 -2
- package/dist/drawer/index.d.ts +0 -2
- package/dist/drawer/types.d.ts +0 -140
- package/dist/dropdown/ContextMenu.d.ts +0 -12
- package/dist/dropdown/DropdownContext.d.ts +0 -29
- package/dist/dropdown/DropdownMenu.d.ts +0 -3
- package/dist/dropdown/MenuItem.d.ts +0 -8
- package/dist/dropdown/Submenu.d.ts +0 -23
- package/dist/dropdown/index.d.ts +0 -11
- package/dist/dropdown/types.d.ts +0 -168
- package/dist/firma_manual/FirmaManual.d.ts +0 -3
- package/dist/firma_manual/Iconografia.d.ts +0 -16
- package/dist/firma_manual/TypesFirma.d.ts +0 -22
- package/dist/firma_manual/index.d.ts +0 -2
- package/dist/firma_manual/useFirmaLogica.d.ts +0 -10
- package/dist/hablar_escuchar/BadgeVoz.d.ts +0 -6
- package/dist/hablar_escuchar/Iconografia.d.ts +0 -10
- package/dist/hablar_escuchar/index.d.ts +0 -3
- package/dist/hablar_escuchar/useReconocimientoVoz.d.ts +0 -21
- package/dist/input_date/InputDate.d.ts +0 -342
- package/dist/input_date/funciones.d.ts +0 -27
- package/dist/input_date/index.d.ts +0 -3
- package/dist/input_date/types.d.ts +0 -70
- package/dist/input_numeric/Iconografia.d.ts +0 -5
- package/dist/input_numeric/InputNumeric.d.ts +0 -353
- package/dist/input_numeric/funciones.d.ts +0 -64
- package/dist/input_numeric/index.d.ts +0 -3
- package/dist/input_numeric/types.d.ts +0 -96
- package/dist/input_text/Iconografia.d.ts +0 -9
- package/dist/input_text/InputText.d.ts +0 -347
- package/dist/input_text/index.d.ts +0 -2
- package/dist/input_text/types.d.ts +0 -77
- package/dist/input_types_compartidos/index.d.ts +0 -1
- package/dist/input_types_compartidos/types.d.ts +0 -11
- package/dist/modal/Modal.d.ts +0 -2
- package/dist/modal/index.d.ts +0 -2
- package/dist/modal/types.d.ts +0 -115
- package/dist/modal_stack/ModalStack.d.ts +0 -14
- package/dist/modal_stack/index.d.ts +0 -2
- package/dist/panel_filtros/Iconografia.d.ts +0 -5
- package/dist/panel_filtros/PanelFiltros.d.ts +0 -49
- package/dist/panel_filtros/index.d.ts +0 -3
- package/dist/radio/Radio.d.ts +0 -16
- package/dist/radio/RadioContext.d.ts +0 -3
- package/dist/radio/RadioGroup.d.ts +0 -11
- package/dist/radio/index.d.ts +0 -3
- package/dist/radio/types.d.ts +0 -195
- package/dist/select/Iconografia.d.ts +0 -10
- package/dist/select/Select.d.ts +0 -42
- package/dist/select/SelectBase.d.ts +0 -17
- package/dist/select/SelectNativo.d.ts +0 -57
- package/dist/select/Types.d.ts +0 -629
- package/dist/select/funciones.d.ts +0 -244
- package/dist/select/index.d.ts +0 -4
- package/dist/tabla_datos/TablaDatos.d.ts +0 -80
- package/dist/tabla_datos/components/Iconografia.d.ts +0 -17
- package/dist/tabla_datos/components/TablaCards.d.ts +0 -1
- package/dist/tabla_datos/components/TablaEscritorio.d.ts +0 -1
- package/dist/tabla_datos/components/configuraciones/ConfigColumnas.d.ts +0 -1
- package/dist/tabla_datos/components/configuraciones/ConfigEncabezado.d.ts +0 -6
- package/dist/tabla_datos/components/configuraciones/ConfigFilas.d.ts +0 -1
- package/dist/tabla_datos/components/configuraciones/ConfigOpciones.d.ts +0 -6
- package/dist/tabla_datos/components/configuraciones/MenuConfiguraciones.d.ts +0 -1
- package/dist/tabla_datos/components/skeletons/SkeletonCargando.d.ts +0 -4
- package/dist/tabla_datos/components/skeletons/SkeletonCargandoCards.d.ts +0 -2
- package/dist/tabla_datos/components/tabla/BarraHerramientas.d.ts +0 -1
- package/dist/tabla_datos/components/tabla/BarraSeleccion.d.ts +0 -9
- package/dist/tabla_datos/components/tabla/Paginacion.d.ts +0 -1
- package/dist/tabla_datos/components/tabla/SinDatos.d.ts +0 -1
- package/dist/tabla_datos/components/tabla/tabla_cards/AccionesCards.d.ts +0 -3
- package/dist/tabla_datos/components/tabla/tabla_cards/ContenidoCards.d.ts +0 -3
- package/dist/tabla_datos/components/tabla/tabla_cards/EncabezadoCards.d.ts +0 -3
- package/dist/tabla_datos/constantes/ConstGenerales.d.ts +0 -18
- package/dist/tabla_datos/context/ContextTypes.d.ts +0 -23
- package/dist/tabla_datos/context/TablaDatosContext.d.ts +0 -3
- package/dist/tabla_datos/context/hooks.d.ts +0 -10
- package/dist/tabla_datos/hooks/useClickOutside.d.ts +0 -8
- package/dist/tabla_datos/hooks/useEscapeKey.d.ts +0 -1
- package/dist/tabla_datos/hooks/usePopoverPosition.d.ts +0 -15
- package/dist/tabla_datos/hooks/useScrollLock.d.ts +0 -1
- package/dist/tabla_datos/index.d.ts +0 -5
- package/dist/tabla_datos/types/TablaTypes.d.ts +0 -85
- package/dist/tabla_datos/types/tanstack-table.d.ts +0 -8
- package/dist/tabla_datos/utils/FuncionesColumnas.d.ts +0 -9
- package/dist/tabla_datos/utils/FuncionesPaginacion.d.ts +0 -12
- package/dist/tabla_datos/utils/FuncionesTabla.d.ts +0 -54
- package/dist/text_area/Iconografia.d.ts +0 -6
- package/dist/text_area/TextArea.d.ts +0 -333
- package/dist/text_area/index.d.ts +0 -2
- package/dist/text_area/types.d.ts +0 -76
- package/dist/texts/Texts.d.ts +0 -19
- package/dist/toggle/Toggle.d.ts +0 -21
- package/dist/toggle/index.d.ts +0 -2
- package/dist/toggle/types.d.ts +0 -90
- package/dist/tooltip/Tooltip.d.ts +0 -2
- package/dist/tooltip/index.d.ts +0 -2
- package/dist/tooltip/types.d.ts +0 -83
package/dist/index.umd.cjs
CHANGED
|
@@ -1,10 +1,663 @@
|
|
|
1
|
-
(function(X,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):(X=typeof globalThis<"u"?globalThis:X||self,a(X.CoreKitUI={},X.jsxRuntime,X.React,X.ReactDOM))})(this,(function(X,a,v,un){"use strict";function zr(e){if(e&&e.__esModule)return e;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const M=zr(v),Io=zr(un);function Vr(e){var n,t,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(n=0;n<r;n++)e[n]&&(t=Vr(e[n]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function K(){for(var e,n,t=0,o="",r=arguments.length;t<r;t++)(e=arguments[t])&&(n=Vr(e))&&(o&&(o+=" "),o+=n);return o}const qr=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,jr=K,Ea=(e,n)=>t=>{var o;if(n?.variants==null)return jr(e,t?.class,t?.className);const{variants:r,defaultVariants:i}=n,s=Object.keys(r).map(u=>{const f=t?.[u],p=i?.[u];if(f===null)return null;const _=qr(f)||qr(p);return r[u][_]}),l=t&&Object.entries(t).reduce((u,f)=>{let[p,_]=f;return _===void 0||(u[p]=_),u},{}),d=n==null||(o=n.compoundVariants)===null||o===void 0?void 0:o.reduce((u,f)=>{let{class:p,className:_,...c}=f;return Object.entries(c).every(h=>{let[g,m]=h;return Array.isArray(m)?m.includes({...i,...l}[g]):{...i,...l}[g]===m})?[...u,p,_]:u},[]);return jr(e,s,d,t?.class,t?.className)},Se={boton:"_boton_ofmyy_1",animated:"_animated_ofmyy_61",disabled:"_disabled_ofmyy_61",loading:"_loading_ofmyy_61",content:"_content_ofmyy_69",spinner:"_spinner_ofmyy_71",spinner_icon:"_spinner_icon_ofmyy_111",ripple:"_ripple_ofmyy_147",solid:"_solid_ofmyy_199",bordered:"_bordered_ofmyy_219",ghost:"_ghost_ofmyy_239",light:"_light_ofmyy_263",faded:"_faded_ofmyy_283",shadow:"_shadow_ofmyy_303",only_loading:"_only_loading_ofmyy_355",sm:"_sm_ofmyy_373",md:"_md_ofmyy_389",lg:"_lg_ofmyy_405",full_width:"_full_width_ofmyy_421",icon_only:"_icon_only_ofmyy_429",radius_none:"_radius_none_ofmyy_471",radius_sm:"_radius_sm_ofmyy_479",radius_md:"_radius_md_ofmyy_487",radius_lg:"_radius_lg_ofmyy_495",radius_full:"_radius_full_ofmyy_503",primary:"_primary_ofmyy_511",secondary:"_secondary_ofmyy_521",success:"_success_ofmyy_531",warning:"_warning_ofmyy_541",danger:"_danger_ofmyy_551",default:"_default_ofmyy_561"},Ma=Ea(Se.boton,{variants:{variant:{solid:Se.solid,bordered:Se.bordered,ghost:Se.ghost,light:Se.light,faded:Se.faded,shadow:Se.shadow},color:{default:Se.default,primary:Se.primary,secondary:Se.secondary,success:Se.success,warning:Se.warning,danger:Se.danger},size:{sm:Se.sm,md:Se.md,lg:Se.lg},radius:{none:Se.radius_none,sm:Se.radius_sm,md:Se.radius_md,lg:Se.radius_lg,full:Se.radius_full},fullWidth:{true:Se.full_width},isIconOnly:{true:Se.icon_only},isLoading:{true:Se.loading},onlyLoading:{true:Se.only_loading},isDisabled:{true:Se.disabled},disableAnimation:{false:Se.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md",disableAnimation:!0}}),ht=v.forwardRef(({variant:e="solid",color:n="default",size:t="md",radius:o="md",fullWidth:r=!1,isLoading:i=!1,onlyLoading:s=!1,isDisabled:l=!1,isIconOnly:d=!1,disableRipple:u=!1,disableAnimation:f=!0,customColor:p,spinner:_,spinnerPlacement:c="end",permisos:h,permiso:g,children:m,className:b,onClick:w,style:C,type:S="button","aria-label":k,...$},I)=>{const F=g&&h?!h.includes(g):!1,L=l||i||F,N=E=>{if(L){E.preventDefault();return}if(w?.(E),u||L||!(E.currentTarget instanceof HTMLElement))return;const z=E.currentTarget,A=document.createElement("span"),x=z.getBoundingClientRect(),P=Math.max(x.width,x.height);A.className=Se.ripple,A.style.width=`${P}px`,A.style.height=`${P}px`,A.style.left=`${E.clientX-x.left}px`,A.style.top=`${E.clientY-x.top}px`,A.addEventListener("animationend",()=>A.remove(),{once:!0}),z.appendChild(A)},D=p?{"--btn-color":p,"--btn-text-color":p,...C}:C,V=Ma({variant:e,color:p?void 0:n,size:t,radius:o,fullWidth:r,isIconOnly:d,isLoading:i,onlyLoading:s,isDisabled:L,disableAnimation:f}),T=i&&a.jsx("span",{className:Se.spinner,"aria-hidden":s?void 0:"true",children:_||a.jsx("span",{className:Se.spinner_icon})}),y=s&&!k?"Cargando":k;return a.jsxs("button",{...$,ref:I,type:S,"aria-label":y,"aria-busy":i,className:K(V,b),disabled:L,onClick:N,style:D,children:[c==="start"&&T,m&&!s&&a.jsx("span",{className:Se.content,children:m}),c==="end"&&T]})});ht.displayName="Boton";const Ee={dialog:"_dialog_1vo1g_1",modal:"_modal_1vo1g_69",encabezado:"_encabezado_1vo1g_93",titulo:"_titulo_1vo1g_107",boton_cerrar:"_boton_cerrar_1vo1g_121",texto_esc:"_texto_esc_1vo1g_157",icono_x:"_icono_x_1vo1g_171",contenedor_lienzo:"_contenedor_lienzo_1vo1g_181",area_firma:"_area_firma_1vo1g_191",lienzo:"_lienzo_1vo1g_205",lienzo_deshabilitado:"_lienzo_deshabilitado_1vo1g_233",barra_acciones:"_barra_acciones_1vo1g_243",grupo_izquierda:"_grupo_izquierda_1vo1g_259",separador:"_separador_1vo1g_271",boton_accion:"_boton_accion_1vo1g_283",boton_guardar:"_boton_guardar_1vo1g_329",icono:"_icono_1vo1g_171",contenedor_consentimiento:"_contenedor_consentimiento_1vo1g_379",contenedor_checkbox:"_contenedor_checkbox_1vo1g_393",checkbox_nativo:"_checkbox_nativo_1vo1g_409",checkbox_custom:"_checkbox_custom_1vo1g_423",texto_consentimiento:"_texto_consentimiento_1vo1g_489",contenedor_subir:"_contenedor_subir_1vo1g_505",boton_subir:"_boton_subir_1vo1g_515",input_archivo:"_input_archivo_1vo1g_551"},Na=({className:e,title:n="Deshacer"})=>a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[a.jsx("title",{children:n}),a.jsx("path",{d:"M3 7v6h6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("path",{d:"M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Fa=({className:e,title:n="Limpiar"})=>a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[a.jsx("title",{children:n}),a.jsx("path",{d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Aa=({className:e,title:n="Adjuntar"})=>a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[a.jsx("title",{children:n}),a.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M17 8l-5-5-5 5M12 3v12",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Pa=({className:e,title:n="Cerrar"})=>a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[a.jsx("title",{children:n}),a.jsx("path",{d:"M6 18L18 6M6 6l12 12",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),La=()=>{const e=v.useRef(null),[n,t]=v.useState(!1),[o,r]=v.useState(!0),[i,s]=v.useState(null),[l,d]=v.useState([]),[u,f]=v.useState([]),p=v.useCallback(()=>{const S=e.current,k=S?.getContext("2d");S&&k&&(k.clearRect(0,0,S.width,S.height),r(!0),d([]),f([]))},[]),_=v.useCallback(()=>{if(l.length===0)return;const S=l.slice(0,-1);d(S);const k=e.current,$=k?.getContext("2d");!k||!$||($.clearRect(0,0,k.width,k.height),S.forEach(I=>{if(!(I.puntos.length<2)){$.strokeStyle=I.color,$.beginPath(),$.moveTo(I.puntos[0].x,I.puntos[0].y);for(let F=1;F<I.puntos.length;F++)$.lineTo(I.puntos[F].x,I.puntos[F].y);$.stroke()}}),r(S.length===0))},[l]),c=v.useCallback(S=>{const k=e.current;if(!k)return{x:0,y:0};const $=k.getBoundingClientRect(),I=k.width/$.width,F=k.height/$.height;return"touches"in S?{x:(S.touches[0].clientX-$.left)*I,y:(S.touches[0].clientY-$.top)*F}:{x:(S.clientX-$.left)*I,y:(S.clientY-$.top)*F}},[]),h=v.useCallback((S,k)=>{const I=e.current?.getContext("2d");I&&(I.beginPath(),I.moveTo(S.x,S.y),I.lineTo(k.x,k.y),I.stroke(),r(!1))},[]),g=v.useCallback(S=>{S.preventDefault();const k=c(S);t(!0),s(k),f([k])},[c]),m=v.useCallback(S=>{if(!n||!i)return;S.preventDefault();const k=c(S);h(i,k),s(k),f($=>[...$,k])},[n,i,c,h]),b=v.useCallback(()=>{if(n&&u.length>0){const k=e.current?.getContext("2d"),$={puntos:u,color:k?.strokeStyle||"#000000"};d(I=>[...I,$]),f([])}t(!1),s(null)},[n,u]),w=v.useCallback(()=>{const S=e.current;return!S||o?null:S.toDataURL("image/png")},[o]),C=v.useCallback((S,k=!0)=>{const $=e.current,I=$?.getContext("2d");if(!(!$||!I))return I.strokeStyle=S,I.lineWidth=4,I.lineCap="round",I.lineJoin="round",k?($.addEventListener("mousedown",g),$.addEventListener("mousemove",m),$.addEventListener("mouseup",b),$.addEventListener("mouseout",b),$.addEventListener("touchstart",g),$.addEventListener("touchmove",m),$.addEventListener("touchend",b),()=>{$.removeEventListener("mousedown",g),$.removeEventListener("mousemove",m),$.removeEventListener("mouseup",b),$.removeEventListener("mouseout",b),$.removeEventListener("touchstart",g),$.removeEventListener("touchmove",m),$.removeEventListener("touchend",b)}):()=>{}},[g,m,b]);return{canvasRef:e,estaVacio:o,limpiarCanvas:p,deshacerUltimoTrazo:_,puedeDeshacer:l.length>0,obtenerDatosFirma:w,configurarCanvas:C}},Br=v.forwardRef(({isOpen:e=!1,onClose:n,onConfirm:t,titulo:o="Firmar el contrato",textoGuardar:r="Guardar firma",textoModificar:i="Modificar firma",textoDeshacer:s="Deshacer",textoLimpiar:l="Limpiar",textoAdjuntar:d="Adjuntar firma",ancho:u=500,alto:f=200,className:p,textoConsentimiento:_="Al firmar, confirmo que he leído y acepto todos los términos contractuales",mostrarBotonSubir:c=!1,cerrarAlGuardar:h=!1},g)=>{const{canvasRef:m,estaVacio:b,limpiarCanvas:w,deshacerUltimoTrazo:C,obtenerDatosFirma:S,configurarCanvas:k,puedeDeshacer:$}=La(),I=v.useRef(null),F=v.useRef(null),[L,N]=v.useState(!1),[D,V]=v.useState(!1),[T,y]=v.useState(!1);v.useImperativeHandle(g,()=>({limpiar:w,obtenerDatosFirma:S,estaVacio:()=>b})),v.useEffect(()=>{if(e&&m.current){const q=m.current,le=(()=>{const ce=document.documentElement.getAttribute("data-theme"),ie=window.matchMedia("(prefers-color-scheme: dark)").matches;return ce==="dark"||ce===null&&ie})()?"#ffffff":"#000000",oe=k(le,!T),re=new MutationObserver(()=>{const ce=document.documentElement.getAttribute("data-theme"),ie=window.matchMedia("(prefers-color-scheme: dark)").matches,U=ce==="dark"||ce===null&&ie?"#ffffff":"#000000",ne=q.getContext("2d");ne&&(ne.strokeStyle=U)});return re.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>{oe?.(),re.disconnect()}}},[e,k,m,T]),v.useEffect(()=>{const q=I.current;if(q)return e?(q.showModal(),document.body.style.overflow="hidden"):(q.close(),document.body.style.overflow=""),()=>{document.body.style.overflow=""}},[e]);const E=v.useCallback(()=>{n&&(V(!1),N(!1),y(!1),n())},[n]);v.useEffect(()=>{if(!e)return;const q=J=>{J.key==="Escape"&&E()};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[e,E]);const z=v.useCallback(q=>{const J=I.current;if(!J)return;const G=J.getBoundingClientRect();(q.clientX<G.left||q.clientX>G.right||q.clientY<G.top||q.clientY>G.bottom)&&E()},[E]),A=()=>{const q=S();q&&t&&L&&(V(!0),t(q),h&&n&&E())},x=()=>{V(!1),y(!1),w()},P=q=>{const J=q.target.files?.[0];if(!J||!m.current)return;const G=new FileReader;G.onload=le=>{const oe=new Image;oe.onload=()=>{const re=m.current,ce=re?.getContext("2d");if(!re||!ce)return;ce.clearRect(0,0,re.width,re.height);const ie=re.width,me=re.height,U=ie/me,ne=oe.width/oe.height;let ee,pe,_e,Z;ne>U?(ee=ie,pe=ie/ne,_e=0,Z=(me-pe)/2):(pe=me,ee=me*ne,_e=(ie-ee)/2,Z=0),ce.drawImage(oe,_e,Z,ee,pe),y(!0)},oe.src=le.target?.result},G.readAsDataURL(J)},O=()=>{F.current?.click()},B=D||T,j=!D&&(b&&!T||!L);return e?a.jsx("dialog",{ref:I,className:`${Ee.dialog} ${p||""}`,onClick:z,"aria-labelledby":"firma-titulo","aria-describedby":"firma-consentimiento",children:a.jsxs("div",{className:Ee.modal,children:[a.jsxs("header",{className:Ee.encabezado,children:[a.jsx("h2",{id:"firma-titulo",className:Ee.titulo,children:o}),a.jsxs("button",{className:Ee.boton_cerrar,onClick:E,type:"button","aria-label":"Cerrar",children:[a.jsx("span",{className:Ee.texto_esc,children:"ESC"}),a.jsx(Pa,{className:Ee.icono_x})]})]}),a.jsx("div",{className:Ee.contenedor_lienzo,children:a.jsxs("div",{className:Ee.area_firma,children:[a.jsx("canvas",{ref:m,className:`${Ee.lienzo} ${B?Ee.lienzo_deshabilitado:""}`,width:u*2,height:f*2,style:{pointerEvents:B?"none":"auto"},"aria-label":"Área de firma"}),a.jsxs("div",{className:Ee.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[a.jsxs("div",{className:Ee.grupo_izquierda,children:[a.jsxs("button",{className:Ee.boton_accion,onClick:C,type:"button",disabled:!$||B,"aria-label":s,children:[a.jsx(Na,{className:Ee.icono,"aria-hidden":"true"}),a.jsx("span",{children:s})]}),a.jsx("span",{className:Ee.separador,"aria-hidden":"true",children:"|"}),a.jsxs("button",{className:Ee.boton_accion,onClick:w,type:"button",disabled:b||B,"aria-label":l,children:[a.jsx(Fa,{className:Ee.icono,"aria-hidden":"true"}),a.jsx("span",{children:l})]})]}),a.jsx("button",{className:Ee.boton_guardar,onClick:D?x:A,type:"button",disabled:j,children:D?i:r})]})]})}),a.jsx("div",{className:Ee.contenedor_consentimiento,children:a.jsxs("label",{className:Ee.contenedor_checkbox,children:[a.jsx("input",{type:"checkbox",className:Ee.checkbox_nativo,checked:L,onChange:q=>N(q.target.checked),"aria-describedby":"firma-consentimiento"}),a.jsx("span",{className:Ee.checkbox_custom,"aria-hidden":"true"}),a.jsx("span",{id:"firma-consentimiento",className:Ee.texto_consentimiento,children:_})]})}),c&&a.jsxs("div",{className:Ee.contenedor_subir,children:[a.jsx("input",{ref:F,type:"file",accept:"image/*",className:Ee.input_archivo,onChange:P,"aria-label":"Subir imagen de firma"}),a.jsxs("button",{className:Ee.boton_subir,onClick:O,type:"button",children:[a.jsx(Aa,{className:Ee.icono,"aria-hidden":"true"}),d]})]})]})}):null});Br.displayName="FirmaManual";const Da="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Nn=(e=21)=>{let n="",t=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=Da[t[e]&63];return n};const Ta=({size:e="1em",...n})=>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",...n,children:[a.jsx("path",{d:"M18 6 6 18"}),a.jsx("path",{d:"m6 6 12 12"})]}),Oa=({size:e="1em",...n})=>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",...n,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"})]}),za=({size:e="1em",...n})=>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",...n,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"})]}),De={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"},Hr=v.forwardRef((e,n)=>{const{type:t="text",value:o,defaultValue:r,placeholder:i,variant:s="bordered",color:l="default",size:d="md",radius:u="md",fullWidth:f=!0,disableAnimation:p=!1,label:_,description:c,errorMessage:h,startContent:g,endContent:m,isRequired:b=!1,isReadOnly:w=!1,isDisabled:C=!1,isClearable:S=!1,isInvalid:k,validationState:$,validate:I,className:F,classNames:L,style:N,onChange:D,onClear:V,onValueChange:T,onFocus:y,onBlur:E,onKeyDown:z,id:A,name:x,autoComplete:P,autoFocus:O,maxLength:B,minLength:j,pattern:q,...J}=e,G=v.useRef(null),oe=v.useRef(A??`input-text-${Nn(8)}`).current;v.useImperativeHandle(n,()=>G.current);const re=o!==void 0,[ce,ie]=v.useState(r??""),me=re?o:ce,[U,ne]=v.useState(!1),[ee,pe]=v.useState(!1),_e=v.useMemo(()=>{if(!I)return null;const be=I(me);return be===!0||be==null?null:typeof be=="string"?be:typeof be=="object"&&"message"in be?be.message??"Entrada inválida":"Entrada inválida"},[me,I]),Z=v.useMemo(()=>k!==void 0?k:$==="invalid"?!0:$==="valid"?!1:!!_e,[k,$,_e]),de=$==="valid"&&!Z,ye={invalido:Z,mensaje:_e},ue=me.length>0,Ce=t==="password",W=Ce&&ee?"text":t,R=S&&ue&&!w&&!C,H=v.useCallback(be=>{if(C||w)return;const Ne=be.target.value;re||ie(Ne),D?.(Ne),T?.(Ne)},[re,C,w,D,T]),he=v.useCallback(be=>{ne(!0),y?.(be)},[y]),ge=v.useCallback(be=>{ne(!1),E?.(be)},[E]),ve=v.useCallback(()=>{C||w||(re||ie(""),D?.(""),T?.(""),V?.(),G.current?.focus())},[re,C,w,D,T,V]),We=v.useCallback(be=>{be.key==="Escape"&&S&&ue&&ve(),z?.(be)},[S,ue,ve,z]),ft=v.useCallback(()=>{pe(be=>!be),requestAnimationFrame(()=>G.current?.focus())},[]),nt=c?`${oe}-desc`:void 0,Be=Z?`${oe}-err`:void 0,Ze=[nt,Be].filter(Boolean).join(" ")||void 0,fe=typeof h=="function"?h(ye):h??_e,Qe=K(De.contenedor_base,De[`variante_${s}`],De[`tam_${d}`],De[`radio_${u}`],De[`color_${l}`],{[De.ancho_total]:f,[De.sin_animacion]:p,[De.deshabilitado]:C,[De.solo_lectura]:w,[De.invalido]:Z,[De.valido]:de,[De.enfocado]:U,[De.tiene_contenido]:ue},F,L?.base);return a.jsxs("div",{className:Qe,style:N,children:[_&&a.jsxs("label",{className:K(De.etiqueta,L?.label),htmlFor:oe,children:[_,b&&a.jsx("span",{className:De.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:K(De.envoltorio_input,L?.inputWrapper),children:[g&&a.jsx("span",{className:De.contenido_inicio,children:g}),a.jsx("div",{className:K(De.envoltorio_interno,L?.innerWrapper),children:a.jsx("input",{...J,ref:G,id:oe,name:x,type:W,value:re?me:void 0,defaultValue:re?void 0:r,placeholder:i,disabled:C,readOnly:w,required:b,autoComplete:P,autoFocus:O,maxLength:B,minLength:j,pattern:q,"aria-invalid":Z||void 0,"aria-describedby":Ze,"aria-required":b,className:K(De.entrada,L?.input),onChange:H,onFocus:he,onBlur:ge,onKeyDown:We})}),R&&a.jsx("button",{type:"button",className:K(De.boton_limpiar,L?.clearButton),onClick:ve,tabIndex:-1,"aria-label":"Limpiar campo",children:a.jsx(Ta,{size:"0.75em"})}),Ce&&a.jsx("button",{type:"button",className:De.boton_password,onClick:ft,tabIndex:-1,"aria-label":ee?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":ee,children:ee?a.jsx(za,{}):a.jsx(Oa,{})}),m&&a.jsx("span",{className:De.contenido_final,children:m})]}),c&&!Z&&a.jsx("div",{id:nt,className:K(De.descripcion,L?.description),children:c}),Z&&fe&&a.jsx("div",{id:Be,className:K(De.mensaje_error,L?.errorMessage),role:"alert",children:fe})]})});Hr.displayName="InputText";function Fn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fn(e,n){if(e==null||Number.isNaN(e))return"";const{separadorMiles:t=!1,separadorDecimal:o=".",escalaDecimal:r,decimalesFijos:i=!1,prefijo:s="",sufijo:l=""}=n;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,f]=d.split(".");let p=u;if(t){const c=typeof t=="string"?t:",";p=u.replace(/\B(?=(\d{3})+(?!\d))/g,c)}let _=p;return f!==void 0?_+=o+f:i&&r&&r>0&&(_+=o+"0".repeat(r)),`${s}${_}${l}`}function Gr(e,n){if(!e||e.trim()==="")return;const{separadorMiles:t=!1,separadorDecimal:o=".",prefijo:r="",sufijo:i="",permitirNegativo:s=!0}=n;let l=e;if(r&&(l=l.replace(new RegExp(`^${Fn(r)}`),"")),i&&(l=l.replace(new RegExp(`${Fn(i)}$`),"")),t){const u=typeof t=="string"?t:",";l=l.replace(new RegExp(Fn(u),"g"),"")}o!=="."&&(l=l.replace(new RegExp(Fn(o)),".")),s||(l=l.replace(/-/g,""));const d=parseFloat(l);return Number.isNaN(d)?void 0:d}function An(e,n,t){let o=e;return n!==void 0&&o<n&&(o=n),t!==void 0&&o>t&&(o=t),o}function Wr(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 Rr(e,n){const t=Math.pow(10,n);return Math.round(e*t)/t}const Va=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"})]}),qa=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"})}),Te={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"},Kr=v.forwardRef((e,n)=>{const{value:t,defaultValue:o,placeholder:r,variant:i="bordered",color:s="default",size:l="md",radius:d="md",fullWidth:u=!0,disableAnimation:f=!1,label:p,description:_,errorMessage:c,startContent:h,endContent:g,isRequired:m=!1,isReadOnly:b=!1,isDisabled:w=!1,isInvalid:C,validationState:S,validate:k,className:$,classNames:I,style:F,min:L,max:N,step:D=1,decimalScale:V,fixedDecimalScale:T=!1,thousandSeparator:y=!1,decimalSeparator:E=".",prefix:z="",suffix:A="",allowNegative:x=!0,allowDecimal:P=!0,hideControls:O=!1,clampBehavior:B="blur",onChange:j,onValueChange:q,onFocus:J,onBlur:G,onKeyDown:le,id:oe,name:re,...ce}=e,ie=v.useRef(null),U=v.useRef(oe??`input-numeric-${Nn(8)}`).current;v.useImperativeHandle(n,()=>ie.current);const ne=t!==void 0,[ee,pe]=v.useState(o!==void 0?o:void 0),[_e,Z]=v.useState(""),[de,ye]=v.useState(!1),ue=ne?t===""?void 0:t:ee,Ce=v.useMemo(()=>({separadorMiles:y,separadorDecimal:E,escalaDecimal:P?V:0,decimalesFijos:T,prefijo:z,sufijo:A,permitirNegativo:x}),[y,E,V,T,z,A,x,P]),W=v.useMemo(()=>{if(!k)return null;const te=Wr(k(ue));return te.invalido?te.mensaje:null},[ue,k]),R=v.useMemo(()=>C!==void 0?C:S==="invalid"?!0:S==="valid"?!1:!!W,[C,S,W]),H=S==="valid"&&!R,he={invalido:R,mensaje:W},ge=v.useCallback(te=>{ne||pe(te),j?.(te),q?.(fn(te,Ce),te)},[ne,j,q,Ce]),ve=v.useCallback(te=>{let we=(ue??0)+D*te;B!=="none"&&(we=An(we,L,N)),V!==void 0&&(we=Rr(we,V)),ge(we),Z(fn(we,Ce))},[ue,D,L,N,B,V,ge,Ce]),We=v.useCallback(te=>{if(w||b)return;const Fe=te.target.value,we=E===","?",":".";let _t="0-9";P&&(_t+=we),x&&(_t+="-");const gt=new RegExp(`[^${_t}]`,"g");let lt=Fe.replace(gt,"");if(P){const Re=lt.split(we);Re.length>2&&(lt=Re[0]+we+Re.slice(1).join(""))}if(x&<.includes("-")){const Re=lt.replace(/-/g,"");lt=lt.startsWith("-")?"-"+Re:Re}Z(lt);const Zt=Gr(lt,Ce);if(B==="strict"&&Zt!==void 0){const Re=An(Zt,L,N);ge(Re)}else ge(Zt)},[w,b,Ce,B,L,N,ge,E,x,P]),ft=v.useCallback(te=>{if(ye(!0),ue!==void 0){let Fe=String(ue);E!=="."&&(Fe=Fe.replace(".",E)),Z(Fe)}J?.(te)},[ue,E,J]),nt=v.useCallback(te=>{if(ye(!1),B==="blur"&&ue!==void 0){const Fe=An(ue,L,N);Fe!==ue&&ge(Fe)}Z(fn(ue,Ce)),G?.(te)},[ue,B,L,N,ge,Ce,G]),Be=v.useCallback(te=>{te.key==="ArrowUp"?(te.preventDefault(),ve(1)):te.key==="ArrowDown"&&(te.preventDefault(),ve(-1));const Fe=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],we=te.ctrlKey||te.metaKey,_t=P&&(te.key===E||te.key==="."||te.key===","),gt=te.key==="-"&&x,Xt=/^[0-9]$/.test(te.key);!Fe.includes(te.key)&&!we&&!_t&&!gt&&!Xt&&te.preventDefault(),le?.(te)},[ve,le,E,x,P]);v.useEffect(()=>{de||Z(fn(ue,Ce))},[ue,de,Ce]);const Ze=_?`${U}-desc`:void 0,fe=R?`${U}-err`:void 0,Qe=[Ze,fe].filter(Boolean).join(" ")||void 0,be=typeof c=="function"?c(he):c??W,Ne=N===void 0||(ue??0)<N,it=L===void 0||(ue??0)>L,bt=K(Te.contenedor_base,Te[`variante_${i}`],Te[`tam_${l}`],Te[`radio_${d}`],Te[`color_${s}`],{[Te.ancho_total]:u,[Te.sin_animacion]:f,[Te.deshabilitado]:w,[Te.solo_lectura]:b,[Te.invalido]:R,[Te.valido]:H,[Te.enfocado]:de},$,I?.base);return a.jsxs("div",{className:bt,style:F,children:[p&&a.jsxs("label",{className:K(Te.etiqueta,I?.label),htmlFor:U,children:[p,m&&a.jsx("span",{className:Te.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:K(Te.envoltorio_input,I?.inputWrapper),children:[a.jsxs("div",{className:K(Te.envoltorio_interno,I?.innerWrapper),children:[h&&a.jsx("span",{className:Te.contenido_inicio,children:h}),a.jsx("input",{...ce,ref:ie,id:U,name:re,type:"text",inputMode:"decimal",value:_e,placeholder:r,disabled:w,readOnly:b,required:m,"aria-invalid":R||void 0,"aria-describedby":Qe,"aria-required":m,className:K(Te.entrada,I?.input),onChange:We,onFocus:ft,onBlur:nt,onKeyDown:Be}),g&&a.jsx("span",{className:Te.contenido_final,children:g})]}),!O&&!b&&!w&&a.jsxs("div",{className:K(Te.controles,I?.controls),children:[a.jsx("button",{type:"button",tabIndex:-1,className:K(Te.boton_control,I?.controlButton),disabled:!it,onClick:()=>ve(-1),"aria-label":"Decrementar valor",children:a.jsx(qa,{})}),a.jsx("button",{type:"button",tabIndex:-1,className:K(Te.boton_control,I?.controlButton),disabled:!Ne,onClick:()=>ve(1),"aria-label":"Incrementar valor",children:a.jsx(Va,{})})]})]}),_&&!R&&a.jsx("div",{id:Ze,className:K(Te.descripcion,I?.description),children:_}),R&&be&&a.jsx("div",{id:fe,className:K(Te.mensaje_error,I?.errorMessage),role:"alert",children:be})]})});Kr.displayName="InputNumeric";function ja(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 Ba(e,n="es-CO"){if(!e)return"";const t=new Date(e+"T00:00:00");return Number.isNaN(t.getTime())?"":t.toLocaleDateString(n,{year:"numeric",month:"long",day:"numeric"})}function Ha(){return new Date().toISOString().split("T")[0]}function Ga(e,n,t){if(!e)return!0;const o=new Date(e).getTime();return!(n&&o<new Date(n).getTime()||t&&o>new Date(t).getTime())}const ze={contenedor_base:"_contenedor_base_64bo9_1",tam_sm:"_tam_sm_64bo9_37",tam_lg:"_tam_lg_64bo9_49",radio_none:"_radio_none_64bo9_61",radio_sm:"_radio_sm_64bo9_69",radio_md:"_radio_md_64bo9_77",radio_lg:"_radio_lg_64bo9_85",radio_full:"_radio_full_64bo9_93",color_default:"_color_default_64bo9_101",color_primary:"_color_primary_64bo9_103",color_secondary:"_color_secondary_64bo9_111",color_success:"_color_success_64bo9_119",color_warning:"_color_warning_64bo9_127",color_danger:"_color_danger_64bo9_135",etiqueta:"_etiqueta_64bo9_143",marca_requerido:"_marca_requerido_64bo9_159",envoltorio_input:"_envoltorio_input_64bo9_169",envoltorio_interno:"_envoltorio_interno_64bo9_195",entrada:"_entrada_64bo9_215",icono_calendario_decorativo:"_icono_calendario_decorativo_64bo9_291",enfocado:"_enfocado_64bo9_315",contenido_inicio:"_contenido_inicio_64bo9_323",descripcion:"_descripcion_64bo9_341",mensaje_error:"_mensaje_error_64bo9_353",ancho_total:"_ancho_total_64bo9_365",variante_bordered:"_variante_bordered_64bo9_373",variante_faded:"_variante_faded_64bo9_383",variante_underlined:"_variante_underlined_64bo9_393",variante_ghost:"_variante_ghost_64bo9_427",deshabilitado:"_deshabilitado_64bo9_439",solo_lectura:"_solo_lectura_64bo9_473",valido:"_valido_64bo9_539",invalido:"_invalido_64bo9_547",sin_animacion:"_sin_animacion_64bo9_579"},Wa=({tipo:e})=>e==="time"?a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:ze.icono_calendario_decorativo,"aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]}):a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:ze.icono_calendario_decorativo,"aria-hidden":"true",children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),a.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),a.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),a.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),Ur=v.forwardRef((e,n)=>{const{type:t="date",value:o,defaultValue:r,placeholder:i,variant:s="bordered",color:l="default",size:d="md",radius:u="md",fullWidth:f=!0,disableAnimation:p=!1,label:_,description:c,errorMessage:h,startContent:g,isRequired:m=!1,isReadOnly:b=!1,isDisabled:w=!1,isInvalid:C,validationState:S,validate:k,className:$,classNames:I,style:F,min:L,max:N,onChange:D,onFocus:V,onBlur:T,id:y,name:E,...z}=e,A=v.useRef(null),P=v.useRef(y??`input-date-${Nn(8)}`).current;v.useImperativeHandle(n,()=>A.current);const O=o!==void 0,[B,j]=v.useState(r??""),q=O?o:B,[J,G]=v.useState(!1),le=v.useMemo(()=>{if(!k)return null;const de=ja(k(q));return de.invalido?de.mensaje:null},[q,k]),oe=v.useMemo(()=>C!==void 0?C:S==="invalid"?!0:S==="valid"?!1:!!le,[C,S,le]),re=S==="valid"&&!oe,ce={invalido:oe,mensaje:le},ie=v.useCallback(de=>{if(w||b)return;const ye=de.target.value;O||j(ye),D?.(ye)},[O,w,b,D]),me=v.useCallback(de=>{G(!0),V?.(de)},[V]),U=v.useCallback(de=>{G(!1),T?.(de)},[T]),ne=c?`${P}-desc`:void 0,ee=oe?`${P}-err`:void 0,pe=[ne,ee].filter(Boolean).join(" ")||void 0,_e=typeof h=="function"?h(ce):h??le,Z=K(ze.contenedor_base,ze[`variante_${s}`],ze[`tam_${d}`],ze[`radio_${u}`],ze[`color_${l}`],{[ze.ancho_total]:f,[ze.sin_animacion]:p,[ze.deshabilitado]:w,[ze.solo_lectura]:b,[ze.invalido]:oe,[ze.valido]:re,[ze.enfocado]:J},$,I?.base);return a.jsxs("div",{className:Z,style:F,children:[_&&a.jsxs("label",{className:K(ze.etiqueta,I?.label),htmlFor:P,children:[_,m&&a.jsx("span",{className:ze.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsx("div",{className:K(ze.envoltorio_input,I?.inputWrapper),children:a.jsxs("div",{className:K(ze.envoltorio_interno,I?.innerWrapper),children:[g&&a.jsx("span",{className:ze.contenido_inicio,children:g}),a.jsx("input",{...z,ref:A,id:P,name:E,type:t,value:O?q:void 0,defaultValue:O?void 0:r,placeholder:i,disabled:w,readOnly:b,required:m,min:L,max:N,"aria-invalid":oe||void 0,"aria-describedby":pe,"aria-required":m,className:K(ze.entrada,I?.input),onChange:ie,onFocus:me,onBlur:U}),a.jsx(Wa,{tipo:t})]})}),c&&!oe&&a.jsx("div",{id:ne,className:K(ze.descripcion,I?.description),children:c}),oe&&_e&&a.jsx("div",{id:ee,className:K(ze.mensaje_error,I?.errorMessage),role:"alert",children:_e})]})});Ur.displayName="InputDate";const Ra={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function Pn({mostrar:e,children:n,tipo:t="desvanecerDeslizar",className:o,...r}){const[i,s]=v.useState(e),[l,d]=v.useState(e?"entrada":null);e&&!i?(s(!0),d("entrada")):!e&&i&&l!=="salida"&&d("salida");const u=()=>{l==="entrada"?d(null):l==="salida"&&(s(!1),d(null))};if(!i)return null;const f=Ra[t||"desvanecer"],p=l?`transicion_${f}_${l}`:"";return a.jsx("div",{...r,onAnimationEnd:u,className:`${p} ${o||""}`.trim(),children:n})}const St={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 Eo(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 Mo(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 Yr(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 No({tipo:e,texto:n,size:t="md",estirar:o}){const r=e==="mic";return a.jsxs("span",{className:K(St.badge_voz,r?St.badge_mic:St.badge_tts,St[`badge_${t}`],o&&St.badge_estirada),"data-tipo":e,children:[a.jsx("span",{className:St.badge_icono,children:r?a.jsx(Eo,{}):a.jsx(Mo,{})}),a.jsx("span",{className:St.badge_texto,children:n}),r?a.jsxs("span",{className:St.badge_ondas,"aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{})]}):a.jsxs("span",{className:St.badge_eq,"aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{})]})]})}function Xr({value:e,onChange:n,isDisabled:t,isReadOnly:o,onDictadoCompleto:r,idioma:i="es-ES"}){const[s,l]=v.useState(!1),[d,u]=v.useState(!1),[f,p]=v.useState(null),_=v.useRef(null),c=v.useRef(null),h=v.useRef(null),g=v.useRef(""),m=typeof window<"u"&&"speechSynthesis"in window,b=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),w=v.useCallback(()=>{h.current&&(clearTimeout(h.current),h.current=null),m&&window.speechSynthesis.cancel(),c.current=null,l(!1)},[m]),C=v.useCallback(()=>{if(!m||!e)return;if(w(),_.current){try{_.current.stop()}catch(I){console.error("Error stopping recognition:",I)}_.current=null,u(!1)}const $=new SpeechSynthesisUtterance(e);$.lang=i,$.onstart=()=>l(!0),$.onend=()=>{l(!1),c.current=null},$.onerror=()=>{l(!1),c.current=null},c.current=$,window.speechSynthesis.speak($)},[m,e,i,w]),S=v.useCallback(()=>{if(_.current)try{_.current.stop()}catch($){console.error("Error stopping recognition:",$)}u(!1),p(null)},[]),k=v.useCallback(()=>{if(!b||t||o)return;w();const $=window,I=$.SpeechRecognition||$.webkitSpeechRecognition;if(!I){p("Navegador no compatible");return}try{const F=new I;F.continuous=!0,F.interimResults=!0,F.lang=i,F.onstart=()=>{u(!0),p(null),g.current=e||""},F.onend=()=>{u(!1),_.current=null,r?.()},F.onerror=L=>{L.error!=="no-speech"&&(u(!1),_.current=null,L.error!=="aborted"&&p("Error al reconocer voz"))},F.onresult=L=>{try{let N="";for(let T=0;T<L.results.length;T++)N+=L.results[T][0].transcript;const D=g.current&&N?" ":"",V=g.current+D+N;n(V)}catch{p("Error procesando dictado")}},_.current=F,F.start()}catch{p("No se pudo iniciar dictado"),u(!1)}},[b,t,o,e,n,i,w,r]);return v.useEffect(()=>()=>{h.current&&clearTimeout(h.current),m&&window.speechSynthesis.cancel(),_.current&&_.current.abort()},[m]),{puedeHablar:m,puedeEscuchar:b,hablando:s,escuchando:d,errorDictado:f,escuchar:C,detenerHablar:w,dictar:k,detenerDictado:S}}function Ka({size:e="1em",className:n}){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:n,"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 Ae={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"},Zr=v.forwardRef((e,n)=>{const{children:t,variant:o="bordered",color:r="default",size:i="md",radius:s="md",fullWidth:l=!0,disableAnimation:d=!1,label:u,description:f,errorMessage:p,value:_,defaultValue:c,placeholder:h,isRequired:g=!1,isReadOnly:m=!1,isDisabled:b=!1,isClearable:w=!1,isInvalid:C,validationState:S,validate:k,minRows:$=4,maxRows:I=10,disableAutosize:F=!1,hideVoiceActions:L=!1,className:N,classNames:D,style:V,onChange:T,onClear:y,onFocus:E,onBlur:z,id:A,name:x,rows:P,...O}=e,B=v.useRef(null),q=v.useRef(A??`textarea-${Nn(8)}`).current;v.useImperativeHandle(n,()=>B.current);const J=_!==void 0,[G,le]=v.useState(c??""),oe=J?_:G,[re,ce]=v.useState(!1),ie=v.useMemo(()=>{if(!k)return null;const te=k(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,k]),me=v.useMemo(()=>C!==void 0?C:S==="invalid"?!0:S==="valid"?!1:!!ie,[C,S,ie]),U=S==="valid"&&!me,ne={invalido:me,mensaje:ie},ee=oe.length>0,pe=v.useCallback(()=>{if(!B.current||F)return;const te=B.current,Fe=window.getComputedStyle(te),we=parseFloat(Fe.lineHeight)||parseFloat(Fe.fontSize)*1.5,_t=parseFloat(Fe.paddingTop)||0,gt=parseFloat(Fe.paddingBottom)||0,Xt=parseFloat(Fe.borderTopWidth)||0,lt=parseFloat(Fe.borderBottomWidth)||0,Zt=$*we+_t+gt+Xt+lt,Re=I*we+_t+gt+Xt+lt;te.style.height="auto";const Tr=te.scrollHeight;te.style.height=`${Math.min(Math.max(Tr,Zt),Re)}px`},[F,$,I]);v.useEffect(()=>{F||pe()},[oe,pe,F]);const _e=v.useCallback(te=>{J||le(te),T?.(te)},[J,T]),{puedeHablar:Z,hablando:de,escuchar:ye,detenerHablar:ue,puedeEscuchar:Ce,escuchando:W,errorDictado:R,dictar:H,detenerDictado:he}=Xr({isDisabled:b||L,isReadOnly:m,value:oe,onChange:_e}),ge=v.useCallback(te=>{if(b||m)return;const Fe=te.target.value;J||le(Fe),T?.(Fe)},[J,b,m,T]),ve=v.useCallback(te=>{ce(!0),E?.(te)},[E]),We=v.useCallback(te=>{ce(!1),z?.(te)},[z]),ft=v.useCallback(()=>{b||m||(J||le(""),T?.(""),y?.(),B.current?.focus())},[J,b,m,T,y]),nt=v.useCallback(()=>{de?ue():ye()},[de,ye,ue]),Be=v.useCallback(()=>{W?he():H()},[W,H,he]),Ze=f?`${q}-desc`:void 0,fe=me||R?`${q}-err`:void 0,Qe=[Ze,fe].filter(Boolean).join(" ")||void 0,be=typeof p=="function"?p(ne):p??ie,Ne=w&&ee&&!m&&!b,it=!L||Ne,bt=K(Ae.contenedor_base,Ae[`variante_${o}`],Ae[`tam_${i}`],Ae[`radio_${s}`],Ae[`color_${r}`],{[Ae.ancho_total]:l,[Ae.sin_animacion]:d,[Ae.deshabilitado]:b,[Ae.solo_lectura]:m,[Ae.invalido]:me,[Ae.valido]:U,[Ae.enfocado]:re},N,D?.base);return a.jsxs("div",{className:bt,style:V,children:[u&&a.jsxs("label",{className:K(Ae.etiqueta,D?.label),htmlFor:q,children:[u,g&&a.jsx("span",{className:Ae.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:K(Ae.envoltorio_input,D?.inputWrapper),children:[a.jsx("textarea",{...O,ref:B,id:q,name:x,placeholder:h,value:J?oe:void 0,defaultValue:J?void 0:c,onChange:ge,onFocus:ve,onBlur:We,className:K(Ae.entrada,F&&Ae.sin_autosize,D?.input),readOnly:m,disabled:b,rows:P??$,"aria-invalid":me||void 0,"aria-describedby":Qe,"aria-required":g,required:g}),it&&a.jsxs("div",{className:K(Ae.barra_acciones,D?.actions),children:[a.jsxs("div",{className:Ae.badges_contenedor,"aria-live":"polite",role:"status",children:[a.jsx(Pn,{mostrar:W,children:a.jsx(No,{tipo:"mic",texto:"Escuchando...",size:i==="lg"?"md":"sm"})}),a.jsx(Pn,{mostrar:de,children:a.jsx(No,{tipo:"tts",texto:"Leyendo...",size:i==="lg"?"md":"sm"})})]}),a.jsxs("div",{className:Ae.botones_grupo,children:[!L&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:K(Ae.boton_accion,de&&Ae.boton_activo_tts),onClick:nt,disabled:!Z||!de&&(!oe||W),title:de?"Detener lectura":"Leer texto","aria-pressed":de,"aria-label":de?"Detener lectura":"Leer texto",children:a.jsx(Mo,{})}),Ce&&a.jsx("button",{type:"button",className:K(Ae.boton_accion,W&&Ae.boton_activo_mic),onClick:Be,disabled:b||m||de,title:W?"Detener dictado":"Dictar texto","aria-pressed":W,"aria-label":W?"Detener dictado":"Dictar texto",children:W?a.jsx(Yr,{}):a.jsx(Eo,{})})]}),Ne&&a.jsx("button",{type:"button",className:Ae.boton_limpiar,onClick:ft,title:"Limpiar campo","aria-label":"Limpiar campo",children:a.jsx(Ka,{size:"0.75em"})})]})]})]}),f&&!me&&a.jsx("div",{id:Ze,className:K(Ae.descripcion,D?.description),children:f}),me&&be||R?a.jsxs("div",{id:fe,className:K(Ae.mensaje_error,D?.errorMessage),role:"alert",children:[be,be&&R&&a.jsx("br",{}),R&&a.jsxs("span",{children:["Error de voz: ",R]})]}):null,t]})});Zr.displayName="TextArea";function Ln(){return typeof window<"u"}function At(e){return Fo(e)?(e.nodeName||"").toLowerCase():"#document"}function at(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function wt(e){var n;return(n=(Fo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function Fo(e){return Ln()?e instanceof Node||e instanceof at(e).Node:!1}function Pe(e){return Ln()?e instanceof Element||e instanceof at(e).Element:!1}function Ve(e){return Ln()?e instanceof HTMLElement||e instanceof at(e).HTMLElement:!1}function Dn(e){return!Ln()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof at(e).ShadowRoot}const Ua=new Set(["inline","contents"]);function _n(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=ct(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!Ua.has(r)}const Ya=new Set(["table","td","th"]);function Xa(e){return Ya.has(At(e))}const Za=[":popover-open",":modal"];function Tn(e){return Za.some(n=>{try{return e.matches(n)}catch{return!1}})}const Qa=["transform","translate","scale","rotate","perspective"],Ja=["transform","translate","scale","rotate","perspective","filter"],el=["paint","layout","strict","content"];function Ao(e){const n=On(),t=Pe(e)?ct(e):e;return Qa.some(o=>t[o]?t[o]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!n&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!n&&(t.filter?t.filter!=="none":!1)||Ja.some(o=>(t.willChange||"").includes(o))||el.some(o=>(t.contain||"").includes(o))}function tl(e){let n=kt(e);for(;Ve(n)&&!$t(n);){if(Ao(n))return n;if(Tn(n))return null;n=kt(n)}return null}function On(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const nl=new Set(["html","body","#document"]);function $t(e){return nl.has(At(e))}function ct(e){return at(e).getComputedStyle(e)}function zn(e){return Pe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kt(e){if(At(e)==="html")return e;const n=e.assignedSlot||e.parentNode||Dn(e)&&e.host||wt(e);return Dn(n)?n.host:n}function Qr(e){const n=kt(e);return $t(n)?e.ownerDocument?e.ownerDocument.body:e.body:Ve(n)&&_n(n)?n:Qr(n)}function Pt(e,n,t){var o;n===void 0&&(n=[]),t===void 0&&(t=!0);const r=Qr(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=at(r);if(i){const l=Po(s);return n.concat(s,s.visualViewport||[],_n(r)?r:[],l&&t?Pt(l):[])}return n.concat(r,Pt(r,[],t))}function Po(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Lt=Math.min,dt=Math.max,Vn=Math.round,Qt=Math.floor,yt=e=>({x:e,y:e}),ol={left:"right",right:"left",bottom:"top",top:"bottom"},rl={start:"end",end:"start"};function Lo(e,n,t){return dt(e,Lt(n,t))}function Jt(e,n){return typeof e=="function"?e(n):e}function Dt(e){return e.split("-")[0]}function en(e){return e.split("-")[1]}function Jr(e){return e==="x"?"y":"x"}function Do(e){return e==="y"?"height":"width"}const il=new Set(["top","bottom"]);function It(e){return il.has(Dt(e))?"y":"x"}function To(e){return Jr(It(e))}function sl(e,n,t){t===void 0&&(t=!1);const o=en(e),r=To(e),i=Do(r);let s=r==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return n.reference[i]>n.floating[i]&&(s=qn(s)),[s,qn(s)]}function al(e){const n=qn(e);return[Oo(e),n,Oo(n)]}function Oo(e){return e.replace(/start|end/g,n=>rl[n])}const ei=["left","right"],ti=["right","left"],ll=["top","bottom"],cl=["bottom","top"];function dl(e,n,t){switch(e){case"top":case"bottom":return t?n?ti:ei:n?ei:ti;case"left":case"right":return n?ll:cl;default:return[]}}function ul(e,n,t,o){const r=en(e);let i=dl(Dt(e),t==="start",o);return r&&(i=i.map(s=>s+"-"+r),n&&(i=i.concat(i.map(Oo)))),i}function qn(e){return e.replace(/left|right|bottom|top/g,n=>ol[n])}function fl(e){return{top:0,right:0,bottom:0,left:0,...e}}function ni(e){return typeof e!="number"?fl(e):{top:e,right:e,bottom:e,left:e}}function jn(e){const{x:n,y:t,width:o,height:r}=e;return{width:o,height:r,top:t,left:n,right:n+o,bottom:t+r,x:n,y:t}}/*!
|
|
1
|
+
(function(Z,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):(Z=typeof globalThis<"u"?globalThis:Z||self,a(Z.CoreKitUI={},Z.jsxRuntime,Z.React,Z.ReactDOM))})(this,(function(Z,a,v,Fn){"use strict";function Ws(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 I=Ws(v),gr=Ws(Fn);function Gs(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=Gs(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=Gs(e))&&(o&&(o+=" "),o+=t);return o}const Ks=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ys=W,Ic=(e,t)=>n=>{var o;if(t?.variants==null)return Ys(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 u=Ks(_)||Ks(g);return r[d][u]}),l=n&&Object.entries(n).reduce((d,_)=>{let[g,u]=_;return u===void 0||(d[g]=u),d},{}),c=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((d,_)=>{let{class:g,className:u,...f}=_;return Object.entries(f).every(h=>{let[p,m]=h;return Array.isArray(m)?m.includes({...s,...l}[p]):{...s,...l}[p]===m})?[...d,g,u]:d},[]);return Ys(e,i,c,n?.class,n?.className)},ke={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"},kc=Ic(ke.boton,{variants:{variant:{solid:ke.solid,bordered:ke.bordered,ghost:ke.ghost,light:ke.light,faded:ke.faded,shadow:ke.shadow},color:{default:ke.default,primary:ke.primary,secondary:ke.secondary,success:ke.success,warning:ke.warning,danger:ke.danger},size:{sm:ke.sm,md:ke.md,lg:ke.lg},radius:{none:ke.radius_none,sm:ke.radius_sm,md:ke.radius_md,lg:ke.radius_lg,full:ke.radius_full},fullWidth:{true:ke.full_width},isIconOnly:{true:ke.icon_only},isLoading:{true:ke.loading},onlyLoading:{true:ke.only_loading},isDisabled:{true:ke.disabled},disableAnimation:{false:ke.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md",disableAnimation:!0}}),ct=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:u,endContent:f,spinner:h,spinnerPlacement:p="end",permisos:m,permiso:w,children:y,className:x,onClick:$,style:A,type:F="button","aria-label":N,...P},T)=>{const k=w&&m?!m.includes(w):!1,z=l||s||k,B=D=>{if(z){D.preventDefault();return}if($?.(D),d||z||!(D.currentTarget instanceof HTMLElement))return;const C=D.currentTarget,M=document.createElement("span"),L=C.getBoundingClientRect(),q=Math.max(L.width,L.height);M.className=ke.ripple,M.style.width=`${q}px`,M.style.height=`${q}px`,M.style.left=`${D.clientX-L.left}px`,M.style.top=`${D.clientY-L.top}px`,M.addEventListener("animationend",()=>M.remove(),{once:!0}),C.appendChild(M)},E=g?{"--btn-color":g,"--btn-text-color":g,...A}:A,b=kc({variant:e,color:g?void 0:t,size:n,radius:o,fullWidth:r,isIconOnly:c,isLoading:s,onlyLoading:i,isDisabled:z,disableAnimation:_}),S=s&&a.jsx("span",{className:ke.spinner,"aria-hidden":i?void 0:"true",children:h||a.jsx("span",{className:ke.spinner_icon})}),O=i&&!N?"Cargando":N;return a.jsxs("button",{...P,ref:T,type:F,"aria-label":O,"aria-busy":s,className:W(b,x),disabled:z,onClick:B,style:E,children:[p==="start"&&S,u&&!i&&a.jsx("span",{className:W(ke.start_content,ke.content_item),children:u}),y&&!i&&a.jsx("span",{className:ke.content,children:y}),f&&!i&&a.jsx("span",{className:W(ke.end_content,ke.content_item),children:f}),p==="end"&&S]})});ct.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 Nc=()=>{};/**
|
|
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 Xs=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},Mc=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("")},Zs={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 u=(l&15)<<2|d>>6,f=d&63;c||(f=64,i||(u=64)),o.push(n[_],n[g],n[u],n[f])}return o.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(Xs(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):Mc(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 Ac;const u=s<<2|l>>4;if(o.push(u),d!==64){const f=l<<4&240|d>>2;if(o.push(f),g!==64){const h=d<<6&192|g;o.push(h)}}}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 Ac extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Dc=function(e){const t=Xs(e);return Zs.encodeByteArray(t,!0)},ao=function(e){return Dc(e).replace(/\./g,"")},Tc=function(e){try{return Zs.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 Fc(){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 Pc=()=>Fc().__FIREBASE_DEFAULTS__,Lc=()=>{if(typeof process>"u"||typeof process.env>"u")return;const e=process.env.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},Oc=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&Tc(e[1]);return t&&JSON.parse(t)},Js=()=>{try{return Nc()||Pc()||Lc()||Oc()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},zc=e=>Js()?.emulatorHosts?.[e],Bc=e=>{const t=zc(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]},Qs=()=>Js()?.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 Vc{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 hr(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function jc(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 qc(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[ao(JSON.stringify(n)),ao(JSON.stringify(i)),""].join(".")}const Pn={};function Hc(){const e={prod:[],emulator:[]};for(const t of Object.keys(Pn))Pn[t]?e.emulator.push(t):e.prod.push(t);return e}function Rc(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 ei=!1;function Uc(e,t){if(typeof window>"u"||typeof document>"u"||!hr(window.location.host)||Pn[e]===t||Pn[e]||ei)return;Pn[e]=t;function n(u){return`__firebase__banner__${u}`}const o="__firebase__banner",s=Hc().prod.length>0;function i(){const u=document.getElementById(o);u&&u.remove()}function l(u){u.style.display="flex",u.style.background="#7faaf0",u.style.position="fixed",u.style.bottom="5px",u.style.left="5px",u.style.padding=".5em",u.style.borderRadius="5px",u.style.alignItems="center"}function c(u,f){u.setAttribute("width","24"),u.setAttribute("id",f),u.setAttribute("height","24"),u.setAttribute("viewBox","0 0 24 24"),u.setAttribute("fill","none"),u.style.marginLeft="-6px"}function d(){const u=document.createElement("span");return u.style.cursor="pointer",u.style.marginLeft="16px",u.style.fontSize="24px",u.innerHTML=" ×",u.onclick=()=>{ei=!0,i()},u}function _(u,f){u.setAttribute("id",f),u.innerText="Learn more",u.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",u.setAttribute("target","__blank"),u.style.paddingLeft="5px",u.style.textDecoration="underline"}function g(){const u=Rc(o),f=n("text"),h=document.getElementById(f)||document.createElement("span"),p=n("learnmore"),m=document.getElementById(p)||document.createElement("a"),w=n("preprendIcon"),y=document.getElementById(w)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(u.created){const x=u.element;l(x),_(m,p);const $=d();c(y,w),x.append(y,h,m,$),document.body.appendChild(x)}s?(h.innerText="Preview backend disconnected.",y.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>`):(y.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>`,h.innerText="Preview backend running in this workspace."),h.setAttribute("id",f)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",g):g()}function Wc(){try{return typeof indexedDB=="object"}catch{return!1}}function Gc(){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 Kc="FirebaseError";class yn extends Error{constructor(t,n,o){super(n),this.code=t,this.customData=o,this.name=Kc,Object.setPrototypeOf(this,yn.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,ti.prototype.create)}}class ti{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?Yc(s,o):"Error",l=`${this.serviceName}: ${i} (${r}).`;return new yn(r,l,o)}}function Yc(e,t){return e.replace(Xc,(n,o)=>{const r=t[o];return r!=null?String(r):`<${o}?>`})}const Xc=/\{\$([^}]+)}/g;function pr(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(ni(s)&&ni(i)){if(!pr(s,i))return!1}else if(s!==i)return!1}for(const r of o)if(!n.includes(r))return!1;return!0}function ni(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 Ln(e){return e&&e._delegate?e._delegate:e}class On{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 cn="[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 Zc{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 Vc;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(Qc(t))try{this.getOrInitializeService({instanceIdentifier:cn})}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=cn){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=cn){return this.instances.has(t)}getOptions(t=cn){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:Jc(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=cn){return this.component?this.component.multipleInstances?t:cn:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Jc(e){return e===cn?void 0:e}function Qc(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 ed{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 Zc(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 Ve;(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"})(Ve||(Ve={}));const td={debug:Ve.DEBUG,verbose:Ve.VERBOSE,info:Ve.INFO,warn:Ve.WARN,error:Ve.ERROR,silent:Ve.SILENT},nd=Ve.INFO,od={[Ve.DEBUG]:"log",[Ve.VERBOSE]:"log",[Ve.INFO]:"info",[Ve.WARN]:"warn",[Ve.ERROR]:"error"},rd=(e,t,...n)=>{if(t<e.logLevel)return;const o=new Date().toISOString(),r=od[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 sd{constructor(t){this.name=t,this._logLevel=nd,this._logHandler=rd,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in Ve))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?td[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,Ve.DEBUG,...t),this._logHandler(this,Ve.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,Ve.VERBOSE,...t),this._logHandler(this,Ve.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,Ve.INFO,...t),this._logHandler(this,Ve.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,Ve.WARN,...t),this._logHandler(this,Ve.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,Ve.ERROR,...t),this._logHandler(this,Ve.ERROR,...t)}}const id=(e,t)=>t.some(n=>e instanceof n);let oi,ri;function ad(){return oi||(oi=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ld(){return ri||(ri=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const si=new WeakMap,mr=new WeakMap,ii=new WeakMap,vr=new WeakMap,br=new WeakMap;function cd(e){const t=new Promise((n,o)=>{const r=()=>{e.removeEventListener("success",s),e.removeEventListener("error",i)},s=()=>{n(Gt(e.result)),r()},i=()=>{o(e.error),r()};e.addEventListener("success",s),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&si.set(n,e)}).catch(()=>{}),br.set(t,e),t}function dd(e){if(mr.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)});mr.set(e,t)}let wr={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return mr.get(e);if(t==="objectStoreNames")return e.objectStoreNames||ii.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Gt(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 ud(e){wr=e(wr)}function fd(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const o=e.call(yr(this),t,...n);return ii.set(o,t.sort?t.sort():[t]),Gt(o)}:ld().includes(e)?function(...t){return e.apply(yr(this),t),Gt(si.get(this))}:function(...t){return Gt(e.apply(yr(this),t))}}function _d(e){return typeof e=="function"?fd(e):(e instanceof IDBTransaction&&dd(e),id(e,ad())?new Proxy(e,wr):e)}function Gt(e){if(e instanceof IDBRequest)return cd(e);if(vr.has(e))return vr.get(e);const t=_d(e);return t!==e&&(vr.set(e,t),br.set(t,e)),t}const yr=e=>br.get(e);function gd(e,t,{blocked:n,upgrade:o,blocking:r,terminated:s}={}){const i=indexedDB.open(e,t),l=Gt(i);return o&&i.addEventListener("upgradeneeded",c=>{o(Gt(i.result),c.oldVersion,c.newVersion,Gt(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 hd=["get","getKey","getAll","getAllKeys","count"],pd=["put","add","delete","clear"],Cr=new Map;function ai(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Cr.get(t))return Cr.get(t);const n=t.replace(/FromIndex$/,""),o=t!==n,r=pd.includes(n);if(!(n in(o?IDBIndex:IDBObjectStore).prototype)||!(r||hd.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 Cr.set(t,s),s}ud(e=>({...e,get:(t,n,o)=>ai(t,n)||e.get(t,n,o),has:(t,n)=>!!ai(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 md{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(vd(n)){const o=n.getImmediate();return`${o.library}/${o.version}`}else return null}).filter(n=>n).join(" ")}}function vd(e){return e.getComponent()?.type==="VERSION"}const xr="@firebase/app",li="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 Ot=new sd("@firebase/app"),bd="@firebase/app-compat",wd="@firebase/analytics-compat",yd="@firebase/analytics",Cd="@firebase/app-check-compat",xd="@firebase/app-check",Sd="@firebase/auth",$d="@firebase/auth-compat",Ed="@firebase/database",Id="@firebase/data-connect",kd="@firebase/database-compat",Nd="@firebase/functions",Md="@firebase/functions-compat",Ad="@firebase/installations",Dd="@firebase/installations-compat",Td="@firebase/messaging",Fd="@firebase/messaging-compat",Pd="@firebase/performance",Ld="@firebase/performance-compat",Od="@firebase/remote-config",zd="@firebase/remote-config-compat",Bd="@firebase/storage",Vd="@firebase/storage-compat",jd="@firebase/firestore",qd="@firebase/ai",Hd="@firebase/firestore-compat",Rd="firebase",Ud="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 Sr="[DEFAULT]",Wd={[xr]:"fire-core",[bd]:"fire-core-compat",[yd]:"fire-analytics",[wd]:"fire-analytics-compat",[xd]:"fire-app-check",[Cd]:"fire-app-check-compat",[Sd]:"fire-auth",[$d]:"fire-auth-compat",[Ed]:"fire-rtdb",[Id]:"fire-data-connect",[kd]:"fire-rtdb-compat",[Nd]:"fire-fn",[Md]:"fire-fn-compat",[Ad]:"fire-iid",[Dd]:"fire-iid-compat",[Td]:"fire-fcm",[Fd]:"fire-fcm-compat",[Pd]:"fire-perf",[Ld]:"fire-perf-compat",[Od]:"fire-rc",[zd]:"fire-rc-compat",[Bd]:"fire-gcs",[Vd]:"fire-gcs-compat",[jd]:"fire-fst",[Hd]:"fire-fst-compat",[qd]:"fire-vertex","fire-js":"fire-js",[Rd]:"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,Gd=new Map,$r=new Map;function ci(e,t){try{e.container.addComponent(t)}catch(n){Ot.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function co(e){const t=e.name;if($r.has(t))return Ot.debug(`There were multiple attempts to register component ${t}.`),!1;$r.set(t,e);for(const n of lo.values())ci(n,e);for(const n of Gd.values())ci(n,e);return!0}function Kd(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function Yd(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 Xd={"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."},Kt=new ti("app","Firebase",Xd);/**
|
|
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 Zd{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 On("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 Kt.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 Jd=Ud;function Qd(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const o={name:Sr,automaticDataCollectionEnabled:!0,...t},r=o.name;if(typeof r!="string"||!r)throw Kt.create("bad-app-name",{appName:String(r)});if(n||(n=Qs()),!n)throw Kt.create("no-options");const s=lo.get(r);if(s){if(pr(n,s.options)&&pr(o,s.config))return s;throw Kt.create("duplicate-app",{appName:r})}const i=new ed(r);for(const c of $r.values())i.addComponent(c);const l=new Zd(n,o,i);return lo.set(r,l),l}function eu(e=Sr){const t=lo.get(e);if(!t&&e===Sr&&Qs())return Qd();if(!t)throw Kt.create("no-app",{appName:e});return t}function zn(e,t,n){let o=Wd[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 "/")`),Ot.warn(i.join(" "));return}co(new On(`${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 tu="firebase-heartbeat-database",nu=1,Bn="firebase-heartbeat-store";let Er=null;function di(){return Er||(Er=gd(tu,nu,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(Bn)}catch(n){console.warn(n)}}}}).catch(e=>{throw Kt.create("idb-open",{originalErrorMessage:e.message})})),Er}async function ou(e){try{const n=(await di()).transaction(Bn),o=await n.objectStore(Bn).get(fi(e));return await n.done,o}catch(t){if(t instanceof yn)Ot.warn(t.message);else{const n=Kt.create("idb-get",{originalErrorMessage:t?.message});Ot.warn(n.message)}}}async function ui(e,t){try{const o=(await di()).transaction(Bn,"readwrite");await o.objectStore(Bn).put(t,fi(e)),await o.done}catch(n){if(n instanceof yn)Ot.warn(n.message);else{const o=Kt.create("idb-set",{originalErrorMessage:n?.message});Ot.warn(o.message)}}}function fi(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 ru=1024,su=30;class iu{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new lu(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=_i();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>su){const r=cu(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(r,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(t){Ot.warn(t)}}async getHeartbeatsHeader(){try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||this._heartbeatsCache.heartbeats.length===0)return"";const t=_i(),{heartbeatsToSend:n,unsentEntries:o}=au(this._heartbeatsCache.heartbeats),r=ao(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 Ot.warn(t),""}}}function _i(){return new Date().toISOString().substring(0,10)}function au(e,t=ru){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),gi(n)>t){s.dates.pop();break}}else if(n.push({agent:r.agent,dates:[r.date]}),gi(n)>t){n.pop();break}o=o.slice(1)}return{heartbeatsToSend:n,unsentEntries:o}}class lu{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Wc()?Gc().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await ou(this.app);return n?.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){if(await this._canUseIndexedDBPromise){const o=await this.read();return ui(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 ui(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??o.lastSentHeartbeatDate,heartbeats:[...o.heartbeats,...t.heartbeats]})}else return}}function gi(e){return ao(JSON.stringify({version:2,heartbeats:e})).length}function cu(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 du(e){co(new On("platform-logger",t=>new md(t),"PRIVATE")),co(new On("heartbeat",t=>new iu(t),"PRIVATE")),zn(xr,li,e),zn(xr,li,"esm2020"),zn("fire-js","")}du("");/**
|
|
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 hi="firebasestorage.googleapis.com",pi="storageBucket",uu=120*1e3,fu=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 yn{constructor(t,n,o=0){super(Ir(t),`Firebase Storage: ${n} (${Ir(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 Ir(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 Ir(e){return"storage/"+e}function kr(){const e="An unknown error occurred, please check the error payload for server response.";return new We(Ge.UNKNOWN,e)}function _u(e){return new We(Ge.OBJECT_NOT_FOUND,"Object '"+e+"' does not exist.")}function gu(e){return new We(Ge.QUOTA_EXCEEDED,"Quota for bucket '"+e+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function hu(){const e="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new We(Ge.UNAUTHENTICATED,e)}function pu(){return new We(Ge.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function mu(e){return new We(Ge.UNAUTHORIZED,"User does not have permission to access '"+e+"'.")}function vu(){return new We(Ge.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function bu(){return new We(Ge.CANCELED,"User canceled the upload/download.")}function wu(e){return new We(Ge.INVALID_URL,"Invalid URL '"+e+"'.")}function yu(e){return new We(Ge.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+e+"'.")}function Cu(){return new We(Ge.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+pi+"' property when initializing the app?")}function xu(){return new We(Ge.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function Su(){return new We(Ge.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function $u(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 Nr(e){return new We(Ge.INVALID_ARGUMENT,e)}function mi(){return new We(Ge.APP_DELETED,"The Firebase app was deleted.")}function Eu(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 Vn(e,t){return new We(Ge.INVALID_FORMAT,"String does not match format '"+e+"': "+t)}function jn(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 yt{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=yt.makeFromUrl(t,n)}catch{return new yt(t,"")}if(o.path==="")return o;throw yu(t)}static makeFromUrl(t,n){let o=null;const r="([A-Za-z0-9.\\-_]+)";function s($){$.path.charAt($.path.length-1)==="/"&&($.path_=$.path_.slice(0,-1))}const i="(/(.*))?$",l=new RegExp("^gs://"+r+i,"i"),c={bucket:1,path:3};function d($){$.path_=decodeURIComponent($.path)}const _="v[A-Za-z0-9_]+",g=n.replace(/[.]/g,"\\."),u="(/([^?#]*).*)?$",f=new RegExp(`^https?://${g}/${_}/b/${r}/o${u}`,"i"),h={bucket:1,path:3},p=n===hi?"(?:storage.googleapis.com|storage.cloud.google.com)":n,m="([^?#]*)",w=new RegExp(`^https?://${p}/${r}/${m}`,"i"),x=[{regex:l,indices:c,postModify:s},{regex:f,indices:h,postModify:d},{regex:w,indices:{bucket:1,path:2},postModify:d}];for(let $=0;$<x.length;$++){const A=x[$],F=A.regex.exec(t);if(F){const N=F[A.indices.bucket];let P=F[A.indices.path];P||(P=""),o=new yt(N,P),A.postModify(o);break}}if(o==null)throw wu(t);return o}}class Iu{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 ku(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(f,c())},m)}function u(){s&&clearTimeout(s)}function f(m,...w){if(d){u();return}if(m){u(),_.call(null,m,...w);return}if(c()||i){u(),_.call(null,m,...w);return}o<64&&(o*=2);let x;l===1?(l=2,x=0):x=(o+Math.random())*1e3,g(x)}let h=!1;function p(m){h||(h=!0,u(),!d&&(r!==null?(m||(l=2),clearTimeout(r),g(0)):m||(l=1)))}return g(0),s=setTimeout(()=>{i=!0,p(!0)},n),p}function Nu(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 Mu(e){return e!==void 0}function Au(e){return typeof e=="object"&&!Array.isArray(e)}function Mr(e){return typeof e=="string"||e instanceof String}function vi(e){return Ar()&&e instanceof Blob}function Ar(){return typeof Blob<"u"}function bi(e,t,n,o){if(o<t)throw Nr(`Invalid value for '${e}'. Expected ${t} or greater.`);if(o>n)throw Nr(`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 uo(e,t,n){let o=t;return n==null&&(o=`https://${t}`),`${n}://${o}/v0${e}`}function wi(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 dn;(function(e){e[e.NO_ERROR=0]="NO_ERROR",e[e.NETWORK_ERROR=1]="NETWORK_ERROR",e[e.ABORT=2]="ABORT"})(dn||(dn={}));/**
|
|
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 Du(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 Tu{constructor(t,n,o,r,s,i,l,c,d,_,g,u=!0,f=!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=u,this.isUsingEmulator=f,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((h,p)=>{this.resolve_=h,this.reject_=p,this.start_()})}start_(){const t=(o,r)=>{if(r){o(!1,new fo(!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()===dn.NO_ERROR,c=s.getStatus();if(!l||Du(c,this.additionalRetryCodes_)&&this.retry){const _=s.getErrorCode()===dn.ABORT;o(!1,new fo(!1,null,_));return}const d=this.successCodes_.indexOf(c)!==-1;o(!0,new fo(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());Mu(c)?s(c):s()}catch(c){i(c)}else if(l!==null){const c=kr();c.serverResponse=l.getErrorText(),this.errorCallback_?i(this.errorCallback_(l,c)):i(c)}else if(r.canceled){const c=this.appDelete_?mi():bu();i(c)}else{const c=vu();i(c)}};this.canceled_?n(!1,new fo(!1,null,!0)):this.backoffId_=ku(t,n,this.timeout_)}getPromise(){return this.promise_}cancel(t){this.canceled_=!0,this.appDelete_=t||!1,this.backoffId_!==null&&Nu(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class fo{constructor(t,n,o){this.wasSuccessCode=t,this.connection=n,this.canceled=!!o}}function Fu(e,t){t!==null&&t.length>0&&(e.Authorization="Firebase "+t)}function Pu(e,t){e["X-Firebase-Storage-Version"]="webjs/"+(t??"AppManager")}function Lu(e,t){t&&(e["X-Firebase-GMPID"]=t)}function Ou(e,t){t!==null&&(e["X-Firebase-AppCheck"]=t)}function zu(e,t,n,o,r,s,i=!0,l=!1){const c=wi(e.urlParams),d=e.url+c,_=Object.assign({},e.headers);return Lu(_,t),Fu(_,n),Pu(_,s),Ou(_,o),new Tu(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 Bu(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function Vu(...e){const t=Bu();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(Ar())return new Blob(e);throw new We(Ge.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}}function ju(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 qu(e){if(typeof atob>"u")throw $u("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 Nt={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class Dr{constructor(t,n){this.data=t,this.contentType=n||null}}function yi(e,t){switch(e){case Nt.RAW:return new Dr(Ci(t));case Nt.BASE64:case Nt.BASE64URL:return new Dr(xi(e,t));case Nt.DATA_URL:return new Dr(Ru(t),Uu(t))}throw kr()}function Ci(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 Hu(e){let t;try{t=decodeURIComponent(e)}catch{throw Vn(Nt.DATA_URL,"Malformed data URL.")}return Ci(t)}function xi(e,t){switch(e){case Nt.BASE64:{const r=t.indexOf("-")!==-1,s=t.indexOf("_")!==-1;if(r||s)throw Vn(e,"Invalid character '"+(r?"-":"_")+"' found: is it base64url encoded?");break}case Nt.BASE64URL:{const r=t.indexOf("+")!==-1,s=t.indexOf("/")!==-1;if(r||s)throw Vn(e,"Invalid character '"+(r?"+":"/")+"' found: is it base64 encoded?");t=t.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=qu(t)}catch(r){throw r.message.includes("polyfill")?r:Vn(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 Si{constructor(t){this.base64=!1,this.contentType=null;const n=t.match(/^data:([^,]+)?,/);if(n===null)throw Vn(Nt.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");const o=n[1]||null;o!=null&&(this.base64=Wu(o,";base64"),this.contentType=this.base64?o.substring(0,o.length-7):o),this.rest=t.substring(t.indexOf(",")+1)}}function Ru(e){const t=new Si(e);return t.base64?xi(Nt.BASE64,t.rest):Hu(t.rest)}function Uu(e){return new Si(e).contentType}function Wu(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 Yt{constructor(t,n){let o=0,r="";vi(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(vi(this.data_)){const o=this.data_,r=ju(o,t,n);return r===null?null:new Yt(r)}else{const o=new Uint8Array(this.data_.buffer,t,n-t);return new Yt(o,!0)}}static getBlob(...t){if(Ar()){const n=t.map(o=>o instanceof Yt?o.data_:o);return new Yt(Vu.apply(null,n))}else{const n=t.map(i=>Mr(i)?yi(Nt.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 Yt(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 $i(e){let t;try{t=JSON.parse(e)}catch{return null}return Au(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 Gu(e){if(e.length===0)return null;const t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function Ku(e,t){const n=t.split("/").filter(o=>o.length>0).join("/");return e.length===0?n:e+"/"+n}function Ei(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 Yu(e,t){return t}class gt{constructor(t,n,o,r){this.server=t,this.local=n||t,this.writable=!!o,this.xform=r||Yu}}let _o=null;function Xu(e){return!Mr(e)||e.length<2?e:Ei(e)}function Ii(){if(_o)return _o;const e=[];e.push(new gt("bucket")),e.push(new gt("generation")),e.push(new gt("metageneration")),e.push(new gt("name","fullPath",!0));function t(s,i){return Xu(i)}const n=new gt("name");n.xform=t,e.push(n);function o(s,i){return i!==void 0?Number(i):i}const r=new gt("size");return r.xform=o,e.push(r),e.push(new gt("timeCreated")),e.push(new gt("updated")),e.push(new gt("md5Hash",null,!0)),e.push(new gt("cacheControl",null,!0)),e.push(new gt("contentDisposition",null,!0)),e.push(new gt("contentEncoding",null,!0)),e.push(new gt("contentLanguage",null,!0)),e.push(new gt("contentType",null,!0)),e.push(new gt("metadata","customMetadata",!0)),_o=e,_o}function Zu(e,t){function n(){const o=e.bucket,r=e.fullPath,s=new yt(o,r);return t._makeStorageReference(s)}Object.defineProperty(e,"ref",{get:n})}function Ju(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 Zu(o,e),o}function ki(e,t,n){const o=$i(t);return o===null?null:Ju(e,o,n)}function Qu(e,t,n,o){const r=$i(t);if(r===null||!Mr(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,u="/b/"+i(_)+"/o/"+i(g),f=uo(u,n,o),h=wi({alt:"media",token:d});return f+h})[0]}function ef(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 Tr{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 Ni(e){if(!e)throw kr()}function tf(e,t){function n(o,r){const s=ki(e,r,t);return Ni(s!==null),s}return n}function nf(e,t){function n(o,r){const s=ki(e,r,t);return Ni(s!==null),Qu(s,r,e.host,e._protocol)}return n}function Mi(e){function t(n,o){let r;return n.getStatus()===401?n.getErrorText().includes("Firebase App Check token is invalid")?r=pu():r=hu():n.getStatus()===402?r=gu(e.bucket):n.getStatus()===403?r=mu(e.path):r=o,r.status=n.getStatus(),r.serverResponse=o.serverResponse,r}return t}function Ai(e){const t=Mi(e);function n(o,r){let s=t(o,r);return o.getStatus()===404&&(s=_u(e.path)),s.serverResponse=r.serverResponse,s}return n}function of(e,t,n){const o=t.fullServerUrl(),r=uo(o,e.host,e._protocol),s="GET",i=e.maxOperationRetryTime,l=new Tr(r,s,nf(e,n),i);return l.errorHandler=Ai(t),l}function rf(e,t){const n=t.fullServerUrl(),o=uo(n,e.host,e._protocol),r="DELETE",s=e.maxOperationRetryTime;function i(c,d){}const l=new Tr(o,r,i,s);return l.successCodes=[200,204],l.errorHandler=Ai(t),l}function sf(e,t){return e&&e.contentType||t&&t.type()||"application/octet-stream"}function af(e,t,n){const o=Object.assign({},n);return o.fullPath=e.path,o.size=t.size(),o.contentType||(o.contentType=sf(null,t)),o}function lf(e,t,n,o,r){const s=t.bucketOnlyServerUrl(),i={"X-Goog-Upload-Protocol":"multipart"};function l(){let x="";for(let $=0;$<2;$++)x=x+Math.random().toString().slice(2);return x}const c=l();i["Content-Type"]="multipart/related; boundary="+c;const d=af(t,o,r),_=ef(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
|
+
`,u=`\r
|
|
609
|
+
--`+c+"--",f=Yt.getBlob(g,o,u);if(f===null)throw xu();const h={name:d.fullPath},p=uo(s,e.host,e._protocol),m="POST",w=e.maxUploadRetryTime,y=new Tr(p,m,tf(e,n),w);return y.urlParams=h,y.headers=i,y.body=f.uploadData(),y.errorHandler=Mi(t),y}class cf{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=dn.NO_ERROR,this.sendPromise_=new Promise(t=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=dn.ABORT,t()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=dn.NETWORK_ERROR,t()}),this.xhr_.addEventListener("load",()=>{t()})})}send(t,n,o,r,s){if(this.sent_)throw jn("cannot .send() more than once");if(hr(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 jn("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw jn("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw jn("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw jn("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 df extends cf{initXhr(){this.xhr_.responseType="text"}}function Fr(){return new df}/**
|
|
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 un{constructor(t,n){this._service=t,n instanceof yt?this._location=n:this._location=yt.makeFromUrl(n,t.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(t,n){return new un(t,n)}get root(){const t=new yt(this._location.bucket,"");return this._newRef(this._service,t)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return Ei(this._location.path)}get storage(){return this._service}get parent(){const t=Gu(this._location.path);if(t===null)return null;const n=new yt(this._location.bucket,t);return new un(this._service,n)}_throwIfRoot(t){if(this._location.path==="")throw Eu(t)}}function uf(e,t,n){e._throwIfRoot("uploadBytes");const o=lf(e.storage,e._location,Ii(),new Yt(t,!0),n);return e.storage.makeRequestWithTokens(o,Fr).then(r=>({metadata:r,ref:e}))}function ff(e,t,n=Nt.RAW,o){e._throwIfRoot("uploadString");const r=yi(n,t),s={...o};return s.contentType==null&&r.contentType!=null&&(s.contentType=r.contentType),uf(e,r.data,s)}function _f(e){e._throwIfRoot("getDownloadURL");const t=of(e.storage,e._location,Ii());return e.storage.makeRequestWithTokens(t,Fr).then(n=>{if(n===null)throw Su();return n})}function gf(e){e._throwIfRoot("deleteObject");const t=rf(e.storage,e._location);return e.storage.makeRequestWithTokens(t,Fr)}function hf(e,t){const n=Ku(e._location.path,t),o=new yt(e._location.bucket,n);return new un(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 pf(e){return/^[A-Za-z]+:\/\//.test(e)}function mf(e,t){return new un(e,t)}function Di(e,t){if(e instanceof Pr){const n=e;if(n._bucket==null)throw Cu();const o=new un(n,n._bucket);return t!=null?Di(o,t):o}else return t!==void 0?hf(e,t):e}function vf(e,t){if(t&&pf(t)){if(e instanceof Pr)return mf(e,t);throw Nr("To use ref(service, url), the first argument must be a Storage instance.")}else return Di(e,t)}function Ti(e,t){const n=t?.[pi];return n==null?null:yt.makeFromBucketSpec(n,e)}function bf(e,t,n,o={}){e.host=`${t}:${n}`;const r=hr(t);r&&(jc(`https://${e.host}/b`),Uc("Storage",!0)),e._isUsingEmulator=!0,e._protocol=r?"https":"http";const{mockUserToken:s}=o;s&&(e._overrideAuthToken=typeof s=="string"?s:qc(s,e.app.options.projectId))}class Pr{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=hi,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=uu,this._maxUploadRetryTime=fu,this._requests=new Set,r!=null?this._bucket=yt.makeFromBucketSpec(r,this._host):this._bucket=Ti(this._host,this.app.options)}get host(){return this._host}set host(t){this._host=t,this._url!=null?this._bucket=yt.makeFromBucketSpec(this._url,t):this._bucket=Ti(t,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(t){bi("time",0,Number.POSITIVE_INFINITY,t),this._maxUploadRetryTime=t}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(t){bi("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(Yd(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 un(this,t)}_makeRequest(t,n,o,r,s=!0){if(this._deleted)return new Iu(mi());{const i=zu(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 Fi="@firebase/storage",Pi="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 Li="storage";function wf(e,t,n,o){return e=Ln(e),ff(e,t,n,o)}function yf(e){return e=Ln(e),_f(e)}function Cf(e){return e=Ln(e),gf(e)}function Oi(e,t){return e=Ln(e),vf(e,t)}function zi(e=eu(),t){e=Ln(e);const o=Kd(e,Li).getImmediate({identifier:t}),r=Bc("storage");return r&&xf(o,...r),o}function xf(e,t,n,o={}){bf(e,t,n,o)}function Sf(e,{instanceIdentifier:t}){const n=e.getProvider("app").getImmediate(),o=e.getProvider("auth-internal"),r=e.getProvider("app-check-internal");return new Pr(n,o,r,t,Jd)}function $f(){co(new On(Li,Sf,"PUBLIC").setMultipleInstances(!0)),zn(Fi,Pi,""),zn(Fi,Pi,"esm2020")}$f();function Ef(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Array(12).fill(0);let Lr=1;class If{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:o,...r}=t,s=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Lr++,i=this.toasts.find(c=>c.id===s),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...t,id:s,title:o}),{...c,...t,id:s,dismissible:l,title:o}):c):this.addToast({title:o,...r,dismissible:l,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(o=>o({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let o;n.loading!==void 0&&(o=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(t instanceof Function?t():t);let s=o!==void 0,i;const l=r.then(async d=>{if(i=["resolve",d],I.default.isValidElement(d))s=!1,this.create({id:o,type:"default",message:d});else if(Nf(d)&&!d.ok){s=!1;const g=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,u=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,h=typeof g=="object"&&!I.default.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:u,...h})}else if(d instanceof Error){s=!1;const g=typeof n.error=="function"?await n.error(d):n.error,u=typeof n.description=="function"?await n.description(d):n.description,h=typeof g=="object"&&!I.default.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:u,...h})}else if(n.success!==void 0){s=!1;const g=typeof n.success=="function"?await n.success(d):n.success,u=typeof n.description=="function"?await n.description(d):n.description,h=typeof g=="object"&&!I.default.isValidElement(g)?g:{message:g};this.create({id:o,type:"success",description:u,...h})}}).catch(async d=>{if(i=["reject",d],n.error!==void 0){s=!1;const _=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,f=typeof _=="object"&&!I.default.isValidElement(_)?_:{message:_};this.create({id:o,type:"error",description:g,...f})}}).finally(()=>{s&&(this.dismiss(o),o=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,_)=>l.then(()=>i[0]==="reject"?_(i[1]):d(i[1])).catch(_));return typeof o!="string"&&typeof o!="number"?{unwrap:c}:Object.assign(o,{unwrap:c})},this.custom=(t,n)=>{const o=n?.id||Lr++;return this.create({jsx:t(o),id:o,...n}),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Et=new If,kf=(e,t)=>{const n=t?.id||Lr++;return Et.addToast({title:e,...t,id:n}),n},Nf=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Mf=kf,Af=()=>Et.toasts,Df=()=>Et.getActiveToasts(),go=Object.assign(Mf,{success:Et.success,info:Et.info,warning:Et.warning,error:Et.error,custom:Et.custom,message:Et.message,promise:Et.promise,dismiss:Et.dismiss,loading:Et.loading},{getHistory:Af,getToasts:Df});Ef("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");const Mt={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"},Tf=()=>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"})}),Bi=({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:u})=>{const f=!!u,h=v.useMemo(()=>{if(!_)return;const w=_,y=`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":y,"--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=[Mt.badge,Mt[`size_${n}`],Mt[`radius_${o}`],Mt[`variant_${e}`],!_&&Mt[`color_${t}`],_&&Mt.badge_custom,f&&Mt.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:p,style:h,onClick:u,role:f?"button":void 0,tabIndex:f?0:void 0,children:[l&&a.jsx("span",{className:Mt.dot,style:{backgroundColor:m}}),s&&a.jsx("span",{className:Mt.icon,children:s}),r,i&&a.jsx("span",{className:Mt.icon,children:i}),c&&a.jsx("button",{type:"button",className:Mt.dismiss_button,onClick:w=>{w.stopPropagation(),d?.()},"aria-label":"Eliminar badge",children:a.jsx(Tf,{})})]})},je={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"},Or=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:u=!1,showIcons:f=!1,labelPlacement:h="right",labelPosition:p="inline",justifyEnd:m=!1,children:w,className:y="",...x},$)=>{const[A,F]=v.useState(t),N=v.useId(),P=x.id||N,T=e!==void 0?e:A,k=D=>{if(d||_)return;const C=D.target.checked;e===void 0&&F(C),n&&n(C)},z=w||o,B=[je.contenedor_toggle,je[`tam_${s}`],!l&&je[`color_${i}`],je[`variante_${c}`],je[`label_${h}`],je[`posicion_${p}`],T&&je.seleccionado,d&&je.deshabilitado,_&&je.solo_lectura,g&&je.invalido,f&&je.con_iconos,m&&je.justify_end,y].filter(Boolean).join(" "),E=l?{"--toggle-custom-color":l}:void 0,b=()=>z?a.jsxs("div",{className:je.contenedor_label,children:[a.jsxs("span",{className:je.texto_label,children:[z,u&&a.jsx("span",{className:je.marca_requerido,children:" *"})]}),r&&a.jsx("span",{className:je.texto_descripcion,children:r})]}):null,S=()=>c!=="moon"?null:a.jsx("div",{className:je.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=()=>!f||c==="moon"?null:a.jsxs(a.Fragment,{children:[a.jsx("svg",{className:je.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:je.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:B,style:E,children:[p==="top"&&b(),a.jsxs("label",{className:je.envoltorio_toggle,htmlFor:P,children:[p==="inline"&&h==="left"&&b(),a.jsxs("div",{className:je.pista_toggle,children:[a.jsx("input",{ref:$,type:"checkbox",id:P,checked:T,disabled:d,readOnly:_,required:u,"aria-invalid":g,className:je.input,onChange:k,...x}),a.jsx("div",{className:je.fondo_pista,children:a.jsxs("div",{className:je.pulgar_toggle,children:[S(),O()]})})]}),p==="inline"&&h==="right"&&b()]})]})});Or.displayName="Toggle";const Ff=({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"})}),Vi=({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"})}),Pf=({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"})}),Lf=({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"})}),Of=({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"})}),zf=({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"})]}),Bf=({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"})]}),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"},Vf=8,jf=1.2,fn=4.2,qf=1.8,ji=(e,t,n)=>Math.max(t,Math.min(n,e)),Hf=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)},qi=e=>Number.isFinite(e)?e:performance.now(),Rf=()=>{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),u=v.useRef(fn),f=v.useRef(!1),h=v.useCallback(()=>e.current?.getContext("2d")??null,[]),p=v.useCallback(()=>h(),[h]),m=v.useCallback(()=>{const E=e.current,b=h();E&&b&&b.clearRect(0,0,E.width,E.height),n(!0),l.current=[],i([]),_.current=[],d.current=null,u.current=fn,f.current=!1},[h]),w=v.useCallback(()=>{f.current=!0,n(!1)},[]),y=v.useCallback((E,b)=>{const S=Math.max(1,b.t-E.t),D=Hf(E,b)/S,M=(fn-D*qf)*ji(b.pressure||.5,.35,1),L=ji(M,jf,fn),H=u.current+(L-u.current)*.25;return u.current=H,H},[]),x=v.useCallback((E,b)=>{E.strokeStyle=c.current.color,E.lineWidth=b,E.lineCap="round",E.lineJoin="round"},[]),$=v.useCallback((E,b)=>{const S=p();if(!S)return;const O=y(E,b);x(S,O),S.beginPath(),S.moveTo(E.x,E.y),S.quadraticCurveTo(E.x,E.y,b.x,b.y),S.stroke(),n(!1)},[y,p,x]),A=v.useCallback(E=>{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:E.pressure&&E.pressure>0?E.pressure:.5,t:E.timeStamp||performance.now(),x:(E.clientX-S.left)*O,y:(E.clientY-S.top)*D}},[]),F=v.useCallback(E=>{if(!c.current.enabled)return;E.preventDefault();const b=e.current;if(!b)return;b.setPointerCapture(E.pointerId);const S=A(E);r(!0),d.current=S,_.current=[S],g.current=qi(E.timeStamp)},[A]),N=v.useCallback(E=>{if(!o||!c.current.enabled)return;E.preventDefault();const b=qi(E.timeStamp);if(b-g.current<Vf)return;g.current=b;const S=A(E),O=d.current;O&&($(O,S),d.current=S,_.current.push(S))},[$,o,A]),P=v.useCallback(E=>{if(E&&e.current?.hasPointerCapture(E.pointerId)&&e.current.releasePointerCapture(E.pointerId),o&&_.current.length>0){const b=[...l.current,{puntos:[..._.current]}];l.current=b,i(b)}r(!1),d.current=null,_.current=[]},[o]),T=v.useCallback((E,b,S)=>{if(!(b.puntos.length<2))for(let O=1;O<b.puntos.length;O++){const D=b.puntos[O-1],C=b.puntos[O],M=y(D,C);E.strokeStyle=S??c.current.color,E.lineWidth=M,E.lineCap="round",E.lineJoin="round",E.beginPath(),E.moveTo(D.x,D.y),E.quadraticCurveTo(D.x,D.y,C.x,C.y),E.stroke()}},[y]),k=v.useCallback(()=>{if(l.current.length===0)return;const E=l.current.slice(0,-1);l.current=E,i(E);const b=e.current;if(!b)return;const S=h();S&&(S.clearRect(0,0,b.width,b.height),u.current=fn,E.forEach(O=>T(S,O)),n(E.length===0&&!f.current))},[h,T]),z=v.useCallback((E={})=>{const b=e.current;if(!b||t&&l.current.length===0&&!f.current)return null;const{backgroundColor:S,format:O,quality:D,strokeColor:C}=E;if(!S&&!C)return b.toDataURL("image/png");const M=document.createElement("canvas");M.width=b.width,M.height=b.height;const L=M.getContext("2d");if(!L)return null;S&&(L.fillStyle=S,L.fillRect(0,0,M.width,M.height)),C&&l.current.length>0&&!f.current?(u.current=fn,l.current.forEach(j=>T(L,j,C))):L.drawImage(b,0,0);const q=O??"image/png",H=D??.85;return q==="image/png"?M.toDataURL(q):M.toDataURL(q,H)},[t,T]),B=v.useCallback(E=>{const b=e.current,S=h();if(!b||!S)return;if(c.current={color:E.color,enabled:E.enabled??!0},b.style.touchAction="none",b.style.userSelect="none",!c.current.enabled)return()=>{};const O=L=>F(L),D=L=>N(L),C=L=>P(L),M=L=>P(L);return b.addEventListener("pointerdown",O,{passive:!1}),b.addEventListener("pointermove",D,{passive:!1}),b.addEventListener("pointerup",C,{passive:!1}),b.addEventListener("pointerleave",C,{passive:!1}),b.addEventListener("pointercancel",M,{passive:!1}),()=>{b.removeEventListener("pointerdown",O),b.removeEventListener("pointermove",D),b.removeEventListener("pointerup",C),b.removeEventListener("pointerleave",C),b.removeEventListener("pointercancel",M)}},[P,F,N,h]);return v.useEffect(()=>{u.current=fn},[s.length]),{canvasRef:e,configurarCanvas:B,deshacerUltimoTrazo:k,estaVacio:t,limpiarCanvas:m,marcarConContenido:w,obtenerDatosFirma:z,puedeDeshacer:s.length>0}},Hi=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:u=!1,readonlyPostGuardado:f=!1,requiredMessage:h="Se debe registrar una firma para continuar",textoAdjuntar:p="Adjuntar firma",textoConsentimiento:m="Al firmar, confirmo que he leído y acepto todos los términos contractuales",textoDeshacer:w="Deshacer",textoEliminarFirma:y="Eliminar firma",textoEstadoGuardada:x="Guardada",textoEstadoPendiente:$="Pendiente",textoGuardar:A="Guardar firma",textoLimpiar:F="Limpiar",textoModificar:N="Modificar firma",textoReemplazarFirma:P="Reemplazar firma",textoSolicitarFirma:T="Agregar firma",tituloBloque:k="Firma del responsable",titulo:z="Firmar el contrato",mostrarBotonAgregarFirma:B=!0,mostrarBotonEliminarFirma:E=!0,firebasePath:b,onFirebaseUploadSuccess:S,onFirebaseUploadError:O},D)=>{const{canvasRef:C,configurarCanvas:M,deshacerUltimoTrazo:L,estaVacio:q,limpiarCanvas:H,marcarConContenido:j,obtenerDatosFirma:J,puedeDeshacer:G}=Rf(),me=v.useRef(null),de=v.useRef(null),se=v.useRef(null),_e=v.useId(),ge=`${_e}-toggle`,$e=`${_e}-texto`,X=`${_e}-dialog-title`,oe=`${_e}-dialog-description`,[K,ye]=v.useState(!!i),[le,Q]=v.useState(!1),[ne,xe]=v.useState(s),[ce,Ee]=v.useState(t),[U,V]=v.useState(!1),[R,ue]=v.useState(!!s),[he,pe]=v.useState(!1),[Ne,Re]=v.useState(!1),tt=Math.round(ce*e/Math.max(1,t)),we=u||f&&R,Je=!u&&!(f&&R),nt=v.useCallback(fe=>{const be=C.current,$t=be?.getContext("2d");if(!be||!$t)return;const lt=new Image;lt.onload=()=>{$t.clearRect(0,0,be.width,be.height);const kt=be.width/be.height,wn=lt.width/lt.height;let an=be.width,io=be.height,dr=0,ur=0;wn>kt?(io=be.width/wn,ur=(be.height-io)/2):(an=be.height*wn,dr=(be.width-an)/2),$t.drawImage(lt,dr,ur,an,io),j(),pe(!0)},lt.src=fe},[C,j]),ve=v.useCallback(async()=>{if(!(we||Ne)){if(b&&ne){Re(!0);try{const fe=zi(),be=Oi(fe,`${b}/firma.png`);await Cf(be),go.success("Se eliminó la firma correctamente")}catch(fe){console.error("Error deleting signature from Firebase:",fe),go.error("Ocurrió un error al eliminar la firma del servidor")}finally{Re(!1)}}H(),xe(null),pe(!1),ue(!1)}},[we,Ne,b,ne,H]),Ce=v.useCallback(()=>{u||Ne||(H(),ue(!1),pe(!1),V(!1))},[Ne,H,u]),Ue=v.useCallback(fe=>{if(we)return;const be=fe.target.files?.[0];if(!be)return;const $t=new FileReader;$t.onload=lt=>{const kt=lt.target?.result;typeof kt=="string"&&(H(),nt(kt))},$t.readAsDataURL(be)},[we,nt,H]),Te=v.useCallback(()=>{we||me.current?.click()},[we]),ot=v.useCallback(()=>{V(!1),pe(!1),H()},[H]),ee=v.useCallback(fe=>{le||(Q(!0),setTimeout(()=>{ye(!1),Q(!1),fe?.()},650))},[le]),Ie=v.useCallback(()=>{ee(()=>{ot(),_?.()})},[ee,ot,_]),Be=v.useCallback(async()=>{if(we||le||Ne)return;const fe=he?"image/png":"image/jpeg",be=J({backgroundColor:"#ffffff",format:fe,quality:.82,strokeColor:"#111827"});if(!be||!U)return;let $t=be;if(b){Re(!0);try{const lt=zi(),kt=Oi(lt,`${b}/firma.png`),wn=be.split(",")[1],an=await wf(kt,wn,"base64",{contentType:fe,customMetadata:{uploadedAt:new Date().toISOString()}});$t=await yf(an.ref),S?.($t),go.success("Firma cargada exitosamente")}catch(lt){const kt=lt instanceof Error?lt:new Error(String(lt));console.error("Error uploading signature to Firebase:",kt),O?.(kt),go.error(kt.message||"Error al cargar la firma"),Re(!1);return}finally{Re(!1)}}ee(()=>{xe($t),ue(!0),g?.($t),ot(),_?.()})},[U,we,ee,Ne,b,he,le,ot,J,_,g,O,S]);v.useEffect(()=>{i&&(ye(!0),Q(!1))},[i]),v.useEffect(()=>{xe(s),ue(!!s)},[s]),v.useEffect(()=>{if(!K)return;const fe=()=>{const be=se.current;be&&Ee(Math.max(1,Math.floor(be.clientWidth)))};return fe(),window.addEventListener("resize",fe),()=>window.removeEventListener("resize",fe)},[t,K]),v.useImperativeHandle(D,()=>({limpiar:H,obtenerDatosFirma:J,estaVacio:()=>q}),[q,H,J]),v.useEffect(()=>{if(!K)return;const fe=M({color:"#111827",enabled:!we});return()=>{fe?.()}},[we,M,K]),v.useEffect(()=>{if(!K){document.body.style.overflow="";return}const fe=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",fe>0&&(document.body.style.paddingRight=`${fe}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[K]),v.useEffect(()=>{K||ot()},[ot,K]),v.useEffect(()=>{if(!K)return;const fe=be=>{if(be.key==="Escape"){Ie();return}if(be.ctrlKey&&be.key.toLowerCase()==="z"){be.preventDefault(),!we&&G&&L();return}be.ctrlKey&&be.key==="Enter"&&(be.preventDefault(),we||Be())};return document.addEventListener("keydown",fe),()=>document.removeEventListener("keydown",fe)},[we,L,Ie,Be,K,G]),v.useEffect(()=>{const fe=de.current;if(!fe)return;if(l&&!!!ne){fe.setCustomValidity(h);return}fe.setCustomValidity("")},[ne,l,h]);const Pe=v.useCallback(fe=>{le||!r||fe.target===fe.currentTarget&&Ie()},[r,le,Ie]),pt=we||Ne,wt=we||he||Ne,mt=we||Ne||!R&&(q&&!he||!U),Pt=()=>{u||Ne||(ne&&Ce(),Q(!1),ye(!0))};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${re.bloque_firma} ${o||""}`,children:[a.jsxs("div",{className:re.bloque_encabezado,children:[a.jsxs("span",{className:re.bloque_titulo,children:[k,l&&a.jsx("span",{className:re.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsx(Bi,{color:ne?"success":"warning",size:"sm",variant:"outline",children:Ne?"Procesando...":ne?x:$})]}),a.jsxs("div",{className:re.bloque_preview,style:n?{aspectRatio:n}:void 0,children:[(l||d)&&a.jsx("input",{ref:de,className:re.input_validacion_firma,"aria-hidden":"true",name:d,required:l,tabIndex:-1,type:"text",value:ne?"signed":"",onChange:()=>{},onInvalid:fe=>{l&&!ne&&fe.currentTarget.setCustomValidity(h)},onInput:fe=>{fe.currentTarget.setCustomValidity("")}}),ne?a.jsx("img",{src:ne,alt:"Firma guardada",className:re.bloque_preview_imagen}):a.jsx("span",{className:re.bloque_preview_placeholder,children:"Sin firma registrada"})]}),!u&&(B||E&&!!ne)&&a.jsxs("div",{className:re.bloque_acciones,children:[B&&a.jsx(ct,{color:"primary",size:"sm",variant:"solid",onClick:Pt,className:re.accion_agregar_firma,isDisabled:le||Ne,children:a.jsxs("span",{className:re.boton_texto_con_icono,children:[ne?a.jsx(Of,{className:re.icono_boton_accion}):a.jsx(zf,{className:re.icono_boton_accion}),a.jsx("span",{className:re.accion_texto,children:ne?P:T})]})}),E&&ne&&a.jsx(ct,{color:"default",size:"sm",variant:"bordered",onClick:ve,className:re.accion_eliminar_firma,isDisabled:le||Ne,children:a.jsxs("span",{className:re.boton_texto_con_icono,children:[a.jsx(Vi,{className:re.icono_boton_accion}),a.jsx("span",{className:re.accion_texto,children:y})]})})]})]}),K&&a.jsx("div",{className:`${re.backdrop} ${le?"":re.visible}`,onClick:Pe,children:a.jsxs("div",{className:`${re.modal} ${le?"":re.visible}`,role:"dialog","aria-modal":"true","aria-labelledby":X,"aria-describedby":oe,children:[a.jsxs("header",{className:re.encabezado,children:[a.jsx("h2",{id:X,className:re.titulo,children:z}),a.jsxs("button",{className:re.boton_cerrar,onClick:Ie,type:"button","aria-label":"Cerrar",children:[a.jsx("span",{className:re.texto_esc,children:"ESC"}),a.jsx(Ff,{className:re.icono_x})]})]}),a.jsxs("div",{className:re.cuerpo_modal,children:[a.jsx("div",{className:re.contenedor_lienzo,ref:se,children:a.jsxs("div",{className:re.area_firma,children:[a.jsx("div",{className:re.superficie_lienzo,children:a.jsx("canvas",{ref:C,className:`${re.lienzo} ${pt?re.lienzo_deshabilitado:""}`,width:ce,height:tt,style:{height:`${tt}px`,pointerEvents:wt?"none":"auto",width:"100%"},"aria-label":"Area de firma"})}),Je&&a.jsxs("div",{className:re.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[a.jsxs("div",{className:re.grupo_izquierda,children:[a.jsxs("button",{className:re.boton_accion,onClick:L,type:"button",disabled:!G||pt,"aria-label":w,children:[a.jsx(Pf,{className:re.icono,"aria-hidden":"true"}),a.jsx("span",{children:w})]}),a.jsx("span",{className:re.separador,"aria-hidden":"true",children:"|"}),a.jsxs("button",{className:re.boton_accion,onClick:ve,type:"button",disabled:q&&!he||pt,"aria-label":F,children:[a.jsx(Vi,{className:re.icono,"aria-hidden":"true"}),a.jsx("span",{children:F})]})]}),c&&a.jsx("div",{className:re.grupo_derecha,children:a.jsxs("button",{className:re.boton_adjuntar,onClick:Te,type:"button",disabled:we,children:[a.jsx(Lf,{className:re.icono,"aria-hidden":"true"}),p]})})]})]})}),Je&&a.jsxs(a.Fragment,{children:[a.jsx("div",{id:oe,className:re.contenedor_consentimiento,children:a.jsxs("div",{className:re.consentimiento_fila,children:[a.jsx(Or,{id:ge,isSelected:U,onChange:V,color:"primary",size:"md",isDisabled:we,"aria-describedby":$e,className:re.toggle_consentimiento}),a.jsx("label",{htmlFor:ge,id:$e,className:re.texto_consentimiento,children:m})]})}),a.jsx("div",{className:re.contenedor_guardar,children:a.jsx(ct,{color:"primary",variant:"solid",radius:"full",size:"md",onClick:R&&!f?Ce:Be,type:"button",isDisabled:mt,isLoading:Ne,startContent:!Ne&&a.jsx(Bf,{className:re.icono,"aria-hidden":"true"}),children:R&&!f?N:A})})]}),Je&&c&&a.jsx("div",{className:re.contenedor_subir_oculto,children:a.jsx("input",{ref:me,type:"file",accept:"image/*",className:re.input_archivo,onChange:Ue,"aria-label":"Subir imagen de firma"})})]})]})})]})});Hi.displayName="Signature";const Uf="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let ho=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Uf[n[e]&63];return t};const Wf=({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"})]}),Gf=({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"})]}),Kf=({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"})]}),qe={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"},Ri=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:u,description:f,errorMessage:h,startContent:p,endContent:m,isRequired:w=!1,isReadOnly:y=!1,isDisabled:x=!1,isClearable:$=!1,isInvalid:A,validationState:F,validate:N,className:P,classNames:T,style:k,onChange:z,onClear:B,onValueChange:E,onFocus:b,onBlur:S,onKeyDown:O,id:D,name:C,autoComplete:M,autoFocus:L,maxLength:q,minLength:H,pattern:j,...J}=e,G=v.useRef(null),de=v.useRef(D??`input-text-${ho(8)}`).current;v.useImperativeHandle(t,()=>G.current);const se=o!==void 0,[_e,ge]=v.useState(r??""),$e=se?o:_e,[X,oe]=v.useState(!1),[K,ye]=v.useState(!1),le=v.useMemo(()=>{if(!N)return null;const Ce=N($e);return Ce===!0||Ce==null?null:typeof Ce=="string"?Ce:typeof Ce=="object"&&"message"in Ce?Ce.message??"Entrada inválida":"Entrada inválida"},[$e,N]),Q=v.useMemo(()=>A!==void 0?A:F==="invalid"?!0:F==="valid"?!1:!!le,[A,F,le]),ne=F==="valid"&&!Q,xe={invalido:Q,mensaje:le},ce=$e.length>0,Ee=n==="password",U=Ee&&K?"text":n,V=$&&ce&&!y&&!x,R=v.useCallback(Ce=>{if(x||y)return;const Ue=Ce.target.value;se||ge(Ue),z?.(Ue),E?.(Ue)},[se,x,y,z,E]),ue=v.useCallback(Ce=>{oe(!0),b?.(Ce)},[b]),he=v.useCallback(Ce=>{oe(!1),S?.(Ce)},[S]),pe=v.useCallback(()=>{x||y||(se||ge(""),z?.(""),E?.(""),B?.(),G.current?.focus())},[se,x,y,z,E,B]),Ne=v.useCallback(Ce=>{Ce.key==="Escape"&&$&&ce&&pe(),O?.(Ce)},[$,ce,pe,O]),Re=v.useCallback(()=>{ye(Ce=>!Ce),requestAnimationFrame(()=>G.current?.focus())},[]),tt=f?`${de}-desc`:void 0,we=Q?`${de}-err`:void 0,Je=[tt,we].filter(Boolean).join(" ")||void 0,nt=typeof h=="function"?h(xe):h??le,ve=W(qe.contenedor_base,qe[`variante_${i}`],qe[`tam_${c}`],qe[`radio_${d}`],qe[`color_${l}`],{[qe.ancho_total]:_,[qe.sin_animacion]:g,[qe.deshabilitado]:x,[qe.solo_lectura]:y,[qe.invalido]:Q,[qe.valido]:ne,[qe.enfocado]:X,[qe.tiene_contenido]:ce},P,T?.base);return a.jsxs("div",{className:ve,style:k,children:[u&&a.jsxs("label",{className:W(qe.etiqueta,T?.label),htmlFor:de,children:[u,w&&a.jsx("span",{className:qe.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:W(qe.envoltorio_input,T?.inputWrapper),children:[p&&a.jsx("span",{className:qe.contenido_inicio,children:p}),a.jsx("div",{className:W(qe.envoltorio_interno,T?.innerWrapper),children:a.jsx("input",{...J,ref:G,id:de,name:C,type:U,value:se?$e:void 0,defaultValue:se?void 0:r,placeholder:s,disabled:x,readOnly:y,required:w,autoComplete:M,autoFocus:L,maxLength:q,minLength:H,pattern:j,"aria-invalid":Q||void 0,"aria-describedby":Je,"aria-required":w,className:W(qe.entrada,T?.input),onChange:R,onFocus:ue,onBlur:he,onKeyDown:Ne})}),V&&a.jsx("button",{type:"button",className:W(qe.boton_limpiar,T?.clearButton),onClick:pe,tabIndex:-1,"aria-label":"Limpiar campo",children:a.jsx(Wf,{size:"0.75em"})}),Ee&&a.jsx("button",{type:"button",className:qe.boton_password,onClick:Re,tabIndex:-1,"aria-label":K?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":K,children:K?a.jsx(Kf,{}):a.jsx(Gf,{})}),m&&a.jsx("span",{className:qe.contenido_final,children:m})]}),f&&!Q&&a.jsx("div",{id:tt,className:W(qe.descripcion,T?.description),children:f}),Q&&nt&&a.jsx("div",{id:we,className:W(qe.mensaje_error,T?.errorMessage),role:"alert",children:nt})]})});Ri.displayName="InputText";function po(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qn(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 f=typeof n=="string"?n:",";g=d.replace(/\B(?=(\d{3})+(?!\d))/g,f)}let u=g;return _!==void 0?u+=o+_:s&&r&&r>0&&(u+=o+"0".repeat(r)),`${i}${u}${l}`}function Ui(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(`^${po(r)}`),"")),s&&(l=l.replace(new RegExp(`${po(s)}$`),"")),n){const d=typeof n=="string"?n:",";l=l.replace(new RegExp(po(d),"g"),"")}o!=="."&&(l=l.replace(new RegExp(po(o)),".")),i||(l=l.replace(/-/g,""));const c=parseFloat(l);return Number.isNaN(c)?void 0:c}function mo(e,t,n){let o=e;return t!==void 0&&o<t&&(o=t),n!==void 0&&o>n&&(o=n),o}function Wi(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 Gi(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}const Yf=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"})]}),Xf=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"})}),He={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"},Ki=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:u,errorMessage:f,startContent:h,endContent:p,isRequired:m=!1,isReadOnly:w=!1,isDisabled:y=!1,isInvalid:x,validationState:$,validate:A,className:F,classNames:N,style:P,min:T,max:k,step:z=1,decimalScale:B,fixedDecimalScale:E=!1,thousandSeparator:b=!1,decimalSeparator:S=".",prefix:O="",suffix:D="",allowNegative:C=!0,allowDecimal:M=!0,hideControls:L=!1,clampBehavior:q="blur",onChange:H,onValueChange:j,onFocus:J,onBlur:G,onKeyDown:me,id:de,name:se,..._e}=e,ge=v.useRef(null),X=v.useRef(de??`input-numeric-${ho(8)}`).current;v.useImperativeHandle(t,()=>ge.current);const oe=n!==void 0,[K,ye]=v.useState(o!==void 0?o:void 0),[le,Q]=v.useState(""),[ne,xe]=v.useState(!1),ce=oe?n===""?void 0:n:K,Ee=v.useMemo(()=>({separadorMiles:b,separadorDecimal:S,escalaDecimal:M?B:0,decimalesFijos:E,prefijo:O,sufijo:D,permitirNegativo:C}),[b,S,B,E,O,D,C,M]),U=v.useMemo(()=>{if(!A)return null;const ee=Wi(A(ce));return ee.invalido?ee.mensaje:null},[ce,A]),V=v.useMemo(()=>x!==void 0?x:$==="invalid"?!0:$==="valid"?!1:!!U,[x,$,U]),R=$==="valid"&&!V,ue={invalido:V,mensaje:U},he=v.useCallback(ee=>{oe||ye(ee),H?.(ee),j?.(qn(ee,Ee),ee)},[oe,H,j,Ee]),pe=v.useCallback(ee=>{let Be=(ce??0)+z*ee;q!=="none"&&(Be=mo(Be,T,k)),B!==void 0&&(Be=Gi(Be,B)),he(Be),Q(qn(Be,Ee))},[ce,z,T,k,q,B,he,Ee]),Ne=v.useCallback(ee=>{if(y||w)return;const Ie=ee.target.value,Be=S===","?",":".";let Pe="0-9";M&&(Pe+=Be),C&&(Pe+="-");const pt=new RegExp(`[^${Pe}]`,"g");let mt=Ie.replace(pt,"");if(M){const fe=mt.split(Be);fe.length>2&&(mt=fe[0]+Be+fe.slice(1).join(""))}if(C&&mt.includes("-")){const fe=mt.replace(/-/g,"");mt=mt.startsWith("-")?"-"+fe:fe}Q(mt);const Pt=Ui(mt,Ee);if(q==="strict"&&Pt!==void 0){const fe=mo(Pt,T,k);he(fe)}else he(Pt)},[y,w,Ee,q,T,k,he,S,C,M]),Re=v.useCallback(ee=>{if(xe(!0),ce!==void 0){let Ie=String(ce);S!=="."&&(Ie=Ie.replace(".",S)),Q(Ie)}J?.(ee)},[ce,S,J]),tt=v.useCallback(ee=>{if(xe(!1),q==="blur"&&ce!==void 0){const Ie=mo(ce,T,k);Ie!==ce&&he(Ie)}Q(qn(ce,Ee)),G?.(ee)},[ce,q,T,k,he,Ee,G]),we=v.useCallback(ee=>{ee.key==="ArrowUp"?(ee.preventDefault(),pe(1)):ee.key==="ArrowDown"&&(ee.preventDefault(),pe(-1));const Ie=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],Be=ee.ctrlKey||ee.metaKey,Pe=M&&(ee.key===S||ee.key==="."||ee.key===","),pt=ee.key==="-"&&C,wt=/^[0-9]$/.test(ee.key);!Ie.includes(ee.key)&&!Be&&!Pe&&!pt&&!wt&&ee.preventDefault(),me?.(ee)},[pe,me,S,C,M]);v.useEffect(()=>{ne||Q(qn(ce,Ee))},[ce,ne,Ee]);const Je=u?`${X}-desc`:void 0,nt=V?`${X}-err`:void 0,ve=[Je,nt].filter(Boolean).join(" ")||void 0,Ce=typeof f=="function"?f(ue):f??U,Ue=k===void 0||(ce??0)<k,Te=T===void 0||(ce??0)>T,ot=W(He.contenedor_base,He[`variante_${s}`],He[`tam_${l}`],He[`radio_${c}`],He[`color_${i}`],{[He.ancho_total]:d,[He.sin_animacion]:_,[He.deshabilitado]:y,[He.solo_lectura]:w,[He.invalido]:V,[He.valido]:R,[He.enfocado]:ne},F,N?.base);return a.jsxs("div",{className:ot,style:P,children:[g&&a.jsxs("label",{className:W(He.etiqueta,N?.label),htmlFor:X,children:[g,m&&a.jsx("span",{className:He.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:W(He.envoltorio_input,N?.inputWrapper),children:[a.jsxs("div",{className:W(He.envoltorio_interno,N?.innerWrapper),children:[h&&a.jsx("span",{className:He.contenido_inicio,children:h}),a.jsx("input",{..._e,ref:ge,id:X,name:se,type:"text",inputMode:"decimal",value:le,placeholder:r,disabled:y,readOnly:w,required:m,"aria-invalid":V||void 0,"aria-describedby":ve,"aria-required":m,className:W(He.entrada,N?.input),onChange:Ne,onFocus:Re,onBlur:tt,onKeyDown:we}),p&&a.jsx("span",{className:He.contenido_final,children:p})]}),!L&&!w&&!y&&a.jsxs("div",{className:W(He.controles,N?.controls),children:[a.jsx("button",{type:"button",tabIndex:-1,className:W(He.boton_control,N?.controlButton),disabled:!Te,onClick:()=>pe(-1),"aria-label":"Decrementar valor",children:a.jsx(Xf,{})}),a.jsx("button",{type:"button",tabIndex:-1,className:W(He.boton_control,N?.controlButton),disabled:!Ue,onClick:()=>pe(1),"aria-label":"Incrementar valor",children:a.jsx(Yf,{})})]})]}),u&&!V&&a.jsx("div",{id:Je,className:W(He.descripcion,N?.description),children:u}),V&&Ce&&a.jsx("div",{id:nt,className:W(He.mensaje_error,N?.errorMessage),role:"alert",children:Ce})]})});Ki.displayName="InputNumeric";function Zf(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 zr(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 Jf(){return new Date().toISOString().split("T")[0]}function Qf(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"},e_=()=>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"})]}),t_=()=>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"})]}),n_=()=>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"})]}),o_=({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(e_,{}):a.jsx(t_,{})}),Yi=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:u,description:f,errorMessage:h,startContent:p,isRequired:m=!1,isReadOnly:w=!1,isDisabled:y=!1,isInvalid:x,validationState:$,validate:A,className:F,classNames:N,style:P,min:T,max:k,isClearable:z=!1,onChange:B,onFocus:E,onBlur:b,id:S,name:O,...D}=e,C=v.useRef(null),L=v.useRef(S??`input-date-${ho(8)}`).current;v.useImperativeHandle(t,()=>C.current);const q=o!==void 0,[H,j]=v.useState(r??""),J=q?o:H,[G,me]=v.useState(!1),de=v.useRef(!1),se=v.useMemo(()=>{if(J&&n!=="time"&&(T||k)){if(T&&J<T)return`La fecha debe ser ${n==="date"?zr(T):T} o posterior`;if(k&&J>k)return`La fecha debe ser ${n==="date"?zr(k):k} o anterior`}if(!A)return null;const V=Zf(A(J));return V.invalido?V.mensaje:null},[J,A,T,k,n]),_e=v.useMemo(()=>x!==void 0?x:$==="invalid"?!0:$==="valid"?!1:!!se,[x,$,se]),ge=$==="valid"&&!_e,$e={invalido:_e,mensaje:se},X=v.useCallback(V=>{if(y||w)return;de.current=!1;const R=V.target.value;q||j(R),B?.(R)},[q,y,w,B]),oe=v.useCallback(V=>{me(!0),E?.(V)},[E]),K=v.useCallback(V=>{me(!1),de.current=!1,b?.(V)},[b]),ye=v.useCallback(V=>{V.preventDefault()},[]),le=v.useCallback(V=>{if(V.preventDefault(),V.stopPropagation(),!(!C.current||y||w)){if(de.current){de.current=!1,C.current.blur();return}C.current.focus();try{C.current.showPicker?.(),de.current=!0}catch{}}},[y,w]),Q=v.useCallback(V=>{V.preventDefault(),V.stopPropagation(),de.current=!1,q||j(""),B?.(""),C.current?.focus()},[q,B]),ne=f?`${L}-desc`:void 0,xe=_e?`${L}-err`:void 0,ce=[ne,xe].filter(Boolean).join(" ")||void 0,Ee=typeof h=="function"?h($e):h??se,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]:y,[Ke.solo_lectura]:w,[Ke.invalido]:_e,[Ke.valido]:ge,[Ke.enfocado]:G},F,N?.base);return a.jsxs("div",{className:U,style:P,children:[u&&a.jsxs("label",{className:W(Ke.etiqueta,N?.label),htmlFor:L,children:[u,m&&a.jsx("span",{className:Ke.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsx("div",{className:W(Ke.envoltorio_input,N?.inputWrapper),children:a.jsxs("div",{className:W(Ke.envoltorio_interno,N?.innerWrapper),children:[p&&a.jsx("span",{className:Ke.contenido_inicio,children:p}),a.jsx("input",{...D,ref:C,id:L,name:O,type:n,value:q?J:void 0,defaultValue:q?void 0:r,placeholder:s,disabled:y,readOnly:w,required:m,min:T,max:k,"aria-invalid":_e||void 0,"aria-describedby":ce,"aria-required":m,className:W(Ke.entrada,N?.input),onChange:X,onFocus:oe,onBlur:K}),z&&J&&!y&&!w&&a.jsx("button",{type:"button",tabIndex:-1,className:W(Ke.boton_limpiar,N?.clearButton),onMouseDown:V=>V.preventDefault(),onClick:Q,"aria-label":"Limpiar fecha",children:a.jsx(n_,{})}),a.jsx(o_,{tipo:n,onClick:le,onMouseDown:ye})]})}),f&&!_e&&a.jsx("div",{id:ne,className:W(Ke.descripcion,N?.description),children:f}),_e&&Ee&&a.jsx("div",{id:xe,className:W(Ke.mensaje_error,N?.errorMessage),role:"alert",children:Ee})]})});Yi.displayName="InputDate";const r_={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function vo({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 _=r_[n||"desvanecer"],g=l?`transicion_${_}_${l}`:"";return a.jsx("div",{...r,onAnimationEnd:d,className:`${g} ${o||""}`.trim(),children:t})}const zt={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 Br(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 Vr(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 Xi(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 jr({tipo:e,texto:t,size:n="md",estirar:o}){const r=e==="mic";return a.jsxs("span",{className:W(zt.badge_voz,r?zt.badge_mic:zt.badge_tts,zt[`badge_${n}`],o&&zt.badge_estirada),"data-tipo":e,children:[a.jsx("span",{className:zt.badge_icono,children:r?a.jsx(Br,{}):a.jsx(Vr,{})}),a.jsx("span",{className:zt.badge_texto,children:t}),r?a.jsxs("span",{className:zt.badge_ondas,"aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{})]}):a.jsxs("span",{className:zt.badge_eq,"aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{})]})]})}function Zi({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),u=v.useRef(null),f=v.useRef(null),h=v.useRef(null),p=v.useRef(""),m=typeof window<"u"&&"speechSynthesis"in window,w=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),y=v.useCallback(()=>{h.current&&(clearTimeout(h.current),h.current=null),m&&window.speechSynthesis.cancel(),f.current=null,l(!1)},[m]),x=v.useCallback(()=>{if(!m||!e)return;if(y(),u.current){try{u.current.stop()}catch(N){console.error("Error stopping recognition:",N)}u.current=null,d(!1)}const F=new SpeechSynthesisUtterance(e);F.lang=s,F.onstart=()=>l(!0),F.onend=()=>{l(!1),f.current=null},F.onerror=()=>{l(!1),f.current=null},f.current=F,window.speechSynthesis.speak(F)},[m,e,s,y]),$=v.useCallback(()=>{if(u.current)try{u.current.stop()}catch(F){console.error("Error stopping recognition:",F)}d(!1),g(null)},[]),A=v.useCallback(()=>{if(!w||n||o)return;y();const F=window,N=F.SpeechRecognition||F.webkitSpeechRecognition;if(!N){g("Navegador no compatible");return}try{const P=new N;P.continuous=!0,P.interimResults=!0,P.lang=s,P.onstart=()=>{d(!0),g(null),p.current=e||""},P.onend=()=>{d(!1),u.current=null,r?.()},P.onerror=T=>{T.error!=="no-speech"&&(d(!1),u.current=null,T.error!=="aborted"&&g("Error al reconocer voz"))},P.onresult=T=>{try{let k="";for(let E=0;E<T.results.length;E++)k+=T.results[E][0].transcript;const z=p.current&&k?" ":"",B=p.current+z+k;t(B)}catch{g("Error procesando dictado")}},u.current=P,P.start()}catch{g("No se pudo iniciar dictado"),d(!1)}},[w,n,o,e,t,s,y,r]);return v.useEffect(()=>()=>{h.current&&clearTimeout(h.current),m&&window.speechSynthesis.cancel(),u.current&&u.current.abort()},[m]),{puedeHablar:m,puedeEscuchar:w,hablando:i,escuchando:c,errorDictado:_,escuchar:x,detenerHablar:y,dictar:A,detenerDictado:$}}function s_({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 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"},Ji=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:u,defaultValue:f,placeholder:h,isRequired:p=!1,isReadOnly:m=!1,isDisabled:w=!1,isClearable:y=!1,isInvalid:x,validationState:$,validate:A,minRows:F=4,maxRows:N=10,disableAutosize:P=!1,hideVoiceActions:T=!1,className:k,classNames:z,style:B,onChange:E,onClear:b,onFocus:S,onBlur:O,id:D,name:C,rows:M,...L}=e,q=v.useRef(null),j=v.useRef(D??`textarea-${ho(8)}`).current;v.useImperativeHandle(t,()=>q.current);const J=u!==void 0,[G,me]=v.useState(f??""),de=J?u:G,[se,_e]=v.useState(!1),ge=v.useMemo(()=>{if(!A)return null;const ee=A(de);return ee===!0||ee==null?null:typeof ee=="string"?ee:typeof ee=="object"&&"message"in ee?ee.message??"Entrada inválida":"Entrada inválida"},[de,A]),$e=v.useMemo(()=>x!==void 0?x:$==="invalid"?!0:$==="valid"?!1:!!ge,[x,$,ge]),X=$==="valid"&&!$e,oe={invalido:$e,mensaje:ge},K=de.length>0,ye=v.useCallback(()=>{if(!q.current||P)return;const ee=q.current,Ie=window.getComputedStyle(ee),Be=parseFloat(Ie.lineHeight)||parseFloat(Ie.fontSize)*1.5,Pe=parseFloat(Ie.paddingTop)||0,pt=parseFloat(Ie.paddingBottom)||0,wt=parseFloat(Ie.borderTopWidth)||0,mt=parseFloat(Ie.borderBottomWidth)||0,Pt=F*Be+Pe+pt+wt+mt,fe=N*Be+Pe+pt+wt+mt;ee.style.height="auto";const be=ee.scrollHeight;ee.style.height=`${Math.min(Math.max(be,Pt),fe)}px`},[P,F,N]);v.useEffect(()=>{P||ye()},[de,ye,P]);const le=v.useCallback(ee=>{J||me(ee),E?.(ee)},[J,E]),{puedeHablar:Q,hablando:ne,escuchar:xe,detenerHablar:ce,puedeEscuchar:Ee,escuchando:U,errorDictado:V,dictar:R,detenerDictado:ue}=Zi({isDisabled:w||T,isReadOnly:m,value:de,onChange:le}),he=v.useCallback(ee=>{if(w||m)return;const Ie=ee.target.value;J||me(Ie),E?.(Ie)},[J,w,m,E]),pe=v.useCallback(ee=>{_e(!0),S?.(ee)},[S]),Ne=v.useCallback(ee=>{_e(!1),O?.(ee)},[O]),Re=v.useCallback(()=>{w||m||(J||me(""),E?.(""),b?.(),q.current?.focus())},[J,w,m,E,b]),tt=v.useCallback(()=>{ne?ce():xe()},[ne,xe,ce]),we=v.useCallback(()=>{U?ue():R()},[U,R,ue]),Je=_?`${j}-desc`:void 0,nt=$e||V?`${j}-err`:void 0,ve=[Je,nt].filter(Boolean).join(" ")||void 0,Ce=typeof g=="function"?g(oe):g??ge,Ue=y&&K&&!m&&!w,Te=!T||Ue,ot=W(Le.contenedor_base,Le[`variante_${o}`],Le[`tam_${s}`],Le[`radio_${i}`],Le[`color_${r}`],{[Le.ancho_total]:l,[Le.sin_animacion]:c,[Le.deshabilitado]:w,[Le.solo_lectura]:m,[Le.invalido]:$e,[Le.valido]:X,[Le.enfocado]:se},k,z?.base);return a.jsxs("div",{className:ot,style:B,children:[d&&a.jsxs("label",{className:W(Le.etiqueta,z?.label),htmlFor:j,children:[d,p&&a.jsx("span",{className:Le.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:W(Le.envoltorio_input,z?.inputWrapper),children:[a.jsx("textarea",{...L,ref:q,id:j,name:C,placeholder:h,value:J?de:void 0,defaultValue:J?void 0:f,onChange:he,onFocus:pe,onBlur:Ne,className:W(Le.entrada,P&&Le.sin_autosize,z?.input),readOnly:m,disabled:w,rows:M??F,"aria-invalid":$e||void 0,"aria-describedby":ve,"aria-required":p,required:p}),Te&&a.jsxs("div",{className:W(Le.barra_acciones,z?.actions),children:[a.jsxs("div",{className:Le.badges_contenedor,"aria-live":"polite",role:"status",children:[a.jsx(vo,{mostrar:U,children:a.jsx(jr,{tipo:"mic",texto:"Escuchando...",size:s==="lg"?"md":"sm"})}),a.jsx(vo,{mostrar:ne,children:a.jsx(jr,{tipo:"tts",texto:"Leyendo...",size:s==="lg"?"md":"sm"})})]}),a.jsxs("div",{className:Le.botones_grupo,children:[!T&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:W(Le.boton_accion,ne&&Le.boton_activo_tts),onClick:tt,disabled:!Q||!ne&&(!de||U),title:ne?"Detener lectura":"Leer texto","aria-pressed":ne,"aria-label":ne?"Detener lectura":"Leer texto",children:a.jsx(Vr,{})}),Ee&&a.jsx("button",{type:"button",className:W(Le.boton_accion,U&&Le.boton_activo_mic),onClick:we,disabled:w||m||ne,title:U?"Detener dictado":"Dictar texto","aria-pressed":U,"aria-label":U?"Detener dictado":"Dictar texto",children:U?a.jsx(Xi,{}):a.jsx(Br,{})})]}),Ue&&a.jsx("button",{type:"button",className:Le.boton_limpiar,onClick:Re,title:"Limpiar campo","aria-label":"Limpiar campo",children:a.jsx(s_,{size:"0.75em"})})]})]})]}),_&&!$e&&a.jsx("div",{id:Je,className:W(Le.descripcion,z?.description),children:_}),$e&&Ce||V?a.jsxs("div",{id:nt,className:W(Le.mensaje_error,z?.errorMessage),role:"alert",children:[Ce,Ce&&V&&a.jsx("br",{}),V&&a.jsxs("span",{children:["Error de voz: ",V]})]}):null,n]})});Ji.displayName="TextArea";function bo(){return typeof window<"u"}function Xt(e){return qr(e)?(e.nodeName||"").toLowerCase():"#document"}function bt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Dt(e){var t;return(t=(qr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qr(e){return bo()?e instanceof Node||e instanceof bt(e).Node:!1}function Oe(e){return bo()?e instanceof Element||e instanceof bt(e).Element:!1}function Ye(e){return bo()?e instanceof HTMLElement||e instanceof bt(e).HTMLElement:!1}function wo(e){return!bo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof bt(e).ShadowRoot}const i_=new Set(["inline","contents"]);function Hn(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ct(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!i_.has(r)}const a_=new Set(["table","td","th"]);function l_(e){return a_.has(Xt(e))}const c_=[":popover-open",":modal"];function yo(e){return c_.some(t=>{try{return e.matches(t)}catch{return!1}})}const d_=["transform","translate","scale","rotate","perspective"],u_=["transform","translate","scale","rotate","perspective","filter"],f_=["paint","layout","strict","content"];function Hr(e){const t=Co(),n=Oe(e)?Ct(e):e;return d_.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)||u_.some(o=>(n.willChange||"").includes(o))||f_.some(o=>(n.contain||"").includes(o))}function __(e){let t=Vt(e);for(;Ye(t)&&!Bt(t);){if(Hr(t))return t;if(yo(t))return null;t=Vt(t)}return null}function Co(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const g_=new Set(["html","body","#document"]);function Bt(e){return g_.has(Xt(e))}function Ct(e){return bt(e).getComputedStyle(e)}function xo(e){return Oe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Vt(e){if(Xt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wo(e)&&e.host||Dt(e);return wo(t)?t.host:t}function Qi(e){const t=Vt(e);return Bt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ye(t)&&Hn(t)?t:Qi(t)}function Zt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Qi(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=bt(r);if(s){const l=Rr(i);return t.concat(i,i.visualViewport||[],Hn(r)?r:[],l&&n?Zt(l):[])}return t.concat(r,Zt(r,[],n))}function Rr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Jt=Math.min,xt=Math.max,So=Math.round,Cn=Math.floor,Tt=e=>({x:e,y:e}),h_={left:"right",right:"left",bottom:"top",top:"bottom"},p_={start:"end",end:"start"};function Ur(e,t,n){return xt(e,Jt(t,n))}function xn(e,t){return typeof e=="function"?e(t):e}function Qt(e){return e.split("-")[0]}function Sn(e){return e.split("-")[1]}function ea(e){return e==="x"?"y":"x"}function Wr(e){return e==="y"?"height":"width"}const m_=new Set(["top","bottom"]);function jt(e){return m_.has(Qt(e))?"y":"x"}function Gr(e){return ea(jt(e))}function v_(e,t,n){n===void 0&&(n=!1);const o=Sn(e),r=Gr(e),s=Wr(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=$o(i)),[i,$o(i)]}function b_(e){const t=$o(e);return[Kr(e),t,Kr(t)]}function Kr(e){return e.replace(/start|end/g,t=>p_[t])}const ta=["left","right"],na=["right","left"],w_=["top","bottom"],y_=["bottom","top"];function C_(e,t,n){switch(e){case"top":case"bottom":return n?t?na:ta:t?ta:na;case"left":case"right":return t?w_:y_;default:return[]}}function x_(e,t,n,o){const r=Sn(e);let s=C_(Qt(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(Kr)))),s}function $o(e){return e.replace(/left|right|bottom|top/g,t=>h_[t])}function S_(e){return{top:0,right:0,bottom:0,left:0,...e}}function oa(e){return typeof e!="number"?S_(e):{top:e,right:e,bottom:e,left:e}}function Eo(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}}/*!
|
|
2
655
|
* tabbable 6.3.0
|
|
3
656
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
4
|
-
*/var _l=["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])"],Bn=_l.join(","),oi=typeof Element>"u",tn=oi?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Hn=!oi&&Element.prototype.getRootNode?function(e){var n;return e==null||(n=e.getRootNode)===null||n===void 0?void 0:n.call(e)}:function(e){return e?.ownerDocument},gn=function(n,t){var o;t===void 0&&(t=!0);var r=n==null||(o=n.getAttribute)===null||o===void 0?void 0:o.call(n,"inert"),i=r===""||r==="true",s=i||t&&n&&gn(n.parentNode);return s},gl=function(n){var t,o=n==null||(t=n.getAttribute)===null||t===void 0?void 0:t.call(n,"contenteditable");return o===""||o==="true"},ri=function(n,t,o){if(gn(n))return[];var r=Array.prototype.slice.apply(n.querySelectorAll(Bn));return t&&tn.call(n,Bn)&&r.unshift(n),r=r.filter(o),r},Gn=function(n,t,o){for(var r=[],i=Array.from(n);i.length;){var s=i.shift();if(!gn(s,!1))if(s.tagName==="SLOT"){var l=s.assignedElements(),d=l.length?l:s.children,u=Gn(d,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:s,candidates:u})}else{var f=tn.call(s,Bn);f&&o.filter(s)&&(t||!n.includes(s))&&r.push(s);var p=s.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(s),_=!gn(p,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(s));if(p&&_){var c=Gn(p===!0?s.children:p.children,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:s,candidates:c})}else i.unshift.apply(i,s.children)}}return r},ii=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},si=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||gl(n))&&!ii(n)?0:n.tabIndex},pl=function(n,t){var o=si(n);return o<0&&t&&!ii(n)?0:o},hl=function(n,t){return n.tabIndex===t.tabIndex?n.documentOrder-t.documentOrder:n.tabIndex-t.tabIndex},ai=function(n){return n.tagName==="INPUT"},ml=function(n){return ai(n)&&n.type==="hidden"},vl=function(n){var t=n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(o){return o.tagName==="SUMMARY"});return t},bl=function(n,t){for(var o=0;o<n.length;o++)if(n[o].checked&&n[o].form===t)return n[o]},wl=function(n){if(!n.name)return!0;var t=n.form||Hn(n),o=function(l){return t.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(n.name));else try{r=o(n.name)}catch(s){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",s.message),!1}var i=bl(r,n.form);return!i||i===n},yl=function(n){return ai(n)&&n.type==="radio"},xl=function(n){return yl(n)&&!wl(n)},Cl=function(n){var t,o=n&&Hn(n),r=(t=o)===null||t===void 0?void 0:t.host,i=!1;if(o&&o!==n){var s,l,d;for(i=!!((s=r)!==null&&s!==void 0&&(l=s.ownerDocument)!==null&&l!==void 0&&l.contains(r)||n!=null&&(d=n.ownerDocument)!==null&&d!==void 0&&d.contains(n));!i&&r;){var u,f,p;o=Hn(r),r=(u=o)===null||u===void 0?void 0:u.host,i=!!((f=r)!==null&&f!==void 0&&(p=f.ownerDocument)!==null&&p!==void 0&&p.contains(r))}}return i},li=function(n){var t=n.getBoundingClientRect(),o=t.width,r=t.height;return o===0&&r===0},Sl=function(n,t){var o=t.displayCheck,r=t.getShadowRoot;if(o==="full-native"&&"checkVisibility"in n){var i=n.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(n).visibility==="hidden")return!0;var s=tn.call(n,"details>summary:first-of-type"),l=s?n.parentElement:n;if(tn.call(l,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var d=n;n;){var u=n.parentElement,f=Hn(n);if(u&&!u.shadowRoot&&r(u)===!0)return li(n);n.assignedSlot?n=n.assignedSlot:!u&&f!==n.ownerDocument?n=f.host:n=u}n=d}if(Cl(n))return!n.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return li(n);return!1},$l=function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var t=n.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var o=0;o<t.children.length;o++){var r=t.children.item(o);if(r.tagName==="LEGEND")return tn.call(t,"fieldset[disabled] *")?!0:!r.contains(n)}return!0}t=t.parentElement}return!1},zo=function(n,t){return!(t.disabled||gn(t)||ml(t)||Sl(t,n)||vl(t)||$l(t))},Vo=function(n,t){return!(xl(t)||si(t)<0||!zo(n,t))},kl=function(n){var t=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ci=function(n){var t=[],o=[];return n.forEach(function(r,i){var s=!!r.scopeParent,l=s?r.scopeParent:r,d=pl(l,s),u=s?ci(r.candidates):l;d===0?s?t.push.apply(t,u):t.push(l):o.push({documentOrder:i,tabIndex:d,item:r,isScope:s,content:u})}),o.sort(hl).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(t)},Wn=function(n,t){t=t||{};var o;return t.getShadowRoot?o=Gn([n],t.includeContainer,{filter:Vo.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:kl}):o=ri(n,t.includeContainer,Vo.bind(null,t)),ci(o)},Il=function(n,t){t=t||{};var o;return t.getShadowRoot?o=Gn([n],t.includeContainer,{filter:zo.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):o=ri(n,t.includeContainer,zo.bind(null,t)),o},di=function(n,t){if(t=t||{},!n)throw new Error("No node provided");return tn.call(n,Bn)===!1?!1:Vo(t,n)};function ui(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function fi(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(n=>{let{brand:t,version:o}=n;return t+"/"+o}).join(" "):navigator.userAgent}function _i(){return/apple/i.test(navigator.vendor)}function qo(){const e=/android/i;return e.test(ui())||e.test(fi())}function El(){return ui().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function gi(){return fi().includes("jsdom/")}const pi="data-floating-ui-focusable",Ml="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",jo="ArrowLeft",Bo="ArrowRight",Nl="ArrowUp",Fl="ArrowDown";function xt(e){let n=e.activeElement;for(;((t=n)==null||(t=t.shadowRoot)==null?void 0:t.activeElement)!=null;){var t;n=n.shadowRoot.activeElement}return n}function Ke(e,n){if(!e||!n)return!1;const t=n.getRootNode==null?void 0:n.getRootNode();if(e.contains(n))return!0;if(t&&Dn(t)){let o=n;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Et(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ho(e,n){if(n==null)return!1;if("composedPath"in e)return e.composedPath().includes(n);const t=e;return t.target!=null&&n.contains(t.target)}function Al(e){return e.matches("html,body")}function Ue(e){return e?.ownerDocument||document}function Go(e){return Ve(e)&&e.matches(Ml)}function Wo(e){return e?e.getAttribute("role")==="combobox"&&Go(e):!1}function Pl(e){if(!e||gi())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Rn(e){return e?e.hasAttribute(pi)?e:e.querySelector("["+pi+"]")||e:null}function Ht(e,n,t){return t===void 0&&(t=!0),e.filter(r=>{var i;return r.parentId===n&&(!t||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...Ht(e,r.id,t)])}function Ll(e,n){let t,o=-1;function r(i,s){s>o&&(t=i,o=s),Ht(e,i).forEach(d=>{r(d.id,s+1)})}return r(n,0),e.find(i=>i.id===t)}function hi(e,n){var t;let o=[],r=(t=e.find(i=>i.id===n))==null?void 0:t.parentId;for(;r;){const i=e.find(s=>s.id===r);r=i?.parentId,i&&(o=o.concat(i))}return o}function Ye(e){e.preventDefault(),e.stopPropagation()}function Dl(e){return"nativeEvent"in e}function mi(e){return e.mozInputSource===0&&e.isTrusted?!0:qo()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function vi(e){return gi()?!1:!qo()&&e.width===0&&e.height===0||qo()&&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 pn(e,n){const t=["mouse","pen"];return n||t.push("",void 0),t.includes(e)}var Tl=typeof document<"u",Ol=function(){},Le=Tl?v.useLayoutEffect:Ol;const zl={...M};function Ge(e){const n=M.useRef(e);return Le(()=>{n.current=e}),n}const Vl=zl.useInsertionEffect||(e=>e());function qe(e){const n=M.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Vl(()=>{n.current=e}),M.useCallback(function(){for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return n.current==null?void 0:n.current(...o)},[])}function Kn(e,n,t){return Math.floor(e/n)!==t}function hn(e,n){return n<0||n>=e.current.length}function Ro(e,n){return Je(e,{disabledIndices:n})}function bi(e,n){return Je(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:n})}function Je(e,n){let{startingIndex:t=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=n===void 0?{}:n,s=t;do s+=o?-i:i;while(s>=0&&s<=e.current.length-1&&Un(e,s,r));return s}function ql(e,n){let{event:t,orientation:o,loop:r,rtl:i,cols:s,disabledIndices:l,minIndex:d,maxIndex:u,prevIndex:f,stopEvent:p=!1}=n,_=f;if(t.key===Nl){if(p&&Ye(t),f===-1)_=u;else if(_=Je(e,{startingIndex:_,amount:s,decrement:!0,disabledIndices:l}),r&&(f-s<d||_<0)){const c=f%s,h=u%s,g=u-(h-c);h===c?_=u:_=h>c?g:g-s}hn(e,_)&&(_=f)}if(t.key===Fl&&(p&&Ye(t),f===-1?_=d:(_=Je(e,{startingIndex:f,amount:s,disabledIndices:l}),r&&f+s>u&&(_=Je(e,{startingIndex:f%s-s,amount:s,disabledIndices:l}))),hn(e,_)&&(_=f)),o==="both"){const c=Qt(f/s);t.key===(i?jo:Bo)&&(p&&Ye(t),f%s!==s-1?(_=Je(e,{startingIndex:f,disabledIndices:l}),r&&Kn(_,s,c)&&(_=Je(e,{startingIndex:f-f%s-1,disabledIndices:l}))):r&&(_=Je(e,{startingIndex:f-f%s-1,disabledIndices:l})),Kn(_,s,c)&&(_=f)),t.key===(i?Bo:jo)&&(p&&Ye(t),f%s!==0?(_=Je(e,{startingIndex:f,decrement:!0,disabledIndices:l}),r&&Kn(_,s,c)&&(_=Je(e,{startingIndex:f+(s-f%s),decrement:!0,disabledIndices:l}))):r&&(_=Je(e,{startingIndex:f+(s-f%s),decrement:!0,disabledIndices:l})),Kn(_,s,c)&&(_=f));const h=Qt(u/s)===c;hn(e,_)&&(r&&h?_=t.key===(i?Bo:jo)?u:Je(e,{startingIndex:f-f%s-1,disabledIndices:l}):_=f)}return _}function jl(e,n,t){const o=[];let r=0;return e.forEach((i,s)=>{let{width:l,height:d}=i;if(l>n&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+s+" is greater than grid columns");let u=!1;for(t&&(r=0);!u;){const f=[];for(let p=0;p<l;p++)for(let _=0;_<d;_++)f.push(r+p+_*n);r%n+l<=n&&f.every(p=>o[p]==null)?(f.forEach(p=>{o[p]=s}),u=!0):r++}}),[...o]}function Bl(e,n,t,o,r){if(e===-1)return-1;const i=t.indexOf(e),s=n[e];switch(r){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*o:i;case"br":return t.lastIndexOf(e)}}function Hl(e,n){return n.flatMap((t,o)=>e.includes(t)?[o]:[])}function Un(e,n,t){if(typeof t=="function")return t(n);if(t)return t.includes(n);const o=e.current[n];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}const mn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function wi(e,n){const t=Wn(e,mn()),o=t.length;if(o===0)return;const r=xt(Ue(e)),i=t.indexOf(r),s=i===-1?n===1?0:o-1:i+n;return t[s]}function yi(e){return wi(Ue(e).body,1)||e}function xi(e){return wi(Ue(e).body,-1)||e}function vn(e,n){const t=n||e.currentTarget,o=e.relatedTarget;return!o||!Ke(t,o)}function Gl(e){Wn(e,mn()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function Ci(e){e.querySelectorAll("[data-tabindex]").forEach(t=>{const o=t.dataset.tabindex;delete t.dataset.tabindex,o?t.setAttribute("tabindex",o):t.removeAttribute("tabindex")})}function Si(e,n,t){let{reference:o,floating:r}=e;const i=It(n),s=To(n),l=Do(s),d=Dt(n),u=i==="y",f=o.x+o.width/2-r.width/2,p=o.y+o.height/2-r.height/2,_=o[l]/2-r[l]/2;let c;switch(d){case"top":c={x:f,y:o.y-r.height};break;case"bottom":c={x:f,y:o.y+o.height};break;case"right":c={x:o.x+o.width,y:p};break;case"left":c={x:o.x-r.width,y:p};break;default:c={x:o.x,y:o.y}}switch(en(n)){case"start":c[s]-=_*(t&&u?-1:1);break;case"end":c[s]+=_*(t&&u?-1:1);break}return c}const Wl=async(e,n,t)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=t,l=i.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(n));let u=await s.getElementRects({reference:e,floating:n,strategy:r}),{x:f,y:p}=Si(u,o,d),_=o,c={},h=0;for(let g=0;g<l.length;g++){const{name:m,fn:b}=l[g],{x:w,y:C,data:S,reset:k}=await b({x:f,y:p,initialPlacement:o,placement:_,strategy:r,middlewareData:c,rects:u,platform:s,elements:{reference:e,floating:n}});f=w??f,p=C??p,c={...c,[m]:{...c[m],...S}},k&&h<=50&&(h++,typeof k=="object"&&(k.placement&&(_=k.placement),k.rects&&(u=k.rects===!0?await s.getElementRects({reference:e,floating:n,strategy:r}):k.rects),{x:f,y:p}=Si(u,_,d)),g=-1)}return{x:f,y:p,placement:_,strategy:r,middlewareData:c}};async function Ko(e,n){var t;n===void 0&&(n={});const{x:o,y:r,platform:i,rects:s,elements:l,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:_=!1,padding:c=0}=Jt(n,e),h=ni(c),m=l[_?p==="floating"?"reference":"floating":p],b=jn(await i.getClippingRect({element:(t=await(i.isElement==null?void 0:i.isElement(m)))==null||t?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:f,strategy:d})),w=p==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),S=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},k=jn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:C,strategy:d}):w);return{top:(b.top-k.top+h.top)/S.y,bottom:(k.bottom-b.bottom+h.bottom)/S.y,left:(b.left-k.left+h.left)/S.x,right:(k.right-b.right+h.right)/S.x}}const Rl=e=>({name:"arrow",options:e,async fn(n){const{x:t,y:o,placement:r,rects:i,platform:s,elements:l,middlewareData:d}=n,{element:u,padding:f=0}=Jt(e,n)||{};if(u==null)return{};const p=ni(f),_={x:t,y:o},c=To(r),h=Do(c),g=await s.getDimensions(u),m=c==="y",b=m?"top":"left",w=m?"bottom":"right",C=m?"clientHeight":"clientWidth",S=i.reference[h]+i.reference[c]-_[c]-i.floating[h],k=_[c]-i.reference[c],$=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let I=$?$[C]:0;(!I||!await(s.isElement==null?void 0:s.isElement($)))&&(I=l.floating[C]||i.floating[h]);const F=S/2-k/2,L=I/2-g[h]/2-1,N=Lt(p[b],L),D=Lt(p[w],L),V=N,T=I-g[h]-D,y=I/2-g[h]/2+F,E=Lo(V,y,T),z=!d.arrow&&en(r)!=null&&y!==E&&i.reference[h]/2-(y<V?N:D)-g[h]/2<0,A=z?y<V?y-V:y-T:0;return{[c]:_[c]+A,data:{[c]:E,centerOffset:y-E-A,...z&&{alignmentOffset:A}},reset:z}}}),Kl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var t,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:l,platform:d,elements:u}=n,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:_,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...m}=Jt(e,n);if((t=i.arrow)!=null&&t.alignmentOffset)return{};const b=Dt(r),w=It(l),C=Dt(l)===l,S=await(d.isRTL==null?void 0:d.isRTL(u.floating)),k=_||(C||!g?[qn(l)]:al(l)),$=h!=="none";!_&&$&&k.push(...ul(l,g,h,S));const I=[l,...k],F=await Ko(n,m),L=[];let N=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&L.push(F[b]),p){const y=sl(r,s,S);L.push(F[y[0]],F[y[1]])}if(N=[...N,{placement:r,overflows:L}],!L.every(y=>y<=0)){var D,V;const y=(((D=i.flip)==null?void 0:D.index)||0)+1,E=I[y];if(E&&(!(p==="alignment"?w!==It(E):!1)||N.every(x=>It(x.placement)===w?x.overflows[0]>0:!0)))return{data:{index:y,overflows:N},reset:{placement:E}};let z=(V=N.filter(A=>A.overflows[0]<=0).sort((A,x)=>A.overflows[1]-x.overflows[1])[0])==null?void 0:V.placement;if(!z)switch(c){case"bestFit":{var T;const A=(T=N.filter(x=>{if($){const P=It(x.placement);return P===w||P==="y"}return!0}).map(x=>[x.placement,x.overflows.filter(P=>P>0).reduce((P,O)=>P+O,0)]).sort((x,P)=>x[1]-P[1])[0])==null?void 0:T[0];A&&(z=A);break}case"initialPlacement":z=l;break}if(r!==z)return{reset:{placement:z}}}return{}}}},Ul=new Set(["left","top"]);async function Yl(e,n){const{placement:t,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=Dt(t),l=en(t),d=It(t)==="y",u=Ul.has(s)?-1:1,f=i&&d?-1:1,p=Jt(n,e);let{mainAxis:_,crossAxis:c,alignmentAxis:h}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof h=="number"&&(c=l==="end"?h*-1:h),d?{x:c*f,y:_*u}:{x:_*u,y:c*f}}const Xl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var t,o;const{x:r,y:i,placement:s,middlewareData:l}=n,d=await Yl(n,e);return s===((t=l.offset)==null?void 0:t.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+d.x,y:i+d.y,data:{...d,placement:s}}}}},Zl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:t,y:o,placement:r}=n,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:m=>{let{x:b,y:w}=m;return{x:b,y:w}}},...d}=Jt(e,n),u={x:t,y:o},f=await Ko(n,d),p=It(Dt(r)),_=Jr(p);let c=u[_],h=u[p];if(i){const m=_==="y"?"top":"left",b=_==="y"?"bottom":"right",w=c+f[m],C=c-f[b];c=Lo(w,c,C)}if(s){const m=p==="y"?"top":"left",b=p==="y"?"bottom":"right",w=h+f[m],C=h-f[b];h=Lo(w,h,C)}const g=l.fn({...n,[_]:c,[p]:h});return{...g,data:{x:g.x-t,y:g.y-o,enabled:{[_]:i,[p]:s}}}}}},Ql=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var t,o;const{placement:r,rects:i,platform:s,elements:l}=n,{apply:d=()=>{},...u}=Jt(e,n),f=await Ko(n,u),p=Dt(r),_=en(r),c=It(r)==="y",{width:h,height:g}=i.floating;let m,b;p==="top"||p==="bottom"?(m=p,b=_===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(b=p,m=_==="end"?"top":"bottom");const w=g-f.top-f.bottom,C=h-f.left-f.right,S=Lt(g-f[m],w),k=Lt(h-f[b],C),$=!n.middlewareData.shift;let I=S,F=k;if((t=n.middlewareData.shift)!=null&&t.enabled.x&&(F=C),(o=n.middlewareData.shift)!=null&&o.enabled.y&&(I=w),$&&!_){const N=dt(f.left,0),D=dt(f.right,0),V=dt(f.top,0),T=dt(f.bottom,0);c?F=h-2*(N!==0||D!==0?N+D:dt(f.left,f.right)):I=g-2*(V!==0||T!==0?V+T:dt(f.top,f.bottom))}await d({...n,availableWidth:F,availableHeight:I});const L=await s.getDimensions(l.floating);return h!==L.width||g!==L.height?{reset:{rects:!0}}:{}}}};function $i(e){const n=ct(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=Ve(e),i=r?e.offsetWidth:t,s=r?e.offsetHeight:o,l=Vn(t)!==i||Vn(o)!==s;return l&&(t=i,o=s),{width:t,height:o,$:l}}function Uo(e){return Pe(e)?e:e.contextElement}function nn(e){const n=Uo(e);if(!Ve(n))return yt(1);const t=n.getBoundingClientRect(),{width:o,height:r,$:i}=$i(n);let s=(i?Vn(t.width):t.width)/o,l=(i?Vn(t.height):t.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Jl=yt(0);function ki(e){const n=at(e);return!On()||!n.visualViewport?Jl:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function ec(e,n,t){return n===void 0&&(n=!1),!t||n&&t!==at(e)?!1:n}function Gt(e,n,t,o){n===void 0&&(n=!1),t===void 0&&(t=!1);const r=e.getBoundingClientRect(),i=Uo(e);let s=yt(1);n&&(o?Pe(o)&&(s=nn(o)):s=nn(e));const l=ec(i,t,o)?ki(i):yt(0);let d=(r.left+l.x)/s.x,u=(r.top+l.y)/s.y,f=r.width/s.x,p=r.height/s.y;if(i){const _=at(i),c=o&&Pe(o)?at(o):o;let h=_,g=Po(h);for(;g&&o&&c!==h;){const m=nn(g),b=g.getBoundingClientRect(),w=ct(g),C=b.left+(g.clientLeft+parseFloat(w.paddingLeft))*m.x,S=b.top+(g.clientTop+parseFloat(w.paddingTop))*m.y;d*=m.x,u*=m.y,f*=m.x,p*=m.y,d+=C,u+=S,h=at(g),g=Po(h)}}return jn({width:f,height:p,x:d,y:u})}function Yn(e,n){const t=zn(e).scrollLeft;return n?n.left+t:Gt(wt(e)).left+t}function Ii(e,n){const t=e.getBoundingClientRect(),o=t.left+n.scrollLeft-Yn(e,t),r=t.top+n.scrollTop;return{x:o,y:r}}function tc(e){let{elements:n,rect:t,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=wt(o),l=n?Tn(n.floating):!1;if(o===s||l&&i)return t;let d={scrollLeft:0,scrollTop:0},u=yt(1);const f=yt(0),p=Ve(o);if((p||!p&&!i)&&((At(o)!=="body"||_n(s))&&(d=zn(o)),Ve(o))){const c=Gt(o);u=nn(o),f.x=c.x+o.clientLeft,f.y=c.y+o.clientTop}const _=s&&!p&&!i?Ii(s,d):yt(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-d.scrollLeft*u.x+f.x+_.x,y:t.y*u.y-d.scrollTop*u.y+f.y+_.y}}function nc(e){return Array.from(e.getClientRects())}function oc(e){const n=wt(e),t=zn(e),o=e.ownerDocument.body,r=dt(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),i=dt(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let s=-t.scrollLeft+Yn(e);const l=-t.scrollTop;return ct(o).direction==="rtl"&&(s+=dt(n.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:l}}const Ei=25;function rc(e,n){const t=at(e),o=wt(e),r=t.visualViewport;let i=o.clientWidth,s=o.clientHeight,l=0,d=0;if(r){i=r.width,s=r.height;const f=On();(!f||f&&n==="fixed")&&(l=r.offsetLeft,d=r.offsetTop)}const u=Yn(o);if(u<=0){const f=o.ownerDocument,p=f.body,_=getComputedStyle(p),c=f.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,h=Math.abs(o.clientWidth-p.clientWidth-c);h<=Ei&&(i-=h)}else u<=Ei&&(i+=u);return{width:i,height:s,x:l,y:d}}const ic=new Set(["absolute","fixed"]);function sc(e,n){const t=Gt(e,!0,n==="fixed"),o=t.top+e.clientTop,r=t.left+e.clientLeft,i=Ve(e)?nn(e):yt(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,d=r*i.x,u=o*i.y;return{width:s,height:l,x:d,y:u}}function Mi(e,n,t){let o;if(n==="viewport")o=rc(e,t);else if(n==="document")o=oc(wt(e));else if(Pe(n))o=sc(n,t);else{const r=ki(e);o={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return jn(o)}function Ni(e,n){const t=kt(e);return t===n||!Pe(t)||$t(t)?!1:ct(t).position==="fixed"||Ni(t,n)}function ac(e,n){const t=n.get(e);if(t)return t;let o=Pt(e,[],!1).filter(l=>Pe(l)&&At(l)!=="body"),r=null;const i=ct(e).position==="fixed";let s=i?kt(e):e;for(;Pe(s)&&!$t(s);){const l=ct(s),d=Ao(s);!d&&l.position==="fixed"&&(r=null),(i?!d&&!r:!d&&l.position==="static"&&!!r&&ic.has(r.position)||_n(s)&&!d&&Ni(e,s))?o=o.filter(f=>f!==s):r=l,s=kt(s)}return n.set(e,o),o}function lc(e){let{element:n,boundary:t,rootBoundary:o,strategy:r}=e;const s=[...t==="clippingAncestors"?Tn(n)?[]:ac(n,this._c):[].concat(t),o],l=s[0],d=s.reduce((u,f)=>{const p=Mi(n,f,r);return u.top=dt(p.top,u.top),u.right=Lt(p.right,u.right),u.bottom=Lt(p.bottom,u.bottom),u.left=dt(p.left,u.left),u},Mi(n,l,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function cc(e){const{width:n,height:t}=$i(e);return{width:n,height:t}}function dc(e,n,t){const o=Ve(n),r=wt(n),i=t==="fixed",s=Gt(e,!0,i,n);let l={scrollLeft:0,scrollTop:0};const d=yt(0);function u(){d.x=Yn(r)}if(o||!o&&!i)if((At(n)!=="body"||_n(r))&&(l=zn(n)),o){const c=Gt(n,!0,i,n);d.x=c.x+n.clientLeft,d.y=c.y+n.clientTop}else r&&u();i&&!o&&r&&u();const f=r&&!o&&!i?Ii(r,l):yt(0),p=s.left+l.scrollLeft-d.x-f.x,_=s.top+l.scrollTop-d.y-f.y;return{x:p,y:_,width:s.width,height:s.height}}function Yo(e){return ct(e).position==="static"}function Fi(e,n){if(!Ve(e)||ct(e).position==="fixed")return null;if(n)return n(e);let t=e.offsetParent;return wt(e)===t&&(t=t.ownerDocument.body),t}function Ai(e,n){const t=at(e);if(Tn(e))return t;if(!Ve(e)){let r=kt(e);for(;r&&!$t(r);){if(Pe(r)&&!Yo(r))return r;r=kt(r)}return t}let o=Fi(e,n);for(;o&&Xa(o)&&Yo(o);)o=Fi(o,n);return o&&$t(o)&&Yo(o)&&!Ao(o)?t:o||tl(e)||t}const uc=async function(e){const n=this.getOffsetParent||Ai,t=this.getDimensions,o=await t(e.floating);return{reference:dc(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function fc(e){return ct(e).direction==="rtl"}const _c={convertOffsetParentRelativeRectToViewportRelativeRect:tc,getDocumentElement:wt,getClippingRect:lc,getOffsetParent:Ai,getElementRects:uc,getClientRects:nc,getDimensions:cc,getScale:nn,isElement:Pe,isRTL:fc};function Pi(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function gc(e,n){let t=null,o;const r=wt(e);function i(){var l;clearTimeout(o),(l=t)==null||l.disconnect(),t=null}function s(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),i();const u=e.getBoundingClientRect(),{left:f,top:p,width:_,height:c}=u;if(l||n(),!_||!c)return;const h=Qt(p),g=Qt(r.clientWidth-(f+_)),m=Qt(r.clientHeight-(p+c)),b=Qt(f),C={rootMargin:-h+"px "+-g+"px "+-m+"px "+-b+"px",threshold:dt(0,Lt(1,d))||1};let S=!0;function k($){const I=$[0].intersectionRatio;if(I!==d){if(!S)return s();I?s(!1,I):o=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!Pi(u,e.getBoundingClientRect())&&s(),S=!1}try{t=new IntersectionObserver(k,{...C,root:r.ownerDocument})}catch{t=new IntersectionObserver(k,C)}t.observe(e)}return s(!0),i}function Xn(e,n,t,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,u=Uo(e),f=r||i?[...u?Pt(u):[],...Pt(n)]:[];f.forEach(b=>{r&&b.addEventListener("scroll",t,{passive:!0}),i&&b.addEventListener("resize",t)});const p=u&&l?gc(u,t):null;let _=-1,c=null;s&&(c=new ResizeObserver(b=>{let[w]=b;w&&w.target===u&&c&&(c.unobserve(n),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var C;(C=c)==null||C.observe(n)})),t()}),u&&!d&&c.observe(u),c.observe(n));let h,g=d?Gt(e):null;d&&m();function m(){const b=Gt(e);g&&!Pi(g,b)&&t(),g=b,h=requestAnimationFrame(m)}return t(),()=>{var b;f.forEach(w=>{r&&w.removeEventListener("scroll",t),i&&w.removeEventListener("resize",t)}),p?.(),(b=c)==null||b.disconnect(),c=null,d&&cancelAnimationFrame(h)}}const pc=Xl,hc=Zl,mc=Kl,vc=Ql,Li=Rl,bc=(e,n,t)=>{const o=new Map,r={platform:_c,...t},i={...r.platform,_c:o};return Wl(e,n,{...r,platform:i})};var wc=typeof document<"u",yc=function(){},Zn=wc?v.useLayoutEffect:yc;function Qn(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let t,o,r;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(t=e.length,t!==n.length)return!1;for(o=t;o--!==0;)if(!Qn(e[o],n[o]))return!1;return!0}if(r=Object.keys(e),t=r.length,t!==Object.keys(n).length)return!1;for(o=t;o--!==0;)if(!{}.hasOwnProperty.call(n,r[o]))return!1;for(o=t;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!Qn(e[i],n[i]))return!1}return!0}return e!==e&&n!==n}function Di(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ti(e,n){const t=Di(e);return Math.round(n*t)/t}function Xo(e){const n=M.useRef(e);return Zn(()=>{n.current=e}),n}function xc(e){e===void 0&&(e={});const{placement:n="bottom",strategy:t="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:d,open:u}=e,[f,p]=M.useState({x:0,y:0,strategy:t,placement:n,middlewareData:{},isPositioned:!1}),[_,c]=M.useState(o);Qn(_,o)||c(o);const[h,g]=M.useState(null),[m,b]=M.useState(null),w=M.useCallback(x=>{x!==$.current&&($.current=x,g(x))},[]),C=M.useCallback(x=>{x!==I.current&&(I.current=x,b(x))},[]),S=i||h,k=s||m,$=M.useRef(null),I=M.useRef(null),F=M.useRef(f),L=d!=null,N=Xo(d),D=Xo(r),V=Xo(u),T=M.useCallback(()=>{if(!$.current||!I.current)return;const x={placement:n,strategy:t,middleware:_};D.current&&(x.platform=D.current),bc($.current,I.current,x).then(P=>{const O={...P,isPositioned:V.current!==!1};y.current&&!Qn(F.current,O)&&(F.current=O,Io.flushSync(()=>{p(O)}))})},[_,n,t,D,V]);Zn(()=>{u===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,p(x=>({...x,isPositioned:!1})))},[u]);const y=M.useRef(!1);Zn(()=>(y.current=!0,()=>{y.current=!1}),[]),Zn(()=>{if(S&&($.current=S),k&&(I.current=k),S&&k){if(N.current)return N.current(S,k,T);T()}},[S,k,T,N,L]);const E=M.useMemo(()=>({reference:$,floating:I,setReference:w,setFloating:C}),[w,C]),z=M.useMemo(()=>({reference:S,floating:k}),[S,k]),A=M.useMemo(()=>{const x={position:t,left:0,top:0};if(!z.floating)return x;const P=Ti(z.floating,f.x),O=Ti(z.floating,f.y);return l?{...x,transform:"translate("+P+"px, "+O+"px)",...Di(z.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:P,top:O}},[t,l,z.floating,f.x,f.y]);return M.useMemo(()=>({...f,update:T,refs:E,elements:z,floatingStyles:A}),[f,T,E,z,A])}const Cc=e=>{function n(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:e,fn(t){const{element:o,padding:r}=typeof e=="function"?e(t):e;return o&&n(o)?o.current!=null?Li({element:o.current,padding:r}).fn(t):{}:o?Li({element:o,padding:r}).fn(t):{}}}},Jn=(e,n)=>({...pc(e),options:[e,n]}),eo=(e,n)=>({...hc(e),options:[e,n]}),to=(e,n)=>({...mc(e),options:[e,n]}),Oi=(e,n)=>({...vc(e),options:[e,n]}),Sc=(e,n)=>({...Cc(e),options:[e,n]});function zi(e){const n=M.useRef(void 0),t=M.useCallback(o=>{const r=e.map(i=>{if(i!=null){if(typeof i=="function"){const s=i,l=s(o);return typeof l=="function"?l:()=>{s(null)}}return i.current=o,()=>{i.current=null}}});return()=>{r.forEach(i=>i?.())}},e);return M.useMemo(()=>e.every(o=>o==null)?null:o=>{n.current&&(n.current(),n.current=void 0),o!=null&&(n.current=t(o))},e)}const $c="data-floating-ui-focusable",Vi="active",qi="selected",bn="ArrowLeft",wn="ArrowRight",ji="ArrowUp",no="ArrowDown",kc={...M};let Bi=!1,Ic=0;const Hi=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Ic++;function Ec(){const[e,n]=M.useState(()=>Bi?Hi():void 0);return Le(()=>{e==null&&n(Hi())},[]),M.useEffect(()=>{Bi=!0},[]),e}const yn=kc.useId||Ec;let xn;process.env.NODE_ENV!=="production"&&(xn=new Set);function oo(){for(var e,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];const r="Floating UI: "+t.join(" ");if(!((e=xn)!=null&&e.has(r))){var i;(i=xn)==null||i.add(r),console.warn(r)}}function Mc(){for(var e,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];const r="Floating UI: "+t.join(" ");if(!((e=xn)!=null&&e.has(r))){var i;(i=xn)==null||i.add(r),console.error(r)}}const Nc=M.forwardRef(function(n,t){const{context:{placement:o,elements:{floating:r},middlewareData:{arrow:i,shift:s}},width:l=14,height:d=7,tipRadius:u=0,strokeWidth:f=0,staticOffset:p,stroke:_,d:c,style:{transform:h,...g}={},...m}=n;process.env.NODE_ENV!=="production"&&(t||oo("The `ref` prop is required for `FloatingArrow`."));const b=yn(),[w,C]=M.useState(!1);if(Le(()=>{if(!r)return;ct(r).direction==="rtl"&&C(!0)},[r]),!r)return null;const[S,k]=o.split("-"),$=S==="top"||S==="bottom";let I=p;($&&s!=null&&s.x||!$&&s!=null&&s.y)&&(I=null);const F=f*2,L=F/2,N=l/2*(u/-8+1),D=d/2*u/4,V=!!c,T=I&&k==="end"?"bottom":"top";let y=I&&k==="end"?"right":"left";I&&w&&(y=k==="end"?"left":"right");const E=i?.x!=null?I||i.x:"",z=i?.y!=null?I||i.y:"",A=c||"M0,0"+(" H"+l)+(" L"+(l-N)+","+(d-D))+(" Q"+l/2+","+d+" "+N+","+(d-D))+" Z",x={top:V?"rotate(180deg)":"",left:V?"rotate(90deg)":"rotate(-90deg)",bottom:V?"":"rotate(180deg)",right:V?"rotate(-90deg)":"rotate(90deg)"}[S];return a.jsxs("svg",{...m,"aria-hidden":!0,ref:t,width:V?l:l+F,height:l,viewBox:"0 0 "+l+" "+(d>l?d:l),style:{position:"absolute",pointerEvents:"none",[y]:E,[T]:z,[S]:$||V?"100%":"calc(100% - "+F/2+"px)",transform:[x,h].filter(P=>!!P).join(" "),...g},children:[F>0&&a.jsx("path",{clipPath:"url(#"+b+")",fill:"none",stroke:_,strokeWidth:F+(c?0:1),d:A}),a.jsx("path",{stroke:F&&!c?m.fill:"none",d:A}),a.jsx("clipPath",{id:b,children:a.jsx("rect",{x:-L,y:L*(V?-1:1),width:l+F,height:l})})]})});function Gi(){const e=new Map;return{emit(n,t){var o;(o=e.get(n))==null||o.forEach(r=>r(t))},on(n,t){e.has(n)||e.set(n,new Set),e.get(n).add(t)},off(n,t){var o;(o=e.get(n))==null||o.delete(t)}}}const Wi=M.createContext(null),Ri=M.createContext(null),on=()=>{var e;return((e=M.useContext(Wi))==null?void 0:e.id)||null},Wt=()=>M.useContext(Ri);function Ki(e){const n=yn(),t=Wt(),r=on();return Le(()=>{if(!n)return;const i={id:n,parentId:r};return t?.addNode(i),()=>{t?.removeNode(i)}},[t,n,r]),n}function Ui(e){const{children:n,id:t}=e,o=on();return a.jsx(Wi.Provider,{value:M.useMemo(()=>({id:t,parentId:o}),[t,o]),children:n})}function Fc(e){const{children:n}=e,t=M.useRef([]),o=M.useCallback(s=>{t.current=[...t.current,s]},[]),r=M.useCallback(s=>{t.current=t.current.filter(l=>l!==s)},[]),[i]=M.useState(()=>Gi());return a.jsx(Ri.Provider,{value:M.useMemo(()=>({nodesRef:t,addNode:o,removeNode:r,events:i}),[o,r,i]),children:n})}function Rt(e){return"data-floating-ui-"+e}function Xe(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Yi=Rt("safe-polygon");function Zo(e,n,t){if(t&&!pn(t))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[n]}return e?.[n]}function Qo(e){return typeof e=="function"?e():e}function Jo(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,dataRef:r,events:i,elements:s}=e,{enabled:l=!0,delay:d=0,handleClose:u=null,mouseOnly:f=!1,restMs:p=0,move:_=!0}=n,c=Wt(),h=on(),g=Ge(u),m=Ge(d),b=Ge(t),w=Ge(p),C=M.useRef(),S=M.useRef(-1),k=M.useRef(),$=M.useRef(-1),I=M.useRef(!0),F=M.useRef(!1),L=M.useRef(()=>{}),N=M.useRef(!1),D=qe(()=>{var A;const x=(A=r.current.openEvent)==null?void 0:A.type;return x?.includes("mouse")&&x!=="mousedown"});M.useEffect(()=>{if(!l)return;function A(x){let{open:P}=x;P||(Xe(S),Xe($),I.current=!0,N.current=!1)}return i.on("openchange",A),()=>{i.off("openchange",A)}},[l,i]),M.useEffect(()=>{if(!l||!g.current||!t)return;function A(P){D()&&o(!1,P,"hover")}const x=Ue(s.floating).documentElement;return x.addEventListener("mouseleave",A),()=>{x.removeEventListener("mouseleave",A)}},[s.floating,t,o,l,g,D]);const V=M.useCallback(function(A,x,P){x===void 0&&(x=!0),P===void 0&&(P="hover");const O=Zo(m.current,"close",C.current);O&&!k.current?(Xe(S),S.current=window.setTimeout(()=>o(!1,A,P),O)):x&&(Xe(S),o(!1,A,P))},[m,o]),T=qe(()=>{L.current(),k.current=void 0}),y=qe(()=>{if(F.current){const A=Ue(s.floating).body;A.style.pointerEvents="",A.removeAttribute(Yi),F.current=!1}}),E=qe(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);M.useEffect(()=>{if(!l)return;function A(j){if(Xe(S),I.current=!1,f&&!pn(C.current)||Qo(w.current)>0&&!Zo(m.current,"open"))return;const q=Zo(m.current,"open",C.current);q?S.current=window.setTimeout(()=>{b.current||o(!0,j,"hover")},q):t||o(!0,j,"hover")}function x(j){if(E()){y();return}L.current();const q=Ue(s.floating);if(Xe($),N.current=!1,g.current&&r.current.floatingContext){t||Xe(S),k.current=g.current({...r.current.floatingContext,tree:c,x:j.clientX,y:j.clientY,onClose(){y(),T(),E()||V(j,!0,"safe-polygon")}});const G=k.current;q.addEventListener("mousemove",G),L.current=()=>{q.removeEventListener("mousemove",G)};return}(C.current==="touch"?!Ke(s.floating,j.relatedTarget):!0)&&V(j)}function P(j){E()||r.current.floatingContext&&(g.current==null||g.current({...r.current.floatingContext,tree:c,x:j.clientX,y:j.clientY,onClose(){y(),T(),E()||V(j)}})(j))}function O(){Xe(S)}function B(j){E()||V(j,!1)}if(Pe(s.domReference)){const j=s.domReference,q=s.floating;return t&&j.addEventListener("mouseleave",P),_&&j.addEventListener("mousemove",A,{once:!0}),j.addEventListener("mouseenter",A),j.addEventListener("mouseleave",x),q&&(q.addEventListener("mouseleave",P),q.addEventListener("mouseenter",O),q.addEventListener("mouseleave",B)),()=>{t&&j.removeEventListener("mouseleave",P),_&&j.removeEventListener("mousemove",A),j.removeEventListener("mouseenter",A),j.removeEventListener("mouseleave",x),q&&(q.removeEventListener("mouseleave",P),q.removeEventListener("mouseenter",O),q.removeEventListener("mouseleave",B))}}},[s,l,e,f,_,V,T,y,o,t,b,c,m,g,r,E,w]),Le(()=>{var A;if(l&&t&&(A=g.current)!=null&&(A=A.__options)!=null&&A.blockPointerEvents&&D()){F.current=!0;const P=s.floating;if(Pe(s.domReference)&&P){var x;const O=Ue(s.floating).body;O.setAttribute(Yi,"");const B=s.domReference,j=c==null||(x=c.nodesRef.current.find(q=>q.id===h))==null||(x=x.context)==null?void 0:x.elements.floating;return j&&(j.style.pointerEvents=""),O.style.pointerEvents="none",B.style.pointerEvents="auto",P.style.pointerEvents="auto",()=>{O.style.pointerEvents="",B.style.pointerEvents="",P.style.pointerEvents=""}}}},[l,t,h,s,c,g,D]),Le(()=>{t||(C.current=void 0,N.current=!1,T(),y())},[t,T,y]),M.useEffect(()=>()=>{T(),Xe(S),Xe($),y()},[l,s.domReference,T,y]);const z=M.useMemo(()=>{function A(x){C.current=x.pointerType}return{onPointerDown:A,onPointerEnter:A,onMouseMove(x){const{nativeEvent:P}=x;function O(){!I.current&&!b.current&&o(!0,P,"hover")}f&&!pn(C.current)||t||Qo(w.current)===0||N.current&&x.movementX**2+x.movementY**2<2||(Xe($),C.current==="touch"?O():(N.current=!0,$.current=window.setTimeout(O,Qo(w.current))))}}},[f,o,t,b,w]);return M.useMemo(()=>l?{reference:z}:{},[l,z])}let Xi=0;function Kt(e,n){n===void 0&&(n={});const{preventScroll:t=!1,cancelPrevious:o=!0,sync:r=!1}=n;o&&cancelAnimationFrame(Xi);const i=()=>e?.focus({preventScroll:t});r?i():Xi=requestAnimationFrame(i)}function er(e,n){if(!e||!n)return!1;const t=n.getRootNode==null?void 0:n.getRootNode();if(e.contains(n))return!0;if(t&&Dn(t)){let o=n;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Ac(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Pc(e){return e?.ownerDocument||document}const rn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Zi(e){return e==="inert"?rn.inert:e==="aria-hidden"?rn["aria-hidden"]:rn.none}let ro=new WeakSet,io={},tr=0;const Lc=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Qi=e=>e&&(e.host||Qi(e.parentNode)),Dc=(e,n)=>n.map(t=>{if(e.contains(t))return t;const o=Qi(t);return e.contains(o)?o:null}).filter(t=>t!=null);function Tc(e,n,t,o){const r="data-floating-ui-inert",i=o?"inert":t?"aria-hidden":null,s=Dc(n,e),l=new Set,d=new Set(s),u=[];io[r]||(io[r]=new WeakMap);const f=io[r];s.forEach(p),_(n),l.clear();function p(c){!c||l.has(c)||(l.add(c),c.parentNode&&p(c.parentNode))}function _(c){!c||d.has(c)||[].forEach.call(c.children,h=>{if(At(h)!=="script")if(l.has(h))_(h);else{const g=i?h.getAttribute(i):null,m=g!==null&&g!=="false",b=Zi(i),w=(b.get(h)||0)+1,C=(f.get(h)||0)+1;b.set(h,w),f.set(h,C),u.push(h),w===1&&m&&ro.add(h),C===1&&h.setAttribute(r,""),!m&&i&&h.setAttribute(i,i==="inert"?"":"true")}})}return tr++,()=>{u.forEach(c=>{const h=Zi(i),m=(h.get(c)||0)-1,b=(f.get(c)||0)-1;h.set(c,m),f.set(c,b),m||(!ro.has(c)&&i&&c.removeAttribute(i),ro.delete(c)),b||c.removeAttribute(r)}),tr--,tr||(rn.inert=new WeakMap,rn["aria-hidden"]=new WeakMap,rn.none=new WeakMap,ro=new WeakSet,io={})}}function Ji(e,n,t){n===void 0&&(n=!1),t===void 0&&(t=!1);const o=Pc(e[0]).body;return Tc(e.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,n,t)}const so={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},ao=M.forwardRef(function(n,t){const[o,r]=M.useState();Le(()=>{_i()&&r("button")},[]);const i={ref:t,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[Rt("focus-guard")]:"",style:so};return a.jsx("span",{...n,...i})}),es=M.createContext(null),ts=Rt("portal");function Oc(e){e===void 0&&(e={});const{id:n,root:t}=e,o=yn(),r=ns(),[i,s]=M.useState(null),l=M.useRef(null);return Le(()=>()=>{i?.remove(),queueMicrotask(()=>{l.current=null})},[i]),Le(()=>{if(!o||l.current)return;const d=n?document.getElementById(n):null;if(!d)return;const u=document.createElement("div");u.id=o,u.setAttribute(ts,""),d.appendChild(u),l.current=u,s(u)},[n,o]),Le(()=>{if(t===null||!o||l.current)return;let d=t||r?.portalNode;d&&!Fo(d)&&(d=d.current),d=d||document.body;let u=null;n&&(u=document.createElement("div"),u.id=n,d.appendChild(u));const f=document.createElement("div");f.id=o,f.setAttribute(ts,""),d=u||d,d.appendChild(f),l.current=f,s(f)},[n,t,o,r]),i}function lo(e){const{children:n,id:t,root:o,preserveTabOrder:r=!0}=e,i=Oc({id:t,root:o}),[s,l]=M.useState(null),d=M.useRef(null),u=M.useRef(null),f=M.useRef(null),p=M.useRef(null),_=s?.modal,c=s?.open,h=!!s&&!s.modal&&s.open&&r&&!!(o||i);return M.useEffect(()=>{if(!i||!r||_)return;function g(m){i&&vn(m)&&(m.type==="focusin"?Ci:Gl)(i)}return i.addEventListener("focusin",g,!0),i.addEventListener("focusout",g,!0),()=>{i.removeEventListener("focusin",g,!0),i.removeEventListener("focusout",g,!0)}},[i,r,_]),M.useEffect(()=>{i&&(c||Ci(i))},[c,i]),a.jsxs(es.Provider,{value:M.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:d,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:p,portalNode:i,setFocusManagerState:l}),[r,i]),children:[h&&i&&a.jsx(ao,{"data-type":"outside",ref:d,onFocus:g=>{if(vn(g,i)){var m;(m=f.current)==null||m.focus()}else{const b=s?s.domReference:null,w=xi(b);w?.focus()}}}),h&&i&&a.jsx("span",{"aria-owns":i.id,style:so}),i&&Io.createPortal(n,i),h&&i&&a.jsx(ao,{"data-type":"outside",ref:u,onFocus:g=>{if(vn(g,i)){var m;(m=p.current)==null||m.focus()}else{const b=s?s.domReference:null,w=yi(b);w?.focus(),s?.closeOnFocusOut&&s?.onOpenChange(!1,g.nativeEvent,"focus-out")}}})]})}const ns=()=>M.useContext(es);function os(e){return M.useMemo(()=>n=>{e.forEach(t=>{t&&(t.current=n)})},e)}const zc=20;let Tt=[];function nr(){Tt=Tt.filter(e=>e.isConnected)}function Vc(e){nr(),e&&At(e)!=="body"&&(Tt.push(e),Tt.length>zc&&(Tt=Tt.slice(-20)))}function rs(){return nr(),Tt[Tt.length-1]}function qc(e){const n=mn();return di(e,n)?e:Wn(e,n)[0]||e}function is(e,n){var t;if(!n.current.includes("floating")&&!((t=e.getAttribute("role"))!=null&&t.includes("dialog")))return;const o=mn(),i=Il(e,o).filter(l=>{const d=l.getAttribute("data-tabindex")||"";return di(l,o)||l.hasAttribute("data-tabindex")&&!d.startsWith("-")}),s=e.getAttribute("tabindex");n.current.includes("floating")||i.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const jc=M.forwardRef(function(n,t){return a.jsx("button",{...n,type:"button",ref:t,tabIndex:-1,style:so})});function or(e){const{context:n,children:t,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:s=0,returnFocus:l=!0,restoreFocus:d=!1,modal:u=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:p=!0,outsideElementsInert:_=!1,getInsideElements:c=()=>[]}=e,{open:h,onOpenChange:g,events:m,dataRef:b,elements:{domReference:w,floating:C}}=n,S=qe(()=>{var U;return(U=b.current.floatingContext)==null?void 0:U.nodeId}),k=qe(c),$=typeof s=="number"&&s<0,I=Wo(w)&&$,F=Lc(),L=F?i:!0,N=!L||F&&_,D=Ge(r),V=Ge(s),T=Ge(l),y=Wt(),E=ns(),z=M.useRef(null),A=M.useRef(null),x=M.useRef(!1),P=M.useRef(!1),O=M.useRef(-1),B=M.useRef(-1),j=E!=null,q=Rn(C),J=qe(function(U){return U===void 0&&(U=q),U?Wn(U,mn()):[]}),G=qe(U=>{const ne=J(U);return D.current.map(ee=>w&&ee==="reference"?w:q&&ee==="floating"?q:ne).filter(Boolean).flat()});M.useEffect(()=>{if(o||!u)return;function U(ee){if(ee.key==="Tab"){Ke(q,xt(Ue(q)))&&J().length===0&&!I&&Ye(ee);const pe=G(),_e=Et(ee);D.current[0]==="reference"&&_e===w&&(Ye(ee),ee.shiftKey?Kt(pe[pe.length-1]):Kt(pe[1])),D.current[1]==="floating"&&_e===q&&ee.shiftKey&&(Ye(ee),Kt(pe[0]))}}const ne=Ue(q);return ne.addEventListener("keydown",U),()=>{ne.removeEventListener("keydown",U)}},[o,w,q,u,D,I,J,G]),M.useEffect(()=>{if(o||!C)return;function U(ne){const ee=Et(ne),_e=J().indexOf(ee);_e!==-1&&(O.current=_e)}return C.addEventListener("focusin",U),()=>{C.removeEventListener("focusin",U)}},[o,C,J]),M.useEffect(()=>{if(o||!p)return;function U(){P.current=!0,setTimeout(()=>{P.current=!1})}function ne(_e){const Z=_e.relatedTarget,de=_e.currentTarget,ye=Et(_e);queueMicrotask(()=>{const ue=S(),Ce=!(Ke(w,Z)||Ke(C,Z)||Ke(Z,C)||Ke(E?.portalNode,Z)||Z!=null&&Z.hasAttribute(Rt("focus-guard"))||y&&(Ht(y.nodesRef.current,ue).find(W=>{var R,H;return Ke((R=W.context)==null?void 0:R.elements.floating,Z)||Ke((H=W.context)==null?void 0:H.elements.domReference,Z)})||hi(y.nodesRef.current,ue).find(W=>{var R,H,he;return[(R=W.context)==null?void 0:R.elements.floating,Rn((H=W.context)==null?void 0:H.elements.floating)].includes(Z)||((he=W.context)==null?void 0:he.elements.domReference)===Z})));if(de===w&&q&&is(q,D),d&&de!==w&&!(ye!=null&&ye.isConnected)&&xt(Ue(q))===Ue(q).body){Ve(q)&&q.focus();const W=O.current,R=J(),H=R[W]||R[R.length-1]||q;Ve(H)&&H.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(I||!u)&&Z&&Ce&&!P.current&&Z!==rs()&&(x.current=!0,g(!1,_e,"focus-out"))})}const ee=!!(!y&&E);function pe(){Xe(B),b.current.insideReactTree=!0,B.current=window.setTimeout(()=>{b.current.insideReactTree=!1})}if(C&&Ve(w))return w.addEventListener("focusout",ne),w.addEventListener("pointerdown",U),C.addEventListener("focusout",ne),ee&&C.addEventListener("focusout",pe,!0),()=>{w.removeEventListener("focusout",ne),w.removeEventListener("pointerdown",U),C.removeEventListener("focusout",ne),ee&&C.removeEventListener("focusout",pe,!0)}},[o,w,C,q,u,y,E,g,p,d,J,I,S,D,b]);const le=M.useRef(null),oe=M.useRef(null),re=os([le,E?.beforeInsideRef]),ce=os([oe,E?.afterInsideRef]);M.useEffect(()=>{var U,ne;if(o||!C)return;const ee=Array.from((E==null||(U=E.portalNode)==null?void 0:U.querySelectorAll("["+Rt("portal")+"]"))||[]),_e=(ne=(y?hi(y.nodesRef.current,S()):[]).find(ye=>{var ue;return Wo(((ue=ye.context)==null?void 0:ue.elements.domReference)||null)}))==null||(ne=ne.context)==null?void 0:ne.elements.domReference,Z=[C,_e,...ee,...k(),z.current,A.current,le.current,oe.current,E?.beforeOutsideRef.current,E?.afterOutsideRef.current,D.current.includes("reference")||I?w:null].filter(ye=>ye!=null),de=u||I?Ji(Z,!N,N):Ji(Z);return()=>{de()}},[o,w,C,u,D,E,I,L,N,y,S,k]),Le(()=>{if(o||!Ve(q))return;const U=Ue(q),ne=xt(U);queueMicrotask(()=>{const ee=G(q),pe=V.current,_e=(typeof pe=="number"?ee[pe]:pe.current)||q,Z=Ke(q,ne);!$&&!Z&&h&&Kt(_e,{preventScroll:_e===q})})},[o,h,q,$,G,V]),Le(()=>{if(o||!q)return;const U=Ue(q),ne=xt(U);Vc(ne);function ee(Z){let{reason:de,event:ye,nested:ue}=Z;if(["hover","safe-polygon"].includes(de)&&ye.type==="mouseleave"&&(x.current=!0),de==="outside-press")if(ue)x.current=!1;else if(mi(ye)||vi(ye))x.current=!1;else{let Ce=!1;document.createElement("div").focus({get preventScroll(){return Ce=!0,!1}}),Ce?x.current=!1:x.current=!0}}m.on("openchange",ee);const pe=U.createElement("span");pe.setAttribute("tabindex","-1"),pe.setAttribute("aria-hidden","true"),Object.assign(pe.style,so),j&&w&&w.insertAdjacentElement("afterend",pe);function _e(){if(typeof T.current=="boolean"){const Z=w||rs();return Z&&Z.isConnected?Z:pe}return T.current.current||pe}return()=>{m.off("openchange",ee);const Z=xt(U),de=Ke(C,Z)||y&&Ht(y.nodesRef.current,S(),!1).some(ue=>{var Ce;return Ke((Ce=ue.context)==null?void 0:Ce.elements.floating,Z)}),ye=_e();queueMicrotask(()=>{const ue=qc(ye);T.current&&!x.current&&Ve(ue)&&(!(ue!==Z&&Z!==U.body)||de)&&ue.focus({preventScroll:!0}),pe.remove()})}},[o,C,q,T,b,m,y,j,w,S]),M.useEffect(()=>(queueMicrotask(()=>{x.current=!1}),()=>{queueMicrotask(nr)}),[o]),Le(()=>{if(!o&&E)return E.setFocusManagerState({modal:u,closeOnFocusOut:p,open:h,onOpenChange:g,domReference:w}),()=>{E.setFocusManagerState(null)}},[o,E,u,h,g,p,w]),Le(()=>{o||q&&is(q,D)},[o,q,D]);function ie(U){return o||!f||!u?null:a.jsx(jc,{ref:U==="start"?z:A,onClick:ne=>g(!1,ne.nativeEvent),children:typeof f=="string"?f:"Dismiss"})}const me=!o&&L&&(u?!I:!0)&&(j||u);return a.jsxs(a.Fragment,{children:[me&&a.jsx(ao,{"data-type":"inside",ref:re,onFocus:U=>{if(u){const ee=G();Kt(r[0]==="reference"?ee[0]:ee[ee.length-1])}else if(E!=null&&E.preserveTabOrder&&E.portalNode)if(x.current=!1,vn(U,E.portalNode)){const ee=yi(w);ee?.focus()}else{var ne;(ne=E.beforeOutsideRef.current)==null||ne.focus()}}}),!I&&ie("start"),t,ie("end"),me&&a.jsx(ao,{"data-type":"inside",ref:ce,onFocus:U=>{if(u)Kt(G()[0]);else if(E!=null&&E.preserveTabOrder&&E.portalNode)if(p&&(x.current=!0),vn(U,E.portalNode)){const ee=xi(w);ee?.focus()}else{var ne;(ne=E.afterOutsideRef.current)==null||ne.focus()}}})]})}function ss(e){return Ve(e.target)&&e.target.tagName==="BUTTON"}function Bc(e){return Ve(e.target)&&e.target.tagName==="A"}function as(e){return Go(e)}function ls(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,dataRef:r,elements:{domReference:i}}=e,{enabled:s=!0,event:l="click",toggle:d=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0,stickIfOpen:p=!0}=n,_=M.useRef(),c=M.useRef(!1),h=M.useMemo(()=>({onPointerDown(g){_.current=g.pointerType},onMouseDown(g){const m=_.current;g.button===0&&l!=="click"&&(pn(m,!0)&&u||(t&&d&&(!(r.current.openEvent&&p)||r.current.openEvent.type==="mousedown")?o(!1,g.nativeEvent,"click"):(g.preventDefault(),o(!0,g.nativeEvent,"click"))))},onClick(g){const m=_.current;if(l==="mousedown"&&_.current){_.current=void 0;return}pn(m,!0)&&u||(t&&d&&(!(r.current.openEvent&&p)||r.current.openEvent.type==="click")?o(!1,g.nativeEvent,"click"):o(!0,g.nativeEvent,"click"))},onKeyDown(g){_.current=void 0,!(g.defaultPrevented||!f||ss(g))&&(g.key===" "&&!as(i)&&(g.preventDefault(),c.current=!0),!Bc(g)&&g.key==="Enter"&&o(!(t&&d),g.nativeEvent,"click"))},onKeyUp(g){g.defaultPrevented||!f||ss(g)||as(i)||g.key===" "&&c.current&&(c.current=!1,o(!(t&&d),g.nativeEvent,"click"))}}),[r,i,l,u,f,o,t,p,d]);return M.useMemo(()=>s?{reference:h}:{},[s,h])}const Hc={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Gc={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},cs=e=>{var n,t;return{escapeKey:typeof e=="boolean"?e:(n=e?.escapeKey)!=null?n:!1,outsidePress:typeof e=="boolean"?e:(t=e?.outsidePress)!=null?t:!0}};function co(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,elements:r,dataRef:i}=e,{enabled:s=!0,escapeKey:l=!0,outsidePress:d=!0,outsidePressEvent:u="pointerdown",referencePress:f=!1,referencePressEvent:p="pointerdown",ancestorScroll:_=!1,bubbles:c,capture:h}=n,g=Wt(),m=qe(typeof d=="function"?d:()=>!1),b=typeof d=="function"?m:d,w=M.useRef(!1),{escapeKey:C,outsidePress:S}=cs(c),{escapeKey:k,outsidePress:$}=cs(h),I=M.useRef(!1),F=qe(y=>{var E;if(!t||!s||!l||y.key!=="Escape"||I.current)return;const z=(E=i.current.floatingContext)==null?void 0:E.nodeId,A=g?Ht(g.nodesRef.current,z):[];if(!C&&(y.stopPropagation(),A.length>0)){let x=!0;if(A.forEach(P=>{var O;if((O=P.context)!=null&&O.open&&!P.context.dataRef.current.__escapeKeyBubbles){x=!1;return}}),!x)return}o(!1,Dl(y)?y.nativeEvent:y,"escape-key")}),L=qe(y=>{var E;const z=()=>{var A;F(y),(A=Et(y))==null||A.removeEventListener("keydown",z)};(E=Et(y))==null||E.addEventListener("keydown",z)}),N=qe(y=>{var E;const z=i.current.insideReactTree;i.current.insideReactTree=!1;const A=w.current;if(w.current=!1,u==="click"&&A||z||typeof b=="function"&&!b(y))return;const x=Et(y),P="["+Rt("inert")+"]",O=Ue(r.floating).querySelectorAll(P);let B=Pe(x)?x:null;for(;B&&!$t(B);){const G=kt(B);if($t(G)||!Pe(G))break;B=G}if(O.length&&Pe(x)&&!Al(x)&&!Ke(x,r.floating)&&Array.from(O).every(G=>!Ke(B,G)))return;if(Ve(x)&&T){const G=$t(x),le=ct(x),oe=/auto|scroll/,re=G||oe.test(le.overflowX),ce=G||oe.test(le.overflowY),ie=re&&x.clientWidth>0&&x.scrollWidth>x.clientWidth,me=ce&&x.clientHeight>0&&x.scrollHeight>x.clientHeight,U=le.direction==="rtl",ne=me&&(U?y.offsetX<=x.offsetWidth-x.clientWidth:y.offsetX>x.clientWidth),ee=ie&&y.offsetY>x.clientHeight;if(ne||ee)return}const j=(E=i.current.floatingContext)==null?void 0:E.nodeId,q=g&&Ht(g.nodesRef.current,j).some(G=>{var le;return Ho(y,(le=G.context)==null?void 0:le.elements.floating)});if(Ho(y,r.floating)||Ho(y,r.domReference)||q)return;const J=g?Ht(g.nodesRef.current,j):[];if(J.length>0){let G=!0;if(J.forEach(le=>{var oe;if((oe=le.context)!=null&&oe.open&&!le.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}o(!1,y,"outside-press")}),D=qe(y=>{var E;const z=()=>{var A;N(y),(A=Et(y))==null||A.removeEventListener(u,z)};(E=Et(y))==null||E.addEventListener(u,z)});M.useEffect(()=>{if(!t||!s)return;i.current.__escapeKeyBubbles=C,i.current.__outsidePressBubbles=S;let y=-1;function E(O){o(!1,O,"ancestor-scroll")}function z(){window.clearTimeout(y),I.current=!0}function A(){y=window.setTimeout(()=>{I.current=!1},On()?5:0)}const x=Ue(r.floating);l&&(x.addEventListener("keydown",k?L:F,k),x.addEventListener("compositionstart",z),x.addEventListener("compositionend",A)),b&&x.addEventListener(u,$?D:N,$);let P=[];return _&&(Pe(r.domReference)&&(P=Pt(r.domReference)),Pe(r.floating)&&(P=P.concat(Pt(r.floating))),!Pe(r.reference)&&r.reference&&r.reference.contextElement&&(P=P.concat(Pt(r.reference.contextElement)))),P=P.filter(O=>{var B;return O!==((B=x.defaultView)==null?void 0:B.visualViewport)}),P.forEach(O=>{O.addEventListener("scroll",E,{passive:!0})}),()=>{l&&(x.removeEventListener("keydown",k?L:F,k),x.removeEventListener("compositionstart",z),x.removeEventListener("compositionend",A)),b&&x.removeEventListener(u,$?D:N,$),P.forEach(O=>{O.removeEventListener("scroll",E)}),window.clearTimeout(y)}},[i,r,l,b,u,t,o,_,s,C,S,F,k,L,N,$,D]),M.useEffect(()=>{i.current.insideReactTree=!1},[i,b,u]);const V=M.useMemo(()=>({onKeyDown:F,...f&&{[Hc[p]]:y=>{o(!1,y.nativeEvent,"reference-press")},...p!=="click"&&{onClick(y){o(!1,y.nativeEvent,"reference-press")}}}}),[F,o,f,p]),T=M.useMemo(()=>({onKeyDown:F,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[Gc[u]]:()=>{i.current.insideReactTree=!0}}),[F,u,i]);return M.useMemo(()=>s?{reference:V,floating:T}:{},[s,V,T])}function Wc(e){const{open:n=!1,onOpenChange:t,elements:o}=e,r=yn(),i=M.useRef({}),[s]=M.useState(()=>Gi()),l=on()!=null;if(process.env.NODE_ENV!=="production"){const c=o.reference;c&&!Pe(c)&&Mc("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),f=qe((c,h,g)=>{i.current.openEvent=c?h:void 0,s.emit("openchange",{open:c,event:h,reason:g,nested:l}),t?.(c,h,g)}),p=M.useMemo(()=>({setPositionReference:u}),[]),_=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:n,onOpenChange:f,elements:_,events:s,floatingId:r,refs:p}),[n,f,_,s,r,p])}function uo(e){e===void 0&&(e={});const{nodeId:n}=e,t=Wc({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||t,r=o.elements,[i,s]=M.useState(null),[l,d]=M.useState(null),f=r?.domReference||i,p=M.useRef(null),_=Wt();Le(()=>{f&&(p.current=f)},[f]);const c=xc({...e,elements:{...r,...l&&{reference:l}}}),h=M.useCallback(C=>{const S=Pe(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;d(S),c.refs.setReference(S)},[c.refs]),g=M.useCallback(C=>{(Pe(C)||C===null)&&(p.current=C,s(C)),(Pe(c.refs.reference.current)||c.refs.reference.current===null||C!==null&&!Pe(C))&&c.refs.setReference(C)},[c.refs]),m=M.useMemo(()=>({...c.refs,setReference:g,setPositionReference:h,domReference:p}),[c.refs,g,h]),b=M.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),w=M.useMemo(()=>({...c,...o,refs:m,elements:b,nodeId:n}),[c,m,b,n,o]);return Le(()=>{o.dataRef.current.floatingContext=w;const C=_?.nodesRef.current.find(S=>S.id===n);C&&(C.context=w)}),M.useMemo(()=>({...c,context:w,refs:m,elements:b}),[c,m,b,w])}function rr(){return El()&&_i()}function Rc(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,events:r,dataRef:i,elements:s}=e,{enabled:l=!0,visibleOnly:d=!0}=n,u=M.useRef(!1),f=M.useRef(-1),p=M.useRef(!0);M.useEffect(()=>{if(!l)return;const c=at(s.domReference);function h(){!t&&Ve(s.domReference)&&s.domReference===xt(Ue(s.domReference))&&(u.current=!0)}function g(){p.current=!0}function m(){p.current=!1}return c.addEventListener("blur",h),rr()&&(c.addEventListener("keydown",g,!0),c.addEventListener("pointerdown",m,!0)),()=>{c.removeEventListener("blur",h),rr()&&(c.removeEventListener("keydown",g,!0),c.removeEventListener("pointerdown",m,!0))}},[s.domReference,t,l]),M.useEffect(()=>{if(!l)return;function c(h){let{reason:g}=h;(g==="reference-press"||g==="escape-key")&&(u.current=!0)}return r.on("openchange",c),()=>{r.off("openchange",c)}},[r,l]),M.useEffect(()=>()=>{Xe(f)},[]);const _=M.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(c){if(u.current)return;const h=Et(c.nativeEvent);if(d&&Pe(h)){if(rr()&&!c.relatedTarget){if(!p.current&&!Go(h))return}else if(!Pl(h))return}o(!0,c.nativeEvent,"focus")},onBlur(c){u.current=!1;const h=c.relatedTarget,g=c.nativeEvent,m=Pe(h)&&h.hasAttribute(Rt("focus-guard"))&&h.getAttribute("data-type")==="outside";f.current=window.setTimeout(()=>{var b;const w=xt(s.domReference?s.domReference.ownerDocument:document);!h&&w===s.domReference||Ke((b=i.current.floatingContext)==null?void 0:b.refs.floating.current,w)||Ke(s.domReference,w)||m||o(!1,g,"focus")})}}),[i,s.domReference,o,d]);return M.useMemo(()=>l?{reference:_}:{},[l,_])}function ir(e,n,t){const o=new Map,r=t==="item";let i=e;if(r&&e){const{[Vi]:s,[qi]:l,...d}=e;i=d}return{...t==="floating"&&{tabIndex:-1,[$c]:""},...i,...n.map(s=>{const l=s?s[t]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((s,l)=>(l&&Object.entries(l).forEach(d=>{let[u,f]=d;if(!(r&&[Vi,qi].includes(u)))if(u.indexOf("on")===0){if(o.has(u)||o.set(u,[]),typeof f=="function"){var p;(p=o.get(u))==null||p.push(f),s[u]=function(){for(var _,c=arguments.length,h=new Array(c),g=0;g<c;g++)h[g]=arguments[g];return(_=o.get(u))==null?void 0:_.map(m=>m(...h)).find(m=>m!==void 0)}}}else s[u]=f}),s),{})}}function fo(e){e===void 0&&(e=[]);const n=e.map(l=>l?.reference),t=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=M.useCallback(l=>ir(l,e,"reference"),n),i=M.useCallback(l=>ir(l,e,"floating"),t),s=M.useCallback(l=>ir(l,e,"item"),o);return M.useMemo(()=>({getReferenceProps:r,getFloatingProps:i,getItemProps:s}),[r,i,s])}const Kc="Escape";function _o(e,n,t){switch(e){case"vertical":return n;case"horizontal":return t;default:return n||t}}function go(e,n){return _o(n,e===ji||e===no,e===bn||e===wn)}function sr(e,n,t){return _o(n,e===no,t?e===bn:e===wn)||e==="Enter"||e===" "||e===""}function ds(e,n,t){return _o(n,t?e===bn:e===wn,e===no)}function us(e,n,t,o){const r=t?e===wn:e===bn,i=e===ji;return n==="both"||n==="horizontal"&&o&&o>1?e===Kc:_o(n,r,i)}function ar(e,n){const{open:t,onOpenChange:o,elements:r,floatingId:i}=e,{listRef:s,activeIndex:l,onNavigate:d=()=>{},enabled:u=!0,selectedIndex:f=null,allowEscape:p=!1,loop:_=!1,nested:c=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:m="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:w=!0,disabledIndices:C=void 0,orientation:S="vertical",parentOrientation:k,cols:$=1,scrollItemIntoView:I=!0,virtualItemRef:F,itemSizes:L,dense:N=!1}=n;process.env.NODE_ENV!=="production"&&(p&&(_||oo("`useListNavigation` looping must be enabled to allow escaping."),g||oo("`useListNavigation` must be virtual to allow escaping.")),S==="vertical"&&$>1&&oo("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const D=Rn(r.floating),V=Ge(D),T=on(),y=Wt();Le(()=>{e.dataRef.current.orientation=S},[e,S]);const E=qe(()=>{d(x.current===-1?null:x.current)}),z=Wo(r.domReference),A=M.useRef(m),x=M.useRef(f??-1),P=M.useRef(null),O=M.useRef(!0),B=M.useRef(E),j=M.useRef(!!r.floating),q=M.useRef(t),J=M.useRef(!1),G=M.useRef(!1),le=Ge(C),oe=Ge(t),re=Ge(I),ce=Ge(f),[ie,me]=M.useState(),[U,ne]=M.useState(),ee=qe(()=>{function W(ge){if(g){var ve;(ve=ge.id)!=null&&ve.endsWith("-fui-option")&&(ge.id=i+"-"+Math.random().toString(16).slice(2,10)),me(ge.id),y?.events.emit("virtualfocus",ge),F&&(F.current=ge)}else Kt(ge,{sync:J.current,preventScroll:!0})}const R=s.current[x.current],H=G.current;R&&W(R),(J.current?ge=>ge():requestAnimationFrame)(()=>{const ge=s.current[x.current]||R;if(!ge)return;R||W(ge);const ve=re.current;ve&&_e&&(H||!O.current)&&(ge.scrollIntoView==null||ge.scrollIntoView(typeof ve=="boolean"?{block:"nearest",inline:"nearest"}:ve))})});Le(()=>{u&&(t&&r.floating?A.current&&f!=null&&(G.current=!0,x.current=f,E()):j.current&&(x.current=-1,B.current()))},[u,t,r.floating,f,E]),Le(()=>{if(u&&t&&r.floating)if(l==null){if(J.current=!1,ce.current!=null)return;if(j.current&&(x.current=-1,ee()),(!q.current||!j.current)&&A.current&&(P.current!=null||A.current===!0&&P.current==null)){let W=0;const R=()=>{s.current[0]==null?(W<2&&(W?requestAnimationFrame:queueMicrotask)(R),W++):(x.current=P.current==null||sr(P.current,S,h)||c?Ro(s,le.current):bi(s,le.current),P.current=null,E())};R()}}else hn(s,l)||(x.current=l,ee(),G.current=!1)},[u,t,r.floating,l,ce,c,s,S,h,E,ee,le]),Le(()=>{var W;if(!u||r.floating||!y||g||!j.current)return;const R=y.nodesRef.current,H=(W=R.find(ve=>ve.id===T))==null||(W=W.context)==null?void 0:W.elements.floating,he=xt(Ue(r.floating)),ge=R.some(ve=>ve.context&&Ke(ve.context.elements.floating,he));H&&!ge&&O.current&&H.focus({preventScroll:!0})},[u,r.floating,y,T,g]),Le(()=>{if(!u||!y||!g||T)return;function W(R){ne(R.id),F&&(F.current=R)}return y.events.on("virtualfocus",W),()=>{y.events.off("virtualfocus",W)}},[u,y,g,T,F]),Le(()=>{B.current=E,q.current=t,j.current=!!r.floating}),Le(()=>{t||(P.current=null,A.current=m)},[t,m]);const pe=l!=null,_e=M.useMemo(()=>{function W(H){if(!oe.current)return;const he=s.current.indexOf(H);he!==-1&&x.current!==he&&(x.current=he,E())}return{onFocus(H){let{currentTarget:he}=H;J.current=!0,W(he)},onClick:H=>{let{currentTarget:he}=H;return he.focus({preventScroll:!0})},onMouseMove(H){let{currentTarget:he}=H;J.current=!0,G.current=!1,b&&W(he)},onPointerLeave(H){let{pointerType:he}=H;if(!(!O.current||he==="touch")&&(J.current=!0,!!b&&(x.current=-1,E(),!g))){var ge;(ge=V.current)==null||ge.focus({preventScroll:!0})}}}},[oe,V,b,s,E,g]),Z=M.useCallback(()=>{var W;return k??(y==null||(W=y.nodesRef.current.find(R=>R.id===T))==null||(W=W.context)==null||(W=W.dataRef)==null?void 0:W.current.orientation)},[T,y,k]),de=qe(W=>{if(O.current=!1,J.current=!0,W.which===229||!oe.current&&W.currentTarget===V.current)return;if(c&&us(W.key,S,h,$)){go(W.key,Z())||Ye(W),o(!1,W.nativeEvent,"list-navigation"),Ve(r.domReference)&&(g?y?.events.emit("virtualfocus",r.domReference):r.domReference.focus());return}const R=x.current,H=Ro(s,C),he=bi(s,C);if(z||(W.key==="Home"&&(Ye(W),x.current=H,E()),W.key==="End"&&(Ye(W),x.current=he,E())),$>1){const ge=L||Array.from({length:s.current.length},()=>({width:1,height:1})),ve=jl(ge,$,N),We=ve.findIndex(Be=>Be!=null&&!Un(s,Be,C)),ft=ve.reduce((Be,Ze,fe)=>Ze!=null&&!Un(s,Ze,C)?fe:Be,-1),nt=ve[ql({current:ve.map(Be=>Be!=null?s.current[Be]:null)},{event:W,orientation:S,loop:_,rtl:h,cols:$,disabledIndices:Hl([...(typeof C!="function"?C:null)||s.current.map((Be,Ze)=>Un(s,Ze,C)?Ze:void 0),void 0],ve),minIndex:We,maxIndex:ft,prevIndex:Bl(x.current>he?H:x.current,ge,ve,$,W.key===no?"bl":W.key===(h?bn:wn)?"tr":"tl"),stopEvent:!0})];if(nt!=null&&(x.current=nt,E()),S==="both")return}if(go(W.key,S)){if(Ye(W),t&&!g&&xt(W.currentTarget.ownerDocument)===W.currentTarget){x.current=sr(W.key,S,h)?H:he,E();return}sr(W.key,S,h)?_?x.current=R>=he?p&&R!==s.current.length?-1:H:Je(s,{startingIndex:R,disabledIndices:C}):x.current=Math.min(he,Je(s,{startingIndex:R,disabledIndices:C})):_?x.current=R<=H?p&&R!==-1?s.current.length:he:Je(s,{startingIndex:R,decrement:!0,disabledIndices:C}):x.current=Math.max(H,Je(s,{startingIndex:R,decrement:!0,disabledIndices:C})),hn(s,x.current)&&(x.current=-1),E()}}),ye=M.useMemo(()=>g&&t&&pe&&{"aria-activedescendant":U||ie},[g,t,pe,U,ie]),ue=M.useMemo(()=>({"aria-orientation":S==="both"?void 0:S,...z?{}:ye,onKeyDown:de,onPointerMove(){O.current=!0}}),[ye,de,S,z]),Ce=M.useMemo(()=>{function W(H){m==="auto"&&mi(H.nativeEvent)&&(A.current=!0)}function R(H){A.current=m,m==="auto"&&vi(H.nativeEvent)&&(A.current=!0)}return{...ye,onKeyDown(H){O.current=!1;const he=H.key.startsWith("Arrow"),ge=["Home","End"].includes(H.key),ve=he||ge,We=ds(H.key,S,h),ft=us(H.key,S,h,$),nt=ds(H.key,Z(),h),Be=go(H.key,S),Ze=(c?nt:Be)||H.key==="Enter"||H.key.trim()==="";if(g&&t){const Ne=y?.nodesRef.current.find(bt=>bt.parentId==null),it=y&&Ne?Ll(y.nodesRef.current,Ne.id):null;if(ve&&it&&F){const bt=new KeyboardEvent("keydown",{key:H.key,bubbles:!0});if(We||ft){var fe,Qe;const te=((fe=it.context)==null?void 0:fe.elements.domReference)===H.currentTarget,Fe=ft&&!te?(Qe=it.context)==null?void 0:Qe.elements.domReference:We?s.current.find(we=>we?.id===ie):null;Fe&&(Ye(H),Fe.dispatchEvent(bt),ne(void 0))}if((Be||ge)&&it.context&&it.context.open&&it.parentId&&H.currentTarget!==it.context.elements.domReference){var be;Ye(H),(be=it.context.elements.domReference)==null||be.dispatchEvent(bt);return}}return de(H)}if(!(!t&&!w&&he)){if(Ze){const Ne=go(H.key,Z());P.current=c&&Ne?null:H.key}if(c){nt&&(Ye(H),t?(x.current=Ro(s,le.current),E()):o(!0,H.nativeEvent,"list-navigation"));return}Be&&(f!=null&&(x.current=f),Ye(H),!t&&w?o(!0,H.nativeEvent,"list-navigation"):de(H),t&&E())}},onFocus(){t&&!g&&(x.current=-1,E())},onPointerDown:R,onPointerEnter:R,onMouseDown:W,onClick:W}},[ie,ye,$,de,le,m,s,c,E,o,t,w,S,Z,h,f,y,g,F]);return M.useMemo(()=>u?{reference:Ce,floating:ue,item:_e}:{},[u,Ce,ue,_e])}const Uc=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function po(e,n){var t,o;n===void 0&&(n={});const{open:r,elements:i,floatingId:s}=e,{enabled:l=!0,role:d="dialog"}=n,u=yn(),f=((t=i.domReference)==null?void 0:t.id)||u,p=M.useMemo(()=>{var w;return((w=Rn(i.floating))==null?void 0:w.id)||s},[i.floating,s]),_=(o=Uc.get(d))!=null?o:d,h=on()!=null,g=M.useMemo(()=>_==="tooltip"||d==="label"?{["aria-"+(d==="label"?"labelledby":"describedby")]:r?p:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":_==="alertdialog"?"dialog":_,"aria-controls":r?p:void 0,..._==="listbox"&&{role:"combobox"},..._==="menu"&&{id:f},..._==="menu"&&h&&{role:"menuitem"},...d==="select"&&{"aria-autocomplete":"none"},...d==="combobox"&&{"aria-autocomplete":"list"}},[_,p,h,r,f,d]),m=M.useMemo(()=>{const w={id:p,..._&&{role:_}};return _==="tooltip"||d==="label"?w:{...w,..._==="menu"&&{"aria-labelledby":f}}},[_,p,f,d]),b=M.useCallback(w=>{let{active:C,selected:S}=w;const k={role:"option",...C&&{id:p+"-fui-option"}};switch(d){case"select":case"combobox":return{...k,"aria-selected":S}}return{}},[p,d]);return M.useMemo(()=>l?{reference:g,floating:m,item:b}:{},[l,g,m,b])}const fs=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(n,t)=>(t?"-":"")+n.toLowerCase());function sn(e,n){return typeof e=="function"?e(n):e}function Yc(e,n){const[t,o]=M.useState(e);return e&&!t&&o(!0),M.useEffect(()=>{if(!e&&t){const r=setTimeout(()=>o(!1),n);return()=>clearTimeout(r)}},[e,t,n]),t}function Xc(e,n){n===void 0&&(n={});const{open:t,elements:{floating:o}}=e,{duration:r=250}=n,s=(typeof r=="number"?r:r.close)||0,[l,d]=M.useState("unmounted"),u=Yc(t,s);return!u&&l==="close"&&d("unmounted"),Le(()=>{if(o){if(t){d("initial");const f=requestAnimationFrame(()=>{Io.flushSync(()=>{d("open")})});return()=>{cancelAnimationFrame(f)}}d("close")}},[t,o]),{isMounted:u,status:l}}function ho(e,n){n===void 0&&(n={});const{initial:t={opacity:0},open:o,close:r,common:i,duration:s=250}=n,l=e.placement,d=l.split("-")[0],u=M.useMemo(()=>({side:d,placement:l}),[d,l]),f=typeof s=="number",p=(f?s:s.open)||0,_=(f?s:s.close)||0,[c,h]=M.useState(()=>({...sn(i,u),...sn(t,u)})),{isMounted:g,status:m}=Xc(e,{duration:s}),b=Ge(t),w=Ge(o),C=Ge(r),S=Ge(i);return Le(()=>{const k=sn(b.current,u),$=sn(C.current,u),I=sn(S.current,u),F=sn(w.current,u)||Object.keys(k).reduce((L,N)=>(L[N]="",L),{});if(m==="initial"&&h(L=>({transitionProperty:L.transitionProperty,...I,...k})),m==="open"&&h({transitionProperty:Object.keys(F).map(fs).join(","),transitionDuration:p+"ms",...I,...F}),m==="close"){const L=$||k;h({transitionProperty:Object.keys(L).map(fs).join(","),transitionDuration:_+"ms",...I,...L})}},[_,C,b,w,S,p,m,u]),{isMounted:g,styles:c}}function _s(e,n){var t;const{open:o,dataRef:r}=e,{listRef:i,activeIndex:s,onMatch:l,onTypingChange:d,enabled:u=!0,findMatch:f=null,resetMs:p=750,ignoreKeys:_=[],selectedIndex:c=null}=n,h=M.useRef(-1),g=M.useRef(""),m=M.useRef((t=c??s)!=null?t:-1),b=M.useRef(null),w=qe(l),C=qe(d),S=Ge(f),k=Ge(_);Le(()=>{o&&(Xe(h),b.current=null,g.current="")},[o]),Le(()=>{if(o&&g.current===""){var N;m.current=(N=c??s)!=null?N:-1}},[o,c,s]);const $=qe(N=>{N?r.current.typing||(r.current.typing=N,C(N)):r.current.typing&&(r.current.typing=N,C(N))}),I=qe(N=>{function D(z,A,x){const P=S.current?S.current(A,x):A.find(O=>O?.toLocaleLowerCase().indexOf(x.toLocaleLowerCase())===0);return P?z.indexOf(P):-1}const V=i.current;if(g.current.length>0&&g.current[0]!==" "&&(D(V,V,g.current)===-1?$(!1):N.key===" "&&Ye(N)),V==null||k.current.includes(N.key)||N.key.length!==1||N.ctrlKey||N.metaKey||N.altKey)return;o&&N.key!==" "&&(Ye(N),$(!0)),V.every(z=>{var A,x;return z?((A=z[0])==null?void 0:A.toLocaleLowerCase())!==((x=z[1])==null?void 0:x.toLocaleLowerCase()):!0})&&g.current===N.key&&(g.current="",m.current=b.current),g.current+=N.key,Xe(h),h.current=window.setTimeout(()=>{g.current="",m.current=b.current,$(!1)},p);const y=m.current,E=D(V,[...V.slice((y||0)+1),...V.slice(0,(y||0)+1)],g.current);E!==-1?(w(E),b.current=E):N.key!==" "&&(g.current="",$(!1))}),F=M.useMemo(()=>({onKeyDown:I}),[I]),L=M.useMemo(()=>({onKeyDown:I,onKeyUp(N){N.key===" "&&$(!1)}}),[I,$]);return M.useMemo(()=>u?{reference:F,floating:L}:{},[u,F,L])}function gs(e,n,t){return t===void 0&&(t=!0),e.filter(r=>{var i;return r.parentId===n&&(!t||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...gs(e,r.id,t)])}function ps(e,n){const[t,o]=e;let r=!1;const i=n.length;for(let s=0,l=i-1;s<i;l=s++){const[d,u]=n[s]||[0,0],[f,p]=n[l]||[0,0];u>=o!=p>=o&&t<=(f-d)*(o-u)/(p-u)+d&&(r=!r)}return r}function Zc(e,n){return e[0]>=n.x&&e[0]<=n.x+n.width&&e[1]>=n.y&&e[1]<=n.y+n.height}function hs(e){e===void 0&&(e={});const{buffer:n=.5,blockPointerEvents:t=!1,requireIntent:o=!0}=e,r={current:-1};let i=!1,s=null,l=null,d=typeof performance<"u"?performance.now():0;function u(p,_){const c=performance.now(),h=c-d;if(s===null||l===null||h===0)return s=p,l=_,d=c,null;const g=p-s,m=_-l,w=Math.sqrt(g*g+m*m)/h;return s=p,l=_,d=c,w}const f=p=>{let{x:_,y:c,placement:h,elements:g,onClose:m,nodeId:b,tree:w}=p;return function(S){function k(){Xe(r),m()}if(Xe(r),!g.domReference||!g.floating||h==null||_==null||c==null)return;const{clientX:$,clientY:I}=S,F=[$,I],L=Ac(S),N=S.type==="mouseleave",D=er(g.floating,L),V=er(g.domReference,L),T=g.domReference.getBoundingClientRect(),y=g.floating.getBoundingClientRect(),E=h.split("-")[0],z=_>y.right-y.width/2,A=c>y.bottom-y.height/2,x=Zc(F,T),P=y.width>T.width,O=y.height>T.height,B=(P?T:y).left,j=(P?T:y).right,q=(O?T:y).top,J=(O?T:y).bottom;if(D&&(i=!0,!N))return;if(V&&(i=!1),V&&!N){i=!0;return}if(N&&Pe(S.relatedTarget)&&er(g.floating,S.relatedTarget)||w&&gs(w.nodesRef.current,b).length)return;if(E==="top"&&c>=T.bottom-1||E==="bottom"&&c<=T.top+1||E==="left"&&_>=T.right-1||E==="right"&&_<=T.left+1)return k();let G=[];switch(E){case"top":G=[[B,T.top+1],[B,y.bottom-1],[j,y.bottom-1],[j,T.top+1]];break;case"bottom":G=[[B,y.top+1],[B,T.bottom-1],[j,T.bottom-1],[j,y.top+1]];break;case"left":G=[[y.right-1,J],[y.right-1,q],[T.left+1,q],[T.left+1,J]];break;case"right":G=[[T.right-1,J],[T.right-1,q],[y.left+1,q],[y.left+1,J]];break}function le(oe){let[re,ce]=oe;switch(E){case"top":{const ie=[P?re+n/2:z?re+n*4:re-n*4,ce+n+1],me=[P?re-n/2:z?re+n*4:re-n*4,ce+n+1],U=[[y.left,z||P?y.bottom-n:y.top],[y.right,z?P?y.bottom-n:y.top:y.bottom-n]];return[ie,me,...U]}case"bottom":{const ie=[P?re+n/2:z?re+n*4:re-n*4,ce-n],me=[P?re-n/2:z?re+n*4:re-n*4,ce-n],U=[[y.left,z||P?y.top+n:y.bottom],[y.right,z?P?y.top+n:y.bottom:y.top+n]];return[ie,me,...U]}case"left":{const ie=[re+n+1,O?ce+n/2:A?ce+n*4:ce-n*4],me=[re+n+1,O?ce-n/2:A?ce+n*4:ce-n*4];return[...[[A||O?y.right-n:y.left,y.top],[A?O?y.right-n:y.left:y.right-n,y.bottom]],ie,me]}case"right":{const ie=[re-n,O?ce+n/2:A?ce+n*4:ce-n*4],me=[re-n,O?ce-n/2:A?ce+n*4:ce-n*4],U=[[A||O?y.left+n:y.right,y.top],[A?O?y.left+n:y.right:y.left+n,y.bottom]];return[ie,me,...U]}}}if(!ps([$,I],G)){if(i&&!x)return k();if(!N&&o){const oe=u(S.clientX,S.clientY);if(oe!==null&&oe<.1)return k()}ps([$,I],le([_,c]))?!i&&o&&(r.current=window.setTimeout(k,40)):k()}}};return f.__options={blockPointerEvents:t},f}function an(e,n,t){let o=t.initialDeps??[],r;function i(){var s,l,d,u;let f;t.key&&((s=t.debug)!=null&&s.call(t))&&(f=Date.now());const p=e();if(!(p.length!==o.length||p.some((h,g)=>o[g]!==h)))return r;o=p;let c;if(t.key&&((l=t.debug)!=null&&l.call(t))&&(c=Date.now()),r=n(...p),t.key&&((d=t.debug)!=null&&d.call(t))){const h=Math.round((Date.now()-f)*100)/100,g=Math.round((Date.now()-c)*100)/100,m=g/16,b=(w,C)=>{for(w=String(w);w.length<C;)w=" "+w;return w};console.info(`%c⏱ ${b(g,5)} /${b(h,5)} ms`,`
|
|
657
|
+
*/var $_=["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])"],Io=$_.join(","),ra=typeof Element>"u",$n=ra?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ko=!ra&&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},Rn=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&&Rn(t.parentNode);return i},E_=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},sa=function(t,n,o){if(Rn(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Io));return n&&$n.call(t,Io)&&r.unshift(t),r=r.filter(o),r},No=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!Rn(i,!1))if(i.tagName==="SLOT"){var l=i.assignedElements(),c=l.length?l:i.children,d=No(c,!0,o);o.flatten?r.push.apply(r,d):r.push({scopeParent:i,candidates:d})}else{var _=$n.call(i,Io);_&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var g=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),u=!Rn(g,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(g&&u){var f=No(g===!0?i.children:g.children,!0,o);o.flatten?r.push.apply(r,f):r.push({scopeParent:i,candidates:f})}else s.unshift.apply(s,i.children)}}return r},ia=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},aa=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||E_(t))&&!ia(t)?0:t.tabIndex},I_=function(t,n){var o=aa(t);return o<0&&n&&!ia(t)?0:o},k_=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},la=function(t){return t.tagName==="INPUT"},N_=function(t){return la(t)&&t.type==="hidden"},M_=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},A_=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},D_=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=A_(r,t.form);return!s||s===t},T_=function(t){return la(t)&&t.type==="radio"},F_=function(t){return T_(t)&&!D_(t)},P_=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},ca=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},L_=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=$n.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if($n.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 ca(t);t.assignedSlot?t=t.assignedSlot:!d&&_!==t.ownerDocument?t=_.host:t=d}t=c}if(P_(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return ca(t);return!1},O_=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 $n.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},Yr=function(t,n){return!(n.disabled||Rn(n)||N_(n)||L_(n,t)||M_(n)||O_(n))},Xr=function(t,n){return!(F_(n)||aa(n)<0||!Yr(t,n))},z_=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},da=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,l=i?r.scopeParent:r,c=I_(l,i),d=i?da(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(k_).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},Mo=function(t,n){n=n||{};var o;return n.getShadowRoot?o=No([t],n.includeContainer,{filter:Xr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:z_}):o=sa(t,n.includeContainer,Xr.bind(null,n)),da(o)},B_=function(t,n){n=n||{};var o;return n.getShadowRoot?o=No([t],n.includeContainer,{filter:Yr.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=sa(t,n.includeContainer,Yr.bind(null,n)),o},ua=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return $n.call(t,Io)===!1?!1:Xr(n,t)};function fa(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function _a(){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 ga(){return/apple/i.test(navigator.vendor)}function Zr(){const e=/android/i;return e.test(fa())||e.test(_a())}function V_(){return fa().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function ha(){return _a().includes("jsdom/")}const pa="data-floating-ui-focusable",j_="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Jr="ArrowLeft",Qr="ArrowRight",q_="ArrowUp",H_="ArrowDown";function Ft(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 rt(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&wo(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function qt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function es(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 R_(e){return e.matches("html,body")}function st(e){return e?.ownerDocument||document}function ts(e){return Ye(e)&&e.matches(j_)}function ns(e){return e?e.getAttribute("role")==="combobox"&&ts(e):!1}function U_(e){if(!e||ha())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Ao(e){return e?e.hasAttribute(pa)?e:e.querySelector("["+pa+"]")||e:null}function _n(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,..._n(e,r.id,n)])}function W_(e,t){let n,o=-1;function r(s,i){i>o&&(n=s,o=i),_n(e,s).forEach(c=>{r(c.id,i+1)})}return r(t,0),e.find(s=>s.id===n)}function ma(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 it(e){e.preventDefault(),e.stopPropagation()}function G_(e){return"nativeEvent"in e}function va(e){return e.mozInputSource===0&&e.isTrusted?!0:Zr()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ba(e){return ha()?!1:!Zr()&&e.width===0&&e.height===0||Zr()&&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 Un(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var K_=typeof document<"u",Y_=function(){},ze=K_?v.useLayoutEffect:Y_;const X_={...I};function et(e){const t=I.useRef(e);return ze(()=>{t.current=e}),t}const Z_=X_.useInsertionEffect||(e=>e());function Xe(e){const t=I.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Z_(()=>{t.current=e}),I.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 Do(e,t,n){return Math.floor(e/t)!==n}function Wn(e,t){return t<0||t>=e.current.length}function os(e,t){return dt(e,{disabledIndices:t})}function wa(e,t){return dt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function dt(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&&To(e,i,r));return i}function J_(e,t){let{event:n,orientation:o,loop:r,rtl:s,cols:i,disabledIndices:l,minIndex:c,maxIndex:d,prevIndex:_,stopEvent:g=!1}=t,u=_;if(n.key===q_){if(g&&it(n),_===-1)u=d;else if(u=dt(e,{startingIndex:u,amount:i,decrement:!0,disabledIndices:l}),r&&(_-i<c||u<0)){const f=_%i,h=d%i,p=d-(h-f);h===f?u=d:u=h>f?p:p-i}Wn(e,u)&&(u=_)}if(n.key===H_&&(g&&it(n),_===-1?u=c:(u=dt(e,{startingIndex:_,amount:i,disabledIndices:l}),r&&_+i>d&&(u=dt(e,{startingIndex:_%i-i,amount:i,disabledIndices:l}))),Wn(e,u)&&(u=_)),o==="both"){const f=Cn(_/i);n.key===(s?Jr:Qr)&&(g&&it(n),_%i!==i-1?(u=dt(e,{startingIndex:_,disabledIndices:l}),r&&Do(u,i,f)&&(u=dt(e,{startingIndex:_-_%i-1,disabledIndices:l}))):r&&(u=dt(e,{startingIndex:_-_%i-1,disabledIndices:l})),Do(u,i,f)&&(u=_)),n.key===(s?Qr:Jr)&&(g&&it(n),_%i!==0?(u=dt(e,{startingIndex:_,decrement:!0,disabledIndices:l}),r&&Do(u,i,f)&&(u=dt(e,{startingIndex:_+(i-_%i),decrement:!0,disabledIndices:l}))):r&&(u=dt(e,{startingIndex:_+(i-_%i),decrement:!0,disabledIndices:l})),Do(u,i,f)&&(u=_));const h=Cn(d/i)===f;Wn(e,u)&&(r&&h?u=n.key===(s?Qr:Jr)?d:dt(e,{startingIndex:_-_%i-1,disabledIndices:l}):u=_)}return u}function Q_(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 u=0;u<c;u++)_.push(r+g+u*t);r%t+l<=t&&_.every(g=>o[g]==null)?(_.forEach(g=>{o[g]=i}),d=!0):r++}}),[...o]}function eg(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 tg(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function To(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 Gn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ya(e,t){const n=Mo(e,Gn()),o=n.length;if(o===0)return;const r=Ft(st(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function Ca(e){return ya(st(e).body,1)||e}function xa(e){return ya(st(e).body,-1)||e}function Kn(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!rt(n,o)}function ng(e){Mo(e,Gn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Sa(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 $a(e,t,n){let{reference:o,floating:r}=e;const s=jt(t),i=Gr(t),l=Wr(i),c=Qt(t),d=s==="y",_=o.x+o.width/2-r.width/2,g=o.y+o.height/2-r.height/2,u=o[l]/2-r[l]/2;let f;switch(c){case"top":f={x:_,y:o.y-r.height};break;case"bottom":f={x:_,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:g};break;case"left":f={x:o.x-r.width,y:g};break;default:f={x:o.x,y:o.y}}switch(Sn(t)){case"start":f[i]-=u*(n&&d?-1:1);break;case"end":f[i]+=u*(n&&d?-1:1);break}return f}const og=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}=$a(d,o,c),u=o,f={},h=0;for(let p=0;p<l.length;p++){const{name:m,fn:w}=l[p],{x:y,y:x,data:$,reset:A}=await w({x:_,y:g,initialPlacement:o,placement:u,strategy:r,middlewareData:f,rects:d,platform:i,elements:{reference:e,floating:t}});_=y??_,g=x??g,f={...f,[m]:{...f[m],...$}},A&&h<=50&&(h++,typeof A=="object"&&(A.placement&&(u=A.placement),A.rects&&(d=A.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):A.rects),{x:_,y:g}=$a(d,u,c)),p=-1)}return{x:_,y:g,placement:u,strategy:r,middlewareData:f}};async function rs(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:u=!1,padding:f=0}=xn(t,e),h=oa(f),m=l[u?g==="floating"?"reference":"floating":g],w=Eo(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})),y=g==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),$=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},A=Eo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:c}):y);return{top:(w.top-A.top+h.top)/$.y,bottom:(A.bottom-w.bottom+h.bottom)/$.y,left:(w.left-A.left+h.left)/$.x,right:(A.right-w.right+h.right)/$.x}}const rg=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}=xn(e,t)||{};if(d==null)return{};const g=oa(_),u={x:n,y:o},f=Gr(r),h=Wr(f),p=await i.getDimensions(d),m=f==="y",w=m?"top":"left",y=m?"bottom":"right",x=m?"clientHeight":"clientWidth",$=s.reference[h]+s.reference[f]-u[f]-s.floating[h],A=u[f]-s.reference[f],F=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let N=F?F[x]:0;(!N||!await(i.isElement==null?void 0:i.isElement(F)))&&(N=l.floating[x]||s.floating[h]);const P=$/2-A/2,T=N/2-p[h]/2-1,k=Jt(g[w],T),z=Jt(g[y],T),B=k,E=N-p[h]-z,b=N/2-p[h]/2+P,S=Ur(B,b,E),O=!c.arrow&&Sn(r)!=null&&b!==S&&s.reference[h]/2-(b<B?k:z)-p[h]/2<0,D=O?b<B?b-B:b-E:0;return{[f]:u[f]+D,data:{[f]:S,centerOffset:b-S-D,...O&&{alignmentOffset:D}},reset:O}}}),sg=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:u,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...m}=xn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=Qt(r),y=jt(l),x=Qt(l)===l,$=await(c.isRTL==null?void 0:c.isRTL(d.floating)),A=u||(x||!p?[$o(l)]:b_(l)),F=h!=="none";!u&&F&&A.push(...x_(l,p,h,$));const N=[l,...A],P=await rs(t,m),T=[];let k=((o=s.flip)==null?void 0:o.overflows)||[];if(_&&T.push(P[w]),g){const b=v_(r,i,$);T.push(P[b[0]],P[b[1]])}if(k=[...k,{placement:r,overflows:T}],!T.every(b=>b<=0)){var z,B;const b=(((z=s.flip)==null?void 0:z.index)||0)+1,S=N[b];if(S&&(!(g==="alignment"?y!==jt(S):!1)||k.every(C=>jt(C.placement)===y?C.overflows[0]>0:!0)))return{data:{index:b,overflows:k},reset:{placement:S}};let O=(B=k.filter(D=>D.overflows[0]<=0).sort((D,C)=>D.overflows[1]-C.overflows[1])[0])==null?void 0:B.placement;if(!O)switch(f){case"bestFit":{var E;const D=(E=k.filter(C=>{if(F){const M=jt(C.placement);return M===y||M==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(M=>M>0).reduce((M,L)=>M+L,0)]).sort((C,M)=>C[1]-M[1])[0])==null?void 0:E[0];D&&(O=D);break}case"initialPlacement":O=l;break}if(r!==O)return{reset:{placement:O}}}return{}}}},ig=new Set(["left","top"]);async function ag(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=Qt(n),l=Sn(n),c=jt(n)==="y",d=ig.has(i)?-1:1,_=s&&c?-1:1,g=xn(t,e);let{mainAxis:u,crossAxis:f,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"&&(f=l==="end"?h*-1:h),c?{x:f*_,y:u*d}:{x:u*d,y:f*_}}const lg=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 ag(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}}}}},cg=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:w,y}=m;return{x:w,y}}},...c}=xn(e,t),d={x:n,y:o},_=await rs(t,c),g=jt(Qt(r)),u=ea(g);let f=d[u],h=d[g];if(s){const m=u==="y"?"top":"left",w=u==="y"?"bottom":"right",y=f+_[m],x=f-_[w];f=Ur(y,f,x)}if(i){const m=g==="y"?"top":"left",w=g==="y"?"bottom":"right",y=h+_[m],x=h-_[w];h=Ur(y,h,x)}const p=l.fn({...t,[u]:f,[g]:h});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[u]:s,[g]:i}}}}}},dg=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}=xn(e,t),_=await rs(t,d),g=Qt(r),u=Sn(r),f=jt(r)==="y",{width:h,height:p}=s.floating;let m,w;g==="top"||g==="bottom"?(m=g,w=u===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(w=g,m=u==="end"?"top":"bottom");const y=p-_.top-_.bottom,x=h-_.left-_.right,$=Jt(p-_[m],y),A=Jt(h-_[w],x),F=!t.middlewareData.shift;let N=$,P=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(N=y),F&&!u){const k=xt(_.left,0),z=xt(_.right,0),B=xt(_.top,0),E=xt(_.bottom,0);f?P=h-2*(k!==0||z!==0?k+z:xt(_.left,_.right)):N=p-2*(B!==0||E!==0?B+E:xt(_.top,_.bottom))}await c({...t,availableWidth:P,availableHeight:N});const T=await i.getDimensions(l.floating);return h!==T.width||p!==T.height?{reset:{rects:!0}}:{}}}};function Ea(e){const t=Ct(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Ye(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,l=So(n)!==s||So(o)!==i;return l&&(n=s,o=i),{width:n,height:o,$:l}}function ss(e){return Oe(e)?e:e.contextElement}function En(e){const t=ss(e);if(!Ye(t))return Tt(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Ea(t);let i=(s?So(n.width):n.width)/o,l=(s?So(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const ug=Tt(0);function Ia(e){const t=bt(e);return!Co()||!t.visualViewport?ug:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fg(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==bt(e)?!1:t}function gn(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=ss(e);let i=Tt(1);t&&(o?Oe(o)&&(i=En(o)):i=En(e));const l=fg(s,n,o)?Ia(s):Tt(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 u=bt(s),f=o&&Oe(o)?bt(o):o;let h=u,p=Rr(h);for(;p&&o&&f!==h;){const m=En(p),w=p.getBoundingClientRect(),y=Ct(p),x=w.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,$=w.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;c*=m.x,d*=m.y,_*=m.x,g*=m.y,c+=x,d+=$,h=bt(p),p=Rr(h)}}return Eo({width:_,height:g,x:c,y:d})}function Fo(e,t){const n=xo(e).scrollLeft;return t?t.left+n:gn(Dt(e)).left+n}function ka(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Fo(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function _g(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=Dt(o),l=t?yo(t.floating):!1;if(o===i||l&&s)return n;let c={scrollLeft:0,scrollTop:0},d=Tt(1);const _=Tt(0),g=Ye(o);if((g||!g&&!s)&&((Xt(o)!=="body"||Hn(i))&&(c=xo(o)),Ye(o))){const f=gn(o);d=En(o),_.x=f.x+o.clientLeft,_.y=f.y+o.clientTop}const u=i&&!g&&!s?ka(i,c):Tt(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+_.x+u.x,y:n.y*d.y-c.scrollTop*d.y+_.y+u.y}}function gg(e){return Array.from(e.getClientRects())}function hg(e){const t=Dt(e),n=xo(e),o=e.ownerDocument.body,r=xt(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=xt(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Fo(e);const l=-n.scrollTop;return Ct(o).direction==="rtl"&&(i+=xt(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:l}}const Na=25;function pg(e,t){const n=bt(e),o=Dt(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,l=0,c=0;if(r){s=r.width,i=r.height;const _=Co();(!_||_&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const d=Fo(o);if(d<=0){const _=o.ownerDocument,g=_.body,u=getComputedStyle(g),f=_.compatMode==="CSS1Compat"&&parseFloat(u.marginLeft)+parseFloat(u.marginRight)||0,h=Math.abs(o.clientWidth-g.clientWidth-f);h<=Na&&(s-=h)}else d<=Na&&(s+=d);return{width:s,height:i,x:l,y:c}}const mg=new Set(["absolute","fixed"]);function vg(e,t){const n=gn(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=Ye(e)?En(e):Tt(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 Ma(e,t,n){let o;if(t==="viewport")o=pg(e,n);else if(t==="document")o=hg(Dt(e));else if(Oe(t))o=vg(t,n);else{const r=Ia(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Eo(o)}function Aa(e,t){const n=Vt(e);return n===t||!Oe(n)||Bt(n)?!1:Ct(n).position==="fixed"||Aa(n,t)}function bg(e,t){const n=t.get(e);if(n)return n;let o=Zt(e,[],!1).filter(l=>Oe(l)&&Xt(l)!=="body"),r=null;const s=Ct(e).position==="fixed";let i=s?Vt(e):e;for(;Oe(i)&&!Bt(i);){const l=Ct(i),c=Hr(i);!c&&l.position==="fixed"&&(r=null),(s?!c&&!r:!c&&l.position==="static"&&!!r&&mg.has(r.position)||Hn(i)&&!c&&Aa(e,i))?o=o.filter(_=>_!==i):r=l,i=Vt(i)}return t.set(e,o),o}function wg(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?yo(t)?[]:bg(t,this._c):[].concat(n),o],l=i[0],c=i.reduce((d,_)=>{const g=Ma(t,_,r);return d.top=xt(g.top,d.top),d.right=Jt(g.right,d.right),d.bottom=Jt(g.bottom,d.bottom),d.left=xt(g.left,d.left),d},Ma(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function yg(e){const{width:t,height:n}=Ea(e);return{width:t,height:n}}function Cg(e,t,n){const o=Ye(t),r=Dt(t),s=n==="fixed",i=gn(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=Tt(0);function d(){c.x=Fo(r)}if(o||!o&&!s)if((Xt(t)!=="body"||Hn(r))&&(l=xo(t)),o){const f=gn(t,!0,s,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else r&&d();s&&!o&&r&&d();const _=r&&!o&&!s?ka(r,l):Tt(0),g=i.left+l.scrollLeft-c.x-_.x,u=i.top+l.scrollTop-c.y-_.y;return{x:g,y:u,width:i.width,height:i.height}}function is(e){return Ct(e).position==="static"}function Da(e,t){if(!Ye(e)||Ct(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Dt(e)===n&&(n=n.ownerDocument.body),n}function Ta(e,t){const n=bt(e);if(yo(e))return n;if(!Ye(e)){let r=Vt(e);for(;r&&!Bt(r);){if(Oe(r)&&!is(r))return r;r=Vt(r)}return n}let o=Da(e,t);for(;o&&l_(o)&&is(o);)o=Da(o,t);return o&&Bt(o)&&is(o)&&!Hr(o)?n:o||__(e)||n}const xg=async function(e){const t=this.getOffsetParent||Ta,n=this.getDimensions,o=await n(e.floating);return{reference:Cg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Sg(e){return Ct(e).direction==="rtl"}const $g={convertOffsetParentRelativeRectToViewportRelativeRect:_g,getDocumentElement:Dt,getClippingRect:wg,getOffsetParent:Ta,getElementRects:xg,getClientRects:gg,getDimensions:yg,getScale:En,isElement:Oe,isRTL:Sg};function Fa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Eg(e,t){let n=null,o;const r=Dt(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:u,height:f}=d;if(l||t(),!u||!f)return;const h=Cn(g),p=Cn(r.clientWidth-(_+u)),m=Cn(r.clientHeight-(g+f)),w=Cn(_),x={rootMargin:-h+"px "+-p+"px "+-m+"px "+-w+"px",threshold:xt(0,Jt(1,c))||1};let $=!0;function A(F){const N=F[0].intersectionRatio;if(N!==c){if(!$)return i();N?i(!1,N):o=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!Fa(d,e.getBoundingClientRect())&&i(),$=!1}try{n=new IntersectionObserver(A,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(A,x)}n.observe(e)}return i(!0),s}function Po(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=ss(e),_=r||s?[...d?Zt(d):[],...Zt(t)]:[];_.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const g=d&&l?Eg(d,n):null;let u=-1,f=null;i&&(f=new ResizeObserver(w=>{let[y]=w;y&&y.target===d&&f&&(f.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(t)})),n()}),d&&!c&&f.observe(d),f.observe(t));let h,p=c?gn(e):null;c&&m();function m(){const w=gn(e);p&&!Fa(p,w)&&n(),p=w,h=requestAnimationFrame(m)}return n(),()=>{var w;_.forEach(y=>{r&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),g?.(),(w=f)==null||w.disconnect(),f=null,c&&cancelAnimationFrame(h)}}const Ig=lg,kg=cg,Ng=sg,Mg=dg,Pa=rg,Ag=(e,t,n)=>{const o=new Map,r={platform:$g,...n},s={...r.platform,_c:o};return og(e,t,{...r,platform:s})};var Dg=typeof document<"u",Tg=function(){},Lo=Dg?v.useLayoutEffect:Tg;function Oo(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(!Oo(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)&&!Oo(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function La(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Oa(e,t){const n=La(e);return Math.round(t*n)/n}function as(e){const t=I.useRef(e);return Lo(()=>{t.current=e}),t}function Fg(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]=I.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[u,f]=I.useState(o);Oo(u,o)||f(o);const[h,p]=I.useState(null),[m,w]=I.useState(null),y=I.useCallback(C=>{C!==F.current&&(F.current=C,p(C))},[]),x=I.useCallback(C=>{C!==N.current&&(N.current=C,w(C))},[]),$=s||h,A=i||m,F=I.useRef(null),N=I.useRef(null),P=I.useRef(_),T=c!=null,k=as(c),z=as(r),B=as(d),E=I.useCallback(()=>{if(!F.current||!N.current)return;const C={placement:t,strategy:n,middleware:u};z.current&&(C.platform=z.current),Ag(F.current,N.current,C).then(M=>{const L={...M,isPositioned:B.current!==!1};b.current&&!Oo(P.current,L)&&(P.current=L,gr.flushSync(()=>{g(L)}))})},[u,t,n,z,B]);Lo(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g(C=>({...C,isPositioned:!1})))},[d]);const b=I.useRef(!1);Lo(()=>(b.current=!0,()=>{b.current=!1}),[]),Lo(()=>{if($&&(F.current=$),A&&(N.current=A),$&&A){if(k.current)return k.current($,A,E);E()}},[$,A,E,k,T]);const S=I.useMemo(()=>({reference:F,floating:N,setReference:y,setFloating:x}),[y,x]),O=I.useMemo(()=>({reference:$,floating:A}),[$,A]),D=I.useMemo(()=>{const C={position:n,left:0,top:0};if(!O.floating)return C;const M=Oa(O.floating,_.x),L=Oa(O.floating,_.y);return l?{...C,transform:"translate("+M+"px, "+L+"px)",...La(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:L}},[n,l,O.floating,_.x,_.y]);return I.useMemo(()=>({..._,update:E,refs:S,elements:O,floatingStyles:D}),[_,E,S,O,D])}const Pg=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?Pa({element:o.current,padding:r}).fn(n):{}:o?Pa({element:o,padding:r}).fn(n):{}}}},zo=(e,t)=>({...Ig(e),options:[e,t]}),Bo=(e,t)=>({...kg(e),options:[e,t]}),Vo=(e,t)=>({...Ng(e),options:[e,t]}),za=(e,t)=>({...Mg(e),options:[e,t]}),Lg=(e,t)=>({...Pg(e),options:[e,t]});function Ba(e){const t=I.useRef(void 0),n=I.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 I.useMemo(()=>e.every(o=>o==null)?null:o=>{t.current&&(t.current(),t.current=void 0),o!=null&&(t.current=n(o))},e)}const Og="data-floating-ui-focusable",Va="active",ja="selected",Yn="ArrowLeft",Xn="ArrowRight",qa="ArrowUp",jo="ArrowDown",zg={...I};let Ha=!1,Bg=0;const Ra=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Bg++;function Vg(){const[e,t]=I.useState(()=>Ha?Ra():void 0);return ze(()=>{e==null&&t(Ra())},[]),I.useEffect(()=>{Ha=!0},[]),e}const Zn=zg.useId||Vg;let Jn;process.env.NODE_ENV!=="production"&&(Jn=new Set);function qo(){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=Jn)!=null&&e.has(r))){var s;(s=Jn)==null||s.add(r),console.warn(r)}}function jg(){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=Jn)!=null&&e.has(r))){var s;(s=Jn)==null||s.add(r),console.error(r)}}const qg=I.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:u,d:f,style:{transform:h,...p}={},...m}=t;process.env.NODE_ENV!=="production"&&(n||qo("The `ref` prop is required for `FloatingArrow`."));const w=Zn(),[y,x]=I.useState(!1);if(ze(()=>{if(!r)return;Ct(r).direction==="rtl"&&x(!0)},[r]),!r)return null;const[$,A]=o.split("-"),F=$==="top"||$==="bottom";let N=g;(F&&i!=null&&i.x||!F&&i!=null&&i.y)&&(N=null);const P=_*2,T=P/2,k=l/2*(d/-8+1),z=c/2*d/4,B=!!f,E=N&&A==="end"?"bottom":"top";let b=N&&A==="end"?"right":"left";N&&y&&(b=A==="end"?"left":"right");const S=s?.x!=null?N||s.x:"",O=s?.y!=null?N||s.y:"",D=f||"M0,0"+(" H"+l)+(" L"+(l-k)+","+(c-z))+(" Q"+l/2+","+c+" "+k+","+(c-z))+" Z",C={top:B?"rotate(180deg)":"",left:B?"rotate(90deg)":"rotate(-90deg)",bottom:B?"":"rotate(180deg)",right:B?"rotate(-90deg)":"rotate(90deg)"}[$];return a.jsxs("svg",{...m,"aria-hidden":!0,ref:n,width:B?l:l+P,height:l,viewBox:"0 0 "+l+" "+(c>l?c:l),style:{position:"absolute",pointerEvents:"none",[b]:S,[E]:O,[$]:F||B?"100%":"calc(100% - "+P/2+"px)",transform:[C,h].filter(M=>!!M).join(" "),...p},children:[P>0&&a.jsx("path",{clipPath:"url(#"+w+")",fill:"none",stroke:u,strokeWidth:P+(f?0:1),d:D}),a.jsx("path",{stroke:P&&!f?m.fill:"none",d:D}),a.jsx("clipPath",{id:w,children:a.jsx("rect",{x:-T,y:T*(B?-1:1),width:l+P,height:l})})]})});function Ua(){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 Wa=I.createContext(null),Ga=I.createContext(null),In=()=>{var e;return((e=I.useContext(Wa))==null?void 0:e.id)||null},hn=()=>I.useContext(Ga);function Ka(e){const t=Zn(),n=hn(),r=In();return ze(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function Ya(e){const{children:t,id:n}=e,o=In();return a.jsx(Wa.Provider,{value:I.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function Hg(e){const{children:t}=e,n=I.useRef([]),o=I.useCallback(i=>{n.current=[...n.current,i]},[]),r=I.useCallback(i=>{n.current=n.current.filter(l=>l!==i)},[]),[s]=I.useState(()=>Ua());return a.jsx(Ga.Provider,{value:I.useMemo(()=>({nodesRef:n,addNode:o,removeNode:r,events:s}),[o,r,s]),children:t})}function pn(e){return"data-floating-ui-"+e}function at(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Xa=pn("safe-polygon");function ls(e,t,n){if(n&&!Un(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 cs(e){return typeof e=="function"?e():e}function ds(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:u=!0}=t,f=hn(),h=In(),p=et(d),m=et(c),w=et(n),y=et(g),x=I.useRef(),$=I.useRef(-1),A=I.useRef(),F=I.useRef(-1),N=I.useRef(!0),P=I.useRef(!1),T=I.useRef(()=>{}),k=I.useRef(!1),z=Xe(()=>{var D;const C=(D=r.current.openEvent)==null?void 0:D.type;return C?.includes("mouse")&&C!=="mousedown"});I.useEffect(()=>{if(!l)return;function D(C){let{open:M}=C;M||(at($),at(F),N.current=!0,k.current=!1)}return s.on("openchange",D),()=>{s.off("openchange",D)}},[l,s]),I.useEffect(()=>{if(!l||!p.current||!n)return;function D(M){z()&&o(!1,M,"hover")}const C=st(i.floating).documentElement;return C.addEventListener("mouseleave",D),()=>{C.removeEventListener("mouseleave",D)}},[i.floating,n,o,l,p,z]);const B=I.useCallback(function(D,C,M){C===void 0&&(C=!0),M===void 0&&(M="hover");const L=ls(m.current,"close",x.current);L&&!A.current?(at($),$.current=window.setTimeout(()=>o(!1,D,M),L)):C&&(at($),o(!1,D,M))},[m,o]),E=Xe(()=>{T.current(),A.current=void 0}),b=Xe(()=>{if(P.current){const D=st(i.floating).body;D.style.pointerEvents="",D.removeAttribute(Xa),P.current=!1}}),S=Xe(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);I.useEffect(()=>{if(!l)return;function D(H){if(at($),N.current=!1,_&&!Un(x.current)||cs(y.current)>0&&!ls(m.current,"open"))return;const j=ls(m.current,"open",x.current);j?$.current=window.setTimeout(()=>{w.current||o(!0,H,"hover")},j):n||o(!0,H,"hover")}function C(H){if(S()){b();return}T.current();const j=st(i.floating);if(at(F),k.current=!1,p.current&&r.current.floatingContext){n||at($),A.current=p.current({...r.current.floatingContext,tree:f,x:H.clientX,y:H.clientY,onClose(){b(),E(),S()||B(H,!0,"safe-polygon")}});const G=A.current;j.addEventListener("mousemove",G),T.current=()=>{j.removeEventListener("mousemove",G)};return}(x.current==="touch"?!rt(i.floating,H.relatedTarget):!0)&&B(H)}function M(H){S()||r.current.floatingContext&&(p.current==null||p.current({...r.current.floatingContext,tree:f,x:H.clientX,y:H.clientY,onClose(){b(),E(),S()||B(H)}})(H))}function L(){at($)}function q(H){S()||B(H,!1)}if(Oe(i.domReference)){const H=i.domReference,j=i.floating;return n&&H.addEventListener("mouseleave",M),u&&H.addEventListener("mousemove",D,{once:!0}),H.addEventListener("mouseenter",D),H.addEventListener("mouseleave",C),j&&(j.addEventListener("mouseleave",M),j.addEventListener("mouseenter",L),j.addEventListener("mouseleave",q)),()=>{n&&H.removeEventListener("mouseleave",M),u&&H.removeEventListener("mousemove",D),H.removeEventListener("mouseenter",D),H.removeEventListener("mouseleave",C),j&&(j.removeEventListener("mouseleave",M),j.removeEventListener("mouseenter",L),j.removeEventListener("mouseleave",q))}}},[i,l,e,_,u,B,E,b,o,n,w,f,m,p,r,S,y]),ze(()=>{var D;if(l&&n&&(D=p.current)!=null&&(D=D.__options)!=null&&D.blockPointerEvents&&z()){P.current=!0;const M=i.floating;if(Oe(i.domReference)&&M){var C;const L=st(i.floating).body;L.setAttribute(Xa,"");const q=i.domReference,H=f==null||(C=f.nodesRef.current.find(j=>j.id===h))==null||(C=C.context)==null?void 0:C.elements.floating;return H&&(H.style.pointerEvents=""),L.style.pointerEvents="none",q.style.pointerEvents="auto",M.style.pointerEvents="auto",()=>{L.style.pointerEvents="",q.style.pointerEvents="",M.style.pointerEvents=""}}}},[l,n,h,i,f,p,z]),ze(()=>{n||(x.current=void 0,k.current=!1,E(),b())},[n,E,b]),I.useEffect(()=>()=>{E(),at($),at(F),b()},[l,i.domReference,E,b]);const O=I.useMemo(()=>{function D(C){x.current=C.pointerType}return{onPointerDown:D,onPointerEnter:D,onMouseMove(C){const{nativeEvent:M}=C;function L(){!N.current&&!w.current&&o(!0,M,"hover")}_&&!Un(x.current)||n||cs(y.current)===0||k.current&&C.movementX**2+C.movementY**2<2||(at(F),x.current==="touch"?L():(k.current=!0,F.current=window.setTimeout(L,cs(y.current))))}}},[_,o,n,w,y]);return I.useMemo(()=>l?{reference:O}:{},[l,O])}let Za=0;function mn(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(Za);const s=()=>e?.focus({preventScroll:n});r?s():Za=requestAnimationFrame(s)}function us(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&wo(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Rg(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ug(e){return e?.ownerDocument||document}const kn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Ja(e){return e==="inert"?kn.inert:e==="aria-hidden"?kn["aria-hidden"]:kn.none}let Ho=new WeakSet,Ro={},fs=0;const Wg=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Qa=e=>e&&(e.host||Qa(e.parentNode)),Gg=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=Qa(n);return e.contains(o)?o:null}).filter(n=>n!=null);function Kg(e,t,n,o){const r="data-floating-ui-inert",s=o?"inert":n?"aria-hidden":null,i=Gg(t,e),l=new Set,c=new Set(i),d=[];Ro[r]||(Ro[r]=new WeakMap);const _=Ro[r];i.forEach(g),u(t),l.clear();function g(f){!f||l.has(f)||(l.add(f),f.parentNode&&g(f.parentNode))}function u(f){!f||c.has(f)||[].forEach.call(f.children,h=>{if(Xt(h)!=="script")if(l.has(h))u(h);else{const p=s?h.getAttribute(s):null,m=p!==null&&p!=="false",w=Ja(s),y=(w.get(h)||0)+1,x=(_.get(h)||0)+1;w.set(h,y),_.set(h,x),d.push(h),y===1&&m&&Ho.add(h),x===1&&h.setAttribute(r,""),!m&&s&&h.setAttribute(s,s==="inert"?"":"true")}})}return fs++,()=>{d.forEach(f=>{const h=Ja(s),m=(h.get(f)||0)-1,w=(_.get(f)||0)-1;h.set(f,m),_.set(f,w),m||(!Ho.has(f)&&s&&f.removeAttribute(s),Ho.delete(f)),w||f.removeAttribute(r)}),fs--,fs||(kn.inert=new WeakMap,kn["aria-hidden"]=new WeakMap,kn.none=new WeakMap,Ho=new WeakSet,Ro={})}}function el(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=Ug(e[0]).body;return Kg(e.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,t,n)}const Uo={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},Wo=I.forwardRef(function(t,n){const[o,r]=I.useState();ze(()=>{ga()&&r("button")},[]);const s={ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[pn("focus-guard")]:"",style:Uo};return a.jsx("span",{...t,...s})}),tl=I.createContext(null),nl=pn("portal");function Yg(e){e===void 0&&(e={});const{id:t,root:n}=e,o=Zn(),r=ol(),[s,i]=I.useState(null),l=I.useRef(null);return ze(()=>()=>{s?.remove(),queueMicrotask(()=>{l.current=null})},[s]),ze(()=>{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(nl,""),c.appendChild(d),l.current=d,i(d)},[t,o]),ze(()=>{if(n===null||!o||l.current)return;let c=n||r?.portalNode;c&&!qr(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(nl,""),c=d||c,c.appendChild(_),l.current=_,i(_)},[t,n,o,r]),s}function Go(e){const{children:t,id:n,root:o,preserveTabOrder:r=!0}=e,s=Yg({id:n,root:o}),[i,l]=I.useState(null),c=I.useRef(null),d=I.useRef(null),_=I.useRef(null),g=I.useRef(null),u=i?.modal,f=i?.open,h=!!i&&!i.modal&&i.open&&r&&!!(o||s);return I.useEffect(()=>{if(!s||!r||u)return;function p(m){s&&Kn(m)&&(m.type==="focusin"?Sa:ng)(s)}return s.addEventListener("focusin",p,!0),s.addEventListener("focusout",p,!0),()=>{s.removeEventListener("focusin",p,!0),s.removeEventListener("focusout",p,!0)}},[s,r,u]),I.useEffect(()=>{s&&(f||Sa(s))},[f,s]),a.jsxs(tl.Provider,{value:I.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:c,afterOutsideRef:d,beforeInsideRef:_,afterInsideRef:g,portalNode:s,setFocusManagerState:l}),[r,s]),children:[h&&s&&a.jsx(Wo,{"data-type":"outside",ref:c,onFocus:p=>{if(Kn(p,s)){var m;(m=_.current)==null||m.focus()}else{const w=i?i.domReference:null,y=xa(w);y?.focus()}}}),h&&s&&a.jsx("span",{"aria-owns":s.id,style:Uo}),s&&gr.createPortal(t,s),h&&s&&a.jsx(Wo,{"data-type":"outside",ref:d,onFocus:p=>{if(Kn(p,s)){var m;(m=g.current)==null||m.focus()}else{const w=i?i.domReference:null,y=Ca(w);y?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,p.nativeEvent,"focus-out")}}})]})}const ol=()=>I.useContext(tl);function rl(e){return I.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const Xg=20;let en=[];function _s(){en=en.filter(e=>e.isConnected)}function Zg(e){_s(),e&&Xt(e)!=="body"&&(en.push(e),en.length>Xg&&(en=en.slice(-20)))}function sl(){return _s(),en[en.length-1]}function Jg(e){const t=Gn();return ua(e,t)?e:Mo(e,t)[0]||e}function il(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const o=Gn(),s=B_(e,o).filter(l=>{const c=l.getAttribute("data-tabindex")||"";return ua(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 Qg=I.forwardRef(function(t,n){return a.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:Uo})});function gs(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:u=!1,getInsideElements:f=()=>[]}=e,{open:h,onOpenChange:p,events:m,dataRef:w,elements:{domReference:y,floating:x}}=t,$=Xe(()=>{var X;return(X=w.current.floatingContext)==null?void 0:X.nodeId}),A=Xe(f),F=typeof i=="number"&&i<0,N=ns(y)&&F,P=Wg(),T=P?s:!0,k=!T||P&&u,z=et(r),B=et(i),E=et(l),b=hn(),S=ol(),O=I.useRef(null),D=I.useRef(null),C=I.useRef(!1),M=I.useRef(!1),L=I.useRef(-1),q=I.useRef(-1),H=S!=null,j=Ao(x),J=Xe(function(X){return X===void 0&&(X=j),X?Mo(X,Gn()):[]}),G=Xe(X=>{const oe=J(X);return z.current.map(K=>y&&K==="reference"?y:j&&K==="floating"?j:oe).filter(Boolean).flat()});I.useEffect(()=>{if(o||!d)return;function X(K){if(K.key==="Tab"){rt(j,Ft(st(j)))&&J().length===0&&!N&&it(K);const ye=G(),le=qt(K);z.current[0]==="reference"&&le===y&&(it(K),K.shiftKey?mn(ye[ye.length-1]):mn(ye[1])),z.current[1]==="floating"&&le===j&&K.shiftKey&&(it(K),mn(ye[0]))}}const oe=st(j);return oe.addEventListener("keydown",X),()=>{oe.removeEventListener("keydown",X)}},[o,y,j,d,z,N,J,G]),I.useEffect(()=>{if(o||!x)return;function X(oe){const K=qt(oe),le=J().indexOf(K);le!==-1&&(L.current=le)}return x.addEventListener("focusin",X),()=>{x.removeEventListener("focusin",X)}},[o,x,J]),I.useEffect(()=>{if(o||!g)return;function X(){M.current=!0,setTimeout(()=>{M.current=!1})}function oe(le){const Q=le.relatedTarget,ne=le.currentTarget,xe=qt(le);queueMicrotask(()=>{const ce=$(),Ee=!(rt(y,Q)||rt(x,Q)||rt(Q,x)||rt(S?.portalNode,Q)||Q!=null&&Q.hasAttribute(pn("focus-guard"))||b&&(_n(b.nodesRef.current,ce).find(U=>{var V,R;return rt((V=U.context)==null?void 0:V.elements.floating,Q)||rt((R=U.context)==null?void 0:R.elements.domReference,Q)})||ma(b.nodesRef.current,ce).find(U=>{var V,R,ue;return[(V=U.context)==null?void 0:V.elements.floating,Ao((R=U.context)==null?void 0:R.elements.floating)].includes(Q)||((ue=U.context)==null?void 0:ue.elements.domReference)===Q})));if(ne===y&&j&&il(j,z),c&&ne!==y&&!(xe!=null&&xe.isConnected)&&Ft(st(j))===st(j).body){Ye(j)&&j.focus();const U=L.current,V=J(),R=V[U]||V[V.length-1]||j;Ye(R)&&R.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(N||!d)&&Q&&Ee&&!M.current&&Q!==sl()&&(C.current=!0,p(!1,le,"focus-out"))})}const K=!!(!b&&S);function ye(){at(q),w.current.insideReactTree=!0,q.current=window.setTimeout(()=>{w.current.insideReactTree=!1})}if(x&&Ye(y))return y.addEventListener("focusout",oe),y.addEventListener("pointerdown",X),x.addEventListener("focusout",oe),K&&x.addEventListener("focusout",ye,!0),()=>{y.removeEventListener("focusout",oe),y.removeEventListener("pointerdown",X),x.removeEventListener("focusout",oe),K&&x.removeEventListener("focusout",ye,!0)}},[o,y,x,j,d,b,S,p,g,c,J,N,$,z,w]);const me=I.useRef(null),de=I.useRef(null),se=rl([me,S?.beforeInsideRef]),_e=rl([de,S?.afterInsideRef]);I.useEffect(()=>{var X,oe;if(o||!x)return;const K=Array.from((S==null||(X=S.portalNode)==null?void 0:X.querySelectorAll("["+pn("portal")+"]"))||[]),le=(oe=(b?ma(b.nodesRef.current,$()):[]).find(xe=>{var ce;return ns(((ce=xe.context)==null?void 0:ce.elements.domReference)||null)}))==null||(oe=oe.context)==null?void 0:oe.elements.domReference,Q=[x,le,...K,...A(),O.current,D.current,me.current,de.current,S?.beforeOutsideRef.current,S?.afterOutsideRef.current,z.current.includes("reference")||N?y:null].filter(xe=>xe!=null),ne=d||N?el(Q,!k,k):el(Q);return()=>{ne()}},[o,y,x,d,z,S,N,T,k,b,$,A]),ze(()=>{if(o||!Ye(j))return;const X=st(j),oe=Ft(X);queueMicrotask(()=>{const K=G(j),ye=B.current,le=(typeof ye=="number"?K[ye]:ye.current)||j,Q=rt(j,oe);!F&&!Q&&h&&mn(le,{preventScroll:le===j})})},[o,h,j,F,G,B]),ze(()=>{if(o||!j)return;const X=st(j),oe=Ft(X);Zg(oe);function K(Q){let{reason:ne,event:xe,nested:ce}=Q;if(["hover","safe-polygon"].includes(ne)&&xe.type==="mouseleave"&&(C.current=!0),ne==="outside-press")if(ce)C.current=!1;else if(va(xe)||ba(xe))C.current=!1;else{let Ee=!1;document.createElement("div").focus({get preventScroll(){return Ee=!0,!1}}),Ee?C.current=!1:C.current=!0}}m.on("openchange",K);const ye=X.createElement("span");ye.setAttribute("tabindex","-1"),ye.setAttribute("aria-hidden","true"),Object.assign(ye.style,Uo),H&&y&&y.insertAdjacentElement("afterend",ye);function le(){if(typeof E.current=="boolean"){const Q=y||sl();return Q&&Q.isConnected?Q:ye}return E.current.current||ye}return()=>{m.off("openchange",K);const Q=Ft(X),ne=rt(x,Q)||b&&_n(b.nodesRef.current,$(),!1).some(ce=>{var Ee;return rt((Ee=ce.context)==null?void 0:Ee.elements.floating,Q)}),xe=le();queueMicrotask(()=>{const ce=Jg(xe);E.current&&!C.current&&Ye(ce)&&(!(ce!==Q&&Q!==X.body)||ne)&&ce.focus({preventScroll:!0}),ye.remove()})}},[o,x,j,E,w,m,b,H,y,$]),I.useEffect(()=>(queueMicrotask(()=>{C.current=!1}),()=>{queueMicrotask(_s)}),[o]),ze(()=>{if(!o&&S)return S.setFocusManagerState({modal:d,closeOnFocusOut:g,open:h,onOpenChange:p,domReference:y}),()=>{S.setFocusManagerState(null)}},[o,S,d,h,p,g,y]),ze(()=>{o||j&&il(j,z)},[o,j,z]);function ge(X){return o||!_||!d?null:a.jsx(Qg,{ref:X==="start"?O:D,onClick:oe=>p(!1,oe.nativeEvent),children:typeof _=="string"?_:"Dismiss"})}const $e=!o&&T&&(d?!N:!0)&&(H||d);return a.jsxs(a.Fragment,{children:[$e&&a.jsx(Wo,{"data-type":"inside",ref:se,onFocus:X=>{if(d){const K=G();mn(r[0]==="reference"?K[0]:K[K.length-1])}else if(S!=null&&S.preserveTabOrder&&S.portalNode)if(C.current=!1,Kn(X,S.portalNode)){const K=Ca(y);K?.focus()}else{var oe;(oe=S.beforeOutsideRef.current)==null||oe.focus()}}}),!N&&ge("start"),n,ge("end"),$e&&a.jsx(Wo,{"data-type":"inside",ref:_e,onFocus:X=>{if(d)mn(G()[0]);else if(S!=null&&S.preserveTabOrder&&S.portalNode)if(g&&(C.current=!0),Kn(X,S.portalNode)){const K=xa(y);K?.focus()}else{var oe;(oe=S.afterOutsideRef.current)==null||oe.focus()}}})]})}function al(e){return Ye(e.target)&&e.target.tagName==="BUTTON"}function eh(e){return Ye(e.target)&&e.target.tagName==="A"}function ll(e){return ts(e)}function cl(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,u=I.useRef(),f=I.useRef(!1),h=I.useMemo(()=>({onPointerDown(p){u.current=p.pointerType},onMouseDown(p){const m=u.current;p.button===0&&l!=="click"&&(Un(m,!0)&&d||(n&&c&&(!(r.current.openEvent&&g)||r.current.openEvent.type==="mousedown")?o(!1,p.nativeEvent,"click"):(p.preventDefault(),o(!0,p.nativeEvent,"click"))))},onClick(p){const m=u.current;if(l==="mousedown"&&u.current){u.current=void 0;return}Un(m,!0)&&d||(n&&c&&(!(r.current.openEvent&&g)||r.current.openEvent.type==="click")?o(!1,p.nativeEvent,"click"):o(!0,p.nativeEvent,"click"))},onKeyDown(p){u.current=void 0,!(p.defaultPrevented||!_||al(p))&&(p.key===" "&&!ll(s)&&(p.preventDefault(),f.current=!0),!eh(p)&&p.key==="Enter"&&o(!(n&&c),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!_||al(p)||ll(s)||p.key===" "&&f.current&&(f.current=!1,o(!(n&&c),p.nativeEvent,"click"))}}),[r,s,l,d,_,o,n,g,c]);return I.useMemo(()=>i?{reference:h}:{},[i,h])}const th={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},nh={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},dl=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 Ko(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:u=!1,bubbles:f,capture:h}=t,p=hn(),m=Xe(typeof c=="function"?c:()=>!1),w=typeof c=="function"?m:c,y=I.useRef(!1),{escapeKey:x,outsidePress:$}=dl(f),{escapeKey:A,outsidePress:F}=dl(h),N=I.useRef(!1),P=Xe(b=>{var S;if(!n||!i||!l||b.key!=="Escape"||N.current)return;const O=(S=s.current.floatingContext)==null?void 0:S.nodeId,D=p?_n(p.nodesRef.current,O):[];if(!x&&(b.stopPropagation(),D.length>0)){let C=!0;if(D.forEach(M=>{var L;if((L=M.context)!=null&&L.open&&!M.context.dataRef.current.__escapeKeyBubbles){C=!1;return}}),!C)return}o(!1,G_(b)?b.nativeEvent:b,"escape-key")}),T=Xe(b=>{var S;const O=()=>{var D;P(b),(D=qt(b))==null||D.removeEventListener("keydown",O)};(S=qt(b))==null||S.addEventListener("keydown",O)}),k=Xe(b=>{var S;const O=s.current.insideReactTree;s.current.insideReactTree=!1;const D=y.current;if(y.current=!1,d==="click"&&D||O||typeof w=="function"&&!w(b))return;const C=qt(b),M="["+pn("inert")+"]",L=st(r.floating).querySelectorAll(M);let q=Oe(C)?C:null;for(;q&&!Bt(q);){const G=Vt(q);if(Bt(G)||!Oe(G))break;q=G}if(L.length&&Oe(C)&&!R_(C)&&!rt(C,r.floating)&&Array.from(L).every(G=>!rt(q,G)))return;if(Ye(C)&&E){const G=Bt(C),me=Ct(C),de=/auto|scroll/,se=G||de.test(me.overflowX),_e=G||de.test(me.overflowY),ge=se&&C.clientWidth>0&&C.scrollWidth>C.clientWidth,$e=_e&&C.clientHeight>0&&C.scrollHeight>C.clientHeight,X=me.direction==="rtl",oe=$e&&(X?b.offsetX<=C.offsetWidth-C.clientWidth:b.offsetX>C.clientWidth),K=ge&&b.offsetY>C.clientHeight;if(oe||K)return}const H=(S=s.current.floatingContext)==null?void 0:S.nodeId,j=p&&_n(p.nodesRef.current,H).some(G=>{var me;return es(b,(me=G.context)==null?void 0:me.elements.floating)});if(es(b,r.floating)||es(b,r.domReference)||j)return;const J=p?_n(p.nodesRef.current,H):[];if(J.length>0){let G=!0;if(J.forEach(me=>{var de;if((de=me.context)!=null&&de.open&&!me.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}o(!1,b,"outside-press")}),z=Xe(b=>{var S;const O=()=>{var D;k(b),(D=qt(b))==null||D.removeEventListener(d,O)};(S=qt(b))==null||S.addEventListener(d,O)});I.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=x,s.current.__outsidePressBubbles=$;let b=-1;function S(L){o(!1,L,"ancestor-scroll")}function O(){window.clearTimeout(b),N.current=!0}function D(){b=window.setTimeout(()=>{N.current=!1},Co()?5:0)}const C=st(r.floating);l&&(C.addEventListener("keydown",A?T:P,A),C.addEventListener("compositionstart",O),C.addEventListener("compositionend",D)),w&&C.addEventListener(d,F?z:k,F);let M=[];return u&&(Oe(r.domReference)&&(M=Zt(r.domReference)),Oe(r.floating)&&(M=M.concat(Zt(r.floating))),!Oe(r.reference)&&r.reference&&r.reference.contextElement&&(M=M.concat(Zt(r.reference.contextElement)))),M=M.filter(L=>{var q;return L!==((q=C.defaultView)==null?void 0:q.visualViewport)}),M.forEach(L=>{L.addEventListener("scroll",S,{passive:!0})}),()=>{l&&(C.removeEventListener("keydown",A?T:P,A),C.removeEventListener("compositionstart",O),C.removeEventListener("compositionend",D)),w&&C.removeEventListener(d,F?z:k,F),M.forEach(L=>{L.removeEventListener("scroll",S)}),window.clearTimeout(b)}},[s,r,l,w,d,n,o,u,i,x,$,P,A,T,k,F,z]),I.useEffect(()=>{s.current.insideReactTree=!1},[s,w,d]);const B=I.useMemo(()=>({onKeyDown:P,..._&&{[th[g]]:b=>{o(!1,b.nativeEvent,"reference-press")},...g!=="click"&&{onClick(b){o(!1,b.nativeEvent,"reference-press")}}}}),[P,o,_,g]),E=I.useMemo(()=>({onKeyDown:P,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[nh[d]]:()=>{s.current.insideReactTree=!0}}),[P,d,s]);return I.useMemo(()=>i?{reference:B,floating:E}:{},[i,B,E])}function oh(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=Zn(),s=I.useRef({}),[i]=I.useState(()=>Ua()),l=In()!=null;if(process.env.NODE_ENV!=="production"){const f=o.reference;f&&!Oe(f)&&jg("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]=I.useState(o.reference),_=Xe((f,h,p)=>{s.current.openEvent=f?h:void 0,i.emit("openchange",{open:f,event:h,reason:p,nested:l}),n?.(f,h,p)}),g=I.useMemo(()=>({setPositionReference:d}),[]),u=I.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return I.useMemo(()=>({dataRef:s,open:t,onOpenChange:_,elements:u,events:i,floatingId:r,refs:g}),[t,_,u,i,r,g])}function Yo(e){e===void 0&&(e={});const{nodeId:t}=e,n=oh({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,r=o.elements,[s,i]=I.useState(null),[l,c]=I.useState(null),_=r?.domReference||s,g=I.useRef(null),u=hn();ze(()=>{_&&(g.current=_)},[_]);const f=Fg({...e,elements:{...r,...l&&{reference:l}}}),h=I.useCallback(x=>{const $=Oe(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;c($),f.refs.setReference($)},[f.refs]),p=I.useCallback(x=>{(Oe(x)||x===null)&&(g.current=x,i(x)),(Oe(f.refs.reference.current)||f.refs.reference.current===null||x!==null&&!Oe(x))&&f.refs.setReference(x)},[f.refs]),m=I.useMemo(()=>({...f.refs,setReference:p,setPositionReference:h,domReference:g}),[f.refs,p,h]),w=I.useMemo(()=>({...f.elements,domReference:_}),[f.elements,_]),y=I.useMemo(()=>({...f,...o,refs:m,elements:w,nodeId:t}),[f,m,w,t,o]);return ze(()=>{o.dataRef.current.floatingContext=y;const x=u?.nodesRef.current.find($=>$.id===t);x&&(x.context=y)}),I.useMemo(()=>({...f,context:y,refs:m,elements:w}),[f,m,w,y])}function hs(){return V_()&&ga()}function rh(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=I.useRef(!1),_=I.useRef(-1),g=I.useRef(!0);I.useEffect(()=>{if(!l)return;const f=bt(i.domReference);function h(){!n&&Ye(i.domReference)&&i.domReference===Ft(st(i.domReference))&&(d.current=!0)}function p(){g.current=!0}function m(){g.current=!1}return f.addEventListener("blur",h),hs()&&(f.addEventListener("keydown",p,!0),f.addEventListener("pointerdown",m,!0)),()=>{f.removeEventListener("blur",h),hs()&&(f.removeEventListener("keydown",p,!0),f.removeEventListener("pointerdown",m,!0))}},[i.domReference,n,l]),I.useEffect(()=>{if(!l)return;function f(h){let{reason:p}=h;(p==="reference-press"||p==="escape-key")&&(d.current=!0)}return r.on("openchange",f),()=>{r.off("openchange",f)}},[r,l]),I.useEffect(()=>()=>{at(_)},[]);const u=I.useMemo(()=>({onMouseLeave(){d.current=!1},onFocus(f){if(d.current)return;const h=qt(f.nativeEvent);if(c&&Oe(h)){if(hs()&&!f.relatedTarget){if(!g.current&&!ts(h))return}else if(!U_(h))return}o(!0,f.nativeEvent,"focus")},onBlur(f){d.current=!1;const h=f.relatedTarget,p=f.nativeEvent,m=Oe(h)&&h.hasAttribute(pn("focus-guard"))&&h.getAttribute("data-type")==="outside";_.current=window.setTimeout(()=>{var w;const y=Ft(i.domReference?i.domReference.ownerDocument:document);!h&&y===i.domReference||rt((w=s.current.floatingContext)==null?void 0:w.refs.floating.current,y)||rt(i.domReference,y)||m||o(!1,p,"focus")})}}),[s,i.domReference,o,c]);return I.useMemo(()=>l?{reference:u}:{},[l,u])}function ps(e,t,n){const o=new Map,r=n==="item";let s=e;if(r&&e){const{[Va]:i,[ja]:l,...c}=e;s=c}return{...n==="floating"&&{tabIndex:-1,[Og]:""},...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&&[Va,ja].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 u,f=arguments.length,h=new Array(f),p=0;p<f;p++)h[p]=arguments[p];return(u=o.get(d))==null?void 0:u.map(m=>m(...h)).find(m=>m!==void 0)}}}else i[d]=_}),i),{})}}function Xo(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=I.useCallback(l=>ps(l,e,"reference"),t),s=I.useCallback(l=>ps(l,e,"floating"),n),i=I.useCallback(l=>ps(l,e,"item"),o);return I.useMemo(()=>({getReferenceProps:r,getFloatingProps:s,getItemProps:i}),[r,s,i])}const sh="Escape";function Zo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Jo(e,t){return Zo(t,e===qa||e===jo,e===Yn||e===Xn)}function ms(e,t,n){return Zo(t,e===jo,n?e===Yn:e===Xn)||e==="Enter"||e===" "||e===""}function ul(e,t,n){return Zo(t,n?e===Yn:e===Xn,e===jo)}function fl(e,t,n,o){const r=n?e===Xn:e===Yn,s=e===qa;return t==="both"||t==="horizontal"&&o&&o>1?e===sh:Zo(t,r,s)}function vs(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:u=!1,nested:f=!1,rtl:h=!1,virtual:p=!1,focusItemOnOpen:m="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:y=!0,disabledIndices:x=void 0,orientation:$="vertical",parentOrientation:A,cols:F=1,scrollItemIntoView:N=!0,virtualItemRef:P,itemSizes:T,dense:k=!1}=t;process.env.NODE_ENV!=="production"&&(g&&(u||qo("`useListNavigation` looping must be enabled to allow escaping."),p||qo("`useListNavigation` must be virtual to allow escaping.")),$==="vertical"&&F>1&&qo("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const z=Ao(r.floating),B=et(z),E=In(),b=hn();ze(()=>{e.dataRef.current.orientation=$},[e,$]);const S=Xe(()=>{c(C.current===-1?null:C.current)}),O=ns(r.domReference),D=I.useRef(m),C=I.useRef(_??-1),M=I.useRef(null),L=I.useRef(!0),q=I.useRef(S),H=I.useRef(!!r.floating),j=I.useRef(n),J=I.useRef(!1),G=I.useRef(!1),me=et(x),de=et(n),se=et(N),_e=et(_),[ge,$e]=I.useState(),[X,oe]=I.useState(),K=Xe(()=>{function U(he){if(p){var pe;(pe=he.id)!=null&&pe.endsWith("-fui-option")&&(he.id=s+"-"+Math.random().toString(16).slice(2,10)),$e(he.id),b?.events.emit("virtualfocus",he),P&&(P.current=he)}else mn(he,{sync:J.current,preventScroll:!0})}const V=i.current[C.current],R=G.current;V&&U(V),(J.current?he=>he():requestAnimationFrame)(()=>{const he=i.current[C.current]||V;if(!he)return;V||U(he);const pe=se.current;pe&&le&&(R||!L.current)&&(he.scrollIntoView==null||he.scrollIntoView(typeof pe=="boolean"?{block:"nearest",inline:"nearest"}:pe))})});ze(()=>{d&&(n&&r.floating?D.current&&_!=null&&(G.current=!0,C.current=_,S()):H.current&&(C.current=-1,q.current()))},[d,n,r.floating,_,S]),ze(()=>{if(d&&n&&r.floating)if(l==null){if(J.current=!1,_e.current!=null)return;if(H.current&&(C.current=-1,K()),(!j.current||!H.current)&&D.current&&(M.current!=null||D.current===!0&&M.current==null)){let U=0;const V=()=>{i.current[0]==null?(U<2&&(U?requestAnimationFrame:queueMicrotask)(V),U++):(C.current=M.current==null||ms(M.current,$,h)||f?os(i,me.current):wa(i,me.current),M.current=null,S())};V()}}else Wn(i,l)||(C.current=l,K(),G.current=!1)},[d,n,r.floating,l,_e,f,i,$,h,S,K,me]),ze(()=>{var U;if(!d||r.floating||!b||p||!H.current)return;const V=b.nodesRef.current,R=(U=V.find(pe=>pe.id===E))==null||(U=U.context)==null?void 0:U.elements.floating,ue=Ft(st(r.floating)),he=V.some(pe=>pe.context&&rt(pe.context.elements.floating,ue));R&&!he&&L.current&&R.focus({preventScroll:!0})},[d,r.floating,b,E,p]),ze(()=>{if(!d||!b||!p||E)return;function U(V){oe(V.id),P&&(P.current=V)}return b.events.on("virtualfocus",U),()=>{b.events.off("virtualfocus",U)}},[d,b,p,E,P]),ze(()=>{q.current=S,j.current=n,H.current=!!r.floating}),ze(()=>{n||(M.current=null,D.current=m)},[n,m]);const ye=l!=null,le=I.useMemo(()=>{function U(R){if(!de.current)return;const ue=i.current.indexOf(R);ue!==-1&&C.current!==ue&&(C.current=ue,S())}return{onFocus(R){let{currentTarget:ue}=R;J.current=!0,U(ue)},onClick:R=>{let{currentTarget:ue}=R;return ue.focus({preventScroll:!0})},onMouseMove(R){let{currentTarget:ue}=R;J.current=!0,G.current=!1,w&&U(ue)},onPointerLeave(R){let{pointerType:ue}=R;if(!(!L.current||ue==="touch")&&(J.current=!0,!!w&&(C.current=-1,S(),!p))){var he;(he=B.current)==null||he.focus({preventScroll:!0})}}}},[de,B,w,i,S,p]),Q=I.useCallback(()=>{var U;return A??(b==null||(U=b.nodesRef.current.find(V=>V.id===E))==null||(U=U.context)==null||(U=U.dataRef)==null?void 0:U.current.orientation)},[E,b,A]),ne=Xe(U=>{if(L.current=!1,J.current=!0,U.which===229||!de.current&&U.currentTarget===B.current)return;if(f&&fl(U.key,$,h,F)){Jo(U.key,Q())||it(U),o(!1,U.nativeEvent,"list-navigation"),Ye(r.domReference)&&(p?b?.events.emit("virtualfocus",r.domReference):r.domReference.focus());return}const V=C.current,R=os(i,x),ue=wa(i,x);if(O||(U.key==="Home"&&(it(U),C.current=R,S()),U.key==="End"&&(it(U),C.current=ue,S())),F>1){const he=T||Array.from({length:i.current.length},()=>({width:1,height:1})),pe=Q_(he,F,k),Ne=pe.findIndex(we=>we!=null&&!To(i,we,x)),Re=pe.reduce((we,Je,nt)=>Je!=null&&!To(i,Je,x)?nt:we,-1),tt=pe[J_({current:pe.map(we=>we!=null?i.current[we]:null)},{event:U,orientation:$,loop:u,rtl:h,cols:F,disabledIndices:tg([...(typeof x!="function"?x:null)||i.current.map((we,Je)=>To(i,Je,x)?Je:void 0),void 0],pe),minIndex:Ne,maxIndex:Re,prevIndex:eg(C.current>ue?R:C.current,he,pe,F,U.key===jo?"bl":U.key===(h?Yn:Xn)?"tr":"tl"),stopEvent:!0})];if(tt!=null&&(C.current=tt,S()),$==="both")return}if(Jo(U.key,$)){if(it(U),n&&!p&&Ft(U.currentTarget.ownerDocument)===U.currentTarget){C.current=ms(U.key,$,h)?R:ue,S();return}ms(U.key,$,h)?u?C.current=V>=ue?g&&V!==i.current.length?-1:R:dt(i,{startingIndex:V,disabledIndices:x}):C.current=Math.min(ue,dt(i,{startingIndex:V,disabledIndices:x})):u?C.current=V<=R?g&&V!==-1?i.current.length:ue:dt(i,{startingIndex:V,decrement:!0,disabledIndices:x}):C.current=Math.max(R,dt(i,{startingIndex:V,decrement:!0,disabledIndices:x})),Wn(i,C.current)&&(C.current=-1),S()}}),xe=I.useMemo(()=>p&&n&&ye&&{"aria-activedescendant":X||ge},[p,n,ye,X,ge]),ce=I.useMemo(()=>({"aria-orientation":$==="both"?void 0:$,...O?{}:xe,onKeyDown:ne,onPointerMove(){L.current=!0}}),[xe,ne,$,O]),Ee=I.useMemo(()=>{function U(R){m==="auto"&&va(R.nativeEvent)&&(D.current=!0)}function V(R){D.current=m,m==="auto"&&ba(R.nativeEvent)&&(D.current=!0)}return{...xe,onKeyDown(R){L.current=!1;const ue=R.key.startsWith("Arrow"),he=["Home","End"].includes(R.key),pe=ue||he,Ne=ul(R.key,$,h),Re=fl(R.key,$,h,F),tt=ul(R.key,Q(),h),we=Jo(R.key,$),Je=(f?tt:we)||R.key==="Enter"||R.key.trim()==="";if(p&&n){const Ue=b?.nodesRef.current.find(ot=>ot.parentId==null),Te=b&&Ue?W_(b.nodesRef.current,Ue.id):null;if(pe&&Te&&P){const ot=new KeyboardEvent("keydown",{key:R.key,bubbles:!0});if(Ne||Re){var nt,ve;const ee=((nt=Te.context)==null?void 0:nt.elements.domReference)===R.currentTarget,Ie=Re&&!ee?(ve=Te.context)==null?void 0:ve.elements.domReference:Ne?i.current.find(Be=>Be?.id===ge):null;Ie&&(it(R),Ie.dispatchEvent(ot),oe(void 0))}if((we||he)&&Te.context&&Te.context.open&&Te.parentId&&R.currentTarget!==Te.context.elements.domReference){var Ce;it(R),(Ce=Te.context.elements.domReference)==null||Ce.dispatchEvent(ot);return}}return ne(R)}if(!(!n&&!y&&ue)){if(Je){const Ue=Jo(R.key,Q());M.current=f&&Ue?null:R.key}if(f){tt&&(it(R),n?(C.current=os(i,me.current),S()):o(!0,R.nativeEvent,"list-navigation"));return}we&&(_!=null&&(C.current=_),it(R),!n&&y?o(!0,R.nativeEvent,"list-navigation"):ne(R),n&&S())}},onFocus(){n&&!p&&(C.current=-1,S())},onPointerDown:V,onPointerEnter:V,onMouseDown:U,onClick:U}},[ge,xe,F,ne,me,m,i,f,S,o,n,y,$,Q,h,_,b,p,P]);return I.useMemo(()=>d?{reference:Ee,floating:ce,item:le}:{},[d,Ee,ce,le])}const ih=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Qo(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=Zn(),_=((n=s.domReference)==null?void 0:n.id)||d,g=I.useMemo(()=>{var y;return((y=Ao(s.floating))==null?void 0:y.id)||i},[s.floating,i]),u=(o=ih.get(c))!=null?o:c,h=In()!=null,p=I.useMemo(()=>u==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:r?g:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":u==="alertdialog"?"dialog":u,"aria-controls":r?g:void 0,...u==="listbox"&&{role:"combobox"},...u==="menu"&&{id:_},...u==="menu"&&h&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[u,g,h,r,_,c]),m=I.useMemo(()=>{const y={id:g,...u&&{role:u}};return u==="tooltip"||c==="label"?y:{...y,...u==="menu"&&{"aria-labelledby":_}}},[u,g,_,c]),w=I.useCallback(y=>{let{active:x,selected:$}=y;const A={role:"option",...x&&{id:g+"-fui-option"}};switch(c){case"select":case"combobox":return{...A,"aria-selected":$}}return{}},[g,c]);return I.useMemo(()=>l?{reference:p,floating:m,item:w}:{},[l,p,m,w])}const _l=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function Nn(e,t){return typeof e=="function"?e(t):e}function ah(e,t){const[n,o]=I.useState(e);return e&&!n&&o(!0),I.useEffect(()=>{if(!e&&n){const r=setTimeout(()=>o(!1),t);return()=>clearTimeout(r)}},[e,n,t]),n}function lh(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]=I.useState("unmounted"),d=ah(n,i);return!d&&l==="close"&&c("unmounted"),ze(()=>{if(o){if(n){c("initial");const _=requestAnimationFrame(()=>{gr.flushSync(()=>{c("open")})});return()=>{cancelAnimationFrame(_)}}c("close")}},[n,o]),{isMounted:d,status:l}}function er(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=I.useMemo(()=>({side:c,placement:l}),[c,l]),_=typeof i=="number",g=(_?i:i.open)||0,u=(_?i:i.close)||0,[f,h]=I.useState(()=>({...Nn(s,d),...Nn(n,d)})),{isMounted:p,status:m}=lh(e,{duration:i}),w=et(n),y=et(o),x=et(r),$=et(s);return ze(()=>{const A=Nn(w.current,d),F=Nn(x.current,d),N=Nn($.current,d),P=Nn(y.current,d)||Object.keys(A).reduce((T,k)=>(T[k]="",T),{});if(m==="initial"&&h(T=>({transitionProperty:T.transitionProperty,...N,...A})),m==="open"&&h({transitionProperty:Object.keys(P).map(_l).join(","),transitionDuration:g+"ms",...N,...P}),m==="close"){const T=F||A;h({transitionProperty:Object.keys(T).map(_l).join(","),transitionDuration:u+"ms",...N,...T})}},[u,x,w,y,$,g,m,d]),{isMounted:p,styles:f}}function gl(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:u=[],selectedIndex:f=null}=t,h=I.useRef(-1),p=I.useRef(""),m=I.useRef((n=f??i)!=null?n:-1),w=I.useRef(null),y=Xe(l),x=Xe(c),$=et(_),A=et(u);ze(()=>{o&&(at(h),w.current=null,p.current="")},[o]),ze(()=>{if(o&&p.current===""){var k;m.current=(k=f??i)!=null?k:-1}},[o,f,i]);const F=Xe(k=>{k?r.current.typing||(r.current.typing=k,x(k)):r.current.typing&&(r.current.typing=k,x(k))}),N=Xe(k=>{function z(O,D,C){const M=$.current?$.current(D,C):D.find(L=>L?.toLocaleLowerCase().indexOf(C.toLocaleLowerCase())===0);return M?O.indexOf(M):-1}const B=s.current;if(p.current.length>0&&p.current[0]!==" "&&(z(B,B,p.current)===-1?F(!1):k.key===" "&&it(k)),B==null||A.current.includes(k.key)||k.key.length!==1||k.ctrlKey||k.metaKey||k.altKey)return;o&&k.key!==" "&&(it(k),F(!0)),B.every(O=>{var D,C;return O?((D=O[0])==null?void 0:D.toLocaleLowerCase())!==((C=O[1])==null?void 0:C.toLocaleLowerCase()):!0})&&p.current===k.key&&(p.current="",m.current=w.current),p.current+=k.key,at(h),h.current=window.setTimeout(()=>{p.current="",m.current=w.current,F(!1)},g);const b=m.current,S=z(B,[...B.slice((b||0)+1),...B.slice(0,(b||0)+1)],p.current);S!==-1?(y(S),w.current=S):k.key!==" "&&(p.current="",F(!1))}),P=I.useMemo(()=>({onKeyDown:N}),[N]),T=I.useMemo(()=>({onKeyDown:N,onKeyUp(k){k.key===" "&&F(!1)}}),[N,F]);return I.useMemo(()=>d?{reference:P,floating:T}:{},[d,P,T])}function hl(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,...hl(e,r.id,n)])}function pl(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 ch(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function ml(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,u){const f=performance.now(),h=f-c;if(i===null||l===null||h===0)return i=g,l=u,c=f,null;const p=g-i,m=u-l,y=Math.sqrt(p*p+m*m)/h;return i=g,l=u,c=f,y}const _=g=>{let{x:u,y:f,placement:h,elements:p,onClose:m,nodeId:w,tree:y}=g;return function($){function A(){at(r),m()}if(at(r),!p.domReference||!p.floating||h==null||u==null||f==null)return;const{clientX:F,clientY:N}=$,P=[F,N],T=Rg($),k=$.type==="mouseleave",z=us(p.floating,T),B=us(p.domReference,T),E=p.domReference.getBoundingClientRect(),b=p.floating.getBoundingClientRect(),S=h.split("-")[0],O=u>b.right-b.width/2,D=f>b.bottom-b.height/2,C=ch(P,E),M=b.width>E.width,L=b.height>E.height,q=(M?E:b).left,H=(M?E:b).right,j=(L?E:b).top,J=(L?E:b).bottom;if(z&&(s=!0,!k))return;if(B&&(s=!1),B&&!k){s=!0;return}if(k&&Oe($.relatedTarget)&&us(p.floating,$.relatedTarget)||y&&hl(y.nodesRef.current,w).length)return;if(S==="top"&&f>=E.bottom-1||S==="bottom"&&f<=E.top+1||S==="left"&&u>=E.right-1||S==="right"&&u<=E.left+1)return A();let G=[];switch(S){case"top":G=[[q,E.top+1],[q,b.bottom-1],[H,b.bottom-1],[H,E.top+1]];break;case"bottom":G=[[q,b.top+1],[q,E.bottom-1],[H,E.bottom-1],[H,b.top+1]];break;case"left":G=[[b.right-1,J],[b.right-1,j],[E.left+1,j],[E.left+1,J]];break;case"right":G=[[E.right-1,J],[E.right-1,j],[b.left+1,j],[b.left+1,J]];break}function me(de){let[se,_e]=de;switch(S){case"top":{const ge=[M?se+t/2:O?se+t*4:se-t*4,_e+t+1],$e=[M?se-t/2:O?se+t*4:se-t*4,_e+t+1],X=[[b.left,O||M?b.bottom-t:b.top],[b.right,O?M?b.bottom-t:b.top:b.bottom-t]];return[ge,$e,...X]}case"bottom":{const ge=[M?se+t/2:O?se+t*4:se-t*4,_e-t],$e=[M?se-t/2:O?se+t*4:se-t*4,_e-t],X=[[b.left,O||M?b.top+t:b.bottom],[b.right,O?M?b.top+t:b.bottom:b.top+t]];return[ge,$e,...X]}case"left":{const ge=[se+t+1,L?_e+t/2:D?_e+t*4:_e-t*4],$e=[se+t+1,L?_e-t/2:D?_e+t*4:_e-t*4];return[...[[D||L?b.right-t:b.left,b.top],[D?L?b.right-t:b.left:b.right-t,b.bottom]],ge,$e]}case"right":{const ge=[se-t,L?_e+t/2:D?_e+t*4:_e-t*4],$e=[se-t,L?_e-t/2:D?_e+t*4:_e-t*4],X=[[D||L?b.left+t:b.right,b.top],[D?L?b.left+t:b.right:b.left+t,b.bottom]];return[ge,$e,...X]}}}if(!pl([F,N],G)){if(s&&!C)return A();if(!k&&o){const de=d($.clientX,$.clientY);if(de!==null&&de<.1)return A()}pl([F,N],me([u,f]))?!s&&o&&(r.current=window.setTimeout(A,40)):A()}}};return _.__options={blockPointerEvents:n},_}function Mn(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((h,p)=>o[p]!==h)))return r;o=g;let f;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(f=Date.now()),r=t(...g),n.key&&((c=n.debug)!=null&&c.call(n))){const h=Math.round((Date.now()-_)*100)/100,p=Math.round((Date.now()-f)*100)/100,m=p/16,w=(y,x)=>{for(y=String(y);y.length<x;)y=" "+y;return y};console.info(`%c⏱ ${w(p,5)} /${w(h,5)} ms`,`
|
|
5
658
|
font-size: .6rem;
|
|
6
659
|
font-weight: bold;
|
|
7
|
-
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,t?.key)}return(u=t?.onChange)==null||u.call(t,r),r}return i.updateDeps=s=>{o=s},i}function ms(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const Qc=(e,n)=>Math.abs(e-n)<1.01,Jc=(e,n,t)=>{let o;return function(...r){e.clearTimeout(o),o=e.setTimeout(()=>n.apply(this,r),t)}},vs=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},ed=e=>e,td=e=>{const n=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let r=n;r<=t;r++)o.push(r);return o},nd=(e,n)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;const r=s=>{const{width:l,height:d}=s;n({width:Math.round(l),height:Math.round(d)})};if(r(vs(t)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver(s=>{const l=()=>{const d=s[0];if(d?.borderBoxSize){const u=d.borderBoxSize[0];if(u){r({width:u.inlineSize,height:u.blockSize});return}}r(vs(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},bs={passive:!0},ws=typeof window>"u"?!0:"onscrollend"in window,od=(e,n)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;let r=0;const i=e.options.useScrollendEvent&&ws?()=>{}:Jc(o,()=>{n(r,!1)},e.options.isScrollingResetDelay),s=f=>()=>{const{horizontal:p,isRtl:_}=e.options;r=p?t.scrollLeft*(_&&-1||1):t.scrollTop,i(),n(r,f)},l=s(!0),d=s(!1);d(),t.addEventListener("scroll",l,bs);const u=e.options.useScrollendEvent&&ws;return u&&t.addEventListener("scrollend",d,bs),()=>{t.removeEventListener("scroll",l),u&&t.removeEventListener("scrollend",d)}},rd=(e,n,t)=>{if(n?.borderBoxSize){const o=n.borderBoxSize[0];if(o)return Math.round(o[t.options.horizontal?"inlineSize":"blockSize"])}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},id=(e,{adjustments:n=0,behavior:t},o)=>{var r,i;const s=e+n;(i=(r=o.scrollElement)==null?void 0:r.scrollTo)==null||i.call(r,{[o.options.horizontal?"left":"top"]:s,behavior:t})};class sd{constructor(n){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 t=null;const o=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(r=>{r.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var r;(r=o())==null||r.disconnect(),t=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=t=>{Object.entries(t).forEach(([o,r])=>{typeof r>"u"&&delete t[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ed,rangeExtractor:td,onChange:()=>{},measureElement:rd,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,...t}},this.notify=t=>{var o,r;(r=(o=this.options).onChange)==null||r.call(o,this,t)},this.maybeNotify=an(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{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(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;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=((t=this.scrollElement)==null?void 0:t.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=(t,o)=>{const r=new Map,i=new Map;for(let s=o-1;s>=0;s--){const l=t[s];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((s,l)=>s.end===l.end?s.index-l.index:s.end-l.end)[0]:void 0},this.getMeasurementOptions=an(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,o,r,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:s}),{key:!1}),this.getMeasurements=an(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:s},l)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const d=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,d);for(let f=d;f<t;f++){const p=i(f),_=this.options.lanes===1?u[f-1]:this.getFurthestMeasurement(u,f),c=_?_.end+this.options.gap:o+r,h=l.get(p),g=typeof h=="number"?h:this.options.estimateSize(f),m=c+g,b=_?_.lane:f%this.options.lanes;u[f]={index:f,start:c,size:g,end:m,key:p,lane:b}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=an(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,o,r,i)=>this.range=t.length>0&&o>0?ad({measurements:t,outerSize:o,scrollOffset:r,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=an(()=>{let t=null,o=null;const r=this.calculateRange();return r&&(t=r.startIndex,o=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,o]},(t,o,r,i,s)=>i===null||s===null?[]:t({startIndex:i,endIndex:s,overscan:o,count:r}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const o=this.options.indexAttribute,r=t.getAttribute(o);return r?parseInt(r,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(t,o)=>{const r=this.indexFromElement(t),i=this.measurementsCache[r];if(!i)return;const s=i.key,l=this.elementsCache.get(s);l!==t&&(l&&this.observer.unobserve(l),this.observer.observe(t),this.elementsCache.set(s,t)),t.isConnected&&this.resizeItem(r,this.options.measureElement(t,o,this))},this.resizeItem=(t,o)=>{const r=this.measurementsCache[t];if(!r)return;const i=this.itemSizeCache.get(r.key)??r.size,s=o-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,s,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,o)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((o,r)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(r))});return}this._measureElement(t,void 0)},this.getVirtualItems=an(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,o)=>{const r=[];for(let i=0,s=t.length;i<s;i++){const l=t[i],d=o[l];r.push(d)}return r},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const o=this.getMeasurements();if(o.length!==0)return ms(o[ys(0,o.length-1,r=>ms(o[r]).start,t)])},this.getOffsetForAlignment=(t,o,r=0)=>{const i=this.getSize(),s=this.getScrollOffset();o==="auto"&&(o=t>=s+i?"end":"start"),o==="center"?t+=(r-i)/2:o==="end"&&(t-=i);const l=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(l,t),0)},this.getOffsetForIndex=(t,o="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const r=this.measurementsCache[t];if(!r)return;const i=this.getSize(),s=this.getScrollOffset();if(o==="auto")if(r.end>=s+i-this.options.scrollPaddingEnd)o="end";else if(r.start<=s+this.options.scrollPaddingStart)o="start";else return[s,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=(t,{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(t,o),{adjustments:void 0,behavior:r})},this.scrollToIndex=(t,{align:o="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let i=0;const s=10,l=u=>{if(!this.targetWindow)return;const f=this.getOffsetForIndex(t,u);if(!f){console.warn("Failed to get offset for index:",t);return}const[p,_]=f;this._scrollToOffset(p,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const c=this.getScrollOffset(),h=this.getOffsetForIndex(t,_);if(!h){console.warn("Failed to get offset for index:",t);return}Qc(h[0],c)||d(_)})},d=u=>{this.targetWindow&&(i++,i<s?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,s),this.targetWindow.requestAnimationFrame(()=>l(u))):console.warn(`Failed to scroll to index ${t} after ${s} attempts.`))};l(o)},this.scrollBy=(t,{behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var t;const o=this.getMeasurements();let r;if(o.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((t=o[o.length-1])==null?void 0:t.end)??0;else{const i=Array(this.options.lanes).fill(null);let s=o.length-1;for(;s>=0&&i.some(l=>l===null);){const l=o[s];i[l.lane]===null&&(i[l.lane]=l.end),s--}r=Math.max(...i.filter(l=>l!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:o,behavior:r})=>{this.options.scrollToFn(t,{behavior:r,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(n)}}const ys=(e,n,t,o)=>{for(;e<=n;){const r=(e+n)/2|0,i=t(r);if(i<o)e=r+1;else if(i>o)n=r-1;else return r}return e>0?e-1:0};function ad({measurements:e,outerSize:n,scrollOffset:t,lanes:o}){const r=e.length-1,i=d=>e[d].start;if(e.length<=o)return{startIndex:0,endIndex:r};let s=ys(0,r,i,t),l=s;if(o===1)for(;l<r&&e[l].end<t+n;)l++;else if(o>1){const d=Array(o).fill(0);for(;l<r&&d.some(f=>f<t+n);){const f=e[l];d[f.lane]=f.end,l++}const u=Array(o).fill(t+n);for(;s>=0&&u.some(f=>f>=t);){const f=e[s];u[f.lane]=f.start,s--}s=Math.max(0,s-s%o),l=Math.min(r,l+(o-1-l%o))}return{startIndex:s,endIndex:l}}const xs=typeof document<"u"?M.useLayoutEffect:M.useEffect;function ld(e){const n=M.useReducer(()=>({}),{})[1],t={...e,onChange:(r,i)=>{var s;i?un.flushSync(n):n(),(s=e.onChange)==null||s.call(e,r,i)}},[o]=M.useState(()=>new sd(t));return o.setOptions(t),xs(()=>o._didMount(),[]),xs(()=>o._willUpdate()),o}function cd(e){return ld({observeElementRect:nd,observeElementOffset:od,scrollToFn:id,...e})}function dd(e,n){const[t,o]=M.useState(e);return M.useEffect(()=>{const r=setTimeout(()=>{o(e)},n);return()=>{clearTimeout(r)}},[e,n]),t}function mo(e){const n=M.useCallback(r=>{const i=window.matchMedia(e);return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[e]),t=()=>window.matchMedia(e).matches,o=()=>{throw Error("useMediaQuery is a client-only hook")};return M.useSyncExternalStore(n,t,o)}function lr(e,n){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[n]??"":e)}function Cn(e,n){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[n]??"":e)}function vo(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function Cs(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function Ss(e,n,t,o){if(!n.trim())return e;const r=Cs(n.trim());return o?e.filter(i=>o(i,n)):e.filter(i=>Cs(lr(i,t)).includes(r))}function ud(e){if(e.length===0)return!1;const n=e[0];return typeof n=="object"&&n!==null&&"grupo"in n&&"opciones"in n&&Array.isArray(n.opciones)}function fd(e){const n=[];let t=0;for(const o of e){n.push({tipo:"grupo",datos:null,nombreGrupo:o.grupo,indice:t++});for(const r of o.opciones)n.push({tipo:"opcion",datos:r,indice:t++})}return n}function _d(e,n,t,o){return n.trim()?e.map(r=>({...r,opciones:Ss(r.opciones,n,t,o)})).filter(r=>r.opciones.length>0):e}function gd(e){return e.map((n,t)=>n.tipo==="grupo"||n.datos&&vo(n.datos)?t:null).filter(n=>n!==null)}function pd(e,n){if(!n)return null;const t=n(e);return t===!0||t==null?null:typeof t=="string"?t:typeof t=="object"&&"message"in t?t.message??"Selección inválida":"Selección inválida"}function hd(e,n,t){return e!==void 0?e:n==="invalid"?!0:n==="valid"?!1:!!t}function md(e,n="Opción"){return Array.from({length:e},(t,o)=>`${n} ${o+1}`)}function vd(e){return Array.from({length:e},(n,t)=>({id:`usr-${t+1}`,nombre:`Usuario ${t+1}`,email:`usuario${t+1}@test.com`}))}const $s=({size:e="1em",...n})=>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",...n,children:a.jsx("path",{d:"m6 9 6 6 6-6"})}),ks=({size:e="1em",...n})=>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",...n,children:[a.jsx("path",{d:"M18 6 6 18"}),a.jsx("path",{d:"m6 6 12 12"})]}),bd=({size:e="1em",...n})=>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",...n,children:a.jsx("path",{d:"M20 6 9 17l-5-5"})}),wd=({size:e="1em",...n})=>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",...n,children:[a.jsx("circle",{cx:"11",cy:"11",r:"8"}),a.jsx("path",{d:"m21 21-4.3-4.3"})]}),yd=({size:e="1em",...n})=>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",...n,children:a.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),Y={contenedor_base:"_contenedor_base_1co2q_1",tam_sm:"_tam_sm_1co2q_41",tam_lg:"_tam_lg_1co2q_55",radio_none:"_radio_none_1co2q_69",radio_sm:"_radio_sm_1co2q_77",radio_md:"_radio_md_1co2q_85",radio_lg:"_radio_lg_1co2q_93",radio_full:"_radio_full_1co2q_101",color_default:"_color_default_1co2q_109",color_primary:"_color_primary_1co2q_111",color_secondary:"_color_secondary_1co2q_119",color_success:"_color_success_1co2q_127",color_warning:"_color_warning_1co2q_135",color_danger:"_color_danger_1co2q_143",etiqueta:"_etiqueta_1co2q_151",marca_requerido:"_marca_requerido_1co2q_167",trigger:"_trigger_1co2q_177",trigger_expandido:"_trigger_expandido_1co2q_213",variante_bordered:"_variante_bordered_1co2q_223",variante_faded:"_variante_faded_1co2q_233",variante_underlined:"_variante_underlined_1co2q_243",variante_ghost:"_variante_ghost_1co2q_259",deshabilitado:"_deshabilitado_1co2q_271",solo_lectura:"_solo_lectura_1co2q_291",valor_texto:"_valor_texto_1co2q_307",abierto:"_abierto_1co2q_335",valido:"_valido_1co2q_343",invalido:"_invalido_1co2q_351",contenido_inicio:"_contenido_inicio_1co2q_403",contenido_final:"_contenido_final_1co2q_405",valor_wrapper:"_valor_wrapper_1co2q_423",mostrar_todos:"_mostrar_todos_1co2q_443",valor_wrapper_expandido:"_valor_wrapper_expandido_1co2q_453",placeholder:"_placeholder_1co2q_469",chip_multi:"_chip_multi_1co2q_479",chip_texto:"_chip_texto_1co2q_513",chip_cerrar:"_chip_cerrar_1co2q_525",contador_multi:"_contador_multi_1co2q_565",acciones:"_acciones_1co2q_579",boton_limpiar:"_boton_limpiar_1co2q_593",tiene_valor:"_tiene_valor_1co2q_645",icono_chevron:"_icono_chevron_1co2q_655",icono_spinner:"_icono_spinner_1co2q_677",girarSpinner:"_girarSpinner_1co2q_1",menu:"_menu_1co2q_711",buscador_wrapper:"_buscador_wrapper_1co2q_741",buscador_interno:"_buscador_interno_1co2q_753",icono_buscar:"_icono_buscar_1co2q_783",input_busqueda:"_input_busqueda_1co2q_795",lista_opciones:"_lista_opciones_1co2q_827",lista_virtual:"_lista_virtual_1co2q_853",contenedor_virtual:"_contenedor_virtual_1co2q_865",encabezado_grupo:"_encabezado_grupo_1co2q_873",opcion:"_opcion_1co2q_905",opcion_virtual:"_opcion_virtual_1co2q_931",activo:"_activo_1co2q_939",seleccionado:"_seleccionado_1co2q_947",opcion_check:"_opcion_check_1co2q_979",opcion_contenido:"_opcion_contenido_1co2q_1007",sin_resultados:"_sin_resultados_1co2q_1023",descripcion:"_descripcion_1co2q_1047",mensaje_error:"_mensaje_error_1co2q_1059",ancho_total:"_ancho_total_1co2q_1071",sin_animacion:"_sin_animacion_1co2q_1079",contenedor_nativo:"_contenedor_nativo_1co2q_1089",select_nativo:"_select_nativo_1co2q_1097",input_validacion:"_input_validacion_1co2q_1125"};function xd(e){const{options:n=[],value:t,onChange:o,onValueChange:r,optionLabelKey:i="label",optionValueKey:s="id",label:l,placeholder:d="Seleccione una opción",description:u,errorMessage:f,isRequired:p=!1,isInvalid:_,id:c,name:h,classNames:g,startContent:m,endContent:b,esInvalido:w,estaDeshabilitadoReal:C,clasesBase:S,renderizarValorMostrado:k}=e,$=v.useId(),I=c??`select-nativo-${$}`,F=u?`${I}-desc`:void 0,L=w?`${I}-err`:void 0,N=v.useCallback(z=>lr(z,i),[i]),D=v.useCallback(z=>Cn(z,s),[s]),V=v.useCallback(z=>{o?.(z),r?.(z)},[o,r]),T=v.useCallback(z=>{const A=z.target.value;if(!A){V(null);return}const x=n.find(P=>D(P)===A);x&&V(x)},[n,D,V]),y=typeof _=="string"?_:null,E=typeof f=="function"?f({invalido:w,mensaje:y}):f??y;return a.jsxs("div",{className:S,children:[l&&a.jsxs("label",{className:K(Y.etiqueta,g?.label),htmlFor:I,children:[l,p&&a.jsx("span",{className:Y.marca_requerido,children:"*"})]}),a.jsxs("div",{className:Y.contenedor_nativo,children:[a.jsxs("div",{className:K(Y.trigger,g?.trigger),children:[m&&a.jsx("span",{className:Y.contenido_inicio,children:m}),a.jsx("div",{className:K(Y.valor_wrapper,g?.value),children:k()}),a.jsxs("div",{className:Y.acciones,children:[b&&a.jsx("span",{className:Y.contenido_final,children:b}),a.jsx("span",{className:Y.icono_chevron,children:a.jsx($s,{size:"1em"})})]})]}),a.jsxs("select",{id:I,name:h,className:Y.select_nativo,value:t?D(t):"",onChange:T,disabled:C,required:p,children:[a.jsx("option",{value:"",children:d}),n.map(z=>a.jsx("option",{value:D(z),disabled:vo(z),children:N(z)},D(z)))]})]}),u&&!w&&a.jsx("div",{id:F,className:K(Y.descripcion,g?.description),children:u}),w&&E&&a.jsx("div",{id:L,className:K(Y.mensaje_error,g?.errorMessage),children:E})]})}const Cd="(max-width: 768px)",Sd=40,cr=320,bo=100,$d=200,kd=5;function Id(e,n){const{options:t=[],value:o,defaultValue:r,onChange:i,onValueChange:s,optionLabelKey:l="label",optionValueKey:d="id",renderOption:u,renderValue:f,variant:p="bordered",color:_="default",size:c="md",radius:h="md",fullWidth:g=!0,disableAnimation:m=!1,label:b,placeholder:w="",description:C,errorMessage:S,emptyMessage:k="No hay opciones",noResultsMessage:$="Sin resultados",isRequired:I=!1,isDisabled:F=!1,isReadOnly:L=!1,isLoading:N=!1,isClearable:D=!0,isInvalid:V,validationState:T,isMultiple:y=!1,mostrarTodos:E=!1,isSearchable:z=!1,isVirtualized:A=!1,estimatedOptionHeight:x=Sd,filterFn:P,validate:O,onOpen:B,onClose:j,onSearchChange:q,onClear:J,onFocus:G,onBlur:le,id:oe,name:re,className:ce,classNames:ie,style:me,startContent:U,endContent:ne,menuZIndex:ee,portalContainer:pe}=e,_e=v.useRef(null),Z=v.useRef([]),de=v.useRef(null),ye=v.useRef(null),ue=v.useId(),Ce=oe??`select-${ue}`,R=mo(Cd)&&!z&&!y,[H,he]=v.useState(!1),[ge,ve]=v.useState(null),[We,ft]=v.useState(""),nt=o!==void 0,[Be,Ze]=v.useState(r??null),fe=nt?o:Be,Qe=F||N,be=v.useCallback(Q=>lr(Q,l),[l]),Ne=v.useCallback(Q=>Cn(Q,d),[d]),it=v.useMemo(()=>{const Q=new Set;if(!fe)return Q;try{if(y&&Array.isArray(fe))for(const Ie of fe)Q.add(Cn(Ie,d));else fe&&Q.add(Cn(fe,d))}catch{}return Q},[fe,y,d]),bt=v.useCallback(Q=>{try{return it.has(Cn(Q,d))}catch{return!1}},[it,d]),te=v.useMemo(()=>ud(t),[t]),Fe=v.useMemo(()=>{if(!z||!We.trim())return t;try{return te?_d(t,We,l,P):Ss(t,We,l,P)}catch{return t}},[t,We,z,P,l,te]),we=v.useMemo(()=>te?fd(Fe):Fe.map((Q,Ie)=>({tipo:"opcion",datos:Q,indice:Ie})),[Fe,te]),_t=v.useMemo(()=>pd(fe,O),[fe,O]),gt=v.useMemo(()=>hd(V,T,_t),[V,T,_t]),Xt=T==="valid"&&!gt,{refs:lt,floatingStyles:Zt,context:Re,placement:Tr}=uo({open:H,onOpenChange:Q=>{Qe||L||(he(Q),Q?(B?.(),ft(""),ve(0)):j?.())},strategy:"fixed",transform:!1,placement:"bottom-start",middleware:[Jn(4),to({padding:8}),eo({padding:8}),Oi({apply({rects:Q,elements:Ie}){Object.assign(Ie.floating.style,{width:`${Q.reference.width}px`})},padding:8})],whileElementsMounted:Xn}),Or=Tr.startsWith("top"),{isMounted:mf,styles:vf}=ho(Re,{duration:m||we.length>$d?0:200,initial:{opacity:0,transform:Or?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},open:{opacity:1,transform:"translateY(0) scale(1)"},close:{opacity:0,transform:Or?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},common:{transformOrigin:Or?"bottom":"top"}}),va=cd({count:we.length,getScrollElement:()=>de.current,estimateSize:()=>x,overscan:kd,enabled:A&&H&&we.length>bo}),bf=ls(Re,{enabled:!Qe&&!L}),wf=co(Re),yf=po(Re,{role:"listbox"}),xf=v.useMemo(()=>{try{return gd(we)}catch{return[]}},[we]),Cf=ar(Re,{listRef:Z,activeIndex:ge,onNavigate:ve,loop:!0,virtual:A,disabledIndices:xf}),ba=v.useRef([]);v.useEffect(()=>{ba.current=we.map(Q=>Q.tipo==="opcion"&&Q.datos?be(Q.datos):null)},[we,be]);const Sf=_s(Re,{listRef:ba,activeIndex:ge,onMatch:H?ve:void 0,enabled:!z}),{getReferenceProps:$f,getFloatingProps:kf,getItemProps:wa}=fo([bf,wf,yf,Cf,Sf]),Bt=v.useCallback(Q=>{nt||Ze(Q),i?.(Q),s?.(Q)},[nt,i,s]),$o=v.useCallback(Q=>{if(!vo(Q))if(y){const Ie=Array.isArray(fe)?fe:[],Ct=Ie.some(st=>Ne(st)===Ne(Q));Bt(Ct?Ie.filter(st=>Ne(st)!==Ne(Q)):[...Ie,Q])}else Bt(Q),he(!1)},[y,fe,Ne,Bt]),If=v.useCallback(Q=>{Q.stopPropagation(),Bt(y?[]:null),J?.(),_e.current?.focus()},[y,Bt,J]),ya=v.useCallback((Q,Ie)=>{Ie.stopPropagation(),!(!y||!Array.isArray(fe))&&Bt(fe.filter(Ct=>Ne(Ct)!==Ne(Q)))},[y,fe,Ne,Bt]),Ef=v.useCallback(Q=>{const Ie=Q.target.value;ft(Ie),q?.(Ie),ve(0)},[q]),Mf=v.useCallback(Q=>{if(Q.key==="Enter"&&ge!==null){Q.preventDefault();const Ie=we[ge];Ie?.tipo==="opcion"&&Ie.datos&&$o(Ie.datos)}},[ge,we,$o]);v.useEffect(()=>{H&&z&&requestAnimationFrame(()=>ye.current?.focus())},[H,z]),v.useEffect(()=>()=>{Z.current=[]},[we.length]),v.useImperativeHandle(n,()=>({focus:()=>_e.current?.focus(),blur:()=>_e.current?.blur(),open:()=>he(!0),close:()=>he(!1),clear:()=>Bt(y?[]:null)}));const ko=y?Array.isArray(fe)&&fe.length>0:fe!=null&&fe!=="",xa=v.useCallback(()=>{if(f)return f(fe??null);if(!ko)return a.jsx("span",{className:Y.placeholder,children:w});if(y&&Array.isArray(fe)){if(fe.length===0)return a.jsx("span",{className:Y.placeholder,children:w});const Q=E?fe:fe.slice(0,2),Ie=E?0:Math.max(0,fe.length-2);return a.jsxs(a.Fragment,{children:[Q.map(Ct=>a.jsxs("span",{className:Y.chip_multi,children:[a.jsx("span",{className:Y.chip_texto,children:be(Ct)}),!L&&!Qe&&a.jsx("button",{type:"button",className:Y.chip_cerrar,onClick:st=>ya(Ct,st),children:a.jsx(ks,{size:"1em"})})]},Ne(Ct))),Ie>0&&a.jsxs("span",{className:Y.contador_multi,children:["+",Ie]})]})}return a.jsx("span",{className:Y.valor_texto,children:be(fe)})},[f,fe,ko,w,y,E,L,Qe,Ne,be,ya]),Ca=v.useCallback((Q,Ie,Ct)=>{try{if(Q.tipo==="grupo")return a.jsx("li",{className:K(Y.encabezado_grupo,A&&Y.opcion_virtual),style:Ct,children:Q.nombreGrupo},`grupo-${Q.nombreGrupo}`);const st=Q.datos;if(!st)return null;const ka=bt(st),Ia=ge===Ie,Nf=vo(st),Ff=u?u(st,{isSelected:ka,isActive:Ia}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:Y.opcion_check,children:a.jsx(bd,{size:"1em"})}),a.jsx("span",{className:Y.opcion_contenido,children:be(st)})]}),Af=Ne(st);return a.jsx("li",{ref:Pf=>{Z.current[Ie]=Pf},className:K(Y.opcion,A&&Y.opcion_virtual,{[Y.activo]:Ia,[Y.seleccionado]:ka,[Y.deshabilitado]:Nf},ie?.option),style:Ct,...wa({onClick:()=>$o(st)}),children:Ff},Af)}catch(st){return console.error("Error rendering select item:",st),null}},[A,ge,bt,u,be,Ne,ie?.option,wa,$o]),Sa=typeof S=="function"?S({invalido:gt,mensaje:_t}):S??_t,$a=K(Y.contenedor_base,Y[`variante_${p}`],Y[`tam_${c}`],Y[`radio_${h}`],Y[`color_${_}`],{[Y.ancho_total]:g,[Y.sin_animacion]:m,[Y.deshabilitado]:Qe,[Y.solo_lectura]:L,[Y.invalido]:gt,[Y.valido]:Xt,[Y.abierto]:H,[Y.tiene_valor]:ko},ie?.base,ce);return R&&!te?a.jsx(xd,{...e,esInvalido:gt,estaDeshabilitadoReal:Qe,clasesBase:$a,renderizarValorMostrado:xa}):a.jsxs("div",{className:$a,style:me,children:[b&&a.jsxs("label",{id:`${Ce}-label`,className:K(Y.etiqueta,ie?.label),children:[b,I&&a.jsx("span",{className:Y.marca_requerido,children:"*"})]}),a.jsxs("div",{ref:Q=>{lt.setReference(Q),_e.current=Q},id:Ce,tabIndex:Qe?-1:0,className:K(Y.trigger,E&&y&&Y.trigger_expandido,ie?.trigger),"aria-labelledby":b?`${Ce}-label`:void 0,onFocus:G,onBlur:le,...$f(),children:[U&&a.jsx("span",{className:Y.contenido_inicio,children:U}),a.jsx("div",{className:K(Y.valor_wrapper,E&&y&&Y.mostrar_todos,E&&y&&Y.valor_wrapper_expandido,ie?.value),children:xa()}),a.jsxs("div",{className:Y.acciones,children:[D&&ko&&!L&&!Qe&&a.jsx("button",{type:"button",className:K(Y.boton_limpiar,ie?.clearButton),onClick:If,tabIndex:-1,children:a.jsx(ks,{size:"1em"})}),ne&&a.jsx("span",{className:Y.contenido_final,children:ne}),N?a.jsx("span",{className:Y.icono_spinner,children:a.jsx(yd,{size:"1em"})}):a.jsx("span",{className:Y.icono_chevron,children:a.jsx($s,{size:"1em"})})]})]}),(re||I)&&a.jsx("input",{type:"text",name:re,required:I,value:y&&Array.isArray(fe)?fe.map(Ne).join(","):fe?Ne(fe):"",onChange:()=>{},onFocus:Q=>Q.target.blur(),"aria-hidden":"true",className:Y.input_validacion}),mf&&a.jsx(lo,{root:pe,children:a.jsx(or,{context:Re,modal:!1,initialFocus:z?ye:-1,children:a.jsxs("div",{ref:lt.setFloating,style:{...Zt,...vf,zIndex:ee??"var(--z-popover)"},className:K(Y.menu,ie?.menu),...kf(),children:[z&&a.jsx("div",{className:Y.buscador_wrapper,children:a.jsxs("div",{className:Y.buscador_interno,children:[a.jsx("span",{className:Y.icono_buscar,children:a.jsx(wd,{size:"1em"})}),a.jsx("input",{ref:ye,type:"text",className:K(Y.input_busqueda,ie?.searchInput),placeholder:"Buscar...",value:We,onChange:Ef,onKeyDown:Mf})]})}),a.jsx("ul",{ref:de,className:K(Y.lista_opciones,A&&Y.lista_virtual),style:{height:A&&we.length>bo?`${cr}px`:`${Math.min(we.length*x,cr)}px`,maxHeight:`${cr}px`,overflow:"auto",position:A&&we.length>bo?"relative":void 0},children:we.length===0?a.jsx("li",{className:Y.sin_resultados,children:We?$:k}):A&&we.length>bo?a.jsx(a.Fragment,{children:a.jsx("div",{style:{height:`${va.getTotalSize()}px`,position:"relative",width:"100%"},children:va.getVirtualItems().map(Q=>{const Ie=we[Q.index];return Ie?a.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,width:"100%",height:`${Q.size}px`,transform:`translateY(${Q.start}px)`},children:Ca(Ie,Q.index)},`virtual-${Q.index}`):null})})}):we.map((Q,Ie)=>Ca(Q,Ie))})]})})}),C&&!gt&&a.jsx("div",{className:K(Y.descripcion,ie?.description),children:C}),gt&&Sa&&a.jsx("div",{className:K(Y.mensaje_error,ie?.errorMessage),children:Sa})]})}const Ed=v.forwardRef(Id),Is=v.memo(Ed);Is.displayName="SelectBase";function Md(e,n){const{options:t=[],value:o,onChange:r,onValueChange:i,optionValueKey:s,optionLabelKey:l="label",isMultiple:d=!1,devolverObjeto:u=!1,...f}=e,p=v.useMemo(()=>t.length>0&&typeof t[0]=="object",[t]),_=v.useMemo(()=>{if(!p||!s)return null;const g=new Map;for(const m of t)g.set(String(m[s]),m);return g},[t,s,p]),c=v.useMemo(()=>{if(o==null||!p||u)return o;const g=m=>_?.get(String(m));return d&&Array.isArray(o)?o.map(g).filter(m=>m!==void 0):g(o)??null},[o,_,d,u,p]),h=v.useCallback(g=>{const m=r||i;if(!m)return;if(g===null){m(d?[]:u||!p?null:"");return}if(u||!p){m(g);return}const b=w=>typeof w=="string"?w:w[s];m(d&&Array.isArray(g)?g.map(b):b(g))},[r,i,u,d,s,p]);return a.jsx(Is,{...f,ref:n,options:t,value:c,onChange:h,optionValueKey:s,optionLabelKey:l,isMultiple:d})}const Es=v.forwardRef(Md);Es.displayName="Select";/**
|
|
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 vl(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const dh=(e,t)=>Math.abs(e-t)<1.01,uh=(e,t,n)=>{let o;return function(...r){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,r),n)}},bl=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},fh=e=>e,_h=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},gh=(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(bl(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(bl(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},wl={passive:!0},yl=typeof window>"u"?!0:"onscrollend"in window,hh=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;let r=0;const s=e.options.useScrollendEvent&&yl?()=>{}:uh(o,()=>{t(r,!1)},e.options.isScrollingResetDelay),i=_=>()=>{const{horizontal:g,isRtl:u}=e.options;r=g?n.scrollLeft*(u&&-1||1):n.scrollTop,s(),t(r,_)},l=i(!0),c=i(!1);c(),n.addEventListener("scroll",l,wl);const d=e.options.useScrollendEvent&&yl;return d&&n.addEventListener("scrollend",c,wl),()=>{n.removeEventListener("scroll",l),d&&n.removeEventListener("scrollend",c)}},ph=(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"]},mh=(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 vh{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:fh,rangeExtractor:_h,onChange:()=>{},measureElement:ph,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=Mn(()=>(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=Mn(()=>[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=Mn(()=>[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(_),u=this.options.lanes===1?d[_-1]:this.getFurthestMeasurement(d,_),f=u?u.end+this.options.gap:o+r,h=l.get(g),p=typeof h=="number"?h:this.options.estimateSize(_),m=f+p,w=u?u.lane:_%this.options.lanes;d[_]={index:_,start:f,size:p,end:m,key:g,lane:w}}return this.measurementsCache=d,d},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Mn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,o,r,s)=>this.range=n.length>0&&o>0?bh({measurements:n,outerSize:o,scrollOffset:r,lanes:s}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Mn(()=>{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=Mn(()=>[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 vl(o[Cl(0,o.length-1,r=>vl(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,u]=_;this._scrollToOffset(g,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const f=this.getScrollOffset(),h=this.getOffsetForIndex(n,u);if(!h){console.warn("Failed to get offset for index:",n);return}dh(h[0],f)||c(u)})},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 Cl=(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 bh({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=Cl(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 xl=typeof document<"u"?I.useLayoutEffect:I.useEffect;function wh(e){const t=I.useReducer(()=>({}),{})[1],n={...e,onChange:(r,s)=>{var i;s?Fn.flushSync(t):t(),(i=e.onChange)==null||i.call(e,r,s)}},[o]=I.useState(()=>new vh(n));return o.setOptions(n),xl(()=>o._didMount(),[]),xl(()=>o._willUpdate()),o}function yh(e){return wh({observeElementRect:gh,observeElementOffset:hh,scrollToFn:mh,...e})}function Ch(e,t){const[n,o]=I.useState(e);return I.useEffect(()=>{const r=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(r)}},[e,t]),n}function tr(e){const t=I.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 I.useSyncExternalStore(t,n,o)}function bs(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function Qn(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function nr(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function Sl(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function $l(e,t,n,o){if(!t.trim())return e;const r=Sl(t.trim());return o?e.filter(s=>o(s,t)):e.filter(s=>Sl(bs(s,n)).includes(r))}function xh(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 Sh(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 $h(e,t,n,o){return t.trim()?e.map(r=>({...r,opciones:$l(r.opciones,t,n,o)})).filter(r=>r.opciones.length>0):e}function Eh(e){return e.map((t,n)=>t.tipo==="grupo"||t.datos&&nr(t.datos)?n:null).filter(t=>t!==null)}function Ih(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 kh(e,t,n){return e!==void 0?e:t==="invalid"?!0:t==="valid"?!1:!!n}function Nh(e,t="Opción"){return Array.from({length:e},(n,o)=>`${t} ${o+1}`)}function Mh(e){return Array.from({length:e},(t,n)=>({id:`usr-${n+1}`,nombre:`Usuario ${n+1}`,email:`usuario${n+1}@test.com`}))}const El=({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"})}),Il=({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"})]}),Ah=({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"})}),Dh=({size:e="1em",...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",...t,children:[a.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"}),a.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"})]}),Th=({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"})}),Y={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 Fh(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:u,id:f,name:h,classNames:p,startContent:m,endContent:w,esInvalido:y,estaDeshabilitadoReal:x,clasesBase:$,renderizarValorMostrado:A}=e,F=v.useId(),N=f??`select-nativo-${F}`,P=d?`${N}-desc`:void 0,T=y?`${N}-err`:void 0,k=v.useCallback(O=>bs(O,s),[s]),z=v.useCallback(O=>Qn(O,i),[i]),B=v.useCallback(O=>{o?.(O),r?.(O)},[o,r]),E=v.useCallback(O=>{const D=O.target.value;if(!D){B(null);return}const C=t.find(M=>z(M)===D);C&&B(C)},[t,z,B]),b=typeof u=="string"?u:null,S=typeof _=="function"?_({invalido:y,mensaje:b}):_??b;return a.jsxs("div",{className:$,children:[l&&a.jsxs("label",{className:W(Y.etiqueta,p?.label),htmlFor:N,children:[l,g&&a.jsx("span",{className:Y.marca_requerido,children:"*"})]}),a.jsxs("div",{className:Y.contenedor_nativo,children:[a.jsxs("div",{className:W(Y.trigger,p?.trigger),children:[m&&a.jsx("span",{className:Y.contenido_inicio,children:m}),a.jsx("div",{className:W(Y.valor_wrapper,p?.value),children:A()}),a.jsxs("div",{className:Y.acciones,children:[w&&a.jsx("span",{className:Y.contenido_final,children:w}),a.jsx("span",{className:Y.icono_chevron,children:a.jsx(El,{size:"1em"})})]})]}),a.jsxs("select",{id:N,name:h,className:Y.select_nativo,value:n?z(n):"",onChange:E,disabled:x,required:g,children:[a.jsx("option",{value:"",children:c}),t.map(O=>a.jsx("option",{value:z(O),disabled:nr(O),children:k(O)},z(O)))]})]}),d&&!y&&a.jsx("div",{id:P,className:W(Y.descripcion,p?.description),children:d}),y&&S&&a.jsx("div",{id:T,className:W(Y.mensaje_error,p?.errorMessage),children:S})]})}const Ph="(max-width: 768px)",Lh=44,ws=320,or=100,Oh=200,zh=5;function Bh(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:u="default",size:f="md",radius:h="md",fullWidth:p=!0,disableAnimation:m=!1,label:w,placeholder:y="",description:x,errorMessage:$,emptyMessage:A="No hay opciones",noResultsMessage:F="Sin resultados",isRequired:N=!1,isDisabled:P=!1,isReadOnly:T=!1,isLoading:k=!1,isClearable:z=!0,isInvalid:B,validationState:E,isMultiple:b=!1,mostrarTodos:S=!1,isSearchable:O,isVirtualized:D=!1,estimatedOptionHeight:C=Lh,filterFn:M,validate:L,onOpen:q,onClose:H,onSearchChange:j,onClear:J,onFocus:G,onBlur:me,id:de,name:se,className:_e,classNames:ge,style:$e,startContent:X,endContent:oe,menuZIndex:K,portalContainer:ye}=e,le=v.useRef(null),Q=v.useRef([]),ne=v.useRef(null),xe=v.useRef(null),ce=v.useId(),Ee=de??`select-${ce}`,U=tr(Ph),V=O??!U,R=U&&!V&&!b,[ue,he]=v.useState(!1),[pe,Ne]=v.useState(null),[Re,tt]=v.useState(""),we=o!==void 0,[Je,nt]=v.useState(r??null),ve=we?o:Je,Ce=P||k,Ue=v.useCallback(te=>bs(te,l),[l]),Te=v.useCallback(te=>Qn(te,c),[c]),ot=v.useMemo(()=>{const te=new Set;if(!ve)return te;try{if(b&&Array.isArray(ve))for(const De of ve)te.add(Qn(De,c));else ve&&te.add(Qn(ve,c))}catch{}return te},[ve,b,c]),ee=v.useCallback(te=>{try{return ot.has(Qn(te,c))}catch{return!1}},[ot,c]),Ie=v.useMemo(()=>xh(n),[n]),Be=v.useMemo(()=>{if(!V||!Re.trim())return n;try{return Ie?$h(n,Re,l,M):$l(n,Re,l,M)}catch{return n}},[n,Re,V,M,l,Ie]),Pe=v.useMemo(()=>Ie?Sh(Be):Be.map((te,De)=>({tipo:"opcion",datos:te,indice:De})),[Be,Ie]),pt=v.useMemo(()=>Ih(ve,L),[ve,L]),wt=v.useMemo(()=>kh(B,E,pt),[B,E,pt]),mt=E==="valid"&&!wt,{refs:Pt,floatingStyles:fe,context:be,placement:$t}=Yo({open:ue,onOpenChange:te=>{Ce||T||(he(te),te?(q?.(),tt(""),Ne(null)):H?.())},strategy:"fixed",transform:!1,placement:"bottom-start",middleware:[zo(4),Vo({padding:8}),Bo({padding:8}),za({apply({rects:te,elements:De}){Object.assign(De.floating.style,{width:`${te.reference.width}px`})},padding:8})],whileElementsMounted:Po}),lt=$t.startsWith("top"),{isMounted:kt,styles:wn}=er(be,{duration:m||Pe.length>Oh?0:200,initial:{opacity:0,transform:lt?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},open:{opacity:1,transform:"translateY(0) scale(1)"},close:{opacity:0,transform:lt?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},common:{transformOrigin:lt?"bottom":"top"}}),an=yh({count:Pe.length,getScrollElement:()=>ne.current,estimateSize:()=>C,overscan:zh,enabled:D&&ue&&Pe.length>or}),io=cl(be,{enabled:!Ce&&!T}),dr=Ko(be),ur=Qo(be,{role:"listbox"}),Im=v.useMemo(()=>{try{return Eh(Pe)}catch{return[]}},[Pe]),km=vs(be,{listRef:Q,activeIndex:pe,onNavigate:Ne,loop:!0,virtual:D,focusItemOnHover:!V,disabledIndices:Im}),vc=v.useRef([]);v.useEffect(()=>{vc.current=Pe.map(te=>te.tipo==="opcion"&&te.datos?Ue(te.datos):null)},[Pe,Ue]);const Nm=gl(be,{listRef:vc,activeIndex:pe,onMatch:ue?Ne:void 0,enabled:!V}),{getReferenceProps:Mm,getFloatingProps:Am,getItemProps:bc}=Xo([io,dr,ur,km,Nm]),ln=v.useCallback(te=>{we||nt(te),s?.(te),i?.(te)},[we,s,i]),fr=v.useCallback(te=>{if(!nr(te))if(b){const De=Array.isArray(ve)?ve:[],Lt=De.some(vt=>Te(vt)===Te(te));ln(Lt?De.filter(vt=>Te(vt)!==Te(te)):[...De,te])}else ln(te),he(!1)},[b,ve,Te,ln]),Dm=v.useCallback(te=>{te.stopPropagation(),ln(b?[]:null),J?.(),le.current?.focus()},[b,ln,J]),wc=v.useCallback((te,De)=>{De.stopPropagation(),!(!b||!Array.isArray(ve))&&ln(ve.filter(Lt=>Te(Lt)!==Te(te)))},[b,ve,Te,ln]),Tm=v.useCallback(te=>{const De=te.target.value;tt(De),j?.(De),Ne(0)},[j]),Fm=v.useCallback(te=>{if(te.key==="Enter"&&pe!==null){te.preventDefault();const De=Pe[pe];De?.tipo==="opcion"&&De.datos&&fr(De.datos)}},[pe,Pe,fr]);v.useEffect(()=>{ue&&V&&requestAnimationFrame(()=>xe.current?.focus())},[ue,V]),v.useEffect(()=>()=>{Q.current=[]},[Pe.length]),v.useImperativeHandle(t,()=>({focus:()=>le.current?.focus(),blur:()=>le.current?.blur(),open:()=>he(!0),close:()=>he(!1),clear:()=>ln(b?[]:null)}));const _r=b?Array.isArray(ve)&&ve.length>0:ve!=null&&ve!=="",yc=v.useCallback(()=>{if(_)return _(ve??null);if(!_r)return a.jsx("span",{className:Y.placeholder,children:y});if(b&&Array.isArray(ve)){if(ve.length===0)return a.jsx("span",{className:Y.placeholder,children:y});const te=S?ve:ve.slice(0,2),De=S?0:Math.max(0,ve.length-2);return a.jsxs(a.Fragment,{children:[te.map(Lt=>a.jsxs("span",{className:Y.chip_multi,children:[a.jsx("span",{className:Y.chip_texto,children:Ue(Lt)}),!T&&!Ce&&a.jsx("button",{type:"button",className:Y.chip_cerrar,onClick:vt=>wc(Lt,vt),children:a.jsx(Il,{size:"1em"})})]},Te(Lt))),De>0&&a.jsxs("span",{className:Y.contador_multi,children:["+",De]})]})}return a.jsx("span",{className:Y.valor_texto,children:Ue(ve)})},[_,ve,_r,y,b,S,T,Ce,Te,Ue,wc]),Cc=v.useCallback((te,De,Lt)=>{try{if(te.tipo==="grupo")return a.jsx("li",{className:W(Y.encabezado_grupo,D&&Y.opcion_virtual),style:Lt,children:te.nombreGrupo},`grupo-${te.nombreGrupo}`);const vt=te.datos;if(!vt)return null;const $c=ee(vt),Ec=pe===De,Pm=nr(vt),Lm=d?d(vt,{isSelected:$c,isActive:Ec}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:Y.opcion_check,children:a.jsx(Ah,{size:"1em"})}),a.jsx("span",{className:Y.opcion_contenido,children:Ue(vt)})]}),Om=Te(vt);return a.jsx("li",{ref:zm=>{Q.current[De]=zm},className:W(Y.opcion,D&&Y.opcion_virtual,{[Y.activo]:Ec,[Y.seleccionado]:$c,[Y.deshabilitado]:Pm},ge?.option),style:Lt,...bc({onClick:()=>fr(vt)}),children:Lm},Om)}catch(vt){return console.error("Error rendering select item:",vt),null}},[D,pe,ee,d,Ue,Te,ge?.option,bc,fr]),xc=typeof $=="function"?$({invalido:wt,mensaje:pt}):$??pt,Sc=W(Y.contenedor_base,Y[`variante_${g}`],Y[`tam_${f}`],Y[`radio_${h}`],Y[`color_${u}`],{[Y.ancho_total]:p,[Y.sin_animacion]:m,[Y.deshabilitado]:Ce,[Y.solo_lectura]:T,[Y.invalido]:wt,[Y.valido]:mt,[Y.abierto]:ue,[Y.tiene_valor]:_r},ge?.base,_e);return R&&!Ie?a.jsx(Fh,{...e,esInvalido:wt,estaDeshabilitadoReal:Ce,clasesBase:Sc,renderizarValorMostrado:yc}):a.jsxs("div",{className:Sc,style:$e,children:[w&&a.jsxs("label",{id:`${Ee}-label`,className:W(Y.etiqueta,ge?.label),children:[w,N&&a.jsx("span",{className:Y.marca_requerido,children:"*"})]}),a.jsxs("div",{ref:te=>{Pt.setReference(te),le.current=te},id:Ee,tabIndex:Ce?-1:0,className:W(Y.trigger,S&&b&&Y.trigger_expandido,ge?.trigger),"aria-labelledby":w?`${Ee}-label`:void 0,onFocus:G,onBlur:me,...Mm(),children:[X&&a.jsx("span",{className:Y.contenido_inicio,children:X}),a.jsx("div",{className:W(Y.valor_wrapper,S&&b&&Y.mostrar_todos,S&&b&&Y.valor_wrapper_expandido,ge?.value),children:yc()}),a.jsxs("div",{className:Y.acciones,children:[z&&_r&&!T&&!Ce&&a.jsx("button",{type:"button",className:W(Y.boton_limpiar,ge?.clearButton),onClick:Dm,tabIndex:-1,children:a.jsx(Il,{size:"1em"})}),oe&&a.jsx("span",{className:Y.contenido_final,children:oe}),k?a.jsx("span",{className:Y.icono_spinner,children:a.jsx(Th,{size:"1em"})}):a.jsx("span",{className:Y.icono_chevron,children:a.jsx(El,{size:"1em"})})]})]}),(se||N)&&a.jsx("input",{type:"text",name:se,required:N,value:b&&Array.isArray(ve)?ve.map(Te).join(","):ve?Te(ve):"",onChange:()=>{},onFocus:te=>te.target.blur(),"aria-hidden":"true",className:Y.input_validacion}),kt&&a.jsx(Go,{root:ye,children:a.jsx(gs,{context:be,modal:!1,initialFocus:V?xe:-1,children:a.jsxs("div",{ref:Pt.setFloating,style:{...fe,...wn,zIndex:K??"var(--z-popover)"},className:W(Y.menu,ge?.menu),...Am(),children:[V&&a.jsx("div",{className:Y.buscador_wrapper,children:a.jsxs("div",{className:Y.buscador_interno,children:[a.jsx("span",{className:Y.icono_buscar,children:a.jsx(Dh,{size:"1.6em"})}),a.jsx("input",{ref:xe,type:"text",className:W(Y.input_busqueda,ge?.searchInput),placeholder:"Buscar...",value:Re,onChange:Tm,onKeyDown:Fm})]})}),a.jsx("ul",{ref:ne,className:W(Y.lista_opciones,D&&Y.lista_virtual),style:{height:D&&Pe.length>or?`${ws}px`:`${Math.min(Pe.length*C,ws)}px`,maxHeight:`${ws}px`,overflow:"auto",position:D&&Pe.length>or?"relative":void 0},children:Pe.length===0?a.jsx("li",{className:Y.sin_resultados,children:Re?F:A}):D&&Pe.length>or?a.jsx(a.Fragment,{children:a.jsx("div",{style:{height:`${an.getTotalSize()}px`,position:"relative",width:"100%"},children:an.getVirtualItems().map(te=>{const De=Pe[te.index];return De?a.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,width:"100%",height:`${te.size}px`,transform:`translateY(${te.start}px)`},children:Cc(De,te.index)},`virtual-${te.index}`):null})})}):Pe.map((te,De)=>Cc(te,De))})]})})}),x&&!wt&&a.jsx("div",{className:W(Y.descripcion,ge?.description),children:x}),wt&&xc&&a.jsx("div",{className:W(Y.mensaje_error,ge?.errorMessage),children:xc})]})}const Vh=v.forwardRef(Bh),kl=v.memo(Vh);kl.displayName="SelectBase";function jh(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]),u=v.useMemo(()=>{if(!g||!i)return null;const p=new Map;for(const m of n)p.set(String(m[i]),m);return p},[n,i,g]),f=v.useMemo(()=>{if(o==null||!g||d)return o;const p=m=>u?.get(String(m));return c&&Array.isArray(o)?o.map(p).filter(m=>m!==void 0):p(o)??null},[o,u,c,d,g]),h=v.useCallback(p=>{const m=r||s;if(!m)return;if(p===null){m(c?[]:d||!g?null:"");return}if(d||!g){m(p);return}const w=y=>typeof y=="string"?y:y[i];m(c&&Array.isArray(p)?p.map(w):w(p))},[r,s,d,c,i,g]);return a.jsx(kl,{..._,ref:t,options:n,value:f,onChange:h,optionValueKey:i,optionLabelKey:l,isMultiple:c})}const Nl=v.forwardRef(jh);Nl.displayName="Select";/**
|
|
8
661
|
* table-core
|
|
9
662
|
*
|
|
10
663
|
* Copyright (c) TanStack
|
|
@@ -13,10 +666,10 @@
|
|
|
13
666
|
* LICENSE.md file in the root directory of this source tree.
|
|
14
667
|
*
|
|
15
668
|
* @license MIT
|
|
16
|
-
*/function
|
|
669
|
+
*/function tn(e,t){return typeof e=="function"?e(t):e}function St(e,t){return n=>{t.setState(o=>({...o,[e]:tn(n,o[e])}))}}function rr(e){return e instanceof Function}function qh(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Hh(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 ie(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,u=g/16,f=(h,p)=>{for(h=String(h);h.length<p;)h=" "+h;return h};console.info(`%c⏱ ${f(g,5)} /${f(_,5)} ms`,`
|
|
17
670
|
font-size: .6rem;
|
|
18
671
|
font-weight: bold;
|
|
19
|
-
color: hsl(${Math.max(0,Math.min(120-120*_,120))}deg 100% 31%);`,t?.key)}return r}}function ae(e,n,t,o){return{debug:()=>{var r;return(r=e?.debugAll)!=null?r:e[n]},key:process.env.NODE_ENV==="development"&&t,onChange:o}}function Ad(e,n,t,o){const r=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${n.id}_${t.id}`,row:n,column:t,getValue:()=>n.getValue(o),renderValue:r,getContext:se(()=>[e,t,n,i],(s,l,d,u)=>({table:s,column:l,row:d,cell:u,getValue:u.getValue,renderValue:u.renderValue}),ae(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,t,n,e)},{}),i}function Pd(e,n,t,o){var r,i;const l={...e._getDefaultColumnDef(),...n},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,f;if(l.accessorFn?f=l.accessorFn:d&&(d.includes(".")?f=_=>{let c=_;for(const g of d.split(".")){var h;c=(h=c)==null?void 0:h[g],process.env.NODE_ENV!=="production"&&c===void 0&&console.warn(`"${g}" in deeply nested key "${d}" returned undefined.`)}return c}: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 p={id:`${String(u)}`,accessorFn:f,parent:o,depth:t,columnDef:l,columns:[],getFlatColumns:se(()=>[!0],()=>{var _;return[p,...(_=p.columns)==null?void 0:_.flatMap(c=>c.getFlatColumns())]},ae(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:se(()=>[e._getOrderColumnsFn()],_=>{var c;if((c=p.columns)!=null&&c.length){let h=p.columns.flatMap(g=>g.getLeafColumns());return _(h)}return[p]},ae(e.options,"debugColumns","column.getLeafColumns"))};for(const _ of e._features)_.createColumn==null||_.createColumn(p,e);return p}const et="debugHeaders";function Ms(e,n,t){var o;let i={id:(o=t.id)!=null?o:n.id,column:n,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],l=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(l),s.push(d)};return l(i),s},getContext:()=>({table:e,header:i,column:n})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const Ld={createTable:e=>{e.getHeaderGroups=se(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,r)=>{var i,s;const l=(i=o?.map(p=>t.find(_=>_.id===p)).filter(Boolean))!=null?i:[],d=(s=r?.map(p=>t.find(_=>_.id===p)).filter(Boolean))!=null?s:[],u=t.filter(p=>!(o!=null&&o.includes(p.id))&&!(r!=null&&r.includes(p.id)));return yo(n,[...l,...u,...d],e)},ae(e.options,et,"getHeaderGroups")),e.getCenterHeaderGroups=se(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,r)=>(t=t.filter(i=>!(o!=null&&o.includes(i.id))&&!(r!=null&&r.includes(i.id))),yo(n,t,e,"center")),ae(e.options,et,"getCenterHeaderGroups")),e.getLeftHeaderGroups=se(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,t,o)=>{var r;const i=(r=o?.map(s=>t.find(l=>l.id===s)).filter(Boolean))!=null?r:[];return yo(n,i,e,"left")},ae(e.options,et,"getLeftHeaderGroups")),e.getRightHeaderGroups=se(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,t,o)=>{var r;const i=(r=o?.map(s=>t.find(l=>l.id===s)).filter(Boolean))!=null?r:[];return yo(n,i,e,"right")},ae(e.options,et,"getRightHeaderGroups")),e.getFooterGroups=se(()=>[e.getHeaderGroups()],n=>[...n].reverse(),ae(e.options,et,"getFooterGroups")),e.getLeftFooterGroups=se(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),ae(e.options,et,"getLeftFooterGroups")),e.getCenterFooterGroups=se(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),ae(e.options,et,"getCenterFooterGroups")),e.getRightFooterGroups=se(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),ae(e.options,et,"getRightFooterGroups")),e.getFlatHeaders=se(()=>[e.getHeaderGroups()],n=>n.map(t=>t.headers).flat(),ae(e.options,et,"getFlatHeaders")),e.getLeftFlatHeaders=se(()=>[e.getLeftHeaderGroups()],n=>n.map(t=>t.headers).flat(),ae(e.options,et,"getLeftFlatHeaders")),e.getCenterFlatHeaders=se(()=>[e.getCenterHeaderGroups()],n=>n.map(t=>t.headers).flat(),ae(e.options,et,"getCenterFlatHeaders")),e.getRightFlatHeaders=se(()=>[e.getRightHeaderGroups()],n=>n.map(t=>t.headers).flat(),ae(e.options,et,"getRightFlatHeaders")),e.getCenterLeafHeaders=se(()=>[e.getCenterFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ae(e.options,et,"getCenterLeafHeaders")),e.getLeftLeafHeaders=se(()=>[e.getLeftFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ae(e.options,et,"getLeftLeafHeaders")),e.getRightLeafHeaders=se(()=>[e.getRightFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ae(e.options,et,"getRightLeafHeaders")),e.getLeafHeaders=se(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,t,o)=>{var r,i,s,l,d,u;return[...(r=(i=n[0])==null?void 0:i.headers)!=null?r:[],...(s=(l=t[0])==null?void 0:l.headers)!=null?s:[],...(d=(u=o[0])==null?void 0:u.headers)!=null?d:[]].map(f=>f.getLeafHeaders()).flat()},ae(e.options,et,"getLeafHeaders"))}};function yo(e,n,t,o){var r,i;let s=0;const l=function(_,c){c===void 0&&(c=1),s=Math.max(s,c),_.filter(h=>h.getIsVisible()).forEach(h=>{var g;(g=h.columns)!=null&&g.length&&l(h.columns,c+1)},0)};l(e);let d=[];const u=(_,c)=>{const h={depth:c,id:[o,`${c}`].filter(Boolean).join("_"),headers:[]},g=[];_.forEach(m=>{const b=[...g].reverse()[0],w=m.column.depth===h.depth;let C,S=!1;if(w&&m.column.parent?C=m.column.parent:(C=m.column,S=!0),b&&b?.column===C)b.subHeaders.push(m);else{const k=Ms(t,C,{id:[o,c,C.id,m?.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${g.filter($=>$.column===C).length}`:void 0,depth:c,index:g.length});k.subHeaders.push(m),g.push(k)}h.headers.push(m),m.headerGroup=h}),d.push(h),c>0&&u(g,c-1)},f=n.map((_,c)=>Ms(t,_,{depth:s,index:c}));u(f,s-1),d.reverse();const p=_=>_.filter(h=>h.column.getIsVisible()).map(h=>{let g=0,m=0,b=[0];h.subHeaders&&h.subHeaders.length?(b=[],p(h.subHeaders).forEach(C=>{let{colSpan:S,rowSpan:k}=C;g+=S,b.push(k)})):g=1;const w=Math.min(...b);return m=m+w,h.colSpan=g,h.rowSpan=m,{colSpan:g,rowSpan:m}});return p((r=(i=d[0])==null?void 0:i.headers)!=null?r:[]),d}const dr=(e,n,t,o,r,i,s)=>{let l={id:n,index:o,original:t,depth:r,parentId:s,_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:()=>Fd(l.subRows,d=>d.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let d=[],u=l;for(;;){const f=u.getParentRow();if(!f)break;d.push(f),u=f}return d.reverse()},getAllCells:se(()=>[e.getAllLeafColumns()],d=>d.map(u=>Ad(e,l,u,u.id)),ae(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:se(()=>[l.getAllCells()],d=>d.reduce((u,f)=>(u[f.column.id]=f,u),{}),ae(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},Dd={createColumn:(e,n)=>{e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Ns=(e,n,t)=>{var o,r;const i=t==null||(o=t.toString())==null?void 0:o.toLowerCase();return!!(!((r=e.getValue(n))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(i))};Ns.autoRemove=e=>mt(e);const Fs=(e,n,t)=>{var o;return!!(!((o=e.getValue(n))==null||(o=o.toString())==null)&&o.includes(t))};Fs.autoRemove=e=>mt(e);const As=(e,n,t)=>{var o;return((o=e.getValue(n))==null||(o=o.toString())==null?void 0:o.toLowerCase())===t?.toLowerCase()};As.autoRemove=e=>mt(e);const Ps=(e,n,t)=>{var o;return(o=e.getValue(n))==null?void 0:o.includes(t)};Ps.autoRemove=e=>mt(e);const Ls=(e,n,t)=>!t.some(o=>{var r;return!((r=e.getValue(n))!=null&&r.includes(o))});Ls.autoRemove=e=>mt(e)||!(e!=null&&e.length);const Ds=(e,n,t)=>t.some(o=>{var r;return(r=e.getValue(n))==null?void 0:r.includes(o)});Ds.autoRemove=e=>mt(e)||!(e!=null&&e.length);const Ts=(e,n,t)=>e.getValue(n)===t;Ts.autoRemove=e=>mt(e);const Os=(e,n,t)=>e.getValue(n)==t;Os.autoRemove=e=>mt(e);const ur=(e,n,t)=>{let[o,r]=t;const i=e.getValue(n);return i>=o&&i<=r};ur.resolveFilterValue=e=>{let[n,t]=e,o=typeof n!="number"?parseFloat(n):n,r=typeof t!="number"?parseFloat(t):t,i=n===null||Number.isNaN(o)?-1/0:o,s=t===null||Number.isNaN(r)?1/0:r;if(i>s){const l=i;i=s,s=l}return[i,s]},ur.autoRemove=e=>mt(e)||mt(e[0])&&mt(e[1]);const Mt={includesString:Ns,includesStringSensitive:Fs,equalsString:As,arrIncludes:Ps,arrIncludesAll:Ls,arrIncludesSome:Ds,equals:Ts,weakEquals:Os,inNumberRange:ur};function mt(e){return e==null||e===""}const Td={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:ut("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const t=n.getCoreRowModel().flatRows[0],o=t?.getValue(e.id);return typeof o=="string"?Mt.includesString:typeof o=="number"?Mt.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Mt.equals:Array.isArray(o)?Mt.arrIncludes:Mt.weakEquals},e.getFilterFn=()=>{var t,o;return wo(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(t=(o=n.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?t:Mt[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,o,r;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((o=n.options.enableColumnFilters)!=null?o:!0)&&((r=n.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=n.getState().columnFilters)==null||(t=t.find(o=>o.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,o;return(t=(o=n.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?t:-1},e.setFilterValue=t=>{n.setColumnFilters(o=>{const r=e.getFilterFn(),i=o?.find(f=>f.id===e.id),s=Ot(t,i?i.value:void 0);if(zs(r,s,e)){var l;return(l=o?.filter(f=>f.id!==e.id))!=null?l:[]}const d={id:e.id,value:s};if(i){var u;return(u=o?.map(f=>f.id===e.id?d:f))!=null?u:[]}return o!=null&&o.length?[...o,d]:[d]})}},createRow:(e,n)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=n=>{const t=e.getAllLeafColumns(),o=r=>{var i;return(i=Ot(n,r))==null?void 0:i.filter(s=>{const l=t.find(d=>d.id===s.id);if(l){const d=l.getFilterFn();if(zs(d,s.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=n=>{var t,o;e.setColumnFilters(n?[]:(t=(o=e.initialState)==null?void 0:o.columnFilters)!=null?t:[])},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 zs(e,n,t){return(e&&e.autoRemove?e.autoRemove(n,t):!1)||typeof n>"u"||typeof n=="string"&&!n}const fr={sum:(e,n,t)=>t.reduce((o,r)=>{const i=r.getValue(e);return o+(typeof i=="number"?i:0)},0),min:(e,n,t)=>{let o;return t.forEach(r=>{const i=r.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},max:(e,n,t)=>{let o;return t.forEach(r=>{const i=r.getValue(e);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},extent:(e,n,t)=>{let o,r;return t.forEach(i=>{const s=i.getValue(e);s!=null&&(o===void 0?s>=s&&(o=r=s):(o>s&&(o=s),r<s&&(r=s)))}),[o,r]},mean:(e,n)=>{let t=0,o=0;if(n.forEach(r=>{let i=r.getValue(e);i!=null&&(i=+i)>=i&&(++t,o+=i)}),t)return o/t},median:(e,n)=>{if(!n.length)return;const t=n.map(i=>i.getValue(e));if(!Nd(t))return;if(t.length===1)return t[0];const o=Math.floor(t.length/2),r=t.sort((i,s)=>i-s);return t.length%2!==0?r[o]:(r[o-1]+r[o])/2},unique:(e,n)=>Array.from(new Set(n.map(t=>t.getValue(e))).values()),uniqueCount:(e,n)=>new Set(n.map(t=>t.getValue(e))).size,count:(e,n)=>n.length},Od={getDefaultColumnDef:()=>({aggregatedCell:e=>{var n,t;return(n=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?n:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:ut("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,n)=>{e.toggleGrouping=()=>{n.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(o=>o!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,o;return((t=e.columnDef.enableGrouping)!=null?t:!0)&&((o=n.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var t;return(t=n.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=n.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=n.getCoreRowModel().flatRows[0],o=t?.getValue(e.id);if(typeof o=="number")return fr.sum;if(Object.prototype.toString.call(o)==="[object Date]")return fr.extent},e.getAggregationFn=()=>{var t,o;if(!e)throw new Error;return wo(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(t=(o=n.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?t:fr[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=n=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(n),e.resetGrouping=n=>{var t,o;e.setGrouping(n?[]:(t=(o=e.initialState)==null?void 0:o.grouping)!=null?t:[])},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,n)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const o=n.getColumn(t);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[t]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,n,t,o)=>{e.getIsGrouped=()=>n.getIsGrouped()&&n.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&n.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=t.subRows)!=null&&r.length)}}};function zd(e,n,t){if(!(n!=null&&n.length)||!t)return e;const o=e.filter(i=>!n.includes(i.id));return t==="remove"?o:[...n.map(i=>e.find(s=>s.id===i)).filter(Boolean),...o]}const Vd={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:ut("columnOrder",e)}),createColumn:(e,n)=>{e.getIndex=se(t=>[Sn(n,t)],t=>t.findIndex(o=>o.id===e.id),ae(n.options,"debugColumns","getIndex")),e.getIsFirstColumn=t=>{var o;return((o=Sn(n,t)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=t=>{var o;const r=Sn(n,t);return((o=r[r.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=n=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(n),e.resetColumnOrder=n=>{var t;e.setColumnOrder(n?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=se(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,t,o)=>r=>{let i=[];if(!(n!=null&&n.length))i=r;else{const s=[...n],l=[...r];for(;l.length&&s.length;){const d=s.shift(),u=l.findIndex(f=>f.id===d);u>-1&&i.push(l.splice(u,1)[0])}i=[...i,...l]}return zd(i,t,o)},ae(e.options,"debugTable","_getOrderColumnsFn"))}},_r=()=>({left:[],right:[]}),qd={getInitialState:e=>({columnPinning:_r(),...e}),getDefaultOptions:e=>({onColumnPinningChange:ut("columnPinning",e)}),createColumn:(e,n)=>{e.pin=t=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);n.setColumnPinning(r=>{var i,s;if(t==="right"){var l,d;return{left:((l=r?.left)!=null?l:[]).filter(p=>!(o!=null&&o.includes(p))),right:[...((d=r?.right)!=null?d:[]).filter(p=>!(o!=null&&o.includes(p))),...o]}}if(t==="left"){var u,f;return{left:[...((u=r?.left)!=null?u:[]).filter(p=>!(o!=null&&o.includes(p))),...o],right:((f=r?.right)!=null?f:[]).filter(p=>!(o!=null&&o.includes(p)))}}return{left:((i=r?.left)!=null?i:[]).filter(p=>!(o!=null&&o.includes(p))),right:((s=r?.right)!=null?s:[]).filter(p=>!(o!=null&&o.includes(p)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,i,s;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((i=(s=n.options.enableColumnPinning)!=null?s:n.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(l=>l.id),{left:o,right:r}=n.getState().columnPinning,i=t.some(l=>o?.includes(l)),s=t.some(l=>r?.includes(l));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var t,o;const r=e.getIsPinned();return r?(t=(o=n.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?t:-1:0}},createRow:(e,n)=>{e.getCenterVisibleCells=se(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(t,o,r)=>{const i=[...o??[],...r??[]];return t.filter(s=>!i.includes(s.column.id))},ae(n.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=se(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left],(t,o)=>(o??[]).map(i=>t.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ae(n.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=se(()=>[e._getAllVisibleCells(),n.getState().columnPinning.right],(t,o)=>(o??[]).map(i=>t.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ae(n.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=n=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(n),e.resetColumnPinning=n=>{var t,o;return e.setColumnPinning(n?_r():(t=(o=e.initialState)==null?void 0:o.columnPinning)!=null?t:_r())},e.getIsSomeColumnsPinned=n=>{var t;const o=e.getState().columnPinning;if(!n){var r,i;return!!((r=o.left)!=null&&r.length||(i=o.right)!=null&&i.length)}return!!((t=o[n])!=null&&t.length)},e.getLeftLeafColumns=se(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,t)=>(t??[]).map(o=>n.find(r=>r.id===o)).filter(Boolean),ae(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=se(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,t)=>(t??[]).map(o=>n.find(r=>r.id===o)).filter(Boolean),ae(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=se(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o)=>{const r=[...t??[],...o??[]];return n.filter(i=>!r.includes(i.id))},ae(e.options,"debugColumns","getCenterLeafColumns"))}};function jd(e){return e||(typeof document<"u"?document:null)}const xo={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},gr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Bd={getDefaultColumnDef:()=>xo,getInitialState:e=>({columnSizing:{},columnSizingInfo:gr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:ut("columnSizing",e),onColumnSizingInfoChange:ut("columnSizingInfo",e)}),createColumn:(e,n)=>{e.getSize=()=>{var t,o,r;const i=n.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:xo.minSize,(o=i??e.columnDef.size)!=null?o:xo.size),(r=e.columnDef.maxSize)!=null?r:xo.maxSize)},e.getStart=se(t=>[t,Sn(n,t),n.getState().columnSizing],(t,o)=>o.slice(0,e.getIndex(t)).reduce((r,i)=>r+i.getSize(),0),ae(n.options,"debugColumns","getStart")),e.getAfter=se(t=>[t,Sn(n,t),n.getState().columnSizing],(t,o)=>o.slice(e.getIndex(t)+1).reduce((r,i)=>r+i.getSize(),0),ae(n.options,"debugColumns","getAfter")),e.resetSize=()=>{n.setColumnSizing(t=>{let{[e.id]:o,...r}=t;return r})},e.getCanResize=()=>{var t,o;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((o=n.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>n.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,n)=>{e.getSize=()=>{let t=0;const o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var i;t+=(i=r.column.getSize())!=null?i:0}};return o(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=t=>{const o=n.getColumn(e.column.id),r=o?.getCanResize();return i=>{if(!o||!r||(i.persist==null||i.persist(),pr(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),l=e?e.getLeafHeaders().map(b=>[b.column.id,b.column.getSize()]):[[o.id,o.getSize()]],d=pr(i)?Math.round(i.touches[0].clientX):i.clientX,u={},f=(b,w)=>{typeof w=="number"&&(n.setColumnSizingInfo(C=>{var S,k;const $=n.options.columnResizeDirection==="rtl"?-1:1,I=(w-((S=C?.startOffset)!=null?S:0))*$,F=Math.max(I/((k=C?.startSize)!=null?k:0),-.999999);return C.columnSizingStart.forEach(L=>{let[N,D]=L;u[N]=Math.round(Math.max(D+D*F,0)*100)/100}),{...C,deltaOffset:I,deltaPercentage:F}}),(n.options.columnResizeMode==="onChange"||b==="end")&&n.setColumnSizing(C=>({...C,...u})))},p=b=>f("move",b),_=b=>{f("end",b),n.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},c=jd(t),h={moveHandler:b=>p(b.clientX),upHandler:b=>{c?.removeEventListener("mousemove",h.moveHandler),c?.removeEventListener("mouseup",h.upHandler),_(b.clientX)}},g={moveHandler:b=>(b.cancelable&&(b.preventDefault(),b.stopPropagation()),p(b.touches[0].clientX),!1),upHandler:b=>{var w;c?.removeEventListener("touchmove",g.moveHandler),c?.removeEventListener("touchend",g.upHandler),b.cancelable&&(b.preventDefault(),b.stopPropagation()),_((w=b.touches[0])==null?void 0:w.clientX)}},m=Hd()?{passive:!1}:!1;pr(i)?(c?.addEventListener("touchmove",g.moveHandler,m),c?.addEventListener("touchend",g.upHandler,m)):(c?.addEventListener("mousemove",h.moveHandler,m),c?.addEventListener("mouseup",h.upHandler,m)),n.setColumnSizingInfo(b=>({...b,startOffset:d,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=n=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(n),e.setColumnSizingInfo=n=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(n),e.resetColumnSizing=n=>{var t;e.setColumnSizing(n?{}:(t=e.initialState.columnSizing)!=null?t:{})},e.resetHeaderSizeInfo=n=>{var t;e.setColumnSizingInfo(n?gr():(t=e.initialState.columnSizingInfo)!=null?t:gr())},e.getTotalSize=()=>{var n,t;return(n=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getLeftTotalSize=()=>{var n,t;return(n=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getCenterTotalSize=()=>{var n,t;return(n=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getRightTotalSize=()=>{var n,t;return(n=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0}}};let Co=null;function Hd(){if(typeof Co=="boolean")return Co;let e=!1;try{const n={get passive(){return e=!0,!1}},t=()=>{};window.addEventListener("test",t,n),window.removeEventListener("test",t)}catch{e=!1}return Co=e,Co}function pr(e){return e.type==="touchstart"}const Gd={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:ut("columnVisibility",e)}),createColumn:(e,n)=>{e.toggleVisibility=t=>{e.getCanHide()&&n.setColumnVisibility(o=>({...o,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,o;const r=e.columns;return(t=r.length?r.some(i=>i.getIsVisible()):(o=n.getState().columnVisibility)==null?void 0:o[e.id])!=null?t:!0},e.getCanHide=()=>{var t,o;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((o=n.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,n)=>{e._getAllVisibleCells=se(()=>[e.getAllCells(),n.getState().columnVisibility],t=>t.filter(o=>o.column.getIsVisible()),ae(n.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=se(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,o,r)=>[...t,...o,...r],ae(n.options,"debugRows","getVisibleCells"))},createTable:e=>{const n=(t,o)=>se(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ae(e.options,"debugColumns",t));e.getVisibleFlatColumns=n("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=n("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=n("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=n("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=n("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var o;e.setColumnVisibility(t?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=t=>{var o;t=(o=t)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,i)=>({...r,[i.id]:t||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(t=>!(t.getIsVisible!=null&&t.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(t=>t.getIsVisible==null?void 0:t.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var o;e.toggleAllColumnsVisible((o=t.target)==null?void 0:o.checked)}}};function Sn(e,n){return n?n==="center"?e.getCenterVisibleLeafColumns():n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Wd={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()}}},Rd={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:ut("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:n=>{var t;const o=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[n.id])==null?void 0:t.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,n)=>{e.getCanGlobalFilter=()=>{var t,o,r,i;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((o=n.options.enableGlobalFilter)!=null?o:!0)&&((r=n.options.enableFilters)!=null?r:!0)&&((i=n.options.getColumnCanGlobalFilter==null?void 0:n.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Mt.includesString,e.getGlobalFilterFn=()=>{var n,t;const{globalFilterFn:o}=e.options;return wo(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(n=(t=e.options.filterFns)==null?void 0:t[o])!=null?n:Mt[o]},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)}}},Kd={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:ut("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let n=!1,t=!1;e._autoResetExpanded=()=>{var o,r;if(!n){e._queue(()=>{n=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!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 s=i.split(".");o=Math.max(o,s.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,n)=>{e.toggleExpanded=t=>{n.setExpanded(o=>{var r;const i=o===!0?!0:!!(o!=null&&o[e.id]);let s={};if(o===!0?Object.keys(n.getRowModel().rowsById).forEach(l=>{s[l]=!0}):s=o,t=(r=t)!=null?r:!i,!i&&t)return{...s,[e.id]:!0};if(i&&!t){const{[e.id]:l,...d}=s;return d}return o})},e.getIsExpanded=()=>{var t;const o=n.getState().expanded;return!!((t=n.options.getIsRowExpanded==null?void 0:n.options.getIsRowExpanded(e))!=null?t:o===!0||o?.[e.id])},e.getCanExpand=()=>{var t,o,r;return(t=n.options.getRowCanExpand==null?void 0:n.options.getRowCanExpand(e))!=null?t:((o=n.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let t=!0,o=e;for(;t&&o.parentId;)o=n.getRow(o.parentId,!0),t=o.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},hr=0,mr=10,vr=()=>({pageIndex:hr,pageSize:mr}),Ud={getInitialState:e=>({...e,pagination:{...vr(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:ut("pagination",e)}),createTable:e=>{let n=!1,t=!1;e._autoResetPageIndex=()=>{var o,r;if(!n){e._queue(()=>{n=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=o=>{const r=i=>Ot(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?vr():(r=e.initialState.pagination)!=null?r:vr())},e.setPageIndex=o=>{e.setPagination(r=>{let i=Ot(o,r.pageIndex);const s=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,s)),{...r,pageIndex:i}})},e.resetPageIndex=o=>{var r,i;e.setPageIndex(o?hr:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:hr)},e.resetPageSize=o=>{var r,i;e.setPageSize(o?mr:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:mr)},e.setPageSize=o=>{e.setPagination(r=>{const i=Math.max(1,Ot(o,r.pageSize)),s=r.pageSize*r.pageIndex,l=Math.floor(s/i);return{...r,pageIndex:l,pageSize:i}})},e.setPageCount=o=>e.setPagination(r=>{var i;let s=Ot(o,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...r,pageCount:s}}),e.getPageOptions=se(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((i,s)=>s)),r},ae(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}}},br=()=>({top:[],bottom:[]}),Yd={getInitialState:e=>({rowPinning:br(),...e}),getDefaultOptions:e=>({onRowPinningChange:ut("rowPinning",e)}),createRow:(e,n)=>{e.pin=(t,o,r)=>{const i=o?e.getLeafRows().map(d=>{let{id:u}=d;return u}):[],s=r?e.getParentRows().map(d=>{let{id:u}=d;return u}):[],l=new Set([...s,e.id,...i]);n.setRowPinning(d=>{var u,f;if(t==="bottom"){var p,_;return{top:((p=d?.top)!=null?p:[]).filter(g=>!(l!=null&&l.has(g))),bottom:[...((_=d?.bottom)!=null?_:[]).filter(g=>!(l!=null&&l.has(g))),...Array.from(l)]}}if(t==="top"){var c,h;return{top:[...((c=d?.top)!=null?c:[]).filter(g=>!(l!=null&&l.has(g))),...Array.from(l)],bottom:((h=d?.bottom)!=null?h:[]).filter(g=>!(l!=null&&l.has(g)))}}return{top:((u=d?.top)!=null?u:[]).filter(g=>!(l!=null&&l.has(g))),bottom:((f=d?.bottom)!=null?f:[]).filter(g=>!(l!=null&&l.has(g)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:o,enablePinning:r}=n.options;return typeof o=="function"?o(e):(t=o??r)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:o,bottom:r}=n.getState().rowPinning,i=t.some(l=>o?.includes(l)),s=t.some(l=>r?.includes(l));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var t,o;const r=e.getIsPinned();if(!r)return-1;const i=(t=r==="top"?n.getTopRows():n.getBottomRows())==null?void 0:t.map(s=>{let{id:l}=s;return l});return(o=i?.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=n=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(n),e.resetRowPinning=n=>{var t,o;return e.setRowPinning(n?br():(t=(o=e.initialState)==null?void 0:o.rowPinning)!=null?t:br())},e.getIsSomeRowsPinned=n=>{var t;const o=e.getState().rowPinning;if(!n){var r,i;return!!((r=o.top)!=null&&r.length||(i=o.bottom)!=null&&i.length)}return!!((t=o[n])!=null&&t.length)},e._getPinnedRows=(n,t,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(t??[]).map(s=>{const l=e.getRow(s,!0);return l.getIsAllParentsExpanded()?l:null}):(t??[]).map(s=>n.find(l=>l.id===s))).filter(Boolean).map(s=>({...s,position:o}))},e.getTopRows=se(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(n,t)=>e._getPinnedRows(n,t,"top"),ae(e.options,"debugRows","getTopRows")),e.getBottomRows=se(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(n,t)=>e._getPinnedRows(n,t,"bottom"),ae(e.options,"debugRows","getBottomRows")),e.getCenterRows=se(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(n,t,o)=>{const r=new Set([...t??[],...o??[]]);return n.filter(i=>!r.has(i.id))},ae(e.options,"debugRows","getCenterRows"))}},Xd={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:ut("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=n=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(n),e.resetRowSelection=n=>{var t;return e.setRowSelection(n?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=n=>{e.setRowSelection(t=>{n=typeof n<"u"?n:!e.getIsAllRowsSelected();const o={...t},r=e.getPreGroupedRowModel().flatRows;return n?r.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):r.forEach(i=>{delete o[i.id]}),o})},e.toggleAllPageRowsSelected=n=>e.setRowSelection(t=>{const o=typeof n<"u"?n:!e.getIsAllPageRowsSelected(),r={...t};return e.getRowModel().rows.forEach(i=>{wr(r,i.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=se(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,t)=>Object.keys(n).length?yr(e,t):{rows:[],flatRows:[],rowsById:{}},ae(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=se(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,t)=>Object.keys(n).length?yr(e,t):{rows:[],flatRows:[],rowsById:{}},ae(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=se(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,t)=>Object.keys(n).length?yr(e,t):{rows:[],flatRows:[],rowsById:{}},ae(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const n=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let o=!!(n.length&&Object.keys(t).length);return o&&n.some(r=>r.getCanSelect()&&!t[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:t}=e.getState();let o=!!n.length;return o&&n.some(r=>!t[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var n;const t=Object.keys((n=e.getState().rowSelection)!=null?n:{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:n.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>n=>{e.toggleAllRowsSelected(n.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>n=>{e.toggleAllPageRowsSelected(n.target.checked)}},createRow:(e,n)=>{e.toggleSelected=(t,o)=>{const r=e.getIsSelected();n.setRowSelection(i=>{var s;if(t=typeof t<"u"?t:!r,e.getCanSelect()&&r===t)return i;const l={...i};return wr(l,e.id,t,(s=o?.selectChildren)!=null?s:!0,n),l})},e.getIsSelected=()=>{const{rowSelection:t}=n.getState();return xr(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=n.getState();return Cr(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=n.getState();return Cr(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof n.options.enableRowSelection=="function"?n.options.enableRowSelection(e):(t=n.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof n.options.enableSubRowSelection=="function"?n.options.enableSubRowSelection(e):(t=n.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof n.options.enableMultiRowSelection=="function"?n.options.enableMultiRowSelection(e):(t=n.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return o=>{var r;t&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}}},wr=(e,n,t,o,r)=>{var i;const s=r.getRow(n,!0);t?(s.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),s.getCanSelect()&&(e[n]=!0)):delete e[n],o&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(l=>wr(e,l.id,t,o,r))};function yr(e,n){const t=e.getState().rowSelection,o=[],r={},i=function(s,l){return s.map(d=>{var u;const f=xr(d,t);if(f&&(o.push(d),r[d.id]=d),(u=d.subRows)!=null&&u.length&&(d={...d,subRows:i(d.subRows)}),f)return d}).filter(Boolean)};return{rows:i(n.rows),flatRows:o,rowsById:r}}function xr(e,n){var t;return(t=n[e.id])!=null?t:!1}function Cr(e,n,t){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!r)&&(s.getCanSelect()&&(xr(s,n)?i=!0:r=!1),s.subRows&&s.subRows.length)){const l=Cr(s,n);l==="all"?i=!0:(l==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}const Sr=/([0-9]+)/gm,Zd=(e,n,t)=>Vs(zt(e.getValue(t)).toLowerCase(),zt(n.getValue(t)).toLowerCase()),Qd=(e,n,t)=>Vs(zt(e.getValue(t)),zt(n.getValue(t))),Jd=(e,n,t)=>$r(zt(e.getValue(t)).toLowerCase(),zt(n.getValue(t)).toLowerCase()),eu=(e,n,t)=>$r(zt(e.getValue(t)),zt(n.getValue(t))),tu=(e,n,t)=>{const o=e.getValue(t),r=n.getValue(t);return o>r?1:o<r?-1:0},nu=(e,n,t)=>$r(e.getValue(t),n.getValue(t));function $r(e,n){return e===n?0:e>n?1:-1}function zt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Vs(e,n){const t=e.split(Sr).filter(Boolean),o=n.split(Sr).filter(Boolean);for(;t.length&&o.length;){const r=t.shift(),i=o.shift(),s=parseInt(r,10),l=parseInt(i,10),d=[s,l].sort();if(isNaN(d[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(d[1]))return isNaN(s)?-1:1;if(s>l)return 1;if(l>s)return-1}return t.length-o.length}const $n={alphanumeric:Zd,alphanumericCaseSensitive:Qd,text:Jd,textCaseSensitive:eu,datetime:tu,basic:nu},ou=[Ld,Gd,Vd,qd,Dd,Td,Wd,Rd,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:ut("sorting",e),isMultiSortEvent:n=>n.shiftKey}),createColumn:(e,n)=>{e.getAutoSortingFn=()=>{const t=n.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const r of t){const i=r?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return $n.datetime;if(typeof i=="string"&&(o=!0,i.split(Sr).length>1))return $n.alphanumeric}return o?$n.text:$n.basic},e.getAutoSortDir=()=>{const t=n.getFilteredRowModel().flatRows[0];return typeof t?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,o;if(!e)throw new Error;return wo(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(t=(o=n.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?t:$n[e.columnDef.sortingFn]},e.toggleSorting=(t,o)=>{const r=e.getNextSortingOrder(),i=typeof t<"u"&&t!==null;n.setSorting(s=>{const l=s?.find(c=>c.id===e.id),d=s?.findIndex(c=>c.id===e.id);let u=[],f,p=i?t:r==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&o?l?f="toggle":f="add":s!=null&&s.length&&d!==s.length-1?f="replace":l?f="toggle":f="replace",f==="toggle"&&(i||r||(f="remove")),f==="add"){var _;u=[...s,{id:e.id,desc:p}],u.splice(0,u.length-((_=n.options.maxMultiSortColCount)!=null?_:Number.MAX_SAFE_INTEGER))}else f==="toggle"?u=s.map(c=>c.id===e.id?{...c,desc:p}:c):f==="remove"?u=s.filter(c=>c.id!==e.id):u=[{id:e.id,desc:p}];return u})},e.getFirstSortDir=()=>{var t,o;return((t=(o=e.columnDef.sortDescFirst)!=null?o:n.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var o,r;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((o=n.options.enableSortingRemoval)==null||o)&&(!(t&&(r=n.options.enableMultiRemove)!=null)||r)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var t,o;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((o=n.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,o;return(t=(o=e.columnDef.enableMultiSort)!=null?o:n.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const o=(t=n.getState().sorting)==null?void 0:t.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,o;return(t=(o=n.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?t:-1},e.clearSorting=()=>{n.setSorting(t=>t!=null&&t.length?t.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return o=>{t&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?n.options.isMultiSortEvent==null?void 0:n.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=n=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(n),e.resetSorting=n=>{var t,o;e.setSorting(n?[]:(t=(o=e.initialState)==null?void 0:o.sorting)!=null?t:[])},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())}},Od,Kd,Ud,Yd,Xd,Bd];function ru(e){var n,t;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...ou,...(n=e._features)!=null?n:[]];let r={_features:o};const i=r._features.reduce((_,c)=>Object.assign(_,c.getDefaultOptions==null?void 0:c.getDefaultOptions(r)),{}),s=_=>r.options.mergeOptions?r.options.mergeOptions(i,_):{...i,..._};let d={...{},...(t=e.initialState)!=null?t:{}};r._features.forEach(_=>{var c;d=(c=_.getInitialState==null?void 0:_.getInitialState(d))!=null?c:d});const u=[];let f=!1;const p={_features:o,options:{...i,...e},initialState:d,_queue:_=>{u.push(_),f||(f=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();f=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{r.setState(r.initialState)},setOptions:_=>{const c=Ot(_,r.options);r.options=s(c)},getState:()=>r.options.state,setState:_=>{r.options.onStateChange==null||r.options.onStateChange(_)},_getRowId:(_,c,h)=>{var g;return(g=r.options.getRowId==null?void 0:r.options.getRowId(_,c,h))!=null?g:`${h?[h.id,c].join("."):c}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(_,c)=>{let h=(c?r.getPrePaginationRowModel():r.getRowModel()).rowsById[_];if(!h&&(h=r.getCoreRowModel().rowsById[_],!h))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${_}`):new Error;return h},_getDefaultColumnDef:se(()=>[r.options.defaultColumn],_=>{var c;return _=(c=_)!=null?c:{},{header:h=>{const g=h.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:h=>{var g,m;return(g=(m=h.renderValue())==null||m.toString==null?void 0:m.toString())!=null?g:null},...r._features.reduce((h,g)=>Object.assign(h,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),..._}},ae(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:se(()=>[r._getColumnDefs()],_=>{const c=function(h,g,m){return m===void 0&&(m=0),h.map(b=>{const w=Pd(r,b,m,g),C=b;return w.columns=C.columns?c(C.columns,w,m+1):[],w})};return c(_)},ae(e,"debugColumns","getAllColumns")),getAllFlatColumns:se(()=>[r.getAllColumns()],_=>_.flatMap(c=>c.getFlatColumns()),ae(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:se(()=>[r.getAllFlatColumns()],_=>_.reduce((c,h)=>(c[h.id]=h,c),{}),ae(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:se(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(_,c)=>{let h=_.flatMap(g=>g.getLeafColumns());return c(h)},ae(e,"debugColumns","getAllLeafColumns")),getColumn:_=>{const c=r._getAllFlatColumnsById()[_];return process.env.NODE_ENV!=="production"&&!c&&console.error(`[Table] Column with id '${_}' does not exist.`),c}};Object.assign(r,p);for(let _=0;_<r._features.length;_++){const c=r._features[_];c==null||c.createTable==null||c.createTable(r)}return r}function iu(){return e=>se(()=>[e.options.data],n=>{const t={rows:[],flatRows:[],rowsById:{}},o=function(r,i,s){i===void 0&&(i=0);const l=[];for(let u=0;u<r.length;u++){const f=dr(e,e._getRowId(r[u],u,s),r[u],u,i,void 0,s?.id);if(t.flatRows.push(f),t.rowsById[f.id]=f,l.push(f),e.options.getSubRows){var d;f.originalSubRows=e.options.getSubRows(r[u],u),(d=f.originalSubRows)!=null&&d.length&&(f.subRows=o(f.originalSubRows,i+1,f))}}return l};return t.rows=o(n),t},ae(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function su(e){const n=[],t=o=>{var r;n.push(o),(r=o.subRows)!=null&&r.length&&o.getIsExpanded()&&o.subRows.forEach(t)};return e.rows.forEach(t),{rows:n,flatRows:e.flatRows,rowsById:e.rowsById}}function au(e,n,t){return t.options.filterFromLeafRows?lu(e,n,t):cu(e,n,t)}function lu(e,n,t){var o;const r=[],i={},s=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,u){u===void 0&&(u=0);const f=[];for(let _=0;_<d.length;_++){var p;let c=d[_];const h=dr(t,c.id,c.original,c.index,c.depth,void 0,c.parentId);if(h.columnFilters=c.columnFilters,(p=c.subRows)!=null&&p.length&&u<s){if(h.subRows=l(c.subRows,u+1),c=h,n(c)&&!h.subRows.length){f.push(c),i[c.id]=c,r.push(c);continue}if(n(c)||h.subRows.length){f.push(c),i[c.id]=c,r.push(c);continue}}else c=h,n(c)&&(f.push(c),i[c.id]=c,r.push(c))}return f};return{rows:l(e),flatRows:r,rowsById:i}}function cu(e,n,t){var o;const r=[],i={},s=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,u){u===void 0&&(u=0);const f=[];for(let _=0;_<d.length;_++){let c=d[_];if(n(c)){var p;if((p=c.subRows)!=null&&p.length&&u<s){const g=dr(t,c.id,c.original,c.index,c.depth,void 0,c.parentId);g.subRows=l(c.subRows,u+1),c=g}f.push(c),r.push(c),i[c.id]=c}}return f};return{rows:l(e),flatRows:r,rowsById:i}}function du(){return e=>se(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(n,t,o)=>{if(!n.rows.length||!(t!=null&&t.length)&&!o){for(let _=0;_<n.flatRows.length;_++)n.flatRows[_].columnFilters={},n.flatRows[_].columnFiltersMeta={};return n}const r=[],i=[];(t??[]).forEach(_=>{var c;const h=e.getColumn(_.id);if(!h)return;const g=h.getFilterFn();if(!g){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:_.id,filterFn:g,resolvedValue:(c=g.resolveFilterValue==null?void 0:g.resolveFilterValue(_.value))!=null?c:_.value})});const s=(t??[]).map(_=>_.id),l=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(_=>_.getCanGlobalFilter());o&&l&&d.length&&(s.push("__global__"),d.forEach(_=>{var c;i.push({id:_.id,filterFn:l,resolvedValue:(c=l.resolveFilterValue==null?void 0:l.resolveFilterValue(o))!=null?c:o})}));let u,f;for(let _=0;_<n.flatRows.length;_++){const c=n.flatRows[_];if(c.columnFilters={},r.length)for(let h=0;h<r.length;h++){u=r[h];const g=u.id;c.columnFilters[g]=u.filterFn(c,g,u.resolvedValue,m=>{c.columnFiltersMeta[g]=m})}if(i.length){for(let h=0;h<i.length;h++){f=i[h];const g=f.id;if(f.filterFn(c,g,f.resolvedValue,m=>{c.columnFiltersMeta[g]=m})){c.columnFilters.__global__=!0;break}}c.columnFilters.__global__!==!0&&(c.columnFilters.__global__=!1)}}const p=_=>{for(let c=0;c<s.length;c++)if(_.columnFilters[s[c]]===!1)return!1;return!0};return au(n.rows,p,e)},ae(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function uu(e){return n=>se(()=>[n.getState().pagination,n.getPrePaginationRowModel(),n.options.paginateExpandedRows?void 0:n.getState().expanded],(t,o)=>{if(!o.rows.length)return o;const{pageSize:r,pageIndex:i}=t;let{rows:s,flatRows:l,rowsById:d}=o;const u=r*i,f=u+r;s=s.slice(u,f);let p;n.options.paginateExpandedRows?p={rows:s,flatRows:l,rowsById:d}:p=su({rows:s,flatRows:l,rowsById:d}),p.flatRows=[];const _=c=>{p.flatRows.push(c),c.subRows.length&&c.subRows.forEach(_)};return p.rows.forEach(_),p},ae(n.options,"debugTable","getPaginationRowModel"))}function fu(){return e=>se(()=>[e.getState().sorting,e.getPreSortedRowModel()],(n,t)=>{if(!t.rows.length||!(n!=null&&n.length))return t;const o=e.getState().sorting,r=[],i=o.filter(d=>{var u;return(u=e.getColumn(d.id))==null?void 0:u.getCanSort()}),s={};i.forEach(d=>{const u=e.getColumn(d.id);u&&(s[d.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const l=d=>{const u=d.map(f=>({...f}));return u.sort((f,p)=>{for(let c=0;c<i.length;c+=1){var _;const h=i[c],g=s[h.id],m=g.sortUndefined,b=(_=h?.desc)!=null?_:!1;let w=0;if(m){const C=f.getValue(h.id),S=p.getValue(h.id),k=C===void 0,$=S===void 0;if(k||$){if(m==="first")return k?-1:1;if(m==="last")return k?1:-1;w=k&&$?0:k?m:-m}}if(w===0&&(w=g.sortingFn(f,p,h.id)),w!==0)return b&&(w*=-1),g.invertSorting&&(w*=-1),w}return f.index-p.index}),u.forEach(f=>{var p;r.push(f),(p=f.subRows)!=null&&p.length&&(f.subRows=l(f.subRows))}),u};return{rows:l(t.rows),flatRows:r,rowsById:t.rowsById}},ae(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
672
|
+
color: hsl(${Math.max(0,Math.min(120-120*u,120))}deg 100% 31%);`,n?.key)}return r}}function ae(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 Rh(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:ie(()=>[e,n,t,s],(i,l,c,d)=>({table:i,column:l,row:c,cell:d,getValue:d.getValue,renderValue:d.renderValue}),ae(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function Uh(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(".")?_=u=>{let f=u;for(const p of c.split(".")){var h;f=(h=f)==null?void 0:h[p],process.env.NODE_ENV!=="production"&&f===void 0&&console.warn(`"${p}" in deeply nested key "${c}" returned undefined.`)}return f}:_=u=>u[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:ie(()=>[!0],()=>{var u;return[g,...(u=g.columns)==null?void 0:u.flatMap(f=>f.getFlatColumns())]},ae(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ie(()=>[e._getOrderColumnsFn()],u=>{var f;if((f=g.columns)!=null&&f.length){let h=g.columns.flatMap(p=>p.getLeafColumns());return u(h)}return[g]},ae(e.options,"debugColumns","column.getLeafColumns"))};for(const u of e._features)u.createColumn==null||u.createColumn(g,e);return g}const ut="debugHeaders";function Ml(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 Wh={createTable:e=>{e.getHeaderGroups=ie(()=>[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(u=>u.id===g)).filter(Boolean))!=null?s:[],c=(i=r?.map(g=>n.find(u=>u.id===g)).filter(Boolean))!=null?i:[],d=n.filter(g=>!(o!=null&&o.includes(g.id))&&!(r!=null&&r.includes(g.id)));return sr(t,[...l,...d,...c],e)},ae(e.options,ut,"getHeaderGroups")),e.getCenterHeaderGroups=ie(()=>[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))),sr(t,n,e,"center")),ae(e.options,ut,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ie(()=>[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 sr(t,s,e,"left")},ae(e.options,ut,"getLeftHeaderGroups")),e.getRightHeaderGroups=ie(()=>[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 sr(t,s,e,"right")},ae(e.options,ut,"getRightHeaderGroups")),e.getFooterGroups=ie(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ae(e.options,ut,"getFooterGroups")),e.getLeftFooterGroups=ie(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ae(e.options,ut,"getLeftFooterGroups")),e.getCenterFooterGroups=ie(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ae(e.options,ut,"getCenterFooterGroups")),e.getRightFooterGroups=ie(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ae(e.options,ut,"getRightFooterGroups")),e.getFlatHeaders=ie(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ae(e.options,ut,"getFlatHeaders")),e.getLeftFlatHeaders=ie(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ae(e.options,ut,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ie(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ae(e.options,ut,"getCenterFlatHeaders")),e.getRightFlatHeaders=ie(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ae(e.options,ut,"getRightFlatHeaders")),e.getCenterLeafHeaders=ie(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),ae(e.options,ut,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ie(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),ae(e.options,ut,"getLeftLeafHeaders")),e.getRightLeafHeaders=ie(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),ae(e.options,ut,"getRightLeafHeaders")),e.getLeafHeaders=ie(()=>[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()},ae(e.options,ut,"getLeafHeaders"))}};function sr(e,t,n,o){var r,s;let i=0;const l=function(u,f){f===void 0&&(f=1),i=Math.max(i,f),u.filter(h=>h.getIsVisible()).forEach(h=>{var p;(p=h.columns)!=null&&p.length&&l(h.columns,f+1)},0)};l(e);let c=[];const d=(u,f)=>{const h={depth:f,id:[o,`${f}`].filter(Boolean).join("_"),headers:[]},p=[];u.forEach(m=>{const w=[...p].reverse()[0],y=m.column.depth===h.depth;let x,$=!1;if(y&&m.column.parent?x=m.column.parent:(x=m.column,$=!0),w&&w?.column===x)w.subHeaders.push(m);else{const A=Ml(n,x,{id:[o,f,x.id,m?.id].filter(Boolean).join("_"),isPlaceholder:$,placeholderId:$?`${p.filter(F=>F.column===x).length}`:void 0,depth:f,index:p.length});A.subHeaders.push(m),p.push(A)}h.headers.push(m),m.headerGroup=h}),c.push(h),f>0&&d(p,f-1)},_=t.map((u,f)=>Ml(n,u,{depth:i,index:f}));d(_,i-1),c.reverse();const g=u=>u.filter(h=>h.column.getIsVisible()).map(h=>{let p=0,m=0,w=[0];h.subHeaders&&h.subHeaders.length?(w=[],g(h.subHeaders).forEach(x=>{let{colSpan:$,rowSpan:A}=x;p+=$,w.push(A)})):p=1;const y=Math.min(...w);return m=m+y,h.colSpan=p,h.rowSpan=m,{colSpan:p,rowSpan:m}});return g((r=(s=c[0])==null?void 0:s.headers)!=null?r:[]),c}const ys=(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:()=>Hh(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:ie(()=>[e.getAllLeafColumns()],c=>c.map(d=>Rh(e,l,d,d.id)),ae(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ie(()=>[l.getAllCells()],c=>c.reduce((d,_)=>(d[_.column.id]=_,d),{}),ae(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},Gh={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()}}},Al=(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))};Al.autoRemove=e=>At(e);const Dl=(e,t,n)=>{var o;return!!(!((o=e.getValue(t))==null||(o=o.toString())==null)&&o.includes(n))};Dl.autoRemove=e=>At(e);const Tl=(e,t,n)=>{var o;return((o=e.getValue(t))==null||(o=o.toString())==null?void 0:o.toLowerCase())===n?.toLowerCase()};Tl.autoRemove=e=>At(e);const Fl=(e,t,n)=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(n)};Fl.autoRemove=e=>At(e);const Pl=(e,t,n)=>!n.some(o=>{var r;return!((r=e.getValue(t))!=null&&r.includes(o))});Pl.autoRemove=e=>At(e)||!(e!=null&&e.length);const Ll=(e,t,n)=>n.some(o=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(o)});Ll.autoRemove=e=>At(e)||!(e!=null&&e.length);const Ol=(e,t,n)=>e.getValue(t)===n;Ol.autoRemove=e=>At(e);const zl=(e,t,n)=>e.getValue(t)==n;zl.autoRemove=e=>At(e);const Cs=(e,t,n)=>{let[o,r]=n;const s=e.getValue(t);return s>=o&&s<=r};Cs.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]},Cs.autoRemove=e=>At(e)||At(e[0])&&At(e[1]);const Ht={includesString:Al,includesStringSensitive:Dl,equalsString:Tl,arrIncludes:Fl,arrIncludesAll:Pl,arrIncludesSome:Ll,equals:Ol,weakEquals:zl,inNumberRange:Cs};function At(e){return e==null||e===""}const Kh={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:St("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"?Ht.includesString:typeof o=="number"?Ht.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Ht.equals:Array.isArray(o)?Ht.arrIncludes:Ht.weakEquals},e.getFilterFn=()=>{var n,o;return rr(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:Ht[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=tn(n,s?s.value:void 0);if(Bl(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=tn(t,r))==null?void 0:s.filter(i=>{const l=n.find(c=>c.id===i.id);if(l){const c=l.getFilterFn();if(Bl(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 Bl(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const xs={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(!qh(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},Yh={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:St("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 xs.sum;if(Object.prototype.toString.call(o)==="[object Date]")return xs.extent},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return rr(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:xs[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 Xh(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:St("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ie(n=>[eo(t,n)],n=>n.findIndex(o=>o.id===e.id),ae(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var o;return((o=eo(t,n)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;const r=eo(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=ie(()=>[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 Xh(s,n,o)},ae(e.options,"debugTable","_getOrderColumnsFn"))}},Ss=()=>({left:[],right:[]}),Jh={getInitialState:e=>({columnPinning:Ss(),...e}),getDefaultOptions:e=>({onColumnPinningChange:St("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=ie(()=>[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))},ae(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ie(()=>[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"})),ae(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ie(()=>[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"})),ae(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?Ss():(n=(o=e.initialState)==null?void 0:o.columnPinning)!=null?n:Ss())},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=ie(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),ae(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ie(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),ae(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ie(()=>[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))},ae(e.options,"debugColumns","getCenterLeafColumns"))}};function Qh(e){return e||(typeof document<"u"?document:null)}const ir={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},$s=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),ep={getDefaultColumnDef:()=>ir,getInitialState:e=>({columnSizing:{},columnSizingInfo:$s(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:St("columnSizing",e),onColumnSizingInfoChange:St("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:ir.minSize,(o=s??e.columnDef.size)!=null?o:ir.size),(r=e.columnDef.maxSize)!=null?r:ir.maxSize)},e.getStart=ie(n=>[n,eo(t,n),t.getState().columnSizing],(n,o)=>o.slice(0,e.getIndex(n)).reduce((r,s)=>r+s.getSize(),0),ae(t.options,"debugColumns","getStart")),e.getAfter=ie(n=>[n,eo(t,n),t.getState().columnSizing],(n,o)=>o.slice(e.getIndex(n)+1).reduce((r,s)=>r+s.getSize(),0),ae(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(),Es(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),l=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[o.id,o.getSize()]],c=Es(s)?Math.round(s.touches[0].clientX):s.clientX,d={},_=(w,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(x=>{var $,A;const F=t.options.columnResizeDirection==="rtl"?-1:1,N=(y-(($=x?.startOffset)!=null?$:0))*F,P=Math.max(N/((A=x?.startSize)!=null?A:0),-.999999);return x.columnSizingStart.forEach(T=>{let[k,z]=T;d[k]=Math.round(Math.max(z+z*P,0)*100)/100}),{...x,deltaOffset:N,deltaPercentage:P}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(x=>({...x,...d})))},g=w=>_("move",w),u=w=>{_("end",w),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},f=Qh(n),h={moveHandler:w=>g(w.clientX),upHandler:w=>{f?.removeEventListener("mousemove",h.moveHandler),f?.removeEventListener("mouseup",h.upHandler),u(w.clientX)}},p={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),g(w.touches[0].clientX),!1),upHandler:w=>{var y;f?.removeEventListener("touchmove",p.moveHandler),f?.removeEventListener("touchend",p.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),u((y=w.touches[0])==null?void 0:y.clientX)}},m=tp()?{passive:!1}:!1;Es(s)?(f?.addEventListener("touchmove",p.moveHandler,m),f?.addEventListener("touchend",p.upHandler,m)):(f?.addEventListener("mousemove",h.moveHandler,m),f?.addEventListener("mouseup",h.upHandler,m)),t.setColumnSizingInfo(w=>({...w,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?$s():(n=e.initialState.columnSizingInfo)!=null?n:$s())},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 ar=null;function tp(){if(typeof ar=="boolean")return ar;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 ar=e,ar}function Es(e){return e.type==="touchstart"}const np={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:St("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=ie(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),ae(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ie(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,o,r)=>[...n,...o,...r],ae(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,o)=>ie(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),ae(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 eo(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const op={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()}}},rp={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:St("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=()=>Ht.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return rr(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[o])!=null?t:Ht[o]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},sp={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:St("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()}}}},Is=0,ks=10,Ns=()=>({pageIndex:Is,pageSize:ks}),ip={getInitialState:e=>({...e,pagination:{...Ns(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:St("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=>tn(o,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?Ns():(r=e.initialState.pagination)!=null?r:Ns())},e.setPageIndex=o=>{e.setPagination(r=>{let s=tn(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?Is:(r=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?r:Is)},e.resetPageSize=o=>{var r,s;e.setPageSize(o?ks:(r=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?r:ks)},e.setPageSize=o=>{e.setPagination(r=>{const s=Math.max(1,tn(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=tn(o,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...r,pageCount:i}}),e.getPageOptions=ie(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((s,i)=>i)),r},ae(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}}},Ms=()=>({top:[],bottom:[]}),ap={getInitialState:e=>({rowPinning:Ms(),...e}),getDefaultOptions:e=>({onRowPinningChange:St("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,u;return{top:((g=c?.top)!=null?g:[]).filter(p=>!(l!=null&&l.has(p))),bottom:[...((u=c?.bottom)!=null?u:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)]}}if(n==="top"){var f,h;return{top:[...((f=c?.top)!=null?f:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)],bottom:((h=c?.bottom)!=null?h:[]).filter(p=>!(l!=null&&l.has(p)))}}return{top:((d=c?.top)!=null?d:[]).filter(p=>!(l!=null&&l.has(p))),bottom:((_=c?.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,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?Ms():(n=(o=e.initialState)==null?void 0:o.rowPinning)!=null?n:Ms())},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=ie(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ae(e.options,"debugRows","getTopRows")),e.getBottomRows=ie(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ae(e.options,"debugRows","getBottomRows")),e.getCenterRows=ie(()=>[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))},ae(e.options,"debugRows","getCenterRows"))}},lp={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:St("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=>{As(r,s.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ie(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Ds(e,n):{rows:[],flatRows:[],rowsById:{}},ae(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ie(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Ds(e,n):{rows:[],flatRows:[],rowsById:{}},ae(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ie(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Ds(e,n):{rows:[],flatRows:[],rowsById:{}},ae(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 As(l,e.id,n,(i=o?.selectChildren)!=null?i:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Ts(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Fs(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Fs(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)}}}},As=(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=>As(e,l.id,n,o,r))};function Ds(e,t){const n=e.getState().rowSelection,o=[],r={},s=function(i,l){return i.map(c=>{var d;const _=Ts(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 Ts(e,t){var n;return(n=t[e.id])!=null?n:!1}function Fs(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()&&(Ts(i,t)?s=!0:r=!1),i.subRows&&i.subRows.length)){const l=Fs(i,t);l==="all"?s=!0:(l==="some"&&(s=!0),r=!1)}}),r?"all":s?"some":!1}const Ps=/([0-9]+)/gm,cp=(e,t,n)=>Vl(nn(e.getValue(n)).toLowerCase(),nn(t.getValue(n)).toLowerCase()),dp=(e,t,n)=>Vl(nn(e.getValue(n)),nn(t.getValue(n))),up=(e,t,n)=>Ls(nn(e.getValue(n)).toLowerCase(),nn(t.getValue(n)).toLowerCase()),fp=(e,t,n)=>Ls(nn(e.getValue(n)),nn(t.getValue(n))),_p=(e,t,n)=>{const o=e.getValue(n),r=t.getValue(n);return o>r?1:o<r?-1:0},gp=(e,t,n)=>Ls(e.getValue(n),t.getValue(n));function Ls(e,t){return e===t?0:e>t?1:-1}function nn(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Vl(e,t){const n=e.split(Ps).filter(Boolean),o=t.split(Ps).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 to={alphanumeric:cp,alphanumericCaseSensitive:dp,text:up,textCaseSensitive:fp,datetime:_p,basic:gp},hp=[Wh,np,Zh,Jh,Gh,Kh,op,rp,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:St("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 to.datetime;if(typeof s=="string"&&(o=!0,s.split(Ps).length>1))return to.alphanumeric}return o?to.text:to.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 rr(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:to[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{const r=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const l=i?.find(f=>f.id===e.id),c=i?.findIndex(f=>f.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 u;d=[...i,{id:e.id,desc:g}],d.splice(0,d.length-((u=t.options.maxMultiSortColCount)!=null?u:Number.MAX_SAFE_INTEGER))}else _==="toggle"?d=i.map(f=>f.id===e.id?{...f,desc:g}:f):_==="remove"?d=i.filter(f=>f.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())}},Yh,sp,ip,ap,lp,ep];function pp(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...hp,...(t=e._features)!=null?t:[]];let r={_features:o};const s=r._features.reduce((u,f)=>Object.assign(u,f.getDefaultOptions==null?void 0:f.getDefaultOptions(r)),{}),i=u=>r.options.mergeOptions?r.options.mergeOptions(s,u):{...s,...u};let c={...{},...(n=e.initialState)!=null?n:{}};r._features.forEach(u=>{var f;c=(f=u.getInitialState==null?void 0:u.getInitialState(c))!=null?f:c});const d=[];let _=!1;const g={_features:o,options:{...s,...e},initialState:c,_queue:u=>{d.push(u),_||(_=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();_=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{r.setState(r.initialState)},setOptions:u=>{const f=tn(u,r.options);r.options=i(f)},getState:()=>r.options.state,setState:u=>{r.options.onStateChange==null||r.options.onStateChange(u)},_getRowId:(u,f,h)=>{var p;return(p=r.options.getRowId==null?void 0:r.options.getRowId(u,f,h))!=null?p:`${h?[h.id,f].join("."):f}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(u,f)=>{let h=(f?r.getPrePaginationRowModel():r.getRowModel()).rowsById[u];if(!h&&(h=r.getCoreRowModel().rowsById[u],!h))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${u}`):new Error;return h},_getDefaultColumnDef:ie(()=>[r.options.defaultColumn],u=>{var f;return u=(f=u)!=null?f:{},{header:h=>{const p=h.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:h=>{var p,m;return(p=(m=h.renderValue())==null||m.toString==null?void 0:m.toString())!=null?p:null},...r._features.reduce((h,p)=>Object.assign(h,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...u}},ae(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:ie(()=>[r._getColumnDefs()],u=>{const f=function(h,p,m){return m===void 0&&(m=0),h.map(w=>{const y=Uh(r,w,m,p),x=w;return y.columns=x.columns?f(x.columns,y,m+1):[],y})};return f(u)},ae(e,"debugColumns","getAllColumns")),getAllFlatColumns:ie(()=>[r.getAllColumns()],u=>u.flatMap(f=>f.getFlatColumns()),ae(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ie(()=>[r.getAllFlatColumns()],u=>u.reduce((f,h)=>(f[h.id]=h,f),{}),ae(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ie(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(u,f)=>{let h=u.flatMap(p=>p.getLeafColumns());return f(h)},ae(e,"debugColumns","getAllLeafColumns")),getColumn:u=>{const f=r._getAllFlatColumnsById()[u];return process.env.NODE_ENV!=="production"&&!f&&console.error(`[Table] Column with id '${u}' does not exist.`),f}};Object.assign(r,g);for(let u=0;u<r._features.length;u++){const f=r._features[u];f==null||f.createTable==null||f.createTable(r)}return r}function mp(){return e=>ie(()=>[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 _=ys(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},ae(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function vp(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 bp(e,t,n){return n.options.filterFromLeafRows?wp(e,t,n):yp(e,t,n)}function wp(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 u=0;u<c.length;u++){var g;let f=c[u];const h=ys(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);if(h.columnFilters=f.columnFilters,(g=f.subRows)!=null&&g.length&&d<i){if(h.subRows=l(f.subRows,d+1),f=h,t(f)&&!h.subRows.length){_.push(f),s[f.id]=f,r.push(f);continue}if(t(f)||h.subRows.length){_.push(f),s[f.id]=f,r.push(f);continue}}else f=h,t(f)&&(_.push(f),s[f.id]=f,r.push(f))}return _};return{rows:l(e),flatRows:r,rowsById:s}}function yp(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 u=0;u<c.length;u++){let f=c[u];if(t(f)){var g;if((g=f.subRows)!=null&&g.length&&d<i){const p=ys(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);p.subRows=l(f.subRows,d+1),f=p}_.push(f),r.push(f),s[f.id]=f}}return _};return{rows:l(e),flatRows:r,rowsById:s}}function Cp(){return e=>ie(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,o)=>{if(!t.rows.length||!(n!=null&&n.length)&&!o){for(let u=0;u<t.flatRows.length;u++)t.flatRows[u].columnFilters={},t.flatRows[u].columnFiltersMeta={};return t}const r=[],s=[];(n??[]).forEach(u=>{var f;const h=e.getColumn(u.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:u.id,filterFn:p,resolvedValue:(f=p.resolveFilterValue==null?void 0:p.resolveFilterValue(u.value))!=null?f:u.value})});const i=(n??[]).map(u=>u.id),l=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(u=>u.getCanGlobalFilter());o&&l&&c.length&&(i.push("__global__"),c.forEach(u=>{var f;s.push({id:u.id,filterFn:l,resolvedValue:(f=l.resolveFilterValue==null?void 0:l.resolveFilterValue(o))!=null?f:o})}));let d,_;for(let u=0;u<t.flatRows.length;u++){const f=t.flatRows[u];if(f.columnFilters={},r.length)for(let h=0;h<r.length;h++){d=r[h];const p=d.id;f.columnFilters[p]=d.filterFn(f,p,d.resolvedValue,m=>{f.columnFiltersMeta[p]=m})}if(s.length){for(let h=0;h<s.length;h++){_=s[h];const p=_.id;if(_.filterFn(f,p,_.resolvedValue,m=>{f.columnFiltersMeta[p]=m})){f.columnFilters.__global__=!0;break}}f.columnFilters.__global__!==!0&&(f.columnFilters.__global__=!1)}}const g=u=>{for(let f=0;f<i.length;f++)if(u.columnFilters[i[f]]===!1)return!1;return!0};return bp(t.rows,g,e)},ae(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function xp(e){return t=>ie(()=>[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=vp({rows:i,flatRows:l,rowsById:c}),g.flatRows=[];const u=f=>{g.flatRows.push(f),f.subRows.length&&f.subRows.forEach(u)};return g.rows.forEach(u),g},ae(t.options,"debugTable","getPaginationRowModel"))}function Sp(){return e=>ie(()=>[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 f=0;f<s.length;f+=1){var u;const h=s[f],p=i[h.id],m=p.sortUndefined,w=(u=h?.desc)!=null?u:!1;let y=0;if(m){const x=_.getValue(h.id),$=g.getValue(h.id),A=x===void 0,F=$===void 0;if(A||F){if(m==="first")return A?-1:1;if(m==="last")return A?1:-1;y=A&&F?0:A?m:-m}}if(y===0&&(y=p.sortingFn(_,g,h.id)),y!==0)return w&&(y*=-1),p.invertSorting&&(y*=-1),y}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}},ae(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
20
673
|
* react-table
|
|
21
674
|
*
|
|
22
675
|
* Copyright (c) TanStack
|
|
@@ -25,5 +678,5 @@
|
|
|
25
678
|
* LICENSE.md file in the root directory of this source tree.
|
|
26
679
|
*
|
|
27
680
|
* @license MIT
|
|
28
|
-
*/function ln(e,n){return e?_u(e)?M.createElement(e,n):e:null}function _u(e){return gu(e)||typeof e=="function"||pu(e)}function gu(e){return typeof e=="function"&&(()=>{const n=Object.getPrototypeOf(e);return n.prototype&&n.prototype.isReactComponent})()}function pu(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function hu(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=M.useState(()=>({current:ru(n)})),[o,r]=M.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:s=>{r(s),e.onStateChange==null||e.onStateChange(s)}})),t.current}const $e={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"},qs=v.createContext(null),js=()=>v.useContext(qs),cn=v.forwardRef((e,n)=>{const{children:t,label:o,hint:r,isSelected:i,defaultChecked:s,isIndeterminate:l=!1,isDisabled:d=!1,isReadOnly:u=!1,isRequired:f=!1,lineThrough:p=!1,onlyIcon:_=!1,disableAnimation:c=!1,customCheckIcon:h,size:g="md",color:m="primary",customColor:b,radius:w="md",variant:C="solid",className:S="",classNames:k={},onChange:$,value:I,name:F,...L}=e,N=js(),D=v.useId(),V=v.useRef(null),T=i!==void 0,[y,E]=v.useState(s??!1),z=!!N,A=z&&I?N.value.includes(I):!1,x=z?A:T?i:y,P=d||N?.isDisabled,O=u||N?.isReadOnly,B=f||N?.isRequired,j=F||N?.name;v.useEffect(()=>{const G=V.current||(n&&typeof n=="object"?n.current:null);G&&(G.indeterminate=l??!1)},[l,n]);const q=G=>{if(P||O)return;const le=G.target.checked;z&&I?N.onChange(I):(T||E(le),$?.(le))},J=o||t;return a.jsxs("div",{className:K($e.checkbox_container,{[$e.disabled]:P,[$e.readonly]:O},k.base,S),children:[a.jsxs("label",{className:K($e.checkbox_wrapper,$e[g],!b&&$e[m],$e[C],$e[`radius_${w}`],{[$e.checked]:x,[$e.indeterminate]:l,[$e.disabled]:P,[$e.readonly]:O,[$e.line_through]:p&&x,[$e.no_animation]:c}),style:b?{"--checkbox-custom-color":b}:void 0,children:[a.jsxs("span",{className:$e.checkbox,children:[a.jsx("input",{ref:G=>{V.current=G,typeof n=="function"?n(G):n&&(n.current=G)},id:D,type:"checkbox",className:$e.input,checked:x,onChange:q,disabled:P,readOnly:O,required:B,value:I,name:j,...L}),h?a.jsx("span",{className:$e.custom_icon,children:h}):a.jsx("svg",{className:$e.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"})})]}),!_&&J&&a.jsx("span",{className:K($e.label_text,k.label),children:J})]}),r&&a.jsx("span",{className:K($e.hint_text,k.label),children:r})]})});cn.displayName="Checkbox";const Bs=({label:e,children:n,description:t,errorMessage:o,isInvalid:r=!1,orientation:i="vertical",className:s,value:l,defaultValue:d=[],onChange:u,isDisabled:f=!1,isReadOnly:p=!1,isRequired:_=!1,name:c,options:h,optionValueKey:g,optionLabelKey:m,optionDisabledKey:b,optionDescriptionKey:w})=>{const C=l!==void 0,[S,k]=v.useState(d),$=C?l:S,I=F=>{if(f||p)return;const L=$.includes(F)?$.filter(N=>N!==F):[...$,F];C||k(L),u?.(L)};return a.jsxs("div",{className:K($e.checkbox_group,$e[i],{[$e.invalid]:r,[$e.disabled]:f,[$e.readonly]:p},s),role:"group","aria-required":_,"aria-invalid":r,children:[e&&a.jsxs("div",{className:$e.label,children:[e,_&&a.jsx("span",{className:$e.marca_requerido,children:" *"})]}),t&&a.jsx("div",{className:$e.description,children:t}),a.jsx(qs.Provider,{value:{value:$,onChange:I,isDisabled:f,isReadOnly:p,isRequired:_,name:c},children:a.jsx("div",{className:K($e.checkboxes,$e[i]),children:h&&h.length>0?h.map((F,L)=>{let N,D,V=!1,T;if(typeof F=="object"&&F!==null){const y=g??"value",E=m??"label",z=b??"isDisabled",A=w??"description",x=F[y],P=F[E];N=String(x!==void 0?x:L),D=P;const O=F[z];V=typeof O=="boolean"?O:!1;const B=F[A];T=typeof B=="string"?B:void 0}else N=String(F),D=F;return a.jsx(cn,{value:N,isDisabled:V,hint:T,children:D},N)}):n})}),o&&r&&a.jsx("div",{className:$e.error_message,children:o})]})};Bs.displayName="CheckboxGroup";const kn={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 In({content:e,children:n,placement:t="top",variant:o="default",size:r="md",offset:i=8,delayShow:s=100,delayHide:l=0,isDisabled:d=!1,showArrow:u=!1,maxWidth:f="320px",isInteractive:p=!1,className:_="",onOpen:c,onClose:h,isOpen:g,onOpenChange:m}){const[b,w]=v.useState(!1),C=v.useRef(null),S=g!==void 0?g:b,k=v.useCallback(O=>{d||(m?m(O):w(O),O?c?.():h?.())},[d,m,c,h]),{refs:$,floatingStyles:I,context:F,isPositioned:L}=uo({open:S,onOpenChange:k,placement:t,strategy:"fixed",middleware:[Jn(i+(u?8:0)),to({fallbackAxisSideDirection:"start",padding:8}),eo({padding:8}),u?Sc({element:C}):void 0].filter(Boolean),whileElementsMounted:Xn}),N=Jo(F,{delay:{open:s,close:p?200:l||100},enabled:!d,move:!1,handleClose:null}),D=Rc(F,{enabled:!d}),V=co(F,{enabled:!d}),T=po(F,{role:"tooltip"}),{getReferenceProps:y,getFloatingProps:E}=fo([N,D,V,T]),{isMounted:z,styles:A}=ho(F,{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(()=>[kn.tooltip,kn[`size_${r}`],kn[`variant_${o}`],_].filter(Boolean).join(" "),[r,o,_]),P=v.useMemo(()=>v.cloneElement(n,y({ref:$.setReference,...n.props})),[n,y,$.setReference]);return!e||d?n:a.jsxs(a.Fragment,{children:[P,z&&a.jsx(lo,{children:a.jsx("div",{ref:$.setFloating,className:kn.tooltip_positioner,style:{...I,maxWidth:f,zIndex:9999,pointerEvents:"none"},children:a.jsxs("div",{className:x,style:{...A,pointerEvents:p?"auto":"none",visibility:L||!S?"visible":"hidden"},...E(),children:[e,u&&a.jsx(Nc,{ref:C,context:F,className:kn.arrow})]})})})]})}const je={contenedor:"_contenedor_hurn6_1",contenedor_superior:"_contenedor_superior_hurn6_17",input_con_icono:"_input_con_icono_hurn6_35",icono_busqueda:"_icono_busqueda_hurn6_49",input_busqueda:"_input_busqueda_hurn6_75",contenedor_acciones_botones:"_contenedor_acciones_botones_hurn6_147",contenedor_acciones:"_contenedor_acciones_hurn6_147",columna:"_columna_hurn6_183",encabezados:"_encabezados_hurn6_201",boton_basico:"_boton_basico_hurn6_265",texto_filtros:"_texto_filtros_hurn6_289",menu_configuraciones:"_menu_configuraciones_hurn6_321",boton_excel:"_boton_excel_hurn6_349",contenedor_tabla:"_contenedor_tabla_hurn6_369",contenedor_datos:"_contenedor_datos_hurn6_387",datos:"_datos_hurn6_395",seleccionada:"_seleccionada_hurn6_431",boton_acciones:"_boton_acciones_hurn6_475"};function mu(e,n,t=3){const o=Math.floor(t/2);let r=e-o;r<1&&(r=1),r+t-1>n&&(r=Math.max(1,n-t+1));const i=Math.min(t,n);return Array.from({length:i},(s,l)=>r+l)}function vu(e,n){return n===0?0:e>=n?n-1:e<0?0:e}function bu(e){return e?{asc:" ↑",desc:" ↓"}[e]??null:null}function dn(e,n){const t=new Map;n.getFlatHeaders().forEach(s=>t.set(s.column.id,s));const o=t.get(e);if(o)return ln(o.column.columnDef.header,o.getContext());const r=n.getAllLeafColumns().find(s=>s.id===e),i=r?.columnDef.header;return typeof i=="string"||typeof i=="number"?i:r?.id??e}function Hs(e,n){const t=e.getVisibleCells().find(o=>o.column.id===n);return t?ln(t.column.columnDef.cell,t.getContext()):null}function Gs(e,n){return n?e.getVisibleCells().map(o=>o.column.id).includes(n):!1}function wu(e,n,t){return e.getVisibleCells().filter(o=>o.column.id!=="actions"&&o.column.id!==n&&o.column.id!==t)}function yu(e,n){if(n===0)return"";if(n===1)return kr(e[0].nombre.toLowerCase());if(n===2)return`${kr(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const t=e.slice(0,2).map(r=>r.nombre.toLowerCase()),o=n-2;return`${kr(t.join(", "))} y ${o>1?`otros ${o}`:"otro"} más`}function kr(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Ws(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}const Rs=v.createContext(null),Ir=Rs;function xu({children:e,data:n,columns:t,controls:o,loading:r,primerasColumnas:i,tamanioPaginaInicial:s=10,filtros:l,descargarExcel:d,actualizarTabla:u,selectorFilas:f=[],sinDatosProps:p}){const[_,c]=v.useState(""),h=dd(_,200),g=mo("only screen and (max-width: 830px)"),[m,b]=v.useState({pageIndex:0,pageSize:s}),[w,C]=v.useState({}),S=v.useMemo(()=>{const x=[];if(f.length>0&&!g){const P={id:"select",header:({table:O})=>a.jsx(cn,{color:"secondary",isSelected:O.getIsAllPageRowsSelected(),isIndeterminate:O.getIsSomePageRowsSelected()&&!O.getIsAllPageRowsSelected(),onChange:B=>O.toggleAllPageRowsSelected(!!B)}),cell:({row:O})=>a.jsx(cn,{color:"primary",isSelected:O.getIsSelected(),isDisabled:!O.getCanSelect(),onChange:B=>O.toggleSelected(B)}),enableSorting:!1,enableHiding:!1};x.push(P)}if(x.push(...t),o?.length){const P={id:"actions",header:"Acciones",cell:O=>a.jsx("div",{className:je.contenedor_acciones,children:o.map(B=>a.jsx(In,{content:B.nombre,variant:"default",size:"sm",placement:"top",children:a.jsx("button",{type:"button",onClick:()=>B.evento(O.row.original),className:je.boton_acciones,children:B.icono})},B.id))}),enableSorting:!1,enableHiding:!1};x.push(P)}return x},[t,o,f,g]),k=v.useMemo(()=>{const x=S.map(O=>"accessorKey"in O?String(O.accessorKey):"id"in O?String(O.id):"").filter(Boolean),P=x.indexOf("actions");return P>-1&&P<x.length-1&&(x.splice(P,1),x.push("actions")),x},[S]),[$,I]=v.useState(k),F=v.useCallback((x,P,O)=>{if(!O)return!0;const B=Ws(O),j=x.getValue(P);return j==null?!1:Ws(String(j)).includes(B)},[]),L=hu({data:n,columns:S,state:{pagination:m,globalFilter:h,columnOrder:$,rowSelection:w},globalFilterFn:F,enableRowSelection:f.length>0,onRowSelectionChange:C,onPaginationChange:b,onColumnOrderChange:I,getCoreRowModel:iu(),getSortedRowModel:fu(),getFilteredRowModel:du(),getPaginationRowModel:uu(),autoResetPageIndex:!1}),N=L.getPageCount();v.useEffect(()=>{const x=vu(m.pageIndex,N);x!==m.pageIndex&&b(P=>({...P,pageIndex:x}))},[N]),v.useEffect(()=>{h!==void 0&&L.setPageIndex(0)},[h]);const D=v.useMemo(()=>L.getAllLeafColumns().filter(x=>x.id!=="actions"&&x.id!=="select"&&x.getCanHide?.()),[L]),V=v.useCallback(x=>{const O=t.find(B=>"accessorKey"in B?B.accessorKey===x:B.id===x)?.header;return typeof O=="string"||typeof O=="number"?String(O):x},[t]),T=v.useCallback(()=>{L.setColumnVisibility({}),L.setPageSize(s),L.setPageIndex(0),L.resetRowSelection(),I(k)},[L,s,k]),y=v.useCallback(x=>{const P=Math.max(1,Math.min(200,x));L.setPageSize(P),L.setPageIndex(0)},[L]),E=v.useCallback(x=>{I(P=>typeof x=="function"?x(P):x)},[]),A={state:{ordenColumnas:$,table:L,columns:S,controls:o,loading:r,primerasColumnas:[String(i[0]),String(i[1])],inputBusqueda:_,setInputBusqueda:c,filtros:l,descargarExcel:d,actualizarTabla:u,selectorFilas:f,sinDatosProps:p},todasLasColumnas:D,etiquetaColumna:V,restaurarConfiguracion:T,cambiarPageSize:y,cambiarOrdenColumnas:E};return a.jsx(Rs.Provider,{value:A,children:e})}function Cu(){const e=v.useContext(Ir);if(!e)throw new Error("useTablaContext debe usarse dentro de TablaDatosProvider");return e}function Vt(){const e=v.useContext(Ir);return e||null}const Nt={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 Ks(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 Us(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 Su(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 $u(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 ku(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 Iu(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 Eu(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 Mu(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 Nu(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 Fu(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 Au(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 Ys(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 Pu(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 Lu(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"})})}const Du=({titulo:e,onBack:n})=>a.jsxs("header",{className:Nt.header,children:[a.jsx(ht,{isIconOnly:!0,variant:"light",onClick:n,"aria-label":"Regresar",children:a.jsx(Ks,{})}),a.jsx("h3",{className:Nt.titulo,children:e})]}),Ut={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 Tu(){const e=Vt(),[n,t]=v.useState(null);if(!e)return null;const{state:o,todasLasColumnas:r,etiquetaColumna:i,cambiarOrdenColumnas:s}=e,{ordenColumnas:l}=o,d=p=>_=>{t(p),_.dataTransfer.effectAllowed="move",_.dataTransfer.setData("text/plain",p)},u=p=>_=>{_.preventDefault(),!(!n||n===p)&&s?.(c=>{const h=[...c],g=h.indexOf(n),m=h.indexOf(p);return g===-1||m===-1?c:(h.splice(g,1),h.splice(m,0,n),h)})},f=()=>t(null);return a.jsx("div",{className:Ut.contenedor,children:a.jsx("ul",{className:Ut.lista,children:l.map(p=>{const _=r.find(m=>m.id===p);if(!_)return null;const c=_.getCanHide?.()??!0,h=_.getIsVisible(),g=n===_.id;return a.jsxs("li",{className:`${Ut.item} ${g?Ut.item_dragging:""}`,draggable:!0,onDragStart:d(_.id),onDragOver:u(_.id),onDrop:f,onDragEnd:f,children:[a.jsx("span",{className:Ut.icono_drag,"aria-label":"Arrastrar columna",children:a.jsx(Nu,{})}),a.jsx("span",{className:Ut.nombre,children:i(_.id)}),a.jsx(cn,{size:"md",color:"primary",isSelected:h,isDisabled:!c,onChange:m=>_.toggleVisibility(m),className:Ut.checkbox})]},_.id)})})})}const En={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function Ou(){const e=Vt(),[n,t]=v.useState(""),o=v.useRef(null),r=e?.state.table?.getState().pagination.pageSize??10;if(v.useEffect(()=>t(String(r)),[r]),!e)return null;const{cambiarPageSize:i}=e,s=p=>Math.max(Er,Math.min(Mr,p)),l=p=>{const _=r+p;_>=Er&&_<=Mr&&i?.(_)},d=()=>{const p=parseInt(n,10),_=!isNaN(p)&&p>0?s(p):r;i?.(_),t(String(_))},u=p=>{({Enter:()=>{d(),o.current?.blur()},Escape:()=>{t(String(r)),o.current?.blur()},ArrowUp:()=>{p.preventDefault(),l(1),setTimeout(()=>o.current?.select(),0)},ArrowDown:()=>{p.preventDefault(),l(-1),setTimeout(()=>o.current?.select(),0)}})[p.key]?.()},f=p=>{const _=p.target.value;(_===""||/^\d+$/.test(_))&&t(_)};return a.jsxs("div",{className:En.contenido,children:[a.jsx("p",{className:En.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),a.jsxs("div",{className:En.control,children:[a.jsx(ht,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(-1),"aria-label":"Disminuir filas",disabled:r<=Er,children:a.jsx(Pu,{style:{fontSize:"var(--gaps-6)"}})}),a.jsx("div",{className:En.valor,children:a.jsx("input",{ref:o,type:"text",inputMode:"numeric",value:n,onChange:f,onKeyDown:u,onFocus:()=>o.current?.select(),onBlur:d,className:En.input,"aria-label":"Número de filas por página"})}),a.jsx(ht,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(1),"aria-label":"Aumentar filas",disabled:r>=Mr,children:a.jsx(Ys,{})})]})]})}const ot={contenedor:"_contenedor_1syil_1",menu:"_menu_1syil_11",item:"_item_1syil_25",icono_contenedor:"_icono_contenedor_1syil_71",texto:"_texto_1syil_109",nombre:"_nombre_1syil_123",descripcion:"_descripcion_1syil_135",chevron:"_chevron_1syil_151",divider:"_divider_1syil_175"};function zu({navegar:e}){const n=Vt();return a.jsxs("div",{className:ot.contenedor,children:[a.jsx("nav",{className:ot.menu,children:ju.map(({id:t,icono:o,nombre:r,descripcion:i})=>a.jsxs("button",{className:ot.item,onClick:()=>e(t),children:[a.jsx("div",{className:ot.icono_contenedor,children:a.jsx(o,{})}),a.jsxs("div",{className:ot.texto,children:[a.jsx("span",{className:ot.nombre,children:r}),a.jsx("span",{className:ot.descripcion,children:i})]}),a.jsx(Us,{className:ot.chevron})]},t))}),a.jsx("div",{className:ot.divider}),a.jsx("div",{className:ot.menu,children:a.jsxs("button",{className:ot.item,onClick:n?.restaurarConfiguracion,children:[a.jsx("div",{className:ot.icono_contenedor,children:a.jsx(Mu,{})}),a.jsxs("div",{className:ot.texto,children:[a.jsx("span",{className:ot.nombre,children:"Restaurar configuración"}),a.jsx("span",{className:ot.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const Er=1,Mr=200,Xs=250,Vu=200,qu={panelPrincipal:{component:zu},panelColumnas:{component:Tu,titulo:"Columnas visibles"},panelFilas:{component:Ou,titulo:"Filas por página"}},ju=[{id:"panelColumnas",icono:Fu,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:Au,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}];function Bu(e,n,t){const o=v.useRef(t);o.current=t;const r=v.useRef(e);r.current=e;const i=v.useCallback(s=>{const l=s.target;o.current.some(u=>u.current?.contains(l))||r.current()},[]);v.useEffect(()=>{if(!n)return;const s=setTimeout(()=>{document.addEventListener("mousedown",i)},100);return()=>{clearTimeout(s),document.removeEventListener("mousedown",i)}},[n,i])}function Zs(e,n){v.useEffect(()=>{if(!n)return;const t=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[n,e])}function Hu(e,n,t,{width:o,margin:r=0,offsetRight:i=0,offsetLeft:s=0,offsetTop:l=0,offsetBottom:d=0}){const[u,f]=v.useState({top:0,left:0}),p=mo("only screen and (max-width: 480px)");return v.useEffect(()=>{if(!t||!e.current)return;const _=()=>{const c=e.current.getBoundingClientRect();let h=c.bottom+l,g=0;if(p)g=window.innerWidth-o-r;else{const b=c.right-o+i-s;g=Math.max(r,Math.min(b,window.innerWidth-o-r))}const m=n.current?.offsetHeight||400;h+m>window.innerHeight-r&&(h=c.top-m-d,h<r&&(h=c.bottom+l)),f({top:h,left:g})};return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[t,p,o,r,i,s,l,d,e,n]),u}function Gu(e){v.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function Wu(){const[e,n]=v.useState(!1),[t,o]=v.useState(!1),[r,i]=v.useState("panelPrincipal"),[s,l]=v.useState(null),d=v.useRef(null),u=v.useRef(null),f=v.useRef(null);Gu(t),Bu(()=>_(),t,[d,u]),Zs(()=>_(),t);const p=Hu(d,u,t,{width:Xs,offsetRight:6,offsetTop:-2});v.useEffect(()=>{e&&(o(!0),l(null))},[e]),v.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);function _(){t&&(n(!1),f.current=window.setTimeout(()=>{o(!1),i("panelPrincipal"),l(null)},Vu))}function c(m){l(m==="panelPrincipal"?"backward":"forward"),i(m)}const h=qu[r],g=h.component;return a.jsxs("div",{className:Nt.contenedor,children:[a.jsx(ht,{isIconOnly:!0,ref:d,variant:"light",onClick:()=>n(m=>!m),"aria-haspopup":"dialog","aria-expanded":e,children:a.jsx(Eu,{})}),t&&d.current&&un.createPortal(a.jsx("div",{ref:u,className:`${Nt.popover} ${e?Nt.popover_entrada:Nt.popover_salida}`,role:"dialog",style:{top:`${p.top}px`,left:`${p.left}px`,width:Xs},children:a.jsx("div",{className:Nt.ventana,children:a.jsxs("div",{className:K([Nt.panel,Nt[`panel_${s}`]]),children:[h.titulo&&a.jsx(Du,{titulo:h.titulo,onBack:()=>c("panelPrincipal")}),a.jsx(g,{navegar:c})]},r)})}),document.body)]})}function Ru(){const e=Vt();if(!e)return null;const{state:n}=e,{inputBusqueda:t,setInputBusqueda:o,filtros:r,actualizarTabla:i,descargarExcel:s}=n,{abrirFiltros:l,filtrosAplicados:d=[]}=r||{},u=d?.length||0;return a.jsxs("section",{className:je.contenedor_superior,children:[a.jsxs("div",{className:je.input_con_icono,children:[a.jsx(Su,{className:je.icono_busqueda}),a.jsx("input",{type:"text",placeholder:"Buscar en tabla...",value:t??"",onChange:f=>o&&o(f.target.value),className:je.input_busqueda})]}),a.jsxs("div",{className:je.contenedor_acciones_botones,children:[a.jsxs("div",{className:je.contenedor_acciones,children:[i!==void 0&&a.jsxs(ht,{variant:"light",className:je.boton_basico,disabled:i?.cargando,onClick:i?.onClick,children:[a.jsx(Iu,{}),i?.cargando?"Actualizando...":"Actualizar tabla"]}),l!==void 0&&a.jsxs(ht,{onClick:l,variant:"light",className:je.boton_basico,children:[a.jsx(ku,{})," Filtros"]}),u>0?a.jsxs("div",{className:je.texto_filtros,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:yu(d,u)})]}):null]}),s!==void 0?a.jsxs(ht,{onClick:s,className:`${je.boton_basico} ${je.boton_excel}`,children:[a.jsx($u,{})," Excel"]}):null]}),a.jsx("div",{className:je.menu_configuraciones,children:a.jsx(Wu,{})})]})}const qt={contenedor_paginacion:"_contenedor_paginacion_1di9q_1",info_paginacion:"_info_paginacion_1di9q_19",contenedor_botones:"_contenedor_botones_1di9q_35",boton_paginacion:"_boton_paginacion_1di9q_71",pagina_activa:"_pagina_activa_1di9q_89",boton_num_paginacion:"_boton_num_paginacion_1di9q_99"};function Ku(){const e=Vt();if(!e)return null;const{state:n}=e,{table:t}=n,o=t.getPrePaginationRowModel().rows.length,r=t.getPageCount()||1,{pageIndex:i}=t.getState().pagination,s=i+1,l=mu(s,r),d=t.getCanPreviousPage(),u=t.getCanNextPage(),f=r>1,p=()=>{d&&t.previousPage()},_=()=>{u&&t.nextPage()},c=h=>{t.setPageIndex(h-1)};return a.jsxs("section",{className:qt.contenedor_paginacion,children:[a.jsxs("p",{className:qt.info_paginacion,children:["Documentos: ",o]}),f&&a.jsxs("div",{className:qt.contenedor_botones,children:[d&&a.jsx(Ks,{onClick:p,"aria-disabled":!d,className:qt.boton_paginacion}),l.map(h=>a.jsx("button",{type:"button",onClick:()=>c(h),className:h===s?qt.pagina_activa:qt.boton_num_paginacion,children:h},h)),u&&a.jsx(Us,{onClick:_,"aria-disabled":!u,className:qt.boton_paginacion})]}),a.jsxs("p",{className:qt.info_paginacion,children:["Página ",s," de ",r]})]})}const ke={contenedor_tabla_cards:"_contenedor_tabla_cards_1xee4_1",contenedor_card:"_contenedor_card_1xee4_11",contenedor_encabezado_card:"_contenedor_encabezado_card_1xee4_25",contenedor_columna_card:"_contenedor_columna_card_1xee4_47",card_label:"_card_label_1xee4_57",card_valor:"_card_valor_1xee4_69",card_segundo_valor:"_card_segundo_valor_1xee4_83",contenedor_contenido_cards:"_contenedor_contenido_cards_1xee4_93",contenedor_fila_card:"_contenedor_fila_card_1xee4_105",card_fila_label:"_card_fila_label_1xee4_119",card_fila_valor:"_card_fila_valor_1xee4_137",contenedor_acciones_card:"_contenedor_acciones_card_1xee4_153",boton_acciones:"_boton_acciones_1xee4_171",boton_card:"_boton_card_1xee4_207"};function Qs(e,n){if(n)return e.find(t=>t.accessorKey===n||t.id!==void 0&&t.id===String(n))}function Js(e){if(e)return e.id??e.accessorKey}const Ft={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 Uu({filas:e,cantidadControles:n=0,table:t,idPrimeraColumna:o,idSegundaColumna:r}){const s=t.getAllLeafColumns().filter(d=>d.id!=="actions"&&d.id!==o&&d.id!==r),l=["25vw","30vw","20vw","28vw","22vw","26vw"];return a.jsx("section",{className:ke.contenedor_tabla_cards,children:Array.from({length:e}).map((d,u)=>a.jsxs("article",{className:ke.contenedor_card,children:[a.jsxs("div",{className:ke.contenedor_encabezado_card,children:[a.jsx("div",{className:ke.contenedor_columna_card,children:o&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ke.card_label,children:dn(o,t)}),a.jsx("div",{className:ke.card_valor,children:a.jsx("div",{className:`${Ft.skeleton_elemento} ${Ft.skeleton_elemento_encabezado}`})})]})}),a.jsx("div",{className:ke.contenedor_columna_card,children:r&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ke.card_label,children:dn(r,t)}),a.jsx("div",{className:ke.card_segundo_valor,children:a.jsx("div",{className:`${Ft.skeleton_elemento} ${Ft.skeleton_elemento_encabezado_segundo}`})})]})})]}),a.jsx("div",{className:ke.contenedor_contenido_cards,children:s.map((f,p)=>a.jsxs("div",{className:ke.contenedor_fila_card,children:[a.jsx("div",{className:ke.card_fila_label,children:dn(f.id,t)}),a.jsx("div",{className:ke.card_fila_valor,children:a.jsx("div",{className:`${Ft.skeleton_elemento} ${Ft.skeleton_elemento_contenido}`,style:{width:l[p%l.length]}})})]},f.id))}),n>0&&a.jsx("div",{className:ke.contenedor_acciones_card,children:Array.from({length:Math.min(n,3)}).map((f,p)=>a.jsx("div",{className:Ft.skeleton_accion,children:a.jsx("div",{className:`${Ft.skeleton_elemento} ${Ft.skeleton_elemento_encabezado}`})},`accion-${p}`))})]},`skeleton-card-${u}`))})}const jt={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",boton_agregar:"_boton_agregar_53kvd_145"};function ea(){const e=v.useContext(Ir),{sinDatosProps:n}=e?.state||{},{alAgregarRegistro:t,titulo:o="No se encontraron resultados",descripcion:r="No hay datos que coincidan con tus filtros. Intenta buscar por otra variable o agrega un nuevo registro.",etiquetaAccion:i="Agregar nuevo registro"}=n||{};return a.jsxs("div",{className:jt.contenedor,children:[a.jsx(Yu,{}),a.jsxs("div",{className:jt.envolvedor_contenido,children:[a.jsx(Xu,{}),a.jsx("h3",{className:jt.titulo,children:o}),a.jsx("p",{className:jt.descripcion,children:r}),t?a.jsxs(ht,{onClick:t,variant:"bordered",className:jt.boton_agregar,children:[a.jsx(Ys,{})," ",i]}):null]})]})}function Yu(){return a.jsx("div",{className:jt.envolvedor_cuadricula,children:a.jsxs("svg",{className:jt.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 Xu(){return a.jsxs("svg",{className:jt.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 Zu=({fila:e,controls:n})=>(n?.length??0)>0?a.jsx("div",{className:ke.contenedor_acciones_card,children:n?.map(o=>a.jsxs("button",{type:"button",title:o.nombre,onClick:()=>o.evento(e.original),className:`${ke.boton_acciones} ${ke.boton_card}`,children:[o.icono," ",o.nombre]},o.id))}):null,Qu=({columnasRestantes:e,table:n})=>e.length===0?null:a.jsx("div",{className:ke.contenedor_contenido_cards,children:e.map(t=>a.jsxs("div",{className:ke.contenedor_fila_card,children:[a.jsx("div",{className:ke.card_fila_label,children:dn(t.column.id,n)}),a.jsx("div",{className:ke.card_fila_valor,children:ln(t.column.columnDef.cell,t.getContext())})]},t.id))}),Ju=({fila:e,table:n,idPrimeraColumna:t,idSegundaColumna:o})=>{const r=Gs(e,t),i=Gs(e,o);return a.jsxs("div",{className:ke.contenedor_encabezado_card,children:[a.jsx("div",{className:ke.contenedor_columna_card,children:t&&r&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ke.card_label,children:dn(t,n)}),a.jsx("div",{className:ke.card_valor,children:Hs(e,t)})]})}),a.jsx("div",{className:ke.contenedor_columna_card,children:o&&i&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ke.card_label,children:dn(o,n)}),a.jsx("div",{className:ke.card_segundo_valor,children:Hs(e,o)})]})})]})};function ef(){const e=Vt();if(!e)return null;const{state:n}=e,{table:t,controls:o,primerasColumnas:r,loading:i,columns:s}=n;if(!t)return null;const l=s&&r?Qs(s,r[0]):void 0,d=s&&r?Qs(s,r[1]):void 0,u=Js(l),f=Js(d);if(i)return a.jsx(Uu,{filas:3,cantidadControles:o?.length??0,table:t,idPrimeraColumna:u,idSegundaColumna:f});const p=t.getRowModel().rows;return p.length===0?a.jsx("article",{className:ke.contenedor_card,children:a.jsx(ea,{})}):a.jsx("section",{className:ke.contenedor_tabla_cards,children:p.map(_=>{const c=wu(_,u,f);return a.jsxs("article",{className:ke.contenedor_card,children:[a.jsx(Ju,{fila:_,table:t,idPrimeraColumna:u,idSegundaColumna:f}),a.jsx(Qu,{columnasRestantes:c,table:t}),a.jsx(Zu,{fila:_,controls:o})]},_.id)})})}const ta={filas:"_filas_un2v3_1",columnas:"_columnas_un2v3_43"},tf=({columnas:e,filas:n})=>a.jsx(a.Fragment,{children:Array.from({length:n}).map((t,o)=>a.jsx("tr",{className:ta.filas,children:Array.from({length:e}).map((r,i)=>a.jsx("td",{className:ta.columnas},`sk-cell-${o}-${i}`))},`sk-row-${o}`))}),Yt={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 nf({totalSeleccionadas:e,acciones:n,filasSeleccionadas:t,onLimpiarSeleccion:o}){const[r,i]=v.useState(0),[s,l]=v.useState([]),[d,u]=v.useState([]),f=e>0,p=v.useRef(null);return Zs(o,f),v.useEffect(()=>{f&&(i(e),l(n),u(t))},[e,n,t,f]),a.jsx(Pn,{mostrar:f,tipo:"escalar",className:Yt.contenedor,children:a.jsxs("div",{ref:p,className:Yt.barra,children:[a.jsxs("div",{className:Yt.info,children:[a.jsx(ht,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:o,"aria-label":"Limpiar selección",className:Yt.btn_cerrar,children:a.jsx(Lu,{})}),a.jsxs("p",{className:Yt.contador,children:[r," filas seleccionadas"]})]}),a.jsx("div",{className:Yt.separador}),a.jsx("div",{className:Yt.acciones,children:s.map(_=>a.jsx("div",{children:_.componente(d)},_.id))})]})})}function of(){const e=Vt();if(!e)return null;const{state:n}=e,{table:t,loading:o,columns:r,selectorFilas:i=[]}=n;if(!t)return null;const s=t.getHeaderGroups(),l=t.getRowModel().rows,d=r?.length??0,u=t.getSelectedRowModel().rows,f=u.length,p=()=>{t.resetRowSelection()};return a.jsxs(a.Fragment,{children:[a.jsxs("table",{className:je.contenedor_tabla,children:[a.jsx("thead",{children:s.map(_=>a.jsx("tr",{children:_.headers.map(c=>{const h=c.column.columnDef.meta?.style;return a.jsx("th",{className:je.encabezados,style:h,"data-columna":c.id,children:c.id==="select"?a.jsx("div",{children:ln(c.column.columnDef.header,c.getContext())}):a.jsxs("div",{onClick:c.column.getToggleSortingHandler(),children:[ln(c.column.columnDef.header,c.getContext()),bu(c.column.getIsSorted())]})},c.id)})},_.id))}),a.jsx("tbody",{className:je.contenedor_datos,children:o?a.jsx(tf,{columnas:d,filas:10}):l.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:d,style:{backgroundColor:"var(--base)"},children:a.jsx(ea,{})})}):l.map(_=>a.jsx("tr",{className:`${je.datos} ${_.getIsSelected()?je.seleccionada:""}`,children:_.getVisibleCells().map(c=>{const h=c.column.columnDef.meta?.style;return a.jsx("td",{className:je.columna,style:h,"data-columna":c.column.id,children:ln(c.column.columnDef.cell,c.getContext())},c.id)})},_.id))})]}),i?.length>0?a.jsx(nf,{totalSeleccionadas:f,acciones:i,filasSeleccionadas:u.map(_=>_.original),onLimpiarSeleccion:p}):null]})}function rf({id:e}){const n=mo("only screen and (max-width: 830px)");return a.jsxs("main",{className:je.contenedor,id:e,children:[a.jsx(Ru,{}),n?a.jsx(ef,{}):a.jsx(of,{}),a.jsx(Ku,{})]})}function sf({id:e,...n}){return a.jsx(xu,{...n,children:a.jsx(rf,{id:e})})}const Me={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"},na=v.createContext(void 0),af=()=>v.useContext(na),Nr=v.memo(v.forwardRef(({value:e,label:n,description:t,size:o="md",color:r="primary",customColor:i,variant:s="default",isDisabled:l=!1,isReadOnly:d=!1,isInvalid:u=!1,isRequired:f=!1,children:p,className:_="",onChange:c,...h},g)=>{const m=af(),b=v.useId(),w=h.id||b,C=m?.name||h.name,S=m?.size||o,k=m?.color||r,$=m?.customColor||i,I=m?.variant||s,F=m?.isDisabled||l,L=m?.isReadOnly||d,N=m?.isInvalid||u,D=m?.isRequired||f,V=m?.value!==void 0?m.value===e:void 0,T=p||n,y=A=>{F||L||(m?.onChange&&m.onChange(e),c&&c(A))},E=[Me.contenedor_radio,Me[`tam_${S}`],!$&&Me[`color_${k}`],Me[`variante_${I}`],F&&Me.deshabilitado,L&&Me.solo_lectura,N&&Me.invalido,V&&Me.seleccionado,_].filter(Boolean).join(" "),z=$?{"--radio-custom-color":$}:void 0;return a.jsx("div",{className:E,style:z,children:a.jsxs("label",{className:Me.envoltorio_radio,htmlFor:w,children:[a.jsxs("div",{className:Me.radio,children:[a.jsx("input",{ref:g,type:"radio",id:w,name:C,value:e,checked:V,disabled:F,readOnly:L,required:D,"aria-invalid":N,className:Me.input,onChange:y,...h}),a.jsx("div",{className:Me.circulo_radio,children:a.jsx("div",{className:Me.punto_radio})})]})," ",T&&a.jsxs("div",{className:Me.contenedor_label,children:[a.jsxs("span",{className:Me.texto_label,children:[T,f&&!m&&a.jsx("span",{className:Me.marca_requerido,children:" *"})]}),t&&a.jsx("span",{className:Me.texto_descripcion,children:t})]})]})})}));Nr.displayName="Radio";const oa=({name:e,value:n,defaultValue:t,onChange:o,orientation:r="horizontal",label:i,description:s,isDisabled:l=!1,isReadOnly:d=!1,isRequired:u=!1,isInvalid:f=!1,errorMessage:p,size:_,color:c,customColor:h,variant:g,justifyContent:m="flex-start",children:b,className:w="",options:C,optionValueKey:S,optionLabelKey:k,optionDisabledKey:$,optionDescriptionKey:I})=>{const[F,L]=v.useState(String(t??"")),N=n!==void 0?String(n):F,V={name:e,value:N,onChange:E=>{l||d||(n===void 0&&L(E),o&&o(E))},size:_,color:c,customColor:h,variant:g,isDisabled:l,isReadOnly:d,isInvalid:f,isRequired:u},T=[Me.grupo_radio,Me[`orientacion_${r}`],f&&Me.grupo_invalido,l&&Me.grupo_deshabilitado,d&&Me.grupo_solo_lectura,w].filter(Boolean).join(" "),y=m==="center"?"center":m==="flex-end"?"right":"left";return a.jsx(na.Provider,{value:V,children:a.jsxs("div",{className:T,role:"radiogroup","aria-required":u,"aria-invalid":f,style:{textAlign:y},children:[i&&a.jsxs("div",{className:Me.encabezado_grupo,children:[a.jsxs("label",{className:Me.label_grupo,children:[i,u&&a.jsx("span",{className:Me.marca_requerido,children:" *"})]}),s&&a.jsx("span",{className:Me.descripcion_grupo,children:s})]}),a.jsx("div",{className:Me.contenedor_radios,style:{justifyContent:m},children:C&&C.length>0?C.map((E,z)=>{let A,x,P=!1,O;if(typeof E=="object"&&E!==null){const B=S??"value",j=k??"label",q=$??"isDisabled",J=I??"description",G=E[B],le=E[j];A=String(G!==void 0?G:z),x=le;const oe=E[q];P=typeof oe=="boolean"?oe:!1;const re=E[J];O=typeof re=="string"?re:void 0}else A=String(E),x=E;return a.jsx(Nr,{value:A,isDisabled:P,description:O,children:x},A)}):b}),f&&p&&a.jsx("span",{className:Me.mensaje_error,children:p})]})})};oa.displayName="RadioGroup";const Oe={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"},ra=v.forwardRef(({isSelected:e,defaultSelected:n=!1,onChange:t,label:o,description:r,size:i="md",color:s="primary",customColor:l,variant:d="default",isDisabled:u=!1,isReadOnly:f=!1,isInvalid:p=!1,isRequired:_=!1,showIcons:c=!1,labelPlacement:h="right",labelPosition:g="inline",justifyEnd:m=!1,children:b,className:w="",...C},S)=>{const[k,$]=v.useState(n),I=v.useId(),F=C.id||I,L=e!==void 0?e:k,N=A=>{if(u||f)return;const x=A.target.checked;e===void 0&&$(x),t&&t(x)},D=b||o,V=[Oe.contenedor_toggle,Oe[`tam_${i}`],!l&&Oe[`color_${s}`],Oe[`variante_${d}`],Oe[`label_${h}`],Oe[`posicion_${g}`],L&&Oe.seleccionado,u&&Oe.deshabilitado,f&&Oe.solo_lectura,p&&Oe.invalido,c&&Oe.con_iconos,m&&Oe.justify_end,w].filter(Boolean).join(" "),T=l?{"--toggle-custom-color":l}:void 0,y=()=>D?a.jsxs("div",{className:Oe.contenedor_label,children:[a.jsxs("span",{className:Oe.texto_label,children:[D,_&&a.jsx("span",{className:Oe.marca_requerido,children:" *"})]}),r&&a.jsx("span",{className:Oe.texto_descripcion,children:r})]}):null,E=()=>d!=="moon"?null:a.jsx("div",{className:Oe.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"})})}),z=()=>!c||d==="moon"?null:a.jsxs(a.Fragment,{children:[a.jsx("svg",{className:Oe.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:Oe.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:T,children:[g==="top"&&y(),a.jsxs("label",{className:Oe.envoltorio_toggle,htmlFor:F,children:[g==="inline"&&h==="left"&&y(),a.jsxs("div",{className:Oe.pista_toggle,children:[a.jsx("input",{ref:S,type:"checkbox",id:F,checked:L,disabled:u,readOnly:f,required:_,"aria-invalid":p,className:Oe.input,onChange:N,...C}),a.jsx("div",{className:Oe.fondo_pista,children:a.jsxs("div",{className:Oe.pulgar_toggle,children:[E(),z()]})})]}),g==="inline"&&h==="right"&&y()]})]})});ra.displayName="Toggle";const rt={backdrop:"_backdrop_1cxqc_1",visible:"_visible_1cxqc_39",drawer:"_drawer_1cxqc_51",posicion_right:"_posicion_right_1cxqc_81",slideInRight:"_slideInRight_1cxqc_1",drawer_detras:"_drawer_detras_1cxqc_145",posicion_left:"_posicion_left_1cxqc_153",slideInLeft:"_slideInLeft_1cxqc_1",radio_none:"_radio_none_1cxqc_225",radio_sm:"_radio_sm_1cxqc_233",posicion_top:"_posicion_top_1cxqc_233",posicion_bottom:"_posicion_bottom_1cxqc_243",radio_md:"_radio_md_1cxqc_253",radio_lg:"_radio_lg_1cxqc_273",radio_xl:"_radio_xl_1cxqc_293",slideInTop:"_slideInTop_1cxqc_1",slideInBottom:"_slideInBottom_1cxqc_1",tamano_sm:"_tamano_sm_1cxqc_457",tamano_md:"_tamano_md_1cxqc_467",tamano_lg:"_tamano_lg_1cxqc_477",tamano_xl:"_tamano_xl_1cxqc_487",tamano_full:"_tamano_full_1cxqc_497",encabezado:"_encabezado_1cxqc_557",titulo:"_titulo_1cxqc_577",boton_cerrar:"_boton_cerrar_1cxqc_597",contenido:"_contenido_1cxqc_651",pie:"_pie_1cxqc_663",loading_overlay:"_loading_overlay_1cxqc_683",spinner:"_spinner_1cxqc_709",spin:"_spin_1cxqc_709",loading_text:"_loading_text_1cxqc_739",resize_handle:"_resize_handle_1cxqc_751"},ia=v.forwardRef(({isOpen:e,onClose:n,position:t="right",size:o="md",title:r,showCloseButton:i=!0,closeOnBackdropClick:s=!0,closeOnEscape:l=!0,preventScroll:d=!0,header:u,footer:f,children:p,className:_="",contentClassName:c="",isLoading:h=!1,loadingMessage:g="Cargando...",onOpen:m,backdropVariant:b="normal",borderRadius:w,resizable:C=!1,zIndex:S,getContainer:k},$)=>{const I=v.useRef(null),[F,L]=v.useState(!1),N=v.useCallback(()=>{L(!0),setTimeout(()=>{n?.(),L(!1)},350)},[n]);v.useEffect(()=>{if(e){if(m?.(),d){const j=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",j>0&&(document.body.style.paddingRight=`${j}px`)}if(l){const j=q=>{q.key==="Escape"&&N()};return document.addEventListener("keydown",j),()=>{document.removeEventListener("keydown",j),d&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{d&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,N,l,d,m]);const D=j=>{s&&j.target===I.current&&N()},V=w?rt[`radio_${w}`]:void 0,T=[rt.drawer,rt[`posicion_${t}`],rt[`tamano_${o}`],V,_].filter(Boolean).join(" "),y=[rt.contenido,c].filter(Boolean).join(" "),E=[rt.backdrop,e&&!F&&rt.visible].filter(Boolean).join(" "),z=S||500,A={transparente:{opacity:0,blur:0},sutil:{opacity:.2,blur:0},normal:{opacity:.4,blur:1},intermedio:{opacity:.6,blur:3},intenso:{opacity:.8,blur:6}},{opacity:x,blur:P}=A[b],O={background:`rgb(0 0 0 / ${x})`,backdropFilter:`blur(${P}px)`,zIndex:z,...k&&{position:"absolute"}},B=a.jsx("div",{className:E,ref:I,onClick:D,style:O,children:a.jsxs("div",{ref:$,className:T,role:"dialog","aria-modal":"true","aria-labelledby":"drawer-title",children:[(r||u)&&a.jsx("div",{className:rt.encabezado,children:u||a.jsxs(a.Fragment,{children:[a.jsx("h2",{id:"drawer-title",className:rt.titulo,children:r}),i&&a.jsx("button",{type:"button",className:rt.boton_cerrar,onClick:N,"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:y,children:p}),f&&a.jsx("div",{className:rt.pie,children:f}),h&&a.jsxs("div",{className:rt.loading_overlay,children:[a.jsx("div",{className:rt.spinner}),a.jsx("span",{className:rt.loading_text,children:g})]}),C&&a.jsx("div",{className:rt.resize_handle})]})});if(k){const j=typeof k=="function"?k():k;if(j&&j instanceof HTMLElement)return un.createPortal(B,j)}return B});ia.displayName="Drawer";const tt={backdrop:"_backdrop_rrtrc_1",visible:"_visible_rrtrc_41",centrado:"_centrado_rrtrc_53",modal:"_modal_rrtrc_61",scaleInModal:"_scaleInModal_rrtrc_1",tamano_sm:"_tamano_sm_rrtrc_133",tamano_md:"_tamano_md_rrtrc_141",tamano_lg:"_tamano_lg_rrtrc_149",tamano_xl:"_tamano_xl_rrtrc_157",tamano_formulario:"_tamano_formulario_rrtrc_165",tamano_full:"_tamano_full_rrtrc_173",tamano_auto:"_tamano_auto_rrtrc_181",encabezado:"_encabezado_rrtrc_191",contenedor_titulo_completo:"_contenedor_titulo_completo_rrtrc_205",contenedor_titulo_icono:"_contenedor_titulo_icono_rrtrc_215",boton_atras:"_boton_atras_rrtrc_227",icono_titulo:"_icono_titulo_rrtrc_269",titulo:"_titulo_rrtrc_283",contenido:"_contenido_rrtrc_303",pie:"_pie_rrtrc_315",loading_overlay:"_loading_overlay_rrtrc_335",spinner:"_spinner_rrtrc_361",spin:"_spin_rrtrc_361",loading_text:"_loading_text_rrtrc_391"},sa=v.forwardRef(({isOpen:e,onClose:n,size:t="md",title:o,titleIcon:r,closeOnBackdropClick:i=!1,closeOnEscape:s=!0,preventScroll:l=!0,isCentered:d=!0,header:u,footer:f,children:p,className:_="",contentClassName:c="",isLoading:h=!1,loadingMessage:g="Cargando...",backdropVariant:m="normal",showIconTitle:b=!1,onOpen:w},C)=>{const S=v.useRef(null),k=v.useCallback(()=>{h||n?.()},[n,h]);v.useEffect(()=>{if(e){if(w?.(),l){const y=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",y>0&&(document.body.style.paddingRight=`${y}px`)}if(s){const y=E=>{E.key==="Escape"&&k()};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y),l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,k,s,l,w]);const $=y=>{i&&y.target===S.current&&k()},I=[tt.backdrop,d&&tt.centrado,e&&tt.visible].filter(Boolean).join(" "),F=[tt.modal,tt[`tamano_${t}`],_].filter(Boolean).join(" "),L=[tt.contenido,c].filter(Boolean).join(" "),N={transparente:{opacity:0,blur:0},sutil:{opacity:.3,blur:1},normal:{opacity:.5,blur:4},intermedio:{opacity:.7,blur:8},intenso:{opacity:.9,blur:12}},{opacity:D,blur:V}=N[m]||N.normal,T={background:`rgb(0 0 0 / ${D})`,backdropFilter:`blur(${V}px)`};return a.jsx("div",{className:I,ref:S,onClick:$,style:T,children:a.jsxs("div",{ref:C,className:F,role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",children:[(o||u)&&a.jsx("div",{className:tt.encabezado,children:a.jsx("div",{className:tt.contenedor_titulo_completo,children:u||a.jsx(a.Fragment,{children:a.jsxs("div",{className:tt.contenedor_titulo_icono,children:[b&&r!==void 0&&(typeof r=="string"?a.jsx("span",{className:tt.icono_titulo,children:r}):r),b&&r===void 0&&a.jsx("span",{className:tt.icono_titulo,children:"📄"}),a.jsx("h2",{id:"modal-title",className:tt.titulo,children:o})]})})})}),a.jsx("div",{className:L,children:p}),f&&a.jsx("div",{className:tt.pie,children:f}),h&&a.jsxs("div",{className:tt.loading_overlay,children:[a.jsx("div",{className:tt.spinner}),a.jsx("span",{className:tt.loading_text,children:g})]})]})})});sa.displayName="Modal";const pt={overlay:"_overlay_1d3xw_1",container:"_container_1d3xw_29",modal:"_modal_1d3xw_47",modal_closing:"_modal_closing_1d3xw_85",modal_detras:"_modal_detras_1d3xw_95",header:"_header_1d3xw_171",button_back:"_button_back_1d3xw_187",title_container:"_title_container_1d3xw_243",title_icon:"_title_icon_1d3xw_259",title:"_title_1d3xw_243",content:"_content_1d3xw_291",footer:"_footer_1d3xw_303"};function lf({modals:e,onClose:n}){const[t,o]=v.useState([]),[r,i]=v.useState(!1);v.useEffect(()=>{const _=()=>{i(window.innerWidth<=768)};return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]);const s=_=>{o(c=>[...c,_]),setTimeout(()=>{n(_),o(c=>c.filter(h=>h!==_))},300)};if(e.length===0)return null;const l=e.length-1,d=500,u=24,f=e.length*d+(e.length-1)*u,p=e.length>1?f/2-d/2-l*(d+u):0;return a.jsx("div",{className:pt.overlay,children:a.jsx("div",{className:pt.container,style:r?void 0:{transform:`translateX(${p}px)`},children:e.map((_,c)=>{const h=t.includes(_.id),g=c===e.length-1,m=[pt.modal,h&&pt.modal_closing,!g&&pt.modal_detras].filter(Boolean).join(" ");return a.jsxs("div",{className:m,children:[a.jsxs("div",{className:pt.header,children:[a.jsx("button",{type:"button",className:pt.button_back,onClick:()=>s(_.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:pt.title_container,children:[_.titleIcon&&a.jsx("span",{className:pt.title_icon,children:_.titleIcon}),a.jsx("h2",{className:pt.title,children:_.title})]})]}),a.jsx("div",{className:pt.content,children:_.content}),_.footer&&a.jsx("div",{className:pt.footer,children:_.footer})]},_.id)})})})}const Fr=v.createContext(null),Ar=()=>{const e=v.useContext(Fr);if(!e)throw new Error("useDropdownContext debe usarse dentro de DropdownMenu o ContextMenu");return e},Mn=e=>e.type==="separator"||e.type==="label"?!1:"children"in e&&Array.isArray(e.children)&&e.children.length>0,aa=e=>e.type==="checkbox",la=e=>e.type==="radio",ca=e=>e.type==="separator",da=e=>e.type==="label",xe={menu:"_menu_1bgl0_1",variant_default:"_variant_default_1bgl0_49",variant_elevated:"_variant_elevated_1bgl0_59",variant_bordered:"_variant_bordered_1bgl0_69",variant_glass:"_variant_glass_1bgl0_83",size_sm:"_size_sm_1bgl0_97",size_md:"_size_md_1bgl0_113",size_lg:"_size_lg_1bgl0_127",item:"_item_1bgl0_143",disabled:"_disabled_1bgl0_201",active:"_active_1bgl0_203",danger:"_danger_1bgl0_249",has_submenu:"_has_submenu_1bgl0_263",submenu_open:"_submenu_open_1bgl0_271",indicator:"_indicator_1bgl0_279",start_icon:"_start_icon_1bgl0_309",content:"_content_1bgl0_351",label_text:"_label_text_1bgl0_369",description:"_description_1bgl0_381",shortcut:"_shortcut_1bgl0_399",end_icon:"_end_icon_1bgl0_423",submenu_arrow:"_submenu_arrow_1bgl0_453",separator:"_separator_1bgl0_489",label:"_label_1bgl0_369",menuEnter:"_menuEnter_1bgl0_1",context_menu_trigger:"_context_menu_trigger_1bgl0_623"},cf=()=>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"})}),df=()=>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"})}),uf=({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"})]}),Pr=v.forwardRef(({item:e,index:n,activeIndex:t,getItemProps:o},r)=>{const i=Ar();if(ca(e))return a.jsx("div",{className:K(xe.separator,i.classNames?.separator),role:"separator"});if(da(e))return a.jsx("div",{className:K(xe.label,i.classNames?.label),role:"presentation","data-testid":"dropdown-label",children:e.label});const s=n===t,l=aa(e),d=la(e),u=$=>{"isDisabled"in e&&e.isDisabled||(l?e.onCheckedChange?.(!e.isChecked):d&&i.onRadioChange?.(e.value),"onSelect"in e&&e.onSelect&&e.onSelect($),i.closeOnSelect&&!Mn(e)&&i.cerrarMenu())},f=$=>{u($)},p=$=>{"isDisabled"in e&&e.isDisabled||($.key==="Enter"||$.key===" ")&&($.preventDefault(),u($))},_=l?e.isChecked:!1,c=d?i.radioValue===e.value:!1,h="label"in e?e.label:void 0,g="description"in e?e.description:void 0,m="shortcut"in e?e.shortcut:void 0,b="startIcon"in e?e.startIcon:void 0,w="endIcon"in e?e.endIcon:void 0,C="isDisabled"in e?e.isDisabled:!1,S="isDanger"in e?e.isDanger:!1,k="className"in e?e.className:void 0;return a.jsxs("div",{ref:r,role:l?"menuitemcheckbox":d?"menuitemradio":"menuitem","aria-checked":l?_:d?c:void 0,"aria-disabled":C,tabIndex:s?0:-1,className:K(xe.item,xe[`size_${i.size}`],s&&xe.active,C&&xe.disabled,S&&xe.danger,Mn(e)&&xe.has_submenu,k,i.classNames?.item),onClick:f,onKeyDown:p,...o(),children:[(l||d)&&a.jsxs("span",{className:xe.indicator,children:[l&&_&&a.jsx(cf,{}),d&&a.jsx(uf,{marcado:c})]}),b&&a.jsx("span",{className:xe.start_icon,children:b}),a.jsxs("span",{className:xe.content,children:[a.jsx("span",{className:xe.label_text,children:h}),g&&a.jsx("span",{className:xe.description,children:g})]}),m&&a.jsx("kbd",{className:xe.shortcut,children:m}),w&&a.jsx("span",{className:xe.end_icon,children:w}),Mn(e)&&a.jsx("span",{className:xe.submenu_arrow,children:a.jsx(df,{})})]})});Pr.displayName="MenuItem";const ff=()=>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"})}),So=({items:e,activeIndex:n,getItemProps:t,listRef:o})=>a.jsx(a.Fragment,{children:e.map((r,i)=>Mn(r)?a.jsx(Lr,{ref:s=>{o.current[i]=s},item:r,index:i,activeIndex:n,getItemProps:t},r.id):a.jsx(Pr,{ref:s=>{o.current[i]=s},item:r,index:i,activeIndex:n,getItemProps:t},r.id))});So.displayName="MenuList";const Lr=v.forwardRef(({item:e,index:n,activeIndex:t,getItemProps:o},r)=>{const i=Ar(),[s,l]=v.useState(!1),d=Wt(),u=Ki(),f=v.useRef([]),[p,_]=v.useState(null),{refs:c,floatingStyles:h,context:g,isPositioned:m}=uo({nodeId:u,open:s,onOpenChange:l,placement:"right-start",middleware:[Jn({mainAxis:4,alignmentAxis:-4}),to(),eo({padding:8})],whileElementsMounted:Xn}),{isMounted:b,styles:w}=ho(g,{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)"}}),C=Jo(g,{enabled:!e.isDisabled,delay:{open:75},handleClose:hs({blockPointerEvents:!0})}),S=po(g,{role:"menu"}),k=co(g,{bubbles:!0}),$=ar(g,{listRef:f,activeIndex:p,onNavigate:_,nested:!0}),{getReferenceProps:I,getFloatingProps:F,getItemProps:L}=fo([C,S,k,$]);v.useEffect(()=>{if(!d)return;const V=()=>l(!1);return d.events.on("click",V),()=>{d.events.off("click",V)}},[d]);const N=n===t,D=zi([c.setReference,r]);return a.jsxs(Ui,{id:u,children:[a.jsxs("div",{ref:D,role:"menuitem","aria-haspopup":"menu","aria-expanded":s,"aria-disabled":e.isDisabled,tabIndex:N?0:-1,className:K(xe.item,xe[`size_${i.size}`],N&&xe.active,e.isDisabled&&xe.disabled,e.isDanger&&xe.danger,xe.has_submenu,s&&xe.submenu_open,e.className,i.classNames?.item),...I(o()),children:[e.startIcon&&a.jsx("span",{className:xe.start_icon,children:e.startIcon}),a.jsxs("span",{className:xe.content,children:[a.jsx("span",{className:xe.label_text,children:e.label}),e.description&&a.jsx("span",{className:xe.description,children:e.description})]}),e.shortcut&&a.jsx("kbd",{className:xe.shortcut,children:e.shortcut}),a.jsx("span",{className:xe.submenu_arrow,children:a.jsx(ff,{})})]}),b&&a.jsx(lo,{root:i.portalContainer,children:a.jsx(or,{context:g,modal:!1,initialFocus:-1,returnFocus:!1,children:a.jsx("div",{ref:c.setFloating,style:{...h,pointerEvents:"none",zIndex:i.zIndex??"var(--z-dropdown)"},children:a.jsx("div",{className:K(xe.menu,xe[`variant_${i.variant}`],i.classNames?.menu),style:{...w,pointerEvents:"auto",visibility:m||!s?"visible":"hidden"},...F(),children:a.jsx(So,{items:e.children,activeIndex:p,getItemProps:L,listRef:f})})})})})]})});Lr.displayName="Submenu";const ua=v.forwardRef(({children:e,items:n,triggerAction:t="click",placement:o="bottom-start",variant:r="default",size:i="md",isDisabled:s=!1,offset:l=4,minWidth:d="180px",matchTriggerWidth:u=!1,disableAnimation:f=!1,closeOnClickOutside:p=!0,closeOnEscape:_=!0,closeOnSelect:c=!0,className:h,classNames:g,style:m,onOpen:b,onClose:w,onOpenChange:C,onContextMenu:S,isOpen:k,zIndex:$,portalContainer:I,radioValue:F,onRadioChange:L},N)=>{const[D,V]=v.useState(!1),[T,y]=v.useState(null),[E,z]=v.useState(0),A=v.useRef([]),x=v.useRef([]),P=Ki(),O=k!==void 0,B=O?k:D,j=v.useCallback(R=>{s&&R||(O||V(R),C?.(R),R?b?.():w?.())},[s,O,C,b,w]);v.useEffect(()=>{x.current=n.filter(R=>R.type!=="separator"&&R.type!=="label").map(R=>"label"in R&&typeof R.label=="string"?R.label:"")},[n]);const{refs:q,floatingStyles:J,context:G,isPositioned:le}=uo({nodeId:P,open:B,onOpenChange:j,placement:o,strategy:"fixed",middleware:[Jn(l),to({fallbackAxisSideDirection:"start",padding:8}),eo({padding:8}),u?Oi({apply({rects:R,elements:H}){Object.assign(H.floating.style,{minWidth:`${R.reference.width}px`})}}):void 0].filter(Boolean),whileElementsMounted:Xn}),oe=ls(G,{enabled:!s&&(t==="click"||t==="both"),toggle:!0}),re=Jo(G,{enabled:!s&&t==="hover",delay:{open:150,close:150},handleClose:hs()}),ce=co(G,{enabled:_||p,escapeKey:_,outsidePress:p}),ie=po(G,{role:"menu"}),me=ar(G,{listRef:A,activeIndex:T,onNavigate:y,loop:!0}),U=_s(G,{listRef:x,activeIndex:T,onMatch:y,enabled:B}),{getReferenceProps:ne,getFloatingProps:ee,getItemProps:pe}=fo([oe,re,ce,ie,me,U]),{isMounted:_e,styles:Z}=ho(G,{duration:f?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:f?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}});v.useImperativeHandle(N,()=>({open:()=>j(!0),close:()=>j(!1),toggle:()=>j(!B),isOpen:B}),[j,B]);const de=v.useMemo(()=>({radioValue:F,onRadioChange:L,cerrarMenu:()=>j(!1),closeOnSelect:c,size:i,variant:r,disableAnimation:f,classNames:g,portalContainer:I,zIndex:$}),[F,L,j,c,i,r,f,g,I,$]),ye=v.isValidElement(e)?e:null,ue=zi([q.setReference,ye?.ref||null]);if(!ye)return e!=null&&console.error("DropdownMenu: children debe ser un elemento React válido"),null;const Ce=t==="contextmenu"||t==="both"?{onContextMenu:R=>{R.preventDefault();const H={x:R.clientX,y:R.clientY};S?.(R,H),j(!1),z(he=>he+1),requestAnimationFrame(()=>{q.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:H.x,y:H.y,top:H.y,left:H.x,right:H.x,bottom:H.y}}}),j(!0)})},onClick:()=>{B&&t==="contextmenu"&&j(!1)}}:{},W=v.cloneElement(e,ne({...e.props,...Ce,ref:ue,"aria-haspopup":"menu","aria-expanded":B}));return a.jsx(Fr.Provider,{value:de,children:a.jsxs(Ui,{id:P,children:[W,_e&&a.jsx(lo,{root:I,children:a.jsx(or,{context:G,modal:!1,initialFocus:-1,returnFocus:!0,children:a.jsx("div",{ref:q.setFloating,style:{...J,zIndex:$??"var(--z-dropdown)",outline:"none",pointerEvents:"none"},children:a.jsx("div",{role:"menu","aria-orientation":"vertical",className:K(xe.menu,xe[`variant_${r}`],xe[`size_${i}`],h,g?.menu),style:{...Z,minWidth:d,...m,transform:[Z.transform,m?.transform].filter(Boolean).join(" "),pointerEvents:"auto",visibility:le||!B?"visible":"hidden"},...ee(),children:a.jsx(So,{items:n,activeIndex:T,getItemProps:pe,listRef:A})},E)})})})]})})});ua.displayName="DropdownMenuInner";const Dr=v.forwardRef((e,n)=>a.jsx(Fc,{children:a.jsx(ua,{...e,ref:n})}));Dr.displayName="DropdownMenu";const fa=v.forwardRef(({isEnabled:e=!0,children:n,...t},o)=>a.jsx(Dr,{...t,ref:o,triggerAction:"contextmenu",isDisabled:!e||t.isDisabled,children:n}));fa.displayName="ContextMenu";const _a=()=>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"})}),ga=()=>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"})}),pa=()=>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"})}),ha=()=>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"})}),ma=()=>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"})}),He={overlay:"_overlay_e2tbk_1",backdrop:"_backdrop_e2tbk_25",visible:"_visible_e2tbk_51",layout:"_layout_e2tbk_63",columna_acciones:"_columna_acciones_e2tbk_127",boton_flotante:"_boton_flotante_e2tbk_147",boton_primario:"_boton_primario_e2tbk_221",boton_peligro:"_boton_peligro_e2tbk_231",panel:"_panel_e2tbk_249",encabezado:"_encabezado_e2tbk_277",titulo:"_titulo_e2tbk_295",contenido:"_contenido_e2tbk_311",paginacion:"_paginacion_e2tbk_325",texto_paginacion:"_texto_paginacion_e2tbk_351"},_f={transparente:{background:"transparent",backdropFilter:"none"},sutil:{background:"rgb(0 0 0 / 20%)",backdropFilter:"blur(0px)"},normal:{background:"rgb(0 0 0 / 40%)",backdropFilter:"blur(2px)"},intenso:{background:"rgb(0 0 0 / 60%)",backdropFilter:"blur(4px)"}},gf=({isOpen:e,onClose:n,onApply:t,onClear:o,title:r="Filtros",backdropVariant:i="sutil",closeOnBackdropClick:s=!0,allowBackdropInteraction:l=!1,getContainer:d,children:u})=>{const[f,p]=v.useState(!1),[_,c]=v.useState(0),h=l||i==="transparente",g=v.useCallback(()=>{p(!0),setTimeout(()=>{n(),p(!1),c(0)},400)},[n]);v.useEffect(()=>{if(!e)return;const D=V=>V.key==="Escape"&&g();return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[e,g]);const m=v.useCallback(D=>{s&&D.target===D.currentTarget&&g()},[s,g]),b=v.useCallback(D=>{document.activeElement?.blur(),D?.()},[]),{pages:w,totalPages:C,hasPagination:S}=v.useMemo(()=>{const D=Array.isArray(u)?u:[u];return{pages:D,totalPages:D.length,hasPagination:D.length>1}},[u]),{background:k,backdropFilter:$}=_f[i],I={background:k,backdropFilter:$,pointerEvents:h?"none":"auto"},F=d?{position:"absolute"}:{},L=d?{position:"relative"}:{},N=a.jsxs("div",{className:He.overlay,role:"dialog","aria-modal":"true",style:F,children:[a.jsx("div",{className:`${He.backdrop} ${e&&!f?He.visible:""}`,style:I,onClick:m}),a.jsxs("div",{className:`${He.layout} ${e&&!f?He.visible:""}`,style:L,children:[a.jsxs("aside",{className:He.columna_acciones,children:[a.jsx(In,{content:"Cerrar",placement:"left",children:a.jsx("button",{className:He.boton_flotante,onClick:()=>b(g),"aria-label":"Cerrar panel",children:a.jsx(_a,{})})}),a.jsx(In,{content:"Aplicar filtros",placement:"left",children:a.jsx("button",{className:`${He.boton_flotante} ${He.boton_primario}`,onClick:()=>b(t),children:a.jsx(ga,{})})}),a.jsx(In,{content:"Limpiar filtros",placement:"left",children:a.jsx("button",{className:`${He.boton_flotante} ${He.boton_peligro}`,onClick:()=>b(o),children:a.jsx(pa,{})})}),S&&a.jsxs("div",{className:He.paginacion,children:[a.jsx("button",{className:He.boton_flotante,style:{width:36,height:36},onClick:()=>c(D=>Math.max(0,D-1)),disabled:_===0,"aria-label":"Página anterior",children:a.jsx(ha,{})}),a.jsxs("span",{className:He.texto_paginacion,children:[_+1," / ",C]}),a.jsx("button",{className:He.boton_flotante,style:{width:36,height:36},onClick:()=>c(D=>Math.min(C-1,D+1)),disabled:_===C-1,"aria-label":"Página siguiente",children:a.jsx(ma,{})})]})]}),a.jsxs("main",{className:He.panel,children:[a.jsx("header",{className:He.encabezado,children:a.jsx("h2",{className:He.titulo,children:r})}),a.jsx("div",{className:He.contenido,children:a.jsx("div",{style:{animation:"fadeIn 0.3s ease"},children:w[_]},_)})]})]})]});if(d){const D=typeof d=="function"?d():d;if(D&&D instanceof HTMLElement)return un.createPortal(N,D)}return N},vt={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"},pf=()=>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"})}),hf=({variant:e="solid",color:n="default",size:t="md",radius:o="md",children:r,startIcon:i,endIcon:s,dot:l,dismissible:d,onDismiss:u,customColor:f,className:p="",onClick:_})=>{const c=!!_,h=v.useMemo(()=>{if(!f)return;const b=f,w=`color-mix(in oklab, ${b} 15%, transparent)`;return{solid:{"--badge-custom-bg":b,"--badge-custom-text":"white","--badge-custom-border":"transparent"},subtle:{"--badge-custom-bg":w,"--badge-custom-text":b,"--badge-custom-border":"transparent"},outline:{"--badge-custom-bg":"transparent","--badge-custom-text":b,"--badge-custom-border":b},soft:{"--badge-custom-bg":`color-mix(in oklab, ${b} 10%, var(--surface-first))`,"--badge-custom-text":b,"--badge-custom-border":"transparent"}}[e]},[f,e]),g=[vt.badge,vt[`size_${t}`],vt[`radius_${o}`],vt[`variant_${e}`],!f&&vt[`color_${n}`],f&&vt.badge_custom,c&&vt.badge_clickable,p].filter(Boolean).join(" "),m=v.useMemo(()=>f||{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)"}[n],[n,f]);return a.jsxs("span",{className:g,style:h,onClick:_,role:c?"button":void 0,tabIndex:c?0:void 0,children:[l&&a.jsx("span",{className:vt.dot,style:{backgroundColor:m}}),i&&a.jsx("span",{className:vt.icon,children:i}),r,s&&a.jsx("span",{className:vt.icon,children:s}),d&&a.jsx("button",{type:"button",className:vt.dismiss_button,onClick:b=>{b.stopPropagation(),u?.()},"aria-label":"Eliminar badge",children:a.jsx(pf,{})})]})};X.Badge=hf,X.BadgeVoz=No,X.Boton=ht,X.Checkbox=cn,X.CheckboxGroup=Bs,X.ContextMenu=fa,X.Drawer=ia,X.DropdownContext=Fr,X.DropdownMenu=Dr,X.FirmaManual=Br,X.GrabacionIcono=Yr,X.IconoCerrar=_a,X.IconoDerecha=ma,X.IconoFiltroAplicar=ga,X.IconoFiltroLimpiar=pa,X.IconoIzquierda=ha,X.InputDate=Ur,X.InputNumeric=Kr,X.InputText=Hr,X.MenuItem=Pr,X.MenuList=So,X.MicrofonoIcono=Eo,X.Modal=sa,X.ModalStack=lf,X.PanelFiltros=gf,X.Radio=Nr,X.RadioGroup=oa,X.Select=Es,X.SonidoIcono=Mo,X.Submenu=Lr,X.TablaDatos=sf,X.TextArea=Zr,X.Toggle=ra,X.Tooltip=In,X.Transicion=Pn,X.esCheckbox=aa,X.esLabel=da,X.esRadio=la,X.esSeparador=ca,X.fechaEnRango=Ga,X.formatearFecha=Ba,X.formatearNumero=fn,X.generarOpcionesAleatorias=md,X.generarUsuariosPrueba=vd,X.obtenerFechaHoy=Ha,X.parsearNumero=Gr,X.procesarValidacion=Wr,X.redondearDecimales=Rr,X.restringirRango=An,X.tieneHijos=Mn,X.useCheckboxGroupContext=js,X.useDropdownContext=Ar,X.useReconocimientoVoz=Xr,X.useTablaContext=Cu,X.useTablaContextSafe=Vt,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})}));
|
|
681
|
+
*/function An(e,t){return e?$p(e)?I.createElement(e,t):e:null}function $p(e){return Ep(e)||typeof e=="function"||Ip(e)}function Ep(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Ip(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function kp(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=I.useState(()=>({current:pp(t)})),[o,r]=I.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_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"},jl=v.createContext(null),ql=()=>v.useContext(jl),Dn=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:u=!1,disableAnimation:f=!1,customCheckIcon:h,size:p="md",color:m="primary",customColor:w,radius:y="md",variant:x="solid",className:$="",classNames:A={},onChange:F,value:N,name:P,...T}=e,k=ql(),z=v.useId(),B=v.useRef(null),E=s!==void 0,[b,S]=v.useState(i??!1),O=!!k,D=O&&N?k.value.includes(N):!1,C=O?D:E?s:b,M=c||k?.isDisabled,L=d||k?.isReadOnly,q=_||k?.isRequired,H=P||k?.name;v.useEffect(()=>{const G=B.current||(t&&typeof t=="object"?t.current:null);G&&(G.indeterminate=l??!1)},[l,t]);const j=G=>{if(M||L)return;const me=G.target.checked;O&&N?k.onChange(N):(E||S(me),F?.(me))},J=o||n;return a.jsxs("div",{className:W(Me.checkbox_container,{[Me.disabled]:M,[Me.readonly]:L},A.base,$),children:[a.jsxs("label",{className:W(Me.checkbox_wrapper,Me[p],!w&&Me[m],Me[x],Me[`radius_${y}`],{[Me.checked]:C,[Me.indeterminate]:l,[Me.disabled]:M,[Me.readonly]:L,[Me.line_through]:g&&C,[Me.no_animation]:f}),style:w?{"--checkbox-custom-color":w}:void 0,children:[a.jsxs("span",{className:Me.checkbox,children:[a.jsx("input",{ref:G=>{B.current=G,typeof t=="function"?t(G):t&&(t.current=G)},id:z,type:"checkbox",className:Me.input,checked:C,onChange:j,disabled:M,readOnly:L,required:q,value:N,name:H,...T}),h?a.jsx("span",{className:Me.custom_icon,children:h}):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"})})]}),!u&&J&&a.jsx("span",{className:W(Me.label_text,A.label),children:J})]}),r&&a.jsx("span",{className:W(Me.hint_text,A.label),children:r})]})});Dn.displayName="Checkbox";const Hl=({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:u=!1,name:f,options:h,optionValueKey:p,optionLabelKey:m,optionDisabledKey:w,optionDescriptionKey:y})=>{const x=l!==void 0,[$,A]=v.useState(c),F=x?l:$,N=P=>{if(_||g)return;const T=F.includes(P)?F.filter(k=>k!==P):[...F,P];x||A(T),d?.(T)};return a.jsxs("div",{className:W(Me.checkbox_group,Me[s],{[Me.invalid]:r,[Me.disabled]:_,[Me.readonly]:g},i),role:"group","aria-required":u,"aria-invalid":r,children:[e&&a.jsxs("div",{className:Me.label,children:[e,u&&a.jsx("span",{className:Me.marca_requerido,children:" *"})]}),n&&a.jsx("div",{className:Me.description,children:n}),a.jsx(jl.Provider,{value:{value:F,onChange:N,isDisabled:_,isReadOnly:g,isRequired:u,name:f},children:a.jsx("div",{className:W(Me.checkboxes,Me[s]),children:h&&h.length>0?h.map((P,T)=>{let k,z,B=!1,E;if(typeof P=="object"&&P!==null){const b=p??"value",S=m??"label",O=w??"isDisabled",D=y??"description",C=P[b],M=P[S];k=String(C!==void 0?C:T),z=M;const L=P[O];B=typeof L=="boolean"?L:!1;const q=P[D];E=typeof q=="string"?q:void 0}else k=String(P),z=P;return a.jsx(Dn,{value:k,isDisabled:B,hint:E,children:z},k)}):t})}),o&&r&&a.jsx("div",{className:Me.error_message,children:o})]})};Hl.displayName="CheckboxGroup";const no={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 oo({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:u="",onOpen:f,onClose:h,isOpen:p,onOpenChange:m}){const[w,y]=v.useState(!1),x=v.useRef(null),$=p!==void 0?p:w,A=v.useCallback(L=>{c||(m?m(L):y(L),L?f?.():h?.())},[c,m,f,h]),{refs:F,floatingStyles:N,context:P,isPositioned:T}=Yo({open:$,onOpenChange:A,placement:n,strategy:"fixed",middleware:[zo(s+(d?8:0)),Vo({fallbackAxisSideDirection:"start",padding:8}),Bo({padding:8}),d?Lg({element:x}):void 0].filter(Boolean),whileElementsMounted:Po}),k=ds(P,{delay:{open:i,close:g?200:l||100},enabled:!c,move:!1,handleClose:null}),z=rh(P,{enabled:!c}),B=Ko(P,{enabled:!c}),E=Qo(P,{role:"tooltip"}),{getReferenceProps:b,getFloatingProps:S}=Xo([k,z,B,E]),{isMounted:O,styles:D}=er(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)"}}),C=v.useMemo(()=>[no.tooltip,no[`size_${r}`],no[`variant_${o}`],u].filter(Boolean).join(" "),[r,o,u]),M=v.useMemo(()=>v.cloneElement(t,b({ref:F.setReference,...t.props})),[t,b,F.setReference]);return!e||c?t:a.jsxs(a.Fragment,{children:[M,O&&a.jsx(Go,{children:a.jsx("div",{ref:F.setFloating,className:no.tooltip_positioner,style:{...N,maxWidth:_,zIndex:9999,pointerEvents:"none"},children:a.jsxs("div",{className:C,style:{...D,pointerEvents:g?"auto":"none",visibility:T||!$?"visible":"hidden"},...S(),children:[e,d&&a.jsx(qg,{ref:x,context:P,className:no.arrow})]})})})]})}const Ze={contenedor:"_contenedor_hurn6_1",contenedor_superior:"_contenedor_superior_hurn6_17",input_con_icono:"_input_con_icono_hurn6_35",icono_busqueda:"_icono_busqueda_hurn6_49",input_busqueda:"_input_busqueda_hurn6_75",contenedor_acciones_botones:"_contenedor_acciones_botones_hurn6_147",contenedor_acciones:"_contenedor_acciones_hurn6_147",columna:"_columna_hurn6_183",encabezados:"_encabezados_hurn6_201",boton_basico:"_boton_basico_hurn6_265",texto_filtros:"_texto_filtros_hurn6_289",menu_configuraciones:"_menu_configuraciones_hurn6_321",boton_excel:"_boton_excel_hurn6_349",contenedor_tabla:"_contenedor_tabla_hurn6_369",contenedor_datos:"_contenedor_datos_hurn6_387",datos:"_datos_hurn6_395",seleccionada:"_seleccionada_hurn6_431",boton_acciones:"_boton_acciones_hurn6_475"};function Np(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 Ap(e){return e?{asc:" ↑",desc:" ↓"}[e]??null:null}function Tn(e,t){const n=new Map;t.getFlatHeaders().forEach(i=>n.set(i.column.id,i));const o=n.get(e);if(o)return An(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 Rl(e,t){const n=e.getVisibleCells().find(o=>o.column.id===t);return n?An(n.column.columnDef.cell,n.getContext()):null}function Ul(e,t){return t?e.getVisibleCells().map(o=>o.column.id).includes(t):!1}function Dp(e,t,n){return e.getVisibleCells().filter(o=>o.column.id!=="actions"&&o.column.id!==t&&o.column.id!==n)}function Tp(e,t){if(t===0)return"";if(t===1)return Os(e[0].nombre.toLowerCase());if(t===2)return`${Os(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const n=e.slice(0,2).map(r=>r.nombre.toLowerCase()),o=t-2;return`${Os(n.join(", "))} y ${o>1?`otros ${o}`:"otro"} más`}function Os(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Wl(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}const Gl=v.createContext(null),zs=Gl;function Fp({children:e,data:t,columns:n,controls:o,loading:r,primerasColumnas:s,tamanioPaginaInicial:i=10,filtros:l,descargarExcel:c,actualizarTabla:d,selectorFilas:_=[],sinDatosProps:g}){const[u,f]=v.useState(""),h=Ch(u,200),p=tr("only screen and (max-width: 830px)"),[m,w]=v.useState({pageIndex:0,pageSize:i}),[y,x]=v.useState({}),$=v.useMemo(()=>{const C=[];if(_.length>0&&!p){const M={id:"select",header:({table:L})=>a.jsx(Dn,{color:"secondary",isSelected:L.getIsAllPageRowsSelected(),isIndeterminate:L.getIsSomePageRowsSelected()&&!L.getIsAllPageRowsSelected(),onChange:q=>L.toggleAllPageRowsSelected(!!q)}),cell:({row:L})=>a.jsx(Dn,{color:"primary",isSelected:L.getIsSelected(),isDisabled:!L.getCanSelect(),onChange:q=>L.toggleSelected(q)}),enableSorting:!1,enableHiding:!1};C.push(M)}if(C.push(...n),o?.length){const M={id:"actions",header:"Acciones",cell:L=>a.jsx("div",{className:Ze.contenedor_acciones,children:o.map(q=>a.jsx(oo,{content:q.nombre,variant:"default",size:"sm",placement:"top",children:a.jsx("button",{type:"button",onClick:()=>q.evento(L.row.original),className:Ze.boton_acciones,children:q.icono})},q.id))}),enableSorting:!1,enableHiding:!1};C.push(M)}return C},[n,o,_,p]),A=v.useMemo(()=>{const C=$.map(L=>"accessorKey"in L?String(L.accessorKey):"id"in L?String(L.id):"").filter(Boolean),M=C.indexOf("actions");return M>-1&&M<C.length-1&&(C.splice(M,1),C.push("actions")),C},[$]),[F,N]=v.useState(A),P=v.useCallback((C,M,L)=>{if(!L)return!0;const q=Wl(L),H=C.getValue(M);return H==null?!1:Wl(String(H)).includes(q)},[]),T=kp({data:t,columns:$,state:{pagination:m,globalFilter:h,columnOrder:F,rowSelection:y},globalFilterFn:P,enableRowSelection:_.length>0,onRowSelectionChange:x,onPaginationChange:w,onColumnOrderChange:N,getCoreRowModel:mp(),getSortedRowModel:Sp(),getFilteredRowModel:Cp(),getPaginationRowModel:xp(),autoResetPageIndex:!1}),k=T.getPageCount();v.useEffect(()=>{const C=Mp(m.pageIndex,k);C!==m.pageIndex&&w(M=>({...M,pageIndex:C}))},[k]),v.useEffect(()=>{h!==void 0&&T.setPageIndex(0)},[h]);const z=v.useMemo(()=>T.getAllLeafColumns().filter(C=>C.id!=="actions"&&C.id!=="select"&&C.getCanHide?.()),[T]),B=v.useCallback(C=>{const L=n.find(q=>"accessorKey"in q?q.accessorKey===C:q.id===C)?.header;return typeof L=="string"||typeof L=="number"?String(L):C},[n]),E=v.useCallback(()=>{T.setColumnVisibility({}),T.setPageSize(i),T.setPageIndex(0),T.resetRowSelection(),N(A)},[T,i,A]),b=v.useCallback(C=>{const M=Math.max(1,Math.min(200,C));T.setPageSize(M),T.setPageIndex(0)},[T]),S=v.useCallback(C=>{N(M=>typeof C=="function"?C(M):C)},[]),D={state:{ordenColumnas:F,table:T,columns:$,controls:o,loading:r,primerasColumnas:[String(s[0]),String(s[1])],inputBusqueda:u,setInputBusqueda:f,filtros:l,descargarExcel:c,actualizarTabla:d,selectorFilas:_,sinDatosProps:g},todasLasColumnas:z,etiquetaColumna:B,restaurarConfiguracion:E,cambiarPageSize:b,cambiarOrdenColumnas:S};return a.jsx(Gl.Provider,{value:D,children:e})}function Pp(){const e=v.useContext(zs);if(!e)throw new Error("useTablaContext debe usarse dentro de TablaDatosProvider");return e}function on(){const e=v.useContext(zs);return e||null}const Rt={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 Kl(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 Yl(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 Lp(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 Op(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 zp(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 Bp(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 Vp(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 jp(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 qp(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 Hp(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 Rp(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 Xl(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 Up(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 Wp(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"})})}const Gp=({titulo:e,onBack:t})=>a.jsxs("header",{className:Rt.header,children:[a.jsx(ct,{isIconOnly:!0,variant:"light",onClick:t,"aria-label":"Regresar",children:a.jsx(Kl,{})}),a.jsx("h3",{className:Rt.titulo,children:e})]}),vn={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 Kp(){const e=on(),[t,n]=v.useState(null);if(!e)return null;const{state:o,todasLasColumnas:r,etiquetaColumna:s,cambiarOrdenColumnas:i}=e,{ordenColumnas:l}=o,c=g=>u=>{n(g),u.dataTransfer.effectAllowed="move",u.dataTransfer.setData("text/plain",g)},d=g=>u=>{u.preventDefault(),!(!t||t===g)&&i?.(f=>{const h=[...f],p=h.indexOf(t),m=h.indexOf(g);return p===-1||m===-1?f:(h.splice(p,1),h.splice(m,0,t),h)})},_=()=>n(null);return a.jsx("div",{className:vn.contenedor,children:a.jsx("ul",{className:vn.lista,children:l.map(g=>{const u=r.find(m=>m.id===g);if(!u)return null;const f=u.getCanHide?.()??!0,h=u.getIsVisible(),p=t===u.id;return a.jsxs("li",{className:`${vn.item} ${p?vn.item_dragging:""}`,draggable:!0,onDragStart:c(u.id),onDragOver:d(u.id),onDrop:_,onDragEnd:_,children:[a.jsx("span",{className:vn.icono_drag,"aria-label":"Arrastrar columna",children:a.jsx(qp,{})}),a.jsx("span",{className:vn.nombre,children:s(u.id)}),a.jsx(Dn,{size:"md",color:"primary",isSelected:h,isDisabled:!f,onChange:m=>u.toggleVisibility(m),className:vn.checkbox})]},u.id)})})})}const ro={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function Yp(){const e=on(),[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(Bs,Math.min(Vs,g)),l=g=>{const u=r+g;u>=Bs&&u<=Vs&&s?.(u)},c=()=>{const g=parseInt(t,10),u=!isNaN(g)&&g>0?i(g):r;s?.(u),n(String(u))},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 u=g.target.value;(u===""||/^\d+$/.test(u))&&n(u)};return a.jsxs("div",{className:ro.contenido,children:[a.jsx("p",{className:ro.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),a.jsxs("div",{className:ro.control,children:[a.jsx(ct,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(-1),"aria-label":"Disminuir filas",disabled:r<=Bs,children:a.jsx(Up,{style:{fontSize:"var(--gaps-6)"}})}),a.jsx("div",{className:ro.valor,children:a.jsx("input",{ref:o,type:"text",inputMode:"numeric",value:t,onChange:_,onKeyDown:d,onFocus:()=>o.current?.select(),onBlur:c,className:ro.input,"aria-label":"Número de filas por página"})}),a.jsx(ct,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(1),"aria-label":"Aumentar filas",disabled:r>=Vs,children:a.jsx(Xl,{})})]})]})}const ht={contenedor:"_contenedor_1syil_1",menu:"_menu_1syil_11",item:"_item_1syil_25",icono_contenedor:"_icono_contenedor_1syil_71",texto:"_texto_1syil_109",nombre:"_nombre_1syil_123",descripcion:"_descripcion_1syil_135",chevron:"_chevron_1syil_151",divider:"_divider_1syil_175"};function Xp({navegar:e}){const t=on();return a.jsxs("div",{className:ht.contenedor,children:[a.jsx("nav",{className:ht.menu,children:Qp.map(({id:n,icono:o,nombre:r,descripcion:s})=>a.jsxs("button",{className:ht.item,onClick:()=>e(n),children:[a.jsx("div",{className:ht.icono_contenedor,children:a.jsx(o,{})}),a.jsxs("div",{className:ht.texto,children:[a.jsx("span",{className:ht.nombre,children:r}),a.jsx("span",{className:ht.descripcion,children:s})]}),a.jsx(Yl,{className:ht.chevron})]},n))}),a.jsx("div",{className:ht.divider}),a.jsx("div",{className:ht.menu,children:a.jsxs("button",{className:ht.item,onClick:t?.restaurarConfiguracion,children:[a.jsx("div",{className:ht.icono_contenedor,children:a.jsx(jp,{})}),a.jsxs("div",{className:ht.texto,children:[a.jsx("span",{className:ht.nombre,children:"Restaurar configuración"}),a.jsx("span",{className:ht.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const Bs=1,Vs=200,Zl=250,Zp=200,Jp={panelPrincipal:{component:Xp},panelColumnas:{component:Kp,titulo:"Columnas visibles"},panelFilas:{component:Yp,titulo:"Filas por página"}},Qp=[{id:"panelColumnas",icono:Hp,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:Rp,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}];function em(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 Jl(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 tm(e,t,n,{width:o,margin:r=0,offsetRight:s=0,offsetLeft:i=0,offsetTop:l=0,offsetBottom:c=0}){const[d,_]=v.useState({top:0,left:0}),g=tr("only screen and (max-width: 480px)");return v.useEffect(()=>{if(!n||!e.current)return;const u=()=>{const f=e.current.getBoundingClientRect();let h=f.bottom+l,p=0;if(g)p=window.innerWidth-o-r;else{const w=f.right-o+s-i;p=Math.max(r,Math.min(w,window.innerWidth-o-r))}const m=t.current?.offsetHeight||400;h+m>window.innerHeight-r&&(h=f.top-m-c,h<r&&(h=f.bottom+l)),_({top:h,left:p})};return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[n,g,o,r,s,i,l,c,e,t]),d}function nm(e){v.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function om(){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);nm(n),em(()=>u(),n,[c,d]),Jl(()=>u(),n);const g=tm(c,d,n,{width:Zl,offsetRight:6,offsetTop:-2});v.useEffect(()=>{e&&(o(!0),l(null))},[e]),v.useEffect(()=>()=>{_.current&&clearTimeout(_.current)},[]);function u(){n&&(t(!1),_.current=window.setTimeout(()=>{o(!1),s("panelPrincipal"),l(null)},Zp))}function f(m){l(m==="panelPrincipal"?"backward":"forward"),s(m)}const h=Jp[r],p=h.component;return a.jsxs("div",{className:Rt.contenedor,children:[a.jsx(ct,{isIconOnly:!0,ref:c,variant:"light",onClick:()=>t(m=>!m),"aria-haspopup":"dialog","aria-expanded":e,children:a.jsx(Vp,{})}),n&&c.current&&Fn.createPortal(a.jsx("div",{ref:d,className:`${Rt.popover} ${e?Rt.popover_entrada:Rt.popover_salida}`,role:"dialog",style:{top:`${g.top}px`,left:`${g.left}px`,width:Zl},children:a.jsx("div",{className:Rt.ventana,children:a.jsxs("div",{className:W([Rt.panel,Rt[`panel_${i}`]]),children:[h.titulo&&a.jsx(Gp,{titulo:h.titulo,onBack:()=>f("panelPrincipal")}),a.jsx(p,{navegar:f})]},r)})}),document.body)]})}function rm(){const e=on();if(!e)return null;const{state:t}=e,{inputBusqueda:n,setInputBusqueda:o,filtros:r,actualizarTabla:s,descargarExcel:i}=t,{abrirFiltros:l,filtrosAplicados:c=[]}=r||{},d=c?.length||0;return a.jsxs("section",{className:Ze.contenedor_superior,children:[a.jsxs("div",{className:Ze.input_con_icono,children:[a.jsx(Lp,{className:Ze.icono_busqueda}),a.jsx("input",{type:"text",placeholder:"Buscar en tabla...",value:n??"",onChange:_=>o&&o(_.target.value),className:Ze.input_busqueda})]}),a.jsxs("div",{className:Ze.contenedor_acciones_botones,children:[a.jsxs("div",{className:Ze.contenedor_acciones,children:[s!==void 0&&a.jsxs(ct,{variant:"light",className:Ze.boton_basico,disabled:s?.cargando,onClick:s?.onClick,children:[a.jsx(Bp,{}),s?.cargando?"Actualizando...":"Actualizar tabla"]}),l!==void 0&&a.jsxs(ct,{onClick:l,variant:"light",className:Ze.boton_basico,children:[a.jsx(zp,{})," Filtros"]}),d>0?a.jsxs("div",{className:Ze.texto_filtros,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:Tp(c,d)})]}):null]}),i!==void 0?a.jsxs(ct,{onClick:i,className:`${Ze.boton_basico} ${Ze.boton_excel}`,children:[a.jsx(Op,{})," Excel"]}):null]}),a.jsx("div",{className:Ze.menu_configuraciones,children:a.jsx(om,{})})]})}const rn={contenedor_paginacion:"_contenedor_paginacion_1di9q_1",info_paginacion:"_info_paginacion_1di9q_19",contenedor_botones:"_contenedor_botones_1di9q_35",boton_paginacion:"_boton_paginacion_1di9q_71",pagina_activa:"_pagina_activa_1di9q_89",boton_num_paginacion:"_boton_num_paginacion_1di9q_99"};function sm(){const e=on();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=Np(i,r),c=n.getCanPreviousPage(),d=n.getCanNextPage(),_=r>1,g=()=>{c&&n.previousPage()},u=()=>{d&&n.nextPage()},f=h=>{n.setPageIndex(h-1)};return a.jsxs("section",{className:rn.contenedor_paginacion,children:[a.jsxs("p",{className:rn.info_paginacion,children:["Documentos: ",o]}),_&&a.jsxs("div",{className:rn.contenedor_botones,children:[c&&a.jsx(Kl,{onClick:g,"aria-disabled":!c,className:rn.boton_paginacion}),l.map(h=>a.jsx("button",{type:"button",onClick:()=>f(h),className:h===i?rn.pagina_activa:rn.boton_num_paginacion,children:h},h)),d&&a.jsx(Yl,{onClick:u,"aria-disabled":!d,className:rn.boton_paginacion})]}),a.jsxs("p",{className:rn.info_paginacion,children:["Página ",i," de ",r]})]})}const Ae={contenedor_tabla_cards:"_contenedor_tabla_cards_1xee4_1",contenedor_card:"_contenedor_card_1xee4_11",contenedor_encabezado_card:"_contenedor_encabezado_card_1xee4_25",contenedor_columna_card:"_contenedor_columna_card_1xee4_47",card_label:"_card_label_1xee4_57",card_valor:"_card_valor_1xee4_69",card_segundo_valor:"_card_segundo_valor_1xee4_83",contenedor_contenido_cards:"_contenedor_contenido_cards_1xee4_93",contenedor_fila_card:"_contenedor_fila_card_1xee4_105",card_fila_label:"_card_fila_label_1xee4_119",card_fila_valor:"_card_fila_valor_1xee4_137",contenedor_acciones_card:"_contenedor_acciones_card_1xee4_153",boton_acciones:"_boton_acciones_1xee4_171",boton_card:"_boton_card_1xee4_207"};function Ql(e,t){if(t)return e.find(n=>n.accessorKey===t||n.id!==void 0&&n.id===String(t))}function ec(e){if(e)return e.id??e.accessorKey}const Ut={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 im({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:Ae.contenedor_tabla_cards,children:Array.from({length:e}).map((c,d)=>a.jsxs("article",{className:Ae.contenedor_card,children:[a.jsxs("div",{className:Ae.contenedor_encabezado_card,children:[a.jsx("div",{className:Ae.contenedor_columna_card,children:o&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ae.card_label,children:Tn(o,n)}),a.jsx("div",{className:Ae.card_valor,children:a.jsx("div",{className:`${Ut.skeleton_elemento} ${Ut.skeleton_elemento_encabezado}`})})]})}),a.jsx("div",{className:Ae.contenedor_columna_card,children:r&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ae.card_label,children:Tn(r,n)}),a.jsx("div",{className:Ae.card_segundo_valor,children:a.jsx("div",{className:`${Ut.skeleton_elemento} ${Ut.skeleton_elemento_encabezado_segundo}`})})]})})]}),a.jsx("div",{className:Ae.contenedor_contenido_cards,children:i.map((_,g)=>a.jsxs("div",{className:Ae.contenedor_fila_card,children:[a.jsx("div",{className:Ae.card_fila_label,children:Tn(_.id,n)}),a.jsx("div",{className:Ae.card_fila_valor,children:a.jsx("div",{className:`${Ut.skeleton_elemento} ${Ut.skeleton_elemento_contenido}`,style:{width:l[g%l.length]}})})]},_.id))}),t>0&&a.jsx("div",{className:Ae.contenedor_acciones_card,children:Array.from({length:Math.min(t,3)}).map((_,g)=>a.jsx("div",{className:Ut.skeleton_accion,children:a.jsx("div",{className:`${Ut.skeleton_elemento} ${Ut.skeleton_elemento_encabezado}`})},`accion-${g}`))})]},`skeleton-card-${d}`))})}const sn={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",boton_agregar:"_boton_agregar_53kvd_145"};function tc(){const e=v.useContext(zs),{sinDatosProps:t}=e?.state||{},{alAgregarRegistro:n,titulo:o="No se encontraron resultados",descripcion:r="No hay datos que coincidan con tus filtros. Intenta buscar por otra variable o agrega un nuevo registro.",etiquetaAccion:s="Agregar nuevo registro"}=t||{};return a.jsxs("div",{className:sn.contenedor,children:[a.jsx(am,{}),a.jsxs("div",{className:sn.envolvedor_contenido,children:[a.jsx(lm,{}),a.jsx("h3",{className:sn.titulo,children:o}),a.jsx("p",{className:sn.descripcion,children:r}),n?a.jsxs(ct,{onClick:n,variant:"bordered",className:sn.boton_agregar,children:[a.jsx(Xl,{})," ",s]}):null]})]})}function am(){return a.jsx("div",{className:sn.envolvedor_cuadricula,children:a.jsxs("svg",{className:sn.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 lm(){return a.jsxs("svg",{className:sn.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 cm=({fila:e,controls:t})=>(t?.length??0)>0?a.jsx("div",{className:Ae.contenedor_acciones_card,children:t?.map(o=>a.jsxs("button",{type:"button",title:o.nombre,onClick:()=>o.evento(e.original),className:`${Ae.boton_acciones} ${Ae.boton_card}`,children:[o.icono," ",o.nombre]},o.id))}):null,dm=({columnasRestantes:e,table:t})=>e.length===0?null:a.jsx("div",{className:Ae.contenedor_contenido_cards,children:e.map(n=>a.jsxs("div",{className:Ae.contenedor_fila_card,children:[a.jsx("div",{className:Ae.card_fila_label,children:Tn(n.column.id,t)}),a.jsx("div",{className:Ae.card_fila_valor,children:An(n.column.columnDef.cell,n.getContext())})]},n.id))}),um=({fila:e,table:t,idPrimeraColumna:n,idSegundaColumna:o})=>{const r=Ul(e,n),s=Ul(e,o);return a.jsxs("div",{className:Ae.contenedor_encabezado_card,children:[a.jsx("div",{className:Ae.contenedor_columna_card,children:n&&r&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ae.card_label,children:Tn(n,t)}),a.jsx("div",{className:Ae.card_valor,children:Rl(e,n)})]})}),a.jsx("div",{className:Ae.contenedor_columna_card,children:o&&s&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ae.card_label,children:Tn(o,t)}),a.jsx("div",{className:Ae.card_segundo_valor,children:Rl(e,o)})]})})]})};function fm(){const e=on();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?Ql(i,r[0]):void 0,c=i&&r?Ql(i,r[1]):void 0,d=ec(l),_=ec(c);if(s)return a.jsx(im,{filas:3,cantidadControles:o?.length??0,table:n,idPrimeraColumna:d,idSegundaColumna:_});const g=n.getRowModel().rows;return g.length===0?a.jsx("article",{className:Ae.contenedor_card,children:a.jsx(tc,{})}):a.jsx("section",{className:Ae.contenedor_tabla_cards,children:g.map(u=>{const f=Dp(u,d,_);return a.jsxs("article",{id:`tabla-card-${u.id}`,className:Ae.contenedor_card,children:[a.jsx(um,{fila:u,table:n,idPrimeraColumna:d,idSegundaColumna:_}),a.jsx(dm,{columnasRestantes:f,table:n}),a.jsx(cm,{fila:u,controls:o})]},u.id)})})}const nc={filas:"_filas_un2v3_1",columnas:"_columnas_un2v3_43"},_m=({columnas:e,filas:t})=>a.jsx(a.Fragment,{children:Array.from({length:t}).map((n,o)=>a.jsx("tr",{className:nc.filas,children:Array.from({length:e}).map((r,s)=>a.jsx("td",{className:nc.columnas},`sk-cell-${o}-${s}`))},`sk-row-${o}`))}),bn={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 gm({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 Jl(o,_),v.useEffect(()=>{_&&(s(e),l(t),d(n))},[e,t,n,_]),a.jsx(vo,{mostrar:_,tipo:"escalar",className:bn.contenedor,children:a.jsxs("div",{ref:g,className:bn.barra,children:[a.jsxs("div",{className:bn.info,children:[a.jsx(ct,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:o,"aria-label":"Limpiar selección",className:bn.btn_cerrar,children:a.jsx(Wp,{})}),a.jsxs("p",{className:bn.contador,children:[r," filas seleccionadas"]})]}),a.jsx("div",{className:bn.separador}),a.jsx("div",{className:bn.acciones,children:i.map(u=>a.jsx("div",{children:u.componente(c)},u.id))})]})})}function hm(){const e=on();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:Ze.contenedor_tabla,children:[a.jsx("thead",{children:i.map(u=>a.jsx("tr",{children:u.headers.map(f=>{const h=f.column.columnDef.meta?.style;return a.jsx("th",{id:`tabla-col-${f.id}`,className:Ze.encabezados,style:h,"data-columna":f.id,children:f.id==="select"?a.jsx("div",{children:An(f.column.columnDef.header,f.getContext())}):a.jsxs("div",{onClick:f.column.getToggleSortingHandler(),children:[An(f.column.columnDef.header,f.getContext()),Ap(f.column.getIsSorted())]})},f.id)})},u.id))}),a.jsx("tbody",{className:Ze.contenedor_datos,children:o?a.jsx(_m,{columnas:c,filas:10}):l.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:c,style:{backgroundColor:"var(--base)"},children:a.jsx(tc,{})})}):l.map(u=>a.jsx("tr",{id:`tabla-fila-${u.id}`,className:`${Ze.datos} ${u.getIsSelected()?Ze.seleccionada:""}`,"data-fila-index":u.index,children:u.getVisibleCells().map(f=>{const h=f.column.columnDef.meta?.style;return a.jsx("td",{className:Ze.columna,style:h,"data-columna":f.column.id,children:An(f.column.columnDef.cell,f.getContext())},f.id)})},u.id))})]}),s?.length>0?a.jsx(gm,{totalSeleccionadas:_,acciones:s,filasSeleccionadas:d.map(u=>u.original),onLimpiarSeleccion:g}):null]})}function pm({id:e}){const t=tr("only screen and (max-width: 830px)");return a.jsxs("main",{className:Ze.contenedor,id:e,children:[a.jsx(rm,{}),t?a.jsx(fm,{}):a.jsx(hm,{}),a.jsx(sm,{})]})}function mm({id:e,...t}){return a.jsx(Fp,{...t,children:a.jsx(pm,{id:e})})}const Fe={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"},oc=v.createContext(void 0),vm=()=>v.useContext(oc),js=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:u="",onChange:f,...h},p)=>{const m=vm(),w=v.useId(),y=h.id||w,x=m?.name||h.name,$=m?.size||o,A=m?.color||r,F=m?.customColor||s,N=m?.variant||i,P=m?.isDisabled||l,T=m?.isReadOnly||c,k=m?.isInvalid||d,z=m?.isRequired||_,B=m?.value!==void 0?m.value===e:void 0,E=g||t,b=D=>{P||T||(m?.onChange&&m.onChange(e),f&&f(D))},S=[Fe.contenedor_radio,Fe[`tam_${$}`],!F&&Fe[`color_${A}`],Fe[`variante_${N}`],P&&Fe.deshabilitado,T&&Fe.solo_lectura,k&&Fe.invalido,B&&Fe.seleccionado,u].filter(Boolean).join(" "),O=F?{"--radio-custom-color":F}:void 0;return a.jsx("div",{className:S,style:O,children:a.jsxs("label",{className:Fe.envoltorio_radio,htmlFor:y,children:[a.jsxs("div",{className:Fe.radio,children:[a.jsx("input",{ref:p,type:"radio",id:y,name:x,value:e,checked:B,disabled:P,readOnly:T,required:z,"aria-invalid":k,className:Fe.input,onChange:b,...h}),a.jsx("div",{className:Fe.circulo_radio,children:a.jsx("div",{className:Fe.punto_radio})})]})," ",E&&a.jsxs("div",{className:Fe.contenedor_label,children:[a.jsxs("span",{className:Fe.texto_label,children:[E,_&&!m&&a.jsx("span",{className:Fe.marca_requerido,children:" *"})]}),n&&a.jsx("span",{className:Fe.texto_descripcion,children:n})]})]})})}));js.displayName="Radio";const rc=({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:u,color:f,customColor:h,variant:p,justifyContent:m="flex-start",children:w,className:y="",options:x,optionValueKey:$,optionLabelKey:A,optionDisabledKey:F,optionDescriptionKey:N})=>{const[P,T]=v.useState(String(n??"")),k=t!==void 0?String(t):P,B={name:e,value:k,onChange:S=>{l||c||(t===void 0&&T(S),o&&o(S))},size:u,color:f,customColor:h,variant:p,isDisabled:l,isReadOnly:c,isInvalid:_,isRequired:d},E=[Fe.grupo_radio,Fe[`orientacion_${r}`],_&&Fe.grupo_invalido,l&&Fe.grupo_deshabilitado,c&&Fe.grupo_solo_lectura,y].filter(Boolean).join(" "),b=m==="center"?"center":m==="flex-end"?"right":"left";return a.jsx(oc.Provider,{value:B,children:a.jsxs("div",{className:E,role:"radiogroup","aria-required":d,"aria-invalid":_,style:{textAlign:b},children:[s&&a.jsxs("div",{className:Fe.encabezado_grupo,children:[a.jsxs("label",{className:Fe.label_grupo,children:[s,d&&a.jsx("span",{className:Fe.marca_requerido,children:" *"})]}),i&&a.jsx("span",{className:Fe.descripcion_grupo,children:i})]}),a.jsx("div",{className:Fe.contenedor_radios,style:{justifyContent:m},children:x&&x.length>0?x.map((S,O)=>{let D,C,M=!1,L;if(typeof S=="object"&&S!==null){const q=$??"value",H=A??"label",j=F??"isDisabled",J=N??"description",G=S[q],me=S[H];D=String(G!==void 0?G:O),C=me;const de=S[j];M=typeof de=="boolean"?de:!1;const se=S[J];L=typeof se=="string"?se:void 0}else D=String(S),C=S;return a.jsx(js,{value:D,isDisabled:M,description:L,children:C},D)}):w}),_&&g&&a.jsx("span",{className:Fe.mensaje_error,children:g})]})})};rc.displayName="RadioGroup";const ft={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"},sc=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:u="",contentClassName:f="",isLoading:h=!1,loadingMessage:p="Cargando...",onOpen:m,backdropVariant:w="normal",borderRadius:y,resizable:x=!1,zIndex:$,getContainer:A},F)=>{const N=v.useRef(null),[P,T]=v.useState(!1),k=v.useCallback(()=>{P||(T(!0),setTimeout(()=>{t?.(),T(!1)},650))},[t,P]);v.useEffect(()=>{e&&T(!1)},[e]),v.useEffect(()=>{if(e){if(m?.(),c){const j=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",j>0&&(document.body.style.paddingRight=`${j}px`)}if(l){const j=J=>{J.key==="Escape"&&k()};return document.addEventListener("keydown",j),()=>{document.removeEventListener("keydown",j),c&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{c&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,k,l,c,m]);const z=j=>{i&&j.target===N.current&&k()},B=y?ft[`radio_${y}`]:void 0,E=e&&!P,b=[ft.drawer,ft[`posicion_${n}`],ft[`tamano_${o}`],E&&ft.visible,B,u].filter(Boolean).join(" "),S=[ft.contenido,f].filter(Boolean).join(" "),O=[ft.backdrop,E&&ft.visible].filter(Boolean).join(" "),D=$||500,C={transparente:{opacity:0},sutil:{opacity:.2},normal:{opacity:.4},intermedio:{opacity:.6},intenso:{opacity:.8}},M=C[w]||C.normal,{opacity:L}=M,q={background:`rgb(0 0 0 / ${L})`,zIndex:D,...A&&{position:"absolute"}},H=a.jsx("div",{className:O,ref:N,onClick:z,style:q,children:a.jsxs("div",{ref:F,className:b,role:"dialog","aria-modal":"true","aria-labelledby":"drawer-title",children:[(r||d)&&a.jsx("div",{className:ft.encabezado,children:d||a.jsxs(a.Fragment,{children:[a.jsx("h2",{id:"drawer-title",className:ft.titulo,children:r}),s&&a.jsx("button",{type:"button",className:ft.boton_cerrar,onClick:k,"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:ft.pie,children:_}),h&&a.jsxs("div",{className:ft.loading_overlay,children:[a.jsx("div",{className:ft.spinner}),a.jsx("span",{className:ft.loading_text,children:p})]}),x&&a.jsx("div",{className:ft.resize_handle})]})});if(A){const j=typeof A=="function"?A():A;if(j&&j instanceof HTMLElement)return Fn.createPortal(H,j)}return H});sc.displayName="Drawer";const _t={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"},ic=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:u="",contentClassName:f="",isLoading:h=!1,loadingMessage:p="Cargando...",backdropVariant:m="normal",showIconTitle:w=!1,onOpen:y},x)=>{const $=v.useRef(null),A=v.useCallback(()=>{h||t?.()},[t,h]);v.useEffect(()=>{if(e){if(y?.(),l){const E=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",E>0&&(document.body.style.paddingRight=`${E}px`)}if(i){const E=b=>{b.key==="Escape"&&A()};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E),l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,A,i,l,y]);const F=E=>{s&&E.target===$.current&&A()},N=[_t.backdrop,c&&_t.centrado,e&&_t.visible].filter(Boolean).join(" "),P=[_t.modal,_t[`tamano_${n}`],u].filter(Boolean).join(" "),T=[_t.contenido,f].filter(Boolean).join(" "),k={transparente:{opacity:0},sutil:{opacity:.3},normal:{opacity:.5},intermedio:{opacity:.7},intenso:{opacity:.9}},{opacity:z}=k[m]||k.normal,B={background:`rgb(0 0 0 / ${z})`};return a.jsx("div",{className:N,ref:$,onClick:F,style:B,children:a.jsxs("div",{ref:x,className:P,role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",children:[(o||d)&&a.jsx("div",{className:_t.encabezado,children:a.jsx("div",{className:_t.contenedor_titulo_completo,children:d||a.jsx(a.Fragment,{children:a.jsxs("div",{className:_t.contenedor_titulo_icono,children:[w&&r!==void 0&&(typeof r=="string"?a.jsx("span",{className:_t.icono_titulo,children:r}):r),w&&r===void 0&&a.jsx("span",{className:_t.icono_titulo,children:"📄"}),a.jsx("h2",{id:"modal-title",className:_t.titulo,children:o})]})})})}),a.jsx("div",{className:T,children:g}),_&&a.jsx("div",{className:_t.pie,children:_}),h&&a.jsxs("div",{className:_t.loading_overlay,children:[a.jsx("div",{className:_t.spinner}),a.jsx("span",{className:_t.loading_text,children:p})]})]})})});ic.displayName="Modal";const It={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 bm({modals:e,onClose:t}){const[n,o]=v.useState([]),[r,s]=v.useState(!1);v.useEffect(()=>{const u=()=>{s(window.innerWidth<=768)};return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[]);const i=u=>{o(f=>[...f,u]),setTimeout(()=>{t(u),o(f=>f.filter(h=>h!==u))},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:It.overlay,children:a.jsx("div",{className:It.container,style:r?void 0:{transform:`translateX(${g}px)`},children:e.map((u,f)=>{const h=n.includes(u.id),p=f===e.length-1,m=[It.modal,h&&It.modal_closing,!p&&It.modal_detras].filter(Boolean).join(" ");return a.jsxs("div",{className:m,children:[a.jsxs("div",{className:It.header,children:[a.jsx("button",{type:"button",className:It.button_back,onClick:()=>i(u.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:It.title_container,children:[u.titleIcon&&a.jsx("span",{className:It.title_icon,children:u.titleIcon}),a.jsx("h2",{className:It.title,children:u.title})]})]}),a.jsx("div",{className:It.content,children:u.content}),u.footer&&a.jsx("div",{className:It.footer,children:u.footer})]},u.id)})})})}const qs=v.createContext(null),Hs=()=>{const e=v.useContext(qs);if(!e)throw new Error("useDropdownContext debe usarse dentro de DropdownMenu o ContextMenu");return e},so=e=>e.type==="separator"||e.type==="label"?!1:"children"in e&&Array.isArray(e.children)&&e.children.length>0,ac=e=>e.type==="checkbox",lc=e=>e.type==="radio",cc=e=>e.type==="separator",dc=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"},wm=()=>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"})}),ym=()=>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"})}),Cm=({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"})]}),Rs=v.forwardRef(({item:e,index:t,activeIndex:n,getItemProps:o},r)=>{const s=Hs();if(cc(e))return a.jsx("div",{className:W(Se.separator,s.classNames?.separator),role:"separator"});if(dc(e))return a.jsx("div",{className:W(Se.label,s.classNames?.label),role:"presentation","data-testid":"dropdown-label",children:e.label});const i=t===n,l=ac(e),c=lc(e),d=N=>{"isDisabled"in e&&e.isDisabled||(l?e.onCheckedChange?.(!e.isChecked):c&&s.onRadioChange?.(e.value),"onSelect"in e&&e.onSelect&&e.onSelect(N),s.closeOnSelect&&!so(e)&&s.cerrarMenu())},_=N=>{d(N)},g=N=>{"isDisabled"in e&&e.isDisabled||(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),d(N))},u=l?e.isChecked:!1,f=c?s.radioValue===e.value:!1,h="label"in e?e.label:void 0,p="description"in e?e.description:void 0,m="shortcut"in e?e.shortcut:void 0,w="startIcon"in e?e.startIcon:void 0,y="endIcon"in e?e.endIcon:void 0,x="isDisabled"in e?e.isDisabled:!1,$="isLoading"in e?e.isLoading:!1,A="isDanger"in e?e.isDanger:!1,F="className"in e?e.className:void 0;return a.jsxs("div",{ref:r,role:l?"menuitemcheckbox":c?"menuitemradio":"menuitem","aria-checked":l?u:c?f:void 0,"aria-disabled":x||$,tabIndex:i?0:-1,className:W(Se.item,Se[`size_${s.size}`],i&&Se.active,x&&Se.disabled,$&&Se.loading,A&&Se.danger,so(e)&&Se.has_submenu,F,s.classNames?.item),onClick:_,onKeyDown:g,...o(),children:[$?a.jsx("span",{className:Se.indicator,children:a.jsx("span",{className:Se.spinner_item})}):(l||c)&&a.jsxs("span",{className:Se.indicator,children:[l&&u&&a.jsx(wm,{}),c&&a.jsx(Cm,{marcado:f})]}),!$&&w&&a.jsx("span",{className:Se.start_icon,children:w}),a.jsxs("span",{className:Se.content,children:[a.jsx("span",{className:Se.label_text,children:h}),p&&a.jsx("span",{className:Se.description,children:p})]}),m&&a.jsx("kbd",{className:Se.shortcut,children:m}),y&&a.jsx("span",{className:Se.end_icon,children:y}),so(e)&&a.jsx("span",{className:Se.submenu_arrow,children:a.jsx(ym,{})})]})});Rs.displayName="MenuItem";const xm=()=>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"})}),lr=({items:e,activeIndex:t,getItemProps:n,listRef:o})=>a.jsx(a.Fragment,{children:e.map((r,s)=>so(r)?a.jsx(Us,{ref:i=>{o.current[s]=i},item:r,index:s,activeIndex:t,getItemProps:n},r.id):a.jsx(Rs,{ref:i=>{o.current[s]=i},item:r,index:s,activeIndex:t,getItemProps:n},r.id))});lr.displayName="MenuList";const Us=v.forwardRef(({item:e,index:t,activeIndex:n,getItemProps:o},r)=>{const s=Hs(),[i,l]=v.useState(!1),c=hn(),d=Ka(),_=v.useRef([]),[g,u]=v.useState(null),{refs:f,floatingStyles:h,context:p,isPositioned:m}=Yo({nodeId:d,open:i,onOpenChange:l,placement:"right-start",middleware:[zo({mainAxis:4,alignmentAxis:-4}),Vo(),Bo({padding:8})],whileElementsMounted:Po}),{isMounted:w,styles:y}=er(p,{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)"}}),x=ds(p,{enabled:!e.isDisabled,delay:{open:75},handleClose:ml({blockPointerEvents:!0})}),$=Qo(p,{role:"menu"}),A=Ko(p,{bubbles:!0}),F=vs(p,{listRef:_,activeIndex:g,onNavigate:u,nested:!0}),{getReferenceProps:N,getFloatingProps:P,getItemProps:T}=Xo([x,$,A,F]);v.useEffect(()=>{if(!c)return;const B=()=>l(!1);return c.events.on("click",B),()=>{c.events.off("click",B)}},[c]);const k=t===n,z=Ba([f.setReference,r]);return a.jsxs(Ya,{id:d,children:[a.jsxs("div",{ref:z,role:"menuitem","aria-haspopup":"menu","aria-expanded":i,"aria-disabled":e.isDisabled,tabIndex:k?0:-1,className:W(Se.item,Se[`size_${s.size}`],k&&Se.active,e.isDisabled&&Se.disabled,e.isDanger&&Se.danger,Se.has_submenu,i&&Se.submenu_open,e.className,s.classNames?.item),...N(o()),children:[e.startIcon&&a.jsx("span",{className:Se.start_icon,children:e.startIcon}),a.jsxs("span",{className:Se.content,children:[a.jsx("span",{className:Se.label_text,children:e.label}),e.description&&a.jsx("span",{className:Se.description,children:e.description})]}),e.shortcut&&a.jsx("kbd",{className:Se.shortcut,children:e.shortcut}),a.jsx("span",{className:Se.submenu_arrow,children:a.jsx(xm,{})})]}),w&&a.jsx(Go,{root:s.portalContainer,children:a.jsx(gs,{context:p,modal:!1,initialFocus:-1,returnFocus:!1,children:a.jsx("div",{ref:f.setFloating,style:{...h,pointerEvents:"none",zIndex:s.zIndex??"var(--z-dropdown)"},children:a.jsx("div",{className:W(Se.menu,Se[`variant_${s.variant}`],s.classNames?.menu),style:{...y,pointerEvents:"auto",visibility:m||!i?"visible":"hidden"},...P(),children:a.jsx(lr,{items:e.children,activeIndex:g,getItemProps:T,listRef:_})})})})})]})});Us.displayName="Submenu";const uc=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:u=!0,closeOnSelect:f=!0,className:h,classNames:p,style:m,onOpen:w,onClose:y,onOpenChange:x,onContextMenu:$,isOpen:A,zIndex:F,portalContainer:N,radioValue:P,onRadioChange:T},k)=>{const[z,B]=v.useState(!1),[E,b]=v.useState(null),[S,O]=v.useState(0),D=v.useRef([]),C=v.useRef([]),M=Ka(),L=A!==void 0,q=L?A:z,H=v.useCallback(V=>{i&&V||(L||B(V),x?.(V),V?w?.():y?.())},[i,L,x,w,y]);v.useEffect(()=>{C.current=t.filter(V=>V.type!=="separator"&&V.type!=="label").map(V=>"label"in V&&typeof V.label=="string"?V.label:"")},[t]);const{refs:j,floatingStyles:J,context:G,isPositioned:me}=Yo({nodeId:M,open:q,onOpenChange:H,placement:o,strategy:"fixed",middleware:[zo(l),Vo({fallbackAxisSideDirection:"start",padding:8}),Bo({padding:8}),d?za({apply({rects:V,elements:R}){Object.assign(R.floating.style,{minWidth:`${V.reference.width}px`})}}):void 0].filter(Boolean),whileElementsMounted:Po}),de=cl(G,{enabled:!i&&(n==="click"||n==="both"),toggle:!0}),se=ds(G,{enabled:!i&&n==="hover",delay:{open:150,close:150},handleClose:ml()}),_e=Ko(G,{enabled:u||g,escapeKey:u,outsidePress:g}),ge=Qo(G,{role:"menu"}),$e=vs(G,{listRef:D,activeIndex:E,onNavigate:b,loop:!0}),X=gl(G,{listRef:C,activeIndex:E,onMatch:b,enabled:q}),{getReferenceProps:oe,getFloatingProps:K,getItemProps:ye}=Xo([de,se,_e,ge,$e,X]),{isMounted:le,styles:Q}=er(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(k,()=>({open:()=>H(!0),close:()=>H(!1),toggle:()=>H(!q),isOpen:q}),[H,q]);const ne=v.useMemo(()=>({radioValue:P,onRadioChange:T,cerrarMenu:()=>H(!1),closeOnSelect:f,size:s,variant:r,disableAnimation:_,classNames:p,portalContainer:N,zIndex:F}),[P,T,H,f,s,r,_,p,N,F]),xe=v.isValidElement(e)?e:null,ce=Ba([j.setReference,xe?.ref||null]);if(!xe)return e!=null&&console.error("DropdownMenu: children debe ser un elemento React válido"),null;const Ee=n==="contextmenu"||n==="both"?{onContextMenu:V=>{V.preventDefault();const R={x:V.clientX,y:V.clientY};$?.(V,R),H(!1),O(ue=>ue+1),requestAnimationFrame(()=>{j.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}}}),H(!0)})},onClick:()=>{q&&n==="contextmenu"&&H(!1)}}:{},U=v.cloneElement(e,oe({...e.props,...Ee,ref:ce,"aria-haspopup":"menu","aria-expanded":q}));return a.jsx(qs.Provider,{value:ne,children:a.jsxs(Ya,{id:M,children:[U,le&&a.jsx(Go,{root:N,children:a.jsx(gs,{context:G,modal:!1,initialFocus:-1,returnFocus:!0,children:a.jsx("div",{ref:j.setFloating,style:{...J,zIndex:F??"var(--z-dropdown)",outline:"none",pointerEvents:"none"},children:a.jsx("div",{role:"menu","aria-orientation":"vertical",className:W(Se.menu,Se[`variant_${r}`],Se[`size_${s}`],h,p?.menu),style:{...Q,minWidth:c,...m,transform:[Q.transform,m?.transform].filter(Boolean).join(" "),pointerEvents:"auto",visibility:me||!q?"visible":"hidden"},...K(),children:a.jsx(lr,{items:t,activeIndex:E,getItemProps:ye,listRef:D})},S)})})})]})})});uc.displayName="DropdownMenuInner";const cr=v.forwardRef((e,t)=>a.jsx(Hg,{children:a.jsx(uc,{...e,ref:t})}));cr.displayName="DropdownMenu";const fc=v.forwardRef(({isEnabled:e=!0,children:t,...n},o)=>a.jsx(cr,{...n,ref:o,triggerAction:"contextmenu",isDisabled:!e||n.isDisabled,children:t}));fc.displayName="ContextMenu";const Wt={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"},Sm=({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,...u})=>{const[f,h]=v.useState(!1),p=W(Wt.group_button,Wt[`variant_${o}`],g&&Wt.full_width,_),m=()=>a.jsx("div",{className:W(Wt.chevron,f&&Wt.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:p,children:[a.jsx(ct,{variant:o,color:r,size:s,radius:i,isLoading:l,isDisabled:c,onClick:t,className:W(Wt.main_button,Wt.first_item),...u,children:e}),n&&a.jsx(cr,{items:n,triggerAction:"click",onOpenChange:h,placement:"bottom-end",isDisabled:c||l,variant:"default",size:s,matchTriggerWidth:!1,children:a.jsx(ct,{variant:o,color:r,size:s,radius:i,isDisabled:c||l,isIconOnly:!0,className:W(Wt.dropdown_trigger,Wt.last_item),"aria-label":"M�s acciones",children:d||m()})})]})},_c=()=>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"})}),gc=()=>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"})}),hc=()=>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"})}),pc=()=>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"})}),mc=()=>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_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"},$m={transparente:{background:"transparent"},sutil:{background:"rgb(0 0 0 / 20%)"},normal:{background:"rgb(0 0 0 / 40%)"},intenso:{background:"rgb(0 0 0 / 60%)"}},Em=({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),[u,f]=v.useState(0),h=l||s==="transparente",p=v.useCallback(()=>{_||(g(!0),setTimeout(()=>{t(),g(!1),f(0)},650))},[t,_]);v.useEffect(()=>{e&&g(!1)},[e]),v.useEffect(()=>{if(!e)return;const k=z=>z.key==="Escape"&&p();return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[e,p]);const m=v.useCallback(k=>{i&&k.target===k.currentTarget&&p()},[i,p]),w=v.useCallback(k=>{document.activeElement?.blur(),k?.()},[]),{pages:y,totalPages:x,hasPagination:$}=v.useMemo(()=>{const k=Array.isArray(d)?d:[d];return{pages:k,totalPages:k.length,hasPagination:k.length>1}},[d]),{background:A}=$m[s],F={background:A,pointerEvents:h?"none":"auto"},N=c?{position:"absolute"}:{},P=c?{position:"relative"}:{},T=a.jsxs("div",{className:Qe.overlay,role:"dialog","aria-modal":"true",style:N,children:[a.jsx("div",{className:`${Qe.backdrop} ${e&&!_?Qe.visible:""}`,style:F,onClick:m}),a.jsxs("div",{className:`${Qe.layout} ${e&&!_?Qe.visible:""}`,style:P,children:[a.jsxs("aside",{className:Qe.columna_acciones,children:[a.jsx(oo,{content:"Cerrar",placement:"left",children:a.jsx("button",{className:Qe.boton_flotante,onClick:()=>w(p),"aria-label":"Cerrar panel",children:a.jsx(_c,{})})}),a.jsx(oo,{content:"Aplicar filtros",placement:"left",children:a.jsx("button",{className:`${Qe.boton_flotante} ${Qe.boton_primario}`,onClick:()=>w(n),children:a.jsx(gc,{})})}),a.jsx(oo,{content:"Limpiar filtros",placement:"left",children:a.jsx("button",{className:`${Qe.boton_flotante} ${Qe.boton_peligro}`,onClick:()=>w(o),children:a.jsx(hc,{})})}),$&&a.jsxs("div",{className:Qe.paginacion,children:[a.jsx("button",{className:Qe.boton_flotante,style:{width:36,height:36},onClick:()=>f(k=>Math.max(0,k-1)),disabled:u===0,"aria-label":"Página anterior",children:a.jsx(pc,{})}),a.jsxs("span",{className:Qe.texto_paginacion,children:[u+1," / ",x]}),a.jsx("button",{className:Qe.boton_flotante,style:{width:36,height:36},onClick:()=>f(k=>Math.min(x-1,k+1)),disabled:u===x-1,"aria-label":"Página siguiente",children:a.jsx(mc,{})})]})]}),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:y[u]},u)})]})]})]});if(c){const k=typeof c=="function"?c():c;if(k&&k instanceof HTMLElement)return Fn.createPortal(T,k)}return T};Z.Badge=Bi,Z.BadgeVoz=jr,Z.Boton=ct,Z.Checkbox=Dn,Z.CheckboxGroup=Hl,Z.ContextMenu=fc,Z.Drawer=sc,Z.DropdownContext=qs,Z.DropdownMenu=cr,Z.GrabacionIcono=Xi,Z.GroupButton=Sm,Z.IconoCerrar=_c,Z.IconoDerecha=mc,Z.IconoFiltroAplicar=gc,Z.IconoFiltroLimpiar=hc,Z.IconoIzquierda=pc,Z.InputDate=Yi,Z.InputNumeric=Ki,Z.InputText=Ri,Z.MenuItem=Rs,Z.MenuList=lr,Z.MicrofonoIcono=Br,Z.Modal=ic,Z.ModalStack=bm,Z.PanelFiltros=Em,Z.Radio=js,Z.RadioGroup=rc,Z.Select=Nl,Z.Signature=Hi,Z.SonidoIcono=Vr,Z.Submenu=Us,Z.TablaDatos=mm,Z.TextArea=Ji,Z.Toggle=Or,Z.Tooltip=oo,Z.Transicion=vo,Z.esCheckbox=ac,Z.esLabel=dc,Z.esRadio=lc,Z.esSeparador=cc,Z.fechaEnRango=Qf,Z.formatearFecha=zr,Z.formatearNumero=qn,Z.generarOpcionesAleatorias=Nh,Z.generarUsuariosPrueba=Mh,Z.obtenerFechaHoy=Jf,Z.parsearNumero=Ui,Z.procesarValidacion=Wi,Z.redondearDecimales=Gi,Z.restringirRango=mo,Z.tieneHijos=so,Z.useCheckboxGroupContext=ql,Z.useDropdownContext=Hs,Z.useReconocimientoVoz=Zi,Z.useTablaContext=Pp,Z.useTablaContextSafe=on,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})}));
|
|
29
682
|
//# sourceMappingURL=index.umd.cjs.map
|