corekit-ui 0.1.34 → 0.2.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/excel.worker-CFqewIyg.js +39 -0
- package/dist/assets/excel.worker-CFqewIyg.js.map +1 -0
- package/dist/corekit-ui.css +1 -1
- package/dist/index.d.ts +473 -37
- package/dist/index.js +8996 -6455
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +6 -6
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +13 -3
package/dist/index.umd.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(Y,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react/jsx-runtime"),require("react"),require("firebase/app"),require("firebase/storage"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","firebase/app","firebase/storage","react-dom"],s):(Y=typeof globalThis<"u"?globalThis:Y||self,s(Y.CoreKitUI={},Y.jsxRuntime,Y.React,Y.app,Y.storage,Y.ReactDOM))})(this,(function(Y,s,m,Ka,Jn,xt){"use strict";function ti(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const M=ti(m),Go=ti(xt);function oi(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=oi(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=oi(e))&&(o&&(o+=" "),o+=t);return o}const ri=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ii=K,Ua=(e,t)=>n=>{var o;if(t?.variants==null)return ii(e,n?.class,n?.className);const{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(u=>{const _=n?.[u],g=i?.[u];if(_===null)return null;const f=ri(_)||ri(g);return r[u][f]}),l=n&&Object.entries(n).reduce((u,_)=>{let[g,f]=_;return f===void 0||(u[g]=f),u},{}),d=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((u,_)=>{let{class:g,className:f,...c}=_;return Object.entries(c).every(h=>{let[p,v]=h;return Array.isArray(v)?v.includes({...i,...l}[p]):{...i,...l}[p]===v})?[...u,g,f]:u},[]);return ii(e,a,d,n?.class,n?.className)},Ie={boton:"_boton_14vy4_1",animated:"_animated_14vy4_71",disabled:"_disabled_14vy4_71",loading:"_loading_14vy4_71",content:"_content_14vy4_79",spinner:"_spinner_14vy4_81",start_content:"_start_content_14vy4_83",end_content:"_end_content_14vy4_85",content_item:"_content_item_14vy4_113",spinner_icon:"_spinner_icon_14vy4_135",ripple:"_ripple_14vy4_171",solid:"_solid_14vy4_223",bordered:"_bordered_14vy4_243",ghost:"_ghost_14vy4_263",light:"_light_14vy4_287",faded:"_faded_14vy4_307",shadow:"_shadow_14vy4_327",only_loading:"_only_loading_14vy4_379",sm:"_sm_14vy4_397",md:"_md_14vy4_413",lg:"_lg_14vy4_429",full_width:"_full_width_14vy4_445",icon_only:"_icon_only_14vy4_453",radius_none:"_radius_none_14vy4_495",radius_sm:"_radius_sm_14vy4_563",radius_md:"_radius_md_14vy4_571",radius_lg:"_radius_lg_14vy4_579",radius_full:"_radius_full_14vy4_587",primary:"_primary_14vy4_595",secondary:"_secondary_14vy4_605",success:"_success_14vy4_615",warning:"_warning_14vy4_625",danger:"_danger_14vy4_635",default:"_default_14vy4_645"},Xa=Ua(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}}),on=m.forwardRef(({variant:e="solid",color:t="default",size:n="md",radius:o="md",fullWidth:r=!1,isLoading:i=!1,onlyLoading:a=!1,isDisabled:l=!1,isIconOnly:d=!1,disableRipple:u=!1,disableAnimation:_=!0,customColor:g,startContent:f,endContent:c,spinner:h,spinnerPlacement:p="end",permisos:v,permiso:w,children:y,className:x,onClick:E,style:A,type:L="button","aria-label":N,...P},z)=>{const I=w&&v?!v.includes(w):!1,V=l||i||I,j=F=>{if(V){F.preventDefault();return}if(E?.(F),u||V||!(F.currentTarget instanceof HTMLElement))return;const C=F.currentTarget,k=document.createElement("span"),D=C.getBoundingClientRect(),O=Math.max(D.width,D.height);k.className=Ie.ripple,k.style.width=`${O}px`,k.style.height=`${O}px`,k.style.left=`${F.clientX-D.left}px`,k.style.top=`${F.clientY-D.top}px`,k.addEventListener("animationend",()=>k.remove(),{once:!0}),C.appendChild(k)},$=g?{"--btn-color":g,"--btn-text-color":g,...A}:A,b=Xa({variant:e,color:g?void 0:t,size:n,radius:o,fullWidth:r,isIconOnly:d,isLoading:i,onlyLoading:a,isDisabled:V,disableAnimation:_}),S=i&&s.jsx("span",{className:Ie.spinner,"aria-hidden":a?void 0:"true",children:h||s.jsx("span",{className:Ie.spinner_icon})}),T=a&&!N?"Cargando":N;return s.jsxs("button",{...P,ref:z,type:L,"aria-label":T,"aria-busy":i,className:K(b,x),disabled:V,onClick:j,style:$,children:[p==="start"&&S,f&&!a&&s.jsx("span",{className:K(Ie.start_content,Ie.content_item),children:f}),y&&!a&&s.jsx("span",{className:Ie.content,children:y}),c&&!a&&s.jsx("span",{className:K(Ie.end_content,Ie.content_item),children:c}),p==="end"&&S]})});on.displayName="Boton";const kn={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"},Ya=()=>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"})}),si=({variant:e="solid",color:t="default",size:n="md",radius:o="md",children:r,startIcon:i,endIcon:a,dot:l,dismissible:d,onDismiss:u,customColor:_,className:g="",onClick:f})=>{const c=!!f,h=m.useMemo(()=>{if(!_)return;const w=_,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=[kn.badge,kn[`size_${n}`],kn[`radius_${o}`],kn[`variant_${e}`],!_&&kn[`color_${t}`],_&&kn.badge_custom,c&&kn.badge_clickable,g].filter(Boolean).join(" "),v=m.useMemo(()=>_||{default:"var(--gray-11)",primary:"var(--brand-6)",secondary:"var(--brand-6-secondary)",success:"var(--color-add-green-6)",warning:"var(--color-add-orange-6)",danger:"var(--color-add-red-6)",info:"var(--color-add-blue-6)",brand:"var(--brand-6)"}[t],[t,_]);return s.jsxs("span",{className:p,style:h,onClick:f,role:c?"button":void 0,tabIndex:c?0:void 0,children:[l&&s.jsx("span",{className:kn.dot,style:{backgroundColor:v}}),i&&s.jsx("span",{className:kn.icon,children:i}),r,a&&s.jsx("span",{className:kn.icon,children:a}),d&&s.jsx("button",{type:"button",className:kn.dismiss_button,onClick:w=>{w.stopPropagation(),u?.()},"aria-label":"Eliminar badge",children:s.jsx(Ya,{})})]})},qe={contenedor_toggle:"_contenedor_toggle_1ow2e_5",envoltorio_toggle:"_envoltorio_toggle_1ow2e_19",contenedor_label:"_contenedor_label_1ow2e_37",texto_label:"_texto_label_1ow2e_49",texto_descripcion:"_texto_descripcion_1ow2e_65",marca_requerido:"_marca_requerido_1ow2e_75",pista_toggle:"_pista_toggle_1ow2e_83",input:"_input_1ow2e_117",fondo_pista:"_fondo_pista_1ow2e_143",pulgar_toggle:"_pulgar_toggle_1ow2e_171",icono_check:"_icono_check_1ow2e_205",icono_x:"_icono_x_1ow2e_207",seleccionado:"_seleccionado_1ow2e_275",con_iconos:"_con_iconos_1ow2e_307",tam_sm:"_tam_sm_1ow2e_317",icono_moon:"_icono_moon_1ow2e_321",tam_lg:"_tam_lg_1ow2e_371",color_primary:"_color_primary_1ow2e_415",color_secondary:"_color_secondary_1ow2e_423",color_success:"_color_success_1ow2e_431",color_warning:"_color_warning_1ow2e_439",color_danger:"_color_danger_1ow2e_447",label_left:"_label_left_1ow2e_455",deshabilitado:"_deshabilitado_1ow2e_463",solo_lectura:"_solo_lectura_1ow2e_531",invalido:"_invalido_1ow2e_597",variante_moon:"_variante_moon_1ow2e_663",posicion_top:"_posicion_top_1ow2e_709",justify_end:"_justify_end_1ow2e_727",posicion_inline:"_posicion_inline_1ow2e_737"},Wo=m.forwardRef(({isSelected:e,defaultSelected:t=!1,onChange:n,label:o,description:r,size:i="md",color:a="primary",customColor:l,variant:d="default",isDisabled:u=!1,isReadOnly:_=!1,isInvalid:g=!1,isRequired:f=!1,showIcons:c=!1,labelPlacement:h="right",labelPosition:p="inline",justifyEnd:v=!1,children:w,className:y="",...x},E)=>{const[A,L]=m.useState(t),N=m.useId(),P=x.id||N,z=e!==void 0?e:A,I=F=>{if(u||_)return;const C=F.target.checked;e===void 0&&L(C),n&&n(C)},V=w||o,j=[qe.contenedor_toggle,qe[`tam_${i}`],!l&&qe[`color_${a}`],qe[`variante_${d}`],qe[`label_${h}`],qe[`posicion_${p}`],z&&qe.seleccionado,u&&qe.deshabilitado,_&&qe.solo_lectura,g&&qe.invalido,c&&qe.con_iconos,v&&qe.justify_end,y].filter(Boolean).join(" "),$=l?{"--toggle-custom-color":l}:void 0,b=()=>V?s.jsxs("div",{className:qe.contenedor_label,children:[s.jsxs("span",{className:qe.texto_label,children:[V,f&&s.jsx("span",{className:qe.marca_requerido,children:" *"})]}),r&&s.jsx("span",{className:qe.texto_descripcion,children:r})]}):null,S=()=>d!=="moon"?null:s.jsx("div",{className:qe.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:qe.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:qe.icono_x,width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[s.jsx("line",{x1:"2",y1:"2",x2:"8",y2:"8"}),s.jsx("line",{x1:"8",y1:"2",x2:"2",y2:"8"})]})]});return s.jsxs("div",{className:j,style:$,children:[p==="top"&&b(),s.jsxs("label",{className:qe.envoltorio_toggle,htmlFor:P,children:[p==="inline"&&h==="left"&&b(),s.jsxs("div",{className:qe.pista_toggle,children:[s.jsx("input",{ref:E,type:"checkbox",id:P,checked:z,disabled:u,readOnly:_,required:f,"aria-invalid":g,className:qe.input,onChange:I,...x}),s.jsx("div",{className:qe.fondo_pista,children:s.jsxs("div",{className:qe.pulgar_toggle,children:[S(),T()]})})]}),p==="inline"&&h==="right"&&b()]})]})});Wo.displayName="Toggle";const Ra=({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"})}),ai=({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"})}),Za=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M3 7v6h6M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})}),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:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"})}),Qa=({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"})}),el=({className:e})=>s.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("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"})]}),nl=({className:e})=>s.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("path",{d:"m8.5 12 2.3 2.3 4.7-4.7"})]}),re={backdrop:"_backdrop_1ruhw_1",visible:"_visible_1ruhw_41",modal:"_modal_1ruhw_65",cuerpo_modal:"_cuerpo_modal_1ruhw_107",encabezado:"_encabezado_1ruhw_155",titulo:"_titulo_1ruhw_169",boton_cerrar:"_boton_cerrar_1ruhw_183",texto_esc:"_texto_esc_1ruhw_223",icono_x:"_icono_x_1ruhw_237",contenedor_lienzo:"_contenedor_lienzo_1ruhw_247",area_firma:"_area_firma_1ruhw_257",superficie_lienzo:"_superficie_lienzo_1ruhw_271",lienzo:"_lienzo_1ruhw_279",lienzo_deshabilitado:"_lienzo_deshabilitado_1ruhw_309",barra_acciones:"_barra_acciones_1ruhw_319",grupo_izquierda:"_grupo_izquierda_1ruhw_339",grupo_derecha:"_grupo_derecha_1ruhw_351",separador:"_separador_1ruhw_363",boton_accion:"_boton_accion_1ruhw_375",contenedor_guardar:"_contenedor_guardar_1ruhw_435",boton_texto_con_icono:"_boton_texto_con_icono_1ruhw_447",accion_texto:"_accion_texto_1ruhw_459",icono_boton_accion:"_icono_boton_accion_1ruhw_469",icono:"_icono_1ruhw_237",contenedor_consentimiento:"_contenedor_consentimiento_1ruhw_495",texto_consentimiento:"_texto_consentimiento_1ruhw_509",consentimiento_fila:"_consentimiento_fila_1ruhw_525",toggle_consentimiento:"_toggle_consentimiento_1ruhw_539",contenedor_subir_oculto:"_contenedor_subir_oculto_1ruhw_547",boton_adjuntar:"_boton_adjuntar_1ruhw_559",input_archivo:"_input_archivo_1ruhw_599",input_validacion_firma:"_input_validacion_firma_1ruhw_607",bloque_firma:"_bloque_firma_1ruhw_635",bloque_encabezado:"_bloque_encabezado_1ruhw_657",bloque_titulo:"_bloque_titulo_1ruhw_669",marca_requerido:"_marca_requerido_1ruhw_685",bloque_preview:"_bloque_preview_1ruhw_695",bloque_preview_imagen:"_bloque_preview_imagen_1ruhw_723",bloque_preview_placeholder:"_bloque_preview_placeholder_1ruhw_737",bloque_acciones:"_bloque_acciones_1ruhw_751",accion_agregar_firma:"_accion_agregar_firma_1ruhw_765",accion_eliminar_firma:"_accion_eliminar_firma_1ruhw_767"},tl=8,ol=1.2,Qn=4.2,rl=1.8,li=(e,t,n)=>Math.max(t,Math.min(n,e)),il=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)},ci=e=>Number.isFinite(e)?e:performance.now(),sl=()=>{const e=m.useRef(null),[t,n]=m.useState(!0),[o,r]=m.useState(!1),[i,a]=m.useState([]),l=m.useRef([]),d=m.useRef({color:"#111827",enabled:!0}),u=m.useRef(null),_=m.useRef([]),g=m.useRef(0),f=m.useRef(Qn),c=m.useRef(!1),h=m.useCallback(()=>e.current?.getContext("2d")??null,[]),p=m.useCallback(()=>h(),[h]),v=m.useCallback(()=>{const $=e.current,b=h();$&&b&&b.clearRect(0,0,$.width,$.height),n(!0),l.current=[],a([]),_.current=[],u.current=null,f.current=Qn,c.current=!1},[h]),w=m.useCallback(()=>{c.current=!0,n(!1)},[]),y=m.useCallback(($,b)=>{const S=Math.max(1,b.t-$.t),F=il($,b)/S,k=(Qn-F*rl)*li(b.pressure||.5,.35,1),D=li(k,ol,Qn),H=f.current+(D-f.current)*.25;return f.current=H,H},[]),x=m.useCallback(($,b)=>{$.strokeStyle=d.current.color,$.lineWidth=b,$.lineCap="round",$.lineJoin="round"},[]),E=m.useCallback(($,b)=>{const S=p();if(!S)return;const T=y($,b);x(S,T),S.beginPath(),S.moveTo($.x,$.y),S.quadraticCurveTo($.x,$.y,b.x,b.y),S.stroke(),n(!1)},[y,p,x]),A=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=A($);r(!0),u.current=S,_.current=[S],g.current=ci($.timeStamp)},[A]),N=m.useCallback($=>{if(!o||!d.current.enabled)return;$.preventDefault();const b=ci($.timeStamp);if(b-g.current<tl)return;g.current=b;const S=A($),T=u.current;T&&(E(T,S),u.current=S,_.current.push(S))},[E,o,A]),P=m.useCallback($=>{if($&&e.current?.hasPointerCapture($.pointerId)&&e.current.releasePointerCapture($.pointerId),o&&_.current.length>0){const b=[...l.current,{puntos:[..._.current]}];l.current=b,a(b)}r(!1),u.current=null,_.current=[]},[o]),z=m.useCallback(($,b,S)=>{if(!(b.puntos.length<2))for(let T=1;T<b.puntos.length;T++){const F=b.puntos[T-1],C=b.puntos[T],k=y(F,C);$.strokeStyle=S??d.current.color,$.lineWidth=k,$.lineCap="round",$.lineJoin="round",$.beginPath(),$.moveTo(F.x,F.y),$.quadraticCurveTo(F.x,F.y,C.x,C.y),$.stroke()}},[y]),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),f.current=Qn,$.forEach(T=>z(S,T)),n($.length===0&&!c.current))},[h,z]),V=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:C}=$;if(!S&&!C)return b.toDataURL("image/png");const k=document.createElement("canvas");k.width=b.width,k.height=b.height;const D=k.getContext("2d");if(!D)return null;S&&(D.fillStyle=S,D.fillRect(0,0,k.width,k.height)),C&&l.current.length>0&&!c.current?(f.current=Qn,l.current.forEach(B=>z(D,B,C))):D.drawImage(b,0,0);const O=T??"image/png",H=F??.85;return O==="image/png"?k.toDataURL(O):k.toDataURL(O,H)},[t,z]),j=m.useCallback($=>{const b=e.current,S=h();if(!b||!S)return;if(d.current={color:$.color,enabled:$.enabled??!0},b.style.touchAction="none",b.style.userSelect="none",!d.current.enabled)return()=>{};const T=D=>L(D),F=D=>N(D),C=D=>P(D),k=D=>P(D);return b.addEventListener("pointerdown",T,{passive:!1}),b.addEventListener("pointermove",F,{passive:!1}),b.addEventListener("pointerup",C,{passive:!1}),b.addEventListener("pointerleave",C,{passive:!1}),b.addEventListener("pointercancel",k,{passive:!1}),()=>{b.removeEventListener("pointerdown",T),b.removeEventListener("pointermove",F),b.removeEventListener("pointerup",C),b.removeEventListener("pointerleave",C),b.removeEventListener("pointercancel",k)}},[P,L,N,h]);return m.useEffect(()=>{f.current=Qn},[i.length]),{canvasRef:e,configurarCanvas:j,deshacerUltimoTrazo:I,estaVacio:t,limpiarCanvas:v,marcarConContenido:w,obtenerDatosFirma:V,puedeDeshacer:i.length>0}},di=m.forwardRef(({alto:e=200,ancho:t=700,aspectRatio:n,className:o,closeOnBackdropClick:r=!1,firmaInicial:i=null,isOpen:a=!1,isRequired:l=!1,mostrarBotonSubir:d=!0,name:u,onClose:_,onConfirm:g,readonly:f=!1,readonlyPostGuardado:c=!1,requiredMessage:h="Se debe registrar una firma para continuar",textoAdjuntar:p="Adjuntar firma",textoConsentimiento:v="Al firmar, confirmo que he leído y acepto todos los términos contractuales",textoDeshacer:w="Deshacer",textoEliminarFirma:y="Eliminar firma",textoEstadoGuardada:x="Guardada",textoEstadoPendiente:E="Pendiente",textoGuardar:A="Guardar firma",textoLimpiar:L="Limpiar",textoModificar:N="Modificar firma",textoReemplazarFirma:P="Reemplazar firma",textoSolicitarFirma:z="Agregar firma",tituloBloque:I="Firma del responsable",titulo:V="Firmar el contrato",mostrarBotonAgregarFirma:j=!0,mostrarBotonEliminarFirma:$=!0,firebasePath:b,firebaseStorage:S,onFirebaseUploadSuccess:T,onFirebaseUploadError:F,fondoTransparente:C=!0},k)=>{const{canvasRef:D,configurarCanvas:O,deshacerUltimoTrazo:H,estaVacio:B,limpiarCanvas:U,marcarConContenido:X,obtenerDatosFirma:ge,puedeDeshacer:ce}=sl(),ie=m.useRef(null),pe=m.useRef(null),ue=m.useRef(null),ye=m.useId(),Z=`${ye}-toggle`,oe=`${ye}-texto`,te=`${ye}-dialog-title`,ve=`${ye}-dialog-description`,[se,Q]=m.useState(!!a),[de,be]=m.useState(!1),[J,Ce]=m.useState(i),[W,q]=m.useState(t),[G,fe]=m.useState(!1),[_e,he]=m.useState(!!i),[Ze,Ue]=m.useState(!1),[je,Le]=m.useState(!1),Je=Math.round(W*e/Math.max(1,t)),Se=f||c&&_e,me=!f&&!(c&&_e),we=m.useCallback(ke=>{const xe=D.current,Ke=xe?.getContext("2d");if(!xe||!Ke)return;const xn=new Image;xn.onload=()=>{Ke.clearRect(0,0,xe.width,xe.height);const Dn=xe.width/xe.height,ct=xn.width/xn.height;let Bt=xe.width,Ct=xe.height,jo=0,qo=0;ct>Dn?(Ct=xe.width/ct,qo=(xe.height-Ct)/2):(Bt=xe.height*ct,jo=(xe.width-Bt)/2),Ke.drawImage(xn,jo,qo,Bt,Ct),X(),Ue(!0)},xn.src=ke},[D,X]),Ve=m.useCallback(()=>{if(S&&typeof S=="object")return S;if(!Ka.getApps().length)throw new Error("Firebase no esta inicializado. Inicializa la app y el almacenamiento antes de usar firebasePath o pasa firebaseStorage al componente.");return Jn.getStorage()},[S]),Fe=m.useCallback(()=>{U(),Ce(null),Ue(!1),he(!1)},[U]),yn=m.useCallback(()=>{Se||(U(),Ue(!1))},[Se,U]),ne=m.useCallback(async()=>{if(Se||je)return;const ke=Ve(),xe=typeof J=="string"&&/^https?:\/\//i.test(J)?Jn.ref(ke,J):b?Jn.ref(ke,b):null;try{xe&&(Le(!0),await Jn.deleteObject(xe)),Fe(),g?.("")}catch(Ke){if(typeof Ke=="object"&&Ke!==null&&"code"in Ke&&String(Ke.code)==="storage/object-not-found"){Fe(),g?.("");return}console.error("Error al eliminar la firma de Firebase:",Ke),F?.(Ke instanceof Error?Ke:new Error(String(Ke)))}finally{xe&&Le(!1)}},[Se,J,b,Ve,Fe,g,F,je]),Me=m.useCallback(()=>{f||(U(),he(!1),Ue(!1),fe(!1))},[U,f]),We=m.useCallback(ke=>{if(Se)return;const xe=ke.target.files?.[0];if(!xe)return;const Ke=new FileReader;Ke.onload=xn=>{const Dn=xn.target?.result;typeof Dn=="string"&&(U(),we(Dn))},Ke.readAsDataURL(xe)},[Se,we,U]),Pe=m.useCallback(()=>{Se||ie.current?.click()},[Se]),tn=m.useCallback(()=>{fe(!1),Ue(!1),U()},[U]),cn=m.useCallback(ke=>{de||(be(!0),setTimeout(()=>{Q(!1),be(!1),ke?.()},400))},[de]),en=m.useCallback(()=>{cn(()=>{tn(),_?.()})},[cn,tn,_]),$n=m.useCallback(async()=>{if(Se||de||je)return;const ke=ge(C?{format:"image/png",strokeColor:"#111827"}:{backgroundColor:"#ffffff",format:"image/jpeg",quality:.82,strokeColor:"#111827"});if(!ke||!G)return;let xe=ke;try{if(b){Le(!0);const Ke=Ve();let xn;try{xn=Jn.ref(Ke,b)}catch(Dn){const ct=Dn instanceof Error?Dn.message:String(Dn);throw new Error(`No se pudo crear la referencia de Firebase Storage para "${b}". Posible conflicto por dos copias de Firebase (la app y la libreria). Verifica que firebase este externalizado en corekit-ui y que la app use una sola instancia del SDK. Detalle: ${ct}`)}await Jn.uploadString(xn,ke,"data_url"),xe=await Jn.getDownloadURL(xn),T?.(xe)}cn(()=>{Ce(xe),he(!0),g?.(xe),tn(),_?.()})}catch(Ke){console.error("Error al subir la firma a Firebase:",Ke),F?.(Ke instanceof Error?Ke:new Error(String(Ke)))}finally{b&&Le(!1)}},[G,Se,cn,b,Ve,tn,ge,_,g,F,T,de,je]);m.useEffect(()=>{a&&(Q(!0),be(!1))},[a]),m.useEffect(()=>{Ce(i),he(!!i)},[i]),m.useEffect(()=>{if(!se)return;const ke=()=>{const xe=ue.current;xe&&q(Math.max(1,Math.floor(xe.clientWidth)))};return ke(),window.addEventListener("resize",ke),()=>window.removeEventListener("resize",ke)},[t,se]),m.useImperativeHandle(k,()=>({limpiar:U,obtenerDatosFirma:ge,estaVacio:()=>B}),[B,U,ge]),m.useEffect(()=>{if(!se)return;const ke=O({color:"#111827",enabled:!Se});return()=>{ke?.()}},[Se,O,se]),m.useEffect(()=>{if(!se){document.body.style.overflow="";return}const ke=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",ke>0&&(document.body.style.paddingRight=`${ke}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[se]),m.useEffect(()=>{se||tn()},[tn,se]),m.useEffect(()=>{if(!se)return;const ke=xe=>{if(xe.key==="Escape"){en();return}if(xe.ctrlKey&&xe.key.toLowerCase()==="z"){xe.preventDefault(),!Se&&ce&&H();return}xe.ctrlKey&&xe.key==="Enter"&&(xe.preventDefault(),Se||$n())};return document.addEventListener("keydown",ke),()=>document.removeEventListener("keydown",ke)},[Se,H,en,$n,se,ce]),m.useEffect(()=>{const ke=pe.current;if(!ke)return;if(l&&!!!J){ke.setCustomValidity(h);return}ke.setCustomValidity("")},[J,l,h]);const mn=m.useCallback(ke=>{de||!r||ke.target===ke.currentTarget&&en()},[r,de,en]),Cn=Se,ei=Se||Ze,qt=Se||!_e&&(B&&!Ze||!G),ni=()=>{f||(J&&Me(),be(!1),Q(!0))};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`${re.bloque_firma} ${o||""}`,children:[s.jsxs("div",{className:re.bloque_encabezado,children:[s.jsxs("span",{className:re.bloque_titulo,children:[I,l&&s.jsx("span",{className:re.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsx(si,{color:J?"success":"warning",size:"sm",variant:"outline",children:J?x:E})]}),s.jsxs("div",{className:re.bloque_preview,style:n?{aspectRatio:n}:void 0,children:[(l||u)&&s.jsx("input",{ref:pe,className:re.input_validacion_firma,"aria-hidden":"true",name:u,required:l,tabIndex:-1,type:"text",value:J?"signed":"",onChange:()=>{},onInvalid:ke=>{l&&!J&&ke.currentTarget.setCustomValidity(h)},onInput:ke=>{ke.currentTarget.setCustomValidity("")}}),J?s.jsx("img",{src:J,alt:"Firma guardada",className:re.bloque_preview_imagen}):s.jsx("span",{className:re.bloque_preview_placeholder,children:"Sin firma registrada"})]}),!f&&(j||$&&!!J)&&s.jsxs("div",{className:re.bloque_acciones,children:[j&&s.jsx(on,{color:"primary",size:"sm",variant:"solid",onClick:ni,className:re.accion_agregar_firma,isDisabled:Se||de,children:s.jsxs("span",{className:re.boton_texto_con_icono,children:[J?s.jsx(Qa,{className:re.icono_boton_accion}):s.jsx(el,{className:re.icono_boton_accion}),s.jsx("span",{className:re.accion_texto,children:J?P:z})]})}),$&&J&&s.jsx(on,{color:"default",size:"sm",variant:"bordered",onClick:ne,className:re.accion_eliminar_firma,isDisabled:Se||de||je,children:s.jsxs("span",{className:re.boton_texto_con_icono,children:[s.jsx(ai,{className:re.icono_boton_accion}),s.jsx("span",{className:re.accion_texto,children:y})]})})]})]}),se&&s.jsx("div",{className:`${re.backdrop} ${de?"":re.visible}`,onClick:mn,children:s.jsxs("div",{className:`${re.modal} ${de?"":re.visible}`,role:"dialog","aria-modal":"true","aria-labelledby":te,"aria-describedby":ve,children:[s.jsxs("header",{className:re.encabezado,children:[s.jsx("h2",{id:te,className:re.titulo,children:V}),s.jsxs("button",{className:re.boton_cerrar,onClick:en,type:"button","aria-label":"Cerrar",children:[s.jsx("span",{className:re.texto_esc,children:"ESC"}),s.jsx(Ra,{className:re.icono_x})]})]}),s.jsxs("div",{className:re.cuerpo_modal,children:[s.jsx("div",{className:re.contenedor_lienzo,ref:ue,children:s.jsxs("div",{className:re.area_firma,children:[s.jsx("div",{className:re.superficie_lienzo,children:s.jsx("canvas",{ref:D,className:`${re.lienzo} ${Cn?re.lienzo_deshabilitado:""}`,width:W,height:Je,style:{height:`${Je}px`,pointerEvents:ei?"none":"auto",width:"100%"},"aria-label":"Area de firma"})}),me&&s.jsxs("div",{className:re.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[s.jsxs("div",{className:re.grupo_izquierda,children:[s.jsxs("button",{className:re.boton_accion,onClick:H,type:"button",disabled:!ce||Cn,"aria-label":w,children:[s.jsx(Za,{className:re.icono,"aria-hidden":"true"}),s.jsx("span",{children:w})]}),s.jsx("span",{className:re.separador,"aria-hidden":"true",children:"|"}),s.jsxs("button",{className:re.boton_accion,onClick:yn,type:"button",disabled:B&&!Ze||Cn,"aria-label":L,children:[s.jsx(ai,{className:re.icono,"aria-hidden":"true"}),s.jsx("span",{children:L})]})]}),d&&s.jsx("div",{className:re.grupo_derecha,children:s.jsxs("button",{className:re.boton_adjuntar,onClick:Pe,type:"button",disabled:Se,children:[s.jsx(Ja,{className:re.icono,"aria-hidden":"true"}),p]})})]})]})}),me&&s.jsxs(s.Fragment,{children:[s.jsx("div",{id:ve,className:re.contenedor_consentimiento,children:s.jsxs("div",{className:re.consentimiento_fila,children:[s.jsx(Wo,{id:Z,isSelected:G,onChange:fe,color:"primary",size:"md",isDisabled:Se,"aria-describedby":oe,className:re.toggle_consentimiento}),s.jsx("label",{htmlFor:Z,id:oe,className:re.texto_consentimiento,children:v})]})}),s.jsx("div",{className:re.contenedor_guardar,children:s.jsx(on,{color:"primary",variant:"solid",radius:"full",size:"md",onClick:_e&&!c?Me:$n,type:"button",isLoading:je,isDisabled:qt||je,startContent:je?void 0:s.jsx(nl,{className:re.icono,"aria-hidden":"true"}),children:je?"Guardando...":_e&&!c?N:A})})]}),me&&d&&s.jsx("div",{className:re.contenedor_subir_oculto,children:s.jsx("input",{ref:ie,type:"file",accept:"image/*",className:re.input_archivo,onChange:We,"aria-label":"Subir imagen de firma"})})]})]})})]})});di.displayName="Signature";const al="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Ht=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=al[n[e]&63];return t};const ll=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[s.jsx("path",{d:"M18 6 6 18"}),s.jsx("path",{d:"m6 6 12 12"})]}),cl=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[s.jsx("path",{d:"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"})]}),dl=({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"})]}),Be={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"},ui=m.forwardRef((e,t)=>{const{type:n="text",value:o,defaultValue:r,placeholder:i,variant:a="bordered",color:l="default",size:d="md",radius:u="md",fullWidth:_=!0,disableAnimation:g=!1,label:f,description:c,errorMessage:h,startContent:p,endContent:v,isRequired:w=!1,isReadOnly:y=!1,isDisabled:x=!1,isClearable:E=!1,isInvalid:A,validationState:L,validate:N,className:P,classNames:z,style:I,onChange:V,onClear:j,onValueChange:$,onFocus:b,onBlur:S,onKeyDown:T,id:F,name:C,autoComplete:k,autoFocus:D,maxLength:O,minLength:H,pattern:B,...U}=e,X=m.useRef(null),ce=m.useRef(F??`input-text-${Ht(8)}`).current;m.useImperativeHandle(t,()=>X.current);const ie=o!==void 0,[pe,ue]=m.useState(r??""),ye=ie?o:pe,[Z,oe]=m.useState(!1),[te,ve]=m.useState(!1),se=m.useMemo(()=>{if(!N)return null;const we=N(ye);return we===!0||we==null?null:typeof we=="string"?we:typeof we=="object"&&"message"in we?we.message??"Entrada inválida":"Entrada inválida"},[ye,N]),Q=m.useMemo(()=>A!==void 0?A:L==="invalid"?!0:L==="valid"?!1:!!se,[A,L,se]),de=L==="valid"&&!Q,be={invalido:Q,mensaje:se},J=ye.length>0,Ce=n==="password",W=Ce&&te?"text":n,q=E&&J&&!y&&!x,G=m.useCallback(we=>{if(x||y)return;const Ve=we.target.value;ie||ue(Ve),V?.(Ve),$?.(Ve)},[ie,x,y,V,$]),fe=m.useCallback(we=>{oe(!0),b?.(we)},[b]),_e=m.useCallback(we=>{oe(!1),S?.(we)},[S]),he=m.useCallback(()=>{x||y||(ie||ue(""),V?.(""),$?.(""),j?.(),X.current?.focus())},[ie,x,y,V,$,j]),Ze=m.useCallback(we=>{we.key==="Escape"&&E&&J&&he(),T?.(we)},[E,J,he,T]),Ue=m.useCallback(()=>{ve(we=>!we),requestAnimationFrame(()=>X.current?.focus())},[]),je=c?`${ce}-desc`:void 0,Le=Q?`${ce}-err`:void 0,Je=[je,Le].filter(Boolean).join(" ")||void 0,Se=typeof h=="function"?h(be):h??se,me=K(Be.contenedor_base,Be[`variante_${a}`],Be[`tam_${d}`],Be[`radio_${u}`],Be[`color_${l}`],{[Be.ancho_total]:_,[Be.sin_animacion]:g,[Be.deshabilitado]:x,[Be.solo_lectura]:y,[Be.invalido]:Q,[Be.valido]:de,[Be.enfocado]:Z,[Be.tiene_contenido]:J},P,z?.base);return s.jsxs("div",{className:me,style:I,children:[f&&s.jsxs("label",{className:K(Be.etiqueta,z?.label),htmlFor:ce,children:[f,w&&s.jsx("span",{className:Be.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsxs("div",{className:K(Be.envoltorio_input,z?.inputWrapper),children:[p&&s.jsx("span",{className:Be.contenido_inicio,children:p}),s.jsx("div",{className:K(Be.envoltorio_interno,z?.innerWrapper),children:s.jsx("input",{...U,ref:X,id:ce,name:C,type:W,value:ie?ye:void 0,defaultValue:ie?void 0:r,placeholder:i,disabled:x,readOnly:y,required:w,autoComplete:k,autoFocus:D,maxLength:O,minLength:H,pattern:B,"aria-invalid":Q||void 0,"aria-describedby":Je,"aria-required":w,className:K(Be.entrada,z?.input),onChange:G,onFocus:fe,onBlur:_e,onKeyDown:Ze})}),q&&s.jsx("button",{type:"button",className:K(Be.boton_limpiar,z?.clearButton),onClick:he,tabIndex:-1,"aria-label":"Limpiar campo",children:s.jsx(ll,{size:"0.75em"})}),Ce&&s.jsx("button",{type:"button",className:Be.boton_password,onClick:Ue,tabIndex:-1,"aria-label":te?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":te,children:te?s.jsx(dl,{}):s.jsx(cl,{})}),v&&s.jsx("span",{className:Be.contenido_final,children:v})]}),c&&!Q&&s.jsx("div",{id:je,className:K(Be.descripcion,z?.description),children:c}),Q&&Se&&s.jsx("div",{id:Le,className:K(Be.mensaje_error,z?.errorMessage),role:"alert",children:Se})]})});ui.displayName="InputText";function Gt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function St(e,t){if(e==null||Number.isNaN(e))return"";const{separadorMiles:n=!1,separadorDecimal:o=".",escalaDecimal:r,decimalesFijos:i=!1,prefijo:a="",sufijo:l=""}=t;let d;r!==void 0?d=i?e.toFixed(r):String(Math.round(e*Math.pow(10,r))/Math.pow(10,r)):d=String(e);const[u,_]=d.split(".");let g=u;if(n){const c=typeof n=="string"?n:",";g=u.replace(/\B(?=(\d{3})+(?!\d))/g,c)}let f=g;return _!==void 0?f+=o+_:i&&r&&r>0&&(f+=o+"0".repeat(r)),`${a}${f}${l}`}function fi(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(`^${Gt(r)}`),"")),i&&(l=l.replace(new RegExp(`${Gt(i)}$`),"")),n){const u=typeof n=="string"?n:",";l=l.replace(new RegExp(Gt(u),"g"),"")}o!=="."&&(l=l.replace(new RegExp(Gt(o)),".")),a||(l=l.replace(/-/g,""));const d=parseFloat(l);return Number.isNaN(d)?void 0:d}function Wt(e,t,n){let o=e;return t!==void 0&&o<t&&(o=t),n!==void 0&&o>n&&(o=n),o}function _i(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 ul=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"})]}),fl=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"})}),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"},pi=m.forwardRef((e,t)=>{const{value:n,defaultValue:o,placeholder:r,variant:i="bordered",color:a="default",size:l="md",radius:d="md",fullWidth:u=!0,disableAnimation:_=!1,label:g,description:f,errorMessage:c,startContent:h,endContent:p,isRequired:v=!1,isReadOnly:w=!1,isDisabled:y=!1,isInvalid:x,validationState:E,validate:A,className:L,classNames:N,style:P,min:z,max:I,step:V=1,decimalScale:j,fixedDecimalScale:$=!1,thousandSeparator:b=!1,decimalSeparator:S=".",prefix:T="",suffix:F="",allowNegative:C=!0,allowDecimal:k=!0,hideControls:D=!1,clampBehavior:O="blur",onChange:H,onValueChange:B,onFocus:U,onBlur:X,onKeyDown:ge,id:ce,name:ie,...pe}=e,ue=m.useRef(null),Z=m.useRef(ce??`input-numeric-${Ht(8)}`).current;m.useImperativeHandle(t,()=>ue.current);const oe=n!==void 0,[te,ve]=m.useState(o!==void 0?o:void 0),[se,Q]=m.useState(""),[de,be]=m.useState(!1),J=oe?n===""?void 0:n:te,Ce=m.useMemo(()=>({separadorMiles:b,separadorDecimal:S,escalaDecimal:k?j:0,decimalesFijos:$,prefijo:T,sufijo:F,permitirNegativo:C}),[b,S,j,$,T,F,C,k]),W=m.useMemo(()=>{if(!A)return null;const ne=_i(A(J));return ne.invalido?ne.mensaje:null},[J,A]),q=m.useMemo(()=>x!==void 0?x:E==="invalid"?!0:E==="valid"?!1:!!W,[x,E,W]),G=E==="valid"&&!q,fe={invalido:q,mensaje:W},_e=m.useCallback(ne=>{oe||ve(ne),H?.(ne),B?.(St(ne,Ce),ne)},[oe,H,B,Ce]),he=m.useCallback(ne=>{let We=(J??0)+V*ne;O!=="none"&&(We=Wt(We,z,I)),j!==void 0&&(We=gi(We,j)),_e(We),Q(St(We,Ce))},[J,V,z,I,O,j,_e,Ce]),Ze=m.useCallback(ne=>{if(y||w)return;const Me=ne.target.value,We=S===","?",":".";let Pe="0-9";k&&(Pe+=We),C&&(Pe+="-");const tn=new RegExp(`[^${Pe}]`,"g");let en=Me.replace(tn,"");if(k){const mn=en.split(We);mn.length>2&&(en=mn[0]+We+mn.slice(1).join(""))}if(C&&en.includes("-")){const mn=en.replace(/-/g,"");en=en.startsWith("-")?"-"+mn:mn}Q(en);const $n=fi(en,Ce);if(O==="strict"&&$n!==void 0){const mn=Wt($n,z,I);_e(mn)}else _e($n)},[y,w,Ce,O,z,I,_e,S,C,k]),Ue=m.useCallback(ne=>{if(be(!0),J!==void 0){let Me=String(J);S!=="."&&(Me=Me.replace(".",S)),Q(Me)}U?.(ne)},[J,S,U]),je=m.useCallback(ne=>{if(be(!1),O==="blur"&&J!==void 0){const Me=Wt(J,z,I);Me!==J&&_e(Me)}Q(St(J,Ce)),X?.(ne)},[J,O,z,I,_e,Ce,X]),Le=m.useCallback(ne=>{ne.key==="ArrowUp"?(ne.preventDefault(),he(1)):ne.key==="ArrowDown"&&(ne.preventDefault(),he(-1));const Me=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],We=ne.ctrlKey||ne.metaKey,Pe=k&&(ne.key===S||ne.key==="."||ne.key===","),tn=ne.key==="-"&&C,cn=/^[0-9]$/.test(ne.key);!Me.includes(ne.key)&&!We&&!Pe&&!tn&&!cn&&ne.preventDefault(),ge?.(ne)},[he,ge,S,C,k]);m.useEffect(()=>{de||Q(St(J,Ce))},[J,de,Ce]);const Je=f?`${Z}-desc`:void 0,Se=q?`${Z}-err`:void 0,me=[Je,Se].filter(Boolean).join(" ")||void 0,we=typeof c=="function"?c(fe):c??W,Ve=I===void 0||(J??0)<I,Fe=z===void 0||(J??0)>z,yn=K(He.contenedor_base,He[`variante_${i}`],He[`tam_${l}`],He[`radio_${d}`],He[`color_${a}`],{[He.ancho_total]:u,[He.sin_animacion]:_,[He.deshabilitado]:y,[He.solo_lectura]:w,[He.invalido]:q,[He.valido]:G,[He.enfocado]:de},L,N?.base);return s.jsxs("div",{className:yn,style:P,children:[g&&s.jsxs("label",{className:K(He.etiqueta,N?.label),htmlFor:Z,children:[g,v&&s.jsx("span",{className:He.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsxs("div",{className:K(He.envoltorio_input,N?.inputWrapper),children:[s.jsxs("div",{className:K(He.envoltorio_interno,N?.innerWrapper),children:[h&&s.jsx("span",{className:He.contenido_inicio,children:h}),s.jsx("input",{...pe,ref:ue,id:Z,name:ie,type:"text",inputMode:"decimal",value:se,placeholder:r,disabled:y,readOnly:w,required:v,"aria-invalid":q||void 0,"aria-describedby":me,"aria-required":v,className:K(He.entrada,N?.input),onChange:Ze,onFocus:Ue,onBlur:je,onKeyDown:Le}),p&&s.jsx("span",{className:He.contenido_final,children:p})]}),!D&&!w&&!y&&s.jsxs("div",{className:K(He.controles,N?.controls),children:[s.jsx("button",{type:"button",tabIndex:-1,className:K(He.boton_control,N?.controlButton),disabled:!Fe,onClick:()=>he(-1),"aria-label":"Decrementar valor",children:s.jsx(fl,{})}),s.jsx("button",{type:"button",tabIndex:-1,className:K(He.boton_control,N?.controlButton),disabled:!Ve,onClick:()=>he(1),"aria-label":"Incrementar valor",children:s.jsx(ul,{})})]})]}),f&&!q&&s.jsx("div",{id:Je,className:K(He.descripcion,N?.description),children:f}),q&&we&&s.jsx("div",{id:Se,className:K(He.mensaje_error,N?.errorMessage),role:"alert",children:we})]})});pi.displayName="InputNumeric";function _l(e){return e===!0||e===null||e===void 0?{invalido:!1,mensaje:null}:e===!1?{invalido:!0,mensaje:null}:typeof e=="string"?{invalido:!0,mensaje:e}:typeof e=="object"&&e.message?{invalido:!0,mensaje:e.message}:{invalido:!1,mensaje:null}}function Ko(e,t="es-CO"){if(!e)return"";const n=new Date(e+"T00:00:00");return Number.isNaN(n.getTime())?"":n.toLocaleDateString(t,{year:"numeric",month:"long",day:"numeric"})}function gl(){return new Date().toISOString().split("T")[0]}function pl(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 Xe={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"},hl=()=>s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("polyline",{points:"12 6 12 12 16 14"})]}),ml=()=>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"})]}),vl=()=>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"})]}),bl=({tipo:e,onClick:t,onMouseDown:n})=>s.jsx("button",{type:"button",tabIndex:-1,className:Xe.boton_icono,onMouseDown:n,onClick:t,"aria-label":e==="time"?"Abrir selector de hora":"Abrir selector de fecha",children:e==="time"?s.jsx(hl,{}):s.jsx(ml,{})}),hi=m.forwardRef((e,t)=>{const{type:n="date",value:o,defaultValue:r,placeholder:i,variant:a="bordered",color:l="default",size:d="md",radius:u="md",fullWidth:_=!0,disableAnimation:g=!1,label:f,description:c,errorMessage:h,startContent:p,isRequired:v=!1,isReadOnly:w=!1,isDisabled:y=!1,isInvalid:x,validationState:E,validate:A,className:L,classNames:N,style:P,min:z,max:I,isClearable:V=!1,onChange:j,onFocus:$,onBlur:b,id:S,name:T,...F}=e,C=m.useRef(null),D=m.useRef(S??`input-date-${Ht(8)}`).current;m.useImperativeHandle(t,()=>C.current);const O=o!==void 0,[H,B]=m.useState(r??""),U=O?o:H,[X,ge]=m.useState(!1),ce=m.useRef(!1),ie=m.useMemo(()=>{if(U&&n!=="time"&&(z||I)){if(z&&U<z)return`La fecha debe ser ${n==="date"?Ko(z):z} o posterior`;if(I&&U>I)return`La fecha debe ser ${n==="date"?Ko(I):I} o anterior`}if(!A)return null;const q=_l(A(U));return q.invalido?q.mensaje:null},[U,A,z,I,n]),pe=m.useMemo(()=>x!==void 0?x:E==="invalid"?!0:E==="valid"?!1:!!ie,[x,E,ie]),ue=E==="valid"&&!pe,ye={invalido:pe,mensaje:ie},Z=m.useCallback(q=>{if(y||w)return;ce.current=!1;const G=q.target.value;O||B(G),j?.(G)},[O,y,w,j]),oe=m.useCallback(q=>{ge(!0),$?.(q)},[$]),te=m.useCallback(q=>{ge(!1),ce.current=!1,b?.(q)},[b]),ve=m.useCallback(q=>{q.preventDefault()},[]),se=m.useCallback(q=>{if(q.preventDefault(),q.stopPropagation(),!(!C.current||y||w)){if(ce.current){ce.current=!1,C.current.blur();return}C.current.focus();try{C.current.showPicker?.(),ce.current=!0}catch{}}},[y,w]),Q=m.useCallback(q=>{q.preventDefault(),q.stopPropagation(),ce.current=!1,O||B(""),j?.(""),C.current?.focus()},[O,j]),de=c?`${D}-desc`:void 0,be=pe?`${D}-err`:void 0,J=[de,be].filter(Boolean).join(" ")||void 0,Ce=typeof h=="function"?h(ye):h??ie,W=K(Xe.contenedor_base,Xe[`variante_${a}`],Xe[`tam_${d}`],Xe[`radio_${u}`],Xe[`color_${l}`],{[Xe.ancho_total]:_,[Xe.sin_animacion]:g,[Xe.deshabilitado]:y,[Xe.solo_lectura]:w,[Xe.invalido]:pe,[Xe.valido]:ue,[Xe.enfocado]:X},L,N?.base);return s.jsxs("div",{className:W,style:P,children:[f&&s.jsxs("label",{className:K(Xe.etiqueta,N?.label),htmlFor:D,children:[f,v&&s.jsx("span",{className:Xe.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsx("div",{className:K(Xe.envoltorio_input,N?.inputWrapper),children:s.jsxs("div",{className:K(Xe.envoltorio_interno,N?.innerWrapper),children:[p&&s.jsx("span",{className:Xe.contenido_inicio,children:p}),s.jsx("input",{...F,ref:C,id:D,name:T,type:n,value:O?U:void 0,defaultValue:O?void 0:r,placeholder:i,disabled:y,readOnly:w,required:v,min:z,max:I,"aria-invalid":pe||void 0,"aria-describedby":J,"aria-required":v,className:K(Xe.entrada,N?.input),onChange:Z,onFocus:oe,onBlur:te}),V&&U&&!y&&!w&&s.jsx("button",{type:"button",tabIndex:-1,className:K(Xe.boton_limpiar,N?.clearButton),onMouseDown:q=>q.preventDefault(),onClick:Q,"aria-label":"Limpiar fecha",children:s.jsx(vl,{})}),s.jsx(bl,{tipo:n,onClick:se,onMouseDown:ve})]})}),c&&!pe&&s.jsx("div",{id:de,className:K(Xe.descripcion,N?.description),children:c}),pe&&Ce&&s.jsx("div",{id:be,className:K(Xe.mensaje_error,N?.errorMessage),role:"alert",children:Ce})]})});hi.displayName="InputDate";const wl={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function Kt({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 _=wl[n||"desvanecer"],g=l?`transicion_${_}_${l}`:"";return s.jsx("div",{...r,onAnimationEnd:u,className:`${g} ${o||""}`.trim(),children:t})}const Ln={badges_wrap:"_badges_wrap_asqih_15",badges_wrap_visible:"_badges_wrap_visible_asqih_23",acciones_grupo:"_acciones_grupo_asqih_33",badge_voz:"_badge_voz_asqih_41",badge_sm:"_badge_sm_asqih_73",badge_md:"_badge_md_asqih_85",badge_lg:"_badge_lg_asqih_97",badge_estirada:"_badge_estirada_asqih_109",badge_icono:"_badge_icono_asqih_129",badge_texto:"_badge_texto_asqih_155",badge_mic:"_badge_mic_asqih_165",badge_tts:"_badge_tts_asqih_173",badge_ondas:"_badge_ondas_asqih_181",badgeOnda:"_badgeOnda_asqih_1",badge_eq:"_badge_eq_asqih_219",badgeEq:"_badgeEq_asqih_1"};function Uo(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:s.jsxs("g",{fill:"currentColor",children:[s.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),s.jsx("path",{d:"M8 11a4 4 0 0 1-4-4H2a6 6 0 0 0 5 5.917V14H5v2h6v-2H9v-1.083A6 6 0 0 0 14 7h-2a4 4 0 0 1-4 4"})]})})}function Xo(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...e,children:s.jsx("path",{fill:"currentColor",d:"M18 5.433c0-1.398-1.742-2.036-2.645-.97l-4.086 4.83A2 2 0 0 1 9.743 10H6a4 4 0 0 0-4 4v4a4 4 0 0 0 4 4h3.743a2 2 0 0 1 1.526.708l4.086 4.829c.902 1.066 2.645.428 2.645-.97zm3.433 3.743a1 1 0 0 1 1.391.258c1.465 2.13 2.238 4.324 2.238 6.566s-.773 4.436-2.238 6.567a1 1 0 1 1-1.648-1.133c1.285-1.87 1.887-3.676 1.887-5.434s-.602-3.564-1.887-5.433a1 1 0 0 1 .258-1.39m4.257-3.9a1 1 0 0 0-1.38 1.448c2.387 2.273 3.628 5.739 3.628 9.276s-1.241 7.003-3.628 9.276a1 1 0 0 0 1.38 1.448c2.863-2.727 4.247-6.761 4.247-10.724S28.554 8.003 25.69 5.276"})})}function mi(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...e,children:[s.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),s.jsx("path",{fill:"currentColor",d:"M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2m0 16a6 6 0 1 1 6-6a6.007 6.007 0 0 1-6 6"})]})}function Yo({tipo:e,texto:t,size:n="md",estirar:o}){const r=e==="mic";return s.jsxs("span",{className:K(Ln.badge_voz,r?Ln.badge_mic:Ln.badge_tts,Ln[`badge_${n}`],o&&Ln.badge_estirada),"data-tipo":e,children:[s.jsx("span",{className:Ln.badge_icono,children:r?s.jsx(Uo,{}):s.jsx(Xo,{})}),s.jsx("span",{className:Ln.badge_texto,children:t}),r?s.jsxs("span",{className:Ln.badge_ondas,"aria-hidden":"true",children:[s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{})]}):s.jsxs("span",{className:Ln.badge_eq,"aria-hidden":"true",children:[s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{})]})]})}function vi({value:e,onChange:t,isDisabled:n,isReadOnly:o,onDictadoCompleto:r,idioma:i="es-ES"}){const[a,l]=m.useState(!1),[d,u]=m.useState(!1),[_,g]=m.useState(null),f=m.useRef(null),c=m.useRef(null),h=m.useRef(null),p=m.useRef(""),v=typeof window<"u"&&"speechSynthesis"in window,w=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),y=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(y(),f.current){try{f.current.stop()}catch(N){console.error("Error stopping recognition:",N)}f.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,y]),E=m.useCallback(()=>{if(f.current)try{f.current.stop()}catch(L){console.error("Error stopping recognition:",L)}u(!1),g(null)},[]),A=m.useCallback(()=>{if(!w||n||o)return;y();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),f.current=null,r?.()},P.onerror=z=>{z.error!=="no-speech"&&(u(!1),f.current=null,z.error!=="aborted"&&g("Error al reconocer voz"))},P.onresult=z=>{try{let I="";for(let $=0;$<z.results.length;$++)I+=z.results[$][0].transcript;const V=p.current&&I?" ":"",j=p.current+V+I;t(j)}catch{g("Error procesando dictado")}},f.current=P,P.start()}catch{g("No se pudo iniciar dictado"),u(!1)}},[w,n,o,e,t,i,y,r]);return m.useEffect(()=>()=>{h.current&&clearTimeout(h.current),v&&window.speechSynthesis.cancel(),f.current&&f.current.abort()},[v]),{puedeHablar:v,puedeEscuchar:w,hablando:a,escuchando:d,errorDictado:_,escuchar:x,detenerHablar:y,dictar:A,detenerDictado:E}}function yl({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 ze={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"},bi=m.forwardRef((e,t)=>{const{children:n,variant:o="bordered",color:r="default",size:i="md",radius:a="md",fullWidth:l=!0,disableAnimation:d=!1,label:u,description:_,errorMessage:g,value:f,defaultValue:c,placeholder:h,isRequired:p=!1,isReadOnly:v=!1,isDisabled:w=!1,isClearable:y=!1,isInvalid:x,validationState:E,validate:A,minRows:L=4,maxRows:N=10,disableAutosize:P=!1,hideVoiceActions:z=!1,className:I,classNames:V,style:j,onChange:$,onClear:b,onFocus:S,onBlur:T,id:F,name:C,rows:k,...D}=e,O=m.useRef(null),B=m.useRef(F??`textarea-${Ht(8)}`).current;m.useImperativeHandle(t,()=>O.current);const U=f!==void 0,[X,ge]=m.useState(c??""),ce=U?f:X,[ie,pe]=m.useState(!1),ue=m.useMemo(()=>{if(!A)return null;const ne=A(ce);return ne===!0||ne==null?null:typeof ne=="string"?ne:typeof ne=="object"&&"message"in ne?ne.message??"Entrada inválida":"Entrada inválida"},[ce,A]),ye=m.useMemo(()=>x!==void 0?x:E==="invalid"?!0:E==="valid"?!1:!!ue,[x,E,ue]),Z=E==="valid"&&!ye,oe={invalido:ye,mensaje:ue},te=ce.length>0,ve=m.useCallback(()=>{if(!O.current||P)return;const ne=O.current,Me=window.getComputedStyle(ne),We=parseFloat(Me.lineHeight)||parseFloat(Me.fontSize)*1.5,Pe=parseFloat(Me.paddingTop)||0,tn=parseFloat(Me.paddingBottom)||0,cn=parseFloat(Me.borderTopWidth)||0,en=parseFloat(Me.borderBottomWidth)||0,$n=L*We+Pe+tn+cn+en,mn=N*We+Pe+tn+cn+en;ne.style.height="auto";const Cn=ne.scrollHeight;ne.style.height=`${Math.min(Math.max(Cn,$n),mn)}px`},[P,L,N]);m.useEffect(()=>{P||ve()},[ce,ve,P]);const se=m.useCallback(ne=>{U||ge(ne),$?.(ne)},[U,$]),{puedeHablar:Q,hablando:de,escuchar:be,detenerHablar:J,puedeEscuchar:Ce,escuchando:W,errorDictado:q,dictar:G,detenerDictado:fe}=vi({isDisabled:w||z,isReadOnly:v,value:ce,onChange:se}),_e=m.useCallback(ne=>{if(w||v)return;const Me=ne.target.value;U||ge(Me),$?.(Me)},[U,w,v,$]),he=m.useCallback(ne=>{pe(!0),S?.(ne)},[S]),Ze=m.useCallback(ne=>{pe(!1),T?.(ne)},[T]),Ue=m.useCallback(()=>{w||v||(U||ge(""),$?.(""),b?.(),O.current?.focus())},[U,w,v,$,b]),je=m.useCallback(()=>{de?J():be()},[de,be,J]),Le=m.useCallback(()=>{W?fe():G()},[W,G,fe]),Je=_?`${B}-desc`:void 0,Se=ye||q?`${B}-err`:void 0,me=[Je,Se].filter(Boolean).join(" ")||void 0,we=typeof g=="function"?g(oe):g??ue,Ve=y&&te&&!v&&!w,Fe=!z||Ve,yn=K(ze.contenedor_base,ze[`variante_${o}`],ze[`tam_${i}`],ze[`radio_${a}`],ze[`color_${r}`],{[ze.ancho_total]:l,[ze.sin_animacion]:d,[ze.deshabilitado]:w,[ze.solo_lectura]:v,[ze.invalido]:ye,[ze.valido]:Z,[ze.enfocado]:ie},I,V?.base);return s.jsxs("div",{className:yn,style:j,children:[u&&s.jsxs("label",{className:K(ze.etiqueta,V?.label),htmlFor:B,children:[u,p&&s.jsx("span",{className:ze.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsxs("div",{className:K(ze.envoltorio_input,V?.inputWrapper),children:[s.jsx("textarea",{...D,ref:O,id:B,name:C,placeholder:h,value:U?ce:void 0,defaultValue:U?void 0:c,onChange:_e,onFocus:he,onBlur:Ze,className:K(ze.entrada,P&&ze.sin_autosize,V?.input),readOnly:v,disabled:w,rows:k??L,"aria-invalid":ye||void 0,"aria-describedby":me,"aria-required":p,required:p}),Fe&&s.jsxs("div",{className:K(ze.barra_acciones,V?.actions),children:[s.jsxs("div",{className:ze.badges_contenedor,"aria-live":"polite",role:"status",children:[s.jsx(Kt,{mostrar:W,children:s.jsx(Yo,{tipo:"mic",texto:"Escuchando...",size:i==="lg"?"md":"sm"})}),s.jsx(Kt,{mostrar:de,children:s.jsx(Yo,{tipo:"tts",texto:"Leyendo...",size:i==="lg"?"md":"sm"})})]}),s.jsxs("div",{className:ze.botones_grupo,children:[!z&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:K(ze.boton_accion,de&&ze.boton_activo_tts),onClick:je,disabled:!Q||!de&&(!ce||W),title:de?"Detener lectura":"Leer texto","aria-pressed":de,"aria-label":de?"Detener lectura":"Leer texto",children:s.jsx(Xo,{})}),Ce&&s.jsx("button",{type:"button",className:K(ze.boton_accion,W&&ze.boton_activo_mic),onClick:Le,disabled:w||v||de,title:W?"Detener dictado":"Dictar texto","aria-pressed":W,"aria-label":W?"Detener dictado":"Dictar texto",children:W?s.jsx(mi,{}):s.jsx(Uo,{})})]}),Ve&&s.jsx("button",{type:"button",className:ze.boton_limpiar,onClick:Ue,title:"Limpiar campo","aria-label":"Limpiar campo",children:s.jsx(yl,{size:"0.75em"})})]})]})]}),_&&!ye&&s.jsx("div",{id:Je,className:K(ze.descripcion,V?.description),children:_}),ye&&we||q?s.jsxs("div",{id:Se,className:K(ze.mensaje_error,V?.errorMessage),role:"alert",children:[we,we&&q&&s.jsx("br",{}),q&&s.jsxs("span",{children:["Error de voz: ",q]})]}):null,n]})});bi.displayName="TextArea";function Ut(){return typeof window<"u"}function Hn(e){return Ro(e)?(e.nodeName||"").toLowerCase():"#document"}function hn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function En(e){var t;return(t=(Ro(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ro(e){return Ut()?e instanceof Node||e instanceof hn(e).Node:!1}function Te(e){return Ut()?e instanceof Element||e instanceof hn(e).Element:!1}function Ye(e){return Ut()?e instanceof HTMLElement||e instanceof hn(e).HTMLElement:!1}function Xt(e){return!Ut()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof hn(e).ShadowRoot}const Cl=new Set(["inline","contents"]);function $t(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=vn(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Cl.has(r)}const xl=new Set(["table","td","th"]);function Sl(e){return xl.has(Hn(e))}const $l=[":popover-open",":modal"];function Yt(e){return $l.some(t=>{try{return e.matches(t)}catch{return!1}})}const kl=["transform","translate","scale","rotate","perspective"],Il=["transform","translate","scale","rotate","perspective","filter"],El=["paint","layout","strict","content"];function Zo(e){const t=Rt(),n=Te(e)?vn(e):e;return kl.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)||Il.some(o=>(n.willChange||"").includes(o))||El.some(o=>(n.contain||"").includes(o))}function Ml(e){let t=zn(e);for(;Ye(t)&&!Pn(t);){if(Zo(t))return t;if(Yt(t))return null;t=zn(t)}return null}function Rt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Nl=new Set(["html","body","#document"]);function Pn(e){return Nl.has(Hn(e))}function vn(e){return hn(e).getComputedStyle(e)}function Zt(e){return Te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function zn(e){if(Hn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Xt(e)&&e.host||En(e);return Xt(t)?t.host:t}function wi(e){const t=zn(e);return Pn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ye(t)&&$t(t)?t:wi(t)}function Gn(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=wi(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),a=hn(r);if(i){const l=Jo(a);return t.concat(a,a.visualViewport||[],$t(r)?r:[],l&&n?Gn(l):[])}return t.concat(r,Gn(r,[],n))}function Jo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Wn=Math.min,bn=Math.max,Jt=Math.round,dt=Math.floor,Mn=e=>({x:e,y:e}),Fl={left:"right",right:"left",bottom:"top",top:"bottom"},Dl={start:"end",end:"start"};function Qo(e,t,n){return bn(e,Wn(t,n))}function ut(e,t){return typeof e=="function"?e(t):e}function Kn(e){return e.split("-")[0]}function ft(e){return e.split("-")[1]}function yi(e){return e==="x"?"y":"x"}function er(e){return e==="y"?"height":"width"}const Al=new Set(["top","bottom"]);function Tn(e){return Al.has(Kn(e))?"y":"x"}function nr(e){return yi(Tn(e))}function Ll(e,t,n){n===void 0&&(n=!1);const o=ft(e),r=nr(e),i=er(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Qt(a)),[a,Qt(a)]}function Pl(e){const t=Qt(e);return[tr(e),t,tr(t)]}function tr(e){return e.replace(/start|end/g,t=>Dl[t])}const Ci=["left","right"],xi=["right","left"],zl=["top","bottom"],Tl=["bottom","top"];function Ol(e,t,n){switch(e){case"top":case"bottom":return n?t?xi:Ci:t?Ci:xi;case"left":case"right":return t?zl:Tl;default:return[]}}function Vl(e,t,n,o){const r=ft(e);let i=Ol(Kn(e),n==="start",o);return r&&(i=i.map(a=>a+"-"+r),t&&(i=i.concat(i.map(tr)))),i}function Qt(e){return e.replace(/left|right|bottom|top/g,t=>Fl[t])}function jl(e){return{top:0,right:0,bottom:0,left:0,...e}}function Si(e){return typeof e!="number"?jl(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}}/*!
|
|
1
|
+
(function(J,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react/jsx-runtime"),require("react"),require("firebase/app"),require("firebase/storage"),require("react-dom"),require("xlsx")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","firebase/app","firebase/storage","react-dom","xlsx"],r):(J=typeof globalThis<"u"?globalThis:J||self,r(J.CoreKitUI={},J.jsxRuntime,J.React,J.app,J.storage,J.ReactDOM,J.XLSX))})(this,(function(J,r,h,wa,yt,Fn,Il){"use strict";var or=typeof document<"u"?document.currentScript:null;function rr(e){if(e&&e.__esModule)return e;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const M=rr(h),ar=rr(Fn),mn=rr(Il);function ya(e){var n,t,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(n=0;n<a;n++)e[n]&&(t=ya(e[n]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function ne(){for(var e,n,t=0,o="",a=arguments.length;t<a;t++)(e=arguments[t])&&(n=ya(e))&&(o&&(o+=" "),o+=n);return o}const Ca=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,xa=ne,Fl=(e,n)=>t=>{var o;if(n?.variants==null)return xa(e,t?.class,t?.className);const{variants:a,defaultVariants:i}=n,s=Object.keys(a).map(u=>{const _=t?.[u],g=i?.[u];if(_===null)return null;const f=Ca(_)||Ca(g);return a[u][f]}),l=t&&Object.entries(t).reduce((u,_)=>{let[g,f]=_;return f===void 0||(u[g]=f),u},{}),c=n==null||(o=n.compoundVariants)===null||o===void 0?void 0:o.reduce((u,_)=>{let{class:g,className:f,...d}=_;return Object.entries(d).every(m=>{let[p,v]=m;return Array.isArray(v)?v.includes({...i,...l}[p]):{...i,...l}[p]===v})?[...u,g,f]:u},[]);return xa(e,s,c,t?.class,t?.className)},ke={boton:"_boton_9uvrp_1",animated:"_animated_9uvrp_83",disabled:"_disabled_9uvrp_83",loading:"_loading_9uvrp_83",xs:"_xs_9uvrp_117",sm:"_sm_9uvrp_135",md:"_md_9uvrp_153",lg:"_lg_9uvrp_167",full_width:"_full_width_9uvrp_181",icon_only:"_icon_only_9uvrp_189",radius_none:"_radius_none_9uvrp_233",radius_sm:"_radius_sm_9uvrp_241",radius_md:"_radius_md_9uvrp_249",radius_lg:"_radius_lg_9uvrp_257",radius_full:"_radius_full_9uvrp_265",content:"_content_9uvrp_273",spinner:"_spinner_9uvrp_275",start_content:"_start_content_9uvrp_277",end_content:"_end_content_9uvrp_279",content_item:"_content_item_9uvrp_291",only_loading:"_only_loading_9uvrp_323",spinner_icon:"_spinner_icon_9uvrp_343",ripple:"_ripple_9uvrp_379",solid:"_solid_9uvrp_431",bordered:"_bordered_9uvrp_449",ghost:"_ghost_9uvrp_469",light:"_light_9uvrp_493",light_active:"_light_active_9uvrp_511",faded:"_faded_9uvrp_531",shadow:"_shadow_9uvrp_551",outline:"_outline_9uvrp_625",muted:"_muted_9uvrp_649",contrast:"_contrast_9uvrp_667",tap_animating:"_tap_animating_9uvrp_713",default:"_default_9uvrp_731",primary:"_primary_9uvrp_741",secondary:"_secondary_9uvrp_751",success:"_success_9uvrp_761",warning:"_warning_9uvrp_771",danger:"_danger_9uvrp_781"},zl=Fl(ke.boton,{variants:{variant:{solid:ke.solid,bordered:ke.bordered,ghost:ke.ghost,light:ke.light,"light-active":ke.light_active,faded:ke.faded,shadow:ke.shadow,outline:ke.outline,muted:ke.muted,contrast:ke.contrast},color:{default:ke.default,primary:ke.primary,secondary:ke.secondary,success:ke.success,warning:ke.warning,danger:ke.danger},size:{xs:ke.xs,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:{true:ke.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"lg",disableAnimation:!0}}),Ze=h.forwardRef(({variant:e="solid",color:n="default",size:t="md",radius:o="lg",fullWidth:a=!1,isLoading:i=!1,onlyLoading:s=!1,isDisabled:l=!1,isIconOnly:c=!1,disableRipple:u=!1,disableAnimation:_=!0,animationTap:g=!1,customColor:f,startContent:d,endContent:m,spinner:p,spinnerPlacement:v="end",permisos:y,permiso:w,children:C,className:k,onClick:z,style:A,type:N="button","aria-label":P,...O},E)=>{const T=w&&y?!y.includes(w):!1,V=l||i||T,S=h.useRef(null),b=D=>{if(V){D.preventDefault();return}if(z?.(D),g&&!V&&D.currentTarget instanceof HTMLElement){const j=D.currentTarget;S.current&&(clearTimeout(S.current),S.current=null),j.classList.remove(ke.tap_animating),j.offsetWidth,j.classList.add(ke.tap_animating),S.current=setTimeout(()=>{j.classList.remove(ke.tap_animating),S.current=null},230)}if(u||V||!(D.currentTarget instanceof HTMLElement))return;const B=D.currentTarget,X=document.createElement("span"),U=B.getBoundingClientRect(),L=Math.max(U.width,U.height);X.className=ke.ripple,X.style.width=`${L}px`,X.style.height=`${L}px`,X.style.left=`${D.clientX-U.left}px`,X.style.top=`${D.clientY-U.top}px`,X.addEventListener("animationend",()=>X.remove(),{once:!0}),B.appendChild(X)},x=f?{"--btn-color":f,"--btn-text-color":f,...A}:A,F=zl({variant:e,color:f?void 0:n,size:t,radius:o,fullWidth:a,isIconOnly:c,isLoading:i,onlyLoading:s,isDisabled:V,disableAnimation:_}),I=i&&r.jsx("span",{className:ke.spinner,"aria-hidden":s?void 0:"true",children:p||r.jsx("span",{className:ke.spinner_icon})}),$=s&&!P?"Cargando":P;return r.jsxs("button",{...O,ref:E,type:N,"aria-label":$,"aria-busy":i,className:ne(F,k),disabled:V,onClick:b,style:x,children:[v==="start"&&I,d&&!s&&r.jsx("span",{className:ne(ke.start_content,ke.content_item),children:d}),C&&!s&&r.jsx("span",{className:ke.content,children:C}),m&&!s&&r.jsx("span",{className:ne(ke.end_content,ke.content_item),children:m}),v==="end"&&I]})});Ze.displayName="Boton";const Ft={badge:"_badge_1ojub_1",badge_clickable:"_badge_clickable_1ojub_41",size_xs:"_size_xs_1ojub_65",size_sm:"_size_sm_1ojub_77",size_md:"_size_md_1ojub_89",size_lg:"_size_lg_1ojub_101",size_xl:"_size_xl_1ojub_113",radius_none:"_radius_none_1ojub_125",radius_sm:"_radius_sm_1ojub_133",radius_md:"_radius_md_1ojub_141",radius_lg:"_radius_lg_1ojub_149",radius_full:"_radius_full_1ojub_157",dot:"_dot_1ojub_165",icon:"_icon_1ojub_179",dismiss_button:"_dismiss_button_1ojub_191",variant_solid:"_variant_solid_1ojub_251",color_default:"_color_default_1ojub_259",color_primary:"_color_primary_1ojub_269",color_secondary:"_color_secondary_1ojub_279",color_success:"_color_success_1ojub_289",color_warning:"_color_warning_1ojub_299",color_danger:"_color_danger_1ojub_309",color_info:"_color_info_1ojub_319",color_brand:"_color_brand_1ojub_329",variant_subtle:"_variant_subtle_1ojub_339",variant_outline:"_variant_outline_1ojub_419",variant_soft:"_variant_soft_1ojub_515",badge_custom:"_badge_custom_1ojub_595"},Ll=()=>r.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:r.jsx("path",{d:"M2 2L8 8M8 2L2 8"})}),$a=({variant:e="solid",color:n="default",size:t="md",radius:o="md",children:a,startIcon:i,endIcon:s,dot:l,dismissible:c,onDismiss:u,customColor:_,className:g="",onClick:f})=>{const d=!!f,m=h.useMemo(()=>{if(!_)return;const y=_,w=`color-mix(in oklab, ${y} 15%, transparent)`;return{solid:{"--badge-custom-bg":y,"--badge-custom-text":"white","--badge-custom-border":"transparent"},subtle:{"--badge-custom-bg":w,"--badge-custom-text":y,"--badge-custom-border":"transparent"},outline:{"--badge-custom-bg":"transparent","--badge-custom-text":y,"--badge-custom-border":y},soft:{"--badge-custom-bg":`color-mix(in oklab, ${y} 10%, var(--surface-first))`,"--badge-custom-text":y,"--badge-custom-border":"transparent"}}[e]},[_,e]),p=[Ft.badge,Ft[`size_${t}`],Ft[`radius_${o}`],Ft[`variant_${e}`],!_&&Ft[`color_${n}`],_&&Ft.badge_custom,d&&Ft.badge_clickable,g].filter(Boolean).join(" "),v=h.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)"}[n],[n,_]);return r.jsxs("span",{className:p,style:m,onClick:f,role:d?"button":void 0,tabIndex:d?0:void 0,children:[l&&r.jsx("span",{className:Ft.dot,style:{backgroundColor:v}}),i&&r.jsx("span",{className:Ft.icon,children:i}),a,s&&r.jsx("span",{className:Ft.icon,children:s}),c&&r.jsx("button",{type:"button",className:Ft.dismiss_button,onClick:y=>{y.stopPropagation(),u?.()},"aria-label":"Eliminar badge",children:r.jsx(Ll,{})})]})},Ue={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"},ir=h.forwardRef(({isSelected:e,defaultSelected:n=!1,onChange:t,label:o,description:a,size:i="md",color:s="primary",customColor:l,variant:c="default",isDisabled:u=!1,isReadOnly:_=!1,isInvalid:g=!1,isRequired:f=!1,showIcons:d=!1,labelPlacement:m="right",labelPosition:p="inline",justifyEnd:v=!1,children:y,className:w="",...C},k)=>{const[z,A]=h.useState(n),N=h.useId(),P=C.id||N,O=e!==void 0?e:z,E=I=>{if(u||_)return;const $=I.target.checked;e===void 0&&A($),t&&t($)},T=y||o,V=[Ue.contenedor_toggle,Ue[`tam_${i}`],!l&&Ue[`color_${s}`],Ue[`variante_${c}`],Ue[`label_${m}`],Ue[`posicion_${p}`],O&&Ue.seleccionado,u&&Ue.deshabilitado,_&&Ue.solo_lectura,g&&Ue.invalido,d&&Ue.con_iconos,v&&Ue.justify_end,w].filter(Boolean).join(" "),S=l?{"--toggle-custom-color":l}:void 0,b=()=>T?r.jsxs("div",{className:Ue.contenedor_label,children:[r.jsxs("span",{className:Ue.texto_label,children:[T,f&&r.jsx("span",{className:Ue.marca_requerido,children:" *"})]}),a&&r.jsx("span",{className:Ue.texto_descripcion,children:a})]}):null,x=()=>c!=="moon"?null:r.jsx("div",{className:Ue.icono_moon,children:r.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:r.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"})})}),F=()=>!d||c==="moon"?null:r.jsxs(r.Fragment,{children:[r.jsx("svg",{className:Ue.icono_check,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("polyline",{points:"2,6 5,9 10,3"})}),r.jsxs("svg",{className:Ue.icono_x,width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[r.jsx("line",{x1:"2",y1:"2",x2:"8",y2:"8"}),r.jsx("line",{x1:"8",y1:"2",x2:"2",y2:"8"})]})]});return r.jsxs("div",{className:V,style:S,children:[p==="top"&&b(),r.jsxs("label",{className:Ue.envoltorio_toggle,htmlFor:P,children:[p==="inline"&&m==="left"&&b(),r.jsxs("div",{className:Ue.pista_toggle,children:[r.jsx("input",{ref:k,type:"checkbox",id:P,checked:O,disabled:u,readOnly:_,required:f,"aria-invalid":g,className:Ue.input,onChange:E,...C}),r.jsx("div",{className:Ue.fondo_pista,children:r.jsxs("div",{className:Ue.pulgar_toggle,children:[x(),F()]})})]}),p==="inline"&&m==="right"&&b()]})]})});ir.displayName="Toggle";const Al=({className:e})=>r.jsx("svg",{className:e,width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),Sa=({className:e})=>r.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.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"})}),Dl=({className:e})=>r.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M3 7v6h6M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})}),Pl=({className:e})=>r.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"})}),Tl=({className:e})=>r.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M12 20h9M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})}),Ol=({className:e})=>r.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"}),r.jsx("path",{d:"M15 19h6"}),r.jsx("path",{d:"M18 16v6"})]}),Vl=({className:e})=>r.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M20 6L9 17l-5-5"})}),ve={backdrop:"_backdrop_3rgw3_1",visible:"_visible_3rgw3_41",modal:"_modal_3rgw3_65",cuerpo_modal:"_cuerpo_modal_3rgw3_107",encabezado:"_encabezado_3rgw3_155",titulo:"_titulo_3rgw3_169",boton_cerrar:"_boton_cerrar_3rgw3_183",texto_esc:"_texto_esc_3rgw3_223",icono_x:"_icono_x_3rgw3_237",contenedor_lienzo:"_contenedor_lienzo_3rgw3_247",area_firma:"_area_firma_3rgw3_257",superficie_lienzo:"_superficie_lienzo_3rgw3_271",lienzo:"_lienzo_3rgw3_279",lienzo_deshabilitado:"_lienzo_deshabilitado_3rgw3_309",barra_acciones:"_barra_acciones_3rgw3_319",grupo_izquierda:"_grupo_izquierda_3rgw3_339",grupo_derecha:"_grupo_derecha_3rgw3_351",separador:"_separador_3rgw3_363",boton_accion:"_boton_accion_3rgw3_375",contenedor_guardar:"_contenedor_guardar_3rgw3_435",boton_texto_con_icono:"_boton_texto_con_icono_3rgw3_447",accion_texto:"_accion_texto_3rgw3_459",icono_boton_accion:"_icono_boton_accion_3rgw3_469",icono:"_icono_3rgw3_237",contenedor_consentimiento:"_contenedor_consentimiento_3rgw3_495",texto_consentimiento:"_texto_consentimiento_3rgw3_509",consentimiento_fila:"_consentimiento_fila_3rgw3_525",toggle_consentimiento:"_toggle_consentimiento_3rgw3_539",contenedor_subir_oculto:"_contenedor_subir_oculto_3rgw3_547",boton_adjuntar:"_boton_adjuntar_3rgw3_559",input_archivo:"_input_archivo_3rgw3_599",input_validacion_firma:"_input_validacion_firma_3rgw3_607",bloque_firma:"_bloque_firma_3rgw3_635",bloque_encabezado:"_bloque_encabezado_3rgw3_657",bloque_titulo:"_bloque_titulo_3rgw3_669",marca_requerido:"_marca_requerido_3rgw3_685",bloque_preview:"_bloque_preview_3rgw3_695",bloque_preview_imagen:"_bloque_preview_imagen_3rgw3_723",bloque_preview_placeholder:"_bloque_preview_placeholder_3rgw3_737",bloque_acciones:"_bloque_acciones_3rgw3_751",accion_agregar_firma:"_accion_agregar_firma_3rgw3_765",accion_eliminar_firma:"_accion_eliminar_firma_3rgw3_767"},Bl=8,jl=1.2,rn=4.2,ql=1.8,ka=(e,n,t)=>Math.max(n,Math.min(t,e)),Hl=(e,n)=>{const t=n.x-e.x,o=n.y-e.y;return Math.sqrt(t*t+o*o)},Na=e=>Number.isFinite(e)?e:performance.now(),Wl=()=>{const e=h.useRef(null),[n,t]=h.useState(!0),[o,a]=h.useState(!1),[i,s]=h.useState([]),l=h.useRef([]),c=h.useRef({color:"#111827",enabled:!0}),u=h.useRef(null),_=h.useRef([]),g=h.useRef(0),f=h.useRef(rn),d=h.useRef(!1),m=h.useCallback(()=>e.current?.getContext("2d")??null,[]),p=h.useCallback(()=>m(),[m]),v=h.useCallback(()=>{const S=e.current,b=m();S&&b&&b.clearRect(0,0,S.width,S.height),t(!0),l.current=[],s([]),_.current=[],u.current=null,f.current=rn,d.current=!1},[m]),y=h.useCallback(()=>{d.current=!0,t(!1)},[]),w=h.useCallback((S,b)=>{const x=Math.max(1,b.t-S.t),I=Hl(S,b)/x,D=(rn-I*ql)*ka(b.pressure||.5,.35,1),B=ka(D,jl,rn),U=f.current+(B-f.current)*.25;return f.current=U,U},[]),C=h.useCallback((S,b)=>{S.strokeStyle=c.current.color,S.lineWidth=b,S.lineCap="round",S.lineJoin="round"},[]),k=h.useCallback((S,b)=>{const x=p();if(!x)return;const F=w(S,b);C(x,F),x.beginPath(),x.moveTo(S.x,S.y),x.quadraticCurveTo(S.x,S.y,b.x,b.y),x.stroke(),t(!1)},[w,p,C]),z=h.useCallback(S=>{const b=e.current;if(!b)return{pressure:.5,t:performance.now(),x:0,y:0};const x=b.getBoundingClientRect(),F=b.width/x.width,I=b.height/x.height;return{pressure:S.pressure&&S.pressure>0?S.pressure:.5,t:S.timeStamp||performance.now(),x:(S.clientX-x.left)*F,y:(S.clientY-x.top)*I}},[]),A=h.useCallback(S=>{if(!c.current.enabled)return;S.preventDefault();const b=e.current;if(!b)return;b.setPointerCapture(S.pointerId);const x=z(S);a(!0),u.current=x,_.current=[x],g.current=Na(S.timeStamp)},[z]),N=h.useCallback(S=>{if(!o||!c.current.enabled)return;S.preventDefault();const b=Na(S.timeStamp);if(b-g.current<Bl)return;g.current=b;const x=z(S),F=u.current;F&&(k(F,x),u.current=x,_.current.push(x))},[k,o,z]),P=h.useCallback(S=>{if(S&&e.current?.hasPointerCapture(S.pointerId)&&e.current.releasePointerCapture(S.pointerId),o&&_.current.length>0){const b=[...l.current,{puntos:[..._.current]}];l.current=b,s(b)}a(!1),u.current=null,_.current=[]},[o]),O=h.useCallback((S,b,x)=>{if(!(b.puntos.length<2))for(let F=1;F<b.puntos.length;F++){const I=b.puntos[F-1],$=b.puntos[F],D=w(I,$);S.strokeStyle=x??c.current.color,S.lineWidth=D,S.lineCap="round",S.lineJoin="round",S.beginPath(),S.moveTo(I.x,I.y),S.quadraticCurveTo(I.x,I.y,$.x,$.y),S.stroke()}},[w]),E=h.useCallback(()=>{if(l.current.length===0)return;const S=l.current.slice(0,-1);l.current=S,s(S);const b=e.current;if(!b)return;const x=m();x&&(x.clearRect(0,0,b.width,b.height),f.current=rn,S.forEach(F=>O(x,F)),t(S.length===0&&!d.current))},[m,O]),T=h.useCallback((S={})=>{const b=e.current;if(!b||n&&l.current.length===0&&!d.current)return null;const{backgroundColor:x,format:F,quality:I,strokeColor:$}=S;if(!x&&!$)return b.toDataURL("image/png");const D=document.createElement("canvas");D.width=b.width,D.height=b.height;const B=D.getContext("2d");if(!B)return null;x&&(B.fillStyle=x,B.fillRect(0,0,D.width,D.height)),$&&l.current.length>0&&!d.current?(f.current=rn,l.current.forEach(L=>O(B,L,$))):B.drawImage(b,0,0);const X=F??"image/png",U=I??.85;return X==="image/png"?D.toDataURL(X):D.toDataURL(X,U)},[n,O]),V=h.useCallback(S=>{const b=e.current,x=m();if(!b||!x)return;if(c.current={color:S.color,enabled:S.enabled??!0},b.style.touchAction="none",b.style.userSelect="none",!c.current.enabled)return()=>{};const F=B=>A(B),I=B=>N(B),$=B=>P(B),D=B=>P(B);return b.addEventListener("pointerdown",F,{passive:!1}),b.addEventListener("pointermove",I,{passive:!1}),b.addEventListener("pointerup",$,{passive:!1}),b.addEventListener("pointerleave",$,{passive:!1}),b.addEventListener("pointercancel",D,{passive:!1}),()=>{b.removeEventListener("pointerdown",F),b.removeEventListener("pointermove",I),b.removeEventListener("pointerup",$),b.removeEventListener("pointerleave",$),b.removeEventListener("pointercancel",D)}},[P,A,N,m]);return h.useEffect(()=>{f.current=rn},[i.length]),{canvasRef:e,configurarCanvas:V,deshacerUltimoTrazo:E,estaVacio:n,limpiarCanvas:v,marcarConContenido:y,obtenerDatosFirma:T,puedeDeshacer:i.length>0}},Ea=h.forwardRef(({alto:e=200,ancho:n=700,aspectRatio:t,className:o,closeOnBackdropClick:a=!1,firmaInicial:i=null,isOpen:s=!1,isRequired:l=!1,mostrarBotonSubir:c=!0,name:u,onClose:_,onConfirm:g,readonly:f=!1,readonlyPostGuardado:d=!1,requiredMessage:m="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:y="Deshacer",textoEliminarFirma:w="Eliminar firma",textoEstadoGuardada:C="Guardada",textoEstadoPendiente:k="Pendiente",textoGuardar:z="Guardar firma",textoLimpiar:A="Limpiar",textoModificar:N="Modificar firma",textoReemplazarFirma:P="Reemplazar firma",textoSolicitarFirma:O="Agregar firma",tituloBloque:E="Firma del responsable",titulo:T="Firmar el contrato",mostrarBotonAgregarFirma:V=!0,mostrarBotonEliminarFirma:S=!0,firebasePath:b,firebaseStorage:x,onFirebaseUploadSuccess:F,onFirebaseUploadError:I,fondoTransparente:$=!0},D)=>{const{canvasRef:B,configurarCanvas:X,deshacerUltimoTrazo:U,estaVacio:L,limpiarCanvas:j,marcarConContenido:W,obtenerDatosFirma:ie,puedeDeshacer:re}=Wl(),ae=h.useRef(null),me=h.useRef(null),ee=h.useRef(null),fe=h.useId(),R=`${fe}-toggle`,se=`${fe}-texto`,_e=`${fe}-dialog-title`,Se=`${fe}-dialog-description`,[ge,le]=h.useState(!!s),[he,G]=h.useState(!1),[Y,ce]=h.useState(i),[K,q]=h.useState(n),[H,de]=h.useState(!1),[te,pe]=h.useState(!!i),[Ye,Oe]=h.useState(!1),[Ae,Ne]=h.useState(!1),ot=Math.round(K*e/Math.max(1,n)),Me=f||d&&te,bt=!f&&!(d&&te),Te=h.useCallback(Ie=>{const Fe=B.current,Je=Fe?.getContext("2d");if(!Fe||!Je)return;const kt=new Image;kt.onload=()=>{Je.clearRect(0,0,Fe.width,Fe.height);const Mt=Fe.width/Fe.height,hn=kt.width/kt.height;let eo=Fe.width,to=Fe.height,Ro=0,er=0;hn>Mt?(to=Fe.width/hn,er=(Fe.height-to)/2):(eo=Fe.height*hn,Ro=(Fe.width-eo)/2),Je.drawImage(kt,Ro,er,eo,to),W(),Oe(!0)},kt.src=Ie},[B,W]),be=h.useCallback(()=>{if(x&&typeof x=="object")return x;if(!wa.getApps().length)throw new Error("Firebase no esta inicializado. Inicializa la app y el almacenamiento antes de usar firebasePath o pasa firebaseStorage al componente.");return yt.getStorage()},[x]),Ge=h.useCallback(()=>{j(),ce(null),Oe(!1),pe(!1)},[j]),lt=h.useCallback(()=>{Me||(j(),Oe(!1))},[Me,j]),Ee=h.useCallback(async()=>{if(Me||Ae)return;const Ie=be(),Fe=typeof Y=="string"&&/^https?:\/\//i.test(Y)?yt.ref(Ie,Y):b?yt.ref(Ie,b):null;try{Fe&&(Ne(!0),await yt.deleteObject(Fe)),Ge(),g?.("")}catch(Je){if(typeof Je=="object"&&Je!==null&&"code"in Je&&String(Je.code)==="storage/object-not-found"){Ge(),g?.("");return}console.error("Error al eliminar la firma de Firebase:",Je),I?.(Je instanceof Error?Je:new Error(String(Je)))}finally{Fe&&Ne(!1)}},[Me,Y,b,be,Ge,g,I,Ae]),rt=h.useCallback(()=>{f||(j(),pe(!1),Oe(!1),de(!1))},[j,f]),St=h.useCallback(Ie=>{if(Me)return;const Fe=Ie.target.files?.[0];if(!Fe)return;const Je=new FileReader;Je.onload=kt=>{const Mt=kt.target?.result;typeof Mt=="string"&&(j(),Te(Mt))},Je.readAsDataURL(Fe)},[Me,Te,j]),Et=h.useCallback(()=>{Me||ae.current?.click()},[Me]),Ce=h.useCallback(()=>{de(!1),Oe(!1),j()},[j]),xe=h.useCallback(Ie=>{he||(G(!0),setTimeout(()=>{le(!1),G(!1),Ie?.()},400))},[he]),et=h.useCallback(()=>{xe(()=>{Ce(),_?.()})},[xe,Ce,_]),Be=h.useCallback(async()=>{if(Me||he||Ae)return;const Ie=ie($?{format:"image/png",strokeColor:"#111827"}:{backgroundColor:"#ffffff",format:"image/jpeg",quality:.82,strokeColor:"#111827"});if(!Ie||!H)return;let Fe=Ie;try{if(b){Ne(!0);const Je=be();let kt;try{kt=yt.ref(Je,b)}catch(Mt){const hn=Mt instanceof Error?Mt.message:String(Mt);throw new Error(`No se pudo crear la referencia de Firebase Storage para "${b}". Posible conflicto por dos copias de Firebase (la app y la libreria). Verifica que firebase este externalizado en corekit-ui y que la app use una sola instancia del SDK. Detalle: ${hn}`)}await yt.uploadString(kt,Ie,"data_url"),Fe=await yt.getDownloadURL(kt),F?.(Fe)}xe(()=>{ce(Fe),pe(!0),g?.(Fe),Ce(),_?.()})}catch(Je){console.error("Error al subir la firma a Firebase:",Je),I?.(Je instanceof Error?Je:new Error(String(Je)))}finally{b&&Ne(!1)}},[Me,he,Ae,ie,$,H,b,xe,be,F,g,Ce,_,I]);h.useEffect(()=>{s&&(le(!0),G(!1))},[s]),h.useEffect(()=>{ce(i),pe(!!i)},[i]),h.useEffect(()=>{if(!ge)return;const Ie=()=>{const Fe=ee.current;Fe&&q(Math.max(1,Math.floor(Fe.clientWidth)))};return Ie(),window.addEventListener("resize",Ie),()=>window.removeEventListener("resize",Ie)},[n,ge]),h.useImperativeHandle(D,()=>({limpiar:j,obtenerDatosFirma:ie,estaVacio:()=>L}),[L,j,ie]),h.useEffect(()=>{if(!ge)return;const Ie=X({color:"#111827",enabled:!Me});return()=>{Ie?.()}},[Me,X,ge]),h.useEffect(()=>{if(!ge){document.body.style.overflow="";return}const Ie=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",Ie>0&&(document.body.style.paddingRight=`${Ie}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[ge]),h.useEffect(()=>{ge||Ce()},[Ce,ge]),h.useEffect(()=>{if(!ge)return;const Ie=Fe=>{if(Fe.key==="Escape"){et();return}if(Fe.ctrlKey&&Fe.key.toLowerCase()==="z"){Fe.preventDefault(),!Me&&re&&U();return}Fe.ctrlKey&&Fe.key==="Enter"&&(Fe.preventDefault(),Me||Be())};return document.addEventListener("keydown",Ie),()=>document.removeEventListener("keydown",Ie)},[Me,U,et,Be,ge,re]),h.useEffect(()=>{const Ie=me.current;if(!Ie)return;if(l&&!!!Y){Ie.setCustomValidity(m);return}Ie.setCustomValidity("")},[Y,l,m]);const wt=h.useCallback(Ie=>{he||!a||Ie.target===Ie.currentTarget&&et()},[a,he,et]),Tt=Me,ba=Me||Ye,Ot=Me||!te&&(L&&!Ye||!H),Qo=()=>{f||(Y&&rt(),G(!1),le(!0))};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${ve.bloque_firma} ${o||""}`,children:[r.jsxs("div",{className:ve.bloque_encabezado,children:[r.jsxs("span",{className:ve.bloque_titulo,children:[E,l&&r.jsx("span",{className:ve.marca_requerido,"aria-hidden":"true",children:"*"})]}),r.jsx($a,{color:Y?"success":"warning",size:"sm",variant:"outline",children:Y?C:k})]}),r.jsxs("div",{className:ve.bloque_preview,style:t?{aspectRatio:t}:void 0,children:[(l||u)&&r.jsx("input",{ref:me,className:ve.input_validacion_firma,"aria-hidden":"true",name:u,required:l,tabIndex:-1,type:"text",value:Y?"signed":"",onChange:()=>{},onInvalid:Ie=>{l&&!Y&&Ie.currentTarget.setCustomValidity(m)},onInput:Ie=>{Ie.currentTarget.setCustomValidity("")}}),Y?r.jsx("img",{src:Y,alt:"Firma guardada",className:ve.bloque_preview_imagen}):r.jsx("span",{className:ve.bloque_preview_placeholder,children:"Sin firma registrada"})]}),!f&&(V||S&&!!Y)&&r.jsxs("div",{className:ve.bloque_acciones,children:[V&&r.jsx(Ze,{color:"primary",size:"sm",variant:"solid",onClick:Qo,className:ve.accion_agregar_firma,isDisabled:Me||he,children:r.jsxs("span",{className:ve.boton_texto_con_icono,children:[Y?r.jsx(Tl,{className:ve.icono_boton_accion}):r.jsx(Ol,{className:ve.icono_boton_accion}),r.jsx("span",{className:ve.accion_texto,children:Y?P:O})]})}),S&&Y&&r.jsx(Ze,{color:"danger",size:"sm",variant:"bordered",onClick:Ee,className:ve.accion_eliminar_firma,isDisabled:Me||he||Ae,children:r.jsxs("span",{className:ve.boton_texto_con_icono,children:[r.jsx(Sa,{className:ve.icono_boton_accion}),r.jsx("span",{className:ve.accion_texto,children:w})]})})]})]}),ge&&r.jsx("div",{className:`${ve.backdrop} ${he?"":ve.visible}`,onClick:wt,children:r.jsxs("div",{className:`${ve.modal} ${he?"":ve.visible}`,role:"dialog","aria-modal":"true","aria-labelledby":_e,"aria-describedby":Se,children:[r.jsxs("header",{className:ve.encabezado,children:[r.jsx("h2",{id:_e,className:ve.titulo,children:T}),r.jsxs("button",{className:ve.boton_cerrar,onClick:et,type:"button","aria-label":"Cerrar",children:[r.jsx("span",{className:ve.texto_esc,children:"ESC"}),r.jsx(Al,{className:ve.icono_x})]})]}),r.jsxs("div",{className:ve.cuerpo_modal,children:[r.jsx("div",{className:ve.contenedor_lienzo,ref:ee,children:r.jsxs("div",{className:ve.area_firma,children:[r.jsx("div",{className:ve.superficie_lienzo,children:r.jsx("canvas",{ref:B,className:`${ve.lienzo} ${Tt?ve.lienzo_deshabilitado:""}`,width:K,height:ot,style:{height:`${ot}px`,pointerEvents:ba?"none":"auto",width:"100%"},"aria-label":"Area de firma"})}),bt&&r.jsxs("div",{className:ve.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[r.jsxs("div",{className:ve.grupo_izquierda,children:[r.jsxs("button",{className:ve.boton_accion,onClick:U,type:"button",disabled:!re||Tt,"aria-label":y,children:[r.jsx(Dl,{className:ve.icono,"aria-hidden":"true"}),r.jsx("span",{children:y})]}),r.jsx("span",{className:ve.separador,"aria-hidden":"true",children:"|"}),r.jsxs("button",{className:ve.boton_accion,onClick:lt,type:"button",disabled:L&&!Ye||Tt,"aria-label":A,children:[r.jsx(Sa,{className:ve.icono,"aria-hidden":"true"}),r.jsx("span",{children:A})]})]}),c&&r.jsx("div",{className:ve.grupo_derecha,children:r.jsxs("button",{className:ve.boton_adjuntar,onClick:Et,type:"button",disabled:Me,children:[r.jsx(Pl,{className:ve.icono,"aria-hidden":"true"}),p]})})]})]})}),bt&&r.jsxs(r.Fragment,{children:[r.jsx("div",{id:Se,className:ve.contenedor_consentimiento,children:r.jsxs("div",{className:ve.consentimiento_fila,children:[r.jsx(ir,{id:R,isSelected:H,onChange:de,color:"primary",size:"md",isDisabled:Me,"aria-describedby":se,className:ve.toggle_consentimiento}),r.jsx("label",{htmlFor:R,id:se,className:ve.texto_consentimiento,children:v})]})}),r.jsx("div",{className:ve.contenedor_guardar,children:r.jsx(Ze,{color:"primary",variant:"solid",size:"md",onClick:te&&!d?rt:Be,type:"button",isLoading:Ae,isDisabled:Ot||Ae,startContent:Ae?void 0:r.jsx(Vl,{className:ve.icono,"aria-hidden":"true"}),children:Ae?"Guardando...":te&&!d?N:z})})]}),bt&&c&&r.jsx("div",{className:ve.contenedor_subir_oculto,children:r.jsx("input",{ref:ae,type:"file",accept:"image/*",className:ve.input_archivo,onChange:St,"aria-label":"Subir imagen de firma"})})]})]})})]})});Ea.displayName="Signature";const Gl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let no=(e=21)=>{let n="",t=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=Gl[t[e]&63];return n};const Zl=({size:e="1em",...n})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:[r.jsx("path",{d:"M18 6 6 18"}),r.jsx("path",{d:"m6 6 12 12"})]}),Ul=({size:e="1em",...n})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:[r.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"}),r.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),Kl=({size:e="1em",...n})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:[r.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"}),r.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),r.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"}),r.jsx("path",{d:"m2 2 20 20"})]}),Ke={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"},Ma=h.forwardRef((e,n)=>{const{type:t="text",value:o,defaultValue:a,placeholder:i,variant:s="bordered",color:l="default",size:c="md",radius:u="md",fullWidth:_=!0,disableAnimation:g=!1,label:f,description:d,errorMessage:m,startContent:p,endContent:v,isRequired:y=!1,isReadOnly:w=!1,isDisabled:C=!1,isClearable:k=!1,isInvalid:z,validationState:A,validate:N,className:P,classNames:O,style:E,onChange:T,onClear:V,onValueChange:S,onFocus:b,onBlur:x,onKeyDown:F,id:I,name:$,autoComplete:D,autoFocus:B,maxLength:X,minLength:U,pattern:L,...j}=e,W=h.useRef(null),re=h.useRef(I??`input-text-${no(8)}`).current;h.useImperativeHandle(n,()=>W.current);const ae=o!==void 0,[me,ee]=h.useState(a??""),fe=ae?o:me,[R,se]=h.useState(!1),[_e,Se]=h.useState(!1),ge=h.useMemo(()=>{if(!N)return null;const Te=N(fe);return Te===!0||Te==null?null:typeof Te=="string"?Te:typeof Te=="object"&&"message"in Te?Te.message??"Entrada inválida":"Entrada inválida"},[fe,N]),le=h.useMemo(()=>z!==void 0?z:A==="invalid"?!0:A==="valid"?!1:!!ge,[z,A,ge]),he=A==="valid"&&!le,G={invalido:le,mensaje:ge},Y=fe.length>0,ce=t==="password",K=ce&&_e?"text":t,q=k&&Y&&!w&&!C,H=h.useCallback(Te=>{if(C||w)return;const be=Te.target.value;ae||ee(be),T?.(be),S?.(be)},[ae,C,w,T,S]),de=h.useCallback(Te=>{se(!0),b?.(Te)},[b]),te=h.useCallback(Te=>{se(!1),x?.(Te)},[x]),pe=h.useCallback(()=>{C||w||(ae||ee(""),T?.(""),S?.(""),V?.(),W.current?.focus())},[ae,C,w,T,S,V]),Ye=h.useCallback(Te=>{Te.key==="Escape"&&k&&Y&&pe(),F?.(Te)},[k,Y,pe,F]),Oe=h.useCallback(()=>{Se(Te=>!Te),requestAnimationFrame(()=>W.current?.focus())},[]),Ae=d?`${re}-desc`:void 0,Ne=le?`${re}-err`:void 0,ot=[Ae,Ne].filter(Boolean).join(" ")||void 0,Me=typeof m=="function"?m(G):m??ge,bt=ne(Ke.contenedor_base,Ke[`variante_${s}`],Ke[`tam_${c}`],Ke[`radio_${u}`],Ke[`color_${l}`],{[Ke.ancho_total]:_,[Ke.sin_animacion]:g,[Ke.deshabilitado]:C,[Ke.solo_lectura]:w,[Ke.invalido]:le,[Ke.valido]:he,[Ke.enfocado]:R,[Ke.tiene_contenido]:Y},P,O?.base);return r.jsxs("div",{className:bt,style:E,children:[f&&r.jsxs("label",{className:ne(Ke.etiqueta,O?.label),htmlFor:re,children:[f,y&&r.jsx("span",{className:Ke.marca_requerido,"aria-hidden":"true",children:"*"})]}),r.jsxs("div",{className:ne(Ke.envoltorio_input,O?.inputWrapper),children:[p&&r.jsx("span",{className:Ke.contenido_inicio,children:p}),r.jsx("div",{className:ne(Ke.envoltorio_interno,O?.innerWrapper),children:r.jsx("input",{...j,ref:W,id:re,name:$,type:K,value:ae?fe:void 0,defaultValue:ae?void 0:a,placeholder:i,disabled:C,readOnly:w,required:y,autoComplete:D,autoFocus:B,maxLength:X,minLength:U,pattern:L,"aria-invalid":le||void 0,"aria-describedby":ot,"aria-required":y,className:ne(Ke.entrada,O?.input),onChange:H,onFocus:de,onBlur:te,onKeyDown:Ye})}),q&&r.jsx("button",{type:"button",className:ne(Ke.boton_limpiar,O?.clearButton),onClick:pe,tabIndex:-1,"aria-label":"Limpiar campo",children:r.jsx(Zl,{size:"0.75em"})}),ce&&r.jsx("button",{type:"button",className:Ke.boton_password,onClick:Oe,tabIndex:-1,"aria-label":_e?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":_e,children:_e?r.jsx(Kl,{}):r.jsx(Ul,{})}),v&&r.jsx("span",{className:Ke.contenido_final,children:v})]}),d&&!le&&r.jsx("div",{id:Ae,className:ne(Ke.descripcion,O?.description),children:d}),le&&Me&&r.jsx("div",{id:Ne,className:ne(Ke.mensaje_error,O?.errorMessage),role:"alert",children:Me})]})});Ma.displayName="InputText";function an(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function zn(e,n){if(e==null||Number.isNaN(e))return"";const{separadorMiles:t=!1,separadorDecimal:o=".",escalaDecimal:a,decimalesFijos:i=!1,prefijo:s="",sufijo:l=""}=n;let c;a!==void 0?c=i?e.toFixed(a):String(Math.round(e*Math.pow(10,a))/Math.pow(10,a)):c=String(e);const[u,_]=c.split(".");let g=u;if(t){const d=typeof t=="string"?t:",";g=u.replace(/\B(?=(\d{3})+(?!\d))/g,d)}let f=g;return _!==void 0?f+=o+_:i&&a&&a>0&&(f+=o+"0".repeat(a)),`${s}${f}${l}`}function Ia(e,n){if(!e||e.trim()==="")return;const{separadorMiles:t=!1,separadorDecimal:o=".",prefijo:a="",sufijo:i="",permitirNegativo:s=!0}=n;let l=e;if(a&&(l=l.replace(new RegExp(`^${an(a)}`),"")),i&&(l=l.replace(new RegExp(`${an(i)}$`),"")),t){const u=typeof t=="string"?t:",";l=l.replace(new RegExp(an(u),"g"),"")}o!=="."&&(l=l.replace(new RegExp(an(o)),".")),s||(l=l.replace(/-/g,""));const c=parseFloat(l);return Number.isNaN(c)?void 0:c}function sr(e,n,t){let o=e;return n!==void 0&&o<n&&(o=n),t!==void 0&&o>t&&(o=t),o}function Fa(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 za(e,n){const t=Math.pow(10,n);return Math.round(e*t)/t}function Xl(e,n){if(!e)return e;const{separadorMiles:t=!1,separadorDecimal:o=".",escalaDecimal:a,decimalesFijos:i=!1,prefijo:s="",sufijo:l=""}=n,c=e.startsWith("-"),u=c?e.slice(1):e,[_,g]=u.split(o);let f=g??"";a!==void 0&&(f=f.slice(0,a),i&&(f=f.padEnd(a,"0")));let d=_||"";if(t&&d){const p=typeof t=="string"?t:",";d=d.replace(/\B(?=(\d{3})+(?!\d))/g,p)}let m=(c?"-":"")+d;return g!==void 0?m+=o+f:i&&a&&a>0&&(m+=o+"0".repeat(a)),`${s}${m}${l}`}function La(e,n){const{separadorMiles:t,prefijo:o="",sufijo:a=""}=n;let i=e;if(o&&(i=i.replace(new RegExp(`^${an(o)}`),"")),a&&(i=i.replace(new RegExp(`${an(a)}$`),"")),t){const s=typeof t=="string"?t:",";i=i.replace(new RegExp(an(s),"g"),"")}return i}const Yl=e=>r.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:[r.jsx("path",{d:"M5 12h14"}),r.jsx("path",{d:"M12 5v14"})]}),Jl=e=>r.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:r.jsx("path",{d:"M5 12h14"})}),Xe={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"},Aa=h.forwardRef((e,n)=>{const{value:t,defaultValue:o,placeholder:a,variant:i="bordered",color:s="default",size:l="md",radius:c="md",fullWidth:u=!0,disableAnimation:_=!1,label:g,description:f,errorMessage:d,startContent:m,endContent:p,isRequired:v=!1,isReadOnly:y=!1,isDisabled:w=!1,isInvalid:C,validationState:k,validate:z,className:A,classNames:N,style:P,min:O,max:E,step:T=1,decimalScale:V,fixedDecimalScale:S=!1,thousandSeparator:b=!1,decimalSeparator:x=".",prefix:F="",suffix:I="",allowNegative:$=!0,allowDecimal:D=!0,hideControls:B=!1,clampBehavior:X="error",onChange:U,onValueChange:L,onFocus:j,onBlur:W,onKeyDown:ie,id:re,name:ae,...me}=e,ee=h.useRef(null),R=h.useRef(re??`input-numeric-${no(8)}`).current;h.useImperativeHandle(n,()=>ee.current);const se=t!==void 0,[_e,Se]=h.useState(o),[ge,le]=h.useState(""),[he,G]=h.useState(!1),Y=se?t===""?void 0:t:_e,ce=h.useMemo(()=>({separadorMiles:b,separadorDecimal:x,escalaDecimal:D?V:0,decimalesFijos:S,prefijo:F,sufijo:I,permitirNegativo:$}),[b,x,V,S,F,I,$,D]),K=h.useRef(Y);K.current=Y;const q=h.useRef(ce);q.current=ce;const H=h.useRef(he);H.current=he;const de=h.useRef(""),te=h.useMemo(()=>{if(X==="error"&&Y!==void 0){if(O!==void 0&&Y<O)return`El valor debe ser mayor o igual a ${O}`;if(E!==void 0&&Y>E)return`El valor debe ser menor o igual a ${E}`}if(!z)return null;const Ce=Fa(z(Y));return Ce.invalido?Ce.mensaje:null},[Y,z,X,O,E]),pe=h.useMemo(()=>C!==void 0?C:k==="invalid"?!0:k==="valid"?!1:!!te,[C,k,te]),Ye=k==="valid"&&!pe,Oe={invalido:pe,mensaje:te},Ae=h.useCallback(Ce=>{se||Se(Ce),U?.(Ce),L?.(zn(Ce,ce),Ce)},[se,U,L,ce]),Ne=h.useCallback(Ce=>{let xe=(Y??0)+T*Ce;X!=="error"&&(xe=sr(xe,O,E)),V!==void 0&&(xe=za(xe,V)),Ae(xe),le(zn(xe,ce))},[Y,T,O,E,X,V,Ae,ce]),ot=h.useCallback(Ce=>{if(w||y)return;const xe=x===","?",":".";let et="0-9";D&&(et+=xe),$&&(et+="-");let Be=Ce.target.value.replace(new RegExp(`[^${et}]`,"g"),"");if(D){const wt=Be.split(xe);wt.length>2&&(Be=wt[0]+xe+wt.slice(1).join(""))}if($&&Be.includes("-")){const wt=Be.replace(/-/g,"");Be=Be.startsWith("-")?"-"+wt:wt}de.current=Be,le(Be),Ae(Ia(Be,ce))},[w,y,ce,Ae,x,$,D]),Me=h.useCallback(Ce=>{const xe=La(de.current,q.current);de.current=xe,G(!0),xe&&le(xe),j?.(Ce)},[j]),bt=h.useCallback(Ce=>{const xe=K.current,et=q.current;if(G(!1),X==="blur"&&xe!==void 0){const Be=sr(xe,O,E);if(Be!==xe){Ae(Be),le(zn(Be,et)),W?.(Ce);return}}X!=="error"&&le(Xl(de.current,et)),W?.(Ce)},[X,O,E,Ae,W]),Te=h.useCallback(Ce=>{Ce.key==="ArrowUp"?(Ce.preventDefault(),Ne(1)):Ce.key==="ArrowDown"&&(Ce.preventDefault(),Ne(-1));const xe=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],et=Ce.ctrlKey||Ce.metaKey,Be=D&&(Ce.key===x||Ce.key==="."||Ce.key===","),wt=Ce.key==="-"&&$,Tt=/^[0-9]$/.test(Ce.key);!xe.includes(Ce.key)&&!et&&!Be&&!wt&&!Tt&&Ce.preventDefault(),ie?.(Ce)},[Ne,ie,x,$,D]);h.useEffect(()=>{if(!H.current){const Ce=zn(Y,ce);de.current=La(Ce,ce),le(Ce)}},[Y,ce]),h.useLayoutEffect(()=>{ee.current&&ee.current.setCustomValidity(X==="error"&&te?te:"")},[X,te]);const be=f?`${R}-desc`:void 0,Ge=pe?`${R}-err`:void 0,lt=[be,Ge].filter(Boolean).join(" ")||void 0,Ee=typeof d=="function"?d(Oe):d??te,rt=E===void 0||(Y??0)<E,St=O===void 0||(Y??0)>O,Et=ne(Xe.contenedor_base,Xe[`variante_${i}`],Xe[`tam_${l}`],Xe[`radio_${c}`],Xe[`color_${s}`],{[Xe.ancho_total]:u,[Xe.sin_animacion]:_,[Xe.deshabilitado]:w,[Xe.solo_lectura]:y,[Xe.invalido]:pe,[Xe.valido]:Ye,[Xe.enfocado]:he},A,N?.base);return r.jsxs("div",{className:Et,style:P,children:[g&&r.jsxs("label",{className:ne(Xe.etiqueta,N?.label),htmlFor:R,children:[g,v&&r.jsx("span",{className:Xe.marca_requerido,"aria-hidden":"true",children:"*"})]}),r.jsxs("div",{className:ne(Xe.envoltorio_input,N?.inputWrapper),children:[r.jsxs("div",{className:ne(Xe.envoltorio_interno,N?.innerWrapper),children:[m&&r.jsx("span",{className:Xe.contenido_inicio,children:m}),r.jsx("input",{...me,ref:ee,id:R,name:ae,type:"text",inputMode:"decimal",value:ge,placeholder:a,disabled:w,readOnly:y,required:v,"aria-invalid":pe||void 0,"aria-describedby":lt,"aria-required":v,className:ne(Xe.entrada,N?.input),onChange:ot,onFocus:Me,onBlur:bt,onKeyDown:Te}),p&&r.jsx("span",{className:Xe.contenido_final,children:p})]}),!B&&!y&&!w&&r.jsxs("div",{className:ne(Xe.controles,N?.controls),children:[r.jsx("button",{type:"button",tabIndex:-1,className:ne(Xe.boton_control,N?.controlButton),disabled:!St,onClick:()=>Ne(-1),"aria-label":"Decrementar valor",children:r.jsx(Jl,{})}),r.jsx("button",{type:"button",tabIndex:-1,className:ne(Xe.boton_control,N?.controlButton),disabled:!rt,onClick:()=>Ne(1),"aria-label":"Incrementar valor",children:r.jsx(Yl,{})})]})]}),f&&!pe&&r.jsx("div",{id:be,className:ne(Xe.descripcion,N?.description),children:f}),pe&&Ee&&r.jsx("div",{id:Ge,className:ne(Xe.mensaje_error,N?.errorMessage),role:"alert",children:Ee})]})});Aa.displayName="InputNumeric";function Ql(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 lr(e,n="es-CO"){if(!e)return"";const t=new Date(e+"T00:00:00");return Number.isNaN(t.getTime())?"":t.toLocaleDateString(n,{year:"numeric",month:"long",day:"numeric"})}function Rl(){return new Date().toISOString().split("T")[0]}function ec(e,n,t){if(!e)return!0;const o=new Date(e).getTime();return!(n&&o<new Date(n).getTime()||t&&o>new Date(t).getTime())}const Re={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"},tc=()=>r.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:[r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("polyline",{points:"12 6 12 12 16 14"})]}),nc=()=>r.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:[r.jsx("path",{d:"M8 2v4"}),r.jsx("path",{d:"M16 2v4"}),r.jsx("rect",{height:"18",rx:"2",width:"18",x:"3",y:"4"}),r.jsx("path",{d:"M3 10h18"}),r.jsx("circle",{cx:"8",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),r.jsx("circle",{cx:"12",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),r.jsx("circle",{cx:"16",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),r.jsx("circle",{cx:"8",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),r.jsx("circle",{cx:"12",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),r.jsx("circle",{cx:"16",cy:"18",r:"1",fill:"currentColor",stroke:"none"})]}),oc=()=>r.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:[r.jsx("path",{d:"M18 6 6 18"}),r.jsx("path",{d:"m6 6 12 12"})]}),rc=({tipo:e,onClick:n,onMouseDown:t})=>r.jsx("button",{type:"button",tabIndex:-1,className:Re.boton_icono,onMouseDown:t,onClick:n,"aria-label":e==="time"?"Abrir selector de hora":"Abrir selector de fecha",children:e==="time"?r.jsx(tc,{}):r.jsx(nc,{})}),Da=h.forwardRef((e,n)=>{const{type:t="date",value:o,defaultValue:a,placeholder:i,variant:s="bordered",color:l="default",size:c="md",radius:u="md",fullWidth:_=!0,disableAnimation:g=!1,label:f,description:d,errorMessage:m,startContent:p,isRequired:v=!1,isReadOnly:y=!1,isDisabled:w=!1,isInvalid:C,validationState:k,validate:z,className:A,classNames:N,style:P,min:O,max:E,isClearable:T=!1,onChange:V,onFocus:S,onBlur:b,id:x,name:F,...I}=e,$=h.useRef(null),B=h.useRef(x??`input-date-${no(8)}`).current;h.useImperativeHandle(n,()=>$.current);const X=o!==void 0,[U,L]=h.useState(a??""),j=X?o:U,[W,ie]=h.useState(!1),re=h.useRef(!1),ae=h.useMemo(()=>{if(j&&t!=="time"&&(O||E)){if(O&&j<O)return`La fecha debe ser ${t==="date"?lr(O):O} o posterior`;if(E&&j>E)return`La fecha debe ser ${t==="date"?lr(E):E} o anterior`}if(!z)return null;const q=Ql(z(j));return q.invalido?q.mensaje:null},[j,z,O,E,t]),me=h.useMemo(()=>C!==void 0?C:k==="invalid"?!0:k==="valid"?!1:!!ae,[C,k,ae]),ee=k==="valid"&&!me,fe={invalido:me,mensaje:ae},R=h.useCallback(q=>{if(w||y)return;re.current=!1;const H=q.target.value;X||L(H),V?.(H)},[X,w,y,V]),se=h.useCallback(q=>{ie(!0),S?.(q)},[S]),_e=h.useCallback(q=>{ie(!1),re.current=!1,b?.(q)},[b]),Se=h.useCallback(q=>{q.preventDefault()},[]),ge=h.useCallback(q=>{if(q.preventDefault(),q.stopPropagation(),!(!$.current||w||y)){if(re.current){re.current=!1,$.current.blur();return}$.current.focus();try{$.current.showPicker?.(),re.current=!0}catch{}}},[w,y]),le=h.useCallback(q=>{q.preventDefault(),q.stopPropagation(),re.current=!1,X||L(""),V?.(""),$.current?.focus()},[X,V]),he=d?`${B}-desc`:void 0,G=me?`${B}-err`:void 0,Y=[he,G].filter(Boolean).join(" ")||void 0,ce=typeof m=="function"?m(fe):m??ae,K=ne(Re.contenedor_base,Re[`variante_${s}`],Re[`tam_${c}`],Re[`radio_${u}`],Re[`color_${l}`],{[Re.ancho_total]:_,[Re.sin_animacion]:g,[Re.deshabilitado]:w,[Re.solo_lectura]:y,[Re.invalido]:me,[Re.valido]:ee,[Re.enfocado]:W},A,N?.base);return r.jsxs("div",{className:K,style:P,children:[f&&r.jsxs("label",{className:ne(Re.etiqueta,N?.label),htmlFor:B,children:[f,v&&r.jsx("span",{className:Re.marca_requerido,"aria-hidden":"true",children:"*"})]}),r.jsx("div",{className:ne(Re.envoltorio_input,N?.inputWrapper),children:r.jsxs("div",{className:ne(Re.envoltorio_interno,N?.innerWrapper),children:[p&&r.jsx("span",{className:Re.contenido_inicio,children:p}),r.jsx("input",{...I,ref:$,id:B,name:F,type:t,value:X?j:void 0,defaultValue:X?void 0:a,placeholder:i,disabled:w,readOnly:y,required:v,min:O,max:E,"aria-invalid":me||void 0,"aria-describedby":Y,"aria-required":v,className:ne(Re.entrada,N?.input),onChange:R,onFocus:se,onBlur:_e}),T&&j&&!w&&!y&&r.jsx("button",{type:"button",tabIndex:-1,className:ne(Re.boton_limpiar,N?.clearButton),onMouseDown:q=>q.preventDefault(),onClick:le,"aria-label":"Limpiar fecha",children:r.jsx(oc,{})}),r.jsx(rc,{tipo:t,onClick:ge,onMouseDown:Se})]})}),d&&!me&&r.jsx("div",{id:he,className:ne(Re.descripcion,N?.description),children:d}),me&&ce&&r.jsx("div",{id:G,className:ne(Re.mensaje_error,N?.errorMessage),role:"alert",children:ce})]})});Da.displayName="InputDate";const ac={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function oo({mostrar:e,children:n,tipo:t="desvanecerDeslizar",className:o,...a}){const[i,s]=h.useState(e),[l,c]=h.useState(e?"entrada":null);e&&!i?(s(!0),c("entrada")):!e&&i&&l!=="salida"&&c("salida");const u=()=>{l==="entrada"?c(null):l==="salida"&&(s(!1),c(null))};if(!i)return null;const _=ac[t||"desvanecer"],g=l?`transicion_${_}_${l}`:"";return r.jsx("div",{...a,onAnimationEnd:u,className:`${g} ${o||""}`.trim(),children:n})}const Vt={badges_wrap:"_badges_wrap_1dfuw_15",badges_wrap_visible:"_badges_wrap_visible_1dfuw_23",acciones_grupo:"_acciones_grupo_1dfuw_33",badge_voz:"_badge_voz_1dfuw_41",badge_sm:"_badge_sm_1dfuw_73",badge_md:"_badge_md_1dfuw_85",badge_lg:"_badge_lg_1dfuw_97",badge_estirada:"_badge_estirada_1dfuw_109",badge_icono:"_badge_icono_1dfuw_129",badge_texto:"_badge_texto_1dfuw_155",badge_mic:"_badge_mic_1dfuw_165",badge_tts:"_badge_tts_1dfuw_173",badge_ondas:"_badge_ondas_1dfuw_181",badgeOnda:"_badgeOnda_1dfuw_1",badge_eq:"_badge_eq_1dfuw_219",badgeEq:"_badgeEq_1dfuw_1"};function cr(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:r.jsxs("g",{fill:"currentColor",children:[r.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),r.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 dr(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...e,children:r.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 Pa(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...e,children:[r.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),r.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 ur({tipo:e,texto:n,size:t="md",estirar:o}){const a=e==="mic";return r.jsxs("span",{className:ne(Vt.badge_voz,a?Vt.badge_mic:Vt.badge_tts,Vt[`badge_${t}`],o&&Vt.badge_estirada),"data-tipo":e,children:[r.jsx("span",{className:Vt.badge_icono,children:a?r.jsx(cr,{}):r.jsx(dr,{})}),r.jsx("span",{className:Vt.badge_texto,children:n}),a?r.jsxs("span",{className:Vt.badge_ondas,"aria-hidden":"true",children:[r.jsx("span",{}),r.jsx("span",{}),r.jsx("span",{})]}):r.jsxs("span",{className:Vt.badge_eq,"aria-hidden":"true",children:[r.jsx("span",{}),r.jsx("span",{}),r.jsx("span",{}),r.jsx("span",{})]})]})}function Ta({value:e,onChange:n,isDisabled:t,isReadOnly:o,onDictadoCompleto:a,idioma:i="es-ES"}){const[s,l]=h.useState(!1),[c,u]=h.useState(!1),[_,g]=h.useState(null),f=h.useRef(null),d=h.useRef(null),m=h.useRef(null),p=h.useRef(""),v=typeof window<"u"&&"speechSynthesis"in window,y=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),w=h.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null),v&&window.speechSynthesis.cancel(),d.current=null,l(!1)},[v]),C=h.useCallback(()=>{if(!v||!e)return;if(w(),f.current){try{f.current.stop()}catch(N){console.error("Error stopping recognition:",N)}f.current=null,u(!1)}const A=new SpeechSynthesisUtterance(e);A.lang=i,A.onstart=()=>l(!0),A.onend=()=>{l(!1),d.current=null},A.onerror=()=>{l(!1),d.current=null},d.current=A,window.speechSynthesis.speak(A)},[v,e,i,w]),k=h.useCallback(()=>{if(f.current)try{f.current.stop()}catch(A){console.error("Error stopping recognition:",A)}u(!1),g(null)},[]),z=h.useCallback(()=>{if(!y||t||o)return;w();const A=window,N=A.SpeechRecognition||A.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),f.current=null,a?.()},P.onerror=O=>{O.error!=="no-speech"&&(u(!1),f.current=null,O.error!=="aborted"&&g("Error al reconocer voz"))},P.onresult=O=>{try{let E="";for(let S=0;S<O.results.length;S++)E+=O.results[S][0].transcript;const T=p.current&&E?" ":"",V=p.current+T+E;n(V)}catch{g("Error procesando dictado")}},f.current=P,P.start()}catch{g("No se pudo iniciar dictado"),u(!1)}},[y,t,o,e,n,i,w,a]);return h.useEffect(()=>()=>{m.current&&clearTimeout(m.current),v&&window.speechSynthesis.cancel(),f.current&&f.current.abort()},[v]),{puedeHablar:v,puedeEscuchar:y,hablando:s,escuchando:c,errorDictado:_,escuchar:C,detenerHablar:w,dictar:z,detenerDictado:k}}function ic({size:e="1em",className:n}){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:e,height:e,className:n,"aria-hidden":"true",children:[r.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}const je={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"},Oa=h.forwardRef((e,n)=>{const{children:t,variant:o="bordered",color:a="default",size:i="md",radius:s="md",fullWidth:l=!0,disableAnimation:c=!1,label:u,description:_,errorMessage:g,value:f,defaultValue:d,placeholder:m,isRequired:p=!1,isReadOnly:v=!1,isDisabled:y=!1,isClearable:w=!1,isInvalid:C,validationState:k,validate:z,minRows:A=4,maxRows:N=10,disableAutosize:P=!1,hideVoiceActions:O=!1,className:E,classNames:T,style:V,onChange:S,onClear:b,onFocus:x,onBlur:F,id:I,name:$,rows:D,...B}=e,X=h.useRef(null),L=h.useRef(I??`textarea-${no(8)}`).current;h.useImperativeHandle(n,()=>X.current);const j=f!==void 0,[W,ie]=h.useState(d??""),re=j?f:W,[ae,me]=h.useState(!1),ee=h.useMemo(()=>{if(!z)return null;const Ee=z(re);return Ee===!0||Ee==null?null:typeof Ee=="string"?Ee:typeof Ee=="object"&&"message"in Ee?Ee.message??"Entrada inválida":"Entrada inválida"},[re,z]),fe=h.useMemo(()=>C!==void 0?C:k==="invalid"?!0:k==="valid"?!1:!!ee,[C,k,ee]),R=k==="valid"&&!fe,se={invalido:fe,mensaje:ee},_e=re.length>0,Se=h.useCallback(()=>{if(!X.current||P)return;const Ee=X.current,rt=window.getComputedStyle(Ee),St=parseFloat(rt.lineHeight)||parseFloat(rt.fontSize)*1.5,Et=parseFloat(rt.paddingTop)||0,Ce=parseFloat(rt.paddingBottom)||0,xe=parseFloat(rt.borderTopWidth)||0,et=parseFloat(rt.borderBottomWidth)||0,Be=A*St+Et+Ce+xe+et,wt=N*St+Et+Ce+xe+et;Ee.style.height="auto";const Tt=Ee.scrollHeight;Ee.style.height=`${Math.min(Math.max(Tt,Be),wt)}px`},[P,A,N]);h.useEffect(()=>{P||Se()},[re,Se,P]);const ge=h.useCallback(Ee=>{j||ie(Ee),S?.(Ee)},[j,S]),{puedeHablar:le,hablando:he,escuchar:G,detenerHablar:Y,puedeEscuchar:ce,escuchando:K,errorDictado:q,dictar:H,detenerDictado:de}=Ta({isDisabled:y||O,isReadOnly:v,value:re,onChange:ge}),te=h.useCallback(Ee=>{if(y||v)return;const rt=Ee.target.value;j||ie(rt),S?.(rt)},[j,y,v,S]),pe=h.useCallback(Ee=>{me(!0),x?.(Ee)},[x]),Ye=h.useCallback(Ee=>{me(!1),F?.(Ee)},[F]),Oe=h.useCallback(()=>{y||v||(j||ie(""),S?.(""),b?.(),X.current?.focus())},[j,y,v,S,b]),Ae=h.useCallback(()=>{he?Y():G()},[he,G,Y]),Ne=h.useCallback(()=>{K?de():H()},[K,H,de]),ot=_?`${L}-desc`:void 0,Me=fe||q?`${L}-err`:void 0,bt=[ot,Me].filter(Boolean).join(" ")||void 0,Te=typeof g=="function"?g(se):g??ee,be=w&&_e&&!v&&!y,Ge=!O||be,lt=ne(je.contenedor_base,je[`variante_${o}`],je[`tam_${i}`],je[`radio_${s}`],je[`color_${a}`],{[je.ancho_total]:l,[je.sin_animacion]:c,[je.deshabilitado]:y,[je.solo_lectura]:v,[je.invalido]:fe,[je.valido]:R,[je.enfocado]:ae},E,T?.base);return r.jsxs("div",{className:lt,style:V,children:[u&&r.jsxs("label",{className:ne(je.etiqueta,T?.label),htmlFor:L,children:[u,p&&r.jsx("span",{className:je.marca_requerido,"aria-hidden":"true",children:"*"})]}),r.jsxs("div",{className:ne(je.envoltorio_input,T?.inputWrapper),children:[r.jsx("textarea",{...B,ref:X,id:L,name:$,placeholder:m,value:j?re:void 0,defaultValue:j?void 0:d,onChange:te,onFocus:pe,onBlur:Ye,className:ne(je.entrada,P&&je.sin_autosize,T?.input),readOnly:v,disabled:y,rows:D??A,"aria-invalid":fe||void 0,"aria-describedby":bt,"aria-required":p,required:p}),Ge&&r.jsxs("div",{className:ne(je.barra_acciones,T?.actions),children:[r.jsxs("div",{className:je.badges_contenedor,"aria-live":"polite",role:"status",children:[r.jsx(oo,{mostrar:K,children:r.jsx(ur,{tipo:"mic",texto:"Escuchando...",size:i==="lg"?"md":"sm"})}),r.jsx(oo,{mostrar:he,children:r.jsx(ur,{tipo:"tts",texto:"Leyendo...",size:i==="lg"?"md":"sm"})})]}),r.jsxs("div",{className:je.botones_grupo,children:[!O&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:ne(je.boton_accion,he&&je.boton_activo_tts),onClick:Ae,disabled:!le||!he&&(!re||K),title:he?"Detener lectura":"Leer texto","aria-pressed":he,"aria-label":he?"Detener lectura":"Leer texto",children:r.jsx(dr,{})}),ce&&r.jsx("button",{type:"button",className:ne(je.boton_accion,K&&je.boton_activo_mic),onClick:Ne,disabled:y||v||he,title:K?"Detener dictado":"Dictar texto","aria-pressed":K,"aria-label":K?"Detener dictado":"Dictar texto",children:K?r.jsx(Pa,{}):r.jsx(cr,{})})]}),be&&r.jsx("button",{type:"button",className:je.boton_limpiar,onClick:Oe,title:"Limpiar campo","aria-label":"Limpiar campo",children:r.jsx(ic,{size:"0.75em"})})]})]})]}),_&&!fe&&r.jsx("div",{id:ot,className:ne(je.descripcion,T?.description),children:_}),fe&&Te||q?r.jsxs("div",{id:Me,className:ne(je.mensaje_error,T?.errorMessage),role:"alert",children:[Te,Te&&q&&r.jsx("br",{}),q&&r.jsxs("span",{children:["Error de voz: ",q]})]}):null,t]})});Oa.displayName="TextArea";function ro(){return typeof window<"u"}function Kt(e){return _r(e)?(e.nodeName||"").toLowerCase():"#document"}function vt(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function Lt(e){var n;return(n=(_r(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function _r(e){return ro()?e instanceof Node||e instanceof vt(e).Node:!1}function qe(e){return ro()?e instanceof Element||e instanceof vt(e).Element:!1}function tt(e){return ro()?e instanceof HTMLElement||e instanceof vt(e).HTMLElement:!1}function ao(e){return!ro()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vt(e).ShadowRoot}const sc=new Set(["inline","contents"]);function Ln(e){const{overflow:n,overflowX:t,overflowY:o,display:a}=Ct(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!sc.has(a)}const lc=new Set(["table","td","th"]);function cc(e){return lc.has(Kt(e))}const dc=[":popover-open",":modal"];function io(e){return dc.some(n=>{try{return e.matches(n)}catch{return!1}})}const uc=["transform","translate","scale","rotate","perspective"],_c=["transform","translate","scale","rotate","perspective","filter"],fc=["paint","layout","strict","content"];function fr(e){const n=so(),t=qe(e)?Ct(e):e;return uc.some(o=>t[o]?t[o]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!n&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!n&&(t.filter?t.filter!=="none":!1)||_c.some(o=>(t.willChange||"").includes(o))||fc.some(o=>(t.contain||"").includes(o))}function pc(e){let n=jt(e);for(;tt(n)&&!Bt(n);){if(fr(n))return n;if(io(n))return null;n=jt(n)}return null}function so(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const gc=new Set(["html","body","#document"]);function Bt(e){return gc.has(Kt(e))}function Ct(e){return vt(e).getComputedStyle(e)}function lo(e){return qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jt(e){if(Kt(e)==="html")return e;const n=e.assignedSlot||e.parentNode||ao(e)&&e.host||Lt(e);return ao(n)?n.host:n}function Va(e){const n=jt(e);return Bt(n)?e.ownerDocument?e.ownerDocument.body:e.body:tt(n)&&Ln(n)?n:Va(n)}function Xt(e,n,t){var o;n===void 0&&(n=[]),t===void 0&&(t=!0);const a=Va(e),i=a===((o=e.ownerDocument)==null?void 0:o.body),s=vt(a);if(i){const l=pr(s);return n.concat(s,s.visualViewport||[],Ln(a)?a:[],l&&t?Xt(l):[])}return n.concat(a,Xt(a,[],t))}function pr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Yt=Math.min,xt=Math.max,co=Math.round,vn=Math.floor,At=e=>({x:e,y:e}),hc={left:"right",right:"left",bottom:"top",top:"bottom"},mc={start:"end",end:"start"};function gr(e,n,t){return xt(e,Yt(n,t))}function bn(e,n){return typeof e=="function"?e(n):e}function Jt(e){return e.split("-")[0]}function wn(e){return e.split("-")[1]}function Ba(e){return e==="x"?"y":"x"}function hr(e){return e==="y"?"height":"width"}const vc=new Set(["top","bottom"]);function qt(e){return vc.has(Jt(e))?"y":"x"}function mr(e){return Ba(qt(e))}function bc(e,n,t){t===void 0&&(t=!1);const o=wn(e),a=mr(e),i=hr(a);let s=a==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return n.reference[i]>n.floating[i]&&(s=uo(s)),[s,uo(s)]}function wc(e){const n=uo(e);return[vr(e),n,vr(n)]}function vr(e){return e.replace(/start|end/g,n=>mc[n])}const ja=["left","right"],qa=["right","left"],yc=["top","bottom"],Cc=["bottom","top"];function xc(e,n,t){switch(e){case"top":case"bottom":return t?n?qa:ja:n?ja:qa;case"left":case"right":return n?yc:Cc;default:return[]}}function $c(e,n,t,o){const a=wn(e);let i=xc(Jt(e),t==="start",o);return a&&(i=i.map(s=>s+"-"+a),n&&(i=i.concat(i.map(vr)))),i}function uo(e){return e.replace(/left|right|bottom|top/g,n=>hc[n])}function Sc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ha(e){return typeof e!="number"?Sc(e):{top:e,right:e,bottom:e,left:e}}function _o(e){const{x:n,y:t,width:o,height:a}=e;return{width:o,height:a,top:t,left:n,right:n+o,bottom:t+a,x:n,y:t}}/*!
|
|
2
2
|
* tabbable 6.3.0
|
|
3
3
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
4
|
-
*/var ql=["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])"],no=ql.join(","),$i=typeof Element>"u",_t=$i?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,to=!$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},kt=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&&kt(t.parentNode);return a},Bl=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},ki=function(t,n,o){if(kt(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(no));return n&&_t.call(t,no)&&r.unshift(t),r=r.filter(o),r},oo=function(t,n,o){for(var r=[],i=Array.from(t);i.length;){var a=i.shift();if(!kt(a,!1))if(a.tagName==="SLOT"){var l=a.assignedElements(),d=l.length?l:a.children,u=oo(d,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else{var _=_t.call(a,no);_&&o.filter(a)&&(n||!t.includes(a))&&r.push(a);var g=a.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(a),f=!kt(g,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(g&&f){var c=oo(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},Ii=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Ei=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Bl(t))&&!Ii(t)?0:t.tabIndex},Hl=function(t,n){var o=Ei(t);return o<0&&n&&!Ii(t)?0:o},Gl=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Mi=function(t){return t.tagName==="INPUT"},Wl=function(t){return Mi(t)&&t.type==="hidden"},Kl=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Ul=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Xl=function(t){if(!t.name)return!0;var n=t.form||to(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=Ul(r,t.form);return!i||i===t},Yl=function(t){return Mi(t)&&t.type==="radio"},Rl=function(t){return Yl(t)&&!Xl(t)},Zl=function(t){var n,o=t&&to(t),r=(n=o)===null||n===void 0?void 0:n.host,i=!1;if(o&&o!==t){var a,l,d;for(i=!!((a=r)!==null&&a!==void 0&&(l=a.ownerDocument)!==null&&l!==void 0&&l.contains(r)||t!=null&&(d=t.ownerDocument)!==null&&d!==void 0&&d.contains(t));!i&&r;){var u,_,g;o=to(r),r=(u=o)===null||u===void 0?void 0:u.host,i=!!((_=r)!==null&&_!==void 0&&(g=_.ownerDocument)!==null&&g!==void 0&&g.contains(r))}}return i},Ni=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},Jl=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(t).visibility==="hidden")return!0;var a=_t.call(t,"details>summary:first-of-type"),l=a?t.parentElement:t;if(_t.call(l,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var d=t;t;){var u=t.parentElement,_=to(t);if(u&&!u.shadowRoot&&r(u)===!0)return Ni(t);t.assignedSlot?t=t.assignedSlot:!u&&_!==t.ownerDocument?t=_.host:t=u}t=d}if(Zl(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Ni(t);return!1},Ql=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return _t.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},or=function(t,n){return!(n.disabled||kt(n)||Wl(n)||Jl(n,t)||Kl(n)||Ql(n))},rr=function(t,n){return!(Rl(n)||Ei(n)<0||!or(t,n))},ec=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Fi=function(t){var n=[],o=[];return t.forEach(function(r,i){var a=!!r.scopeParent,l=a?r.scopeParent:r,d=Hl(l,a),u=a?Fi(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(Gl).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(n)},ro=function(t,n){n=n||{};var o;return n.getShadowRoot?o=oo([t],n.includeContainer,{filter:rr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:ec}):o=ki(t,n.includeContainer,rr.bind(null,n)),Fi(o)},nc=function(t,n){n=n||{};var o;return n.getShadowRoot?o=oo([t],n.includeContainer,{filter:or.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=ki(t,n.includeContainer,or.bind(null,n)),o},Di=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return _t.call(t,no)===!1?!1:rr(n,t)};function Ai(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Li(){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 Pi(){return/apple/i.test(navigator.vendor)}function ir(){const e=/android/i;return e.test(Ai())||e.test(Li())}function tc(){return Ai().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function zi(){return Li().includes("jsdom/")}const Ti="data-floating-ui-focusable",oc="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",sr="ArrowLeft",ar="ArrowRight",rc="ArrowUp",ic="ArrowDown";function Nn(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 rn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Xt(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function On(e){return"composedPath"in e?e.composedPath()[0]:e.target}function lr(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function sc(e){return e.matches("html,body")}function sn(e){return e?.ownerDocument||document}function cr(e){return Ye(e)&&e.matches(oc)}function dr(e){return e?e.getAttribute("role")==="combobox"&&cr(e):!1}function ac(e){if(!e||zi())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function io(e){return e?e.hasAttribute(Ti)?e:e.querySelector("["+Ti+"]")||e:null}function et(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var i;return r.parentId===t&&(!n||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...et(e,r.id,n)])}function lc(e,t){let n,o=-1;function r(i,a){a>o&&(n=i,o=a),et(e,i).forEach(d=>{r(d.id,a+1)})}return r(t,0),e.find(i=>i.id===n)}function Oi(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 an(e){e.preventDefault(),e.stopPropagation()}function cc(e){return"nativeEvent"in e}function Vi(e){return e.mozInputSource===0&&e.isTrusted?!0:ir()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ji(e){return zi()?!1:!ir()&&e.width===0&&e.height===0||ir()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function It(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var dc=typeof document<"u",uc=function(){},Oe=dc?m.useLayoutEffect:uc;const fc={...M};function nn(e){const t=M.useRef(e);return Oe(()=>{t.current=e}),t}const _c=fc.useInsertionEffect||(e=>e());function Re(e){const t=M.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return _c(()=>{t.current=e}),M.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function so(e,t,n){return Math.floor(e/t)!==n}function Et(e,t){return t<0||t>=e.current.length}function ur(e,t){return dn(e,{disabledIndices:t})}function qi(e,t){return dn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function dn(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&&ao(e,a,r));return a}function gc(e,t){let{event:n,orientation:o,loop:r,rtl:i,cols:a,disabledIndices:l,minIndex:d,maxIndex:u,prevIndex:_,stopEvent:g=!1}=t,f=_;if(n.key===rc){if(g&&an(n),_===-1)f=u;else if(f=dn(e,{startingIndex:f,amount:a,decrement:!0,disabledIndices:l}),r&&(_-a<d||f<0)){const c=_%a,h=u%a,p=u-(h-c);h===c?f=u:f=h>c?p:p-a}Et(e,f)&&(f=_)}if(n.key===ic&&(g&&an(n),_===-1?f=d:(f=dn(e,{startingIndex:_,amount:a,disabledIndices:l}),r&&_+a>u&&(f=dn(e,{startingIndex:_%a-a,amount:a,disabledIndices:l}))),Et(e,f)&&(f=_)),o==="both"){const c=dt(_/a);n.key===(i?sr:ar)&&(g&&an(n),_%a!==a-1?(f=dn(e,{startingIndex:_,disabledIndices:l}),r&&so(f,a,c)&&(f=dn(e,{startingIndex:_-_%a-1,disabledIndices:l}))):r&&(f=dn(e,{startingIndex:_-_%a-1,disabledIndices:l})),so(f,a,c)&&(f=_)),n.key===(i?ar:sr)&&(g&&an(n),_%a!==0?(f=dn(e,{startingIndex:_,decrement:!0,disabledIndices:l}),r&&so(f,a,c)&&(f=dn(e,{startingIndex:_+(a-_%a),decrement:!0,disabledIndices:l}))):r&&(f=dn(e,{startingIndex:_+(a-_%a),decrement:!0,disabledIndices:l})),so(f,a,c)&&(f=_));const h=dt(u/a)===c;Et(e,f)&&(r&&h?f=n.key===(i?ar:sr)?u:dn(e,{startingIndex:_-_%a-1,disabledIndices:l}):f=_)}return f}function pc(e,t,n){const o=[];let r=0;return e.forEach((i,a)=>{let{width:l,height:d}=i;if(l>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+a+" is greater than grid columns");let u=!1;for(n&&(r=0);!u;){const _=[];for(let g=0;g<l;g++)for(let f=0;f<d;f++)_.push(r+g+f*t);r%t+l<=t&&_.every(g=>o[g]==null)?(_.forEach(g=>{o[g]=a}),u=!0):r++}}),[...o]}function hc(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 mc(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function ao(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const o=e.current[t];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}const Mt=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Bi(e,t){const n=ro(e,Mt()),o=n.length;if(o===0)return;const r=Nn(sn(e)),i=n.indexOf(r),a=i===-1?t===1?0:o-1:i+t;return n[a]}function Hi(e){return Bi(sn(e).body,1)||e}function Gi(e){return Bi(sn(e).body,-1)||e}function Nt(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!rn(n,o)}function vc(e){ro(e,Mt()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Wi(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 Ki(e,t,n){let{reference:o,floating:r}=e;const i=Tn(t),a=nr(t),l=er(a),d=Kn(t),u=i==="y",_=o.x+o.width/2-r.width/2,g=o.y+o.height/2-r.height/2,f=o[l]/2-r[l]/2;let c;switch(d){case"top":c={x:_,y:o.y-r.height};break;case"bottom":c={x:_,y:o.y+o.height};break;case"right":c={x:o.x+o.width,y:g};break;case"left":c={x:o.x-r.width,y:g};break;default:c={x:o.x,y:o.y}}switch(ft(t)){case"start":c[a]-=f*(n&&u?-1:1);break;case"end":c[a]+=f*(n&&u?-1:1);break}return c}const bc=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:_,y:g}=Ki(u,o,d),f=o,c={},h=0;for(let p=0;p<l.length;p++){const{name:v,fn:w}=l[p],{x:y,y:x,data:E,reset:A}=await w({x:_,y:g,initialPlacement:o,placement:f,strategy:r,middlewareData:c,rects:u,platform:a,elements:{reference:e,floating:t}});_=y??_,g=x??g,c={...c,[v]:{...c[v],...E}},A&&h<=50&&(h++,typeof A=="object"&&(A.placement&&(f=A.placement),A.rects&&(u=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:r}):A.rects),{x:_,y:g}=Ki(u,f,d)),p=-1)}return{x:_,y:g,placement:f,strategy:r,middlewareData:c}};async function fr(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:a,elements:l,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:_="viewport",elementContext:g="floating",altBoundary:f=!1,padding:c=0}=ut(t,e),h=Si(c),v=l[f?g==="floating"?"reference":"floating":g],w=eo(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:_,strategy:d})),y=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)),E=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},A=eo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:d}):y);return{top:(w.top-A.top+h.top)/E.y,bottom:(A.bottom-w.bottom+h.bottom)/E.y,left:(w.left-A.left+h.left)/E.x,right:(A.right-w.right+h.right)/E.x}}const wc=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:a,elements:l,middlewareData:d}=t,{element:u,padding:_=0}=ut(e,t)||{};if(u==null)return{};const g=Si(_),f={x:n,y:o},c=nr(r),h=er(c),p=await a.getDimensions(u),v=c==="y",w=v?"top":"left",y=v?"bottom":"right",x=v?"clientHeight":"clientWidth",E=i.reference[h]+i.reference[c]-f[c]-i.floating[h],A=f[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=E/2-A/2,z=N/2-p[h]/2-1,I=Wn(g[w],z),V=Wn(g[y],z),j=I,$=N-p[h]-V,b=N/2-p[h]/2+P,S=Qo(j,b,$),T=!d.arrow&&ft(r)!=null&&b!==S&&i.reference[h]/2-(b<j?I:V)-p[h]/2<0,F=T?b<j?b-j:b-$:0;return{[c]:f[c]+F,data:{[c]:S,centerOffset:b-S-F,...T&&{alignmentOffset:F}},reset:T}}}),yc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:l,platform:d,elements:u}=t,{mainAxis:_=!0,crossAxis:g=!0,fallbackPlacements:f,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...v}=ut(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=Kn(r),y=Tn(l),x=Kn(l)===l,E=await(d.isRTL==null?void 0:d.isRTL(u.floating)),A=f||(x||!p?[Qt(l)]:Pl(l)),L=h!=="none";!f&&L&&A.push(...Vl(l,p,h,E));const N=[l,...A],P=await fr(t,v),z=[];let I=((o=i.flip)==null?void 0:o.overflows)||[];if(_&&z.push(P[w]),g){const b=Ll(r,a,E);z.push(P[b[0]],P[b[1]])}if(I=[...I,{placement:r,overflows:z}],!z.every(b=>b<=0)){var V,j;const b=(((V=i.flip)==null?void 0:V.index)||0)+1,S=N[b];if(S&&(!(g==="alignment"?y!==Tn(S):!1)||I.every(C=>Tn(C.placement)===y?C.overflows[0]>0:!0)))return{data:{index:b,overflows:I},reset:{placement:S}};let T=(j=I.filter(F=>F.overflows[0]<=0).sort((F,C)=>F.overflows[1]-C.overflows[1])[0])==null?void 0:j.placement;if(!T)switch(c){case"bestFit":{var $;const F=($=I.filter(C=>{if(L){const k=Tn(C.placement);return k===y||k==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(k=>k>0).reduce((k,D)=>k+D,0)]).sort((C,k)=>C[1]-k[1])[0])==null?void 0:$[0];F&&(T=F);break}case"initialPlacement":T=l;break}if(r!==T)return{reset:{placement:T}}}return{}}}},Cc=new Set(["left","top"]);async function xc(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=Kn(n),l=ft(n),d=Tn(n)==="y",u=Cc.has(a)?-1:1,_=i&&d?-1:1,g=ut(t,e);let{mainAxis:f,crossAxis:c,alignmentAxis:h}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof h=="number"&&(c=l==="end"?h*-1:h),d?{x:c*_,y:f*u}:{x:f*u,y:c*_}}const Sc=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 xc(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}}}}},$c=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}=v;return{x:w,y}}},...d}=ut(e,t),u={x:n,y:o},_=await fr(t,d),g=Tn(Kn(r)),f=yi(g);let c=u[f],h=u[g];if(i){const v=f==="y"?"top":"left",w=f==="y"?"bottom":"right",y=c+_[v],x=c-_[w];c=Qo(y,c,x)}if(a){const v=g==="y"?"top":"left",w=g==="y"?"bottom":"right",y=h+_[v],x=h-_[w];h=Qo(y,h,x)}const p=l.fn({...t,[f]:c,[g]:h});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[f]:i,[g]:a}}}}}},kc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:a,elements:l}=t,{apply:d=()=>{},...u}=ut(e,t),_=await fr(t,u),g=Kn(r),f=ft(r),c=Tn(r)==="y",{width:h,height:p}=i.floating;let v,w;g==="top"||g==="bottom"?(v=g,w=f===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(w=g,v=f==="end"?"top":"bottom");const y=p-_.top-_.bottom,x=h-_.left-_.right,E=Wn(p-_[v],y),A=Wn(h-_[w],x),L=!t.middlewareData.shift;let N=E,P=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(N=y),L&&!f){const I=bn(_.left,0),V=bn(_.right,0),j=bn(_.top,0),$=bn(_.bottom,0);c?P=h-2*(I!==0||V!==0?I+V:bn(_.left,_.right)):N=p-2*(j!==0||$!==0?j+$:bn(_.top,_.bottom))}await d({...t,availableWidth:P,availableHeight:N});const z=await a.getDimensions(l.floating);return h!==z.width||p!==z.height?{reset:{rects:!0}}:{}}}};function Ui(e){const t=vn(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Ye(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:o,l=Jt(n)!==i||Jt(o)!==a;return l&&(n=i,o=a),{width:n,height:o,$:l}}function _r(e){return Te(e)?e:e.contextElement}function gt(e){const t=_r(e);if(!Ye(t))return Mn(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Ui(t);let a=(i?Jt(n.width):n.width)/o,l=(i?Jt(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const Ic=Mn(0);function Xi(e){const t=hn(e);return!Rt()||!t.visualViewport?Ic:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ec(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==hn(e)?!1:t}function nt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=_r(e);let a=Mn(1);t&&(o?Te(o)&&(a=gt(o)):a=gt(e));const l=Ec(i,n,o)?Xi(i):Mn(0);let d=(r.left+l.x)/a.x,u=(r.top+l.y)/a.y,_=r.width/a.x,g=r.height/a.y;if(i){const f=hn(i),c=o&&Te(o)?hn(o):o;let h=f,p=Jo(h);for(;p&&o&&c!==h;){const v=gt(p),w=p.getBoundingClientRect(),y=vn(p),x=w.left+(p.clientLeft+parseFloat(y.paddingLeft))*v.x,E=w.top+(p.clientTop+parseFloat(y.paddingTop))*v.y;d*=v.x,u*=v.y,_*=v.x,g*=v.y,d+=x,u+=E,h=hn(p),p=Jo(h)}}return eo({width:_,height:g,x:d,y:u})}function lo(e,t){const n=Zt(e).scrollLeft;return t?t.left+n:nt(En(e)).left+n}function Yi(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-lo(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Mc(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",a=En(o),l=t?Yt(t.floating):!1;if(o===a||l&&i)return n;let d={scrollLeft:0,scrollTop:0},u=Mn(1);const _=Mn(0),g=Ye(o);if((g||!g&&!i)&&((Hn(o)!=="body"||$t(a))&&(d=Zt(o)),Ye(o))){const c=nt(o);u=gt(o),_.x=c.x+o.clientLeft,_.y=c.y+o.clientTop}const f=a&&!g&&!i?Yi(a,d):Mn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-d.scrollLeft*u.x+_.x+f.x,y:n.y*u.y-d.scrollTop*u.y+_.y+f.y}}function Nc(e){return Array.from(e.getClientRects())}function Fc(e){const t=En(e),n=Zt(e),o=e.ownerDocument.body,r=bn(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=bn(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+lo(e);const l=-n.scrollTop;return vn(o).direction==="rtl"&&(a+=bn(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:a,y:l}}const Ri=25;function Dc(e,t){const n=hn(e),o=En(e),r=n.visualViewport;let i=o.clientWidth,a=o.clientHeight,l=0,d=0;if(r){i=r.width,a=r.height;const _=Rt();(!_||_&&t==="fixed")&&(l=r.offsetLeft,d=r.offsetTop)}const u=lo(o);if(u<=0){const _=o.ownerDocument,g=_.body,f=getComputedStyle(g),c=_.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,h=Math.abs(o.clientWidth-g.clientWidth-c);h<=Ri&&(i-=h)}else u<=Ri&&(i+=u);return{width:i,height:a,x:l,y:d}}const Ac=new Set(["absolute","fixed"]);function Lc(e,t){const n=nt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Ye(e)?gt(e):Mn(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 Zi(e,t,n){let o;if(t==="viewport")o=Dc(e,n);else if(t==="document")o=Fc(En(e));else if(Te(t))o=Lc(t,n);else{const r=Xi(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return eo(o)}function Ji(e,t){const n=zn(e);return n===t||!Te(n)||Pn(n)?!1:vn(n).position==="fixed"||Ji(n,t)}function Pc(e,t){const n=t.get(e);if(n)return n;let o=Gn(e,[],!1).filter(l=>Te(l)&&Hn(l)!=="body"),r=null;const i=vn(e).position==="fixed";let a=i?zn(e):e;for(;Te(a)&&!Pn(a);){const l=vn(a),d=Zo(a);!d&&l.position==="fixed"&&(r=null),(i?!d&&!r:!d&&l.position==="static"&&!!r&&Ac.has(r.position)||$t(a)&&!d&&Ji(e,a))?o=o.filter(_=>_!==a):r=l,a=zn(a)}return t.set(e,o),o}function zc(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?Yt(t)?[]:Pc(t,this._c):[].concat(n),o],l=a[0],d=a.reduce((u,_)=>{const g=Zi(t,_,r);return u.top=bn(g.top,u.top),u.right=Wn(g.right,u.right),u.bottom=Wn(g.bottom,u.bottom),u.left=bn(g.left,u.left),u},Zi(t,l,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Tc(e){const{width:t,height:n}=Ui(e);return{width:t,height:n}}function Oc(e,t,n){const o=Ye(t),r=En(t),i=n==="fixed",a=nt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const d=Mn(0);function u(){d.x=lo(r)}if(o||!o&&!i)if((Hn(t)!=="body"||$t(r))&&(l=Zt(t)),o){const c=nt(t,!0,i,t);d.x=c.x+t.clientLeft,d.y=c.y+t.clientTop}else r&&u();i&&!o&&r&&u();const _=r&&!o&&!i?Yi(r,l):Mn(0),g=a.left+l.scrollLeft-d.x-_.x,f=a.top+l.scrollTop-d.y-_.y;return{x:g,y:f,width:a.width,height:a.height}}function gr(e){return vn(e).position==="static"}function Qi(e,t){if(!Ye(e)||vn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return En(e)===n&&(n=n.ownerDocument.body),n}function es(e,t){const n=hn(e);if(Yt(e))return n;if(!Ye(e)){let r=zn(e);for(;r&&!Pn(r);){if(Te(r)&&!gr(r))return r;r=zn(r)}return n}let o=Qi(e,t);for(;o&&Sl(o)&&gr(o);)o=Qi(o,t);return o&&Pn(o)&&gr(o)&&!Zo(o)?n:o||Ml(e)||n}const Vc=async function(e){const t=this.getOffsetParent||es,n=this.getDimensions,o=await n(e.floating);return{reference:Oc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function jc(e){return vn(e).direction==="rtl"}const qc={convertOffsetParentRelativeRectToViewportRelativeRect:Mc,getDocumentElement:En,getClippingRect:zc,getOffsetParent:es,getElementRects:Vc,getClientRects:Nc,getDimensions:Tc,getScale:gt,isElement:Te,isRTL:jc};function ns(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bc(e,t){let n=null,o;const r=En(e);function i(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function a(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),i();const u=e.getBoundingClientRect(),{left:_,top:g,width:f,height:c}=u;if(l||t(),!f||!c)return;const h=dt(g),p=dt(r.clientWidth-(_+f)),v=dt(r.clientHeight-(g+c)),w=dt(_),x={rootMargin:-h+"px "+-p+"px "+-v+"px "+-w+"px",threshold:bn(0,Wn(1,d))||1};let E=!0;function A(L){const N=L[0].intersectionRatio;if(N!==d){if(!E)return a();N?a(!1,N):o=setTimeout(()=>{a(!1,1e-7)},1e3)}N===1&&!ns(u,e.getBoundingClientRect())&&a(),E=!1}try{n=new IntersectionObserver(A,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(A,x)}n.observe(e)}return a(!0),i}function co(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,u=_r(e),_=r||i?[...u?Gn(u):[],...Gn(t)]:[];_.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const g=u&&l?Bc(u,n):null;let f=-1,c=null;a&&(c=new ResizeObserver(w=>{let[y]=w;y&&y.target===u&&c&&(c.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=c)==null||x.observe(t)})),n()}),u&&!d&&c.observe(u),c.observe(t));let h,p=d?nt(e):null;d&&v();function v(){const w=nt(e);p&&!ns(p,w)&&n(),p=w,h=requestAnimationFrame(v)}return n(),()=>{var w;_.forEach(y=>{r&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),g?.(),(w=c)==null||w.disconnect(),c=null,d&&cancelAnimationFrame(h)}}const Hc=Sc,Gc=$c,Wc=yc,Kc=kc,ts=wc,Uc=(e,t,n)=>{const o=new Map,r={platform:qc,...n},i={...r.platform,_c:o};return bc(e,t,{...r,platform:i})};var Xc=typeof document<"u",Yc=function(){},uo=Xc?m.useLayoutEffect:Yc;function fo(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(!fo(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)&&!fo(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function os(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rs(e,t){const n=os(e);return Math.round(t*n)/n}function pr(e){const t=M.useRef(e);return uo(()=>{t.current=e}),t}function Rc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:d,open:u}=e,[_,g]=M.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,c]=M.useState(o);fo(f,o)||c(o);const[h,p]=M.useState(null),[v,w]=M.useState(null),y=M.useCallback(C=>{C!==L.current&&(L.current=C,p(C))},[]),x=M.useCallback(C=>{C!==N.current&&(N.current=C,w(C))},[]),E=i||h,A=a||v,L=M.useRef(null),N=M.useRef(null),P=M.useRef(_),z=d!=null,I=pr(d),V=pr(r),j=pr(u),$=M.useCallback(()=>{if(!L.current||!N.current)return;const C={placement:t,strategy:n,middleware:f};V.current&&(C.platform=V.current),Uc(L.current,N.current,C).then(k=>{const D={...k,isPositioned:j.current!==!1};b.current&&!fo(P.current,D)&&(P.current=D,Go.flushSync(()=>{g(D)}))})},[f,t,n,V,j]);uo(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g(C=>({...C,isPositioned:!1})))},[u]);const b=M.useRef(!1);uo(()=>(b.current=!0,()=>{b.current=!1}),[]),uo(()=>{if(E&&(L.current=E),A&&(N.current=A),E&&A){if(I.current)return I.current(E,A,$);$()}},[E,A,$,I,z]);const S=M.useMemo(()=>({reference:L,floating:N,setReference:y,setFloating:x}),[y,x]),T=M.useMemo(()=>({reference:E,floating:A}),[E,A]),F=M.useMemo(()=>{const C={position:n,left:0,top:0};if(!T.floating)return C;const k=rs(T.floating,_.x),D=rs(T.floating,_.y);return l?{...C,transform:"translate("+k+"px, "+D+"px)",...os(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:D}},[n,l,T.floating,_.x,_.y]);return M.useMemo(()=>({..._,update:$,refs:S,elements:T,floatingStyles:F}),[_,$,S,T,F])}const Zc=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?ts({element:o.current,padding:r}).fn(n):{}:o?ts({element:o,padding:r}).fn(n):{}}}},_o=(e,t)=>({...Hc(e),options:[e,t]}),go=(e,t)=>({...Gc(e),options:[e,t]}),po=(e,t)=>({...Wc(e),options:[e,t]}),is=(e,t)=>({...Kc(e),options:[e,t]}),Jc=(e,t)=>({...Zc(e),options:[e,t]});function ss(e){const t=M.useRef(void 0),n=M.useCallback(o=>{const r=e.map(i=>{if(i!=null){if(typeof i=="function"){const a=i,l=a(o);return typeof l=="function"?l:()=>{a(null)}}return i.current=o,()=>{i.current=null}}});return()=>{r.forEach(i=>i?.())}},e);return M.useMemo(()=>e.every(o=>o==null)?null:o=>{t.current&&(t.current(),t.current=void 0),o!=null&&(t.current=n(o))},e)}const Qc="data-floating-ui-focusable",as="active",ls="selected",Ft="ArrowLeft",Dt="ArrowRight",cs="ArrowUp",ho="ArrowDown",ed={...M};let ds=!1,nd=0;const us=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+nd++;function td(){const[e,t]=M.useState(()=>ds?us():void 0);return Oe(()=>{e==null&&t(us())},[]),M.useEffect(()=>{ds=!0},[]),e}const At=ed.useId||td;let Lt;process.env.NODE_ENV!=="production"&&(Lt=new Set);function mo(){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=Lt)!=null&&e.has(r))){var i;(i=Lt)==null||i.add(r),console.warn(r)}}function od(){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=Lt)!=null&&e.has(r))){var i;(i=Lt)==null||i.add(r),console.error(r)}}const rd=M.forwardRef(function(t,n){const{context:{placement:o,elements:{floating:r},middlewareData:{arrow:i,shift:a}},width:l=14,height:d=7,tipRadius:u=0,strokeWidth:_=0,staticOffset:g,stroke:f,d:c,style:{transform:h,...p}={},...v}=t;process.env.NODE_ENV!=="production"&&(n||mo("The `ref` prop is required for `FloatingArrow`."));const w=At(),[y,x]=M.useState(!1);if(Oe(()=>{if(!r)return;vn(r).direction==="rtl"&&x(!0)},[r]),!r)return null;const[E,A]=o.split("-"),L=E==="top"||E==="bottom";let N=g;(L&&a!=null&&a.x||!L&&a!=null&&a.y)&&(N=null);const P=_*2,z=P/2,I=l/2*(u/-8+1),V=d/2*u/4,j=!!c,$=N&&A==="end"?"bottom":"top";let b=N&&A==="end"?"right":"left";N&&y&&(b=A==="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-V))+(" Q"+l/2+","+d+" "+I+","+(d-V))+" Z",C={top:j?"rotate(180deg)":"",left:j?"rotate(90deg)":"rotate(-90deg)",bottom:j?"":"rotate(180deg)",right:j?"rotate(-90deg)":"rotate(90deg)"}[E];return s.jsxs("svg",{...v,"aria-hidden":!0,ref:n,width:j?l:l+P,height:l,viewBox:"0 0 "+l+" "+(d>l?d:l),style:{position:"absolute",pointerEvents:"none",[b]:S,[$]:T,[E]:L||j?"100%":"calc(100% - "+P/2+"px)",transform:[C,h].filter(k=>!!k).join(" "),...p},children:[P>0&&s.jsx("path",{clipPath:"url(#"+w+")",fill:"none",stroke:f,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:-z,y:z*(j?-1:1),width:l+P,height:l})})]})});function fs(){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 _s=M.createContext(null),gs=M.createContext(null),pt=()=>{var e;return((e=M.useContext(_s))==null?void 0:e.id)||null},tt=()=>M.useContext(gs);function ps(e){const t=At(),n=tt(),r=pt();return Oe(()=>{if(!t)return;const i={id:t,parentId:r};return n?.addNode(i),()=>{n?.removeNode(i)}},[n,t,r]),t}function hs(e){const{children:t,id:n}=e,o=pt();return s.jsx(_s.Provider,{value:M.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function id(e){const{children:t}=e,n=M.useRef([]),o=M.useCallback(a=>{n.current=[...n.current,a]},[]),r=M.useCallback(a=>{n.current=n.current.filter(l=>l!==a)},[]),[i]=M.useState(()=>fs());return s.jsx(gs.Provider,{value:M.useMemo(()=>({nodesRef:n,addNode:o,removeNode:r,events:i}),[o,r,i]),children:t})}function ot(e){return"data-floating-ui-"+e}function ln(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const ms=ot("safe-polygon");function hr(e,t,n){if(n&&!It(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function mr(e){return typeof e=="function"?e():e}function vr(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,events:i,elements:a}=e,{enabled:l=!0,delay:d=0,handleClose:u=null,mouseOnly:_=!1,restMs:g=0,move:f=!0}=t,c=tt(),h=pt(),p=nn(u),v=nn(d),w=nn(n),y=nn(g),x=M.useRef(),E=M.useRef(-1),A=M.useRef(),L=M.useRef(-1),N=M.useRef(!0),P=M.useRef(!1),z=M.useRef(()=>{}),I=M.useRef(!1),V=Re(()=>{var F;const C=(F=r.current.openEvent)==null?void 0:F.type;return C?.includes("mouse")&&C!=="mousedown"});M.useEffect(()=>{if(!l)return;function F(C){let{open:k}=C;k||(ln(E),ln(L),N.current=!0,I.current=!1)}return i.on("openchange",F),()=>{i.off("openchange",F)}},[l,i]),M.useEffect(()=>{if(!l||!p.current||!n)return;function F(k){V()&&o(!1,k,"hover")}const C=sn(a.floating).documentElement;return C.addEventListener("mouseleave",F),()=>{C.removeEventListener("mouseleave",F)}},[a.floating,n,o,l,p,V]);const j=M.useCallback(function(F,C,k){C===void 0&&(C=!0),k===void 0&&(k="hover");const D=hr(v.current,"close",x.current);D&&!A.current?(ln(E),E.current=window.setTimeout(()=>o(!1,F,k),D)):C&&(ln(E),o(!1,F,k))},[v,o]),$=Re(()=>{z.current(),A.current=void 0}),b=Re(()=>{if(P.current){const F=sn(a.floating).body;F.style.pointerEvents="",F.removeAttribute(ms),P.current=!1}}),S=Re(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);M.useEffect(()=>{if(!l)return;function F(H){if(ln(E),N.current=!1,_&&!It(x.current)||mr(y.current)>0&&!hr(v.current,"open"))return;const B=hr(v.current,"open",x.current);B?E.current=window.setTimeout(()=>{w.current||o(!0,H,"hover")},B):n||o(!0,H,"hover")}function C(H){if(S()){b();return}z.current();const B=sn(a.floating);if(ln(L),I.current=!1,p.current&&r.current.floatingContext){n||ln(E),A.current=p.current({...r.current.floatingContext,tree:c,x:H.clientX,y:H.clientY,onClose(){b(),$(),S()||j(H,!0,"safe-polygon")}});const X=A.current;B.addEventListener("mousemove",X),z.current=()=>{B.removeEventListener("mousemove",X)};return}(x.current==="touch"?!rn(a.floating,H.relatedTarget):!0)&&j(H)}function k(H){S()||r.current.floatingContext&&(p.current==null||p.current({...r.current.floatingContext,tree:c,x:H.clientX,y:H.clientY,onClose(){b(),$(),S()||j(H)}})(H))}function D(){ln(E)}function O(H){S()||j(H,!1)}if(Te(a.domReference)){const H=a.domReference,B=a.floating;return n&&H.addEventListener("mouseleave",k),f&&H.addEventListener("mousemove",F,{once:!0}),H.addEventListener("mouseenter",F),H.addEventListener("mouseleave",C),B&&(B.addEventListener("mouseleave",k),B.addEventListener("mouseenter",D),B.addEventListener("mouseleave",O)),()=>{n&&H.removeEventListener("mouseleave",k),f&&H.removeEventListener("mousemove",F),H.removeEventListener("mouseenter",F),H.removeEventListener("mouseleave",C),B&&(B.removeEventListener("mouseleave",k),B.removeEventListener("mouseenter",D),B.removeEventListener("mouseleave",O))}}},[a,l,e,_,f,j,$,b,o,n,w,c,v,p,r,S,y]),Oe(()=>{var F;if(l&&n&&(F=p.current)!=null&&(F=F.__options)!=null&&F.blockPointerEvents&&V()){P.current=!0;const k=a.floating;if(Te(a.domReference)&&k){var C;const D=sn(a.floating).body;D.setAttribute(ms,"");const O=a.domReference,H=c==null||(C=c.nodesRef.current.find(B=>B.id===h))==null||(C=C.context)==null?void 0:C.elements.floating;return H&&(H.style.pointerEvents=""),D.style.pointerEvents="none",O.style.pointerEvents="auto",k.style.pointerEvents="auto",()=>{D.style.pointerEvents="",O.style.pointerEvents="",k.style.pointerEvents=""}}}},[l,n,h,a,c,p,V]),Oe(()=>{n||(x.current=void 0,I.current=!1,$(),b())},[n,$,b]),M.useEffect(()=>()=>{$(),ln(E),ln(L),b()},[l,a.domReference,$,b]);const T=M.useMemo(()=>{function F(C){x.current=C.pointerType}return{onPointerDown:F,onPointerEnter:F,onMouseMove(C){const{nativeEvent:k}=C;function D(){!N.current&&!w.current&&o(!0,k,"hover")}_&&!It(x.current)||n||mr(y.current)===0||I.current&&C.movementX**2+C.movementY**2<2||(ln(L),x.current==="touch"?D():(I.current=!0,L.current=window.setTimeout(D,mr(y.current))))}}},[_,o,n,w,y]);return M.useMemo(()=>l?{reference:T}:{},[l,T])}let vs=0;function rt(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(vs);const i=()=>e?.focus({preventScroll:n});r?i():vs=requestAnimationFrame(i)}function br(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Xt(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function sd(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ad(e){return e?.ownerDocument||document}const ht={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function bs(e){return e==="inert"?ht.inert:e==="aria-hidden"?ht["aria-hidden"]:ht.none}let vo=new WeakSet,bo={},wr=0;const ld=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,ws=e=>e&&(e.host||ws(e.parentNode)),cd=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=ws(n);return e.contains(o)?o:null}).filter(n=>n!=null);function dd(e,t,n,o){const r="data-floating-ui-inert",i=o?"inert":n?"aria-hidden":null,a=cd(t,e),l=new Set,d=new Set(a),u=[];bo[r]||(bo[r]=new WeakMap);const _=bo[r];a.forEach(g),f(t),l.clear();function g(c){!c||l.has(c)||(l.add(c),c.parentNode&&g(c.parentNode))}function f(c){!c||d.has(c)||[].forEach.call(c.children,h=>{if(Hn(h)!=="script")if(l.has(h))f(h);else{const p=i?h.getAttribute(i):null,v=p!==null&&p!=="false",w=bs(i),y=(w.get(h)||0)+1,x=(_.get(h)||0)+1;w.set(h,y),_.set(h,x),u.push(h),y===1&&v&&vo.add(h),x===1&&h.setAttribute(r,""),!v&&i&&h.setAttribute(i,i==="inert"?"":"true")}})}return wr++,()=>{u.forEach(c=>{const h=bs(i),v=(h.get(c)||0)-1,w=(_.get(c)||0)-1;h.set(c,v),_.set(c,w),v||(!vo.has(c)&&i&&c.removeAttribute(i),vo.delete(c)),w||c.removeAttribute(r)}),wr--,wr||(ht.inert=new WeakMap,ht["aria-hidden"]=new WeakMap,ht.none=new WeakMap,vo=new WeakSet,bo={})}}function ys(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=ad(e[0]).body;return dd(e.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,t,n)}const wo={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},yo=M.forwardRef(function(t,n){const[o,r]=M.useState();Oe(()=>{Pi()&&r("button")},[]);const i={ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[ot("focus-guard")]:"",style:wo};return s.jsx("span",{...t,...i})}),Cs=M.createContext(null),xs=ot("portal");function ud(e){e===void 0&&(e={});const{id:t,root:n}=e,o=At(),r=Ss(),[i,a]=M.useState(null),l=M.useRef(null);return Oe(()=>()=>{i?.remove(),queueMicrotask(()=>{l.current=null})},[i]),Oe(()=>{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(xs,""),d.appendChild(u),l.current=u,a(u)},[t,o]),Oe(()=>{if(n===null||!o||l.current)return;let d=n||r?.portalNode;d&&!Ro(d)&&(d=d.current),d=d||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,d.appendChild(u));const _=document.createElement("div");_.id=o,_.setAttribute(xs,""),d=u||d,d.appendChild(_),l.current=_,a(_)},[t,n,o,r]),i}function Co(e){const{children:t,id:n,root:o,preserveTabOrder:r=!0}=e,i=ud({id:n,root:o}),[a,l]=M.useState(null),d=M.useRef(null),u=M.useRef(null),_=M.useRef(null),g=M.useRef(null),f=a?.modal,c=a?.open,h=!!a&&!a.modal&&a.open&&r&&!!(o||i);return M.useEffect(()=>{if(!i||!r||f)return;function p(v){i&&Nt(v)&&(v.type==="focusin"?Wi:vc)(i)}return i.addEventListener("focusin",p,!0),i.addEventListener("focusout",p,!0),()=>{i.removeEventListener("focusin",p,!0),i.removeEventListener("focusout",p,!0)}},[i,r,f]),M.useEffect(()=>{i&&(c||Wi(i))},[c,i]),s.jsxs(Cs.Provider,{value:M.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:d,afterOutsideRef:u,beforeInsideRef:_,afterInsideRef:g,portalNode:i,setFocusManagerState:l}),[r,i]),children:[h&&i&&s.jsx(yo,{"data-type":"outside",ref:d,onFocus:p=>{if(Nt(p,i)){var v;(v=_.current)==null||v.focus()}else{const w=a?a.domReference:null,y=Gi(w);y?.focus()}}}),h&&i&&s.jsx("span",{"aria-owns":i.id,style:wo}),i&&Go.createPortal(t,i),h&&i&&s.jsx(yo,{"data-type":"outside",ref:u,onFocus:p=>{if(Nt(p,i)){var v;(v=g.current)==null||v.focus()}else{const w=a?a.domReference:null,y=Hi(w);y?.focus(),a?.closeOnFocusOut&&a?.onOpenChange(!1,p.nativeEvent,"focus-out")}}})]})}const Ss=()=>M.useContext(Cs);function $s(e){return M.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const fd=20;let Un=[];function yr(){Un=Un.filter(e=>e.isConnected)}function _d(e){yr(),e&&Hn(e)!=="body"&&(Un.push(e),Un.length>fd&&(Un=Un.slice(-20)))}function ks(){return yr(),Un[Un.length-1]}function gd(e){const t=Mt();return Di(e,t)?e:ro(e,t)[0]||e}function Is(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const o=Mt(),i=nc(e,o).filter(l=>{const d=l.getAttribute("data-tabindex")||"";return Di(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 pd=M.forwardRef(function(t,n){return s.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:wo})});function Cr(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:a=0,returnFocus:l=!0,restoreFocus:d=!1,modal:u=!0,visuallyHiddenDismiss:_=!1,closeOnFocusOut:g=!0,outsideElementsInert:f=!1,getInsideElements:c=()=>[]}=e,{open:h,onOpenChange:p,events:v,dataRef:w,elements:{domReference:y,floating:x}}=t,E=Re(()=>{var Z;return(Z=w.current.floatingContext)==null?void 0:Z.nodeId}),A=Re(c),L=typeof a=="number"&&a<0,N=dr(y)&&L,P=ld(),z=P?i:!0,I=!z||P&&f,V=nn(r),j=nn(a),$=nn(l),b=tt(),S=Ss(),T=M.useRef(null),F=M.useRef(null),C=M.useRef(!1),k=M.useRef(!1),D=M.useRef(-1),O=M.useRef(-1),H=S!=null,B=io(x),U=Re(function(Z){return Z===void 0&&(Z=B),Z?ro(Z,Mt()):[]}),X=Re(Z=>{const oe=U(Z);return V.current.map(te=>y&&te==="reference"?y:B&&te==="floating"?B:oe).filter(Boolean).flat()});M.useEffect(()=>{if(o||!u)return;function Z(te){if(te.key==="Tab"){rn(B,Nn(sn(B)))&&U().length===0&&!N&&an(te);const ve=X(),se=On(te);V.current[0]==="reference"&&se===y&&(an(te),te.shiftKey?rt(ve[ve.length-1]):rt(ve[1])),V.current[1]==="floating"&&se===B&&te.shiftKey&&(an(te),rt(ve[0]))}}const oe=sn(B);return oe.addEventListener("keydown",Z),()=>{oe.removeEventListener("keydown",Z)}},[o,y,B,u,V,N,U,X]),M.useEffect(()=>{if(o||!x)return;function Z(oe){const te=On(oe),se=U().indexOf(te);se!==-1&&(D.current=se)}return x.addEventListener("focusin",Z),()=>{x.removeEventListener("focusin",Z)}},[o,x,U]),M.useEffect(()=>{if(o||!g)return;function Z(){k.current=!0,setTimeout(()=>{k.current=!1})}function oe(se){const Q=se.relatedTarget,de=se.currentTarget,be=On(se);queueMicrotask(()=>{const J=E(),Ce=!(rn(y,Q)||rn(x,Q)||rn(Q,x)||rn(S?.portalNode,Q)||Q!=null&&Q.hasAttribute(ot("focus-guard"))||b&&(et(b.nodesRef.current,J).find(W=>{var q,G;return rn((q=W.context)==null?void 0:q.elements.floating,Q)||rn((G=W.context)==null?void 0:G.elements.domReference,Q)})||Oi(b.nodesRef.current,J).find(W=>{var q,G,fe;return[(q=W.context)==null?void 0:q.elements.floating,io((G=W.context)==null?void 0:G.elements.floating)].includes(Q)||((fe=W.context)==null?void 0:fe.elements.domReference)===Q})));if(de===y&&B&&Is(B,V),d&&de!==y&&!(be!=null&&be.isConnected)&&Nn(sn(B))===sn(B).body){Ye(B)&&B.focus();const W=D.current,q=U(),G=q[W]||q[q.length-1]||B;Ye(G)&&G.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(N||!u)&&Q&&Ce&&!k.current&&Q!==ks()&&(C.current=!0,p(!1,se,"focus-out"))})}const te=!!(!b&&S);function ve(){ln(O),w.current.insideReactTree=!0,O.current=window.setTimeout(()=>{w.current.insideReactTree=!1})}if(x&&Ye(y))return y.addEventListener("focusout",oe),y.addEventListener("pointerdown",Z),x.addEventListener("focusout",oe),te&&x.addEventListener("focusout",ve,!0),()=>{y.removeEventListener("focusout",oe),y.removeEventListener("pointerdown",Z),x.removeEventListener("focusout",oe),te&&x.removeEventListener("focusout",ve,!0)}},[o,y,x,B,u,b,S,p,g,d,U,N,E,V,w]);const ge=M.useRef(null),ce=M.useRef(null),ie=$s([ge,S?.beforeInsideRef]),pe=$s([ce,S?.afterInsideRef]);M.useEffect(()=>{var Z,oe;if(o||!x)return;const te=Array.from((S==null||(Z=S.portalNode)==null?void 0:Z.querySelectorAll("["+ot("portal")+"]"))||[]),se=(oe=(b?Oi(b.nodesRef.current,E()):[]).find(be=>{var J;return dr(((J=be.context)==null?void 0:J.elements.domReference)||null)}))==null||(oe=oe.context)==null?void 0:oe.elements.domReference,Q=[x,se,...te,...A(),T.current,F.current,ge.current,ce.current,S?.beforeOutsideRef.current,S?.afterOutsideRef.current,V.current.includes("reference")||N?y:null].filter(be=>be!=null),de=u||N?ys(Q,!I,I):ys(Q);return()=>{de()}},[o,y,x,u,V,S,N,z,I,b,E,A]),Oe(()=>{if(o||!Ye(B))return;const Z=sn(B),oe=Nn(Z);queueMicrotask(()=>{const te=X(B),ve=j.current,se=(typeof ve=="number"?te[ve]:ve.current)||B,Q=rn(B,oe);!L&&!Q&&h&&rt(se,{preventScroll:se===B})})},[o,h,B,L,X,j]),Oe(()=>{if(o||!B)return;const Z=sn(B),oe=Nn(Z);_d(oe);function te(Q){let{reason:de,event:be,nested:J}=Q;if(["hover","safe-polygon"].includes(de)&&be.type==="mouseleave"&&(C.current=!0),de==="outside-press")if(J)C.current=!1;else if(Vi(be)||ji(be))C.current=!1;else{let Ce=!1;document.createElement("div").focus({get preventScroll(){return Ce=!0,!1}}),Ce?C.current=!1:C.current=!0}}v.on("openchange",te);const ve=Z.createElement("span");ve.setAttribute("tabindex","-1"),ve.setAttribute("aria-hidden","true"),Object.assign(ve.style,wo),H&&y&&y.insertAdjacentElement("afterend",ve);function se(){if(typeof $.current=="boolean"){const Q=y||ks();return Q&&Q.isConnected?Q:ve}return $.current.current||ve}return()=>{v.off("openchange",te);const Q=Nn(Z),de=rn(x,Q)||b&&et(b.nodesRef.current,E(),!1).some(J=>{var Ce;return rn((Ce=J.context)==null?void 0:Ce.elements.floating,Q)}),be=se();queueMicrotask(()=>{const J=gd(be);$.current&&!C.current&&Ye(J)&&(!(J!==Q&&Q!==Z.body)||de)&&J.focus({preventScroll:!0}),ve.remove()})}},[o,x,B,$,w,v,b,H,y,E]),M.useEffect(()=>(queueMicrotask(()=>{C.current=!1}),()=>{queueMicrotask(yr)}),[o]),Oe(()=>{if(!o&&S)return S.setFocusManagerState({modal:u,closeOnFocusOut:g,open:h,onOpenChange:p,domReference:y}),()=>{S.setFocusManagerState(null)}},[o,S,u,h,p,g,y]),Oe(()=>{o||B&&Is(B,V)},[o,B,V]);function ue(Z){return o||!_||!u?null:s.jsx(pd,{ref:Z==="start"?T:F,onClick:oe=>p(!1,oe.nativeEvent),children:typeof _=="string"?_:"Dismiss"})}const ye=!o&&z&&(u?!N:!0)&&(H||u);return s.jsxs(s.Fragment,{children:[ye&&s.jsx(yo,{"data-type":"inside",ref:ie,onFocus:Z=>{if(u){const te=X();rt(r[0]==="reference"?te[0]:te[te.length-1])}else if(S!=null&&S.preserveTabOrder&&S.portalNode)if(C.current=!1,Nt(Z,S.portalNode)){const te=Hi(y);te?.focus()}else{var oe;(oe=S.beforeOutsideRef.current)==null||oe.focus()}}}),!N&&ue("start"),n,ue("end"),ye&&s.jsx(yo,{"data-type":"inside",ref:pe,onFocus:Z=>{if(u)rt(X()[0]);else if(S!=null&&S.preserveTabOrder&&S.portalNode)if(g&&(C.current=!0),Nt(Z,S.portalNode)){const te=Gi(y);te?.focus()}else{var oe;(oe=S.afterOutsideRef.current)==null||oe.focus()}}})]})}function Es(e){return Ye(e.target)&&e.target.tagName==="BUTTON"}function hd(e){return Ye(e.target)&&e.target.tagName==="A"}function Ms(e){return cr(e)}function Ns(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,elements:{domReference:i}}=e,{enabled:a=!0,event:l="click",toggle:d=!0,ignoreMouse:u=!1,keyboardHandlers:_=!0,stickIfOpen:g=!0}=t,f=M.useRef(),c=M.useRef(!1),h=M.useMemo(()=>({onPointerDown(p){f.current=p.pointerType},onMouseDown(p){const v=f.current;p.button===0&&l!=="click"&&(It(v,!0)&&u||(n&&d&&(!(r.current.openEvent&&g)||r.current.openEvent.type==="mousedown")?o(!1,p.nativeEvent,"click"):(p.preventDefault(),o(!0,p.nativeEvent,"click"))))},onClick(p){const v=f.current;if(l==="mousedown"&&f.current){f.current=void 0;return}It(v,!0)&&u||(n&&d&&(!(r.current.openEvent&&g)||r.current.openEvent.type==="click")?o(!1,p.nativeEvent,"click"):o(!0,p.nativeEvent,"click"))},onKeyDown(p){f.current=void 0,!(p.defaultPrevented||!_||Es(p))&&(p.key===" "&&!Ms(i)&&(p.preventDefault(),c.current=!0),!hd(p)&&p.key==="Enter"&&o(!(n&&d),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!_||Es(p)||Ms(i)||p.key===" "&&c.current&&(c.current=!1,o(!(n&&d),p.nativeEvent,"click"))}}),[r,i,l,u,_,o,n,g,d]);return M.useMemo(()=>a?{reference:h}:{},[a,h])}const md={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},vd={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Fs=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 xo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,elements:r,dataRef:i}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:d=!0,outsidePressEvent:u="pointerdown",referencePress:_=!1,referencePressEvent:g="pointerdown",ancestorScroll:f=!1,bubbles:c,capture:h}=t,p=tt(),v=Re(typeof d=="function"?d:()=>!1),w=typeof d=="function"?v:d,y=M.useRef(!1),{escapeKey:x,outsidePress:E}=Fs(c),{escapeKey:A,outsidePress:L}=Fs(h),N=M.useRef(!1),P=Re(b=>{var S;if(!n||!a||!l||b.key!=="Escape"||N.current)return;const T=(S=i.current.floatingContext)==null?void 0:S.nodeId,F=p?et(p.nodesRef.current,T):[];if(!x&&(b.stopPropagation(),F.length>0)){let C=!0;if(F.forEach(k=>{var D;if((D=k.context)!=null&&D.open&&!k.context.dataRef.current.__escapeKeyBubbles){C=!1;return}}),!C)return}o(!1,cc(b)?b.nativeEvent:b,"escape-key")}),z=Re(b=>{var S;const T=()=>{var F;P(b),(F=On(b))==null||F.removeEventListener("keydown",T)};(S=On(b))==null||S.addEventListener("keydown",T)}),I=Re(b=>{var S;const T=i.current.insideReactTree;i.current.insideReactTree=!1;const F=y.current;if(y.current=!1,u==="click"&&F||T||typeof w=="function"&&!w(b))return;const C=On(b),k="["+ot("inert")+"]",D=sn(r.floating).querySelectorAll(k);let O=Te(C)?C:null;for(;O&&!Pn(O);){const X=zn(O);if(Pn(X)||!Te(X))break;O=X}if(D.length&&Te(C)&&!sc(C)&&!rn(C,r.floating)&&Array.from(D).every(X=>!rn(O,X)))return;if(Ye(C)&&$){const X=Pn(C),ge=vn(C),ce=/auto|scroll/,ie=X||ce.test(ge.overflowX),pe=X||ce.test(ge.overflowY),ue=ie&&C.clientWidth>0&&C.scrollWidth>C.clientWidth,ye=pe&&C.clientHeight>0&&C.scrollHeight>C.clientHeight,Z=ge.direction==="rtl",oe=ye&&(Z?b.offsetX<=C.offsetWidth-C.clientWidth:b.offsetX>C.clientWidth),te=ue&&b.offsetY>C.clientHeight;if(oe||te)return}const H=(S=i.current.floatingContext)==null?void 0:S.nodeId,B=p&&et(p.nodesRef.current,H).some(X=>{var ge;return lr(b,(ge=X.context)==null?void 0:ge.elements.floating)});if(lr(b,r.floating)||lr(b,r.domReference)||B)return;const U=p?et(p.nodesRef.current,H):[];if(U.length>0){let X=!0;if(U.forEach(ge=>{var ce;if((ce=ge.context)!=null&&ce.open&&!ge.context.dataRef.current.__outsidePressBubbles){X=!1;return}}),!X)return}o(!1,b,"outside-press")}),V=Re(b=>{var S;const T=()=>{var F;I(b),(F=On(b))==null||F.removeEventListener(u,T)};(S=On(b))==null||S.addEventListener(u,T)});M.useEffect(()=>{if(!n||!a)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=E;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},Rt()?5:0)}const C=sn(r.floating);l&&(C.addEventListener("keydown",A?z:P,A),C.addEventListener("compositionstart",T),C.addEventListener("compositionend",F)),w&&C.addEventListener(u,L?V:I,L);let k=[];return f&&(Te(r.domReference)&&(k=Gn(r.domReference)),Te(r.floating)&&(k=k.concat(Gn(r.floating))),!Te(r.reference)&&r.reference&&r.reference.contextElement&&(k=k.concat(Gn(r.reference.contextElement)))),k=k.filter(D=>{var O;return D!==((O=C.defaultView)==null?void 0:O.visualViewport)}),k.forEach(D=>{D.addEventListener("scroll",S,{passive:!0})}),()=>{l&&(C.removeEventListener("keydown",A?z:P,A),C.removeEventListener("compositionstart",T),C.removeEventListener("compositionend",F)),w&&C.removeEventListener(u,L?V:I,L),k.forEach(D=>{D.removeEventListener("scroll",S)}),window.clearTimeout(b)}},[i,r,l,w,u,n,o,f,a,x,E,P,A,z,I,L,V]),M.useEffect(()=>{i.current.insideReactTree=!1},[i,w,u]);const j=M.useMemo(()=>({onKeyDown:P,..._&&{[md[g]]:b=>{o(!1,b.nativeEvent,"reference-press")},...g!=="click"&&{onClick(b){o(!1,b.nativeEvent,"reference-press")}}}}),[P,o,_,g]),$=M.useMemo(()=>({onKeyDown:P,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[vd[u]]:()=>{i.current.insideReactTree=!0}}),[P,u,i]);return M.useMemo(()=>a?{reference:j,floating:$}:{},[a,j,$])}function bd(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=At(),i=M.useRef({}),[a]=M.useState(()=>fs()),l=pt()!=null;if(process.env.NODE_ENV!=="production"){const c=o.reference;c&&!Te(c)&&od("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[d,u]=M.useState(o.reference),_=Re((c,h,p)=>{i.current.openEvent=c?h:void 0,a.emit("openchange",{open:c,event:h,reason:p,nested:l}),n?.(c,h,p)}),g=M.useMemo(()=>({setPositionReference:u}),[]),f=M.useMemo(()=>({reference:d||o.reference||null,floating:o.floating||null,domReference:o.reference}),[d,o.reference,o.floating]);return M.useMemo(()=>({dataRef:i,open:t,onOpenChange:_,elements:f,events:a,floatingId:r,refs:g}),[t,_,f,a,r,g])}function So(e){e===void 0&&(e={});const{nodeId:t}=e,n=bd({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,r=o.elements,[i,a]=M.useState(null),[l,d]=M.useState(null),_=r?.domReference||i,g=M.useRef(null),f=tt();Oe(()=>{_&&(g.current=_)},[_]);const c=Rc({...e,elements:{...r,...l&&{reference:l}}}),h=M.useCallback(x=>{const E=Te(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;d(E),c.refs.setReference(E)},[c.refs]),p=M.useCallback(x=>{(Te(x)||x===null)&&(g.current=x,a(x)),(Te(c.refs.reference.current)||c.refs.reference.current===null||x!==null&&!Te(x))&&c.refs.setReference(x)},[c.refs]),v=M.useMemo(()=>({...c.refs,setReference:p,setPositionReference:h,domReference:g}),[c.refs,p,h]),w=M.useMemo(()=>({...c.elements,domReference:_}),[c.elements,_]),y=M.useMemo(()=>({...c,...o,refs:v,elements:w,nodeId:t}),[c,v,w,t,o]);return Oe(()=>{o.dataRef.current.floatingContext=y;const x=f?.nodesRef.current.find(E=>E.id===t);x&&(x.context=y)}),M.useMemo(()=>({...c,context:y,refs:v,elements:w}),[c,v,w,y])}function xr(){return tc()&&Pi()}function wd(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,events:r,dataRef:i,elements:a}=e,{enabled:l=!0,visibleOnly:d=!0}=t,u=M.useRef(!1),_=M.useRef(-1),g=M.useRef(!0);M.useEffect(()=>{if(!l)return;const c=hn(a.domReference);function h(){!n&&Ye(a.domReference)&&a.domReference===Nn(sn(a.domReference))&&(u.current=!0)}function p(){g.current=!0}function v(){g.current=!1}return c.addEventListener("blur",h),xr()&&(c.addEventListener("keydown",p,!0),c.addEventListener("pointerdown",v,!0)),()=>{c.removeEventListener("blur",h),xr()&&(c.removeEventListener("keydown",p,!0),c.removeEventListener("pointerdown",v,!0))}},[a.domReference,n,l]),M.useEffect(()=>{if(!l)return;function c(h){let{reason:p}=h;(p==="reference-press"||p==="escape-key")&&(u.current=!0)}return r.on("openchange",c),()=>{r.off("openchange",c)}},[r,l]),M.useEffect(()=>()=>{ln(_)},[]);const f=M.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(c){if(u.current)return;const h=On(c.nativeEvent);if(d&&Te(h)){if(xr()&&!c.relatedTarget){if(!g.current&&!cr(h))return}else if(!ac(h))return}o(!0,c.nativeEvent,"focus")},onBlur(c){u.current=!1;const h=c.relatedTarget,p=c.nativeEvent,v=Te(h)&&h.hasAttribute(ot("focus-guard"))&&h.getAttribute("data-type")==="outside";_.current=window.setTimeout(()=>{var w;const y=Nn(a.domReference?a.domReference.ownerDocument:document);!h&&y===a.domReference||rn((w=i.current.floatingContext)==null?void 0:w.refs.floating.current,y)||rn(a.domReference,y)||v||o(!1,p,"focus")})}}),[i,a.domReference,o,d]);return M.useMemo(()=>l?{reference:f}:{},[l,f])}function Sr(e,t,n){const o=new Map,r=n==="item";let i=e;if(r&&e){const{[as]:a,[ls]:l,...d}=e;i=d}return{...n==="floating"&&{tabIndex:-1,[Qc]:""},...i,...t.map(a=>{const l=a?a[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((a,l)=>(l&&Object.entries(l).forEach(d=>{let[u,_]=d;if(!(r&&[as,ls].includes(u)))if(u.indexOf("on")===0){if(o.has(u)||o.set(u,[]),typeof _=="function"){var g;(g=o.get(u))==null||g.push(_),a[u]=function(){for(var f,c=arguments.length,h=new Array(c),p=0;p<c;p++)h[p]=arguments[p];return(f=o.get(u))==null?void 0:f.map(v=>v(...h)).find(v=>v!==void 0)}}}else a[u]=_}),a),{})}}function $o(e){e===void 0&&(e=[]);const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=M.useCallback(l=>Sr(l,e,"reference"),t),i=M.useCallback(l=>Sr(l,e,"floating"),n),a=M.useCallback(l=>Sr(l,e,"item"),o);return M.useMemo(()=>({getReferenceProps:r,getFloatingProps:i,getItemProps:a}),[r,i,a])}const yd="Escape";function ko(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Io(e,t){return ko(t,e===cs||e===ho,e===Ft||e===Dt)}function $r(e,t,n){return ko(t,e===ho,n?e===Ft:e===Dt)||e==="Enter"||e===" "||e===""}function Ds(e,t,n){return ko(t,n?e===Ft:e===Dt,e===ho)}function As(e,t,n,o){const r=n?e===Dt:e===Ft,i=e===cs;return t==="both"||t==="horizontal"&&o&&o>1?e===yd:ko(t,r,i)}function kr(e,t){const{open:n,onOpenChange:o,elements:r,floatingId:i}=e,{listRef:a,activeIndex:l,onNavigate:d=()=>{},enabled:u=!0,selectedIndex:_=null,allowEscape:g=!1,loop:f=!1,nested:c=!1,rtl:h=!1,virtual:p=!1,focusItemOnOpen:v="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:y=!0,disabledIndices:x=void 0,orientation:E="vertical",parentOrientation:A,cols:L=1,scrollItemIntoView:N=!0,virtualItemRef:P,itemSizes:z,dense:I=!1}=t;process.env.NODE_ENV!=="production"&&(g&&(f||mo("`useListNavigation` looping must be enabled to allow escaping."),p||mo("`useListNavigation` must be virtual to allow escaping.")),E==="vertical"&&L>1&&mo("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const V=io(r.floating),j=nn(V),$=pt(),b=tt();Oe(()=>{e.dataRef.current.orientation=E},[e,E]);const S=Re(()=>{d(C.current===-1?null:C.current)}),T=dr(r.domReference),F=M.useRef(v),C=M.useRef(_??-1),k=M.useRef(null),D=M.useRef(!0),O=M.useRef(S),H=M.useRef(!!r.floating),B=M.useRef(n),U=M.useRef(!1),X=M.useRef(!1),ge=nn(x),ce=nn(n),ie=nn(N),pe=nn(_),[ue,ye]=M.useState(),[Z,oe]=M.useState(),te=Re(()=>{function W(_e){if(p){var he;(he=_e.id)!=null&&he.endsWith("-fui-option")&&(_e.id=i+"-"+Math.random().toString(16).slice(2,10)),ye(_e.id),b?.events.emit("virtualfocus",_e),P&&(P.current=_e)}else rt(_e,{sync:U.current,preventScroll:!0})}const q=a.current[C.current],G=X.current;q&&W(q),(U.current?_e=>_e():requestAnimationFrame)(()=>{const _e=a.current[C.current]||q;if(!_e)return;q||W(_e);const he=ie.current;he&&se&&(G||!D.current)&&(_e.scrollIntoView==null||_e.scrollIntoView(typeof he=="boolean"?{block:"nearest",inline:"nearest"}:he))})});Oe(()=>{u&&(n&&r.floating?F.current&&_!=null&&(X.current=!0,C.current=_,S()):H.current&&(C.current=-1,O.current()))},[u,n,r.floating,_,S]),Oe(()=>{if(u&&n&&r.floating)if(l==null){if(U.current=!1,pe.current!=null)return;if(H.current&&(C.current=-1,te()),(!B.current||!H.current)&&F.current&&(k.current!=null||F.current===!0&&k.current==null)){let W=0;const q=()=>{a.current[0]==null?(W<2&&(W?requestAnimationFrame:queueMicrotask)(q),W++):(C.current=k.current==null||$r(k.current,E,h)||c?ur(a,ge.current):qi(a,ge.current),k.current=null,S())};q()}}else Et(a,l)||(C.current=l,te(),X.current=!1)},[u,n,r.floating,l,pe,c,a,E,h,S,te,ge]),Oe(()=>{var W;if(!u||r.floating||!b||p||!H.current)return;const q=b.nodesRef.current,G=(W=q.find(he=>he.id===$))==null||(W=W.context)==null?void 0:W.elements.floating,fe=Nn(sn(r.floating)),_e=q.some(he=>he.context&&rn(he.context.elements.floating,fe));G&&!_e&&D.current&&G.focus({preventScroll:!0})},[u,r.floating,b,$,p]),Oe(()=>{if(!u||!b||!p||$)return;function W(q){oe(q.id),P&&(P.current=q)}return b.events.on("virtualfocus",W),()=>{b.events.off("virtualfocus",W)}},[u,b,p,$,P]),Oe(()=>{O.current=S,B.current=n,H.current=!!r.floating}),Oe(()=>{n||(k.current=null,F.current=v)},[n,v]);const ve=l!=null,se=M.useMemo(()=>{function W(G){if(!ce.current)return;const fe=a.current.indexOf(G);fe!==-1&&C.current!==fe&&(C.current=fe,S())}return{onFocus(G){let{currentTarget:fe}=G;U.current=!0,W(fe)},onClick:G=>{let{currentTarget:fe}=G;return fe.focus({preventScroll:!0})},onMouseMove(G){let{currentTarget:fe}=G;U.current=!0,X.current=!1,w&&W(fe)},onPointerLeave(G){let{pointerType:fe}=G;if(!(!D.current||fe==="touch")&&(U.current=!0,!!w&&(C.current=-1,S(),!p))){var _e;(_e=j.current)==null||_e.focus({preventScroll:!0})}}}},[ce,j,w,a,S,p]),Q=M.useCallback(()=>{var W;return A??(b==null||(W=b.nodesRef.current.find(q=>q.id===$))==null||(W=W.context)==null||(W=W.dataRef)==null?void 0:W.current.orientation)},[$,b,A]),de=Re(W=>{if(D.current=!1,U.current=!0,W.which===229||!ce.current&&W.currentTarget===j.current)return;if(c&&As(W.key,E,h,L)){Io(W.key,Q())||an(W),o(!1,W.nativeEvent,"list-navigation"),Ye(r.domReference)&&(p?b?.events.emit("virtualfocus",r.domReference):r.domReference.focus());return}const q=C.current,G=ur(a,x),fe=qi(a,x);if(T||(W.key==="Home"&&(an(W),C.current=G,S()),W.key==="End"&&(an(W),C.current=fe,S())),L>1){const _e=z||Array.from({length:a.current.length},()=>({width:1,height:1})),he=pc(_e,L,I),Ze=he.findIndex(Le=>Le!=null&&!ao(a,Le,x)),Ue=he.reduce((Le,Je,Se)=>Je!=null&&!ao(a,Je,x)?Se:Le,-1),je=he[gc({current:he.map(Le=>Le!=null?a.current[Le]:null)},{event:W,orientation:E,loop:f,rtl:h,cols:L,disabledIndices:mc([...(typeof x!="function"?x:null)||a.current.map((Le,Je)=>ao(a,Je,x)?Je:void 0),void 0],he),minIndex:Ze,maxIndex:Ue,prevIndex:hc(C.current>fe?G:C.current,_e,he,L,W.key===ho?"bl":W.key===(h?Ft:Dt)?"tr":"tl"),stopEvent:!0})];if(je!=null&&(C.current=je,S()),E==="both")return}if(Io(W.key,E)){if(an(W),n&&!p&&Nn(W.currentTarget.ownerDocument)===W.currentTarget){C.current=$r(W.key,E,h)?G:fe,S();return}$r(W.key,E,h)?f?C.current=q>=fe?g&&q!==a.current.length?-1:G:dn(a,{startingIndex:q,disabledIndices:x}):C.current=Math.min(fe,dn(a,{startingIndex:q,disabledIndices:x})):f?C.current=q<=G?g&&q!==-1?a.current.length:fe:dn(a,{startingIndex:q,decrement:!0,disabledIndices:x}):C.current=Math.max(G,dn(a,{startingIndex:q,decrement:!0,disabledIndices:x})),Et(a,C.current)&&(C.current=-1),S()}}),be=M.useMemo(()=>p&&n&&ve&&{"aria-activedescendant":Z||ue},[p,n,ve,Z,ue]),J=M.useMemo(()=>({"aria-orientation":E==="both"?void 0:E,...T?{}:be,onKeyDown:de,onPointerMove(){D.current=!0}}),[be,de,E,T]),Ce=M.useMemo(()=>{function W(G){v==="auto"&&Vi(G.nativeEvent)&&(F.current=!0)}function q(G){F.current=v,v==="auto"&&ji(G.nativeEvent)&&(F.current=!0)}return{...be,onKeyDown(G){D.current=!1;const fe=G.key.startsWith("Arrow"),_e=["Home","End"].includes(G.key),he=fe||_e,Ze=Ds(G.key,E,h),Ue=As(G.key,E,h,L),je=Ds(G.key,Q(),h),Le=Io(G.key,E),Je=(c?je:Le)||G.key==="Enter"||G.key.trim()==="";if(p&&n){const Ve=b?.nodesRef.current.find(yn=>yn.parentId==null),Fe=b&&Ve?lc(b.nodesRef.current,Ve.id):null;if(he&&Fe&&P){const yn=new KeyboardEvent("keydown",{key:G.key,bubbles:!0});if(Ze||Ue){var Se,me;const ne=((Se=Fe.context)==null?void 0:Se.elements.domReference)===G.currentTarget,Me=Ue&&!ne?(me=Fe.context)==null?void 0:me.elements.domReference:Ze?a.current.find(We=>We?.id===ue):null;Me&&(an(G),Me.dispatchEvent(yn),oe(void 0))}if((Le||_e)&&Fe.context&&Fe.context.open&&Fe.parentId&&G.currentTarget!==Fe.context.elements.domReference){var we;an(G),(we=Fe.context.elements.domReference)==null||we.dispatchEvent(yn);return}}return de(G)}if(!(!n&&!y&&fe)){if(Je){const Ve=Io(G.key,Q());k.current=c&&Ve?null:G.key}if(c){je&&(an(G),n?(C.current=ur(a,ge.current),S()):o(!0,G.nativeEvent,"list-navigation"));return}Le&&(_!=null&&(C.current=_),an(G),!n&&y?o(!0,G.nativeEvent,"list-navigation"):de(G),n&&S())}},onFocus(){n&&!p&&(C.current=-1,S())},onPointerDown:q,onPointerEnter:q,onMouseDown:W,onClick:W}},[ue,be,L,de,ge,v,a,c,S,o,n,y,E,Q,h,_,b,p,P]);return M.useMemo(()=>u?{reference:Ce,floating:J,item:se}:{},[u,Ce,J,se])}const Cd=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Eo(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=At(),_=((n=i.domReference)==null?void 0:n.id)||u,g=M.useMemo(()=>{var y;return((y=io(i.floating))==null?void 0:y.id)||a},[i.floating,a]),f=(o=Cd.get(d))!=null?o:d,h=pt()!=null,p=M.useMemo(()=>f==="tooltip"||d==="label"?{["aria-"+(d==="label"?"labelledby":"describedby")]:r?g:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":f==="alertdialog"?"dialog":f,"aria-controls":r?g:void 0,...f==="listbox"&&{role:"combobox"},...f==="menu"&&{id:_},...f==="menu"&&h&&{role:"menuitem"},...d==="select"&&{"aria-autocomplete":"none"},...d==="combobox"&&{"aria-autocomplete":"list"}},[f,g,h,r,_,d]),v=M.useMemo(()=>{const y={id:g,...f&&{role:f}};return f==="tooltip"||d==="label"?y:{...y,...f==="menu"&&{"aria-labelledby":_}}},[f,g,_,d]),w=M.useCallback(y=>{let{active:x,selected:E}=y;const A={role:"option",...x&&{id:g+"-fui-option"}};switch(d){case"select":case"combobox":return{...A,"aria-selected":E}}return{}},[g,d]);return M.useMemo(()=>l?{reference:p,floating:v,item:w}:{},[l,p,v,w])}const Ls=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function mt(e,t){return typeof e=="function"?e(t):e}function xd(e,t){const[n,o]=M.useState(e);return e&&!n&&o(!0),M.useEffect(()=>{if(!e&&n){const r=setTimeout(()=>o(!1),t);return()=>clearTimeout(r)}},[e,n,t]),n}function Sd(e,t){t===void 0&&(t={});const{open:n,elements:{floating:o}}=e,{duration:r=250}=t,a=(typeof r=="number"?r:r.close)||0,[l,d]=M.useState("unmounted"),u=xd(n,a);return!u&&l==="close"&&d("unmounted"),Oe(()=>{if(o){if(n){d("initial");const _=requestAnimationFrame(()=>{Go.flushSync(()=>{d("open")})});return()=>{cancelAnimationFrame(_)}}d("close")}},[n,o]),{isMounted:u,status:l}}function Mo(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:o,close:r,common:i,duration:a=250}=t,l=e.placement,d=l.split("-")[0],u=M.useMemo(()=>({side:d,placement:l}),[d,l]),_=typeof a=="number",g=(_?a:a.open)||0,f=(_?a:a.close)||0,[c,h]=M.useState(()=>({...mt(i,u),...mt(n,u)})),{isMounted:p,status:v}=Sd(e,{duration:a}),w=nn(n),y=nn(o),x=nn(r),E=nn(i);return Oe(()=>{const A=mt(w.current,u),L=mt(x.current,u),N=mt(E.current,u),P=mt(y.current,u)||Object.keys(A).reduce((z,I)=>(z[I]="",z),{});if(v==="initial"&&h(z=>({transitionProperty:z.transitionProperty,...N,...A})),v==="open"&&h({transitionProperty:Object.keys(P).map(Ls).join(","),transitionDuration:g+"ms",...N,...P}),v==="close"){const z=L||A;h({transitionProperty:Object.keys(z).map(Ls).join(","),transitionDuration:f+"ms",...N,...z})}},[f,x,w,y,E,g,v,u]),{isMounted:p,styles:c}}function Ps(e,t){var n;const{open:o,dataRef:r}=e,{listRef:i,activeIndex:a,onMatch:l,onTypingChange:d,enabled:u=!0,findMatch:_=null,resetMs:g=750,ignoreKeys:f=[],selectedIndex:c=null}=t,h=M.useRef(-1),p=M.useRef(""),v=M.useRef((n=c??a)!=null?n:-1),w=M.useRef(null),y=Re(l),x=Re(d),E=nn(_),A=nn(f);Oe(()=>{o&&(ln(h),w.current=null,p.current="")},[o]),Oe(()=>{if(o&&p.current===""){var I;v.current=(I=c??a)!=null?I:-1}},[o,c,a]);const L=Re(I=>{I?r.current.typing||(r.current.typing=I,x(I)):r.current.typing&&(r.current.typing=I,x(I))}),N=Re(I=>{function V(T,F,C){const k=E.current?E.current(F,C):F.find(D=>D?.toLocaleLowerCase().indexOf(C.toLocaleLowerCase())===0);return k?T.indexOf(k):-1}const j=i.current;if(p.current.length>0&&p.current[0]!==" "&&(V(j,j,p.current)===-1?L(!1):I.key===" "&&an(I)),j==null||A.current.includes(I.key)||I.key.length!==1||I.ctrlKey||I.metaKey||I.altKey)return;o&&I.key!==" "&&(an(I),L(!0)),j.every(T=>{var F,C;return T?((F=T[0])==null?void 0:F.toLocaleLowerCase())!==((C=T[1])==null?void 0:C.toLocaleLowerCase()):!0})&&p.current===I.key&&(p.current="",v.current=w.current),p.current+=I.key,ln(h),h.current=window.setTimeout(()=>{p.current="",v.current=w.current,L(!1)},g);const b=v.current,S=V(j,[...j.slice((b||0)+1),...j.slice(0,(b||0)+1)],p.current);S!==-1?(y(S),w.current=S):I.key!==" "&&(p.current="",L(!1))}),P=M.useMemo(()=>({onKeyDown:N}),[N]),z=M.useMemo(()=>({onKeyDown:N,onKeyUp(I){I.key===" "&&L(!1)}}),[N,L]);return M.useMemo(()=>u?{reference:P,floating:z}:{},[u,P,z])}function zs(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,...zs(e,r.id,n)])}function Ts(e,t){const[n,o]=e;let r=!1;const i=t.length;for(let a=0,l=i-1;a<i;l=a++){const[d,u]=t[a]||[0,0],[_,g]=t[l]||[0,0];u>=o!=g>=o&&n<=(_-d)*(o-u)/(g-u)+d&&(r=!r)}return r}function $d(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Os(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r={current:-1};let i=!1,a=null,l=null,d=typeof performance<"u"?performance.now():0;function u(g,f){const c=performance.now(),h=c-d;if(a===null||l===null||h===0)return a=g,l=f,d=c,null;const p=g-a,v=f-l,y=Math.sqrt(p*p+v*v)/h;return a=g,l=f,d=c,y}const _=g=>{let{x:f,y:c,placement:h,elements:p,onClose:v,nodeId:w,tree:y}=g;return function(E){function A(){ln(r),v()}if(ln(r),!p.domReference||!p.floating||h==null||f==null||c==null)return;const{clientX:L,clientY:N}=E,P=[L,N],z=sd(E),I=E.type==="mouseleave",V=br(p.floating,z),j=br(p.domReference,z),$=p.domReference.getBoundingClientRect(),b=p.floating.getBoundingClientRect(),S=h.split("-")[0],T=f>b.right-b.width/2,F=c>b.bottom-b.height/2,C=$d(P,$),k=b.width>$.width,D=b.height>$.height,O=(k?$:b).left,H=(k?$:b).right,B=(D?$:b).top,U=(D?$:b).bottom;if(V&&(i=!0,!I))return;if(j&&(i=!1),j&&!I){i=!0;return}if(I&&Te(E.relatedTarget)&&br(p.floating,E.relatedTarget)||y&&zs(y.nodesRef.current,w).length)return;if(S==="top"&&c>=$.bottom-1||S==="bottom"&&c<=$.top+1||S==="left"&&f>=$.right-1||S==="right"&&f<=$.left+1)return A();let X=[];switch(S){case"top":X=[[O,$.top+1],[O,b.bottom-1],[H,b.bottom-1],[H,$.top+1]];break;case"bottom":X=[[O,b.top+1],[O,$.bottom-1],[H,$.bottom-1],[H,b.top+1]];break;case"left":X=[[b.right-1,U],[b.right-1,B],[$.left+1,B],[$.left+1,U]];break;case"right":X=[[$.right-1,U],[$.right-1,B],[b.left+1,B],[b.left+1,U]];break}function ge(ce){let[ie,pe]=ce;switch(S){case"top":{const ue=[k?ie+t/2:T?ie+t*4:ie-t*4,pe+t+1],ye=[k?ie-t/2:T?ie+t*4:ie-t*4,pe+t+1],Z=[[b.left,T||k?b.bottom-t:b.top],[b.right,T?k?b.bottom-t:b.top:b.bottom-t]];return[ue,ye,...Z]}case"bottom":{const ue=[k?ie+t/2:T?ie+t*4:ie-t*4,pe-t],ye=[k?ie-t/2:T?ie+t*4:ie-t*4,pe-t],Z=[[b.left,T||k?b.top+t:b.bottom],[b.right,T?k?b.top+t:b.bottom:b.top+t]];return[ue,ye,...Z]}case"left":{const ue=[ie+t+1,D?pe+t/2:F?pe+t*4:pe-t*4],ye=[ie+t+1,D?pe-t/2:F?pe+t*4:pe-t*4];return[...[[F||D?b.right-t:b.left,b.top],[F?D?b.right-t:b.left:b.right-t,b.bottom]],ue,ye]}case"right":{const ue=[ie-t,D?pe+t/2:F?pe+t*4:pe-t*4],ye=[ie-t,D?pe-t/2:F?pe+t*4:pe-t*4],Z=[[F||D?b.left+t:b.right,b.top],[F?D?b.left+t:b.right:b.left+t,b.bottom]];return[ue,ye,...Z]}}}if(!Ts([L,N],X)){if(i&&!C)return A();if(!I&&o){const ce=u(E.clientX,E.clientY);if(ce!==null&&ce<.1)return A()}Ts([L,N],ge([f,c]))?!i&&o&&(r.current=window.setTimeout(A,40)):A()}}};return _.__options={blockPointerEvents:n},_}function vt(e,t,n){let o=n.initialDeps??[],r;function i(){var a,l,d,u;let _;n.key&&((a=n.debug)!=null&&a.call(n))&&(_=Date.now());const g=e();if(!(g.length!==o.length||g.some((h,p)=>o[p]!==h)))return r;o=g;let c;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(c=Date.now()),r=t(...g),n.key&&((d=n.debug)!=null&&d.call(n))){const h=Math.round((Date.now()-_)*100)/100,p=Math.round((Date.now()-c)*100)/100,v=p/16,w=(y,x)=>{for(y=String(y);y.length<x;)y=" "+y;return y};console.info(`%c⏱ ${w(p,5)} /${w(h,5)} ms`,`
|
|
4
|
+
*/var kc=["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])"],fo=kc.join(","),Wa=typeof Element>"u",yn=Wa?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,po=!Wa&&Element.prototype.getRootNode?function(e){var n;return e==null||(n=e.getRootNode)===null||n===void 0?void 0:n.call(e)}:function(e){return e?.ownerDocument},An=function(n,t){var o;t===void 0&&(t=!0);var a=n==null||(o=n.getAttribute)===null||o===void 0?void 0:o.call(n,"inert"),i=a===""||a==="true",s=i||t&&n&&An(n.parentNode);return s},Nc=function(n){var t,o=n==null||(t=n.getAttribute)===null||t===void 0?void 0:t.call(n,"contenteditable");return o===""||o==="true"},Ga=function(n,t,o){if(An(n))return[];var a=Array.prototype.slice.apply(n.querySelectorAll(fo));return t&&yn.call(n,fo)&&a.unshift(n),a=a.filter(o),a},go=function(n,t,o){for(var a=[],i=Array.from(n);i.length;){var s=i.shift();if(!An(s,!1))if(s.tagName==="SLOT"){var l=s.assignedElements(),c=l.length?l:s.children,u=go(c,!0,o);o.flatten?a.push.apply(a,u):a.push({scopeParent:s,candidates:u})}else{var _=yn.call(s,fo);_&&o.filter(s)&&(t||!n.includes(s))&&a.push(s);var g=s.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(s),f=!An(g,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(s));if(g&&f){var d=go(g===!0?s.children:g.children,!0,o);o.flatten?a.push.apply(a,d):a.push({scopeParent:s,candidates:d})}else i.unshift.apply(i,s.children)}}return a},Za=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},Ua=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||Nc(n))&&!Za(n)?0:n.tabIndex},Ec=function(n,t){var o=Ua(n);return o<0&&t&&!Za(n)?0:o},Mc=function(n,t){return n.tabIndex===t.tabIndex?n.documentOrder-t.documentOrder:n.tabIndex-t.tabIndex},Ka=function(n){return n.tagName==="INPUT"},Ic=function(n){return Ka(n)&&n.type==="hidden"},Fc=function(n){var t=n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(o){return o.tagName==="SUMMARY"});return t},zc=function(n,t){for(var o=0;o<n.length;o++)if(n[o].checked&&n[o].form===t)return n[o]},Lc=function(n){if(!n.name)return!0;var t=n.form||po(n),o=function(l){return t.querySelectorAll('input[type="radio"][name="'+l+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=o(window.CSS.escape(n.name));else try{a=o(n.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=zc(a,n.form);return!i||i===n},Ac=function(n){return Ka(n)&&n.type==="radio"},Dc=function(n){return Ac(n)&&!Lc(n)},Pc=function(n){var t,o=n&&po(n),a=(t=o)===null||t===void 0?void 0:t.host,i=!1;if(o&&o!==n){var s,l,c;for(i=!!((s=a)!==null&&s!==void 0&&(l=s.ownerDocument)!==null&&l!==void 0&&l.contains(a)||n!=null&&(c=n.ownerDocument)!==null&&c!==void 0&&c.contains(n));!i&&a;){var u,_,g;o=po(a),a=(u=o)===null||u===void 0?void 0:u.host,i=!!((_=a)!==null&&_!==void 0&&(g=_.ownerDocument)!==null&&g!==void 0&&g.contains(a))}}return i},Xa=function(n){var t=n.getBoundingClientRect(),o=t.width,a=t.height;return o===0&&a===0},Tc=function(n,t){var o=t.displayCheck,a=t.getShadowRoot;if(o==="full-native"&&"checkVisibility"in n){var i=n.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(n).visibility==="hidden")return!0;var s=yn.call(n,"details>summary:first-of-type"),l=s?n.parentElement:n;if(yn.call(l,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof a=="function"){for(var c=n;n;){var u=n.parentElement,_=po(n);if(u&&!u.shadowRoot&&a(u)===!0)return Xa(n);n.assignedSlot?n=n.assignedSlot:!u&&_!==n.ownerDocument?n=_.host:n=u}n=c}if(Pc(n))return!n.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Xa(n);return!1},Oc=function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var t=n.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var o=0;o<t.children.length;o++){var a=t.children.item(o);if(a.tagName==="LEGEND")return yn.call(t,"fieldset[disabled] *")?!0:!a.contains(n)}return!0}t=t.parentElement}return!1},br=function(n,t){return!(t.disabled||An(t)||Ic(t)||Tc(t,n)||Fc(t)||Oc(t))},wr=function(n,t){return!(Dc(t)||Ua(t)<0||!br(n,t))},Vc=function(n){var t=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ya=function(n){var t=[],o=[];return n.forEach(function(a,i){var s=!!a.scopeParent,l=s?a.scopeParent:a,c=Ec(l,s),u=s?Ya(a.candidates):l;c===0?s?t.push.apply(t,u):t.push(l):o.push({documentOrder:i,tabIndex:c,item:a,isScope:s,content:u})}),o.sort(Mc).reduce(function(a,i){return i.isScope?a.push.apply(a,i.content):a.push(i.content),a},[]).concat(t)},ho=function(n,t){t=t||{};var o;return t.getShadowRoot?o=go([n],t.includeContainer,{filter:wr.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Vc}):o=Ga(n,t.includeContainer,wr.bind(null,t)),Ya(o)},Bc=function(n,t){t=t||{};var o;return t.getShadowRoot?o=go([n],t.includeContainer,{filter:br.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):o=Ga(n,t.includeContainer,br.bind(null,t)),o},Ja=function(n,t){if(t=t||{},!n)throw new Error("No node provided");return yn.call(n,fo)===!1?!1:wr(t,n)};function Qa(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Ra(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(n=>{let{brand:t,version:o}=n;return t+"/"+o}).join(" "):navigator.userAgent}function ei(){return/apple/i.test(navigator.vendor)}function yr(){const e=/android/i;return e.test(Qa())||e.test(Ra())}function jc(){return Qa().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function ti(){return Ra().includes("jsdom/")}const ni="data-floating-ui-focusable",qc="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Cr="ArrowLeft",xr="ArrowRight",Hc="ArrowUp",Wc="ArrowDown";function Dt(e){let n=e.activeElement;for(;((t=n)==null||(t=t.shadowRoot)==null?void 0:t.activeElement)!=null;){var t;n=n.shadowRoot.activeElement}return n}function ct(e,n){if(!e||!n)return!1;const t=n.getRootNode==null?void 0:n.getRootNode();if(e.contains(n))return!0;if(t&&ao(t)){let o=n;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Ht(e){return"composedPath"in e?e.composedPath()[0]:e.target}function $r(e,n){if(n==null)return!1;if("composedPath"in e)return e.composedPath().includes(n);const t=e;return t.target!=null&&n.contains(t.target)}function Gc(e){return e.matches("html,body")}function dt(e){return e?.ownerDocument||document}function Sr(e){return tt(e)&&e.matches(qc)}function kr(e){return e?e.getAttribute("role")==="combobox"&&Sr(e):!1}function Zc(e){if(!e||ti())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function mo(e){return e?e.hasAttribute(ni)?e:e.querySelector("["+ni+"]")||e:null}function sn(e,n,t){return t===void 0&&(t=!0),e.filter(a=>{var i;return a.parentId===n&&(!t||((i=a.context)==null?void 0:i.open))}).flatMap(a=>[a,...sn(e,a.id,t)])}function Uc(e,n){let t,o=-1;function a(i,s){s>o&&(t=i,o=s),sn(e,i).forEach(c=>{a(c.id,s+1)})}return a(n,0),e.find(i=>i.id===t)}function oi(e,n){var t;let o=[],a=(t=e.find(i=>i.id===n))==null?void 0:t.parentId;for(;a;){const i=e.find(s=>s.id===a);a=i?.parentId,i&&(o=o.concat(i))}return o}function ut(e){e.preventDefault(),e.stopPropagation()}function Kc(e){return"nativeEvent"in e}function ri(e){return e.mozInputSource===0&&e.isTrusted?!0:yr()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ai(e){return ti()?!1:!yr()&&e.width===0&&e.height===0||yr()&&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 Dn(e,n){const t=["mouse","pen"];return n||t.push("",void 0),t.includes(e)}var Xc=typeof document<"u",Yc=function(){},He=Xc?h.useLayoutEffect:Yc;const Jc={...M};function st(e){const n=M.useRef(e);return He(()=>{n.current=e}),n}const Qc=Jc.useInsertionEffect||(e=>e());function nt(e){const n=M.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Qc(()=>{n.current=e}),M.useCallback(function(){for(var t=arguments.length,o=new Array(t),a=0;a<t;a++)o[a]=arguments[a];return n.current==null?void 0:n.current(...o)},[])}function vo(e,n,t){return Math.floor(e/n)!==t}function Pn(e,n){return n<0||n>=e.current.length}function Nr(e,n){return ft(e,{disabledIndices:n})}function ii(e,n){return ft(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:n})}function ft(e,n){let{startingIndex:t=-1,decrement:o=!1,disabledIndices:a,amount:i=1}=n===void 0?{}:n,s=t;do s+=o?-i:i;while(s>=0&&s<=e.current.length-1&&bo(e,s,a));return s}function Rc(e,n){let{event:t,orientation:o,loop:a,rtl:i,cols:s,disabledIndices:l,minIndex:c,maxIndex:u,prevIndex:_,stopEvent:g=!1}=n,f=_;if(t.key===Hc){if(g&&ut(t),_===-1)f=u;else if(f=ft(e,{startingIndex:f,amount:s,decrement:!0,disabledIndices:l}),a&&(_-s<c||f<0)){const d=_%s,m=u%s,p=u-(m-d);m===d?f=u:f=m>d?p:p-s}Pn(e,f)&&(f=_)}if(t.key===Wc&&(g&&ut(t),_===-1?f=c:(f=ft(e,{startingIndex:_,amount:s,disabledIndices:l}),a&&_+s>u&&(f=ft(e,{startingIndex:_%s-s,amount:s,disabledIndices:l}))),Pn(e,f)&&(f=_)),o==="both"){const d=vn(_/s);t.key===(i?Cr:xr)&&(g&&ut(t),_%s!==s-1?(f=ft(e,{startingIndex:_,disabledIndices:l}),a&&vo(f,s,d)&&(f=ft(e,{startingIndex:_-_%s-1,disabledIndices:l}))):a&&(f=ft(e,{startingIndex:_-_%s-1,disabledIndices:l})),vo(f,s,d)&&(f=_)),t.key===(i?xr:Cr)&&(g&&ut(t),_%s!==0?(f=ft(e,{startingIndex:_,decrement:!0,disabledIndices:l}),a&&vo(f,s,d)&&(f=ft(e,{startingIndex:_+(s-_%s),decrement:!0,disabledIndices:l}))):a&&(f=ft(e,{startingIndex:_+(s-_%s),decrement:!0,disabledIndices:l})),vo(f,s,d)&&(f=_));const m=vn(u/s)===d;Pn(e,f)&&(a&&m?f=t.key===(i?xr:Cr)?u:ft(e,{startingIndex:_-_%s-1,disabledIndices:l}):f=_)}return f}function ed(e,n,t){const o=[];let a=0;return e.forEach((i,s)=>{let{width:l,height:c}=i;if(l>n&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+s+" is greater than grid columns");let u=!1;for(t&&(a=0);!u;){const _=[];for(let g=0;g<l;g++)for(let f=0;f<c;f++)_.push(a+g+f*n);a%n+l<=n&&_.every(g=>o[g]==null)?(_.forEach(g=>{o[g]=s}),u=!0):a++}}),[...o]}function td(e,n,t,o,a){if(e===-1)return-1;const i=t.indexOf(e),s=n[e];switch(a){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*o:i;case"br":return t.lastIndexOf(e)}}function nd(e,n){return n.flatMap((t,o)=>e.includes(t)?[o]:[])}function bo(e,n,t){if(typeof t=="function")return t(n);if(t)return t.includes(n);const o=e.current[n];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}const Tn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function si(e,n){const t=ho(e,Tn()),o=t.length;if(o===0)return;const a=Dt(dt(e)),i=t.indexOf(a),s=i===-1?n===1?0:o-1:i+n;return t[s]}function li(e){return si(dt(e).body,1)||e}function ci(e){return si(dt(e).body,-1)||e}function On(e,n){const t=n||e.currentTarget,o=e.relatedTarget;return!o||!ct(t,o)}function od(e){ho(e,Tn()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function di(e){e.querySelectorAll("[data-tabindex]").forEach(t=>{const o=t.dataset.tabindex;delete t.dataset.tabindex,o?t.setAttribute("tabindex",o):t.removeAttribute("tabindex")})}function ui(e,n,t){let{reference:o,floating:a}=e;const i=qt(n),s=mr(n),l=hr(s),c=Jt(n),u=i==="y",_=o.x+o.width/2-a.width/2,g=o.y+o.height/2-a.height/2,f=o[l]/2-a[l]/2;let d;switch(c){case"top":d={x:_,y:o.y-a.height};break;case"bottom":d={x:_,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:g};break;case"left":d={x:o.x-a.width,y:g};break;default:d={x:o.x,y:o.y}}switch(wn(n)){case"start":d[s]-=f*(t&&u?-1:1);break;case"end":d[s]+=f*(t&&u?-1:1);break}return d}const rd=async(e,n,t)=>{const{placement:o="bottom",strategy:a="absolute",middleware:i=[],platform:s}=t,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(n));let u=await s.getElementRects({reference:e,floating:n,strategy:a}),{x:_,y:g}=ui(u,o,c),f=o,d={},m=0;for(let p=0;p<l.length;p++){const{name:v,fn:y}=l[p],{x:w,y:C,data:k,reset:z}=await y({x:_,y:g,initialPlacement:o,placement:f,strategy:a,middlewareData:d,rects:u,platform:s,elements:{reference:e,floating:n}});_=w??_,g=C??g,d={...d,[v]:{...d[v],...k}},z&&m<=50&&(m++,typeof z=="object"&&(z.placement&&(f=z.placement),z.rects&&(u=z.rects===!0?await s.getElementRects({reference:e,floating:n,strategy:a}):z.rects),{x:_,y:g}=ui(u,f,c)),p=-1)}return{x:_,y:g,placement:f,strategy:a,middlewareData:d}};async function Er(e,n){var t;n===void 0&&(n={});const{x:o,y:a,platform:i,rects:s,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:_="viewport",elementContext:g="floating",altBoundary:f=!1,padding:d=0}=bn(n,e),m=Ha(d),v=l[f?g==="floating"?"reference":"floating":g],y=_o(await i.getClippingRect({element:(t=await(i.isElement==null?void 0:i.isElement(v)))==null||t?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:_,strategy:c})),w=g==="floating"?{x:o,y:a,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),k=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},z=_o(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:C,strategy:c}):w);return{top:(y.top-z.top+m.top)/k.y,bottom:(z.bottom-y.bottom+m.bottom)/k.y,left:(y.left-z.left+m.left)/k.x,right:(z.right-y.right+m.right)/k.x}}const ad=e=>({name:"arrow",options:e,async fn(n){const{x:t,y:o,placement:a,rects:i,platform:s,elements:l,middlewareData:c}=n,{element:u,padding:_=0}=bn(e,n)||{};if(u==null)return{};const g=Ha(_),f={x:t,y:o},d=mr(a),m=hr(d),p=await s.getDimensions(u),v=d==="y",y=v?"top":"left",w=v?"bottom":"right",C=v?"clientHeight":"clientWidth",k=i.reference[m]+i.reference[d]-f[d]-i.floating[m],z=f[d]-i.reference[d],A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let N=A?A[C]:0;(!N||!await(s.isElement==null?void 0:s.isElement(A)))&&(N=l.floating[C]||i.floating[m]);const P=k/2-z/2,O=N/2-p[m]/2-1,E=Yt(g[y],O),T=Yt(g[w],O),V=E,S=N-p[m]-T,b=N/2-p[m]/2+P,x=gr(V,b,S),F=!c.arrow&&wn(a)!=null&&b!==x&&i.reference[m]/2-(b<V?E:T)-p[m]/2<0,I=F?b<V?b-V:b-S:0;return{[d]:f[d]+I,data:{[d]:x,centerOffset:b-x-I,...F&&{alignmentOffset:I}},reset:F}}}),id=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var t,o;const{placement:a,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:u}=n,{mainAxis:_=!0,crossAxis:g=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...v}=bn(e,n);if((t=i.arrow)!=null&&t.alignmentOffset)return{};const y=Jt(a),w=qt(l),C=Jt(l)===l,k=await(c.isRTL==null?void 0:c.isRTL(u.floating)),z=f||(C||!p?[uo(l)]:wc(l)),A=m!=="none";!f&&A&&z.push(...$c(l,p,m,k));const N=[l,...z],P=await Er(n,v),O=[];let E=((o=i.flip)==null?void 0:o.overflows)||[];if(_&&O.push(P[y]),g){const b=bc(a,s,k);O.push(P[b[0]],P[b[1]])}if(E=[...E,{placement:a,overflows:O}],!O.every(b=>b<=0)){var T,V;const b=(((T=i.flip)==null?void 0:T.index)||0)+1,x=N[b];if(x&&(!(g==="alignment"?w!==qt(x):!1)||E.every($=>qt($.placement)===w?$.overflows[0]>0:!0)))return{data:{index:b,overflows:E},reset:{placement:x}};let F=(V=E.filter(I=>I.overflows[0]<=0).sort((I,$)=>I.overflows[1]-$.overflows[1])[0])==null?void 0:V.placement;if(!F)switch(d){case"bestFit":{var S;const I=(S=E.filter($=>{if(A){const D=qt($.placement);return D===w||D==="y"}return!0}).map($=>[$.placement,$.overflows.filter(D=>D>0).reduce((D,B)=>D+B,0)]).sort(($,D)=>$[1]-D[1])[0])==null?void 0:S[0];I&&(F=I);break}case"initialPlacement":F=l;break}if(a!==F)return{reset:{placement:F}}}return{}}}},sd=new Set(["left","top"]);async function ld(e,n){const{placement:t,platform:o,elements:a}=e,i=await(o.isRTL==null?void 0:o.isRTL(a.floating)),s=Jt(t),l=wn(t),c=qt(t)==="y",u=sd.has(s)?-1:1,_=i&&c?-1:1,g=bn(n,e);let{mainAxis:f,crossAxis:d,alignmentAxis:m}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof m=="number"&&(d=l==="end"?m*-1:m),c?{x:d*_,y:f*u}:{x:f*u,y:d*_}}const cd=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var t,o;const{x:a,y:i,placement:s,middlewareData:l}=n,c=await ld(n,e);return s===((t=l.offset)==null?void 0:t.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:s}}}}},dd=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:t,y:o,placement:a}=n,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:v=>{let{x:y,y:w}=v;return{x:y,y:w}}},...c}=bn(e,n),u={x:t,y:o},_=await Er(n,c),g=qt(Jt(a)),f=Ba(g);let d=u[f],m=u[g];if(i){const v=f==="y"?"top":"left",y=f==="y"?"bottom":"right",w=d+_[v],C=d-_[y];d=gr(w,d,C)}if(s){const v=g==="y"?"top":"left",y=g==="y"?"bottom":"right",w=m+_[v],C=m-_[y];m=gr(w,m,C)}const p=l.fn({...n,[f]:d,[g]:m});return{...p,data:{x:p.x-t,y:p.y-o,enabled:{[f]:i,[g]:s}}}}}},ud=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var t,o;const{placement:a,rects:i,platform:s,elements:l}=n,{apply:c=()=>{},...u}=bn(e,n),_=await Er(n,u),g=Jt(a),f=wn(a),d=qt(a)==="y",{width:m,height:p}=i.floating;let v,y;g==="top"||g==="bottom"?(v=g,y=f===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(y=g,v=f==="end"?"top":"bottom");const w=p-_.top-_.bottom,C=m-_.left-_.right,k=Yt(p-_[v],w),z=Yt(m-_[y],C),A=!n.middlewareData.shift;let N=k,P=z;if((t=n.middlewareData.shift)!=null&&t.enabled.x&&(P=C),(o=n.middlewareData.shift)!=null&&o.enabled.y&&(N=w),A&&!f){const E=xt(_.left,0),T=xt(_.right,0),V=xt(_.top,0),S=xt(_.bottom,0);d?P=m-2*(E!==0||T!==0?E+T:xt(_.left,_.right)):N=p-2*(V!==0||S!==0?V+S:xt(_.top,_.bottom))}await c({...n,availableWidth:P,availableHeight:N});const O=await s.getDimensions(l.floating);return m!==O.width||p!==O.height?{reset:{rects:!0}}:{}}}};function _i(e){const n=Ct(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const a=tt(e),i=a?e.offsetWidth:t,s=a?e.offsetHeight:o,l=co(t)!==i||co(o)!==s;return l&&(t=i,o=s),{width:t,height:o,$:l}}function Mr(e){return qe(e)?e:e.contextElement}function Cn(e){const n=Mr(e);if(!tt(n))return At(1);const t=n.getBoundingClientRect(),{width:o,height:a,$:i}=_i(n);let s=(i?co(t.width):t.width)/o,l=(i?co(t.height):t.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const _d=At(0);function fi(e){const n=vt(e);return!so()||!n.visualViewport?_d:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function fd(e,n,t){return n===void 0&&(n=!1),!t||n&&t!==vt(e)?!1:n}function ln(e,n,t,o){n===void 0&&(n=!1),t===void 0&&(t=!1);const a=e.getBoundingClientRect(),i=Mr(e);let s=At(1);n&&(o?qe(o)&&(s=Cn(o)):s=Cn(e));const l=fd(i,t,o)?fi(i):At(0);let c=(a.left+l.x)/s.x,u=(a.top+l.y)/s.y,_=a.width/s.x,g=a.height/s.y;if(i){const f=vt(i),d=o&&qe(o)?vt(o):o;let m=f,p=pr(m);for(;p&&o&&d!==m;){const v=Cn(p),y=p.getBoundingClientRect(),w=Ct(p),C=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*v.x,k=y.top+(p.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,_*=v.x,g*=v.y,c+=C,u+=k,m=vt(p),p=pr(m)}}return _o({width:_,height:g,x:c,y:u})}function wo(e,n){const t=lo(e).scrollLeft;return n?n.left+t:ln(Lt(e)).left+t}function pi(e,n){const t=e.getBoundingClientRect(),o=t.left+n.scrollLeft-wo(e,t),a=t.top+n.scrollTop;return{x:o,y:a}}function pd(e){let{elements:n,rect:t,offsetParent:o,strategy:a}=e;const i=a==="fixed",s=Lt(o),l=n?io(n.floating):!1;if(o===s||l&&i)return t;let c={scrollLeft:0,scrollTop:0},u=At(1);const _=At(0),g=tt(o);if((g||!g&&!i)&&((Kt(o)!=="body"||Ln(s))&&(c=lo(o)),tt(o))){const d=ln(o);u=Cn(o),_.x=d.x+o.clientLeft,_.y=d.y+o.clientTop}const f=s&&!g&&!i?pi(s,c):At(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-c.scrollLeft*u.x+_.x+f.x,y:t.y*u.y-c.scrollTop*u.y+_.y+f.y}}function gd(e){return Array.from(e.getClientRects())}function hd(e){const n=Lt(e),t=lo(e),o=e.ownerDocument.body,a=xt(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),i=xt(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let s=-t.scrollLeft+wo(e);const l=-t.scrollTop;return Ct(o).direction==="rtl"&&(s+=xt(n.clientWidth,o.clientWidth)-a),{width:a,height:i,x:s,y:l}}const gi=25;function md(e,n){const t=vt(e),o=Lt(e),a=t.visualViewport;let i=o.clientWidth,s=o.clientHeight,l=0,c=0;if(a){i=a.width,s=a.height;const _=so();(!_||_&&n==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const u=wo(o);if(u<=0){const _=o.ownerDocument,g=_.body,f=getComputedStyle(g),d=_.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(o.clientWidth-g.clientWidth-d);m<=gi&&(i-=m)}else u<=gi&&(i+=u);return{width:i,height:s,x:l,y:c}}const vd=new Set(["absolute","fixed"]);function bd(e,n){const t=ln(e,!0,n==="fixed"),o=t.top+e.clientTop,a=t.left+e.clientLeft,i=tt(e)?Cn(e):At(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=a*i.x,u=o*i.y;return{width:s,height:l,x:c,y:u}}function hi(e,n,t){let o;if(n==="viewport")o=md(e,t);else if(n==="document")o=hd(Lt(e));else if(qe(n))o=bd(n,t);else{const a=fi(e);o={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return _o(o)}function mi(e,n){const t=jt(e);return t===n||!qe(t)||Bt(t)?!1:Ct(t).position==="fixed"||mi(t,n)}function wd(e,n){const t=n.get(e);if(t)return t;let o=Xt(e,[],!1).filter(l=>qe(l)&&Kt(l)!=="body"),a=null;const i=Ct(e).position==="fixed";let s=i?jt(e):e;for(;qe(s)&&!Bt(s);){const l=Ct(s),c=fr(s);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&vd.has(a.position)||Ln(s)&&!c&&mi(e,s))?o=o.filter(_=>_!==s):a=l,s=jt(s)}return n.set(e,o),o}function yd(e){let{element:n,boundary:t,rootBoundary:o,strategy:a}=e;const s=[...t==="clippingAncestors"?io(n)?[]:wd(n,this._c):[].concat(t),o],l=s[0],c=s.reduce((u,_)=>{const g=hi(n,_,a);return u.top=xt(g.top,u.top),u.right=Yt(g.right,u.right),u.bottom=Yt(g.bottom,u.bottom),u.left=xt(g.left,u.left),u},hi(n,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Cd(e){const{width:n,height:t}=_i(e);return{width:n,height:t}}function xd(e,n,t){const o=tt(n),a=Lt(n),i=t==="fixed",s=ln(e,!0,i,n);let l={scrollLeft:0,scrollTop:0};const c=At(0);function u(){c.x=wo(a)}if(o||!o&&!i)if((Kt(n)!=="body"||Ln(a))&&(l=lo(n)),o){const d=ln(n,!0,i,n);c.x=d.x+n.clientLeft,c.y=d.y+n.clientTop}else a&&u();i&&!o&&a&&u();const _=a&&!o&&!i?pi(a,l):At(0),g=s.left+l.scrollLeft-c.x-_.x,f=s.top+l.scrollTop-c.y-_.y;return{x:g,y:f,width:s.width,height:s.height}}function Ir(e){return Ct(e).position==="static"}function vi(e,n){if(!tt(e)||Ct(e).position==="fixed")return null;if(n)return n(e);let t=e.offsetParent;return Lt(e)===t&&(t=t.ownerDocument.body),t}function bi(e,n){const t=vt(e);if(io(e))return t;if(!tt(e)){let a=jt(e);for(;a&&!Bt(a);){if(qe(a)&&!Ir(a))return a;a=jt(a)}return t}let o=vi(e,n);for(;o&&cc(o)&&Ir(o);)o=vi(o,n);return o&&Bt(o)&&Ir(o)&&!fr(o)?t:o||pc(e)||t}const $d=async function(e){const n=this.getOffsetParent||bi,t=this.getDimensions,o=await t(e.floating);return{reference:xd(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Sd(e){return Ct(e).direction==="rtl"}const kd={convertOffsetParentRelativeRectToViewportRelativeRect:pd,getDocumentElement:Lt,getClippingRect:yd,getOffsetParent:bi,getElementRects:$d,getClientRects:gd,getDimensions:Cd,getScale:Cn,isElement:qe,isRTL:Sd};function wi(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function Nd(e,n){let t=null,o;const a=Lt(e);function i(){var l;clearTimeout(o),(l=t)==null||l.disconnect(),t=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:_,top:g,width:f,height:d}=u;if(l||n(),!f||!d)return;const m=vn(g),p=vn(a.clientWidth-(_+f)),v=vn(a.clientHeight-(g+d)),y=vn(_),C={rootMargin:-m+"px "+-p+"px "+-v+"px "+-y+"px",threshold:xt(0,Yt(1,c))||1};let k=!0;function z(A){const N=A[0].intersectionRatio;if(N!==c){if(!k)return s();N?s(!1,N):o=setTimeout(()=>{s(!1,1e-7)},1e3)}N===1&&!wi(u,e.getBoundingClientRect())&&s(),k=!1}try{t=new IntersectionObserver(z,{...C,root:a.ownerDocument})}catch{t=new IntersectionObserver(z,C)}t.observe(e)}return s(!0),i}function yo(e,n,t,o){o===void 0&&(o={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,u=Mr(e),_=a||i?[...u?Xt(u):[],...Xt(n)]:[];_.forEach(y=>{a&&y.addEventListener("scroll",t,{passive:!0}),i&&y.addEventListener("resize",t)});const g=u&&l?Nd(u,t):null;let f=-1,d=null;s&&(d=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&d&&(d.unobserve(n),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var C;(C=d)==null||C.observe(n)})),t()}),u&&!c&&d.observe(u),d.observe(n));let m,p=c?ln(e):null;c&&v();function v(){const y=ln(e);p&&!wi(p,y)&&t(),p=y,m=requestAnimationFrame(v)}return t(),()=>{var y;_.forEach(w=>{a&&w.removeEventListener("scroll",t),i&&w.removeEventListener("resize",t)}),g?.(),(y=d)==null||y.disconnect(),d=null,c&&cancelAnimationFrame(m)}}const Ed=cd,Md=dd,Id=id,Fd=ud,yi=ad,zd=(e,n,t)=>{const o=new Map,a={platform:kd,...t},i={...a.platform,_c:o};return rd(e,n,{...a,platform:i})};var Ld=typeof document<"u",Ad=function(){},Co=Ld?h.useLayoutEffect:Ad;function xo(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let t,o,a;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(t=e.length,t!==n.length)return!1;for(o=t;o--!==0;)if(!xo(e[o],n[o]))return!1;return!0}if(a=Object.keys(e),t=a.length,t!==Object.keys(n).length)return!1;for(o=t;o--!==0;)if(!{}.hasOwnProperty.call(n,a[o]))return!1;for(o=t;o--!==0;){const i=a[o];if(!(i==="_owner"&&e.$$typeof)&&!xo(e[i],n[i]))return!1}return!0}return e!==e&&n!==n}function Ci(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xi(e,n){const t=Ci(e);return Math.round(n*t)/t}function Fr(e){const n=M.useRef(e);return Co(()=>{n.current=e}),n}function Dd(e){e===void 0&&(e={});const{placement:n="bottom",strategy:t="absolute",middleware:o=[],platform:a,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[_,g]=M.useState({x:0,y:0,strategy:t,placement:n,middlewareData:{},isPositioned:!1}),[f,d]=M.useState(o);xo(f,o)||d(o);const[m,p]=M.useState(null),[v,y]=M.useState(null),w=M.useCallback($=>{$!==A.current&&(A.current=$,p($))},[]),C=M.useCallback($=>{$!==N.current&&(N.current=$,y($))},[]),k=i||m,z=s||v,A=M.useRef(null),N=M.useRef(null),P=M.useRef(_),O=c!=null,E=Fr(c),T=Fr(a),V=Fr(u),S=M.useCallback(()=>{if(!A.current||!N.current)return;const $={placement:n,strategy:t,middleware:f};T.current&&($.platform=T.current),zd(A.current,N.current,$).then(D=>{const B={...D,isPositioned:V.current!==!1};b.current&&!xo(P.current,B)&&(P.current=B,ar.flushSync(()=>{g(B)}))})},[f,n,t,T,V]);Co(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g($=>({...$,isPositioned:!1})))},[u]);const b=M.useRef(!1);Co(()=>(b.current=!0,()=>{b.current=!1}),[]),Co(()=>{if(k&&(A.current=k),z&&(N.current=z),k&&z){if(E.current)return E.current(k,z,S);S()}},[k,z,S,E,O]);const x=M.useMemo(()=>({reference:A,floating:N,setReference:w,setFloating:C}),[w,C]),F=M.useMemo(()=>({reference:k,floating:z}),[k,z]),I=M.useMemo(()=>{const $={position:t,left:0,top:0};if(!F.floating)return $;const D=xi(F.floating,_.x),B=xi(F.floating,_.y);return l?{...$,transform:"translate("+D+"px, "+B+"px)",...Ci(F.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:D,top:B}},[t,l,F.floating,_.x,_.y]);return M.useMemo(()=>({..._,update:S,refs:x,elements:F,floatingStyles:I}),[_,S,x,F,I])}const Pd=e=>{function n(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:e,fn(t){const{element:o,padding:a}=typeof e=="function"?e(t):e;return o&&n(o)?o.current!=null?yi({element:o.current,padding:a}).fn(t):{}:o?yi({element:o,padding:a}).fn(t):{}}}},$o=(e,n)=>({...Ed(e),options:[e,n]}),So=(e,n)=>({...Md(e),options:[e,n]}),ko=(e,n)=>({...Id(e),options:[e,n]}),$i=(e,n)=>({...Fd(e),options:[e,n]}),Td=(e,n)=>({...Pd(e),options:[e,n]});function Si(e){const n=M.useRef(void 0),t=M.useCallback(o=>{const a=e.map(i=>{if(i!=null){if(typeof i=="function"){const s=i,l=s(o);return typeof l=="function"?l:()=>{s(null)}}return i.current=o,()=>{i.current=null}}});return()=>{a.forEach(i=>i?.())}},e);return M.useMemo(()=>e.every(o=>o==null)?null:o=>{n.current&&(n.current(),n.current=void 0),o!=null&&(n.current=t(o))},e)}const Od="data-floating-ui-focusable",ki="active",Ni="selected",Vn="ArrowLeft",Bn="ArrowRight",Ei="ArrowUp",No="ArrowDown",Vd={...M};let Mi=!1,Bd=0;const Ii=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Bd++;function jd(){const[e,n]=M.useState(()=>Mi?Ii():void 0);return He(()=>{e==null&&n(Ii())},[]),M.useEffect(()=>{Mi=!0},[]),e}const jn=Vd.useId||jd;let qn;process.env.NODE_ENV!=="production"&&(qn=new Set);function Eo(){for(var e,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];const a="Floating UI: "+t.join(" ");if(!((e=qn)!=null&&e.has(a))){var i;(i=qn)==null||i.add(a),console.warn(a)}}function qd(){for(var e,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];const a="Floating UI: "+t.join(" ");if(!((e=qn)!=null&&e.has(a))){var i;(i=qn)==null||i.add(a),console.error(a)}}const Hd=M.forwardRef(function(n,t){const{context:{placement:o,elements:{floating:a},middlewareData:{arrow:i,shift:s}},width:l=14,height:c=7,tipRadius:u=0,strokeWidth:_=0,staticOffset:g,stroke:f,d,style:{transform:m,...p}={},...v}=n;process.env.NODE_ENV!=="production"&&(t||Eo("The `ref` prop is required for `FloatingArrow`."));const y=jn(),[w,C]=M.useState(!1);if(He(()=>{if(!a)return;Ct(a).direction==="rtl"&&C(!0)},[a]),!a)return null;const[k,z]=o.split("-"),A=k==="top"||k==="bottom";let N=g;(A&&s!=null&&s.x||!A&&s!=null&&s.y)&&(N=null);const P=_*2,O=P/2,E=l/2*(u/-8+1),T=c/2*u/4,V=!!d,S=N&&z==="end"?"bottom":"top";let b=N&&z==="end"?"right":"left";N&&w&&(b=z==="end"?"left":"right");const x=i?.x!=null?N||i.x:"",F=i?.y!=null?N||i.y:"",I=d||"M0,0"+(" H"+l)+(" L"+(l-E)+","+(c-T))+(" Q"+l/2+","+c+" "+E+","+(c-T))+" Z",$={top:V?"rotate(180deg)":"",left:V?"rotate(90deg)":"rotate(-90deg)",bottom:V?"":"rotate(180deg)",right:V?"rotate(-90deg)":"rotate(90deg)"}[k];return r.jsxs("svg",{...v,"aria-hidden":!0,ref:t,width:V?l:l+P,height:l,viewBox:"0 0 "+l+" "+(c>l?c:l),style:{position:"absolute",pointerEvents:"none",[b]:x,[S]:F,[k]:A||V?"100%":"calc(100% - "+P/2+"px)",transform:[$,m].filter(D=>!!D).join(" "),...p},children:[P>0&&r.jsx("path",{clipPath:"url(#"+y+")",fill:"none",stroke:f,strokeWidth:P+(d?0:1),d:I}),r.jsx("path",{stroke:P&&!d?v.fill:"none",d:I}),r.jsx("clipPath",{id:y,children:r.jsx("rect",{x:-O,y:O*(V?-1:1),width:l+P,height:l})})]})});function Fi(){const e=new Map;return{emit(n,t){var o;(o=e.get(n))==null||o.forEach(a=>a(t))},on(n,t){e.has(n)||e.set(n,new Set),e.get(n).add(t)},off(n,t){var o;(o=e.get(n))==null||o.delete(t)}}}const zi=M.createContext(null),Li=M.createContext(null),xn=()=>{var e;return((e=M.useContext(zi))==null?void 0:e.id)||null},cn=()=>M.useContext(Li);function Ai(e){const n=jn(),t=cn(),a=xn();return He(()=>{if(!n)return;const i={id:n,parentId:a};return t?.addNode(i),()=>{t?.removeNode(i)}},[t,n,a]),n}function Di(e){const{children:n,id:t}=e,o=xn();return r.jsx(zi.Provider,{value:M.useMemo(()=>({id:t,parentId:o}),[t,o]),children:n})}function Wd(e){const{children:n}=e,t=M.useRef([]),o=M.useCallback(s=>{t.current=[...t.current,s]},[]),a=M.useCallback(s=>{t.current=t.current.filter(l=>l!==s)},[]),[i]=M.useState(()=>Fi());return r.jsx(Li.Provider,{value:M.useMemo(()=>({nodesRef:t,addNode:o,removeNode:a,events:i}),[o,a,i]),children:n})}function dn(e){return"data-floating-ui-"+e}function _t(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Pi=dn("safe-polygon");function zr(e,n,t){if(t&&!Dn(t))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[n]}return e?.[n]}function Lr(e){return typeof e=="function"?e():e}function Ar(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,dataRef:a,events:i,elements:s}=e,{enabled:l=!0,delay:c=0,handleClose:u=null,mouseOnly:_=!1,restMs:g=0,move:f=!0}=n,d=cn(),m=xn(),p=st(u),v=st(c),y=st(t),w=st(g),C=M.useRef(),k=M.useRef(-1),z=M.useRef(),A=M.useRef(-1),N=M.useRef(!0),P=M.useRef(!1),O=M.useRef(()=>{}),E=M.useRef(!1),T=nt(()=>{var I;const $=(I=a.current.openEvent)==null?void 0:I.type;return $?.includes("mouse")&&$!=="mousedown"});M.useEffect(()=>{if(!l)return;function I($){let{open:D}=$;D||(_t(k),_t(A),N.current=!0,E.current=!1)}return i.on("openchange",I),()=>{i.off("openchange",I)}},[l,i]),M.useEffect(()=>{if(!l||!p.current||!t)return;function I(D){T()&&o(!1,D,"hover")}const $=dt(s.floating).documentElement;return $.addEventListener("mouseleave",I),()=>{$.removeEventListener("mouseleave",I)}},[s.floating,t,o,l,p,T]);const V=M.useCallback(function(I,$,D){$===void 0&&($=!0),D===void 0&&(D="hover");const B=zr(v.current,"close",C.current);B&&!z.current?(_t(k),k.current=window.setTimeout(()=>o(!1,I,D),B)):$&&(_t(k),o(!1,I,D))},[v,o]),S=nt(()=>{O.current(),z.current=void 0}),b=nt(()=>{if(P.current){const I=dt(s.floating).body;I.style.pointerEvents="",I.removeAttribute(Pi),P.current=!1}}),x=nt(()=>a.current.openEvent?["click","mousedown"].includes(a.current.openEvent.type):!1);M.useEffect(()=>{if(!l)return;function I(U){if(_t(k),N.current=!1,_&&!Dn(C.current)||Lr(w.current)>0&&!zr(v.current,"open"))return;const L=zr(v.current,"open",C.current);L?k.current=window.setTimeout(()=>{y.current||o(!0,U,"hover")},L):t||o(!0,U,"hover")}function $(U){if(x()){b();return}O.current();const L=dt(s.floating);if(_t(A),E.current=!1,p.current&&a.current.floatingContext){t||_t(k),z.current=p.current({...a.current.floatingContext,tree:d,x:U.clientX,y:U.clientY,onClose(){b(),S(),x()||V(U,!0,"safe-polygon")}});const W=z.current;L.addEventListener("mousemove",W),O.current=()=>{L.removeEventListener("mousemove",W)};return}(C.current==="touch"?!ct(s.floating,U.relatedTarget):!0)&&V(U)}function D(U){x()||a.current.floatingContext&&(p.current==null||p.current({...a.current.floatingContext,tree:d,x:U.clientX,y:U.clientY,onClose(){b(),S(),x()||V(U)}})(U))}function B(){_t(k)}function X(U){x()||V(U,!1)}if(qe(s.domReference)){const U=s.domReference,L=s.floating;return t&&U.addEventListener("mouseleave",D),f&&U.addEventListener("mousemove",I,{once:!0}),U.addEventListener("mouseenter",I),U.addEventListener("mouseleave",$),L&&(L.addEventListener("mouseleave",D),L.addEventListener("mouseenter",B),L.addEventListener("mouseleave",X)),()=>{t&&U.removeEventListener("mouseleave",D),f&&U.removeEventListener("mousemove",I),U.removeEventListener("mouseenter",I),U.removeEventListener("mouseleave",$),L&&(L.removeEventListener("mouseleave",D),L.removeEventListener("mouseenter",B),L.removeEventListener("mouseleave",X))}}},[s,l,e,_,f,V,S,b,o,t,y,d,v,p,a,x,w]),He(()=>{var I;if(l&&t&&(I=p.current)!=null&&(I=I.__options)!=null&&I.blockPointerEvents&&T()){P.current=!0;const D=s.floating;if(qe(s.domReference)&&D){var $;const B=dt(s.floating).body;B.setAttribute(Pi,"");const X=s.domReference,U=d==null||($=d.nodesRef.current.find(L=>L.id===m))==null||($=$.context)==null?void 0:$.elements.floating;return U&&(U.style.pointerEvents=""),B.style.pointerEvents="none",X.style.pointerEvents="auto",D.style.pointerEvents="auto",()=>{B.style.pointerEvents="",X.style.pointerEvents="",D.style.pointerEvents=""}}}},[l,t,m,s,d,p,T]),He(()=>{t||(C.current=void 0,E.current=!1,S(),b())},[t,S,b]),M.useEffect(()=>()=>{S(),_t(k),_t(A),b()},[l,s.domReference,S,b]);const F=M.useMemo(()=>{function I($){C.current=$.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove($){const{nativeEvent:D}=$;function B(){!N.current&&!y.current&&o(!0,D,"hover")}_&&!Dn(C.current)||t||Lr(w.current)===0||E.current&&$.movementX**2+$.movementY**2<2||(_t(A),C.current==="touch"?B():(E.current=!0,A.current=window.setTimeout(B,Lr(w.current))))}}},[_,o,t,y,w]);return M.useMemo(()=>l?{reference:F}:{},[l,F])}let Ti=0;function un(e,n){n===void 0&&(n={});const{preventScroll:t=!1,cancelPrevious:o=!0,sync:a=!1}=n;o&&cancelAnimationFrame(Ti);const i=()=>e?.focus({preventScroll:t});a?i():Ti=requestAnimationFrame(i)}function Dr(e,n){if(!e||!n)return!1;const t=n.getRootNode==null?void 0:n.getRootNode();if(e.contains(n))return!0;if(t&&ao(t)){let o=n;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Gd(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Zd(e){return e?.ownerDocument||document}const $n={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Oi(e){return e==="inert"?$n.inert:e==="aria-hidden"?$n["aria-hidden"]:$n.none}let Mo=new WeakSet,Io={},Pr=0;const Ud=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Vi=e=>e&&(e.host||Vi(e.parentNode)),Kd=(e,n)=>n.map(t=>{if(e.contains(t))return t;const o=Vi(t);return e.contains(o)?o:null}).filter(t=>t!=null);function Xd(e,n,t,o){const a="data-floating-ui-inert",i=o?"inert":t?"aria-hidden":null,s=Kd(n,e),l=new Set,c=new Set(s),u=[];Io[a]||(Io[a]=new WeakMap);const _=Io[a];s.forEach(g),f(n),l.clear();function g(d){!d||l.has(d)||(l.add(d),d.parentNode&&g(d.parentNode))}function f(d){!d||c.has(d)||[].forEach.call(d.children,m=>{if(Kt(m)!=="script")if(l.has(m))f(m);else{const p=i?m.getAttribute(i):null,v=p!==null&&p!=="false",y=Oi(i),w=(y.get(m)||0)+1,C=(_.get(m)||0)+1;y.set(m,w),_.set(m,C),u.push(m),w===1&&v&&Mo.add(m),C===1&&m.setAttribute(a,""),!v&&i&&m.setAttribute(i,i==="inert"?"":"true")}})}return Pr++,()=>{u.forEach(d=>{const m=Oi(i),v=(m.get(d)||0)-1,y=(_.get(d)||0)-1;m.set(d,v),_.set(d,y),v||(!Mo.has(d)&&i&&d.removeAttribute(i),Mo.delete(d)),y||d.removeAttribute(a)}),Pr--,Pr||($n.inert=new WeakMap,$n["aria-hidden"]=new WeakMap,$n.none=new WeakMap,Mo=new WeakSet,Io={})}}function Bi(e,n,t){n===void 0&&(n=!1),t===void 0&&(t=!1);const o=Zd(e[0]).body;return Xd(e.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,n,t)}const Fo={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},zo=M.forwardRef(function(n,t){const[o,a]=M.useState();He(()=>{ei()&&a("button")},[]);const i={ref:t,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[dn("focus-guard")]:"",style:Fo};return r.jsx("span",{...n,...i})}),ji=M.createContext(null),qi=dn("portal");function Yd(e){e===void 0&&(e={});const{id:n,root:t}=e,o=jn(),a=Hi(),[i,s]=M.useState(null),l=M.useRef(null);return He(()=>()=>{i?.remove(),queueMicrotask(()=>{l.current=null})},[i]),He(()=>{if(!o||l.current)return;const c=n?document.getElementById(n):null;if(!c)return;const u=document.createElement("div");u.id=o,u.setAttribute(qi,""),c.appendChild(u),l.current=u,s(u)},[n,o]),He(()=>{if(t===null||!o||l.current)return;let c=t||a?.portalNode;c&&!_r(c)&&(c=c.current),c=c||document.body;let u=null;n&&(u=document.createElement("div"),u.id=n,c.appendChild(u));const _=document.createElement("div");_.id=o,_.setAttribute(qi,""),c=u||c,c.appendChild(_),l.current=_,s(_)},[n,t,o,a]),i}function Lo(e){const{children:n,id:t,root:o,preserveTabOrder:a=!0}=e,i=Yd({id:t,root:o}),[s,l]=M.useState(null),c=M.useRef(null),u=M.useRef(null),_=M.useRef(null),g=M.useRef(null),f=s?.modal,d=s?.open,m=!!s&&!s.modal&&s.open&&a&&!!(o||i);return M.useEffect(()=>{if(!i||!a||f)return;function p(v){i&&On(v)&&(v.type==="focusin"?di:od)(i)}return i.addEventListener("focusin",p,!0),i.addEventListener("focusout",p,!0),()=>{i.removeEventListener("focusin",p,!0),i.removeEventListener("focusout",p,!0)}},[i,a,f]),M.useEffect(()=>{i&&(d||di(i))},[d,i]),r.jsxs(ji.Provider,{value:M.useMemo(()=>({preserveTabOrder:a,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:_,afterInsideRef:g,portalNode:i,setFocusManagerState:l}),[a,i]),children:[m&&i&&r.jsx(zo,{"data-type":"outside",ref:c,onFocus:p=>{if(On(p,i)){var v;(v=_.current)==null||v.focus()}else{const y=s?s.domReference:null,w=ci(y);w?.focus()}}}),m&&i&&r.jsx("span",{"aria-owns":i.id,style:Fo}),i&&ar.createPortal(n,i),m&&i&&r.jsx(zo,{"data-type":"outside",ref:u,onFocus:p=>{if(On(p,i)){var v;(v=g.current)==null||v.focus()}else{const y=s?s.domReference:null,w=li(y);w?.focus(),s?.closeOnFocusOut&&s?.onOpenChange(!1,p.nativeEvent,"focus-out")}}})]})}const Hi=()=>M.useContext(ji);function Wi(e){return M.useMemo(()=>n=>{e.forEach(t=>{t&&(t.current=n)})},e)}const Jd=20;let Qt=[];function Tr(){Qt=Qt.filter(e=>e.isConnected)}function Qd(e){Tr(),e&&Kt(e)!=="body"&&(Qt.push(e),Qt.length>Jd&&(Qt=Qt.slice(-20)))}function Gi(){return Tr(),Qt[Qt.length-1]}function Rd(e){const n=Tn();return Ja(e,n)?e:ho(e,n)[0]||e}function Zi(e,n){var t;if(!n.current.includes("floating")&&!((t=e.getAttribute("role"))!=null&&t.includes("dialog")))return;const o=Tn(),i=Bc(e,o).filter(l=>{const c=l.getAttribute("data-tabindex")||"";return Ja(l,o)||l.hasAttribute("data-tabindex")&&!c.startsWith("-")}),s=e.getAttribute("tabindex");n.current.includes("floating")||i.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const eu=M.forwardRef(function(n,t){return r.jsx("button",{...n,type:"button",ref:t,tabIndex:-1,style:Fo})});function Or(e){const{context:n,children:t,disabled:o=!1,order:a=["content"],guards:i=!0,initialFocus:s=0,returnFocus:l=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:_=!1,closeOnFocusOut:g=!0,outsideElementsInert:f=!1,getInsideElements:d=()=>[]}=e,{open:m,onOpenChange:p,events:v,dataRef:y,elements:{domReference:w,floating:C}}=n,k=nt(()=>{var R;return(R=y.current.floatingContext)==null?void 0:R.nodeId}),z=nt(d),A=typeof s=="number"&&s<0,N=kr(w)&&A,P=Ud(),O=P?i:!0,E=!O||P&&f,T=st(a),V=st(s),S=st(l),b=cn(),x=Hi(),F=M.useRef(null),I=M.useRef(null),$=M.useRef(!1),D=M.useRef(!1),B=M.useRef(-1),X=M.useRef(-1),U=x!=null,L=mo(C),j=nt(function(R){return R===void 0&&(R=L),R?ho(R,Tn()):[]}),W=nt(R=>{const se=j(R);return T.current.map(_e=>w&&_e==="reference"?w:L&&_e==="floating"?L:se).filter(Boolean).flat()});M.useEffect(()=>{if(o||!u)return;function R(_e){if(_e.key==="Tab"){ct(L,Dt(dt(L)))&&j().length===0&&!N&&ut(_e);const Se=W(),ge=Ht(_e);T.current[0]==="reference"&&ge===w&&(ut(_e),_e.shiftKey?un(Se[Se.length-1]):un(Se[1])),T.current[1]==="floating"&&ge===L&&_e.shiftKey&&(ut(_e),un(Se[0]))}}const se=dt(L);return se.addEventListener("keydown",R),()=>{se.removeEventListener("keydown",R)}},[o,w,L,u,T,N,j,W]),M.useEffect(()=>{if(o||!C)return;function R(se){const _e=Ht(se),ge=j().indexOf(_e);ge!==-1&&(B.current=ge)}return C.addEventListener("focusin",R),()=>{C.removeEventListener("focusin",R)}},[o,C,j]),M.useEffect(()=>{if(o||!g)return;function R(){D.current=!0,setTimeout(()=>{D.current=!1})}function se(ge){const le=ge.relatedTarget,he=ge.currentTarget,G=Ht(ge);queueMicrotask(()=>{const Y=k(),ce=!(ct(w,le)||ct(C,le)||ct(le,C)||ct(x?.portalNode,le)||le!=null&&le.hasAttribute(dn("focus-guard"))||b&&(sn(b.nodesRef.current,Y).find(K=>{var q,H;return ct((q=K.context)==null?void 0:q.elements.floating,le)||ct((H=K.context)==null?void 0:H.elements.domReference,le)})||oi(b.nodesRef.current,Y).find(K=>{var q,H,de;return[(q=K.context)==null?void 0:q.elements.floating,mo((H=K.context)==null?void 0:H.elements.floating)].includes(le)||((de=K.context)==null?void 0:de.elements.domReference)===le})));if(he===w&&L&&Zi(L,T),c&&he!==w&&!(G!=null&&G.isConnected)&&Dt(dt(L))===dt(L).body){tt(L)&&L.focus();const K=B.current,q=j(),H=q[K]||q[q.length-1]||L;tt(H)&&H.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(N||!u)&&le&&ce&&!D.current&&le!==Gi()&&($.current=!0,p(!1,ge,"focus-out"))})}const _e=!!(!b&&x);function Se(){_t(X),y.current.insideReactTree=!0,X.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}if(C&&tt(w))return w.addEventListener("focusout",se),w.addEventListener("pointerdown",R),C.addEventListener("focusout",se),_e&&C.addEventListener("focusout",Se,!0),()=>{w.removeEventListener("focusout",se),w.removeEventListener("pointerdown",R),C.removeEventListener("focusout",se),_e&&C.removeEventListener("focusout",Se,!0)}},[o,w,C,L,u,b,x,p,g,c,j,N,k,T,y]);const ie=M.useRef(null),re=M.useRef(null),ae=Wi([ie,x?.beforeInsideRef]),me=Wi([re,x?.afterInsideRef]);M.useEffect(()=>{var R,se;if(o||!C)return;const _e=Array.from((x==null||(R=x.portalNode)==null?void 0:R.querySelectorAll("["+dn("portal")+"]"))||[]),ge=(se=(b?oi(b.nodesRef.current,k()):[]).find(G=>{var Y;return kr(((Y=G.context)==null?void 0:Y.elements.domReference)||null)}))==null||(se=se.context)==null?void 0:se.elements.domReference,le=[C,ge,..._e,...z(),F.current,I.current,ie.current,re.current,x?.beforeOutsideRef.current,x?.afterOutsideRef.current,T.current.includes("reference")||N?w:null].filter(G=>G!=null),he=u||N?Bi(le,!E,E):Bi(le);return()=>{he()}},[o,w,C,u,T,x,N,O,E,b,k,z]),He(()=>{if(o||!tt(L))return;const R=dt(L),se=Dt(R);queueMicrotask(()=>{const _e=W(L),Se=V.current,ge=(typeof Se=="number"?_e[Se]:Se.current)||L,le=ct(L,se);!A&&!le&&m&&un(ge,{preventScroll:ge===L})})},[o,m,L,A,W,V]),He(()=>{if(o||!L)return;const R=dt(L),se=Dt(R);Qd(se);function _e(le){let{reason:he,event:G,nested:Y}=le;if(["hover","safe-polygon"].includes(he)&&G.type==="mouseleave"&&($.current=!0),he==="outside-press")if(Y)$.current=!1;else if(ri(G)||ai(G))$.current=!1;else{let ce=!1;document.createElement("div").focus({get preventScroll(){return ce=!0,!1}}),ce?$.current=!1:$.current=!0}}v.on("openchange",_e);const Se=R.createElement("span");Se.setAttribute("tabindex","-1"),Se.setAttribute("aria-hidden","true"),Object.assign(Se.style,Fo),U&&w&&w.insertAdjacentElement("afterend",Se);function ge(){if(typeof S.current=="boolean"){const le=w||Gi();return le&&le.isConnected?le:Se}return S.current.current||Se}return()=>{v.off("openchange",_e);const le=Dt(R),he=ct(C,le)||b&&sn(b.nodesRef.current,k(),!1).some(Y=>{var ce;return ct((ce=Y.context)==null?void 0:ce.elements.floating,le)}),G=ge();queueMicrotask(()=>{const Y=Rd(G);S.current&&!$.current&&tt(Y)&&(!(Y!==le&&le!==R.body)||he)&&Y.focus({preventScroll:!0}),Se.remove()})}},[o,C,L,S,y,v,b,U,w,k]),M.useEffect(()=>(queueMicrotask(()=>{$.current=!1}),()=>{queueMicrotask(Tr)}),[o]),He(()=>{if(!o&&x)return x.setFocusManagerState({modal:u,closeOnFocusOut:g,open:m,onOpenChange:p,domReference:w}),()=>{x.setFocusManagerState(null)}},[o,x,u,m,p,g,w]),He(()=>{o||L&&Zi(L,T)},[o,L,T]);function ee(R){return o||!_||!u?null:r.jsx(eu,{ref:R==="start"?F:I,onClick:se=>p(!1,se.nativeEvent),children:typeof _=="string"?_:"Dismiss"})}const fe=!o&&O&&(u?!N:!0)&&(U||u);return r.jsxs(r.Fragment,{children:[fe&&r.jsx(zo,{"data-type":"inside",ref:ae,onFocus:R=>{if(u){const _e=W();un(a[0]==="reference"?_e[0]:_e[_e.length-1])}else if(x!=null&&x.preserveTabOrder&&x.portalNode)if($.current=!1,On(R,x.portalNode)){const _e=li(w);_e?.focus()}else{var se;(se=x.beforeOutsideRef.current)==null||se.focus()}}}),!N&&ee("start"),t,ee("end"),fe&&r.jsx(zo,{"data-type":"inside",ref:me,onFocus:R=>{if(u)un(W()[0]);else if(x!=null&&x.preserveTabOrder&&x.portalNode)if(g&&($.current=!0),On(R,x.portalNode)){const _e=ci(w);_e?.focus()}else{var se;(se=x.afterOutsideRef.current)==null||se.focus()}}})]})}function Ui(e){return tt(e.target)&&e.target.tagName==="BUTTON"}function tu(e){return tt(e.target)&&e.target.tagName==="A"}function Ki(e){return Sr(e)}function Xi(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,dataRef:a,elements:{domReference:i}}=e,{enabled:s=!0,event:l="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:_=!0,stickIfOpen:g=!0}=n,f=M.useRef(),d=M.useRef(!1),m=M.useMemo(()=>({onPointerDown(p){f.current=p.pointerType},onMouseDown(p){const v=f.current;p.button===0&&l!=="click"&&(Dn(v,!0)&&u||(t&&c&&(!(a.current.openEvent&&g)||a.current.openEvent.type==="mousedown")?o(!1,p.nativeEvent,"click"):(p.preventDefault(),o(!0,p.nativeEvent,"click"))))},onClick(p){const v=f.current;if(l==="mousedown"&&f.current){f.current=void 0;return}Dn(v,!0)&&u||(t&&c&&(!(a.current.openEvent&&g)||a.current.openEvent.type==="click")?o(!1,p.nativeEvent,"click"):o(!0,p.nativeEvent,"click"))},onKeyDown(p){f.current=void 0,!(p.defaultPrevented||!_||Ui(p))&&(p.key===" "&&!Ki(i)&&(p.preventDefault(),d.current=!0),!tu(p)&&p.key==="Enter"&&o(!(t&&c),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!_||Ui(p)||Ki(i)||p.key===" "&&d.current&&(d.current=!1,o(!(t&&c),p.nativeEvent,"click"))}}),[a,i,l,u,_,o,t,g,c]);return M.useMemo(()=>s?{reference:m}:{},[s,m])}const nu={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ou={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Yi=e=>{var n,t;return{escapeKey:typeof e=="boolean"?e:(n=e?.escapeKey)!=null?n:!1,outsidePress:typeof e=="boolean"?e:(t=e?.outsidePress)!=null?t:!0}};function Ao(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,elements:a,dataRef:i}=e,{enabled:s=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:_=!1,referencePressEvent:g="pointerdown",ancestorScroll:f=!1,bubbles:d,capture:m}=n,p=cn(),v=nt(typeof c=="function"?c:()=>!1),y=typeof c=="function"?v:c,w=M.useRef(!1),{escapeKey:C,outsidePress:k}=Yi(d),{escapeKey:z,outsidePress:A}=Yi(m),N=M.useRef(!1),P=nt(b=>{var x;if(!t||!s||!l||b.key!=="Escape"||N.current)return;const F=(x=i.current.floatingContext)==null?void 0:x.nodeId,I=p?sn(p.nodesRef.current,F):[];if(!C&&(b.stopPropagation(),I.length>0)){let $=!0;if(I.forEach(D=>{var B;if((B=D.context)!=null&&B.open&&!D.context.dataRef.current.__escapeKeyBubbles){$=!1;return}}),!$)return}o(!1,Kc(b)?b.nativeEvent:b,"escape-key")}),O=nt(b=>{var x;const F=()=>{var I;P(b),(I=Ht(b))==null||I.removeEventListener("keydown",F)};(x=Ht(b))==null||x.addEventListener("keydown",F)}),E=nt(b=>{var x;const F=i.current.insideReactTree;i.current.insideReactTree=!1;const I=w.current;if(w.current=!1,u==="click"&&I||F||typeof y=="function"&&!y(b))return;const $=Ht(b),D="["+dn("inert")+"]",B=dt(a.floating).querySelectorAll(D);let X=qe($)?$:null;for(;X&&!Bt(X);){const W=jt(X);if(Bt(W)||!qe(W))break;X=W}if(B.length&&qe($)&&!Gc($)&&!ct($,a.floating)&&Array.from(B).every(W=>!ct(X,W)))return;if(tt($)&&S){const W=Bt($),ie=Ct($),re=/auto|scroll/,ae=W||re.test(ie.overflowX),me=W||re.test(ie.overflowY),ee=ae&&$.clientWidth>0&&$.scrollWidth>$.clientWidth,fe=me&&$.clientHeight>0&&$.scrollHeight>$.clientHeight,R=ie.direction==="rtl",se=fe&&(R?b.offsetX<=$.offsetWidth-$.clientWidth:b.offsetX>$.clientWidth),_e=ee&&b.offsetY>$.clientHeight;if(se||_e)return}const U=(x=i.current.floatingContext)==null?void 0:x.nodeId,L=p&&sn(p.nodesRef.current,U).some(W=>{var ie;return $r(b,(ie=W.context)==null?void 0:ie.elements.floating)});if($r(b,a.floating)||$r(b,a.domReference)||L)return;const j=p?sn(p.nodesRef.current,U):[];if(j.length>0){let W=!0;if(j.forEach(ie=>{var re;if((re=ie.context)!=null&&re.open&&!ie.context.dataRef.current.__outsidePressBubbles){W=!1;return}}),!W)return}o(!1,b,"outside-press")}),T=nt(b=>{var x;const F=()=>{var I;E(b),(I=Ht(b))==null||I.removeEventListener(u,F)};(x=Ht(b))==null||x.addEventListener(u,F)});M.useEffect(()=>{if(!t||!s)return;i.current.__escapeKeyBubbles=C,i.current.__outsidePressBubbles=k;let b=-1;function x(B){o(!1,B,"ancestor-scroll")}function F(){window.clearTimeout(b),N.current=!0}function I(){b=window.setTimeout(()=>{N.current=!1},so()?5:0)}const $=dt(a.floating);l&&($.addEventListener("keydown",z?O:P,z),$.addEventListener("compositionstart",F),$.addEventListener("compositionend",I)),y&&$.addEventListener(u,A?T:E,A);let D=[];return f&&(qe(a.domReference)&&(D=Xt(a.domReference)),qe(a.floating)&&(D=D.concat(Xt(a.floating))),!qe(a.reference)&&a.reference&&a.reference.contextElement&&(D=D.concat(Xt(a.reference.contextElement)))),D=D.filter(B=>{var X;return B!==((X=$.defaultView)==null?void 0:X.visualViewport)}),D.forEach(B=>{B.addEventListener("scroll",x,{passive:!0})}),()=>{l&&($.removeEventListener("keydown",z?O:P,z),$.removeEventListener("compositionstart",F),$.removeEventListener("compositionend",I)),y&&$.removeEventListener(u,A?T:E,A),D.forEach(B=>{B.removeEventListener("scroll",x)}),window.clearTimeout(b)}},[i,a,l,y,u,t,o,f,s,C,k,P,z,O,E,A,T]),M.useEffect(()=>{i.current.insideReactTree=!1},[i,y,u]);const V=M.useMemo(()=>({onKeyDown:P,..._&&{[nu[g]]:b=>{o(!1,b.nativeEvent,"reference-press")},...g!=="click"&&{onClick(b){o(!1,b.nativeEvent,"reference-press")}}}}),[P,o,_,g]),S=M.useMemo(()=>({onKeyDown:P,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[ou[u]]:()=>{i.current.insideReactTree=!0}}),[P,u,i]);return M.useMemo(()=>s?{reference:V,floating:S}:{},[s,V,S])}function ru(e){const{open:n=!1,onOpenChange:t,elements:o}=e,a=jn(),i=M.useRef({}),[s]=M.useState(()=>Fi()),l=xn()!=null;if(process.env.NODE_ENV!=="production"){const d=o.reference;d&&!qe(d)&&qd("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,u]=M.useState(o.reference),_=nt((d,m,p)=>{i.current.openEvent=d?m:void 0,s.emit("openchange",{open:d,event:m,reason:p,nested:l}),t?.(d,m,p)}),g=M.useMemo(()=>({setPositionReference:u}),[]),f=M.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return M.useMemo(()=>({dataRef:i,open:n,onOpenChange:_,elements:f,events:s,floatingId:a,refs:g}),[n,_,f,s,a,g])}function Do(e){e===void 0&&(e={});const{nodeId:n}=e,t=ru({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||t,a=o.elements,[i,s]=M.useState(null),[l,c]=M.useState(null),_=a?.domReference||i,g=M.useRef(null),f=cn();He(()=>{_&&(g.current=_)},[_]);const d=Dd({...e,elements:{...a,...l&&{reference:l}}}),m=M.useCallback(C=>{const k=qe(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;c(k),d.refs.setReference(k)},[d.refs]),p=M.useCallback(C=>{(qe(C)||C===null)&&(g.current=C,s(C)),(qe(d.refs.reference.current)||d.refs.reference.current===null||C!==null&&!qe(C))&&d.refs.setReference(C)},[d.refs]),v=M.useMemo(()=>({...d.refs,setReference:p,setPositionReference:m,domReference:g}),[d.refs,p,m]),y=M.useMemo(()=>({...d.elements,domReference:_}),[d.elements,_]),w=M.useMemo(()=>({...d,...o,refs:v,elements:y,nodeId:n}),[d,v,y,n,o]);return He(()=>{o.dataRef.current.floatingContext=w;const C=f?.nodesRef.current.find(k=>k.id===n);C&&(C.context=w)}),M.useMemo(()=>({...d,context:w,refs:v,elements:y}),[d,v,y,w])}function Vr(){return jc()&&ei()}function au(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,events:a,dataRef:i,elements:s}=e,{enabled:l=!0,visibleOnly:c=!0}=n,u=M.useRef(!1),_=M.useRef(-1),g=M.useRef(!0);M.useEffect(()=>{if(!l)return;const d=vt(s.domReference);function m(){!t&&tt(s.domReference)&&s.domReference===Dt(dt(s.domReference))&&(u.current=!0)}function p(){g.current=!0}function v(){g.current=!1}return d.addEventListener("blur",m),Vr()&&(d.addEventListener("keydown",p,!0),d.addEventListener("pointerdown",v,!0)),()=>{d.removeEventListener("blur",m),Vr()&&(d.removeEventListener("keydown",p,!0),d.removeEventListener("pointerdown",v,!0))}},[s.domReference,t,l]),M.useEffect(()=>{if(!l)return;function d(m){let{reason:p}=m;(p==="reference-press"||p==="escape-key")&&(u.current=!0)}return a.on("openchange",d),()=>{a.off("openchange",d)}},[a,l]),M.useEffect(()=>()=>{_t(_)},[]);const f=M.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(d){if(u.current)return;const m=Ht(d.nativeEvent);if(c&&qe(m)){if(Vr()&&!d.relatedTarget){if(!g.current&&!Sr(m))return}else if(!Zc(m))return}o(!0,d.nativeEvent,"focus")},onBlur(d){u.current=!1;const m=d.relatedTarget,p=d.nativeEvent,v=qe(m)&&m.hasAttribute(dn("focus-guard"))&&m.getAttribute("data-type")==="outside";_.current=window.setTimeout(()=>{var y;const w=Dt(s.domReference?s.domReference.ownerDocument:document);!m&&w===s.domReference||ct((y=i.current.floatingContext)==null?void 0:y.refs.floating.current,w)||ct(s.domReference,w)||v||o(!1,p,"focus")})}}),[i,s.domReference,o,c]);return M.useMemo(()=>l?{reference:f}:{},[l,f])}function Br(e,n,t){const o=new Map,a=t==="item";let i=e;if(a&&e){const{[ki]:s,[Ni]:l,...c}=e;i=c}return{...t==="floating"&&{tabIndex:-1,[Od]:""},...i,...n.map(s=>{const l=s?s[t]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((s,l)=>(l&&Object.entries(l).forEach(c=>{let[u,_]=c;if(!(a&&[ki,Ni].includes(u)))if(u.indexOf("on")===0){if(o.has(u)||o.set(u,[]),typeof _=="function"){var g;(g=o.get(u))==null||g.push(_),s[u]=function(){for(var f,d=arguments.length,m=new Array(d),p=0;p<d;p++)m[p]=arguments[p];return(f=o.get(u))==null?void 0:f.map(v=>v(...m)).find(v=>v!==void 0)}}}else s[u]=_}),s),{})}}function Po(e){e===void 0&&(e=[]);const n=e.map(l=>l?.reference),t=e.map(l=>l?.floating),o=e.map(l=>l?.item),a=M.useCallback(l=>Br(l,e,"reference"),n),i=M.useCallback(l=>Br(l,e,"floating"),t),s=M.useCallback(l=>Br(l,e,"item"),o);return M.useMemo(()=>({getReferenceProps:a,getFloatingProps:i,getItemProps:s}),[a,i,s])}const iu="Escape";function To(e,n,t){switch(e){case"vertical":return n;case"horizontal":return t;default:return n||t}}function Oo(e,n){return To(n,e===Ei||e===No,e===Vn||e===Bn)}function jr(e,n,t){return To(n,e===No,t?e===Vn:e===Bn)||e==="Enter"||e===" "||e===""}function Ji(e,n,t){return To(n,t?e===Vn:e===Bn,e===No)}function Qi(e,n,t,o){const a=t?e===Bn:e===Vn,i=e===Ei;return n==="both"||n==="horizontal"&&o&&o>1?e===iu:To(n,a,i)}function qr(e,n){const{open:t,onOpenChange:o,elements:a,floatingId:i}=e,{listRef:s,activeIndex:l,onNavigate:c=()=>{},enabled:u=!0,selectedIndex:_=null,allowEscape:g=!1,loop:f=!1,nested:d=!1,rtl:m=!1,virtual:p=!1,focusItemOnOpen:v="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:w=!0,disabledIndices:C=void 0,orientation:k="vertical",parentOrientation:z,cols:A=1,scrollItemIntoView:N=!0,virtualItemRef:P,itemSizes:O,dense:E=!1}=n;process.env.NODE_ENV!=="production"&&(g&&(f||Eo("`useListNavigation` looping must be enabled to allow escaping."),p||Eo("`useListNavigation` must be virtual to allow escaping.")),k==="vertical"&&A>1&&Eo("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const T=mo(a.floating),V=st(T),S=xn(),b=cn();He(()=>{e.dataRef.current.orientation=k},[e,k]);const x=nt(()=>{c($.current===-1?null:$.current)}),F=kr(a.domReference),I=M.useRef(v),$=M.useRef(_??-1),D=M.useRef(null),B=M.useRef(!0),X=M.useRef(x),U=M.useRef(!!a.floating),L=M.useRef(t),j=M.useRef(!1),W=M.useRef(!1),ie=st(C),re=st(t),ae=st(N),me=st(_),[ee,fe]=M.useState(),[R,se]=M.useState(),_e=nt(()=>{function K(te){if(p){var pe;(pe=te.id)!=null&&pe.endsWith("-fui-option")&&(te.id=i+"-"+Math.random().toString(16).slice(2,10)),fe(te.id),b?.events.emit("virtualfocus",te),P&&(P.current=te)}else un(te,{sync:j.current,preventScroll:!0})}const q=s.current[$.current],H=W.current;q&&K(q),(j.current?te=>te():requestAnimationFrame)(()=>{const te=s.current[$.current]||q;if(!te)return;q||K(te);const pe=ae.current;pe&&ge&&(H||!B.current)&&(te.scrollIntoView==null||te.scrollIntoView(typeof pe=="boolean"?{block:"nearest",inline:"nearest"}:pe))})});He(()=>{u&&(t&&a.floating?I.current&&_!=null&&(W.current=!0,$.current=_,x()):U.current&&($.current=-1,X.current()))},[u,t,a.floating,_,x]),He(()=>{if(u&&t&&a.floating)if(l==null){if(j.current=!1,me.current!=null)return;if(U.current&&($.current=-1,_e()),(!L.current||!U.current)&&I.current&&(D.current!=null||I.current===!0&&D.current==null)){let K=0;const q=()=>{s.current[0]==null?(K<2&&(K?requestAnimationFrame:queueMicrotask)(q),K++):($.current=D.current==null||jr(D.current,k,m)||d?Nr(s,ie.current):ii(s,ie.current),D.current=null,x())};q()}}else Pn(s,l)||($.current=l,_e(),W.current=!1)},[u,t,a.floating,l,me,d,s,k,m,x,_e,ie]),He(()=>{var K;if(!u||a.floating||!b||p||!U.current)return;const q=b.nodesRef.current,H=(K=q.find(pe=>pe.id===S))==null||(K=K.context)==null?void 0:K.elements.floating,de=Dt(dt(a.floating)),te=q.some(pe=>pe.context&&ct(pe.context.elements.floating,de));H&&!te&&B.current&&H.focus({preventScroll:!0})},[u,a.floating,b,S,p]),He(()=>{if(!u||!b||!p||S)return;function K(q){se(q.id),P&&(P.current=q)}return b.events.on("virtualfocus",K),()=>{b.events.off("virtualfocus",K)}},[u,b,p,S,P]),He(()=>{X.current=x,L.current=t,U.current=!!a.floating}),He(()=>{t||(D.current=null,I.current=v)},[t,v]);const Se=l!=null,ge=M.useMemo(()=>{function K(H){if(!re.current)return;const de=s.current.indexOf(H);de!==-1&&$.current!==de&&($.current=de,x())}return{onFocus(H){let{currentTarget:de}=H;j.current=!0,K(de)},onClick:H=>{let{currentTarget:de}=H;return de.focus({preventScroll:!0})},onMouseMove(H){let{currentTarget:de}=H;j.current=!0,W.current=!1,y&&K(de)},onPointerLeave(H){let{pointerType:de}=H;if(!(!B.current||de==="touch")&&(j.current=!0,!!y&&($.current=-1,x(),!p))){var te;(te=V.current)==null||te.focus({preventScroll:!0})}}}},[re,V,y,s,x,p]),le=M.useCallback(()=>{var K;return z??(b==null||(K=b.nodesRef.current.find(q=>q.id===S))==null||(K=K.context)==null||(K=K.dataRef)==null?void 0:K.current.orientation)},[S,b,z]),he=nt(K=>{if(B.current=!1,j.current=!0,K.which===229||!re.current&&K.currentTarget===V.current)return;if(d&&Qi(K.key,k,m,A)){Oo(K.key,le())||ut(K),o(!1,K.nativeEvent,"list-navigation"),tt(a.domReference)&&(p?b?.events.emit("virtualfocus",a.domReference):a.domReference.focus());return}const q=$.current,H=Nr(s,C),de=ii(s,C);if(F||(K.key==="Home"&&(ut(K),$.current=H,x()),K.key==="End"&&(ut(K),$.current=de,x())),A>1){const te=O||Array.from({length:s.current.length},()=>({width:1,height:1})),pe=ed(te,A,E),Ye=pe.findIndex(Ne=>Ne!=null&&!bo(s,Ne,C)),Oe=pe.reduce((Ne,ot,Me)=>ot!=null&&!bo(s,ot,C)?Me:Ne,-1),Ae=pe[Rc({current:pe.map(Ne=>Ne!=null?s.current[Ne]:null)},{event:K,orientation:k,loop:f,rtl:m,cols:A,disabledIndices:nd([...(typeof C!="function"?C:null)||s.current.map((Ne,ot)=>bo(s,ot,C)?ot:void 0),void 0],pe),minIndex:Ye,maxIndex:Oe,prevIndex:td($.current>de?H:$.current,te,pe,A,K.key===No?"bl":K.key===(m?Vn:Bn)?"tr":"tl"),stopEvent:!0})];if(Ae!=null&&($.current=Ae,x()),k==="both")return}if(Oo(K.key,k)){if(ut(K),t&&!p&&Dt(K.currentTarget.ownerDocument)===K.currentTarget){$.current=jr(K.key,k,m)?H:de,x();return}jr(K.key,k,m)?f?$.current=q>=de?g&&q!==s.current.length?-1:H:ft(s,{startingIndex:q,disabledIndices:C}):$.current=Math.min(de,ft(s,{startingIndex:q,disabledIndices:C})):f?$.current=q<=H?g&&q!==-1?s.current.length:de:ft(s,{startingIndex:q,decrement:!0,disabledIndices:C}):$.current=Math.max(H,ft(s,{startingIndex:q,decrement:!0,disabledIndices:C})),Pn(s,$.current)&&($.current=-1),x()}}),G=M.useMemo(()=>p&&t&&Se&&{"aria-activedescendant":R||ee},[p,t,Se,R,ee]),Y=M.useMemo(()=>({"aria-orientation":k==="both"?void 0:k,...F?{}:G,onKeyDown:he,onPointerMove(){B.current=!0}}),[G,he,k,F]),ce=M.useMemo(()=>{function K(H){v==="auto"&&ri(H.nativeEvent)&&(I.current=!0)}function q(H){I.current=v,v==="auto"&&ai(H.nativeEvent)&&(I.current=!0)}return{...G,onKeyDown(H){B.current=!1;const de=H.key.startsWith("Arrow"),te=["Home","End"].includes(H.key),pe=de||te,Ye=Ji(H.key,k,m),Oe=Qi(H.key,k,m,A),Ae=Ji(H.key,le(),m),Ne=Oo(H.key,k),ot=(d?Ae:Ne)||H.key==="Enter"||H.key.trim()==="";if(p&&t){const be=b?.nodesRef.current.find(lt=>lt.parentId==null),Ge=b&&be?Uc(b.nodesRef.current,be.id):null;if(pe&&Ge&&P){const lt=new KeyboardEvent("keydown",{key:H.key,bubbles:!0});if(Ye||Oe){var Me,bt;const Ee=((Me=Ge.context)==null?void 0:Me.elements.domReference)===H.currentTarget,rt=Oe&&!Ee?(bt=Ge.context)==null?void 0:bt.elements.domReference:Ye?s.current.find(St=>St?.id===ee):null;rt&&(ut(H),rt.dispatchEvent(lt),se(void 0))}if((Ne||te)&&Ge.context&&Ge.context.open&&Ge.parentId&&H.currentTarget!==Ge.context.elements.domReference){var Te;ut(H),(Te=Ge.context.elements.domReference)==null||Te.dispatchEvent(lt);return}}return he(H)}if(!(!t&&!w&&de)){if(ot){const be=Oo(H.key,le());D.current=d&&be?null:H.key}if(d){Ae&&(ut(H),t?($.current=Nr(s,ie.current),x()):o(!0,H.nativeEvent,"list-navigation"));return}Ne&&(_!=null&&($.current=_),ut(H),!t&&w?o(!0,H.nativeEvent,"list-navigation"):he(H),t&&x())}},onFocus(){t&&!p&&($.current=-1,x())},onPointerDown:q,onPointerEnter:q,onMouseDown:K,onClick:K}},[ee,G,A,he,ie,v,s,d,x,o,t,w,k,le,m,_,b,p,P]);return M.useMemo(()=>u?{reference:ce,floating:Y,item:ge}:{},[u,ce,Y,ge])}const su=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Vo(e,n){var t,o;n===void 0&&(n={});const{open:a,elements:i,floatingId:s}=e,{enabled:l=!0,role:c="dialog"}=n,u=jn(),_=((t=i.domReference)==null?void 0:t.id)||u,g=M.useMemo(()=>{var w;return((w=mo(i.floating))==null?void 0:w.id)||s},[i.floating,s]),f=(o=su.get(c))!=null?o:c,m=xn()!=null,p=M.useMemo(()=>f==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:a?g:void 0}:{"aria-expanded":a?"true":"false","aria-haspopup":f==="alertdialog"?"dialog":f,"aria-controls":a?g:void 0,...f==="listbox"&&{role:"combobox"},...f==="menu"&&{id:_},...f==="menu"&&m&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[f,g,m,a,_,c]),v=M.useMemo(()=>{const w={id:g,...f&&{role:f}};return f==="tooltip"||c==="label"?w:{...w,...f==="menu"&&{"aria-labelledby":_}}},[f,g,_,c]),y=M.useCallback(w=>{let{active:C,selected:k}=w;const z={role:"option",...C&&{id:g+"-fui-option"}};switch(c){case"select":case"combobox":return{...z,"aria-selected":k}}return{}},[g,c]);return M.useMemo(()=>l?{reference:p,floating:v,item:y}:{},[l,p,v,y])}const Ri=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(n,t)=>(t?"-":"")+n.toLowerCase());function Sn(e,n){return typeof e=="function"?e(n):e}function lu(e,n){const[t,o]=M.useState(e);return e&&!t&&o(!0),M.useEffect(()=>{if(!e&&t){const a=setTimeout(()=>o(!1),n);return()=>clearTimeout(a)}},[e,t,n]),t}function cu(e,n){n===void 0&&(n={});const{open:t,elements:{floating:o}}=e,{duration:a=250}=n,s=(typeof a=="number"?a:a.close)||0,[l,c]=M.useState("unmounted"),u=lu(t,s);return!u&&l==="close"&&c("unmounted"),He(()=>{if(o){if(t){c("initial");const _=requestAnimationFrame(()=>{ar.flushSync(()=>{c("open")})});return()=>{cancelAnimationFrame(_)}}c("close")}},[t,o]),{isMounted:u,status:l}}function Bo(e,n){n===void 0&&(n={});const{initial:t={opacity:0},open:o,close:a,common:i,duration:s=250}=n,l=e.placement,c=l.split("-")[0],u=M.useMemo(()=>({side:c,placement:l}),[c,l]),_=typeof s=="number",g=(_?s:s.open)||0,f=(_?s:s.close)||0,[d,m]=M.useState(()=>({...Sn(i,u),...Sn(t,u)})),{isMounted:p,status:v}=cu(e,{duration:s}),y=st(t),w=st(o),C=st(a),k=st(i);return He(()=>{const z=Sn(y.current,u),A=Sn(C.current,u),N=Sn(k.current,u),P=Sn(w.current,u)||Object.keys(z).reduce((O,E)=>(O[E]="",O),{});if(v==="initial"&&m(O=>({transitionProperty:O.transitionProperty,...N,...z})),v==="open"&&m({transitionProperty:Object.keys(P).map(Ri).join(","),transitionDuration:g+"ms",...N,...P}),v==="close"){const O=A||z;m({transitionProperty:Object.keys(O).map(Ri).join(","),transitionDuration:f+"ms",...N,...O})}},[f,C,y,w,k,g,v,u]),{isMounted:p,styles:d}}function es(e,n){var t;const{open:o,dataRef:a}=e,{listRef:i,activeIndex:s,onMatch:l,onTypingChange:c,enabled:u=!0,findMatch:_=null,resetMs:g=750,ignoreKeys:f=[],selectedIndex:d=null}=n,m=M.useRef(-1),p=M.useRef(""),v=M.useRef((t=d??s)!=null?t:-1),y=M.useRef(null),w=nt(l),C=nt(c),k=st(_),z=st(f);He(()=>{o&&(_t(m),y.current=null,p.current="")},[o]),He(()=>{if(o&&p.current===""){var E;v.current=(E=d??s)!=null?E:-1}},[o,d,s]);const A=nt(E=>{E?a.current.typing||(a.current.typing=E,C(E)):a.current.typing&&(a.current.typing=E,C(E))}),N=nt(E=>{function T(F,I,$){const D=k.current?k.current(I,$):I.find(B=>B?.toLocaleLowerCase().indexOf($.toLocaleLowerCase())===0);return D?F.indexOf(D):-1}const V=i.current;if(p.current.length>0&&p.current[0]!==" "&&(T(V,V,p.current)===-1?A(!1):E.key===" "&&ut(E)),V==null||z.current.includes(E.key)||E.key.length!==1||E.ctrlKey||E.metaKey||E.altKey)return;o&&E.key!==" "&&(ut(E),A(!0)),V.every(F=>{var I,$;return F?((I=F[0])==null?void 0:I.toLocaleLowerCase())!==(($=F[1])==null?void 0:$.toLocaleLowerCase()):!0})&&p.current===E.key&&(p.current="",v.current=y.current),p.current+=E.key,_t(m),m.current=window.setTimeout(()=>{p.current="",v.current=y.current,A(!1)},g);const b=v.current,x=T(V,[...V.slice((b||0)+1),...V.slice(0,(b||0)+1)],p.current);x!==-1?(w(x),y.current=x):E.key!==" "&&(p.current="",A(!1))}),P=M.useMemo(()=>({onKeyDown:N}),[N]),O=M.useMemo(()=>({onKeyDown:N,onKeyUp(E){E.key===" "&&A(!1)}}),[N,A]);return M.useMemo(()=>u?{reference:P,floating:O}:{},[u,P,O])}function ts(e,n,t){return t===void 0&&(t=!0),e.filter(a=>{var i;return a.parentId===n&&(!t||((i=a.context)==null?void 0:i.open))}).flatMap(a=>[a,...ts(e,a.id,t)])}function ns(e,n){const[t,o]=e;let a=!1;const i=n.length;for(let s=0,l=i-1;s<i;l=s++){const[c,u]=n[s]||[0,0],[_,g]=n[l]||[0,0];u>=o!=g>=o&&t<=(_-c)*(o-u)/(g-u)+c&&(a=!a)}return a}function du(e,n){return e[0]>=n.x&&e[0]<=n.x+n.width&&e[1]>=n.y&&e[1]<=n.y+n.height}function os(e){e===void 0&&(e={});const{buffer:n=.5,blockPointerEvents:t=!1,requireIntent:o=!0}=e,a={current:-1};let i=!1,s=null,l=null,c=typeof performance<"u"?performance.now():0;function u(g,f){const d=performance.now(),m=d-c;if(s===null||l===null||m===0)return s=g,l=f,c=d,null;const p=g-s,v=f-l,w=Math.sqrt(p*p+v*v)/m;return s=g,l=f,c=d,w}const _=g=>{let{x:f,y:d,placement:m,elements:p,onClose:v,nodeId:y,tree:w}=g;return function(k){function z(){_t(a),v()}if(_t(a),!p.domReference||!p.floating||m==null||f==null||d==null)return;const{clientX:A,clientY:N}=k,P=[A,N],O=Gd(k),E=k.type==="mouseleave",T=Dr(p.floating,O),V=Dr(p.domReference,O),S=p.domReference.getBoundingClientRect(),b=p.floating.getBoundingClientRect(),x=m.split("-")[0],F=f>b.right-b.width/2,I=d>b.bottom-b.height/2,$=du(P,S),D=b.width>S.width,B=b.height>S.height,X=(D?S:b).left,U=(D?S:b).right,L=(B?S:b).top,j=(B?S:b).bottom;if(T&&(i=!0,!E))return;if(V&&(i=!1),V&&!E){i=!0;return}if(E&&qe(k.relatedTarget)&&Dr(p.floating,k.relatedTarget)||w&&ts(w.nodesRef.current,y).length)return;if(x==="top"&&d>=S.bottom-1||x==="bottom"&&d<=S.top+1||x==="left"&&f>=S.right-1||x==="right"&&f<=S.left+1)return z();let W=[];switch(x){case"top":W=[[X,S.top+1],[X,b.bottom-1],[U,b.bottom-1],[U,S.top+1]];break;case"bottom":W=[[X,b.top+1],[X,S.bottom-1],[U,S.bottom-1],[U,b.top+1]];break;case"left":W=[[b.right-1,j],[b.right-1,L],[S.left+1,L],[S.left+1,j]];break;case"right":W=[[S.right-1,j],[S.right-1,L],[b.left+1,L],[b.left+1,j]];break}function ie(re){let[ae,me]=re;switch(x){case"top":{const ee=[D?ae+n/2:F?ae+n*4:ae-n*4,me+n+1],fe=[D?ae-n/2:F?ae+n*4:ae-n*4,me+n+1],R=[[b.left,F||D?b.bottom-n:b.top],[b.right,F?D?b.bottom-n:b.top:b.bottom-n]];return[ee,fe,...R]}case"bottom":{const ee=[D?ae+n/2:F?ae+n*4:ae-n*4,me-n],fe=[D?ae-n/2:F?ae+n*4:ae-n*4,me-n],R=[[b.left,F||D?b.top+n:b.bottom],[b.right,F?D?b.top+n:b.bottom:b.top+n]];return[ee,fe,...R]}case"left":{const ee=[ae+n+1,B?me+n/2:I?me+n*4:me-n*4],fe=[ae+n+1,B?me-n/2:I?me+n*4:me-n*4];return[...[[I||B?b.right-n:b.left,b.top],[I?B?b.right-n:b.left:b.right-n,b.bottom]],ee,fe]}case"right":{const ee=[ae-n,B?me+n/2:I?me+n*4:me-n*4],fe=[ae-n,B?me-n/2:I?me+n*4:me-n*4],R=[[I||B?b.left+n:b.right,b.top],[I?B?b.left+n:b.right:b.left+n,b.bottom]];return[ee,fe,...R]}}}if(!ns([A,N],W)){if(i&&!$)return z();if(!E&&o){const re=u(k.clientX,k.clientY);if(re!==null&&re<.1)return z()}ns([A,N],ie([f,d]))?!i&&o&&(a.current=window.setTimeout(z,40)):z()}}};return _.__options={blockPointerEvents:t},_}function kn(e,n,t){let o=t.initialDeps??[],a;function i(){var s,l,c,u;let _;t.key&&((s=t.debug)!=null&&s.call(t))&&(_=Date.now());const g=e();if(!(g.length!==o.length||g.some((m,p)=>o[p]!==m)))return a;o=g;let d;if(t.key&&((l=t.debug)!=null&&l.call(t))&&(d=Date.now()),a=n(...g),t.key&&((c=t.debug)!=null&&c.call(t))){const m=Math.round((Date.now()-_)*100)/100,p=Math.round((Date.now()-d)*100)/100,v=p/16,y=(w,C)=>{for(w=String(w);w.length<C;)w=" "+w;return w};console.info(`%c⏱ ${y(p,5)} /${y(m,5)} ms`,`
|
|
5
5
|
font-size: .6rem;
|
|
6
6
|
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 Vs(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const kd=(e,t)=>Math.abs(e-t)<1.01,Id=(e,t,n)=>{let o;return function(...r){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,r),n)}},js=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Ed=e=>e,Md=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},Nd=(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(js(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(js(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},qs={passive:!0},Bs=typeof window>"u"?!0:"onscrollend"in window,Fd=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;let r=0;const i=e.options.useScrollendEvent&&Bs?()=>{}:Id(o,()=>{t(r,!1)},e.options.isScrollingResetDelay),a=_=>()=>{const{horizontal:g,isRtl:f}=e.options;r=g?n.scrollLeft*(f&&-1||1):n.scrollTop,i(),t(r,_)},l=a(!0),d=a(!1);d(),n.addEventListener("scroll",l,qs);const u=e.options.useScrollendEvent&&Bs;return u&&n.addEventListener("scrollend",d,qs),()=>{n.removeEventListener("scroll",l),u&&n.removeEventListener("scrollend",d)}},Dd=(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"]},Ad=(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 Ld{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:Ed,rangeExtractor:Md,onChange:()=>{},measureElement:Dd,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var o,r;(r=(o=this.options).onChange)==null||r.call(o,this,n)},this.maybeNotify=vt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,o)=>{const r=new Map,i=new Map;for(let a=o-1;a>=0;a--){const l=n[a];if(r.has(l.lane))continue;const d=i.get(l.lane);if(d==null||l.end>d.end?i.set(l.lane,l):l.end<d.end&&r.set(l.lane,!0),r.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((a,l)=>a.end===l.end?a.index-l.index:a.end-l.end)[0]:void 0},this.getMeasurementOptions=vt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,o,r,i,a)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:a}),{key:!1}),this.getMeasurements=vt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:a},l)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(_=>{this.itemSizeCache.set(_.key,_.size)}));const d=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,d);for(let _=d;_<n;_++){const g=i(_),f=this.options.lanes===1?u[_-1]:this.getFurthestMeasurement(u,_),c=f?f.end+this.options.gap:o+r,h=l.get(g),p=typeof h=="number"?h:this.options.estimateSize(_),v=c+p,w=f?f.lane:_%this.options.lanes;u[_]={index:_,start:c,size:p,end:v,key:g,lane:w}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=vt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,o,r,i)=>this.range=n.length>0&&o>0?Pd({measurements:n,outerSize:o,scrollOffset:r,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=vt(()=>{let n=null,o=null;const r=this.calculateRange();return r&&(n=r.startIndex,o=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,o]},(n,o,r,i,a)=>i===null||a===null?[]:n({startIndex:i,endIndex:a,overscan:o,count:r}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const o=this.options.indexAttribute,r=n.getAttribute(o);return r?parseInt(r,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(n,o)=>{const r=this.indexFromElement(n),i=this.measurementsCache[r];if(!i)return;const a=i.key,l=this.elementsCache.get(a);l!==n&&(l&&this.observer.unobserve(l),this.observer.observe(n),this.elementsCache.set(a,n)),n.isConnected&&this.resizeItem(r,this.options.measureElement(n,o,this))},this.resizeItem=(n,o)=>{const r=this.measurementsCache[n];if(!r)return;const i=this.itemSizeCache.get(r.key)??r.size,a=o-i;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,a,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",a),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,o)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((o,r)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(r))});return}this._measureElement(n,void 0)},this.getVirtualItems=vt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,o)=>{const r=[];for(let i=0,a=n.length;i<a;i++){const l=n[i],d=o[l];r.push(d)}return r},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const o=this.getMeasurements();if(o.length!==0)return Vs(o[Hs(0,o.length-1,r=>Vs(o[r]).start,n)])},this.getOffsetForAlignment=(n,o,r=0)=>{const i=this.getSize(),a=this.getScrollOffset();o==="auto"&&(o=n>=a+i?"end":"start"),o==="center"?n+=(r-i)/2:o==="end"&&(n-=i);const l=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,o="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.measurementsCache[n];if(!r)return;const i=this.getSize(),a=this.getScrollOffset();if(o==="auto")if(r.end>=a+i-this.options.scrollPaddingEnd)o="end";else if(r.start<=a+this.options.scrollPaddingStart)o="start";else return[a,o];const l=o==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,o,r.size),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:o="start",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,o),{adjustments:void 0,behavior:r})},this.scrollToIndex=(n,{align:o="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let i=0;const a=10,l=u=>{if(!this.targetWindow)return;const _=this.getOffsetForIndex(n,u);if(!_){console.warn("Failed to get offset for index:",n);return}const[g,f]=_;this._scrollToOffset(g,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const c=this.getScrollOffset(),h=this.getOffsetForIndex(n,f);if(!h){console.warn("Failed to get offset for index:",n);return}kd(h[0],c)||d(f)})},d=u=>{this.targetWindow&&(i++,i<a?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,a),this.targetWindow.requestAnimationFrame(()=>l(u))):console.warn(`Failed to scroll to index ${n} after ${a} attempts.`))};l(o)},this.scrollBy=(n,{behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var n;const o=this.getMeasurements();let r;if(o.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((n=o[o.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let a=o.length-1;for(;a>=0&&i.some(l=>l===null);){const l=o[a];i[l.lane]===null&&(i[l.lane]=l.end),a--}r=Math.max(...i.filter(l=>l!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:o,behavior:r})=>{this.options.scrollToFn(n,{behavior:r,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const Hs=(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 Pd({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=Hs(0,r,i,n),l=a;if(o===1)for(;l<r&&e[l].end<n+t;)l++;else if(o>1){const d=Array(o).fill(0);for(;l<r&&d.some(_=>_<n+t);){const _=e[l];d[_.lane]=_.end,l++}const u=Array(o).fill(n+t);for(;a>=0&&u.some(_=>_>=n);){const _=e[a];u[_.lane]=_.start,a--}a=Math.max(0,a-a%o),l=Math.min(r,l+(o-1-l%o))}return{startIndex:a,endIndex:l}}const Gs=typeof document<"u"?M.useLayoutEffect:M.useEffect;function zd(e){const t=M.useReducer(()=>({}),{})[1],n={...e,onChange:(r,i)=>{var a;i?xt.flushSync(t):t(),(a=e.onChange)==null||a.call(e,r,i)}},[o]=M.useState(()=>new Ld(n));return o.setOptions(n),Gs(()=>o._didMount(),[]),Gs(()=>o._willUpdate()),o}function Td(e){return zd({observeElementRect:Nd,observeElementOffset:Fd,scrollToFn:Ad,...e})}function Od(e,t){const[n,o]=M.useState(e);return M.useEffect(()=>{const r=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(r)}},[e,t]),n}function No(e){const t=M.useCallback(r=>{const i=window.matchMedia(e);return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[e]),n=()=>window.matchMedia(e).matches,o=()=>{throw Error("useMediaQuery is a client-only hook")};return M.useSyncExternalStore(t,n,o)}function Ir(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function Pt(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function Fo(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function Ws(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function Ks(e,t,n,o){if(!t.trim())return e;const r=Ws(t.trim());return o?e.filter(i=>o(i,t)):e.filter(i=>Ws(Ir(i,n)).includes(r))}function Vd(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 jd(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 qd(e,t,n,o){return t.trim()?e.map(r=>({...r,opciones:Ks(r.opciones,t,n,o)})).filter(r=>r.opciones.length>0):e}function Bd(e){return e.map((t,n)=>t.tipo==="grupo"||t.datos&&Fo(t.datos)?n:null).filter(t=>t!==null)}function Hd(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 Gd(e,t,n){return e!==void 0?e:t==="invalid"?!0:t==="valid"?!1:!!n}function Wd(e,t="Opción"){return Array.from({length:e},(n,o)=>`${t} ${o+1}`)}function Kd(e){return Array.from({length:e},(t,n)=>({id:`usr-${n+1}`,nombre:`Usuario ${n+1}`,email:`usuario${n+1}@test.com`}))}const Us=({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"})}),Xs=({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"})]}),Ud=({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"})}),Xd=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",...t,children:[s.jsx("path",{fill:"currentColor",d:"M10 18a7.95 7.95 0 0 0 4.897-1.688l4.396 4.396l1.414-1.414l-4.396-4.396A7.95 7.95 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8s3.589 8 8 8m0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6s-6-2.691-6-6s2.691-6 6-6"}),s.jsx("path",{fill:"currentColor",d:"M11.412 8.586c.379.38.588.882.588 1.414h2a3.98 3.98 0 0 0-1.174-2.828c-1.514-1.512-4.139-1.512-5.652 0l1.412 1.416c.76-.758 2.07-.756 2.826-.002"})]}),Yd=({size:e="1em",...t})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:s.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),R={contenedor_base:"_contenedor_base_1uead_1",tam_sm:"_tam_sm_1uead_41",tam_lg:"_tam_lg_1uead_55",radio_none:"_radio_none_1uead_69",radio_sm:"_radio_sm_1uead_77",radio_md:"_radio_md_1uead_85",radio_lg:"_radio_lg_1uead_93",radio_full:"_radio_full_1uead_101",color_default:"_color_default_1uead_109",color_primary:"_color_primary_1uead_111",color_secondary:"_color_secondary_1uead_119",color_success:"_color_success_1uead_127",color_warning:"_color_warning_1uead_135",color_danger:"_color_danger_1uead_143",etiqueta:"_etiqueta_1uead_151",marca_requerido:"_marca_requerido_1uead_167",trigger:"_trigger_1uead_177",trigger_expandido:"_trigger_expandido_1uead_213",variante_bordered:"_variante_bordered_1uead_223",variante_faded:"_variante_faded_1uead_233",variante_underlined:"_variante_underlined_1uead_243",variante_ghost:"_variante_ghost_1uead_259",deshabilitado:"_deshabilitado_1uead_271",solo_lectura:"_solo_lectura_1uead_291",valor_texto:"_valor_texto_1uead_307",abierto:"_abierto_1uead_335",valido:"_valido_1uead_343",invalido:"_invalido_1uead_351",contenido_inicio:"_contenido_inicio_1uead_403",contenido_final:"_contenido_final_1uead_405",valor_wrapper:"_valor_wrapper_1uead_423",mostrar_todos:"_mostrar_todos_1uead_443",valor_wrapper_expandido:"_valor_wrapper_expandido_1uead_453",placeholder:"_placeholder_1uead_469",chip_multi:"_chip_multi_1uead_479",chip_texto:"_chip_texto_1uead_513",chip_cerrar:"_chip_cerrar_1uead_525",contador_multi:"_contador_multi_1uead_565",acciones:"_acciones_1uead_579",boton_limpiar:"_boton_limpiar_1uead_593",tiene_valor:"_tiene_valor_1uead_645",icono_chevron:"_icono_chevron_1uead_655",icono_spinner:"_icono_spinner_1uead_677",girarSpinner:"_girarSpinner_1uead_1",menu:"_menu_1uead_711",buscador_wrapper:"_buscador_wrapper_1uead_741",buscador_interno:"_buscador_interno_1uead_755",icono_buscar:"_icono_buscar_1uead_807",input_busqueda:"_input_busqueda_1uead_859",lista_opciones:"_lista_opciones_1uead_899",lista_virtual:"_lista_virtual_1uead_927",contenedor_virtual:"_contenedor_virtual_1uead_939",encabezado_grupo:"_encabezado_grupo_1uead_947",opcion_virtual:"_opcion_virtual_1uead_979",opcion:"_opcion_1uead_979",activo:"_activo_1uead_1023",seleccionado:"_seleccionado_1uead_1039",opcion_check:"_opcion_check_1uead_1079",opcion_contenido:"_opcion_contenido_1uead_1107",sin_resultados:"_sin_resultados_1uead_1123",descripcion:"_descripcion_1uead_1147",mensaje_error:"_mensaje_error_1uead_1159",ancho_total:"_ancho_total_1uead_1171",sin_animacion:"_sin_animacion_1uead_1179",contenedor_nativo:"_contenedor_nativo_1uead_1189",select_nativo:"_select_nativo_1uead_1197",input_validacion:"_input_validacion_1uead_1225"};function Rd(e){const{options:t=[],value:n,onChange:o,onValueChange:r,optionLabelKey:i="label",optionValueKey:a="id",label:l,placeholder:d="Seleccione una opción",description:u,errorMessage:_,isRequired:g=!1,isInvalid:f,id:c,name:h,classNames:p,startContent:v,endContent:w,esInvalido:y,estaDeshabilitadoReal:x,clasesBase:E,renderizarValorMostrado:A}=e,L=m.useId(),N=c??`select-nativo-${L}`,P=u?`${N}-desc`:void 0,z=y?`${N}-err`:void 0,I=m.useCallback(T=>Ir(T,i),[i]),V=m.useCallback(T=>Pt(T,a),[a]),j=m.useCallback(T=>{o?.(T),r?.(T)},[o,r]),$=m.useCallback(T=>{const F=T.target.value;if(!F){j(null);return}const C=t.find(k=>V(k)===F);C&&j(C)},[t,V,j]),b=typeof f=="string"?f:null,S=typeof _=="function"?_({invalido:y,mensaje:b}):_??b;return s.jsxs("div",{className:E,children:[l&&s.jsxs("label",{className:K(R.etiqueta,p?.label),htmlFor:N,children:[l,g&&s.jsx("span",{className:R.marca_requerido,children:"*"})]}),s.jsxs("div",{className:R.contenedor_nativo,children:[s.jsxs("div",{className:K(R.trigger,p?.trigger),children:[v&&s.jsx("span",{className:R.contenido_inicio,children:v}),s.jsx("div",{className:K(R.valor_wrapper,p?.value),children:A()}),s.jsxs("div",{className:R.acciones,children:[w&&s.jsx("span",{className:R.contenido_final,children:w}),s.jsx("span",{className:R.icono_chevron,children:s.jsx(Us,{size:"1em"})})]})]}),s.jsxs("select",{id:N,name:h,className:R.select_nativo,value:n?V(n):"",onChange:$,disabled:x,required:g,children:[s.jsx("option",{value:"",children:d}),t.map(T=>s.jsx("option",{value:V(T),disabled:Fo(T),children:I(T)},V(T)))]})]}),u&&!y&&s.jsx("div",{id:P,className:K(R.descripcion,p?.description),children:u}),y&&S&&s.jsx("div",{id:z,className:K(R.mensaje_error,p?.errorMessage),children:S})]})}const Zd="(max-width: 768px)",Jd=44,Er=320,Do=100,Qd=200,eu=5;function nu(e,t){const{options:n=[],value:o,defaultValue:r,onChange:i,onValueChange:a,optionLabelKey:l="label",optionValueKey:d="id",renderOption:u,renderValue:_,variant:g="bordered",color:f="default",size:c="md",radius:h="md",fullWidth:p=!0,disableAnimation:v=!1,label:w,placeholder:y="",description:x,errorMessage:E,emptyMessage:A="No hay opciones",noResultsMessage:L="Sin resultados",isRequired:N=!1,isDisabled:P=!1,isReadOnly:z=!1,isLoading:I=!1,isClearable:V=!0,isInvalid:j,validationState:$,isMultiple:b=!1,mostrarTodos:S=!1,isSearchable:T,isVirtualized:F=!1,estimatedOptionHeight:C=Jd,filterFn:k,validate:D,onOpen:O,onClose:H,onSearchChange:B,onClear:U,onFocus:X,onBlur:ge,id:ce,name:ie,className:pe,classNames:ue,style:ye,startContent:Z,endContent:oe,menuZIndex:te,portalContainer:ve}=e,se=m.useRef(null),Q=m.useRef([]),de=m.useRef(null),be=m.useRef(null),J=m.useId(),Ce=ce??`select-${J}`,W=No(Zd),q=T??!W,G=W&&!q&&!b,[fe,_e]=m.useState(!1),[he,Ze]=m.useState(null),[Ue,je]=m.useState(""),Le=o!==void 0,[Je,Se]=m.useState(r??null),me=Le?o:Je,we=P||I,Ve=m.useCallback(ee=>Ir(ee,l),[l]),Fe=m.useCallback(ee=>Pt(ee,d),[d]),yn=m.useMemo(()=>{const ee=new Set;if(!me)return ee;try{if(b&&Array.isArray(me))for(const De of me)ee.add(Pt(De,d));else me&&ee.add(Pt(me,d))}catch{}return ee},[me,b,d]),ne=m.useCallback(ee=>{try{return yn.has(Pt(ee,d))}catch{return!1}},[yn,d]),Me=m.useMemo(()=>Vd(n),[n]),We=m.useMemo(()=>{if(!q||!Ue.trim())return n;try{return Me?qd(n,Ue,l,k):Ks(n,Ue,l,k)}catch{return n}},[n,Ue,q,k,l,Me]),Pe=m.useMemo(()=>Me?jd(We):We.map((ee,De)=>({tipo:"opcion",datos:ee,indice:De})),[We,Me]),tn=m.useMemo(()=>Hd(me,D),[me,D]),cn=m.useMemo(()=>Gd(j,$,tn),[j,$,tn]),en=$==="valid"&&!cn,{refs:$n,floatingStyles:mn,context:Cn,placement:ei}=So({open:fe,onOpenChange:ee=>{we||z||(_e(ee),ee?(O?.(),je(""),Ze(null)):H?.())},strategy:"fixed",transform:!1,placement:"bottom-start",middleware:[_o(4),po({padding:8}),go({padding:8}),is({apply({rects:ee,elements:De}){Object.assign(De.floating.style,{width:`${ee.reference.width}px`})},padding:8})],whileElementsMounted:co}),qt=ei.startsWith("top"),{isMounted:ni,styles:ke}=Mo(Cn,{duration:v||Pe.length>Qd?0:200,initial:{opacity:0,transform:qt?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},open:{opacity:1,transform:"translateY(0) scale(1)"},close:{opacity:0,transform:qt?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},common:{transformOrigin:qt?"bottom":"top"}}),xe=Td({count:Pe.length,getScrollElement:()=>de.current,estimateSize:()=>C,overscan:eu,enabled:F&&fe&&Pe.length>Do}),Ke=Ns(Cn,{enabled:!we&&!z}),xn=xo(Cn),Dn=Eo(Cn,{role:"listbox"}),ct=m.useMemo(()=>{try{return Bd(Pe)}catch{return[]}},[Pe]),Bt=kr(Cn,{listRef:Q,activeIndex:he,onNavigate:Ze,loop:!0,virtual:F,focusItemOnHover:!q,disabledIndices:ct}),Ct=m.useRef([]);m.useEffect(()=>{Ct.current=Pe.map(ee=>ee.tipo==="opcion"&&ee.datos?Ve(ee.datos):null)},[Pe,Ve]);const jo=Ps(Cn,{listRef:Ct,activeIndex:he,onMatch:fe?Ze:void 0,enabled:!q}),{getReferenceProps:qo,getFloatingProps:Xf,getItemProps:Oa}=$o([Ke,xn,Dn,Bt,jo]),Zn=m.useCallback(ee=>{Le||Se(ee),i?.(ee),a?.(ee)},[Le,i,a]),Bo=m.useCallback(ee=>{if(!Fo(ee))if(b){const De=Array.isArray(me)?me:[],An=De.some(pn=>Fe(pn)===Fe(ee));Zn(An?De.filter(pn=>Fe(pn)!==Fe(ee)):[...De,ee])}else Zn(ee),_e(!1)},[b,me,Fe,Zn]),Yf=m.useCallback(ee=>{ee.stopPropagation(),Zn(b?[]:null),U?.(),se.current?.focus()},[b,Zn,U]),Va=m.useCallback((ee,De)=>{De.stopPropagation(),!(!b||!Array.isArray(me))&&Zn(me.filter(An=>Fe(An)!==Fe(ee)))},[b,me,Fe,Zn]),Rf=m.useCallback(ee=>{const De=ee.target.value;je(De),B?.(De),Ze(0)},[B]),Zf=m.useCallback(ee=>{if(ee.key==="Enter"&&he!==null){ee.preventDefault();const De=Pe[he];De?.tipo==="opcion"&&De.datos&&Bo(De.datos)}},[he,Pe,Bo]);m.useEffect(()=>{fe&&q&&requestAnimationFrame(()=>be.current?.focus())},[fe,q]),m.useEffect(()=>()=>{Q.current=[]},[Pe.length]),m.useImperativeHandle(t,()=>({focus:()=>se.current?.focus(),blur:()=>se.current?.blur(),open:()=>_e(!0),close:()=>_e(!1),clear:()=>Zn(b?[]:null)}));const Ho=b?Array.isArray(me)&&me.length>0:me!=null&&me!=="",ja=m.useCallback(()=>{if(_)return _(me??null);if(!Ho)return s.jsx("span",{className:R.placeholder,children:y});if(b&&Array.isArray(me)){if(me.length===0)return s.jsx("span",{className:R.placeholder,children:y});const ee=S?me:me.slice(0,2),De=S?0:Math.max(0,me.length-2);return s.jsxs(s.Fragment,{children:[ee.map(An=>s.jsxs("span",{className:R.chip_multi,children:[s.jsx("span",{className:R.chip_texto,children:Ve(An)}),!z&&!we&&s.jsx("button",{type:"button",className:R.chip_cerrar,onClick:pn=>Va(An,pn),children:s.jsx(Xs,{size:"1em"})})]},Fe(An))),De>0&&s.jsxs("span",{className:R.contador_multi,children:["+",De]})]})}return s.jsx("span",{className:R.valor_texto,children:Ve(me)})},[_,me,Ho,y,b,S,z,we,Fe,Ve,Va]),qa=m.useCallback((ee,De,An)=>{try{if(ee.tipo==="grupo")return s.jsx("li",{className:K(R.encabezado_grupo,F&&R.opcion_virtual),style:An,children:ee.nombreGrupo},`grupo-${ee.nombreGrupo}`);const pn=ee.datos;if(!pn)return null;const Ga=ne(pn),Wa=he===De,Jf=Fo(pn),Qf=u?u(pn,{isSelected:Ga,isActive:Wa}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:R.opcion_check,children:s.jsx(Ud,{size:"1em"})}),s.jsx("span",{className:R.opcion_contenido,children:Ve(pn)})]}),e_=Fe(pn);return s.jsx("li",{ref:n_=>{Q.current[De]=n_},className:K(R.opcion,F&&R.opcion_virtual,{[R.activo]:Wa,[R.seleccionado]:Ga,[R.deshabilitado]:Jf},ue?.option),style:An,...Oa({onClick:()=>Bo(pn)}),children:Qf},e_)}catch(pn){return console.error("Error rendering select item:",pn),null}},[F,he,ne,u,Ve,Fe,ue?.option,Oa,Bo]),Ba=typeof E=="function"?E({invalido:cn,mensaje:tn}):E??tn,Ha=K(R.contenedor_base,R[`variante_${g}`],R[`tam_${c}`],R[`radio_${h}`],R[`color_${f}`],{[R.ancho_total]:p,[R.sin_animacion]:v,[R.deshabilitado]:we,[R.solo_lectura]:z,[R.invalido]:cn,[R.valido]:en,[R.abierto]:fe,[R.tiene_valor]:Ho},ue?.base,pe);return G&&!Me?s.jsx(Rd,{...e,esInvalido:cn,estaDeshabilitadoReal:we,clasesBase:Ha,renderizarValorMostrado:ja}):s.jsxs("div",{className:Ha,style:ye,children:[w&&s.jsxs("label",{id:`${Ce}-label`,className:K(R.etiqueta,ue?.label),children:[w,N&&s.jsx("span",{className:R.marca_requerido,children:"*"})]}),s.jsxs("div",{ref:ee=>{$n.setReference(ee),se.current=ee},id:Ce,tabIndex:we?-1:0,className:K(R.trigger,S&&b&&R.trigger_expandido,ue?.trigger),"aria-labelledby":w?`${Ce}-label`:void 0,onFocus:X,onBlur:ge,...qo(),children:[Z&&s.jsx("span",{className:R.contenido_inicio,children:Z}),s.jsx("div",{className:K(R.valor_wrapper,S&&b&&R.mostrar_todos,S&&b&&R.valor_wrapper_expandido,ue?.value),children:ja()}),s.jsxs("div",{className:R.acciones,children:[V&&Ho&&!z&&!we&&s.jsx("button",{type:"button",className:K(R.boton_limpiar,ue?.clearButton),onClick:Yf,tabIndex:-1,children:s.jsx(Xs,{size:"1em"})}),oe&&s.jsx("span",{className:R.contenido_final,children:oe}),I?s.jsx("span",{className:R.icono_spinner,children:s.jsx(Yd,{size:"1em"})}):s.jsx("span",{className:R.icono_chevron,children:s.jsx(Us,{size:"1em"})})]})]}),(ie||N)&&s.jsx("input",{type:"text",name:ie,required:N,value:b&&Array.isArray(me)?me.map(Fe).join(","):me?Fe(me):"",onChange:()=>{},onFocus:ee=>ee.target.blur(),"aria-hidden":"true",className:R.input_validacion}),ni&&s.jsx(Co,{root:ve,children:s.jsx(Cr,{context:Cn,modal:!1,initialFocus:q?be:-1,children:s.jsxs("div",{ref:$n.setFloating,style:{...mn,...ke,zIndex:te??"var(--z-popover)"},className:K(R.menu,ue?.menu),...Xf(),children:[q&&s.jsx("div",{className:R.buscador_wrapper,children:s.jsxs("div",{className:R.buscador_interno,children:[s.jsx("span",{className:R.icono_buscar,children:s.jsx(Xd,{size:"1.6em"})}),s.jsx("input",{ref:be,type:"text",className:K(R.input_busqueda,ue?.searchInput),placeholder:"Buscar...",value:Ue,onChange:Rf,onKeyDown:Zf})]})}),s.jsx("ul",{ref:de,className:K(R.lista_opciones,F&&R.lista_virtual),style:{height:F&&Pe.length>Do?`${Er}px`:`${Math.min(Pe.length*C,Er)}px`,maxHeight:`${Er}px`,overflow:"auto",position:F&&Pe.length>Do?"relative":void 0},children:Pe.length===0?s.jsx("li",{className:R.sin_resultados,children:Ue?L:A}):F&&Pe.length>Do?s.jsx(s.Fragment,{children:s.jsx("div",{style:{height:`${xe.getTotalSize()}px`,position:"relative",width:"100%"},children:xe.getVirtualItems().map(ee=>{const De=Pe[ee.index];return De?s.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,width:"100%",height:`${ee.size}px`,transform:`translateY(${ee.start}px)`},children:qa(De,ee.index)},`virtual-${ee.index}`):null})})}):Pe.map((ee,De)=>qa(ee,De))})]})})}),x&&!cn&&s.jsx("div",{className:K(R.descripcion,ue?.description),children:x}),cn&&Ba&&s.jsx("div",{className:K(R.mensaje_error,ue?.errorMessage),children:Ba})]})}const tu=m.forwardRef(nu),Ys=m.memo(tu);Ys.displayName="SelectBase";function ou(e,t){const{options:n=[],value:o,onChange:r,onValueChange:i,optionValueKey:a,optionLabelKey:l="label",isMultiple:d=!1,devolverObjeto:u=!1,..._}=e,g=m.useMemo(()=>n.length>0&&typeof n[0]=="object",[n]),f=m.useMemo(()=>{if(!g||!a)return null;const p=new Map;for(const v of n)p.set(String(v[a]),v);return p},[n,a,g]),c=m.useMemo(()=>{if(o==null||!g||u)return o;const p=v=>f?.get(String(v));return d&&Array.isArray(o)?o.map(p).filter(v=>v!==void 0):p(o)??null},[o,f,d,u,g]),h=m.useCallback(p=>{const v=r||i;if(!v)return;if(p===null){v(d?[]:u||!g?null:"");return}if(u||!g){v(p);return}const w=y=>typeof y=="string"?y:y[a];v(d&&Array.isArray(p)?p.map(w):w(p))},[r,i,u,d,a,g]);return s.jsx(Ys,{..._,ref:t,options:n,value:c,onChange:h,optionValueKey:a,optionLabelKey:l,isMultiple:d})}const Rs=m.forwardRef(ou);Rs.displayName="Select";const zt={tooltip:"_tooltip_myw27_1",tooltip_positioner:"_tooltip_positioner_myw27_53",enterAnimation:"_enterAnimation_myw27_1",exitAnimation:"_exitAnimation_myw27_1",arrow:"_arrow_myw27_81",size_sm:"_size_sm_myw27_91",size_md:"_size_md_myw27_101",size_lg:"_size_lg_myw27_111",variant_default:"_variant_default_myw27_121",variant_dark:"_variant_dark_myw27_141",variant_light:"_variant_light_myw27_153",variant_brand:"_variant_brand_myw27_165",variant_success:"_variant_success_myw27_181",variant_warning:"_variant_warning_myw27_193",variant_danger:"_variant_danger_myw27_205",variant_info:"_variant_info_myw27_217",fadeOnly:"_fadeOnly_myw27_1"};function it({content:e,children:t,placement:n="top",variant:o="default",size:r="md",offset:i=8,delayShow:a=100,delayHide:l=0,isDisabled:d=!1,showArrow:u=!1,maxWidth:_="320px",isInteractive:g=!1,className:f="",onOpen:c,onClose:h,isOpen:p,onOpenChange:v}){const[w,y]=m.useState(!1),x=m.useRef(null),E=p!==void 0?p:w,A=m.useCallback(D=>{d||(v?v(D):y(D),D?c?.():h?.())},[d,v,c,h]),{refs:L,floatingStyles:N,context:P,isPositioned:z}=So({open:E,onOpenChange:A,placement:n,strategy:"fixed",middleware:[_o(i+(u?8:0)),po({fallbackAxisSideDirection:"start",padding:8}),go({padding:8}),u?Jc({element:x}):void 0].filter(Boolean),whileElementsMounted:co}),I=vr(P,{delay:{open:a,close:g?200:l||100},enabled:!d,move:!1,handleClose:null}),V=wd(P,{enabled:!d}),j=xo(P,{enabled:!d}),$=Eo(P,{role:"tooltip"}),{getReferenceProps:b,getFloatingProps:S}=$o([I,V,j,$]),{isMounted:T,styles:F}=Mo(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=m.useMemo(()=>[zt.tooltip,zt[`size_${r}`],zt[`variant_${o}`],f].filter(Boolean).join(" "),[r,o,f]),k=m.useMemo(()=>m.cloneElement(t,b({ref:L.setReference,...t.props})),[t,b,L.setReference]);return!e||d?t:s.jsxs(s.Fragment,{children:[k,T&&s.jsx(Co,{children:s.jsx("div",{ref:L.setFloating,className:zt.tooltip_positioner,style:{...N,maxWidth:_,zIndex:9999,pointerEvents:"none"},children:s.jsxs("div",{className:C,style:{...F,pointerEvents:g?"auto":"none",visibility:z||!E?"visible":"hidden"},...S(),children:[e,u&&s.jsx(rd,{ref:x,context:P,className:zt.arrow})]})})})]})}/**
|
|
7
|
+
color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,t?.key)}return(u=t?.onChange)==null||u.call(t,a),a}return i.updateDeps=s=>{o=s},i}function rs(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const uu=(e,n)=>Math.abs(e-n)<1.01,_u=(e,n,t)=>{let o;return function(...a){e.clearTimeout(o),o=e.setTimeout(()=>n.apply(this,a),t)}},as=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},fu=e=>e,pu=e=>{const n=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let a=n;a<=t;a++)o.push(a);return o},gu=(e,n)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;const a=s=>{const{width:l,height:c}=s;n({width:Math.round(l),height:Math.round(c)})};if(a(as(t)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver(s=>{const l=()=>{const c=s[0];if(c?.borderBoxSize){const u=c.borderBoxSize[0];if(u){a({width:u.inlineSize,height:u.blockSize});return}}a(as(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},is={passive:!0},ss=typeof window>"u"?!0:"onscrollend"in window,hu=(e,n)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;let a=0;const i=e.options.useScrollendEvent&&ss?()=>{}:_u(o,()=>{n(a,!1)},e.options.isScrollingResetDelay),s=_=>()=>{const{horizontal:g,isRtl:f}=e.options;a=g?t.scrollLeft*(f&&-1||1):t.scrollTop,i(),n(a,_)},l=s(!0),c=s(!1);c(),t.addEventListener("scroll",l,is);const u=e.options.useScrollendEvent&&ss;return u&&t.addEventListener("scrollend",c,is),()=>{t.removeEventListener("scroll",l),u&&t.removeEventListener("scrollend",c)}},mu=(e,n,t)=>{if(n?.borderBoxSize){const o=n.borderBoxSize[0];if(o)return Math.round(o[t.options.horizontal?"inlineSize":"blockSize"])}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},vu=(e,{adjustments:n=0,behavior:t},o)=>{var a,i;const s=e+n;(i=(a=o.scrollElement)==null?void 0:a.scrollTo)==null||i.call(a,{[o.options.horizontal?"left":"top"]:s,behavior:t})};class bu{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const o=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(a=>{a.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var a;(a=o())==null||a.disconnect(),t=null},observe:a=>{var i;return(i=o())==null?void 0:i.observe(a,{box:"border-box"})},unobserve:a=>{var i;return(i=o())==null?void 0:i.unobserve(a)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([o,a])=>{typeof a>"u"&&delete t[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:fu,rangeExtractor:pu,onChange:()=>{},measureElement:mu,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var o,a;(a=(o=this.options).onChange)==null||a.call(o,this,t)},this.maybeNotify=kn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(a=>{this.observer.observe(a)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(a,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<a?"forward":"backward":null,this.scrollOffset=a,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,o)=>{const a=new Map,i=new Map;for(let s=o-1;s>=0;s--){const l=t[s];if(a.has(l.lane))continue;const c=i.get(l.lane);if(c==null||l.end>c.end?i.set(l.lane,l):l.end<c.end&&a.set(l.lane,!0),a.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,l)=>s.end===l.end?s.index-l.index:s.end-l.end)[0]:void 0},this.getMeasurementOptions=kn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,o,a,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:o,scrollMargin:a,getItemKey:i,enabled:s}),{key:!1}),this.getMeasurements=kn(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:o,scrollMargin:a,getItemKey:i,enabled:s},l)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(_=>{this.itemSizeCache.set(_.key,_.size)}));const c=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,c);for(let _=c;_<t;_++){const g=i(_),f=this.options.lanes===1?u[_-1]:this.getFurthestMeasurement(u,_),d=f?f.end+this.options.gap:o+a,m=l.get(g),p=typeof m=="number"?m:this.options.estimateSize(_),v=d+p,y=f?f.lane:_%this.options.lanes;u[_]={index:_,start:d,size:p,end:v,key:g,lane:y}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=kn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,o,a,i)=>this.range=t.length>0&&o>0?wu({measurements:t,outerSize:o,scrollOffset:a,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=kn(()=>{let t=null,o=null;const a=this.calculateRange();return a&&(t=a.startIndex,o=a.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,o]},(t,o,a,i,s)=>i===null||s===null?[]:t({startIndex:i,endIndex:s,overscan:o,count:a}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const o=this.options.indexAttribute,a=t.getAttribute(o);return a?parseInt(a,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(t,o)=>{const a=this.indexFromElement(t),i=this.measurementsCache[a];if(!i)return;const s=i.key,l=this.elementsCache.get(s);l!==t&&(l&&this.observer.unobserve(l),this.observer.observe(t),this.elementsCache.set(s,t)),t.isConnected&&this.resizeItem(a,this.options.measureElement(t,o,this))},this.resizeItem=(t,o)=>{const a=this.measurementsCache[t];if(!a)return;const i=this.itemSizeCache.get(a.key)??a.size,s=o-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(a,s,this):a.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(a.index),this.itemSizeCache=new Map(this.itemSizeCache.set(a.key,o)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((o,a)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(a))});return}this._measureElement(t,void 0)},this.getVirtualItems=kn(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,o)=>{const a=[];for(let i=0,s=t.length;i<s;i++){const l=t[i],c=o[l];a.push(c)}return a},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const o=this.getMeasurements();if(o.length!==0)return rs(o[ls(0,o.length-1,a=>rs(o[a]).start,t)])},this.getOffsetForAlignment=(t,o,a=0)=>{const i=this.getSize(),s=this.getScrollOffset();o==="auto"&&(o=t>=s+i?"end":"start"),o==="center"?t+=(a-i)/2:o==="end"&&(t-=i);const l=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(l,t),0)},this.getOffsetForIndex=(t,o="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const a=this.measurementsCache[t];if(!a)return;const i=this.getSize(),s=this.getScrollOffset();if(o==="auto")if(a.end>=s+i-this.options.scrollPaddingEnd)o="end";else if(a.start<=s+this.options.scrollPaddingStart)o="start";else return[s,o];const l=o==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,o,a.size),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:o="start",behavior:a}={})=>{a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,o),{adjustments:void 0,behavior:a})},this.scrollToIndex=(t,{align:o="auto",behavior:a}={})=>{a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let i=0;const s=10,l=u=>{if(!this.targetWindow)return;const _=this.getOffsetForIndex(t,u);if(!_){console.warn("Failed to get offset for index:",t);return}const[g,f]=_;this._scrollToOffset(g,{adjustments:void 0,behavior:a}),this.targetWindow.requestAnimationFrame(()=>{const d=this.getScrollOffset(),m=this.getOffsetForIndex(t,f);if(!m){console.warn("Failed to get offset for index:",t);return}uu(m[0],d)||c(f)})},c=u=>{this.targetWindow&&(i++,i<s?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,s),this.targetWindow.requestAnimationFrame(()=>l(u))):console.warn(`Failed to scroll to index ${t} after ${s} attempts.`))};l(o)},this.scrollBy=(t,{behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var t;const o=this.getMeasurements();let a;if(o.length===0)a=this.options.paddingStart;else if(this.options.lanes===1)a=((t=o[o.length-1])==null?void 0:t.end)??0;else{const i=Array(this.options.lanes).fill(null);let s=o.length-1;for(;s>=0&&i.some(l=>l===null);){const l=o[s];i[l.lane]===null&&(i[l.lane]=l.end),s--}a=Math.max(...i.filter(l=>l!==null))}return Math.max(a-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:o,behavior:a})=>{this.options.scrollToFn(t,{behavior:a,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(n)}}const ls=(e,n,t,o)=>{for(;e<=n;){const a=(e+n)/2|0,i=t(a);if(i<o)e=a+1;else if(i>o)n=a-1;else return a}return e>0?e-1:0};function wu({measurements:e,outerSize:n,scrollOffset:t,lanes:o}){const a=e.length-1,i=c=>e[c].start;if(e.length<=o)return{startIndex:0,endIndex:a};let s=ls(0,a,i,t),l=s;if(o===1)for(;l<a&&e[l].end<t+n;)l++;else if(o>1){const c=Array(o).fill(0);for(;l<a&&c.some(_=>_<t+n);){const _=e[l];c[_.lane]=_.end,l++}const u=Array(o).fill(t+n);for(;s>=0&&u.some(_=>_>=t);){const _=e[s];u[_.lane]=_.start,s--}s=Math.max(0,s-s%o),l=Math.min(a,l+(o-1-l%o))}return{startIndex:s,endIndex:l}}const cs=typeof document<"u"?M.useLayoutEffect:M.useEffect;function yu(e){const n=M.useReducer(()=>({}),{})[1],t={...e,onChange:(a,i)=>{var s;i?Fn.flushSync(n):n(),(s=e.onChange)==null||s.call(e,a,i)}},[o]=M.useState(()=>new bu(t));return o.setOptions(t),cs(()=>o._didMount(),[]),cs(()=>o._willUpdate()),o}function Cu(e){return yu({observeElementRect:gu,observeElementOffset:hu,scrollToFn:vu,...e})}function xu(e,n){const[t,o]=M.useState(e);return M.useEffect(()=>{const a=setTimeout(()=>{o(e)},n);return()=>{clearTimeout(a)}},[e,n]),t}function Hr(e){const n=M.useCallback(a=>{const i=window.matchMedia(e);return i.addEventListener("change",a),()=>{i.removeEventListener("change",a)}},[e]),t=()=>window.matchMedia(e).matches,o=()=>{throw Error("useMediaQuery is a client-only hook")};return M.useSyncExternalStore(n,t,o)}function Wr(e,n){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[n]??"":e)}function Hn(e,n){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[n]??"":e)}function jo(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function ds(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function us(e,n,t,o){if(!n.trim())return e;const a=ds(n.trim());return o?e.filter(i=>o(i,n)):e.filter(i=>ds(Wr(i,t)).includes(a))}function $u(e){if(e.length===0)return!1;const n=e[0];return typeof n=="object"&&n!==null&&"grupo"in n&&"opciones"in n&&Array.isArray(n.opciones)}function Su(e){const n=[];let t=0;for(const o of e){n.push({tipo:"grupo",datos:null,nombreGrupo:o.grupo,indice:t++});for(const a of o.opciones)n.push({tipo:"opcion",datos:a,indice:t++})}return n}function ku(e,n,t,o){return n.trim()?e.map(a=>({...a,opciones:us(a.opciones,n,t,o)})).filter(a=>a.opciones.length>0):e}function Nu(e){return e.map((n,t)=>n.tipo==="grupo"||n.datos&&jo(n.datos)?t:null).filter(n=>n!==null)}function Eu(e,n){if(!n)return null;const t=n(e);return t===!0||t==null?null:typeof t=="string"?t:typeof t=="object"&&"message"in t?t.message??"Selección inválida":"Selección inválida"}function Mu(e,n,t){return e!==void 0?e:n==="invalid"?!0:n==="valid"?!1:!!t}function Iu(e,n="Opción"){return Array.from({length:e},(t,o)=>`${n} ${o+1}`)}function Fu(e){return Array.from({length:e},(n,t)=>({id:`usr-${t+1}`,nombre:`Usuario ${t+1}`,email:`usuario${t+1}@test.com`}))}const _s=({size:e="1em",...n})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:r.jsx("path",{d:"m6 9 6 6 6-6"})}),fs=({size:e="1em",...n})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:[r.jsx("path",{d:"M18 6 6 18"}),r.jsx("path",{d:"m6 6 12 12"})]}),zu=({size:e="1em",...n})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:r.jsx("path",{d:"M20 6 9 17l-5-5"})}),Lu=({size:e="1em",...n})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",...n,children:[r.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"}),r.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"})]}),Au=({size:e="1em",...n})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:r.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),ue={contenedor_base:"_contenedor_base_1h7dd_1",tam_sm:"_tam_sm_1h7dd_43",tam_lg:"_tam_lg_1h7dd_57",radio_none:"_radio_none_1h7dd_71",radio_sm:"_radio_sm_1h7dd_79",radio_md:"_radio_md_1h7dd_87",radio_lg:"_radio_lg_1h7dd_95",radio_full:"_radio_full_1h7dd_103",color_default:"_color_default_1h7dd_111",color_primary:"_color_primary_1h7dd_113",color_secondary:"_color_secondary_1h7dd_121",color_success:"_color_success_1h7dd_129",color_warning:"_color_warning_1h7dd_137",color_danger:"_color_danger_1h7dd_145",etiqueta:"_etiqueta_1h7dd_153",marca_requerido:"_marca_requerido_1h7dd_169",trigger:"_trigger_1h7dd_179",trigger_expandido:"_trigger_expandido_1h7dd_215",variante_bordered:"_variante_bordered_1h7dd_225",variante_faded:"_variante_faded_1h7dd_235",variante_underlined:"_variante_underlined_1h7dd_245",variante_ghost:"_variante_ghost_1h7dd_261",deshabilitado:"_deshabilitado_1h7dd_273",solo_lectura:"_solo_lectura_1h7dd_293",valor_texto:"_valor_texto_1h7dd_309",abierto:"_abierto_1h7dd_337",valido:"_valido_1h7dd_345",invalido:"_invalido_1h7dd_353",contenido_inicio:"_contenido_inicio_1h7dd_405",contenido_final:"_contenido_final_1h7dd_407",valor_wrapper:"_valor_wrapper_1h7dd_425",mostrar_todos:"_mostrar_todos_1h7dd_445",valor_wrapper_expandido:"_valor_wrapper_expandido_1h7dd_455",placeholder:"_placeholder_1h7dd_471",chip_multi:"_chip_multi_1h7dd_481",chip_texto:"_chip_texto_1h7dd_515",chip_cerrar:"_chip_cerrar_1h7dd_527",contador_multi:"_contador_multi_1h7dd_567",acciones:"_acciones_1h7dd_581",boton_limpiar:"_boton_limpiar_1h7dd_595",tiene_valor:"_tiene_valor_1h7dd_647",icono_chevron:"_icono_chevron_1h7dd_657",icono_spinner:"_icono_spinner_1h7dd_679",girarSpinner:"_girarSpinner_1h7dd_1",menu:"_menu_1h7dd_713",buscador_wrapper:"_buscador_wrapper_1h7dd_749",buscador_interno:"_buscador_interno_1h7dd_763",icono_buscar:"_icono_buscar_1h7dd_809",input_busqueda:"_input_busqueda_1h7dd_841",lista_opciones:"_lista_opciones_1h7dd_885",lista_virtual:"_lista_virtual_1h7dd_969",contenedor_virtual:"_contenedor_virtual_1h7dd_981",encabezado_grupo:"_encabezado_grupo_1h7dd_989",opcion_virtual:"_opcion_virtual_1h7dd_1021",opcion:"_opcion_1h7dd_1021",activo:"_activo_1h7dd_1065",seleccionado:"_seleccionado_1h7dd_1081",opcion_check:"_opcion_check_1h7dd_1139",opcion_contenido:"_opcion_contenido_1h7dd_1167",sin_resultados:"_sin_resultados_1h7dd_1183",descripcion:"_descripcion_1h7dd_1207",mensaje_error:"_mensaje_error_1h7dd_1219",ancho_total:"_ancho_total_1h7dd_1231",sin_animacion:"_sin_animacion_1h7dd_1239",contenedor_nativo:"_contenedor_nativo_1h7dd_1249",select_nativo:"_select_nativo_1h7dd_1257",input_validacion:"_input_validacion_1h7dd_1285"};function Du(e){const{options:n=[],value:t,onChange:o,onValueChange:a,optionLabelKey:i="label",optionValueKey:s="id",label:l,placeholder:c="Seleccione una opción",description:u,errorMessage:_,isRequired:g=!1,isInvalid:f,id:d,name:m,classNames:p,startContent:v,endContent:y,esInvalido:w,estaDeshabilitadoReal:C,clasesBase:k,renderizarValorMostrado:z}=e,A=h.useId(),N=d??`select-nativo-${A}`,P=u?`${N}-desc`:void 0,O=w?`${N}-err`:void 0,E=h.useCallback(F=>Wr(F,i),[i]),T=h.useCallback(F=>Hn(F,s),[s]),V=h.useCallback(F=>{o?.(F),a?.(F)},[o,a]),S=h.useCallback(F=>{const I=F.target.value;if(!I){V(null);return}const $=n.find(D=>T(D)===I);$&&V($)},[n,T,V]),b=typeof f=="string"?f:null,x=typeof _=="function"?_({invalido:w,mensaje:b}):_??b;return r.jsxs("div",{className:k,children:[l&&r.jsxs("label",{className:ne(ue.etiqueta,p?.label),htmlFor:N,children:[l,g&&r.jsx("span",{className:ue.marca_requerido,children:"*"})]}),r.jsxs("div",{className:ue.contenedor_nativo,children:[r.jsxs("div",{className:ne(ue.trigger,p?.trigger),children:[v&&r.jsx("span",{className:ue.contenido_inicio,children:v}),r.jsx("div",{className:ne(ue.valor_wrapper,p?.value),children:z()}),r.jsxs("div",{className:ue.acciones,children:[y&&r.jsx("span",{className:ue.contenido_final,children:y}),r.jsx("span",{className:ue.icono_chevron,children:r.jsx(_s,{size:"1em"})})]})]}),r.jsxs("select",{id:N,name:m,className:ue.select_nativo,value:t?T(t):"",onChange:S,disabled:C,required:g,children:[r.jsx("option",{value:"",children:c}),n.map(F=>r.jsx("option",{value:T(F),disabled:jo(F),children:E(F)},T(F)))]})]}),u&&!w&&r.jsx("div",{id:P,className:ne(ue.descripcion,p?.description),children:u}),w&&x&&r.jsx("div",{id:O,className:ne(ue.mensaje_error,p?.errorMessage),children:x})]})}const Pu="(max-width: 768px)",Tu=44,Gr=320,Wn=100,Ou=200,Vu=5;function Bu(e,n){const{options:t=[],value:o,defaultValue:a,onChange:i,onValueChange:s,optionLabelKey:l="label",optionValueKey:c="id",renderOption:u,renderValue:_,variant:g="bordered",color:f="default",size:d="md",radius:m="md",fullWidth:p=!0,disableAnimation:v=!1,label:y,placeholder:w="",description:C,errorMessage:k,emptyMessage:z="No hay opciones",noResultsMessage:A="Sin resultados",isRequired:N=!1,isDisabled:P=!1,isReadOnly:O=!1,isLoading:E=!1,isClearable:T=!0,isInvalid:V,validationState:S,isMultiple:b=!1,mostrarTodos:x=!1,isSearchable:F,isVirtualized:I=!1,estimatedOptionHeight:$=Tu,filterFn:D,validate:B,onOpen:X,onClose:U,onSearchChange:L,onClear:j,onFocus:W,onBlur:ie,id:re,name:ae,className:me,classNames:ee,style:fe,startContent:R,endContent:se,menuZIndex:_e,portalContainer:Se}=e,ge=h.useRef(null),le=h.useRef([]),he=h.useRef(null),G=h.useRef(null),Y=h.useId(),ce=re??`select-${Y}`,K=Hr(Pu),q=F??(t.length>4&&!K),H=K&&!q&&!b,[de,te]=h.useState(!1),[pe,Ye]=h.useState("bottom-start"),[Oe,Ae]=h.useState(null),[Ne,ot]=h.useState(""),Me=o!==void 0,[bt,Te]=h.useState(a??null),be=Me?o:bt,Ge=P||E,lt=h.useCallback(oe=>Wr(oe,l),[l]),Ee=h.useCallback(oe=>Hn(oe,c),[c]),rt=h.useMemo(()=>{const oe=new Set;if(!be)return oe;try{if(b&&Array.isArray(be))for(const Le of be)oe.add(Hn(Le,c));else be&&oe.add(Hn(be,c))}catch{}return oe},[be,b,c]),St=h.useCallback(oe=>{try{return rt.has(Hn(oe,c))}catch{return!1}},[rt,c]),Et=h.useMemo(()=>$u(t),[t]),Ce=h.useMemo(()=>{if(!q||!Ne.trim())return t;try{return Et?ku(t,Ne,l,D):us(t,Ne,l,D)}catch{return t}},[t,Ne,q,D,l,Et]),xe=h.useMemo(()=>Et?Su(Ce):Ce.map((oe,Le)=>({tipo:"opcion",datos:oe,indice:Le})),[Ce,Et]),et=h.useMemo(()=>Eu(be,B),[be,B]),Be=h.useMemo(()=>Mu(V,S,et),[V,S,et]),wt=S==="valid"&&!Be,{refs:Tt,floatingStyles:ba,context:Ot,placement:Qo}=Do({open:de,onOpenChange:oe=>{Ge||O||(oe&&Ye("bottom-start"),te(oe),oe?(X?.(),ot(""),Ae(null)):U?.())},strategy:"fixed",transform:!1,placement:pe,middleware:[$o(4),ko({padding:8}),So({padding:8}),$i({apply({rects:oe,elements:Le,availableHeight:It}){Object.assign(Le.floating.style,{minWidth:`${oe.reference.width}px`,width:"max-content",maxWidth:`min(${Math.max(oe.reference.width,280)}px, calc(100vw - 16px))`,maxHeight:`${It}px`})},padding:8})],whileElementsMounted:yo});h.useLayoutEffect(()=>{if(!de)return;const oe=Qo.startsWith("top")?"top-start":"bottom-start";Ye(Le=>Le===oe?Le:oe)},[de,Qo]);const Ie=pe.startsWith("top"),Fe=v||xe.length>Ou?0:300,{isMounted:Je,styles:kt}=Bo(Ot,{duration:{open:Fe,close:Math.round(Fe*.5)},initial:{opacity:0,transform:Ie?"translateY(6px) scale(0.96)":"translateY(-6px) scale(0.96)"},open:{opacity:1,transform:"translateY(0) scale(1)"},close:{opacity:0,transform:Ie?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)"},common:{transformOrigin:Ie?"bottom center":"top center"}}),Mt=Cu({count:xe.length,getScrollElement:()=>he.current,estimateSize:()=>$,overscan:Vu,enabled:I&&de&&xe.length>Wn}),hn=Xi(Ot,{enabled:!Ge&&!O}),eo=Ao(Ot),to=Vo(Ot,{role:"listbox"}),Ro=h.useMemo(()=>{try{return Nu(xe)}catch{return[]}},[xe]),er=qr(Ot,{listRef:le,activeIndex:Oe,onNavigate:Ae,loop:!0,virtual:I,focusItemOnHover:!q,disabledIndices:Ro}),yl=h.useRef([]);h.useEffect(()=>{yl.current=xe.map(oe=>oe.tipo==="opcion"&&oe.datos?lt(oe.datos):null)},[xe,lt]);const rp=es(Ot,{listRef:yl,activeIndex:Oe,onMatch:de?Ae:void 0,enabled:!q}),{getReferenceProps:ap,getFloatingProps:ip,getItemProps:Cl}=Po([hn,eo,to,er,rp]),on=h.useCallback(oe=>{Me||Te(oe),i?.(oe),s?.(oe)},[Me,i,s]),tr=h.useCallback(oe=>{if(!jo(oe))if(b){const Le=Array.isArray(be)?be:[],It=Le.some(mt=>Ee(mt)===Ee(oe));on(It?Le.filter(mt=>Ee(mt)!==Ee(oe)):[...Le,oe])}else on(oe),te(!1)},[b,be,Ee,on]),sp=h.useCallback(oe=>{oe.stopPropagation(),on(b?[]:null),j?.(),ge.current?.focus()},[b,on,j]),xl=h.useCallback((oe,Le)=>{Le.stopPropagation(),!(!b||!Array.isArray(be))&&on(be.filter(It=>Ee(It)!==Ee(oe)))},[b,be,Ee,on]),lp=h.useCallback(oe=>{const Le=oe.target.value;ot(Le),L?.(Le),Ae(0)},[L]),cp=h.useCallback(oe=>{if(oe.key==="Enter"&&Oe!==null){oe.preventDefault();const Le=xe[Oe];Le?.tipo==="opcion"&&Le.datos&&tr(Le.datos)}},[Oe,xe,tr]);h.useEffect(()=>{de&&q&&requestAnimationFrame(()=>G.current?.focus())},[de,q]),h.useEffect(()=>{if(!de)return;const oe=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",oe>0&&(document.body.style.paddingRight=`${oe}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[de]),h.useEffect(()=>()=>{le.current=[]},[xe.length]),h.useEffect(()=>{if(!de)return;const oe=xe.findIndex(Le=>Le.tipo==="opcion"&&Le.datos!=null&&St(Le.datos));oe!==-1&&requestAnimationFrame(()=>{I&&xe.length>Wn?Mt.scrollToIndex(oe,{align:"center"}):le.current[oe]?.scrollIntoView({block:"nearest"})})},[de]),h.useImperativeHandle(n,()=>({focus:()=>ge.current?.focus(),blur:()=>ge.current?.blur(),open:()=>te(!0),close:()=>te(!1),clear:()=>on(b?[]:null)}));const nr=b?Array.isArray(be)&&be.length>0:be!=null&&be!=="",$l=h.useCallback(()=>{if(_)return _(be??null);if(!nr)return r.jsx("span",{className:ue.placeholder,children:w});if(b&&Array.isArray(be)){if(be.length===0)return r.jsx("span",{className:ue.placeholder,children:w});const oe=x?be:be.slice(0,2),Le=x?0:Math.max(0,be.length-2);return r.jsxs(r.Fragment,{children:[oe.map(It=>r.jsxs("span",{className:ue.chip_multi,children:[r.jsx("span",{className:ue.chip_texto,children:lt(It)}),!O&&!Ge&&r.jsx("button",{type:"button",className:ue.chip_cerrar,onClick:mt=>xl(It,mt),children:r.jsx(fs,{size:"1em"})})]},Ee(It))),Le>0&&r.jsxs("span",{className:ue.contador_multi,children:["+",Le]})]})}return r.jsx("span",{className:ue.valor_texto,children:lt(be)})},[_,be,nr,w,b,x,O,Ge,Ee,lt,xl]),Sl=h.useCallback((oe,Le,It)=>{try{if(oe.tipo==="grupo")return r.jsx("li",{className:ne(ue.encabezado_grupo,I&&ue.opcion_virtual),style:It,children:oe.nombreGrupo},`grupo-${oe.nombreGrupo}`);const mt=oe.datos;if(!mt)return null;const El=St(mt),Ml=Oe===Le,dp=jo(mt),up=u?u(mt,{isSelected:El,isActive:Ml}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:ue.opcion_check,children:r.jsx(zu,{size:"1em"})}),r.jsx("span",{className:ue.opcion_contenido,children:lt(mt)})]}),_p=Ee(mt);return r.jsx("li",{ref:fp=>{le.current[Le]=fp},className:ne(ue.opcion,I&&ue.opcion_virtual,{[ue.activo]:Ml,[ue.seleccionado]:El,[ue.deshabilitado]:dp},ee?.option),style:It,...Cl({onClick:()=>tr(mt)}),children:up},_p)}catch(mt){return console.error("Error rendering select item:",mt),null}},[I,Oe,St,u,lt,Ee,ee?.option,Cl,tr]),kl=typeof k=="function"?k({invalido:Be,mensaje:et}):k??et,Nl=ne(ue.contenedor_base,ue[`variante_${g}`],ue[`tam_${d}`],ue[`radio_${m}`],ue[`color_${f}`],{[ue.ancho_total]:p,[ue.sin_animacion]:v,[ue.deshabilitado]:Ge,[ue.solo_lectura]:O,[ue.invalido]:Be,[ue.valido]:wt,[ue.abierto]:de,[ue.tiene_valor]:nr},ee?.base,me);return H&&!Et?r.jsx(Du,{...e,esInvalido:Be,estaDeshabilitadoReal:Ge,clasesBase:Nl,renderizarValorMostrado:$l}):r.jsxs("div",{className:Nl,style:fe,children:[y&&r.jsxs("label",{id:`${ce}-label`,className:ne(ue.etiqueta,ee?.label),children:[y,N&&r.jsx("span",{className:ue.marca_requerido,children:"*"})]}),r.jsxs("div",{ref:oe=>{Tt.setReference(oe),ge.current=oe},id:ce,tabIndex:Ge?-1:0,className:ne(ue.trigger,x&&b&&ue.trigger_expandido,ee?.trigger),"aria-labelledby":y?`${ce}-label`:void 0,onFocus:W,onBlur:ie,...ap(),children:[R&&r.jsx("span",{className:ue.contenido_inicio,children:R}),r.jsx("div",{className:ne(ue.valor_wrapper,x&&b&&ue.mostrar_todos,x&&b&&ue.valor_wrapper_expandido,ee?.value),children:$l()}),r.jsxs("div",{className:ue.acciones,children:[T&&nr&&!O&&!Ge&&r.jsx("button",{type:"button",className:ne(ue.boton_limpiar,ee?.clearButton),onClick:sp,tabIndex:-1,children:r.jsx(fs,{size:"1em"})}),se&&r.jsx("span",{className:ue.contenido_final,children:se}),E?r.jsx("span",{className:ue.icono_spinner,children:r.jsx(Au,{size:"1em"})}):r.jsx("span",{className:ue.icono_chevron,children:r.jsx(_s,{size:"1em"})})]})]}),(ae||N)&&r.jsx("input",{type:"text",name:ae,required:N,value:b&&Array.isArray(be)?be.map(Ee).join(","):be?Ee(be):"",onChange:()=>{},onFocus:oe=>oe.target.blur(),"aria-hidden":"true",className:ue.input_validacion}),Je&&r.jsx(Lo,{root:Se,children:r.jsx(Or,{context:Ot,modal:!1,initialFocus:q?G:-1,children:r.jsxs("div",{ref:Tt.setFloating,style:{...ba,...kt,zIndex:_e??"var(--z-popover)",transitionTimingFunction:Ot.open?"cubic-bezier(0.32, 0.72, 0, 1)":"cubic-bezier(0.4, 0, 1, 1)"},className:ne(ue.menu,ee?.menu),...ip(),children:[q&&r.jsx("div",{className:ue.buscador_wrapper,children:r.jsxs("div",{className:ue.buscador_interno,children:[r.jsx("span",{className:ue.icono_buscar,children:r.jsx(Lu,{size:"1.6em"})}),r.jsx("input",{ref:G,type:"text",className:ne(ue.input_busqueda,ee?.searchInput),placeholder:"Buscar...",value:Ne,onChange:lp,onKeyDown:cp})]})}),r.jsx("ul",{ref:he,className:ne(ue.lista_opciones,I&&ue.lista_virtual),style:{height:I&&xe.length>Wn?`${Gr}px`:`${Math.min(xe.length*$,Gr)}px`,maxHeight:`${Gr}px`,overflow:"auto",position:I&&xe.length>Wn?"relative":void 0},children:xe.length===0?r.jsx("li",{className:ue.sin_resultados,children:Ne?A:z}):I&&xe.length>Wn?r.jsx(r.Fragment,{children:r.jsx("div",{style:{height:`${Mt.getTotalSize()}px`,position:"relative",width:"100%"},children:Mt.getVirtualItems().map(oe=>{const Le=xe[oe.index];return Le?r.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,width:"100%",height:`${oe.size}px`,transform:`translateY(${oe.start}px)`},children:Sl(Le,oe.index)},`virtual-${oe.index}`):null})})}):xe.map((oe,Le)=>Sl(oe,Le))})]})})}),C&&!Be&&r.jsx("div",{className:ne(ue.descripcion,ee?.description),children:C}),Be&&kl&&r.jsx("div",{className:ne(ue.mensaje_error,ee?.errorMessage),children:kl})]})}const ju=h.forwardRef(Bu),ps=h.memo(ju);ps.displayName="SelectBase";function qu(e,n){const{options:t=[],value:o,onChange:a,onValueChange:i,optionValueKey:s,optionLabelKey:l="label",isMultiple:c=!1,devolverObjeto:u=!1,..._}=e,g=h.useMemo(()=>t.length>0&&typeof t[0]=="object",[t]),f=h.useMemo(()=>{if(!g||!s)return null;const p=new Map;for(const v of t)p.set(String(v[s]),v);return p},[t,s,g]),d=h.useMemo(()=>{if(o==null||!g||u)return o;const p=v=>f?.get(String(v));return c&&Array.isArray(o)?o.map(p).filter(v=>v!==void 0):p(o)??null},[o,f,c,u,g]),m=h.useCallback(p=>{const v=a||i;if(!v)return;if(p===null){v(c?[]:u||!g?null:"");return}if(u||!g){v(p);return}const y=w=>typeof w=="string"?w:w[s];v(c&&Array.isArray(p)?p.map(y):y(p))},[a,i,u,c,s,g]);return r.jsx(ps,{..._,ref:n,options:t,value:d,onChange:m,optionValueKey:s,optionLabelKey:l,isMultiple:c})}const gs=h.forwardRef(qu);gs.displayName="Select";const Gn={tooltip:"_tooltip_aqvwg_1",tooltip_positioner:"_tooltip_positioner_aqvwg_53",enterAnimation:"_enterAnimation_aqvwg_1",exitAnimation:"_exitAnimation_aqvwg_1",arrow:"_arrow_aqvwg_81",size_sm:"_size_sm_aqvwg_91",size_md:"_size_md_aqvwg_101",size_lg:"_size_lg_aqvwg_111",variant_default:"_variant_default_aqvwg_121",variant_dark:"_variant_dark_aqvwg_141",variant_light:"_variant_light_aqvwg_153",variant_brand:"_variant_brand_aqvwg_165",variant_success:"_variant_success_aqvwg_181",variant_warning:"_variant_warning_aqvwg_193",variant_danger:"_variant_danger_aqvwg_205",variant_info:"_variant_info_aqvwg_217",fadeOnly:"_fadeOnly_aqvwg_1"};function _n({content:e,children:n,placement:t="top",variant:o="default",size:a="md",offset:i=8,delayShow:s=100,delayHide:l=0,isDisabled:c=!1,showArrow:u=!1,maxWidth:_="320px",isInteractive:g=!1,className:f="",onOpen:d,onClose:m,isOpen:p,onOpenChange:v}){const[y,w]=h.useState(!1),C=h.useRef(null),k=p!==void 0?p:y,z=h.useCallback(B=>{c||(v?v(B):w(B),B?d?.():m?.())},[c,v,d,m]),{refs:A,floatingStyles:N,context:P,isPositioned:O}=Do({open:k,onOpenChange:z,placement:t,strategy:"fixed",middleware:[$o(i+(u?8:0)),ko({fallbackAxisSideDirection:"start",padding:8}),So({padding:8}),u?Td({element:C}):void 0].filter(Boolean),whileElementsMounted:yo}),E=Ar(P,{delay:{open:s,close:g?200:l||100},enabled:!c,move:!1,handleClose:null}),T=au(P,{enabled:!c}),V=Ao(P,{enabled:!c}),S=Vo(P,{role:"tooltip"}),{getReferenceProps:b,getFloatingProps:x}=Po([E,T,V,S]),{isMounted:F,styles:I}=Bo(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)"}}),$=h.useMemo(()=>[Gn.tooltip,Gn[`size_${a}`],Gn[`variant_${o}`],f].filter(Boolean).join(" "),[a,o,f]),D=h.useMemo(()=>h.cloneElement(n,b({ref:A.setReference,...n.props})),[n,b,A.setReference]);return!e||c?n:r.jsxs(r.Fragment,{children:[D,F&&r.jsx(Lo,{children:r.jsx("div",{ref:A.setFloating,className:Gn.tooltip_positioner,style:{...N,maxWidth:_,zIndex:9999,pointerEvents:"none"},children:r.jsxs("div",{className:$,style:{...I,pointerEvents:g?"auto":"none",visibility:O||!k?"visible":"hidden"},...x(),children:[e,u&&r.jsx(Hd,{ref:C,context:P,className:Gn.arrow})]})})})]})}/**
|
|
8
8
|
* table-core
|
|
9
9
|
*
|
|
10
10
|
* Copyright (c) TanStack
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
* LICENSE.md file in the root directory of this source tree.
|
|
14
14
|
*
|
|
15
15
|
* @license MIT
|
|
16
|
-
*/function
|
|
16
|
+
*/function Rt(e,n){return typeof e=="function"?e(n):e}function $t(e,n){return t=>{n.setState(o=>({...o,[e]:Rt(t,o[e])}))}}function qo(e){return e instanceof Function}function Hu(e){return Array.isArray(e)&&e.every(n=>typeof n=="number")}function Wu(e,n){const t=[],o=a=>{a.forEach(i=>{t.push(i);const s=n(i);s!=null&&s.length&&o(s)})};return o(e),t}function we(e,n,t){let o=[],a;return i=>{let s;t.key&&t.debug&&(s=Date.now());const l=e(i);if(!(l.length!==o.length||l.some((_,g)=>o[g]!==_)))return a;o=l;let u;if(t.key&&t.debug&&(u=Date.now()),a=n(...l),t==null||t.onChange==null||t.onChange(a),t.key&&t.debug&&t!=null&&t.debug()){const _=Math.round((Date.now()-s)*100)/100,g=Math.round((Date.now()-u)*100)/100,f=g/16,d=(m,p)=>{for(m=String(m);m.length<p;)m=" "+m;return m};console.info(`%c⏱ ${d(g,5)} /${d(_,5)} ms`,`
|
|
17
17
|
font-size: .6rem;
|
|
18
18
|
font-weight: bold;
|
|
19
|
-
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n?.key)}return r}}function le(e,t,n,o){return{debug:()=>{var r;return(r=e?.debugAll)!=null?r:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:o}}function su(e,t,n,o){const r=()=>{var a;return(a=i.getValue())!=null?a:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:r,getContext:ae(()=>[e,n,t,i],(a,l,d,u)=>({table:a,column:l,row:d,cell:u,getValue:u.getValue,renderValue:u.renderValue}),le(e.options,"debugCells","cell.getContext"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(i,n,t,e)},{}),i}function au(e,t,n,o){var r,i;const l={...e._getDefaultColumnDef(),...t},d=l.accessorKey;let u=(r=(i=l.id)!=null?i:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?r:typeof l.header=="string"?l.header:void 0,_;if(l.accessorFn?_=l.accessorFn:d&&(d.includes(".")?_=f=>{let c=f;for(const p of d.split(".")){var h;c=(h=c)==null?void 0:h[p],process.env.NODE_ENV!=="production"&&c===void 0&&console.warn(`"${p}" in deeply nested key "${d}" returned undefined.`)}return c}:_=f=>f[l.accessorKey]),!u)throw process.env.NODE_ENV!=="production"?new Error(l.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let g={id:`${String(u)}`,accessorFn:_,parent:o,depth:n,columnDef:l,columns:[],getFlatColumns:ae(()=>[!0],()=>{var f;return[g,...(f=g.columns)==null?void 0:f.flatMap(c=>c.getFlatColumns())]},le(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ae(()=>[e._getOrderColumnsFn()],f=>{var c;if((c=g.columns)!=null&&c.length){let h=g.columns.flatMap(p=>p.getLeafColumns());return f(h)}return[g]},le(e.options,"debugColumns","column.getLeafColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(g,e);return g}const un="debugHeaders";function Zs(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 lu={createTable:e=>{e.getHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>{var i,a;const l=(i=o?.map(g=>n.find(f=>f.id===g)).filter(Boolean))!=null?i:[],d=(a=r?.map(g=>n.find(f=>f.id===g)).filter(Boolean))!=null?a:[],u=n.filter(g=>!(o!=null&&o.includes(g.id))&&!(r!=null&&r.includes(g.id)));return Lo(t,[...l,...u,...d],e)},le(e.options,un,"getHeaderGroups")),e.getCenterHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>(n=n.filter(i=>!(o!=null&&o.includes(i.id))&&!(r!=null&&r.includes(i.id))),Lo(t,n,e,"center")),le(e.options,un,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var r;const i=(r=o?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?r:[];return Lo(t,i,e,"left")},le(e.options,un,"getLeftHeaderGroups")),e.getRightHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var r;const i=(r=o?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?r:[];return Lo(t,i,e,"right")},le(e.options,un,"getRightHeaderGroups")),e.getFooterGroups=ae(()=>[e.getHeaderGroups()],t=>[...t].reverse(),le(e.options,un,"getFooterGroups")),e.getLeftFooterGroups=ae(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),le(e.options,un,"getLeftFooterGroups")),e.getCenterFooterGroups=ae(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),le(e.options,un,"getCenterFooterGroups")),e.getRightFooterGroups=ae(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),le(e.options,un,"getRightFooterGroups")),e.getFlatHeaders=ae(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,un,"getFlatHeaders")),e.getLeftFlatHeaders=ae(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,un,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ae(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,un,"getCenterFlatHeaders")),e.getRightFlatHeaders=ae(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,un,"getRightFlatHeaders")),e.getCenterLeafHeaders=ae(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),le(e.options,un,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ae(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),le(e.options,un,"getLeftLeafHeaders")),e.getRightLeafHeaders=ae(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),le(e.options,un,"getRightLeafHeaders")),e.getLeafHeaders=ae(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,o)=>{var r,i,a,l,d,u;return[...(r=(i=t[0])==null?void 0:i.headers)!=null?r:[],...(a=(l=n[0])==null?void 0:l.headers)!=null?a:[],...(d=(u=o[0])==null?void 0:u.headers)!=null?d:[]].map(_=>_.getLeafHeaders()).flat()},le(e.options,un,"getLeafHeaders"))}};function Lo(e,t,n,o){var r,i;let a=0;const l=function(f,c){c===void 0&&(c=1),a=Math.max(a,c),f.filter(h=>h.getIsVisible()).forEach(h=>{var p;(p=h.columns)!=null&&p.length&&l(h.columns,c+1)},0)};l(e);let d=[];const u=(f,c)=>{const h={depth:c,id:[o,`${c}`].filter(Boolean).join("_"),headers:[]},p=[];f.forEach(v=>{const w=[...p].reverse()[0],y=v.column.depth===h.depth;let x,E=!1;if(y&&v.column.parent?x=v.column.parent:(x=v.column,E=!0),w&&w?.column===x)w.subHeaders.push(v);else{const A=Zs(n,x,{id:[o,c,x.id,v?.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${p.filter(L=>L.column===x).length}`:void 0,depth:c,index:p.length});A.subHeaders.push(v),p.push(A)}h.headers.push(v),v.headerGroup=h}),d.push(h),c>0&&u(p,c-1)},_=t.map((f,c)=>Zs(n,f,{depth:a,index:c}));u(_,a-1),d.reverse();const g=f=>f.filter(h=>h.column.getIsVisible()).map(h=>{let p=0,v=0,w=[0];h.subHeaders&&h.subHeaders.length?(w=[],g(h.subHeaders).forEach(x=>{let{colSpan:E,rowSpan:A}=x;p+=E,w.push(A)})):p=1;const y=Math.min(...w);return v=v+y,h.colSpan=p,h.rowSpan=v,{colSpan:p,rowSpan:v}});return g((r=(i=d[0])==null?void 0:i.headers)!=null?r:[]),d}const Mr=(e,t,n,o,r,i,a)=>{let l={id:t,index:o,original:n,depth:r,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(l._valuesCache.hasOwnProperty(d))return l._valuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return l._valuesCache[d]=u.accessorFn(l.original,o),l._valuesCache[d]},getUniqueValues:d=>{if(l._uniqueValuesCache.hasOwnProperty(d))return l._uniqueValuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(l._uniqueValuesCache[d]=u.columnDef.getUniqueValues(l.original,o),l._uniqueValuesCache[d]):(l._uniqueValuesCache[d]=[l.getValue(d)],l._uniqueValuesCache[d])},renderValue:d=>{var u;return(u=l.getValue(d))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>iu(l.subRows,d=>d.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let d=[],u=l;for(;;){const _=u.getParentRow();if(!_)break;d.push(_),u=_}return d.reverse()},getAllCells:ae(()=>[e.getAllLeafColumns()],d=>d.map(u=>su(e,l,u,u.id)),le(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ae(()=>[l.getAllCells()],d=>d.reduce((u,_)=>(u[_.column.id]=_,u),{}),le(e.options,"debugRows","getAllCellsByColumnId"))};for(let d=0;d<e._features.length;d++){const u=e._features[d];u==null||u.createRow==null||u.createRow(l,e)}return l},cu={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()}}},Js=(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))};Js.autoRemove=e=>In(e);const Qs=(e,t,n)=>{var o;return!!(!((o=e.getValue(t))==null||(o=o.toString())==null)&&o.includes(n))};Qs.autoRemove=e=>In(e);const ea=(e,t,n)=>{var o;return((o=e.getValue(t))==null||(o=o.toString())==null?void 0:o.toLowerCase())===n?.toLowerCase()};ea.autoRemove=e=>In(e);const na=(e,t,n)=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(n)};na.autoRemove=e=>In(e);const ta=(e,t,n)=>!n.some(o=>{var r;return!((r=e.getValue(t))!=null&&r.includes(o))});ta.autoRemove=e=>In(e)||!(e!=null&&e.length);const oa=(e,t,n)=>n.some(o=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(o)});oa.autoRemove=e=>In(e)||!(e!=null&&e.length);const ra=(e,t,n)=>e.getValue(t)===n;ra.autoRemove=e=>In(e);const ia=(e,t,n)=>e.getValue(t)==n;ia.autoRemove=e=>In(e);const Nr=(e,t,n)=>{let[o,r]=n;const i=e.getValue(t);return i>=o&&i<=r};Nr.resolveFilterValue=e=>{let[t,n]=e,o=typeof t!="number"?parseFloat(t):t,r=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(o)?-1/0:o,a=n===null||Number.isNaN(r)?1/0:r;if(i>a){const l=i;i=a,a=l}return[i,a]},Nr.autoRemove=e=>In(e)||In(e[0])&&In(e[1]);const Vn={includesString:Js,includesStringSensitive:Qs,equalsString:ea,arrIncludes:na,arrIncludesAll:ta,arrIncludesSome:oa,equals:ra,weakEquals:ia,inNumberRange:Nr};function In(e){return e==null||e===""}const du={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:wn("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=n?.getValue(e.id);return typeof o=="string"?Vn.includesString:typeof o=="number"?Vn.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Vn.equals:Array.isArray(o)?Vn.arrIncludes:Vn.weakEquals},e.getFilterFn=()=>{var n,o;return Ao(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(o=t.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?n:Vn[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,r;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((o=t.options.enableColumnFilters)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(o=>o.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,o;return(n=(o=t.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(o=>{const r=e.getFilterFn(),i=o?.find(_=>_.id===e.id),a=Xn(n,i?i.value:void 0);if(sa(r,a,e)){var l;return(l=o?.filter(_=>_.id!==e.id))!=null?l:[]}const d={id:e.id,value:a};if(i){var u;return(u=o?.map(_=>_.id===e.id?d:_))!=null?u:[]}return o!=null&&o.length?[...o,d]:[d]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),o=r=>{var i;return(i=Xn(t,r))==null?void 0:i.filter(a=>{const l=n.find(d=>d.id===a.id);if(l){const d=l.getFilterFn();if(sa(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 sa(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Fr={sum:(e,t,n)=>n.reduce((o,r)=>{const i=r.getValue(e);return o+(typeof i=="number"?i:0)},0),min:(e,t,n)=>{let o;return n.forEach(r=>{const i=r.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},max:(e,t,n)=>{let o;return n.forEach(r=>{const i=r.getValue(e);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},extent:(e,t,n)=>{let o,r;return n.forEach(i=>{const a=i.getValue(e);a!=null&&(o===void 0?a>=a&&(o=r=a):(o>a&&(o=a),r<a&&(r=a)))}),[o,r]},mean:(e,t)=>{let n=0,o=0;if(t.forEach(r=>{let i=r.getValue(e);i!=null&&(i=+i)>=i&&(++n,o+=i)}),n)return o/n},median:(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!ru(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},uu={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:wn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(o=>o!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,o;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((o=t.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=n?.getValue(e.id);if(typeof o=="number")return Fr.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Fr.extent},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return Ao(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(o=t.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?n:Fr[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,o;e.setGrouping(t?[]:(n=(o=e.initialState)==null?void 0:o.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const o=t.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,o)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=n.subRows)!=null&&r.length)}}};function fu(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 _u={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:wn("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ae(n=>[Tt(t,n)],n=>n.findIndex(o=>o.id===e.id),le(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var o;return((o=Tt(t,n)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;const r=Tt(t,n);return((o=r[r.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ae(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,o)=>r=>{let i=[];if(!(t!=null&&t.length))i=r;else{const a=[...t],l=[...r];for(;l.length&&a.length;){const d=a.shift(),u=l.findIndex(_=>_.id===d);u>-1&&i.push(l.splice(u,1)[0])}i=[...i,...l]}return fu(i,n,o)},le(e.options,"debugTable","_getOrderColumnsFn"))}},Dr=()=>({left:[],right:[]}),gu={getInitialState:e=>({columnPinning:Dr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:wn("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);t.setColumnPinning(r=>{var i,a;if(n==="right"){var l,d;return{left:((l=r?.left)!=null?l:[]).filter(g=>!(o!=null&&o.includes(g))),right:[...((d=r?.right)!=null?d:[]).filter(g=>!(o!=null&&o.includes(g))),...o]}}if(n==="left"){var u,_;return{left:[...((u=r?.left)!=null?u:[]).filter(g=>!(o!=null&&o.includes(g))),...o],right:((_=r?.right)!=null?_:[]).filter(g=>!(o!=null&&o.includes(g)))}}return{left:((i=r?.left)!=null?i:[]).filter(g=>!(o!=null&&o.includes(g))),right:((a=r?.right)!=null?a:[]).filter(g=>!(o!=null&&o.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,i,a;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((i=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(l=>l.id),{left:o,right:r}=t.getState().columnPinning,i=n.some(l=>o?.includes(l)),a=n.some(l=>r?.includes(l));return i?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();return r?(n=(o=t.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,o,r)=>{const i=[...o??[],...r??[]];return n.filter(a=>!i.includes(a.column.id))},le(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,o)=>(o??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),le(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,o)=>(o??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),le(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,o;return e.setColumnPinning(t?Dr():(n=(o=e.initialState)==null?void 0:o.columnPinning)!=null?n:Dr())},e.getIsSomeColumnsPinned=t=>{var n;const o=e.getState().columnPinning;if(!t){var r,i;return!!((r=o.left)!=null&&r.length||(i=o.right)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},e.getLeftLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),le(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),le(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o)=>{const r=[...n??[],...o??[]];return t.filter(i=>!r.includes(i.id))},le(e.options,"debugColumns","getCenterLeafColumns"))}};function pu(e){return e||(typeof document<"u"?document:null)}const Po={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ar=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),hu={getDefaultColumnDef:()=>Po,getInitialState:e=>({columnSizing:{},columnSizingInfo:Ar(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:wn("columnSizing",e),onColumnSizingInfoChange:wn("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,r;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Po.minSize,(o=i??e.columnDef.size)!=null?o:Po.size),(r=e.columnDef.maxSize)!=null?r:Po.maxSize)},e.getStart=ae(n=>[n,Tt(t,n),t.getState().columnSizing],(n,o)=>o.slice(0,e.getIndex(n)).reduce((r,i)=>r+i.getSize(),0),le(t.options,"debugColumns","getStart")),e.getAfter=ae(n=>[n,Tt(t,n),t.getState().columnSizing],(n,o)=>o.slice(e.getIndex(n)+1).reduce((r,i)=>r+i.getSize(),0),le(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:o,...r}=n;return r})},e.getCanResize=()=>{var n,o;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((o=t.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var i;n+=(i=r.column.getSize())!=null?i:0}};return o(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const o=t.getColumn(e.column.id),r=o?.getCanResize();return i=>{if(!o||!r||(i.persist==null||i.persist(),Lr(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=Lr(i)?Math.round(i.touches[0].clientX):i.clientX,u={},_=(w,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(x=>{var E,A;const L=t.options.columnResizeDirection==="rtl"?-1:1,N=(y-((E=x?.startOffset)!=null?E:0))*L,P=Math.max(N/((A=x?.startSize)!=null?A:0),-.999999);return x.columnSizingStart.forEach(z=>{let[I,V]=z;u[I]=Math.round(Math.max(V+V*P,0)*100)/100}),{...x,deltaOffset:N,deltaPercentage:P}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(x=>({...x,...u})))},g=w=>_("move",w),f=w=>{_("end",w),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},c=pu(n),h={moveHandler:w=>g(w.clientX),upHandler:w=>{c?.removeEventListener("mousemove",h.moveHandler),c?.removeEventListener("mouseup",h.upHandler),f(w.clientX)}},p={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),g(w.touches[0].clientX),!1),upHandler:w=>{var y;c?.removeEventListener("touchmove",p.moveHandler),c?.removeEventListener("touchend",p.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),f((y=w.touches[0])==null?void 0:y.clientX)}},v=mu()?{passive:!1}:!1;Lr(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?Ar():(n=e.initialState.columnSizingInfo)!=null?n:Ar())},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 zo=null;function mu(){if(typeof zo=="boolean")return zo;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 zo=e,zo}function Lr(e){return e.type==="touchstart"}const vu={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:wn("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(o=>({...o,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,o;const r=e.columns;return(n=r.length?r.some(i=>i.getIsVisible()):(o=t.getState().columnVisibility)==null?void 0:o[e.id])!=null?n:!0},e.getCanHide=()=>{var n,o;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((o=t.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ae(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),le(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ae(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,o,r)=>[...n,...o,...r],le(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,o)=>ae(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),le(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var o;e.setColumnVisibility(n?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,i)=>({...r,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;e.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}};function Tt(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const bu={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()}}},wu={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:wn("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const o=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,o,r,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=t.options.enableGlobalFilter)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Vn.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return Ao(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[o])!=null?t:Vn[o]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},yu={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:wn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var r,i;e.setExpanded(o?{}:(r=(i=e.initialState)==null?void 0:i.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const a=i.split(".");o=Math.max(o,a.length)}),o},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(o=>{var r;const i=o===!0?!0:!!(o!=null&&o[e.id]);let a={};if(o===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{a[l]=!0}):a=o,n=(r=n)!=null?r:!i,!i&&n)return{...a,[e.id]:!0};if(i&&!n){const{[e.id]:l,...d}=a;return d}return o})},e.getIsExpanded=()=>{var n;const o=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:o===!0||o?.[e.id])},e.getCanExpand=()=>{var n,o,r;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((o=t.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)o=t.getRow(o.parentId,!0),n=o.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Pr=0,zr=10,Tr=()=>({pageIndex:Pr,pageSize:zr}),Cu={getInitialState:e=>({...e,pagination:{...Tr(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:wn("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=o=>{const r=i=>Xn(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?Tr():(r=e.initialState.pagination)!=null?r:Tr())},e.setPageIndex=o=>{e.setPagination(r=>{let i=Xn(o,r.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,a)),{...r,pageIndex:i}})},e.resetPageIndex=o=>{var r,i;e.setPageIndex(o?Pr:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:Pr)},e.resetPageSize=o=>{var r,i;e.setPageSize(o?zr:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:zr)},e.setPageSize=o=>{e.setPagination(r=>{const i=Math.max(1,Xn(o,r.pageSize)),a=r.pageSize*r.pageIndex,l=Math.floor(a/i);return{...r,pageIndex:l,pageSize:i}})},e.setPageCount=o=>e.setPagination(r=>{var i;let a=Xn(o,(i=e.options.pageCount)!=null?i:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...r,pageCount:a}}),e.getPageOptions=ae(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((i,a)=>a)),r},le(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:o}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:o<r-1},e.previousPage=()=>e.setPageIndex(o=>o-1),e.nextPage=()=>e.setPageIndex(o=>o+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var o;return(o=e.options.rowCount)!=null?o:e.getPrePaginationRowModel().rows.length}}},Or=()=>({top:[],bottom:[]}),xu={getInitialState:e=>({rowPinning:Or(),...e}),getDefaultOptions:e=>({onRowPinningChange:wn("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,o,r)=>{const i=o?e.getLeafRows().map(d=>{let{id:u}=d;return u}):[],a=r?e.getParentRows().map(d=>{let{id:u}=d;return u}):[],l=new Set([...a,e.id,...i]);t.setRowPinning(d=>{var u,_;if(n==="bottom"){var g,f;return{top:((g=d?.top)!=null?g:[]).filter(p=>!(l!=null&&l.has(p))),bottom:[...((f=d?.bottom)!=null?f:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)]}}if(n==="top"){var c,h;return{top:[...((c=d?.top)!=null?c:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)],bottom:((h=d?.bottom)!=null?h:[]).filter(p=>!(l!=null&&l.has(p)))}}return{top:((u=d?.top)!=null?u:[]).filter(p=>!(l!=null&&l.has(p))),bottom:((_=d?.bottom)!=null?_:[]).filter(p=>!(l!=null&&l.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:r}=t.options;return typeof o=="function"?o(e):(n=o??r)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:o,bottom:r}=t.getState().rowPinning,i=n.some(l=>o?.includes(l)),a=n.some(l=>r?.includes(l));return i?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();if(!r)return-1;const i=(n=r==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:l}=a;return l});return(o=i?.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?Or():(n=(o=e.initialState)==null?void 0:o.rowPinning)!=null?n:Or())},e.getIsSomeRowsPinned=t=>{var n;const o=e.getState().rowPinning;if(!t){var r,i;return!!((r=o.top)!=null&&r.length||(i=o.bottom)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},e._getPinnedRows=(t,n,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(n??[]).map(a=>{const l=e.getRow(a,!0);return l.getIsAllParentsExpanded()?l:null}):(n??[]).map(a=>t.find(l=>l.id===a))).filter(Boolean).map(a=>({...a,position:o}))},e.getTopRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),le(e.options,"debugRows","getTopRows")),e.getBottomRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),le(e.options,"debugRows","getBottomRows")),e.getCenterRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,o)=>{const r=new Set([...n??[],...o??[]]);return t.filter(i=>!r.has(i.id))},le(e.options,"debugRows","getCenterRows"))}},Su={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:wn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const o={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):r.forEach(i=>{delete o[i.id]}),o})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const o=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(i=>{Vr(r,i.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?jr(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?jr(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?jr(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=!!(t.length&&Object.keys(n).length);return o&&t.some(r=>r.getCanSelect()&&!n[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some(r=>!n[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,o)=>{const r=e.getIsSelected();t.setRowSelection(i=>{var a;if(n=typeof n<"u"?n:!r,e.getCanSelect()&&r===n)return i;const l={...i};return Vr(l,e.id,n,(a=o?.selectChildren)!=null?a:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return qr(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Br(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Br(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return o=>{var r;n&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}}},Vr=(e,t,n,o,r)=>{var i;const a=r.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),a.getCanSelect()&&(e[t]=!0)):delete e[t],o&&(i=a.subRows)!=null&&i.length&&a.getCanSelectSubRows()&&a.subRows.forEach(l=>Vr(e,l.id,n,o,r))};function jr(e,t){const n=e.getState().rowSelection,o=[],r={},i=function(a,l){return a.map(d=>{var u;const _=qr(d,n);if(_&&(o.push(d),r[d.id]=d),(u=d.subRows)!=null&&u.length&&(d={...d,subRows:i(d.subRows)}),_)return d}).filter(Boolean)};return{rows:i(t.rows),flatRows:o,rowsById:r}}function qr(e,t){var n;return(n=t[e.id])!=null?n:!1}function Br(e,t,n){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,i=!1;return e.subRows.forEach(a=>{if(!(i&&!r)&&(a.getCanSelect()&&(qr(a,t)?i=!0:r=!1),a.subRows&&a.subRows.length)){const l=Br(a,t);l==="all"?i=!0:(l==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}const Hr=/([0-9]+)/gm,$u=(e,t,n)=>aa(Yn(e.getValue(n)).toLowerCase(),Yn(t.getValue(n)).toLowerCase()),ku=(e,t,n)=>aa(Yn(e.getValue(n)),Yn(t.getValue(n))),Iu=(e,t,n)=>Gr(Yn(e.getValue(n)).toLowerCase(),Yn(t.getValue(n)).toLowerCase()),Eu=(e,t,n)=>Gr(Yn(e.getValue(n)),Yn(t.getValue(n))),Mu=(e,t,n)=>{const o=e.getValue(n),r=t.getValue(n);return o>r?1:o<r?-1:0},Nu=(e,t,n)=>Gr(e.getValue(n),t.getValue(n));function Gr(e,t){return e===t?0:e>t?1:-1}function Yn(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function aa(e,t){const n=e.split(Hr).filter(Boolean),o=t.split(Hr).filter(Boolean);for(;n.length&&o.length;){const r=n.shift(),i=o.shift(),a=parseInt(r,10),l=parseInt(i,10),d=[a,l].sort();if(isNaN(d[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(d[1]))return isNaN(a)?-1:1;if(a>l)return 1;if(l>a)return-1}return n.length-o.length}const Ot={alphanumeric:$u,alphanumericCaseSensitive:ku,text:Iu,textCaseSensitive:Eu,datetime:Mu,basic:Nu},Fu=[lu,vu,_u,gu,cu,du,bu,wu,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:wn("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const r of n){const i=r?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Ot.datetime;if(typeof i=="string"&&(o=!0,i.split(Hr).length>1))return Ot.alphanumeric}return o?Ot.text:Ot.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw new Error;return Ao(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(o=t.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?n:Ot[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{const r=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(a=>{const l=a?.find(c=>c.id===e.id),d=a?.findIndex(c=>c.id===e.id);let u=[],_,g=i?n:r==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&o?l?_="toggle":_="add":a!=null&&a.length&&d!==a.length-1?_="replace":l?_="toggle":_="replace",_==="toggle"&&(i||r||(_="remove")),_==="add"){var f;u=[...a,{id:e.id,desc:g}],u.splice(0,u.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else _==="toggle"?u=a.map(c=>c.id===e.id?{...c,desc:g}:c):_==="remove"?u=a.filter(c=>c.id!==e.id):u=[{id:e.id,desc:g}];return u})},e.getFirstSortDir=()=>{var n,o;return((n=(o=e.columnDef.sortDescFirst)!=null?o:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var o,r;const i=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==i&&((o=t.options.enableSortingRemoval)==null||o)&&(!(n&&(r=t.options.enableMultiRemove)!=null)||r)?!1:a==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,o;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((o=t.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return(n=(o=e.columnDef.enableMultiSort)!=null?o:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const o=(n=t.getState().sorting)==null?void 0:n.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,o;return(n=(o=t.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return o=>{n&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:(n=(o=e.initialState)==null?void 0:o.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},uu,yu,Cu,xu,Su,hu];function Du(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...Fu,...(t=e._features)!=null?t:[]];let r={_features:o};const i=r._features.reduce((f,c)=>Object.assign(f,c.getDefaultOptions==null?void 0:c.getDefaultOptions(r)),{}),a=f=>r.options.mergeOptions?r.options.mergeOptions(i,f):{...i,...f};let d={...{},...(n=e.initialState)!=null?n:{}};r._features.forEach(f=>{var c;d=(c=f.getInitialState==null?void 0:f.getInitialState(d))!=null?c:d});const u=[];let _=!1;const g={_features:o,options:{...i,...e},initialState:d,_queue:f=>{u.push(f),_||(_=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();_=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{r.setState(r.initialState)},setOptions:f=>{const c=Xn(f,r.options);r.options=a(c)},getState:()=>r.options.state,setState:f=>{r.options.onStateChange==null||r.options.onStateChange(f)},_getRowId:(f,c,h)=>{var p;return(p=r.options.getRowId==null?void 0:r.options.getRowId(f,c,h))!=null?p:`${h?[h.id,c].join("."):c}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(f,c)=>{let h=(c?r.getPrePaginationRowModel():r.getRowModel()).rowsById[f];if(!h&&(h=r.getCoreRowModel().rowsById[f],!h))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${f}`):new Error;return h},_getDefaultColumnDef:ae(()=>[r.options.defaultColumn],f=>{var c;return f=(c=f)!=null?c:{},{header:h=>{const p=h.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:h=>{var p,v;return(p=(v=h.renderValue())==null||v.toString==null?void 0:v.toString())!=null?p:null},...r._features.reduce((h,p)=>Object.assign(h,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...f}},le(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:ae(()=>[r._getColumnDefs()],f=>{const c=function(h,p,v){return v===void 0&&(v=0),h.map(w=>{const y=au(r,w,v,p),x=w;return y.columns=x.columns?c(x.columns,y,v+1):[],y})};return c(f)},le(e,"debugColumns","getAllColumns")),getAllFlatColumns:ae(()=>[r.getAllColumns()],f=>f.flatMap(c=>c.getFlatColumns()),le(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ae(()=>[r.getAllFlatColumns()],f=>f.reduce((c,h)=>(c[h.id]=h,c),{}),le(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ae(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(f,c)=>{let h=f.flatMap(p=>p.getLeafColumns());return c(h)},le(e,"debugColumns","getAllLeafColumns")),getColumn:f=>{const c=r._getAllFlatColumnsById()[f];return process.env.NODE_ENV!=="production"&&!c&&console.error(`[Table] Column with id '${f}' does not exist.`),c}};Object.assign(r,g);for(let f=0;f<r._features.length;f++){const c=r._features[f];c==null||c.createTable==null||c.createTable(r)}return r}function Au(){return e=>ae(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(r,i,a){i===void 0&&(i=0);const l=[];for(let u=0;u<r.length;u++){const _=Mr(e,e._getRowId(r[u],u,a),r[u],u,i,void 0,a?.id);if(n.flatRows.push(_),n.rowsById[_.id]=_,l.push(_),e.options.getSubRows){var d;_.originalSubRows=e.options.getSubRows(r[u],u),(d=_.originalSubRows)!=null&&d.length&&(_.subRows=o(_.originalSubRows,i+1,_))}}return l};return n.rows=o(t),n},le(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Lu(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 Pu(e,t,n){return n.options.filterFromLeafRows?zu(e,t,n):Tu(e,t,n)}function zu(e,t,n){var o;const r=[],i={},a=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,u){u===void 0&&(u=0);const _=[];for(let f=0;f<d.length;f++){var g;let c=d[f];const h=Mr(n,c.id,c.original,c.index,c.depth,void 0,c.parentId);if(h.columnFilters=c.columnFilters,(g=c.subRows)!=null&&g.length&&u<a){if(h.subRows=l(c.subRows,u+1),c=h,t(c)&&!h.subRows.length){_.push(c),i[c.id]=c,r.push(c);continue}if(t(c)||h.subRows.length){_.push(c),i[c.id]=c,r.push(c);continue}}else c=h,t(c)&&(_.push(c),i[c.id]=c,r.push(c))}return _};return{rows:l(e),flatRows:r,rowsById:i}}function Tu(e,t,n){var o;const r=[],i={},a=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,u){u===void 0&&(u=0);const _=[];for(let f=0;f<d.length;f++){let c=d[f];if(t(c)){var g;if((g=c.subRows)!=null&&g.length&&u<a){const p=Mr(n,c.id,c.original,c.index,c.depth,void 0,c.parentId);p.subRows=l(c.subRows,u+1),c=p}_.push(c),r.push(c),i[c.id]=c}}return _};return{rows:l(e),flatRows:r,rowsById:i}}function Ou(){return e=>ae(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,o)=>{if(!t.rows.length||!(n!=null&&n.length)&&!o){for(let f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const r=[],i=[];(n??[]).forEach(f=>{var c;const h=e.getColumn(f.id);if(!h)return;const p=h.getFilterFn();if(!p){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${h.id}.`);return}r.push({id:f.id,filterFn:p,resolvedValue:(c=p.resolveFilterValue==null?void 0:p.resolveFilterValue(f.value))!=null?c:f.value})});const a=(n??[]).map(f=>f.id),l=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());o&&l&&d.length&&(a.push("__global__"),d.forEach(f=>{var c;i.push({id:f.id,filterFn:l,resolvedValue:(c=l.resolveFilterValue==null?void 0:l.resolveFilterValue(o))!=null?c:o})}));let u,_;for(let f=0;f<t.flatRows.length;f++){const c=t.flatRows[f];if(c.columnFilters={},r.length)for(let h=0;h<r.length;h++){u=r[h];const p=u.id;c.columnFilters[p]=u.filterFn(c,p,u.resolvedValue,v=>{c.columnFiltersMeta[p]=v})}if(i.length){for(let h=0;h<i.length;h++){_=i[h];const p=_.id;if(_.filterFn(c,p,_.resolvedValue,v=>{c.columnFiltersMeta[p]=v})){c.columnFilters.__global__=!0;break}}c.columnFilters.__global__!==!0&&(c.columnFilters.__global__=!1)}}const g=f=>{for(let c=0;c<a.length;c++)if(f.columnFilters[a[c]]===!1)return!1;return!0};return Pu(t.rows,g,e)},le(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Vu(e){return t=>ae(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,o)=>{if(!o.rows.length)return o;const{pageSize:r,pageIndex:i}=n;let{rows:a,flatRows:l,rowsById:d}=o;const u=r*i,_=u+r;a=a.slice(u,_);let g;t.options.paginateExpandedRows?g={rows:a,flatRows:l,rowsById:d}:g=Lu({rows:a,flatRows:l,rowsById:d}),g.flatRows=[];const f=c=>{g.flatRows.push(c),c.subRows.length&&c.subRows.forEach(f)};return g.rows.forEach(f),g},le(t.options,"debugTable","getPaginationRowModel"))}function ju(){return e=>ae(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const o=e.getState().sorting,r=[],i=o.filter(d=>{var u;return(u=e.getColumn(d.id))==null?void 0:u.getCanSort()}),a={};i.forEach(d=>{const u=e.getColumn(d.id);u&&(a[d.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const l=d=>{const u=d.map(_=>({..._}));return u.sort((_,g)=>{for(let c=0;c<i.length;c+=1){var f;const h=i[c],p=a[h.id],v=p.sortUndefined,w=(f=h?.desc)!=null?f:!1;let y=0;if(v){const x=_.getValue(h.id),E=g.getValue(h.id),A=x===void 0,L=E===void 0;if(A||L){if(v==="first")return A?-1:1;if(v==="last")return A?1:-1;y=A&&L?0:A?v:-v}}if(y===0&&(y=p.sortingFn(_,g,h.id)),y!==0)return w&&(y*=-1),p.invertSorting&&(y*=-1),y}return _.index-g.index}),u.forEach(_=>{var g;r.push(_),(g=_.subRows)!=null&&g.length&&(_.subRows=l(_.subRows))}),u};return{rows:l(n.rows),flatRows:r,rowsById:n.rowsById}},le(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
19
|
+
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,t?.key)}return a}}function ye(e,n,t,o){return{debug:()=>{var a;return(a=e?.debugAll)!=null?a:e[n]},key:process.env.NODE_ENV==="development"&&t,onChange:o}}function Gu(e,n,t,o){const a=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${n.id}_${t.id}`,row:n,column:t,getValue:()=>n.getValue(o),renderValue:a,getContext:we(()=>[e,t,n,i],(s,l,c,u)=>({table:s,column:l,row:c,cell:u,getValue:u.getValue,renderValue:u.renderValue}),ye(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,t,n,e)},{}),i}function Zu(e,n,t,o){var a,i;const l={...e._getDefaultColumnDef(),...n},c=l.accessorKey;let u=(a=(i=l.id)!=null?i:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?a:typeof l.header=="string"?l.header:void 0,_;if(l.accessorFn?_=l.accessorFn:c&&(c.includes(".")?_=f=>{let d=f;for(const p of c.split(".")){var m;d=(m=d)==null?void 0:m[p],process.env.NODE_ENV!=="production"&&d===void 0&&console.warn(`"${p}" in deeply nested key "${c}" returned undefined.`)}return d}:_=f=>f[l.accessorKey]),!u)throw process.env.NODE_ENV!=="production"?new Error(l.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let g={id:`${String(u)}`,accessorFn:_,parent:o,depth:t,columnDef:l,columns:[],getFlatColumns:we(()=>[!0],()=>{var f;return[g,...(f=g.columns)==null?void 0:f.flatMap(d=>d.getFlatColumns())]},ye(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:we(()=>[e._getOrderColumnsFn()],f=>{var d;if((d=g.columns)!=null&&d.length){let m=g.columns.flatMap(p=>p.getLeafColumns());return f(m)}return[g]},ye(e.options,"debugColumns","column.getLeafColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(g,e);return g}const pt="debugHeaders";function hs(e,n,t){var o;let i={id:(o=t.id)!=null?o:n.id,column:n,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],l=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(l),s.push(c)};return l(i),s},getContext:()=>({table:e,header:i,column:n})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const Uu={createTable:e=>{e.getHeaderGroups=we(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,a)=>{var i,s;const l=(i=o?.map(g=>t.find(f=>f.id===g)).filter(Boolean))!=null?i:[],c=(s=a?.map(g=>t.find(f=>f.id===g)).filter(Boolean))!=null?s:[],u=t.filter(g=>!(o!=null&&o.includes(g.id))&&!(a!=null&&a.includes(g.id)));return Ho(n,[...l,...u,...c],e)},ye(e.options,pt,"getHeaderGroups")),e.getCenterHeaderGroups=we(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,a)=>(t=t.filter(i=>!(o!=null&&o.includes(i.id))&&!(a!=null&&a.includes(i.id))),Ho(n,t,e,"center")),ye(e.options,pt,"getCenterHeaderGroups")),e.getLeftHeaderGroups=we(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,t,o)=>{var a;const i=(a=o?.map(s=>t.find(l=>l.id===s)).filter(Boolean))!=null?a:[];return Ho(n,i,e,"left")},ye(e.options,pt,"getLeftHeaderGroups")),e.getRightHeaderGroups=we(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,t,o)=>{var a;const i=(a=o?.map(s=>t.find(l=>l.id===s)).filter(Boolean))!=null?a:[];return Ho(n,i,e,"right")},ye(e.options,pt,"getRightHeaderGroups")),e.getFooterGroups=we(()=>[e.getHeaderGroups()],n=>[...n].reverse(),ye(e.options,pt,"getFooterGroups")),e.getLeftFooterGroups=we(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),ye(e.options,pt,"getLeftFooterGroups")),e.getCenterFooterGroups=we(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),ye(e.options,pt,"getCenterFooterGroups")),e.getRightFooterGroups=we(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),ye(e.options,pt,"getRightFooterGroups")),e.getFlatHeaders=we(()=>[e.getHeaderGroups()],n=>n.map(t=>t.headers).flat(),ye(e.options,pt,"getFlatHeaders")),e.getLeftFlatHeaders=we(()=>[e.getLeftHeaderGroups()],n=>n.map(t=>t.headers).flat(),ye(e.options,pt,"getLeftFlatHeaders")),e.getCenterFlatHeaders=we(()=>[e.getCenterHeaderGroups()],n=>n.map(t=>t.headers).flat(),ye(e.options,pt,"getCenterFlatHeaders")),e.getRightFlatHeaders=we(()=>[e.getRightHeaderGroups()],n=>n.map(t=>t.headers).flat(),ye(e.options,pt,"getRightFlatHeaders")),e.getCenterLeafHeaders=we(()=>[e.getCenterFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ye(e.options,pt,"getCenterLeafHeaders")),e.getLeftLeafHeaders=we(()=>[e.getLeftFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ye(e.options,pt,"getLeftLeafHeaders")),e.getRightLeafHeaders=we(()=>[e.getRightFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ye(e.options,pt,"getRightLeafHeaders")),e.getLeafHeaders=we(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,t,o)=>{var a,i,s,l,c,u;return[...(a=(i=n[0])==null?void 0:i.headers)!=null?a:[],...(s=(l=t[0])==null?void 0:l.headers)!=null?s:[],...(c=(u=o[0])==null?void 0:u.headers)!=null?c:[]].map(_=>_.getLeafHeaders()).flat()},ye(e.options,pt,"getLeafHeaders"))}};function Ho(e,n,t,o){var a,i;let s=0;const l=function(f,d){d===void 0&&(d=1),s=Math.max(s,d),f.filter(m=>m.getIsVisible()).forEach(m=>{var p;(p=m.columns)!=null&&p.length&&l(m.columns,d+1)},0)};l(e);let c=[];const u=(f,d)=>{const m={depth:d,id:[o,`${d}`].filter(Boolean).join("_"),headers:[]},p=[];f.forEach(v=>{const y=[...p].reverse()[0],w=v.column.depth===m.depth;let C,k=!1;if(w&&v.column.parent?C=v.column.parent:(C=v.column,k=!0),y&&y?.column===C)y.subHeaders.push(v);else{const z=hs(t,C,{id:[o,d,C.id,v?.id].filter(Boolean).join("_"),isPlaceholder:k,placeholderId:k?`${p.filter(A=>A.column===C).length}`:void 0,depth:d,index:p.length});z.subHeaders.push(v),p.push(z)}m.headers.push(v),v.headerGroup=m}),c.push(m),d>0&&u(p,d-1)},_=n.map((f,d)=>hs(t,f,{depth:s,index:d}));u(_,s-1),c.reverse();const g=f=>f.filter(m=>m.column.getIsVisible()).map(m=>{let p=0,v=0,y=[0];m.subHeaders&&m.subHeaders.length?(y=[],g(m.subHeaders).forEach(C=>{let{colSpan:k,rowSpan:z}=C;p+=k,y.push(z)})):p=1;const w=Math.min(...y);return v=v+w,m.colSpan=p,m.rowSpan=v,{colSpan:p,rowSpan:v}});return g((a=(i=c[0])==null?void 0:i.headers)!=null?a:[]),c}const Zr=(e,n,t,o,a,i,s)=>{let l={id:n,index:o,original:t,depth:a,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(l._valuesCache.hasOwnProperty(c))return l._valuesCache[c];const u=e.getColumn(c);if(u!=null&&u.accessorFn)return l._valuesCache[c]=u.accessorFn(l.original,o),l._valuesCache[c]},getUniqueValues:c=>{if(l._uniqueValuesCache.hasOwnProperty(c))return l._uniqueValuesCache[c];const u=e.getColumn(c);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(l._uniqueValuesCache[c]=u.columnDef.getUniqueValues(l.original,o),l._uniqueValuesCache[c]):(l._uniqueValuesCache[c]=[l.getValue(c)],l._uniqueValuesCache[c])},renderValue:c=>{var u;return(u=l.getValue(c))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Wu(l.subRows,c=>c.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let c=[],u=l;for(;;){const _=u.getParentRow();if(!_)break;c.push(_),u=_}return c.reverse()},getAllCells:we(()=>[e.getAllLeafColumns()],c=>c.map(u=>Gu(e,l,u,u.id)),ye(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:we(()=>[l.getAllCells()],c=>c.reduce((u,_)=>(u[_.column.id]=_,u),{}),ye(e.options,"debugRows","getAllCellsByColumnId"))};for(let c=0;c<e._features.length;c++){const u=e._features[c];u==null||u.createRow==null||u.createRow(l,e)}return l},Ku={createColumn:(e,n)=>{e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},ms=(e,n,t)=>{var o,a;const i=t==null||(o=t.toString())==null?void 0:o.toLowerCase();return!!(!((a=e.getValue(n))==null||(a=a.toString())==null||(a=a.toLowerCase())==null)&&a.includes(i))};ms.autoRemove=e=>zt(e);const vs=(e,n,t)=>{var o;return!!(!((o=e.getValue(n))==null||(o=o.toString())==null)&&o.includes(t))};vs.autoRemove=e=>zt(e);const bs=(e,n,t)=>{var o;return((o=e.getValue(n))==null||(o=o.toString())==null?void 0:o.toLowerCase())===t?.toLowerCase()};bs.autoRemove=e=>zt(e);const ws=(e,n,t)=>{var o;return(o=e.getValue(n))==null?void 0:o.includes(t)};ws.autoRemove=e=>zt(e);const ys=(e,n,t)=>!t.some(o=>{var a;return!((a=e.getValue(n))!=null&&a.includes(o))});ys.autoRemove=e=>zt(e)||!(e!=null&&e.length);const Cs=(e,n,t)=>t.some(o=>{var a;return(a=e.getValue(n))==null?void 0:a.includes(o)});Cs.autoRemove=e=>zt(e)||!(e!=null&&e.length);const xs=(e,n,t)=>e.getValue(n)===t;xs.autoRemove=e=>zt(e);const $s=(e,n,t)=>e.getValue(n)==t;$s.autoRemove=e=>zt(e);const Ur=(e,n,t)=>{let[o,a]=t;const i=e.getValue(n);return i>=o&&i<=a};Ur.resolveFilterValue=e=>{let[n,t]=e,o=typeof n!="number"?parseFloat(n):n,a=typeof t!="number"?parseFloat(t):t,i=n===null||Number.isNaN(o)?-1/0:o,s=t===null||Number.isNaN(a)?1/0:a;if(i>s){const l=i;i=s,s=l}return[i,s]},Ur.autoRemove=e=>zt(e)||zt(e[0])&&zt(e[1]);const Wt={includesString:ms,includesStringSensitive:vs,equalsString:bs,arrIncludes:ws,arrIncludesAll:ys,arrIncludesSome:Cs,equals:xs,weakEquals:$s,inNumberRange:Ur};function zt(e){return e==null||e===""}const Xu={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:$t("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const t=n.getCoreRowModel().flatRows[0],o=t?.getValue(e.id);return typeof o=="string"?Wt.includesString:typeof o=="number"?Wt.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Wt.equals:Array.isArray(o)?Wt.arrIncludes:Wt.weakEquals},e.getFilterFn=()=>{var t,o;return qo(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(t=(o=n.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?t:Wt[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,o,a;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((o=n.options.enableColumnFilters)!=null?o:!0)&&((a=n.options.enableFilters)!=null?a:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=n.getState().columnFilters)==null||(t=t.find(o=>o.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,o;return(t=(o=n.getState().columnFilters)==null?void 0:o.findIndex(a=>a.id===e.id))!=null?t:-1},e.setFilterValue=t=>{n.setColumnFilters(o=>{const a=e.getFilterFn(),i=o?.find(_=>_.id===e.id),s=Rt(t,i?i.value:void 0);if(Ss(a,s,e)){var l;return(l=o?.filter(_=>_.id!==e.id))!=null?l:[]}const c={id:e.id,value:s};if(i){var u;return(u=o?.map(_=>_.id===e.id?c:_))!=null?u:[]}return o!=null&&o.length?[...o,c]:[c]})}},createRow:(e,n)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=n=>{const t=e.getAllLeafColumns(),o=a=>{var i;return(i=Rt(n,a))==null?void 0:i.filter(s=>{const l=t.find(c=>c.id===s.id);if(l){const c=l.getFilterFn();if(Ss(c,s.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=n=>{var t,o;e.setColumnFilters(n?[]:(t=(o=e.initialState)==null?void 0:o.columnFilters)!=null?t:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Ss(e,n,t){return(e&&e.autoRemove?e.autoRemove(n,t):!1)||typeof n>"u"||typeof n=="string"&&!n}const Kr={sum:(e,n,t)=>t.reduce((o,a)=>{const i=a.getValue(e);return o+(typeof i=="number"?i:0)},0),min:(e,n,t)=>{let o;return t.forEach(a=>{const i=a.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},max:(e,n,t)=>{let o;return t.forEach(a=>{const i=a.getValue(e);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},extent:(e,n,t)=>{let o,a;return t.forEach(i=>{const s=i.getValue(e);s!=null&&(o===void 0?s>=s&&(o=a=s):(o>s&&(o=s),a<s&&(a=s)))}),[o,a]},mean:(e,n)=>{let t=0,o=0;if(n.forEach(a=>{let i=a.getValue(e);i!=null&&(i=+i)>=i&&(++t,o+=i)}),t)return o/t},median:(e,n)=>{if(!n.length)return;const t=n.map(i=>i.getValue(e));if(!Hu(t))return;if(t.length===1)return t[0];const o=Math.floor(t.length/2),a=t.sort((i,s)=>i-s);return t.length%2!==0?a[o]:(a[o-1]+a[o])/2},unique:(e,n)=>Array.from(new Set(n.map(t=>t.getValue(e))).values()),uniqueCount:(e,n)=>new Set(n.map(t=>t.getValue(e))).size,count:(e,n)=>n.length},Yu={getDefaultColumnDef:()=>({aggregatedCell:e=>{var n,t;return(n=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?n:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:$t("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,n)=>{e.toggleGrouping=()=>{n.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(o=>o!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,o;return((t=e.columnDef.enableGrouping)!=null?t:!0)&&((o=n.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var t;return(t=n.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=n.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=n.getCoreRowModel().flatRows[0],o=t?.getValue(e.id);if(typeof o=="number")return Kr.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Kr.extent},e.getAggregationFn=()=>{var t,o;if(!e)throw new Error;return qo(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(t=(o=n.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?t:Kr[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=n=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(n),e.resetGrouping=n=>{var t,o;e.setGrouping(n?[]:(t=(o=e.initialState)==null?void 0:o.grouping)!=null?t:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,n)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const o=n.getColumn(t);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[t]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,n,t,o)=>{e.getIsGrouped=()=>n.getIsGrouped()&&n.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&n.getIsGrouped(),e.getIsAggregated=()=>{var a;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((a=t.subRows)!=null&&a.length)}}};function Ju(e,n,t){if(!(n!=null&&n.length)||!t)return e;const o=e.filter(i=>!n.includes(i.id));return t==="remove"?o:[...n.map(i=>e.find(s=>s.id===i)).filter(Boolean),...o]}const Qu={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$t("columnOrder",e)}),createColumn:(e,n)=>{e.getIndex=we(t=>[Zn(n,t)],t=>t.findIndex(o=>o.id===e.id),ye(n.options,"debugColumns","getIndex")),e.getIsFirstColumn=t=>{var o;return((o=Zn(n,t)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=t=>{var o;const a=Zn(n,t);return((o=a[a.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=n=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(n),e.resetColumnOrder=n=>{var t;e.setColumnOrder(n?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=we(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,t,o)=>a=>{let i=[];if(!(n!=null&&n.length))i=a;else{const s=[...n],l=[...a];for(;l.length&&s.length;){const c=s.shift(),u=l.findIndex(_=>_.id===c);u>-1&&i.push(l.splice(u,1)[0])}i=[...i,...l]}return Ju(i,t,o)},ye(e.options,"debugTable","_getOrderColumnsFn"))}},Xr=()=>({left:[],right:[]}),Ru={getInitialState:e=>({columnPinning:Xr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:$t("columnPinning",e)}),createColumn:(e,n)=>{e.pin=t=>{const o=e.getLeafColumns().map(a=>a.id).filter(Boolean);n.setColumnPinning(a=>{var i,s;if(t==="right"){var l,c;return{left:((l=a?.left)!=null?l:[]).filter(g=>!(o!=null&&o.includes(g))),right:[...((c=a?.right)!=null?c:[]).filter(g=>!(o!=null&&o.includes(g))),...o]}}if(t==="left"){var u,_;return{left:[...((u=a?.left)!=null?u:[]).filter(g=>!(o!=null&&o.includes(g))),...o],right:((_=a?.right)!=null?_:[]).filter(g=>!(o!=null&&o.includes(g)))}}return{left:((i=a?.left)!=null?i:[]).filter(g=>!(o!=null&&o.includes(g))),right:((s=a?.right)!=null?s:[]).filter(g=>!(o!=null&&o.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var a,i,s;return((a=o.columnDef.enablePinning)!=null?a:!0)&&((i=(s=n.options.enableColumnPinning)!=null?s:n.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(l=>l.id),{left:o,right:a}=n.getState().columnPinning,i=t.some(l=>o?.includes(l)),s=t.some(l=>a?.includes(l));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var t,o;const a=e.getIsPinned();return a?(t=(o=n.getState().columnPinning)==null||(o=o[a])==null?void 0:o.indexOf(e.id))!=null?t:-1:0}},createRow:(e,n)=>{e.getCenterVisibleCells=we(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(t,o,a)=>{const i=[...o??[],...a??[]];return t.filter(s=>!i.includes(s.column.id))},ye(n.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=we(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left],(t,o)=>(o??[]).map(i=>t.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ye(n.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=we(()=>[e._getAllVisibleCells(),n.getState().columnPinning.right],(t,o)=>(o??[]).map(i=>t.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ye(n.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=n=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(n),e.resetColumnPinning=n=>{var t,o;return e.setColumnPinning(n?Xr():(t=(o=e.initialState)==null?void 0:o.columnPinning)!=null?t:Xr())},e.getIsSomeColumnsPinned=n=>{var t;const o=e.getState().columnPinning;if(!n){var a,i;return!!((a=o.left)!=null&&a.length||(i=o.right)!=null&&i.length)}return!!((t=o[n])!=null&&t.length)},e.getLeftLeafColumns=we(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,t)=>(t??[]).map(o=>n.find(a=>a.id===o)).filter(Boolean),ye(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=we(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,t)=>(t??[]).map(o=>n.find(a=>a.id===o)).filter(Boolean),ye(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=we(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o)=>{const a=[...t??[],...o??[]];return n.filter(i=>!a.includes(i.id))},ye(e.options,"debugColumns","getCenterLeafColumns"))}};function e_(e){return e||(typeof document<"u"?document:null)}const Wo={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Yr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),t_={getDefaultColumnDef:()=>Wo,getInitialState:e=>({columnSizing:{},columnSizingInfo:Yr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:$t("columnSizing",e),onColumnSizingInfoChange:$t("columnSizingInfo",e)}),createColumn:(e,n)=>{e.getSize=()=>{var t,o,a;const i=n.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:Wo.minSize,(o=i??e.columnDef.size)!=null?o:Wo.size),(a=e.columnDef.maxSize)!=null?a:Wo.maxSize)},e.getStart=we(t=>[t,Zn(n,t),n.getState().columnSizing],(t,o)=>o.slice(0,e.getIndex(t)).reduce((a,i)=>a+i.getSize(),0),ye(n.options,"debugColumns","getStart")),e.getAfter=we(t=>[t,Zn(n,t),n.getState().columnSizing],(t,o)=>o.slice(e.getIndex(t)+1).reduce((a,i)=>a+i.getSize(),0),ye(n.options,"debugColumns","getAfter")),e.resetSize=()=>{n.setColumnSizing(t=>{let{[e.id]:o,...a}=t;return a})},e.getCanResize=()=>{var t,o;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((o=n.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>n.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,n)=>{e.getSize=()=>{let t=0;const o=a=>{if(a.subHeaders.length)a.subHeaders.forEach(o);else{var i;t+=(i=a.column.getSize())!=null?i:0}};return o(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=t=>{const o=n.getColumn(e.column.id),a=o?.getCanResize();return i=>{if(!o||!a||(i.persist==null||i.persist(),Jr(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),l=e?e.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[o.id,o.getSize()]],c=Jr(i)?Math.round(i.touches[0].clientX):i.clientX,u={},_=(y,w)=>{typeof w=="number"&&(n.setColumnSizingInfo(C=>{var k,z;const A=n.options.columnResizeDirection==="rtl"?-1:1,N=(w-((k=C?.startOffset)!=null?k:0))*A,P=Math.max(N/((z=C?.startSize)!=null?z:0),-.999999);return C.columnSizingStart.forEach(O=>{let[E,T]=O;u[E]=Math.round(Math.max(T+T*P,0)*100)/100}),{...C,deltaOffset:N,deltaPercentage:P}}),(n.options.columnResizeMode==="onChange"||y==="end")&&n.setColumnSizing(C=>({...C,...u})))},g=y=>_("move",y),f=y=>{_("end",y),n.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},d=e_(t),m={moveHandler:y=>g(y.clientX),upHandler:y=>{d?.removeEventListener("mousemove",m.moveHandler),d?.removeEventListener("mouseup",m.upHandler),f(y.clientX)}},p={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),g(y.touches[0].clientX),!1),upHandler:y=>{var w;d?.removeEventListener("touchmove",p.moveHandler),d?.removeEventListener("touchend",p.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),f((w=y.touches[0])==null?void 0:w.clientX)}},v=n_()?{passive:!1}:!1;Jr(i)?(d?.addEventListener("touchmove",p.moveHandler,v),d?.addEventListener("touchend",p.upHandler,v)):(d?.addEventListener("mousemove",m.moveHandler,v),d?.addEventListener("mouseup",m.upHandler,v)),n.setColumnSizingInfo(y=>({...y,startOffset:c,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=n=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(n),e.setColumnSizingInfo=n=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(n),e.resetColumnSizing=n=>{var t;e.setColumnSizing(n?{}:(t=e.initialState.columnSizing)!=null?t:{})},e.resetHeaderSizeInfo=n=>{var t;e.setColumnSizingInfo(n?Yr():(t=e.initialState.columnSizingInfo)!=null?t:Yr())},e.getTotalSize=()=>{var n,t;return(n=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((o,a)=>o+a.getSize(),0))!=null?n:0},e.getLeftTotalSize=()=>{var n,t;return(n=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((o,a)=>o+a.getSize(),0))!=null?n:0},e.getCenterTotalSize=()=>{var n,t;return(n=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((o,a)=>o+a.getSize(),0))!=null?n:0},e.getRightTotalSize=()=>{var n,t;return(n=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((o,a)=>o+a.getSize(),0))!=null?n:0}}};let Go=null;function n_(){if(typeof Go=="boolean")return Go;let e=!1;try{const n={get passive(){return e=!0,!1}},t=()=>{};window.addEventListener("test",t,n),window.removeEventListener("test",t)}catch{e=!1}return Go=e,Go}function Jr(e){return e.type==="touchstart"}const o_={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:$t("columnVisibility",e)}),createColumn:(e,n)=>{e.toggleVisibility=t=>{e.getCanHide()&&n.setColumnVisibility(o=>({...o,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,o;const a=e.columns;return(t=a.length?a.some(i=>i.getIsVisible()):(o=n.getState().columnVisibility)==null?void 0:o[e.id])!=null?t:!0},e.getCanHide=()=>{var t,o;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((o=n.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,n)=>{e._getAllVisibleCells=we(()=>[e.getAllCells(),n.getState().columnVisibility],t=>t.filter(o=>o.column.getIsVisible()),ye(n.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=we(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,o,a)=>[...t,...o,...a],ye(n.options,"debugRows","getVisibleCells"))},createTable:e=>{const n=(t,o)=>we(()=>[o(),o().filter(a=>a.getIsVisible()).map(a=>a.id).join("_")],a=>a.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ye(e.options,"debugColumns",t));e.getVisibleFlatColumns=n("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=n("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=n("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=n("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=n("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var o;e.setColumnVisibility(t?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=t=>{var o;t=(o=t)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((a,i)=>({...a,[i.id]:t||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(t=>!(t.getIsVisible!=null&&t.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(t=>t.getIsVisible==null?void 0:t.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var o;e.toggleAllColumnsVisible((o=t.target)==null?void 0:o.checked)}}};function Zn(e,n){return n?n==="center"?e.getCenterVisibleLeafColumns():n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const r_={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()}}},a_={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:$t("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:n=>{var t;const o=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[n.id])==null?void 0:t.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,n)=>{e.getCanGlobalFilter=()=>{var t,o,a,i;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((o=n.options.enableGlobalFilter)!=null?o:!0)&&((a=n.options.enableFilters)!=null?a:!0)&&((i=n.options.getColumnCanGlobalFilter==null?void 0:n.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Wt.includesString,e.getGlobalFilterFn=()=>{var n,t;const{globalFilterFn:o}=e.options;return qo(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(n=(t=e.options.filterFns)==null?void 0:t[o])!=null?n:Wt[o]},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)}}},i_={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:$t("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let n=!1,t=!1;e._autoResetExpanded=()=>{var o,a;if(!n){e._queue(()=>{n=!0});return}if((o=(a=e.options.autoResetAll)!=null?a:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var a,i;e.setExpanded(o?{}:(a=(i=e.initialState)==null?void 0:i.expanded)!=null?a:{})},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(a=>!a.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");o=Math.max(o,s.length)}),o},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,n)=>{e.toggleExpanded=t=>{n.setExpanded(o=>{var a;const i=o===!0?!0:!!(o!=null&&o[e.id]);let s={};if(o===!0?Object.keys(n.getRowModel().rowsById).forEach(l=>{s[l]=!0}):s=o,t=(a=t)!=null?a:!i,!i&&t)return{...s,[e.id]:!0};if(i&&!t){const{[e.id]:l,...c}=s;return c}return o})},e.getIsExpanded=()=>{var t;const o=n.getState().expanded;return!!((t=n.options.getIsRowExpanded==null?void 0:n.options.getIsRowExpanded(e))!=null?t:o===!0||o?.[e.id])},e.getCanExpand=()=>{var t,o,a;return(t=n.options.getRowCanExpand==null?void 0:n.options.getRowCanExpand(e))!=null?t:((o=n.options.enableExpanding)!=null?o:!0)&&!!((a=e.subRows)!=null&&a.length)},e.getIsAllParentsExpanded=()=>{let t=!0,o=e;for(;t&&o.parentId;)o=n.getRow(o.parentId,!0),t=o.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},Qr=0,Rr=10,ea=()=>({pageIndex:Qr,pageSize:Rr}),s_={getInitialState:e=>({...e,pagination:{...ea(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:$t("pagination",e)}),createTable:e=>{let n=!1,t=!1;e._autoResetPageIndex=()=>{var o,a;if(!n){e._queue(()=>{n=!0});return}if((o=(a=e.options.autoResetAll)!=null?a:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=o=>{const a=i=>Rt(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(a)},e.resetPagination=o=>{var a;e.setPagination(o?ea():(a=e.initialState.pagination)!=null?a:ea())},e.setPageIndex=o=>{e.setPagination(a=>{let i=Rt(o,a.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...a,pageIndex:i}})},e.resetPageIndex=o=>{var a,i;e.setPageIndex(o?Qr:(a=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?a:Qr)},e.resetPageSize=o=>{var a,i;e.setPageSize(o?Rr:(a=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?a:Rr)},e.setPageSize=o=>{e.setPagination(a=>{const i=Math.max(1,Rt(o,a.pageSize)),s=a.pageSize*a.pageIndex,l=Math.floor(s/i);return{...a,pageIndex:l,pageSize:i}})},e.setPageCount=o=>e.setPagination(a=>{var i;let s=Rt(o,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...a,pageCount:s}}),e.getPageOptions=we(()=>[e.getPageCount()],o=>{let a=[];return o&&o>0&&(a=[...new Array(o)].fill(null).map((i,s)=>s)),a},ye(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:o}=e.getState().pagination,a=e.getPageCount();return a===-1?!0:a===0?!1:o<a-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}}},ta=()=>({top:[],bottom:[]}),l_={getInitialState:e=>({rowPinning:ta(),...e}),getDefaultOptions:e=>({onRowPinningChange:$t("rowPinning",e)}),createRow:(e,n)=>{e.pin=(t,o,a)=>{const i=o?e.getLeafRows().map(c=>{let{id:u}=c;return u}):[],s=a?e.getParentRows().map(c=>{let{id:u}=c;return u}):[],l=new Set([...s,e.id,...i]);n.setRowPinning(c=>{var u,_;if(t==="bottom"){var g,f;return{top:((g=c?.top)!=null?g:[]).filter(p=>!(l!=null&&l.has(p))),bottom:[...((f=c?.bottom)!=null?f:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)]}}if(t==="top"){var d,m;return{top:[...((d=c?.top)!=null?d:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)],bottom:((m=c?.bottom)!=null?m:[]).filter(p=>!(l!=null&&l.has(p)))}}return{top:((u=c?.top)!=null?u:[]).filter(p=>!(l!=null&&l.has(p))),bottom:((_=c?.bottom)!=null?_:[]).filter(p=>!(l!=null&&l.has(p)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:o,enablePinning:a}=n.options;return typeof o=="function"?o(e):(t=o??a)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:o,bottom:a}=n.getState().rowPinning,i=t.some(l=>o?.includes(l)),s=t.some(l=>a?.includes(l));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var t,o;const a=e.getIsPinned();if(!a)return-1;const i=(t=a==="top"?n.getTopRows():n.getBottomRows())==null?void 0:t.map(s=>{let{id:l}=s;return l});return(o=i?.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=n=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(n),e.resetRowPinning=n=>{var t,o;return e.setRowPinning(n?ta():(t=(o=e.initialState)==null?void 0:o.rowPinning)!=null?t:ta())},e.getIsSomeRowsPinned=n=>{var t;const o=e.getState().rowPinning;if(!n){var a,i;return!!((a=o.top)!=null&&a.length||(i=o.bottom)!=null&&i.length)}return!!((t=o[n])!=null&&t.length)},e._getPinnedRows=(n,t,o)=>{var a;return((a=e.options.keepPinnedRows)==null||a?(t??[]).map(s=>{const l=e.getRow(s,!0);return l.getIsAllParentsExpanded()?l:null}):(t??[]).map(s=>n.find(l=>l.id===s))).filter(Boolean).map(s=>({...s,position:o}))},e.getTopRows=we(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(n,t)=>e._getPinnedRows(n,t,"top"),ye(e.options,"debugRows","getTopRows")),e.getBottomRows=we(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(n,t)=>e._getPinnedRows(n,t,"bottom"),ye(e.options,"debugRows","getBottomRows")),e.getCenterRows=we(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(n,t,o)=>{const a=new Set([...t??[],...o??[]]);return n.filter(i=>!a.has(i.id))},ye(e.options,"debugRows","getCenterRows"))}},c_={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:$t("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=n=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(n),e.resetRowSelection=n=>{var t;return e.setRowSelection(n?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=n=>{e.setRowSelection(t=>{n=typeof n<"u"?n:!e.getIsAllRowsSelected();const o={...t},a=e.getPreGroupedRowModel().flatRows;return n?a.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):a.forEach(i=>{delete o[i.id]}),o})},e.toggleAllPageRowsSelected=n=>e.setRowSelection(t=>{const o=typeof n<"u"?n:!e.getIsAllPageRowsSelected(),a={...t};return e.getRowModel().rows.forEach(i=>{na(a,i.id,o,!0,e)}),a}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=we(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,t)=>Object.keys(n).length?oa(e,t):{rows:[],flatRows:[],rowsById:{}},ye(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=we(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,t)=>Object.keys(n).length?oa(e,t):{rows:[],flatRows:[],rowsById:{}},ye(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=we(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,t)=>Object.keys(n).length?oa(e,t):{rows:[],flatRows:[],rowsById:{}},ye(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const n=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let o=!!(n.length&&Object.keys(t).length);return o&&n.some(a=>a.getCanSelect()&&!t[a.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows.filter(a=>a.getCanSelect()),{rowSelection:t}=e.getState();let o=!!n.length;return o&&n.some(a=>!t[a.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var n;const t=Object.keys((n=e.getState().rowSelection)!=null?n:{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:n.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>n=>{e.toggleAllRowsSelected(n.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>n=>{e.toggleAllPageRowsSelected(n.target.checked)}},createRow:(e,n)=>{e.toggleSelected=(t,o)=>{const a=e.getIsSelected();n.setRowSelection(i=>{var s;if(t=typeof t<"u"?t:!a,e.getCanSelect()&&a===t)return i;const l={...i};return na(l,e.id,t,(s=o?.selectChildren)!=null?s:!0,n),l})},e.getIsSelected=()=>{const{rowSelection:t}=n.getState();return ra(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=n.getState();return aa(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=n.getState();return aa(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof n.options.enableRowSelection=="function"?n.options.enableRowSelection(e):(t=n.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof n.options.enableSubRowSelection=="function"?n.options.enableSubRowSelection(e):(t=n.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof n.options.enableMultiRowSelection=="function"?n.options.enableMultiRowSelection(e):(t=n.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return o=>{var a;t&&e.toggleSelected((a=o.target)==null?void 0:a.checked)}}}},na=(e,n,t,o,a)=>{var i;const s=a.getRow(n,!0);t?(s.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),s.getCanSelect()&&(e[n]=!0)):delete e[n],o&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(l=>na(e,l.id,t,o,a))};function oa(e,n){const t=e.getState().rowSelection,o=[],a={},i=function(s,l){return s.map(c=>{var u;const _=ra(c,t);if(_&&(o.push(c),a[c.id]=c),(u=c.subRows)!=null&&u.length&&(c={...c,subRows:i(c.subRows)}),_)return c}).filter(Boolean)};return{rows:i(n.rows),flatRows:o,rowsById:a}}function ra(e,n){var t;return(t=n[e.id])!=null?t:!1}function aa(e,n,t){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let a=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!a)&&(s.getCanSelect()&&(ra(s,n)?i=!0:a=!1),s.subRows&&s.subRows.length)){const l=aa(s,n);l==="all"?i=!0:(l==="some"&&(i=!0),a=!1)}}),a?"all":i?"some":!1}const ia=/([0-9]+)/gm,d_=(e,n,t)=>ks(en(e.getValue(t)).toLowerCase(),en(n.getValue(t)).toLowerCase()),u_=(e,n,t)=>ks(en(e.getValue(t)),en(n.getValue(t))),__=(e,n,t)=>sa(en(e.getValue(t)).toLowerCase(),en(n.getValue(t)).toLowerCase()),f_=(e,n,t)=>sa(en(e.getValue(t)),en(n.getValue(t))),p_=(e,n,t)=>{const o=e.getValue(t),a=n.getValue(t);return o>a?1:o<a?-1:0},g_=(e,n,t)=>sa(e.getValue(t),n.getValue(t));function sa(e,n){return e===n?0:e>n?1:-1}function en(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function ks(e,n){const t=e.split(ia).filter(Boolean),o=n.split(ia).filter(Boolean);for(;t.length&&o.length;){const a=t.shift(),i=o.shift(),s=parseInt(a,10),l=parseInt(i,10),c=[s,l].sort();if(isNaN(c[0])){if(a>i)return 1;if(i>a)return-1;continue}if(isNaN(c[1]))return isNaN(s)?-1:1;if(s>l)return 1;if(l>s)return-1}return t.length-o.length}const Un={alphanumeric:d_,alphanumericCaseSensitive:u_,text:__,textCaseSensitive:f_,datetime:p_,basic:g_},h_=[Uu,o_,Qu,Ru,Ku,Xu,r_,a_,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:$t("sorting",e),isMultiSortEvent:n=>n.shiftKey}),createColumn:(e,n)=>{e.getAutoSortingFn=()=>{const t=n.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const a of t){const i=a?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Un.datetime;if(typeof i=="string"&&(o=!0,i.split(ia).length>1))return Un.alphanumeric}return o?Un.text:Un.basic},e.getAutoSortDir=()=>{const t=n.getFilteredRowModel().flatRows[0];return typeof t?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,o;if(!e)throw new Error;return qo(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(t=(o=n.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?t:Un[e.columnDef.sortingFn]},e.toggleSorting=(t,o)=>{const a=e.getNextSortingOrder(),i=typeof t<"u"&&t!==null;n.setSorting(s=>{const l=s?.find(d=>d.id===e.id),c=s?.findIndex(d=>d.id===e.id);let u=[],_,g=i?t:a==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&o?l?_="toggle":_="add":s!=null&&s.length&&c!==s.length-1?_="replace":l?_="toggle":_="replace",_==="toggle"&&(i||a||(_="remove")),_==="add"){var f;u=[...s,{id:e.id,desc:g}],u.splice(0,u.length-((f=n.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else _==="toggle"?u=s.map(d=>d.id===e.id?{...d,desc:g}:d):_==="remove"?u=s.filter(d=>d.id!==e.id):u=[{id:e.id,desc:g}];return u})},e.getFirstSortDir=()=>{var t,o;return((t=(o=e.columnDef.sortDescFirst)!=null?o:n.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var o,a;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((o=n.options.enableSortingRemoval)==null||o)&&(!(t&&(a=n.options.enableMultiRemove)!=null)||a)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var t,o;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((o=n.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,o;return(t=(o=e.columnDef.enableMultiSort)!=null?o:n.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const o=(t=n.getState().sorting)==null?void 0:t.find(a=>a.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,o;return(t=(o=n.getState().sorting)==null?void 0:o.findIndex(a=>a.id===e.id))!=null?t:-1},e.clearSorting=()=>{n.setSorting(t=>t!=null&&t.length?t.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return o=>{t&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?n.options.isMultiSortEvent==null?void 0:n.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=n=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(n),e.resetSorting=n=>{var t,o;e.setSorting(n?[]:(t=(o=e.initialState)==null?void 0:o.sorting)!=null?t:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Yu,i_,s_,l_,c_,t_];function m_(e){var n,t;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...h_,...(n=e._features)!=null?n:[]];let a={_features:o};const i=a._features.reduce((f,d)=>Object.assign(f,d.getDefaultOptions==null?void 0:d.getDefaultOptions(a)),{}),s=f=>a.options.mergeOptions?a.options.mergeOptions(i,f):{...i,...f};let c={...{},...(t=e.initialState)!=null?t:{}};a._features.forEach(f=>{var d;c=(d=f.getInitialState==null?void 0:f.getInitialState(c))!=null?d:c});const u=[];let _=!1;const g={_features:o,options:{...i,...e},initialState:c,_queue:f=>{u.push(f),_||(_=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();_=!1}).catch(d=>setTimeout(()=>{throw d})))},reset:()=>{a.setState(a.initialState)},setOptions:f=>{const d=Rt(f,a.options);a.options=s(d)},getState:()=>a.options.state,setState:f=>{a.options.onStateChange==null||a.options.onStateChange(f)},_getRowId:(f,d,m)=>{var p;return(p=a.options.getRowId==null?void 0:a.options.getRowId(f,d,m))!=null?p:`${m?[m.id,d].join("."):d}`},getCoreRowModel:()=>(a._getCoreRowModel||(a._getCoreRowModel=a.options.getCoreRowModel(a)),a._getCoreRowModel()),getRowModel:()=>a.getPaginationRowModel(),getRow:(f,d)=>{let m=(d?a.getPrePaginationRowModel():a.getRowModel()).rowsById[f];if(!m&&(m=a.getCoreRowModel().rowsById[f],!m))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${f}`):new Error;return m},_getDefaultColumnDef:we(()=>[a.options.defaultColumn],f=>{var d;return f=(d=f)!=null?d:{},{header:m=>{const p=m.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:m=>{var p,v;return(p=(v=m.renderValue())==null||v.toString==null?void 0:v.toString())!=null?p:null},...a._features.reduce((m,p)=>Object.assign(m,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...f}},ye(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>a.options.columns,getAllColumns:we(()=>[a._getColumnDefs()],f=>{const d=function(m,p,v){return v===void 0&&(v=0),m.map(y=>{const w=Zu(a,y,v,p),C=y;return w.columns=C.columns?d(C.columns,w,v+1):[],w})};return d(f)},ye(e,"debugColumns","getAllColumns")),getAllFlatColumns:we(()=>[a.getAllColumns()],f=>f.flatMap(d=>d.getFlatColumns()),ye(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:we(()=>[a.getAllFlatColumns()],f=>f.reduce((d,m)=>(d[m.id]=m,d),{}),ye(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:we(()=>[a.getAllColumns(),a._getOrderColumnsFn()],(f,d)=>{let m=f.flatMap(p=>p.getLeafColumns());return d(m)},ye(e,"debugColumns","getAllLeafColumns")),getColumn:f=>{const d=a._getAllFlatColumnsById()[f];return process.env.NODE_ENV!=="production"&&!d&&console.error(`[Table] Column with id '${f}' does not exist.`),d}};Object.assign(a,g);for(let f=0;f<a._features.length;f++){const d=a._features[f];d==null||d.createTable==null||d.createTable(a)}return a}function v_(){return e=>we(()=>[e.options.data],n=>{const t={rows:[],flatRows:[],rowsById:{}},o=function(a,i,s){i===void 0&&(i=0);const l=[];for(let u=0;u<a.length;u++){const _=Zr(e,e._getRowId(a[u],u,s),a[u],u,i,void 0,s?.id);if(t.flatRows.push(_),t.rowsById[_.id]=_,l.push(_),e.options.getSubRows){var c;_.originalSubRows=e.options.getSubRows(a[u],u),(c=_.originalSubRows)!=null&&c.length&&(_.subRows=o(_.originalSubRows,i+1,_))}}return l};return t.rows=o(n),t},ye(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function b_(e){const n=[],t=o=>{var a;n.push(o),(a=o.subRows)!=null&&a.length&&o.getIsExpanded()&&o.subRows.forEach(t)};return e.rows.forEach(t),{rows:n,flatRows:e.flatRows,rowsById:e.rowsById}}function w_(e,n,t){return t.options.filterFromLeafRows?y_(e,n,t):C_(e,n,t)}function y_(e,n,t){var o;const a=[],i={},s=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,l=function(c,u){u===void 0&&(u=0);const _=[];for(let f=0;f<c.length;f++){var g;let d=c[f];const m=Zr(t,d.id,d.original,d.index,d.depth,void 0,d.parentId);if(m.columnFilters=d.columnFilters,(g=d.subRows)!=null&&g.length&&u<s){if(m.subRows=l(d.subRows,u+1),d=m,n(d)&&!m.subRows.length){_.push(d),i[d.id]=d,a.push(d);continue}if(n(d)||m.subRows.length){_.push(d),i[d.id]=d,a.push(d);continue}}else d=m,n(d)&&(_.push(d),i[d.id]=d,a.push(d))}return _};return{rows:l(e),flatRows:a,rowsById:i}}function C_(e,n,t){var o;const a=[],i={},s=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,l=function(c,u){u===void 0&&(u=0);const _=[];for(let f=0;f<c.length;f++){let d=c[f];if(n(d)){var g;if((g=d.subRows)!=null&&g.length&&u<s){const p=Zr(t,d.id,d.original,d.index,d.depth,void 0,d.parentId);p.subRows=l(d.subRows,u+1),d=p}_.push(d),a.push(d),i[d.id]=d}}return _};return{rows:l(e),flatRows:a,rowsById:i}}function x_(){return e=>we(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(n,t,o)=>{if(!n.rows.length||!(t!=null&&t.length)&&!o){for(let f=0;f<n.flatRows.length;f++)n.flatRows[f].columnFilters={},n.flatRows[f].columnFiltersMeta={};return n}const a=[],i=[];(t??[]).forEach(f=>{var d;const m=e.getColumn(f.id);if(!m)return;const p=m.getFilterFn();if(!p){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${m.id}.`);return}a.push({id:f.id,filterFn:p,resolvedValue:(d=p.resolveFilterValue==null?void 0:p.resolveFilterValue(f.value))!=null?d:f.value})});const s=(t??[]).map(f=>f.id),l=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());o&&l&&c.length&&(s.push("__global__"),c.forEach(f=>{var d;i.push({id:f.id,filterFn:l,resolvedValue:(d=l.resolveFilterValue==null?void 0:l.resolveFilterValue(o))!=null?d:o})}));let u,_;for(let f=0;f<n.flatRows.length;f++){const d=n.flatRows[f];if(d.columnFilters={},a.length)for(let m=0;m<a.length;m++){u=a[m];const p=u.id;d.columnFilters[p]=u.filterFn(d,p,u.resolvedValue,v=>{d.columnFiltersMeta[p]=v})}if(i.length){for(let m=0;m<i.length;m++){_=i[m];const p=_.id;if(_.filterFn(d,p,_.resolvedValue,v=>{d.columnFiltersMeta[p]=v})){d.columnFilters.__global__=!0;break}}d.columnFilters.__global__!==!0&&(d.columnFilters.__global__=!1)}}const g=f=>{for(let d=0;d<s.length;d++)if(f.columnFilters[s[d]]===!1)return!1;return!0};return w_(n.rows,g,e)},ye(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function $_(e){return n=>we(()=>[n.getState().pagination,n.getPrePaginationRowModel(),n.options.paginateExpandedRows?void 0:n.getState().expanded],(t,o)=>{if(!o.rows.length)return o;const{pageSize:a,pageIndex:i}=t;let{rows:s,flatRows:l,rowsById:c}=o;const u=a*i,_=u+a;s=s.slice(u,_);let g;n.options.paginateExpandedRows?g={rows:s,flatRows:l,rowsById:c}:g=b_({rows:s,flatRows:l,rowsById:c}),g.flatRows=[];const f=d=>{g.flatRows.push(d),d.subRows.length&&d.subRows.forEach(f)};return g.rows.forEach(f),g},ye(n.options,"debugTable","getPaginationRowModel"))}function S_(){return e=>we(()=>[e.getState().sorting,e.getPreSortedRowModel()],(n,t)=>{if(!t.rows.length||!(n!=null&&n.length))return t;const o=e.getState().sorting,a=[],i=o.filter(c=>{var u;return(u=e.getColumn(c.id))==null?void 0:u.getCanSort()}),s={};i.forEach(c=>{const u=e.getColumn(c.id);u&&(s[c.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const l=c=>{const u=c.map(_=>({..._}));return u.sort((_,g)=>{for(let d=0;d<i.length;d+=1){var f;const m=i[d],p=s[m.id],v=p.sortUndefined,y=(f=m?.desc)!=null?f:!1;let w=0;if(v){const C=_.getValue(m.id),k=g.getValue(m.id),z=C===void 0,A=k===void 0;if(z||A){if(v==="first")return z?-1:1;if(v==="last")return z?1:-1;w=z&&A?0:z?v:-v}}if(w===0&&(w=p.sortingFn(_,g,m.id)),w!==0)return y&&(w*=-1),p.invertSorting&&(w*=-1),w}return _.index-g.index}),u.forEach(_=>{var g;a.push(_),(g=_.subRows)!=null&&g.length&&(_.subRows=l(_.subRows))}),u};return{rows:l(t.rows),flatRows:a,rowsById:t.rowsById}},ye(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
20
20
|
* react-table
|
|
21
21
|
*
|
|
22
22
|
* Copyright (c) TanStack
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
* LICENSE.md file in the root directory of this source tree.
|
|
26
26
|
*
|
|
27
27
|
* @license MIT
|
|
28
|
-
*/function bt(e,t){return e?qu(e)?M.createElement(e,t):e:null}function qu(e){return Bu(e)||typeof e=="function"||Hu(e)}function Bu(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Hu(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Gu(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=M.useState(()=>({current:Du(t)})),[o,r]=M.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:a=>{r(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}const Ne={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"},la=m.createContext(null),ca=()=>m.useContext(la),wt=m.forwardRef((e,t)=>{const{children:n,label:o,hint:r,isSelected:i,defaultChecked:a,isIndeterminate:l=!1,isDisabled:d=!1,isReadOnly:u=!1,isRequired:_=!1,lineThrough:g=!1,onlyIcon:f=!1,disableAnimation:c=!1,customCheckIcon:h,size:p="md",color:v="primary",customColor:w,radius:y="md",variant:x="solid",className:E="",classNames:A={},onChange:L,value:N,name:P,...z}=e,I=ca(),V=m.useId(),j=m.useRef(null),$=i!==void 0,[b,S]=m.useState(a??!1),T=!!I,F=T&&N?I.value.includes(N):!1,C=T?F:$?i:b,k=d||I?.isDisabled,D=u||I?.isReadOnly,O=_||I?.isRequired,H=P||I?.name;m.useEffect(()=>{const X=j.current||(t&&typeof t=="object"?t.current:null);X&&(X.indeterminate=l??!1)},[l,t]);const B=X=>{if(k||D)return;const ge=X.target.checked;T&&N?I.onChange(N):($||S(ge),L?.(ge))},U=o||n;return s.jsxs("div",{className:K(Ne.checkbox_container,{[Ne.disabled]:k,[Ne.readonly]:D},A.base,E),children:[s.jsxs("label",{className:K(Ne.checkbox_wrapper,Ne[p],!w&&Ne[v],Ne[x],Ne[`radius_${y}`],{[Ne.checked]:C,[Ne.indeterminate]:l,[Ne.disabled]:k,[Ne.readonly]:D,[Ne.line_through]:g&&C,[Ne.no_animation]:c}),style:w?{"--checkbox-custom-color":w}:void 0,children:[s.jsxs("span",{className:Ne.checkbox,children:[s.jsx("input",{ref:X=>{j.current=X,typeof t=="function"?t(X):t&&(t.current=X)},id:V,type:"checkbox",className:Ne.input,checked:C,onChange:B,disabled:k,readOnly:D,required:O,value:N,name:H,...z}),h?s.jsx("span",{className:Ne.custom_icon,children:h}):s.jsx("svg",{className:Ne.checkbox_svg,viewBox:"0 0 22 22","aria-hidden":"true",children:s.jsx("path",{fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:l?"M6,11 L16,11":"M5.5,11.3L9,14.8L20.2,3.3l0,0c-0.5-1-1.5-1.8-2.7-1.8h-13c-1.7,0-3,1.3-3,3v13c0,1.7,1.3,3,3,3h13 c1.7,0,3-1.3,3-3v-13c0-0.4-0.1-0.8-0.3-1.2"})})]}),!f&&U&&s.jsx("span",{className:K(Ne.label_text,A.label),children:U})]}),r&&s.jsx("span",{className:K(Ne.hint_text,A.label),children:r})]})});wt.displayName="Checkbox";const da=({label:e,children:t,description:n,errorMessage:o,isInvalid:r=!1,orientation:i="vertical",className:a,value:l,defaultValue:d=[],onChange:u,isDisabled:_=!1,isReadOnly:g=!1,isRequired:f=!1,name:c,options:h,optionValueKey:p,optionLabelKey:v,optionDisabledKey:w,optionDescriptionKey:y})=>{const x=l!==void 0,[E,A]=m.useState(d),L=x?l:E,N=P=>{if(_||g)return;const z=L.includes(P)?L.filter(I=>I!==P):[...L,P];x||A(z),u?.(z)};return s.jsxs("div",{className:K(Ne.checkbox_group,Ne[i],{[Ne.invalid]:r,[Ne.disabled]:_,[Ne.readonly]:g},a),role:"group","aria-required":f,"aria-invalid":r,children:[e&&s.jsxs("div",{className:Ne.label,children:[e,f&&s.jsx("span",{className:Ne.marca_requerido,children:" *"})]}),n&&s.jsx("div",{className:Ne.description,children:n}),s.jsx(la.Provider,{value:{value:L,onChange:N,isDisabled:_,isReadOnly:g,isRequired:f,name:c},children:s.jsx("div",{className:K(Ne.checkboxes,Ne[i]),children:h&&h.length>0?h.map((P,z)=>{let I,V,j=!1,$;if(typeof P=="object"&&P!==null){const b=p??"value",S=v??"label",T=w??"isDisabled",F=y??"description",C=P[b],k=P[S];I=String(C!==void 0?C:z),V=k;const D=P[T];j=typeof D=="boolean"?D:!1;const O=P[F];$=typeof O=="string"?O:void 0}else I=String(P),V=P;return s.jsx(wt,{value:I,isDisabled:j,hint:$,children:V},I)}):t})}),o&&r&&s.jsx("div",{className:Ne.error_message,children:o})]})};da.displayName="CheckboxGroup";const Ge={contenedor:"_contenedor_kj261_1",contenedor_superior:"_contenedor_superior_kj261_17",input_con_icono:"_input_con_icono_kj261_35",icono_busqueda:"_icono_busqueda_kj261_49",input_busqueda:"_input_busqueda_kj261_75",contenedor_acciones_botones:"_contenedor_acciones_botones_kj261_147",contenedor_acciones:"_contenedor_acciones_kj261_147",columna:"_columna_kj261_183",encabezados:"_encabezados_kj261_201",boton_basico:"_boton_basico_kj261_265",texto_filtros:"_texto_filtros_kj261_289",menu_configuraciones:"_menu_configuraciones_kj261_321",boton_excel:"_boton_excel_kj261_349",contenedor_tabla:"_contenedor_tabla_kj261_369",contenedor_datos:"_contenedor_datos_kj261_387",datos:"_datos_kj261_395",seleccionada:"_seleccionada_kj261_431",boton_acciones:"_boton_acciones_kj261_475"};function Wu(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 Ku(e,t){return t===0?0:e>=t?t-1:e<0?0:e}function Uu(e){return e?{asc:" ↑",desc:" ↓"}[e]??null:null}function yt(e,t){const n=new Map;t.getFlatHeaders().forEach(a=>n.set(a.column.id,a));const o=n.get(e);if(o)return bt(o.column.columnDef.header,o.getContext());const r=t.getAllLeafColumns().find(a=>a.id===e),i=r?.columnDef.header;return typeof i=="string"||typeof i=="number"?i:r?.id??e}function ua(e,t){const n=e.getVisibleCells().find(o=>o.column.id===t);return n?bt(n.column.columnDef.cell,n.getContext()):null}function fa(e,t){return t?e.getVisibleCells().map(o=>o.column.id).includes(t):!1}function Xu(e,t,n){return e.getVisibleCells().filter(o=>o.column.id!=="actions"&&o.column.id!==t&&o.column.id!==n)}function Yu(e,t){if(t===0)return"";if(t===1)return Wr(e[0].nombre.toLowerCase());if(t===2)return`${Wr(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const n=e.slice(0,2).map(r=>r.nombre.toLowerCase()),o=t-2;return`${Wr(n.join(", "))} y ${o>1?`otros ${o}`:"otro"} más`}function Wr(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function _a(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}const ga=m.createContext(null),Kr=ga;function To(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Ru({children:e,data:t,columns:n,controls:o,loading:r,primerasColumnas:i,tamanioPaginaInicial:a=10,filtros:l,descargarExcel:d,actualizarTabla:u,selectorFilas:_=[],sinDatosProps:g,...f}){const[c,h]=m.useState(""),p=Od(c,200),v=No("only screen and (max-width: 830px)"),[w,y]=m.useState({pageIndex:0,pageSize:a}),[x,E]=m.useState({}),A=m.useMemo(()=>{const k=[];return _.length>0&&!v&&k.push({id:"select",header:({table:D})=>s.jsx(wt,{color:"secondary",isSelected:D.getIsAllPageRowsSelected(),isIndeterminate:D.getIsSomePageRowsSelected()&&!D.getIsAllPageRowsSelected(),onChange:O=>D.toggleAllPageRowsSelected(!!O)}),cell:({row:D})=>s.jsx(wt,{color:"primary",isSelected:D.getIsSelected(),isDisabled:!D.getCanSelect(),onChange:O=>D.toggleSelected(O)}),enableSorting:!1,enableHiding:!1}),k.push(...n),o?.length&&k.push({id:"actions",header:"Acciones",cell:D=>s.jsx("div",{className:Ge.contenedor_acciones,children:o.map(O=>"contenido"in O?s.jsx(it,{content:O.nombre,variant:"default",size:"sm",placement:"top",children:s.jsx("span",{children:O.contenido(D.row.original,Ge.boton_acciones)})},O.id):s.jsx(it,{content:O.nombre,variant:"default",size:"sm",placement:"top",children:s.jsx(on,{id:O.id,size:"sm",radius:"md",variant:"light",isIconOnly:!0,onClick:()=>O.evento(D.row.original),className:Ge.boton_acciones,children:O.icono})},O.id))}),enableSorting:!1,enableHiding:!1}),k},[n,o,_.length,v]),L=m.useMemo(()=>{const k=A.map(O=>"accessorKey"in O&&O.accessorKey!=null?String(O.accessorKey):"id"in O&&O.id!=null?String(O.id):"").filter(Boolean),D=k.indexOf("actions");return D>-1&&D<k.length-1&&(k.splice(D,1),k.push("actions")),k},[A]),[N,P]=m.useState(()=>L);m.useEffect(()=>{P(k=>To(k,L)?k:L)},[L]);const z=m.useCallback((k,D,O)=>{if(!O)return!0;const H=_a(String(O)),B=k.getValue(D);return B==null?!1:_a(String(B)).includes(H)},[]),I=Gu({data:t,columns:A,state:{pagination:w,globalFilter:p,columnOrder:N,rowSelection:x},globalFilterFn:z,enableRowSelection:_.length>0,onRowSelectionChange:E,onPaginationChange:y,onColumnOrderChange:k=>{P(D=>{const O=typeof k=="function"?k(D):k;return To(D,O)?D:O})},getCoreRowModel:Au(),getSortedRowModel:ju(),getFilteredRowModel:Ou(),getPaginationRowModel:Vu(),autoResetPageIndex:!1}),V=I.getPageCount();m.useEffect(()=>{const k=Ku(w.pageIndex,V);k!==w.pageIndex&&y(D=>({...D,pageIndex:k}))},[w.pageIndex,V]);const j=m.useRef(p);m.useEffect(()=>{j.current!==p&&y(D=>D.pageIndex===0?D:{...D,pageIndex:0}),j.current=p},[p]);const $=m.useMemo(()=>I.getAllLeafColumns().filter(k=>k.id!=="actions"&&k.id!=="select"&&k.getCanHide?.()),[I]),b=m.useCallback(k=>{const O=n.find(H=>"accessorKey"in H?String(H.accessorKey)===k:String(H.id)===k)?.header;return typeof O=="string"||typeof O=="number"?String(O):k},[n]),S=m.useCallback(()=>{I.setColumnVisibility({}),I.setPageSize(a),I.setPageIndex(0),I.resetRowSelection(),P(k=>To(k,L)?k:L)},[I,a,L]),T=m.useCallback(k=>{const D=Math.max(1,Math.min(200,k));I.setPageSize(D),I.setPageIndex(0)},[I]),F=m.useCallback(k=>{P(D=>{const O=typeof k=="function"?k(D):k;return To(D,O)?D:O})},[]),C=m.useMemo(()=>({state:{ordenColumnas:N,table:I,columns:A,controls:o,loading:r,primerasColumnas:[String(i[0]),String(i[1])],inputBusqueda:c,setInputBusqueda:h,filtros:l,descargarExcel:d,actualizarTabla:u,selectorFilas:_,sinDatosProps:g,...f},todasLasColumnas:$,etiquetaColumna:b,restaurarConfiguracion:S,cambiarPageSize:T,cambiarOrdenColumnas:F}),[N,I,A,o,r,c,l,i,d,u,_,g,f,$,b,S,T,F]);return s.jsx(ga.Provider,{value:C,children:e})}function Zu(){const e=m.useContext(Kr);if(!e)throw new Error("useTablaContext debe usarse dentro de TablaDatosProvider");return e}function Rn(){const e=m.useContext(Kr);return e||null}const jn={contenedor:"_contenedor_1dhtd_1",popover:"_popover_1dhtd_9",popover_entrada:"_popover_entrada_1dhtd_45",popoverEntrada:"_popoverEntrada_1dhtd_1",popover_salida:"_popover_salida_1dhtd_53",popoverSalida:"_popoverSalida_1dhtd_1",ventana:"_ventana_1dhtd_109",panel:"_panel_1dhtd_127",panel_forward:"_panel_forward_1dhtd_145",panelForwardIn:"_panelForwardIn_1dhtd_1",panel_backward:"_panel_backward_1dhtd_153",panelBackwardIn:"_panelBackwardIn_1dhtd_1",header:"_header_1dhtd_209",titulo:"_titulo_1dhtd_233"};function pa(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function ha(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 Ju(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"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 Qu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"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 ef(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 nf(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 tf(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 of(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 rf(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 sf(e){return s.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[s.jsx("rect",{x:"3",y:"3",width:"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 af(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 lf(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"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 cf(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 df(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:s.jsx("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"})})}function uf(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsxs("g",{fill:"none",children:[s.jsx("path",{fill:"currentColor",d:"M7.378 11.63h-.75zm0 .926l-.562.497a.75.75 0 0 0 1.08.044zm2.141-1.015a.75.75 0 0 0-1.038-1.082zm-2.958-1.038a.75.75 0 1 0-1.122.994zm8.37-1.494a.75.75 0 1 0 1.102-1.018zM12.045 6.25c-2.986 0-5.416 2.403-5.416 5.38h1.5c0-2.137 1.747-3.88 3.916-3.88zm-5.416 5.38v.926h1.5v-.926zm1.269 1.467l1.622-1.556l-1.038-1.082l-1.622 1.555zm.042-1.039l-1.378-1.555l-1.122.994l1.377 1.556zm8.094-4.067a5.42 5.42 0 0 0-3.99-1.741v1.5a3.92 3.92 0 0 1 2.889 1.26zm.585 3.453l.56-.498a.75.75 0 0 0-1.08-.043zm-2.139 1.014a.75.75 0 1 0 1.04 1.082zm2.96 1.04a.75.75 0 0 0 1.12-.997zm-8.393 1.507a.75.75 0 0 0-1.094 1.026zm2.888 2.745c2.993 0 5.434-2.4 5.434-5.38h-1.5c0 2.135-1.753 3.88-3.934 3.88zm5.434-5.38v-.926h-1.5v.926zm-1.27-1.467l-1.619 1.555l1.04 1.082l1.618-1.555zm-.04 1.04l1.38 1.554l1.122-.996l-1.381-1.555zM7.952 16.03a5.45 5.45 0 0 0 3.982 1.719v-1.5c-1.143 0-2.17-.48-2.888-1.245z"}),s.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",opacity:".5"})]})})}function ff(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:s.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"})})}function _f(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:s.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"})})}const gf=({titulo:e,onBack:t})=>s.jsxs("header",{className:jn.header,children:[s.jsx(on,{isIconOnly:!0,variant:"light",onClick:t,"aria-label":"Regresar",children:s.jsx(pa,{})}),s.jsx("h3",{className:jn.titulo,children:e})]}),st={contenedor:"_contenedor_1qz45_1",lista:"_lista_1qz45_13",item:"_item_1qz45_45",item_dragging:"_item_dragging_1qz45_75",icono_drag:"_icono_drag_1qz45_93",nombre:"_nombre_1qz45_129",checkbox:"_checkbox_1qz45_159"};function pf(){const e=Rn(),[t,n]=m.useState(null);if(!e)return null;const{state:o,todasLasColumnas:r,etiquetaColumna:i,cambiarOrdenColumnas:a}=e,{ordenColumnas:l}=o,d=g=>f=>{n(g),f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",g)},u=g=>f=>{f.preventDefault(),!(!t||t===g)&&a?.(c=>{const h=[...c],p=h.indexOf(t),v=h.indexOf(g);return p===-1||v===-1?c:(h.splice(p,1),h.splice(v,0,t),h)})},_=()=>n(null);return s.jsx("div",{className:st.contenedor,children:s.jsx("ul",{className:st.lista,children:l.map(g=>{const f=r.find(v=>v.id===g);if(!f)return null;const c=f.getCanHide?.()??!0,h=f.getIsVisible(),p=t===f.id;return s.jsxs("li",{className:`${st.item} ${p?st.item_dragging:""}`,draggable:!0,onDragStart:d(f.id),onDragOver:u(f.id),onDrop:_,onDragEnd:_,children:[s.jsx("span",{className:st.icono_drag,"aria-label":"Arrastrar columna",children:s.jsx(rf,{})}),s.jsx("span",{className:st.nombre,children:i(f.id)}),s.jsx(wt,{size:"md",color:"primary",isSelected:h,isDisabled:!c,onChange:v=>f.toggleVisibility(v),className:st.checkbox})]},f.id)})})})}const Vt={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function hf(){const e=Rn(),[t,n]=m.useState(""),o=m.useRef(null),r=e?.state.table?.getState().pagination.pageSize??10;if(m.useEffect(()=>n(String(r)),[r]),!e)return null;const{cambiarPageSize:i}=e,a=g=>Math.max(Ur,Math.min(Xr,g)),l=g=>{const f=r+g;f>=Ur&&f<=Xr&&i?.(f)},d=()=>{const g=parseInt(t,10),f=!isNaN(g)&&g>0?a(g):r;i?.(f),n(String(f))},u=g=>{({Enter:()=>{d(),o.current?.blur()},Escape:()=>{n(String(r)),o.current?.blur()},ArrowUp:()=>{g.preventDefault(),l(1),setTimeout(()=>o.current?.select(),0)},ArrowDown:()=>{g.preventDefault(),l(-1),setTimeout(()=>o.current?.select(),0)}})[g.key]?.()},_=g=>{const f=g.target.value;(f===""||/^\d+$/.test(f))&&n(f)};return s.jsxs("div",{className:Vt.contenido,children:[s.jsx("p",{className:Vt.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),s.jsxs("div",{className:Vt.control,children:[s.jsx(on,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(-1),"aria-label":"Disminuir filas",disabled:r<=Ur,children:s.jsx(cf,{style:{fontSize:"var(--gaps-6)"}})}),s.jsx("div",{className:Vt.valor,children:s.jsx("input",{ref:o,type:"text",inputMode:"numeric",value:t,onChange:_,onKeyDown:u,onFocus:()=>o.current?.select(),onBlur:d,className:Vt.input,"aria-label":"Número de filas por página"})}),s.jsx(on,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(1),"aria-label":"Aumentar filas",disabled:r>=Xr,children:s.jsx(lf,{})})]})]})}const fn={contenedor:"_contenedor_1lwmx_1",menu:"_menu_1lwmx_11",item:"_item_1lwmx_25",icono_contenedor:"_icono_contenedor_1lwmx_111",icono_restaurar:"_icono_restaurar_1lwmx_143",texto:"_texto_1lwmx_153",nombre:"_nombre_1lwmx_165",descripcion:"_descripcion_1lwmx_183",chevron:"_chevron_1lwmx_201",divider:"_divider_1lwmx_227"};function mf({navegar:e}){const t=Rn();return s.jsxs("div",{className:fn.contenedor,children:[s.jsx("nav",{className:fn.menu,children:wf.map(({id:n,icono:o,nombre:r,descripcion:i})=>s.jsxs("button",{className:fn.item,onClick:()=>e(n),children:[s.jsx("div",{className:fn.icono_contenedor,children:s.jsx(o,{})}),s.jsxs("div",{className:fn.texto,children:[s.jsx("span",{className:fn.nombre,children:r}),s.jsx("span",{className:fn.descripcion,children:i})]}),s.jsx(ha,{className:fn.chevron})]},n))}),s.jsx("div",{className:fn.divider}),s.jsx("div",{className:fn.menu,children:s.jsxs("button",{className:fn.item,onClick:t?.restaurarConfiguracion,children:[s.jsx("div",{className:fn.icono_contenedor,children:s.jsx(of,{className:fn.icono_restaurar})}),s.jsxs("div",{className:fn.texto,children:[s.jsx("span",{className:fn.nombre,children:"Restaurar configuración"}),s.jsx("span",{className:fn.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const Ur=1,Xr=200,ma=250,vf=200,bf={panelPrincipal:{component:mf},panelColumnas:{component:pf,titulo:"Columnas visibles"},panelFilas:{component:hf,titulo:"Filas por página"}},wf=[{id:"panelColumnas",icono:sf,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:af,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}];function yf(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 va(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 Cf(e,t,n,{width:o,offsetRight:r=0,offsetLeft:i=0,offsetTop:a=0,offsetBottom:l=0,shiftPadding:d=8}){const[u,_]=m.useState({top:0,left:0}),g=No("only screen and (max-width: 480px)"),f=m.useCallback(()=>{if(!e.current)return{top:0,left:0};const c=e.current.getBoundingClientRect(),h=d;let p=c.bottom+a,v=0;g?v=c.right-o-i+r:v=c.right-o+r-i;const w=t.current?.offsetHeight||400;p+w>window.innerHeight-h&&(p=c.top-w-l,p<h&&(p=h));const y=h,x=window.innerWidth-o-h;return v=Math.max(y,Math.min(v,x)),{top:p,left:v}},[g,o,r,i,a,l,d,e,t]);return m.useEffect(()=>{if(!n||!e.current)return;const c=()=>{_(f())};return c(),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)}},[n,f,e]),u}function xf(e){m.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function Sf(){const[e,t]=m.useState(!1),[n,o]=m.useState(!1),[r,i]=m.useState("panelPrincipal"),[a,l]=m.useState(null),d=m.useRef(null),u=m.useRef(null),_=m.useRef(null);xf(n),yf(()=>f(),n,[d,u]),va(()=>f(),n);const g=Cf(d,u,n,{width:ma,offsetRight:6,offsetTop:-2,shiftPadding:8});m.useEffect(()=>{e&&(o(!0),l(null))},[e]),m.useEffect(()=>()=>{_.current&&clearTimeout(_.current)},[]);function f(){n&&(t(!1),_.current=window.setTimeout(()=>{o(!1),i("panelPrincipal"),l(null)},vf))}function c(v){l(v==="panelPrincipal"?"backward":"forward"),i(v)}const h=bf[r],p=h.component;return s.jsxs("div",{className:jn.contenedor,children:[s.jsx(on,{isIconOnly:!0,ref:d,variant:"light",onClick:()=>t(v=>!v),"aria-haspopup":"dialog","aria-expanded":e,children:s.jsx(tf,{})}),n&&d.current&&xt.createPortal(s.jsx("div",{ref:u,className:`${jn.popover} ${e?jn.popover_entrada:jn.popover_salida}`,role:"dialog",style:{top:`${g.top}px`,left:`${g.left}px`,width:ma},children:s.jsx("div",{className:jn.ventana,children:s.jsxs("div",{className:K([jn.panel,jn[`panel_${a}`]]),children:[h.titulo&&s.jsx(gf,{titulo:h.titulo,onBack:()=>c("panelPrincipal")}),s.jsx(p,{navegar:c})]},r)})}),document.body)]})}function $f(){const e=Rn();if(!e)return null;const{state:t}=e,{inputBusqueda:n,setInputBusqueda:o,loading:r,filtros:i,actualizarTabla:a,descargarExcel:l,paginacion:d}=t,{abrirFiltros:u,filtrosAplicados:_=[]}=i||{},g=_?.length||0;return s.jsxs("section",{className:Ge.contenedor_superior,children:[s.jsxs("div",{className:Ge.input_con_icono,id:"buscador-tabla",children:[s.jsx(Ju,{className:Ge.icono_busqueda}),s.jsx("input",{type:"text",placeholder:"Buscar en tabla...",value:n??"",onChange:f=>o&&o(f.target.value),className:Ge.input_busqueda})]}),s.jsxs("div",{className:Ge.contenedor_acciones_botones,children:[s.jsxs("div",{className:Ge.contenedor_acciones,children:[d?.hayMasDatos&&s.jsxs(on,{id:"cargar-mas-datos",variant:"light",className:Ge.boton_basico,disabled:r,onClick:d.onCargarMasDatos,children:[s.jsx(uf,{}),r?"Actualizando...":"Más datos"]}),u!==void 0&&s.jsxs(on,{id:"boton-filtros",onClick:u,variant:"light",className:Ge.boton_basico,children:[s.jsx(ef,{})," Filtros"]}),g>0?s.jsxs("div",{className:Ge.texto_filtros,id:"filtros-aplicados",children:[s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:s.jsx("path",{d:"M2 4h12M4 8h8M6 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),s.jsx("p",{children:Yu(_,g)})]}):null]}),l!==void 0?s.jsxs(on,{onClick:l,className:`${Ge.boton_basico} ${Ge.boton_excel}`,children:[s.jsx(Qu,{})," Excel"]}):null]}),s.jsxs("div",{className:Ge.contenedor_acciones,children:[a!==void 0&&s.jsx(it,{content:"Actualiza los últimos datos guardados",children:s.jsx(on,{id:"actualizar-tabla",variant:"light",isIconOnly:!0,className:Ge.boton_basico,disabled:a?.cargando,onClick:a?.onClick,children:s.jsx(nf,{})})}),s.jsx("div",{className:Ge.menu_configuraciones,id:"configuraciones-tabla",children:s.jsx(Sf,{})})]})]})}const Fn={contenedor_paginacion:"_contenedor_paginacion_1l3vz_1",info_paginacion:"_info_paginacion_1l3vz_19",contenedor_botones:"_contenedor_botones_1l3vz_37",boton_paginacion:"_boton_paginacion_1l3vz_87",pagina_activa:"_pagina_activa_1l3vz_107",boton_num_paginacion:"_boton_num_paginacion_1l3vz_117"};function kf(){const e=Rn();if(!e)return null;const{state:t}=e,{table:n}=t,o=n.getPrePaginationRowModel().rows.length,r=n.getPageCount()||1,{pageIndex:i}=n.getState().pagination,a=i+1,l=Wu(a,r),d=n.getCanPreviousPage(),u=n.getCanNextPage(),_=r>1,g=i===0,f=i===r-1,c=()=>{d&&n.previousPage()},h=()=>{u&&n.nextPage()},p=y=>{n.setPageIndex(y-1)},v=()=>{g||n.firstPage()},w=()=>{f||n.lastPage()};return s.jsxs("section",{className:Fn.contenedor_paginacion,id:"paginacion-tabla",children:[s.jsxs("p",{className:Fn.info_paginacion,id:"paginacion-total-documentos",children:["Documentos: ",o]}),_&&s.jsxs("div",{className:Fn.contenedor_botones,id:"paginacion-numerador-pags",children:[!g&&s.jsx(ff,{id:"paginacion-flecha-inicio",onClick:v,"aria-label":"Ir a la primera página","aria-disabled":g,className:Fn.boton_paginacion}),d&&s.jsx(pa,{id:"paginacion-flecha-izq",onClick:c,"aria-disabled":!d,className:Fn.boton_paginacion}),s.jsx("div",{id:"paginacion-numero-pag",children:l.map(y=>s.jsx("button",{type:"button",onClick:()=>p(y),"aria-current":y===a?"page":void 0,className:y===a?Fn.pagina_activa:Fn.boton_num_paginacion,children:y},y))}),u&&s.jsx(ha,{id:"paginacion-flecha-der",onClick:h,"aria-disabled":!u,className:Fn.boton_paginacion}),!f&&s.jsx(_f,{id:"paginacion-flecha-fin",onClick:w,"aria-label":"Ir a la última página","aria-disabled":f,className:Fn.boton_paginacion})]}),s.jsxs("p",{className:Fn.info_paginacion,id:"paginacion-total-pags",children:["Página ",a," de ",r]})]})}const Ee={contenedor_tabla_cards:"_contenedor_tabla_cards_zuvsb_1",contenedor_card:"_contenedor_card_zuvsb_11",contenedor_encabezado_card:"_contenedor_encabezado_card_zuvsb_25",contenedor_columna_card:"_contenedor_columna_card_zuvsb_47",card_label:"_card_label_zuvsb_57",card_valor:"_card_valor_zuvsb_69",card_segundo_valor:"_card_segundo_valor_zuvsb_83",contenedor_contenido_cards:"_contenedor_contenido_cards_zuvsb_93",contenedor_fila_card:"_contenedor_fila_card_zuvsb_105",card_fila_label:"_card_fila_label_zuvsb_119",card_fila_valor:"_card_fila_valor_zuvsb_137",contenedor_acciones_card:"_contenedor_acciones_card_zuvsb_153",boton_acciones:"_boton_acciones_zuvsb_171",boton_card:"_boton_card_zuvsb_207",boton_personalizado:"_boton_personalizado_zuvsb_237"};function ba(e,t){if(t)return e.find(n=>n.accessorKey===t||n.id!==void 0&&n.id===String(t))}function wa(e){if(e)return e.id??e.accessorKey}const qn={skeleton_elemento:"_skeleton_elemento_5jnrx_1",skeleton_elemento_encabezado:"_skeleton_elemento_encabezado_5jnrx_23",skeleton_elemento_encabezado_segundo:"_skeleton_elemento_encabezado_segundo_5jnrx_73",skeleton_elemento_contenido:"_skeleton_elemento_contenido_5jnrx_99",skeleton_accion:"_skeleton_accion_5jnrx_107"};function If({filas:e,cantidadControles:t=0,table:n,idPrimeraColumna:o,idSegundaColumna:r}){const a=n.getAllLeafColumns().filter(d=>d.id!=="actions"&&d.id!==o&&d.id!==r),l=["25vw","30vw","20vw","28vw","22vw","26vw"];return s.jsx("section",{className:Ee.contenedor_tabla_cards,children:Array.from({length:e}).map((d,u)=>s.jsxs("article",{className:Ee.contenedor_card,children:[s.jsxs("div",{className:Ee.contenedor_encabezado_card,children:[s.jsx("div",{className:Ee.contenedor_columna_card,children:o&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ee.card_label,children:yt(o,n)}),s.jsx("div",{className:Ee.card_valor,children:s.jsx("div",{className:`${qn.skeleton_elemento} ${qn.skeleton_elemento_encabezado}`})})]})}),s.jsx("div",{className:Ee.contenedor_columna_card,children:r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ee.card_label,children:yt(r,n)}),s.jsx("div",{className:Ee.card_segundo_valor,children:s.jsx("div",{className:`${qn.skeleton_elemento} ${qn.skeleton_elemento_encabezado_segundo}`})})]})})]}),s.jsx("div",{className:Ee.contenedor_contenido_cards,children:a.map((_,g)=>s.jsxs("div",{className:Ee.contenedor_fila_card,children:[s.jsx("div",{className:Ee.card_fila_label,children:yt(_.id,n)}),s.jsx("div",{className:Ee.card_fila_valor,children:s.jsx("div",{className:`${qn.skeleton_elemento} ${qn.skeleton_elemento_contenido}`,style:{width:l[g%l.length]}})})]},_.id))}),t>0&&s.jsx("div",{className:Ee.contenedor_acciones_card,children:Array.from({length:Math.min(t,3)}).map((_,g)=>s.jsx("div",{className:qn.skeleton_accion,children:s.jsx("div",{className:`${qn.skeleton_elemento} ${qn.skeleton_elemento_encabezado}`})},`accion-${g}`))})]},`skeleton-card-${u}`))})}const at={contenedor:"_contenedor_53kvd_1",envolvedor_cuadricula:"_envolvedor_cuadricula_53kvd_33",svg_cuadricula:"_svg_cuadricula_53kvd_61",envolvedor_contenido:"_envolvedor_contenido_53kvd_77",icono_carpeta:"_icono_carpeta_53kvd_97",titulo:"_titulo_53kvd_111",descripcion:"_descripcion_53kvd_129"};function ya(){const e=m.useContext(Kr),{sinDatosProps:t}=e?.state||{},{botonAccion:n,titulo:o="No se encontraron coincidencias",descripcion:r='Usa el botón "Filtros" para ampliar tu búsqueda.'}=t||{};return s.jsxs("div",{className:at.contenedor,children:[s.jsx(Ef,{}),s.jsxs("div",{className:at.envolvedor_contenido,children:[s.jsx(Mf,{}),s.jsx("h3",{className:at.titulo,children:o}),s.jsx("p",{className:at.descripcion,children:r}),n]})]})}function Ef(){return s.jsx("div",{className:at.envolvedor_cuadricula,children:s.jsxs("svg",{className:at.svg_cuadricula,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("defs",{children:s.jsx("pattern",{id:"patronCuadricula",width:"40",height:"40",patternUnits:"userSpaceOnUse",children:s.jsx("path",{d:"M 40 0 L 0 0 0 40",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),s.jsx("rect",{width:"100%",height:"100%",fill:"url(#patronCuadricula)"})]})})}function Mf(){return s.jsxs("svg",{className:at.icono_carpeta,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M10 25C10 22.2386 12.2386 20 15 20H40L50 30H85C87.7614 30 90 32.2386 90 35V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V25Z",fill:"var(--color-placeholder)"}),s.jsx("path",{d:"M10 40C10 37.2386 12.2386 35 15 35H85C87.7614 35 90 37.2386 90 40V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V40Z",fill:"var(--base)",stroke:"var(--color-placeholder)",strokeWidth:"2"}),s.jsx("circle",{cx:"35",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),s.jsx("circle",{cx:"55",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),s.jsx("path",{d:"M42 65H48",stroke:"var(--color-primary-text)",strokeWidth:"1.5",strokeLinecap:"round"}),s.jsx("circle",{cx:"78",cy:"78",r:"14",fill:"var(--brand-primary)"}),s.jsx("path",{d:"M78 71V85M71 78H85",stroke:"var(--base)",strokeWidth:"2.5",strokeLinecap:"round"})]})}const Nf=({fila:e,controls:t})=>(t?.length??0)>0?s.jsx("div",{className:Ee.contenedor_acciones_card,children:t?.map(o=>"contenido"in o?s.jsxs("span",{className:`${Ee.boton_personalizado} ${Ee.boton_acciones} ${Ee.boton_card}`,onClick:r=>{const i=r.currentTarget.querySelector("button");i&&!i.contains(r.target)&&i.click()},children:[o.contenido(e.original)," ",o.nombre]},o.id):s.jsxs("button",{id:o.id,type:"button",title:o.nombre,onClick:()=>o.evento(e.original),className:`${Ee.boton_acciones} ${Ee.boton_card}`,children:[o.icono," ",o.nombre]},o.id))}):null,Ff=({columnasRestantes:e,table:t})=>e.length===0?null:s.jsx("div",{className:Ee.contenedor_contenido_cards,children:e.map(n=>s.jsxs("div",{className:Ee.contenedor_fila_card,children:[s.jsx("div",{className:Ee.card_fila_label,children:yt(n.column.id,t)}),s.jsx("div",{className:Ee.card_fila_valor,children:bt(n.column.columnDef.cell,n.getContext())})]},n.id))}),Df=({fila:e,table:t,idPrimeraColumna:n,idSegundaColumna:o})=>{const r=fa(e,n),i=fa(e,o);return s.jsxs("div",{className:Ee.contenedor_encabezado_card,children:[s.jsx("div",{className:Ee.contenedor_columna_card,children:n&&r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ee.card_label,children:yt(n,t)}),s.jsx("div",{className:Ee.card_valor,children:ua(e,n)})]})}),s.jsx("div",{className:Ee.contenedor_columna_card,children:o&&i&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ee.card_label,children:yt(o,t)}),s.jsx("div",{className:Ee.card_segundo_valor,children:ua(e,o)})]})})]})};function Af(){const e=Rn();if(!e)return null;const{state:t}=e,{table:n,controls:o,primerasColumnas:r,loading:i,columns:a}=t;if(!n)return null;const l=a&&r?ba(a,r[0]):void 0,d=a&&r?ba(a,r[1]):void 0,u=wa(l),_=wa(d);if(i)return s.jsx(If,{filas:3,cantidadControles:o?.length??0,table:n,idPrimeraColumna:u,idSegundaColumna:_});const g=n.getRowModel().rows;return g.length===0?s.jsx("article",{className:Ee.contenedor_card,children:s.jsx(ya,{})}):s.jsx("section",{className:Ee.contenedor_tabla_cards,children:g.map(f=>{const c=Xu(f,u,_);return s.jsxs("article",{id:`tabla-card-${f.id}`,className:Ee.contenedor_card,children:[s.jsx(Df,{fila:f,table:n,idPrimeraColumna:u,idSegundaColumna:_}),s.jsx(Ff,{columnasRestantes:c,table:n}),s.jsx(Nf,{fila:f,controls:o})]},f.id)})})}const Ca={filas:"_filas_un2v3_1",columnas:"_columnas_un2v3_43"},Lf=({columnas:e,filas:t})=>s.jsx(s.Fragment,{children:Array.from({length:t}).map((n,o)=>s.jsx("tr",{className:Ca.filas,children:Array.from({length:e}).map((r,i)=>s.jsx("td",{className:Ca.columnas},`sk-cell-${o}-${i}`))},`sk-row-${o}`))}),lt={contenedor:"_contenedor_1mvgy_1",barra:"_barra_1mvgy_17",info:"_info_1mvgy_39",btn_cerrar:"_btn_cerrar_1mvgy_51",contador:"_contador_1mvgy_67",separador:"_separador_1mvgy_83",acciones:"_acciones_1mvgy_97"};function Pf({totalSeleccionadas:e,acciones:t,filasSeleccionadas:n,onLimpiarSeleccion:o}){const[r,i]=m.useState(0),[a,l]=m.useState([]),[d,u]=m.useState([]),_=e>0,g=m.useRef(null);return va(o,_),m.useEffect(()=>{_&&(i(e),l(t),u(n))},[e,t,n,_]),s.jsx(Kt,{mostrar:_,tipo:"escalar",className:lt.contenedor,children:s.jsxs("div",{ref:g,className:lt.barra,children:[s.jsxs("div",{className:lt.info,children:[s.jsx(on,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:o,"aria-label":"Limpiar selección",className:lt.btn_cerrar,children:s.jsx(df,{})}),s.jsxs("p",{className:lt.contador,children:[r," filas seleccionadas"]})]}),s.jsx("div",{className:lt.separador}),s.jsx("div",{className:lt.acciones,children:a.map(f=>s.jsx("div",{children:f.componente(d)},f.id))})]})})}function zf(){const e=Rn();if(!e)return null;const{state:t}=e,{table:n,loading:o,columns:r,selectorFilas:i=[]}=t;if(!n)return null;const a=n.getHeaderGroups(),l=n.getRowModel().rows,d=r?.length??0,u=n.getSelectedRowModel().rows,_=u.length,g=()=>{n.resetRowSelection()};return s.jsxs(s.Fragment,{children:[s.jsxs("table",{className:Ge.contenedor_tabla,children:[s.jsx("thead",{children:a.map(f=>s.jsx("tr",{children:f.headers.map(c=>{const h=c.column.columnDef.meta?.style;return s.jsx("th",{id:`tabla-col-${c.id}`,className:Ge.encabezados,style:h,"data-columna":c.id,children:c.id==="select"?s.jsx("div",{children:bt(c.column.columnDef.header,c.getContext())}):s.jsxs("div",{onClick:c.column.getToggleSortingHandler(),children:[bt(c.column.columnDef.header,c.getContext()),Uu(c.column.getIsSorted())]})},c.id)})},f.id))}),s.jsx("tbody",{className:Ge.contenedor_datos,children:o?s.jsx(Lf,{columnas:d,filas:10}):l.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:d,style:{backgroundColor:"var(--base)"},children:s.jsx(ya,{})})}):l.map(f=>s.jsx("tr",{id:`tabla-fila-${f.id}`,className:`${Ge.datos} ${f.getIsSelected()?Ge.seleccionada:""}`,"data-fila-index":f.index,children:f.getVisibleCells().map(c=>{const h=c.column.columnDef.meta?.style;return s.jsx("td",{className:Ge.columna,style:h,"data-columna":c.column.id,children:bt(c.column.columnDef.cell,c.getContext())},c.id)})},f.id))})]}),i?.length>0?s.jsx(Pf,{totalSeleccionadas:_,acciones:i,filasSeleccionadas:u.map(f=>f.original),onLimpiarSeleccion:g}):null]})}function Tf({id:e}){const t=No("only screen and (max-width: 830px)");return s.jsxs("main",{className:Ge.contenedor,id:e,children:[s.jsx($f,{}),t?s.jsx(Af,{}):s.jsx(zf,{}),s.jsx(kf,{})]})}function Of({id:e,...t}){return s.jsx(Ru,{...t,children:s.jsx(Tf,{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"},xa=m.createContext(void 0),Vf=()=>m.useContext(xa),Yr=m.memo(m.forwardRef(({value:e,label:t,description:n,size:o="md",color:r="primary",customColor:i,variant:a="default",isDisabled:l=!1,isReadOnly:d=!1,isInvalid:u=!1,isRequired:_=!1,children:g,className:f="",onChange:c,...h},p)=>{const v=Vf(),w=m.useId(),y=h.id||w,x=v?.name||h.name,E=v?.size||o,A=v?.color||r,L=v?.customColor||i,N=v?.variant||a,P=v?.isDisabled||l,z=v?.isReadOnly||d,I=v?.isInvalid||u,V=v?.isRequired||_,j=v?.value!==void 0?v.value===e:void 0,$=g||t,b=F=>{P||z||(v?.onChange&&v.onChange(e),c&&c(F))},S=[Ae.contenedor_radio,Ae[`tam_${E}`],!L&&Ae[`color_${A}`],Ae[`variante_${N}`],P&&Ae.deshabilitado,z&&Ae.solo_lectura,I&&Ae.invalido,j&&Ae.seleccionado,f].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:y,children:[s.jsxs("div",{className:Ae.radio,children:[s.jsx("input",{ref:p,type:"radio",id:y,name:x,value:e,checked:j,disabled:P,readOnly:z,required:V,"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:[$,_&&!v&&s.jsx("span",{className:Ae.marca_requerido,children:" *"})]}),n&&s.jsx("span",{className:Ae.texto_descripcion,children:n})]})]})})}));Yr.displayName="Radio";const Sa=({name:e,value:t,defaultValue:n,onChange:o,orientation:r="horizontal",label:i,description:a,isDisabled:l=!1,isReadOnly:d=!1,isRequired:u=!1,isInvalid:_=!1,errorMessage:g,size:f,color:c,customColor:h,variant:p,justifyContent:v="flex-start",children:w,className:y="",options:x,optionValueKey:E,optionLabelKey:A,optionDisabledKey:L,optionDescriptionKey:N})=>{const[P,z]=m.useState(String(n??"")),I=t!==void 0?String(t):P,j={name:e,value:I,onChange:S=>{l||d||(t===void 0&&z(S),o&&o(S))},size:f,color:c,customColor:h,variant:p,isDisabled:l,isReadOnly:d,isInvalid:_,isRequired:u},$=[Ae.grupo_radio,Ae[`orientacion_${r}`],_&&Ae.grupo_invalido,l&&Ae.grupo_deshabilitado,d&&Ae.grupo_solo_lectura,y].filter(Boolean).join(" "),b=v==="center"?"center":v==="flex-end"?"right":"left";return s.jsx(xa.Provider,{value:j,children:s.jsxs("div",{className:$,role:"radiogroup","aria-required":u,"aria-invalid":_,style:{textAlign:b},children:[i&&s.jsxs("div",{className:Ae.encabezado_grupo,children:[s.jsxs("label",{className:Ae.label_grupo,children:[i,u&&s.jsx("span",{className:Ae.marca_requerido,children:" *"})]}),a&&s.jsx("span",{className:Ae.descripcion_grupo,children:a})]}),s.jsx("div",{className:Ae.contenedor_radios,style:{justifyContent:v},children:x&&x.length>0?x.map((S,T)=>{let F,C,k=!1,D;if(typeof S=="object"&&S!==null){const O=E??"value",H=A??"label",B=L??"isDisabled",U=N??"description",X=S[O],ge=S[H];F=String(X!==void 0?X:T),C=ge;const ce=S[B];k=typeof ce=="boolean"?ce:!1;const ie=S[U];D=typeof ie=="string"?ie:void 0}else F=String(S),C=S;return s.jsx(Yr,{value:F,isDisabled:k,description:D,children:C},F)}):w}),_&&g&&s.jsx("span",{className:Ae.mensaje_error,children:g})]})})};Sa.displayName="RadioGroup";const _n={backdrop:"_backdrop_1dyfm_1",visible:"_visible_1dyfm_41",drawer:"_drawer_1dyfm_61",posicion_right:"_posicion_right_1dyfm_127",drawer_detras:"_drawer_detras_1dyfm_159",posicion_left:"_posicion_left_1dyfm_167",posicion_top:"_posicion_top_1dyfm_207",posicion_bottom:"_posicion_bottom_1dyfm_247",radio_none:"_radio_none_1dyfm_287",radio_sm:"_radio_sm_1dyfm_295",radio_md:"_radio_md_1dyfm_315",radio_lg:"_radio_lg_1dyfm_335",radio_xl:"_radio_xl_1dyfm_355",tamano_sm:"_tamano_sm_1dyfm_455",tamano_md:"_tamano_md_1dyfm_465",tamano_lg:"_tamano_lg_1dyfm_475",tamano_xl:"_tamano_xl_1dyfm_485",tamano_full:"_tamano_full_1dyfm_495",encabezado:"_encabezado_1dyfm_555",titulo:"_titulo_1dyfm_575",boton_cerrar:"_boton_cerrar_1dyfm_595",contenido:"_contenido_1dyfm_649",pie:"_pie_1dyfm_661",loading_overlay:"_loading_overlay_1dyfm_681",spinner:"_spinner_1dyfm_705",spin:"_spin_1dyfm_705",loading_text:"_loading_text_1dyfm_735",resize_handle:"_resize_handle_1dyfm_747"},$a=m.forwardRef(({isOpen:e,onClose:t,position:n="right",size:o="md",title:r,showCloseButton:i=!0,closeOnBackdropClick:a=!0,closeOnEscape:l=!0,preventScroll:d=!0,header:u,footer:_,children:g,className:f="",contentClassName:c="",isLoading:h=!1,loadingMessage:p="Cargando...",onOpen:v,backdropVariant:w="normal",borderRadius:y,resizable:x=!1,zIndex:E,getContainer:A},L)=>{const N=m.useRef(null),[P,z]=m.useState(!1),I=m.useCallback(()=>{P||(z(!0),setTimeout(()=>{t?.(),z(!1)},500))},[t,P]);m.useEffect(()=>{e&&z(!1)},[e]),m.useEffect(()=>{if(e){if(v?.(),d){const B=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",B>0&&(document.body.style.paddingRight=`${B}px`)}if(l){const B=U=>{U.key==="Escape"&&I()};return document.addEventListener("keydown",B),()=>{document.removeEventListener("keydown",B),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 V=B=>{a&&B.target===N.current&&I()},j=y?_n[`radio_${y}`]:void 0,$=e&&!P,b=[_n.drawer,_n[`posicion_${n}`],_n[`tamano_${o}`],$&&_n.visible,j,f].filter(Boolean).join(" "),S=[_n.contenido,c].filter(Boolean).join(" "),T=[_n.backdrop,$&&_n.visible].filter(Boolean).join(" "),F=E||500,C={transparente:{opacity:0},sutil:{opacity:.2},normal:{opacity:.4},intermedio:{opacity:.6},intenso:{opacity:.8}},k=C[w]||C.normal,{opacity:D}=k,O={background:`rgb(0 0 0 / ${D})`,zIndex:F,...A&&{position:"absolute"}},H=s.jsx("div",{className:T,ref:N,onClick:V,style:O,children:s.jsxs("div",{ref:L,className:b,role:"dialog","aria-modal":"true","aria-labelledby":"drawer-title",children:[(r||u)&&s.jsx("div",{className:_n.encabezado,children:u||s.jsxs(s.Fragment,{children:[s.jsx("h2",{id:"drawer-title",className:_n.titulo,children:r}),i&&s.jsx("button",{type:"button",className:_n.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}),_&&s.jsx("div",{className:_n.pie,children:_}),h&&s.jsxs("div",{className:_n.loading_overlay,children:[s.jsx("div",{className:_n.spinner}),s.jsx("span",{className:_n.loading_text,children:p})]}),x&&s.jsx("div",{className:_n.resize_handle})]})});if(A){const B=typeof A=="function"?A():A;if(B&&B instanceof HTMLElement)return xt.createPortal(H,B)}return H});$a.displayName="Drawer";const gn={backdrop:"_backdrop_8iexf_1",visible:"_visible_8iexf_41",centrado:"_centrado_8iexf_65",modal:"_modal_8iexf_73",tamano_sm:"_tamano_sm_8iexf_147",tamano_md:"_tamano_md_8iexf_155",tamano_lg:"_tamano_lg_8iexf_163",tamano_xl:"_tamano_xl_8iexf_171",tamano_formulario:"_tamano_formulario_8iexf_179",tamano_full:"_tamano_full_8iexf_187",tamano_auto:"_tamano_auto_8iexf_195",encabezado:"_encabezado_8iexf_205",contenedor_titulo_completo:"_contenedor_titulo_completo_8iexf_219",contenedor_titulo_icono:"_contenedor_titulo_icono_8iexf_229",boton_atras:"_boton_atras_8iexf_241",icono_titulo:"_icono_titulo_8iexf_283",titulo:"_titulo_8iexf_297",contenido:"_contenido_8iexf_317",pie:"_pie_8iexf_329",loading_overlay:"_loading_overlay_8iexf_349",spinner:"_spinner_8iexf_373",spin:"_spin_8iexf_373",loading_text:"_loading_text_8iexf_403"},ka=m.forwardRef(({isOpen:e,onClose:t,size:n="md",title:o,titleIcon:r,closeOnBackdropClick:i=!1,closeOnEscape:a=!0,preventScroll:l=!0,isCentered:d=!0,header:u,footer:_,children:g,className:f="",contentClassName:c="",isLoading:h=!1,loadingMessage:p="Cargando...",backdropVariant:v="normal",showIconTitle:w=!1,onOpen:y},x)=>{const E=m.useRef(null),A=m.useCallback(()=>{h||t?.()},[t,h]);m.useEffect(()=>{if(e){if(y?.(),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"&&A()};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,A,a,l,y]);const L=$=>{i&&$.target===E.current&&A()},N=[gn.backdrop,d&&gn.centrado,e&&gn.visible].filter(Boolean).join(" "),P=[gn.modal,gn[`tamano_${n}`],f].filter(Boolean).join(" "),z=[gn.contenido,c].filter(Boolean).join(" "),I={transparente:{opacity:0},sutil:{opacity:.3},normal:{opacity:.5},intermedio:{opacity:.7},intenso:{opacity:.9}},{opacity:V}=I[v]||I.normal,j={background:`rgb(0 0 0 / ${V})`};return s.jsx("div",{className:N,ref:E,onClick:L,style:j,children:s.jsxs("div",{ref:x,className:P,role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",children:[(o||u)&&s.jsx("div",{className:gn.encabezado,children:s.jsx("div",{className:gn.contenedor_titulo_completo,children:u||s.jsx(s.Fragment,{children:s.jsxs("div",{className:gn.contenedor_titulo_icono,children:[w&&r!==void 0&&(typeof r=="string"?s.jsx("span",{className:gn.icono_titulo,children:r}):r),w&&r===void 0&&s.jsx("span",{className:gn.icono_titulo,children:"📄"}),s.jsx("h2",{id:"modal-title",className:gn.titulo,children:o})]})})})}),s.jsx("div",{className:z,children:g}),_&&s.jsx("div",{className:gn.pie,children:_}),h&&s.jsxs("div",{className:gn.loading_overlay,children:[s.jsx("div",{className:gn.spinner}),s.jsx("span",{className:gn.loading_text,children:p})]})]})})});ka.displayName="Modal";const Sn={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 jf({modals:e,onClose:t}){const[n,o]=m.useState([]),[r,i]=m.useState(!1);m.useEffect(()=>{const f=()=>{i(window.innerWidth<=768)};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]);const a=f=>{o(c=>[...c,f]),setTimeout(()=>{t(f),o(c=>c.filter(h=>h!==f))},300)};if(e.length===0)return null;const l=e.length-1,d=500,u=24,_=e.length*d+(e.length-1)*u,g=e.length>1?_/2-d/2-l*(d+u):0;return s.jsx("div",{className:Sn.overlay,children:s.jsx("div",{className:Sn.container,style:r?void 0:{transform:`translateX(${g}px)`},children:e.map((f,c)=>{const h=n.includes(f.id),p=c===e.length-1,v=[Sn.modal,h&&Sn.modal_closing,!p&&Sn.modal_detras].filter(Boolean).join(" ");return s.jsxs("div",{className:v,children:[s.jsxs("div",{className:Sn.header,children:[s.jsx("button",{type:"button",className:Sn.button_back,onClick:()=>a(f.id),"aria-label":"Volver",children:s.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:s.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),s.jsxs("div",{className:Sn.title_container,children:[f.titleIcon&&s.jsx("span",{className:Sn.title_icon,children:f.titleIcon}),s.jsx("h2",{className:Sn.title,children:f.title})]})]}),s.jsx("div",{className:Sn.content,children:f.content}),f.footer&&s.jsx("div",{className:Sn.footer,children:f.footer})]},f.id)})})})}const Rr=m.createContext(null),Zr=()=>{const e=m.useContext(Rr);if(!e)throw new Error("useDropdownContext debe usarse dentro de DropdownMenu o ContextMenu");return e},jt=e=>e.type==="separator"||e.type==="label"?!1:"children"in e&&Array.isArray(e.children)&&e.children.length>0,Ia=e=>e.type==="checkbox",Ea=e=>e.type==="radio",Ma=e=>e.type==="separator",Na=e=>e.type==="label",$e={menu:"_menu_1v23n_1",variant_default:"_variant_default_1v23n_49",variant_elevated:"_variant_elevated_1v23n_59",variant_bordered:"_variant_bordered_1v23n_69",variant_glass:"_variant_glass_1v23n_83",size_sm:"_size_sm_1v23n_97",size_md:"_size_md_1v23n_113",size_lg:"_size_lg_1v23n_127",item:"_item_1v23n_143",disabled:"_disabled_1v23n_201",active:"_active_1v23n_203",loading:"_loading_1v23n_249",spinner_item:"_spinner_item_1v23n_261",spinItem:"_spinItem_1v23n_1",danger:"_danger_1v23n_293",has_submenu:"_has_submenu_1v23n_307",submenu_open:"_submenu_open_1v23n_315",indicator:"_indicator_1v23n_323",start_icon:"_start_icon_1v23n_353",content:"_content_1v23n_395",label_text:"_label_text_1v23n_413",description:"_description_1v23n_425",shortcut:"_shortcut_1v23n_443",end_icon:"_end_icon_1v23n_467",submenu_arrow:"_submenu_arrow_1v23n_497",separator:"_separator_1v23n_533",label:"_label_1v23n_413",menuEnter:"_menuEnter_1v23n_1",context_menu_trigger:"_context_menu_trigger_1v23n_667"},qf=()=>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"})}),Bf=()=>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"})}),Hf=({marcado:e})=>s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),e&&s.jsx("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"})]}),Jr=m.forwardRef(({item:e,index:t,activeIndex:n,getItemProps:o},r)=>{const i=Zr();if(Ma(e))return s.jsx("div",{className:K($e.separator,i.classNames?.separator),role:"separator"});if(Na(e))return s.jsx("div",{className:K($e.label,i.classNames?.label),role:"presentation","data-testid":"dropdown-label",children:e.label});const a=t===n,l=Ia(e),d=Ea(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&&!jt(e)&&i.cerrarMenu())},_=N=>{u(N)},g=N=>{"isDisabled"in e&&e.isDisabled||(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),u(N))},f=l?e.isChecked:!1,c=d?i.radioValue===e.value:!1,h="label"in e?e.label:void 0,p="description"in e?e.description:void 0,v="shortcut"in e?e.shortcut:void 0,w="startIcon"in e?e.startIcon:void 0,y="endIcon"in e?e.endIcon:void 0,x="isDisabled"in e?e.isDisabled:!1,E="isLoading"in e?e.isLoading:!1,A="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?f:d?c:void 0,"aria-disabled":x||E,tabIndex:a?0:-1,className:K($e.item,$e[`size_${i.size}`],a&&$e.active,x&&$e.disabled,E&&$e.loading,A&&$e.danger,jt(e)&&$e.has_submenu,L,i.classNames?.item),onClick:_,onKeyDown:g,...o(),children:[E?s.jsx("span",{className:$e.indicator,children:s.jsx("span",{className:$e.spinner_item})}):(l||d)&&s.jsxs("span",{className:$e.indicator,children:[l&&f&&s.jsx(qf,{}),d&&s.jsx(Hf,{marcado:c})]}),!E&&w&&s.jsx("span",{className:$e.start_icon,children:w}),s.jsxs("span",{className:$e.content,children:[s.jsx("span",{className:$e.label_text,children:h}),p&&s.jsx("span",{className:$e.description,children:p})]}),v&&s.jsx("kbd",{className:$e.shortcut,children:v}),y&&s.jsx("span",{className:$e.end_icon,children:y}),jt(e)&&s.jsx("span",{className:$e.submenu_arrow,children:s.jsx(Bf,{})})]})});Jr.displayName="MenuItem";const Gf=()=>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"})}),Oo=({items:e,activeIndex:t,getItemProps:n,listRef:o})=>s.jsx(s.Fragment,{children:e.map((r,i)=>jt(r)?s.jsx(Qr,{ref:a=>{o.current[i]=a},item:r,index:i,activeIndex:t,getItemProps:n},r.id):s.jsx(Jr,{ref:a=>{o.current[i]=a},item:r,index:i,activeIndex:t,getItemProps:n},r.id))});Oo.displayName="MenuList";const Qr=m.forwardRef(({item:e,index:t,activeIndex:n,getItemProps:o},r)=>{const i=Zr(),[a,l]=m.useState(!1),d=tt(),u=ps(),_=m.useRef([]),[g,f]=m.useState(null),{refs:c,floatingStyles:h,context:p,isPositioned:v}=So({nodeId:u,open:a,onOpenChange:l,placement:"right-start",middleware:[_o({mainAxis:4,alignmentAxis:-4}),po(),go({padding:8})],whileElementsMounted:co}),{isMounted:w,styles:y}=Mo(p,{duration:i.disableAnimation?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(2px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(2px)"},common:{transitionTimingFunction:i.disableAnimation?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}}),x=vr(p,{enabled:!e.isDisabled,delay:{open:75},handleClose:Os({blockPointerEvents:!0})}),E=Eo(p,{role:"menu"}),A=xo(p,{bubbles:!0}),L=kr(p,{listRef:_,activeIndex:g,onNavigate:f,nested:!0}),{getReferenceProps:N,getFloatingProps:P,getItemProps:z}=$o([x,E,A,L]);m.useEffect(()=>{if(!d)return;const j=()=>l(!1);return d.events.on("click",j),()=>{d.events.off("click",j)}},[d]);const I=t===n,V=ss([c.setReference,r]);return s.jsxs(hs,{id:u,children:[s.jsxs("div",{ref:V,role:"menuitem","aria-haspopup":"menu","aria-expanded":a,"aria-disabled":e.isDisabled,tabIndex:I?0:-1,className:K($e.item,$e[`size_${i.size}`],I&&$e.active,e.isDisabled&&$e.disabled,e.isDanger&&$e.danger,$e.has_submenu,a&&$e.submenu_open,e.className,i.classNames?.item),...N(o()),children:[e.startIcon&&s.jsx("span",{className:$e.start_icon,children:e.startIcon}),s.jsxs("span",{className:$e.content,children:[s.jsx("span",{className:$e.label_text,children:e.label}),e.description&&s.jsx("span",{className:$e.description,children:e.description})]}),e.shortcut&&s.jsx("kbd",{className:$e.shortcut,children:e.shortcut}),s.jsx("span",{className:$e.submenu_arrow,children:s.jsx(Gf,{})})]}),w&&s.jsx(Co,{root:i.portalContainer,children:s.jsx(Cr,{context:p,modal:!1,initialFocus:-1,returnFocus:!1,children:s.jsx("div",{ref:c.setFloating,style:{...h,pointerEvents:"none",zIndex:i.zIndex??"var(--z-dropdown)"},children:s.jsx("div",{className:K($e.menu,$e[`variant_${i.variant}`],i.classNames?.menu),style:{...y,pointerEvents:"auto",visibility:v||!a?"visible":"hidden"},...P(),children:s.jsx(Oo,{items:e.children,activeIndex:g,getItemProps:z,listRef:_})})})})})]})});Qr.displayName="Submenu";const Fa=m.forwardRef(({children:e,items:t,triggerAction:n="click",placement:o="bottom-start",variant:r="default",size:i="md",isDisabled:a=!1,offset:l=4,minWidth:d="180px",matchTriggerWidth:u=!1,disableAnimation:_=!1,closeOnClickOutside:g=!0,closeOnEscape:f=!0,closeOnSelect:c=!0,className:h,classNames:p,style:v,onOpen:w,onClose:y,onOpenChange:x,onContextMenu:E,isOpen:A,zIndex:L,portalContainer:N,radioValue:P,onRadioChange:z},I)=>{const[V,j]=m.useState(!1),[$,b]=m.useState(null),[S,T]=m.useState(0),F=m.useRef([]),C=m.useRef([]),k=ps(),D=A!==void 0,O=D?A:V,H=m.useCallback(q=>{a&&q||(D||j(q),x?.(q),q?w?.():y?.())},[a,D,x,w,y]);m.useEffect(()=>{C.current=t.filter(q=>q.type!=="separator"&&q.type!=="label").map(q=>"label"in q&&typeof q.label=="string"?q.label:"")},[t]);const{refs:B,floatingStyles:U,context:X,isPositioned:ge}=So({nodeId:k,open:O,onOpenChange:H,placement:o,strategy:"fixed",middleware:[_o(l),po({fallbackAxisSideDirection:"start",padding:8}),go({padding:8}),u?is({apply({rects:q,elements:G}){Object.assign(G.floating.style,{minWidth:`${q.reference.width}px`})}}):void 0].filter(Boolean),whileElementsMounted:co}),ce=Ns(X,{enabled:!a&&(n==="click"||n==="both"),toggle:!0}),ie=vr(X,{enabled:!a&&n==="hover",delay:{open:150,close:150},handleClose:Os()}),pe=xo(X,{enabled:f||g,escapeKey:f,outsidePress:g}),ue=Eo(X,{role:"menu"}),ye=kr(X,{listRef:F,activeIndex:$,onNavigate:b,loop:!0}),Z=Ps(X,{listRef:C,activeIndex:$,onMatch:b,enabled:O}),{getReferenceProps:oe,getFloatingProps:te,getItemProps:ve}=$o([ce,ie,pe,ue,ye,Z]),{isMounted:se,styles:Q}=Mo(X,{duration:_?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(4px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(4px)"},common:{transitionTimingFunction:_?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}});m.useImperativeHandle(I,()=>({open:()=>H(!0),close:()=>H(!1),toggle:()=>H(!O),isOpen:O}),[H,O]);const de=m.useMemo(()=>({radioValue:P,onRadioChange:z,cerrarMenu:()=>H(!1),closeOnSelect:c,size:i,variant:r,disableAnimation:_,classNames:p,portalContainer:N,zIndex:L}),[P,z,H,c,i,r,_,p,N,L]),be=m.isValidElement(e)?e:null,J=ss([B.setReference,be?.ref||null]);if(!be)return e!=null&&console.error("DropdownMenu: children debe ser un elemento React válido"),null;const Ce=n==="contextmenu"||n==="both"?{onContextMenu:q=>{q.preventDefault();const G={x:q.clientX,y:q.clientY};E?.(q,G),H(!1),T(fe=>fe+1),requestAnimationFrame(()=>{B.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:G.x,y:G.y,top:G.y,left:G.x,right:G.x,bottom:G.y}}}),H(!0)})},onClick:()=>{O&&n==="contextmenu"&&H(!1)}}:{},W=m.cloneElement(e,oe({...e.props,...Ce,ref:J,"aria-haspopup":"menu","aria-expanded":O}));return s.jsx(Rr.Provider,{value:de,children:s.jsxs(hs,{id:k,children:[W,se&&s.jsx(Co,{root:N,children:s.jsx(Cr,{context:X,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:B.setFloating,style:{...U,zIndex:L??"var(--z-dropdown)",outline:"none",pointerEvents:"none"},children:s.jsx("div",{role:"menu","aria-orientation":"vertical",className:K($e.menu,$e[`variant_${r}`],$e[`size_${i}`],h,p?.menu),style:{...Q,minWidth:d,...v,transform:[Q.transform,v?.transform].filter(Boolean).join(" "),pointerEvents:"auto",visibility:ge||!O?"visible":"hidden"},...te(),children:s.jsx(Oo,{items:t,activeIndex:$,getItemProps:ve,listRef:F})},S)})})})]})})});Fa.displayName="DropdownMenuInner";const Vo=m.forwardRef((e,t)=>s.jsx(id,{children:s.jsx(Fa,{...e,ref:t})}));Vo.displayName="DropdownMenu";const Da=m.forwardRef(({isEnabled:e=!0,children:t,...n},o)=>s.jsx(Vo,{...n,ref:o,triggerAction:"contextmenu",isDisabled:!e||n.isDisabled,children:t}));Da.displayName="ContextMenu";const Bn={group_button:"_group_button_wgdis_1",full_width:"_full_width_wgdis_17",main_button:"_main_button_wgdis_27",dropdown_trigger:"_dropdown_trigger_wgdis_35",first_item:"_first_item_wgdis_45",last_item:"_last_item_wgdis_55",variant_bordered:"_variant_bordered_wgdis_65",variant_ghost:"_variant_ghost_wgdis_67",variant_faded:"_variant_faded_wgdis_69",disabled:"_disabled_wgdis_93",loading:"_loading_wgdis_93",chevron:"_chevron_wgdis_111",chevron_open:"_chevron_open_wgdis_123"},Wf=({label:e,onClick:t,items:n,variant:o="solid",color:r="primary",size:i="md",radius:a="md",isLoading:l=!1,isDisabled:d=!1,dropdownIcon:u,className:_,fullWidth:g=!1,...f})=>{const[c,h]=m.useState(!1),p=K(Bn.group_button,Bn[`variant_${o}`],g&&Bn.full_width,_),v=()=>s.jsx("div",{className:K(Bn.chevron,c&&Bn.chevron_open),children:s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:s.jsx("path",{d:"m6 9 6 6 6-6"})})});return s.jsxs("div",{className:p,children:[s.jsx(on,{variant:o,color:r,size:i,radius:a,isLoading:l,isDisabled:d,onClick:t,className:K(Bn.main_button,Bn.first_item),...f,children:e}),n&&s.jsx(Vo,{items:n,triggerAction:"click",onOpenChange:h,placement:"bottom-end",isDisabled:d||l,variant:"default",size:i,matchTriggerWidth:!1,children:s.jsx(on,{variant:o,color:r,size:i,radius:a,isDisabled:d||l,isIconOnly:!0,className:K(Bn.dropdown_trigger,Bn.last_item),"aria-label":"M�s acciones",children:u||v()})})]})},Aa=()=>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"})}),La=()=>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"})}),Pa=()=>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"})}),za=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"15 18 9 12 15 6"})}),Ta=()=>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"})}),Qe={overlay:"_overlay_1jwfa_1",backdrop:"_backdrop_1jwfa_25",visible:"_visible_1jwfa_51",layout:"_layout_1jwfa_75",columna_acciones:"_columna_acciones_1jwfa_143",boton_flotante:"_boton_flotante_1jwfa_163",boton_primario:"_boton_primario_1jwfa_237",boton_peligro:"_boton_peligro_1jwfa_247",panel:"_panel_1jwfa_265",encabezado:"_encabezado_1jwfa_293",titulo:"_titulo_1jwfa_311",contenido:"_contenido_1jwfa_327",paginacion:"_paginacion_1jwfa_341",texto_paginacion:"_texto_paginacion_1jwfa_367"},Kf={transparente:{background:"transparent"},sutil:{background:"rgb(0 0 0 / 20%)"},normal:{background:"rgb(0 0 0 / 40%)"},intenso:{background:"rgb(0 0 0 / 60%)"}},Uf=({isOpen:e,onClose:t,onApply:n,onClear:o,title:r="Filtros",backdropVariant:i="sutil",closeOnBackdropClick:a=!0,allowBackdropInteraction:l=!1,getContainer:d,children:u})=>{const[_,g]=m.useState(!1),[f,c]=m.useState(0),h=l||i==="transparente",p=m.useCallback(()=>{_||(g(!0),setTimeout(()=>{t(),g(!1),c(0)},500))},[t,_]);m.useEffect(()=>{e&&g(!1)},[e]),m.useEffect(()=>{if(!e)return;const I=V=>V.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:y,totalPages:x,hasPagination:E}=m.useMemo(()=>{const I=Array.isArray(u)?u:[u];return{pages:I,totalPages:I.length,hasPagination:I.length>1}},[u]),{background:A}=Kf[i],L={background:A,pointerEvents:h?"none":"auto"},N=d?{position:"absolute"}:{},P=d?{position:"relative"}:{},z=s.jsxs("div",{className:Qe.overlay,role:"dialog","aria-modal":"true",style:N,children:[s.jsx("div",{className:`${Qe.backdrop} ${e&&!_?Qe.visible:""}`,style:L,onClick:v}),s.jsxs("div",{className:`${Qe.layout} ${e&&!_?Qe.visible:""}`,style:P,children:[s.jsxs("aside",{className:Qe.columna_acciones,children:[s.jsx(it,{content:"Cerrar",placement:"left",children:s.jsx("button",{className:Qe.boton_flotante,onClick:()=>w(p),"aria-label":"Cerrar panel",children:s.jsx(Aa,{})})}),s.jsx(it,{content:"Aplicar filtros",placement:"left",children:s.jsx("button",{className:`${Qe.boton_flotante} ${Qe.boton_primario}`,onClick:()=>w(n),children:s.jsx(La,{})})}),s.jsx(it,{content:"Limpiar filtros",placement:"left",children:s.jsx("button",{className:`${Qe.boton_flotante} ${Qe.boton_peligro}`,onClick:()=>w(o),children:s.jsx(Pa,{})})}),E&&s.jsxs("div",{className:Qe.paginacion,children:[s.jsx("button",{className:Qe.boton_flotante,style:{width:36,height:36},onClick:()=>c(I=>Math.max(0,I-1)),disabled:f===0,"aria-label":"Página anterior",children:s.jsx(za,{})}),s.jsxs("span",{className:Qe.texto_paginacion,children:[f+1," / ",x]}),s.jsx("button",{className:Qe.boton_flotante,style:{width:36,height:36},onClick:()=>c(I=>Math.min(x-1,I+1)),disabled:f===x-1,"aria-label":"Página siguiente",children:s.jsx(Ta,{})})]})]}),s.jsxs("main",{className:Qe.panel,children:[s.jsx("header",{className:Qe.encabezado,children:s.jsx("h2",{className:Qe.titulo,children:r})}),s.jsx("div",{className:Qe.contenido,children:s.jsx("div",{style:{animation:"fadeIn 0.3s ease"},children:y[f]},f)})]})]})]});if(d){const I=typeof d=="function"?d():d;if(I&&I instanceof HTMLElement)return xt.createPortal(z,I)}return z};Y.Badge=si,Y.BadgeVoz=Yo,Y.Boton=on,Y.Checkbox=wt,Y.CheckboxGroup=da,Y.ContextMenu=Da,Y.Drawer=$a,Y.DropdownContext=Rr,Y.DropdownMenu=Vo,Y.GrabacionIcono=mi,Y.GroupButton=Wf,Y.IconoCerrar=Aa,Y.IconoDerecha=Ta,Y.IconoFiltroAplicar=La,Y.IconoFiltroLimpiar=Pa,Y.IconoIzquierda=za,Y.InputDate=hi,Y.InputNumeric=pi,Y.InputText=ui,Y.MenuItem=Jr,Y.MenuList=Oo,Y.MicrofonoIcono=Uo,Y.Modal=ka,Y.ModalStack=jf,Y.PanelFiltros=Uf,Y.Radio=Yr,Y.RadioGroup=Sa,Y.Select=Rs,Y.Signature=di,Y.SonidoIcono=Xo,Y.Submenu=Qr,Y.TablaDatos=Of,Y.TextArea=bi,Y.Toggle=Wo,Y.Tooltip=it,Y.Transicion=Kt,Y.esCheckbox=Ia,Y.esLabel=Na,Y.esRadio=Ea,Y.esSeparador=Ma,Y.fechaEnRango=pl,Y.formatearFecha=Ko,Y.formatearNumero=St,Y.generarOpcionesAleatorias=Wd,Y.generarUsuariosPrueba=Kd,Y.obtenerFechaHoy=gl,Y.parsearNumero=fi,Y.procesarValidacion=_i,Y.redondearDecimales=gi,Y.restringirRango=Wt,Y.tieneHijos=jt,Y.useCheckboxGroupContext=ca,Y.useDropdownContext=Zr,Y.useReconocimientoVoz=vi,Y.useTablaContext=Zu,Y.useTablaContextSafe=Rn,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})}));
|
|
28
|
+
*/function Nn(e,n){return e?k_(e)?M.createElement(e,n):e:null}function k_(e){return N_(e)||typeof e=="function"||E_(e)}function N_(e){return typeof e=="function"&&(()=>{const n=Object.getPrototypeOf(e);return n.prototype&&n.prototype.isReactComponent})()}function E_(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function M_(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=M.useState(()=>({current:m_(n)})),[o,a]=M.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:s=>{a(s),e.onStateChange==null||e.onStateChange(s)}})),t.current}const Pe={checkbox_container:"_checkbox_container_3c4gu_1",checkbox_wrapper:"_checkbox_wrapper_3c4gu_13",label_text:"_label_text_3c4gu_33",hint_text:"_hint_text_3c4gu_51",checkbox:"_checkbox_3c4gu_1",input:"_input_3c4gu_99",checkbox_svg:"_checkbox_svg_3c4gu_153",custom_icon:"_custom_icon_3c4gu_195",checked:"_checked_3c4gu_225",indeterminate:"_indeterminate_3c4gu_227",radius_none:"_radius_none_3c4gu_235",radius_sm:"_radius_sm_3c4gu_243",radius_md:"_radius_md_3c4gu_251",radius_lg:"_radius_lg_3c4gu_259",radius_full:"_radius_full_3c4gu_267",sm:"_sm_3c4gu_275",lg:"_lg_3c4gu_301",secondary:"_secondary_3c4gu_327",success:"_success_3c4gu_335",warning:"_warning_3c4gu_343",danger:"_danger_3c4gu_351",solid:"_solid_3c4gu_377",outline:"_outline_3c4gu_391",disabled:"_disabled_3c4gu_439",readonly:"_readonly_3c4gu_509",no_animation:"_no_animation_3c4gu_589",line_through:"_line_through_3c4gu_607",lineThrough:"_lineThrough_3c4gu_1",checkbox_group:"_checkbox_group_3c4gu_651",label:"_label_3c4gu_33",marca_requerido:"_marca_requerido_3c4gu_679",description:"_description_3c4gu_687",checkboxes:"_checkboxes_3c4gu_701",vertical:"_vertical_3c4gu_711",horizontal:"_horizontal_3c4gu_719",grid:"_grid_3c4gu_727",error_message:"_error_message_3c4gu_737",invalid:"_invalid_3c4gu_749"},Ns=h.createContext(null),Es=()=>h.useContext(Ns),En=h.forwardRef((e,n)=>{const{children:t,label:o,hint:a,isSelected:i,defaultChecked:s,isIndeterminate:l=!1,isDisabled:c=!1,isReadOnly:u=!1,isRequired:_=!1,lineThrough:g=!1,onlyIcon:f=!1,disableAnimation:d=!1,customCheckIcon:m,size:p="md",color:v="primary",customColor:y,radius:w="md",variant:C="solid",className:k="",classNames:z={},onChange:A,value:N,name:P,id:O,...E}=e,T=Es(),V=h.useId(),S=O||V,b=h.useRef(null),x=i!==void 0,[F,I]=h.useState(s??!1),$=!!T,D=$&&N?T.value.includes(N):!1,B=$?D:x?i:F,X=!!T?.maxSelectionReached&&!B,U=c||T?.isDisabled||X,L=u||T?.isReadOnly,j=T?!1:_,W=P||T?.name;h.useEffect(()=>{const ae=b.current||(n&&typeof n=="object"?n.current:null);ae&&(ae.indeterminate=l??!1)},[l,n]);const ie=ae=>{if(U||L)return;const me=ae.target.checked;$&&N?T.onChange(N):(x||I(me),A?.(me))},re=o||t;return r.jsxs("div",{className:ne(Pe.checkbox_container,{[Pe.disabled]:U,[Pe.readonly]:L},z.base,k),children:[r.jsxs("label",{className:ne(Pe.checkbox_wrapper,Pe[p],!y&&Pe[v],Pe[C],Pe[`radius_${w}`],{[Pe.checked]:B,[Pe.indeterminate]:l,[Pe.disabled]:U,[Pe.readonly]:L,[Pe.line_through]:g&&B,[Pe.no_animation]:d}),style:y?{"--checkbox-custom-color":y}:void 0,children:[r.jsxs("span",{className:Pe.checkbox,children:[r.jsx("input",{ref:ae=>{b.current=ae,typeof n=="function"?n(ae):n&&(n.current=ae)},id:S,type:"checkbox",className:Pe.input,checked:B,onChange:ie,disabled:U,readOnly:L,required:j,value:N,name:W,...E}),m?r.jsx("span",{className:Pe.custom_icon,children:m}):r.jsx("svg",{className:Pe.checkbox_svg,viewBox:"0 0 22 22","aria-hidden":"true",children:r.jsx("path",{fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:l?"M6,11 L16,11":"M5.5,11.3L9,14.8L20.2,3.3l0,0c-0.5-1-1.5-1.8-2.7-1.8h-13c-1.7,0-3,1.3-3,3v13c0,1.7,1.3,3,3,3h13 c1.7,0,3-1.3,3-3v-13c0-0.4-0.1-0.8-0.3-1.2"})})]}),!f&&re&&r.jsx("span",{className:ne(Pe.label_text,z.label),children:re})]}),a&&r.jsx("span",{className:ne(Pe.hint_text,z.label),children:a})]})});En.displayName="Checkbox";const Ms=({label:e,children:n,description:t,errorMessage:o,isInvalid:a=!1,orientation:i="vertical",className:s,value:l,defaultValue:c=[],onChange:u,isDisabled:_=!1,isReadOnly:g=!1,isRequired:f=!1,minSelection:d,maxSelection:m,requiredMessage:p,name:v,options:y,optionValueKey:w,optionLabelKey:C,optionDisabledKey:k,optionDescriptionKey:z,columns:A})=>{const N=l!==void 0,[P,O]=h.useState(c),E=N?l:P,T=h.useRef(null),V=f?d??1:d??0,S=m!==void 0&&E.length>=m;h.useEffect(()=>{if(!T.current||V===0)return;V-E.length<=0?T.current.setCustomValidity(""):T.current.setCustomValidity(p??(V===1?"Selecciona al menos una opción":`Selecciona al menos ${V} opciones`))},[E,V,p]);const b=F=>{if(_||g)return;const I=E.includes(F);if(!I&&S)return;const $=I?E.filter(D=>D!==F):[...E,F];N||O($),u?.($)},x=r.jsx("input",{ref:T,type:"checkbox",required:!0,checked:E.length>=V,onChange:()=>{},"aria-hidden":"true",tabIndex:-1,style:{height:"1px",left:0,opacity:0,pointerEvents:"none",position:"absolute",top:"100%",width:"1px"}});return r.jsxs("div",{className:ne(Pe.checkbox_group,Pe[i],{[Pe.invalid]:a,[Pe.disabled]:_,[Pe.readonly]:g},s),role:"group","aria-required":f||V>0,"aria-invalid":a,children:[V>0&&!e&&x,e&&r.jsxs("div",{className:Pe.label,style:{position:"relative"},children:[e,(f||V>0)&&r.jsx("span",{className:Pe.marca_requerido,children:" *"}),V>0&&x]}),t&&r.jsx("div",{className:Pe.description,children:t}),r.jsx(Ns.Provider,{value:{value:E,onChange:b,isDisabled:_,isReadOnly:g,isRequired:f,name:v,maxSelectionReached:S},children:r.jsx("div",{className:ne(Pe.checkboxes,!A&&Pe[i],A&&Pe.grid),style:A?{gridTemplateColumns:typeof A=="number"?`repeat(${A}, 1fr)`:A}:void 0,children:y&&y.length>0?y.map((F,I)=>{let $,D,B=!1,X;if(typeof F=="object"&&F!==null){const U=w??"value",L=C??"label",j=k??"isDisabled",W=z??"description",ie=F[U];$=String(ie!==void 0?ie:I),D=F[L];const re=F[j];B=typeof re=="boolean"?re:!1;const ae=F[W];X=typeof ae=="string"?ae:void 0}else $=String(F),D=F;return r.jsx(En,{value:$,isDisabled:B,hint:X,children:D},$)}):n})}),o&&a&&r.jsx("div",{className:Pe.error_message,children:o})]})};Ms.displayName="CheckboxGroup";const We={contenedor:"_contenedor_16k0y_1",contenedor_superior:"_contenedor_superior_16k0y_17",input_con_icono:"_input_con_icono_16k0y_35",icono_busqueda:"_icono_busqueda_16k0y_49",input_busqueda:"_input_busqueda_16k0y_75",contenedor_acciones_botones:"_contenedor_acciones_botones_16k0y_147",contenedor_acciones:"_contenedor_acciones_16k0y_147",columna:"_columna_16k0y_183",encabezados:"_encabezados_16k0y_203",contenido_encabezado:"_contenido_encabezado_16k0y_229",icono_orden:"_icono_orden_16k0y_243",boton_basico:"_boton_basico_16k0y_323",texto_filtros:"_texto_filtros_16k0y_347",menu_configuraciones:"_menu_configuraciones_16k0y_379",tabla_card:"_tabla_card_16k0y_427",wrapper_scroll_tabla:"_wrapper_scroll_tabla_16k0y_439",contenedor_tabla:"_contenedor_tabla_16k0y_453",contenedor_datos:"_contenedor_datos_16k0y_467",datos:"_datos_16k0y_501",seleccionada:"_seleccionada_16k0y_549",boton_acciones:"_boton_acciones_16k0y_609"};function I_(e,n,t=3){const o=Math.floor(t/2);let a=e-o;a<1&&(a=1),a+t-1>n&&(a=Math.max(1,n-t+1));const i=Math.min(t,n);return Array.from({length:i},(s,l)=>a+l)}function F_(e,n){return n===0?0:e>=n?n-1:e<0?0:e}function Mn(e,n){const t=new Map;n.getFlatHeaders().forEach(s=>t.set(s.column.id,s));const o=t.get(e);if(o)return Nn(o.column.columnDef.header,o.getContext());const a=n.getAllLeafColumns().find(s=>s.id===e),i=a?.columnDef.header;return typeof i=="string"||typeof i=="number"?i:a?.id??e}function Is(e,n){const t=e.getVisibleCells().find(o=>o.column.id===n);return t?Nn(t.column.columnDef.cell,t.getContext()):null}function Fs(e,n){return n?e.getVisibleCells().map(o=>o.column.id).includes(n):!1}function z_(e,n,t){return e.getVisibleCells().filter(o=>o.column.id!=="actions"&&o.column.id!==n&&o.column.id!==t)}function L_(e,n){if(n===0)return"";if(n===1)return la(e[0].nombre.toLowerCase());if(n===2)return`${la(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const t=e.slice(0,2).map(a=>a.nombre.toLowerCase()),o=n-2;return`${la(t.join(", "))} y ${o>1?`otros ${o}`:"otro"} más`}function la(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function zs(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}const Ls=h.createContext(null),ca=Ls;function Zo(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t+=1)if(e[t]!==n[t])return!1;return!0}function A_({children:e,data:n,columns:t,controls:o,loading:a,primerasColumnas:i,tamanioPaginaInicial:s=10,filtros:l,descargarExcel:c,actualizarTabla:u,selectorFilas:_=[],sinDatosProps:g,maxColumnasVisibles:f=10,...d}){const[m,p]=h.useState(""),v=xu(m,200),y=Hr("only screen and (max-width: 830px)"),[w,C]=h.useState({pageIndex:0,pageSize:s}),[k,z]=h.useState({}),A=h.useMemo(()=>{const L={},j=new Set;t.forEach(ie=>{const re="accessorKey"in ie?String(ie.accessorKey):ie.id;re&&ie.meta?.isHidden&&(L[re]=!1,j.add(re))});let W=0;return t.forEach(ie=>{const re="accessorKey"in ie?String(ie.accessorKey):ie.id;!re||j.has(re)||(W<f?W++:L[re]=!1)}),L},[t,f]),[N,P]=h.useState(()=>A);h.useEffect(()=>{P(A)},[A]);const O=h.useMemo(()=>{const L=[];return _.length>0&&!y&&L.push({id:"select",header:({table:j})=>r.jsx(En,{color:"secondary",isSelected:j.getIsAllPageRowsSelected(),isIndeterminate:j.getIsSomePageRowsSelected()&&!j.getIsAllPageRowsSelected(),onChange:W=>j.toggleAllPageRowsSelected(!!W)}),cell:({row:j})=>r.jsx(En,{color:"primary",isSelected:j.getIsSelected(),isDisabled:!j.getCanSelect(),onChange:W=>j.toggleSelected(W)}),enableSorting:!1,enableHiding:!1}),L.push(...t),o?.length&&L.push({id:"actions",header:"Acciones",cell:j=>r.jsx("div",{className:We.contenedor_acciones,children:o.filter(W=>!W.visible||W.visible(j.row.original)).map(W=>"contenido"in W?r.jsx(_n,{content:W.nombre,variant:"default",size:"sm",placement:"top",children:r.jsx("span",{children:W.contenido(j.row.original,We.boton_acciones)})},W.id):r.jsx(_n,{content:W.nombre,variant:"default",size:"sm",placement:"top",children:r.jsx(Ze,{id:W.id,size:"sm",radius:"md",variant:"light",isIconOnly:!0,onClick:()=>W.evento(j.row.original),className:We.boton_acciones,children:W.icono})},W.id))}),enableSorting:!1,enableHiding:!1}),L},[t,o,_.length,y]),E=h.useMemo(()=>{const L=O.map(W=>"accessorKey"in W&&W.accessorKey!=null?String(W.accessorKey):"id"in W&&W.id!=null?String(W.id):"").filter(Boolean),j=L.indexOf("actions");return j>-1&&j<L.length-1&&(L.splice(j,1),L.push("actions")),L},[O]),[T,V]=h.useState(()=>E);h.useEffect(()=>{V(L=>Zo(L,E)?L:E)},[E]);const S=h.useCallback((L,j,W)=>{if(!W)return!0;const ie=zs(String(W)),re=L.getValue(j);return re==null?!1:zs(String(re)).includes(ie)},[]),b=M_({data:n,columns:O,state:{pagination:w,globalFilter:v,columnOrder:T,rowSelection:k,columnVisibility:N},onColumnVisibilityChange:P,globalFilterFn:S,enableRowSelection:_.length>0,onRowSelectionChange:z,onPaginationChange:C,onColumnOrderChange:L=>{V(j=>{const W=typeof L=="function"?L(j):L;return Zo(j,W)?j:W})},getCoreRowModel:v_(),getSortedRowModel:S_(),getFilteredRowModel:x_(),getPaginationRowModel:$_(),autoResetPageIndex:!1}),x=b.getPageCount();h.useEffect(()=>{const L=F_(w.pageIndex,x);L!==w.pageIndex&&C(j=>({...j,pageIndex:L}))},[w.pageIndex,x]);const F=h.useRef(v);h.useEffect(()=>{F.current!==v&&C(j=>j.pageIndex===0?j:{...j,pageIndex:0}),F.current=v},[v]);const I=h.useMemo(()=>b.getAllLeafColumns().filter(L=>L.id!=="actions"&&L.id!=="select"&&L.getCanHide?.()),[b]),$=h.useCallback(L=>{const W=t.find(ie=>"accessorKey"in ie?String(ie.accessorKey)===L:String(ie.id)===L)?.header;return typeof W=="string"||typeof W=="number"?String(W):L},[t]),D=h.useCallback(()=>{P(A),b.setPageSize(s),b.setPageIndex(0),b.resetRowSelection(),V(L=>Zo(L,E)?L:E)},[b,s,E,A]),B=h.useCallback(L=>{const j=Math.max(1,Math.min(200,L));b.setPageSize(j),b.setPageIndex(0)},[b]),X=h.useCallback(L=>{V(j=>{const W=typeof L=="function"?L(j):L;return Zo(j,W)?j:W})},[]),U=h.useMemo(()=>({state:{ordenColumnas:T,table:b,columns:O,controls:o,loading:a,primerasColumnas:[String(i[0]),String(i[1])],inputBusqueda:m,setInputBusqueda:p,filtros:l,descargarExcel:c,actualizarTabla:u,selectorFilas:_,sinDatosProps:g,maxColumnasVisibles:f,...d},todasLasColumnas:I,etiquetaColumna:$,restaurarConfiguracion:D,cambiarPageSize:B,cambiarOrdenColumnas:X}),[T,b,O,o,a,m,l,i,c,u,_,g,f,d,I,$,D,B,X]);return r.jsx(Ls.Provider,{value:U,children:e})}function D_(){const e=h.useContext(ca);if(!e)throw new Error("useTablaContext debe usarse dentro de TablaDatosProvider");return e}function tn(){const e=h.useContext(ca);return e||null}const Gt={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 As(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:r.jsx("path",{fill:"currentColor",d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function Ds(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:r.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 P_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:r.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 T_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:r.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 O_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:r.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M10.97 20.344L9 21v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4h16v2.172a2 2 0 0 1-.586 1.414L15 12v1.5m3.42 2.11a2.1 2.1 0 0 1 2.97 2.97L18 22h-3v-3z"})})}function V_(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:[r.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"}),r.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 B_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:r.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[r.jsx("circle",{cx:"12",cy:"12",r:"3"}),r.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 j_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:r.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 q_(e){return r.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",...e,children:[r.jsx("circle",{cx:"5.5",cy:"4",r:"1.2",fill:"currentColor"}),r.jsx("circle",{cx:"5.5",cy:"8",r:"1.2",fill:"currentColor"}),r.jsx("circle",{cx:"5.5",cy:"12",r:"1.2",fill:"currentColor"}),r.jsx("circle",{cx:"10.5",cy:"4",r:"1.2",fill:"currentColor",opacity:".35"}),r.jsx("circle",{cx:"10.5",cy:"8",r:"1.2",fill:"currentColor",opacity:".35"}),r.jsx("circle",{cx:"10.5",cy:"12",r:"1.2",fill:"currentColor",opacity:".35"})]})}function H_(e){return r.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[r.jsx("rect",{x:"3",y:"3",width:"4",height:"14",rx:"1",fill:"currentColor"}),r.jsx("rect",{x:"8",y:"3",width:"9",height:"14",rx:"1",fill:"currentColor",opacity:".3"})]})}function W_(e){return r.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[r.jsx("rect",{x:"3",y:"3",width:"14",height:"4",rx:"1",fill:"currentColor"}),r.jsx("rect",{x:"3",y:"8",width:"14",height:"9",rx:"1",fill:"currentColor",opacity:".3"})]})}function G_(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:[r.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor",opacity:".2"}),r.jsx("path",{fill:"currentColor",d:"M13 7a1 1 0 1 0-2 0v4H7a1 1 0 1 0 0 2h4v4a1 1 0 1 0 2 0v-4h4a1 1 0 1 0 0-2h-4V7Z"})]})}function Z_(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[r.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor",opacity:".2"}),r.jsx("path",{fill:"currentColor",d:"M7 12a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Z"})]})}function U_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:r.jsx("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"})})}function K_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:r.jsxs("g",{fill:"none",children:[r.jsx("path",{fill:"currentColor",d:"M7.378 11.63h-.75zm0 .926l-.562.497a.75.75 0 0 0 1.08.044zm2.141-1.015a.75.75 0 0 0-1.038-1.082zm-2.958-1.038a.75.75 0 1 0-1.122.994zm8.37-1.494a.75.75 0 1 0 1.102-1.018zM12.045 6.25c-2.986 0-5.416 2.403-5.416 5.38h1.5c0-2.137 1.747-3.88 3.916-3.88zm-5.416 5.38v.926h1.5v-.926zm1.269 1.467l1.622-1.556l-1.038-1.082l-1.622 1.555zm.042-1.039l-1.378-1.555l-1.122.994l1.377 1.556zm8.094-4.067a5.42 5.42 0 0 0-3.99-1.741v1.5a3.92 3.92 0 0 1 2.889 1.26zm.585 3.453l.56-.498a.75.75 0 0 0-1.08-.043zm-2.139 1.014a.75.75 0 1 0 1.04 1.082zm2.96 1.04a.75.75 0 0 0 1.12-.997zm-8.393 1.507a.75.75 0 0 0-1.094 1.026zm2.888 2.745c2.993 0 5.434-2.4 5.434-5.38h-1.5c0 2.135-1.753 3.88-3.934 3.88zm5.434-5.38v-.926h-1.5v.926zm-1.27-1.467l-1.619 1.555l1.04 1.082l1.618-1.555zm-.04 1.04l1.38 1.554l1.122-.996l-1.381-1.555zM7.952 16.03a5.45 5.45 0 0 0 3.982 1.719v-1.5c-1.143 0-2.17-.48-2.888-1.245z"}),r.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",opacity:".5"})]})})}function X_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:r.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"})})}function Y_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:r.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"})})}const J_=({titulo:e,onBack:n})=>r.jsxs("header",{className:Gt.header,children:[r.jsx(Ze,{isIconOnly:!0,variant:"light",onClick:n,"aria-label":"Regresar",children:r.jsx(As,{})}),r.jsx("h3",{className:Gt.titulo,children:e})]}),nn={contenedor:"_contenedor_1leqv_1",lista:"_lista_1leqv_13",item:"_item_1leqv_45",item_dragging:"_item_dragging_1leqv_75",item_deshabilitado:"_item_deshabilitado_1leqv_85",icono_drag:"_icono_drag_1leqv_95",nombre:"_nombre_1leqv_147",checkbox:"_checkbox_1leqv_177"};function Q_(){const e=tn(),[n,t]=h.useState(null);if(!e)return null;const{state:o,todasLasColumnas:a,etiquetaColumna:i,cambiarOrdenColumnas:s}=e,{ordenColumnas:l,maxColumnasVisibles:c=10}=o,_=a.filter(m=>m.getIsVisible()).length>=c,g=m=>p=>{t(m),p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",m)},f=m=>p=>{p.preventDefault(),!(!n||n===m)&&s?.(v=>{const y=[...v],w=y.indexOf(n),C=y.indexOf(m);return w===-1||C===-1?v:(y.splice(w,1),y.splice(C,0,n),y)})},d=()=>t(null);return r.jsx("div",{className:nn.contenedor,children:r.jsx("ul",{className:nn.lista,children:l.map(m=>{const p=a.find(k=>k.id===m);if(!p)return null;const v=p.getCanHide?.()??!0,y=p.getIsVisible(),w=n===p.id,C=!v||!y&&_;return r.jsxs("li",{className:`${nn.item} ${w?nn.item_dragging:""} ${C?nn.item_deshabilitado:""}`,draggable:!C,onDragStart:g(p.id),onDragOver:f(p.id),onDrop:d,onDragEnd:d,title:!y&&_?`Límite de ${c} columnas visibles alcanzado`:void 0,children:[r.jsx("span",{className:nn.icono_drag,"aria-label":"Arrastrar columna",children:r.jsx(q_,{})}),r.jsx("span",{className:nn.nombre,children:i(p.id)}),r.jsx(En,{size:"md",color:"primary",isSelected:y,isDisabled:C,onChange:k=>p.toggleVisibility(k),className:nn.checkbox})]},p.id)})})})}const Kn={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function R_(){const e=tn(),[n,t]=h.useState(""),o=h.useRef(null),a=e?.state.table?.getState().pagination.pageSize??10;if(h.useEffect(()=>t(String(a)),[a]),!e)return null;const{cambiarPageSize:i}=e,s=g=>Math.max(da,Math.min(ua,g)),l=g=>{const f=a+g;f>=da&&f<=ua&&i?.(f)},c=()=>{const g=parseInt(n,10),f=!isNaN(g)&&g>0?s(g):a;i?.(f),t(String(f))},u=g=>{({Enter:()=>{c(),o.current?.blur()},Escape:()=>{t(String(a)),o.current?.blur()},ArrowUp:()=>{g.preventDefault(),l(1),setTimeout(()=>o.current?.select(),0)},ArrowDown:()=>{g.preventDefault(),l(-1),setTimeout(()=>o.current?.select(),0)}})[g.key]?.()},_=g=>{const f=g.target.value;(f===""||/^\d+$/.test(f))&&t(f)};return r.jsxs("div",{className:Kn.contenido,children:[r.jsx("p",{className:Kn.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),r.jsxs("div",{className:Kn.control,children:[r.jsx(Ze,{isIconOnly:!0,radius:"lg",variant:"light",onClick:()=>l(-1),"aria-label":"Disminuir filas",disabled:a<=da,children:r.jsx(Z_,{style:{fontSize:"var(--gaps-6)"}})}),r.jsx("div",{className:Kn.valor,children:r.jsx("input",{ref:o,type:"text",inputMode:"numeric",value:n,onChange:_,onKeyDown:u,onFocus:()=>o.current?.select(),onBlur:c,className:Kn.input,"aria-label":"Número de filas por página"})}),r.jsx(Ze,{isIconOnly:!0,radius:"lg",variant:"light",onClick:()=>l(1),"aria-label":"Aumentar filas",disabled:a>=ua,children:r.jsx(G_,{})})]})]})}const gt={contenedor:"_contenedor_1lwmx_1",menu:"_menu_1lwmx_11",item:"_item_1lwmx_25",icono_contenedor:"_icono_contenedor_1lwmx_111",icono_restaurar:"_icono_restaurar_1lwmx_143",texto:"_texto_1lwmx_153",nombre:"_nombre_1lwmx_165",descripcion:"_descripcion_1lwmx_183",chevron:"_chevron_1lwmx_201",divider:"_divider_1lwmx_227"};function ef({navegar:e}){const n=tn();return r.jsxs("div",{className:gt.contenedor,children:[r.jsx("nav",{className:gt.menu,children:of.map(({id:t,icono:o,nombre:a,descripcion:i})=>r.jsxs("button",{className:gt.item,onClick:()=>e(t),children:[r.jsx("div",{className:gt.icono_contenedor,children:r.jsx(o,{})}),r.jsxs("div",{className:gt.texto,children:[r.jsx("span",{className:gt.nombre,children:a}),r.jsx("span",{className:gt.descripcion,children:i})]}),r.jsx(Ds,{className:gt.chevron})]},t))}),r.jsx("div",{className:gt.divider}),r.jsx("div",{className:gt.menu,children:r.jsxs("button",{className:gt.item,onClick:n?.restaurarConfiguracion,children:[r.jsx("div",{className:gt.icono_contenedor,children:r.jsx(j_,{className:gt.icono_restaurar})}),r.jsxs("div",{className:gt.texto,children:[r.jsx("span",{className:gt.nombre,children:"Restaurar configuración"}),r.jsx("span",{className:gt.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const da=1,ua=200,Ps=250,tf=200,nf={panelPrincipal:{component:ef},panelColumnas:{component:Q_,titulo:"Columnas visibles"},panelFilas:{component:R_,titulo:"Filas por página"}},of=[{id:"panelColumnas",icono:H_,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:W_,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}];function rf(e,n,t){const o=h.useRef(t);o.current=t;const a=h.useRef(e);a.current=e;const i=h.useCallback(s=>{const l=s.target;o.current.some(u=>u.current?.contains(l))||a.current()},[]);h.useEffect(()=>{if(!n)return;const s=setTimeout(()=>{document.addEventListener("mousedown",i)},100);return()=>{clearTimeout(s),document.removeEventListener("mousedown",i)}},[n,i])}function Ts(e,n){h.useEffect(()=>{if(!n)return;const t=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[n,e])}function af(e,n,t,{width:o,offsetRight:a=0,offsetLeft:i=0,offsetTop:s=0,offsetBottom:l=0,shiftPadding:c=8}){const[u,_]=h.useState({top:0,left:0}),g=Hr("only screen and (max-width: 480px)"),f=h.useCallback(()=>{if(!e.current)return{top:0,left:0};const d=e.current.getBoundingClientRect(),m=c;let p=d.bottom+s,v=0;g?v=d.right-o-i+a:v=d.right-o+a-i;const y=n.current?.offsetHeight||400;p+y>window.innerHeight-m&&(p=d.top-y-l,p<m&&(p=m));const w=m,C=window.innerWidth-o-m;return v=Math.max(w,Math.min(v,C)),{top:p,left:v}},[g,o,a,i,s,l,c,e,n]);return h.useEffect(()=>{if(!t||!e.current)return;const d=()=>{_(f())};return d(),window.addEventListener("resize",d),window.addEventListener("scroll",d,!0),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0)}},[t,f,e]),u}function sf(e){h.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function lf(){const[e,n]=h.useState(!1),[t,o]=h.useState(!1),[a,i]=h.useState("panelPrincipal"),[s,l]=h.useState(null),c=h.useRef(null),u=h.useRef(null),_=h.useRef(null);sf(t),rf(()=>f(),t,[c,u]),Ts(()=>f(),t);const g=af(c,u,t,{width:Ps,offsetRight:6,offsetTop:-2,shiftPadding:8});h.useEffect(()=>{e&&(o(!0),l(null))},[e]),h.useEffect(()=>()=>{_.current&&clearTimeout(_.current)},[]);function f(){t&&(n(!1),_.current=window.setTimeout(()=>{o(!1),i("panelPrincipal"),l(null)},tf))}function d(v){l(v==="panelPrincipal"?"backward":"forward"),i(v)}const m=nf[a],p=m.component;return r.jsxs("div",{ref:c,className:Gt.contenedor,children:[r.jsx(Ze,{isIconOnly:!0,variant:"light",onClick:()=>t?f():n(!0),"aria-haspopup":"dialog","aria-expanded":t,"aria-label":"Configurar tabla",children:r.jsx(B_,{})}),t&&c.current&&Fn.createPortal(r.jsx("div",{ref:u,className:`${Gt.popover} ${e?Gt.popover_entrada:Gt.popover_salida}`,role:"dialog",style:{top:`${g.top}px`,left:`${g.left}px`,width:Ps},children:r.jsx("div",{className:Gt.ventana,children:r.jsxs("div",{className:ne([Gt.panel,Gt[`panel_${s}`]]),children:[m.titulo&&r.jsx(J_,{titulo:m.titulo,onBack:()=>d("panelPrincipal")}),r.jsx(p,{navegar:d})]},a)})}),document.body)]})}function cf(){const e=tn();if(!e)return null;const{state:n}=e,{inputBusqueda:t,setInputBusqueda:o,loading:a,filtros:i,actualizarTabla:s,descargarExcel:l,paginacion:c}=n,{abrirFiltros:u,filtrosAplicados:_=[]}=i||{},g=_?.length||0;return r.jsxs("section",{className:We.contenedor_superior,children:[r.jsxs("div",{className:We.input_con_icono,id:"buscador-tabla",children:[r.jsx(P_,{className:We.icono_busqueda}),r.jsx("input",{type:"text",placeholder:"Buscar en tabla...",value:t??"",onChange:f=>o&&o(f.target.value),className:We.input_busqueda})]}),r.jsxs("div",{className:We.contenedor_acciones_botones,children:[r.jsxs("div",{className:We.contenedor_acciones,children:[c?.hayMasDatos&&r.jsxs(Ze,{id:"cargar-mas-datos",variant:"light",className:We.boton_basico,disabled:a,onClick:c.onCargarMasDatos,children:[r.jsx(K_,{}),a?"Actualizando...":"Más datos"]}),u!==void 0&&r.jsxs(Ze,{id:"boton-filtros",onClick:u,variant:"light",className:We.boton_basico,children:[r.jsx(O_,{})," Filtros"]}),g>0?r.jsxs("div",{className:We.texto_filtros,id:"filtros-aplicados",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.4em",height:"1.4em",viewBox:"0 0 24 24",children:r.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6h16M6 12h12m-9 6h2m4 0l2 2l4-4"})}),r.jsx("p",{children:L_(_,g)})]}):null]}),l!==void 0?r.jsxs(Ze,{onClick:l,color:"success",variant:"faded",children:[r.jsx(T_,{})," Excel"]}):null]}),r.jsxs("div",{className:We.contenedor_acciones,children:[s!==void 0&&r.jsx(_n,{content:"Actualiza los últimos datos guardados",children:r.jsx(Ze,{id:"actualizar-tabla",variant:"light",isIconOnly:!0,className:We.boton_basico,disabled:s?.cargando,onClick:s?.onClick,children:r.jsx(V_,{})})}),r.jsx("div",{className:We.menu_configuraciones,id:"configuraciones-tabla",children:r.jsx(lf,{})})]})]})}const Pt={contenedor_paginacion:"_contenedor_paginacion_mu230_1",info_paginacion:"_info_paginacion_mu230_23",contenedor_botones:"_contenedor_botones_mu230_39",boton_paginacion:"_boton_paginacion_mu230_97",pagina_activa:"_pagina_activa_mu230_143",boton_num_paginacion:"_boton_num_paginacion_mu230_155"};function df(){const e=tn();if(!e)return null;const{state:n}=e,{table:t}=n,o=t.getPrePaginationRowModel().rows.length,a=t.getPageCount()||1,{pageIndex:i}=t.getState().pagination,s=i+1,l=I_(s,a),c=t.getCanPreviousPage(),u=t.getCanNextPage(),_=a>1,g=i===0,f=i===a-1,d=()=>{c&&t.previousPage()},m=()=>{u&&t.nextPage()},p=w=>{t.setPageIndex(w-1)},v=()=>{g||t.firstPage()},y=()=>{f||t.lastPage()};return r.jsxs("section",{className:Pt.contenedor_paginacion,id:"paginacion-tabla",children:[r.jsxs("p",{className:Pt.info_paginacion,id:"paginacion-total-documentos",children:["Documentos: ",o]}),_&&r.jsxs("div",{className:Pt.contenedor_botones,id:"paginacion-numerador-pags",children:[!g&&r.jsx(X_,{id:"paginacion-flecha-inicio",onClick:v,"aria-label":"Ir a la primera página","aria-disabled":g,className:Pt.boton_paginacion}),c&&r.jsx(As,{id:"paginacion-flecha-izq",onClick:d,"aria-disabled":!c,className:Pt.boton_paginacion}),r.jsx("div",{id:"paginacion-numero-pag",children:l.map(w=>r.jsx("button",{type:"button",onClick:()=>p(w),"aria-current":w===s?"page":void 0,className:w===s?Pt.pagina_activa:Pt.boton_num_paginacion,children:w},w))}),u&&r.jsx(Ds,{id:"paginacion-flecha-der",onClick:m,"aria-disabled":!u,className:Pt.boton_paginacion}),!f&&r.jsx(Y_,{id:"paginacion-flecha-fin",onClick:y,"aria-label":"Ir a la última página","aria-disabled":f,className:Pt.boton_paginacion})]}),r.jsxs("p",{className:Pt.info_paginacion,id:"paginacion-total-pags",children:["Página ",s," de ",a]})]})}const De={contenedor_tabla_cards:"_contenedor_tabla_cards_zuvsb_1",contenedor_card:"_contenedor_card_zuvsb_11",contenedor_encabezado_card:"_contenedor_encabezado_card_zuvsb_25",contenedor_columna_card:"_contenedor_columna_card_zuvsb_47",card_label:"_card_label_zuvsb_57",card_valor:"_card_valor_zuvsb_69",card_segundo_valor:"_card_segundo_valor_zuvsb_83",contenedor_contenido_cards:"_contenedor_contenido_cards_zuvsb_93",contenedor_fila_card:"_contenedor_fila_card_zuvsb_105",card_fila_label:"_card_fila_label_zuvsb_119",card_fila_valor:"_card_fila_valor_zuvsb_137",contenedor_acciones_card:"_contenedor_acciones_card_zuvsb_153",boton_acciones:"_boton_acciones_zuvsb_171",boton_card:"_boton_card_zuvsb_207",boton_personalizado:"_boton_personalizado_zuvsb_237"};function Os(e,n){if(n)return e.find(t=>t.accessorKey===n||t.id!==void 0&&t.id===String(n))}function Vs(e){if(e)return e.id??e.accessorKey}const Zt={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 uf({filas:e,cantidadControles:n=0,table:t,idPrimeraColumna:o,idSegundaColumna:a}){const s=t.getAllLeafColumns().filter(c=>c.id!=="actions"&&c.id!==o&&c.id!==a),l=["25vw","30vw","20vw","28vw","22vw","26vw"];return r.jsx("section",{className:De.contenedor_tabla_cards,children:Array.from({length:e}).map((c,u)=>r.jsxs("article",{className:De.contenedor_card,children:[r.jsxs("div",{className:De.contenedor_encabezado_card,children:[r.jsx("div",{className:De.contenedor_columna_card,children:o&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De.card_label,children:Mn(o,t)}),r.jsx("div",{className:De.card_valor,children:r.jsx("div",{className:`${Zt.skeleton_elemento} ${Zt.skeleton_elemento_encabezado}`})})]})}),r.jsx("div",{className:De.contenedor_columna_card,children:a&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De.card_label,children:Mn(a,t)}),r.jsx("div",{className:De.card_segundo_valor,children:r.jsx("div",{className:`${Zt.skeleton_elemento} ${Zt.skeleton_elemento_encabezado_segundo}`})})]})})]}),r.jsx("div",{className:De.contenedor_contenido_cards,children:s.map((_,g)=>r.jsxs("div",{className:De.contenedor_fila_card,children:[r.jsx("div",{className:De.card_fila_label,children:Mn(_.id,t)}),r.jsx("div",{className:De.card_fila_valor,children:r.jsx("div",{className:`${Zt.skeleton_elemento} ${Zt.skeleton_elemento_contenido}`,style:{width:l[g%l.length]}})})]},_.id))}),n>0&&r.jsx("div",{className:De.contenedor_acciones_card,children:Array.from({length:Math.min(n,3)}).map((_,g)=>r.jsx("div",{className:Zt.skeleton_accion,children:r.jsx("div",{className:`${Zt.skeleton_elemento} ${Zt.skeleton_elemento_encabezado}`})},`accion-${g}`))})]},`skeleton-card-${u}`))})}const fn={contenedor:"_contenedor_53kvd_1",envolvedor_cuadricula:"_envolvedor_cuadricula_53kvd_33",svg_cuadricula:"_svg_cuadricula_53kvd_61",envolvedor_contenido:"_envolvedor_contenido_53kvd_77",icono_carpeta:"_icono_carpeta_53kvd_97",titulo:"_titulo_53kvd_111",descripcion:"_descripcion_53kvd_129"};function Bs(){const e=h.useContext(ca),{sinDatosProps:n}=e?.state||{},{botonAccion:t,titulo:o="No se encontraron coincidencias",descripcion:a='Usa el botón "Filtros" para ampliar tu búsqueda.'}=n||{};return r.jsxs("div",{className:fn.contenedor,children:[r.jsx(_f,{}),r.jsxs("div",{className:fn.envolvedor_contenido,children:[r.jsx(ff,{}),r.jsx("h3",{className:fn.titulo,children:o}),r.jsx("p",{className:fn.descripcion,children:a}),t]})]})}function _f(){return r.jsx("div",{className:fn.envolvedor_cuadricula,children:r.jsxs("svg",{className:fn.svg_cuadricula,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("defs",{children:r.jsx("pattern",{id:"patronCuadricula",width:"40",height:"40",patternUnits:"userSpaceOnUse",children:r.jsx("path",{d:"M 40 0 L 0 0 0 40",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),r.jsx("rect",{width:"100%",height:"100%",fill:"url(#patronCuadricula)"})]})})}function ff(){return r.jsxs("svg",{className:fn.icono_carpeta,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r.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)"}),r.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"}),r.jsx("circle",{cx:"35",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),r.jsx("circle",{cx:"55",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),r.jsx("path",{d:"M42 65H48",stroke:"var(--color-primary-text)",strokeWidth:"1.5",strokeLinecap:"round"}),r.jsx("circle",{cx:"78",cy:"78",r:"14",fill:"var(--brand-primary)"}),r.jsx("path",{d:"M78 71V85M71 78H85",stroke:"var(--base)",strokeWidth:"2.5",strokeLinecap:"round"})]})}const pf=({fila:e,controls:n})=>(n?.length??0)>0?r.jsx("div",{className:De.contenedor_acciones_card,children:n?.filter(o=>!o.visible||o.visible(e.original)).map(o=>"contenido"in o?r.jsxs("span",{className:`${De.boton_personalizado} ${De.boton_acciones} ${De.boton_card}`,onClick:a=>{const i=a.currentTarget.querySelector("button");i&&!i.contains(a.target)&&i.click()},children:[o.contenido(e.original)," ",o.nombre]},o.id):r.jsxs("button",{id:o.id,type:"button",title:o.nombre,onClick:()=>o.evento(e.original),className:`${De.boton_acciones} ${De.boton_card}`,children:[o.icono," ",o.nombre]},o.id))}):null,gf=({columnasRestantes:e,table:n})=>e.length===0?null:r.jsx("div",{className:De.contenedor_contenido_cards,children:e.map(t=>r.jsxs("div",{className:De.contenedor_fila_card,children:[r.jsx("div",{className:De.card_fila_label,children:Mn(t.column.id,n)}),r.jsx("div",{className:De.card_fila_valor,children:Nn(t.column.columnDef.cell,t.getContext())})]},t.id))}),hf=({fila:e,table:n,idPrimeraColumna:t,idSegundaColumna:o})=>{const a=Fs(e,t),i=Fs(e,o);return r.jsxs("div",{className:De.contenedor_encabezado_card,children:[r.jsx("div",{className:De.contenedor_columna_card,children:t&&a&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De.card_label,children:Mn(t,n)}),r.jsx("div",{className:De.card_valor,children:Is(e,t)})]})}),r.jsx("div",{className:De.contenedor_columna_card,children:o&&i&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De.card_label,children:Mn(o,n)}),r.jsx("div",{className:De.card_segundo_valor,children:Is(e,o)})]})})]})};function mf(){const e=tn();if(!e)return null;const{state:n}=e,{table:t,controls:o,primerasColumnas:a,loading:i,columns:s}=n;if(!t)return null;const l=s&&a?Os(s,a[0]):void 0,c=s&&a?Os(s,a[1]):void 0,u=Vs(l),_=Vs(c);if(i)return r.jsx(uf,{filas:3,cantidadControles:o?.length??0,table:t,idPrimeraColumna:u,idSegundaColumna:_});const g=t.getRowModel().rows;return g.length===0?r.jsx("article",{className:De.contenedor_card,children:r.jsx(Bs,{})}):r.jsx("section",{className:De.contenedor_tabla_cards,children:g.map(f=>{const d=z_(f,u,_);return r.jsxs("article",{id:`tabla-card-${f.id}`,className:De.contenedor_card,children:[r.jsx(hf,{fila:f,table:t,idPrimeraColumna:u,idSegundaColumna:_}),r.jsx(gf,{columnasRestantes:d,table:t}),r.jsx(pf,{fila:f,controls:o})]},f.id)})})}const js={filas:"_filas_17736_1",columnas:"_columnas_17736_33"},vf=({columnas:e,filas:n})=>r.jsx(r.Fragment,{children:Array.from({length:n}).map((t,o)=>r.jsx("tr",{className:js.filas,children:Array.from({length:e}).map((a,i)=>r.jsx("td",{className:js.columnas},`sk-cell-${o}-${i}`))},`sk-row-${o}`))}),pn={contenedor:"_contenedor_5uhpi_1",barra:"_barra_5uhpi_21",info:"_info_5uhpi_49",btn_cerrar:"_btn_cerrar_5uhpi_63",contador:"_contador_5uhpi_79",separador:"_separador_5uhpi_97",acciones:"_acciones_5uhpi_111"};function bf({totalSeleccionadas:e,acciones:n,filasSeleccionadas:t,onLimpiarSeleccion:o}){const[a,i]=h.useState(0),[s,l]=h.useState([]),[c,u]=h.useState([]),_=e>0,g=h.useRef(null);return Ts(o,_),h.useEffect(()=>{_&&(i(e),l(n),u(t))},[e,n,t,_]),r.jsx(oo,{mostrar:_,tipo:"escalar",className:pn.contenedor,children:r.jsxs("div",{ref:g,className:pn.barra,children:[r.jsxs("div",{className:pn.info,children:[r.jsx(Ze,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:o,"aria-label":"Limpiar selección",className:pn.btn_cerrar,children:r.jsx(U_,{})}),r.jsxs("p",{className:pn.contador,children:[a," filas seleccionadas"]})]}),r.jsx("div",{className:pn.separador}),r.jsx("div",{className:pn.acciones,children:s.map(f=>r.jsx("div",{children:f.componente(c)},f.id))})]})})}function wf({dir:e}){return e?e==="asc"?r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:We.icono_orden,"aria-hidden":"true",children:r.jsx("path",{fill:"currentColor",d:"m12 10.8l-4.6 4.6L6 14l6-6l6 6l-1.4 1.4z"})}):r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:We.icono_orden,"aria-hidden":"true",children:r.jsx("path",{fill:"currentColor",d:"M12 13.2L7.4 8.6L6 10l6 6l6-6l-1.4-1.4z"})}):null}function yf(){const e=tn();if(!e)return null;const{state:n}=e,{table:t,loading:o,selectorFilas:a=[]}=n;if(!t)return null;const i=t.getHeaderGroups(),s=t.getRowModel().rows,l=t.getVisibleLeafColumns().length,c=t.getState().pagination.pageIndex,u=t.getSelectedRowModel().rows,_=u.length,g=()=>{t.resetRowSelection()};return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:We.wrapper_scroll_tabla,children:r.jsxs("table",{className:We.contenedor_tabla,children:[r.jsx("thead",{children:i.map(f=>r.jsx("tr",{children:f.headers.map(d=>{const m=d.column.columnDef.meta?.style;return r.jsx("th",{id:`tabla-col-${d.id}`,className:We.encabezados,style:m,"data-columna":d.id,children:d.id==="select"?r.jsx("div",{children:Nn(d.column.columnDef.header,d.getContext())}):r.jsxs("div",{className:We.contenido_encabezado,style:{justifyContent:m?.textAlign==="center"?"center":m?.textAlign==="right"?"flex-end":void 0},onClick:d.column.getToggleSortingHandler(),children:[Nn(d.column.columnDef.header,d.getContext()),r.jsx(wf,{dir:d.column.getIsSorted()})]})},d.id)})},f.id))}),r.jsx("tbody",{className:We.contenedor_datos,children:o?r.jsx(vf,{columnas:l,filas:10}):s.length===0?r.jsx("tr",{children:r.jsx("td",{colSpan:l,style:{backgroundColor:"var(--base)"},children:r.jsx(Bs,{})})}):s.map(f=>r.jsx("tr",{id:`tabla-fila-${f.id}`,className:`${We.datos} ${f.getIsSelected()?We.seleccionada:""}`,"data-fila-index":f.index,children:f.getVisibleCells().map(d=>{const m=d.column.columnDef.meta?.style;return r.jsx("td",{className:We.columna,style:m,"data-columna":d.column.id,children:Nn(d.column.columnDef.cell,d.getContext())},d.id)})},f.id))},c)]})}),a?.length>0?r.jsx(bf,{totalSeleccionadas:_,acciones:a,filasSeleccionadas:u.map(f=>f.original),onLimpiarSeleccion:g}):null]})}const Cf=830;function xf({id:e}){const n=h.useRef(null),[t,o]=h.useState(!1);return h.useEffect(()=>{const a=n.current;if(!a)return;const i=new ResizeObserver(([s])=>{o(s.contentRect.width<=Cf)});return i.observe(a),()=>i.disconnect()},[]),r.jsxs("main",{className:We.contenedor,id:e,ref:n,children:[r.jsx(cf,{}),r.jsxs("div",{className:We.tabla_card,children:[t?r.jsx(mf,{}):r.jsx(yf,{}),r.jsx(df,{})]})]})}function $f({id:e,...n}){return r.jsx(A_,{...n,children:r.jsx(xf,{id:e})})}const Ve={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"},qs=h.createContext(void 0),Sf=()=>h.useContext(qs),_a=h.memo(h.forwardRef(({value:e,label:n,description:t,size:o="md",color:a="primary",customColor:i,variant:s="default",isDisabled:l=!1,isReadOnly:c=!1,isInvalid:u=!1,isRequired:_=!1,children:g,className:f="",onChange:d,...m},p)=>{const v=Sf(),y=h.useId(),w=m.id||y,C=v?.name||m.name,k=v?.size||o,z=v?.color||a,A=v?.customColor||i,N=v?.variant||s,P=v?.isDisabled||l,O=v?.isReadOnly||c,E=v?.isInvalid||u,T=v?.isRequired||_,V=v?.value!==void 0?v.value===e:void 0,S=g||n,b=I=>{P||O||(v?.onChange&&v.onChange(e),d&&d(I))},x=[Ve.contenedor_radio,Ve[`tam_${k}`],!A&&Ve[`color_${z}`],Ve[`variante_${N}`],P&&Ve.deshabilitado,O&&Ve.solo_lectura,E&&Ve.invalido,V&&Ve.seleccionado,f].filter(Boolean).join(" "),F=A?{"--radio-custom-color":A}:void 0;return r.jsx("div",{className:x,style:F,children:r.jsxs("label",{className:Ve.envoltorio_radio,htmlFor:w,children:[r.jsxs("div",{className:Ve.radio,children:[r.jsx("input",{ref:p,type:"radio",id:w,name:C,value:e,checked:V,disabled:P,readOnly:O,required:T,"aria-invalid":E,className:Ve.input,onChange:b,...m}),r.jsx("div",{className:Ve.circulo_radio,children:r.jsx("div",{className:Ve.punto_radio})})]})," ",S&&r.jsxs("div",{className:Ve.contenedor_label,children:[r.jsxs("span",{className:Ve.texto_label,children:[S,_&&!v&&r.jsx("span",{className:Ve.marca_requerido,children:" *"})]}),t&&r.jsx("span",{className:Ve.texto_descripcion,children:t})]})]})})}));_a.displayName="Radio";const Hs=({name:e,value:n,defaultValue:t,onChange:o,orientation:a="horizontal",label:i,description:s,isDisabled:l=!1,isReadOnly:c=!1,isRequired:u=!1,isInvalid:_=!1,errorMessage:g,size:f,color:d,customColor:m,variant:p,justifyContent:v="flex-start",children:y,className:w="",options:C,optionValueKey:k,optionLabelKey:z,optionDisabledKey:A,optionDescriptionKey:N})=>{const[P,O]=h.useState(String(t??"")),E=n!==void 0?String(n):P,V={name:e,value:E,onChange:x=>{l||c||(n===void 0&&O(x),o&&o(x))},size:f,color:d,customColor:m,variant:p,isDisabled:l,isReadOnly:c,isInvalid:_,isRequired:u},S=[Ve.grupo_radio,Ve[`orientacion_${a}`],_&&Ve.grupo_invalido,l&&Ve.grupo_deshabilitado,c&&Ve.grupo_solo_lectura,w].filter(Boolean).join(" "),b=v==="center"?"center":v==="flex-end"?"right":"left";return r.jsx(qs.Provider,{value:V,children:r.jsxs("div",{className:S,role:"radiogroup","aria-required":u,"aria-invalid":_,style:{textAlign:b},children:[i&&r.jsxs("div",{className:Ve.encabezado_grupo,children:[r.jsxs("label",{className:Ve.label_grupo,children:[i,u&&r.jsx("span",{className:Ve.marca_requerido,children:" *"})]}),s&&r.jsx("span",{className:Ve.descripcion_grupo,children:s})]}),r.jsx("div",{className:Ve.contenedor_radios,style:{justifyContent:v},children:C&&C.length>0?C.map((x,F)=>{let I,$,D=!1,B;if(typeof x=="object"&&x!==null){const X=k??"value",U=z??"label",L=A??"isDisabled",j=N??"description",W=x[X],ie=x[U];I=String(W!==void 0?W:F),$=ie;const re=x[L];D=typeof re=="boolean"?re:!1;const ae=x[j];B=typeof ae=="string"?ae:void 0}else I=String(x),$=x;return r.jsx(_a,{value:I,isDisabled:D,description:B,children:$},I)}):y}),_&&g&&r.jsx("span",{className:Ve.mensaje_error,children:g})]})})};Hs.displayName="RadioGroup";const ht={backdrop:"_backdrop_rup7e_1",visible:"_visible_rup7e_39",drawer:"_drawer_rup7e_73",posicion_right:"_posicion_right_rup7e_137",drawer_detras:"_drawer_detras_rup7e_171",posicion_left:"_posicion_left_rup7e_179",posicion_top:"_posicion_top_rup7e_221",posicion_bottom:"_posicion_bottom_rup7e_263",radio_none:"_radio_none_rup7e_305",radio_sm:"_radio_sm_rup7e_313",radio_md:"_radio_md_rup7e_333",radio_lg:"_radio_lg_rup7e_353",radio_xl:"_radio_xl_rup7e_373",tamano_auto:"_tamano_auto_rup7e_473",tamano_sm:"_tamano_sm_rup7e_497",tamano_md:"_tamano_md_rup7e_507",tamano_lg:"_tamano_lg_rup7e_517",tamano_xl:"_tamano_xl_rup7e_527",tamano_full:"_tamano_full_rup7e_537",encabezado:"_encabezado_rup7e_597",titulo:"_titulo_rup7e_617",boton_cerrar:"_boton_cerrar_rup7e_637",contenido:"_contenido_rup7e_691",pie:"_pie_rup7e_705",loading_overlay:"_loading_overlay_rup7e_725",spinner:"_spinner_rup7e_749",spin:"_spin_rup7e_749",loading_text:"_loading_text_rup7e_779",resize_handle:"_resize_handle_rup7e_791"},Ws=h.forwardRef(({isOpen:e,onClose:n,position:t="right",size:o="md",title:a,showCloseButton:i=!0,closeOnBackdropClick:s=!0,closeOnEscape:l=!0,preventScroll:c=!0,header:u,footer:_,children:g,className:f="",contentClassName:d="",isLoading:m=!1,loadingMessage:p="Cargando...",onOpen:v,backdropVariant:y="normal",radius:w,resizable:C=!1,zIndex:k,getContainer:z},A)=>{const N=h.useRef(null),[P,O]=h.useState(!1),E=h.useCallback(()=>{P||(O(!0),setTimeout(()=>{n?.(),O(!1)},300))},[n,P]);h.useEffect(()=>{e&&O(!1)},[e]),h.useEffect(()=>{if(e){if(v?.(),c){const L=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",L>0&&(document.body.style.paddingRight=`${L}px`)}if(l){const L=j=>{j.key==="Escape"&&E()};return document.addEventListener("keydown",L),()=>{document.removeEventListener("keydown",L),c&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{c&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,E,l,c,v]);const T=L=>{s&&L.target===N.current&&E()},V=w?ht[`radio_${w}`]:void 0,S=e&&!P,b=[ht.drawer,ht[`posicion_${t}`],ht[`tamano_${o}`],S&&ht.visible,V,f].filter(Boolean).join(" "),x=[ht.contenido,d].filter(Boolean).join(" "),F=[ht.backdrop,S&&ht.visible].filter(Boolean).join(" "),I=k||500,$={transparente:{opacity:0},sutil:{opacity:.2},normal:{opacity:.4},intermedio:{opacity:.6},intenso:{opacity:.8}},D=$[y]||$.normal,{opacity:B}=D,X={background:`rgb(0 0 0 / ${B})`,zIndex:I,...z&&{position:"absolute"}},U=r.jsx("div",{className:F,ref:N,onClick:T,style:X,children:r.jsxs("div",{ref:A,className:b,role:"dialog","aria-modal":"true","aria-labelledby":"drawer-title",children:[(a||u)&&r.jsx("div",{className:ht.encabezado,children:u||r.jsxs(r.Fragment,{children:[r.jsx("h2",{id:"drawer-title",className:ht.titulo,children:a}),i&&r.jsx("button",{type:"button",className:ht.boton_cerrar,onClick:E,"aria-label":"Cerrar",children:r.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:r.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}),r.jsx("div",{className:x,children:g}),_&&r.jsx("div",{className:ht.pie,children:_}),m&&r.jsxs("div",{className:ht.loading_overlay,children:[r.jsx("div",{className:ht.spinner}),r.jsx("span",{className:ht.loading_text,children:p})]}),C&&r.jsx("div",{className:ht.resize_handle})]})});if(z){const L=typeof z=="function"?z():z;if(L&&L instanceof HTMLElement)return Fn.createPortal(U,L)}return U});Ws.displayName="Drawer";const Qe={backdrop:"_backdrop_li82t_1",visible:"_visible_li82t_41",centrado:"_centrado_li82t_65",modal:"_modal_li82t_73",tamano_sm:"_tamano_sm_li82t_145",tamano_md:"_tamano_md_li82t_153",tamano_lg:"_tamano_lg_li82t_161",tamano_xl:"_tamano_xl_li82t_169",tamano_formulario:"_tamano_formulario_li82t_177",tamano_full:"_tamano_full_li82t_185",tamano_auto:"_tamano_auto_li82t_193",encabezado:"_encabezado_li82t_203",encabezado_custom:"_encabezado_custom_li82t_221",contenedor_titulo_completo:"_contenedor_titulo_completo_li82t_233",contenedor_titulo_icono:"_contenedor_titulo_icono_li82t_243",icono_titulo:"_icono_titulo_li82t_255",titulo:"_titulo_li82t_269",contenido:"_contenido_li82t_289",pie:"_pie_li82t_303",loading_overlay:"_loading_overlay_li82t_323",spinner:"_spinner_li82t_349",spinner_dot:"_spinner_dot_li82t_365",loadingBounce:"_loadingBounce_li82t_1",loading_text:"_loading_text_li82t_433",radius_none:"_radius_none_li82t_447",radius_sm:"_radius_sm_li82t_455",radius_md:"_radius_md_li82t_463",radius_lg:"_radius_lg_li82t_471",radius_full:"_radius_full_li82t_479",close_button:"_close_button_li82t_487",texto_esc:"_texto_esc_li82t_579"},fa=h.forwardRef(({isOpen:e,onClose:n,size:t="md",title:o,titleIcon:a,closeOnBackdropClick:i=!1,closeOnEscape:s=!0,preventScroll:l=!0,isCentered:c=!0,header:u,footer:_,children:g,className:f="",contentClassName:d="",isLoading:m=!1,loadingMessage:p="Cargando...",backdropVariant:v="normal",showIconTitle:y=!1,onOpen:w,radius:C="lg",showCloseButton:k=!1},z)=>{const A=h.useRef(null),N=h.useCallback(()=>{m||n?.()},[n,m]);h.useEffect(()=>{if(e){if(w?.(),l){const x=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",x>0&&(document.body.style.paddingRight=`${x}px`)}if(s){const x=F=>{F.key==="Escape"&&N()};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x),l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,N,s,l,w]);const P=x=>{i&&x.target===A.current&&N()},O=[Qe.backdrop,c&&Qe.centrado,e&&Qe.visible].filter(Boolean).join(" "),E=[Qe.modal,Qe[`tamano_${t}`],Qe[`radius_${C}`],f].filter(Boolean).join(" "),T=[Qe.contenido,d].filter(Boolean).join(" "),V={transparente:{opacity:0},sutil:{opacity:.3},normal:{opacity:.5},intermedio:{opacity:.7},intenso:{opacity:.9}},{opacity:S}=V[v]||V.normal,b={background:`rgb(0 0 0 / ${S})`};return r.jsx("div",{className:O,ref:A,onClick:P,style:b,children:r.jsxs("div",{ref:z,className:E,role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",children:[(o||u||k)&&r.jsx("div",{className:`${Qe.encabezado}${u?` ${Qe.encabezado_custom}`:""}`,children:u||r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Qe.contenedor_titulo_completo,children:r.jsxs("div",{className:Qe.contenedor_titulo_icono,children:[y&&a!==void 0&&(typeof a=="string"?r.jsx("span",{className:Qe.icono_titulo,children:a}):a),y&&a===void 0&&r.jsx("span",{className:Qe.icono_titulo,children:"📄"}),r.jsx("h2",{id:"modal-title",className:Qe.titulo,children:o})]})}),k&&r.jsxs("button",{type:"button",className:Qe.close_button,onClick:N,"aria-label":"Cerrar",children:[r.jsx("span",{className:Qe.texto_esc,children:"ESC"}),r.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[r.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.08"}),r.jsx("path",{d:"M15 9l-6 6M9 9l6 6",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round"})]})]})]})}),r.jsx("div",{className:T,children:g}),_&&r.jsx("div",{className:Qe.pie,children:_}),m&&r.jsxs("div",{className:Qe.loading_overlay,children:[r.jsxs("div",{className:Qe.spinner,children:[r.jsx("span",{className:Qe.spinner_dot}),r.jsx("span",{className:Qe.spinner_dot}),r.jsx("span",{className:Qe.spinner_dot})]}),r.jsx("span",{className:Qe.loading_text,children:p})]})]})})});fa.displayName="Modal";function kf(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",...e,children:[r.jsx("path",{fill:"currentColor",d:"M232 128c0 12.5-17.8 22-22.7 33.7s1.4 30.6-7.8 39.8s-28.5 3.1-39.8 7.8S140.5 232 128 232s-22-17.8-33.7-22.7s-30.6 1.4-39.8-7.8s-3.1-28.5-7.8-39.8S24 140.5 24 128s17.8-22 22.7-33.7s-1.4-30.6 7.8-39.8s28.5-3.1 39.8-7.8S115.5 24 128 24s22 17.8 33.7 22.7s30.6-1.4 39.8 7.8s3.1 28.5 7.8 39.8S232 115.5 232 128Z",opacity:".2"}),r.jsx("path",{fill:"currentColor",d:"M225.9 102.8c-3.8-3.9-7.7-8-9.2-11.5s-1.4-8.7-1.5-14c-.1-9.7-.3-20.8-8-28.5s-18.8-7.9-28.5-8c-5.3-.1-10.7-.2-14-1.5s-7.6-5.4-11.5-9.2C146.3 23.5 138.4 16 128 16s-18.3 7.5-25.2 14.1c-3.9 3.8-8 7.7-11.5 9.2s-8.7 1.4-14 1.5c-9.7.1-20.8.3-28.5 8s-7.9 18.8-8 28.5c-.1 5.3-.2 10.7-1.5 14s-5.4 7.6-9.2 11.5C23.5 109.7 16 117.6 16 128s7.5 18.3 14.1 25.2c3.8 3.9 7.7 8 9.2 11.5s1.4 8.7 1.5 14c.1 9.7.3 20.8 8 28.5s18.8 7.9 28.5 8c5.3.1 10.7.2 14 1.5s7.6 5.4 11.5 9.2c6.9 6.6 14.8 14.1 25.2 14.1s18.3-7.5 25.2-14.1c3.9-3.8 8-7.7 11.5-9.2s8.7-1.4 14-1.5c9.7-.1 20.8-.3 28.5-8s7.9-18.8 8-28.5c.1-5.3.2-10.7 1.5-14s5.4-7.6 9.2-11.5c6.6-6.9 14.1-14.8 14.1-25.2s-7.5-18.3-14.1-25.2ZM120 136V80a8 8 0 0 1 16 0v56a8 8 0 0 1-16 0Zm20 36a12 12 0 1 1-12-12a12 12 0 0 1 12 12Z"})]})}function Nf(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[r.jsx("path",{fill:"currentColor",d:"M3 6.386c0-.484.345-.877.771-.877h2.665c.529-.016.996-.399 1.176-.965l.03-.1l.115-.391c.07-.24.131-.45.217-.637c.338-.739.964-1.252 1.687-1.383c.184-.033.378-.033.6-.033h3.478c.223 0 .417 0 .6.033c.723.131 1.35.644 1.687 1.383c.086.187.147.396.218.637l.114.391l.03.1c.18.566.74.95 1.27.965h2.57c.427 0 .772.393.772.877s-.345.877-.771.877H3.77c-.425 0-.77-.393-.77-.877"}),r.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.425 11.482c.413-.044.78.273.821.707l.5 5.263c.041.433-.26.82-.671.864c-.412.043-.78-.273-.821-.707l-.5-5.263c-.041-.434.26-.821.671-.864m5.15 0c.412.043.713.43.671.864l-.5 5.263c-.04.434-.408.75-.82.707c-.413-.044-.713-.43-.672-.864l.5-5.264c.041-.433.409-.75.82-.707",clipRule:"evenodd"}),r.jsx("path",{fill:"currentColor",d:"M11.596 22h.808c2.783 0 4.174 0 5.08-.886c.904-.886.996-2.339 1.181-5.245l.267-4.188c.1-1.577.15-2.366-.303-2.865c-.454-.5-1.22-.5-2.753-.5H8.124c-1.533 0-2.3 0-2.753.5s-.404 1.288-.303 2.865l.267 4.188c.185 2.906.277 4.36 1.182 5.245c.905.886 2.296.886 5.079.886",opacity:".5"})]})}function Ef(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",...e,children:r.jsxs("g",{fill:"currentColor",children:[r.jsxs("g",{opacity:".2",children:[r.jsx("path",{d:"M14.696 12.282a1 1 0 1 1-1.392 1.436a2 2 0 0 0-.102-.09a2.4 2.4 0 0 0-.623-.348c-.453-.18-1-.28-1.579-.28c-.914 0-1.733.251-2.202.629q-.056.044-.102.089a1 1 0 1 1-1.392-1.436q.114-.11.24-.212C8.395 11.387 9.656 11 11 11c.827 0 1.624.146 2.316.42c.43.17.815.389 1.14.65q.126.102.24.212"}),r.jsx("path",{d:"M17.213 9.689a1 1 0 1 1-1.426 1.402a4 4 0 0 0-.312-.285a5.5 5.5 0 0 0-.767-.521a6 6 0 0 0-.932-.425a7 7 0 0 0-1.057-.298a8 8 0 0 0-1.137-.153a9 9 0 0 0-1.74.058a8 8 0 0 0-1.102.227a7 7 0 0 0-1 .364a6 6 0 0 0-.854.477a5 5 0 0 0-.361.27a4 4 0 0 0-.312.286A1 1 0 1 1 4.787 9.69q.218-.22.462-.424q.243-.201.512-.384a7.5 7.5 0 0 1 1.15-.643a9 9 0 0 1 1.286-.469a10 10 0 0 1 1.379-.284A10.5 10.5 0 0 1 11 7.39a11 11 0 0 1 1.424.095a10 10 0 0 1 1.38.284a9 9 0 0 1 1.285.469a8 8 0 0 1 1.15.643q.27.183.512.384q.244.204.462.424"}),r.jsx("path",{d:"M19.245 7.222a1 1 0 0 1-1.49 1.333a6 6 0 0 0-.456-.459a7 7 0 0 0-.52-.43a8.4 8.4 0 0 0-1.215-.747a9 9 0 0 0-1.408-.563a10 10 0 0 0-1.542-.35A11 11 0 0 0 11 5.89a11 11 0 0 0-1.614.117a10.5 10.5 0 0 0-1.542.35a9.6 9.6 0 0 0-1.407.564a8 8 0 0 0-.635.353a8 8 0 0 0-.58.393a7 7 0 0 0-.52.43a6 6 0 0 0-.457.46a1 1 0 0 1-1.49-1.334q.28-.314.6-.604q.316-.29.668-.553q.351-.262.732-.496a10.4 10.4 0 0 1 1.62-.813a11.6 11.6 0 0 1 1.785-.554a12.5 12.5 0 0 1 1.883-.279a13.2 13.2 0 0 1 2.864.105a12.5 12.5 0 0 1 1.842.418a11.6 11.6 0 0 1 1.71.686a10.4 10.4 0 0 1 1.518.933q.351.264.669.553t.6.604M13 16.25a2 2 0 1 1-4 0a2 2 0 0 1 4 0"})]}),r.jsx("path",{d:"M13.348 11.641a.5.5 0 0 1-.696.718a2 2 0 0 0-.136-.12a3 3 0 0 0-.753-.424A4.8 4.8 0 0 0 10 11.5c-1.022 0-1.951.285-2.516.739q-.073.06-.136.12a.5.5 0 0 1-.696-.718q.097-.094.206-.182c.754-.606 1.905-.959 3.142-.959c.765 0 1.5.134 2.132.385c.385.153.726.346 1.01.574q.109.089.206.182m2.508-2.601a.5.5 0 1 1-.712.7a5 5 0 0 0-.35-.32a5 5 0 0 0-.399-.298a6.6 6.6 0 0 0-1.449-.731a8 8 0 0 0-1.126-.319a9 9 0 0 0-1.205-.162a9.3 9.3 0 0 0-1.839.061a9 9 0 0 0-1.172.242a8 8 0 0 0-1.071.39a6.6 6.6 0 0 0-.928.519q-.21.143-.399.298q-.186.155-.35.32a.5.5 0 0 1-.712-.7q.198-.202.424-.39q.225-.186.474-.355a7 7 0 0 1 1.076-.602a8 8 0 0 1 1.215-.443a9 9 0 0 1 1.31-.27A10 10 0 0 1 10 6.89a10 10 0 0 1 1.357.09a10 10 0 0 1 1.31.27a9 9 0 0 1 1.215.443a7.6 7.6 0 0 1 1.076.602q.249.17.474.355q.226.188.424.39"}),r.jsx("path",{d:"M17.873 6.555a.5.5 0 1 1-.746.667a7 7 0 0 0-.492-.496a8 8 0 0 0-.557-.46a9 9 0 0 0-1.29-.794a9.5 9.5 0 0 0-1.484-.594a10.6 10.6 0 0 0-1.617-.366A11.4 11.4 0 0 0 10 4.389a12 12 0 0 0-1.687.123a11 11 0 0 0-1.617.366a10 10 0 0 0-1.483.595a9 9 0 0 0-.673.374a8 8 0 0 0-.618.42q-.294.22-.557.46q-.263.239-.492.495a.5.5 0 1 1-.746-.667q.264-.294.564-.568t.632-.521q.332-.249.694-.471a10 10 0 0 1 1.545-.775a11 11 0 0 1 1.709-.53a12 12 0 0 1 1.808-.268a12.7 12.7 0 0 1 2.754.1a12 12 0 0 1 1.767.401a11 11 0 0 1 1.635.656q.387.194.749.416q.36.222.693.47q.333.249.632.522q.3.274.564.568M11.75 15.25a1.75 1.75 0 1 1-3.5 0a1.75 1.75 0 0 1 3.5 0"}),r.jsx("path",{d:"M1.15 1.878a.514.514 0 0 1 .728-.727l16.971 16.971a.514.514 0 0 1-.727.727z"})]})})}function Mf(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:r.jsx("path",{fill:"currentColor",d:"M13.435 2.075a3.33 3.33 0 0 0-2.87 0c-.394.189-.755.497-1.26.928l-.079.066a2.56 2.56 0 0 1-1.58.655l-.102.008c-.662.053-1.135.09-1.547.236a3.33 3.33 0 0 0-2.03 2.029c-.145.412-.182.885-.235 1.547l-.008.102a2.56 2.56 0 0 1-.655 1.58l-.066.078c-.431.506-.74.867-.928 1.261a3.33 3.33 0 0 0 0 2.87c.189.394.497.755.928 1.26l.066.079c.41.48.604.939.655 1.58l.008.102c.053.662.09 1.135.236 1.547a3.33 3.33 0 0 0 2.029 2.03c.412.145.885.182 1.547.235l.102.008c.629.05 1.09.238 1.58.655l.078.066c.506.431.867.74 1.261.928a3.33 3.33 0 0 0 2.87 0c.394-.189.755-.497 1.26-.928l.079-.066c.48-.41.939-.604 1.58-.655l.102-.008c.662-.053 1.135-.09 1.547-.236a3.33 3.33 0 0 0 2.03-2.029c.145-.412.182-.885.235-1.547l.008-.102c.05-.629.238-1.09.655-1.58l.066-.079c.431-.505.74-.866.928-1.26a3.33 3.33 0 0 0 0-2.87c-.189-.394-.497-.755-.928-1.26l-.066-.079a2.56 2.56 0 0 1-.655-1.58l-.008-.102c-.053-.662-.09-1.135-.236-1.547a3.33 3.33 0 0 0-2.029-2.03c-.412-.145-.885-.182-1.547-.235l-.102-.008a2.56 2.56 0 0 1-1.58-.655l-.079-.066c-.505-.431-.866-.74-1.26-.928M12 7.25a.75.75 0 0 1 .75.75v.5a.75.75 0 0 1-1.5 0V8a.75.75 0 0 1 .75-.75M10.75 16a.75.75 0 0 1 .5-.707v-3.586a.75.75 0 0 1 .25-1.457h.5a.75.75 0 0 1 .75.75v4.293a.75.75 0 0 1-.25 1.457h-1a.75.75 0 0 1-.75-.75"})})}function If(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",...e,children:[r.jsx("defs",{children:r.jsx("mask",{id:"SVG4IxzvcIZ",children:r.jsxs("g",{fill:"none",stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",children:[r.jsx("path",{fill:"#555",d:"m24 4l5.253 3.832l6.503-.012l1.997 6.188l5.268 3.812L41 24l2.021 6.18l-5.268 3.812l-1.997 6.188l-6.503-.012L24 44l-5.253-3.832l-6.503.012l-1.997-6.188l-5.268-3.812L7 24l-2.021-6.18l5.268-3.812l1.997-6.188l6.503.012z"}),r.jsx("path",{d:"m17 24l5 5l10-10"})]})})}),r.jsx("path",{fill:"currentColor",d:"M0 0h48v48H0z",mask:"url(#SVG4IxzvcIZ)"})]})}const at={contenido:"_contenido_1mizc_1",modal_radio:"_modal_radio_1mizc_11",cuerpo:"_cuerpo_1mizc_19",icono_wrapper:"_icono_wrapper_1mizc_37",icono:"_icono_1mizc_37",icono_personalizado:"_icono_personalizado_1mizc_55",titulo:"_titulo_1mizc_87",mensaje:"_mensaje_1mizc_105",descripcion:"_descripcion_1mizc_123",grupo_botones:"_grupo_botones_1mizc_139",solo_confirmar:"_solo_confirmar_1mizc_155",boton_modal:"_boton_modal_1mizc_163",advertencia:"_advertencia_1mizc_171",eliminar:"_eliminar_1mizc_179",exito:"_exito_1mizc_187",info:"_info_1mizc_195",sin_conexion:"_sin_conexion_1mizc_203",personalizado:"_personalizado_1mizc_211"},Ff={advertencia:kf,eliminar:Nf,exito:If,info:Mf,"sin-conexion":Ef},zf={advertencia:at.advertencia,eliminar:at.eliminar,exito:at.exito,info:at.info,"sin-conexion":at.sin_conexion,personalizado:at.personalizado},Xn=h.forwardRef(({isOpen:e,tipo:n="advertencia",titulo:t,mensaje:o="¿Estás seguro de continuar?",descripcion:a,textoConfirmar:i="Confirmar",textoCancelar:s="Cancelar",onConfirmar:l,onCancelar:c,size:u="sm",closeOnBackdropClick:_=!1,icono:g,loadingConfirmar:f=!1,timeout:d,colorTipo:m,colorBotonConfirmar:p},v)=>{const y=Ff[n],w=n==="exito";h.useEffect(()=>{if(!e||!d)return;const k=setTimeout(l,d);return()=>clearTimeout(k)},[e,d,l]);const C=m?{"--color-tipo":m}:void 0;return r.jsx(fa,{ref:v,isOpen:e,onClose:c,size:u,isCentered:!0,closeOnBackdropClick:_,closeOnEscape:!w,className:at.modal_radio,contentClassName:at.contenido,children:r.jsxs("div",{className:`${at.cuerpo} ${zf[n]}`,style:C,children:[r.jsx("div",{className:at.icono_wrapper,children:g?r.jsx("span",{className:at.icono_personalizado,"aria-hidden":"true",children:g}):y&&r.jsx(y,{className:at.icono,"aria-hidden":"true"})}),t&&r.jsx("h2",{className:at.titulo,children:t}),r.jsx("p",{className:at.mensaje,children:o}),a&&r.jsx("p",{className:at.descripcion,children:a}),r.jsxs("div",{className:`${at.grupo_botones}${w?` ${at.solo_confirmar}`:""}`,children:[!w&&r.jsx(Ze,{variant:"outline",size:"sm",fullWidth:!0,className:at.boton_modal,onClick:c,children:s}),r.jsx(Ze,{size:"sm",fullWidth:!0,isLoading:f,className:at.boton_modal,style:{"--btn-color":p??"var(--color-tipo)"},onClick:l,children:i})]})]})})});Xn.displayName="ModalAviso";const Nt={overlay:"_overlay_1ywgg_1",container:"_container_1ywgg_47",modal:"_modal_1ywgg_65",modal_closing:"_modal_closing_1ywgg_125",modal_detras:"_modal_detras_1ywgg_143",header:"_header_1ywgg_217",button_back:"_button_back_1ywgg_233",title_container:"_title_container_1ywgg_289",title_icon:"_title_icon_1ywgg_305",title:"_title_1ywgg_289",content:"_content_1ywgg_337",footer:"_footer_1ywgg_351"};function Lf({modals:e,onClose:n}){const[t,o]=h.useState([]),[a,i]=h.useState(!1);h.useEffect(()=>{const f=()=>{i(window.innerWidth<=768)};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]);const s=f=>{o(d=>[...d,f]),setTimeout(()=>{n(f),o(d=>d.filter(m=>m!==f))},300)};if(e.length===0)return null;const l=e.length-1,c=500,u=24,_=e.length*c+(e.length-1)*u,g=e.length>1?_/2-c/2-l*(c+u):0;return r.jsx("div",{className:Nt.overlay,children:r.jsx("div",{className:Nt.container,style:a?void 0:{transform:`translateX(${g}px)`},children:e.map((f,d)=>{const m=t.includes(f.id),p=d===e.length-1,v=[Nt.modal,m&&Nt.modal_closing,!p&&Nt.modal_detras].filter(Boolean).join(" ");return r.jsxs("div",{className:v,children:[r.jsxs("div",{className:Nt.header,children:[r.jsx("button",{type:"button",className:Nt.button_back,onClick:()=>s(f.id),"aria-label":"Volver",children:r.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:r.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),r.jsxs("div",{className:Nt.title_container,children:[f.titleIcon&&r.jsx("span",{className:Nt.title_icon,children:f.titleIcon}),r.jsx("h2",{className:Nt.title,children:f.title})]})]}),r.jsx("div",{className:Nt.content,children:f.content}),f.footer&&r.jsx("div",{className:Nt.footer,children:f.footer})]},f.id)})})})}const pa=h.createContext(null),ga=()=>{const e=h.useContext(pa);if(!e)throw new Error("useDropdownContext debe usarse dentro de DropdownMenu o ContextMenu");return e},Yn=e=>e.type==="separator"||e.type==="label"?!1:"children"in e&&Array.isArray(e.children)&&e.children.length>0,Gs=e=>e.type==="checkbox",Zs=e=>e.type==="radio",Us=e=>e.type==="separator",Ks=e=>e.type==="label",ze={menu:"_menu_14cye_1",variant_default:"_variant_default_14cye_55",variant_elevated:"_variant_elevated_14cye_65",variant_bordered:"_variant_bordered_14cye_75",variant_glass:"_variant_glass_14cye_89",size_sm:"_size_sm_14cye_103",size_md:"_size_md_14cye_119",size_lg:"_size_lg_14cye_133",item:"_item_14cye_149",disabled:"_disabled_14cye_207",active:"_active_14cye_209",loading:"_loading_14cye_255",spinner_item:"_spinner_item_14cye_267",spinItem:"_spinItem_14cye_1",danger:"_danger_14cye_299",has_submenu:"_has_submenu_14cye_313",submenu_open:"_submenu_open_14cye_321",indicator:"_indicator_14cye_329",start_icon:"_start_icon_14cye_361",content:"_content_14cye_409",label_text:"_label_text_14cye_429",description:"_description_14cye_443",shortcut:"_shortcut_14cye_461",end_icon:"_end_icon_14cye_485",submenu_arrow:"_submenu_arrow_14cye_519",separator:"_separator_14cye_555",label:"_label_14cye_429",context_menu_trigger:"_context_menu_trigger_14cye_663"},Af=()=>r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:r.jsx("polyline",{points:"20 6 9 17 4 12"})}),Df=()=>r.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:r.jsx("polyline",{points:"9 18 15 12 9 6"})}),Pf=({marcado:e})=>r.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[r.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),e&&r.jsx("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"})]}),ha=h.forwardRef(({item:e,index:n,activeIndex:t,getItemProps:o},a)=>{const i=ga();if(Us(e))return r.jsx("div",{className:ne(ze.separator,i.classNames?.separator),role:"separator"});if(Ks(e))return r.jsx("div",{className:ne(ze.label,i.classNames?.label),role:"presentation","data-testid":"dropdown-label",children:e.label});const s=n===t,l=Gs(e),c=Zs(e),u=N=>{"isDisabled"in e&&e.isDisabled||(l?e.onCheckedChange?.(!e.isChecked):c&&i.onRadioChange?.(e.value),"onSelect"in e&&e.onSelect&&e.onSelect(N),i.closeOnSelect&&!Yn(e)&&i.cerrarMenu())},_=N=>{u(N)},g=N=>{"isDisabled"in e&&e.isDisabled||(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),u(N))},f=l?e.isChecked:!1,d=c?i.radioValue===e.value:!1,m="label"in e?e.label:void 0,p="description"in e?e.description:void 0,v="shortcut"in e?e.shortcut:void 0,y="startIcon"in e?e.startIcon:void 0,w="endIcon"in e?e.endIcon:void 0,C="isDisabled"in e?e.isDisabled:!1,k="isLoading"in e?e.isLoading:!1,z="isDanger"in e?e.isDanger:!1,A="className"in e?e.className:void 0;return r.jsxs("div",{ref:a,role:l?"menuitemcheckbox":c?"menuitemradio":"menuitem","aria-checked":l?f:c?d:void 0,"aria-disabled":C||k,tabIndex:s?0:-1,className:ne(ze.item,ze[`size_${i.size}`],s&&ze.active,C&&ze.disabled,k&&ze.loading,z&&ze.danger,Yn(e)&&ze.has_submenu,A,i.classNames?.item),onClick:_,onKeyDown:g,...o(),children:[k?r.jsx("span",{className:ze.indicator,children:r.jsx("span",{className:ze.spinner_item})}):(l||c)&&r.jsxs("span",{className:ze.indicator,children:[l&&f&&r.jsx(Af,{}),c&&r.jsx(Pf,{marcado:d})]}),!k&&y&&r.jsx("span",{className:ze.start_icon,children:y}),r.jsxs("span",{className:ze.content,children:[r.jsx("span",{className:ze.label_text,children:m}),p&&r.jsx("span",{className:ze.description,children:p})]}),v&&r.jsx("kbd",{className:ze.shortcut,children:v}),w&&r.jsx("span",{className:ze.end_icon,children:w}),Yn(e)&&r.jsx("span",{className:ze.submenu_arrow,children:r.jsx(Df,{})})]})});ha.displayName="MenuItem";const Tf=()=>r.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:r.jsx("polyline",{points:"9 18 15 12 9 6"})}),Uo=({items:e,activeIndex:n,getItemProps:t,listRef:o})=>r.jsx(r.Fragment,{children:(e??[]).map((a,i)=>Yn(a)?r.jsx(ma,{ref:s=>{o.current[i]=s},item:a,index:i,activeIndex:n,getItemProps:t},a.id):r.jsx(ha,{ref:s=>{o.current[i]=s},item:a,index:i,activeIndex:n,getItemProps:t},a.id))});Uo.displayName="MenuList";const ma=h.forwardRef(({item:e,index:n,activeIndex:t,getItemProps:o},a)=>{const i=ga(),[s,l]=h.useState(!1),c=cn(),u=Ai(),_=h.useRef([]),[g,f]=h.useState(null),{refs:d,floatingStyles:m,context:p,isPositioned:v}=Do({nodeId:u,open:s,onOpenChange:l,placement:"right-start",middleware:[$o({mainAxis:4,alignmentAxis:-4}),ko(),So({padding:8})],whileElementsMounted:yo}),{isMounted:y,styles:w}=Bo(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)"}}),C=Ar(p,{enabled:!e.isDisabled,delay:{open:75},handleClose:os({blockPointerEvents:!0})}),k=Vo(p,{role:"menu"}),z=Ao(p,{bubbles:!0}),A=qr(p,{listRef:_,activeIndex:g,onNavigate:f,nested:!0}),{getReferenceProps:N,getFloatingProps:P,getItemProps:O}=Po([C,k,z,A]);h.useEffect(()=>{if(!c)return;const V=()=>l(!1);return c.events.on("click",V),()=>{c.events.off("click",V)}},[c]);const E=n===t,T=Si([d.setReference,a]);return r.jsxs(Di,{id:u,children:[r.jsxs("div",{ref:T,role:"menuitem","aria-haspopup":"menu","aria-expanded":s,"aria-disabled":e.isDisabled,tabIndex:E?0:-1,className:ne(ze.item,ze[`size_${i.size}`],E&&ze.active,e.isDisabled&&ze.disabled,e.isDanger&&ze.danger,ze.has_submenu,s&&ze.submenu_open,e.className,i.classNames?.item),...N(o()),children:[e.startIcon&&r.jsx("span",{className:ze.start_icon,children:e.startIcon}),r.jsxs("span",{className:ze.content,children:[r.jsx("span",{className:ze.label_text,children:e.label}),e.description&&r.jsx("span",{className:ze.description,children:e.description})]}),e.shortcut&&r.jsx("kbd",{className:ze.shortcut,children:e.shortcut}),r.jsx("span",{className:ze.submenu_arrow,children:r.jsx(Tf,{})})]}),y&&r.jsx(Lo,{root:i.portalContainer,children:r.jsx(Or,{context:p,modal:!1,initialFocus:-1,returnFocus:!1,children:r.jsx("div",{ref:d.setFloating,style:{...m,pointerEvents:"none",zIndex:i.zIndex??"var(--z-dropdown)"},children:r.jsx("div",{className:ne(ze.menu,ze[`variant_${i.variant}`],i.classNames?.menu),style:{...w,pointerEvents:"auto",visibility:v||!s?"visible":"hidden"},...P(),children:r.jsx(Uo,{items:e.children,activeIndex:g,getItemProps:O,listRef:_})})})})})]})});ma.displayName="Submenu";const Xs=h.forwardRef(({children:e,items:n,triggerAction:t="click",placement:o="bottom-start",variant:a="default",size:i="md",isDisabled:s=!1,offset:l=4,minWidth:c="180px",matchTriggerWidth:u=!1,disableAnimation:_=!1,closeOnClickOutside:g=!0,closeOnEscape:f=!0,closeOnSelect:d=!0,className:m,classNames:p,style:v,onOpen:y,onClose:w,onOpenChange:C,onContextMenu:k,isOpen:z,zIndex:A,portalContainer:N,radioValue:P,onRadioChange:O},E)=>{const[T,V]=h.useState(!1),[S,b]=h.useState(null),[x,F]=h.useState(0),I=h.useRef([]),$=h.useRef([]),D=Ai(),B=z!==void 0,X=B?z:T,U=h.useCallback(q=>{s&&q||(B||V(q),C?.(q),q?y?.():w?.())},[s,B,C,y,w]);h.useEffect(()=>{$.current=(n??[]).filter(q=>q.type!=="separator"&&q.type!=="label").map(q=>"label"in q&&typeof q.label=="string"?q.label:"")},[n]);const{refs:L,floatingStyles:j,context:W,isPositioned:ie}=Do({nodeId:D,open:X,onOpenChange:U,placement:o,strategy:"fixed",middleware:[$o(l),ko({fallbackAxisSideDirection:"start",padding:8}),So({padding:8}),u?$i({apply({rects:q,elements:H}){Object.assign(H.floating.style,{minWidth:`${q.reference.width}px`})}}):void 0].filter(Boolean),whileElementsMounted:(q,H,de)=>yo(q,H,de,{animationFrame:!1})}),re=Xi(W,{enabled:!s&&(t==="click"||t==="both"),toggle:!0}),ae=Ar(W,{enabled:!s&&t==="hover",delay:{open:150,close:150},handleClose:os()}),me=Ao(W,{enabled:f||g,escapeKey:f,outsidePress:g}),ee=Vo(W,{role:"menu"}),fe=qr(W,{listRef:I,activeIndex:S,onNavigate:b,loop:!0}),R=es(W,{listRef:$,activeIndex:S,onMatch:b,enabled:X}),{getReferenceProps:se,getFloatingProps:_e,getItemProps:Se}=Po([re,ae,me,ee,fe,R]),{isMounted:ge,styles:le}=Bo(W,{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)"}});h.useImperativeHandle(E,()=>({open:()=>U(!0),close:()=>U(!1),toggle:()=>U(!X),isOpen:X}),[U,X]);const he=h.useMemo(()=>({radioValue:P,onRadioChange:O,cerrarMenu:()=>U(!1),closeOnSelect:d,size:i,variant:a,disableAnimation:_,classNames:p,portalContainer:N,zIndex:A}),[P,O,U,d,i,a,_,p,N,A]),G=h.isValidElement(e)?e:null,Y=Si([L.setReference,G?.ref||null]);if(!G)return e!=null&&console.error("DropdownMenu: children debe ser un elemento React válido"),null;const ce=t==="contextmenu"||t==="both"?{onContextMenu:q=>{q.preventDefault();const H={x:q.clientX,y:q.clientY};k?.(q,H),U(!1),F(de=>de+1),requestAnimationFrame(()=>{L.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}}}),U(!0)})},onClick:()=>{X&&t==="contextmenu"&&U(!1)}}:{},K=h.cloneElement(e,se({...e.props,...ce,ref:Y,"aria-haspopup":"menu","aria-expanded":X}));return r.jsx(pa.Provider,{value:he,children:r.jsxs(Di,{id:D,children:[K,ge&&r.jsx(Lo,{root:N,children:r.jsx(Or,{context:W,modal:!1,initialFocus:-1,returnFocus:!0,children:r.jsx("div",{ref:L.setFloating,style:{...j,zIndex:A??"var(--z-dropdown)",outline:"none",pointerEvents:"none"},children:r.jsx("div",{role:"menu","aria-orientation":"vertical",className:ne(ze.menu,ze[`variant_${a}`],ze[`size_${i}`],m,p?.menu),style:{...le,minWidth:c,...v,transform:[le.transform,v?.transform].filter(Boolean).join(" "),pointerEvents:"auto",visibility:ie||!X?"visible":"hidden"},..._e(),children:r.jsx(Uo,{items:n,activeIndex:S,getItemProps:Se,listRef:I})},x)})})})]})})});Xs.displayName="DropdownMenuInner";const Ko=h.forwardRef((e,n)=>r.jsx(Wd,{children:r.jsx(Xs,{...e,ref:n})}));Ko.displayName="DropdownMenu";const Ys=h.forwardRef(({isEnabled:e=!0,children:n,...t},o)=>r.jsx(Ko,{...t,ref:o,triggerAction:"contextmenu",isDisabled:!e||t.isDisabled,children:n}));Ys.displayName="ContextMenu";const Ut={group_button:"_group_button_wgdis_1",full_width:"_full_width_wgdis_17",main_button:"_main_button_wgdis_27",dropdown_trigger:"_dropdown_trigger_wgdis_35",first_item:"_first_item_wgdis_45",last_item:"_last_item_wgdis_55",variant_bordered:"_variant_bordered_wgdis_65",variant_ghost:"_variant_ghost_wgdis_67",variant_faded:"_variant_faded_wgdis_69",disabled:"_disabled_wgdis_93",loading:"_loading_wgdis_93",chevron:"_chevron_wgdis_111",chevron_open:"_chevron_open_wgdis_123"},Of=({label:e,onClick:n,items:t,variant:o="solid",color:a="primary",size:i="md",radius:s="md",isLoading:l=!1,isDisabled:c=!1,dropdownIcon:u,className:_,fullWidth:g=!1,...f})=>{const[d,m]=h.useState(!1),p=ne(Ut.group_button,Ut[`variant_${o}`],g&&Ut.full_width,_),v=()=>r.jsx("div",{className:ne(Ut.chevron,d&&Ut.chevron_open),children:r.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:r.jsx("path",{d:"m6 9 6 6 6-6"})})});return r.jsxs("div",{className:p,children:[r.jsx(Ze,{variant:o,color:a,size:i,radius:s,isLoading:l,isDisabled:c,onClick:n,className:ne(Ut.main_button,Ut.first_item),...f,children:e}),t&&r.jsx(Ko,{items:t,triggerAction:"click",onOpenChange:m,placement:"bottom-end",isDisabled:c||l,variant:"default",size:i,matchTriggerWidth:!1,children:r.jsx(Ze,{variant:o,color:a,size:i,radius:s,isDisabled:c||l,isIconOnly:!0,className:ne(Ut.dropdown_trigger,Ut.last_item),"aria-label":"M�s acciones",children:u||v()})})]})},Js=()=>r.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),Qs=()=>r.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:r.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"})}),Rs=()=>r.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:r.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"})}),el=()=>r.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("polyline",{points:"15 18 9 12 15 6"})}),tl=()=>r.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("polyline",{points:"9 18 15 12 9 6"})}),it={overlay:"_overlay_e8cuy_1",backdrop:"_backdrop_e8cuy_25",visible:"_visible_e8cuy_47",layout:"_layout_e8cuy_77",columna_acciones:"_columna_acciones_e8cuy_147",boton_flotante:"_boton_flotante_e8cuy_167",boton_primario:"_boton_primario_e8cuy_241",boton_peligro:"_boton_peligro_e8cuy_251",panel:"_panel_e8cuy_269",encabezado:"_encabezado_e8cuy_297",titulo:"_titulo_e8cuy_315",contenido:"_contenido_e8cuy_331",paginacion:"_paginacion_e8cuy_345",texto_paginacion:"_texto_paginacion_e8cuy_371"},Vf={transparente:{background:"transparent"},sutil:{background:"rgb(0 0 0 / 20%)"},normal:{background:"rgb(0 0 0 / 40%)"},intenso:{background:"rgb(0 0 0 / 60%)"}},Bf=({isOpen:e,onClose:n,onApply:t,onClear:o,title:a="Filtros",backdropVariant:i="sutil",backdropBlur:s=!0,closeOnBackdropClick:l=!0,allowBackdropInteraction:c=!1,getContainer:u,children:_})=>{const[g,f]=h.useState(!1),[d,m]=h.useState(0),p=c||i==="transparente",v=h.useCallback(()=>{g||(f(!0),setTimeout(()=>{n(),f(!1),m(0)},300))},[n,g]);h.useEffect(()=>{e&&f(!1)},[e]),h.useEffect(()=>{if(!e)return;const T=V=>V.key==="Escape"&&v();return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[e,v]);const y=h.useCallback(T=>{l&&T.target===T.currentTarget&&v()},[l,v]),w=h.useCallback(T=>{document.activeElement?.blur(),T?.()},[]),{pages:C,totalPages:k,hasPagination:z}=h.useMemo(()=>{const T=Array.isArray(_)?_:[_];return{pages:T,totalPages:T.length,hasPagination:T.length>1}},[_]),{background:A}=Vf[i],N={background:A,backdropFilter:s?"blur(1px)":"none",pointerEvents:p?"none":"auto"},P=u?{position:"absolute"}:{},O=u?{position:"relative"}:{},E=r.jsxs("div",{className:it.overlay,role:"dialog","aria-modal":"true",style:P,children:[r.jsx("div",{className:`${it.backdrop} ${e&&!g?it.visible:""}`,style:N,onClick:y}),r.jsxs("div",{className:`${it.layout} ${e&&!g?it.visible:""}`,style:O,children:[r.jsxs("aside",{className:it.columna_acciones,children:[r.jsx(_n,{content:"Cerrar",placement:"left",children:r.jsx("button",{type:"button",className:it.boton_flotante,onClick:()=>w(v),"aria-label":"Cerrar panel",children:r.jsx(Js,{})})}),r.jsx(_n,{content:"Aplicar filtros",placement:"left",children:r.jsx("button",{type:"button",className:`${it.boton_flotante} ${it.boton_primario}`,onClick:()=>w(t),children:r.jsx(Qs,{})})}),r.jsx(_n,{content:"Limpiar filtros",placement:"left",children:r.jsx("button",{type:"button",className:`${it.boton_flotante} ${it.boton_peligro}`,onClick:()=>w(o),children:r.jsx(Rs,{})})}),z&&r.jsxs("div",{className:it.paginacion,children:[r.jsx("button",{type:"button",className:it.boton_flotante,style:{width:36,height:36},onClick:()=>m(T=>Math.max(0,T-1)),disabled:d===0,"aria-label":"Página anterior",children:r.jsx(el,{})}),r.jsxs("span",{className:it.texto_paginacion,children:[d+1," / ",k]}),r.jsx("button",{type:"button",className:it.boton_flotante,style:{width:36,height:36},onClick:()=>m(T=>Math.min(k-1,T+1)),disabled:d===k-1,"aria-label":"Página siguiente",children:r.jsx(tl,{})})]})]}),r.jsxs("main",{className:it.panel,children:[r.jsx("header",{className:it.encabezado,children:r.jsx("h2",{className:it.titulo,children:a})}),r.jsx("div",{className:it.contenido,children:r.jsx("div",{style:{animation:"fadeIn 0.3s ease"},children:C[d]},d)})]})]})]});if(u){const T=typeof u=="function"?u():u;if(T&&T instanceof HTMLElement)return Fn.createPortal(E,T)}return E},Q={backdrop:"_backdrop_cyx4s_1",visible:"_visible_cyx4s_41",modal:"_modal_cyx4s_65",encabezado:"_encabezado_cyx4s_147",encabezado_textos:"_encabezado_textos_cyx4s_161",titulo:"_titulo_cyx4s_173",subtitulo:"_subtitulo_cyx4s_187",boton_cerrar:"_boton_cerrar_cyx4s_199",texto_esc:"_texto_esc_cyx4s_249",cuerpo:"_cuerpo_cyx4s_263",zona_carga:"_zona_carga_cyx4s_283",zona_carga_activa:"_zona_carga_activa_cyx4s_315",zona_carga_deshabilitada:"_zona_carga_deshabilitada_cyx4s_351",zona_contenido:"_zona_contenido_cyx4s_363",zona_icono_flotante:"_zona_icono_flotante_cyx4s_379",zona_textos:"_zona_textos_cyx4s_435",zona_titulo:"_zona_titulo_cyx4s_449",zona_separador:"_zona_separador_cyx4s_463",zona_meta:"_zona_meta_cyx4s_497",zona_meta_sep:"_zona_meta_sep_cyx4s_519",zona_meta_tam:"_zona_meta_tam_cyx4s_529",zona_meta_label:"_zona_meta_label_cyx4s_539",tipos_permitidos:"_tipos_permitidos_cyx4s_551",tipo_chip:"_tipo_chip_cyx4s_567",contador:"_contador_cyx4s_589",boton_elegir:"_boton_elegir_cyx4s_609",zona_arrastrando:"_zona_arrastrando_cyx4s_675",drag_icon_wrap:"_drag_icon_wrap_cyx4s_707",drag_ring:"_drag_ring_cyx4s_725",drag_ring_2:"_drag_ring_2_cyx4s_749",drag_ring_3:"_drag_ring_3_cyx4s_757",drag_icono:"_drag_icono_cyx4s_789",drag_textos:"_drag_textos_cyx4s_841",drag_titulo:"_drag_titulo_cyx4s_857",drag_subtitulo:"_drag_subtitulo_cyx4s_871",drag_chips:"_drag_chips_cyx4s_885",drag_chip:"_drag_chip_cyx4s_885",banner_limite:"_banner_limite_cyx4s_953",banner_limite_icono:"_banner_limite_icono_cyx4s_973",banner_limite_cuerpo:"_banner_limite_cuerpo_cyx4s_983",banner_limite_titulo:"_banner_limite_titulo_cyx4s_999",banner_limite_desc:"_banner_limite_desc_cyx4s_1011",banner_limite_pill:"_banner_limite_pill_cyx4s_1021",seccion_lista:"_seccion_lista_cyx4s_1041",cabecera_lista:"_cabecera_lista_cyx4s_1057",cabecera_titulo:"_cabecera_titulo_cyx4s_1071",lista_vacia:"_lista_vacia_cyx4s_1085",ilustracion_vacia:"_ilustracion_vacia_cyx4s_1103",lista_vacia_titulo:"_lista_vacia_titulo_cyx4s_1115",lista_vacia_desc:"_lista_vacia_desc_cyx4s_1127",lista:"_lista_cyx4s_1085",fila:"_fila_cyx4s_1251",fila_eliminada:"_fila_eliminada_cyx4s_1289",fila_subiendo:"_fila_subiendo_cyx4s_1289",fila_entrando:"_fila_entrando_cyx4s_1299",fila_saliendo:"_fila_saliendo_cyx4s_1307",fila_nombre:"_fila_nombre_cyx4s_1341",fila_restaurando:"_fila_restaurando_cyx4s_1401",fila_icono:"_fila_icono_cyx4s_1409",fila_error:"_fila_error_cyx4s_1421",fila_aviso:"_fila_aviso_cyx4s_1429",fila_cuerpo:"_fila_cuerpo_cyx4s_1437",fila_error_texto:"_fila_error_texto_cyx4s_1453",estado:"_estado_cyx4s_1479",estado_guardado:"_estado_guardado_cyx4s_1495",estado_nuevo:"_estado_nuevo_cyx4s_1505",estado_subiendo:"_estado_subiendo_cyx4s_1515",estado_eliminado:"_estado_eliminado_cyx4s_1537",fila_acciones:"_fila_acciones_cyx4s_1557",btn_eliminar:"_btn_eliminar_cyx4s_1569",btn_restaurar:"_btn_restaurar_cyx4s_1631",btn_reintentar:"_btn_reintentar_cyx4s_1699",spinner:"_spinner_cyx4s_1743",pie:"_pie_cyx4s_1765",pie_info:"_pie_info_cyx4s_1783",btn_pie:"_btn_pie_cyx4s_1795",input_archivo:"_input_archivo_cyx4s_1803"},jf={jpg:"#10b981",jpeg:"#10b981",png:"#6366f1",webp:"#06b6d4",gif:"#ec4899",avif:"#8b5cf6",pdf:"#ef4444",xls:"#22c55e",xlsx:"#16a34a",csv:"#4ade80",rar:"#f97316",zip:"#f59e0b","7z":"#fb923c",tar:"#ea580c",doc:"#3b82f6",docx:"#2563eb",txt:"#64748b",md:"#475569",mp4:"#a855f7",mov:"#9333ea",avi:"#7e22ce",mp3:"#ec4899",wav:"#db2777",psd:"#0ea5e9",ai:"#f97316",svg:"#8b5cf6"};function qf(e){const n=e.split(".").pop()?.toLowerCase()??"";return jf[n]??"#94a3b8"}function Hf(e){const n=e.split(".").pop()?.toLowerCase()??"";return n.length>4?n.slice(0,3).toUpperCase():n.toUpperCase()||"FILE"}function Jn({nombre:e,size:n=36}){const t=qf(e),o=Hf(e),a=Math.round(n*44/36);return r.jsxs("svg",{width:n,height:a,viewBox:"0 0 36 44",fill:"none","aria-hidden":"true",children:[r.jsx("rect",{x:"4",y:"5",width:"29",height:"37",rx:"5",fill:"black",fillOpacity:"0.06"}),r.jsx("path",{d:"M3 5C3 3.343 4.343 2 6 2H23L33 12V39C33 40.657 31.657 42 30 42H6C4.343 42 3 40.657 3 39V5Z",fill:"white"}),r.jsx("path",{d:"M3 5C3 3.343 4.343 2 6 2H23L33 12V39C33 40.657 31.657 42 30 42H6C4.343 42 3 40.657 3 39V5Z",stroke:"#E2E8F0",strokeWidth:"0.8",fill:"none"}),r.jsx("path",{d:"M23 2L33 12H26C24.343 12 23 10.657 23 9V2Z",fill:"#EEF2FF"}),r.jsx("path",{d:"M23 2L33 12",stroke:"#E2E8F0",strokeWidth:"0.8",fill:"none"}),r.jsx("rect",{x:"8",y:"17",width:"18",height:"1.5",rx:"0.75",fill:t,fillOpacity:"0.2"}),r.jsx("rect",{x:"8",y:"21",width:"14",height:"1.5",rx:"0.75",fill:"#CBD5E1",fillOpacity:"0.6"}),r.jsx("rect",{x:"8",y:"25",width:"16",height:"1.5",rx:"0.75",fill:"#CBD5E1",fillOpacity:"0.6"}),r.jsx("path",{d:"M3 32H33V39C33 40.657 31.657 42 30 42H6C4.343 42 3 40.657 3 39V32Z",fill:t}),r.jsx("text",{x:"18",y:"39.5",textAnchor:"middle",fill:"white",fontSize:"8",fontWeight:"700",fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif",letterSpacing:"0.4",children:o})]})}function nl({size:e=24,className:n}){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",className:n,children:r.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",children:[r.jsx("path",{strokeLinejoin:"round",d:"M2.75 12H6a2 2 0 0 1 2 2a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2a2 2 0 0 1 2-2h3.25"}),r.jsx("path",{d:"M21.25 10.375v4.875a6 6 0 0 1-6 6h-6.5a6 6 0 0 1-6-6v-6.5a6 6 0 0 1 6-6h4.875"}),r.jsx("path",{strokeMiterlimit:"10",d:"M18.957 2.75v5"}),r.jsx("path",{strokeLinejoin:"round",d:"m21.25 4.855l-1.967-1.967a.46.46 0 0 0-.652 0l-1.967 1.967"})]})})}function Wf({size:e=18,className:n}){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",className:n,children:r.jsx("path",{fill:"currentColor",d:"M11 16V7.85l-2.6 2.6L7 9l5-5l5 5l-1.4 1.45l-2.6-2.6V16zm-5 4q-.825 0-1.412-.587T4 18v-3h2v3h12v-3h2v3q0 .825-.587 1.413T18 20z"})})}function ol({size:e=18,className:n}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:n,"aria-hidden":"true",children:[r.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.08"}),r.jsx("path",{d:"M15 9l-6 6M9 9l6 6",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round"})]})}function Gf({size:e=20,className:n}){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",className:n,children:[r.jsx("path",{fill:"currentColor",d:"M3 6.524c0-.395.327-.714.73-.714h4.788c.006-.842.098-1.995.932-2.793A3.68 3.68 0 0 1 12 2a3.68 3.68 0 0 1 2.55 1.017c.834.798.926 1.951.932 2.793h4.788c.403 0 .73.32.73.714a.72.72 0 0 1-.73.714H3.73A.72.72 0 0 1 3 6.524"}),r.jsx("path",{fill:"currentColor",d:"M11.596 22h.808c2.783 0 4.174 0 5.08-.886c.904-.886.996-2.339 1.181-5.245l.267-4.188c.1-1.577.15-2.366-.303-2.865c-.454-.5-1.22-.5-2.753-.5H8.124c-1.533 0-2.3 0-2.753.5s-.404 1.288-.303 2.865l.267 4.188c.185 2.906.277 4.36 1.182 5.245c.905.886 2.296.886 5.079.886",opacity:".5"}),r.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.425 11.482c.413-.044.78.273.821.707l.5 5.263c.041.433-.26.82-.671.864c-.412.043-.78-.273-.821-.707l-.5-5.263c-.041-.434.26-.821.671-.864m5.15 0c.412.043.713.43.671.864l-.5 5.263c-.04.434-.408.75-.82.707c-.413-.044-.713-.43-.672-.864l.5-5.264c.041-.433.409-.75.82-.707",clipRule:"evenodd"})]})}function Zf({size:e=16,className:n}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:n,"aria-hidden":"true",children:[r.jsx("path",{d:"M12 21a9 9 0 1 0-9-9",fill:"currentColor",fillOpacity:"0.1",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),r.jsx("path",{d:"M3 12V7m0 5h5",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Uf({size:e=16,className:n}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:n,"aria-hidden":"true",children:[r.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.12"}),r.jsx("path",{d:"M7.5 12.5l3 3 6-6",stroke:"currentColor",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Kf({size:e=20,className:n}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:n,"aria-hidden":"true",children:[r.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.16",stroke:"currentColor",strokeWidth:"1.7"}),r.jsx("path",{d:"M12 8v5",stroke:"currentColor",strokeWidth:"2.1",strokeLinecap:"round"}),r.jsx("circle",{cx:"12",cy:"16.5",r:"1",fill:"currentColor"})]})}function rl({size:e=20,className:n}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:n,"aria-hidden":"true",children:[r.jsx("path",{d:"M10.268 4a2 2 0 0 1 3.464 0l7.536 13A2 2 0 0 1 19.536 20H4.464a2 2 0 0 1-1.732-3L10.268 4z",fill:"currentColor",fillOpacity:"0.14",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),r.jsx("path",{d:"M12 9v5",stroke:"currentColor",strokeWidth:"2.1",strokeLinecap:"round"}),r.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"currentColor"})]})}function Xf({size:e=18,className:n}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:n,"aria-hidden":"true",children:[r.jsx("path",{d:"M2 12C4 7 7.5 4.5 12 4.5S20 7 22 12c-2 5-5.5 7.5-10 7.5S4 17 2 12z",fill:"currentColor",fillOpacity:"0.1",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),r.jsx("circle",{cx:"12",cy:"12",r:"2.8",fill:"currentColor",fillOpacity:"0.65"}),r.jsx("circle",{cx:"12",cy:"12",r:"1.15",fill:"currentColor"})]})}function al({size:e=18,className:n}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:n,"aria-hidden":"true",children:[r.jsx("path",{d:"M4 17v1a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-1",fill:"currentColor",fillOpacity:"0.1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("path",{d:"M12 4v11m0 0-3-3m3 3 3-3",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round"})]})}function il({className:e}){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 500",className:e,"aria-hidden":"true",children:[r.jsxs("g",{children:[r.jsx("rect",{y:"382.4",width:"500",height:"0.25",style:{fill:"#e6e6e6"}}),r.jsx("rect",{x:"449.63",y:"391.22",width:"18.77",height:"0.25",style:{fill:"#e6e6e6"}}),r.jsx("rect",{x:"373.07",y:"398.08",width:"8.69",height:"0.25",style:{fill:"#e6e6e6"}}),r.jsx("rect",{x:"279.96",y:"394.63",width:"19.36",height:"0.25",style:{fill:"#e6e6e6"}}),r.jsx("rect",{x:"80.93",y:"394.5",width:"43.19",height:"0.25",style:{fill:"#e6e6e6"}}),r.jsx("rect",{x:"65.7",y:"394.5",width:"6.33",height:"0.25",style:{fill:"#e6e6e6"}}),r.jsx("rect",{x:"189.3",y:"388.58",width:"93.68",height:"0.25",style:{fill:"#e6e6e6"}}),r.jsx("rect",{x:"58.71",y:"73.68",width:"202.25",height:"144.13",style:{fill:"#fafafa"}}),r.jsx("rect",{x:"60.46",y:"73.68",width:"204.24",height:"144.13",style:{fill:"#f5f5f5"}}),r.jsx("rect",{x:"96.4",y:"48.86",width:"132.36",height:"193.76",transform:"translate(308.32 -16.84) rotate(90)",style:{fill:"#fafafa"}}),r.jsx("polygon",{points:"100.98 211.92 131.72 79.56 172.02 79.56 141.28 211.92 100.98 211.92",style:{fill:"#fff"}}),r.jsx("polygon",{points:"147.8 211.92 178.55 79.56 196.75 79.56 166 211.92 147.8 211.92",style:{fill:"#fff"}}),r.jsx("rect",{x:"192.95",y:"145.41",width:"132.36",height:"0.67",transform:"translate(404.87 -113.39) rotate(90)",style:{fill:"#fafafa"}}),r.jsx("path",{d:"M54.78,73.44v57.12H69.89S97,112.85,103.21,76.42a6.06,6.06,0,0,0-6-7.09H58.89A4.11,4.11,0,0,0,54.78,73.44Z",style:{fill:"#e0e0e0"}}),r.jsx("path",{d:"M54.78,235.44V135.17H69.89s30.67,59.05,34.22,100.27Z",style:{fill:"#e0e0e0"}}),r.jsx("rect",{x:"53.82",y:"130.56",width:"17.14",height:"4.61",rx:"1.51",style:{fill:"#f5f5f5"}}),r.jsx("path",{d:"M269,73.44v57.12H253.86s-27.15-17.71-33.32-54.14a6.07,6.07,0,0,1,6-7.09h38.36A4.12,4.12,0,0,1,269,73.44Z",style:{fill:"#e0e0e0"}}),r.jsx("path",{d:"M269,235.44V135.17H253.86s-30.66,59.05-34.22,100.27Z",style:{fill:"#e0e0e0"}}),r.jsx("rect",{x:"252.8",y:"130.56",width:"17.14",height:"4.61",rx:"1.51",transform:"translate(522.73 265.72) rotate(180)",style:{fill:"#f5f5f5"}}),r.jsx("rect",{x:"231.2",y:"253.66",width:"33.23",height:"128.74",style:{fill:"#fafafa"}}),r.jsx("polygon",{points:"255.56 382.4 264.43 382.4 264.43 367.53 246.26 367.53 255.56 382.4",style:{fill:"#f4f8ff"}}),r.jsx("rect",{x:"72.22",y:"253.66",width:"33.23",height:"128.74",style:{fill:"#e0e0e0"}}),r.jsx("rect",{x:"97.71",y:"253.66",width:"166.72",height:"123.62",style:{fill:"#fafafa"}}),r.jsx("path",{d:"M147.8,231.8c0,12,11.56,21.86,25.7,21.86h12.76c14.13,0,25.69-9.84,25.69-21.86Z",style:{fill:"#ebebeb"}}),r.jsx("path",{d:"M140.4,204.33h24s-4.17,11-4.17,17.48,18.26,31.85-7.83,31.85-7.83-25.38-7.83-31.85S140.4,204.33,140.4,204.33Z",style:{fill:"#e0e0e0"}}),r.jsx("rect",{x:"104.59",y:"261.19",width:"152.96",height:"31.17",style:{fill:"#ebebeb"}}),r.jsx("polygon",{points:"106.58 382.4 97.71 382.4 97.71 367.53 115.89 367.53 106.58 382.4",style:{fill:"#fafafa"}}),r.jsx("path",{d:"M176.37,276.77a4.7,4.7,0,1,0,4.7-4.7A4.7,4.7,0,0,0,176.37,276.77Z",style:{fill:"#fafafa"}}),r.jsx("rect",{x:"104.59",y:"299.89",width:"152.96",height:"31.17",style:{fill:"#ebebeb"}}),r.jsx("path",{d:"M176.37,315.47a4.7,4.7,0,1,0,4.7-4.7A4.7,4.7,0,0,0,176.37,315.47Z",style:{fill:"#fafafa"}}),r.jsx("rect",{x:"104.59",y:"338.58",width:"152.96",height:"31.17",style:{fill:"#ebebeb"}}),r.jsx("circle",{cx:"181.07",cy:"354.17",r:"4.7",style:{fill:"#fafafa"}}),r.jsx("rect",{x:"295.65",y:"71.94",width:"74.23",height:"52.84",style:{fill:"#e0e0e0"}}),r.jsx("rect",{x:"299.87",y:"71.94",width:"76.07",height:"52.84",style:{fill:"#f5f5f5"}}),r.jsx("rect",{x:"316.34",y:"65.17",width:"43.14",height:"66.37",transform:"translate(436.26 -239.55) rotate(90)",style:{fill:"#fff"}}),r.jsx("rect",{x:"328.9",y:"76.85",width:"18.01",height:"43.01",transform:"translate(436.26 -239.55) rotate(90)",style:{fill:"#f5f5f5"}}),r.jsx("rect",{x:"384.92",y:"98.36",width:"45.18",height:"47.38",style:{fill:"#e0e0e0"}}),r.jsx("rect",{x:"389.15",y:"98.36",width:"47.03",height:"47.38",style:{fill:"#f5f5f5"}}),r.jsx("rect",{x:"393.82",y:"103.38",width:"37.68",height:"37.33",transform:"translate(534.71 -290.61) rotate(90)",style:{fill:"#fff"}}),r.jsx("path",{d:"M405.68,122.05h0a6.28,6.28,0,0,1,6.27-6.28h1.42a6.28,6.28,0,0,1,6.27,6.28h0a6.27,6.27,0,0,1-6.27,6.27H412A6.27,6.27,0,0,1,405.68,122.05Z",style:{fill:"#f5f5f5"}}),r.jsx("polygon",{points:"500 161.85 380.7 161.85 359.01 161.85 359.01 189.42 337.32 189.42 337.32 216.99 315.63 216.99 315.63 244.56 293.94 244.56 293.94 272.13 272.25 272.13 272.25 299.69 250.56 299.69 250.56 327.26 228.87 327.26 228.87 354.83 207.18 354.83 207.18 382.4 228.87 382.4 500 382.4 500 161.85",style:{fill:"#fafafa"}}),r.jsx("rect",{x:"204.95",y:"354.83",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),r.jsx("rect",{x:"226.64",y:"327.26",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),r.jsx("rect",{x:"248.33",y:"299.69",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),r.jsx("rect",{x:"270.02",y:"272.12",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),r.jsx("rect",{x:"291.71",y:"244.56",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),r.jsx("rect",{x:"313.4",y:"216.99",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),r.jsx("rect",{x:"335.09",y:"189.42",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),r.jsx("rect",{x:"356.78",y:"161.85",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),r.jsx("polygon",{points:"478.31 161.85 478.31 189.42 456.62 189.42 456.62 216.99 434.93 216.99 434.93 244.56 413.24 244.56 413.24 272.13 391.55 272.13 391.55 299.69 369.86 299.69 369.86 327.26 348.17 327.26 348.17 354.83 326.48 354.83 326.48 382.4 348.17 382.4 500 382.4 500 189.42 500 161.85 478.31 161.85",style:{fill:"#fff"}})]}),r.jsx("ellipse",{cx:"250",cy:"416.24",rx:"193.89",ry:"11.32",style:{fill:"#f5f5f5"}}),r.jsxs("g",{children:[r.jsx("path",{d:"M365.15,162c1.4,4.69,8.62,13.47,9.19,19.86s-11.74,16.61-11.74,16.61-9.2-30.76-3.44-34.35S365.15,162,365.15,162Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M339.87,195.23c-2.18,1.82-4.32,3.35-6.55,4.92s-4.53,3-6.87,4.34a77.83,77.83,0,0,1-7.25,3.79c-1.26.57-2.51,1.13-3.81,1.62-.64.26-1.29.51-1.95.73l-2,.7a13.24,13.24,0,0,1-5.26.38,30.07,30.07,0,0,1-4.36-.84,57.61,57.61,0,0,1-7.81-2.78,104.07,104.07,0,0,1-14.19-7.55l1.87-3.48c2.36,1,4.78,2,7.18,2.87s4.82,1.79,7.24,2.54a60.74,60.74,0,0,0,7.2,1.88,23.5,23.5,0,0,0,3.39.41,7.07,7.07,0,0,0,2.52-.26,64.62,64.62,0,0,0,6.68-3c1.11-.58,2.21-1.17,3.29-1.81s2.18-1.26,3.25-1.92c2.15-1.33,4.25-2.74,6.33-4.19s4.15-3,6-4.47Z",style:{fill:"#e58a7b"}}),r.jsx("path",{d:"M345.15,184.58c-2.48-1.94-12.74,4.41-15.85,7.06l2.27,13.73s14.75-6.18,15.63-10.4C348.13,190.56,347,186.06,345.15,184.58Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.8}}),r.jsx("polygon",{points:"385.58 406.47 377.79 407.05 374.94 389.12 382.73 388.54 385.58 406.47",style:{fill:"#e58a7b"}}),r.jsx("polygon",{points:"440.68 381.41 434.07 385.57 422.3 371.61 428.91 367.44 440.68 381.41",style:{fill:"#e58a7b"}}),r.jsx("polygon",{points:"374.94 389.12 376.52 399.08 384.2 397.79 382.74 388.55 374.94 389.12",style:{fill:"#cf6f64"}}),r.jsx("polygon",{points:"428.92 367.45 422.3 371.61 427.18 377.39 433.94 373.4 428.92 367.45",style:{fill:"#cf6f64"}}),r.jsx("path",{d:"M349,232.2s-.11,61.82,4.94,85.1c5.26,24.22,20.73,79.32,20.73,79.32l11.22-1.45s-8.77-55.66-12.51-79.73c-4.07-26.23-1.57-87.68-1.57-87.68Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.7}}),r.jsx("path",{d:"M371.11,255.16l-5.5-5.48c.21,23.75,1.54,35.48,6.11,48.26C371,284.43,370.94,268.45,371.11,255.16Z",style:{opacity:.5}}),r.jsx("path",{d:"M356.74,230.6s16.77,51.09,25.09,80.52c8.78,31.05,42.44,65.39,42.44,65.39l9.66-5.58s-23-32.6-31.46-61.57c-17.2-58.81-10.13-71.27-22.82-83.23Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.7}}),r.jsx("path",{d:"M343.56,147.09c4.46,1.49,8.51,12.56,8.68,16.92s-12.92,10.37-12.92,10.37-5.77-14-4.16-23C335.86,147.47,343.56,147.09,343.56,147.09Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M282.35,197.43l-5.29-5.76-1.73,7.22s3.76,3.32,6.8,2.18Z",style:{fill:"#e58a7b"}}),r.jsx("polygon",{points:"271.7 190.02 268 192.96 275.33 198.89 277.06 191.67 271.7 190.02",style:{fill:"#e58a7b"}}),r.jsx("path",{d:"M432,384.08l6.18-6.23a.63.63,0,0,1,.82-.06l5.63,4.18a1.25,1.25,0,0,1,.11,1.87c-2.2,2.13-3.36,3.05-6.08,5.79-1.67,1.69-3.94,4.32-6.25,6.65s-4.74.16-4-1c3.37-5.27,2.77-7.24,3-9.92A2,2,0,0,1,432,384.08Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M377.27,405.93h8.78a.66.66,0,0,1,.65.54l1.38,6.94a1.18,1.18,0,0,1-1.17,1.39c-3.07-.05-4.55-.23-8.41-.23-2.37,0-7.27.24-10.55.24s-3.63-3.24-2.28-3.53c6-1.32,8.35-3.13,10.32-4.87A2,2,0,0,1,377.27,405.93Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M349.81,161.79c3.41,2.85,8.36,7,14.19,2.15,5-4.18,8.5-15.15-.47-15.55C358.84,148.18,349.81,161.79,349.81,161.79Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M358.05,163.74c0,4.72.73,13.23,4.5,15.65,0,0-.34,4.86-8.8,6.5-9.29,1.81-5.34-3.75-5.34-3.75,4.84-2.2,4-5.94,2.4-9.3Z",style:{fill:"#e58a7b"}}),r.jsx("path",{d:"M355.1,167.45l-4.28,5.39a15.19,15.19,0,0,1,.92,2.42c1.88-.66,4.13-3.3,3.94-5.37A6.83,6.83,0,0,0,355.1,167.45Z",style:{fill:"#cf6f64"}}),r.jsx("path",{d:"M358.5,152.9c1,7.69,1.61,10.92-1.47,15.57-4.63,7-14.29,6.55-17.58-.68-3-6.51-4.12-18,2.72-22.45A10.57,10.57,0,0,1,358.5,152.9Z",style:{fill:"#e58a7b"}}),r.jsx("path",{d:"M345.14,139.43c-5.2,3.69,5.23,4.78,5.24,10.13,0,2.21,3.63,9.22,8.79,8.82l5-8.88C369.43,141,357,131,345.14,139.43Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M345.14,139.43c-9.15-.48-13.14,6.8-12.09,13.34a59.6,59.6,0,0,1,19.54-1.55C365.13,152.5,345.14,139.43,345.14,139.43Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M361,159.53a5.65,5.65,0,0,1-1.31,4.12c-1.29,1.51-3,.62-3.6-1.17-.51-1.62-.45-4.35,1.29-5.21A2.55,2.55,0,0,1,361,159.53Z",style:{fill:"#e58a7b"}}),r.jsx("path",{d:"M347.39,157.27c.12.62-.11,1.18-.51,1.26s-.83-.36-.95-1,.11-1.19.51-1.27S347.27,156.65,347.39,157.27Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M340.4,158.63c.12.62-.11,1.19-.51,1.27s-.83-.36-.95-1,.11-1.19.51-1.26S340.28,158,340.4,158.63Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M342.46,159.34a17.1,17.1,0,0,1-1.44,4.37,2.71,2.71,0,0,0,2.29,0Z",style:{fill:"#df5753"}}),r.jsx("path",{d:"M345.92,165.71a.18.18,0,0,1-.18-.15.18.18,0,0,1,.15-.21,5,5,0,0,0,3.62-2.7.18.18,0,1,1,.34.14,5.27,5.27,0,0,1-3.89,2.92Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M353.5,192.54c-16.73,3.73-11.56-6.39-10.56-8.62l.42-.16c2-.73,2.4-.84,5.06-1.62a100.71,100.71,0,0,1,14.14-2.75l1-.14c1-.13,1.91-.23,2.83-.31.62-.07,1.24-.11,1.83-.15l2-.12h0C370.56,180.23,371.39,188.57,353.5,192.54Z",style:{fill:"#e58a7b"}}),r.jsx("path",{d:"M379.76,224.21l1.95,2.52c.15.19-.06.46-.42.53l-32.66,6.36c-.28.06-.54,0-.59-.21l-.83-2.73c0-.19.16-.4.46-.46l31.54-6.14A.57.57,0,0,1,379.76,224.21Z",style:{fill:"#26395a"}}),r.jsx("path",{d:"M376.21,228.56l.85-.16c.17,0,.28-.14.25-.25l-1.1-3.54c0-.11-.2-.16-.37-.13l-.84.16c-.17,0-.28.15-.25.25l1.1,3.55C375.88,228.54,376.05,228.6,376.21,228.56Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M357.08,240.36l-6.51-2.42,1,6.19s4.72,1.7,7.13-.48Z",style:{fill:"#e58a7b"}}),r.jsx("polygon",{points:"344.37 239.58 342.82 243.64 351.57 244.13 350.57 237.94 344.37 239.58",style:{fill:"#e58a7b"}}),r.jsx("path",{d:"M351.06,233.46l.85-.16c.16,0,.28-.14.24-.25l-1.1-3.54c0-.11-.19-.16-.36-.13l-.85.16c-.17,0-.28.15-.24.25l1.1,3.55C350.73,233.44,350.89,233.5,351.06,233.46Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M363.64,231l.84-.16c.17,0,.28-.14.25-.25l-1.1-3.54c0-.11-.2-.16-.37-.13l-.84.16c-.17,0-.28.15-.25.25l1.1,3.55A.32.32,0,0,0,363.64,231Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M355.27,165.13c-2,3.31,5.25,4.84,9.54,1.45,3.43-2.72,2.62-9-.32-10.46S355.27,165.13,355.27,165.13Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.4}}),r.jsx("path",{d:"M379.66,226.13l-31.14,6.07c-16.09-43.57-12.59-45-12.59-45a62.53,62.53,0,0,1,7-3.3l.42-.16c2-.73,2.4-.84,5.06-1.62,4.58-1.09,8.85-2,14.14-2.75l1-.14c1-.12,1.91-.22,2.83-.31.62-.07,1.24-.11,1.83-.15l2-.11c3.42-.17,5.87-.12,5.87-.12C375.13,205.75,376.67,213.56,379.66,226.13Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.8}}),r.jsx("path",{d:"M377.09,194.31l-4.8,2.86L377.83,218C376.62,211.69,377.16,204.76,377.09,194.31Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.27,mixBlendMode:"multiply"}}),r.jsx("polygon",{points:"387.9 395.13 372.62 397.11 371.62 392.85 387.53 389.48 387.9 395.13",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("polygon",{points:"434.74 370.59 423.47 377.1 419.67 373.85 432 365.51 434.74 370.59",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M381.85,189.13c.54,2.78.85,5.4,1.15,8.11s.41,5.39.49,8.1a80.09,80.09,0,0,1-.18,8.19c-.11,1.37-.23,2.74-.42,4.12-.08.68-.17,1.37-.3,2.06l-.37,2.12a13.32,13.32,0,0,1-2.21,4.79,29.67,29.67,0,0,1-2.84,3.41,56.66,56.66,0,0,1-6.2,5.5,103.64,103.64,0,0,1-13.46,8.79L355.37,241c2-1.59,4-3.23,6-4.9s3.9-3.36,5.73-5.12a62.64,62.64,0,0,0,5.11-5.39,23.76,23.76,0,0,0,2-2.78,7,7,0,0,0,1-2.33,66.19,66.19,0,0,0,.57-7.32c0-1.25,0-2.5,0-3.75s-.05-2.52-.11-3.78c-.12-2.52-.35-5-.62-7.56s-.62-5.09-1-7.46Z",style:{fill:"#e58a7b"}}),r.jsx("path",{d:"M380.64,180.63c4.27,3.46,3.25,13.74,3.25,13.74l-14.4,4.74s.66-11.85,1.38-16.11C371.71,177.93,376.43,177.22,380.64,180.63Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.8}}),r.jsx("path",{d:"M429.68,387.71a1.06,1.06,0,0,1-.86-.48.63.63,0,0,1-.11-.62c.35-.94,3.11-1.54,3.42-1.61a.19.19,0,0,1,.19.08.17.17,0,0,1,0,.2c-.54.89-1.6,2.38-2.59,2.43Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M431.32,385.46c-1,0-2.25-.25-2.62-.79a.65.65,0,0,1,.07-.81,1,1,0,0,1,.73-.38h.08c1.12,0,2.66,1.51,2.72,1.57a.18.18,0,0,1,.05.18.19.19,0,0,1-.13.13A3.61,3.61,0,0,1,431.32,385.46Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M374.4,407.3a3,3,0,0,1-1.91-.48,1,1,0,0,1-.38-.89.58.58,0,0,1,.28-.5c.92-.54,4.14,1.06,4.5,1.24a.19.19,0,0,1,.1.19.19.19,0,0,1-.14.16A13.33,13.33,0,0,1,374.4,407.3Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M376.81,407h-.07c-1-.43-2.93-2.13-2.79-3,0-.2.18-.46.68-.51h.15c1.74,0,2.19,3.18,2.21,3.32a.2.2,0,0,1-.07.18A.2.2,0,0,1,376.81,407Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M360.08,175.42c.71-.27,1.6,2.23,1.38,2.55-.51.73-9.85,3.28-10.27,1.85a6.24,6.24,0,0,1,.35-2.28C351.81,177.06,353.88,177.94,360.08,175.42Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M358.5,175.48c.36-.83,1.39-2.16,2.29-1.4s1.28,2.4.69,2.67S357.88,176.87,358.5,175.48Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M360.41,175.91c.62-.66,2-1.57,2.63-.55s.4,2.69-.24,2.74S359.36,177,360.41,175.91Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M360.75,175.76a2.77,2.77,0,0,1,1.39-2.67c1.14-.74,2.25-1.22,2.69-2a5.52,5.52,0,0,1,.11,2.24c-.23,1.07-3.78,1.89-3.54,2.82Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M360.6,175.71a2.77,2.77,0,0,1-.28-3c.54-1.24,1.22-2.24,1.18-3.12a5.57,5.57,0,0,1,1.31,1.82c.38,1-2.15,3.63-1.44,4.29Z",style:{fill:"var(--brand-primary, #407BFF)"}})]}),r.jsxs("g",{children:[r.jsx("path",{d:"M190.41,223.53h0A11,11,0,0,0,179.69,215h-80a11,11,0,0,0-11,11V403.82a11,11,0,0,0,11,11h254a11,11,0,0,0,11-11V254.45a11,11,0,0,0-11-11H215.44A25.68,25.68,0,0,1,190.41,223.53Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.6}}),r.jsx("path",{d:"M162.17,168.15l7.13,23.09a11.61,11.61,0,0,0,14.51,7.66l23.08-7.13Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.22}}),r.jsx("path",{d:"M162.17,168.15l-82.5,25.49A11.59,11.59,0,0,0,72,208.14l47.1,152.48a11.6,11.6,0,0,0,14.51,7.66L239.2,335.66a11.59,11.59,0,0,0,7.66-14.5l-40-129.39Z",style:{fill:"#fff",opacity:.8}}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M206.56,329l-68.64,21.2a5.08,5.08,0,0,1-6.34-3.34h0a5.08,5.08,0,0,1,3.35-6.33l68.64-21.21a5.08,5.08,0,0,1,6.34,3.35h0A5.08,5.08,0,0,1,206.56,329Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M132.69,204.58l-36.3,11.21a5.09,5.09,0,0,1-6.34-3.34h0a5.09,5.09,0,0,1,3.35-6.34l36.3-11.21a5.07,5.07,0,0,1,6.34,3.34h0A5.09,5.09,0,0,1,132.69,204.58Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M162.31,216.47l-60,18.53A5.08,5.08,0,0,1,96,231.65h0a5.07,5.07,0,0,1,3.34-6.33l60-18.53a5.08,5.08,0,0,1,6.34,3.34h0A5.1,5.1,0,0,1,162.31,216.47Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M195.81,227.16l-87.56,27a5.07,5.07,0,0,1-6.33-3.34h0a5.09,5.09,0,0,1,3.34-6.34l87.56-27a5.08,5.08,0,0,1,6.33,3.34h0A5.08,5.08,0,0,1,195.81,227.16Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M201.74,246.36l-50.9,15.73a5.08,5.08,0,0,1-6.33-3.35h0a5.08,5.08,0,0,1,3.34-6.33l50.9-15.73a5.1,5.1,0,0,1,6.34,3.35h0A5.08,5.08,0,0,1,201.74,246.36Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M127.5,269.3l-13.31,4.11a5.08,5.08,0,0,1-6.34-3.34h0a5.08,5.08,0,0,1,3.35-6.34l13.31-4.11a5.09,5.09,0,0,1,6.34,3.34h0A5.1,5.1,0,0,1,127.5,269.3Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M207.68,265.57l-87.56,27.05a5.08,5.08,0,0,1-6.33-3.35h0a5.07,5.07,0,0,1,3.34-6.33l87.56-27.05a5.08,5.08,0,0,1,6.33,3.34h0A5.08,5.08,0,0,1,207.68,265.57Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M179.82,295.21l-53.77,16.61a5.08,5.08,0,0,1-6.33-3.34h0a5.09,5.09,0,0,1,3.34-6.34l53.77-16.61a5.09,5.09,0,0,1,6.34,3.35h0A5.07,5.07,0,0,1,179.82,295.21Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M213.61,284.78l-14.35,4.43a5.09,5.09,0,0,1-6.34-3.35h0a5.08,5.08,0,0,1,3.35-6.33l14.35-4.43a5.07,5.07,0,0,1,6.33,3.34h0A5.08,5.08,0,0,1,213.61,284.78Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M219.54,304l-87.55,27.05a5.08,5.08,0,0,1-6.34-3.35h0a5.07,5.07,0,0,1,3.35-6.33l87.55-27.05a5.1,5.1,0,0,1,6.34,3.35h0A5.08,5.08,0,0,1,219.54,304Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("path",{d:"M221.42,110.81l26.18,58.34a6.31,6.31,0,0,1-3.16,8.32L133.38,227.32a6.3,6.3,0,0,1-8.32-3.16L98.87,165.82a6.3,6.3,0,0,1,3.16-8.33l111.06-49.85a6.32,6.32,0,0,1,8.33,3.17Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.3}}),r.jsx("rect",{x:"200.4",y:"108.68",width:"3.89",height:"1",transform:"translate(-26.96 92.38) rotate(-24.16)",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("rect",{x:"184",y:"114.19",width:"12.13",height:"1",transform:"translate(-30.29 87.83) rotate(-24.16)",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("rect",{x:"99.33",y:"171.59",width:"1",height:"7.4",transform:"translate(-63.04 56.26) rotate(-24.18)",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M217.7,107.43l-28.64,56.1a25.65,25.65,0,0,1-29.3,13.15L98.81,160.79a6.39,6.39,0,0,1,3.22-3.3l111.06-49.85A6.3,6.3,0,0,1,217.7,107.43Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.6}}),r.jsx("path",{d:"M257.07,179.23l-86.18,5.32A11.6,11.6,0,0,0,160,196.84l9.83,159.28A11.6,11.6,0,0,0,182.14,367l110.3-6.81a11.58,11.58,0,0,0,10.86-12.29L295,212.73Z",style:{fill:"#fff",opacity:.8}}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M262.28,346l-71.71,4.43a5.08,5.08,0,0,1-5.36-4.75h0a5.09,5.09,0,0,1,4.74-5.37l71.71-4.42a5.08,5.08,0,0,1,5.37,4.74h0A5.08,5.08,0,0,1,262.28,346Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M219.84,207.68l-37.93,2.34a5.09,5.09,0,0,1-5.37-4.74h0a5.09,5.09,0,0,1,4.75-5.37l37.93-2.34a5.07,5.07,0,0,1,5.36,4.74h0A5.08,5.08,0,0,1,219.84,207.68Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M245.82,226.22l-62.67,3.86a5.07,5.07,0,0,1-5.37-4.74h0a5.08,5.08,0,0,1,4.75-5.37l62.66-3.86a5.07,5.07,0,0,1,5.37,4.74h0A5.08,5.08,0,0,1,245.82,226.22Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M275.85,244.51l-91.46,5.64A5.09,5.09,0,0,1,179,245.4h0a5.07,5.07,0,0,1,4.74-5.36l91.47-5.65a5.08,5.08,0,0,1,5.36,4.75h0A5.08,5.08,0,0,1,275.85,244.51Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M277.09,264.57l-53.17,3.28a5.08,5.08,0,0,1-5.37-4.74h0a5.07,5.07,0,0,1,4.74-5.37l53.17-3.28a5.07,5.07,0,0,1,5.37,4.74h0A5.08,5.08,0,0,1,277.09,264.57Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M199.53,269.35l-13.91.86a5.07,5.07,0,0,1-5.36-4.74h0A5.08,5.08,0,0,1,185,260.1l13.91-.86a5.09,5.09,0,0,1,5.37,4.75h0A5.08,5.08,0,0,1,199.53,269.35Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M278.33,284.63l-91.47,5.64a5.08,5.08,0,0,1-5.37-4.74h0a5.09,5.09,0,0,1,4.75-5.37l91.46-5.64a5.08,5.08,0,0,1,5.37,4.75h0A5.07,5.07,0,0,1,278.33,284.63Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M244.27,306.87l-56.17,3.47a5.09,5.09,0,0,1-5.37-4.75h0a5.08,5.08,0,0,1,4.75-5.36l56.17-3.47a5.08,5.08,0,0,1,5.36,4.75h0A5.06,5.06,0,0,1,244.27,306.87Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M279.56,304.7l-15,.92a5.07,5.07,0,0,1-5.36-4.74h0a5.07,5.07,0,0,1,4.74-5.37l15-.92a5.07,5.07,0,0,1,5.37,4.74h0A5.09,5.09,0,0,1,279.56,304.7Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M280.8,324.76l-91.46,5.64a5.08,5.08,0,0,1-5.37-4.74h0a5.08,5.08,0,0,1,4.74-5.37l91.47-5.64a5.07,5.07,0,0,1,5.36,4.74h0A5.07,5.07,0,0,1,280.8,324.76Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("path",{d:"M257.07,179.23l1.49,24.12a11.6,11.6,0,0,0,12.29,10.87L295,212.73Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.22}}),r.jsx("path",{d:"M228.85,239.4h0a8.65,8.65,0,0,0-9-8.53H139.75c-6.07,0-12,4.93-13.14,11L95,403.82c-1.18,6.07,2.78,11,8.85,11h254c6.07,0,11.95-4.92,13.14-11l26.07-133.5c1.18-6.08-2.78-11-8.85-11H250C238,259.32,229.26,251.06,228.85,239.4Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.5}})]})]})}const Yf={pdf:"application/pdf",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",avif:"image/avif",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",csv:"text/csv",rar:"application/x-rar-compressed",zip:"application/zip","7z":"application/x-7z-compressed"},Jf={"image/jpeg":"JPG","image/png":"PNG","image/webp":"WEBP","image/gif":"GIF","image/avif":"AVIF","application/pdf":"PDF","application/vnd.ms-excel":"XLS","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX","text/csv":"CSV","application/zip":"ZIP","application/x-rar-compressed":"RAR","application/x-7z-compressed":"7Z"},Qf={JPG:"#10b981",PNG:"#6366f1",WEBP:"#06b6d4",GIF:"#ec4899",AVIF:"#8b5cf6",PDF:"#ef4444",XLS:"#22c55e",XLSX:"#16a34a",CSV:"#4ade80",ZIP:"#f59e0b",RAR:"#f97316","7Z":"#fb923c"};function Rf(e){if(!e.length)return;const n=new Set;return e.forEach(t=>{n.add(`.${t}`);const o=Yf[t];o&&n.add(o)}),[...n].join(",")}let e1=0;function Xo(){return`fs_${Date.now()}_${++e1}`}const t1=300;function n1({status:e}){return e==="saved"?r.jsx("span",{className:`${Q.estado} ${Q.estado_guardado}`,children:"Guardado"}):e==="pending"?r.jsx("span",{className:`${Q.estado} ${Q.estado_nuevo}`,children:"Nuevo"}):e==="uploading"?r.jsx("span",{className:`${Q.estado} ${Q.estado_subiendo}`,children:"Subiendo…"}):e==="deleted"?r.jsx("span",{className:`${Q.estado} ${Q.estado_eliminado}`,children:"Eliminado"}):null}const o1={network:"Error de red al subir","too-large":"Supera el límite de tamaño permitido","invalid-type":"Tipo de archivo no permitido",duplicate:"Ya existe un archivo con este nombre"};function r1({archivo:e,alEliminar:n,alRestaurar:t,alReintentar:o,subiendo:a,disableDeleteSaved:i}){const{id:s,name:l,status:c,error:u,entering:_,saliendo:g,restaurando:f}=e,d=c==="deleted",m=c==="uploading",p=c==="error",v=p&&u==="too-large",w=c==="saved"&&i,C=[Q.fila,_&&Q.fila_entrando,g&&Q.fila_saliendo,d&&Q.fila_eliminada,m&&Q.fila_subiendo,p&&Q.fila_error,v&&Q.fila_aviso,f&&Q.fila_restaurando].filter(Boolean).join(" ");return r.jsxs("li",{className:C,children:[r.jsx("span",{className:Q.fila_icono,children:m?r.jsx("span",{className:Q.spinner,"aria-hidden":"true"}):p?v?r.jsx(rl,{size:20}):r.jsx(Kf,{size:20}):r.jsx(Jn,{nombre:l,size:30})}),r.jsxs("div",{className:Q.fila_cuerpo,children:[r.jsx("span",{className:Q.fila_nombre,title:l,children:l}),p?r.jsxs("span",{className:Q.fila_error_texto,children:[o1[u],u==="network"&&r.jsx("button",{className:Q.btn_reintentar,onClick:()=>o(s),children:"Reintentar"})]}):r.jsx(n1,{status:c})]}),r.jsx("div",{className:Q.fila_acciones,children:d?r.jsxs("button",{className:Q.btn_restaurar,onClick:()=>t(s),disabled:a,"aria-label":`Restaurar ${l}`,children:[r.jsx(Zf,{size:14}),"Restaurar"]}):!g&&!w&&r.jsx("button",{className:Q.btn_eliminar,onClick:()=>n(s),disabled:m||a,"aria-label":`Eliminar ${l}`,title:"Eliminar",children:r.jsx(Gf,{size:18})})})]})}const a1=["pdf","jpg","jpeg","png"],i1=50;function s1({onClose:e,storagePath:n,onFilesChange:t,title:o="Importar archivos",subtitle:a,savedFiles:i=[],fileNameBuilder:s,maxFiles:l=1/0,allowedTypes:c=a1,maxSizeMB:u=i1,confirmation:_,firebaseStorage:g,onUploadError:f,onUploadComplete:d,disableDeleteSaved:m=!1}){const p=h.useRef(null),v=h.useRef(0),w=`${h.useId()}-titulo`,[C,k]=h.useState(!1),[z,A]=h.useState(!1),[N,P]=h.useState(()=>i.map(G=>({id:G.id,name:G.name,file:null,url:G.url,status:"saved"}))),[O,E]=h.useState(!1),[T,V]=h.useState([]),[S,b]=h.useState(!1),[x,F]=h.useState(!1);h.useEffect(()=>{const G=requestAnimationFrame(()=>k(!0));return()=>cancelAnimationFrame(G)},[]),h.useEffect(()=>{const G=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",G>0&&(document.body.style.paddingRight=`${G}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[]),h.useEffect(()=>{const G=Y=>{Y.key==="Escape"&&!z&&!S&&!x&&se()};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)});const $=N.filter(G=>G.status==="pending"||G.status==="saved"||G.status==="uploading").length,D=l!==1/0&&$>=l,B=S||D,X=N.some(G=>G.status==="pending")||N.some(G=>G.status==="deleted"&&G.url),U=Rf(c),L=h.useCallback(()=>{if(g&&typeof g=="object")return g;if(!wa.getApps().length)throw new Error("Firebase no está inicializado. Inicializa la app o pasa firebaseStorage como prop.");return yt.getStorage()},[g]),j=h.useCallback(G=>{if(B)return;const Y=[];let ce=l===1/0?1/0:l-$;const K=new Set(N.filter(H=>H.status==="pending"||H.status==="saved"||H.status==="uploading").map(H=>H.name.toLowerCase()));for(const H of G){const de=H.name.split(".").pop()?.toLowerCase()??"",te=H.size>u*1024*1024,pe=c.length>0&&!c.includes(de),Ye=K.has(H.name.toLowerCase());te?Y.push({id:Xo(),name:H.name,file:H,status:"error",error:"too-large",entering:!0}):pe?Y.push({id:Xo(),name:H.name,file:H,status:"error",error:"invalid-type",entering:!0}):Ye?Y.push({id:Xo(),name:H.name,file:H,status:"error",error:"duplicate",entering:!0}):ce>0&&(Y.push({id:Xo(),name:H.name,file:H,status:"pending",entering:!0}),ce!==1/0&&ce--)}if(!Y.length)return;const q=Y.map(H=>H.id);P(H=>[...H,...Y]),setTimeout(()=>{P(H=>H.map(de=>q.includes(de.id)?{...de,entering:!1}:de))},400)},[B,l,$,u,c,N]),W=G=>{if(G.preventDefault(),B)return;v.current++,E(!0);const Y=[];if(G.dataTransfer.items)for(let ce=0;ce<Math.min(G.dataTransfer.items.length,4);ce++){const K=G.dataTransfer.items[ce];if(K.kind==="file"){const q=Jf[K.type];q&&!Y.includes(q)&&Y.push(q)}}V(Y)},ie=G=>{G.preventDefault()},re=G=>{G.preventDefault(),v.current--,v.current<=0&&(v.current=0,E(!1),V([]))},ae=G=>{G.preventDefault(),v.current=0,E(!1),V([]),!B&&j(Array.from(G.dataTransfer.files))},me=G=>{j(Array.from(G.target.files??[])),G.target.value=""},ee=h.useCallback(G=>{P(Y=>{const ce=Y.find(K=>K.id===G);if(!ce)return Y;if(ce.status==="error"||ce.status==="pending"){const K=Y.map(q=>q.id===G?{...q,saliendo:!0}:q);return setTimeout(()=>P(q=>q.filter(H=>H.id!==G)),t1),K}return Y.map(K=>K.id===G?{...K,status:"deleted",prevStatus:K.status}:K)})},[]),fe=h.useCallback(G=>{P(Y=>Y.map(ce=>ce.id===G?{...ce,status:ce.prevStatus??"saved",restaurando:!0}:ce)),setTimeout(()=>{P(Y=>Y.map(ce=>ce.id===G?{...ce,restaurando:!1}:ce))},600)},[]),R=h.useCallback(G=>{P(Y=>Y.map(ce=>ce.id===G?{...ce,status:"pending",error:void 0}:ce))},[]),se=h.useCallback(()=>{z||S||(A(!0),k(!1),setTimeout(e,450))},[z,S,e]),_e=h.useCallback(async()=>{F(!1),b(!0);const G=N.filter(te=>te.status==="pending"&&te.file),Y=N.filter(te=>te.status==="deleted"&&te.url);P(te=>te.map(pe=>pe.status==="pending"?{...pe,status:"uploading"}:pe));const ce=L(),K=N.filter(te=>te.status==="saved").map(te=>({id:te.id,name:te.name,url:te.url})),q=[];for(const te of G){const pe=s?s(te.file):te.file.name,Ye=yt.ref(ce,`${n}/${pe}`);try{await yt.uploadBytes(Ye,te.file);const Oe=await yt.getDownloadURL(Ye);P(Ae=>Ae.map(Ne=>Ne.id===te.id?{...Ne,status:"saved",url:Oe}:Ne)),q.push({id:te.id,name:te.file.name,url:Oe})}catch(Oe){f?.(Oe instanceof Error?Oe:new Error(String(Oe))),P(Ae=>Ae.map(Ne=>Ne.id===te.id?{...Ne,status:"error",error:"network"}:Ne))}}const H=new Set(Y.map(te=>te.id));for(const te of Y)try{await yt.deleteObject(yt.ref(ce,te.url))}catch(pe){pe?.code!=="storage/object-not-found"&&f?.(pe instanceof Error?pe:new Error(String(pe)))}b(!1),P(te=>te.filter(pe=>pe.status!=="deleted"));const de=[...K.filter(te=>!H.has(te.id)),...q];t(de),d?.(de),se()},[N,n,s,L,f,t,d,se]),Se=()=>{!X||S||(_?F(!0):_e())},ge=G=>{G.target===G.currentTarget&&!S&&se()},le=[Q.zona_carga,O&&Q.zona_carga_activa,(S||D)&&Q.zona_carga_deshabilitada].filter(Boolean).join(" "),he=c.map(G=>G.toUpperCase());return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${Q.backdrop} ${C&&!z?Q.visible:""}`,onClick:ge,children:[r.jsxs("div",{className:`${Q.modal} ${C&&!z?Q.visible:""}`,role:"dialog","aria-modal":"true","aria-labelledby":w,children:[r.jsxs("header",{className:Q.encabezado,children:[r.jsxs("div",{className:Q.encabezado_textos,children:[r.jsx("h2",{id:w,className:Q.titulo,children:o}),a&&r.jsx("p",{className:Q.subtitulo,children:a})]}),r.jsxs("button",{className:Q.boton_cerrar,onClick:se,type:"button","aria-label":"Cerrar",disabled:S,children:[r.jsx("span",{className:Q.texto_esc,children:"ESC"}),r.jsx(ol,{size:16})]})]}),r.jsxs("div",{className:Q.cuerpo,children:[r.jsxs("div",{className:le,"aria-label":"Zona para arrastrar archivos",onDragEnter:W,onDragOver:ie,onDragLeave:re,onDrop:ae,children:[r.jsxs("div",{className:Q.zona_contenido,children:[r.jsx("div",{className:Q.zona_icono_flotante,"aria-hidden":"true",children:r.jsx(nl,{size:52})}),r.jsxs("div",{className:Q.zona_textos,children:[r.jsx("p",{className:Q.zona_titulo,children:"Arrastra archivos aquí"}),r.jsx("span",{className:Q.zona_separador,children:"o"}),r.jsxs("button",{className:Q.boton_elegir,type:"button",disabled:S,onClick:G=>{G.stopPropagation(),p.current?.click()},children:[r.jsx(Wf,{size:16}),"Elegir archivos"]})]}),r.jsxs("div",{className:Q.zona_meta,children:[r.jsxs("div",{className:Q.tipos_permitidos,children:[r.jsx("span",{className:Q.zona_meta_label,children:"Permitido:"}),he.map(G=>r.jsx("span",{className:Q.tipo_chip,children:G},G))]}),r.jsx("span",{className:Q.zona_meta_sep,children:"|"}),r.jsxs("span",{className:Q.zona_meta_tam,children:["Máx. ",u," MB"]}),l!==1/0&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:Q.zona_meta_sep,children:"|"}),r.jsxs("span",{className:Q.contador,children:[r.jsx("strong",{children:$}),"/",l]})]})]})]}),O&&r.jsxs("div",{className:Q.zona_arrastrando,children:[r.jsxs("div",{className:Q.drag_icon_wrap,"aria-hidden":"true",children:[r.jsx("span",{className:Q.drag_ring}),r.jsx("span",{className:`${Q.drag_ring} ${Q.drag_ring_2}`}),r.jsx("span",{className:`${Q.drag_ring} ${Q.drag_ring_3}`}),r.jsx("span",{className:Q.drag_icono,children:r.jsx(nl,{size:28})})]}),r.jsxs("div",{className:Q.drag_textos,children:[r.jsx("p",{className:Q.drag_titulo,children:"Suelta para agregar"}),r.jsx("p",{className:Q.drag_subtitulo,children:"Los archivos se agregarán a la lista"})]}),T.length>0&&r.jsx("div",{className:Q.drag_chips,children:T.map((G,Y)=>r.jsx("span",{className:Q.drag_chip,style:{"--chip-color":Qf[G]??"#94a3b8","--chip-delay":`${Y*60}ms`},children:G},G))})]})]}),D&&r.jsxs("div",{className:Q.banner_limite,role:"status",children:[r.jsx("span",{className:Q.banner_limite_icono,children:r.jsx(rl,{size:20})}),r.jsxs("div",{className:Q.banner_limite_cuerpo,children:[r.jsx("span",{className:Q.banner_limite_titulo,children:"Límite alcanzado"}),r.jsx("span",{className:Q.banner_limite_desc,children:"Elimina un archivo para poder agregar otro"})]}),r.jsxs("span",{className:Q.banner_limite_pill,children:[$,"/",l]})]}),r.jsxs("div",{className:Q.seccion_lista,children:[N.length>0&&r.jsx("div",{className:Q.cabecera_lista,children:r.jsx("span",{className:Q.cabecera_titulo,children:"Archivos"})}),N.length===0?r.jsxs("div",{className:Q.lista_vacia,children:[r.jsx(il,{className:Q.ilustracion_vacia}),r.jsx("span",{className:Q.lista_vacia_titulo,children:"Aún no hay archivos"}),r.jsx("span",{className:Q.lista_vacia_desc,children:"Arrastra o elige archivos para comenzar"})]}):r.jsx("ul",{className:Q.lista,children:N.map(G=>r.jsx(r1,{archivo:G,subiendo:S,alEliminar:ee,alRestaurar:fe,alReintentar:R,disableDeleteSaved:m},G.id))})]})]}),r.jsxs("footer",{className:Q.pie,children:[r.jsx("span",{className:Q.pie_info,children:l===1/0?`${$} archivo${$!==1?"s":""}`:`${$} de ${l} archivos`}),r.jsx(Ze,{variant:"light-active",color:"primary",size:"sm",radius:"lg",className:Q.btn_pie,onClick:Se,isDisabled:!X,isLoading:S,children:S?"Actualizando…":"Actualizar archivos"})]})]}),r.jsx("input",{ref:p,type:"file",multiple:!0,accept:U,className:Q.input_archivo,onChange:me,"aria-hidden":"true",tabIndex:-1})]}),_&&r.jsx(Xn,{isOpen:x,tipo:"advertencia",titulo:_.title,mensaje:_.message,textoConfirmar:_.confirmText??"Confirmar",loadingConfirmar:S,onConfirmar:_e,onCancelar:()=>F(!1)})]})}const $e={backdrop:"_backdrop_165ct_1",visible:"_visible_165ct_41",modal:"_modal_165ct_65",encabezado:"_encabezado_165ct_147",encabezado_textos:"_encabezado_textos_165ct_163",titulo:"_titulo_165ct_177",subtitulo:"_subtitulo_165ct_191",boton_cerrar:"_boton_cerrar_165ct_203",texto_esc:"_texto_esc_165ct_253",btn_volver:"_btn_volver_165ct_269",preview_nombre_header:"_preview_nombre_header_165ct_323",cuerpo_deslizante:"_cuerpo_deslizante_165ct_351",panel_lista:"_panel_lista_165ct_369",panel_oculto:"_panel_oculto_165ct_395",panel_preview:"_panel_preview_165ct_407",panel_visible:"_panel_visible_165ct_429",preview_contenido:"_preview_contenido_165ct_441",preview_imagen:"_preview_imagen_165ct_465",preview_imagen_cargando:"_preview_imagen_cargando_165ct_483",preview_loader:"_preview_loader_165ct_491",spinner_preview:"_spinner_preview_165ct_511",preview_iframe:"_preview_iframe_165ct_529",preview_placeholder:"_preview_placeholder_165ct_545",cabecera_lista:"_cabecera_lista_165ct_579",cabecera_titulo:"_cabecera_titulo_165ct_593",cabecera_etiqueta:"_cabecera_etiqueta_165ct_607",lista_vacia:"_lista_vacia_165ct_617",ilustracion_vacia:"_ilustracion_vacia_165ct_635",lista_vacia_titulo:"_lista_vacia_titulo_165ct_647",lista_vacia_desc:"_lista_vacia_desc_165ct_659",lista:"_lista_165ct_617",fila:"_fila_165ct_691",fila_icono:"_fila_icono_165ct_731",fila_cuerpo:"_fila_cuerpo_165ct_743",fila_nombre:"_fila_nombre_165ct_757",fila_acciones:"_fila_acciones_165ct_775",btn_accion:"_btn_accion_165ct_789",btn_descargado:"_btn_descargado_165ct_849",spinner:"_spinner_165ct_511",pie:"_pie_165ct_907",pie_info:"_pie_info_165ct_925"},l1={jpg:"image",jpeg:"image",png:"image",webp:"image",gif:"image",avif:"image",pdf:"pdf",xls:"excel",xlsx:"excel",csv:"excel",rar:"archive",zip:"archive","7z":"archive",tar:"archive"};function sl(e){const n=e.split(".").pop()?.toLowerCase()??"";return l1[n]??"generic"}const c1=["image","pdf"];async function ll(e,n){try{const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new Error("fetch failed");const o=await t.blob(),a=URL.createObjectURL(o),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(()=>URL.revokeObjectURL(a),100)}catch{window.open(e,"_blank","noopener,noreferrer")}}function d1({archivo:e,estadoDescarga:n,alDescargar:t,alPrevisualizar:o}){const a=sl(e.name),i=c1.includes(a),s=n==="done",l=n==="downloading";return r.jsxs("li",{className:$e.fila,children:[r.jsx("span",{className:$e.fila_icono,children:r.jsx(Jn,{nombre:e.name,size:30})}),r.jsx("div",{className:$e.fila_cuerpo,children:r.jsx("span",{className:$e.fila_nombre,title:e.name,children:e.name})}),r.jsxs("div",{className:$e.fila_acciones,children:[i&&r.jsx("button",{className:$e.btn_accion,"aria-label":`Ver ${e.name}`,title:"Vista previa",onClick:()=>o(e),children:r.jsx(Xf,{size:18})}),r.jsx("button",{className:`${$e.btn_accion} ${s?$e.btn_descargado:""}`,"aria-label":`Descargar ${e.name}`,title:s?"Descargado":"Descargar",disabled:l,onClick:()=>t(e),children:l?r.jsx("span",{className:$e.spinner,"aria-hidden":"true"}):s?r.jsx(Uf,{size:18}):r.jsx(al,{size:18})})]})]})}function u1({files:e,title:n="Archivos adjuntos",subtitle:t,onClose:o,className:a}){const s=`${h.useId()}-titulo`,[l,c]=h.useState(!1),[u,_]=h.useState(!1),[g,f]=h.useState({}),[d,m]=h.useState(!1),[p,v]=h.useState(null),[y,w]=h.useState(!1),[C,k]=h.useState(!1);h.useEffect(()=>{const x=requestAnimationFrame(()=>c(!0));return()=>cancelAnimationFrame(x)},[]),h.useEffect(()=>{if(!o)return;const x=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",x>0&&(document.body.style.paddingRight=`${x}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[o]);const z=h.useCallback(()=>{u||(_(!0),c(!1),setTimeout(()=>o?.(),450))},[u,o]);h.useEffect(()=>{if(!o)return;const x=F=>{F.key==="Escape"&&(p?(v(null),w(!1)):z())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[o,p,z]);const A=h.useCallback(async x=>{f(F=>({...F,[x.id]:"downloading"})),await ll(x.url,x.name),f(F=>({...F,[x.id]:"done"})),setTimeout(()=>{f(F=>{const I={...F};return delete I[x.id],I})},2e3)},[]),N=async()=>{if(!(d||!e.length)){m(!0);for(const x of e)await ll(x.url,x.name);m(!1)}},P=x=>{w(!1),k(!0),v(x)},O=()=>{v(null),w(!1),k(!1)},E=t??`${e.length} archivo${e.length!==1?"s":""}`,T=p?sl(p.name):null,V=T==="image",S=T==="pdf",b=r.jsxs("div",{className:`${$e.modal} ${l&&!u?$e.visible:""}`,role:"dialog","aria-modal":"true","aria-labelledby":s,children:[r.jsx("header",{className:$e.encabezado,children:p?r.jsxs(r.Fragment,{children:[r.jsxs("button",{className:$e.btn_volver,onClick:O,type:"button","aria-label":"Volver a la lista",children:[r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r.jsx("path",{d:"M19 12H5M12 5l-7 7 7 7"})}),"Volver"]}),r.jsx("span",{className:$e.preview_nombre_header,title:p.name,children:p.name})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:$e.encabezado_textos,children:[r.jsx("h2",{id:s,className:$e.titulo,children:n}),r.jsx("p",{className:$e.subtitulo,children:E})]}),o&&r.jsxs("button",{className:$e.boton_cerrar,onClick:z,type:"button","aria-label":"Cerrar",children:[r.jsx("span",{className:$e.texto_esc,children:"ESC"}),r.jsx(ol,{size:16})]})]})}),r.jsxs("div",{className:$e.cuerpo_deslizante,children:[r.jsxs("div",{className:`${$e.panel_lista} ${p?$e.panel_oculto:""}`,inert:p?"":void 0,children:[r.jsxs("div",{className:$e.cabecera_lista,children:[r.jsx("span",{className:$e.cabecera_titulo,children:"Documentos"}),r.jsx("span",{className:$e.cabecera_etiqueta,children:"Solo lectura"})]}),e.length===0?r.jsxs("div",{className:$e.lista_vacia,children:[r.jsx(il,{className:$e.ilustracion_vacia}),r.jsx("span",{className:$e.lista_vacia_titulo,children:"Sin archivos adjuntos"}),r.jsx("span",{className:$e.lista_vacia_desc,children:"Este registro no tiene documentos por el momento"})]}):r.jsx("ul",{className:$e.lista,children:e.map(x=>r.jsx(d1,{archivo:x,estadoDescarga:g[x.id]??"idle",alDescargar:A,alPrevisualizar:P},x.id))})]}),r.jsx("div",{className:`${$e.panel_preview} ${p?$e.panel_visible:""}`,inert:p?void 0:"",children:p&&r.jsx("div",{className:$e.preview_contenido,children:V&&!y?r.jsxs(r.Fragment,{children:[C&&r.jsx("div",{className:$e.preview_loader,"aria-hidden":"true",children:r.jsxs("svg",{className:$e.spinner_preview,viewBox:"0 0 44 44",fill:"none",role:"presentation",children:[r.jsx("circle",{cx:"22",cy:"22",r:"17",stroke:"currentColor",strokeWidth:"2.5",opacity:"0.1"}),r.jsx("circle",{cx:"22",cy:"22",r:"17",stroke:"var(--brand-primary, #407bff)",strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"32 75",strokeDashoffset:"0"})]})}),r.jsx("img",{src:p.url,alt:p.name,className:`${$e.preview_imagen} ${C?$e.preview_imagen_cargando:""}`,onLoad:()=>k(!1),onError:()=>{k(!1),w(!0)}})]}):y?r.jsxs("div",{className:$e.preview_placeholder,children:[r.jsx(Jn,{nombre:p.name,size:64}),r.jsx("p",{children:"No se pudo cargar la imagen"}),r.jsx("code",{children:p.name})]}):S?r.jsx("object",{data:p.url,type:"application/pdf",className:$e.preview_iframe,"aria-label":p.name,children:r.jsxs("div",{className:$e.preview_placeholder,children:[r.jsx(Jn,{nombre:p.name,size:64}),r.jsx("p",{children:"No se puede mostrar el PDF en este navegador"}),r.jsx("code",{children:p.name})]})}):r.jsxs("div",{className:$e.preview_placeholder,children:[r.jsx(Jn,{nombre:p.name,size:64}),r.jsx("p",{children:"Vista previa no disponible"}),r.jsx("code",{children:p.name})]})})})]}),r.jsxs("footer",{className:$e.pie,children:[p?r.jsx("span",{className:$e.pie_info,children:"Vista previa"}):r.jsxs("span",{className:$e.pie_info,children:[e.length," archivo",e.length!==1?"s":""," disponible",e.length!==1?"s":""]}),r.jsx(Ze,{variant:"light-active",color:"primary",size:"sm",radius:"lg",startContent:r.jsx(al,{size:14}),onClick:p?()=>A(p):N,isDisabled:!p&&!e.length,isLoading:!p&&d,type:"button",children:p?"Descargar":d?"Descargando…":"Descargar todo"})]})]});return o?r.jsx("div",{className:`${$e.backdrop} ${l&&!u?$e.visible:""} ${a??""}`,onClick:x=>{x.target===x.currentTarget&&!p&&z()},children:b}):r.jsx("div",{className:a,children:b})}const Z={backdrop:"_backdrop_1i685_1",visible:"_visible_1i685_37",modal:"_modal_1i685_61",encabezado:"_encabezado_1i685_145",encabezado_textos:"_encabezado_textos_1i685_161",titulo:"_titulo_1i685_177",subtitulo:"_subtitulo_1i685_193",boton_cerrar:"_boton_cerrar_1i685_205",pasos:"_pasos_1i685_253",paso:"_paso_1i685_253",completado:"_completado_1i685_305",paso_circulo:"_paso_circulo_1i685_313",activo:"_activo_1i685_355",paso_etiqueta_grupo:"_paso_etiqueta_grupo_1i685_417",paso_etiqueta:"_paso_etiqueta_1i685_417",divisor:"_divisor_1i685_473",cuerpo:"_cuerpo_1i685_485",zona_idle:"_zona_idle_1i685_505",plantilla_card:"_plantilla_card_1i685_521",plantilla_icono_wrap:"_plantilla_icono_wrap_1i685_583",plantilla_card_texto:"_plantilla_card_texto_1i685_625",plantilla_titulo:"_plantilla_titulo_1i685_641",plantilla_sub:"_plantilla_sub_1i685_655",zona_drop:"_zona_drop_1i685_665",sobre:"_sobre_1i685_731",con_archivo:"_con_archivo_1i685_739",zona_drop_icono_wrap:"_zona_drop_icono_wrap_1i685_787",zona_drop_icono_ok:"_zona_drop_icono_ok_1i685_823",zona_drop_titulo:"_zona_drop_titulo_1i685_861",zona_drop_sub:"_zona_drop_sub_1i685_879",zona_drop_texto:"_zona_drop_texto_1i685_893",zona_drop_pie:"_zona_drop_pie_1i685_907",tipo_chip:"_tipo_chip_1i685_923",filtro_nombre_hint:"_filtro_nombre_hint_1i685_955",archivo_info:"_archivo_info_1i685_967",archivo_nombre:"_archivo_nombre_1i685_983",archivo_tamano:"_archivo_tamano_1i685_1003",zona_procesando:"_zona_procesando_1i685_1013",spinner_wrap:"_spinner_wrap_1i685_1033",spinner_ring:"_spinner_ring_1i685_1041",spinner_icono:"_spinner_icono_1i685_1059",procesando_texto:"_procesando_texto_1i685_1089",procesando_titulo:"_procesando_titulo_1i685_1105",procesando_sub:"_procesando_sub_1i685_1121",barra_progreso_contenedor:"_barra_progreso_contenedor_1i685_1141",barra_progreso:"_barra_progreso_1i685_1141",zona_resultado:"_zona_resultado_1i685_1199",banner:"_banner_1i685_1217",exito:"_exito_1i685_1235",error:"_error_1i685_1247",banner_icono:"_banner_icono_1i685_1259",banner_texto:"_banner_texto_1i685_1267",banner_titulo:"_banner_titulo_1i685_1281",banner_sub:"_banner_sub_1i685_1293",tabs:"_tabs_1i685_1303",tab:"_tab_1i685_1303",tab_badge:"_tab_badge_1i685_1371",tab_badge_ok:"_tab_badge_ok_1i685_1399",tab_panel:"_tab_panel_1i685_1409",preview_panel_wrap:"_preview_panel_wrap_1i685_1425",info_preview:"_info_preview_1i685_1441",tabla_contenedor:"_tabla_contenedor_1i685_1469",tabla:"_tabla_1i685_1469",fila_error:"_fila_error_1i685_1541",celda_fila:"_celda_fila_1i685_1573",celda_estado:"_celda_estado_1i685_1587",chip_valida:"_chip_valida_1i685_1605",chip_error_count:"_chip_error_count_1i685_1625",preview_truncada:"_preview_truncada_1i685_1645",errores_lista:"_errores_lista_1i685_1659",error_item:"_error_item_1i685_1679",error_cabecera:"_error_cabecera_1i685_1711",error_ids:"_error_ids_1i685_1727",error_ids_label:"_error_ids_label_1i685_1745",error_id_chip:"_error_id_chip_1i685_1759",error_sin_id:"_error_sin_id_1i685_1787",error_fila_tag:"_error_fila_tag_1i685_1799",error_detalle:"_error_detalle_1i685_1821",error_linea:"_error_linea_1i685_1835",error_campo_nombre:"_error_campo_nombre_1i685_1859",error_campo_msg:"_error_campo_msg_1i685_1873",error_mensajes_lista:"_error_mensajes_lista_1i685_1885",error_mensaje_item:"_error_mensaje_item_1i685_1897",opciones_prefijo:"_opciones_prefijo_1i685_1907",opciones_bloque:"_opciones_bloque_1i685_1915",error_expandir_btn:"_error_expandir_btn_1i685_1937",pie:"_pie_1i685_1971",alerta_inline:"_alerta_inline_1i685_1989",paso_contenido:"_paso_contenido_1i685_2027"};function _1({size:e=48}){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",children:[r.jsx("path",{fill:"currentColor",d:"M6.5 18v-.09c0-.865 0-1.659.087-2.304c.095-.711.32-1.463.938-2.08c.618-.619 1.37-.844 2.08-.94c.646-.086 1.44-.086 2.306-.086h.178c.866 0 1.66 0 2.305.087c.711.095 1.463.32 2.08.938c.619.618.844 1.37.94 2.08c.085.637.086 1.416.086 2.267c2.573-.55 4.5-2.812 4.5-5.52c0-2.47-1.607-4.572-3.845-5.337C17.837 4.194 15.415 2 12.476 2C9.32 2 6.762 4.528 6.762 7.647c0 .69.125 1.35.354 1.962a4.4 4.4 0 0 0-.83-.08C3.919 9.53 2 11.426 2 13.765S3.919 18 6.286 18z",opacity:".5"}),r.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 14c-1.886 0-2.828 0-3.414.586S8 16.114 8 18s0 2.828.586 3.414S10.114 22 12 22s2.828 0 3.414-.586S16 19.886 16 18s0-2.828-.586-3.414S13.886 14 12 14m1.805 3.084l-1.334-1.333a.667.667 0 0 0-.942 0l-1.334 1.333a.667.667 0 1 0 .943.943l.195-.195v1.946a.667.667 0 0 0 1.334 0v-1.946l.195.195a.667.667 0 0 0 .943-.943",clipRule:"evenodd"})]})}function f1({size:e=52}){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:r.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-.99M4 4.735v14.53l10 1.429V3.306zM17 19h3V5h-3V3h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4zm-6.8-7l2.8 4h-2.4L9 13.714L7.4 16H5l2.8-4L5 8h2.4L9 10.286L10.6 8H13z"})})}function p1({size:e=20}){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 23 23",fill:"none","aria-hidden":!0,children:r.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[r.jsx("path",{d:"M17 9.002c2.175.012 3.353.109 4.121.877C22 10.758 22 12.172 22 15v1c0 2.829 0 4.243-.879 5.122C20.243 22 18.828 22 16 22H8c-2.828 0-4.243 0-5.121-.878C2 20.242 2 18.829 2 16v-1c0-2.828 0-4.242.879-5.121c.768-.768 1.946-.865 4.121-.877"}),r.jsx("path",{strokeLinejoin:"round",d:"M12 2v13m0 0l-3-3.5m3 3.5l3-3.5"})]})})}function g1({size:e=16}){return r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:r.jsx("path",{d:"M12 4 4 12M4 4l8 8",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})}function cl({size:e=16}){return r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:r.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function dl({size:e=22}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none","aria-hidden":!0,children:[r.jsx("circle",{cx:"11",cy:"11",r:"10",fill:"currentColor",opacity:".15"}),r.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"currentColor",strokeWidth:"1.5"}),r.jsx("path",{d:"M11 7v4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),r.jsx("circle",{cx:"11",cy:"15",r:"1",fill:"currentColor"})]})}function ul({size:e=14}){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",children:r.jsx("path",{fill:"currentColor",d:"M12 4a8 8 0 1 0 0 16a8 8 0 0 0 0-16M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12m5.793-4.207a1 1 0 0 1 1.414 0L12 10.586l2.793-2.793a1 1 0 1 1 1.414 1.414L13.414 12l2.793 2.793a1 1 0 0 1-1.414 1.414L12 13.414l-2.793 2.793a1 1 0 0 1-1.414-1.414L10.586 12L7.793 9.207a1 1 0 0 1 0-1.414Z"})})}function h1({size:e=14}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,children:[r.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"2",fill:"currentColor",opacity:".1"}),r.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"2",stroke:"currentColor",strokeWidth:"1.2"}),r.jsx("path",{d:"M1 5h12M5 5v8",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function m1({size:e=14}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,children:[r.jsx("path",{d:"M2 7A5 5 0 1 1 7 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),r.jsx("path",{d:"M2 4v3h3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})}function v1({size:e=22}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none","aria-hidden":!0,children:[r.jsx("circle",{cx:"11",cy:"11",r:"10",fill:"currentColor",opacity:".15"}),r.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"currentColor",strokeWidth:"1.5"}),r.jsx("path",{d:"M7 11l2.5 2.5L15 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function b1({size:e=24}){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",children:r.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[r.jsx("path",{strokeDasharray:"2 4",strokeDashoffset:"6",d:"M12 21c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9",children:r.jsx("animate",{attributeName:"stroke-dashoffset",dur:"0.6s",repeatCount:"indefinite",values:"6;0"})}),r.jsx("path",{strokeDasharray:"32",strokeDashoffset:"32",d:"M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9",children:r.jsx("animate",{fill:"freeze",attributeName:"stroke-dashoffset",begin:"0.1s",dur:"0.4s",values:"32;0"})}),r.jsx("path",{strokeDasharray:"10",strokeDashoffset:"10",d:"M12 16v-7.5",children:r.jsx("animate",{fill:"freeze",attributeName:"stroke-dashoffset",begin:"0.5s",dur:"0.2s",values:"10;0"})}),r.jsx("path",{strokeDasharray:"6",strokeDashoffset:"6",d:"M12 8.5l3.5 3.5M12 8.5l-3.5 3.5",children:r.jsx("animate",{fill:"freeze",attributeName:"stroke-dashoffset",begin:"0.7s",dur:"0.2s",values:"6;0"})})]})})}function _l({size:e=22}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none","aria-hidden":!0,children:[r.jsx("path",{d:"M11 3L4 6v5c0 4.418 3.134 8.55 7 9.5 3.866-.95 7-5.082 7-9.5V6l-7-3z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),r.jsx("path",{d:"M8 11l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function w1({size:e=22}){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 32 32",children:[r.jsx("circle",{cx:"26",cy:"26",r:"4",fill:"currentColor"}),r.jsx("path",{fill:"currentColor",d:"M10 13h2v2h-2zm0 5h2v2h-2zm0 5h2v2h-2zm4-10h8v2h-8zm0 5h8v2h-8zm0 5h4v2h-4z"}),r.jsx("path",{fill:"currentColor",d:"M7 28V7h3v3h12V7h3v11h2V7a2 2 0 0 0-2-2h-3V4a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v1H7a2 2 0 0 0-2 2v21a2 2 0 0 0 2 2h11v-2Zm5-24h8v4h-8Z"})]})}let gn=null,Qn=!1;const y1=()=>{if(typeof window>"u"||Qn)return null;if(!gn)try{gn=new Worker(new URL("/assets/excel.worker-CFqewIyg.js",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:or&&or.tagName.toUpperCase()==="SCRIPT"&&or.src||new URL("index.umd.cjs",document.baseURI).href),{type:"module"}),gn.onerror=()=>{gn=null,Qn=!0}}catch{return Qn=!0,null}return gn},C1=e=>{if(e==null)return"";if(typeof e=="string")return e.trim();if(e instanceof Date){const n=String(e.getDate()).padStart(2,"0"),t=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getFullYear());return`${n}/${t}/${o}`}return typeof e=="number"||typeof e=="boolean"?String(e):""},x1=(e,n)=>{const t=mn.read(e,{type:"array",cellDates:!0,dateNF:"dd/mm/yyyy"}),o=t.Sheets[t.SheetNames[0]];return mn.utils.sheet_to_json(o,{defval:"",raw:!1,dateNF:"dd/mm/yyyy",range:n}).filter(i=>Object.values(i).some(s=>s!=="")).map(i=>{const s={};for(const l of Object.keys(i))s[l]=C1(i[l]);return s})},$1=(e,n,t)=>new Promise((o,a)=>{const i=setTimeout(()=>{s(),gn=null,Qn=!0,a(new Error("timeout"))},1e4),s=()=>{clearTimeout(i),e.removeEventListener("message",l),e.removeEventListener("error",c)},l=u=>{s(),u.data.exito?o(u.data.filas):a(new Error(u.data.error))},c=()=>{s(),gn=null,Qn=!0,a(new Error("worker-error"))};e.addEventListener("message",l),e.addEventListener("error",c),e.postMessage({buffer:n,filasOmitir:t},[n])}),fl=(e,n=0)=>new Promise((t,o)=>{const a=new FileReader;a.onerror=()=>o(new Error("No se pudo leer el archivo")),a.onload=async i=>{const s=i.target.result,l=y1();if(l)try{const c=await $1(l,s.slice(0),n);t(c);return}catch{}try{t(x1(s,n))}catch(c){o(c instanceof Error?c:new Error("Error al procesar el archivo"))}},a.readAsArrayBuffer(e)}),pl=[".xlsx",".xls",".csv"];function gl(e){const n=e.name.toLowerCase();return pl.some(t=>n.endsWith(t))?null:`Formato no soportado. Usa: ${pl.join(", ")}`}function hl(e,n){return typeof n=="string"?e.name.toLowerCase().includes(n.toLowerCase())?null:`El archivo debe contener "${n}" en su nombre`:n.test(e.name)?null:"El nombre del archivo no es el esperado"}function S1(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}const Rn=e=>e.trim().toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"");function k1(e){const n={};for(const[t,o]of Object.entries(e))n[Rn(t)]=o;return n}function N1(e,n){const t=e.map((o,a)=>{const i=k1(o),s=[],l={};for(const c of n){const u=Rn(c.columna??c.etiqueta),_=i[u]??"",g=(c.validadores??[]).map(f=>f(_,i)).filter(f=>f!==null);g.length>0&&s.push({fila:a+1,campo:String(c.campo),etiqueta:c.etiqueta,valor:_,mensajes:g});try{l[String(c.campo)]=c.transformar?c.transformar(_):_}catch{l[String(c.campo)]=_}}return{indice:a+1,datos:l,errores:s,valida:s.length===0}});return{filasValidas:t.filter(o=>o.valida).map(o=>o.datos),filasProcesadas:t,totalFilas:t.length,totalErrores:t.reduce((o,a)=>o+a.errores.length,0)}}function E1(e,n="plantilla.xlsx"){const t=mn.utils.aoa_to_sheet([e.map(a=>a.columna??a.etiqueta)]),o=mn.utils.book_new();mn.utils.book_append_sheet(o,t,"Plantilla"),mn.writeFile(o,n)}async function M1(e,n){try{const o=await(await fetch(e)).blob(),a=document.createElement("a");a.href=URL.createObjectURL(o),a.download=n,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(a.href)}catch{window.open(e,"_blank")}}function I1(e,n,t){const o=Object.fromEntries(t.map(a=>[Rn(a.etiqueta),String(a.campo)]));return n.map(a=>{const i=o[Rn(a)]??Rn(a);return String(e[i]??"").trim()}).filter(Boolean)}const F1=[{label:"Subir",Icono:b1},{label:"Validar",Icono:_l},{label:"Resultados",Icono:w1}],z1={idle:0,procesando:1,resultado:2};function L1({campos:e,plantillaUrl:n,plantillaFilename:t,generarPlantilla:o,onGenerarPlantilla:a,archivo:i,arrastrandoSobre:s,inputId:l,filtroNombre:c,onDragOver:u,onDragLeave:_,onDrop:g,onClickZona:f}){const d=n||o||a,m=()=>{a?a():n?M1(n,t):o&&E1(e,t)};return r.jsxs("div",{className:Z.zona_idle,children:[d&&r.jsxs("button",{className:Z.plantilla_card,type:"button",onClick:m,children:[r.jsx("div",{className:Z.plantilla_icono_wrap,children:r.jsx(p1,{size:20})}),r.jsxs("div",{className:Z.plantilla_card_texto,children:[r.jsx("span",{className:Z.plantilla_titulo,children:"Descargar plantilla"}),r.jsx("span",{className:Z.plantilla_sub,children:n?"Descarga la plantilla oficial para llenar":"Genera la plantilla con las columnas esperadas"})]})]}),r.jsxs("div",{className:`${Z.zona_drop} ${s?Z.sobre:""} ${i?Z.con_archivo:""}`,role:"button",tabIndex:0,"aria-label":"Zona para arrastrar o seleccionar archivo Excel",onDragOver:u,onDragLeave:_,onDrop:g,onClick:f,onKeyDown:p=>(p.key==="Enter"||p.key===" ")&&f(),children:[i?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`${Z.zona_drop_icono_wrap} ${Z.zona_drop_icono_ok}`,children:r.jsx(f1,{size:38})}),r.jsxs("div",{className:Z.archivo_info,children:[r.jsx("span",{className:Z.archivo_nombre,children:i.name}),r.jsx("span",{className:Z.archivo_tamano,children:S1(i.size)})]}),r.jsx("p",{className:Z.zona_drop_sub,children:"Haz clic para cambiar el archivo"})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Z.zona_drop_icono_wrap,children:r.jsx(_1,{size:48})}),r.jsxs("div",{className:Z.zona_drop_texto,children:[r.jsx("p",{className:Z.zona_drop_titulo,children:"Arrastra tu archivo aquí"}),r.jsx("p",{className:Z.zona_drop_sub,children:"o haz clic para seleccionar desde tu equipo"})]}),r.jsxs("div",{className:Z.zona_drop_pie,children:[["XLSX","XLS","CSV"].map(p=>r.jsx("span",{className:Z.tipo_chip,children:p},p)),typeof c=="string"&&r.jsxs("span",{className:Z.filtro_nombre_hint,children:["Nombre: ",r.jsx("strong",{children:c})]})]})]}),r.jsx("input",{id:l,type:"file",accept:".xlsx,.xls,.csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv",tabIndex:-1})]})]})}function A1({nombre:e}){return r.jsxs("div",{className:Z.zona_procesando,children:[r.jsxs("div",{className:Z.spinner_wrap,children:[r.jsx("div",{className:Z.spinner_ring,"aria-hidden":!0}),r.jsx("div",{className:Z.spinner_icono,children:r.jsx(_l,{size:18})})]}),r.jsxs("div",{className:Z.procesando_texto,children:[r.jsx("p",{className:Z.procesando_titulo,children:"Validando datos…"}),r.jsx("p",{className:Z.procesando_sub,children:e})]}),r.jsx("div",{className:Z.barra_progreso_contenedor,role:"progressbar","aria-label":"Procesando",children:r.jsx("div",{className:Z.barra_progreso})})]})}function D1({resultado:e,campos:n,identificadores:t}){const[o,a]=h.useState(e.totalErrores>0?"errores":"preview"),i=e.totalErrores>0,s=e.filasProcesadas.filter(l=>!l.valida);return r.jsxs("div",{className:Z.zona_resultado,children:[r.jsxs("div",{className:`${Z.banner} ${i?Z.error:Z.exito}`,children:[r.jsx("div",{className:Z.banner_icono,children:i?r.jsx(dl,{size:22}):r.jsx(v1,{size:22})}),r.jsxs("div",{className:Z.banner_texto,children:[r.jsx("span",{className:Z.banner_titulo,children:i?`${s.length} fila${s.length!==1?"s":""} con errores`:`${e.totalFilas} registro${e.totalFilas!==1?"s":""} ${e.totalFilas!==1?"listos":"listo"} para importar`}),r.jsx("span",{className:Z.banner_sub,children:i?"Corrige los errores en el archivo y vuelve a intentarlo":"Todos los datos pasaron la validación correctamente"})]})]}),r.jsxs("div",{className:Z.tabs,role:"tablist",children:[i&&r.jsxs("button",{role:"tab","aria-selected":o==="errores",className:`${Z.tab} ${o==="errores"?Z.activo:""}`,onClick:()=>a("errores"),children:[r.jsx(ul,{size:15}),"Errores",r.jsx("span",{className:Z.tab_badge,children:s.length})]}),r.jsxs("button",{role:"tab","aria-selected":o==="preview",className:`${Z.tab} ${o==="preview"?Z.activo:""}`,onClick:()=>a("preview"),children:[r.jsx(h1,{size:13}),"Vista previa",r.jsx("span",{className:`${Z.tab_badge} ${Z.tab_badge_ok}`,children:e.filasProcesadas.length})]})]}),o==="errores"?r.jsx("div",{className:`${Z.errores_lista} ${Z.tab_panel}`,role:"tabpanel",children:s.map(l=>r.jsx(T1,{fila:l,campos:n,identificadores:t},l.indice))},"errores"):r.jsxs("div",{className:`${Z.preview_panel_wrap} ${Z.tab_panel}`,role:"tabpanel",children:[r.jsxs("div",{className:Z.info_preview,children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:r.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),"Vista previa — se muestran hasta 200 filas."]}),r.jsx("div",{className:Z.tabla_contenedor,children:r.jsx(O1,{filas:e.filasProcesadas,campos:n})})]},"preview")]})}const ml=100,vl=" — opciones válidas: ",bl=6;function wl({texto:e}){const[n,t]=h.useState(!1),o=e.indexOf(vl);if(o>=0){const a=e.slice(0,o),s=e.slice(o+vl.length).split(", ").map(u=>u.trim()).filter(Boolean),l=n?s:s.slice(0,bl),c=s.length-bl;return r.jsxs("span",{children:[r.jsxs("span",{className:Z.opciones_prefijo,children:[a," — opciones válidas:"]})," ",r.jsxs("span",{className:Z.opciones_bloque,children:[l.join(", "),!n&&c>0&&"…"]}),!n&&c>0&&r.jsxs("button",{className:Z.error_expandir_btn,type:"button",onClick:u=>{u.stopPropagation(),t(!0)},children:["▾ +",c]}),n&&c>0&&r.jsx("button",{className:Z.error_expandir_btn,type:"button",onClick:u=>{u.stopPropagation(),t(!1)},children:"▴ menos"})]})}return e.length<=ml?r.jsx("span",{children:e}):r.jsxs("span",{children:[n?e:`${e.slice(0,ml)}…`,r.jsx("button",{className:Z.error_expandir_btn,type:"button",onClick:a=>{a.stopPropagation(),t(i=>!i)},children:n?" ▴ ver menos":" ▾ ver más"})]})}function P1({err:e}){return r.jsxs("div",{className:Z.error_linea,children:[r.jsx("span",{className:Z.error_campo_nombre,children:e.etiqueta}),r.jsx("span",{className:Z.error_campo_msg,children:e.mensajes.length===1?r.jsx(wl,{texto:e.mensajes[0]}):r.jsx("span",{className:Z.error_mensajes_lista,children:e.mensajes.map((n,t)=>r.jsx("span",{className:Z.error_mensaje_item,children:r.jsx(wl,{texto:n})},t))})})]})}function T1({fila:e,campos:n,identificadores:t}){const o=t.length?I1(e.datos,t,n):[];return r.jsxs("div",{className:Z.error_item,children:[r.jsxs("div",{className:Z.error_cabecera,children:[o.length>0?r.jsxs("div",{className:Z.error_ids,children:[r.jsx("span",{className:Z.error_ids_label,children:"Identificador:"}),o.map((a,i)=>r.jsx("span",{className:Z.error_id_chip,children:a},i))]}):r.jsx("span",{className:Z.error_sin_id,children:"Sin identificador"}),r.jsxs("span",{className:Z.error_fila_tag,children:["Fila ",e.indice]})]}),r.jsx("div",{className:Z.error_detalle,children:e.errores.map((a,i)=>r.jsx(P1,{err:a},i))})]})}const va=200;function O1({filas:e,campos:n}){const t=e.slice(0,va),o=e.length>va;return r.jsxs("table",{className:Z.tabla,children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:Z.celda_fila,children:"#"}),n.map(a=>r.jsx("th",{children:a.etiqueta},String(a.campo))),r.jsx("th",{className:Z.celda_estado,children:"Estado"})]})}),r.jsxs("tbody",{children:[t.map(a=>r.jsxs("tr",{className:a.valida?"":Z.fila_error,children:[r.jsx("td",{className:Z.celda_fila,children:a.indice}),n.map(i=>r.jsx("td",{children:String(a.datos[String(i.campo)]??"")},String(i.campo))),r.jsx("td",{className:Z.celda_estado,children:a.valida?r.jsx("span",{className:Z.chip_valida,children:"✓ Válida"}):r.jsxs("span",{className:Z.chip_error_count,children:[a.errores.length," error",a.errores.length!==1?"es":""]})})]},a.indice)),o&&r.jsx("tr",{children:r.jsxs("td",{colSpan:n.length+2,className:Z.preview_truncada,children:["Se muestran ",va," de ",e.length," filas totales"]})})]})]})}function V1({campos:e,onImportar:n,onClose:t,title:o="Importar archivo Excel",subtitle:a,plantillaUrl:i,plantillaFilename:s="plantilla.xlsx",generarPlantilla:l,onGenerarPlantilla:c,rutaStorage:u,filasOmitir:_=0,identificadores:g=[],maxFilas:f,filtroNombre:d,confirmacion:m}){const[p,v]=h.useState(!1),[y,w]=h.useState("idle"),[C,k]=h.useState(null),[z,A]=h.useState(!1),[N,P]=h.useState(null),[O,E]=h.useState(null),[T,V]=h.useState(!1),[S,b]=h.useState(!1),[x,F]=h.useState(null),I=h.useRef(null),$=h.useRef(0),D=h.useId();h.useEffect(()=>{const ee=requestAnimationFrame(()=>v(!0));return()=>cancelAnimationFrame(ee)},[]),h.useEffect(()=>{const ee=fe=>{fe.key==="Escape"&&B()};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[]),h.useEffect(()=>{const ee=document.getElementById(D);ee&&(I.current=ee,ee.onchange=fe=>{const R=fe.target.files?.[0];if(!R)return;const se=gl(R)??(d?hl(R,d):null);if(se){E(se),ee.value="";return}E(null),k(R),ee.value=""})},[D,d]);const B=h.useCallback(()=>{v(!1),setTimeout(t,380)},[t]),X=h.useCallback(async ee=>{k(ee),w("procesando"),E(null);try{const fe=await fl(ee,_),R=f?fe.slice(0,f):fe,se=N1(R,e);if(se.totalFilas===0){E("El archivo no contiene datos. Verifica que tenga filas con información debajo del encabezado."),k(null),w("idle");return}P(se),w("resultado")}catch(fe){E(fe instanceof Error?fe.message:"Error al procesar el archivo"),w("idle")}},[e,_,f]),U=h.useCallback(ee=>{ee.preventDefault(),$.current+=1,A(!0)},[]),L=h.useCallback(ee=>{ee.preventDefault(),$.current-=1,$.current<=0&&($.current=0,A(!1))},[]),j=h.useCallback(ee=>{ee.preventDefault(),$.current=0,A(!1);const fe=ee.dataTransfer.files[0];if(!fe)return;const R=gl(fe)??(d?hl(fe,d):null);if(R){E(R);return}E(null),k(fe)},[d]),W=h.useCallback(()=>{k(null),P(null),E(null),w("idle")},[]),ie=h.useCallback(async()=>{if(!(!N||!C)){if(u){V(!0);try{const{getStorage:ee,ref:fe,uploadBytesResumable:R}=await import("firebase/storage"),se=ee(),_e=C.name.slice(C.name.lastIndexOf("."))||".xlsx",Se=C.name.replace(/\.[^.]+$/,""),ge=fe(se,`${u}/${Se}_${Date.now()}${_e}`);await new Promise((le,he)=>{R(ge,C).on("state_changed",null,he,le)})}catch(ee){F(ee instanceof Error?ee.message:"Error desconocido"),V(!1);return}V(!1)}n(N.filasValidas,C),B()}},[N,C,u,n,B]),re=N!=null&&N.totalErrores===0&&N.totalFilas>0,ae=z1[y],me=T?"Subiendo…":"Subir Excel";return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`${Z.backdrop} ${p?Z.visible:""}`,role:"dialog","aria-modal":!0,"aria-label":o,children:r.jsxs("div",{className:`${Z.modal} ${p?Z.visible:""}`,children:[r.jsxs("div",{className:Z.encabezado,children:[r.jsxs("div",{className:Z.encabezado_textos,children:[r.jsx("h2",{className:Z.titulo,children:o}),a&&r.jsx("p",{className:Z.subtitulo,children:a})]}),r.jsx("button",{className:Z.boton_cerrar,"aria-label":"Cerrar",onClick:B,type:"button",children:r.jsx(g1,{size:14})})]}),r.jsx("div",{className:Z.pasos,"aria-label":"Pasos del proceso",children:F1.map(({label:ee,Icono:fe},R)=>{const se=R===ae,_e=R<ae;return r.jsxs("div",{className:`${Z.paso} ${se?Z.activo:""} ${_e?Z.completado:""}`,children:[r.jsx("div",{className:Z.paso_circulo,"aria-hidden":!0,children:_e?r.jsx(cl,{size:15}):r.jsx(fe,{size:22})}),r.jsx("div",{className:Z.paso_etiqueta_grupo,children:r.jsx("span",{className:Z.paso_etiqueta,children:ee})})]},ee)})}),r.jsx("hr",{className:Z.divisor}),r.jsx("div",{className:Z.cuerpo,style:{paddingTop:"1rem",paddingBottom:"0.5rem"},children:r.jsxs("div",{className:Z.paso_contenido,children:[y==="idle"&&r.jsx(L1,{campos:e,plantillaUrl:i,plantillaFilename:s,generarPlantilla:l,onGenerarPlantilla:c,archivo:C,arrastrandoSobre:z,inputId:D,filtroNombre:d,onDragOver:U,onDragLeave:L,onDrop:j,onClickZona:()=>I.current?.click()}),y==="procesando"&&r.jsx(A1,{nombre:C?.name??""}),y==="resultado"&&N&&r.jsx(D1,{resultado:N,campos:e,identificadores:g})]},y)}),r.jsxs("div",{className:Z.pie,children:[O&&r.jsxs("div",{className:Z.alerta_inline,role:"alert",children:[r.jsx(dl,{size:16}),r.jsx("span",{children:O})]}),y==="idle"&&r.jsx(Ze,{variant:"solid",color:"primary",size:"sm",isDisabled:!C,onClick:()=>C&&X(C),children:"Validar archivo"}),y==="resultado"&&N&&r.jsxs(r.Fragment,{children:[N.totalErrores>0&&r.jsx(Ze,{variant:"outline",color:"default",size:"sm",startContent:r.jsx(m1,{size:16}),isDisabled:T,onClick:W,children:"Reintentar"}),re&&r.jsx(Ze,{variant:"solid",color:"primary",size:"sm",startContent:T?void 0:r.jsx(cl,{size:13}),isDisabled:T,onClick:()=>m?b(!0):void ie(),children:me})]})]})]})}),m&&r.jsx(Xn,{isOpen:S,tipo:"advertencia",titulo:m.titulo??"Confirmar importación",mensaje:m.mensaje??"¿Deseas continuar con la importación?",descripcion:m.descripcion,textoConfirmar:"Sí, importar",textoCancelar:"Revisar",onConfirmar:()=>{b(!1),ie()},onCancelar:()=>b(!1)}),x!==null&&r.jsx(Xn,{isOpen:!0,tipo:"eliminar",icono:r.jsx(ul,{size:22}),titulo:"No se pudo subir el archivo",mensaje:"Ocurrió un error al guardar el archivo en el servidor.",descripcion:x,textoConfirmar:"Reintentar",textoCancelar:"Cancelar",onConfirmar:()=>{F(null),ie()},onCancelar:()=>F(null)})]})}const Yo=e=>e.trim().toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,""),B1=(e,n)=>{const t=Yo(n);return Object.entries(e).find(([a])=>Yo(a)===t)?.[1]??""},j1=e=>(n,t)=>n?.trim()?null:e??"Este campo es requerido",q1=(e,n)=>(t,o)=>{const a=t?.trim();return e.includes(a)?null:n??`Valor no válido — opciones válidas: ${e.join(", ")}`},H1=(e,n)=>(t,o)=>{const a=Yo(t??"");return e.map(Yo).includes(a)?null:n??`Valor no válido — opciones válidas: ${e.join(", ")}`},W1=e=>(n,t)=>{const o=n?.trim();return o&&isNaN(Number(o))?e??"Debe ser un número":null},G1=e=>(n,t)=>{const o=n?.trim();return o&&!Number.isInteger(Number(o))?e??"Debe ser un número entero":null},Z1=e=>Jo(/^\d+$/,e??"Solo se permiten dígitos"),U1=(e,n)=>(t,o)=>(t?.trim()??"").length>e?n??`No puede superar ${e} caracteres`:null,K1=(e,n)=>(t,o)=>{const a=t?.trim()??"";return a.length>0&&a.length<e?n??`Debe tener al menos ${e} caracteres`:null},Jo=(e,n)=>(t,o)=>{const a=t?.trim();return a&&!e.test(a)?n??"Formato inválido":null},X1=e=>Jo(/^[^\s@]+@[^\s@]+\.[^\s@]+$/,e??"Correo electrónico inválido"),Y1=e=>Jo(/^[a-zA-ZÀ-ÿñÑ\s]+$/,e??"Solo se permiten letras"),J1=(e,n,t)=>(o,a)=>{const i=o?.trim();if(!i)return null;const s=Number(i);return isNaN(s)?"Debe ser un número":s<e||s>n?t??`Debe estar entre ${e} y ${n}`:null},In=e=>{const n=e?.trim();if(!n)return null;const t=n.match(/^(\d{1,2})[/-](\d{1,2})[/-](\d{4})$/);if(t){const i=new Date(Number(t[3]),Number(t[2])-1,Number(t[1]));if(!isNaN(i.getTime()))return i}const o=n.match(/^(\d{4})[/-](\d{1,2})[/-](\d{1,2})$/);if(o){const i=new Date(Number(o[1]),Number(o[2])-1,Number(o[3]));if(!isNaN(i.getTime()))return i}const a=new Date(n);return isNaN(a.getTime())?null:a},Q1=e=>(n,t)=>{const o=n?.trim();return o&&In(o)===null?e??"Fecha inválida":null},R1=e=>(n,t)=>{const o=n?.trim();if(!o)return null;const a=In(o);return a&&a>new Date?e??"La fecha no puede ser futura":null},ep=(e=18,n)=>(t,o)=>{const a=t?.trim();if(!a)return null;const i=In(a);if(!i)return null;const s=new Date;return s.getFullYear()-i.getFullYear()-(s<new Date(s.getFullYear(),i.getMonth(),i.getDate())?1:0)<e?n??`La edad mínima es ${e} años`:null},tp=(e,n)=>(t,o)=>{const a=t?.trim();if(!a)return null;const i=In(a);if(!i)return null;const s=B1(o,e);if(!s)return null;const l=In(s);return l&&i<=l?n??`Debe ser posterior a "${e}"`:null},np=(e,n,t)=>(o,a)=>{const i=o?.trim();if(!i)return null;const s=In(i);if(!s)return null;const l=s.getFullYear();return l<e||l>n?t??`El año debe estar entre ${e} y ${n}`:null},op=(...e)=>(n,t)=>{for(const o of e){const a=o(n,t);if(a!==null)return a}return null};J.Badge=$a,J.BadgeVoz=ur,J.Boton=Ze,J.Checkbox=En,J.CheckboxGroup=Ms,J.ContextMenu=Ys,J.Drawer=Ws,J.DropdownContext=pa,J.DropdownMenu=Ko,J.ExcelImport=V1,J.FileStage=s1,J.FileViewer=u1,J.GrabacionIcono=Pa,J.GroupButton=Of,J.IconoCerrar=Js,J.IconoDerecha=tl,J.IconoFiltroAplicar=Qs,J.IconoFiltroLimpiar=Rs,J.IconoIzquierda=el,J.InputDate=Da,J.InputNumeric=Aa,J.InputText=Ma,J.MenuItem=ha,J.MenuList=Uo,J.MicrofonoIcono=cr,J.Modal=fa,J.ModalAviso=Xn,J.ModalStack=Lf,J.PanelFiltros=Bf,J.Radio=_a,J.RadioGroup=Hs,J.Select=gs,J.Signature=Ea,J.SonidoIcono=dr,J.Submenu=ma,J.TablaDatos=$f,J.TextArea=Oa,J.Toggle=ir,J.Tooltip=_n,J.Transicion=oo,J.anioEnRango=np,J.combinar=op,J.correoElectronico=X1,J.edadMinima=ep,J.esCheckbox=Gs,J.esEntero=G1,J.esFechaValida=Q1,J.esLabel=Ks,J.esNumero=W1,J.esRadio=Zs,J.esSeparador=Us,J.expresionRegular=Jo,J.fechaEnRango=ec,J.fechaPosteriorA=tp,J.formatearFecha=lr,J.formatearNumero=zn,J.generarOpcionesAleatorias=Iu,J.generarUsuariosPrueba=Fu,J.leerArchivoExcel=fl,J.longitudMaxima=U1,J.longitudMinima=K1,J.noFechaFutura=R1,J.obtenerFechaHoy=Rl,J.parsearNumero=Ia,J.procesarValidacion=Fa,J.rangoNumerico=J1,J.redondearDecimales=za,J.requerido=j1,J.restringirRango=sr,J.soloLetras=Y1,J.soloNumeros=Z1,J.tieneHijos=Yn,J.unoDeLosSiguientes=q1,J.unoDeLosSiguientesNormalizado=H1,J.useCheckboxGroupContext=Es,J.useDropdownContext=ga,J.useReconocimientoVoz=Ta,J.useTablaContext=D_,J.useTablaContextSafe=tn,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})}));
|
|
29
29
|
//# sourceMappingURL=index.umd.cjs.map
|