corekit-ui 0.1.24 → 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.
@@ -1,10 +1,663 @@
1
- (function(Z,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],s):(Z=typeof globalThis<"u"?globalThis:Z||self,s(Z.CoreKitUI={},Z.jsxRuntime,Z.React,Z.ReactDOM))})(this,(function(Z,s,m,pt){"use strict";function Gr(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 E=Gr(m),Do=Gr(pt);function Wr(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=Wr(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function K(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Wr(e))&&(o&&(o+=" "),o+=t);return o}const Kr=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ur=K,Ta=(e,t)=>n=>{var o;if(t?.variants==null)return Ur(e,n?.class,n?.className);const{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(u=>{const f=n?.[u],g=i?.[u];if(f===null)return null;const _=Kr(f)||Kr(g);return r[u][_]}),l=n&&Object.entries(n).reduce((u,f)=>{let[g,_]=f;return _===void 0||(u[g]=_),u},{}),d=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((u,f)=>{let{class:g,className:_,...c}=f;return Object.entries(c).every(h=>{let[p,v]=h;return Array.isArray(v)?v.includes({...i,...l}[p]):{...i,...l}[p]===v})?[...u,g,_]:u},[]);return Ur(e,a,d,n?.class,n?.className)},Ie={boton:"_boton_18943_1",animated:"_animated_18943_59",disabled:"_disabled_18943_59",loading:"_loading_18943_59",content:"_content_18943_67",spinner:"_spinner_18943_69",start_content:"_start_content_18943_71",end_content:"_end_content_18943_73",content_item:"_content_item_18943_101",spinner_icon:"_spinner_icon_18943_123",ripple:"_ripple_18943_159",solid:"_solid_18943_211",bordered:"_bordered_18943_231",ghost:"_ghost_18943_251",light:"_light_18943_275",faded:"_faded_18943_295",shadow:"_shadow_18943_315",only_loading:"_only_loading_18943_367",sm:"_sm_18943_385",md:"_md_18943_401",lg:"_lg_18943_417",full_width:"_full_width_18943_433",icon_only:"_icon_only_18943_441",radius_none:"_radius_none_18943_483",radius_sm:"_radius_sm_18943_551",radius_md:"_radius_md_18943_559",radius_lg:"_radius_lg_18943_567",radius_full:"_radius_full_18943_575",primary:"_primary_18943_583",secondary:"_secondary_18943_593",success:"_success_18943_603",warning:"_warning_18943_613",danger:"_danger_18943_623",default:"_default_18943_633"},Oa=Ta(Ie.boton,{variants:{variant:{solid:Ie.solid,bordered:Ie.bordered,ghost:Ie.ghost,light:Ie.light,faded:Ie.faded,shadow:Ie.shadow},color:{default:Ie.default,primary:Ie.primary,secondary:Ie.secondary,success:Ie.success,warning:Ie.warning,danger:Ie.danger},size:{sm:Ie.sm,md:Ie.md,lg:Ie.lg},radius:{none:Ie.radius_none,sm:Ie.radius_sm,md:Ie.radius_md,lg:Ie.radius_lg,full:Ie.radius_full},fullWidth:{true:Ie.full_width},isIconOnly:{true:Ie.icon_only},isLoading:{true:Ie.loading},onlyLoading:{true:Ie.only_loading},isDisabled:{true:Ie.disabled},disableAnimation:{false:Ie.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md",disableAnimation:!0}}),rn=m.forwardRef(({variant:e="solid",color:t="default",size:n="md",radius:o="md",fullWidth:r=!1,isLoading:i=!1,onlyLoading:a=!1,isDisabled:l=!1,isIconOnly:d=!1,disableRipple:u=!1,disableAnimation:f=!0,customColor:g,startContent:_,endContent:c,spinner:h,spinnerPlacement:p="end",permisos:v,permiso:w,children:C,className:x,onClick:k,style:z,type:L="button","aria-label":N,...P},A)=>{const I=w&&v?!v.includes(w):!1,O=l||i||I,q=F=>{if(O){F.preventDefault();return}if(k?.(F),u||O||!(F.currentTarget instanceof HTMLElement))return;const y=F.currentTarget,M=document.createElement("span"),D=y.getBoundingClientRect(),B=Math.max(D.width,D.height);M.className=Ie.ripple,M.style.width=`${B}px`,M.style.height=`${B}px`,M.style.left=`${F.clientX-D.left}px`,M.style.top=`${F.clientY-D.top}px`,M.addEventListener("animationend",()=>M.remove(),{once:!0}),y.appendChild(M)},$=g?{"--btn-color":g,"--btn-text-color":g,...z}:z,b=Oa({variant:e,color:g?void 0:t,size:n,radius:o,fullWidth:r,isIconOnly:d,isLoading:i,onlyLoading:a,isDisabled:O,disableAnimation:f}),S=i&&s.jsx("span",{className:Ie.spinner,"aria-hidden":a?void 0:"true",children:h||s.jsx("span",{className:Ie.spinner_icon})}),T=a&&!N?"Cargando":N;return s.jsxs("button",{...P,ref:A,type:L,"aria-label":T,"aria-busy":i,className:K(b,x),disabled:O,onClick:q,style:$,children:[p==="start"&&S,_&&!a&&s.jsx("span",{className:K(Ie.start_content,Ie.content_item),children:_}),C&&!a&&s.jsx("span",{className:Ie.content,children:C}),c&&!a&&s.jsx("span",{className:K(Ie.end_content,Ie.content_item),children:c}),p==="end"&&S]})});rn.displayName="Boton";const yn={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"},qa=()=>s.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:s.jsx("path",{d:"M2 2L8 8M8 2L2 8"})}),Rr=({variant:e="solid",color:t="default",size:n="md",radius:o="md",children:r,startIcon:i,endIcon:a,dot:l,dismissible:d,onDismiss:u,customColor:f,className:g="",onClick:_})=>{const c=!!_,h=m.useMemo(()=>{if(!f)return;const w=f,C=`color-mix(in oklab, ${w} 15%, transparent)`;return{solid:{"--badge-custom-bg":w,"--badge-custom-text":"white","--badge-custom-border":"transparent"},subtle:{"--badge-custom-bg":C,"--badge-custom-text":w,"--badge-custom-border":"transparent"},outline:{"--badge-custom-bg":"transparent","--badge-custom-text":w,"--badge-custom-border":w},soft:{"--badge-custom-bg":`color-mix(in oklab, ${w} 10%, var(--surface-first))`,"--badge-custom-text":w,"--badge-custom-border":"transparent"}}[e]},[f,e]),p=[yn.badge,yn[`size_${n}`],yn[`radius_${o}`],yn[`variant_${e}`],!f&&yn[`color_${t}`],f&&yn.badge_custom,c&&yn.badge_clickable,g].filter(Boolean).join(" "),v=m.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)"}[t],[t,f]);return s.jsxs("span",{className:p,style:h,onClick:_,role:c?"button":void 0,tabIndex:c?0:void 0,children:[l&&s.jsx("span",{className:yn.dot,style:{backgroundColor:v}}),i&&s.jsx("span",{className:yn.icon,children:i}),r,a&&s.jsx("span",{className:yn.icon,children:a}),d&&s.jsx("button",{type:"button",className:yn.dismiss_button,onClick:w=>{w.stopPropagation(),u?.()},"aria-label":"Eliminar badge",children:s.jsx(qa,{})})]})},Te={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"},Lo=m.forwardRef(({isSelected:e,defaultSelected:t=!1,onChange:n,label:o,description:r,size:i="md",color:a="primary",customColor:l,variant:d="default",isDisabled:u=!1,isReadOnly:f=!1,isInvalid:g=!1,isRequired:_=!1,showIcons:c=!1,labelPlacement:h="right",labelPosition:p="inline",justifyEnd:v=!1,children:w,className:C="",...x},k)=>{const[z,L]=m.useState(t),N=m.useId(),P=x.id||N,A=e!==void 0?e:z,I=F=>{if(u||f)return;const y=F.target.checked;e===void 0&&L(y),n&&n(y)},O=w||o,q=[Te.contenedor_toggle,Te[`tam_${i}`],!l&&Te[`color_${a}`],Te[`variante_${d}`],Te[`label_${h}`],Te[`posicion_${p}`],A&&Te.seleccionado,u&&Te.deshabilitado,f&&Te.solo_lectura,g&&Te.invalido,c&&Te.con_iconos,v&&Te.justify_end,C].filter(Boolean).join(" "),$=l?{"--toggle-custom-color":l}:void 0,b=()=>O?s.jsxs("div",{className:Te.contenedor_label,children:[s.jsxs("span",{className:Te.texto_label,children:[O,_&&s.jsx("span",{className:Te.marca_requerido,children:" *"})]}),r&&s.jsx("span",{className:Te.texto_descripcion,children:r})]}):null,S=()=>d!=="moon"?null:s.jsx("div",{className:Te.icono_moon,children:s.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:s.jsx("path",{d:"M5,1 L5,1 C2.790861,1 1,2.790861 1,5 L1,5 C1,7.209139 2.790861,9 5,9 L5,9 C7.209139,9 9,7.209139 9,5 L9,5 C9,2.790861 7.209139,1 5,1 L5,9 L5,1 Z"})})}),T=()=>!c||d==="moon"?null:s.jsxs(s.Fragment,{children:[s.jsx("svg",{className:Te.icono_check,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"2,6 5,9 10,3"})}),s.jsxs("svg",{className:Te.icono_x,width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[s.jsx("line",{x1:"2",y1:"2",x2:"8",y2:"8"}),s.jsx("line",{x1:"8",y1:"2",x2:"2",y2:"8"})]})]});return s.jsxs("div",{className:q,style:$,children:[p==="top"&&b(),s.jsxs("label",{className:Te.envoltorio_toggle,htmlFor:P,children:[p==="inline"&&h==="left"&&b(),s.jsxs("div",{className:Te.pista_toggle,children:[s.jsx("input",{ref:k,type:"checkbox",id:P,checked:A,disabled:u,readOnly:f,required:_,"aria-invalid":g,className:Te.input,onChange:I,...x}),s.jsx("div",{className:Te.fondo_pista,children:s.jsxs("div",{className:Te.pulgar_toggle,children:[S(),T()]})})]}),p==="inline"&&h==="right"&&b()]})]})});Lo.displayName="Toggle";const Va=({className:e})=>s.jsx("svg",{className:e,width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),Xr=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6"})}),ja=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M3 7v6h6M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})}),Ba=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"})}),Ha=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M12 20h9M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})}),Ga=({className:e})=>s.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"}),s.jsx("path",{d:"M15 19h6"}),s.jsx("path",{d:"M18 16v6"})]}),Wa=({className:e})=>s.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("path",{d:"m8.5 12 2.3 2.3 4.7-4.7"})]}),ie={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"},Ka=8,Ua=1.2,Un=4.2,Ra=1.8,Yr=(e,t,n)=>Math.max(t,Math.min(n,e)),Xa=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)},Zr=e=>Number.isFinite(e)?e:performance.now(),Ya=()=>{const e=m.useRef(null),[t,n]=m.useState(!0),[o,r]=m.useState(!1),[i,a]=m.useState([]),l=m.useRef([]),d=m.useRef({color:"#111827",enabled:!0}),u=m.useRef(null),f=m.useRef([]),g=m.useRef(0),_=m.useRef(Un),c=m.useRef(!1),h=m.useCallback(()=>e.current?.getContext("2d")??null,[]),p=m.useCallback(()=>h(),[h]),v=m.useCallback(()=>{const $=e.current,b=h();$&&b&&b.clearRect(0,0,$.width,$.height),n(!0),l.current=[],a([]),f.current=[],u.current=null,_.current=Un,c.current=!1},[h]),w=m.useCallback(()=>{c.current=!0,n(!1)},[]),C=m.useCallback(($,b)=>{const S=Math.max(1,b.t-$.t),F=Xa($,b)/S,M=(Un-F*Ra)*Yr(b.pressure||.5,.35,1),D=Yr(M,Ua,Un),G=_.current+(D-_.current)*.25;return _.current=G,G},[]),x=m.useCallback(($,b)=>{$.strokeStyle=d.current.color,$.lineWidth=b,$.lineCap="round",$.lineJoin="round"},[]),k=m.useCallback(($,b)=>{const S=p();if(!S)return;const T=C($,b);x(S,T),S.beginPath(),S.moveTo($.x,$.y),S.quadraticCurveTo($.x,$.y,b.x,b.y),S.stroke(),n(!1)},[C,p,x]),z=m.useCallback($=>{const b=e.current;if(!b)return{pressure:.5,t:performance.now(),x:0,y:0};const S=b.getBoundingClientRect(),T=b.width/S.width,F=b.height/S.height;return{pressure:$.pressure&&$.pressure>0?$.pressure:.5,t:$.timeStamp||performance.now(),x:($.clientX-S.left)*T,y:($.clientY-S.top)*F}},[]),L=m.useCallback($=>{if(!d.current.enabled)return;$.preventDefault();const b=e.current;if(!b)return;b.setPointerCapture($.pointerId);const S=z($);r(!0),u.current=S,f.current=[S],g.current=Zr($.timeStamp)},[z]),N=m.useCallback($=>{if(!o||!d.current.enabled)return;$.preventDefault();const b=Zr($.timeStamp);if(b-g.current<Ka)return;g.current=b;const S=z($),T=u.current;T&&(k(T,S),u.current=S,f.current.push(S))},[k,o,z]),P=m.useCallback($=>{if($&&e.current?.hasPointerCapture($.pointerId)&&e.current.releasePointerCapture($.pointerId),o&&f.current.length>0){const b=[...l.current,{puntos:[...f.current]}];l.current=b,a(b)}r(!1),u.current=null,f.current=[]},[o]),A=m.useCallback(($,b,S)=>{if(!(b.puntos.length<2))for(let T=1;T<b.puntos.length;T++){const F=b.puntos[T-1],y=b.puntos[T],M=C(F,y);$.strokeStyle=S??d.current.color,$.lineWidth=M,$.lineCap="round",$.lineJoin="round",$.beginPath(),$.moveTo(F.x,F.y),$.quadraticCurveTo(F.x,F.y,y.x,y.y),$.stroke()}},[C]),I=m.useCallback(()=>{if(l.current.length===0)return;const $=l.current.slice(0,-1);l.current=$,a($);const b=e.current;if(!b)return;const S=h();S&&(S.clearRect(0,0,b.width,b.height),_.current=Un,$.forEach(T=>A(S,T)),n($.length===0&&!c.current))},[h,A]),O=m.useCallback(($={})=>{const b=e.current;if(!b||t&&l.current.length===0&&!c.current)return null;const{backgroundColor:S,format:T,quality:F,strokeColor:y}=$;if(!S&&!y)return b.toDataURL("image/png");const M=document.createElement("canvas");M.width=b.width,M.height=b.height;const D=M.getContext("2d");if(!D)return null;S&&(D.fillStyle=S,D.fillRect(0,0,M.width,M.height)),y&&l.current.length>0&&!c.current?(_.current=Un,l.current.forEach(V=>A(D,V,y))):D.drawImage(b,0,0);const B=T??"image/png",G=F??.85;return B==="image/png"?M.toDataURL(B):M.toDataURL(B,G)},[t,A]),q=m.useCallback($=>{const b=e.current,S=h();if(!b||!S)return;if(d.current={color:$.color,enabled:$.enabled??!0},b.style.touchAction="none",b.style.userSelect="none",!d.current.enabled)return()=>{};const T=D=>L(D),F=D=>N(D),y=D=>P(D),M=D=>P(D);return b.addEventListener("pointerdown",T,{passive:!1}),b.addEventListener("pointermove",F,{passive:!1}),b.addEventListener("pointerup",y,{passive:!1}),b.addEventListener("pointerleave",y,{passive:!1}),b.addEventListener("pointercancel",M,{passive:!1}),()=>{b.removeEventListener("pointerdown",T),b.removeEventListener("pointermove",F),b.removeEventListener("pointerup",y),b.removeEventListener("pointerleave",y),b.removeEventListener("pointercancel",M)}},[P,L,N,h]);return m.useEffect(()=>{_.current=Un},[i.length]),{canvasRef:e,configurarCanvas:q,deshacerUltimoTrazo:I,estaVacio:t,limpiarCanvas:v,marcarConContenido:w,obtenerDatosFirma:O,puedeDeshacer:i.length>0}},Jr=m.forwardRef(({alto:e=200,ancho:t=700,aspectRatio:n,className:o,closeOnBackdropClick:r=!1,firmaInicial:i=null,isOpen:a=!1,isRequired:l=!1,mostrarBotonSubir:d=!0,name:u,onClose:f,onConfirm:g,readonly:_=!1,readonlyPostGuardado:c=!1,requiredMessage:h="Se debe registrar una firma para continuar",textoAdjuntar:p="Adjuntar firma",textoConsentimiento:v="Al firmar, confirmo que he leído y acepto todos los términos contractuales",textoDeshacer:w="Deshacer",textoEliminarFirma:C="Eliminar firma",textoEstadoGuardada:x="Guardada",textoEstadoPendiente:k="Pendiente",textoGuardar:z="Guardar firma",textoLimpiar:L="Limpiar",textoModificar:N="Modificar firma",textoReemplazarFirma:P="Reemplazar firma",textoSolicitarFirma:A="Agregar firma",tituloBloque:I="Firma del responsable",titulo:O="Firmar el contrato",mostrarBotonAgregarFirma:q=!0,mostrarBotonEliminarFirma:$=!0},b)=>{const{canvasRef:S,configurarCanvas:T,deshacerUltimoTrazo:F,estaVacio:y,limpiarCanvas:M,marcarConContenido:D,obtenerDatosFirma:B,puedeDeshacer:G}=Ya(),V=m.useRef(null),J=m.useRef(null),U=m.useRef(null),pe=m.useId(),ue=`${pe}-toggle`,se=`${pe}-texto`,he=`${pe}-dialog-title`,fe=`${pe}-dialog-description`,[_e,R]=m.useState(!!a),[te,oe]=m.useState(!1),[ae,ve]=m.useState(i),[ee,we]=m.useState(t),[Se,le]=m.useState(!1),[ye,W]=m.useState(!!i),[j,H]=m.useState(!1),me=Math.round(ee*e/Math.max(1,t)),Y=_||c&&ye,Ce=!_&&!(c&&ye),Re=m.useCallback(ge=>{const xe=S.current,pn=xe?.getContext("2d");if(!xe||!pn)return;const He=new Image;He.onload=()=>{pn.clearRect(0,0,xe.width,xe.height);const wn=xe.width/xe.height,Ge=He.width/He.height;let nt=xe.width,tt=xe.height,No=0,Fo=0;Ge>wn?(tt=xe.width/Ge,Fo=(xe.height-tt)/2):(nt=xe.height*Ge,No=(xe.width-nt)/2),pn.drawImage(He,No,Fo,nt,tt),D(),H(!0)},He.src=ge},[S,D]),dn=m.useCallback(()=>{Y||(M(),ve(null),H(!1),W(!1))},[Y,M]),Ye=m.useCallback(()=>{_||(M(),W(!1),H(!1),le(!1))},[M,_]),Ve=m.useCallback(ge=>{if(Y)return;const xe=ge.target.files?.[0];if(!xe)return;const pn=new FileReader;pn.onload=He=>{const wn=He.target?.result;typeof wn=="string"&&(M(),Re(wn))},pn.readAsDataURL(xe)},[Y,Re,M]),Ze=m.useCallback(()=>{Y||V.current?.click()},[Y]),re=m.useCallback(()=>{le(!1),H(!1),M()},[M]),Be=m.useCallback(ge=>{te||(oe(!0),setTimeout(()=>{R(!1),oe(!1),ge?.()},650))},[te]),be=m.useCallback(()=>{Be(()=>{re(),f?.()})},[Be,re,f]),Ee=m.useCallback(()=>{if(Y||te)return;const ge=B({backgroundColor:"#ffffff",format:"image/jpeg",quality:.82,strokeColor:"#111827"});!ge||!Se||Be(()=>{ve(ge),W(!0),g?.(ge),re(),f?.()})},[Se,Y,Be,re,B,f,g,te]);m.useEffect(()=>{a&&(R(!0),oe(!1))},[a]),m.useEffect(()=>{ve(i),W(!!i)},[i]),m.useEffect(()=>{if(!_e)return;const ge=()=>{const xe=U.current;xe&&we(Math.max(1,Math.floor(xe.clientWidth)))};return ge(),window.addEventListener("resize",ge),()=>window.removeEventListener("resize",ge)},[t,_e]),m.useImperativeHandle(b,()=>({limpiar:M,obtenerDatosFirma:B,estaVacio:()=>y}),[y,M,B]),m.useEffect(()=>{if(!_e)return;const ge=T({color:"#111827",enabled:!Y});return()=>{ge?.()}},[Y,T,_e]),m.useEffect(()=>{if(!_e){document.body.style.overflow="";return}const ge=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",ge>0&&(document.body.style.paddingRight=`${ge}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[_e]),m.useEffect(()=>{_e||re()},[re,_e]),m.useEffect(()=>{if(!_e)return;const ge=xe=>{if(xe.key==="Escape"){be();return}if(xe.ctrlKey&&xe.key.toLowerCase()==="z"){xe.preventDefault(),!Y&&G&&F();return}xe.ctrlKey&&xe.key==="Enter"&&(xe.preventDefault(),Y||Ee())};return document.addEventListener("keydown",ge),()=>document.removeEventListener("keydown",ge)},[Y,F,be,Ee,_e,G]),m.useEffect(()=>{const ge=J.current;if(!ge)return;if(l&&!!!ae){ge.setCustomValidity(h);return}ge.setCustomValidity("")},[ae,l,h]);const on=m.useCallback(ge=>{te||!r||ge.target===ge.currentTarget&&be()},[r,te,be]),fn=Y,Q=Y||j,Fe=Y||!ye&&(y&&!j||!Se),$e=()=>{_||(ae&&Ye(),oe(!1),R(!0))};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`${ie.bloque_firma} ${o||""}`,children:[s.jsxs("div",{className:ie.bloque_encabezado,children:[s.jsxs("span",{className:ie.bloque_titulo,children:[I,l&&s.jsx("span",{className:ie.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsx(Rr,{color:ae?"success":"warning",size:"sm",variant:"outline",children:ae?x:k})]}),s.jsxs("div",{className:ie.bloque_preview,style:n?{aspectRatio:n}:void 0,children:[(l||u)&&s.jsx("input",{ref:J,className:ie.input_validacion_firma,"aria-hidden":"true",name:u,required:l,tabIndex:-1,type:"text",value:ae?"signed":"",onChange:()=>{},onInvalid:ge=>{l&&!ae&&ge.currentTarget.setCustomValidity(h)},onInput:ge=>{ge.currentTarget.setCustomValidity("")}}),ae?s.jsx("img",{src:ae,alt:"Firma guardada",className:ie.bloque_preview_imagen}):s.jsx("span",{className:ie.bloque_preview_placeholder,children:"Sin firma registrada"})]}),!_&&(q||$&&!!ae)&&s.jsxs("div",{className:ie.bloque_acciones,children:[q&&s.jsx(rn,{color:"primary",size:"sm",variant:"solid",onClick:$e,className:ie.accion_agregar_firma,isDisabled:Y||te,children:s.jsxs("span",{className:ie.boton_texto_con_icono,children:[ae?s.jsx(Ha,{className:ie.icono_boton_accion}):s.jsx(Ga,{className:ie.icono_boton_accion}),s.jsx("span",{className:ie.accion_texto,children:ae?P:A})]})}),$&&ae&&s.jsx(rn,{color:"default",size:"sm",variant:"bordered",onClick:dn,className:ie.accion_eliminar_firma,isDisabled:Y||te,children:s.jsxs("span",{className:ie.boton_texto_con_icono,children:[s.jsx(Xr,{className:ie.icono_boton_accion}),s.jsx("span",{className:ie.accion_texto,children:C})]})})]})]}),_e&&s.jsx("div",{className:`${ie.backdrop} ${te?"":ie.visible}`,onClick:on,children:s.jsxs("div",{className:`${ie.modal} ${te?"":ie.visible}`,role:"dialog","aria-modal":"true","aria-labelledby":he,"aria-describedby":fe,children:[s.jsxs("header",{className:ie.encabezado,children:[s.jsx("h2",{id:he,className:ie.titulo,children:O}),s.jsxs("button",{className:ie.boton_cerrar,onClick:be,type:"button","aria-label":"Cerrar",children:[s.jsx("span",{className:ie.texto_esc,children:"ESC"}),s.jsx(Va,{className:ie.icono_x})]})]}),s.jsxs("div",{className:ie.cuerpo_modal,children:[s.jsx("div",{className:ie.contenedor_lienzo,ref:U,children:s.jsxs("div",{className:ie.area_firma,children:[s.jsx("div",{className:ie.superficie_lienzo,children:s.jsx("canvas",{ref:S,className:`${ie.lienzo} ${fn?ie.lienzo_deshabilitado:""}`,width:ee,height:me,style:{height:`${me}px`,pointerEvents:Q?"none":"auto",width:"100%"},"aria-label":"Area de firma"})}),Ce&&s.jsxs("div",{className:ie.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[s.jsxs("div",{className:ie.grupo_izquierda,children:[s.jsxs("button",{className:ie.boton_accion,onClick:F,type:"button",disabled:!G||fn,"aria-label":w,children:[s.jsx(ja,{className:ie.icono,"aria-hidden":"true"}),s.jsx("span",{children:w})]}),s.jsx("span",{className:ie.separador,"aria-hidden":"true",children:"|"}),s.jsxs("button",{className:ie.boton_accion,onClick:dn,type:"button",disabled:y&&!j||fn,"aria-label":L,children:[s.jsx(Xr,{className:ie.icono,"aria-hidden":"true"}),s.jsx("span",{children:L})]})]}),d&&s.jsx("div",{className:ie.grupo_derecha,children:s.jsxs("button",{className:ie.boton_adjuntar,onClick:Ze,type:"button",disabled:Y,children:[s.jsx(Ba,{className:ie.icono,"aria-hidden":"true"}),p]})})]})]})}),Ce&&s.jsxs(s.Fragment,{children:[s.jsx("div",{id:fe,className:ie.contenedor_consentimiento,children:s.jsxs("div",{className:ie.consentimiento_fila,children:[s.jsx(Lo,{id:ue,isSelected:Se,onChange:le,color:"primary",size:"md",isDisabled:Y,"aria-describedby":se,className:ie.toggle_consentimiento}),s.jsx("label",{htmlFor:ue,id:se,className:ie.texto_consentimiento,children:v})]})}),s.jsx("div",{className:ie.contenedor_guardar,children:s.jsx(rn,{color:"primary",variant:"solid",radius:"full",size:"md",onClick:ye&&!c?Ye:Ee,type:"button",isDisabled:Fe,startContent:s.jsx(Wa,{className:ie.icono,"aria-hidden":"true"}),children:ye&&!c?N:z})})]}),Ce&&d&&s.jsx("div",{className:ie.contenedor_subir_oculto,children:s.jsx("input",{ref:V,type:"file",accept:"image/*",className:ie.input_archivo,onChange:Ve,"aria-label":"Subir imagen de firma"})})]})]})})]})});Jr.displayName="Signature";const Za="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Dt=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Za[n[e]&63];return t};const Ja=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[s.jsx("path",{d:"M18 6 6 18"}),s.jsx("path",{d:"m6 6 12 12"})]}),Qa=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[s.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),s.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),el=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[s.jsx("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),s.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),s.jsx("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),s.jsx("path",{d:"m2 2 20 20"})]}),Oe={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"},Qr=m.forwardRef((e,t)=>{const{type:n="text",value:o,defaultValue:r,placeholder:i,variant:a="bordered",color:l="default",size:d="md",radius:u="md",fullWidth:f=!0,disableAnimation:g=!1,label:_,description:c,errorMessage:h,startContent:p,endContent:v,isRequired:w=!1,isReadOnly:C=!1,isDisabled:x=!1,isClearable:k=!1,isInvalid:z,validationState:L,validate:N,className:P,classNames:A,style:I,onChange:O,onClear:q,onValueChange:$,onFocus:b,onBlur:S,onKeyDown:T,id:F,name:y,autoComplete:M,autoFocus:D,maxLength:B,minLength:G,pattern:V,...J}=e,U=m.useRef(null),ue=m.useRef(F??`input-text-${Dt(8)}`).current;m.useImperativeHandle(t,()=>U.current);const se=o!==void 0,[he,fe]=m.useState(r??""),_e=se?o:he,[R,te]=m.useState(!1),[oe,ae]=m.useState(!1),ve=m.useMemo(()=>{if(!N)return null;const be=N(_e);return be===!0||be==null?null:typeof be=="string"?be:typeof be=="object"&&"message"in be?be.message??"Entrada inválida":"Entrada inválida"},[_e,N]),ee=m.useMemo(()=>z!==void 0?z:L==="invalid"?!0:L==="valid"?!1:!!ve,[z,L,ve]),we=L==="valid"&&!ee,Se={invalido:ee,mensaje:ve},le=_e.length>0,ye=n==="password",W=ye&&oe?"text":n,j=k&&le&&!C&&!x,H=m.useCallback(be=>{if(x||C)return;const Ee=be.target.value;se||fe(Ee),O?.(Ee),$?.(Ee)},[se,x,C,O,$]),me=m.useCallback(be=>{te(!0),b?.(be)},[b]),Y=m.useCallback(be=>{te(!1),S?.(be)},[S]),Ce=m.useCallback(()=>{x||C||(se||fe(""),O?.(""),$?.(""),q?.(),U.current?.focus())},[se,x,C,O,$,q]),Re=m.useCallback(be=>{be.key==="Escape"&&k&&le&&Ce(),T?.(be)},[k,le,Ce,T]),dn=m.useCallback(()=>{ae(be=>!be),requestAnimationFrame(()=>U.current?.focus())},[]),Ye=c?`${ue}-desc`:void 0,Ve=ee?`${ue}-err`:void 0,Ze=[Ye,Ve].filter(Boolean).join(" ")||void 0,re=typeof h=="function"?h(Se):h??ve,Be=K(Oe.contenedor_base,Oe[`variante_${a}`],Oe[`tam_${d}`],Oe[`radio_${u}`],Oe[`color_${l}`],{[Oe.ancho_total]:f,[Oe.sin_animacion]:g,[Oe.deshabilitado]:x,[Oe.solo_lectura]:C,[Oe.invalido]:ee,[Oe.valido]:we,[Oe.enfocado]:R,[Oe.tiene_contenido]:le},P,A?.base);return s.jsxs("div",{className:Be,style:I,children:[_&&s.jsxs("label",{className:K(Oe.etiqueta,A?.label),htmlFor:ue,children:[_,w&&s.jsx("span",{className:Oe.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsxs("div",{className:K(Oe.envoltorio_input,A?.inputWrapper),children:[p&&s.jsx("span",{className:Oe.contenido_inicio,children:p}),s.jsx("div",{className:K(Oe.envoltorio_interno,A?.innerWrapper),children:s.jsx("input",{...J,ref:U,id:ue,name:y,type:W,value:se?_e:void 0,defaultValue:se?void 0:r,placeholder:i,disabled:x,readOnly:C,required:w,autoComplete:M,autoFocus:D,maxLength:B,minLength:G,pattern:V,"aria-invalid":ee||void 0,"aria-describedby":Ze,"aria-required":w,className:K(Oe.entrada,A?.input),onChange:H,onFocus:me,onBlur:Y,onKeyDown:Re})}),j&&s.jsx("button",{type:"button",className:K(Oe.boton_limpiar,A?.clearButton),onClick:Ce,tabIndex:-1,"aria-label":"Limpiar campo",children:s.jsx(Ja,{size:"0.75em"})}),ye&&s.jsx("button",{type:"button",className:Oe.boton_password,onClick:dn,tabIndex:-1,"aria-label":oe?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":oe,children:oe?s.jsx(el,{}):s.jsx(Qa,{})}),v&&s.jsx("span",{className:Oe.contenido_final,children:v})]}),c&&!ee&&s.jsx("div",{id:Ye,className:K(Oe.descripcion,A?.description),children:c}),ee&&re&&s.jsx("div",{id:Ve,className:K(Oe.mensaje_error,A?.errorMessage),role:"alert",children:re})]})});Qr.displayName="InputText";function Lt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ht(e,t){if(e==null||Number.isNaN(e))return"";const{separadorMiles:n=!1,separadorDecimal:o=".",escalaDecimal:r,decimalesFijos:i=!1,prefijo:a="",sufijo:l=""}=t;let d;r!==void 0?d=i?e.toFixed(r):String(Math.round(e*Math.pow(10,r))/Math.pow(10,r)):d=String(e);const[u,f]=d.split(".");let g=u;if(n){const c=typeof n=="string"?n:",";g=u.replace(/\B(?=(\d{3})+(?!\d))/g,c)}let _=g;return f!==void 0?_+=o+f:i&&r&&r>0&&(_+=o+"0".repeat(r)),`${a}${_}${l}`}function ei(e,t){if(!e||e.trim()==="")return;const{separadorMiles:n=!1,separadorDecimal:o=".",prefijo:r="",sufijo:i="",permitirNegativo:a=!0}=t;let l=e;if(r&&(l=l.replace(new RegExp(`^${Lt(r)}`),"")),i&&(l=l.replace(new RegExp(`${Lt(i)}$`),"")),n){const u=typeof n=="string"?n:",";l=l.replace(new RegExp(Lt(u),"g"),"")}o!=="."&&(l=l.replace(new RegExp(Lt(o)),".")),a||(l=l.replace(/-/g,""));const d=parseFloat(l);return Number.isNaN(d)?void 0:d}function Pt(e,t,n){let o=e;return t!==void 0&&o<t&&(o=t),n!==void 0&&o>n&&(o=n),o}function ni(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 ti(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}const nl=e=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[s.jsx("path",{d:"M5 12h14"}),s.jsx("path",{d:"M12 5v14"})]}),tl=e=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:s.jsx("path",{d:"M5 12h14"})}),qe={contenedor_base:"_contenedor_base_1i8i2_1",tam_sm:"_tam_sm_1i8i2_37",tam_lg:"_tam_lg_1i8i2_49",radio_none:"_radio_none_1i8i2_61",radio_sm:"_radio_sm_1i8i2_69",radio_md:"_radio_md_1i8i2_77",radio_lg:"_radio_lg_1i8i2_85",radio_full:"_radio_full_1i8i2_93",color_default:"_color_default_1i8i2_101",color_primary:"_color_primary_1i8i2_103",color_secondary:"_color_secondary_1i8i2_111",color_success:"_color_success_1i8i2_119",color_warning:"_color_warning_1i8i2_127",color_danger:"_color_danger_1i8i2_135",etiqueta:"_etiqueta_1i8i2_143",marca_requerido:"_marca_requerido_1i8i2_159",envoltorio_input:"_envoltorio_input_1i8i2_169",envoltorio_interno:"_envoltorio_interno_1i8i2_195",entrada:"_entrada_1i8i2_213",contenido_inicio:"_contenido_inicio_1i8i2_279",contenido_final:"_contenido_final_1i8i2_281",controles:"_controles_1i8i2_299",boton_control:"_boton_control_1i8i2_315",variante_bordered:"_variante_bordered_1i8i2_369",variante_faded:"_variante_faded_1i8i2_377",variante_underlined:"_variante_underlined_1i8i2_385",variante_ghost:"_variante_ghost_1i8i2_397",descripcion:"_descripcion_1i8i2_445",mensaje_error:"_mensaje_error_1i8i2_457",ancho_total:"_ancho_total_1i8i2_469",deshabilitado:"_deshabilitado_1i8i2_533",solo_lectura:"_solo_lectura_1i8i2_567",enfocado:"_enfocado_1i8i2_621",valido:"_valido_1i8i2_629",invalido:"_invalido_1i8i2_637",sin_animacion:"_sin_animacion_1i8i2_669"},oi=m.forwardRef((e,t)=>{const{value:n,defaultValue:o,placeholder:r,variant:i="bordered",color:a="default",size:l="md",radius:d="md",fullWidth:u=!0,disableAnimation:f=!1,label:g,description:_,errorMessage:c,startContent:h,endContent:p,isRequired:v=!1,isReadOnly:w=!1,isDisabled:C=!1,isInvalid:x,validationState:k,validate:z,className:L,classNames:N,style:P,min:A,max:I,step:O=1,decimalScale:q,fixedDecimalScale:$=!1,thousandSeparator:b=!1,decimalSeparator:S=".",prefix:T="",suffix:F="",allowNegative:y=!0,allowDecimal:M=!0,hideControls:D=!1,clampBehavior:B="blur",onChange:G,onValueChange:V,onFocus:J,onBlur:U,onKeyDown:pe,id:ue,name:se,...he}=e,fe=m.useRef(null),R=m.useRef(ue??`input-numeric-${Dt(8)}`).current;m.useImperativeHandle(t,()=>fe.current);const te=n!==void 0,[oe,ae]=m.useState(o!==void 0?o:void 0),[ve,ee]=m.useState(""),[we,Se]=m.useState(!1),le=te?n===""?void 0:n:oe,ye=m.useMemo(()=>({separadorMiles:b,separadorDecimal:S,escalaDecimal:M?q:0,decimalesFijos:$,prefijo:T,sufijo:F,permitirNegativo:y}),[b,S,q,$,T,F,y,M]),W=m.useMemo(()=>{if(!z)return null;const Q=ni(z(le));return Q.invalido?Q.mensaje:null},[le,z]),j=m.useMemo(()=>x!==void 0?x:k==="invalid"?!0:k==="valid"?!1:!!W,[x,k,W]),H=k==="valid"&&!j,me={invalido:j,mensaje:W},Y=m.useCallback(Q=>{te||ae(Q),G?.(Q),V?.(ht(Q,ye),Q)},[te,G,V,ye]),Ce=m.useCallback(Q=>{let $e=(le??0)+O*Q;B!=="none"&&($e=Pt($e,A,I)),q!==void 0&&($e=ti($e,q)),Y($e),ee(ht($e,ye))},[le,O,A,I,B,q,Y,ye]),Re=m.useCallback(Q=>{if(C||w)return;const Fe=Q.target.value,$e=S===","?",":".";let ge="0-9";M&&(ge+=$e),y&&(ge+="-");const xe=new RegExp(`[^${ge}]`,"g");let He=Fe.replace(xe,"");if(M){const Ge=He.split($e);Ge.length>2&&(He=Ge[0]+$e+Ge.slice(1).join(""))}if(y&&He.includes("-")){const Ge=He.replace(/-/g,"");He=He.startsWith("-")?"-"+Ge:Ge}ee(He);const wn=ei(He,ye);if(B==="strict"&&wn!==void 0){const Ge=Pt(wn,A,I);Y(Ge)}else Y(wn)},[C,w,ye,B,A,I,Y,S,y,M]),dn=m.useCallback(Q=>{if(Se(!0),le!==void 0){let Fe=String(le);S!=="."&&(Fe=Fe.replace(".",S)),ee(Fe)}J?.(Q)},[le,S,J]),Ye=m.useCallback(Q=>{if(Se(!1),B==="blur"&&le!==void 0){const Fe=Pt(le,A,I);Fe!==le&&Y(Fe)}ee(ht(le,ye)),U?.(Q)},[le,B,A,I,Y,ye,U]),Ve=m.useCallback(Q=>{Q.key==="ArrowUp"?(Q.preventDefault(),Ce(1)):Q.key==="ArrowDown"&&(Q.preventDefault(),Ce(-1));const Fe=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],$e=Q.ctrlKey||Q.metaKey,ge=M&&(Q.key===S||Q.key==="."||Q.key===","),xe=Q.key==="-"&&y,pn=/^[0-9]$/.test(Q.key);!Fe.includes(Q.key)&&!$e&&!ge&&!xe&&!pn&&Q.preventDefault(),pe?.(Q)},[Ce,pe,S,y,M]);m.useEffect(()=>{we||ee(ht(le,ye))},[le,we,ye]);const Ze=_?`${R}-desc`:void 0,re=j?`${R}-err`:void 0,Be=[Ze,re].filter(Boolean).join(" ")||void 0,be=typeof c=="function"?c(me):c??W,Ee=I===void 0||(le??0)<I,on=A===void 0||(le??0)>A,fn=K(qe.contenedor_base,qe[`variante_${i}`],qe[`tam_${l}`],qe[`radio_${d}`],qe[`color_${a}`],{[qe.ancho_total]:u,[qe.sin_animacion]:f,[qe.deshabilitado]:C,[qe.solo_lectura]:w,[qe.invalido]:j,[qe.valido]:H,[qe.enfocado]:we},L,N?.base);return s.jsxs("div",{className:fn,style:P,children:[g&&s.jsxs("label",{className:K(qe.etiqueta,N?.label),htmlFor:R,children:[g,v&&s.jsx("span",{className:qe.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsxs("div",{className:K(qe.envoltorio_input,N?.inputWrapper),children:[s.jsxs("div",{className:K(qe.envoltorio_interno,N?.innerWrapper),children:[h&&s.jsx("span",{className:qe.contenido_inicio,children:h}),s.jsx("input",{...he,ref:fe,id:R,name:se,type:"text",inputMode:"decimal",value:ve,placeholder:r,disabled:C,readOnly:w,required:v,"aria-invalid":j||void 0,"aria-describedby":Be,"aria-required":v,className:K(qe.entrada,N?.input),onChange:Re,onFocus:dn,onBlur:Ye,onKeyDown:Ve}),p&&s.jsx("span",{className:qe.contenido_final,children:p})]}),!D&&!w&&!C&&s.jsxs("div",{className:K(qe.controles,N?.controls),children:[s.jsx("button",{type:"button",tabIndex:-1,className:K(qe.boton_control,N?.controlButton),disabled:!on,onClick:()=>Ce(-1),"aria-label":"Decrementar valor",children:s.jsx(tl,{})}),s.jsx("button",{type:"button",tabIndex:-1,className:K(qe.boton_control,N?.controlButton),disabled:!Ee,onClick:()=>Ce(1),"aria-label":"Incrementar valor",children:s.jsx(nl,{})})]})]}),_&&!j&&s.jsx("div",{id:Ze,className:K(qe.descripcion,N?.description),children:_}),j&&be&&s.jsx("div",{id:re,className:K(qe.mensaje_error,N?.errorMessage),role:"alert",children:be})]})});oi.displayName="InputNumeric";function ol(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 Po(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 rl(){return new Date().toISOString().split("T")[0]}function il(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 je={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"},sl=()=>s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("polyline",{points:"12 6 12 12 16 14"})]}),al=()=>s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("path",{d:"M8 2v4"}),s.jsx("path",{d:"M16 2v4"}),s.jsx("rect",{height:"18",rx:"2",width:"18",x:"3",y:"4"}),s.jsx("path",{d:"M3 10h18"}),s.jsx("circle",{cx:"8",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"12",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"16",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"8",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"12",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"16",cy:"18",r:"1",fill:"currentColor",stroke:"none"})]}),ll=()=>s.jsxs("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("path",{d:"M18 6 6 18"}),s.jsx("path",{d:"m6 6 12 12"})]}),cl=({tipo:e,onClick:t,onMouseDown:n})=>s.jsx("button",{type:"button",tabIndex:-1,className:je.boton_icono,onMouseDown:n,onClick:t,"aria-label":e==="time"?"Abrir selector de hora":"Abrir selector de fecha",children:e==="time"?s.jsx(sl,{}):s.jsx(al,{})}),ri=m.forwardRef((e,t)=>{const{type:n="date",value:o,defaultValue:r,placeholder:i,variant:a="bordered",color:l="default",size:d="md",radius:u="md",fullWidth:f=!0,disableAnimation:g=!1,label:_,description:c,errorMessage:h,startContent:p,isRequired:v=!1,isReadOnly:w=!1,isDisabled:C=!1,isInvalid:x,validationState:k,validate:z,className:L,classNames:N,style:P,min:A,max:I,isClearable:O=!1,onChange:q,onFocus:$,onBlur:b,id:S,name:T,...F}=e,y=m.useRef(null),D=m.useRef(S??`input-date-${Dt(8)}`).current;m.useImperativeHandle(t,()=>y.current);const B=o!==void 0,[G,V]=m.useState(r??""),J=B?o:G,[U,pe]=m.useState(!1),ue=m.useRef(!1),se=m.useMemo(()=>{if(J&&n!=="time"&&(A||I)){if(A&&J<A)return`La fecha debe ser ${n==="date"?Po(A):A} o posterior`;if(I&&J>I)return`La fecha debe ser ${n==="date"?Po(I):I} o anterior`}if(!z)return null;const j=ol(z(J));return j.invalido?j.mensaje:null},[J,z,A,I,n]),he=m.useMemo(()=>x!==void 0?x:k==="invalid"?!0:k==="valid"?!1:!!se,[x,k,se]),fe=k==="valid"&&!he,_e={invalido:he,mensaje:se},R=m.useCallback(j=>{if(C||w)return;ue.current=!1;const H=j.target.value;B||V(H),q?.(H)},[B,C,w,q]),te=m.useCallback(j=>{pe(!0),$?.(j)},[$]),oe=m.useCallback(j=>{pe(!1),ue.current=!1,b?.(j)},[b]),ae=m.useCallback(j=>{j.preventDefault()},[]),ve=m.useCallback(j=>{if(j.preventDefault(),j.stopPropagation(),!(!y.current||C||w)){if(ue.current){ue.current=!1,y.current.blur();return}y.current.focus();try{y.current.showPicker?.(),ue.current=!0}catch{}}},[C,w]),ee=m.useCallback(j=>{j.preventDefault(),j.stopPropagation(),ue.current=!1,B||V(""),q?.(""),y.current?.focus()},[B,q]),we=c?`${D}-desc`:void 0,Se=he?`${D}-err`:void 0,le=[we,Se].filter(Boolean).join(" ")||void 0,ye=typeof h=="function"?h(_e):h??se,W=K(je.contenedor_base,je[`variante_${a}`],je[`tam_${d}`],je[`radio_${u}`],je[`color_${l}`],{[je.ancho_total]:f,[je.sin_animacion]:g,[je.deshabilitado]:C,[je.solo_lectura]:w,[je.invalido]:he,[je.valido]:fe,[je.enfocado]:U},L,N?.base);return s.jsxs("div",{className:W,style:P,children:[_&&s.jsxs("label",{className:K(je.etiqueta,N?.label),htmlFor:D,children:[_,v&&s.jsx("span",{className:je.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsx("div",{className:K(je.envoltorio_input,N?.inputWrapper),children:s.jsxs("div",{className:K(je.envoltorio_interno,N?.innerWrapper),children:[p&&s.jsx("span",{className:je.contenido_inicio,children:p}),s.jsx("input",{...F,ref:y,id:D,name:T,type:n,value:B?J:void 0,defaultValue:B?void 0:r,placeholder:i,disabled:C,readOnly:w,required:v,min:A,max:I,"aria-invalid":he||void 0,"aria-describedby":le,"aria-required":v,className:K(je.entrada,N?.input),onChange:R,onFocus:te,onBlur:oe}),O&&J&&!C&&!w&&s.jsx("button",{type:"button",tabIndex:-1,className:K(je.boton_limpiar,N?.clearButton),onMouseDown:j=>j.preventDefault(),onClick:ee,"aria-label":"Limpiar fecha",children:s.jsx(ll,{})}),s.jsx(cl,{tipo:n,onClick:ve,onMouseDown:ae})]})}),c&&!he&&s.jsx("div",{id:we,className:K(je.descripcion,N?.description),children:c}),he&&ye&&s.jsx("div",{id:Se,className:K(je.mensaje_error,N?.errorMessage),role:"alert",children:ye})]})});ri.displayName="InputDate";const dl={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function Tt({mostrar:e,children:t,tipo:n="desvanecerDeslizar",className:o,...r}){const[i,a]=m.useState(e),[l,d]=m.useState(e?"entrada":null);e&&!i?(a(!0),d("entrada")):!e&&i&&l!=="salida"&&d("salida");const u=()=>{l==="entrada"?d(null):l==="salida"&&(a(!1),d(null))};if(!i)return null;const f=dl[n||"desvanecer"],g=l?`transicion_${f}_${l}`:"";return s.jsx("div",{...r,onAnimationEnd:u,className:`${g} ${o||""}`.trim(),children:t})}const In={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 To(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:s.jsxs("g",{fill:"currentColor",children:[s.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),s.jsx("path",{d:"M8 11a4 4 0 0 1-4-4H2a6 6 0 0 0 5 5.917V14H5v2h6v-2H9v-1.083A6 6 0 0 0 14 7h-2a4 4 0 0 1-4 4"})]})})}function Oo(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...e,children:s.jsx("path",{fill:"currentColor",d:"M18 5.433c0-1.398-1.742-2.036-2.645-.97l-4.086 4.83A2 2 0 0 1 9.743 10H6a4 4 0 0 0-4 4v4a4 4 0 0 0 4 4h3.743a2 2 0 0 1 1.526.708l4.086 4.829c.902 1.066 2.645.428 2.645-.97zm3.433 3.743a1 1 0 0 1 1.391.258c1.465 2.13 2.238 4.324 2.238 6.566s-.773 4.436-2.238 6.567a1 1 0 1 1-1.648-1.133c1.285-1.87 1.887-3.676 1.887-5.434s-.602-3.564-1.887-5.433a1 1 0 0 1 .258-1.39m4.257-3.9a1 1 0 0 0-1.38 1.448c2.387 2.273 3.628 5.739 3.628 9.276s-1.241 7.003-3.628 9.276a1 1 0 0 0 1.38 1.448c2.863-2.727 4.247-6.761 4.247-10.724S28.554 8.003 25.69 5.276"})})}function ii(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...e,children:[s.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),s.jsx("path",{fill:"currentColor",d:"M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2m0 16a6 6 0 1 1 6-6a6.007 6.007 0 0 1-6 6"})]})}function qo({tipo:e,texto:t,size:n="md",estirar:o}){const r=e==="mic";return s.jsxs("span",{className:K(In.badge_voz,r?In.badge_mic:In.badge_tts,In[`badge_${n}`],o&&In.badge_estirada),"data-tipo":e,children:[s.jsx("span",{className:In.badge_icono,children:r?s.jsx(To,{}):s.jsx(Oo,{})}),s.jsx("span",{className:In.badge_texto,children:t}),r?s.jsxs("span",{className:In.badge_ondas,"aria-hidden":"true",children:[s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{})]}):s.jsxs("span",{className:In.badge_eq,"aria-hidden":"true",children:[s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{})]})]})}function si({value:e,onChange:t,isDisabled:n,isReadOnly:o,onDictadoCompleto:r,idioma:i="es-ES"}){const[a,l]=m.useState(!1),[d,u]=m.useState(!1),[f,g]=m.useState(null),_=m.useRef(null),c=m.useRef(null),h=m.useRef(null),p=m.useRef(""),v=typeof window<"u"&&"speechSynthesis"in window,w=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),C=m.useCallback(()=>{h.current&&(clearTimeout(h.current),h.current=null),v&&window.speechSynthesis.cancel(),c.current=null,l(!1)},[v]),x=m.useCallback(()=>{if(!v||!e)return;if(C(),_.current){try{_.current.stop()}catch(N){console.error("Error stopping recognition:",N)}_.current=null,u(!1)}const L=new SpeechSynthesisUtterance(e);L.lang=i,L.onstart=()=>l(!0),L.onend=()=>{l(!1),c.current=null},L.onerror=()=>{l(!1),c.current=null},c.current=L,window.speechSynthesis.speak(L)},[v,e,i,C]),k=m.useCallback(()=>{if(_.current)try{_.current.stop()}catch(L){console.error("Error stopping recognition:",L)}u(!1),g(null)},[]),z=m.useCallback(()=>{if(!w||n||o)return;C();const L=window,N=L.SpeechRecognition||L.webkitSpeechRecognition;if(!N){g("Navegador no compatible");return}try{const P=new N;P.continuous=!0,P.interimResults=!0,P.lang=i,P.onstart=()=>{u(!0),g(null),p.current=e||""},P.onend=()=>{u(!1),_.current=null,r?.()},P.onerror=A=>{A.error!=="no-speech"&&(u(!1),_.current=null,A.error!=="aborted"&&g("Error al reconocer voz"))},P.onresult=A=>{try{let I="";for(let $=0;$<A.results.length;$++)I+=A.results[$][0].transcript;const O=p.current&&I?" ":"",q=p.current+O+I;t(q)}catch{g("Error procesando dictado")}},_.current=P,P.start()}catch{g("No se pudo iniciar dictado"),u(!1)}},[w,n,o,e,t,i,C,r]);return m.useEffect(()=>()=>{h.current&&clearTimeout(h.current),v&&window.speechSynthesis.cancel(),_.current&&_.current.abort()},[v]),{puedeHablar:v,puedeEscuchar:w,hablando:a,escuchando:d,errorDictado:f,escuchar:x,detenerHablar:C,dictar:z,detenerDictado:k}}function ul({size:e="1em",className:t}){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:e,height:e,className:t,"aria-hidden":"true",children:[s.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}const De={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"},ai=m.forwardRef((e,t)=>{const{children:n,variant:o="bordered",color:r="default",size:i="md",radius:a="md",fullWidth:l=!0,disableAnimation:d=!1,label:u,description:f,errorMessage:g,value:_,defaultValue:c,placeholder:h,isRequired:p=!1,isReadOnly:v=!1,isDisabled:w=!1,isClearable:C=!1,isInvalid:x,validationState:k,validate:z,minRows:L=4,maxRows:N=10,disableAutosize:P=!1,hideVoiceActions:A=!1,className:I,classNames:O,style:q,onChange:$,onClear:b,onFocus:S,onBlur:T,id:F,name:y,rows:M,...D}=e,B=m.useRef(null),V=m.useRef(F??`textarea-${Dt(8)}`).current;m.useImperativeHandle(t,()=>B.current);const J=_!==void 0,[U,pe]=m.useState(c??""),ue=J?_:U,[se,he]=m.useState(!1),fe=m.useMemo(()=>{if(!z)return null;const Q=z(ue);return Q===!0||Q==null?null:typeof Q=="string"?Q:typeof Q=="object"&&"message"in Q?Q.message??"Entrada inválida":"Entrada inválida"},[ue,z]),_e=m.useMemo(()=>x!==void 0?x:k==="invalid"?!0:k==="valid"?!1:!!fe,[x,k,fe]),R=k==="valid"&&!_e,te={invalido:_e,mensaje:fe},oe=ue.length>0,ae=m.useCallback(()=>{if(!B.current||P)return;const Q=B.current,Fe=window.getComputedStyle(Q),$e=parseFloat(Fe.lineHeight)||parseFloat(Fe.fontSize)*1.5,ge=parseFloat(Fe.paddingTop)||0,xe=parseFloat(Fe.paddingBottom)||0,pn=parseFloat(Fe.borderTopWidth)||0,He=parseFloat(Fe.borderBottomWidth)||0,wn=L*$e+ge+xe+pn+He,Ge=N*$e+ge+xe+pn+He;Q.style.height="auto";const nt=Q.scrollHeight;Q.style.height=`${Math.min(Math.max(nt,wn),Ge)}px`},[P,L,N]);m.useEffect(()=>{P||ae()},[ue,ae,P]);const ve=m.useCallback(Q=>{J||pe(Q),$?.(Q)},[J,$]),{puedeHablar:ee,hablando:we,escuchar:Se,detenerHablar:le,puedeEscuchar:ye,escuchando:W,errorDictado:j,dictar:H,detenerDictado:me}=si({isDisabled:w||A,isReadOnly:v,value:ue,onChange:ve}),Y=m.useCallback(Q=>{if(w||v)return;const Fe=Q.target.value;J||pe(Fe),$?.(Fe)},[J,w,v,$]),Ce=m.useCallback(Q=>{he(!0),S?.(Q)},[S]),Re=m.useCallback(Q=>{he(!1),T?.(Q)},[T]),dn=m.useCallback(()=>{w||v||(J||pe(""),$?.(""),b?.(),B.current?.focus())},[J,w,v,$,b]),Ye=m.useCallback(()=>{we?le():Se()},[we,Se,le]),Ve=m.useCallback(()=>{W?me():H()},[W,H,me]),Ze=f?`${V}-desc`:void 0,re=_e||j?`${V}-err`:void 0,Be=[Ze,re].filter(Boolean).join(" ")||void 0,be=typeof g=="function"?g(te):g??fe,Ee=C&&oe&&!v&&!w,on=!A||Ee,fn=K(De.contenedor_base,De[`variante_${o}`],De[`tam_${i}`],De[`radio_${a}`],De[`color_${r}`],{[De.ancho_total]:l,[De.sin_animacion]:d,[De.deshabilitado]:w,[De.solo_lectura]:v,[De.invalido]:_e,[De.valido]:R,[De.enfocado]:se},I,O?.base);return s.jsxs("div",{className:fn,style:q,children:[u&&s.jsxs("label",{className:K(De.etiqueta,O?.label),htmlFor:V,children:[u,p&&s.jsx("span",{className:De.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsxs("div",{className:K(De.envoltorio_input,O?.inputWrapper),children:[s.jsx("textarea",{...D,ref:B,id:V,name:y,placeholder:h,value:J?ue:void 0,defaultValue:J?void 0:c,onChange:Y,onFocus:Ce,onBlur:Re,className:K(De.entrada,P&&De.sin_autosize,O?.input),readOnly:v,disabled:w,rows:M??L,"aria-invalid":_e||void 0,"aria-describedby":Be,"aria-required":p,required:p}),on&&s.jsxs("div",{className:K(De.barra_acciones,O?.actions),children:[s.jsxs("div",{className:De.badges_contenedor,"aria-live":"polite",role:"status",children:[s.jsx(Tt,{mostrar:W,children:s.jsx(qo,{tipo:"mic",texto:"Escuchando...",size:i==="lg"?"md":"sm"})}),s.jsx(Tt,{mostrar:we,children:s.jsx(qo,{tipo:"tts",texto:"Leyendo...",size:i==="lg"?"md":"sm"})})]}),s.jsxs("div",{className:De.botones_grupo,children:[!A&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:K(De.boton_accion,we&&De.boton_activo_tts),onClick:Ye,disabled:!ee||!we&&(!ue||W),title:we?"Detener lectura":"Leer texto","aria-pressed":we,"aria-label":we?"Detener lectura":"Leer texto",children:s.jsx(Oo,{})}),ye&&s.jsx("button",{type:"button",className:K(De.boton_accion,W&&De.boton_activo_mic),onClick:Ve,disabled:w||v||we,title:W?"Detener dictado":"Dictar texto","aria-pressed":W,"aria-label":W?"Detener dictado":"Dictar texto",children:W?s.jsx(ii,{}):s.jsx(To,{})})]}),Ee&&s.jsx("button",{type:"button",className:De.boton_limpiar,onClick:dn,title:"Limpiar campo","aria-label":"Limpiar campo",children:s.jsx(ul,{size:"0.75em"})})]})]})]}),f&&!_e&&s.jsx("div",{id:Ze,className:K(De.descripcion,O?.description),children:f}),_e&&be||j?s.jsxs("div",{id:re,className:K(De.mensaje_error,O?.errorMessage),role:"alert",children:[be,be&&j&&s.jsx("br",{}),j&&s.jsxs("span",{children:["Error de voz: ",j]})]}):null,n]})});ai.displayName="TextArea";function Ot(){return typeof window<"u"}function Pn(e){return Vo(e)?(e.nodeName||"").toLowerCase():"#document"}function gn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xn(e){var t;return(t=(Vo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Vo(e){return Ot()?e instanceof Node||e instanceof gn(e).Node:!1}function Le(e){return Ot()?e instanceof Element||e instanceof gn(e).Element:!1}function We(e){return Ot()?e instanceof HTMLElement||e instanceof gn(e).HTMLElement:!1}function qt(e){return!Ot()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof gn(e).ShadowRoot}const fl=new Set(["inline","contents"]);function mt(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=hn(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!fl.has(r)}const _l=new Set(["table","td","th"]);function gl(e){return _l.has(Pn(e))}const pl=[":popover-open",":modal"];function Vt(e){return pl.some(t=>{try{return e.matches(t)}catch{return!1}})}const hl=["transform","translate","scale","rotate","perspective"],ml=["transform","translate","scale","rotate","perspective","filter"],vl=["paint","layout","strict","content"];function jo(e){const t=jt(),n=Le(e)?hn(e):e;return hl.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)||ml.some(o=>(n.willChange||"").includes(o))||vl.some(o=>(n.contain||"").includes(o))}function bl(e){let t=Mn(e);for(;We(t)&&!En(t);){if(jo(t))return t;if(Vt(t))return null;t=Mn(t)}return null}function jt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const wl=new Set(["html","body","#document"]);function En(e){return wl.has(Pn(e))}function hn(e){return gn(e).getComputedStyle(e)}function Bt(e){return Le(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mn(e){if(Pn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qt(e)&&e.host||xn(e);return qt(t)?t.host:t}function li(e){const t=Mn(e);return En(t)?e.ownerDocument?e.ownerDocument.body:e.body:We(t)&&mt(t)?t:li(t)}function Tn(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=li(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),a=gn(r);if(i){const l=Bo(a);return t.concat(a,a.visualViewport||[],mt(r)?r:[],l&&n?Tn(l):[])}return t.concat(r,Tn(r,[],n))}function Bo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const On=Math.min,mn=Math.max,Ht=Math.round,ot=Math.floor,Sn=e=>({x:e,y:e}),yl={left:"right",right:"left",bottom:"top",top:"bottom"},Cl={start:"end",end:"start"};function Ho(e,t,n){return mn(e,On(t,n))}function rt(e,t){return typeof e=="function"?e(t):e}function qn(e){return e.split("-")[0]}function it(e){return e.split("-")[1]}function ci(e){return e==="x"?"y":"x"}function Go(e){return e==="y"?"height":"width"}const xl=new Set(["top","bottom"]);function Nn(e){return xl.has(qn(e))?"y":"x"}function Wo(e){return ci(Nn(e))}function Sl(e,t,n){n===void 0&&(n=!1);const o=it(e),r=Wo(e),i=Go(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Gt(a)),[a,Gt(a)]}function $l(e){const t=Gt(e);return[Ko(e),t,Ko(t)]}function Ko(e){return e.replace(/start|end/g,t=>Cl[t])}const di=["left","right"],ui=["right","left"],kl=["top","bottom"],Il=["bottom","top"];function El(e,t,n){switch(e){case"top":case"bottom":return n?t?ui:di:t?di:ui;case"left":case"right":return t?kl:Il;default:return[]}}function Ml(e,t,n,o){const r=it(e);let i=El(qn(e),n==="start",o);return r&&(i=i.map(a=>a+"-"+r),t&&(i=i.concat(i.map(Ko)))),i}function Gt(e){return e.replace(/left|right|bottom|top/g,t=>yl[t])}function Nl(e){return{top:0,right:0,bottom:0,left:0,...e}}function fi(e){return typeof e!="number"?Nl(e):{top:e,right:e,bottom:e,left:e}}function Wt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}/*!
1
+ (function(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=" &times;",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 Fl=["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])"],Kt=Fl.join(","),_i=typeof Element>"u",st=_i?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ut=!_i&&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},vt=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),i=r===""||r==="true",a=i||n&&t&&vt(t.parentNode);return a},zl=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},gi=function(t,n,o){if(vt(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Kt));return n&&st.call(t,Kt)&&r.unshift(t),r=r.filter(o),r},Rt=function(t,n,o){for(var r=[],i=Array.from(t);i.length;){var a=i.shift();if(!vt(a,!1))if(a.tagName==="SLOT"){var l=a.assignedElements(),d=l.length?l:a.children,u=Rt(d,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else{var f=st.call(a,Kt);f&&o.filter(a)&&(n||!t.includes(a))&&r.push(a);var g=a.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(a),_=!vt(g,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(g&&_){var c=Rt(g===!0?a.children:g.children,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:a,candidates:c})}else i.unshift.apply(i,a.children)}}return r},pi=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},hi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||zl(t))&&!pi(t)?0:t.tabIndex},Al=function(t,n){var o=hi(t);return o<0&&n&&!pi(t)?0:o},Dl=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},mi=function(t){return t.tagName==="INPUT"},Ll=function(t){return mi(t)&&t.type==="hidden"},Pl=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Tl=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Ol=function(t){if(!t.name)return!0;var n=t.form||Ut(t),o=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var i=Tl(r,t.form);return!i||i===t},ql=function(t){return mi(t)&&t.type==="radio"},Vl=function(t){return ql(t)&&!Ol(t)},jl=function(t){var n,o=t&&Ut(t),r=(n=o)===null||n===void 0?void 0:n.host,i=!1;if(o&&o!==t){var a,l,d;for(i=!!((a=r)!==null&&a!==void 0&&(l=a.ownerDocument)!==null&&l!==void 0&&l.contains(r)||t!=null&&(d=t.ownerDocument)!==null&&d!==void 0&&d.contains(t));!i&&r;){var u,f,g;o=Ut(r),r=(u=o)===null||u===void 0?void 0:u.host,i=!!((f=r)!==null&&f!==void 0&&(g=f.ownerDocument)!==null&&g!==void 0&&g.contains(r))}}return i},vi=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},Bl=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(t).visibility==="hidden")return!0;var a=st.call(t,"details>summary:first-of-type"),l=a?t.parentElement:t;if(st.call(l,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var d=t;t;){var u=t.parentElement,f=Ut(t);if(u&&!u.shadowRoot&&r(u)===!0)return vi(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=d}if(jl(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return vi(t);return!1},Hl=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 st.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},Uo=function(t,n){return!(n.disabled||vt(n)||Ll(n)||Bl(n,t)||Pl(n)||Hl(n))},Ro=function(t,n){return!(Vl(n)||hi(n)<0||!Uo(t,n))},Gl=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},bi=function(t){var n=[],o=[];return t.forEach(function(r,i){var a=!!r.scopeParent,l=a?r.scopeParent:r,d=Al(l,a),u=a?bi(r.candidates):l;d===0?a?n.push.apply(n,u):n.push(l):o.push({documentOrder:i,tabIndex:d,item:r,isScope:a,content:u})}),o.sort(Dl).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(n)},Xt=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Rt([t],n.includeContainer,{filter:Ro.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Gl}):o=gi(t,n.includeContainer,Ro.bind(null,n)),bi(o)},Wl=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Rt([t],n.includeContainer,{filter:Uo.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=gi(t,n.includeContainer,Uo.bind(null,n)),o},wi=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return st.call(t,Kt)===!1?!1:Ro(n,t)};function yi(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Ci(){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 xi(){return/apple/i.test(navigator.vendor)}function Xo(){const e=/android/i;return e.test(yi())||e.test(Ci())}function Kl(){return yi().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Si(){return Ci().includes("jsdom/")}const $i="data-floating-ui-focusable",Ul="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Yo="ArrowLeft",Zo="ArrowRight",Rl="ArrowUp",Xl="ArrowDown";function $n(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 Qe(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&qt(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Fn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Jo(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 Yl(e){return e.matches("html,body")}function en(e){return e?.ownerDocument||document}function Qo(e){return We(e)&&e.matches(Ul)}function er(e){return e?e.getAttribute("role")==="combobox"&&Qo(e):!1}function Zl(e){if(!e||Si())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Yt(e){return e?e.hasAttribute($i)?e:e.querySelector("["+$i+"]")||e:null}function Rn(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var i;return r.parentId===t&&(!n||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...Rn(e,r.id,n)])}function Jl(e,t){let n,o=-1;function r(i,a){a>o&&(n=i,o=a),Rn(e,i).forEach(d=>{r(d.id,a+1)})}return r(t,0),e.find(i=>i.id===n)}function ki(e,t){var n;let o=[],r=(n=e.find(i=>i.id===t))==null?void 0:n.parentId;for(;r;){const i=e.find(a=>a.id===r);r=i?.parentId,i&&(o=o.concat(i))}return o}function nn(e){e.preventDefault(),e.stopPropagation()}function Ql(e){return"nativeEvent"in e}function Ii(e){return e.mozInputSource===0&&e.isTrusted?!0:Xo()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ei(e){return Si()?!1:!Xo()&&e.width===0&&e.height===0||Xo()&&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 bt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var ec=typeof document<"u",nc=function(){},Pe=ec?m.useLayoutEffect:nc;const tc={...E};function Je(e){const t=E.useRef(e);return Pe(()=>{t.current=e}),t}const oc=tc.useInsertionEffect||(e=>e());function Ke(e){const t=E.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return oc(()=>{t.current=e}),E.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 Zt(e,t,n){return Math.floor(e/t)!==n}function wt(e,t){return t<0||t>=e.current.length}function nr(e,t){return sn(e,{disabledIndices:t})}function Mi(e,t){return sn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function sn(e,t){let{startingIndex:n=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=t===void 0?{}:t,a=n;do a+=o?-i:i;while(a>=0&&a<=e.current.length-1&&Jt(e,a,r));return a}function rc(e,t){let{event:n,orientation:o,loop:r,rtl:i,cols:a,disabledIndices:l,minIndex:d,maxIndex:u,prevIndex:f,stopEvent:g=!1}=t,_=f;if(n.key===Rl){if(g&&nn(n),f===-1)_=u;else if(_=sn(e,{startingIndex:_,amount:a,decrement:!0,disabledIndices:l}),r&&(f-a<d||_<0)){const c=f%a,h=u%a,p=u-(h-c);h===c?_=u:_=h>c?p:p-a}wt(e,_)&&(_=f)}if(n.key===Xl&&(g&&nn(n),f===-1?_=d:(_=sn(e,{startingIndex:f,amount:a,disabledIndices:l}),r&&f+a>u&&(_=sn(e,{startingIndex:f%a-a,amount:a,disabledIndices:l}))),wt(e,_)&&(_=f)),o==="both"){const c=ot(f/a);n.key===(i?Yo:Zo)&&(g&&nn(n),f%a!==a-1?(_=sn(e,{startingIndex:f,disabledIndices:l}),r&&Zt(_,a,c)&&(_=sn(e,{startingIndex:f-f%a-1,disabledIndices:l}))):r&&(_=sn(e,{startingIndex:f-f%a-1,disabledIndices:l})),Zt(_,a,c)&&(_=f)),n.key===(i?Zo:Yo)&&(g&&nn(n),f%a!==0?(_=sn(e,{startingIndex:f,decrement:!0,disabledIndices:l}),r&&Zt(_,a,c)&&(_=sn(e,{startingIndex:f+(a-f%a),decrement:!0,disabledIndices:l}))):r&&(_=sn(e,{startingIndex:f+(a-f%a),decrement:!0,disabledIndices:l})),Zt(_,a,c)&&(_=f));const h=ot(u/a)===c;wt(e,_)&&(r&&h?_=n.key===(i?Zo:Yo)?u:sn(e,{startingIndex:f-f%a-1,disabledIndices:l}):_=f)}return _}function ic(e,t,n){const o=[];let r=0;return e.forEach((i,a)=>{let{width:l,height:d}=i;if(l>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+a+" is greater than grid columns");let u=!1;for(n&&(r=0);!u;){const f=[];for(let g=0;g<l;g++)for(let _=0;_<d;_++)f.push(r+g+_*t);r%t+l<=t&&f.every(g=>o[g]==null)?(f.forEach(g=>{o[g]=a}),u=!0):r++}}),[...o]}function sc(e,t,n,o,r){if(e===-1)return-1;const i=n.indexOf(e),a=t[e];switch(r){case"tl":return i;case"tr":return a?i+a.width-1:i;case"bl":return a?i+(a.height-1)*o:i;case"br":return n.lastIndexOf(e)}}function ac(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function Jt(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 yt=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Ni(e,t){const n=Xt(e,yt()),o=n.length;if(o===0)return;const r=$n(en(e)),i=n.indexOf(r),a=i===-1?t===1?0:o-1:i+t;return n[a]}function Fi(e){return Ni(en(e).body,1)||e}function zi(e){return Ni(en(e).body,-1)||e}function Ct(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!Qe(n,o)}function lc(e){Xt(e,yt()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Ai(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 Di(e,t,n){let{reference:o,floating:r}=e;const i=Nn(t),a=Wo(t),l=Go(a),d=qn(t),u=i==="y",f=o.x+o.width/2-r.width/2,g=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:g};break;case"left":c={x:o.x-r.width,y:g};break;default:c={x:o.x,y:o.y}}switch(it(t)){case"start":c[a]-=_*(n&&u?-1:1);break;case"end":c[a]+=_*(n&&u?-1:1);break}return c}const cc=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:g}=Di(u,o,d),_=o,c={},h=0;for(let p=0;p<l.length;p++){const{name:v,fn:w}=l[p],{x:C,y:x,data:k,reset:z}=await w({x:f,y:g,initialPlacement:o,placement:_,strategy:r,middlewareData:c,rects:u,platform:a,elements:{reference:e,floating:t}});f=C??f,g=x??g,c={...c,[v]:{...c[v],...k}},z&&h<=50&&(h++,typeof z=="object"&&(z.placement&&(_=z.placement),z.rects&&(u=z.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:r}):z.rects),{x:f,y:g}=Di(u,_,d)),p=-1)}return{x:f,y:g,placement:_,strategy:r,middlewareData:c}};async function tr(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:a,elements:l,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:g="floating",altBoundary:_=!1,padding:c=0}=rt(t,e),h=fi(c),v=l[_?g==="floating"?"reference":"floating":g],w=Wt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:f,strategy:d})),C=g==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),k=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},z=Wt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:x,strategy:d}):C);return{top:(w.top-z.top+h.top)/k.y,bottom:(z.bottom-w.bottom+h.bottom)/k.y,left:(w.left-z.left+h.left)/k.x,right:(z.right-w.right+h.right)/k.x}}const dc=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:a,elements:l,middlewareData:d}=t,{element:u,padding:f=0}=rt(e,t)||{};if(u==null)return{};const g=fi(f),_={x:n,y:o},c=Wo(r),h=Go(c),p=await a.getDimensions(u),v=c==="y",w=v?"top":"left",C=v?"bottom":"right",x=v?"clientHeight":"clientWidth",k=i.reference[h]+i.reference[c]-_[c]-i.floating[h],z=_[c]-i.reference[c],L=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let N=L?L[x]:0;(!N||!await(a.isElement==null?void 0:a.isElement(L)))&&(N=l.floating[x]||i.floating[h]);const P=k/2-z/2,A=N/2-p[h]/2-1,I=On(g[w],A),O=On(g[C],A),q=I,$=N-p[h]-O,b=N/2-p[h]/2+P,S=Ho(q,b,$),T=!d.arrow&&it(r)!=null&&b!==S&&i.reference[h]/2-(b<q?I:O)-p[h]/2<0,F=T?b<q?b-q:b-$:0;return{[c]:_[c]+F,data:{[c]:S,centerOffset:b-S-F,...T&&{alignmentOffset:F}},reset:T}}}),uc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:l,platform:d,elements:u}=t,{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:_,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...v}=rt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=qn(r),C=Nn(l),x=qn(l)===l,k=await(d.isRTL==null?void 0:d.isRTL(u.floating)),z=_||(x||!p?[Gt(l)]:$l(l)),L=h!=="none";!_&&L&&z.push(...Ml(l,p,h,k));const N=[l,...z],P=await tr(t,v),A=[];let I=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&A.push(P[w]),g){const b=Sl(r,a,k);A.push(P[b[0]],P[b[1]])}if(I=[...I,{placement:r,overflows:A}],!A.every(b=>b<=0)){var O,q;const b=(((O=i.flip)==null?void 0:O.index)||0)+1,S=N[b];if(S&&(!(g==="alignment"?C!==Nn(S):!1)||I.every(y=>Nn(y.placement)===C?y.overflows[0]>0:!0)))return{data:{index:b,overflows:I},reset:{placement:S}};let T=(q=I.filter(F=>F.overflows[0]<=0).sort((F,y)=>F.overflows[1]-y.overflows[1])[0])==null?void 0:q.placement;if(!T)switch(c){case"bestFit":{var $;const F=($=I.filter(y=>{if(L){const M=Nn(y.placement);return M===C||M==="y"}return!0}).map(y=>[y.placement,y.overflows.filter(M=>M>0).reduce((M,D)=>M+D,0)]).sort((y,M)=>y[1]-M[1])[0])==null?void 0:$[0];F&&(T=F);break}case"initialPlacement":T=l;break}if(r!==T)return{reset:{placement:T}}}return{}}}},fc=new Set(["left","top"]);async function _c(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=qn(n),l=it(n),d=Nn(n)==="y",u=fc.has(a)?-1:1,f=i&&d?-1:1,g=rt(t,e);let{mainAxis:_,crossAxis:c,alignmentAxis:h}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof h=="number"&&(c=l==="end"?h*-1:h),d?{x:c*f,y:_*u}:{x:_*u,y:c*f}}const gc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:a,middlewareData:l}=t,d=await _c(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+d.x,y:i+d.y,data:{...d,placement:a}}}}},pc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:w,y:C}=v;return{x:w,y:C}}},...d}=rt(e,t),u={x:n,y:o},f=await tr(t,d),g=Nn(qn(r)),_=ci(g);let c=u[_],h=u[g];if(i){const v=_==="y"?"top":"left",w=_==="y"?"bottom":"right",C=c+f[v],x=c-f[w];c=Ho(C,c,x)}if(a){const v=g==="y"?"top":"left",w=g==="y"?"bottom":"right",C=h+f[v],x=h-f[w];h=Ho(C,h,x)}const p=l.fn({...t,[_]:c,[g]:h});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[_]:i,[g]:a}}}}}},hc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:a,elements:l}=t,{apply:d=()=>{},...u}=rt(e,t),f=await tr(t,u),g=qn(r),_=it(r),c=Nn(r)==="y",{width:h,height:p}=i.floating;let v,w;g==="top"||g==="bottom"?(v=g,w=_===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(w=g,v=_==="end"?"top":"bottom");const C=p-f.top-f.bottom,x=h-f.left-f.right,k=On(p-f[v],C),z=On(h-f[w],x),L=!t.middlewareData.shift;let N=k,P=z;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(N=C),L&&!_){const I=mn(f.left,0),O=mn(f.right,0),q=mn(f.top,0),$=mn(f.bottom,0);c?P=h-2*(I!==0||O!==0?I+O:mn(f.left,f.right)):N=p-2*(q!==0||$!==0?q+$:mn(f.top,f.bottom))}await d({...t,availableWidth:P,availableHeight:N});const A=await a.getDimensions(l.floating);return h!==A.width||p!==A.height?{reset:{rects:!0}}:{}}}};function Li(e){const t=hn(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=We(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:o,l=Ht(n)!==i||Ht(o)!==a;return l&&(n=i,o=a),{width:n,height:o,$:l}}function or(e){return Le(e)?e:e.contextElement}function at(e){const t=or(e);if(!We(t))return Sn(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Li(t);let a=(i?Ht(n.width):n.width)/o,l=(i?Ht(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const mc=Sn(0);function Pi(e){const t=gn(e);return!jt()||!t.visualViewport?mc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==gn(e)?!1:t}function Xn(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=or(e);let a=Sn(1);t&&(o?Le(o)&&(a=at(o)):a=at(e));const l=vc(i,n,o)?Pi(i):Sn(0);let d=(r.left+l.x)/a.x,u=(r.top+l.y)/a.y,f=r.width/a.x,g=r.height/a.y;if(i){const _=gn(i),c=o&&Le(o)?gn(o):o;let h=_,p=Bo(h);for(;p&&o&&c!==h;){const v=at(p),w=p.getBoundingClientRect(),C=hn(p),x=w.left+(p.clientLeft+parseFloat(C.paddingLeft))*v.x,k=w.top+(p.clientTop+parseFloat(C.paddingTop))*v.y;d*=v.x,u*=v.y,f*=v.x,g*=v.y,d+=x,u+=k,h=gn(p),p=Bo(h)}}return Wt({width:f,height:g,x:d,y:u})}function Qt(e,t){const n=Bt(e).scrollLeft;return t?t.left+n:Xn(xn(e)).left+n}function Ti(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Qt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function bc(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",a=xn(o),l=t?Vt(t.floating):!1;if(o===a||l&&i)return n;let d={scrollLeft:0,scrollTop:0},u=Sn(1);const f=Sn(0),g=We(o);if((g||!g&&!i)&&((Pn(o)!=="body"||mt(a))&&(d=Bt(o)),We(o))){const c=Xn(o);u=at(o),f.x=c.x+o.clientLeft,f.y=c.y+o.clientTop}const _=a&&!g&&!i?Ti(a,d):Sn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-d.scrollLeft*u.x+f.x+_.x,y:n.y*u.y-d.scrollTop*u.y+f.y+_.y}}function wc(e){return Array.from(e.getClientRects())}function yc(e){const t=xn(e),n=Bt(e),o=e.ownerDocument.body,r=mn(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=mn(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+Qt(e);const l=-n.scrollTop;return hn(o).direction==="rtl"&&(a+=mn(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:a,y:l}}const Oi=25;function Cc(e,t){const n=gn(e),o=xn(e),r=n.visualViewport;let i=o.clientWidth,a=o.clientHeight,l=0,d=0;if(r){i=r.width,a=r.height;const f=jt();(!f||f&&t==="fixed")&&(l=r.offsetLeft,d=r.offsetTop)}const u=Qt(o);if(u<=0){const f=o.ownerDocument,g=f.body,_=getComputedStyle(g),c=f.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,h=Math.abs(o.clientWidth-g.clientWidth-c);h<=Oi&&(i-=h)}else u<=Oi&&(i+=u);return{width:i,height:a,x:l,y:d}}const xc=new Set(["absolute","fixed"]);function Sc(e,t){const n=Xn(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=We(e)?at(e):Sn(1),a=e.clientWidth*i.x,l=e.clientHeight*i.y,d=r*i.x,u=o*i.y;return{width:a,height:l,x:d,y:u}}function qi(e,t,n){let o;if(t==="viewport")o=Cc(e,n);else if(t==="document")o=yc(xn(e));else if(Le(t))o=Sc(t,n);else{const r=Pi(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Wt(o)}function Vi(e,t){const n=Mn(e);return n===t||!Le(n)||En(n)?!1:hn(n).position==="fixed"||Vi(n,t)}function $c(e,t){const n=t.get(e);if(n)return n;let o=Tn(e,[],!1).filter(l=>Le(l)&&Pn(l)!=="body"),r=null;const i=hn(e).position==="fixed";let a=i?Mn(e):e;for(;Le(a)&&!En(a);){const l=hn(a),d=jo(a);!d&&l.position==="fixed"&&(r=null),(i?!d&&!r:!d&&l.position==="static"&&!!r&&xc.has(r.position)||mt(a)&&!d&&Vi(e,a))?o=o.filter(f=>f!==a):r=l,a=Mn(a)}return t.set(e,o),o}function kc(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?Vt(t)?[]:$c(t,this._c):[].concat(n),o],l=a[0],d=a.reduce((u,f)=>{const g=qi(t,f,r);return u.top=mn(g.top,u.top),u.right=On(g.right,u.right),u.bottom=On(g.bottom,u.bottom),u.left=mn(g.left,u.left),u},qi(t,l,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Ic(e){const{width:t,height:n}=Li(e);return{width:t,height:n}}function Ec(e,t,n){const o=We(t),r=xn(t),i=n==="fixed",a=Xn(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const d=Sn(0);function u(){d.x=Qt(r)}if(o||!o&&!i)if((Pn(t)!=="body"||mt(r))&&(l=Bt(t)),o){const c=Xn(t,!0,i,t);d.x=c.x+t.clientLeft,d.y=c.y+t.clientTop}else r&&u();i&&!o&&r&&u();const f=r&&!o&&!i?Ti(r,l):Sn(0),g=a.left+l.scrollLeft-d.x-f.x,_=a.top+l.scrollTop-d.y-f.y;return{x:g,y:_,width:a.width,height:a.height}}function rr(e){return hn(e).position==="static"}function ji(e,t){if(!We(e)||hn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xn(e)===n&&(n=n.ownerDocument.body),n}function Bi(e,t){const n=gn(e);if(Vt(e))return n;if(!We(e)){let r=Mn(e);for(;r&&!En(r);){if(Le(r)&&!rr(r))return r;r=Mn(r)}return n}let o=ji(e,t);for(;o&&gl(o)&&rr(o);)o=ji(o,t);return o&&En(o)&&rr(o)&&!jo(o)?n:o||bl(e)||n}const Mc=async function(e){const t=this.getOffsetParent||Bi,n=this.getDimensions,o=await n(e.floating);return{reference:Ec(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Nc(e){return hn(e).direction==="rtl"}const Fc={convertOffsetParentRelativeRectToViewportRelativeRect:bc,getDocumentElement:xn,getClippingRect:kc,getOffsetParent:Bi,getElementRects:Mc,getClientRects:wc,getDimensions:Ic,getScale:at,isElement:Le,isRTL:Nc};function Hi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zc(e,t){let n=null,o;const r=xn(e);function i(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function a(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),i();const u=e.getBoundingClientRect(),{left:f,top:g,width:_,height:c}=u;if(l||t(),!_||!c)return;const h=ot(g),p=ot(r.clientWidth-(f+_)),v=ot(r.clientHeight-(g+c)),w=ot(f),x={rootMargin:-h+"px "+-p+"px "+-v+"px "+-w+"px",threshold:mn(0,On(1,d))||1};let k=!0;function z(L){const N=L[0].intersectionRatio;if(N!==d){if(!k)return a();N?a(!1,N):o=setTimeout(()=>{a(!1,1e-7)},1e3)}N===1&&!Hi(u,e.getBoundingClientRect())&&a(),k=!1}try{n=new IntersectionObserver(z,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(z,x)}n.observe(e)}return a(!0),i}function eo(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,u=or(e),f=r||i?[...u?Tn(u):[],...Tn(t)]:[];f.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const g=u&&l?zc(u,n):null;let _=-1,c=null;a&&(c=new ResizeObserver(w=>{let[C]=w;C&&C.target===u&&c&&(c.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var x;(x=c)==null||x.observe(t)})),n()}),u&&!d&&c.observe(u),c.observe(t));let h,p=d?Xn(e):null;d&&v();function v(){const w=Xn(e);p&&!Hi(p,w)&&n(),p=w,h=requestAnimationFrame(v)}return n(),()=>{var w;f.forEach(C=>{r&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),g?.(),(w=c)==null||w.disconnect(),c=null,d&&cancelAnimationFrame(h)}}const Ac=gc,Dc=pc,Lc=uc,Pc=hc,Gi=dc,Tc=(e,t,n)=>{const o=new Map,r={platform:Fc,...n},i={...r.platform,_c:o};return cc(e,t,{...r,platform:i})};var Oc=typeof document<"u",qc=function(){},no=Oc?m.useLayoutEffect:qc;function to(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(!to(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!to(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Wi(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ki(e,t){const n=Wi(e);return Math.round(t*n)/n}function ir(e){const t=E.useRef(e);return no(()=>{t.current=e}),t}function Vc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:d,open:u}=e,[f,g]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[_,c]=E.useState(o);to(_,o)||c(o);const[h,p]=E.useState(null),[v,w]=E.useState(null),C=E.useCallback(y=>{y!==L.current&&(L.current=y,p(y))},[]),x=E.useCallback(y=>{y!==N.current&&(N.current=y,w(y))},[]),k=i||h,z=a||v,L=E.useRef(null),N=E.useRef(null),P=E.useRef(f),A=d!=null,I=ir(d),O=ir(r),q=ir(u),$=E.useCallback(()=>{if(!L.current||!N.current)return;const y={placement:t,strategy:n,middleware:_};O.current&&(y.platform=O.current),Tc(L.current,N.current,y).then(M=>{const D={...M,isPositioned:q.current!==!1};b.current&&!to(P.current,D)&&(P.current=D,Do.flushSync(()=>{g(D)}))})},[_,t,n,O,q]);no(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g(y=>({...y,isPositioned:!1})))},[u]);const b=E.useRef(!1);no(()=>(b.current=!0,()=>{b.current=!1}),[]),no(()=>{if(k&&(L.current=k),z&&(N.current=z),k&&z){if(I.current)return I.current(k,z,$);$()}},[k,z,$,I,A]);const S=E.useMemo(()=>({reference:L,floating:N,setReference:C,setFloating:x}),[C,x]),T=E.useMemo(()=>({reference:k,floating:z}),[k,z]),F=E.useMemo(()=>{const y={position:n,left:0,top:0};if(!T.floating)return y;const M=Ki(T.floating,f.x),D=Ki(T.floating,f.y);return l?{...y,transform:"translate("+M+"px, "+D+"px)",...Wi(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:D}},[n,l,T.floating,f.x,f.y]);return E.useMemo(()=>({...f,update:$,refs:S,elements:T,floatingStyles:F}),[f,$,S,T,F])}const jc=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?Gi({element:o.current,padding:r}).fn(n):{}:o?Gi({element:o,padding:r}).fn(n):{}}}},oo=(e,t)=>({...Ac(e),options:[e,t]}),ro=(e,t)=>({...Dc(e),options:[e,t]}),io=(e,t)=>({...Lc(e),options:[e,t]}),Ui=(e,t)=>({...Pc(e),options:[e,t]}),Bc=(e,t)=>({...jc(e),options:[e,t]});function Ri(e){const t=E.useRef(void 0),n=E.useCallback(o=>{const r=e.map(i=>{if(i!=null){if(typeof i=="function"){const a=i,l=a(o);return typeof l=="function"?l:()=>{a(null)}}return i.current=o,()=>{i.current=null}}});return()=>{r.forEach(i=>i?.())}},e);return E.useMemo(()=>e.every(o=>o==null)?null:o=>{t.current&&(t.current(),t.current=void 0),o!=null&&(t.current=n(o))},e)}const Hc="data-floating-ui-focusable",Xi="active",Yi="selected",xt="ArrowLeft",St="ArrowRight",Zi="ArrowUp",so="ArrowDown",Gc={...E};let Ji=!1,Wc=0;const Qi=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Wc++;function Kc(){const[e,t]=E.useState(()=>Ji?Qi():void 0);return Pe(()=>{e==null&&t(Qi())},[]),E.useEffect(()=>{Ji=!0},[]),e}const $t=Gc.useId||Kc;let kt;process.env.NODE_ENV!=="production"&&(kt=new Set);function ao(){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=kt)!=null&&e.has(r))){var i;(i=kt)==null||i.add(r),console.warn(r)}}function Uc(){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=kt)!=null&&e.has(r))){var i;(i=kt)==null||i.add(r),console.error(r)}}const Rc=E.forwardRef(function(t,n){const{context:{placement:o,elements:{floating:r},middlewareData:{arrow:i,shift:a}},width:l=14,height:d=7,tipRadius:u=0,strokeWidth:f=0,staticOffset:g,stroke:_,d:c,style:{transform:h,...p}={},...v}=t;process.env.NODE_ENV!=="production"&&(n||ao("The `ref` prop is required for `FloatingArrow`."));const w=$t(),[C,x]=E.useState(!1);if(Pe(()=>{if(!r)return;hn(r).direction==="rtl"&&x(!0)},[r]),!r)return null;const[k,z]=o.split("-"),L=k==="top"||k==="bottom";let N=g;(L&&a!=null&&a.x||!L&&a!=null&&a.y)&&(N=null);const P=f*2,A=P/2,I=l/2*(u/-8+1),O=d/2*u/4,q=!!c,$=N&&z==="end"?"bottom":"top";let b=N&&z==="end"?"right":"left";N&&C&&(b=z==="end"?"left":"right");const S=i?.x!=null?N||i.x:"",T=i?.y!=null?N||i.y:"",F=c||"M0,0"+(" H"+l)+(" L"+(l-I)+","+(d-O))+(" Q"+l/2+","+d+" "+I+","+(d-O))+" Z",y={top:q?"rotate(180deg)":"",left:q?"rotate(90deg)":"rotate(-90deg)",bottom:q?"":"rotate(180deg)",right:q?"rotate(-90deg)":"rotate(90deg)"}[k];return s.jsxs("svg",{...v,"aria-hidden":!0,ref:n,width:q?l:l+P,height:l,viewBox:"0 0 "+l+" "+(d>l?d:l),style:{position:"absolute",pointerEvents:"none",[b]:S,[$]:T,[k]:L||q?"100%":"calc(100% - "+P/2+"px)",transform:[y,h].filter(M=>!!M).join(" "),...p},children:[P>0&&s.jsx("path",{clipPath:"url(#"+w+")",fill:"none",stroke:_,strokeWidth:P+(c?0:1),d:F}),s.jsx("path",{stroke:P&&!c?v.fill:"none",d:F}),s.jsx("clipPath",{id:w,children:s.jsx("rect",{x:-A,y:A*(q?-1:1),width:l+P,height:l})})]})});function es(){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 ns=E.createContext(null),ts=E.createContext(null),lt=()=>{var e;return((e=E.useContext(ns))==null?void 0:e.id)||null},Yn=()=>E.useContext(ts);function os(e){const t=$t(),n=Yn(),r=lt();return Pe(()=>{if(!t)return;const i={id:t,parentId:r};return n?.addNode(i),()=>{n?.removeNode(i)}},[n,t,r]),t}function rs(e){const{children:t,id:n}=e,o=lt();return s.jsx(ns.Provider,{value:E.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function Xc(e){const{children:t}=e,n=E.useRef([]),o=E.useCallback(a=>{n.current=[...n.current,a]},[]),r=E.useCallback(a=>{n.current=n.current.filter(l=>l!==a)},[]),[i]=E.useState(()=>es());return s.jsx(ts.Provider,{value:E.useMemo(()=>({nodesRef:n,addNode:o,removeNode:r,events:i}),[o,r,i]),children:t})}function Zn(e){return"data-floating-ui-"+e}function tn(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const is=Zn("safe-polygon");function sr(e,t,n){if(n&&!bt(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 ar(e){return typeof e=="function"?e():e}function lr(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,events:i,elements:a}=e,{enabled:l=!0,delay:d=0,handleClose:u=null,mouseOnly:f=!1,restMs:g=0,move:_=!0}=t,c=Yn(),h=lt(),p=Je(u),v=Je(d),w=Je(n),C=Je(g),x=E.useRef(),k=E.useRef(-1),z=E.useRef(),L=E.useRef(-1),N=E.useRef(!0),P=E.useRef(!1),A=E.useRef(()=>{}),I=E.useRef(!1),O=Ke(()=>{var F;const y=(F=r.current.openEvent)==null?void 0:F.type;return y?.includes("mouse")&&y!=="mousedown"});E.useEffect(()=>{if(!l)return;function F(y){let{open:M}=y;M||(tn(k),tn(L),N.current=!0,I.current=!1)}return i.on("openchange",F),()=>{i.off("openchange",F)}},[l,i]),E.useEffect(()=>{if(!l||!p.current||!n)return;function F(M){O()&&o(!1,M,"hover")}const y=en(a.floating).documentElement;return y.addEventListener("mouseleave",F),()=>{y.removeEventListener("mouseleave",F)}},[a.floating,n,o,l,p,O]);const q=E.useCallback(function(F,y,M){y===void 0&&(y=!0),M===void 0&&(M="hover");const D=sr(v.current,"close",x.current);D&&!z.current?(tn(k),k.current=window.setTimeout(()=>o(!1,F,M),D)):y&&(tn(k),o(!1,F,M))},[v,o]),$=Ke(()=>{A.current(),z.current=void 0}),b=Ke(()=>{if(P.current){const F=en(a.floating).body;F.style.pointerEvents="",F.removeAttribute(is),P.current=!1}}),S=Ke(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);E.useEffect(()=>{if(!l)return;function F(G){if(tn(k),N.current=!1,f&&!bt(x.current)||ar(C.current)>0&&!sr(v.current,"open"))return;const V=sr(v.current,"open",x.current);V?k.current=window.setTimeout(()=>{w.current||o(!0,G,"hover")},V):n||o(!0,G,"hover")}function y(G){if(S()){b();return}A.current();const V=en(a.floating);if(tn(L),I.current=!1,p.current&&r.current.floatingContext){n||tn(k),z.current=p.current({...r.current.floatingContext,tree:c,x:G.clientX,y:G.clientY,onClose(){b(),$(),S()||q(G,!0,"safe-polygon")}});const U=z.current;V.addEventListener("mousemove",U),A.current=()=>{V.removeEventListener("mousemove",U)};return}(x.current==="touch"?!Qe(a.floating,G.relatedTarget):!0)&&q(G)}function M(G){S()||r.current.floatingContext&&(p.current==null||p.current({...r.current.floatingContext,tree:c,x:G.clientX,y:G.clientY,onClose(){b(),$(),S()||q(G)}})(G))}function D(){tn(k)}function B(G){S()||q(G,!1)}if(Le(a.domReference)){const G=a.domReference,V=a.floating;return n&&G.addEventListener("mouseleave",M),_&&G.addEventListener("mousemove",F,{once:!0}),G.addEventListener("mouseenter",F),G.addEventListener("mouseleave",y),V&&(V.addEventListener("mouseleave",M),V.addEventListener("mouseenter",D),V.addEventListener("mouseleave",B)),()=>{n&&G.removeEventListener("mouseleave",M),_&&G.removeEventListener("mousemove",F),G.removeEventListener("mouseenter",F),G.removeEventListener("mouseleave",y),V&&(V.removeEventListener("mouseleave",M),V.removeEventListener("mouseenter",D),V.removeEventListener("mouseleave",B))}}},[a,l,e,f,_,q,$,b,o,n,w,c,v,p,r,S,C]),Pe(()=>{var F;if(l&&n&&(F=p.current)!=null&&(F=F.__options)!=null&&F.blockPointerEvents&&O()){P.current=!0;const M=a.floating;if(Le(a.domReference)&&M){var y;const D=en(a.floating).body;D.setAttribute(is,"");const B=a.domReference,G=c==null||(y=c.nodesRef.current.find(V=>V.id===h))==null||(y=y.context)==null?void 0:y.elements.floating;return G&&(G.style.pointerEvents=""),D.style.pointerEvents="none",B.style.pointerEvents="auto",M.style.pointerEvents="auto",()=>{D.style.pointerEvents="",B.style.pointerEvents="",M.style.pointerEvents=""}}}},[l,n,h,a,c,p,O]),Pe(()=>{n||(x.current=void 0,I.current=!1,$(),b())},[n,$,b]),E.useEffect(()=>()=>{$(),tn(k),tn(L),b()},[l,a.domReference,$,b]);const T=E.useMemo(()=>{function F(y){x.current=y.pointerType}return{onPointerDown:F,onPointerEnter:F,onMouseMove(y){const{nativeEvent:M}=y;function D(){!N.current&&!w.current&&o(!0,M,"hover")}f&&!bt(x.current)||n||ar(C.current)===0||I.current&&y.movementX**2+y.movementY**2<2||(tn(L),x.current==="touch"?D():(I.current=!0,L.current=window.setTimeout(D,ar(C.current))))}}},[f,o,n,w,C]);return E.useMemo(()=>l?{reference:T}:{},[l,T])}let ss=0;function Jn(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(ss);const i=()=>e?.focus({preventScroll:n});r?i():ss=requestAnimationFrame(i)}function cr(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&qt(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Yc(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Zc(e){return e?.ownerDocument||document}const ct={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function as(e){return e==="inert"?ct.inert:e==="aria-hidden"?ct["aria-hidden"]:ct.none}let lo=new WeakSet,co={},dr=0;const Jc=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,ls=e=>e&&(e.host||ls(e.parentNode)),Qc=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=ls(n);return e.contains(o)?o:null}).filter(n=>n!=null);function ed(e,t,n,o){const r="data-floating-ui-inert",i=o?"inert":n?"aria-hidden":null,a=Qc(t,e),l=new Set,d=new Set(a),u=[];co[r]||(co[r]=new WeakMap);const f=co[r];a.forEach(g),_(t),l.clear();function g(c){!c||l.has(c)||(l.add(c),c.parentNode&&g(c.parentNode))}function _(c){!c||d.has(c)||[].forEach.call(c.children,h=>{if(Pn(h)!=="script")if(l.has(h))_(h);else{const p=i?h.getAttribute(i):null,v=p!==null&&p!=="false",w=as(i),C=(w.get(h)||0)+1,x=(f.get(h)||0)+1;w.set(h,C),f.set(h,x),u.push(h),C===1&&v&&lo.add(h),x===1&&h.setAttribute(r,""),!v&&i&&h.setAttribute(i,i==="inert"?"":"true")}})}return dr++,()=>{u.forEach(c=>{const h=as(i),v=(h.get(c)||0)-1,w=(f.get(c)||0)-1;h.set(c,v),f.set(c,w),v||(!lo.has(c)&&i&&c.removeAttribute(i),lo.delete(c)),w||c.removeAttribute(r)}),dr--,dr||(ct.inert=new WeakMap,ct["aria-hidden"]=new WeakMap,ct.none=new WeakMap,lo=new WeakSet,co={})}}function cs(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=Zc(e[0]).body;return ed(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},fo=E.forwardRef(function(t,n){const[o,r]=E.useState();Pe(()=>{xi()&&r("button")},[]);const i={ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[Zn("focus-guard")]:"",style:uo};return s.jsx("span",{...t,...i})}),ds=E.createContext(null),us=Zn("portal");function nd(e){e===void 0&&(e={});const{id:t,root:n}=e,o=$t(),r=fs(),[i,a]=E.useState(null),l=E.useRef(null);return Pe(()=>()=>{i?.remove(),queueMicrotask(()=>{l.current=null})},[i]),Pe(()=>{if(!o||l.current)return;const d=t?document.getElementById(t):null;if(!d)return;const u=document.createElement("div");u.id=o,u.setAttribute(us,""),d.appendChild(u),l.current=u,a(u)},[t,o]),Pe(()=>{if(n===null||!o||l.current)return;let d=n||r?.portalNode;d&&!Vo(d)&&(d=d.current),d=d||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,d.appendChild(u));const f=document.createElement("div");f.id=o,f.setAttribute(us,""),d=u||d,d.appendChild(f),l.current=f,a(f)},[t,n,o,r]),i}function _o(e){const{children:t,id:n,root:o,preserveTabOrder:r=!0}=e,i=nd({id:n,root:o}),[a,l]=E.useState(null),d=E.useRef(null),u=E.useRef(null),f=E.useRef(null),g=E.useRef(null),_=a?.modal,c=a?.open,h=!!a&&!a.modal&&a.open&&r&&!!(o||i);return E.useEffect(()=>{if(!i||!r||_)return;function p(v){i&&Ct(v)&&(v.type==="focusin"?Ai:lc)(i)}return i.addEventListener("focusin",p,!0),i.addEventListener("focusout",p,!0),()=>{i.removeEventListener("focusin",p,!0),i.removeEventListener("focusout",p,!0)}},[i,r,_]),E.useEffect(()=>{i&&(c||Ai(i))},[c,i]),s.jsxs(ds.Provider,{value:E.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:d,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:g,portalNode:i,setFocusManagerState:l}),[r,i]),children:[h&&i&&s.jsx(fo,{"data-type":"outside",ref:d,onFocus:p=>{if(Ct(p,i)){var v;(v=f.current)==null||v.focus()}else{const w=a?a.domReference:null,C=zi(w);C?.focus()}}}),h&&i&&s.jsx("span",{"aria-owns":i.id,style:uo}),i&&Do.createPortal(t,i),h&&i&&s.jsx(fo,{"data-type":"outside",ref:u,onFocus:p=>{if(Ct(p,i)){var v;(v=g.current)==null||v.focus()}else{const w=a?a.domReference:null,C=Fi(w);C?.focus(),a?.closeOnFocusOut&&a?.onOpenChange(!1,p.nativeEvent,"focus-out")}}})]})}const fs=()=>E.useContext(ds);function _s(e){return E.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const td=20;let Vn=[];function ur(){Vn=Vn.filter(e=>e.isConnected)}function od(e){ur(),e&&Pn(e)!=="body"&&(Vn.push(e),Vn.length>td&&(Vn=Vn.slice(-20)))}function gs(){return ur(),Vn[Vn.length-1]}function rd(e){const t=yt();return wi(e,t)?e:Xt(e,t)[0]||e}function ps(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const o=yt(),i=Wl(e,o).filter(l=>{const d=l.getAttribute("data-tabindex")||"";return wi(l,o)||l.hasAttribute("data-tabindex")&&!d.startsWith("-")}),a=e.getAttribute("tabindex");t.current.includes("floating")||i.length===0?a!=="0"&&e.setAttribute("tabindex","0"):(a!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const id=E.forwardRef(function(t,n){return s.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:uo})});function fr(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:a=0,returnFocus:l=!0,restoreFocus:d=!1,modal:u=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:g=!0,outsideElementsInert:_=!1,getInsideElements:c=()=>[]}=e,{open:h,onOpenChange:p,events:v,dataRef:w,elements:{domReference:C,floating:x}}=t,k=Ke(()=>{var R;return(R=w.current.floatingContext)==null?void 0:R.nodeId}),z=Ke(c),L=typeof a=="number"&&a<0,N=er(C)&&L,P=Jc(),A=P?i:!0,I=!A||P&&_,O=Je(r),q=Je(a),$=Je(l),b=Yn(),S=fs(),T=E.useRef(null),F=E.useRef(null),y=E.useRef(!1),M=E.useRef(!1),D=E.useRef(-1),B=E.useRef(-1),G=S!=null,V=Yt(x),J=Ke(function(R){return R===void 0&&(R=V),R?Xt(R,yt()):[]}),U=Ke(R=>{const te=J(R);return O.current.map(oe=>C&&oe==="reference"?C:V&&oe==="floating"?V:te).filter(Boolean).flat()});E.useEffect(()=>{if(o||!u)return;function R(oe){if(oe.key==="Tab"){Qe(V,$n(en(V)))&&J().length===0&&!N&&nn(oe);const ae=U(),ve=Fn(oe);O.current[0]==="reference"&&ve===C&&(nn(oe),oe.shiftKey?Jn(ae[ae.length-1]):Jn(ae[1])),O.current[1]==="floating"&&ve===V&&oe.shiftKey&&(nn(oe),Jn(ae[0]))}}const te=en(V);return te.addEventListener("keydown",R),()=>{te.removeEventListener("keydown",R)}},[o,C,V,u,O,N,J,U]),E.useEffect(()=>{if(o||!x)return;function R(te){const oe=Fn(te),ve=J().indexOf(oe);ve!==-1&&(D.current=ve)}return x.addEventListener("focusin",R),()=>{x.removeEventListener("focusin",R)}},[o,x,J]),E.useEffect(()=>{if(o||!g)return;function R(){M.current=!0,setTimeout(()=>{M.current=!1})}function te(ve){const ee=ve.relatedTarget,we=ve.currentTarget,Se=Fn(ve);queueMicrotask(()=>{const le=k(),ye=!(Qe(C,ee)||Qe(x,ee)||Qe(ee,x)||Qe(S?.portalNode,ee)||ee!=null&&ee.hasAttribute(Zn("focus-guard"))||b&&(Rn(b.nodesRef.current,le).find(W=>{var j,H;return Qe((j=W.context)==null?void 0:j.elements.floating,ee)||Qe((H=W.context)==null?void 0:H.elements.domReference,ee)})||ki(b.nodesRef.current,le).find(W=>{var j,H,me;return[(j=W.context)==null?void 0:j.elements.floating,Yt((H=W.context)==null?void 0:H.elements.floating)].includes(ee)||((me=W.context)==null?void 0:me.elements.domReference)===ee})));if(we===C&&V&&ps(V,O),d&&we!==C&&!(Se!=null&&Se.isConnected)&&$n(en(V))===en(V).body){We(V)&&V.focus();const W=D.current,j=J(),H=j[W]||j[j.length-1]||V;We(H)&&H.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(N||!u)&&ee&&ye&&!M.current&&ee!==gs()&&(y.current=!0,p(!1,ve,"focus-out"))})}const oe=!!(!b&&S);function ae(){tn(B),w.current.insideReactTree=!0,B.current=window.setTimeout(()=>{w.current.insideReactTree=!1})}if(x&&We(C))return C.addEventListener("focusout",te),C.addEventListener("pointerdown",R),x.addEventListener("focusout",te),oe&&x.addEventListener("focusout",ae,!0),()=>{C.removeEventListener("focusout",te),C.removeEventListener("pointerdown",R),x.removeEventListener("focusout",te),oe&&x.removeEventListener("focusout",ae,!0)}},[o,C,x,V,u,b,S,p,g,d,J,N,k,O,w]);const pe=E.useRef(null),ue=E.useRef(null),se=_s([pe,S?.beforeInsideRef]),he=_s([ue,S?.afterInsideRef]);E.useEffect(()=>{var R,te;if(o||!x)return;const oe=Array.from((S==null||(R=S.portalNode)==null?void 0:R.querySelectorAll("["+Zn("portal")+"]"))||[]),ve=(te=(b?ki(b.nodesRef.current,k()):[]).find(Se=>{var le;return er(((le=Se.context)==null?void 0:le.elements.domReference)||null)}))==null||(te=te.context)==null?void 0:te.elements.domReference,ee=[x,ve,...oe,...z(),T.current,F.current,pe.current,ue.current,S?.beforeOutsideRef.current,S?.afterOutsideRef.current,O.current.includes("reference")||N?C:null].filter(Se=>Se!=null),we=u||N?cs(ee,!I,I):cs(ee);return()=>{we()}},[o,C,x,u,O,S,N,A,I,b,k,z]),Pe(()=>{if(o||!We(V))return;const R=en(V),te=$n(R);queueMicrotask(()=>{const oe=U(V),ae=q.current,ve=(typeof ae=="number"?oe[ae]:ae.current)||V,ee=Qe(V,te);!L&&!ee&&h&&Jn(ve,{preventScroll:ve===V})})},[o,h,V,L,U,q]),Pe(()=>{if(o||!V)return;const R=en(V),te=$n(R);od(te);function oe(ee){let{reason:we,event:Se,nested:le}=ee;if(["hover","safe-polygon"].includes(we)&&Se.type==="mouseleave"&&(y.current=!0),we==="outside-press")if(le)y.current=!1;else if(Ii(Se)||Ei(Se))y.current=!1;else{let ye=!1;document.createElement("div").focus({get preventScroll(){return ye=!0,!1}}),ye?y.current=!1:y.current=!0}}v.on("openchange",oe);const ae=R.createElement("span");ae.setAttribute("tabindex","-1"),ae.setAttribute("aria-hidden","true"),Object.assign(ae.style,uo),G&&C&&C.insertAdjacentElement("afterend",ae);function ve(){if(typeof $.current=="boolean"){const ee=C||gs();return ee&&ee.isConnected?ee:ae}return $.current.current||ae}return()=>{v.off("openchange",oe);const ee=$n(R),we=Qe(x,ee)||b&&Rn(b.nodesRef.current,k(),!1).some(le=>{var ye;return Qe((ye=le.context)==null?void 0:ye.elements.floating,ee)}),Se=ve();queueMicrotask(()=>{const le=rd(Se);$.current&&!y.current&&We(le)&&(!(le!==ee&&ee!==R.body)||we)&&le.focus({preventScroll:!0}),ae.remove()})}},[o,x,V,$,w,v,b,G,C,k]),E.useEffect(()=>(queueMicrotask(()=>{y.current=!1}),()=>{queueMicrotask(ur)}),[o]),Pe(()=>{if(!o&&S)return S.setFocusManagerState({modal:u,closeOnFocusOut:g,open:h,onOpenChange:p,domReference:C}),()=>{S.setFocusManagerState(null)}},[o,S,u,h,p,g,C]),Pe(()=>{o||V&&ps(V,O)},[o,V,O]);function fe(R){return o||!f||!u?null:s.jsx(id,{ref:R==="start"?T:F,onClick:te=>p(!1,te.nativeEvent),children:typeof f=="string"?f:"Dismiss"})}const _e=!o&&A&&(u?!N:!0)&&(G||u);return s.jsxs(s.Fragment,{children:[_e&&s.jsx(fo,{"data-type":"inside",ref:se,onFocus:R=>{if(u){const oe=U();Jn(r[0]==="reference"?oe[0]:oe[oe.length-1])}else if(S!=null&&S.preserveTabOrder&&S.portalNode)if(y.current=!1,Ct(R,S.portalNode)){const oe=Fi(C);oe?.focus()}else{var te;(te=S.beforeOutsideRef.current)==null||te.focus()}}}),!N&&fe("start"),n,fe("end"),_e&&s.jsx(fo,{"data-type":"inside",ref:he,onFocus:R=>{if(u)Jn(U()[0]);else if(S!=null&&S.preserveTabOrder&&S.portalNode)if(g&&(y.current=!0),Ct(R,S.portalNode)){const oe=zi(C);oe?.focus()}else{var te;(te=S.afterOutsideRef.current)==null||te.focus()}}})]})}function hs(e){return We(e.target)&&e.target.tagName==="BUTTON"}function sd(e){return We(e.target)&&e.target.tagName==="A"}function ms(e){return Qo(e)}function vs(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,elements:{domReference:i}}=e,{enabled:a=!0,event:l="click",toggle:d=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0,stickIfOpen:g=!0}=t,_=E.useRef(),c=E.useRef(!1),h=E.useMemo(()=>({onPointerDown(p){_.current=p.pointerType},onMouseDown(p){const v=_.current;p.button===0&&l!=="click"&&(bt(v,!0)&&u||(n&&d&&(!(r.current.openEvent&&g)||r.current.openEvent.type==="mousedown")?o(!1,p.nativeEvent,"click"):(p.preventDefault(),o(!0,p.nativeEvent,"click"))))},onClick(p){const v=_.current;if(l==="mousedown"&&_.current){_.current=void 0;return}bt(v,!0)&&u||(n&&d&&(!(r.current.openEvent&&g)||r.current.openEvent.type==="click")?o(!1,p.nativeEvent,"click"):o(!0,p.nativeEvent,"click"))},onKeyDown(p){_.current=void 0,!(p.defaultPrevented||!f||hs(p))&&(p.key===" "&&!ms(i)&&(p.preventDefault(),c.current=!0),!sd(p)&&p.key==="Enter"&&o(!(n&&d),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!f||hs(p)||ms(i)||p.key===" "&&c.current&&(c.current=!1,o(!(n&&d),p.nativeEvent,"click"))}}),[r,i,l,u,f,o,n,g,d]);return E.useMemo(()=>a?{reference:h}:{},[a,h])}const ad={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ld={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},bs=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 go(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,elements:r,dataRef:i}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:d=!0,outsidePressEvent:u="pointerdown",referencePress:f=!1,referencePressEvent:g="pointerdown",ancestorScroll:_=!1,bubbles:c,capture:h}=t,p=Yn(),v=Ke(typeof d=="function"?d:()=>!1),w=typeof d=="function"?v:d,C=E.useRef(!1),{escapeKey:x,outsidePress:k}=bs(c),{escapeKey:z,outsidePress:L}=bs(h),N=E.useRef(!1),P=Ke(b=>{var S;if(!n||!a||!l||b.key!=="Escape"||N.current)return;const T=(S=i.current.floatingContext)==null?void 0:S.nodeId,F=p?Rn(p.nodesRef.current,T):[];if(!x&&(b.stopPropagation(),F.length>0)){let y=!0;if(F.forEach(M=>{var D;if((D=M.context)!=null&&D.open&&!M.context.dataRef.current.__escapeKeyBubbles){y=!1;return}}),!y)return}o(!1,Ql(b)?b.nativeEvent:b,"escape-key")}),A=Ke(b=>{var S;const T=()=>{var F;P(b),(F=Fn(b))==null||F.removeEventListener("keydown",T)};(S=Fn(b))==null||S.addEventListener("keydown",T)}),I=Ke(b=>{var S;const T=i.current.insideReactTree;i.current.insideReactTree=!1;const F=C.current;if(C.current=!1,u==="click"&&F||T||typeof w=="function"&&!w(b))return;const y=Fn(b),M="["+Zn("inert")+"]",D=en(r.floating).querySelectorAll(M);let B=Le(y)?y:null;for(;B&&!En(B);){const U=Mn(B);if(En(U)||!Le(U))break;B=U}if(D.length&&Le(y)&&!Yl(y)&&!Qe(y,r.floating)&&Array.from(D).every(U=>!Qe(B,U)))return;if(We(y)&&$){const U=En(y),pe=hn(y),ue=/auto|scroll/,se=U||ue.test(pe.overflowX),he=U||ue.test(pe.overflowY),fe=se&&y.clientWidth>0&&y.scrollWidth>y.clientWidth,_e=he&&y.clientHeight>0&&y.scrollHeight>y.clientHeight,R=pe.direction==="rtl",te=_e&&(R?b.offsetX<=y.offsetWidth-y.clientWidth:b.offsetX>y.clientWidth),oe=fe&&b.offsetY>y.clientHeight;if(te||oe)return}const G=(S=i.current.floatingContext)==null?void 0:S.nodeId,V=p&&Rn(p.nodesRef.current,G).some(U=>{var pe;return Jo(b,(pe=U.context)==null?void 0:pe.elements.floating)});if(Jo(b,r.floating)||Jo(b,r.domReference)||V)return;const J=p?Rn(p.nodesRef.current,G):[];if(J.length>0){let U=!0;if(J.forEach(pe=>{var ue;if((ue=pe.context)!=null&&ue.open&&!pe.context.dataRef.current.__outsidePressBubbles){U=!1;return}}),!U)return}o(!1,b,"outside-press")}),O=Ke(b=>{var S;const T=()=>{var F;I(b),(F=Fn(b))==null||F.removeEventListener(u,T)};(S=Fn(b))==null||S.addEventListener(u,T)});E.useEffect(()=>{if(!n||!a)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=k;let b=-1;function S(D){o(!1,D,"ancestor-scroll")}function T(){window.clearTimeout(b),N.current=!0}function F(){b=window.setTimeout(()=>{N.current=!1},jt()?5:0)}const y=en(r.floating);l&&(y.addEventListener("keydown",z?A:P,z),y.addEventListener("compositionstart",T),y.addEventListener("compositionend",F)),w&&y.addEventListener(u,L?O:I,L);let M=[];return _&&(Le(r.domReference)&&(M=Tn(r.domReference)),Le(r.floating)&&(M=M.concat(Tn(r.floating))),!Le(r.reference)&&r.reference&&r.reference.contextElement&&(M=M.concat(Tn(r.reference.contextElement)))),M=M.filter(D=>{var B;return D!==((B=y.defaultView)==null?void 0:B.visualViewport)}),M.forEach(D=>{D.addEventListener("scroll",S,{passive:!0})}),()=>{l&&(y.removeEventListener("keydown",z?A:P,z),y.removeEventListener("compositionstart",T),y.removeEventListener("compositionend",F)),w&&y.removeEventListener(u,L?O:I,L),M.forEach(D=>{D.removeEventListener("scroll",S)}),window.clearTimeout(b)}},[i,r,l,w,u,n,o,_,a,x,k,P,z,A,I,L,O]),E.useEffect(()=>{i.current.insideReactTree=!1},[i,w,u]);const q=E.useMemo(()=>({onKeyDown:P,...f&&{[ad[g]]:b=>{o(!1,b.nativeEvent,"reference-press")},...g!=="click"&&{onClick(b){o(!1,b.nativeEvent,"reference-press")}}}}),[P,o,f,g]),$=E.useMemo(()=>({onKeyDown:P,onMouseDown(){C.current=!0},onMouseUp(){C.current=!0},[ld[u]]:()=>{i.current.insideReactTree=!0}}),[P,u,i]);return E.useMemo(()=>a?{reference:q,floating:$}:{},[a,q,$])}function cd(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=$t(),i=E.useRef({}),[a]=E.useState(()=>es()),l=lt()!=null;if(process.env.NODE_ENV!=="production"){const c=o.reference;c&&!Le(c)&&Uc("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]=E.useState(o.reference),f=Ke((c,h,p)=>{i.current.openEvent=c?h:void 0,a.emit("openchange",{open:c,event:h,reason:p,nested:l}),n?.(c,h,p)}),g=E.useMemo(()=>({setPositionReference:u}),[]),_=E.useMemo(()=>({reference:d||o.reference||null,floating:o.floating||null,domReference:o.reference}),[d,o.reference,o.floating]);return E.useMemo(()=>({dataRef:i,open:t,onOpenChange:f,elements:_,events:a,floatingId:r,refs:g}),[t,f,_,a,r,g])}function po(e){e===void 0&&(e={});const{nodeId:t}=e,n=cd({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,r=o.elements,[i,a]=E.useState(null),[l,d]=E.useState(null),f=r?.domReference||i,g=E.useRef(null),_=Yn();Pe(()=>{f&&(g.current=f)},[f]);const c=Vc({...e,elements:{...r,...l&&{reference:l}}}),h=E.useCallback(x=>{const k=Le(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;d(k),c.refs.setReference(k)},[c.refs]),p=E.useCallback(x=>{(Le(x)||x===null)&&(g.current=x,a(x)),(Le(c.refs.reference.current)||c.refs.reference.current===null||x!==null&&!Le(x))&&c.refs.setReference(x)},[c.refs]),v=E.useMemo(()=>({...c.refs,setReference:p,setPositionReference:h,domReference:g}),[c.refs,p,h]),w=E.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),C=E.useMemo(()=>({...c,...o,refs:v,elements:w,nodeId:t}),[c,v,w,t,o]);return Pe(()=>{o.dataRef.current.floatingContext=C;const x=_?.nodesRef.current.find(k=>k.id===t);x&&(x.context=C)}),E.useMemo(()=>({...c,context:C,refs:v,elements:w}),[c,v,w,C])}function _r(){return Kl()&&xi()}function dd(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,events:r,dataRef:i,elements:a}=e,{enabled:l=!0,visibleOnly:d=!0}=t,u=E.useRef(!1),f=E.useRef(-1),g=E.useRef(!0);E.useEffect(()=>{if(!l)return;const c=gn(a.domReference);function h(){!n&&We(a.domReference)&&a.domReference===$n(en(a.domReference))&&(u.current=!0)}function p(){g.current=!0}function v(){g.current=!1}return c.addEventListener("blur",h),_r()&&(c.addEventListener("keydown",p,!0),c.addEventListener("pointerdown",v,!0)),()=>{c.removeEventListener("blur",h),_r()&&(c.removeEventListener("keydown",p,!0),c.removeEventListener("pointerdown",v,!0))}},[a.domReference,n,l]),E.useEffect(()=>{if(!l)return;function c(h){let{reason:p}=h;(p==="reference-press"||p==="escape-key")&&(u.current=!0)}return r.on("openchange",c),()=>{r.off("openchange",c)}},[r,l]),E.useEffect(()=>()=>{tn(f)},[]);const _=E.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(c){if(u.current)return;const h=Fn(c.nativeEvent);if(d&&Le(h)){if(_r()&&!c.relatedTarget){if(!g.current&&!Qo(h))return}else if(!Zl(h))return}o(!0,c.nativeEvent,"focus")},onBlur(c){u.current=!1;const h=c.relatedTarget,p=c.nativeEvent,v=Le(h)&&h.hasAttribute(Zn("focus-guard"))&&h.getAttribute("data-type")==="outside";f.current=window.setTimeout(()=>{var w;const C=$n(a.domReference?a.domReference.ownerDocument:document);!h&&C===a.domReference||Qe((w=i.current.floatingContext)==null?void 0:w.refs.floating.current,C)||Qe(a.domReference,C)||v||o(!1,p,"focus")})}}),[i,a.domReference,o,d]);return E.useMemo(()=>l?{reference:_}:{},[l,_])}function gr(e,t,n){const o=new Map,r=n==="item";let i=e;if(r&&e){const{[Xi]:a,[Yi]:l,...d}=e;i=d}return{...n==="floating"&&{tabIndex:-1,[Hc]:""},...i,...t.map(a=>{const l=a?a[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((a,l)=>(l&&Object.entries(l).forEach(d=>{let[u,f]=d;if(!(r&&[Xi,Yi].includes(u)))if(u.indexOf("on")===0){if(o.has(u)||o.set(u,[]),typeof f=="function"){var g;(g=o.get(u))==null||g.push(f),a[u]=function(){for(var _,c=arguments.length,h=new Array(c),p=0;p<c;p++)h[p]=arguments[p];return(_=o.get(u))==null?void 0:_.map(v=>v(...h)).find(v=>v!==void 0)}}}else a[u]=f}),a),{})}}function ho(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=E.useCallback(l=>gr(l,e,"reference"),t),i=E.useCallback(l=>gr(l,e,"floating"),n),a=E.useCallback(l=>gr(l,e,"item"),o);return E.useMemo(()=>({getReferenceProps:r,getFloatingProps:i,getItemProps:a}),[r,i,a])}const ud="Escape";function mo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function vo(e,t){return mo(t,e===Zi||e===so,e===xt||e===St)}function pr(e,t,n){return mo(t,e===so,n?e===xt:e===St)||e==="Enter"||e===" "||e===""}function ws(e,t,n){return mo(t,n?e===xt:e===St,e===so)}function ys(e,t,n,o){const r=n?e===St:e===xt,i=e===Zi;return t==="both"||t==="horizontal"&&o&&o>1?e===ud:mo(t,r,i)}function hr(e,t){const{open:n,onOpenChange:o,elements:r,floatingId:i}=e,{listRef:a,activeIndex:l,onNavigate:d=()=>{},enabled:u=!0,selectedIndex:f=null,allowEscape:g=!1,loop:_=!1,nested:c=!1,rtl:h=!1,virtual:p=!1,focusItemOnOpen:v="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:C=!0,disabledIndices:x=void 0,orientation:k="vertical",parentOrientation:z,cols:L=1,scrollItemIntoView:N=!0,virtualItemRef:P,itemSizes:A,dense:I=!1}=t;process.env.NODE_ENV!=="production"&&(g&&(_||ao("`useListNavigation` looping must be enabled to allow escaping."),p||ao("`useListNavigation` must be virtual to allow escaping.")),k==="vertical"&&L>1&&ao("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const O=Yt(r.floating),q=Je(O),$=lt(),b=Yn();Pe(()=>{e.dataRef.current.orientation=k},[e,k]);const S=Ke(()=>{d(y.current===-1?null:y.current)}),T=er(r.domReference),F=E.useRef(v),y=E.useRef(f??-1),M=E.useRef(null),D=E.useRef(!0),B=E.useRef(S),G=E.useRef(!!r.floating),V=E.useRef(n),J=E.useRef(!1),U=E.useRef(!1),pe=Je(x),ue=Je(n),se=Je(N),he=Je(f),[fe,_e]=E.useState(),[R,te]=E.useState(),oe=Ke(()=>{function W(Y){if(p){var Ce;(Ce=Y.id)!=null&&Ce.endsWith("-fui-option")&&(Y.id=i+"-"+Math.random().toString(16).slice(2,10)),_e(Y.id),b?.events.emit("virtualfocus",Y),P&&(P.current=Y)}else Jn(Y,{sync:J.current,preventScroll:!0})}const j=a.current[y.current],H=U.current;j&&W(j),(J.current?Y=>Y():requestAnimationFrame)(()=>{const Y=a.current[y.current]||j;if(!Y)return;j||W(Y);const Ce=se.current;Ce&&ve&&(H||!D.current)&&(Y.scrollIntoView==null||Y.scrollIntoView(typeof Ce=="boolean"?{block:"nearest",inline:"nearest"}:Ce))})});Pe(()=>{u&&(n&&r.floating?F.current&&f!=null&&(U.current=!0,y.current=f,S()):G.current&&(y.current=-1,B.current()))},[u,n,r.floating,f,S]),Pe(()=>{if(u&&n&&r.floating)if(l==null){if(J.current=!1,he.current!=null)return;if(G.current&&(y.current=-1,oe()),(!V.current||!G.current)&&F.current&&(M.current!=null||F.current===!0&&M.current==null)){let W=0;const j=()=>{a.current[0]==null?(W<2&&(W?requestAnimationFrame:queueMicrotask)(j),W++):(y.current=M.current==null||pr(M.current,k,h)||c?nr(a,pe.current):Mi(a,pe.current),M.current=null,S())};j()}}else wt(a,l)||(y.current=l,oe(),U.current=!1)},[u,n,r.floating,l,he,c,a,k,h,S,oe,pe]),Pe(()=>{var W;if(!u||r.floating||!b||p||!G.current)return;const j=b.nodesRef.current,H=(W=j.find(Ce=>Ce.id===$))==null||(W=W.context)==null?void 0:W.elements.floating,me=$n(en(r.floating)),Y=j.some(Ce=>Ce.context&&Qe(Ce.context.elements.floating,me));H&&!Y&&D.current&&H.focus({preventScroll:!0})},[u,r.floating,b,$,p]),Pe(()=>{if(!u||!b||!p||$)return;function W(j){te(j.id),P&&(P.current=j)}return b.events.on("virtualfocus",W),()=>{b.events.off("virtualfocus",W)}},[u,b,p,$,P]),Pe(()=>{B.current=S,V.current=n,G.current=!!r.floating}),Pe(()=>{n||(M.current=null,F.current=v)},[n,v]);const ae=l!=null,ve=E.useMemo(()=>{function W(H){if(!ue.current)return;const me=a.current.indexOf(H);me!==-1&&y.current!==me&&(y.current=me,S())}return{onFocus(H){let{currentTarget:me}=H;J.current=!0,W(me)},onClick:H=>{let{currentTarget:me}=H;return me.focus({preventScroll:!0})},onMouseMove(H){let{currentTarget:me}=H;J.current=!0,U.current=!1,w&&W(me)},onPointerLeave(H){let{pointerType:me}=H;if(!(!D.current||me==="touch")&&(J.current=!0,!!w&&(y.current=-1,S(),!p))){var Y;(Y=q.current)==null||Y.focus({preventScroll:!0})}}}},[ue,q,w,a,S,p]),ee=E.useCallback(()=>{var W;return z??(b==null||(W=b.nodesRef.current.find(j=>j.id===$))==null||(W=W.context)==null||(W=W.dataRef)==null?void 0:W.current.orientation)},[$,b,z]),we=Ke(W=>{if(D.current=!1,J.current=!0,W.which===229||!ue.current&&W.currentTarget===q.current)return;if(c&&ys(W.key,k,h,L)){vo(W.key,ee())||nn(W),o(!1,W.nativeEvent,"list-navigation"),We(r.domReference)&&(p?b?.events.emit("virtualfocus",r.domReference):r.domReference.focus());return}const j=y.current,H=nr(a,x),me=Mi(a,x);if(T||(W.key==="Home"&&(nn(W),y.current=H,S()),W.key==="End"&&(nn(W),y.current=me,S())),L>1){const Y=A||Array.from({length:a.current.length},()=>({width:1,height:1})),Ce=ic(Y,L,I),Re=Ce.findIndex(Ve=>Ve!=null&&!Jt(a,Ve,x)),dn=Ce.reduce((Ve,Ze,re)=>Ze!=null&&!Jt(a,Ze,x)?re:Ve,-1),Ye=Ce[rc({current:Ce.map(Ve=>Ve!=null?a.current[Ve]:null)},{event:W,orientation:k,loop:_,rtl:h,cols:L,disabledIndices:ac([...(typeof x!="function"?x:null)||a.current.map((Ve,Ze)=>Jt(a,Ze,x)?Ze:void 0),void 0],Ce),minIndex:Re,maxIndex:dn,prevIndex:sc(y.current>me?H:y.current,Y,Ce,L,W.key===so?"bl":W.key===(h?xt:St)?"tr":"tl"),stopEvent:!0})];if(Ye!=null&&(y.current=Ye,S()),k==="both")return}if(vo(W.key,k)){if(nn(W),n&&!p&&$n(W.currentTarget.ownerDocument)===W.currentTarget){y.current=pr(W.key,k,h)?H:me,S();return}pr(W.key,k,h)?_?y.current=j>=me?g&&j!==a.current.length?-1:H:sn(a,{startingIndex:j,disabledIndices:x}):y.current=Math.min(me,sn(a,{startingIndex:j,disabledIndices:x})):_?y.current=j<=H?g&&j!==-1?a.current.length:me:sn(a,{startingIndex:j,decrement:!0,disabledIndices:x}):y.current=Math.max(H,sn(a,{startingIndex:j,decrement:!0,disabledIndices:x})),wt(a,y.current)&&(y.current=-1),S()}}),Se=E.useMemo(()=>p&&n&&ae&&{"aria-activedescendant":R||fe},[p,n,ae,R,fe]),le=E.useMemo(()=>({"aria-orientation":k==="both"?void 0:k,...T?{}:Se,onKeyDown:we,onPointerMove(){D.current=!0}}),[Se,we,k,T]),ye=E.useMemo(()=>{function W(H){v==="auto"&&Ii(H.nativeEvent)&&(F.current=!0)}function j(H){F.current=v,v==="auto"&&Ei(H.nativeEvent)&&(F.current=!0)}return{...Se,onKeyDown(H){D.current=!1;const me=H.key.startsWith("Arrow"),Y=["Home","End"].includes(H.key),Ce=me||Y,Re=ws(H.key,k,h),dn=ys(H.key,k,h,L),Ye=ws(H.key,ee(),h),Ve=vo(H.key,k),Ze=(c?Ye:Ve)||H.key==="Enter"||H.key.trim()==="";if(p&&n){const Ee=b?.nodesRef.current.find(fn=>fn.parentId==null),on=b&&Ee?Jl(b.nodesRef.current,Ee.id):null;if(Ce&&on&&P){const fn=new KeyboardEvent("keydown",{key:H.key,bubbles:!0});if(Re||dn){var re,Be;const Q=((re=on.context)==null?void 0:re.elements.domReference)===H.currentTarget,Fe=dn&&!Q?(Be=on.context)==null?void 0:Be.elements.domReference:Re?a.current.find($e=>$e?.id===fe):null;Fe&&(nn(H),Fe.dispatchEvent(fn),te(void 0))}if((Ve||Y)&&on.context&&on.context.open&&on.parentId&&H.currentTarget!==on.context.elements.domReference){var be;nn(H),(be=on.context.elements.domReference)==null||be.dispatchEvent(fn);return}}return we(H)}if(!(!n&&!C&&me)){if(Ze){const Ee=vo(H.key,ee());M.current=c&&Ee?null:H.key}if(c){Ye&&(nn(H),n?(y.current=nr(a,pe.current),S()):o(!0,H.nativeEvent,"list-navigation"));return}Ve&&(f!=null&&(y.current=f),nn(H),!n&&C?o(!0,H.nativeEvent,"list-navigation"):we(H),n&&S())}},onFocus(){n&&!p&&(y.current=-1,S())},onPointerDown:j,onPointerEnter:j,onMouseDown:W,onClick:W}},[fe,Se,L,we,pe,v,a,c,S,o,n,C,k,ee,h,f,b,p,P]);return E.useMemo(()=>u?{reference:ye,floating:le,item:ve}:{},[u,ye,le,ve])}const fd=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function bo(e,t){var n,o;t===void 0&&(t={});const{open:r,elements:i,floatingId:a}=e,{enabled:l=!0,role:d="dialog"}=t,u=$t(),f=((n=i.domReference)==null?void 0:n.id)||u,g=E.useMemo(()=>{var C;return((C=Yt(i.floating))==null?void 0:C.id)||a},[i.floating,a]),_=(o=fd.get(d))!=null?o:d,h=lt()!=null,p=E.useMemo(()=>_==="tooltip"||d==="label"?{["aria-"+(d==="label"?"labelledby":"describedby")]:r?g:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":_==="alertdialog"?"dialog":_,"aria-controls":r?g:void 0,..._==="listbox"&&{role:"combobox"},..._==="menu"&&{id:f},..._==="menu"&&h&&{role:"menuitem"},...d==="select"&&{"aria-autocomplete":"none"},...d==="combobox"&&{"aria-autocomplete":"list"}},[_,g,h,r,f,d]),v=E.useMemo(()=>{const C={id:g,..._&&{role:_}};return _==="tooltip"||d==="label"?C:{...C,..._==="menu"&&{"aria-labelledby":f}}},[_,g,f,d]),w=E.useCallback(C=>{let{active:x,selected:k}=C;const z={role:"option",...x&&{id:g+"-fui-option"}};switch(d){case"select":case"combobox":return{...z,"aria-selected":k}}return{}},[g,d]);return E.useMemo(()=>l?{reference:p,floating:v,item:w}:{},[l,p,v,w])}const Cs=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function dt(e,t){return typeof e=="function"?e(t):e}function _d(e,t){const[n,o]=E.useState(e);return e&&!n&&o(!0),E.useEffect(()=>{if(!e&&n){const r=setTimeout(()=>o(!1),t);return()=>clearTimeout(r)}},[e,n,t]),n}function gd(e,t){t===void 0&&(t={});const{open:n,elements:{floating:o}}=e,{duration:r=250}=t,a=(typeof r=="number"?r:r.close)||0,[l,d]=E.useState("unmounted"),u=_d(n,a);return!u&&l==="close"&&d("unmounted"),Pe(()=>{if(o){if(n){d("initial");const f=requestAnimationFrame(()=>{Do.flushSync(()=>{d("open")})});return()=>{cancelAnimationFrame(f)}}d("close")}},[n,o]),{isMounted:u,status:l}}function wo(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:o,close:r,common:i,duration:a=250}=t,l=e.placement,d=l.split("-")[0],u=E.useMemo(()=>({side:d,placement:l}),[d,l]),f=typeof a=="number",g=(f?a:a.open)||0,_=(f?a:a.close)||0,[c,h]=E.useState(()=>({...dt(i,u),...dt(n,u)})),{isMounted:p,status:v}=gd(e,{duration:a}),w=Je(n),C=Je(o),x=Je(r),k=Je(i);return Pe(()=>{const z=dt(w.current,u),L=dt(x.current,u),N=dt(k.current,u),P=dt(C.current,u)||Object.keys(z).reduce((A,I)=>(A[I]="",A),{});if(v==="initial"&&h(A=>({transitionProperty:A.transitionProperty,...N,...z})),v==="open"&&h({transitionProperty:Object.keys(P).map(Cs).join(","),transitionDuration:g+"ms",...N,...P}),v==="close"){const A=L||z;h({transitionProperty:Object.keys(A).map(Cs).join(","),transitionDuration:_+"ms",...N,...A})}},[_,x,w,C,k,g,v,u]),{isMounted:p,styles:c}}function xs(e,t){var n;const{open:o,dataRef:r}=e,{listRef:i,activeIndex:a,onMatch:l,onTypingChange:d,enabled:u=!0,findMatch:f=null,resetMs:g=750,ignoreKeys:_=[],selectedIndex:c=null}=t,h=E.useRef(-1),p=E.useRef(""),v=E.useRef((n=c??a)!=null?n:-1),w=E.useRef(null),C=Ke(l),x=Ke(d),k=Je(f),z=Je(_);Pe(()=>{o&&(tn(h),w.current=null,p.current="")},[o]),Pe(()=>{if(o&&p.current===""){var I;v.current=(I=c??a)!=null?I:-1}},[o,c,a]);const L=Ke(I=>{I?r.current.typing||(r.current.typing=I,x(I)):r.current.typing&&(r.current.typing=I,x(I))}),N=Ke(I=>{function O(T,F,y){const M=k.current?k.current(F,y):F.find(D=>D?.toLocaleLowerCase().indexOf(y.toLocaleLowerCase())===0);return M?T.indexOf(M):-1}const q=i.current;if(p.current.length>0&&p.current[0]!==" "&&(O(q,q,p.current)===-1?L(!1):I.key===" "&&nn(I)),q==null||z.current.includes(I.key)||I.key.length!==1||I.ctrlKey||I.metaKey||I.altKey)return;o&&I.key!==" "&&(nn(I),L(!0)),q.every(T=>{var F,y;return T?((F=T[0])==null?void 0:F.toLocaleLowerCase())!==((y=T[1])==null?void 0:y.toLocaleLowerCase()):!0})&&p.current===I.key&&(p.current="",v.current=w.current),p.current+=I.key,tn(h),h.current=window.setTimeout(()=>{p.current="",v.current=w.current,L(!1)},g);const b=v.current,S=O(q,[...q.slice((b||0)+1),...q.slice(0,(b||0)+1)],p.current);S!==-1?(C(S),w.current=S):I.key!==" "&&(p.current="",L(!1))}),P=E.useMemo(()=>({onKeyDown:N}),[N]),A=E.useMemo(()=>({onKeyDown:N,onKeyUp(I){I.key===" "&&L(!1)}}),[N,L]);return E.useMemo(()=>u?{reference:P,floating:A}:{},[u,P,A])}function Ss(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var i;return r.parentId===t&&(!n||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...Ss(e,r.id,n)])}function $s(e,t){const[n,o]=e;let r=!1;const i=t.length;for(let a=0,l=i-1;a<i;l=a++){const[d,u]=t[a]||[0,0],[f,g]=t[l]||[0,0];u>=o!=g>=o&&n<=(f-d)*(o-u)/(g-u)+d&&(r=!r)}return r}function pd(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function ks(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r={current:-1};let i=!1,a=null,l=null,d=typeof performance<"u"?performance.now():0;function u(g,_){const c=performance.now(),h=c-d;if(a===null||l===null||h===0)return a=g,l=_,d=c,null;const p=g-a,v=_-l,C=Math.sqrt(p*p+v*v)/h;return a=g,l=_,d=c,C}const f=g=>{let{x:_,y:c,placement:h,elements:p,onClose:v,nodeId:w,tree:C}=g;return function(k){function z(){tn(r),v()}if(tn(r),!p.domReference||!p.floating||h==null||_==null||c==null)return;const{clientX:L,clientY:N}=k,P=[L,N],A=Yc(k),I=k.type==="mouseleave",O=cr(p.floating,A),q=cr(p.domReference,A),$=p.domReference.getBoundingClientRect(),b=p.floating.getBoundingClientRect(),S=h.split("-")[0],T=_>b.right-b.width/2,F=c>b.bottom-b.height/2,y=pd(P,$),M=b.width>$.width,D=b.height>$.height,B=(M?$:b).left,G=(M?$:b).right,V=(D?$:b).top,J=(D?$:b).bottom;if(O&&(i=!0,!I))return;if(q&&(i=!1),q&&!I){i=!0;return}if(I&&Le(k.relatedTarget)&&cr(p.floating,k.relatedTarget)||C&&Ss(C.nodesRef.current,w).length)return;if(S==="top"&&c>=$.bottom-1||S==="bottom"&&c<=$.top+1||S==="left"&&_>=$.right-1||S==="right"&&_<=$.left+1)return z();let U=[];switch(S){case"top":U=[[B,$.top+1],[B,b.bottom-1],[G,b.bottom-1],[G,$.top+1]];break;case"bottom":U=[[B,b.top+1],[B,$.bottom-1],[G,$.bottom-1],[G,b.top+1]];break;case"left":U=[[b.right-1,J],[b.right-1,V],[$.left+1,V],[$.left+1,J]];break;case"right":U=[[$.right-1,J],[$.right-1,V],[b.left+1,V],[b.left+1,J]];break}function pe(ue){let[se,he]=ue;switch(S){case"top":{const fe=[M?se+t/2:T?se+t*4:se-t*4,he+t+1],_e=[M?se-t/2:T?se+t*4:se-t*4,he+t+1],R=[[b.left,T||M?b.bottom-t:b.top],[b.right,T?M?b.bottom-t:b.top:b.bottom-t]];return[fe,_e,...R]}case"bottom":{const fe=[M?se+t/2:T?se+t*4:se-t*4,he-t],_e=[M?se-t/2:T?se+t*4:se-t*4,he-t],R=[[b.left,T||M?b.top+t:b.bottom],[b.right,T?M?b.top+t:b.bottom:b.top+t]];return[fe,_e,...R]}case"left":{const fe=[se+t+1,D?he+t/2:F?he+t*4:he-t*4],_e=[se+t+1,D?he-t/2:F?he+t*4:he-t*4];return[...[[F||D?b.right-t:b.left,b.top],[F?D?b.right-t:b.left:b.right-t,b.bottom]],fe,_e]}case"right":{const fe=[se-t,D?he+t/2:F?he+t*4:he-t*4],_e=[se-t,D?he-t/2:F?he+t*4:he-t*4],R=[[F||D?b.left+t:b.right,b.top],[F?D?b.left+t:b.right:b.left+t,b.bottom]];return[fe,_e,...R]}}}if(!$s([L,N],U)){if(i&&!y)return z();if(!I&&o){const ue=u(k.clientX,k.clientY);if(ue!==null&&ue<.1)return z()}$s([L,N],pe([_,c]))?!i&&o&&(r.current=window.setTimeout(z,40)):z()}}};return f.__options={blockPointerEvents:n},f}function ut(e,t,n){let o=n.initialDeps??[],r;function i(){var a,l,d,u;let f;n.key&&((a=n.debug)!=null&&a.call(n))&&(f=Date.now());const g=e();if(!(g.length!==o.length||g.some((h,p)=>o[p]!==h)))return r;o=g;let c;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(c=Date.now()),r=t(...g),n.key&&((d=n.debug)!=null&&d.call(n))){const h=Math.round((Date.now()-f)*100)/100,p=Math.round((Date.now()-c)*100)/100,v=p/16,w=(C,x)=>{for(C=String(C);C.length<x;)C=" "+C;return C};console.info(`%c⏱ ${w(p,5)} /${w(h,5)} ms`,`
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*v,120))}deg 100% 31%);`,n?.key)}return(u=n?.onChange)==null||u.call(n,r),r}return i.updateDeps=a=>{o=a},i}function Is(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const hd=(e,t)=>Math.abs(e-t)<1.01,md=(e,t,n)=>{let o;return function(...r){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,r),n)}},Es=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},vd=e=>e,bd=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},wd=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;const r=a=>{const{width:l,height:d}=a;t({width:Math.round(l),height:Math.round(d)})};if(r(Es(n)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver(a=>{const l=()=>{const d=a[0];if(d?.borderBoxSize){const u=d.borderBoxSize[0];if(u){r({width:u.inlineSize,height:u.blockSize});return}}r(Es(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},Ms={passive:!0},Ns=typeof window>"u"?!0:"onscrollend"in window,yd=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;let r=0;const i=e.options.useScrollendEvent&&Ns?()=>{}:md(o,()=>{t(r,!1)},e.options.isScrollingResetDelay),a=f=>()=>{const{horizontal:g,isRtl:_}=e.options;r=g?n.scrollLeft*(_&&-1||1):n.scrollTop,i(),t(r,f)},l=a(!0),d=a(!1);d(),n.addEventListener("scroll",l,Ms);const u=e.options.useScrollendEvent&&Ns;return u&&n.addEventListener("scrollend",d,Ms),()=>{n.removeEventListener("scroll",l),u&&n.removeEventListener("scrollend",d)}},Cd=(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"]},xd=(e,{adjustments:t=0,behavior:n},o)=>{var r,i;const a=e+t;(i=(r=o.scrollElement)==null?void 0:r.scrollTo)==null||i.call(r,{[o.options.horizontal?"left":"top"]:a,behavior:n})};class Sd{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const o=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(i=>{const a=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var r;(r=o())==null||r.disconnect(),n=null},observe:r=>{var i;return(i=o())==null?void 0:i.observe(r,{box:"border-box"})},unobserve:r=>{var i;return(i=o())==null?void 0:i.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([o,r])=>{typeof r>"u"&&delete n[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:vd,rangeExtractor:bd,onChange:()=>{},measureElement:Cd,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=ut(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,o)=>{const r=new Map,i=new Map;for(let a=o-1;a>=0;a--){const l=n[a];if(r.has(l.lane))continue;const d=i.get(l.lane);if(d==null||l.end>d.end?i.set(l.lane,l):l.end<d.end&&r.set(l.lane,!0),r.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((a,l)=>a.end===l.end?a.index-l.index:a.end-l.end)[0]:void 0},this.getMeasurementOptions=ut(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,o,r,i,a)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:a}),{key:!1}),this.getMeasurements=ut(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:a},l)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(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<n;f++){const g=i(f),_=this.options.lanes===1?u[f-1]:this.getFurthestMeasurement(u,f),c=_?_.end+this.options.gap:o+r,h=l.get(g),p=typeof h=="number"?h:this.options.estimateSize(f),v=c+p,w=_?_.lane:f%this.options.lanes;u[f]={index:f,start:c,size:p,end:v,key:g,lane:w}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=ut(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,o,r,i)=>this.range=n.length>0&&o>0?$d({measurements:n,outerSize:o,scrollOffset:r,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=ut(()=>{let n=null,o=null;const r=this.calculateRange();return r&&(n=r.startIndex,o=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,o]},(n,o,r,i,a)=>i===null||a===null?[]:n({startIndex:i,endIndex:a,overscan:o,count:r}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const o=this.options.indexAttribute,r=n.getAttribute(o);return r?parseInt(r,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(n,o)=>{const r=this.indexFromElement(n),i=this.measurementsCache[r];if(!i)return;const a=i.key,l=this.elementsCache.get(a);l!==n&&(l&&this.observer.unobserve(l),this.observer.observe(n),this.elementsCache.set(a,n)),n.isConnected&&this.resizeItem(r,this.options.measureElement(n,o,this))},this.resizeItem=(n,o)=>{const r=this.measurementsCache[n];if(!r)return;const i=this.itemSizeCache.get(r.key)??r.size,a=o-i;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,a,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",a),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,o)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((o,r)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(r))});return}this._measureElement(n,void 0)},this.getVirtualItems=ut(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,o)=>{const r=[];for(let i=0,a=n.length;i<a;i++){const l=n[i],d=o[l];r.push(d)}return r},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const o=this.getMeasurements();if(o.length!==0)return Is(o[Fs(0,o.length-1,r=>Is(o[r]).start,n)])},this.getOffsetForAlignment=(n,o,r=0)=>{const i=this.getSize(),a=this.getScrollOffset();o==="auto"&&(o=n>=a+i?"end":"start"),o==="center"?n+=(r-i)/2:o==="end"&&(n-=i);const l=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,o="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.measurementsCache[n];if(!r)return;const i=this.getSize(),a=this.getScrollOffset();if(o==="auto")if(r.end>=a+i-this.options.scrollPaddingEnd)o="end";else if(r.start<=a+this.options.scrollPaddingStart)o="start";else return[a,o];const l=o==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,o,r.size),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:o="start",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,o),{adjustments:void 0,behavior:r})},this.scrollToIndex=(n,{align:o="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let i=0;const a=10,l=u=>{if(!this.targetWindow)return;const f=this.getOffsetForIndex(n,u);if(!f){console.warn("Failed to get offset for index:",n);return}const[g,_]=f;this._scrollToOffset(g,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const c=this.getScrollOffset(),h=this.getOffsetForIndex(n,_);if(!h){console.warn("Failed to get offset for index:",n);return}hd(h[0],c)||d(_)})},d=u=>{this.targetWindow&&(i++,i<a?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,a),this.targetWindow.requestAnimationFrame(()=>l(u))):console.warn(`Failed to scroll to index ${n} after ${a} attempts.`))};l(o)},this.scrollBy=(n,{behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var n;const o=this.getMeasurements();let r;if(o.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((n=o[o.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let a=o.length-1;for(;a>=0&&i.some(l=>l===null);){const l=o[a];i[l.lane]===null&&(i[l.lane]=l.end),a--}r=Math.max(...i.filter(l=>l!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:o,behavior:r})=>{this.options.scrollToFn(n,{behavior:r,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const Fs=(e,t,n,o)=>{for(;e<=t;){const r=(e+t)/2|0,i=n(r);if(i<o)e=r+1;else if(i>o)t=r-1;else return r}return e>0?e-1:0};function $d({measurements:e,outerSize:t,scrollOffset:n,lanes:o}){const r=e.length-1,i=d=>e[d].start;if(e.length<=o)return{startIndex:0,endIndex:r};let a=Fs(0,r,i,n),l=a;if(o===1)for(;l<r&&e[l].end<n+t;)l++;else if(o>1){const d=Array(o).fill(0);for(;l<r&&d.some(f=>f<n+t);){const f=e[l];d[f.lane]=f.end,l++}const u=Array(o).fill(n+t);for(;a>=0&&u.some(f=>f>=n);){const f=e[a];u[f.lane]=f.start,a--}a=Math.max(0,a-a%o),l=Math.min(r,l+(o-1-l%o))}return{startIndex:a,endIndex:l}}const zs=typeof document<"u"?E.useLayoutEffect:E.useEffect;function kd(e){const t=E.useReducer(()=>({}),{})[1],n={...e,onChange:(r,i)=>{var a;i?pt.flushSync(t):t(),(a=e.onChange)==null||a.call(e,r,i)}},[o]=E.useState(()=>new Sd(n));return o.setOptions(n),zs(()=>o._didMount(),[]),zs(()=>o._willUpdate()),o}function Id(e){return kd({observeElementRect:wd,observeElementOffset:yd,scrollToFn:xd,...e})}function Ed(e,t){const[n,o]=E.useState(e);return E.useEffect(()=>{const r=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(r)}},[e,t]),n}function yo(e){const t=E.useCallback(r=>{const i=window.matchMedia(e);return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[e]),n=()=>window.matchMedia(e).matches,o=()=>{throw Error("useMediaQuery is a client-only hook")};return E.useSyncExternalStore(t,n,o)}function mr(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function It(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function Co(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function As(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function Ds(e,t,n,o){if(!t.trim())return e;const r=As(t.trim());return o?e.filter(i=>o(i,t)):e.filter(i=>As(mr(i,n)).includes(r))}function Md(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 Nd(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 Fd(e,t,n,o){return t.trim()?e.map(r=>({...r,opciones:Ds(r.opciones,t,n,o)})).filter(r=>r.opciones.length>0):e}function zd(e){return e.map((t,n)=>t.tipo==="grupo"||t.datos&&Co(t.datos)?n:null).filter(t=>t!==null)}function Ad(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 Dd(e,t,n){return e!==void 0?e:t==="invalid"?!0:t==="valid"?!1:!!n}function Ld(e,t="Opción"){return Array.from({length:e},(n,o)=>`${t} ${o+1}`)}function Pd(e){return Array.from({length:e},(t,n)=>({id:`usr-${n+1}`,nombre:`Usuario ${n+1}`,email:`usuario${n+1}@test.com`}))}const Ls=({size:e="1em",...t})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:s.jsx("path",{d:"m6 9 6 6 6-6"})}),Ps=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[s.jsx("path",{d:"M18 6 6 18"}),s.jsx("path",{d:"m6 6 12 12"})]}),Td=({size:e="1em",...t})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:s.jsx("path",{d:"M20 6 9 17l-5-5"})}),Od=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[s.jsx("circle",{cx:"11",cy:"11",r:"8"}),s.jsx("path",{d:"m21 21-4.3-4.3"})]}),qd=({size:e="1em",...t})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:s.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),X={contenedor_base:"_contenedor_base_1qm8z_1",tam_sm:"_tam_sm_1qm8z_41",tam_lg:"_tam_lg_1qm8z_55",radio_none:"_radio_none_1qm8z_69",radio_sm:"_radio_sm_1qm8z_77",radio_md:"_radio_md_1qm8z_85",radio_lg:"_radio_lg_1qm8z_93",radio_full:"_radio_full_1qm8z_101",color_default:"_color_default_1qm8z_109",color_primary:"_color_primary_1qm8z_111",color_secondary:"_color_secondary_1qm8z_119",color_success:"_color_success_1qm8z_127",color_warning:"_color_warning_1qm8z_135",color_danger:"_color_danger_1qm8z_143",etiqueta:"_etiqueta_1qm8z_151",marca_requerido:"_marca_requerido_1qm8z_167",trigger:"_trigger_1qm8z_177",trigger_expandido:"_trigger_expandido_1qm8z_213",variante_bordered:"_variante_bordered_1qm8z_223",variante_faded:"_variante_faded_1qm8z_233",variante_underlined:"_variante_underlined_1qm8z_243",variante_ghost:"_variante_ghost_1qm8z_259",deshabilitado:"_deshabilitado_1qm8z_271",solo_lectura:"_solo_lectura_1qm8z_291",valor_texto:"_valor_texto_1qm8z_307",abierto:"_abierto_1qm8z_335",valido:"_valido_1qm8z_343",invalido:"_invalido_1qm8z_351",contenido_inicio:"_contenido_inicio_1qm8z_403",contenido_final:"_contenido_final_1qm8z_405",valor_wrapper:"_valor_wrapper_1qm8z_423",mostrar_todos:"_mostrar_todos_1qm8z_443",valor_wrapper_expandido:"_valor_wrapper_expandido_1qm8z_453",placeholder:"_placeholder_1qm8z_469",chip_multi:"_chip_multi_1qm8z_479",chip_texto:"_chip_texto_1qm8z_513",chip_cerrar:"_chip_cerrar_1qm8z_525",contador_multi:"_contador_multi_1qm8z_565",acciones:"_acciones_1qm8z_579",boton_limpiar:"_boton_limpiar_1qm8z_593",tiene_valor:"_tiene_valor_1qm8z_645",icono_chevron:"_icono_chevron_1qm8z_655",icono_spinner:"_icono_spinner_1qm8z_677",girarSpinner:"_girarSpinner_1qm8z_1",menu:"_menu_1qm8z_711",buscador_wrapper:"_buscador_wrapper_1qm8z_741",buscador_interno:"_buscador_interno_1qm8z_753",icono_buscar:"_icono_buscar_1qm8z_783",input_busqueda:"_input_busqueda_1qm8z_795",lista_opciones:"_lista_opciones_1qm8z_827",lista_virtual:"_lista_virtual_1qm8z_853",contenedor_virtual:"_contenedor_virtual_1qm8z_865",encabezado_grupo:"_encabezado_grupo_1qm8z_873",opcion:"_opcion_1qm8z_905",opcion_virtual:"_opcion_virtual_1qm8z_931",activo:"_activo_1qm8z_939",seleccionado:"_seleccionado_1qm8z_947",opcion_check:"_opcion_check_1qm8z_979",opcion_contenido:"_opcion_contenido_1qm8z_1007",sin_resultados:"_sin_resultados_1qm8z_1023",descripcion:"_descripcion_1qm8z_1047",mensaje_error:"_mensaje_error_1qm8z_1059",ancho_total:"_ancho_total_1qm8z_1071",sin_animacion:"_sin_animacion_1qm8z_1079",contenedor_nativo:"_contenedor_nativo_1qm8z_1089",select_nativo:"_select_nativo_1qm8z_1097",input_validacion:"_input_validacion_1qm8z_1125"};function Vd(e){const{options:t=[],value:n,onChange:o,onValueChange:r,optionLabelKey:i="label",optionValueKey:a="id",label:l,placeholder:d="Seleccione una opción",description:u,errorMessage:f,isRequired:g=!1,isInvalid:_,id:c,name:h,classNames:p,startContent:v,endContent:w,esInvalido:C,estaDeshabilitadoReal:x,clasesBase:k,renderizarValorMostrado:z}=e,L=m.useId(),N=c??`select-nativo-${L}`,P=u?`${N}-desc`:void 0,A=C?`${N}-err`:void 0,I=m.useCallback(T=>mr(T,i),[i]),O=m.useCallback(T=>It(T,a),[a]),q=m.useCallback(T=>{o?.(T),r?.(T)},[o,r]),$=m.useCallback(T=>{const F=T.target.value;if(!F){q(null);return}const y=t.find(M=>O(M)===F);y&&q(y)},[t,O,q]),b=typeof _=="string"?_:null,S=typeof f=="function"?f({invalido:C,mensaje:b}):f??b;return s.jsxs("div",{className:k,children:[l&&s.jsxs("label",{className:K(X.etiqueta,p?.label),htmlFor:N,children:[l,g&&s.jsx("span",{className:X.marca_requerido,children:"*"})]}),s.jsxs("div",{className:X.contenedor_nativo,children:[s.jsxs("div",{className:K(X.trigger,p?.trigger),children:[v&&s.jsx("span",{className:X.contenido_inicio,children:v}),s.jsx("div",{className:K(X.valor_wrapper,p?.value),children:z()}),s.jsxs("div",{className:X.acciones,children:[w&&s.jsx("span",{className:X.contenido_final,children:w}),s.jsx("span",{className:X.icono_chevron,children:s.jsx(Ls,{size:"1em"})})]})]}),s.jsxs("select",{id:N,name:h,className:X.select_nativo,value:n?O(n):"",onChange:$,disabled:x,required:g,children:[s.jsx("option",{value:"",children:d}),t.map(T=>s.jsx("option",{value:O(T),disabled:Co(T),children:I(T)},O(T)))]})]}),u&&!C&&s.jsx("div",{id:P,className:K(X.descripcion,p?.description),children:u}),C&&S&&s.jsx("div",{id:A,className:K(X.mensaje_error,p?.errorMessage),children:S})]})}const jd="(max-width: 768px)",Bd=40,vr=320,xo=100,Hd=200,Gd=5;function Wd(e,t){const{options:n=[],value:o,defaultValue:r,onChange:i,onValueChange:a,optionLabelKey:l="label",optionValueKey:d="id",renderOption:u,renderValue:f,variant:g="bordered",color:_="default",size:c="md",radius:h="md",fullWidth:p=!0,disableAnimation:v=!1,label:w,placeholder:C="",description:x,errorMessage:k,emptyMessage:z="No hay opciones",noResultsMessage:L="Sin resultados",isRequired:N=!1,isDisabled:P=!1,isReadOnly:A=!1,isLoading:I=!1,isClearable:O=!0,isInvalid:q,validationState:$,isMultiple:b=!1,mostrarTodos:S=!1,isSearchable:T=!1,isVirtualized:F=!1,estimatedOptionHeight:y=Bd,filterFn:M,validate:D,onOpen:B,onClose:G,onSearchChange:V,onClear:J,onFocus:U,onBlur:pe,id:ue,name:se,className:he,classNames:fe,style:_e,startContent:R,endContent:te,menuZIndex:oe,portalContainer:ae}=e,ve=m.useRef(null),ee=m.useRef([]),we=m.useRef(null),Se=m.useRef(null),le=m.useId(),ye=ue??`select-${le}`,j=yo(jd)&&!T&&!b,[H,me]=m.useState(!1),[Y,Ce]=m.useState(null),[Re,dn]=m.useState(""),Ye=o!==void 0,[Ve,Ze]=m.useState(r??null),re=Ye?o:Ve,Be=P||I,be=m.useCallback(ne=>mr(ne,l),[l]),Ee=m.useCallback(ne=>It(ne,d),[d]),on=m.useMemo(()=>{const ne=new Set;if(!re)return ne;try{if(b&&Array.isArray(re))for(const ze of re)ne.add(It(ze,d));else re&&ne.add(It(re,d))}catch{}return ne},[re,b,d]),fn=m.useCallback(ne=>{try{return on.has(It(ne,d))}catch{return!1}},[on,d]),Q=m.useMemo(()=>Md(n),[n]),Fe=m.useMemo(()=>{if(!T||!Re.trim())return n;try{return Q?Fd(n,Re,l,M):Ds(n,Re,l,M)}catch{return n}},[n,Re,T,M,l,Q]),$e=m.useMemo(()=>Q?Nd(Fe):Fe.map((ne,ze)=>({tipo:"opcion",datos:ne,indice:ze})),[Fe,Q]),ge=m.useMemo(()=>Ad(re,D),[re,D]),xe=m.useMemo(()=>Dd(q,$,ge),[q,$,ge]),pn=$==="valid"&&!xe,{refs:He,floatingStyles:wn,context:Ge,placement:nt}=po({open:H,onOpenChange:ne=>{Be||A||(me(ne),ne?(B?.(),dn(""),Ce(0)):G?.())},strategy:"fixed",transform:!1,placement:"bottom-start",middleware:[oo(4),io({padding:8}),ro({padding:8}),Ui({apply({rects:ne,elements:ze}){Object.assign(ze.floating.style,{width:`${ne.reference.width}px`})},padding:8})],whileElementsMounted:eo}),tt=nt.startsWith("top"),{isMounted:No,styles:Fo}=wo(Ge,{duration:v||$e.length>Hd?0:200,initial:{opacity:0,transform:tt?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},open:{opacity:1,transform:"translateY(0) scale(1)"},close:{opacity:0,transform:tt?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},common:{transformOrigin:tt?"bottom":"top"}}),Ia=Id({count:$e.length,getScrollElement:()=>we.current,estimateSize:()=>y,overscan:Gd,enabled:F&&H&&$e.length>xo}),Df=vs(Ge,{enabled:!Be&&!A}),Lf=go(Ge),Pf=bo(Ge,{role:"listbox"}),Tf=m.useMemo(()=>{try{return zd($e)}catch{return[]}},[$e]),Of=hr(Ge,{listRef:ee,activeIndex:Y,onNavigate:Ce,loop:!0,virtual:F,disabledIndices:Tf}),Ea=m.useRef([]);m.useEffect(()=>{Ea.current=$e.map(ne=>ne.tipo==="opcion"&&ne.datos?be(ne.datos):null)},[$e,be]);const qf=xs(Ge,{listRef:Ea,activeIndex:Y,onMatch:H?Ce:void 0,enabled:!T}),{getReferenceProps:Vf,getFloatingProps:jf,getItemProps:Ma}=ho([Df,Lf,Pf,Of,qf]),Kn=m.useCallback(ne=>{Ye||Ze(ne),i?.(ne),a?.(ne)},[Ye,i,a]),zo=m.useCallback(ne=>{if(!Co(ne))if(b){const ze=Array.isArray(re)?re:[],kn=ze.some(_n=>Ee(_n)===Ee(ne));Kn(kn?ze.filter(_n=>Ee(_n)!==Ee(ne)):[...ze,ne])}else Kn(ne),me(!1)},[b,re,Ee,Kn]),Bf=m.useCallback(ne=>{ne.stopPropagation(),Kn(b?[]:null),J?.(),ve.current?.focus()},[b,Kn,J]),Na=m.useCallback((ne,ze)=>{ze.stopPropagation(),!(!b||!Array.isArray(re))&&Kn(re.filter(kn=>Ee(kn)!==Ee(ne)))},[b,re,Ee,Kn]),Hf=m.useCallback(ne=>{const ze=ne.target.value;dn(ze),V?.(ze),Ce(0)},[V]),Gf=m.useCallback(ne=>{if(ne.key==="Enter"&&Y!==null){ne.preventDefault();const ze=$e[Y];ze?.tipo==="opcion"&&ze.datos&&zo(ze.datos)}},[Y,$e,zo]);m.useEffect(()=>{H&&T&&requestAnimationFrame(()=>Se.current?.focus())},[H,T]),m.useEffect(()=>()=>{ee.current=[]},[$e.length]),m.useImperativeHandle(t,()=>({focus:()=>ve.current?.focus(),blur:()=>ve.current?.blur(),open:()=>me(!0),close:()=>me(!1),clear:()=>Kn(b?[]:null)}));const Ao=b?Array.isArray(re)&&re.length>0:re!=null&&re!=="",Fa=m.useCallback(()=>{if(f)return f(re??null);if(!Ao)return s.jsx("span",{className:X.placeholder,children:C});if(b&&Array.isArray(re)){if(re.length===0)return s.jsx("span",{className:X.placeholder,children:C});const ne=S?re:re.slice(0,2),ze=S?0:Math.max(0,re.length-2);return s.jsxs(s.Fragment,{children:[ne.map(kn=>s.jsxs("span",{className:X.chip_multi,children:[s.jsx("span",{className:X.chip_texto,children:be(kn)}),!A&&!Be&&s.jsx("button",{type:"button",className:X.chip_cerrar,onClick:_n=>Na(kn,_n),children:s.jsx(Ps,{size:"1em"})})]},Ee(kn))),ze>0&&s.jsxs("span",{className:X.contador_multi,children:["+",ze]})]})}return s.jsx("span",{className:X.valor_texto,children:be(re)})},[f,re,Ao,C,b,S,A,Be,Ee,be,Na]),za=m.useCallback((ne,ze,kn)=>{try{if(ne.tipo==="grupo")return s.jsx("li",{className:K(X.encabezado_grupo,F&&X.opcion_virtual),style:kn,children:ne.nombreGrupo},`grupo-${ne.nombreGrupo}`);const _n=ne.datos;if(!_n)return null;const La=fn(_n),Pa=Y===ze,Wf=Co(_n),Kf=u?u(_n,{isSelected:La,isActive:Pa}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:X.opcion_check,children:s.jsx(Td,{size:"1em"})}),s.jsx("span",{className:X.opcion_contenido,children:be(_n)})]}),Uf=Ee(_n);return s.jsx("li",{ref:Rf=>{ee.current[ze]=Rf},className:K(X.opcion,F&&X.opcion_virtual,{[X.activo]:Pa,[X.seleccionado]:La,[X.deshabilitado]:Wf},fe?.option),style:kn,...Ma({onClick:()=>zo(_n)}),children:Kf},Uf)}catch(_n){return console.error("Error rendering select item:",_n),null}},[F,Y,fn,u,be,Ee,fe?.option,Ma,zo]),Aa=typeof k=="function"?k({invalido:xe,mensaje:ge}):k??ge,Da=K(X.contenedor_base,X[`variante_${g}`],X[`tam_${c}`],X[`radio_${h}`],X[`color_${_}`],{[X.ancho_total]:p,[X.sin_animacion]:v,[X.deshabilitado]:Be,[X.solo_lectura]:A,[X.invalido]:xe,[X.valido]:pn,[X.abierto]:H,[X.tiene_valor]:Ao},fe?.base,he);return j&&!Q?s.jsx(Vd,{...e,esInvalido:xe,estaDeshabilitadoReal:Be,clasesBase:Da,renderizarValorMostrado:Fa}):s.jsxs("div",{className:Da,style:_e,children:[w&&s.jsxs("label",{id:`${ye}-label`,className:K(X.etiqueta,fe?.label),children:[w,N&&s.jsx("span",{className:X.marca_requerido,children:"*"})]}),s.jsxs("div",{ref:ne=>{He.setReference(ne),ve.current=ne},id:ye,tabIndex:Be?-1:0,className:K(X.trigger,S&&b&&X.trigger_expandido,fe?.trigger),"aria-labelledby":w?`${ye}-label`:void 0,onFocus:U,onBlur:pe,...Vf(),children:[R&&s.jsx("span",{className:X.contenido_inicio,children:R}),s.jsx("div",{className:K(X.valor_wrapper,S&&b&&X.mostrar_todos,S&&b&&X.valor_wrapper_expandido,fe?.value),children:Fa()}),s.jsxs("div",{className:X.acciones,children:[O&&Ao&&!A&&!Be&&s.jsx("button",{type:"button",className:K(X.boton_limpiar,fe?.clearButton),onClick:Bf,tabIndex:-1,children:s.jsx(Ps,{size:"1em"})}),te&&s.jsx("span",{className:X.contenido_final,children:te}),I?s.jsx("span",{className:X.icono_spinner,children:s.jsx(qd,{size:"1em"})}):s.jsx("span",{className:X.icono_chevron,children:s.jsx(Ls,{size:"1em"})})]})]}),(se||N)&&s.jsx("input",{type:"text",name:se,required:N,value:b&&Array.isArray(re)?re.map(Ee).join(","):re?Ee(re):"",onChange:()=>{},onFocus:ne=>ne.target.blur(),"aria-hidden":"true",className:X.input_validacion}),No&&s.jsx(_o,{root:ae,children:s.jsx(fr,{context:Ge,modal:!1,initialFocus:T?Se:-1,children:s.jsxs("div",{ref:He.setFloating,style:{...wn,...Fo,zIndex:oe??"var(--z-popover)"},className:K(X.menu,fe?.menu),...jf(),children:[T&&s.jsx("div",{className:X.buscador_wrapper,children:s.jsxs("div",{className:X.buscador_interno,children:[s.jsx("span",{className:X.icono_buscar,children:s.jsx(Od,{size:"1em"})}),s.jsx("input",{ref:Se,type:"text",className:K(X.input_busqueda,fe?.searchInput),placeholder:"Buscar...",value:Re,onChange:Hf,onKeyDown:Gf})]})}),s.jsx("ul",{ref:we,className:K(X.lista_opciones,F&&X.lista_virtual),style:{height:F&&$e.length>xo?`${vr}px`:`${Math.min($e.length*y,vr)}px`,maxHeight:`${vr}px`,overflow:"auto",position:F&&$e.length>xo?"relative":void 0},children:$e.length===0?s.jsx("li",{className:X.sin_resultados,children:Re?L:z}):F&&$e.length>xo?s.jsx(s.Fragment,{children:s.jsx("div",{style:{height:`${Ia.getTotalSize()}px`,position:"relative",width:"100%"},children:Ia.getVirtualItems().map(ne=>{const ze=$e[ne.index];return ze?s.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,width:"100%",height:`${ne.size}px`,transform:`translateY(${ne.start}px)`},children:za(ze,ne.index)},`virtual-${ne.index}`):null})})}):$e.map((ne,ze)=>za(ne,ze))})]})})}),x&&!xe&&s.jsx("div",{className:K(X.descripcion,fe?.description),children:x}),xe&&Aa&&s.jsx("div",{className:K(X.mensaje_error,fe?.errorMessage),children:Aa})]})}const Kd=m.forwardRef(Wd),Ts=m.memo(Kd);Ts.displayName="SelectBase";function Ud(e,t){const{options:n=[],value:o,onChange:r,onValueChange:i,optionValueKey:a,optionLabelKey:l="label",isMultiple:d=!1,devolverObjeto:u=!1,...f}=e,g=m.useMemo(()=>n.length>0&&typeof n[0]=="object",[n]),_=m.useMemo(()=>{if(!g||!a)return null;const p=new Map;for(const v of n)p.set(String(v[a]),v);return p},[n,a,g]),c=m.useMemo(()=>{if(o==null||!g||u)return o;const p=v=>_?.get(String(v));return d&&Array.isArray(o)?o.map(p).filter(v=>v!==void 0):p(o)??null},[o,_,d,u,g]),h=m.useCallback(p=>{const v=r||i;if(!v)return;if(p===null){v(d?[]:u||!g?null:"");return}if(u||!g){v(p);return}const w=C=>typeof C=="string"?C:C[a];v(d&&Array.isArray(p)?p.map(w):w(p))},[r,i,u,d,a,g]);return s.jsx(Ts,{...f,ref:t,options:n,value:c,onChange:h,optionValueKey:a,optionLabelKey:l,isMultiple:d})}const Os=m.forwardRef(Ud);Os.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 jn(e,t){return typeof e=="function"?e(t):e}function vn(e,t){return n=>{t.setState(o=>({...o,[e]:jn(n,o[e])}))}}function So(e){return e instanceof Function}function Rd(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Xd(e,t){const n=[],o=r=>{r.forEach(i=>{n.push(i);const a=t(i);a!=null&&a.length&&o(a)})};return o(e),n}function ce(e,t,n){let o=[],r;return i=>{let a;n.key&&n.debug&&(a=Date.now());const l=e(i);if(!(l.length!==o.length||l.some((f,g)=>o[g]!==f)))return r;o=l;let u;if(n.key&&n.debug&&(u=Date.now()),r=t(...l),n==null||n.onChange==null||n.onChange(r),n.key&&n.debug&&n!=null&&n.debug()){const f=Math.round((Date.now()-a)*100)/100,g=Math.round((Date.now()-u)*100)/100,_=g/16,c=(h,p)=>{for(h=String(h);h.length<p;)h=" "+h;return h};console.info(`%c⏱ ${c(g,5)} /${c(f,5)} ms`,`
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%);`,n?.key)}return r}}function de(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 Yd(e,t,n,o){const r=()=>{var a;return(a=i.getValue())!=null?a:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:r,getContext:ce(()=>[e,n,t,i],(a,l,d,u)=>({table:a,column:l,row:d,cell:u,getValue:u.getValue,renderValue:u.renderValue}),de(e.options,"debugCells","cell.getContext"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(i,n,t,e)},{}),i}function Zd(e,t,n,o){var r,i;const l={...e._getDefaultColumnDef(),...t},d=l.accessorKey;let u=(r=(i=l.id)!=null?i:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?r:typeof l.header=="string"?l.header:void 0,f;if(l.accessorFn?f=l.accessorFn:d&&(d.includes(".")?f=_=>{let c=_;for(const p of d.split(".")){var h;c=(h=c)==null?void 0:h[p],process.env.NODE_ENV!=="production"&&c===void 0&&console.warn(`"${p}" in deeply nested key "${d}" returned undefined.`)}return c}:f=_=>_[l.accessorKey]),!u)throw process.env.NODE_ENV!=="production"?new Error(l.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let g={id:`${String(u)}`,accessorFn:f,parent:o,depth:n,columnDef:l,columns:[],getFlatColumns:ce(()=>[!0],()=>{var _;return[g,...(_=g.columns)==null?void 0:_.flatMap(c=>c.getFlatColumns())]},de(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ce(()=>[e._getOrderColumnsFn()],_=>{var c;if((c=g.columns)!=null&&c.length){let h=g.columns.flatMap(p=>p.getLeafColumns());return _(h)}return[g]},de(e.options,"debugColumns","column.getLeafColumns"))};for(const _ of e._features)_.createColumn==null||_.createColumn(g,e);return g}const an="debugHeaders";function qs(e,t,n){var o;let i={id:(o=n.id)!=null?o:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],l=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(l),a.push(d)};return l(i),a},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(i,e)}),i}const Jd={createTable:e=>{e.getHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>{var i,a;const l=(i=o?.map(g=>n.find(_=>_.id===g)).filter(Boolean))!=null?i:[],d=(a=r?.map(g=>n.find(_=>_.id===g)).filter(Boolean))!=null?a:[],u=n.filter(g=>!(o!=null&&o.includes(g.id))&&!(r!=null&&r.includes(g.id)));return $o(t,[...l,...u,...d],e)},de(e.options,an,"getHeaderGroups")),e.getCenterHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>(n=n.filter(i=>!(o!=null&&o.includes(i.id))&&!(r!=null&&r.includes(i.id))),$o(t,n,e,"center")),de(e.options,an,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var r;const i=(r=o?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?r:[];return $o(t,i,e,"left")},de(e.options,an,"getLeftHeaderGroups")),e.getRightHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var r;const i=(r=o?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?r:[];return $o(t,i,e,"right")},de(e.options,an,"getRightHeaderGroups")),e.getFooterGroups=ce(()=>[e.getHeaderGroups()],t=>[...t].reverse(),de(e.options,an,"getFooterGroups")),e.getLeftFooterGroups=ce(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),de(e.options,an,"getLeftFooterGroups")),e.getCenterFooterGroups=ce(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),de(e.options,an,"getCenterFooterGroups")),e.getRightFooterGroups=ce(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),de(e.options,an,"getRightFooterGroups")),e.getFlatHeaders=ce(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,an,"getFlatHeaders")),e.getLeftFlatHeaders=ce(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,an,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ce(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,an,"getCenterFlatHeaders")),e.getRightFlatHeaders=ce(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,an,"getRightFlatHeaders")),e.getCenterLeafHeaders=ce(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),de(e.options,an,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ce(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),de(e.options,an,"getLeftLeafHeaders")),e.getRightLeafHeaders=ce(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),de(e.options,an,"getRightLeafHeaders")),e.getLeafHeaders=ce(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,o)=>{var r,i,a,l,d,u;return[...(r=(i=t[0])==null?void 0:i.headers)!=null?r:[],...(a=(l=n[0])==null?void 0:l.headers)!=null?a:[],...(d=(u=o[0])==null?void 0:u.headers)!=null?d:[]].map(f=>f.getLeafHeaders()).flat()},de(e.options,an,"getLeafHeaders"))}};function $o(e,t,n,o){var r,i;let a=0;const l=function(_,c){c===void 0&&(c=1),a=Math.max(a,c),_.filter(h=>h.getIsVisible()).forEach(h=>{var p;(p=h.columns)!=null&&p.length&&l(h.columns,c+1)},0)};l(e);let d=[];const u=(_,c)=>{const h={depth:c,id:[o,`${c}`].filter(Boolean).join("_"),headers:[]},p=[];_.forEach(v=>{const w=[...p].reverse()[0],C=v.column.depth===h.depth;let x,k=!1;if(C&&v.column.parent?x=v.column.parent:(x=v.column,k=!0),w&&w?.column===x)w.subHeaders.push(v);else{const z=qs(n,x,{id:[o,c,x.id,v?.id].filter(Boolean).join("_"),isPlaceholder:k,placeholderId:k?`${p.filter(L=>L.column===x).length}`:void 0,depth:c,index:p.length});z.subHeaders.push(v),p.push(z)}h.headers.push(v),v.headerGroup=h}),d.push(h),c>0&&u(p,c-1)},f=t.map((_,c)=>qs(n,_,{depth:a,index:c}));u(f,a-1),d.reverse();const g=_=>_.filter(h=>h.column.getIsVisible()).map(h=>{let p=0,v=0,w=[0];h.subHeaders&&h.subHeaders.length?(w=[],g(h.subHeaders).forEach(x=>{let{colSpan:k,rowSpan:z}=x;p+=k,w.push(z)})):p=1;const C=Math.min(...w);return v=v+C,h.colSpan=p,h.rowSpan=v,{colSpan:p,rowSpan:v}});return g((r=(i=d[0])==null?void 0:i.headers)!=null?r:[]),d}const br=(e,t,n,o,r,i,a)=>{let l={id:t,index:o,original:n,depth:r,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(l._valuesCache.hasOwnProperty(d))return l._valuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return l._valuesCache[d]=u.accessorFn(l.original,o),l._valuesCache[d]},getUniqueValues:d=>{if(l._uniqueValuesCache.hasOwnProperty(d))return l._uniqueValuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(l._uniqueValuesCache[d]=u.columnDef.getUniqueValues(l.original,o),l._uniqueValuesCache[d]):(l._uniqueValuesCache[d]=[l.getValue(d)],l._uniqueValuesCache[d])},renderValue:d=>{var u;return(u=l.getValue(d))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Xd(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:ce(()=>[e.getAllLeafColumns()],d=>d.map(u=>Yd(e,l,u,u.id)),de(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ce(()=>[l.getAllCells()],d=>d.reduce((u,f)=>(u[f.column.id]=f,u),{}),de(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},Qd={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()}}},Vs=(e,t,n)=>{var o,r;const i=n==null||(o=n.toString())==null?void 0:o.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(i))};Vs.autoRemove=e=>Cn(e);const js=(e,t,n)=>{var o;return!!(!((o=e.getValue(t))==null||(o=o.toString())==null)&&o.includes(n))};js.autoRemove=e=>Cn(e);const Bs=(e,t,n)=>{var o;return((o=e.getValue(t))==null||(o=o.toString())==null?void 0:o.toLowerCase())===n?.toLowerCase()};Bs.autoRemove=e=>Cn(e);const Hs=(e,t,n)=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(n)};Hs.autoRemove=e=>Cn(e);const Gs=(e,t,n)=>!n.some(o=>{var r;return!((r=e.getValue(t))!=null&&r.includes(o))});Gs.autoRemove=e=>Cn(e)||!(e!=null&&e.length);const Ws=(e,t,n)=>n.some(o=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(o)});Ws.autoRemove=e=>Cn(e)||!(e!=null&&e.length);const Ks=(e,t,n)=>e.getValue(t)===n;Ks.autoRemove=e=>Cn(e);const Us=(e,t,n)=>e.getValue(t)==n;Us.autoRemove=e=>Cn(e);const wr=(e,t,n)=>{let[o,r]=n;const i=e.getValue(t);return i>=o&&i<=r};wr.resolveFilterValue=e=>{let[t,n]=e,o=typeof t!="number"?parseFloat(t):t,r=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(o)?-1/0:o,a=n===null||Number.isNaN(r)?1/0:r;if(i>a){const l=i;i=a,a=l}return[i,a]},wr.autoRemove=e=>Cn(e)||Cn(e[0])&&Cn(e[1]);const zn={includesString:Vs,includesStringSensitive:js,equalsString:Bs,arrIncludes:Hs,arrIncludesAll:Gs,arrIncludesSome:Ws,equals:Ks,weakEquals:Us,inNumberRange:wr};function Cn(e){return e==null||e===""}const eu={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:vn("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"?zn.includesString:typeof o=="number"?zn.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?zn.equals:Array.isArray(o)?zn.arrIncludes:zn.weakEquals},e.getFilterFn=()=>{var n,o;return So(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:zn[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,r;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((o=t.options.enableColumnFilters)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(o=>o.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,o;return(n=(o=t.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(o=>{const r=e.getFilterFn(),i=o?.find(f=>f.id===e.id),a=jn(n,i?i.value:void 0);if(Rs(r,a,e)){var l;return(l=o?.filter(f=>f.id!==e.id))!=null?l:[]}const d={id:e.id,value:a};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,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),o=r=>{var i;return(i=jn(t,r))==null?void 0:i.filter(a=>{const l=n.find(d=>d.id===a.id);if(l){const d=l.getFilterFn();if(Rs(d,a.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=t=>{var n,o;e.setColumnFilters(t?[]:(n=(o=e.initialState)==null?void 0:o.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Rs(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const yr={sum:(e,t,n)=>n.reduce((o,r)=>{const i=r.getValue(e);return o+(typeof i=="number"?i:0)},0),min:(e,t,n)=>{let o;return n.forEach(r=>{const i=r.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},max:(e,t,n)=>{let o;return n.forEach(r=>{const i=r.getValue(e);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},extent:(e,t,n)=>{let o,r;return n.forEach(i=>{const a=i.getValue(e);a!=null&&(o===void 0?a>=a&&(o=r=a):(o>a&&(o=a),r<a&&(r=a)))}),[o,r]},mean:(e,t)=>{let n=0,o=0;if(t.forEach(r=>{let i=r.getValue(e);i!=null&&(i=+i)>=i&&(++n,o+=i)}),n)return o/n},median:(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!Rd(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),r=n.sort((i,a)=>i-a);return n.length%2!==0?r[o]:(r[o-1]+r[o])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},nu={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:vn("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 yr.sum;if(Object.prototype.toString.call(o)==="[object Date]")return yr.extent},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return So(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:yr[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 tu(e,t,n){if(!(t!=null&&t.length)||!n)return e;const o=e.filter(i=>!t.includes(i.id));return n==="remove"?o:[...t.map(i=>e.find(a=>a.id===i)).filter(Boolean),...o]}const ou={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:vn("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ce(n=>[Et(t,n)],n=>n.findIndex(o=>o.id===e.id),de(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var o;return((o=Et(t,n)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;const r=Et(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=ce(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,o)=>r=>{let i=[];if(!(t!=null&&t.length))i=r;else{const a=[...t],l=[...r];for(;l.length&&a.length;){const d=a.shift(),u=l.findIndex(f=>f.id===d);u>-1&&i.push(l.splice(u,1)[0])}i=[...i,...l]}return tu(i,n,o)},de(e.options,"debugTable","_getOrderColumnsFn"))}},Cr=()=>({left:[],right:[]}),ru={getInitialState:e=>({columnPinning:Cr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:vn("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);t.setColumnPinning(r=>{var i,a;if(n==="right"){var l,d;return{left:((l=r?.left)!=null?l:[]).filter(g=>!(o!=null&&o.includes(g))),right:[...((d=r?.right)!=null?d:[]).filter(g=>!(o!=null&&o.includes(g))),...o]}}if(n==="left"){var u,f;return{left:[...((u=r?.left)!=null?u:[]).filter(g=>!(o!=null&&o.includes(g))),...o],right:((f=r?.right)!=null?f:[]).filter(g=>!(o!=null&&o.includes(g)))}}return{left:((i=r?.left)!=null?i:[]).filter(g=>!(o!=null&&o.includes(g))),right:((a=r?.right)!=null?a:[]).filter(g=>!(o!=null&&o.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,i,a;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((i=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(l=>l.id),{left:o,right:r}=t.getState().columnPinning,i=n.some(l=>o?.includes(l)),a=n.some(l=>r?.includes(l));return i?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();return r?(n=(o=t.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,o,r)=>{const i=[...o??[],...r??[]];return n.filter(a=>!i.includes(a.column.id))},de(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,o)=>(o??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),de(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,o)=>(o??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),de(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?Cr():(n=(o=e.initialState)==null?void 0:o.columnPinning)!=null?n:Cr())},e.getIsSomeColumnsPinned=t=>{var n;const o=e.getState().columnPinning;if(!t){var r,i;return!!((r=o.left)!=null&&r.length||(i=o.right)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},e.getLeftLeafColumns=ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),de(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),de(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o)=>{const r=[...n??[],...o??[]];return t.filter(i=>!r.includes(i.id))},de(e.options,"debugColumns","getCenterLeafColumns"))}};function iu(e){return e||(typeof document<"u"?document:null)}const ko={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},xr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),su={getDefaultColumnDef:()=>ko,getInitialState:e=>({columnSizing:{},columnSizingInfo:xr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:vn("columnSizing",e),onColumnSizingInfoChange:vn("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,r;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:ko.minSize,(o=i??e.columnDef.size)!=null?o:ko.size),(r=e.columnDef.maxSize)!=null?r:ko.maxSize)},e.getStart=ce(n=>[n,Et(t,n),t.getState().columnSizing],(n,o)=>o.slice(0,e.getIndex(n)).reduce((r,i)=>r+i.getSize(),0),de(t.options,"debugColumns","getStart")),e.getAfter=ce(n=>[n,Et(t,n),t.getState().columnSizing],(n,o)=>o.slice(e.getIndex(n)+1).reduce((r,i)=>r+i.getSize(),0),de(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:o,...r}=n;return r})},e.getCanResize=()=>{var n,o;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((o=t.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var i;n+=(i=r.column.getSize())!=null?i:0}};return o(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const o=t.getColumn(e.column.id),r=o?.getCanResize();return i=>{if(!o||!r||(i.persist==null||i.persist(),Sr(i)&&i.touches&&i.touches.length>1))return;const a=e.getSize(),l=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[o.id,o.getSize()]],d=Sr(i)?Math.round(i.touches[0].clientX):i.clientX,u={},f=(w,C)=>{typeof C=="number"&&(t.setColumnSizingInfo(x=>{var k,z;const L=t.options.columnResizeDirection==="rtl"?-1:1,N=(C-((k=x?.startOffset)!=null?k:0))*L,P=Math.max(N/((z=x?.startSize)!=null?z:0),-.999999);return x.columnSizingStart.forEach(A=>{let[I,O]=A;u[I]=Math.round(Math.max(O+O*P,0)*100)/100}),{...x,deltaOffset:N,deltaPercentage:P}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(x=>({...x,...u})))},g=w=>f("move",w),_=w=>{f("end",w),t.setColumnSizingInfo(C=>({...C,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},c=iu(n),h={moveHandler:w=>g(w.clientX),upHandler:w=>{c?.removeEventListener("mousemove",h.moveHandler),c?.removeEventListener("mouseup",h.upHandler),_(w.clientX)}},p={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),g(w.touches[0].clientX),!1),upHandler:w=>{var C;c?.removeEventListener("touchmove",p.moveHandler),c?.removeEventListener("touchend",p.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),_((C=w.touches[0])==null?void 0:C.clientX)}},v=au()?{passive:!1}:!1;Sr(i)?(c?.addEventListener("touchmove",p.moveHandler,v),c?.addEventListener("touchend",p.upHandler,v)):(c?.addEventListener("mousemove",h.moveHandler,v),c?.addEventListener("mouseup",h.upHandler,v)),t.setColumnSizingInfo(w=>({...w,startOffset:d,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?xr():(n=e.initialState.columnSizingInfo)!=null?n:xr())},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 Io=null;function au(){if(typeof Io=="boolean")return Io;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 Io=e,Io}function Sr(e){return e.type==="touchstart"}const lu={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:vn("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(o=>({...o,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,o;const r=e.columns;return(n=r.length?r.some(i=>i.getIsVisible()):(o=t.getState().columnVisibility)==null?void 0:o[e.id])!=null?n:!0},e.getCanHide=()=>{var n,o;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((o=t.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ce(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),de(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ce(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,o,r)=>[...n,...o,...r],de(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,o)=>ce(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),de(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var o;e.setColumnVisibility(n?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,i)=>({...r,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;e.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}};function Et(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const cu={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()}}},du={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:vn("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const o=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,o,r,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=t.options.enableGlobalFilter)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>zn.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return So(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[o])!=null?t:zn[o]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},uu={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:vn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var r,i;e.setExpanded(o?{}:(r=(i=e.initialState)==null?void 0:i.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const a=i.split(".");o=Math.max(o,a.length)}),o},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(o=>{var r;const i=o===!0?!0:!!(o!=null&&o[e.id]);let a={};if(o===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{a[l]=!0}):a=o,n=(r=n)!=null?r:!i,!i&&n)return{...a,[e.id]:!0};if(i&&!n){const{[e.id]:l,...d}=a;return d}return o})},e.getIsExpanded=()=>{var n;const o=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:o===!0||o?.[e.id])},e.getCanExpand=()=>{var n,o,r;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((o=t.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)o=t.getRow(o.parentId,!0),n=o.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},$r=0,kr=10,Ir=()=>({pageIndex:$r,pageSize:kr}),fu={getInitialState:e=>({...e,pagination:{...Ir(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:vn("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=o=>{const r=i=>jn(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?Ir():(r=e.initialState.pagination)!=null?r:Ir())},e.setPageIndex=o=>{e.setPagination(r=>{let i=jn(o,r.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,a)),{...r,pageIndex:i}})},e.resetPageIndex=o=>{var r,i;e.setPageIndex(o?$r:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:$r)},e.resetPageSize=o=>{var r,i;e.setPageSize(o?kr:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:kr)},e.setPageSize=o=>{e.setPagination(r=>{const i=Math.max(1,jn(o,r.pageSize)),a=r.pageSize*r.pageIndex,l=Math.floor(a/i);return{...r,pageIndex:l,pageSize:i}})},e.setPageCount=o=>e.setPagination(r=>{var i;let a=jn(o,(i=e.options.pageCount)!=null?i:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...r,pageCount:a}}),e.getPageOptions=ce(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((i,a)=>a)),r},de(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}}},Er=()=>({top:[],bottom:[]}),_u={getInitialState:e=>({rowPinning:Er(),...e}),getDefaultOptions:e=>({onRowPinningChange:vn("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,o,r)=>{const i=o?e.getLeafRows().map(d=>{let{id:u}=d;return u}):[],a=r?e.getParentRows().map(d=>{let{id:u}=d;return u}):[],l=new Set([...a,e.id,...i]);t.setRowPinning(d=>{var u,f;if(n==="bottom"){var g,_;return{top:((g=d?.top)!=null?g:[]).filter(p=>!(l!=null&&l.has(p))),bottom:[...((_=d?.bottom)!=null?_:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)]}}if(n==="top"){var c,h;return{top:[...((c=d?.top)!=null?c:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)],bottom:((h=d?.bottom)!=null?h:[]).filter(p=>!(l!=null&&l.has(p)))}}return{top:((u=d?.top)!=null?u:[]).filter(p=>!(l!=null&&l.has(p))),bottom:((f=d?.bottom)!=null?f:[]).filter(p=>!(l!=null&&l.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:r}=t.options;return typeof o=="function"?o(e):(n=o??r)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:o,bottom:r}=t.getState().rowPinning,i=n.some(l=>o?.includes(l)),a=n.some(l=>r?.includes(l));return i?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();if(!r)return-1;const i=(n=r==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:l}=a;return l});return(o=i?.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?Er():(n=(o=e.initialState)==null?void 0:o.rowPinning)!=null?n:Er())},e.getIsSomeRowsPinned=t=>{var n;const o=e.getState().rowPinning;if(!t){var r,i;return!!((r=o.top)!=null&&r.length||(i=o.bottom)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},e._getPinnedRows=(t,n,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(n??[]).map(a=>{const l=e.getRow(a,!0);return l.getIsAllParentsExpanded()?l:null}):(n??[]).map(a=>t.find(l=>l.id===a))).filter(Boolean).map(a=>({...a,position:o}))},e.getTopRows=ce(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),de(e.options,"debugRows","getTopRows")),e.getBottomRows=ce(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),de(e.options,"debugRows","getBottomRows")),e.getCenterRows=ce(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,o)=>{const r=new Set([...n??[],...o??[]]);return t.filter(i=>!r.has(i.id))},de(e.options,"debugRows","getCenterRows"))}},gu={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:vn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const o={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):r.forEach(i=>{delete o[i.id]}),o})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const o=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(i=>{Mr(r,i.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Nr(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Nr(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Nr(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=!!(t.length&&Object.keys(n).length);return o&&t.some(r=>r.getCanSelect()&&!n[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some(r=>!n[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,o)=>{const r=e.getIsSelected();t.setRowSelection(i=>{var a;if(n=typeof n<"u"?n:!r,e.getCanSelect()&&r===n)return i;const l={...i};return Mr(l,e.id,n,(a=o?.selectChildren)!=null?a:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Fr(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return zr(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return zr(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)}}}},Mr=(e,t,n,o,r)=>{var i;const a=r.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),a.getCanSelect()&&(e[t]=!0)):delete e[t],o&&(i=a.subRows)!=null&&i.length&&a.getCanSelectSubRows()&&a.subRows.forEach(l=>Mr(e,l.id,n,o,r))};function Nr(e,t){const n=e.getState().rowSelection,o=[],r={},i=function(a,l){return a.map(d=>{var u;const f=Fr(d,n);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(t.rows),flatRows:o,rowsById:r}}function Fr(e,t){var n;return(n=t[e.id])!=null?n:!1}function zr(e,t,n){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,i=!1;return e.subRows.forEach(a=>{if(!(i&&!r)&&(a.getCanSelect()&&(Fr(a,t)?i=!0:r=!1),a.subRows&&a.subRows.length)){const l=zr(a,t);l==="all"?i=!0:(l==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}const Ar=/([0-9]+)/gm,pu=(e,t,n)=>Xs(Bn(e.getValue(n)).toLowerCase(),Bn(t.getValue(n)).toLowerCase()),hu=(e,t,n)=>Xs(Bn(e.getValue(n)),Bn(t.getValue(n))),mu=(e,t,n)=>Dr(Bn(e.getValue(n)).toLowerCase(),Bn(t.getValue(n)).toLowerCase()),vu=(e,t,n)=>Dr(Bn(e.getValue(n)),Bn(t.getValue(n))),bu=(e,t,n)=>{const o=e.getValue(n),r=t.getValue(n);return o>r?1:o<r?-1:0},wu=(e,t,n)=>Dr(e.getValue(n),t.getValue(n));function Dr(e,t){return e===t?0:e>t?1:-1}function Bn(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Xs(e,t){const n=e.split(Ar).filter(Boolean),o=t.split(Ar).filter(Boolean);for(;n.length&&o.length;){const r=n.shift(),i=o.shift(),a=parseInt(r,10),l=parseInt(i,10),d=[a,l].sort();if(isNaN(d[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(d[1]))return isNaN(a)?-1:1;if(a>l)return 1;if(l>a)return-1}return n.length-o.length}const Mt={alphanumeric:pu,alphanumericCaseSensitive:hu,text:mu,textCaseSensitive:vu,datetime:bu,basic:wu},yu=[Jd,lu,ou,ru,Qd,eu,cu,du,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:vn("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const r of n){const i=r?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Mt.datetime;if(typeof i=="string"&&(o=!0,i.split(Ar).length>1))return Mt.alphanumeric}return o?Mt.text:Mt.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 So(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:Mt[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{const r=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(a=>{const l=a?.find(c=>c.id===e.id),d=a?.findIndex(c=>c.id===e.id);let u=[],f,g=i?n:r==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&o?l?f="toggle":f="add":a!=null&&a.length&&d!==a.length-1?f="replace":l?f="toggle":f="replace",f==="toggle"&&(i||r||(f="remove")),f==="add"){var _;u=[...a,{id:e.id,desc:g}],u.splice(0,u.length-((_=t.options.maxMultiSortColCount)!=null?_:Number.MAX_SAFE_INTEGER))}else f==="toggle"?u=a.map(c=>c.id===e.id?{...c,desc:g}:c):f==="remove"?u=a.filter(c=>c.id!==e.id):u=[{id:e.id,desc:g}];return u})},e.getFirstSortDir=()=>{var n,o;return((n=(o=e.columnDef.sortDescFirst)!=null?o:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var o,r;const i=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==i&&((o=t.options.enableSortingRemoval)==null||o)&&(!(n&&(r=t.options.enableMultiRemove)!=null)||r)?!1:a==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,o;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((o=t.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return(n=(o=e.columnDef.enableMultiSort)!=null?o:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const o=(n=t.getState().sorting)==null?void 0:n.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,o;return(n=(o=t.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return o=>{n&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:(n=(o=e.initialState)==null?void 0:o.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},nu,uu,fu,_u,gu,su];function Cu(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...yu,...(t=e._features)!=null?t:[]];let r={_features:o};const i=r._features.reduce((_,c)=>Object.assign(_,c.getDefaultOptions==null?void 0:c.getDefaultOptions(r)),{}),a=_=>r.options.mergeOptions?r.options.mergeOptions(i,_):{...i,..._};let d={...{},...(n=e.initialState)!=null?n:{}};r._features.forEach(_=>{var c;d=(c=_.getInitialState==null?void 0:_.getInitialState(d))!=null?c:d});const u=[];let f=!1;const g={_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=jn(_,r.options);r.options=a(c)},getState:()=>r.options.state,setState:_=>{r.options.onStateChange==null||r.options.onStateChange(_)},_getRowId:(_,c,h)=>{var p;return(p=r.options.getRowId==null?void 0:r.options.getRowId(_,c,h))!=null?p:`${h?[h.id,c].join("."):c}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(_,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:ce(()=>[r.options.defaultColumn],_=>{var c;return _=(c=_)!=null?c:{},{header:h=>{const p=h.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:h=>{var p,v;return(p=(v=h.renderValue())==null||v.toString==null?void 0:v.toString())!=null?p:null},...r._features.reduce((h,p)=>Object.assign(h,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),..._}},de(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:ce(()=>[r._getColumnDefs()],_=>{const c=function(h,p,v){return v===void 0&&(v=0),h.map(w=>{const C=Zd(r,w,v,p),x=w;return C.columns=x.columns?c(x.columns,C,v+1):[],C})};return c(_)},de(e,"debugColumns","getAllColumns")),getAllFlatColumns:ce(()=>[r.getAllColumns()],_=>_.flatMap(c=>c.getFlatColumns()),de(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ce(()=>[r.getAllFlatColumns()],_=>_.reduce((c,h)=>(c[h.id]=h,c),{}),de(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ce(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(_,c)=>{let h=_.flatMap(p=>p.getLeafColumns());return c(h)},de(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,g);for(let _=0;_<r._features.length;_++){const c=r._features[_];c==null||c.createTable==null||c.createTable(r)}return r}function xu(){return e=>ce(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(r,i,a){i===void 0&&(i=0);const l=[];for(let u=0;u<r.length;u++){const f=br(e,e._getRowId(r[u],u,a),r[u],u,i,void 0,a?.id);if(n.flatRows.push(f),n.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 n.rows=o(t),n},de(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Su(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 $u(e,t,n){return n.options.filterFromLeafRows?ku(e,t,n):Iu(e,t,n)}function ku(e,t,n){var o;const r=[],i={},a=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,u){u===void 0&&(u=0);const f=[];for(let _=0;_<d.length;_++){var g;let c=d[_];const h=br(n,c.id,c.original,c.index,c.depth,void 0,c.parentId);if(h.columnFilters=c.columnFilters,(g=c.subRows)!=null&&g.length&&u<a){if(h.subRows=l(c.subRows,u+1),c=h,t(c)&&!h.subRows.length){f.push(c),i[c.id]=c,r.push(c);continue}if(t(c)||h.subRows.length){f.push(c),i[c.id]=c,r.push(c);continue}}else c=h,t(c)&&(f.push(c),i[c.id]=c,r.push(c))}return f};return{rows:l(e),flatRows:r,rowsById:i}}function Iu(e,t,n){var o;const r=[],i={},a=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,u){u===void 0&&(u=0);const f=[];for(let _=0;_<d.length;_++){let c=d[_];if(t(c)){var g;if((g=c.subRows)!=null&&g.length&&u<a){const p=br(n,c.id,c.original,c.index,c.depth,void 0,c.parentId);p.subRows=l(c.subRows,u+1),c=p}f.push(c),r.push(c),i[c.id]=c}}return f};return{rows:l(e),flatRows:r,rowsById:i}}function Eu(){return e=>ce(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,o)=>{if(!t.rows.length||!(n!=null&&n.length)&&!o){for(let _=0;_<t.flatRows.length;_++)t.flatRows[_].columnFilters={},t.flatRows[_].columnFiltersMeta={};return t}const r=[],i=[];(n??[]).forEach(_=>{var c;const h=e.getColumn(_.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:_.id,filterFn:p,resolvedValue:(c=p.resolveFilterValue==null?void 0:p.resolveFilterValue(_.value))!=null?c:_.value})});const a=(n??[]).map(_=>_.id),l=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(_=>_.getCanGlobalFilter());o&&l&&d.length&&(a.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;_<t.flatRows.length;_++){const c=t.flatRows[_];if(c.columnFilters={},r.length)for(let h=0;h<r.length;h++){u=r[h];const p=u.id;c.columnFilters[p]=u.filterFn(c,p,u.resolvedValue,v=>{c.columnFiltersMeta[p]=v})}if(i.length){for(let h=0;h<i.length;h++){f=i[h];const p=f.id;if(f.filterFn(c,p,f.resolvedValue,v=>{c.columnFiltersMeta[p]=v})){c.columnFilters.__global__=!0;break}}c.columnFilters.__global__!==!0&&(c.columnFilters.__global__=!1)}}const g=_=>{for(let c=0;c<a.length;c++)if(_.columnFilters[a[c]]===!1)return!1;return!0};return $u(t.rows,g,e)},de(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Mu(e){return t=>ce(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,o)=>{if(!o.rows.length)return o;const{pageSize:r,pageIndex:i}=n;let{rows:a,flatRows:l,rowsById:d}=o;const u=r*i,f=u+r;a=a.slice(u,f);let g;t.options.paginateExpandedRows?g={rows:a,flatRows:l,rowsById:d}:g=Su({rows:a,flatRows:l,rowsById:d}),g.flatRows=[];const _=c=>{g.flatRows.push(c),c.subRows.length&&c.subRows.forEach(_)};return g.rows.forEach(_),g},de(t.options,"debugTable","getPaginationRowModel"))}function Nu(){return e=>ce(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const o=e.getState().sorting,r=[],i=o.filter(d=>{var u;return(u=e.getColumn(d.id))==null?void 0:u.getCanSort()}),a={};i.forEach(d=>{const u=e.getColumn(d.id);u&&(a[d.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const l=d=>{const u=d.map(f=>({...f}));return u.sort((f,g)=>{for(let c=0;c<i.length;c+=1){var _;const h=i[c],p=a[h.id],v=p.sortUndefined,w=(_=h?.desc)!=null?_:!1;let C=0;if(v){const x=f.getValue(h.id),k=g.getValue(h.id),z=x===void 0,L=k===void 0;if(z||L){if(v==="first")return z?-1:1;if(v==="last")return z?1:-1;C=z&&L?0:z?v:-v}}if(C===0&&(C=p.sortingFn(f,g,h.id)),C!==0)return w&&(C*=-1),p.invertSorting&&(C*=-1),C}return f.index-g.index}),u.forEach(f=>{var g;r.push(f),(g=f.subRows)!=null&&g.length&&(f.subRows=l(f.subRows))}),u};return{rows:l(n.rows),flatRows:r,rowsById:n.rowsById}},de(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 ft(e,t){return e?Fu(e)?E.createElement(e,t):e:null}function Fu(e){return zu(e)||typeof e=="function"||Au(e)}function zu(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Au(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Du(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=E.useState(()=>({current:Cu(t)})),[o,r]=E.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:a=>{r(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}const 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"},Ys=m.createContext(null),Zs=()=>m.useContext(Ys),_t=m.forwardRef((e,t)=>{const{children:n,label:o,hint:r,isSelected:i,defaultChecked:a,isIndeterminate:l=!1,isDisabled:d=!1,isReadOnly:u=!1,isRequired:f=!1,lineThrough:g=!1,onlyIcon:_=!1,disableAnimation:c=!1,customCheckIcon:h,size:p="md",color:v="primary",customColor:w,radius:C="md",variant:x="solid",className:k="",classNames:z={},onChange:L,value:N,name:P,...A}=e,I=Zs(),O=m.useId(),q=m.useRef(null),$=i!==void 0,[b,S]=m.useState(a??!1),T=!!I,F=T&&N?I.value.includes(N):!1,y=T?F:$?i:b,M=d||I?.isDisabled,D=u||I?.isReadOnly,B=f||I?.isRequired,G=P||I?.name;m.useEffect(()=>{const U=q.current||(t&&typeof t=="object"?t.current:null);U&&(U.indeterminate=l??!1)},[l,t]);const V=U=>{if(M||D)return;const pe=U.target.checked;T&&N?I.onChange(N):($||S(pe),L?.(pe))},J=o||n;return s.jsxs("div",{className:K(Me.checkbox_container,{[Me.disabled]:M,[Me.readonly]:D},z.base,k),children:[s.jsxs("label",{className:K(Me.checkbox_wrapper,Me[p],!w&&Me[v],Me[x],Me[`radius_${C}`],{[Me.checked]:y,[Me.indeterminate]:l,[Me.disabled]:M,[Me.readonly]:D,[Me.line_through]:g&&y,[Me.no_animation]:c}),style:w?{"--checkbox-custom-color":w}:void 0,children:[s.jsxs("span",{className:Me.checkbox,children:[s.jsx("input",{ref:U=>{q.current=U,typeof t=="function"?t(U):t&&(t.current=U)},id:O,type:"checkbox",className:Me.input,checked:y,onChange:V,disabled:M,readOnly:D,required:B,value:N,name:G,...A}),h?s.jsx("span",{className:Me.custom_icon,children:h}):s.jsx("svg",{className:Me.checkbox_svg,viewBox:"0 0 22 22","aria-hidden":"true",children:s.jsx("path",{fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:l?"M6,11 L16,11":"M5.5,11.3L9,14.8L20.2,3.3l0,0c-0.5-1-1.5-1.8-2.7-1.8h-13c-1.7,0-3,1.3-3,3v13c0,1.7,1.3,3,3,3h13 c1.7,0,3-1.3,3-3v-13c0-0.4-0.1-0.8-0.3-1.2"})})]}),!_&&J&&s.jsx("span",{className:K(Me.label_text,z.label),children:J})]}),r&&s.jsx("span",{className:K(Me.hint_text,z.label),children:r})]})});_t.displayName="Checkbox";const Js=({label:e,children:t,description:n,errorMessage:o,isInvalid:r=!1,orientation:i="vertical",className:a,value:l,defaultValue:d=[],onChange:u,isDisabled:f=!1,isReadOnly:g=!1,isRequired:_=!1,name:c,options:h,optionValueKey:p,optionLabelKey:v,optionDisabledKey:w,optionDescriptionKey:C})=>{const x=l!==void 0,[k,z]=m.useState(d),L=x?l:k,N=P=>{if(f||g)return;const A=L.includes(P)?L.filter(I=>I!==P):[...L,P];x||z(A),u?.(A)};return s.jsxs("div",{className:K(Me.checkbox_group,Me[i],{[Me.invalid]:r,[Me.disabled]:f,[Me.readonly]:g},a),role:"group","aria-required":_,"aria-invalid":r,children:[e&&s.jsxs("div",{className:Me.label,children:[e,_&&s.jsx("span",{className:Me.marca_requerido,children:" *"})]}),n&&s.jsx("div",{className:Me.description,children:n}),s.jsx(Ys.Provider,{value:{value:L,onChange:N,isDisabled:f,isReadOnly:g,isRequired:_,name:c},children:s.jsx("div",{className:K(Me.checkboxes,Me[i]),children:h&&h.length>0?h.map((P,A)=>{let I,O,q=!1,$;if(typeof P=="object"&&P!==null){const b=p??"value",S=v??"label",T=w??"isDisabled",F=C??"description",y=P[b],M=P[S];I=String(y!==void 0?y:A),O=M;const D=P[T];q=typeof D=="boolean"?D:!1;const B=P[F];$=typeof B=="string"?B:void 0}else I=String(P),O=P;return s.jsx(_t,{value:I,isDisabled:q,hint:$,children:O},I)}):t})}),o&&r&&s.jsx("div",{className:Me.error_message,children:o})]})};Js.displayName="CheckboxGroup";const Nt={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 Ft({content:e,children:t,placement:n="top",variant:o="default",size:r="md",offset:i=8,delayShow:a=100,delayHide:l=0,isDisabled:d=!1,showArrow:u=!1,maxWidth:f="320px",isInteractive:g=!1,className:_="",onOpen:c,onClose:h,isOpen:p,onOpenChange:v}){const[w,C]=m.useState(!1),x=m.useRef(null),k=p!==void 0?p:w,z=m.useCallback(D=>{d||(v?v(D):C(D),D?c?.():h?.())},[d,v,c,h]),{refs:L,floatingStyles:N,context:P,isPositioned:A}=po({open:k,onOpenChange:z,placement:n,strategy:"fixed",middleware:[oo(i+(u?8:0)),io({fallbackAxisSideDirection:"start",padding:8}),ro({padding:8}),u?Bc({element:x}):void 0].filter(Boolean),whileElementsMounted:eo}),I=lr(P,{delay:{open:a,close:g?200:l||100},enabled:!d,move:!1,handleClose:null}),O=dd(P,{enabled:!d}),q=go(P,{enabled:!d}),$=bo(P,{role:"tooltip"}),{getReferenceProps:b,getFloatingProps:S}=ho([I,O,q,$]),{isMounted:T,styles:F}=wo(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)"}}),y=m.useMemo(()=>[Nt.tooltip,Nt[`size_${r}`],Nt[`variant_${o}`],_].filter(Boolean).join(" "),[r,o,_]),M=m.useMemo(()=>m.cloneElement(t,b({ref:L.setReference,...t.props})),[t,b,L.setReference]);return!e||d?t:s.jsxs(s.Fragment,{children:[M,T&&s.jsx(_o,{children:s.jsx("div",{ref:L.setFloating,className:Nt.tooltip_positioner,style:{...N,maxWidth:f,zIndex:9999,pointerEvents:"none"},children:s.jsxs("div",{className:y,style:{...F,pointerEvents:g?"auto":"none",visibility:A||!k?"visible":"hidden"},...S(),children:[e,u&&s.jsx(Rc,{ref:x,context:P,className:Nt.arrow})]})})})]})}const Ue={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 Lu(e,t,n=3){const o=Math.floor(n/2);let r=e-o;r<1&&(r=1),r+n-1>t&&(r=Math.max(1,t-n+1));const i=Math.min(n,t);return Array.from({length:i},(a,l)=>r+l)}function Pu(e,t){return t===0?0:e>=t?t-1:e<0?0:e}function Tu(e){return e?{asc:" ↑",desc:" ↓"}[e]??null:null}function gt(e,t){const n=new Map;t.getFlatHeaders().forEach(a=>n.set(a.column.id,a));const o=n.get(e);if(o)return ft(o.column.columnDef.header,o.getContext());const r=t.getAllLeafColumns().find(a=>a.id===e),i=r?.columnDef.header;return typeof i=="string"||typeof i=="number"?i:r?.id??e}function Qs(e,t){const n=e.getVisibleCells().find(o=>o.column.id===t);return n?ft(n.column.columnDef.cell,n.getContext()):null}function ea(e,t){return t?e.getVisibleCells().map(o=>o.column.id).includes(t):!1}function Ou(e,t,n){return e.getVisibleCells().filter(o=>o.column.id!=="actions"&&o.column.id!==t&&o.column.id!==n)}function qu(e,t){if(t===0)return"";if(t===1)return Lr(e[0].nombre.toLowerCase());if(t===2)return`${Lr(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const n=e.slice(0,2).map(r=>r.nombre.toLowerCase()),o=t-2;return`${Lr(n.join(", "))} y ${o>1?`otros ${o}`:"otro"} más`}function Lr(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function na(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}const ta=m.createContext(null),Pr=ta;function Vu({children:e,data:t,columns:n,controls:o,loading:r,primerasColumnas:i,tamanioPaginaInicial:a=10,filtros:l,descargarExcel:d,actualizarTabla:u,selectorFilas:f=[],sinDatosProps:g}){const[_,c]=m.useState(""),h=Ed(_,200),p=yo("only screen and (max-width: 830px)"),[v,w]=m.useState({pageIndex:0,pageSize:a}),[C,x]=m.useState({}),k=m.useMemo(()=>{const y=[];if(f.length>0&&!p){const M={id:"select",header:({table:D})=>s.jsx(_t,{color:"secondary",isSelected:D.getIsAllPageRowsSelected(),isIndeterminate:D.getIsSomePageRowsSelected()&&!D.getIsAllPageRowsSelected(),onChange:B=>D.toggleAllPageRowsSelected(!!B)}),cell:({row:D})=>s.jsx(_t,{color:"primary",isSelected:D.getIsSelected(),isDisabled:!D.getCanSelect(),onChange:B=>D.toggleSelected(B)}),enableSorting:!1,enableHiding:!1};y.push(M)}if(y.push(...n),o?.length){const M={id:"actions",header:"Acciones",cell:D=>s.jsx("div",{className:Ue.contenedor_acciones,children:o.map(B=>s.jsx(Ft,{content:B.nombre,variant:"default",size:"sm",placement:"top",children:s.jsx("button",{type:"button",onClick:()=>B.evento(D.row.original),className:Ue.boton_acciones,children:B.icono})},B.id))}),enableSorting:!1,enableHiding:!1};y.push(M)}return y},[n,o,f,p]),z=m.useMemo(()=>{const y=k.map(D=>"accessorKey"in D?String(D.accessorKey):"id"in D?String(D.id):"").filter(Boolean),M=y.indexOf("actions");return M>-1&&M<y.length-1&&(y.splice(M,1),y.push("actions")),y},[k]),[L,N]=m.useState(z),P=m.useCallback((y,M,D)=>{if(!D)return!0;const B=na(D),G=y.getValue(M);return G==null?!1:na(String(G)).includes(B)},[]),A=Du({data:t,columns:k,state:{pagination:v,globalFilter:h,columnOrder:L,rowSelection:C},globalFilterFn:P,enableRowSelection:f.length>0,onRowSelectionChange:x,onPaginationChange:w,onColumnOrderChange:N,getCoreRowModel:xu(),getSortedRowModel:Nu(),getFilteredRowModel:Eu(),getPaginationRowModel:Mu(),autoResetPageIndex:!1}),I=A.getPageCount();m.useEffect(()=>{const y=Pu(v.pageIndex,I);y!==v.pageIndex&&w(M=>({...M,pageIndex:y}))},[I]),m.useEffect(()=>{h!==void 0&&A.setPageIndex(0)},[h]);const O=m.useMemo(()=>A.getAllLeafColumns().filter(y=>y.id!=="actions"&&y.id!=="select"&&y.getCanHide?.()),[A]),q=m.useCallback(y=>{const D=n.find(B=>"accessorKey"in B?B.accessorKey===y:B.id===y)?.header;return typeof D=="string"||typeof D=="number"?String(D):y},[n]),$=m.useCallback(()=>{A.setColumnVisibility({}),A.setPageSize(a),A.setPageIndex(0),A.resetRowSelection(),N(z)},[A,a,z]),b=m.useCallback(y=>{const M=Math.max(1,Math.min(200,y));A.setPageSize(M),A.setPageIndex(0)},[A]),S=m.useCallback(y=>{N(M=>typeof y=="function"?y(M):y)},[]),F={state:{ordenColumnas:L,table:A,columns:k,controls:o,loading:r,primerasColumnas:[String(i[0]),String(i[1])],inputBusqueda:_,setInputBusqueda:c,filtros:l,descargarExcel:d,actualizarTabla:u,selectorFilas:f,sinDatosProps:g},todasLasColumnas:O,etiquetaColumna:q,restaurarConfiguracion:$,cambiarPageSize:b,cambiarOrdenColumnas:S};return s.jsx(ta.Provider,{value:F,children:e})}function ju(){const e=m.useContext(Pr);if(!e)throw new Error("useTablaContext debe usarse dentro de TablaDatosProvider");return e}function Hn(){const e=m.useContext(Pr);return e||null}const An={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 oa(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function ra(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"M9.29 15.88L13.17 12L9.29 8.12a.996.996 0 1 1 1.41-1.41l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3a.996.996 0 0 1-1.41 0c-.38-.39-.39-1.03 0-1.42"})})}function Bu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"M21.71 20.29L18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.39M11 18a7 7 0 1 1 7-7a7 7 0 0 1-7 7"})})}function Hu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"m2.859 2.877l12.57-1.795a.5.5 0 0 1 .571.494v20.848a.5.5 0 0 1-.57.494L2.858 21.123a1 1 0 0 1-.859-.99V3.867a1 1 0 0 1 .859-.99M17 3h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4zm-6.8 9L13 8h-2.4L9 10.286L7.4 8H5l2.8 4L5 16h2.4L9 13.714L10.6 16H13z"})})}function Gu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9.145 17.704v-3.976c0-.381 0-.572-.044-.75a1.5 1.5 0 0 0-.192-.446c-.1-.155-.238-.286-.515-.548L3.578 7.43a2.648 2.648 0 0 1 1.82-4.572h13.189a2.664 2.664 0 0 1 1.852 4.579l-4.765 4.607c-.27.261-.405.392-.501.545a1.5 1.5 0 0 0-.187.441c-.044.176-.044.364-.044.74v3.935c0 .542 0 .813-.062 1.057a2 2 0 0 1-.641 1.027c-.192.163-.436.282-.923.52c-1.14.557-1.709.835-2.172.835a2 2 0 0 1-1.795-1.121c-.204-.416-.204-1.05-.204-2.318"})})}function Wu(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[s.jsx("path",{fill:"currentColor",d:"M12.079 2.25c-4.794 0-8.734 3.663-9.118 8.333H2a.75.75 0 0 0-.528 1.283l1.68 1.666a.75.75 0 0 0 1.056 0l1.68-1.666a.75.75 0 0 0-.528-1.283h-.893c.38-3.831 3.638-6.833 7.612-6.833a7.66 7.66 0 0 1 6.537 3.643a.75.75 0 1 0 1.277-.786A9.16 9.16 0 0 0 12.08 2.25"}),s.jsx("path",{fill:"currentColor",d:"M20.841 10.467a.75.75 0 0 0-1.054 0L18.1 12.133a.75.75 0 0 0 .527 1.284h.899c-.381 3.83-3.651 6.833-7.644 6.833a7.7 7.7 0 0 1-6.565-3.644a.75.75 0 1 0-1.276.788a9.2 9.2 0 0 0 7.84 4.356c4.809 0 8.766-3.66 9.151-8.333H22a.75.75 0 0 0 .527-1.284z",opacity:".5"})]})}function Ku(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[s.jsx("circle",{cx:"12",cy:"12",r:"3"}),s.jsx("path",{d:"M13.765 2.152C13.398 2 12.932 2 12 2s-1.398 0-1.765.152a2 2 0 0 0-1.083 1.083c-.092.223-.129.484-.143.863a1.62 1.62 0 0 1-.79 1.353a1.62 1.62 0 0 1-1.567.008c-.336-.178-.579-.276-.82-.308a2 2 0 0 0-1.478.396C4.04 5.79 3.806 6.193 3.34 7s-.7 1.21-.751 1.605a2 2 0 0 0 .396 1.479c.148.192.355.353.676.555c.473.297.777.803.777 1.361s-.304 1.064-.777 1.36c-.321.203-.529.364-.676.556a2 2 0 0 0-.396 1.479c.052.394.285.798.75 1.605c.467.807.7 1.21 1.015 1.453a2 2 0 0 0 1.479.396c.24-.032.483-.13.819-.308a1.62 1.62 0 0 1 1.567.008c.483.28.77.795.79 1.353c.014.38.05.64.143.863a2 2 0 0 0 1.083 1.083C10.602 22 11.068 22 12 22s1.398 0 1.765-.152a2 2 0 0 0 1.083-1.083c.092-.223.129-.483.143-.863c.02-.558.307-1.074.79-1.353a1.62 1.62 0 0 1 1.567-.008c.336.178.579.276.819.308a2 2 0 0 0 1.479-.396c.315-.242.548-.646 1.014-1.453s.7-1.21.751-1.605a2 2 0 0 0-.396-1.479c-.148-.192-.355-.353-.676-.555A1.62 1.62 0 0 1 19.562 12c0-.558.304-1.064.777-1.36c.321-.203.529-.364.676-.556a2 2 0 0 0 .396-1.479c-.052-.394-.285-.798-.75-1.605c-.467-.807-.7-1.21-1.015-1.453a2 2 0 0 0-1.479-.396c-.24.032-.483.13-.82.308a1.62 1.62 0 0 1-1.566-.008a1.62 1.62 0 0 1-.79-1.353c-.014-.38-.05-.64-.143-.863a2 2 0 0 0-1.083-1.083Z"})]})})}function Uu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:s.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M256 448c-97.974 0-178.808-73.383-190.537-168.183l42.341-5.293c9.123 73.734 71.994 130.809 148.196 130.809c82.475 0 149.333-66.858 149.333-149.333S338.475 106.667 256 106.667c-50.747 0-95.581 25.312-122.567 64h79.9v42.666H64V64h42.667v71.31C141.866 91.812 195.685 64 256 64c106.039 0 192 85.961 192 192s-85.961 192-192 192",clipRule:"evenodd"})})}function Ru(e){return s.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",...e,children:[s.jsx("rect",{x:"6",y:"3.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),s.jsx("rect",{x:"6",y:"7.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),s.jsx("rect",{x:"6",y:"11.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"})]})}function Xu(e){return s.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[s.jsx("rect",{x:"3",y:"3",width:"4",height:"14",rx:"1",fill:"currentColor"}),s.jsx("rect",{x:"8",y:"3",width:"9",height:"14",rx:"1",fill:"currentColor",opacity:".3"})]})}function Yu(e){return s.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[s.jsx("rect",{x:"3",y:"3",width:"14",height:"4",rx:"1",fill:"currentColor"}),s.jsx("rect",{x:"3",y:"8",width:"14",height:"9",rx:"1",fill:"currentColor",opacity:".3"})]})}function ia(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"M11 13H6q-.425 0-.712-.288T5 12t.288-.712T6 11h5V6q0-.425.288-.712T12 5t.713.288T13 6v5h5q.425 0 .713.288T19 12t-.288.713T18 13h-5v5q0 .425-.288.713T12 19t-.712-.288T11 18z"})})}function Zu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"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 Ju(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:s.jsx("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"})})}const Qu=({titulo:e,onBack:t})=>s.jsxs("header",{className:An.header,children:[s.jsx(rn,{isIconOnly:!0,variant:"light",onClick:t,"aria-label":"Regresar",children:s.jsx(oa,{})}),s.jsx("h3",{className:An.titulo,children:e})]}),Qn={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 ef(){const e=Hn(),[t,n]=m.useState(null);if(!e)return null;const{state:o,todasLasColumnas:r,etiquetaColumna:i,cambiarOrdenColumnas:a}=e,{ordenColumnas:l}=o,d=g=>_=>{n(g),_.dataTransfer.effectAllowed="move",_.dataTransfer.setData("text/plain",g)},u=g=>_=>{_.preventDefault(),!(!t||t===g)&&a?.(c=>{const h=[...c],p=h.indexOf(t),v=h.indexOf(g);return p===-1||v===-1?c:(h.splice(p,1),h.splice(v,0,t),h)})},f=()=>n(null);return s.jsx("div",{className:Qn.contenedor,children:s.jsx("ul",{className:Qn.lista,children:l.map(g=>{const _=r.find(v=>v.id===g);if(!_)return null;const c=_.getCanHide?.()??!0,h=_.getIsVisible(),p=t===_.id;return s.jsxs("li",{className:`${Qn.item} ${p?Qn.item_dragging:""}`,draggable:!0,onDragStart:d(_.id),onDragOver:u(_.id),onDrop:f,onDragEnd:f,children:[s.jsx("span",{className:Qn.icono_drag,"aria-label":"Arrastrar columna",children:s.jsx(Ru,{})}),s.jsx("span",{className:Qn.nombre,children:i(_.id)}),s.jsx(_t,{size:"md",color:"primary",isSelected:h,isDisabled:!c,onChange:v=>_.toggleVisibility(v),className:Qn.checkbox})]},_.id)})})})}const zt={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function nf(){const e=Hn(),[t,n]=m.useState(""),o=m.useRef(null),r=e?.state.table?.getState().pagination.pageSize??10;if(m.useEffect(()=>n(String(r)),[r]),!e)return null;const{cambiarPageSize:i}=e,a=g=>Math.max(Tr,Math.min(Or,g)),l=g=>{const _=r+g;_>=Tr&&_<=Or&&i?.(_)},d=()=>{const g=parseInt(t,10),_=!isNaN(g)&&g>0?a(g):r;i?.(_),n(String(_))},u=g=>{({Enter:()=>{d(),o.current?.blur()},Escape:()=>{n(String(r)),o.current?.blur()},ArrowUp:()=>{g.preventDefault(),l(1),setTimeout(()=>o.current?.select(),0)},ArrowDown:()=>{g.preventDefault(),l(-1),setTimeout(()=>o.current?.select(),0)}})[g.key]?.()},f=g=>{const _=g.target.value;(_===""||/^\d+$/.test(_))&&n(_)};return s.jsxs("div",{className:zt.contenido,children:[s.jsx("p",{className:zt.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),s.jsxs("div",{className:zt.control,children:[s.jsx(rn,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(-1),"aria-label":"Disminuir filas",disabled:r<=Tr,children:s.jsx(Zu,{style:{fontSize:"var(--gaps-6)"}})}),s.jsx("div",{className:zt.valor,children:s.jsx("input",{ref:o,type:"text",inputMode:"numeric",value:t,onChange:f,onKeyDown:u,onFocus:()=>o.current?.select(),onBlur:d,className:zt.input,"aria-label":"Número de filas por página"})}),s.jsx(rn,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(1),"aria-label":"Aumentar filas",disabled:r>=Or,children:s.jsx(ia,{})})]})]})}const un={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 tf({navegar:e}){const t=Hn();return s.jsxs("div",{className:un.contenedor,children:[s.jsx("nav",{className:un.menu,children:sf.map(({id:n,icono:o,nombre:r,descripcion:i})=>s.jsxs("button",{className:un.item,onClick:()=>e(n),children:[s.jsx("div",{className:un.icono_contenedor,children:s.jsx(o,{})}),s.jsxs("div",{className:un.texto,children:[s.jsx("span",{className:un.nombre,children:r}),s.jsx("span",{className:un.descripcion,children:i})]}),s.jsx(ra,{className:un.chevron})]},n))}),s.jsx("div",{className:un.divider}),s.jsx("div",{className:un.menu,children:s.jsxs("button",{className:un.item,onClick:t?.restaurarConfiguracion,children:[s.jsx("div",{className:un.icono_contenedor,children:s.jsx(Uu,{})}),s.jsxs("div",{className:un.texto,children:[s.jsx("span",{className:un.nombre,children:"Restaurar configuración"}),s.jsx("span",{className:un.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const Tr=1,Or=200,sa=250,of=200,rf={panelPrincipal:{component:tf},panelColumnas:{component:ef,titulo:"Columnas visibles"},panelFilas:{component:nf,titulo:"Filas por página"}},sf=[{id:"panelColumnas",icono:Xu,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:Yu,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}];function af(e,t,n){const o=m.useRef(n);o.current=n;const r=m.useRef(e);r.current=e;const i=m.useCallback(a=>{const l=a.target;o.current.some(u=>u.current?.contains(l))||r.current()},[]);m.useEffect(()=>{if(!t)return;const a=setTimeout(()=>{document.addEventListener("mousedown",i)},100);return()=>{clearTimeout(a),document.removeEventListener("mousedown",i)}},[t,i])}function aa(e,t){m.useEffect(()=>{if(!t)return;const n=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t,e])}function lf(e,t,n,{width:o,margin:r=0,offsetRight:i=0,offsetLeft:a=0,offsetTop:l=0,offsetBottom:d=0}){const[u,f]=m.useState({top:0,left:0}),g=yo("only screen and (max-width: 480px)");return m.useEffect(()=>{if(!n||!e.current)return;const _=()=>{const c=e.current.getBoundingClientRect();let h=c.bottom+l,p=0;if(g)p=window.innerWidth-o-r;else{const w=c.right-o+i-a;p=Math.max(r,Math.min(w,window.innerWidth-o-r))}const v=t.current?.offsetHeight||400;h+v>window.innerHeight-r&&(h=c.top-v-d,h<r&&(h=c.bottom+l)),f({top:h,left:p})};return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[n,g,o,r,i,a,l,d,e,t]),u}function cf(e){m.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function df(){const[e,t]=m.useState(!1),[n,o]=m.useState(!1),[r,i]=m.useState("panelPrincipal"),[a,l]=m.useState(null),d=m.useRef(null),u=m.useRef(null),f=m.useRef(null);cf(n),af(()=>_(),n,[d,u]),aa(()=>_(),n);const g=lf(d,u,n,{width:sa,offsetRight:6,offsetTop:-2});m.useEffect(()=>{e&&(o(!0),l(null))},[e]),m.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);function _(){n&&(t(!1),f.current=window.setTimeout(()=>{o(!1),i("panelPrincipal"),l(null)},of))}function c(v){l(v==="panelPrincipal"?"backward":"forward"),i(v)}const h=rf[r],p=h.component;return s.jsxs("div",{className:An.contenedor,children:[s.jsx(rn,{isIconOnly:!0,ref:d,variant:"light",onClick:()=>t(v=>!v),"aria-haspopup":"dialog","aria-expanded":e,children:s.jsx(Ku,{})}),n&&d.current&&pt.createPortal(s.jsx("div",{ref:u,className:`${An.popover} ${e?An.popover_entrada:An.popover_salida}`,role:"dialog",style:{top:`${g.top}px`,left:`${g.left}px`,width:sa},children:s.jsx("div",{className:An.ventana,children:s.jsxs("div",{className:K([An.panel,An[`panel_${a}`]]),children:[h.titulo&&s.jsx(Qu,{titulo:h.titulo,onBack:()=>c("panelPrincipal")}),s.jsx(p,{navegar:c})]},r)})}),document.body)]})}function uf(){const e=Hn();if(!e)return null;const{state:t}=e,{inputBusqueda:n,setInputBusqueda:o,filtros:r,actualizarTabla:i,descargarExcel:a}=t,{abrirFiltros:l,filtrosAplicados:d=[]}=r||{},u=d?.length||0;return s.jsxs("section",{className:Ue.contenedor_superior,children:[s.jsxs("div",{className:Ue.input_con_icono,children:[s.jsx(Bu,{className:Ue.icono_busqueda}),s.jsx("input",{type:"text",placeholder:"Buscar en tabla...",value:n??"",onChange:f=>o&&o(f.target.value),className:Ue.input_busqueda})]}),s.jsxs("div",{className:Ue.contenedor_acciones_botones,children:[s.jsxs("div",{className:Ue.contenedor_acciones,children:[i!==void 0&&s.jsxs(rn,{variant:"light",className:Ue.boton_basico,disabled:i?.cargando,onClick:i?.onClick,children:[s.jsx(Wu,{}),i?.cargando?"Actualizando...":"Actualizar tabla"]}),l!==void 0&&s.jsxs(rn,{onClick:l,variant:"light",className:Ue.boton_basico,children:[s.jsx(Gu,{})," Filtros"]}),u>0?s.jsxs("div",{className:Ue.texto_filtros,children:[s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:s.jsx("path",{d:"M2 4h12M4 8h8M6 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),s.jsx("p",{children:qu(d,u)})]}):null]}),a!==void 0?s.jsxs(rn,{onClick:a,className:`${Ue.boton_basico} ${Ue.boton_excel}`,children:[s.jsx(Hu,{})," Excel"]}):null]}),s.jsx("div",{className:Ue.menu_configuraciones,children:s.jsx(df,{})})]})}const Gn={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 ff(){const e=Hn();if(!e)return null;const{state:t}=e,{table:n}=t,o=n.getPrePaginationRowModel().rows.length,r=n.getPageCount()||1,{pageIndex:i}=n.getState().pagination,a=i+1,l=Lu(a,r),d=n.getCanPreviousPage(),u=n.getCanNextPage(),f=r>1,g=()=>{d&&n.previousPage()},_=()=>{u&&n.nextPage()},c=h=>{n.setPageIndex(h-1)};return s.jsxs("section",{className:Gn.contenedor_paginacion,children:[s.jsxs("p",{className:Gn.info_paginacion,children:["Documentos: ",o]}),f&&s.jsxs("div",{className:Gn.contenedor_botones,children:[d&&s.jsx(oa,{onClick:g,"aria-disabled":!d,className:Gn.boton_paginacion}),l.map(h=>s.jsx("button",{type:"button",onClick:()=>c(h),className:h===a?Gn.pagina_activa:Gn.boton_num_paginacion,children:h},h)),u&&s.jsx(ra,{onClick:_,"aria-disabled":!u,className:Gn.boton_paginacion})]}),s.jsxs("p",{className:Gn.info_paginacion,children:["Página ",a," de ",r]})]})}const Ne={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 la(e,t){if(t)return e.find(n=>n.accessorKey===t||n.id!==void 0&&n.id===String(t))}function ca(e){if(e)return e.id??e.accessorKey}const Dn={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 _f({filas:e,cantidadControles:t=0,table:n,idPrimeraColumna:o,idSegundaColumna:r}){const a=n.getAllLeafColumns().filter(d=>d.id!=="actions"&&d.id!==o&&d.id!==r),l=["25vw","30vw","20vw","28vw","22vw","26vw"];return s.jsx("section",{className:Ne.contenedor_tabla_cards,children:Array.from({length:e}).map((d,u)=>s.jsxs("article",{className:Ne.contenedor_card,children:[s.jsxs("div",{className:Ne.contenedor_encabezado_card,children:[s.jsx("div",{className:Ne.contenedor_columna_card,children:o&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ne.card_label,children:gt(o,n)}),s.jsx("div",{className:Ne.card_valor,children:s.jsx("div",{className:`${Dn.skeleton_elemento} ${Dn.skeleton_elemento_encabezado}`})})]})}),s.jsx("div",{className:Ne.contenedor_columna_card,children:r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ne.card_label,children:gt(r,n)}),s.jsx("div",{className:Ne.card_segundo_valor,children:s.jsx("div",{className:`${Dn.skeleton_elemento} ${Dn.skeleton_elemento_encabezado_segundo}`})})]})})]}),s.jsx("div",{className:Ne.contenedor_contenido_cards,children:a.map((f,g)=>s.jsxs("div",{className:Ne.contenedor_fila_card,children:[s.jsx("div",{className:Ne.card_fila_label,children:gt(f.id,n)}),s.jsx("div",{className:Ne.card_fila_valor,children:s.jsx("div",{className:`${Dn.skeleton_elemento} ${Dn.skeleton_elemento_contenido}`,style:{width:l[g%l.length]}})})]},f.id))}),t>0&&s.jsx("div",{className:Ne.contenedor_acciones_card,children:Array.from({length:Math.min(t,3)}).map((f,g)=>s.jsx("div",{className:Dn.skeleton_accion,children:s.jsx("div",{className:`${Dn.skeleton_elemento} ${Dn.skeleton_elemento_encabezado}`})},`accion-${g}`))})]},`skeleton-card-${u}`))})}const Wn={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 da(){const e=m.useContext(Pr),{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:i="Agregar nuevo registro"}=t||{};return s.jsxs("div",{className:Wn.contenedor,children:[s.jsx(gf,{}),s.jsxs("div",{className:Wn.envolvedor_contenido,children:[s.jsx(pf,{}),s.jsx("h3",{className:Wn.titulo,children:o}),s.jsx("p",{className:Wn.descripcion,children:r}),n?s.jsxs(rn,{onClick:n,variant:"bordered",className:Wn.boton_agregar,children:[s.jsx(ia,{})," ",i]}):null]})]})}function gf(){return s.jsx("div",{className:Wn.envolvedor_cuadricula,children:s.jsxs("svg",{className:Wn.svg_cuadricula,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("defs",{children:s.jsx("pattern",{id:"patronCuadricula",width:"40",height:"40",patternUnits:"userSpaceOnUse",children:s.jsx("path",{d:"M 40 0 L 0 0 0 40",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),s.jsx("rect",{width:"100%",height:"100%",fill:"url(#patronCuadricula)"})]})})}function pf(){return s.jsxs("svg",{className:Wn.icono_carpeta,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M10 25C10 22.2386 12.2386 20 15 20H40L50 30H85C87.7614 30 90 32.2386 90 35V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V25Z",fill:"var(--color-placeholder)"}),s.jsx("path",{d:"M10 40C10 37.2386 12.2386 35 15 35H85C87.7614 35 90 37.2386 90 40V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V40Z",fill:"var(--base)",stroke:"var(--color-placeholder)",strokeWidth:"2"}),s.jsx("circle",{cx:"35",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),s.jsx("circle",{cx:"55",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),s.jsx("path",{d:"M42 65H48",stroke:"var(--color-primary-text)",strokeWidth:"1.5",strokeLinecap:"round"}),s.jsx("circle",{cx:"78",cy:"78",r:"14",fill:"var(--brand-primary)"}),s.jsx("path",{d:"M78 71V85M71 78H85",stroke:"var(--base)",strokeWidth:"2.5",strokeLinecap:"round"})]})}const hf=({fila:e,controls:t})=>(t?.length??0)>0?s.jsx("div",{className:Ne.contenedor_acciones_card,children:t?.map(o=>s.jsxs("button",{type:"button",title:o.nombre,onClick:()=>o.evento(e.original),className:`${Ne.boton_acciones} ${Ne.boton_card}`,children:[o.icono," ",o.nombre]},o.id))}):null,mf=({columnasRestantes:e,table:t})=>e.length===0?null:s.jsx("div",{className:Ne.contenedor_contenido_cards,children:e.map(n=>s.jsxs("div",{className:Ne.contenedor_fila_card,children:[s.jsx("div",{className:Ne.card_fila_label,children:gt(n.column.id,t)}),s.jsx("div",{className:Ne.card_fila_valor,children:ft(n.column.columnDef.cell,n.getContext())})]},n.id))}),vf=({fila:e,table:t,idPrimeraColumna:n,idSegundaColumna:o})=>{const r=ea(e,n),i=ea(e,o);return s.jsxs("div",{className:Ne.contenedor_encabezado_card,children:[s.jsx("div",{className:Ne.contenedor_columna_card,children:n&&r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ne.card_label,children:gt(n,t)}),s.jsx("div",{className:Ne.card_valor,children:Qs(e,n)})]})}),s.jsx("div",{className:Ne.contenedor_columna_card,children:o&&i&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ne.card_label,children:gt(o,t)}),s.jsx("div",{className:Ne.card_segundo_valor,children:Qs(e,o)})]})})]})};function bf(){const e=Hn();if(!e)return null;const{state:t}=e,{table:n,controls:o,primerasColumnas:r,loading:i,columns:a}=t;if(!n)return null;const l=a&&r?la(a,r[0]):void 0,d=a&&r?la(a,r[1]):void 0,u=ca(l),f=ca(d);if(i)return s.jsx(_f,{filas:3,cantidadControles:o?.length??0,table:n,idPrimeraColumna:u,idSegundaColumna:f});const g=n.getRowModel().rows;return g.length===0?s.jsx("article",{className:Ne.contenedor_card,children:s.jsx(da,{})}):s.jsx("section",{className:Ne.contenedor_tabla_cards,children:g.map(_=>{const c=Ou(_,u,f);return s.jsxs("article",{className:Ne.contenedor_card,children:[s.jsx(vf,{fila:_,table:n,idPrimeraColumna:u,idSegundaColumna:f}),s.jsx(mf,{columnasRestantes:c,table:n}),s.jsx(hf,{fila:_,controls:o})]},_.id)})})}const ua={filas:"_filas_un2v3_1",columnas:"_columnas_un2v3_43"},wf=({columnas:e,filas:t})=>s.jsx(s.Fragment,{children:Array.from({length:t}).map((n,o)=>s.jsx("tr",{className:ua.filas,children:Array.from({length:e}).map((r,i)=>s.jsx("td",{className:ua.columnas},`sk-cell-${o}-${i}`))},`sk-row-${o}`))}),et={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 yf({totalSeleccionadas:e,acciones:t,filasSeleccionadas:n,onLimpiarSeleccion:o}){const[r,i]=m.useState(0),[a,l]=m.useState([]),[d,u]=m.useState([]),f=e>0,g=m.useRef(null);return aa(o,f),m.useEffect(()=>{f&&(i(e),l(t),u(n))},[e,t,n,f]),s.jsx(Tt,{mostrar:f,tipo:"escalar",className:et.contenedor,children:s.jsxs("div",{ref:g,className:et.barra,children:[s.jsxs("div",{className:et.info,children:[s.jsx(rn,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:o,"aria-label":"Limpiar selección",className:et.btn_cerrar,children:s.jsx(Ju,{})}),s.jsxs("p",{className:et.contador,children:[r," filas seleccionadas"]})]}),s.jsx("div",{className:et.separador}),s.jsx("div",{className:et.acciones,children:a.map(_=>s.jsx("div",{children:_.componente(d)},_.id))})]})})}function Cf(){const e=Hn();if(!e)return null;const{state:t}=e,{table:n,loading:o,columns:r,selectorFilas:i=[]}=t;if(!n)return null;const a=n.getHeaderGroups(),l=n.getRowModel().rows,d=r?.length??0,u=n.getSelectedRowModel().rows,f=u.length,g=()=>{n.resetRowSelection()};return s.jsxs(s.Fragment,{children:[s.jsxs("table",{className:Ue.contenedor_tabla,children:[s.jsx("thead",{children:a.map(_=>s.jsx("tr",{children:_.headers.map(c=>{const h=c.column.columnDef.meta?.style;return s.jsx("th",{className:Ue.encabezados,style:h,"data-columna":c.id,children:c.id==="select"?s.jsx("div",{children:ft(c.column.columnDef.header,c.getContext())}):s.jsxs("div",{onClick:c.column.getToggleSortingHandler(),children:[ft(c.column.columnDef.header,c.getContext()),Tu(c.column.getIsSorted())]})},c.id)})},_.id))}),s.jsx("tbody",{className:Ue.contenedor_datos,children:o?s.jsx(wf,{columnas:d,filas:10}):l.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:d,style:{backgroundColor:"var(--base)"},children:s.jsx(da,{})})}):l.map(_=>s.jsx("tr",{className:`${Ue.datos} ${_.getIsSelected()?Ue.seleccionada:""}`,children:_.getVisibleCells().map(c=>{const h=c.column.columnDef.meta?.style;return s.jsx("td",{className:Ue.columna,style:h,"data-columna":c.column.id,children:ft(c.column.columnDef.cell,c.getContext())},c.id)})},_.id))})]}),i?.length>0?s.jsx(yf,{totalSeleccionadas:f,acciones:i,filasSeleccionadas:u.map(_=>_.original),onLimpiarSeleccion:g}):null]})}function xf({id:e}){const t=yo("only screen and (max-width: 830px)");return s.jsxs("main",{className:Ue.contenedor,id:e,children:[s.jsx(uf,{}),t?s.jsx(bf,{}):s.jsx(Cf,{}),s.jsx(ff,{})]})}function Sf({id:e,...t}){return s.jsx(Vu,{...t,children:s.jsx(xf,{id:e})})}const Ae={contenedor_radio:"_contenedor_radio_87ox4_1",envoltorio_radio:"_envoltorio_radio_87ox4_15",contenedor_label:"_contenedor_label_87ox4_33",texto_label:"_texto_label_87ox4_47",texto_descripcion:"_texto_descripcion_87ox4_65",marca_requerido:"_marca_requerido_87ox4_77",radio:"_radio_87ox4_85",input:"_input_87ox4_115",circulo_radio:"_circulo_radio_87ox4_141",punto_radio:"_punto_radio_87ox4_177",invalido:"_invalido_87ox4_207",solo_lectura:"_solo_lectura_87ox4_215",deshabilitado:"_deshabilitado_87ox4_227",tam_sm:"_tam_sm_87ox4_289",tam_lg:"_tam_lg_87ox4_315",color_primary:"_color_primary_87ox4_341",color_secondary:"_color_secondary_87ox4_349",color_success:"_color_success_87ox4_357",color_warning:"_color_warning_87ox4_365",color_danger:"_color_danger_87ox4_373",variante_card:"_variante_card_87ox4_381",grupo_radio:"_grupo_radio_87ox4_531",encabezado_grupo:"_encabezado_grupo_87ox4_545",label_grupo:"_label_grupo_87ox4_559",descripcion_grupo:"_descripcion_grupo_87ox4_573",contenedor_radios:"_contenedor_radios_87ox4_583",orientacion_vertical:"_orientacion_vertical_87ox4_593",orientacion_horizontal:"_orientacion_horizontal_87ox4_601",mensaje_error:"_mensaje_error_87ox4_609",grupo_invalido:"_grupo_invalido_87ox4_621",grupo_deshabilitado:"_grupo_deshabilitado_87ox4_629",grupo_solo_lectura:"_grupo_solo_lectura_87ox4_653",seleccionado:"_seleccionado_87ox4_679"},fa=m.createContext(void 0),$f=()=>m.useContext(fa),qr=m.memo(m.forwardRef(({value:e,label:t,description:n,size:o="md",color:r="primary",customColor:i,variant:a="default",isDisabled:l=!1,isReadOnly:d=!1,isInvalid:u=!1,isRequired:f=!1,children:g,className:_="",onChange:c,...h},p)=>{const v=$f(),w=m.useId(),C=h.id||w,x=v?.name||h.name,k=v?.size||o,z=v?.color||r,L=v?.customColor||i,N=v?.variant||a,P=v?.isDisabled||l,A=v?.isReadOnly||d,I=v?.isInvalid||u,O=v?.isRequired||f,q=v?.value!==void 0?v.value===e:void 0,$=g||t,b=F=>{P||A||(v?.onChange&&v.onChange(e),c&&c(F))},S=[Ae.contenedor_radio,Ae[`tam_${k}`],!L&&Ae[`color_${z}`],Ae[`variante_${N}`],P&&Ae.deshabilitado,A&&Ae.solo_lectura,I&&Ae.invalido,q&&Ae.seleccionado,_].filter(Boolean).join(" "),T=L?{"--radio-custom-color":L}:void 0;return s.jsx("div",{className:S,style:T,children:s.jsxs("label",{className:Ae.envoltorio_radio,htmlFor:C,children:[s.jsxs("div",{className:Ae.radio,children:[s.jsx("input",{ref:p,type:"radio",id:C,name:x,value:e,checked:q,disabled:P,readOnly:A,required:O,"aria-invalid":I,className:Ae.input,onChange:b,...h}),s.jsx("div",{className:Ae.circulo_radio,children:s.jsx("div",{className:Ae.punto_radio})})]})," ",$&&s.jsxs("div",{className:Ae.contenedor_label,children:[s.jsxs("span",{className:Ae.texto_label,children:[$,f&&!v&&s.jsx("span",{className:Ae.marca_requerido,children:" *"})]}),n&&s.jsx("span",{className:Ae.texto_descripcion,children:n})]})]})})}));qr.displayName="Radio";const _a=({name:e,value:t,defaultValue:n,onChange:o,orientation:r="horizontal",label:i,description:a,isDisabled:l=!1,isReadOnly:d=!1,isRequired:u=!1,isInvalid:f=!1,errorMessage:g,size:_,color:c,customColor:h,variant:p,justifyContent:v="flex-start",children:w,className:C="",options:x,optionValueKey:k,optionLabelKey:z,optionDisabledKey:L,optionDescriptionKey:N})=>{const[P,A]=m.useState(String(n??"")),I=t!==void 0?String(t):P,q={name:e,value:I,onChange:S=>{l||d||(t===void 0&&A(S),o&&o(S))},size:_,color:c,customColor:h,variant:p,isDisabled:l,isReadOnly:d,isInvalid:f,isRequired:u},$=[Ae.grupo_radio,Ae[`orientacion_${r}`],f&&Ae.grupo_invalido,l&&Ae.grupo_deshabilitado,d&&Ae.grupo_solo_lectura,C].filter(Boolean).join(" "),b=v==="center"?"center":v==="flex-end"?"right":"left";return s.jsx(fa.Provider,{value:q,children:s.jsxs("div",{className:$,role:"radiogroup","aria-required":u,"aria-invalid":f,style:{textAlign:b},children:[i&&s.jsxs("div",{className:Ae.encabezado_grupo,children:[s.jsxs("label",{className:Ae.label_grupo,children:[i,u&&s.jsx("span",{className:Ae.marca_requerido,children:" *"})]}),a&&s.jsx("span",{className:Ae.descripcion_grupo,children:a})]}),s.jsx("div",{className:Ae.contenedor_radios,style:{justifyContent:v},children:x&&x.length>0?x.map((S,T)=>{let F,y,M=!1,D;if(typeof S=="object"&&S!==null){const B=k??"value",G=z??"label",V=L??"isDisabled",J=N??"description",U=S[B],pe=S[G];F=String(U!==void 0?U:T),y=pe;const ue=S[V];M=typeof ue=="boolean"?ue:!1;const se=S[J];D=typeof se=="string"?se:void 0}else F=String(S),y=S;return s.jsx(qr,{value:F,isDisabled:M,description:D,children:y},F)}):w}),f&&g&&s.jsx("span",{className:Ae.mensaje_error,children:g})]})})};_a.displayName="RadioGroup";const ln={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"},ga=m.forwardRef(({isOpen:e,onClose:t,position:n="right",size:o="md",title:r,showCloseButton:i=!0,closeOnBackdropClick:a=!0,closeOnEscape:l=!0,preventScroll:d=!0,header:u,footer:f,children:g,className:_="",contentClassName:c="",isLoading:h=!1,loadingMessage:p="Cargando...",onOpen:v,backdropVariant:w="normal",borderRadius:C,resizable:x=!1,zIndex:k,getContainer:z},L)=>{const N=m.useRef(null),[P,A]=m.useState(!1),I=m.useCallback(()=>{P||(A(!0),setTimeout(()=>{t?.(),A(!1)},650))},[t,P]);m.useEffect(()=>{e&&A(!1)},[e]),m.useEffect(()=>{if(e){if(v?.(),d){const V=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",V>0&&(document.body.style.paddingRight=`${V}px`)}if(l){const V=J=>{J.key==="Escape"&&I()};return document.addEventListener("keydown",V),()=>{document.removeEventListener("keydown",V),d&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{d&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,I,l,d,v]);const O=V=>{a&&V.target===N.current&&I()},q=C?ln[`radio_${C}`]:void 0,$=e&&!P,b=[ln.drawer,ln[`posicion_${n}`],ln[`tamano_${o}`],$&&ln.visible,q,_].filter(Boolean).join(" "),S=[ln.contenido,c].filter(Boolean).join(" "),T=[ln.backdrop,$&&ln.visible].filter(Boolean).join(" "),F=k||500,y={transparente:{opacity:0},sutil:{opacity:.2},normal:{opacity:.4},intermedio:{opacity:.6},intenso:{opacity:.8}},M=y[w]||y.normal,{opacity:D}=M,B={background:`rgb(0 0 0 / ${D})`,zIndex:F,...z&&{position:"absolute"}},G=s.jsx("div",{className:T,ref:N,onClick:O,style:B,children:s.jsxs("div",{ref:L,className:b,role:"dialog","aria-modal":"true","aria-labelledby":"drawer-title",children:[(r||u)&&s.jsx("div",{className:ln.encabezado,children:u||s.jsxs(s.Fragment,{children:[s.jsx("h2",{id:"drawer-title",className:ln.titulo,children:r}),i&&s.jsx("button",{type:"button",className:ln.boton_cerrar,onClick:I,"aria-label":"Cerrar",children:s.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:s.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}),s.jsx("div",{className:S,children:g}),f&&s.jsx("div",{className:ln.pie,children:f}),h&&s.jsxs("div",{className:ln.loading_overlay,children:[s.jsx("div",{className:ln.spinner}),s.jsx("span",{className:ln.loading_text,children:p})]}),x&&s.jsx("div",{className:ln.resize_handle})]})});if(z){const V=typeof z=="function"?z():z;if(V&&V instanceof HTMLElement)return pt.createPortal(G,V)}return G});ga.displayName="Drawer";const cn={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"},pa=m.forwardRef(({isOpen:e,onClose:t,size:n="md",title:o,titleIcon:r,closeOnBackdropClick:i=!1,closeOnEscape:a=!0,preventScroll:l=!0,isCentered:d=!0,header:u,footer:f,children:g,className:_="",contentClassName:c="",isLoading:h=!1,loadingMessage:p="Cargando...",backdropVariant:v="normal",showIconTitle:w=!1,onOpen:C},x)=>{const k=m.useRef(null),z=m.useCallback(()=>{h||t?.()},[t,h]);m.useEffect(()=>{if(e){if(C?.(),l){const $=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",$>0&&(document.body.style.paddingRight=`${$}px`)}if(a){const $=b=>{b.key==="Escape"&&z()};return document.addEventListener("keydown",$),()=>{document.removeEventListener("keydown",$),l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,z,a,l,C]);const L=$=>{i&&$.target===k.current&&z()},N=[cn.backdrop,d&&cn.centrado,e&&cn.visible].filter(Boolean).join(" "),P=[cn.modal,cn[`tamano_${n}`],_].filter(Boolean).join(" "),A=[cn.contenido,c].filter(Boolean).join(" "),I={transparente:{opacity:0},sutil:{opacity:.3},normal:{opacity:.5},intermedio:{opacity:.7},intenso:{opacity:.9}},{opacity:O}=I[v]||I.normal,q={background:`rgb(0 0 0 / ${O})`};return s.jsx("div",{className:N,ref:k,onClick:L,style:q,children:s.jsxs("div",{ref:x,className:P,role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",children:[(o||u)&&s.jsx("div",{className:cn.encabezado,children:s.jsx("div",{className:cn.contenedor_titulo_completo,children:u||s.jsx(s.Fragment,{children:s.jsxs("div",{className:cn.contenedor_titulo_icono,children:[w&&r!==void 0&&(typeof r=="string"?s.jsx("span",{className:cn.icono_titulo,children:r}):r),w&&r===void 0&&s.jsx("span",{className:cn.icono_titulo,children:"📄"}),s.jsx("h2",{id:"modal-title",className:cn.titulo,children:o})]})})})}),s.jsx("div",{className:A,children:g}),f&&s.jsx("div",{className:cn.pie,children:f}),h&&s.jsxs("div",{className:cn.loading_overlay,children:[s.jsx("div",{className:cn.spinner}),s.jsx("span",{className:cn.loading_text,children:p})]})]})})});pa.displayName="Modal";const bn={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 kf({modals:e,onClose:t}){const[n,o]=m.useState([]),[r,i]=m.useState(!1);m.useEffect(()=>{const _=()=>{i(window.innerWidth<=768)};return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]);const a=_=>{o(c=>[...c,_]),setTimeout(()=>{t(_),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,g=e.length>1?f/2-d/2-l*(d+u):0;return s.jsx("div",{className:bn.overlay,children:s.jsx("div",{className:bn.container,style:r?void 0:{transform:`translateX(${g}px)`},children:e.map((_,c)=>{const h=n.includes(_.id),p=c===e.length-1,v=[bn.modal,h&&bn.modal_closing,!p&&bn.modal_detras].filter(Boolean).join(" ");return s.jsxs("div",{className:v,children:[s.jsxs("div",{className:bn.header,children:[s.jsx("button",{type:"button",className:bn.button_back,onClick:()=>a(_.id),"aria-label":"Volver",children:s.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:s.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),s.jsxs("div",{className:bn.title_container,children:[_.titleIcon&&s.jsx("span",{className:bn.title_icon,children:_.titleIcon}),s.jsx("h2",{className:bn.title,children:_.title})]})]}),s.jsx("div",{className:bn.content,children:_.content}),_.footer&&s.jsx("div",{className:bn.footer,children:_.footer})]},_.id)})})})}const Vr=m.createContext(null),jr=()=>{const e=m.useContext(Vr);if(!e)throw new Error("useDropdownContext debe usarse dentro de DropdownMenu o ContextMenu");return e},At=e=>e.type==="separator"||e.type==="label"?!1:"children"in e&&Array.isArray(e.children)&&e.children.length>0,ha=e=>e.type==="checkbox",ma=e=>e.type==="radio",va=e=>e.type==="separator",ba=e=>e.type==="label",ke={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"},If=()=>s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:s.jsx("polyline",{points:"20 6 9 17 4 12"})}),Ef=()=>s.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.jsx("polyline",{points:"9 18 15 12 9 6"})}),Mf=({marcado:e})=>s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),e&&s.jsx("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"})]}),Br=m.forwardRef(({item:e,index:t,activeIndex:n,getItemProps:o},r)=>{const i=jr();if(va(e))return s.jsx("div",{className:K(ke.separator,i.classNames?.separator),role:"separator"});if(ba(e))return s.jsx("div",{className:K(ke.label,i.classNames?.label),role:"presentation","data-testid":"dropdown-label",children:e.label});const a=t===n,l=ha(e),d=ma(e),u=N=>{"isDisabled"in e&&e.isDisabled||(l?e.onCheckedChange?.(!e.isChecked):d&&i.onRadioChange?.(e.value),"onSelect"in e&&e.onSelect&&e.onSelect(N),i.closeOnSelect&&!At(e)&&i.cerrarMenu())},f=N=>{u(N)},g=N=>{"isDisabled"in e&&e.isDisabled||(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),u(N))},_=l?e.isChecked:!1,c=d?i.radioValue===e.value:!1,h="label"in e?e.label:void 0,p="description"in e?e.description:void 0,v="shortcut"in e?e.shortcut:void 0,w="startIcon"in e?e.startIcon:void 0,C="endIcon"in e?e.endIcon:void 0,x="isDisabled"in e?e.isDisabled:!1,k="isLoading"in e?e.isLoading:!1,z="isDanger"in e?e.isDanger:!1,L="className"in e?e.className:void 0;return s.jsxs("div",{ref:r,role:l?"menuitemcheckbox":d?"menuitemradio":"menuitem","aria-checked":l?_:d?c:void 0,"aria-disabled":x||k,tabIndex:a?0:-1,className:K(ke.item,ke[`size_${i.size}`],a&&ke.active,x&&ke.disabled,k&&ke.loading,z&&ke.danger,At(e)&&ke.has_submenu,L,i.classNames?.item),onClick:f,onKeyDown:g,...o(),children:[k?s.jsx("span",{className:ke.indicator,children:s.jsx("span",{className:ke.spinner_item})}):(l||d)&&s.jsxs("span",{className:ke.indicator,children:[l&&_&&s.jsx(If,{}),d&&s.jsx(Mf,{marcado:c})]}),!k&&w&&s.jsx("span",{className:ke.start_icon,children:w}),s.jsxs("span",{className:ke.content,children:[s.jsx("span",{className:ke.label_text,children:h}),p&&s.jsx("span",{className:ke.description,children:p})]}),v&&s.jsx("kbd",{className:ke.shortcut,children:v}),C&&s.jsx("span",{className:ke.end_icon,children:C}),At(e)&&s.jsx("span",{className:ke.submenu_arrow,children:s.jsx(Ef,{})})]})});Br.displayName="MenuItem";const Nf=()=>s.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.jsx("polyline",{points:"9 18 15 12 9 6"})}),Eo=({items:e,activeIndex:t,getItemProps:n,listRef:o})=>s.jsx(s.Fragment,{children:e.map((r,i)=>At(r)?s.jsx(Hr,{ref:a=>{o.current[i]=a},item:r,index:i,activeIndex:t,getItemProps:n},r.id):s.jsx(Br,{ref:a=>{o.current[i]=a},item:r,index:i,activeIndex:t,getItemProps:n},r.id))});Eo.displayName="MenuList";const Hr=m.forwardRef(({item:e,index:t,activeIndex:n,getItemProps:o},r)=>{const i=jr(),[a,l]=m.useState(!1),d=Yn(),u=os(),f=m.useRef([]),[g,_]=m.useState(null),{refs:c,floatingStyles:h,context:p,isPositioned:v}=po({nodeId:u,open:a,onOpenChange:l,placement:"right-start",middleware:[oo({mainAxis:4,alignmentAxis:-4}),io(),ro({padding:8})],whileElementsMounted:eo}),{isMounted:w,styles:C}=wo(p,{duration:i.disableAnimation?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(2px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(2px)"},common:{transitionTimingFunction:i.disableAnimation?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}}),x=lr(p,{enabled:!e.isDisabled,delay:{open:75},handleClose:ks({blockPointerEvents:!0})}),k=bo(p,{role:"menu"}),z=go(p,{bubbles:!0}),L=hr(p,{listRef:f,activeIndex:g,onNavigate:_,nested:!0}),{getReferenceProps:N,getFloatingProps:P,getItemProps:A}=ho([x,k,z,L]);m.useEffect(()=>{if(!d)return;const q=()=>l(!1);return d.events.on("click",q),()=>{d.events.off("click",q)}},[d]);const I=t===n,O=Ri([c.setReference,r]);return s.jsxs(rs,{id:u,children:[s.jsxs("div",{ref:O,role:"menuitem","aria-haspopup":"menu","aria-expanded":a,"aria-disabled":e.isDisabled,tabIndex:I?0:-1,className:K(ke.item,ke[`size_${i.size}`],I&&ke.active,e.isDisabled&&ke.disabled,e.isDanger&&ke.danger,ke.has_submenu,a&&ke.submenu_open,e.className,i.classNames?.item),...N(o()),children:[e.startIcon&&s.jsx("span",{className:ke.start_icon,children:e.startIcon}),s.jsxs("span",{className:ke.content,children:[s.jsx("span",{className:ke.label_text,children:e.label}),e.description&&s.jsx("span",{className:ke.description,children:e.description})]}),e.shortcut&&s.jsx("kbd",{className:ke.shortcut,children:e.shortcut}),s.jsx("span",{className:ke.submenu_arrow,children:s.jsx(Nf,{})})]}),w&&s.jsx(_o,{root:i.portalContainer,children:s.jsx(fr,{context:p,modal:!1,initialFocus:-1,returnFocus:!1,children:s.jsx("div",{ref:c.setFloating,style:{...h,pointerEvents:"none",zIndex:i.zIndex??"var(--z-dropdown)"},children:s.jsx("div",{className:K(ke.menu,ke[`variant_${i.variant}`],i.classNames?.menu),style:{...C,pointerEvents:"auto",visibility:v||!a?"visible":"hidden"},...P(),children:s.jsx(Eo,{items:e.children,activeIndex:g,getItemProps:A,listRef:f})})})})})]})});Hr.displayName="Submenu";const wa=m.forwardRef(({children:e,items:t,triggerAction:n="click",placement:o="bottom-start",variant:r="default",size:i="md",isDisabled:a=!1,offset:l=4,minWidth:d="180px",matchTriggerWidth:u=!1,disableAnimation:f=!1,closeOnClickOutside:g=!0,closeOnEscape:_=!0,closeOnSelect:c=!0,className:h,classNames:p,style:v,onOpen:w,onClose:C,onOpenChange:x,onContextMenu:k,isOpen:z,zIndex:L,portalContainer:N,radioValue:P,onRadioChange:A},I)=>{const[O,q]=m.useState(!1),[$,b]=m.useState(null),[S,T]=m.useState(0),F=m.useRef([]),y=m.useRef([]),M=os(),D=z!==void 0,B=D?z:O,G=m.useCallback(j=>{a&&j||(D||q(j),x?.(j),j?w?.():C?.())},[a,D,x,w,C]);m.useEffect(()=>{y.current=t.filter(j=>j.type!=="separator"&&j.type!=="label").map(j=>"label"in j&&typeof j.label=="string"?j.label:"")},[t]);const{refs:V,floatingStyles:J,context:U,isPositioned:pe}=po({nodeId:M,open:B,onOpenChange:G,placement:o,strategy:"fixed",middleware:[oo(l),io({fallbackAxisSideDirection:"start",padding:8}),ro({padding:8}),u?Ui({apply({rects:j,elements:H}){Object.assign(H.floating.style,{minWidth:`${j.reference.width}px`})}}):void 0].filter(Boolean),whileElementsMounted:eo}),ue=vs(U,{enabled:!a&&(n==="click"||n==="both"),toggle:!0}),se=lr(U,{enabled:!a&&n==="hover",delay:{open:150,close:150},handleClose:ks()}),he=go(U,{enabled:_||g,escapeKey:_,outsidePress:g}),fe=bo(U,{role:"menu"}),_e=hr(U,{listRef:F,activeIndex:$,onNavigate:b,loop:!0}),R=xs(U,{listRef:y,activeIndex:$,onMatch:b,enabled:B}),{getReferenceProps:te,getFloatingProps:oe,getItemProps:ae}=ho([ue,se,he,fe,_e,R]),{isMounted:ve,styles:ee}=wo(U,{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)"}});m.useImperativeHandle(I,()=>({open:()=>G(!0),close:()=>G(!1),toggle:()=>G(!B),isOpen:B}),[G,B]);const we=m.useMemo(()=>({radioValue:P,onRadioChange:A,cerrarMenu:()=>G(!1),closeOnSelect:c,size:i,variant:r,disableAnimation:f,classNames:p,portalContainer:N,zIndex:L}),[P,A,G,c,i,r,f,p,N,L]),Se=m.isValidElement(e)?e:null,le=Ri([V.setReference,Se?.ref||null]);if(!Se)return e!=null&&console.error("DropdownMenu: children debe ser un elemento React válido"),null;const ye=n==="contextmenu"||n==="both"?{onContextMenu:j=>{j.preventDefault();const H={x:j.clientX,y:j.clientY};k?.(j,H),G(!1),T(me=>me+1),requestAnimationFrame(()=>{V.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}}}),G(!0)})},onClick:()=>{B&&n==="contextmenu"&&G(!1)}}:{},W=m.cloneElement(e,te({...e.props,...ye,ref:le,"aria-haspopup":"menu","aria-expanded":B}));return s.jsx(Vr.Provider,{value:we,children:s.jsxs(rs,{id:M,children:[W,ve&&s.jsx(_o,{root:N,children:s.jsx(fr,{context:U,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:V.setFloating,style:{...J,zIndex:L??"var(--z-dropdown)",outline:"none",pointerEvents:"none"},children:s.jsx("div",{role:"menu","aria-orientation":"vertical",className:K(ke.menu,ke[`variant_${r}`],ke[`size_${i}`],h,p?.menu),style:{...ee,minWidth:d,...v,transform:[ee.transform,v?.transform].filter(Boolean).join(" "),pointerEvents:"auto",visibility:pe||!B?"visible":"hidden"},...oe(),children:s.jsx(Eo,{items:t,activeIndex:$,getItemProps:ae,listRef:F})},S)})})})]})})});wa.displayName="DropdownMenuInner";const Mo=m.forwardRef((e,t)=>s.jsx(Xc,{children:s.jsx(wa,{...e,ref:t})}));Mo.displayName="DropdownMenu";const ya=m.forwardRef(({isEnabled:e=!0,children:t,...n},o)=>s.jsx(Mo,{...n,ref:o,triggerAction:"contextmenu",isDisabled:!e||n.isDisabled,children:t}));ya.displayName="ContextMenu";const Ln={group_button:"_group_button_1srmq_1",full_width:"_full_width_1srmq_9",main_button:"_main_button_1srmq_14",dropdown_trigger:"_dropdown_trigger_1srmq_18",first_item:"_first_item_1srmq_23",last_item:"_last_item_1srmq_28",variant_bordered:"_variant_bordered_1srmq_33",variant_ghost:"_variant_ghost_1srmq_34",variant_faded:"_variant_faded_1srmq_35",disabled:"_disabled_1srmq_47",loading:"_loading_1srmq_47",chevron:"_chevron_1srmq_56",chevron_open:"_chevron_open_1srmq_62"},Ff=({label:e,onClick:t,items:n,variant:o="solid",color:r="primary",size:i="md",radius:a="md",isLoading:l=!1,isDisabled:d=!1,dropdownIcon:u,className:f,fullWidth:g=!1,..._})=>{const[c,h]=m.useState(!1),p=K(Ln.group_button,Ln[`variant_${o}`],g&&Ln.full_width,f),v=()=>s.jsx("div",{className:K(Ln.chevron,c&&Ln.chevron_open),children:s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:s.jsx("path",{d:"m6 9 6 6 6-6"})})});return s.jsxs("div",{className:p,children:[s.jsx(rn,{variant:o,color:r,size:i,radius:a,isLoading:l,isDisabled:d,onClick:t,className:K(Ln.main_button,Ln.first_item),..._,children:e}),n&&s.jsx(Mo,{items:n,triggerAction:"click",onOpenChange:h,placement:"bottom-end",isDisabled:d||l,variant:"default",size:i,matchTriggerWidth:!1,children:s.jsx(rn,{variant:o,color:r,size:i,radius:a,isDisabled:d||l,isIconOnly:!0,className:K(Ln.dropdown_trigger,Ln.last_item),"aria-label":"M�s acciones",children:u||v()})})]})},Ca=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),xa=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12zm5.75 9L15 18l1.16-1.16l1.59 1.59l3.59-3.59l1.16 1.41z"})}),Sa=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M14.76 20.83L17.6 18l-2.84-2.83l1.41-1.41L19 16.57l2.83-2.81l1.41 1.41L20.43 18l2.81 2.83l-1.41 1.41L19 19.4l-2.83 2.84zM12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12z"})}),$a=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"15 18 9 12 15 6"})}),ka=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"9 18 15 12 9 6"})}),Xe={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"},zf={transparente:{background:"transparent"},sutil:{background:"rgb(0 0 0 / 20%)"},normal:{background:"rgb(0 0 0 / 40%)"},intenso:{background:"rgb(0 0 0 / 60%)"}},Af=({isOpen:e,onClose:t,onApply:n,onClear:o,title:r="Filtros",backdropVariant:i="sutil",closeOnBackdropClick:a=!0,allowBackdropInteraction:l=!1,getContainer:d,children:u})=>{const[f,g]=m.useState(!1),[_,c]=m.useState(0),h=l||i==="transparente",p=m.useCallback(()=>{f||(g(!0),setTimeout(()=>{t(),g(!1),c(0)},650))},[t,f]);m.useEffect(()=>{e&&g(!1)},[e]),m.useEffect(()=>{if(!e)return;const I=O=>O.key==="Escape"&&p();return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[e,p]);const v=m.useCallback(I=>{a&&I.target===I.currentTarget&&p()},[a,p]),w=m.useCallback(I=>{document.activeElement?.blur(),I?.()},[]),{pages:C,totalPages:x,hasPagination:k}=m.useMemo(()=>{const I=Array.isArray(u)?u:[u];return{pages:I,totalPages:I.length,hasPagination:I.length>1}},[u]),{background:z}=zf[i],L={background:z,pointerEvents:h?"none":"auto"},N=d?{position:"absolute"}:{},P=d?{position:"relative"}:{},A=s.jsxs("div",{className:Xe.overlay,role:"dialog","aria-modal":"true",style:N,children:[s.jsx("div",{className:`${Xe.backdrop} ${e&&!f?Xe.visible:""}`,style:L,onClick:v}),s.jsxs("div",{className:`${Xe.layout} ${e&&!f?Xe.visible:""}`,style:P,children:[s.jsxs("aside",{className:Xe.columna_acciones,children:[s.jsx(Ft,{content:"Cerrar",placement:"left",children:s.jsx("button",{className:Xe.boton_flotante,onClick:()=>w(p),"aria-label":"Cerrar panel",children:s.jsx(Ca,{})})}),s.jsx(Ft,{content:"Aplicar filtros",placement:"left",children:s.jsx("button",{className:`${Xe.boton_flotante} ${Xe.boton_primario}`,onClick:()=>w(n),children:s.jsx(xa,{})})}),s.jsx(Ft,{content:"Limpiar filtros",placement:"left",children:s.jsx("button",{className:`${Xe.boton_flotante} ${Xe.boton_peligro}`,onClick:()=>w(o),children:s.jsx(Sa,{})})}),k&&s.jsxs("div",{className:Xe.paginacion,children:[s.jsx("button",{className:Xe.boton_flotante,style:{width:36,height:36},onClick:()=>c(I=>Math.max(0,I-1)),disabled:_===0,"aria-label":"Página anterior",children:s.jsx($a,{})}),s.jsxs("span",{className:Xe.texto_paginacion,children:[_+1," / ",x]}),s.jsx("button",{className:Xe.boton_flotante,style:{width:36,height:36},onClick:()=>c(I=>Math.min(x-1,I+1)),disabled:_===x-1,"aria-label":"Página siguiente",children:s.jsx(ka,{})})]})]}),s.jsxs("main",{className:Xe.panel,children:[s.jsx("header",{className:Xe.encabezado,children:s.jsx("h2",{className:Xe.titulo,children:r})}),s.jsx("div",{className:Xe.contenido,children:s.jsx("div",{style:{animation:"fadeIn 0.3s ease"},children:C[_]},_)})]})]})]});if(d){const I=typeof d=="function"?d():d;if(I&&I instanceof HTMLElement)return pt.createPortal(A,I)}return A};Z.Badge=Rr,Z.BadgeVoz=qo,Z.Boton=rn,Z.Checkbox=_t,Z.CheckboxGroup=Js,Z.ContextMenu=ya,Z.Drawer=ga,Z.DropdownContext=Vr,Z.DropdownMenu=Mo,Z.GrabacionIcono=ii,Z.GroupButton=Ff,Z.IconoCerrar=Ca,Z.IconoDerecha=ka,Z.IconoFiltroAplicar=xa,Z.IconoFiltroLimpiar=Sa,Z.IconoIzquierda=$a,Z.InputDate=ri,Z.InputNumeric=oi,Z.InputText=Qr,Z.MenuItem=Br,Z.MenuList=Eo,Z.MicrofonoIcono=To,Z.Modal=pa,Z.ModalStack=kf,Z.PanelFiltros=Af,Z.Radio=qr,Z.RadioGroup=_a,Z.Select=Os,Z.Signature=Jr,Z.SonidoIcono=Oo,Z.Submenu=Hr,Z.TablaDatos=Sf,Z.TextArea=ai,Z.Toggle=Lo,Z.Tooltip=Ft,Z.Transicion=Tt,Z.esCheckbox=ha,Z.esLabel=ba,Z.esRadio=ma,Z.esSeparador=va,Z.fechaEnRango=il,Z.formatearFecha=Po,Z.formatearNumero=ht,Z.generarOpcionesAleatorias=Ld,Z.generarUsuariosPrueba=Pd,Z.obtenerFechaHoy=rl,Z.parsearNumero=ei,Z.procesarValidacion=ni,Z.redondearDecimales=ti,Z.restringirRango=Pt,Z.tieneHijos=At,Z.useCheckboxGroupContext=Zs,Z.useDropdownContext=jr,Z.useReconocimientoVoz=si,Z.useTablaContext=ju,Z.useTablaContextSafe=Hn,Object.defineProperty(Z,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