corekit-ui 0.1.5 → 0.1.9
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/LICENSE +1 -1
- package/README.md +8 -8
- package/dist/corekit-ui.css +1 -0
- package/dist/index.d.ts +2866 -60
- package/dist/index.js +9202 -826
- package/dist/index.umd.cjs +28 -3
- package/package.json +120 -132
- package/dist/index.js.map +0 -1
- package/dist/index.umd.cjs.map +0 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(':where(._boton_3lotu_1){--ease-out-fluid: cubic-bezier(.22, 1, .36, 1);--ease-quick: cubic-bezier(.4, 0, .2, 1);--color-dur: .36s;--shadow-dur: .48s;--transform-dur: .18s;--ease-extra-smooth: cubic-bezier(.2, 0, .2, 1);--ripple-duration: .6s;--ripple-opacity: .3}._boton_3lotu_1{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:none;color:var(--color-primary-text);contain:paint;cursor:pointer;display:inline-flex;font-size:var(--paragraph);font-weight:500;isolation:isolate;justify-content:center;line-height:normal;outline:none;overflow:hidden;position:relative;touch-action:manipulation;transition:background-color var(--color-dur) var(--ease-out-fluid),color var(--color-dur) var(--ease-out-fluid),border-color var(--color-dur) var(--ease-out-fluid),box-shadow var(--shadow-dur) var(--ease-out-fluid),opacity .22s var(--ease-out-fluid),transform var(--transform-dur) var(--ease-quick);-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle}._inner_3lotu_81{align-items:center;display:inline-flex;gap:.5rem;justify-content:center;position:relative;z-index:1}._start_3lotu_99,._end_3lotu_101,._label_3lotu_103,._spinner_3lotu_105{align-items:center;display:inline-flex;justify-content:center}._start_3lotu_99,._end_3lotu_101{font-size:1em;line-height:1}._start_3lotu_99 :where(svg,img),._end_3lotu_101 :where(svg,img){height:1em;display:block;flex:0 0 auto;width:1em}._ripple_3lotu_145{animation:_ripple_effect_3lotu_1 var(--ripple-duration) var(--ease-extra-smooth) forwards;background-color:color-mix(in srgb,currentcolor 80%,transparent);border-radius:50%;contain:strict;opacity:var(--ripple-opacity);pointer-events:none;position:absolute;transform:translate(-50%,-50%) scale(0);will-change:transform,opacity;z-index:0}@keyframes _ripple_effect_3lotu_1{to{opacity:0;transform:translate(-50%,-50%) scale(1)}}@media (prefers-reduced-motion: reduce){._ripple_3lotu_145{animation-duration:.3s;opacity:.18}}._tap_animation_3lotu_199{will-change:transform}._tap_animation_3lotu_199:active:not(:disabled){transform:scale(.98)}._boton_3lotu_1:focus-visible{outline:3px solid color-mix(in oklab,var(--btn-color),white 20%);outline-offset:2px}._boton_3lotu_1:focus:not(:focus-visible){outline:none}._spinner_3lotu_105{height:1em;width:1em}._modern_spinner_3lotu_243{animation:_spinner_rotate_3lotu_1 1s infinite linear;background:radial-gradient(farthest-side,currentcolor 94%,transparent) top/.16em .16em no-repeat,conic-gradient(transparent 30%,currentcolor);height:1em;border-radius:50%;width:1em;-webkit-mask:radial-gradient(farthest-side,transparent calc(100% - .16em),black 0);mask:radial-gradient(farthest-side,transparent calc(100% - .16em),black 0);will-change:transform}@keyframes _spinner_rotate_3lotu_1{to{transform:rotate(1turn)}}._loading_3lotu_279{cursor:progress;opacity:.7;pointer-events:none}._disabled_3lotu_291{cursor:not-allowed;opacity:.5;pointer-events:none}._full_width_3lotu_303{width:100%}._icon_only_3lotu_311{align-items:center;aspect-ratio:1;display:inline-flex;width:2.5rem;width:var(--icon-size, 2.5rem);justify-content:center;padding:0!important}._icon_only_3lotu_311._sm_3lotu_329{--icon-size: 2.25rem}._icon_only_3lotu_311._md_3lotu_337{--icon-size: 2.5rem}._icon_only_3lotu_311._lg_3lotu_345{--icon-size: 2.75rem}._sm_3lotu_329{font-size:.875rem;padding-top:var(--gaps-1);padding-bottom:var(--gaps-1);padding-left:var(--gaps-3);padding-right:var(--gaps-3)}._md_3lotu_337{font-size:var(--paragraph);padding-top:var(--gaps-2);padding-bottom:var(--gaps-2);padding-left:var(--gaps-4);padding-right:var(--gaps-4)}._lg_3lotu_345{font-size:var(--subtitle);padding-top:var(--gaps-2);padding-bottom:var(--gaps-2);padding-left:var(--gaps-5);padding-right:var(--gaps-5)}._radius_none_3lotu_389{border-radius:0}._radius_sm_3lotu_397{border-radius:var(--radius-1)}._radius_md_3lotu_405{border-radius:var(--radius-2)}._radius_lg_3lotu_413{border-radius:var(--radius-3)}._radius_full_3lotu_421{border-radius:var(--radius-round)}._solid_3lotu_429{background-color:var(--btn-color);color:#fff}._bordered_3lotu_439{background:transparent;border:2px solid var(--btn-text-color);color:var(--btn-text-color)}._ghost_3lotu_451{background:transparent;border:2px solid var(--btn-text-color);color:var(--btn-text-color);opacity:.9}._light_3lotu_465{background:transparent;border:none;color:var(--btn-text-color)}._faded_3lotu_477{background-color:var(--theme-faded-bg);border:2px solid var(--theme-faded-border);color:var(--btn-text-color)}._shadow_3lotu_489{background-color:var(--btn-color);box-shadow:0 12px 18px -10px color-mix(in oklab,var(--btn-shadow-color) 45%,transparent),0 16px 36px -14px color-mix(in oklab,var(--btn-shadow-color) 35%,transparent);color:#fff}._solid_3lotu_429:hover:not(:disabled):not(._loading_3lotu_279),._shadow_3lotu_489:hover:not(:disabled):not(._loading_3lotu_279){background-color:color-mix(in oklab,var(--btn-color) 96%,white 4%)}._shadow_3lotu_489:hover:not(:disabled):not(._loading_3lotu_279){box-shadow:0 12px 24px -12px color-mix(in oklab,var(--btn-shadow-color) 95%,transparent),0 22px 44px -18px color-mix(in oklab,var(--btn-shadow-color) 45%,transparent)}._bordered_3lotu_439:hover:not(:disabled):not(._loading_3lotu_279){border-color:color-mix(in oklab,var(--btn-text-color) 86%,transparent)}._ghost_3lotu_451:hover:not(:disabled):not(._loading_3lotu_279){background-color:color-mix(in oklab,var(--btn-text-color) 8%,transparent);border-color:color-mix(in oklab,var(--btn-text-color) 86%,transparent);color:var(--btn-text-color);opacity:1}._light_3lotu_465:hover:not(:disabled):not(._loading_3lotu_279){background-color:color-mix(in oklab,var(--btn-text-color) 15%,transparent);color:var(--btn-text-color)}._faded_3lotu_477:hover:not(:disabled):not(._loading_3lotu_279){background-color:color-mix(in oklab,var(--btn-text-color) 10%,var(--theme-faded-bg));border-color:color-mix(in oklab,var(--btn-text-color) 32%,var(--theme-faded-border))}._shadow_3lotu_489:active:not(:disabled):not(._loading_3lotu_279){box-shadow:0 8px 18px -12px color-mix(in oklab,var(--btn-shadow-color) 60%,transparent),0 16px 34px -20px color-mix(in oklab,var(--btn-shadow-color) 50%,transparent)}._primary_3lotu_581{--btn-color: var(--brand-6);--csstools-light-dark-toggle--0: var(--csstools-color-scheme--light) var(--brand-4);--btn-text-color: var(--csstools-light-dark-toggle--0, var(--brand-6));--btn-color-foreground: var(--base);--btn-color-light: var(--brand-1);--btn-color-faded: var(--brand-4);--btn-shadow-color: var(--brand-6)}@supports (color: light-dark(red,red)){._primary_3lotu_581{--btn-text-color: light-dark(var(--brand-6), var(--brand-4))}}@supports not (color: light-dark(tan,tan)){._primary_3lotu_581 *{--csstools-light-dark-toggle--0: var(--csstools-color-scheme--light) var(--brand-4);--btn-text-color: var(--csstools-light-dark-toggle--0, var(--brand-6))}}._secondary_3lotu_599{--btn-color: #3d6b0c;--csstools-light-dark-toggle--1: var(--csstools-color-scheme--light) var(--brand-4-secondary);--btn-text-color: var(--csstools-light-dark-toggle--1, #3d6b0c);--btn-color-foreground: var(--base);--btn-color-light: var(--brand-1-secondary);--btn-color-faded: #3d6b0c;--btn-shadow-color: #3d6b0c}@supports (color: light-dark(red,red)){._secondary_3lotu_599{--btn-text-color: light-dark(#3d6b0c, var(--brand-4-secondary))}}@supports not (color: light-dark(tan,tan)){._secondary_3lotu_599 *{--csstools-light-dark-toggle--1: var(--csstools-color-scheme--light) var(--brand-4-secondary);--btn-text-color: var(--csstools-light-dark-toggle--1, #3d6b0c)}}._success_3lotu_617{--btn-color: #246f2e;--csstools-light-dark-toggle--2: var(--csstools-color-scheme--light) var(--color-add-green-4);--btn-text-color: var(--csstools-light-dark-toggle--2, #246f2e);--btn-color-foreground: var(--base);--btn-color-light: var(--color-add-green-1);--btn-color-faded: #246f2e;--btn-shadow-color: #246f2e}@supports (color: light-dark(red,red)){._success_3lotu_617{--btn-text-color: light-dark(#246f2e, var(--color-add-green-4))}}@supports not (color: light-dark(tan,tan)){._success_3lotu_617 *{--csstools-light-dark-toggle--2: var(--csstools-color-scheme--light) var(--color-add-green-4);--btn-text-color: var(--csstools-light-dark-toggle--2, #246f2e)}}._warning_3lotu_635{--btn-color: #a04d00;--csstools-light-dark-toggle--3: var(--csstools-color-scheme--light) var(--color-add-orange-4);--btn-text-color: var(--csstools-light-dark-toggle--3, #a04d00);--btn-color-foreground: var(--base);--btn-color-light: var(--color-add-orange-1);--btn-color-faded: #a04d00;--btn-shadow-color: #a04d00}@supports (color: light-dark(red,red)){._warning_3lotu_635{--btn-text-color: light-dark(#a04d00, var(--color-add-orange-4))}}@supports not (color: light-dark(tan,tan)){._warning_3lotu_635 *{--csstools-light-dark-toggle--3: var(--csstools-color-scheme--light) var(--color-add-orange-4);--btn-text-color: var(--csstools-light-dark-toggle--3, #a04d00)}}._danger_3lotu_653{--btn-color: var(--color-add-red-6);--csstools-light-dark-toggle--4: var(--csstools-color-scheme--light) var(--color-add-red-4);--btn-text-color: var(--csstools-light-dark-toggle--4, var(--color-add-red-6));--btn-color-foreground: var(--base);--btn-color-light: var(--color-add-red-1);--btn-color-faded: var(--color-add-red-5);--btn-shadow-color: var(--color-add-red-6)}@supports (color: light-dark(red,red)){._danger_3lotu_653{--btn-text-color: light-dark(var(--color-add-red-6), var(--color-add-red-4))}}@supports not (color: light-dark(tan,tan)){._danger_3lotu_653 *{--csstools-light-dark-toggle--4: var(--csstools-color-scheme--light) var(--color-add-red-4);--btn-text-color: var(--csstools-light-dark-toggle--4, var(--color-add-red-6))}}._default_3lotu_671{--btn-color: var(--gray-6);--csstools-light-dark-toggle--5: var(--csstools-color-scheme--light) var(--gray-4);--btn-text-color: var(--csstools-light-dark-toggle--5, var(--gray-6));--btn-color-foreground: var(--base);--btn-color-light: var(--gray-2);--btn-color-faded: var(--gray-5);--btn-shadow-color: var(--gray-6)}@supports (color: light-dark(red,red)){._default_3lotu_671{--btn-text-color: light-dark(var(--gray-6), var(--gray-4))}}@supports not (color: light-dark(tan,tan)){._default_3lotu_671 *{--csstools-light-dark-toggle--5: var(--csstools-color-scheme--light) var(--gray-4);--btn-text-color: var(--csstools-light-dark-toggle--5, var(--gray-6))}}._dialog_1i8zu_1{align-items:center;background:transparent;border:none;display:flex;height:100vh;inset:0;justify-content:center;padding:0;position:fixed;width:100vw}._dialog_1i8zu_1::backdrop{-webkit-backdrop-filter:blur(.1875rem);backdrop-filter:blur(.1875rem);background-color:#000000d9}._dialog_1i8zu_1[open]{animation:_aparecer-dialog_1i8zu_1 .2s cubic-bezier(.4,0,.2,1)}@keyframes _aparecer-dialog_1i8zu_1{0%{opacity:0;transform:scale(.95) translateY(-1rem)}to{opacity:1;transform:scale(1) translateY(0)}}._modal_1i8zu_71{--csstools-light-dark-toggle--0: var(--csstools-color-scheme--light) #1e1e1e;background:#fff;background:var(--csstools-light-dark-toggle--0, #fff);background:light-dark(#fff,#1e1e1e);border-radius:1.25rem;box-shadow:0 1.5rem 3rem #00000080;display:flex;flex-direction:column;max-height:90vh;max-width:40rem;overflow-y:auto;width:90vw}._encabezado_1i8zu_95{align-items:center;display:flex;justify-content:space-between;padding:1.5rem 1.5rem 1rem}._titulo_1i8zu_109{--csstools-light-dark-toggle--1: var(--csstools-color-scheme--light) #fff;color:#1a1a1a;color:var(--csstools-light-dark-toggle--1, #1a1a1a);color:light-dark(#1a1a1a,#fff);font-size:1.125rem;font-weight:500;margin:0}._boton_cerrar_1i8zu_123{align-items:center;--csstools-light-dark-toggle--2: var(--csstools-color-scheme--light) #2a2a2a;background:#f0f0f0;background:var(--csstools-light-dark-toggle--2, #f0f0f0);background:light-dark(#f0f0f0,#2a2a2a);border:none;border-radius:.375rem;--csstools-light-dark-toggle--3: var(--csstools-color-scheme--light) #999;color:#666;color:var(--csstools-light-dark-toggle--3, #666);color:light-dark(#666,#999);cursor:pointer;display:flex;gap:.375rem;padding:.375rem .75rem;transition:all .15s ease}._boton_cerrar_1i8zu_123:hover{--csstools-light-dark-toggle--4: var(--csstools-color-scheme--light) #333;background:#e0e0e0;background:var(--csstools-light-dark-toggle--4, #e0e0e0);background:light-dark(#e0e0e0,#333);--csstools-light-dark-toggle--5: var(--csstools-color-scheme--light) #fff;color:#1a1a1a;color:var(--csstools-light-dark-toggle--5, #1a1a1a);color:light-dark(#1a1a1a,#fff)}._texto_esc_1i8zu_159{font-size:.6875rem;font-weight:600;letter-spacing:.025rem;text-transform:uppercase}._icono_x_1i8zu_173{font-size:1rem;line-height:1}._contenedor_lienzo_1i8zu_183{padding:0 1.5rem;position:relative}._area_firma_1i8zu_193{--csstools-light-dark-toggle--6: var(--csstools-color-scheme--light) #0d0d0d;background:#fafafa;background:var(--csstools-light-dark-toggle--6, #fafafa);background:light-dark(#fafafa,#0d0d0d);border-radius:1rem;overflow:hidden;position:relative}._lienzo_1i8zu_207{cursor:crosshair;display:block;height:auto;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}._lienzo_1i8zu_207:focus{--csstools-light-dark-toggle--7: var(--csstools-color-scheme--light) #4a9eff;outline:.125rem solid #007acc;outline:.125rem solid var(--csstools-light-dark-toggle--7, #007acc);outline:.125rem solid light-dark(#007acc,#4a9eff);outline-offset:.125rem}._lienzo_deshabilitado_1i8zu_235{cursor:not-allowed;opacity:.6}._barra_acciones_1i8zu_245{align-items:center;--csstools-light-dark-toggle--8: var(--csstools-color-scheme--light) #0d0d0d;background:#fafafa;background:var(--csstools-light-dark-toggle--8, #fafafa);background:light-dark(#fafafa,#0d0d0d);display:flex;justify-content:space-between;padding:.5rem 1.5rem}._grupo_izquierda_1i8zu_261{align-items:center;display:flex;gap:.5rem}._separador_1i8zu_273{--csstools-light-dark-toggle--9: var(--csstools-color-scheme--light) #444;color:#ccc;color:var(--csstools-light-dark-toggle--9, #ccc);color:light-dark(#ccc,#444);font-size:.875rem;padding:0 .25rem}._boton_accion_1i8zu_285{align-items:center;background:transparent;border:none;--csstools-light-dark-toggle--10: var(--csstools-color-scheme--light) #999;color:#666;color:var(--csstools-light-dark-toggle--10, #666);color:light-dark(#666,#999);cursor:pointer;display:flex;font-size:.875rem;font-weight:400;gap:.375rem;padding:.25rem .5rem;transition:all .15s ease}._boton_accion_1i8zu_285:disabled{cursor:not-allowed;opacity:.3}._boton_accion_1i8zu_285:hover:not(:disabled){--csstools-light-dark-toggle--11: var(--csstools-color-scheme--light) #fff;color:#1a1a1a;color:var(--csstools-light-dark-toggle--11, #1a1a1a);color:light-dark(#1a1a1a,#fff)}._boton_guardar_1i8zu_331{background:transparent;border:none;--csstools-light-dark-toggle--12: var(--csstools-color-scheme--light) #4a9eff;color:#007acc;color:var(--csstools-light-dark-toggle--12, #007acc);color:light-dark(#007acc,#4a9eff);cursor:pointer;font-size:.9375rem;font-weight:400;padding:.5rem .75rem;transition:all .15s ease}._boton_guardar_1i8zu_331:disabled{cursor:not-allowed;opacity:.3}._boton_guardar_1i8zu_331:hover:not(:disabled){--csstools-light-dark-toggle--13: var(--csstools-color-scheme--light) #6bb0ff;color:#005a9e;color:var(--csstools-light-dark-toggle--13, #005a9e);color:light-dark(#005a9e,#6bb0ff)}._icono_1i8zu_173{height:1rem;width:1rem}._contenedor_consentimiento_1i8zu_385{--csstools-light-dark-toggle--14: var(--csstools-color-scheme--light) #1a1a1a;background:#f5f5f5;background:var(--csstools-light-dark-toggle--14, #f5f5f5);background:light-dark(#f5f5f5,#1a1a1a);border-radius:.875rem;margin:1.5rem;padding:1.25rem 1.5rem}._contenedor_checkbox_1i8zu_401{align-items:center;cursor:pointer;display:flex;gap:.75rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}._checkbox_nativo_1i8zu_417{height:0;opacity:0;position:absolute;width:0}._checkbox_custom_1i8zu_431{align-items:center;--csstools-light-dark-toggle--15: var(--csstools-color-scheme--light) #3a3a3a;background:#d0d0d0;background:var(--csstools-light-dark-toggle--15, #d0d0d0);background:light-dark(#d0d0d0,#3a3a3a);border-radius:.75rem;display:flex;flex-shrink:0;height:1.5rem;justify-content:flex-start;padding:.1875rem;position:relative;transition:all .2s ease;width:2.75rem}._checkbox_custom_1i8zu_431:before{--csstools-light-dark-toggle--16: var(--csstools-color-scheme--light) #888;background:#fff;background:var(--csstools-light-dark-toggle--16, #fff);background:light-dark(#fff,#888);border-radius:50%;box-shadow:0 .125rem .25rem #0003;content:"";height:1.125rem;transition:all .2s ease;width:1.125rem}._checkbox_nativo_1i8zu_417:checked+._checkbox_custom_1i8zu_431{--csstools-light-dark-toggle--17: var(--csstools-color-scheme--light) #4a9eff;background:#4a9eff;background:var(--csstools-light-dark-toggle--17, #4a9eff);background:light-dark(#4a9eff,#4a9eff)}._checkbox_nativo_1i8zu_417:checked+._checkbox_custom_1i8zu_431:before{background:#fff;transform:translate(1.25rem)}._texto_consentimiento_1i8zu_497{--csstools-light-dark-toggle--18: var(--csstools-color-scheme--light) #aaa;color:#666;color:var(--csstools-light-dark-toggle--18, #666);color:light-dark(#666,#aaa);flex:1;font-size:.8125rem;line-height:1.5;margin:0}._contenedor_subir_1i8zu_515{margin-bottom:1.5rem;padding:0 1.5rem}._boton_subir_1i8zu_525{align-items:center;background:transparent;border:none;--csstools-light-dark-toggle--19: var(--csstools-color-scheme--light) #aaa;color:#666;color:var(--csstools-light-dark-toggle--19, #666);color:light-dark(#666,#aaa);cursor:pointer;display:inline-flex;font-size:.875rem;font-weight:400;gap:.5rem;padding:.5rem .75rem;transition:all .15s ease}._boton_subir_1i8zu_525:hover{--csstools-light-dark-toggle--20: var(--csstools-color-scheme--light) #fff;color:#1a1a1a;color:var(--csstools-light-dark-toggle--20, #1a1a1a);color:light-dark(#1a1a1a,#fff)}._input_archivo_1i8zu_561{display:none}@media (max-width: 48rem){._dialog_1i8zu_1{max-height:95vh;width:95vw}._encabezado_1i8zu_95{padding:1rem 1rem .75rem}._titulo_1i8zu_109{font-size:1rem}._contenedor_lienzo_1i8zu_183{padding:0 1rem}._barra_acciones_1i8zu_245{flex-direction:column;gap:.75rem;padding:.75rem 1rem}._grupo_izquierda_1i8zu_261,._boton_guardar_1i8zu_331{width:100%}._contenedor_consentimiento_1i8zu_385{margin:1rem;padding:1rem}._contenedor_subir_1i8zu_515{margin-bottom:1rem;padding:0 1rem}._boton_accion_1i8zu_285{font-size:.8125rem;gap:.25rem;padding:.375rem .5rem}._texto_esc_1i8zu_159{display:none}}@keyframes desvanecer_deslizar_entrada{0%{filter:blur(2px);opacity:0;transform:translateY(-8px) scale(.985) skewY(-1.2deg)}60%{filter:blur(.3px);opacity:.92;transform:translateY(2px) scale(1.012) skewY(.15deg)}to{filter:blur(0);opacity:1;transform:translateY(0) scale(1) skewY(0)}}.transicion_desvanecer_deslizar_entrada{animation:desvanecer_deslizar_entrada .38s cubic-bezier(.25,1,.5,1) forwards;backface-visibility:hidden;will-change:transform,opacity,filter}:root{--dur-enter: .8s;--dur-exit: .6s;--ease-emph: cubic-bezier(.2, .7, 0, 1);--ease-emph-in: cubic-bezier(.3, 0, .8, .15)}._contenedor_base_sg347_19{display:grid;grid-gap:var(--gaps-1);gap:var(--gaps-1);width:100%}._etiqueta_sg347_39{color:var(--color-secondary-text);font-size:var(--label);margin:.1em 0 .15em;-webkit-user-select:none;-moz-user-select:none;user-select:none}._marca_requerido_sg347_53{color:var(--system-error-color);font-size:1.25em;font-weight:700;line-height:0}._fila_acciones_sg347_67{align-items:center;display:flex;justify-content:space-between}._etiqueta_externa_sg347_79{font-size:.8em;font-weight:500;margin-bottom:.1em;padding-left:2px;padding-right:2px}._etiqueta_interna_sg347_93{color:var(--color-secondary-text);font-size:.8em;font-weight:500;margin:.05em 0}._encabezado_interno_sg347_109{align-items:center;display:grid;grid-gap:.5rem;gap:.5rem;grid-template-columns:1fr auto;padding:.4rem .9rem .15rem}._encabezado_interno_sg347_109 ._etiqueta_interna_sg347_93{min-width:0;overflow:hidden;pointer-events:none;text-overflow:ellipsis}._acciones_grupo_sg347_141{align-items:center;display:flex;flex-wrap:nowrap;gap:.5rem;min-width:0}._acciones_header_sg347_157{display:inline-flex;gap:.35rem}._encabezado_interno_sg347_109 ._acciones_grupo_sg347_141{justify-self:end;position:relative;z-index:1}._envoltorio_input_sg347_181{background:var(--surface-first);border:1px solid var(--surface-third);border-radius:var(--radius-3);overflow:visible;transition:border-color .18s,box-shadow .18s,background .18s}._label_outside_sg347_203 ._envoltorio_input_sg347_181{padding-top:var(--gaps-1)}._variante_normal_sg347_211 ._envoltorio_input_sg347_181{background:transparent;border:1px solid var(--surface-third);box-shadow:none}._variante_underlined_sg347_223 ._envoltorio_input_sg347_181{background:transparent;border:none;border-radius:0!important;box-shadow:none!important;overflow:visible;padding:0;position:relative}._variante_underlined_sg347_223 ._envoltorio_input_sg347_181:after{background:#1e90ff;background:var(--brand-6, #1e90ff);bottom:0;content:"";height:2.5px;left:0;position:absolute;right:0;transform:scaleX(0);transition:transform .4s cubic-bezier(.4,0,.2,1)}._variante_light_sg347_267 ._envoltorio_input_sg347_181{background:var(--surface-second);border:none;box-shadow:none!important}._variante_bordered_sg347_279 ._envoltorio_input_sg347_181{border-color:var(--gray-4)}._variante_faded_sg347_287 ._envoltorio_input_sg347_181{background:var(--theme-faded-bg);border-color:var(--theme-faded-border)}._radio_none_sg347_299 ._envoltorio_input_sg347_181{border-radius:0}._radio_sm_sg347_307 ._envoltorio_input_sg347_181{border-radius:var(--radius-2)}._radio_md_sg347_315 ._envoltorio_input_sg347_181{border-radius:var(--radius-3)}._radio_lg_sg347_323 ._envoltorio_input_sg347_181{border-radius:var(--radius-4)}._envoltorio_input_sg347_181:focus-within{border-color:var(--gray-4);box-shadow:0 0 0 2px var(--gray-3)}._variante_underlined_sg347_223 ._envoltorio_input_sg347_181:focus-within:after{transform:scaleX(1)}._invalido_sg347_353 ._envoltorio_input_sg347_181{border-color:var(--system-error-color)!important;box-shadow:0 0 0 3px #e6000024}._variante_light_sg347_267 ._envoltorio_input_sg347_181:focus-within{background:var(--surface-third)}._color_primary_sg347_373 ._envoltorio_input_sg347_181:focus-within{border-color:var(--brand-5);box-shadow:0 0 0 3px #0088c22e}._color_secondary_sg347_383 ._envoltorio_input_sg347_181:focus-within{border-color:var(--brand-secondary);box-shadow:0 0 0 3px #5dc3222e}._color_success_sg347_393 ._envoltorio_input_sg347_181:focus-within{border-color:var(--color-add-green-6);box-shadow:0 0 0 3px #29a35a2e}._color_warning_sg347_403 ._envoltorio_input_sg347_181:focus-within{border-color:var(--color-add-orange-6);box-shadow:0 0 0 3px #e686002e}._color_danger_sg347_413 ._envoltorio_input_sg347_181:focus-within{border-color:var(--system-error-color);box-shadow:0 0 0 3px #e600002e}._deshabilitado_sg347_425{opacity:.8;pointer-events:none}._sin_animacion_sg347_435 *{transition:none!important}._variante_light_sg347_267 ._envoltorio_input_sg347_181:hover{background:var(--surface-third)}._contenedor_interior_sg347_453{align-items:start;background:transparent;display:grid;grid-gap:.35rem;gap:.35rem;padding:0 .75rem .6rem}._inicio_sg347_469,._fin_sg347_471{align-self:start;color:var(--color-secondary-text)}._entrada_sg347_483{background:transparent;border:0;color:var(--color-primary-text);font:inherit;line-height:var(--font-lineheight-6);min-width:0;outline:none;resize:none;text-wrap:balance;width:100%}._entrada_sg347_483::-moz-placeholder{color:var(--color-placeholder);opacity:1}._entrada_sg347_483::placeholder{color:var(--color-placeholder);opacity:1}._sin_autosize_sg347_519{resize:vertical}._estado_interno_sg347_529{display:flex;justify-content:flex-end;padding:.25rem .75rem}._tam_sm_sg347_543 ._encabezado_interno_sg347_109{font-size:var(--label)}._tam_md_sg347_551 ._encabezado_interno_sg347_109{font-size:var(--paragraph)}._tam_lg_sg347_559 ._encabezado_interno_sg347_109{font-size:var(--subtitle)}._boton_tts_sg347_569,._boton_limpiar_sg347_571{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--surface-first);border:1px solid var(--surface-third);border-radius:var(--radius-3);color:var(--color-primary-text);cursor:pointer;font-size:.9rem;isolation:isolate;line-height:1;padding:.18rem .46rem;position:relative;-webkit-tap-highlight-color:transparent;transition:transform .18s,box-shadow .18s,background .18s,border-color .18s,color .18s}._boton_tts_sg347_569:hover,._boton_limpiar_sg347_571:hover{--csstools-light-dark-toggle--0: var(--csstools-color-scheme--light) var(--surface-fourth);background:var(--csstools-light-dark-toggle--0, var(--surface-third))}@supports (color: light-dark(red,red)){._boton_tts_sg347_569:hover,._boton_limpiar_sg347_571:hover{background:light-dark(var(--surface-third),var(--surface-fourth))}}._boton_tts_sg347_569:disabled{cursor:not-allowed;opacity:.55}._boton_activo_sg347_635{background:linear-gradient(180deg,var(--brand-2),var(--brand-3));border-color:var(--brand-5);box-shadow:0 0 0 2px var(--brand-3),0 8px 18px -10px #0685e059;color:var(--brand-8)}._boton_activo_sg347_635:after{animation:_btn_halo_azul_sg347_1 1.2s ease-out infinite;border-radius:inherit;box-shadow:0 0 #0685e042;content:"";inset:-4px;pointer-events:none;position:absolute;z-index:-1}._boton_activo_mic_sg347_677{background:transparent;border-color:var(--system-error-color);box-shadow:0 0 0 2px color-mix(in oklab,var(--system-error-color) 35%,transparent),0 8px 18px -10px color-mix(in oklab,var(--system-error-color) 40%,transparent);color:var(--system-error-color)}._boton_activo_mic_sg347_677:after{animation:_btn_halo_rojo_sg347_1 1.2s ease-out infinite;border-radius:inherit;box-shadow:0 0 color-mix(in oklab,var(--system-error-color) 22%,transparent);content:"";inset:-4px;pointer-events:none;position:absolute;z-index:-1}@keyframes _btn_halo_rojo_sg347_1{0%{box-shadow:0 0 color-mix(in oklab,var(--system-error-color) 18%,transparent)}70%{box-shadow:0 0 0 12px color-mix(in oklab,var(--system-error-color) 0%,transparent)}to{box-shadow:0 0 color-mix(in oklab,var(--system-error-color) 0%,transparent)}}@keyframes _btn_halo_azul_sg347_1{0%{box-shadow:0 0 #0685e038}70%{box-shadow:0 0 0 12px #0685e000}to{box-shadow:0 0 #0685e000}}._badges_wrap_sg347_783{display:none}._badges_wrap_visible_sg347_791{display:inline-grid;opacity:1}._acciones_grupo_sg347_141>._badges_wrap_visible_sg347_791{margin-left:.35rem}._badge_voz_sg347_813{align-items:center;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);--csstools-light-dark-toggle--1: var(--csstools-color-scheme--light) #0f1720;--csstools-light-dark-toggle--2: var(--csstools-color-scheme--light) #141c27;background:linear-gradient(180deg,#fff,#f6f9ff);background:linear-gradient(180deg,var(--csstools-light-dark-toggle--1, #fff),var(--csstools-light-dark-toggle--2, #f6f9ff));background:linear-gradient(180deg,light-dark(#fff,#0f1720),light-dark(#f6f9ff,#141c27));--csstools-light-dark-toggle--3: var(--csstools-color-scheme--light) #202c3c;border:1px solid #e1e9f5;border:1px solid var(--csstools-light-dark-toggle--3, #e1e9f5);border:1px solid light-dark(#e1e9f5,#202c3c);border-radius:999px;--csstools-light-dark-toggle--10: var(--csstools-color-scheme--light) #0f1720;box-shadow:0 1px #fff inset,0 4px 14px -8px #1e90ff47;box-shadow:0 1px 0 var(--csstools-light-dark-toggle--10, #fff) inset,0 4px 14px -8px #1e90ff47;box-shadow:0 1px 0 light-dark(#fff,#0f1720) inset,0 4px 14px -8px #1e90ff47;--csstools-light-dark-toggle--4: var(--csstools-color-scheme--light) #e6edf7;color:#0f1720;color:var(--csstools-light-dark-toggle--4, #0f1720);color:light-dark(#0f1720,#e6edf7);display:inline-flex;gap:.45rem;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}._badge_sm_sg347_845{font-size:12px;line-height:1;padding:.2rem .6rem}._badge_md_sg347_857{font-size:13px;line-height:1.05;padding:.28rem .7rem}._badge_lg_sg347_869{font-size:14px;line-height:1.1;padding:.36rem .8rem}._badge_estirada_sg347_881{display:inline-flex;flex:1;justify-content:space-between;margin-top:var(--gaps-1);max-width:100%;min-width:0;order:1}._badge_icono_sg347_901{border-radius:50%;display:grid;height:1.05em;align-items:center;justify-items:center;place-items:center;width:1.05em}._badge_icono_sg347_901 svg{height:.95em;width:.95em}._badge_texto_sg347_927{font-weight:600;letter-spacing:.01em}._badge_mic_sg347_937 ._badge_icono_sg347_901{--csstools-light-dark-toggle--5: var(--csstools-color-scheme--light) #4be896;color:#ef4444;color:var(--csstools-light-dark-toggle--5, #ef4444);color:light-dark(#ef4444,#4be896)}._badge_tts_sg347_945 ._badge_icono_sg347_901{--csstools-light-dark-toggle--6: var(--csstools-color-scheme--light) #66b5ff;color:#1e90ff;color:var(--csstools-light-dark-toggle--6, #1e90ff);color:light-dark(#1e90ff,#66b5ff)}._badge_mic_sg347_937 ._badge_ondas_sg347_955{display:inline-grid;height:1.25em;align-items:center;justify-items:center;place-items:center;position:relative;width:1.25em}._badge_mic_sg347_937 ._badge_ondas_sg347_955 span{animation:_badge_onda_sg347_955 1.8s ease-out infinite;--csstools-light-dark-toggle--7: var(--csstools-color-scheme--light) #4be896;border:2px solid #ef4444;border:2px solid var(--csstools-light-dark-toggle--7, #ef4444);border:2px solid light-dark(#ef4444,#4be896);border-radius:50%;--csstools-light-dark-toggle--8: var(--csstools-color-scheme--light) #22c55e;filter:drop-shadow(0 2px 6px rgba(239,68,68,.35));filter:drop-shadow(0 2px 6px color-mix(in oklab,light-dark(#ef4444,#22c55e) 35%,transparent));height:100%;opacity:.85;position:absolute;width:100%}@supports (color: color-mix(in lch,red,blue)){._badge_mic_sg347_937 ._badge_ondas_sg347_955 span{filter:drop-shadow(0 2px 6px color-mix(in oklab,var(--csstools-light-dark-toggle--8, #ef4444) 35%,transparent))}}._badge_tts_sg347_945 ._badge_eq_sg347_995{align-items:end;display:inline-flex;gap:2px;height:1.1em}._badge_tts_sg347_945 ._badge_eq_sg347_995 span{animation:_badge_eq_sg347_995 .9s ease-in-out infinite;--csstools-light-dark-toggle--9: var(--csstools-color-scheme--light) #66b5ff;background:#1e90ff;background:var(--csstools-light-dark-toggle--9, #1e90ff);background:light-dark(#1e90ff,#66b5ff);border-radius:2px;height:30%;width:2px}._badge_mic_sg347_937 ._badge_ondas_sg347_955 span:nth-child(2){animation-delay:.35s}._badge_mic_sg347_937 ._badge_ondas_sg347_955 span:nth-child(3){animation-delay:.7s}._badge_tts_sg347_945 ._badge_eq_sg347_995 span:nth-child(2){animation-delay:.15s}._badge_tts_sg347_945 ._badge_eq_sg347_995 span:nth-child(3){animation-delay:.3s}._badge_tts_sg347_945 ._badge_eq_sg347_995 span:nth-child(4){animation-delay:.45s}@keyframes _badge_onda_sg347_955{0%{opacity:.85;transform:scale(.15)}70%{opacity:.22}to{opacity:0;transform:scale(1.6)}}@keyframes _badge_eq_sg347_995{0%,to{height:30%}50%{height:85%}}@media (prefers-reduced-motion: reduce){._badge_mic_sg347_937 ._badge_ondas_sg347_955 span,._badge_tts_sg347_945 ._badge_eq_sg347_995 span{animation:none!important}}._descripcion_sg347_1137{color:var(--color-secondary-text);font-size:12px}._mensaje_error_sg347_1147{color:var(--system-error-color);font-size:12px}._ancho_total_sg347_1159{width:100%}')),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
-
(function($,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("clsx"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","clsx","react"],e):($=typeof globalThis<"u"?globalThis:$||self,e($["PC DEMO"]={},$.jsxRuntime,$.clsx,$.React))})(this,function($,e,E,n){"use strict";const w={boton:"_boton_3lotu_1",inner:"_inner_3lotu_81",start:"_start_3lotu_99",end:"_end_3lotu_101",label:"_label_3lotu_103",spinner:"_spinner_3lotu_105",ripple:"_ripple_3lotu_145",ripple_effect:"_ripple_effect_3lotu_1",rippleEffect:"_ripple_effect_3lotu_1",tap_animation:"_tap_animation_3lotu_199",tapAnimation:"_tap_animation_3lotu_199",modern_spinner:"_modern_spinner_3lotu_243",modernSpinner:"_modern_spinner_3lotu_243",spinner_rotate:"_spinner_rotate_3lotu_1",spinnerRotate:"_spinner_rotate_3lotu_1",loading:"_loading_3lotu_279",disabled:"_disabled_3lotu_291",full_width:"_full_width_3lotu_303",fullWidth:"_full_width_3lotu_303",icon_only:"_icon_only_3lotu_311",iconOnly:"_icon_only_3lotu_311",sm:"_sm_3lotu_329",md:"_md_3lotu_337",lg:"_lg_3lotu_345",radius_none:"_radius_none_3lotu_389",radiusNone:"_radius_none_3lotu_389",radius_sm:"_radius_sm_3lotu_397",radiusSm:"_radius_sm_3lotu_397",radius_md:"_radius_md_3lotu_405",radiusMd:"_radius_md_3lotu_405",radius_lg:"_radius_lg_3lotu_413",radiusLg:"_radius_lg_3lotu_413",radius_full:"_radius_full_3lotu_421",radiusFull:"_radius_full_3lotu_421",solid:"_solid_3lotu_429",bordered:"_bordered_3lotu_439",ghost:"_ghost_3lotu_451",light:"_light_3lotu_465",faded:"_faded_3lotu_477",shadow:"_shadow_3lotu_489",primary:"_primary_3lotu_581",secondary:"_secondary_3lotu_599",success:"_success_3lotu_617",warning:"_warning_3lotu_635",danger:"_danger_3lotu_653",default:"_default_3lotu_671"},de=n.forwardRef(({variant:s="solid",color:c="default",size:x="md",radius:y="md",fullWidth:v=!1,isLoading:b=!1,isDisabled:m=!1,isIconOnly:h=!1,startContent:z,endContent:S,spinner:j,spinnerPlacement:F,disableRipple:k=!1,disableAnimation:M=!1,children:I,className:N,...l},u)=>{const A=n.useRef(null),U=E(w.boton,w[s],w[c],w[x],w[`radius_${y}`],v&&!h&&w.full_width,(m||l.disabled)&&w.disabled,h&&w.icon_only,b&&w.loading,!M&&w.tap_animation,N),r=!!I&&(!b||!h),i=o=>{if(!k&&!m&&!b&&A.current&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches){const t=A.current,g=document.createElement("span");g.className=w.ripple,g.setAttribute("aria-hidden","true");const p=t.getBoundingClientRect(),T=o.clientX-p.left,H=o.clientY-p.top,f=Math.max(T,p.width-T),B=Math.max(H,p.height-H),G=Math.hypot(f,B)*2;g.style.width=g.style.height=`${G}px`,g.style.left=`${T}px`,g.style.top=`${H}px`,g.addEventListener("animationend",()=>g.remove(),{once:!0}),t.appendChild(g)}l.onClick?.(o)};return e.jsx("button",{...l,"aria-busy":b,ref:o=>{A.current=o,typeof u=="function"?u(o):u&&(u.current=o)},type:l.type||"button",className:U,disabled:m||b,onClick:i,children:e.jsxs("span",{className:w.inner,children:[z&&!b&&e.jsx("span",{className:w.start,children:z}),r&&e.jsx("span",{className:w.label,children:I}),b&&e.jsx("span",{className:w.spinner,children:j??e.jsx("div",{className:w.modern_spinner})}),S&&!b&&e.jsx("span",{className:w.end,children:S})]})})});de.displayName="Boton";const _={dialog:"_dialog_1i8zu_1",modal:"_modal_1i8zu_71",encabezado:"_encabezado_1i8zu_95",titulo:"_titulo_1i8zu_109",boton_cerrar:"_boton_cerrar_1i8zu_123",texto_esc:"_texto_esc_1i8zu_159",icono_x:"_icono_x_1i8zu_173",contenedor_lienzo:"_contenedor_lienzo_1i8zu_183",area_firma:"_area_firma_1i8zu_193",lienzo:"_lienzo_1i8zu_207",lienzo_deshabilitado:"_lienzo_deshabilitado_1i8zu_235",barra_acciones:"_barra_acciones_1i8zu_245",grupo_izquierda:"_grupo_izquierda_1i8zu_261",separador:"_separador_1i8zu_273",boton_accion:"_boton_accion_1i8zu_285",boton_guardar:"_boton_guardar_1i8zu_331",icono:"_icono_1i8zu_173",contenedor_consentimiento:"_contenedor_consentimiento_1i8zu_385",contenedor_checkbox:"_contenedor_checkbox_1i8zu_401",checkbox_nativo:"_checkbox_nativo_1i8zu_417",checkbox_custom:"_checkbox_custom_1i8zu_431",texto_consentimiento:"_texto_consentimiento_1i8zu_497",contenedor_subir:"_contenedor_subir_1i8zu_515",boton_subir:"_boton_subir_1i8zu_525",input_archivo:"_input_archivo_1i8zu_561"},ze=()=>{const s=n.useRef(null),[c,x]=n.useState(!1),[y,v]=n.useState(!0),[b,m]=n.useState(null),[h,z]=n.useState([]),[S,j]=n.useState([]),F=n.useCallback(()=>{const r=s.current,i=r?.getContext("2d");r&&i&&(i.clearRect(0,0,r.width,r.height),v(!0),z([]),j([]))},[]),k=n.useCallback(()=>{if(h.length===0)return;const r=h.slice(0,-1);z(r);const i=s.current,o=i?.getContext("2d");!i||!o||(o.clearRect(0,0,i.width,i.height),r.forEach(t=>{if(!(t.puntos.length<2)){o.strokeStyle=t.color,o.beginPath(),o.moveTo(t.puntos[0].x,t.puntos[0].y);for(let g=1;g<t.puntos.length;g++)o.lineTo(t.puntos[g].x,t.puntos[g].y);o.stroke()}}),v(r.length===0))},[h]),M=n.useCallback(r=>{const i=s.current;if(!i)return{x:0,y:0};const o=i.getBoundingClientRect(),t=i.width/o.width,g=i.height/o.height;return"touches"in r?{x:(r.touches[0].clientX-o.left)*t,y:(r.touches[0].clientY-o.top)*g}:{x:(r.clientX-o.left)*t,y:(r.clientY-o.top)*g}},[]),I=n.useCallback((r,i)=>{const t=s.current?.getContext("2d");t&&(t.beginPath(),t.moveTo(r.x,r.y),t.lineTo(i.x,i.y),t.stroke(),v(!1))},[]),N=n.useCallback(r=>{r.preventDefault();const i=M(r);x(!0),m(i),j([i])},[M]),l=n.useCallback(r=>{if(!c||!b)return;r.preventDefault();const i=M(r);I(b,i),m(i),j(o=>[...o,i])},[c,b,M,I]),u=n.useCallback(()=>{if(c&&S.length>0){const i=s.current?.getContext("2d"),o={puntos:S,color:i?.strokeStyle||"#000000"};z(t=>[...t,o]),j([])}x(!1),m(null)},[c,S]),A=n.useCallback(()=>{const r=s.current;return!r||y?null:r.toDataURL("image/png")},[y]),U=n.useCallback((r,i=!0)=>{const o=s.current,t=o?.getContext("2d");if(!(!o||!t))return t.strokeStyle=r,t.lineWidth=4,t.lineCap="round",t.lineJoin="round",i?(o.addEventListener("mousedown",N),o.addEventListener("mousemove",l),o.addEventListener("mouseup",u),o.addEventListener("mouseout",u),o.addEventListener("touchstart",N),o.addEventListener("touchmove",l),o.addEventListener("touchend",u),()=>{o.removeEventListener("mousedown",N),o.removeEventListener("mousemove",l),o.removeEventListener("mouseup",u),o.removeEventListener("mouseout",u),o.removeEventListener("touchstart",N),o.removeEventListener("touchmove",l),o.removeEventListener("touchend",u)}):()=>{}},[N,l,u]);return{canvasRef:s,estaVacio:y,limpiarCanvas:F,deshacerUltimoTrazo:k,puedeDeshacer:h.length>0,obtenerDatosFirma:A,configurarCanvas:U}},xe=({className:s,title:c="Deshacer"})=>e.jsxs("svg",{className:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!c,role:"img",children:[e.jsx("title",{children:c}),e.jsx("path",{d:"M3 7v6h6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),ke=({className:s,title:c="Limpiar"})=>e.jsxs("svg",{className:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!c,role:"img",children:[e.jsx("title",{children:c}),e.jsx("path",{d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Ne=({className:s,title:c="Adjuntar"})=>e.jsxs("svg",{className:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!c,role:"img",children:[e.jsx("title",{children:c}),e.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M17 8l-5-5-5 5M12 3v12",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Ee=({className:s,title:c="Cerrar"})=>e.jsxs("svg",{className:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!c,role:"img",children:[e.jsx("title",{children:c}),e.jsx("path",{d:"M6 18L18 6M6 6l12 12",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),le=n.forwardRef(({isOpen:s=!1,onClose:c,onConfirm:x,titulo:y="Firmar el contrato",textoGuardar:v="Guardar firma",textoModificar:b="Modificar firma",textoDeshacer:m="Atrás",textoLimpiar:h="Limpiar",textoAdjuntar:z="Adjuntar firma",ancho:S=500,alto:j=200,className:F,textoConsentimiento:k="Al firmar, confirmo que he leído y acepto todos los términos contractuales, los cuales se vuelven legalmente vinculantes",mostrarBotonSubir:M=!1,cerrarAlGuardar:I=!1},N)=>{const{canvasRef:l,estaVacio:u,limpiarCanvas:A,deshacerUltimoTrazo:U,obtenerDatosFirma:r,configurarCanvas:i,puedeDeshacer:o}=ze(),t=n.useRef(null),g=n.useRef(null),[p,T]=n.useState(!1),[H,f]=n.useState(!1),[B,Z]=n.useState(!1);n.useImperativeHandle(N,()=>({limpiar:A,obtenerDatosFirma:r,estaVacio:()=>u})),n.useEffect(()=>{if(s&&l.current){const d=l.current,K=(()=>{const V=document.documentElement.getAttribute("data-theme"),q=window.matchMedia("(prefers-color-scheme: dark)").matches;return V==="dark"||V===null&&q})()?"#ffffff":"#000000",W=i(K,!B),D=new MutationObserver(()=>{const V=document.documentElement.getAttribute("data-theme"),q=window.matchMedia("(prefers-color-scheme: dark)").matches,ee=V==="dark"||V===null&&q?"#ffffff":"#000000",L=d.getContext("2d");L&&(L.strokeStyle=ee)});return D.observe(document.documentElement,{attributes:!0,attributeFilter:["style","class"]}),()=>{W?.(),D.disconnect()}}},[s,i,l,B]),n.useEffect(()=>{const d=t.current;if(d)return s?(d.showModal(),document.body.style.overflow="hidden"):(d.close(),document.body.style.overflow=""),()=>{document.body.style.overflow=""}},[s]);const G=n.useCallback(()=>{c&&(f(!1),T(!1),Z(!1),c())},[c]);n.useEffect(()=>{if(!s)return;const d=X=>{X.key==="Escape"&&G()};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[s,G]);const te=n.useCallback(d=>{const X=t.current;if(!X)return;const O=X.getBoundingClientRect();(d.clientX<O.left||d.clientX>O.right||d.clientY<O.top||d.clientY>O.bottom)&&G()},[G]),ie=()=>{const d=r();d&&x&&p&&(f(!0),x(d),I&&c&&G())},ce=()=>{f(!1),Z(!1),A()},Q=d=>{const X=d.target.files?.[0];if(!X||!l.current)return;const O=new FileReader;O.onload=K=>{const W=new Image;W.onload=()=>{const D=l.current,V=D?.getContext("2d");if(!D||!V)return;V.clearRect(0,0,D.width,D.height);const q=D.width,Y=D.height,ee=q/Y,L=W.width/W.height;let oe,ne,ae,P;L>ee?(oe=q,ne=q/L,ae=0,P=(Y-ne)/2):(ne=Y,oe=Y*L,ae=(q-oe)/2,P=0),V.drawImage(W,ae,P,oe,ne),Z(!0)},W.src=K.target?.result},O.readAsDataURL(X)},J=()=>{g.current?.click()},R=H||B,se=!H&&(u&&!B||!p);return s?e.jsx("dialog",{ref:t,className:`${_.dialog} ${F||""}`,onClick:te,children:e.jsxs("div",{className:_.modal,children:[e.jsxs("div",{className:_.encabezado,children:[e.jsx("h2",{className:_.titulo,children:y}),e.jsxs("button",{className:_.boton_cerrar,onClick:G,type:"button","aria-label":"Cerrar",children:[e.jsx("span",{className:_.texto_esc,children:"ESC"}),e.jsx(Ee,{className:_.icono_x})]})]}),e.jsx("div",{className:_.contenedor_lienzo,children:e.jsxs("div",{className:_.area_firma,children:[e.jsx("canvas",{ref:l,className:`${_.lienzo} ${R?_.lienzo_deshabilitado:""}`,width:S*2,height:j*2,style:{pointerEvents:R?"none":"auto"}}),e.jsxs("div",{className:_.barra_acciones,children:[e.jsxs("div",{className:_.grupo_izquierda,children:[e.jsxs("button",{className:_.boton_accion,onClick:U,type:"button",disabled:!o||R,title:m,children:[e.jsx(xe,{className:_.icono}),m]}),e.jsx("span",{className:_.separador,children:"|"}),e.jsxs("button",{className:_.boton_accion,onClick:A,type:"button",disabled:u||R,title:h,children:[e.jsx(ke,{className:_.icono}),h]})]}),e.jsx("button",{className:_.boton_guardar,onClick:H?ce:ie,type:"button",disabled:se,children:H?b:v})]})]})}),e.jsx("div",{className:_.contenedor_consentimiento,children:e.jsxs("label",{className:_.contenedor_checkbox,children:[e.jsx("input",{type:"checkbox",className:_.checkbox_nativo,checked:p,onChange:d=>T(d.target.checked)}),e.jsx("span",{className:_.checkbox_custom}),e.jsx("span",{className:_.texto_consentimiento,children:k})]})}),M&&e.jsxs("div",{className:_.contenedor_subir,children:[e.jsx("input",{ref:g,type:"file",accept:"image/*",className:_.input_archivo,onChange:Q}),e.jsxs("button",{className:_.boton_subir,onClick:J,type:"button",children:[e.jsx(Ne,{className:_.icono}),z]})]})]})}):null});le.displayName="FirmaManual";function ue({mostrar:s,children:c,...x}){const[y,v]=n.useState(s),[b,m]=n.useState(!1);n.useLayoutEffect(()=>{s&&!y?(v(!0),m(!0)):s||(v(!1),m(!1))},[s,y]);const h=()=>{b&&m(!1)};return y?e.jsx("div",{...x,onAnimationEnd:h,className:b?"transicion_desvanecer_deslizar_entrada":"",children:c}):null}function ge(s){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...s,children:e.jsxs("g",{fill:"currentColor",children:[e.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),e.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 be(s){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...s,children:e.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 Ce(s){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...s,children:[e.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),e.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"})]})}const a={contenedor_base:"_contenedor_base_sg347_19",contenedorBase:"_contenedor_base_sg347_19",etiqueta:"_etiqueta_sg347_39",marca_requerido:"_marca_requerido_sg347_53",marcaRequerido:"_marca_requerido_sg347_53",fila_acciones:"_fila_acciones_sg347_67",filaAcciones:"_fila_acciones_sg347_67",etiqueta_externa:"_etiqueta_externa_sg347_79",etiquetaExterna:"_etiqueta_externa_sg347_79",etiqueta_interna:"_etiqueta_interna_sg347_93",etiquetaInterna:"_etiqueta_interna_sg347_93",encabezado_interno:"_encabezado_interno_sg347_109",encabezadoInterno:"_encabezado_interno_sg347_109",acciones_grupo:"_acciones_grupo_sg347_141",accionesGrupo:"_acciones_grupo_sg347_141",acciones_header:"_acciones_header_sg347_157",accionesHeader:"_acciones_header_sg347_157",envoltorio_input:"_envoltorio_input_sg347_181",envoltorioInput:"_envoltorio_input_sg347_181",label_outside:"_label_outside_sg347_203",labelOutside:"_label_outside_sg347_203",variante_normal:"_variante_normal_sg347_211",varianteNormal:"_variante_normal_sg347_211",variante_underlined:"_variante_underlined_sg347_223",varianteUnderlined:"_variante_underlined_sg347_223",variante_light:"_variante_light_sg347_267",varianteLight:"_variante_light_sg347_267",variante_bordered:"_variante_bordered_sg347_279",varianteBordered:"_variante_bordered_sg347_279",variante_faded:"_variante_faded_sg347_287",varianteFaded:"_variante_faded_sg347_287",radio_none:"_radio_none_sg347_299",radioNone:"_radio_none_sg347_299",radio_sm:"_radio_sm_sg347_307",radioSm:"_radio_sm_sg347_307",radio_md:"_radio_md_sg347_315",radioMd:"_radio_md_sg347_315",radio_lg:"_radio_lg_sg347_323",radioLg:"_radio_lg_sg347_323",invalido:"_invalido_sg347_353",color_primary:"_color_primary_sg347_373",colorPrimary:"_color_primary_sg347_373",color_secondary:"_color_secondary_sg347_383",colorSecondary:"_color_secondary_sg347_383",color_success:"_color_success_sg347_393",colorSuccess:"_color_success_sg347_393",color_warning:"_color_warning_sg347_403",colorWarning:"_color_warning_sg347_403",color_danger:"_color_danger_sg347_413",colorDanger:"_color_danger_sg347_413",deshabilitado:"_deshabilitado_sg347_425",sin_animacion:"_sin_animacion_sg347_435",sinAnimacion:"_sin_animacion_sg347_435",contenedor_interior:"_contenedor_interior_sg347_453",contenedorInterior:"_contenedor_interior_sg347_453",inicio:"_inicio_sg347_469",fin:"_fin_sg347_471",entrada:"_entrada_sg347_483",sin_autosize:"_sin_autosize_sg347_519",sinAutosize:"_sin_autosize_sg347_519",estado_interno:"_estado_interno_sg347_529",estadoInterno:"_estado_interno_sg347_529",tam_sm:"_tam_sm_sg347_543",tamSm:"_tam_sm_sg347_543",tam_md:"_tam_md_sg347_551",tamMd:"_tam_md_sg347_551",tam_lg:"_tam_lg_sg347_559",tamLg:"_tam_lg_sg347_559",boton_tts:"_boton_tts_sg347_569",botonTts:"_boton_tts_sg347_569",boton_limpiar:"_boton_limpiar_sg347_571",botonLimpiar:"_boton_limpiar_sg347_571",boton_activo:"_boton_activo_sg347_635",botonActivo:"_boton_activo_sg347_635",btn_halo_azul:"_btn_halo_azul_sg347_1",btnHaloAzul:"_btn_halo_azul_sg347_1",boton_activo_mic:"_boton_activo_mic_sg347_677",botonActivoMic:"_boton_activo_mic_sg347_677",btn_halo_rojo:"_btn_halo_rojo_sg347_1",btnHaloRojo:"_btn_halo_rojo_sg347_1",badges_wrap:"_badges_wrap_sg347_783",badgesWrap:"_badges_wrap_sg347_783",badges_wrap_visible:"_badges_wrap_visible_sg347_791",badgesWrapVisible:"_badges_wrap_visible_sg347_791",badge_voz:"_badge_voz_sg347_813",badgeVoz:"_badge_voz_sg347_813",badge_sm:"_badge_sm_sg347_845",badgeSm:"_badge_sm_sg347_845",badge_md:"_badge_md_sg347_857",badgeMd:"_badge_md_sg347_857",badge_lg:"_badge_lg_sg347_869",badgeLg:"_badge_lg_sg347_869",badge_estirada:"_badge_estirada_sg347_881",badgeEstirada:"_badge_estirada_sg347_881",badge_icono:"_badge_icono_sg347_901",badgeIcono:"_badge_icono_sg347_901",badge_texto:"_badge_texto_sg347_927",badgeTexto:"_badge_texto_sg347_927",badge_mic:"_badge_mic_sg347_937",badgeMic:"_badge_mic_sg347_937",badge_tts:"_badge_tts_sg347_945",badgeTts:"_badge_tts_sg347_945",badge_ondas:"_badge_ondas_sg347_955",badgeOndas:"_badge_ondas_sg347_955",badge_onda:"_badge_onda_sg347_955",badgeOnda:"_badge_onda_sg347_955",badge_eq:"_badge_eq_sg347_995",badgeEq:"_badge_eq_sg347_995",descripcion:"_descripcion_sg347_1137",mensaje_error:"_mensaje_error_sg347_1147",mensajeError:"_mensaje_error_sg347_1147",ancho_total:"_ancho_total_sg347_1159",anchoTotal:"_ancho_total_sg347_1159"};function he({tipo:s,texto:c,size:x="md",estirar:y}){const v=s==="mic";return e.jsxs("span",{className:E(a.badge_voz,v?a.badge_mic:a.badge_tts,a[`badge_${x}`],y&&a.badge_estirada),"data-tipo":s,children:[e.jsx("span",{className:a.badge_icono,children:v?e.jsx(ge,{}):e.jsx(be,{})}),e.jsx("span",{className:a.badge_texto,children:c}),v?e.jsxs("span",{className:a.badge_ondas,"aria-hidden":"true",children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]}):e.jsxs("span",{className:a.badge_eq,"aria-hidden":"true",children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]})]})}function Se({isDisabled:s,isReadOnly:c,value:x,onChange:y,redimensionar:v,idioma:b="es-ES"}){const[m,h]=n.useState(!1),[z,S]=n.useState(!1),[j,F]=n.useState(null),k=n.useRef(null),M=n.useRef(!1),I=n.useRef(!1);n.useEffect(()=>{M.current=z},[z]),n.useEffect(()=>{I.current=m},[m]);const N=typeof window<"u"&&"speechSynthesis"in window,l=typeof window<"u"&&(!!window.SpeechRecognition||!!window.webkitSpeechRecognition),u=()=>{N&&(window.speechSynthesis.cancel(),h(!1))},A=()=>{if(!N||!x||M.current)return;if(k.current&&typeof k.current.stop=="function")try{k.current.stop()}catch{}window.speechSynthesis.cancel();const o=new window.SpeechSynthesisUtterance(x);o.lang=b,o.onstart=()=>h(!0),o.onend=()=>h(!1),window.speechSynthesis.speak(o)},U=()=>{const o=k.current;if(o&&typeof o.stop=="function")try{o.stop()}catch{}},r=()=>{if(!l||s||c||I.current){F("Dictado no disponible o está reproduciendo audio.");return}if(z&&k.current&&typeof k.current.stop=="function"){try{k.current.stop()}catch{}return}const o=window.SpeechRecognition||window.webkitSpeechRecognition;if(!o){F("No se pudo iniciar el reconocimiento de voz.");return}const t=new o;k.current=t,t.lang=b,t.interimResults=!0,t.continuous=!0,t.maxAlternatives=1;let g="";t.onresult=p=>{let T="";for(let f=p.resultIndex;f<p.results.length;f++){const B=p.results[f];B.isFinal?g+=B[0].transcript:T+=B[0].transcript}const H=(g+T).trim();y?.(H),v?.()},t.onerror=p=>{S(!1),F(p?.error??"error")},t.onend=()=>S(!1),F(null),S(!0);try{t.start()}catch{}},i=()=>{U(),u()};return n.useEffect(()=>()=>i(),[]),{puedeHablar:N,hablando:m,escuchar:A,detenerHablar:u,puedeEscuchar:l,escuchando:z,errorDictado:j,dictar:r,detenerDictado:U,detenerTodo:i}}const me=n.forwardRef((s,c)=>{const{children:x,variant:y="flat",color:v="default",size:b="md",radius:m="md",label:h,labelPlacement:z="inside",fullWidth:S=!0,value:j,defaultValue:F,placeholder:k,startContent:M,endContent:I,isRequired:N=!1,isReadOnly:l,isDisabled:u=!1,isClearable:A=!1,isInvalid:U,validationState:r,description:i,errorMessage:o,validate:t,minRows:g=3,maxRows:p=8,disableAutosize:T=!1,disableAnimation:H=!1,classNames:f,id:B,name:Z,rows:G,onChange:te,onClear:ie}=s,ce=n.useId(),Q=B??`ta-${ce}`,J=j!=null,[R,se]=n.useState(F??""),d=J?j:R,[X,O]=n.useState(!1),[K,W]=n.useState(null),D=U??(r==="invalid"?!0:r==="valid"?!1:!!K),V={invalido:!!D,mensaje:K};n.useEffect(()=>{if(!t)return W(null);const C=t(d);C===!0||C==null?W(null):W(typeof C=="string"?C:C.message??"Entrada inválida")},[d,t]);const q=n.useRef(null),Y=n.useCallback(()=>{if(!q.current||T)return;const C=q.current;C.style.height="auto";const Be=Math.min(Math.max(C.scrollHeight,g*24),p*24);C.style.height=`${Be}px`},[T,g,p]);n.useEffect(()=>{Y()},[d,Y]),n.useImperativeHandle(c,()=>q.current);const{puedeHablar:ee,hablando:L,escuchar:oe,detenerHablar:ne,puedeEscuchar:ae,escuchando:P,errorDictado:re,dictar:Me,detenerDictado:Ae}=Se({isDisabled:u,isReadOnly:l,value:d,onChange:C=>{J||se(C),te?.(C)},redimensionar:Y}),qe=C=>{u||l||(J||se(C.target.value),te?.(C.target.value))},Le=()=>{u||l||(J||se(""),te?.(""),ie?.(),requestAnimationFrame(()=>q.current?.focus()))},je=()=>L?ne():oe(),Ie=()=>P?Ae():Me(),_e=typeof o=="function"?o(V):o??K,Te=A&&!!d&&!l&&!u,pe=P||L,De=z==="inside"&&(h||A||ee||ae),fe=i?`${Q}-desc`:void 0,ve=_e||re?`${Q}-err`:void 0,Fe=[fe,ve].filter(Boolean).join(" ")||void 0,He=E(a.contenedor_base,a[`variante_${y}`],a[`color_${v}`],a[`tam_${b}`],a[`radio_${m}`],S&&a.ancho_total,H&&a.sin_animacion,u&&a.deshabilitado,z==="outside"&&a.label_outside,D&&a.invalido,X&&a.enfocado,f?.base),we=()=>e.jsxs("div",{className:a.acciones_header,children:[e.jsx("button",{type:"button",className:E(a.boton_tts,L&&a.boton_activo),onClick:je,disabled:!ee||!L&&(!d||P),title:"Escuchar","aria-pressed":L,children:e.jsx(be,{})}),ae&&e.jsx("button",{type:"button",className:E(a.boton_tts,P&&a.boton_activo_mic),onClick:Ie,disabled:u||l||L,title:"Dictar","aria-pressed":P,children:P?e.jsx(Ce,{color:"red"}):e.jsx(ge,{})}),Te&&e.jsx("button",{type:"button",className:a.boton_limpiar,onClick:Le,title:"Limpiar","aria-label":"Limpiar contenido",children:"×"})]}),ye=()=>e.jsxs(e.Fragment,{children:[e.jsx(ue,{mostrar:P,children:e.jsx(he,{tipo:"mic",texto:"Habla ahora",size:b})}),e.jsx(ue,{mostrar:L,children:e.jsx(he,{tipo:"tts",texto:"Reproduciendo",size:b})})]});return e.jsxs("div",{className:He,children:[z==="outside"&&e.jsxs("div",{className:a.fila_acciones,children:[h&&e.jsxs("label",{className:E(a.etiqueta,a.etiqueta_externa,f?.label),htmlFor:Q,children:[h," ",N&&e.jsx("span",{className:a.marca_requerido,children:"*"})]}),e.jsxs("div",{className:a.acciones_grupo,children:[we(),e.jsx("div",{className:E(a.badges_wrap,pe&&a.badges_wrap_visible),"aria-live":"polite",role:"status",children:ye()})]})]}),e.jsxs("div",{className:E(a.envoltorio_input,f?.inputWrapper),children:[De&&e.jsxs("div",{className:E(a.encabezado_interno,f?.headerWrapper),children:[h&&e.jsxs("label",{className:E(a.etiqueta_interna,f?.label),htmlFor:Q,children:[h," ",N&&e.jsx("span",{className:a.marca_requerido,children:"*"})]}),e.jsxs("div",{className:a.acciones_grupo,children:[we(),e.jsx("div",{className:E(a.badges_wrap,pe&&a.badges_wrap_visible),"aria-live":"polite",role:"status",children:ye()})]})]}),e.jsxs("div",{className:E(a.contenedor_interior,f?.innerWrapper),children:[M&&e.jsx("div",{className:a.inicio,children:M}),e.jsx("textarea",{ref:q,id:Q,name:Z,placeholder:k,value:J?d:void 0,defaultValue:J?void 0:F??"",onChange:qe,onFocus:()=>O(!0),onBlur:()=>O(!1),className:E(a.entrada,T&&a.sin_autosize,f?.input),readOnly:l,disabled:u,rows:G??g,"aria-invalid":D||void 0,"aria-describedby":Fe}),I&&e.jsx("div",{className:a.fin,children:I})]})]}),i&&e.jsx("div",{id:fe,className:E(a.descripcion,f?.description),children:i}),(_e||re)&&e.jsxs("div",{id:ve,className:E(a.mensaje_error,f?.errorMessage),children:[_e,re&&e.jsx("span",{className:a.mensaje_error,children:re})]}),x]})});me.displayName="TextArea",$.Boton=de,$.FirmaManual=le,$.TextArea=me,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
|
|
3
|
-
|
|
1
|
+
(function(ce,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],l):(ce=typeof globalThis<"u"?globalThis:ce||self,l(ce.CoreKitUI={},ce.jsxRuntime,ce.React,ce.ReactDOM))})(this,(function(ce,l,v,Zn){"use strict";function Xo(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 I=Xo(v),Jn=Xo(Zn);function Yo(e){var n,t,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(n=0;n<r;n++)e[n]&&(t=Yo(e[n]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function W(){for(var e,n,t=0,o="",r=arguments.length;t<r;t++)(e=arguments[t])&&(n=Yo(e))&&(o&&(o+=" "),o+=n);return o}const Zo=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Jo=W,is=(e,n)=>t=>{var o;if((n==null?void 0:n.variants)==null)return Jo(e,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:r,defaultVariants:i}=n,s=Object.keys(r).map(u=>{const f=t==null?void 0:t[u],h=i==null?void 0:i[u];if(f===null)return null;const g=Zo(f)||Zo(h);return r[u][g]}),a=t&&Object.entries(t).reduce((u,f)=>{let[h,g]=f;return g===void 0||(u[h]=g),u},{}),d=n==null||(o=n.compoundVariants)===null||o===void 0?void 0:o.reduce((u,f)=>{let{class:h,className:g,...c}=f;return Object.entries(c).every(p=>{let[_,m]=p;return Array.isArray(m)?m.includes({...i,...a}[_]):{...i,...a}[_]===m})?[...u,h,g]:u},[]);return Jo(e,s,d,t==null?void 0:t.class,t==null?void 0:t.className)},ve={boton:"_boton_15fyn_1",animated:"_animated_15fyn_61",disabled:"_disabled_15fyn_61",loading:"_loading_15fyn_61",content:"_content_15fyn_69",spinner:"_spinner_15fyn_71",spinner_icon:"_spinner_icon_15fyn_111",ripple:"_ripple_15fyn_147",solid:"_solid_15fyn_199",bordered:"_bordered_15fyn_219",ghost:"_ghost_15fyn_239",light:"_light_15fyn_263",faded:"_faded_15fyn_283",shadow:"_shadow_15fyn_303",only_loading:"_only_loading_15fyn_355",sm:"_sm_15fyn_373",md:"_md_15fyn_387",lg:"_lg_15fyn_401",full_width:"_full_width_15fyn_415",icon_only:"_icon_only_15fyn_423",radius_none:"_radius_none_15fyn_465",radius_sm:"_radius_sm_15fyn_473",radius_md:"_radius_md_15fyn_481",radius_lg:"_radius_lg_15fyn_489",radius_full:"_radius_full_15fyn_497",primary:"_primary_15fyn_505",secondary:"_secondary_15fyn_515",success:"_success_15fyn_525",warning:"_warning_15fyn_535",danger:"_danger_15fyn_545",default:"_default_15fyn_555"},ss=is(ve.boton,{variants:{variant:{solid:ve.solid,bordered:ve.bordered,ghost:ve.ghost,light:ve.light,faded:ve.faded,shadow:ve.shadow},color:{default:ve.default,primary:ve.primary,secondary:ve.secondary,success:ve.success,warning:ve.warning,danger:ve.danger},size:{sm:ve.sm,md:ve.md,lg:ve.lg},radius:{none:ve.radius_none,sm:ve.radius_sm,md:ve.radius_md,lg:ve.radius_lg,full:ve.radius_full},fullWidth:{true:ve.full_width},isIconOnly:{true:ve.icon_only},isLoading:{true:ve.loading},onlyLoading:{true:ve.only_loading},isDisabled:{true:ve.disabled},disableAnimation:{false:ve.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md",disableAnimation:!0}}),lt=({variant:e="solid",color:n="default",size:t="md",radius:o="md",fullWidth:r=!1,isLoading:i=!1,onlyLoading:s=!1,isDisabled:a=!1,isIconOnly:d=!1,disableRipple:u=!1,disableAnimation:f=!0,customColor:h,spinner:g,spinnerPlacement:c="end",children:p,className:_,onClick:m,style:b,type:w="button","aria-label":C,...S})=>{const x=a||i,y=P=>{if(x){P.preventDefault();return}if(m==null||m(P),u||x||!(P.currentTarget instanceof HTMLElement))return;const U=P.currentTarget,z=document.createElement("span"),k=U.getBoundingClientRect(),A=Math.max(k.width,k.height);z.className=ve.ripple,z.style.width=`${A}px`,z.style.height=`${A}px`,z.style.left=`${P.clientX-k.left}px`,z.style.top=`${P.clientY-k.top}px`,z.addEventListener("animationend",()=>z.remove(),{once:!0}),U.appendChild(z)},M=h?{"--btn-color":h,"--btn-text-color":h,...b}:b,E=ss({variant:e,color:h?void 0:n,size:t,radius:o,fullWidth:r,isIconOnly:d,isLoading:i,onlyLoading:s,isDisabled:x,disableAnimation:f}),T=i&&l.jsx("span",{className:ve.spinner,"aria-hidden":s?void 0:"true",children:g||l.jsx("span",{className:ve.spinner_icon})}),F=s&&!C?"Cargando":C;return l.jsxs("button",{...S,type:w,"aria-label":F,"aria-busy":i,className:W(E,_),disabled:x,onClick:y,style:M,children:[c==="start"&&T,p&&!s&&l.jsx("span",{className:ve.content,children:p}),c==="end"&&T]})},xe={dialog:"_dialog_1vo1g_1",modal:"_modal_1vo1g_69",encabezado:"_encabezado_1vo1g_93",titulo:"_titulo_1vo1g_107",boton_cerrar:"_boton_cerrar_1vo1g_121",texto_esc:"_texto_esc_1vo1g_157",icono_x:"_icono_x_1vo1g_171",contenedor_lienzo:"_contenedor_lienzo_1vo1g_181",area_firma:"_area_firma_1vo1g_191",lienzo:"_lienzo_1vo1g_205",lienzo_deshabilitado:"_lienzo_deshabilitado_1vo1g_233",barra_acciones:"_barra_acciones_1vo1g_243",grupo_izquierda:"_grupo_izquierda_1vo1g_259",separador:"_separador_1vo1g_271",boton_accion:"_boton_accion_1vo1g_283",boton_guardar:"_boton_guardar_1vo1g_329",icono:"_icono_1vo1g_171",contenedor_consentimiento:"_contenedor_consentimiento_1vo1g_379",contenedor_checkbox:"_contenedor_checkbox_1vo1g_393",checkbox_nativo:"_checkbox_nativo_1vo1g_409",checkbox_custom:"_checkbox_custom_1vo1g_423",texto_consentimiento:"_texto_consentimiento_1vo1g_489",contenedor_subir:"_contenedor_subir_1vo1g_505",boton_subir:"_boton_subir_1vo1g_515",input_archivo:"_input_archivo_1vo1g_551"},as=({className:e,title:n="Deshacer"})=>l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[l.jsx("title",{children:n}),l.jsx("path",{d:"M3 7v6h6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),l.jsx("path",{d:"M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),ls=({className:e,title:n="Limpiar"})=>l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[l.jsx("title",{children:n}),l.jsx("path",{d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),cs=({className:e,title:n="Adjuntar"})=>l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[l.jsx("title",{children:n}),l.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M17 8l-5-5-5 5M12 3v12",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),us=({className:e,title:n="Cerrar"})=>l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[l.jsx("title",{children:n}),l.jsx("path",{d:"M6 18L18 6M6 6l12 12",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),ds=()=>{const e=v.useRef(null),[n,t]=v.useState(!1),[o,r]=v.useState(!0),[i,s]=v.useState(null),[a,d]=v.useState([]),[u,f]=v.useState([]),h=v.useCallback(()=>{const S=e.current,x=S==null?void 0:S.getContext("2d");S&&x&&(x.clearRect(0,0,S.width,S.height),r(!0),d([]),f([]))},[]),g=v.useCallback(()=>{if(a.length===0)return;const S=a.slice(0,-1);d(S);const x=e.current,y=x==null?void 0:x.getContext("2d");!x||!y||(y.clearRect(0,0,x.width,x.height),S.forEach(M=>{if(!(M.puntos.length<2)){y.strokeStyle=M.color,y.beginPath(),y.moveTo(M.puntos[0].x,M.puntos[0].y);for(let E=1;E<M.puntos.length;E++)y.lineTo(M.puntos[E].x,M.puntos[E].y);y.stroke()}}),r(S.length===0))},[a]),c=v.useCallback(S=>{const x=e.current;if(!x)return{x:0,y:0};const y=x.getBoundingClientRect(),M=x.width/y.width,E=x.height/y.height;return"touches"in S?{x:(S.touches[0].clientX-y.left)*M,y:(S.touches[0].clientY-y.top)*E}:{x:(S.clientX-y.left)*M,y:(S.clientY-y.top)*E}},[]),p=v.useCallback((S,x)=>{const y=e.current,M=y==null?void 0:y.getContext("2d");M&&(M.beginPath(),M.moveTo(S.x,S.y),M.lineTo(x.x,x.y),M.stroke(),r(!1))},[]),_=v.useCallback(S=>{S.preventDefault();const x=c(S);t(!0),s(x),f([x])},[c]),m=v.useCallback(S=>{if(!n||!i)return;S.preventDefault();const x=c(S);p(i,x),s(x),f(y=>[...y,x])},[n,i,c,p]),b=v.useCallback(()=>{if(n&&u.length>0){const S=e.current,x=S==null?void 0:S.getContext("2d"),y={puntos:u,color:(x==null?void 0:x.strokeStyle)||"#000000"};d(M=>[...M,y]),f([])}t(!1),s(null)},[n,u]),w=v.useCallback(()=>{const S=e.current;return!S||o?null:S.toDataURL("image/png")},[o]),C=v.useCallback((S,x=!0)=>{const y=e.current,M=y==null?void 0:y.getContext("2d");if(!(!y||!M))return M.strokeStyle=S,M.lineWidth=4,M.lineCap="round",M.lineJoin="round",x?(y.addEventListener("mousedown",_),y.addEventListener("mousemove",m),y.addEventListener("mouseup",b),y.addEventListener("mouseout",b),y.addEventListener("touchstart",_),y.addEventListener("touchmove",m),y.addEventListener("touchend",b),()=>{y.removeEventListener("mousedown",_),y.removeEventListener("mousemove",m),y.removeEventListener("mouseup",b),y.removeEventListener("mouseout",b),y.removeEventListener("touchstart",_),y.removeEventListener("touchmove",m),y.removeEventListener("touchend",b)}):()=>{}},[_,m,b]);return{canvasRef:e,estaVacio:o,limpiarCanvas:h,deshacerUltimoTrazo:g,puedeDeshacer:a.length>0,obtenerDatosFirma:w,configurarCanvas:C}},Qo=v.forwardRef(({isOpen:e=!1,onClose:n,onConfirm:t,titulo:o="Firmar el contrato",textoGuardar:r="Guardar firma",textoModificar:i="Modificar firma",textoDeshacer:s="Deshacer",textoLimpiar:a="Limpiar",textoAdjuntar:d="Adjuntar firma",ancho:u=500,alto:f=200,className:h,textoConsentimiento:g="Al firmar, confirmo que he leído y acepto todos los términos contractuales",mostrarBotonSubir:c=!1,cerrarAlGuardar:p=!1},_)=>{const{canvasRef:m,estaVacio:b,limpiarCanvas:w,deshacerUltimoTrazo:C,obtenerDatosFirma:S,configurarCanvas:x,puedeDeshacer:y}=ds(),M=v.useRef(null),E=v.useRef(null),[T,F]=v.useState(!1),[P,U]=v.useState(!1),[z,k]=v.useState(!1);v.useImperativeHandle(_,()=>({limpiar:w,obtenerDatosFirma:S,estaVacio:()=>b})),v.useEffect(()=>{if(e&&m.current){const L=m.current,ue=(()=>{const B=document.documentElement.getAttribute("data-theme"),pe=window.matchMedia("(prefers-color-scheme: dark)").matches;return B==="dark"||B===null&&pe})()?"#ffffff":"#000000",we=x(ue,!z),ye=new MutationObserver(()=>{const B=document.documentElement.getAttribute("data-theme"),pe=window.matchMedia("(prefers-color-scheme: dark)").matches,K=B==="dark"||B===null&&pe?"#ffffff":"#000000",J=L.getContext("2d");J&&(J.strokeStyle=K)});return ye.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>{we==null||we(),ye.disconnect()}}},[e,x,m,z]),v.useEffect(()=>{const L=M.current;if(L)return e?(L.showModal(),document.body.style.overflow="hidden"):(L.close(),document.body.style.overflow=""),()=>{document.body.style.overflow=""}},[e]);const A=v.useCallback(()=>{n&&(U(!1),F(!1),k(!1),n())},[n]);v.useEffect(()=>{if(!e)return;const L=re=>{re.key==="Escape"&&A()};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[e,A]);const O=v.useCallback(L=>{const re=M.current;if(!re)return;const Z=re.getBoundingClientRect();(L.clientX<Z.left||L.clientX>Z.right||L.clientY<Z.top||L.clientY>Z.bottom)&&A()},[A]),D=()=>{const L=S();L&&t&&T&&(U(!0),t(L),p&&n&&A())},$=()=>{U(!1),k(!1),w()},N=L=>{var ue;const re=(ue=L.target.files)==null?void 0:ue[0];if(!re||!m.current)return;const Z=new FileReader;Z.onload=we=>{var B;const ye=new Image;ye.onload=()=>{const pe=m.current,Ee=pe==null?void 0:pe.getContext("2d");if(!pe||!Ee)return;Ee.clearRect(0,0,pe.width,pe.height);const K=pe.width,J=pe.height,X=K/J,Y=ye.width/ye.height;let oe,te,se,de;Y>X?(oe=K,te=K/Y,se=0,de=(J-te)/2):(te=J,oe=J*Y,se=(K-oe)/2,de=0),Ee.drawImage(ye,se,de,oe,te),k(!0)},ye.src=(B=we.target)==null?void 0:B.result},Z.readAsDataURL(re)},j=()=>{var L;(L=E.current)==null||L.click()},_e=P||z,fe=!P&&(b&&!z||!T);return e?l.jsx("dialog",{ref:M,className:`${xe.dialog} ${h||""}`,onClick:O,"aria-labelledby":"firma-titulo","aria-describedby":"firma-consentimiento",children:l.jsxs("div",{className:xe.modal,children:[l.jsxs("header",{className:xe.encabezado,children:[l.jsx("h2",{id:"firma-titulo",className:xe.titulo,children:o}),l.jsxs("button",{className:xe.boton_cerrar,onClick:A,type:"button","aria-label":"Cerrar",children:[l.jsx("span",{className:xe.texto_esc,children:"ESC"}),l.jsx(us,{className:xe.icono_x})]})]}),l.jsx("div",{className:xe.contenedor_lienzo,children:l.jsxs("div",{className:xe.area_firma,children:[l.jsx("canvas",{ref:m,className:`${xe.lienzo} ${_e?xe.lienzo_deshabilitado:""}`,width:u*2,height:f*2,style:{pointerEvents:_e?"none":"auto"},"aria-label":"Área de firma"}),l.jsxs("div",{className:xe.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[l.jsxs("div",{className:xe.grupo_izquierda,children:[l.jsxs("button",{className:xe.boton_accion,onClick:C,type:"button",disabled:!y||_e,"aria-label":s,children:[l.jsx(as,{className:xe.icono,"aria-hidden":"true"}),l.jsx("span",{children:s})]}),l.jsx("span",{className:xe.separador,"aria-hidden":"true",children:"|"}),l.jsxs("button",{className:xe.boton_accion,onClick:w,type:"button",disabled:b||_e,"aria-label":a,children:[l.jsx(ls,{className:xe.icono,"aria-hidden":"true"}),l.jsx("span",{children:a})]})]}),l.jsx("button",{className:xe.boton_guardar,onClick:P?$:D,type:"button",disabled:fe,children:P?i:r})]})]})}),l.jsx("div",{className:xe.contenedor_consentimiento,children:l.jsxs("label",{className:xe.contenedor_checkbox,children:[l.jsx("input",{type:"checkbox",className:xe.checkbox_nativo,checked:T,onChange:L=>F(L.target.checked),"aria-describedby":"firma-consentimiento"}),l.jsx("span",{className:xe.checkbox_custom,"aria-hidden":"true"}),l.jsx("span",{id:"firma-consentimiento",className:xe.texto_consentimiento,children:g})]})}),c&&l.jsxs("div",{className:xe.contenedor_subir,children:[l.jsx("input",{ref:E,type:"file",accept:"image/*",className:xe.input_archivo,onChange:N,"aria-label":"Subir imagen de firma"}),l.jsxs("button",{className:xe.boton_subir,onClick:j,type:"button",children:[l.jsx(cs,{className:xe.icono,"aria-hidden":"true"}),d]})]})]})}):null});Qo.displayName="FirmaManual";const fs="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let gn=(e=21)=>{let n="",t=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=fs[t[e]&63];return n};const gs=({size:e="1em",...n})=>l.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:[l.jsx("path",{d:"M18 6 6 18"}),l.jsx("path",{d:"m6 6 12 12"})]}),_s=({size:e="1em",...n})=>l.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:[l.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"}),l.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),ps=({size:e="1em",...n})=>l.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:[l.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"}),l.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),l.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"}),l.jsx("path",{d:"m2 2 20 20"})]}),Me={contenedor_base:"_contenedor_base_h27e6_1",tam_sm:"_tam_sm_h27e6_39",tam_lg:"_tam_lg_h27e6_53",radio_none:"_radio_none_h27e6_67",radio_sm:"_radio_sm_h27e6_75",radio_md:"_radio_md_h27e6_83",radio_lg:"_radio_lg_h27e6_91",radio_full:"_radio_full_h27e6_99",color_default:"_color_default_h27e6_107",color_primary:"_color_primary_h27e6_109",color_secondary:"_color_secondary_h27e6_117",color_success:"_color_success_h27e6_125",color_warning:"_color_warning_h27e6_133",color_danger:"_color_danger_h27e6_141",etiqueta:"_etiqueta_h27e6_149",marca_requerido:"_marca_requerido_h27e6_167",envoltorio_input:"_envoltorio_input_h27e6_193",envoltorio_interno:"_envoltorio_interno_h27e6_219",entrada:"_entrada_h27e6_235",contenido_inicio:"_contenido_inicio_h27e6_293",contenido_final:"_contenido_final_h27e6_295",boton_limpiar:"_boton_limpiar_h27e6_313",tiene_contenido:"_tiene_contenido_h27e6_365",boton_password:"_boton_password_h27e6_375",descripcion:"_descripcion_h27e6_419",mensaje_error:"_mensaje_error_h27e6_431",ancho_total:"_ancho_total_h27e6_443",variante_bordered:"_variante_bordered_h27e6_451",variante_faded:"_variante_faded_h27e6_461",variante_underlined:"_variante_underlined_h27e6_471",variante_ghost:"_variante_ghost_h27e6_487",deshabilitado:"_deshabilitado_h27e6_499",solo_lectura:"_solo_lectura_h27e6_519",enfocado:"_enfocado_h27e6_535",valido:"_valido_h27e6_543",invalido:"_invalido_h27e6_551",sin_animacion:"_sin_animacion_h27e6_583"},er=v.forwardRef((e,n)=>{const{type:t="text",value:o,defaultValue:r,placeholder:i,variant:s="bordered",color:a="default",size:d="md",radius:u="md",fullWidth:f=!0,disableAnimation:h=!1,label:g,description:c,errorMessage:p,startContent:_,endContent:m,isRequired:b=!1,isReadOnly:w=!1,isDisabled:C=!1,isClearable:S=!1,isInvalid:x,validationState:y,validate:M,classNames:E,onChange:T,onClear:F,onValueChange:P,onFocus:U,onBlur:z,onKeyDown:k,id:A,name:O,autoComplete:D,autoFocus:$,maxLength:N,minLength:j,pattern:_e,...fe}=e,L=v.useRef(null),Z=v.useRef(A??`input-text-${gn(8)}`).current;v.useImperativeHandle(n,()=>L.current);const ue=o!==void 0,[we,ye]=v.useState(r??""),B=ue?o:we,[pe,Ee]=v.useState(!1),[K,J]=v.useState(!1),X=v.useMemo(()=>{if(!M)return null;const le=M(B);return le===!0||le==null?null:typeof le=="string"?le:typeof le=="object"&&"message"in le?le.message??"Entrada inválida":"Entrada inválida"},[B,M]),Y=v.useMemo(()=>x!==void 0?x:y==="invalid"?!0:y==="valid"?!1:!!X,[x,y,X]),oe=y==="valid"&&!Y,te={invalido:Y,mensaje:X},se=B.length>0,de=t==="password",me=de&&K?"text":t,$e=S&&se&&!w&&!C,R=v.useCallback(le=>{if(C||w)return;const ke=le.target.value;ue||ye(ke),T==null||T(ke),P==null||P(ke)},[ue,C,w,T,P]),ne=v.useCallback(le=>{Ee(!0),U==null||U(le)},[U]),V=v.useCallback(le=>{Ee(!1),z==null||z(le)},[z]),ae=v.useCallback(()=>{var le;C||w||(ue||ye(""),T==null||T(""),P==null||P(""),F==null||F(),(le=L.current)==null||le.focus())},[ue,C,w,T,P,F]),he=v.useCallback(le=>{le.key==="Escape"&&S&&se&&ae(),k==null||k(le)},[S,se,ae,k]),Ce=v.useCallback(()=>{J(le=>!le),requestAnimationFrame(()=>{var le;return(le=L.current)==null?void 0:le.focus()})},[]),Be=c?`${Z}-desc`:void 0,Je=Y?`${Z}-err`:void 0,Ge=[Be,Je].filter(Boolean).join(" ")||void 0,ie=typeof p=="function"?p(te):p??X,Oe=W(Me.contenedor_base,Me[`variante_${s}`],Me[`tam_${d}`],Me[`radio_${u}`],Me[`color_${a}`],{[Me.ancho_total]:f,[Me.sin_animacion]:h,[Me.deshabilitado]:C,[Me.solo_lectura]:w,[Me.invalido]:Y,[Me.valido]:oe,[Me.enfocado]:pe,[Me.tiene_contenido]:se},E==null?void 0:E.base);return l.jsxs("div",{className:Oe,children:[g&&l.jsxs("label",{className:W(Me.etiqueta,E==null?void 0:E.label),htmlFor:Z,children:[g,b&&l.jsx("span",{className:Me.marca_requerido,"aria-hidden":"true",children:"*"})]}),l.jsxs("div",{className:W(Me.envoltorio_input,E==null?void 0:E.inputWrapper),children:[_&&l.jsx("span",{className:Me.contenido_inicio,children:_}),l.jsx("div",{className:W(Me.envoltorio_interno,E==null?void 0:E.innerWrapper),children:l.jsx("input",{...fe,ref:L,id:Z,name:O,type:me,value:ue?B:void 0,defaultValue:ue?void 0:r,placeholder:i,disabled:C,readOnly:w,required:b,autoComplete:D,autoFocus:$,maxLength:N,minLength:j,pattern:_e,"aria-invalid":Y||void 0,"aria-describedby":Ge,"aria-required":b,className:W(Me.entrada,E==null?void 0:E.input),onChange:R,onFocus:ne,onBlur:V,onKeyDown:he})}),$e&&l.jsx("button",{type:"button",className:W(Me.boton_limpiar,E==null?void 0:E.clearButton),onClick:ae,tabIndex:-1,"aria-label":"Limpiar campo",children:l.jsx(gs,{size:"0.75em"})}),de&&l.jsx("button",{type:"button",className:Me.boton_password,onClick:Ce,tabIndex:-1,"aria-label":K?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":K,children:K?l.jsx(ps,{}):l.jsx(_s,{})}),m&&l.jsx("span",{className:Me.contenido_final,children:m})]}),c&&!Y&&l.jsx("div",{id:Be,className:W(Me.descripcion,E==null?void 0:E.description),children:c}),Y&&ie&&l.jsx("div",{id:Je,className:W(Me.mensaje_error,E==null?void 0:E.errorMessage),role:"alert",children:ie})]})});er.displayName="InputText";const hs=e=>l.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:[l.jsx("path",{d:"M5 12h14"}),l.jsx("path",{d:"M12 5v14"})]}),ms=e=>l.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:l.jsx("path",{d:"M5 12h14"})});function _n(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xt(e,n){if(e==null||Number.isNaN(e))return"";const{separadorMiles:t=!1,separadorDecimal:o=".",escalaDecimal:r,decimalesFijos:i=!1,prefijo:s="",sufijo:a=""}=n;let d;r!==void 0?d=i?e.toFixed(r):String(Math.round(e*Math.pow(10,r))/Math.pow(10,r)):d=String(e);const[u,f]=d.split(".");let h=u;if(t){const c=typeof t=="string"?t:",";h=u.replace(/\B(?=(\d{3})+(?!\d))/g,c)}let g=h;return f!==void 0?g+=o+f:i&&r&&r>0&&(g+=o+"0".repeat(r)),`${s}${g}${a}`}function tr(e,n){if(!e||e.trim()==="")return;const{separadorMiles:t=!1,separadorDecimal:o=".",prefijo:r="",sufijo:i="",permitirNegativo:s=!0}=n;let a=e;if(r&&(a=a.replace(new RegExp(`^${_n(r)}`),"")),i&&(a=a.replace(new RegExp(`${_n(i)}$`),"")),t){const u=typeof t=="string"?t:",";a=a.replace(new RegExp(_n(u),"g"),"")}o!=="."&&(a=a.replace(new RegExp(_n(o)),".")),s||(a=a.replace(/-/g,""));const d=parseFloat(a);return Number.isNaN(d)?void 0:d}function pn(e,n,t){let o=e;return n!==void 0&&o<n&&(o=n),t!==void 0&&o>t&&(o=t),o}function nr(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 or(e,n){const t=Math.pow(10,n);return Math.round(e*t)/t}const Fe={contenedor_base:"_contenedor_base_1pqk6_1",tam_sm:"_tam_sm_1pqk6_39",tam_lg:"_tam_lg_1pqk6_53",radio_none:"_radio_none_1pqk6_67",radio_sm:"_radio_sm_1pqk6_75",radio_md:"_radio_md_1pqk6_83",radio_lg:"_radio_lg_1pqk6_91",radio_full:"_radio_full_1pqk6_99",color_default:"_color_default_1pqk6_107",color_primary:"_color_primary_1pqk6_109",color_secondary:"_color_secondary_1pqk6_117",color_success:"_color_success_1pqk6_125",color_warning:"_color_warning_1pqk6_133",color_danger:"_color_danger_1pqk6_141",etiqueta:"_etiqueta_1pqk6_149",marca_requerido:"_marca_requerido_1pqk6_167",envoltorio_input:"_envoltorio_input_1pqk6_193",envoltorio_interno:"_envoltorio_interno_1pqk6_217",entrada:"_entrada_1pqk6_235",contenido_inicio:"_contenido_inicio_1pqk6_305",contenido_final:"_contenido_final_1pqk6_307",controles:"_controles_1pqk6_325",boton_control:"_boton_control_1pqk6_341",variante_bordered:"_variante_bordered_1pqk6_395",variante_faded:"_variante_faded_1pqk6_403",variante_underlined:"_variante_underlined_1pqk6_411",variante_ghost:"_variante_ghost_1pqk6_423",descripcion:"_descripcion_1pqk6_471",mensaje_error:"_mensaje_error_1pqk6_483",ancho_total:"_ancho_total_1pqk6_495",deshabilitado:"_deshabilitado_1pqk6_549",solo_lectura:"_solo_lectura_1pqk6_569",enfocado:"_enfocado_1pqk6_585",valido:"_valido_1pqk6_593",invalido:"_invalido_1pqk6_601",sin_animacion:"_sin_animacion_1pqk6_633"},rr=v.forwardRef((e,n)=>{const{value:t,defaultValue:o,placeholder:r,variant:i="bordered",color:s="default",size:a="md",radius:d="md",fullWidth:u=!0,disableAnimation:f=!1,label:h,description:g,errorMessage:c,startContent:p,endContent:_,isRequired:m=!1,isReadOnly:b=!1,isDisabled:w=!1,isInvalid:C,validationState:S,validate:x,classNames:y,min:M,max:E,step:T=1,decimalScale:F,fixedDecimalScale:P=!1,thousandSeparator:U=!1,decimalSeparator:z=".",prefix:k="",suffix:A="",allowNegative:O=!0,allowDecimal:D=!0,hideControls:$=!1,clampBehavior:N="blur",onChange:j,onValueChange:_e,onFocus:fe,onBlur:L,onKeyDown:re,id:Z,name:ue,...we}=e,ye=v.useRef(null),pe=v.useRef(Z??`input-numeric-${gn(8)}`).current;v.useImperativeHandle(n,()=>ye.current);const Ee=t!==void 0,[K,J]=v.useState(o!==void 0?o:void 0),[X,Y]=v.useState(""),[oe,te]=v.useState(!1),se=Ee?t===""?void 0:t:K,de=v.useMemo(()=>({separadorMiles:U,separadorDecimal:z,escalaDecimal:D?F:0,decimalesFijos:P,prefijo:k,sufijo:A,permitirNegativo:O}),[U,z,F,P,k,A,O,D]),me=v.useMemo(()=>{if(!x)return null;const q=nr(x(se));return q.invalido?q.mensaje:null},[se,x]),$e=v.useMemo(()=>C!==void 0?C:S==="invalid"?!0:S==="valid"?!1:!!me,[C,S,me]),R=S==="valid"&&!$e,ne={invalido:$e,mensaje:me},V=v.useCallback(q=>{Ee||J(q),j==null||j(q),_e==null||_e(Xt(q,de),q)},[Ee,j,_e,de]),ae=v.useCallback(q=>{let Pe=(se??0)+T*q;N!=="none"&&(Pe=pn(Pe,M,E)),F!==void 0&&(Pe=or(Pe,F)),V(Pe),Y(Xt(Pe,de))},[se,T,M,E,N,F,V,de]),he=v.useCallback(q=>{if(w||b)return;const ge=q.target.value,Pe=z===","?",":".";let Te="0-9";D&&(Te+=Pe),O&&(Te+="-");const at=new RegExp(`[^${Te}]`,"g");let Qe=ge.replace(at,"");if(D){const rt=Qe.split(Pe);rt.length>2&&(Qe=rt[0]+Pe+rt.slice(1).join(""))}if(O&&Qe.includes("-")){const rt=Qe.replace(/-/g,"");Qe=Qe.startsWith("-")?"-"+rt:rt}Y(Qe);const et=tr(Qe,de);if(N==="strict"&&et!==void 0){const rt=pn(et,M,E);V(rt)}else V(et)},[w,b,de,N,M,E,V,z,O,D]),Ce=v.useCallback(q=>{if(te(!0),se!==void 0){let ge=String(se);z!=="."&&(ge=ge.replace(".",z)),Y(ge)}fe==null||fe(q)},[se,z,fe]),Be=v.useCallback(q=>{if(te(!1),N==="blur"&&se!==void 0){const ge=pn(se,M,E);ge!==se&&V(ge)}Y(Xt(se,de)),L==null||L(q)},[se,N,M,E,V,de,L]),Je=v.useCallback(q=>{q.key==="ArrowUp"?(q.preventDefault(),ae(1)):q.key==="ArrowDown"&&(q.preventDefault(),ae(-1));const ge=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],Pe=q.ctrlKey||q.metaKey,Te=D&&(q.key===z||q.key==="."||q.key===","),at=q.key==="-"&&O,At=/^[0-9]$/.test(q.key);!ge.includes(q.key)&&!Pe&&!Te&&!at&&!At&&q.preventDefault(),re==null||re(q)},[ae,re,z,O,D]);v.useEffect(()=>{oe||Y(Xt(se,de))},[se,oe,de]);const Ge=g?`${pe}-desc`:void 0,ie=$e?`${pe}-err`:void 0,Oe=[Ge,ie].filter(Boolean).join(" ")||void 0,le=typeof c=="function"?c(ne):c??me,ke=E===void 0||(se??0)<E,wt=M===void 0||(se??0)>M,Ke=W(Fe.contenedor_base,Fe[`variante_${i}`],Fe[`tam_${a}`],Fe[`radio_${d}`],Fe[`color_${s}`],{[Fe.ancho_total]:u,[Fe.sin_animacion]:f,[Fe.deshabilitado]:w,[Fe.solo_lectura]:b,[Fe.invalido]:$e,[Fe.valido]:R,[Fe.enfocado]:oe},y==null?void 0:y.base);return l.jsxs("div",{className:Ke,children:[h&&l.jsxs("label",{className:W(Fe.etiqueta,y==null?void 0:y.label),htmlFor:pe,children:[h,m&&l.jsx("span",{className:Fe.marca_requerido,"aria-hidden":"true",children:"*"})]}),l.jsxs("div",{className:W(Fe.envoltorio_input,y==null?void 0:y.inputWrapper),children:[l.jsxs("div",{className:W(Fe.envoltorio_interno,y==null?void 0:y.innerWrapper),children:[p&&l.jsx("span",{className:Fe.contenido_inicio,children:p}),l.jsx("input",{...we,ref:ye,id:pe,name:ue,type:"text",inputMode:"decimal",value:X,placeholder:r,disabled:w,readOnly:b,required:m,"aria-invalid":$e||void 0,"aria-describedby":Oe,"aria-required":m,className:W(Fe.entrada,y==null?void 0:y.input),onChange:he,onFocus:Ce,onBlur:Be,onKeyDown:Je}),_&&l.jsx("span",{className:Fe.contenido_final,children:_})]}),!$&&!b&&!w&&l.jsxs("div",{className:W(Fe.controles,y==null?void 0:y.controls),children:[l.jsx("button",{type:"button",tabIndex:-1,className:W(Fe.boton_control,y==null?void 0:y.controlButton),disabled:!wt,onClick:()=>ae(-1),"aria-label":"Decrementar valor",children:l.jsx(ms,{})}),l.jsx("button",{type:"button",tabIndex:-1,className:W(Fe.boton_control,y==null?void 0:y.controlButton),disabled:!ke,onClick:()=>ae(1),"aria-label":"Incrementar valor",children:l.jsx(hs,{})})]})]}),g&&!$e&&l.jsx("div",{id:Ge,className:W(Fe.descripcion,y==null?void 0:y.description),children:g}),$e&&le&&l.jsx("div",{id:ie,className:W(Fe.mensaje_error,y==null?void 0:y.errorMessage),role:"alert",children:le})]})});rr.displayName="InputNumeric";function vs(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 bs(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 ws(){return new Date().toISOString().split("T")[0]}function ys(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 Le={contenedor_base:"_contenedor_base_k44n9_1",tam_sm:"_tam_sm_k44n9_39",tam_lg:"_tam_lg_k44n9_53",radio_none:"_radio_none_k44n9_67",radio_sm:"_radio_sm_k44n9_75",radio_md:"_radio_md_k44n9_83",radio_lg:"_radio_lg_k44n9_91",radio_full:"_radio_full_k44n9_99",color_default:"_color_default_k44n9_107",color_primary:"_color_primary_k44n9_109",color_secondary:"_color_secondary_k44n9_117",color_success:"_color_success_k44n9_125",color_warning:"_color_warning_k44n9_133",color_danger:"_color_danger_k44n9_141",etiqueta:"_etiqueta_k44n9_149",marca_requerido:"_marca_requerido_k44n9_167",envoltorio_input:"_envoltorio_input_k44n9_193",envoltorio_interno:"_envoltorio_interno_k44n9_219",entrada:"_entrada_k44n9_235",contenido_inicio:"_contenido_inicio_k44n9_305",descripcion:"_descripcion_k44n9_323",mensaje_error:"_mensaje_error_k44n9_335",ancho_total:"_ancho_total_k44n9_347",variante_bordered:"_variante_bordered_k44n9_355",variante_faded:"_variante_faded_k44n9_365",variante_underlined:"_variante_underlined_k44n9_375",variante_ghost:"_variante_ghost_k44n9_391",deshabilitado:"_deshabilitado_k44n9_403",solo_lectura:"_solo_lectura_k44n9_423",enfocado:"_enfocado_k44n9_439",valido:"_valido_k44n9_447",invalido:"_invalido_k44n9_455",sin_animacion:"_sin_animacion_k44n9_487"},ir=v.forwardRef((e,n)=>{const{value:t,defaultValue:o,placeholder:r,variant:i="bordered",color:s="default",size:a="md",radius:d="md",fullWidth:u=!0,disableAnimation:f=!1,label:h,description:g,errorMessage:c,startContent:p,isRequired:_=!1,isReadOnly:m=!1,isDisabled:b=!1,isInvalid:w,validationState:C,validate:S,classNames:x,min:y,max:M,onChange:E,onFocus:T,onBlur:F,id:P,name:U,...z}=e,k=v.useRef(null),O=v.useRef(P??`input-date-${gn(8)}`).current;v.useImperativeHandle(n,()=>k.current);const D=t!==void 0,[$,N]=v.useState(o??""),j=D?t:$,[_e,fe]=v.useState(!1),L=v.useMemo(()=>{if(!S)return null;const Y=vs(S(j));return Y.invalido?Y.mensaje:null},[j,S]),re=v.useMemo(()=>w!==void 0?w:C==="invalid"?!0:C==="valid"?!1:!!L,[w,C,L]),Z=C==="valid"&&!re,ue={invalido:re,mensaje:L},we=v.useCallback(Y=>{if(b||m)return;const oe=Y.target.value;D||N(oe),E==null||E(oe)},[D,b,m,E]),ye=v.useCallback(Y=>{fe(!0),T==null||T(Y)},[T]),B=v.useCallback(Y=>{fe(!1),F==null||F(Y)},[F]),pe=g?`${O}-desc`:void 0,Ee=re?`${O}-err`:void 0,K=[pe,Ee].filter(Boolean).join(" ")||void 0,J=typeof c=="function"?c(ue):c??L,X=W(Le.contenedor_base,Le[`variante_${i}`],Le[`tam_${a}`],Le[`radio_${d}`],Le[`color_${s}`],{[Le.ancho_total]:u,[Le.sin_animacion]:f,[Le.deshabilitado]:b,[Le.solo_lectura]:m,[Le.invalido]:re,[Le.valido]:Z,[Le.enfocado]:_e},x==null?void 0:x.base);return l.jsxs("div",{className:X,children:[h&&l.jsxs("label",{className:W(Le.etiqueta,x==null?void 0:x.label),htmlFor:O,children:[h,_&&l.jsx("span",{className:Le.marca_requerido,"aria-hidden":"true",children:"*"})]}),l.jsx("div",{className:W(Le.envoltorio_input,x==null?void 0:x.inputWrapper),children:l.jsxs("div",{className:W(Le.envoltorio_interno,x==null?void 0:x.innerWrapper),children:[p&&l.jsx("span",{className:Le.contenido_inicio,children:p}),l.jsx("input",{...z,ref:k,id:O,name:U,type:"date",value:D?j:void 0,defaultValue:D?void 0:o,placeholder:r,disabled:b,readOnly:m,required:_,min:y,max:M,"aria-invalid":re||void 0,"aria-describedby":K,"aria-required":_,className:W(Le.entrada,x==null?void 0:x.input),onChange:we,onFocus:ye,onBlur:B})]})}),g&&!re&&l.jsx("div",{id:pe,className:W(Le.descripcion,x==null?void 0:x.description),children:g}),re&&J&&l.jsx("div",{id:Ee,className:W(Le.mensaje_error,x==null?void 0:x.errorMessage),role:"alert",children:J})]})});ir.displayName="InputDate";const Cs={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function hn({mostrar:e,children:n,tipo:t="desvanecerDeslizar",className:o,...r}){const[i,s]=v.useState(e),[a,d]=v.useState(e?"entrada":null);e&&!i?(s(!0),d("entrada")):!e&&i&&a!=="salida"&&d("salida");const u=()=>{a==="entrada"?d(null):a==="salida"&&(s(!1),d(null))};if(!i)return null;const f=Cs[t||"desvanecer"],h=a?`transicion_${f}_${a}`:"";return l.jsx("div",{...r,onAnimationEnd:u,className:`${h} ${o||""}`.trim(),children:n})}const ft={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 Qn(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:l.jsxs("g",{fill:"currentColor",children:[l.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),l.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 eo(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...e,children:l.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 sr(e){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...e,children:[l.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),l.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 to({tipo:e,texto:n,size:t="md",estirar:o}){const r=e==="mic";return l.jsxs("span",{className:W(ft.badge_voz,r?ft.badge_mic:ft.badge_tts,ft[`badge_${t}`],o&&ft.badge_estirada),"data-tipo":e,children:[l.jsx("span",{className:ft.badge_icono,children:r?l.jsx(Qn,{}):l.jsx(eo,{})}),l.jsx("span",{className:ft.badge_texto,children:n}),r?l.jsxs("span",{className:ft.badge_ondas,"aria-hidden":"true",children:[l.jsx("span",{}),l.jsx("span",{}),l.jsx("span",{})]}):l.jsxs("span",{className:ft.badge_eq,"aria-hidden":"true",children:[l.jsx("span",{}),l.jsx("span",{}),l.jsx("span",{}),l.jsx("span",{})]})]})}function ar({value:e,onChange:n,isDisabled:t,isReadOnly:o,onDictadoCompleto:r,idioma:i="es-ES"}){const[s,a]=v.useState(!1),[d,u]=v.useState(!1),[f,h]=v.useState(null),g=v.useRef(null),c=v.useRef(null),p=v.useRef(null),_=v.useRef(""),m=typeof window<"u"&&"speechSynthesis"in window,b=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),w=v.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),m&&window.speechSynthesis.cancel(),c.current=null,a(!1)},[m]),C=v.useCallback(()=>{if(!m||!e)return;if(w(),g.current){try{g.current.stop()}catch(M){console.error("Error stopping recognition:",M)}g.current=null,u(!1)}const y=new SpeechSynthesisUtterance(e);y.lang=i,y.onstart=()=>a(!0),y.onend=()=>{a(!1),c.current=null},y.onerror=()=>{a(!1),c.current=null},c.current=y,window.speechSynthesis.speak(y)},[m,e,i,w]),S=v.useCallback(()=>{if(g.current)try{g.current.stop()}catch(y){console.error("Error stopping recognition:",y)}u(!1),h(null)},[]),x=v.useCallback(()=>{if(!b||t||o)return;w();const y=window,M=y.SpeechRecognition||y.webkitSpeechRecognition;if(!M){h("Navegador no compatible");return}try{const E=new M;E.continuous=!0,E.interimResults=!0,E.lang=i,E.onstart=()=>{u(!0),h(null),_.current=e||""},E.onend=()=>{u(!1),g.current=null,r==null||r()},E.onerror=T=>{T.error!=="no-speech"&&(u(!1),g.current=null,T.error!=="aborted"&&h("Error al reconocer voz"))},E.onresult=T=>{try{let F="";for(let z=0;z<T.results.length;z++)F+=T.results[z][0].transcript;const P=_.current&&F?" ":"",U=_.current+P+F;n(U)}catch{h("Error procesando dictado")}},g.current=E,E.start()}catch{h("No se pudo iniciar dictado"),u(!1)}},[b,t,o,e,n,i,w,r]);return v.useEffect(()=>()=>{p.current&&clearTimeout(p.current),m&&window.speechSynthesis.cancel(),g.current&&g.current.abort()},[m]),{puedeHablar:m,puedeEscuchar:b,hablando:s,escuchando:d,errorDictado:f,escuchar:C,detenerHablar:w,dictar:x,detenerDictado:S}}function Ss({size:e="1em",className:n}){return l.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:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}const Ie={contenedor_base:"_contenedor_base_1sp58_1",tam_sm:"_tam_sm_1sp58_29",tam_lg:"_tam_lg_1sp58_41",radio_none:"_radio_none_1sp58_53",radio_sm:"_radio_sm_1sp58_61",radio_md:"_radio_md_1sp58_69",radio_lg:"_radio_lg_1sp58_77",radio_full:"_radio_full_1sp58_85",color_default:"_color_default_1sp58_93",color_primary:"_color_primary_1sp58_95",color_secondary:"_color_secondary_1sp58_103",color_success:"_color_success_1sp58_111",color_warning:"_color_warning_1sp58_119",color_danger:"_color_danger_1sp58_127",etiqueta:"_etiqueta_1sp58_135",marca_requerido:"_marca_requerido_1sp58_153",envoltorio_input:"_envoltorio_input_1sp58_179",entrada:"_entrada_1sp58_203",sin_autosize:"_sin_autosize_1sp58_253",barra_acciones:"_barra_acciones_1sp58_261",badges_contenedor:"_badges_contenedor_1sp58_281",botones_grupo:"_botones_grupo_1sp58_295",boton_accion:"_boton_accion_1sp58_307",boton_activo_tts:"_boton_activo_tts_1sp58_369",haloTts:"_haloTts_1sp58_1",boton_activo_mic:"_boton_activo_mic_1sp58_399",haloMic:"_haloMic_1sp58_1",boton_limpiar:"_boton_limpiar_1sp58_487",descripcion:"_descripcion_1sp58_535",mensaje_error:"_mensaje_error_1sp58_547",ancho_total:"_ancho_total_1sp58_559",variante_bordered:"_variante_bordered_1sp58_567",variante_faded:"_variante_faded_1sp58_577",variante_underlined:"_variante_underlined_1sp58_597",variante_ghost:"_variante_ghost_1sp58_623",deshabilitado:"_deshabilitado_1sp58_643",solo_lectura:"_solo_lectura_1sp58_663",enfocado:"_enfocado_1sp58_679",valido:"_valido_1sp58_687",invalido:"_invalido_1sp58_695",sin_animacion:"_sin_animacion_1sp58_727"},lr=v.forwardRef((e,n)=>{const{children:t,variant:o="bordered",color:r="default",size:i="md",radius:s="md",fullWidth:a=!0,disableAnimation:d=!1,label:u,description:f,errorMessage:h,value:g,defaultValue:c,placeholder:p,isRequired:_=!1,isReadOnly:m=!1,isDisabled:b=!1,isClearable:w=!1,isInvalid:C,validationState:S,validate:x,minRows:y=4,maxRows:M=10,disableAutosize:E=!1,hideVoiceActions:T=!1,classNames:F,onChange:P,onClear:U,onFocus:z,onBlur:k,id:A,name:O,rows:D,...$}=e,N=v.useRef(null),_e=v.useRef(A??`textarea-${gn(8)}`).current;v.useImperativeHandle(n,()=>N.current);const fe=g!==void 0,[L,re]=v.useState(c??""),Z=fe?g:L,[ue,we]=v.useState(!1),ye=v.useMemo(()=>{if(!x)return null;const q=x(Z);return q===!0||q==null?null:typeof q=="string"?q:typeof q=="object"&&"message"in q?q.message??"Entrada inválida":"Entrada inválida"},[Z,x]),B=v.useMemo(()=>C!==void 0?C:S==="invalid"?!0:S==="valid"?!1:!!ye,[C,S,ye]),pe=S==="valid"&&!B,Ee={invalido:B,mensaje:ye},K=Z.length>0,J=v.useCallback(()=>{if(!N.current||E)return;const q=N.current,ge=window.getComputedStyle(q),Pe=parseFloat(ge.lineHeight)||parseFloat(ge.fontSize)*1.5,Te=parseFloat(ge.paddingTop)||0,at=parseFloat(ge.paddingBottom)||0,At=parseFloat(ge.borderTopWidth)||0,Qe=parseFloat(ge.borderBottomWidth)||0,et=y*Pe+Te+at+At+Qe,rt=M*Pe+Te+at+At+Qe;q.style.height="auto";const Ko=q.scrollHeight;q.style.height=`${Math.min(Math.max(Ko,et),rt)}px`},[E,y,M]);v.useEffect(()=>{E||J()},[Z,J,E]);const X=v.useCallback(q=>{fe||re(q),P==null||P(q)},[fe,P]),{puedeHablar:Y,hablando:oe,escuchar:te,detenerHablar:se,puedeEscuchar:de,escuchando:me,errorDictado:$e,dictar:R,detenerDictado:ne}=ar({isDisabled:b||T,isReadOnly:m,value:Z,onChange:X}),V=v.useCallback(q=>{if(b||m)return;const ge=q.target.value;fe||re(ge),P==null||P(ge)},[fe,b,m,P]),ae=v.useCallback(q=>{we(!0),z==null||z(q)},[z]),he=v.useCallback(q=>{we(!1),k==null||k(q)},[k]),Ce=v.useCallback(()=>{var q;b||m||(fe||re(""),P==null||P(""),U==null||U(),(q=N.current)==null||q.focus())},[fe,b,m,P,U]),Be=v.useCallback(()=>{oe?se():te()},[oe,te,se]),Je=v.useCallback(()=>{me?ne():R()},[me,R,ne]),Ge=f?`${_e}-desc`:void 0,ie=B||$e?`${_e}-err`:void 0,Oe=[Ge,ie].filter(Boolean).join(" ")||void 0,le=typeof h=="function"?h(Ee):h??ye,ke=w&&K&&!m&&!b,wt=!T||ke,Ke=W(Ie.contenedor_base,Ie[`variante_${o}`],Ie[`tam_${i}`],Ie[`radio_${s}`],Ie[`color_${r}`],{[Ie.ancho_total]:a,[Ie.sin_animacion]:d,[Ie.deshabilitado]:b,[Ie.solo_lectura]:m,[Ie.invalido]:B,[Ie.valido]:pe,[Ie.enfocado]:ue},F==null?void 0:F.base);return l.jsxs("div",{className:Ke,children:[u&&l.jsxs("label",{className:W(Ie.etiqueta,F==null?void 0:F.label),htmlFor:_e,children:[u,_&&l.jsx("span",{className:Ie.marca_requerido,"aria-hidden":"true",children:"*"})]}),l.jsxs("div",{className:W(Ie.envoltorio_input,F==null?void 0:F.inputWrapper),children:[l.jsx("textarea",{...$,ref:N,id:_e,name:O,placeholder:p,value:fe?Z:void 0,defaultValue:fe?void 0:c,onChange:V,onFocus:ae,onBlur:he,className:W(Ie.entrada,E&&Ie.sin_autosize,F==null?void 0:F.input),readOnly:m,disabled:b,rows:D??y,"aria-invalid":B||void 0,"aria-describedby":Oe,"aria-required":_}),wt&&l.jsxs("div",{className:W(Ie.barra_acciones,F==null?void 0:F.actions),children:[l.jsxs("div",{className:Ie.badges_contenedor,"aria-live":"polite",role:"status",children:[l.jsx(hn,{mostrar:me,children:l.jsx(to,{tipo:"mic",texto:"Escuchando...",size:i==="lg"?"md":"sm"})}),l.jsx(hn,{mostrar:oe,children:l.jsx(to,{tipo:"tts",texto:"Leyendo...",size:i==="lg"?"md":"sm"})})]}),l.jsxs("div",{className:Ie.botones_grupo,children:[!T&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:W(Ie.boton_accion,oe&&Ie.boton_activo_tts),onClick:Be,disabled:!Y||!oe&&(!Z||me),title:oe?"Detener lectura":"Leer texto","aria-pressed":oe,"aria-label":oe?"Detener lectura":"Leer texto",children:l.jsx(eo,{})}),de&&l.jsx("button",{type:"button",className:W(Ie.boton_accion,me&&Ie.boton_activo_mic),onClick:Je,disabled:b||m||oe,title:me?"Detener dictado":"Dictar texto","aria-pressed":me,"aria-label":me?"Detener dictado":"Dictar texto",children:me?l.jsx(sr,{}):l.jsx(Qn,{})})]}),ke&&l.jsx("button",{type:"button",className:Ie.boton_limpiar,onClick:Ce,title:"Limpiar campo","aria-label":"Limpiar campo",children:l.jsx(Ss,{size:"0.75em"})})]})]})]}),f&&!B&&l.jsx("div",{id:Ge,className:W(Ie.descripcion,F==null?void 0:F.description),children:f}),B&&le||$e?l.jsxs("div",{id:ie,className:W(Ie.mensaje_error,F==null?void 0:F.errorMessage),role:"alert",children:[le,le&&$e&&l.jsx("br",{}),$e&&l.jsxs("span",{children:["Error de voz: ",$e]})]}):null,t]})});lr.displayName="TextArea";function mn(){return typeof window<"u"}function yt(e){return no(e)?(e.nodeName||"").toLowerCase():"#document"}function Xe(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function ct(e){var n;return(n=(no(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function no(e){return mn()?e instanceof Node||e instanceof Xe(e).Node:!1}function De(e){return mn()?e instanceof Element||e instanceof Xe(e).Element:!1}function Ve(e){return mn()?e instanceof HTMLElement||e instanceof Xe(e).HTMLElement:!1}function oo(e){return!mn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xe(e).ShadowRoot}const xs=new Set(["inline","contents"]);function Yt(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=tt(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!xs.has(r)}const $s=new Set(["table","td","th"]);function Is(e){return $s.has(yt(e))}const Es=[":popover-open",":modal"];function vn(e){return Es.some(n=>{try{return e.matches(n)}catch{return!1}})}const ks=["transform","translate","scale","rotate","perspective"],Ms=["transform","translate","scale","rotate","perspective","filter"],Fs=["paint","layout","strict","content"];function ro(e){const n=bn(),t=De(e)?tt(e):e;return ks.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)||Ms.some(o=>(t.willChange||"").includes(o))||Fs.some(o=>(t.contain||"").includes(o))}function As(e){let n=_t(e);for(;Ve(n)&&!gt(n);){if(ro(n))return n;if(vn(n))return null;n=_t(n)}return null}function bn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ds=new Set(["html","body","#document"]);function gt(e){return Ds.has(yt(e))}function tt(e){return Xe(e).getComputedStyle(e)}function wn(e){return De(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _t(e){if(yt(e)==="html")return e;const n=e.assignedSlot||e.parentNode||oo(e)&&e.host||ct(e);return oo(n)?n.host:n}function cr(e){const n=_t(e);return gt(n)?e.ownerDocument?e.ownerDocument.body:e.body:Ve(n)&&Yt(n)?n:cr(n)}function Ct(e,n,t){var o;n===void 0&&(n=[]),t===void 0&&(t=!0);const r=cr(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=Xe(r);if(i){const a=io(s);return n.concat(s,s.visualViewport||[],Yt(r)?r:[],a&&t?Ct(a):[])}return n.concat(r,Ct(r,[],t))}function io(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const zt=Math.min,Ye=Math.max,yn=Math.round,Rt=Math.floor,ut=e=>({x:e,y:e}),Os={left:"right",right:"left",bottom:"top",top:"bottom"},Ps={start:"end",end:"start"};function ur(e,n,t){return Ye(e,zt(n,t))}function Zt(e,n){return typeof e=="function"?e(n):e}function St(e){return e.split("-")[0]}function Jt(e){return e.split("-")[1]}function dr(e){return e==="x"?"y":"x"}function fr(e){return e==="y"?"height":"width"}const Ns=new Set(["top","bottom"]);function pt(e){return Ns.has(St(e))?"y":"x"}function gr(e){return dr(pt(e))}function Ls(e,n,t){t===void 0&&(t=!1);const o=Jt(e),r=gr(e),i=fr(r);let s=r==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return n.reference[i]>n.floating[i]&&(s=Cn(s)),[s,Cn(s)]}function Vs(e){const n=Cn(e);return[so(e),n,so(n)]}function so(e){return e.replace(/start|end/g,n=>Ps[n])}const _r=["left","right"],pr=["right","left"],Ts=["top","bottom"],zs=["bottom","top"];function Rs(e,n,t){switch(e){case"top":case"bottom":return t?n?pr:_r:n?_r:pr;case"left":case"right":return n?Ts:zs;default:return[]}}function qs(e,n,t,o){const r=Jt(e);let i=Rs(St(e),t==="start",o);return r&&(i=i.map(s=>s+"-"+r),n&&(i=i.concat(i.map(so)))),i}function Cn(e){return e.replace(/left|right|bottom|top/g,n=>Os[n])}function js(e){return{top:0,right:0,bottom:0,left:0,...e}}function Bs(e){return typeof e!="number"?js(e):{top:e,right:e,bottom:e,left:e}}function Sn(e){const{x:n,y:t,width:o,height:r}=e;return{width:o,height:r,top:t,left:n,right:n+o,bottom:t+r,x:n,y:t}}/*!
|
|
2
|
+
* tabbable 6.3.0
|
|
3
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
4
|
+
*/var Hs=["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])"],xn=Hs.join(","),hr=typeof Element>"u",qt=hr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$n=!hr&&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==null?void 0:e.ownerDocument},Qt=function(n,t){var o;t===void 0&&(t=!0);var r=n==null||(o=n.getAttribute)===null||o===void 0?void 0:o.call(n,"inert"),i=r===""||r==="true",s=i||t&&n&&Qt(n.parentNode);return s},Gs=function(n){var t,o=n==null||(t=n.getAttribute)===null||t===void 0?void 0:t.call(n,"contenteditable");return o===""||o==="true"},mr=function(n,t,o){if(Qt(n))return[];var r=Array.prototype.slice.apply(n.querySelectorAll(xn));return t&&qt.call(n,xn)&&r.unshift(n),r=r.filter(o),r},In=function(n,t,o){for(var r=[],i=Array.from(n);i.length;){var s=i.shift();if(!Qt(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),d=a.length?a:s.children,u=In(d,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:s,candidates:u})}else{var f=qt.call(s,xn);f&&o.filter(s)&&(t||!n.includes(s))&&r.push(s);var h=s.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(s),g=!Qt(h,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(s));if(h&&g){var c=In(h===!0?s.children:h.children,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:s,candidates:c})}else i.unshift.apply(i,s.children)}}return r},vr=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},br=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||Gs(n))&&!vr(n)?0:n.tabIndex},Ws=function(n,t){var o=br(n);return o<0&&t&&!vr(n)?0:o},Us=function(n,t){return n.tabIndex===t.tabIndex?n.documentOrder-t.documentOrder:n.tabIndex-t.tabIndex},wr=function(n){return n.tagName==="INPUT"},Ks=function(n){return wr(n)&&n.type==="hidden"},Xs=function(n){var t=n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(o){return o.tagName==="SUMMARY"});return t},Ys=function(n,t){for(var o=0;o<n.length;o++)if(n[o].checked&&n[o].form===t)return n[o]},Zs=function(n){if(!n.name)return!0;var t=n.form||$n(n),o=function(a){return t.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(n.name));else try{r=o(n.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=Ys(r,n.form);return!i||i===n},Js=function(n){return wr(n)&&n.type==="radio"},Qs=function(n){return Js(n)&&!Zs(n)},ea=function(n){var t,o=n&&$n(n),r=(t=o)===null||t===void 0?void 0:t.host,i=!1;if(o&&o!==n){var s,a,d;for(i=!!((s=r)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(r)||n!=null&&(d=n.ownerDocument)!==null&&d!==void 0&&d.contains(n));!i&&r;){var u,f,h;o=$n(r),r=(u=o)===null||u===void 0?void 0:u.host,i=!!((f=r)!==null&&f!==void 0&&(h=f.ownerDocument)!==null&&h!==void 0&&h.contains(r))}}return i},yr=function(n){var t=n.getBoundingClientRect(),o=t.width,r=t.height;return o===0&&r===0},ta=function(n,t){var o=t.displayCheck,r=t.getShadowRoot;if(o==="full-native"&&"checkVisibility"in n){var i=n.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(n).visibility==="hidden")return!0;var s=qt.call(n,"details>summary:first-of-type"),a=s?n.parentElement:n;if(qt.call(a,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var d=n;n;){var u=n.parentElement,f=$n(n);if(u&&!u.shadowRoot&&r(u)===!0)return yr(n);n.assignedSlot?n=n.assignedSlot:!u&&f!==n.ownerDocument?n=f.host:n=u}n=d}if(ea(n))return!n.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return yr(n);return!1},na=function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var t=n.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var o=0;o<t.children.length;o++){var r=t.children.item(o);if(r.tagName==="LEGEND")return qt.call(t,"fieldset[disabled] *")?!0:!r.contains(n)}return!0}t=t.parentElement}return!1},ao=function(n,t){return!(t.disabled||Qt(t)||Ks(t)||ta(t,n)||Xs(t)||na(t))},lo=function(n,t){return!(Qs(t)||br(t)<0||!ao(n,t))},oa=function(n){var t=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Cr=function(n){var t=[],o=[];return n.forEach(function(r,i){var s=!!r.scopeParent,a=s?r.scopeParent:r,d=Ws(a,s),u=s?Cr(r.candidates):a;d===0?s?t.push.apply(t,u):t.push(a):o.push({documentOrder:i,tabIndex:d,item:r,isScope:s,content:u})}),o.sort(Us).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(t)},En=function(n,t){t=t||{};var o;return t.getShadowRoot?o=In([n],t.includeContainer,{filter:lo.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:oa}):o=mr(n,t.includeContainer,lo.bind(null,t)),Cr(o)},ra=function(n,t){t=t||{};var o;return t.getShadowRoot?o=In([n],t.includeContainer,{filter:ao.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):o=mr(n,t.includeContainer,ao.bind(null,t)),o},Sr=function(n,t){if(t=t||{},!n)throw new Error("No node provided");return qt.call(n,xn)===!1?!1:lo(t,n)};function ia(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function xr(){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 sa(){return/apple/i.test(navigator.vendor)}function co(){const e=/android/i;return e.test(ia())||e.test(xr())}function aa(){return xr().includes("jsdom/")}const $r="data-floating-ui-focusable",la="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",uo="ArrowLeft",fo="ArrowRight",ca="ArrowUp",ua="ArrowDown";function xt(e){let n=e.activeElement;for(;((t=n)==null||(t=t.shadowRoot)==null?void 0:t.activeElement)!=null;){var t;n=n.shadowRoot.activeElement}return n}function We(e,n){if(!e||!n)return!1;const t=n.getRootNode==null?void 0:n.getRootNode();if(e.contains(n))return!0;if(t&&oo(t)){let o=n;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function $t(e){return"composedPath"in e?e.composedPath()[0]:e.target}function go(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 da(e){return e.matches("html,body")}function nt(e){return(e==null?void 0:e.ownerDocument)||document}function Ir(e){return Ve(e)&&e.matches(la)}function _o(e){return e?e.getAttribute("role")==="combobox"&&Ir(e):!1}function kn(e){return e?e.hasAttribute($r)?e:e.querySelector("["+$r+"]")||e:null}function Ot(e,n,t){return t===void 0&&(t=!0),e.filter(r=>{var i;return r.parentId===n&&(!t||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...Ot(e,r.id,t)])}function fa(e,n){let t,o=-1;function r(i,s){s>o&&(t=i,o=s),Ot(e,i).forEach(d=>{r(d.id,s+1)})}return r(n,0),e.find(i=>i.id===t)}function Er(e,n){var t;let o=[],r=(t=e.find(i=>i.id===n))==null?void 0:t.parentId;for(;r;){const i=e.find(s=>s.id===r);r=i==null?void 0:i.parentId,i&&(o=o.concat(i))}return o}function ze(e){e.preventDefault(),e.stopPropagation()}function ga(e){return"nativeEvent"in e}function kr(e){return e.mozInputSource===0&&e.isTrusted?!0:co()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Mr(e){return aa()?!1:!co()&&e.width===0&&e.height===0||co()&&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 Fr(e,n){return["mouse","pen"].includes(e)}var _a=typeof document<"u",pa=function(){},Ae=_a?v.useLayoutEffect:pa;const ha={...I};function Ue(e){const n=I.useRef(e);return Ae(()=>{n.current=e}),n}const ma=ha.useInsertionEffect||(e=>e());function Re(e){const n=I.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return ma(()=>{n.current=e}),I.useCallback(function(){for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return n.current==null?void 0:n.current(...o)},[])}function Mn(e,n,t){return Math.floor(e/n)!==t}function en(e,n){return n<0||n>=e.current.length}function po(e,n){return qe(e,{disabledIndices:n})}function Ar(e,n){return qe(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:n})}function qe(e,n){let{startingIndex:t=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=n===void 0?{}:n,s=t;do s+=o?-i:i;while(s>=0&&s<=e.current.length-1&&Fn(e,s,r));return s}function va(e,n){let{event:t,orientation:o,loop:r,rtl:i,cols:s,disabledIndices:a,minIndex:d,maxIndex:u,prevIndex:f,stopEvent:h=!1}=n,g=f;if(t.key===ca){if(h&&ze(t),f===-1)g=u;else if(g=qe(e,{startingIndex:g,amount:s,decrement:!0,disabledIndices:a}),r&&(f-s<d||g<0)){const c=f%s,p=u%s,_=u-(p-c);p===c?g=u:g=p>c?_:_-s}en(e,g)&&(g=f)}if(t.key===ua&&(h&&ze(t),f===-1?g=d:(g=qe(e,{startingIndex:f,amount:s,disabledIndices:a}),r&&f+s>u&&(g=qe(e,{startingIndex:f%s-s,amount:s,disabledIndices:a}))),en(e,g)&&(g=f)),o==="both"){const c=Rt(f/s);t.key===(i?uo:fo)&&(h&&ze(t),f%s!==s-1?(g=qe(e,{startingIndex:f,disabledIndices:a}),r&&Mn(g,s,c)&&(g=qe(e,{startingIndex:f-f%s-1,disabledIndices:a}))):r&&(g=qe(e,{startingIndex:f-f%s-1,disabledIndices:a})),Mn(g,s,c)&&(g=f)),t.key===(i?fo:uo)&&(h&&ze(t),f%s!==0?(g=qe(e,{startingIndex:f,decrement:!0,disabledIndices:a}),r&&Mn(g,s,c)&&(g=qe(e,{startingIndex:f+(s-f%s),decrement:!0,disabledIndices:a}))):r&&(g=qe(e,{startingIndex:f+(s-f%s),decrement:!0,disabledIndices:a})),Mn(g,s,c)&&(g=f));const p=Rt(u/s)===c;en(e,g)&&(r&&p?g=t.key===(i?fo:uo)?u:qe(e,{startingIndex:f-f%s-1,disabledIndices:a}):g=f)}return g}function ba(e,n,t){const o=[];let r=0;return e.forEach((i,s)=>{let{width:a,height:d}=i;if(a>n&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+s+" is greater than grid columns");let u=!1;for(t&&(r=0);!u;){const f=[];for(let h=0;h<a;h++)for(let g=0;g<d;g++)f.push(r+h+g*n);r%n+a<=n&&f.every(h=>o[h]==null)?(f.forEach(h=>{o[h]=s}),u=!0):r++}}),[...o]}function wa(e,n,t,o,r){if(e===-1)return-1;const i=t.indexOf(e),s=n[e];switch(r){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*o:i;case"br":return t.lastIndexOf(e)}}function ya(e,n){return n.flatMap((t,o)=>e.includes(t)?[o]:[])}function Fn(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 Dr(e,n){const t=En(e,tn()),o=t.length;if(o===0)return;const r=xt(nt(e)),i=t.indexOf(r),s=i===-1?n===1?0:o-1:i+n;return t[s]}function Or(e){return Dr(nt(e).body,1)||e}function Pr(e){return Dr(nt(e).body,-1)||e}function nn(e,n){const t=n||e.currentTarget,o=e.relatedTarget;return!o||!We(t,o)}function Ca(e){En(e,tn()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function Nr(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 Lr(e,n,t){let{reference:o,floating:r}=e;const i=pt(n),s=gr(n),a=fr(s),d=St(n),u=i==="y",f=o.x+o.width/2-r.width/2,h=o.y+o.height/2-r.height/2,g=o[a]/2-r[a]/2;let c;switch(d){case"top":c={x:f,y:o.y-r.height};break;case"bottom":c={x:f,y:o.y+o.height};break;case"right":c={x:o.x+o.width,y:h};break;case"left":c={x:o.x-r.width,y:h};break;default:c={x:o.x,y:o.y}}switch(Jt(n)){case"start":c[s]-=g*(t&&u?-1:1);break;case"end":c[s]+=g*(t&&u?-1:1);break}return c}const Sa=async(e,n,t)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=t,a=i.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(n));let u=await s.getElementRects({reference:e,floating:n,strategy:r}),{x:f,y:h}=Lr(u,o,d),g=o,c={},p=0;for(let _=0;_<a.length;_++){const{name:m,fn:b}=a[_],{x:w,y:C,data:S,reset:x}=await b({x:f,y:h,initialPlacement:o,placement:g,strategy:r,middlewareData:c,rects:u,platform:s,elements:{reference:e,floating:n}});f=w??f,h=C??h,c={...c,[m]:{...c[m],...S}},x&&p<=50&&(p++,typeof x=="object"&&(x.placement&&(g=x.placement),x.rects&&(u=x.rects===!0?await s.getElementRects({reference:e,floating:n,strategy:r}):x.rects),{x:f,y:h}=Lr(u,g,d)),_=-1)}return{x:f,y:h,placement:g,strategy:r,middlewareData:c}};async function ho(e,n){var t;n===void 0&&(n={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:g=!1,padding:c=0}=Zt(n,e),p=Bs(c),m=a[g?h==="floating"?"reference":"floating":h],b=Sn(await i.getClippingRect({element:(t=await(i.isElement==null?void 0:i.isElement(m)))==null||t?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:d})),w=h==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},x=Sn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:C,strategy:d}):w);return{top:(b.top-x.top+p.top)/S.y,bottom:(x.bottom-b.bottom+p.bottom)/S.y,left:(b.left-x.left+p.left)/S.x,right:(x.right-b.right+p.right)/S.x}}const xa=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var t,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:d,elements:u}=n,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:_=!0,...m}=Zt(e,n);if((t=i.arrow)!=null&&t.alignmentOffset)return{};const b=St(r),w=pt(a),C=St(a)===a,S=await(d.isRTL==null?void 0:d.isRTL(u.floating)),x=g||(C||!_?[Cn(a)]:Vs(a)),y=p!=="none";!g&&y&&x.push(...qs(a,_,p,S));const M=[a,...x],E=await ho(n,m),T=[];let F=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&T.push(E[b]),h){const k=Ls(r,s,S);T.push(E[k[0]],E[k[1]])}if(F=[...F,{placement:r,overflows:T}],!T.every(k=>k<=0)){var P,U;const k=(((P=i.flip)==null?void 0:P.index)||0)+1,A=M[k];if(A&&(!(h==="alignment"?w!==pt(A):!1)||F.every($=>pt($.placement)===w?$.overflows[0]>0:!0)))return{data:{index:k,overflows:F},reset:{placement:A}};let O=(U=F.filter(D=>D.overflows[0]<=0).sort((D,$)=>D.overflows[1]-$.overflows[1])[0])==null?void 0:U.placement;if(!O)switch(c){case"bestFit":{var z;const D=(z=F.filter($=>{if(y){const N=pt($.placement);return N===w||N==="y"}return!0}).map($=>[$.placement,$.overflows.filter(N=>N>0).reduce((N,j)=>N+j,0)]).sort(($,N)=>$[1]-N[1])[0])==null?void 0:z[0];D&&(O=D);break}case"initialPlacement":O=a;break}if(r!==O)return{reset:{placement:O}}}return{}}}},$a=new Set(["left","top"]);async function Ia(e,n){const{placement:t,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=St(t),a=Jt(t),d=pt(t)==="y",u=$a.has(s)?-1:1,f=i&&d?-1:1,h=Zt(n,e);let{mainAxis:g,crossAxis:c,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof p=="number"&&(c=a==="end"?p*-1:p),d?{x:c*f,y:g*u}:{x:g*u,y:c*f}}const Ea=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var t,o;const{x:r,y:i,placement:s,middlewareData:a}=n,d=await Ia(n,e);return s===((t=a.offset)==null?void 0:t.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+d.x,y:i+d.y,data:{...d,placement:s}}}}},ka=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:t,y:o,placement:r}=n,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:b,y:w}=m;return{x:b,y:w}}},...d}=Zt(e,n),u={x:t,y:o},f=await ho(n,d),h=pt(St(r)),g=dr(h);let c=u[g],p=u[h];if(i){const m=g==="y"?"top":"left",b=g==="y"?"bottom":"right",w=c+f[m],C=c-f[b];c=ur(w,c,C)}if(s){const m=h==="y"?"top":"left",b=h==="y"?"bottom":"right",w=p+f[m],C=p-f[b];p=ur(w,p,C)}const _=a.fn({...n,[g]:c,[h]:p});return{..._,data:{x:_.x-t,y:_.y-o,enabled:{[g]:i,[h]:s}}}}}},Ma=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var t,o;const{placement:r,rects:i,platform:s,elements:a}=n,{apply:d=()=>{},...u}=Zt(e,n),f=await ho(n,u),h=St(r),g=Jt(r),c=pt(r)==="y",{width:p,height:_}=i.floating;let m,b;h==="top"||h==="bottom"?(m=h,b=g===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=h,m=g==="end"?"top":"bottom");const w=_-f.top-f.bottom,C=p-f.left-f.right,S=zt(_-f[m],w),x=zt(p-f[b],C),y=!n.middlewareData.shift;let M=S,E=x;if((t=n.middlewareData.shift)!=null&&t.enabled.x&&(E=C),(o=n.middlewareData.shift)!=null&&o.enabled.y&&(M=w),y&&!g){const F=Ye(f.left,0),P=Ye(f.right,0),U=Ye(f.top,0),z=Ye(f.bottom,0);c?E=p-2*(F!==0||P!==0?F+P:Ye(f.left,f.right)):M=_-2*(U!==0||z!==0?U+z:Ye(f.top,f.bottom))}await d({...n,availableWidth:E,availableHeight:M});const T=await s.getDimensions(a.floating);return p!==T.width||_!==T.height?{reset:{rects:!0}}:{}}}};function Vr(e){const n=tt(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=Ve(e),i=r?e.offsetWidth:t,s=r?e.offsetHeight:o,a=yn(t)!==i||yn(o)!==s;return a&&(t=i,o=s),{width:t,height:o,$:a}}function mo(e){return De(e)?e:e.contextElement}function jt(e){const n=mo(e);if(!Ve(n))return ut(1);const t=n.getBoundingClientRect(),{width:o,height:r,$:i}=Vr(n);let s=(i?yn(t.width):t.width)/o,a=(i?yn(t.height):t.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Fa=ut(0);function Tr(e){const n=Xe(e);return!bn()||!n.visualViewport?Fa:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Aa(e,n,t){return n===void 0&&(n=!1),!t||n&&t!==Xe(e)?!1:n}function Pt(e,n,t,o){n===void 0&&(n=!1),t===void 0&&(t=!1);const r=e.getBoundingClientRect(),i=mo(e);let s=ut(1);n&&(o?De(o)&&(s=jt(o)):s=jt(e));const a=Aa(i,t,o)?Tr(i):ut(0);let d=(r.left+a.x)/s.x,u=(r.top+a.y)/s.y,f=r.width/s.x,h=r.height/s.y;if(i){const g=Xe(i),c=o&&De(o)?Xe(o):o;let p=g,_=io(p);for(;_&&o&&c!==p;){const m=jt(_),b=_.getBoundingClientRect(),w=tt(_),C=b.left+(_.clientLeft+parseFloat(w.paddingLeft))*m.x,S=b.top+(_.clientTop+parseFloat(w.paddingTop))*m.y;d*=m.x,u*=m.y,f*=m.x,h*=m.y,d+=C,u+=S,p=Xe(_),_=io(p)}}return Sn({width:f,height:h,x:d,y:u})}function An(e,n){const t=wn(e).scrollLeft;return n?n.left+t:Pt(ct(e)).left+t}function zr(e,n){const t=e.getBoundingClientRect(),o=t.left+n.scrollLeft-An(e,t),r=t.top+n.scrollTop;return{x:o,y:r}}function Da(e){let{elements:n,rect:t,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=ct(o),a=n?vn(n.floating):!1;if(o===s||a&&i)return t;let d={scrollLeft:0,scrollTop:0},u=ut(1);const f=ut(0),h=Ve(o);if((h||!h&&!i)&&((yt(o)!=="body"||Yt(s))&&(d=wn(o)),Ve(o))){const c=Pt(o);u=jt(o),f.x=c.x+o.clientLeft,f.y=c.y+o.clientTop}const g=s&&!h&&!i?zr(s,d):ut(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-d.scrollLeft*u.x+f.x+g.x,y:t.y*u.y-d.scrollTop*u.y+f.y+g.y}}function Oa(e){return Array.from(e.getClientRects())}function Pa(e){const n=ct(e),t=wn(e),o=e.ownerDocument.body,r=Ye(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),i=Ye(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let s=-t.scrollLeft+An(e);const a=-t.scrollTop;return tt(o).direction==="rtl"&&(s+=Ye(n.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const Rr=25;function Na(e,n){const t=Xe(e),o=ct(e),r=t.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,d=0;if(r){i=r.width,s=r.height;const f=bn();(!f||f&&n==="fixed")&&(a=r.offsetLeft,d=r.offsetTop)}const u=An(o);if(u<=0){const f=o.ownerDocument,h=f.body,g=getComputedStyle(h),c=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,p=Math.abs(o.clientWidth-h.clientWidth-c);p<=Rr&&(i-=p)}else u<=Rr&&(i+=u);return{width:i,height:s,x:a,y:d}}const La=new Set(["absolute","fixed"]);function Va(e,n){const t=Pt(e,!0,n==="fixed"),o=t.top+e.clientTop,r=t.left+e.clientLeft,i=Ve(e)?jt(e):ut(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,d=r*i.x,u=o*i.y;return{width:s,height:a,x:d,y:u}}function qr(e,n,t){let o;if(n==="viewport")o=Na(e,t);else if(n==="document")o=Pa(ct(e));else if(De(n))o=Va(n,t);else{const r=Tr(e);o={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return Sn(o)}function jr(e,n){const t=_t(e);return t===n||!De(t)||gt(t)?!1:tt(t).position==="fixed"||jr(t,n)}function Ta(e,n){const t=n.get(e);if(t)return t;let o=Ct(e,[],!1).filter(a=>De(a)&&yt(a)!=="body"),r=null;const i=tt(e).position==="fixed";let s=i?_t(e):e;for(;De(s)&&!gt(s);){const a=tt(s),d=ro(s);!d&&a.position==="fixed"&&(r=null),(i?!d&&!r:!d&&a.position==="static"&&!!r&&La.has(r.position)||Yt(s)&&!d&&jr(e,s))?o=o.filter(f=>f!==s):r=a,s=_t(s)}return n.set(e,o),o}function za(e){let{element:n,boundary:t,rootBoundary:o,strategy:r}=e;const s=[...t==="clippingAncestors"?vn(n)?[]:Ta(n,this._c):[].concat(t),o],a=s[0],d=s.reduce((u,f)=>{const h=qr(n,f,r);return u.top=Ye(h.top,u.top),u.right=zt(h.right,u.right),u.bottom=zt(h.bottom,u.bottom),u.left=Ye(h.left,u.left),u},qr(n,a,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Ra(e){const{width:n,height:t}=Vr(e);return{width:n,height:t}}function qa(e,n,t){const o=Ve(n),r=ct(n),i=t==="fixed",s=Pt(e,!0,i,n);let a={scrollLeft:0,scrollTop:0};const d=ut(0);function u(){d.x=An(r)}if(o||!o&&!i)if((yt(n)!=="body"||Yt(r))&&(a=wn(n)),o){const c=Pt(n,!0,i,n);d.x=c.x+n.clientLeft,d.y=c.y+n.clientTop}else r&&u();i&&!o&&r&&u();const f=r&&!o&&!i?zr(r,a):ut(0),h=s.left+a.scrollLeft-d.x-f.x,g=s.top+a.scrollTop-d.y-f.y;return{x:h,y:g,width:s.width,height:s.height}}function vo(e){return tt(e).position==="static"}function Br(e,n){if(!Ve(e)||tt(e).position==="fixed")return null;if(n)return n(e);let t=e.offsetParent;return ct(e)===t&&(t=t.ownerDocument.body),t}function Hr(e,n){const t=Xe(e);if(vn(e))return t;if(!Ve(e)){let r=_t(e);for(;r&&!gt(r);){if(De(r)&&!vo(r))return r;r=_t(r)}return t}let o=Br(e,n);for(;o&&Is(o)&&vo(o);)o=Br(o,n);return o&>(o)&&vo(o)&&!ro(o)?t:o||As(e)||t}const ja=async function(e){const n=this.getOffsetParent||Hr,t=this.getDimensions,o=await t(e.floating);return{reference:qa(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ba(e){return tt(e).direction==="rtl"}const Ha={convertOffsetParentRelativeRectToViewportRelativeRect:Da,getDocumentElement:ct,getClippingRect:za,getOffsetParent:Hr,getElementRects:ja,getClientRects:Oa,getDimensions:Ra,getScale:jt,isElement:De,isRTL:Ba};function Gr(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function Ga(e,n){let t=null,o;const r=ct(e);function i(){var a;clearTimeout(o),(a=t)==null||a.disconnect(),t=null}function s(a,d){a===void 0&&(a=!1),d===void 0&&(d=1),i();const u=e.getBoundingClientRect(),{left:f,top:h,width:g,height:c}=u;if(a||n(),!g||!c)return;const p=Rt(h),_=Rt(r.clientWidth-(f+g)),m=Rt(r.clientHeight-(h+c)),b=Rt(f),C={rootMargin:-p+"px "+-_+"px "+-m+"px "+-b+"px",threshold:Ye(0,zt(1,d))||1};let S=!0;function x(y){const M=y[0].intersectionRatio;if(M!==d){if(!S)return s();M?s(!1,M):o=setTimeout(()=>{s(!1,1e-7)},1e3)}M===1&&!Gr(u,e.getBoundingClientRect())&&s(),S=!1}try{t=new IntersectionObserver(x,{...C,root:r.ownerDocument})}catch{t=new IntersectionObserver(x,C)}t.observe(e)}return s(!0),i}function Wa(e,n,t,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,u=mo(e),f=r||i?[...u?Ct(u):[],...Ct(n)]:[];f.forEach(b=>{r&&b.addEventListener("scroll",t,{passive:!0}),i&&b.addEventListener("resize",t)});const h=u&&a?Ga(u,t):null;let g=-1,c=null;s&&(c=new ResizeObserver(b=>{let[w]=b;w&&w.target===u&&c&&(c.unobserve(n),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=c)==null||C.observe(n)})),t()}),u&&!d&&c.observe(u),c.observe(n));let p,_=d?Pt(e):null;d&&m();function m(){const b=Pt(e);_&&!Gr(_,b)&&t(),_=b,p=requestAnimationFrame(m)}return t(),()=>{var b;f.forEach(w=>{r&&w.removeEventListener("scroll",t),i&&w.removeEventListener("resize",t)}),h==null||h(),(b=c)==null||b.disconnect(),c=null,d&&cancelAnimationFrame(p)}}const Ua=Ea,Ka=ka,Xa=xa,Ya=Ma,Za=(e,n,t)=>{const o=new Map,r={platform:Ha,...t},i={...r.platform,_c:o};return Sa(e,n,{...r,platform:i})};var Ja=typeof document<"u",Qa=function(){},Dn=Ja?v.useLayoutEffect:Qa;function On(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let t,o,r;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(t=e.length,t!==n.length)return!1;for(o=t;o--!==0;)if(!On(e[o],n[o]))return!1;return!0}if(r=Object.keys(e),t=r.length,t!==Object.keys(n).length)return!1;for(o=t;o--!==0;)if(!{}.hasOwnProperty.call(n,r[o]))return!1;for(o=t;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!On(e[i],n[i]))return!1}return!0}return e!==e&&n!==n}function Wr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ur(e,n){const t=Wr(e);return Math.round(n*t)/t}function bo(e){const n=I.useRef(e);return Dn(()=>{n.current=e}),n}function el(e){e===void 0&&(e={});const{placement:n="bottom",strategy:t="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:d,open:u}=e,[f,h]=I.useState({x:0,y:0,strategy:t,placement:n,middlewareData:{},isPositioned:!1}),[g,c]=I.useState(o);On(g,o)||c(o);const[p,_]=I.useState(null),[m,b]=I.useState(null),w=I.useCallback($=>{$!==y.current&&(y.current=$,_($))},[]),C=I.useCallback($=>{$!==M.current&&(M.current=$,b($))},[]),S=i||p,x=s||m,y=I.useRef(null),M=I.useRef(null),E=I.useRef(f),T=d!=null,F=bo(d),P=bo(r),U=bo(u),z=I.useCallback(()=>{if(!y.current||!M.current)return;const $={placement:n,strategy:t,middleware:g};P.current&&($.platform=P.current),Za(y.current,M.current,$).then(N=>{const j={...N,isPositioned:U.current!==!1};k.current&&!On(E.current,j)&&(E.current=j,Jn.flushSync(()=>{h(j)}))})},[g,n,t,P,U]);Dn(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,h($=>({...$,isPositioned:!1})))},[u]);const k=I.useRef(!1);Dn(()=>(k.current=!0,()=>{k.current=!1}),[]),Dn(()=>{if(S&&(y.current=S),x&&(M.current=x),S&&x){if(F.current)return F.current(S,x,z);z()}},[S,x,z,F,T]);const A=I.useMemo(()=>({reference:y,floating:M,setReference:w,setFloating:C}),[w,C]),O=I.useMemo(()=>({reference:S,floating:x}),[S,x]),D=I.useMemo(()=>{const $={position:t,left:0,top:0};if(!O.floating)return $;const N=Ur(O.floating,f.x),j=Ur(O.floating,f.y);return a?{...$,transform:"translate("+N+"px, "+j+"px)",...Wr(O.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:N,top:j}},[t,a,O.floating,f.x,f.y]);return I.useMemo(()=>({...f,update:z,refs:A,elements:O,floatingStyles:D}),[f,z,A,O,D])}const tl=(e,n)=>({...Ua(e),options:[e,n]}),nl=(e,n)=>({...Ka(e),options:[e,n]}),ol=(e,n)=>({...Xa(e),options:[e,n]}),rl=(e,n)=>({...Ya(e),options:[e,n]}),il="data-floating-ui-focusable",Kr="active",Xr="selected",on="ArrowLeft",rn="ArrowRight",Yr="ArrowUp",Pn="ArrowDown",sl={...I};let Zr=!1,al=0;const Jr=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+al++;function ll(){const[e,n]=I.useState(()=>Zr?Jr():void 0);return Ae(()=>{e==null&&n(Jr())},[]),I.useEffect(()=>{Zr=!0},[]),e}const wo=sl.useId||ll;let sn;process.env.NODE_ENV!=="production"&&(sn=new Set);function yo(){for(var e,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];const r="Floating UI: "+t.join(" ");if(!((e=sn)!=null&&e.has(r))){var i;(i=sn)==null||i.add(r),console.warn(r)}}function cl(){for(var e,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];const r="Floating UI: "+t.join(" ");if(!((e=sn)!=null&&e.has(r))){var i;(i=sn)==null||i.add(r),console.error(r)}}function ul(){const e=new Map;return{emit(n,t){var o;(o=e.get(n))==null||o.forEach(r=>r(t))},on(n,t){e.has(n)||e.set(n,new Set),e.get(n).add(t)},off(n,t){var o;(o=e.get(n))==null||o.delete(t)}}}const dl=I.createContext(null),fl=I.createContext(null),Co=()=>{var e;return((e=I.useContext(dl))==null?void 0:e.id)||null},Nn=()=>I.useContext(fl);function an(e){return"data-floating-ui-"+e}function So(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}let Qr=0;function Nt(e,n){n===void 0&&(n={});const{preventScroll:t=!1,cancelPrevious:o=!0,sync:r=!1}=n;o&&cancelAnimationFrame(Qr);const i=()=>e==null?void 0:e.focus({preventScroll:t});r?i():Qr=requestAnimationFrame(i)}function gl(e){return(e==null?void 0:e.ownerDocument)||document}const Bt={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function ei(e){return e==="inert"?Bt.inert:e==="aria-hidden"?Bt["aria-hidden"]:Bt.none}let Ln=new WeakSet,Vn={},xo=0;const _l=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,ti=e=>e&&(e.host||ti(e.parentNode)),pl=(e,n)=>n.map(t=>{if(e.contains(t))return t;const o=ti(t);return e.contains(o)?o:null}).filter(t=>t!=null);function hl(e,n,t,o){const r="data-floating-ui-inert",i=o?"inert":t?"aria-hidden":null,s=pl(n,e),a=new Set,d=new Set(s),u=[];Vn[r]||(Vn[r]=new WeakMap);const f=Vn[r];s.forEach(h),g(n),a.clear();function h(c){!c||a.has(c)||(a.add(c),c.parentNode&&h(c.parentNode))}function g(c){!c||d.has(c)||[].forEach.call(c.children,p=>{if(yt(p)!=="script")if(a.has(p))g(p);else{const _=i?p.getAttribute(i):null,m=_!==null&&_!=="false",b=ei(i),w=(b.get(p)||0)+1,C=(f.get(p)||0)+1;b.set(p,w),f.set(p,C),u.push(p),w===1&&m&&Ln.add(p),C===1&&p.setAttribute(r,""),!m&&i&&p.setAttribute(i,i==="inert"?"":"true")}})}return xo++,()=>{u.forEach(c=>{const p=ei(i),m=(p.get(c)||0)-1,b=(f.get(c)||0)-1;p.set(c,m),f.set(c,b),m||(!Ln.has(c)&&i&&c.removeAttribute(i),Ln.delete(c)),b||c.removeAttribute(r)}),xo--,xo||(Bt.inert=new WeakMap,Bt["aria-hidden"]=new WeakMap,Bt.none=new WeakMap,Ln=new WeakSet,Vn={})}}function ni(e,n,t){n===void 0&&(n=!1),t===void 0&&(t=!1);const o=gl(e[0]).body;return hl(e.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,n,t)}const Tn={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},zn=I.forwardRef(function(n,t){const[o,r]=I.useState();Ae(()=>{sa()&&r("button")},[]);const i={ref:t,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[an("focus-guard")]:"",style:Tn};return l.jsx("span",{...n,...i})}),oi=I.createContext(null),ri=an("portal");function ml(e){e===void 0&&(e={});const{id:n,root:t}=e,o=wo(),r=ii(),[i,s]=I.useState(null),a=I.useRef(null);return Ae(()=>()=>{i==null||i.remove(),queueMicrotask(()=>{a.current=null})},[i]),Ae(()=>{if(!o||a.current)return;const d=n?document.getElementById(n):null;if(!d)return;const u=document.createElement("div");u.id=o,u.setAttribute(ri,""),d.appendChild(u),a.current=u,s(u)},[n,o]),Ae(()=>{if(t===null||!o||a.current)return;let d=t||(r==null?void 0:r.portalNode);d&&!no(d)&&(d=d.current),d=d||document.body;let u=null;n&&(u=document.createElement("div"),u.id=n,d.appendChild(u));const f=document.createElement("div");f.id=o,f.setAttribute(ri,""),d=u||d,d.appendChild(f),a.current=f,s(f)},[n,t,o,r]),i}function vl(e){const{children:n,id:t,root:o,preserveTabOrder:r=!0}=e,i=ml({id:t,root:o}),[s,a]=I.useState(null),d=I.useRef(null),u=I.useRef(null),f=I.useRef(null),h=I.useRef(null),g=s==null?void 0:s.modal,c=s==null?void 0:s.open,p=!!s&&!s.modal&&s.open&&r&&!!(o||i);return I.useEffect(()=>{if(!i||!r||g)return;function _(m){i&&nn(m)&&(m.type==="focusin"?Nr:Ca)(i)}return i.addEventListener("focusin",_,!0),i.addEventListener("focusout",_,!0),()=>{i.removeEventListener("focusin",_,!0),i.removeEventListener("focusout",_,!0)}},[i,r,g]),I.useEffect(()=>{i&&(c||Nr(i))},[c,i]),l.jsxs(oi.Provider,{value:I.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:d,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:h,portalNode:i,setFocusManagerState:a}),[r,i]),children:[p&&i&&l.jsx(zn,{"data-type":"outside",ref:d,onFocus:_=>{if(nn(_,i)){var m;(m=f.current)==null||m.focus()}else{const b=s?s.domReference:null,w=Pr(b);w==null||w.focus()}}}),p&&i&&l.jsx("span",{"aria-owns":i.id,style:Tn}),i&&Jn.createPortal(n,i),p&&i&&l.jsx(zn,{"data-type":"outside",ref:u,onFocus:_=>{if(nn(_,i)){var m;(m=h.current)==null||m.focus()}else{const b=s?s.domReference:null,w=Or(b);w==null||w.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,_.nativeEvent,"focus-out"))}}})]})}const ii=()=>I.useContext(oi);function si(e){return I.useMemo(()=>n=>{e.forEach(t=>{t&&(t.current=n)})},e)}const bl=20;let It=[];function $o(){It=It.filter(e=>e.isConnected)}function wl(e){$o(),e&&yt(e)!=="body"&&(It.push(e),It.length>bl&&(It=It.slice(-20)))}function ai(){return $o(),It[It.length-1]}function yl(e){const n=tn();return Sr(e,n)?e:En(e,n)[0]||e}function li(e,n){var t;if(!n.current.includes("floating")&&!((t=e.getAttribute("role"))!=null&&t.includes("dialog")))return;const o=tn(),i=ra(e,o).filter(a=>{const d=a.getAttribute("data-tabindex")||"";return Sr(a,o)||a.hasAttribute("data-tabindex")&&!d.startsWith("-")}),s=e.getAttribute("tabindex");n.current.includes("floating")||i.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const Cl=I.forwardRef(function(n,t){return l.jsx("button",{...n,type:"button",ref:t,tabIndex:-1,style:Tn})});function Sl(e){const{context:n,children:t,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:s=0,returnFocus:a=!0,restoreFocus:d=!1,modal:u=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:h=!0,outsideElementsInert:g=!1,getInsideElements:c=()=>[]}=e,{open:p,onOpenChange:_,events:m,dataRef:b,elements:{domReference:w,floating:C}}=n,S=Re(()=>{var K;return(K=b.current.floatingContext)==null?void 0:K.nodeId}),x=Re(c),y=typeof s=="number"&&s<0,M=_o(w)&&y,E=_l(),T=E?i:!0,F=!T||E&&g,P=Ue(r),U=Ue(s),z=Ue(a),k=Nn(),A=ii(),O=I.useRef(null),D=I.useRef(null),$=I.useRef(!1),N=I.useRef(!1),j=I.useRef(-1),_e=I.useRef(-1),fe=A!=null,L=kn(C),re=Re(function(K){return K===void 0&&(K=L),K?En(K,tn()):[]}),Z=Re(K=>{const J=re(K);return P.current.map(X=>w&&X==="reference"?w:L&&X==="floating"?L:J).filter(Boolean).flat()});I.useEffect(()=>{if(o||!u)return;function K(X){if(X.key==="Tab"){We(L,xt(nt(L)))&&re().length===0&&!M&&ze(X);const Y=Z(),oe=$t(X);P.current[0]==="reference"&&oe===w&&(ze(X),X.shiftKey?Nt(Y[Y.length-1]):Nt(Y[1])),P.current[1]==="floating"&&oe===L&&X.shiftKey&&(ze(X),Nt(Y[0]))}}const J=nt(L);return J.addEventListener("keydown",K),()=>{J.removeEventListener("keydown",K)}},[o,w,L,u,P,M,re,Z]),I.useEffect(()=>{if(o||!C)return;function K(J){const X=$t(J),oe=re().indexOf(X);oe!==-1&&(j.current=oe)}return C.addEventListener("focusin",K),()=>{C.removeEventListener("focusin",K)}},[o,C,re]),I.useEffect(()=>{if(o||!h)return;function K(){N.current=!0,setTimeout(()=>{N.current=!1})}function J(oe){const te=oe.relatedTarget,se=oe.currentTarget,de=$t(oe);queueMicrotask(()=>{const me=S(),$e=!(We(w,te)||We(C,te)||We(te,C)||We(A==null?void 0:A.portalNode,te)||te!=null&&te.hasAttribute(an("focus-guard"))||k&&(Ot(k.nodesRef.current,me).find(R=>{var ne,V;return We((ne=R.context)==null?void 0:ne.elements.floating,te)||We((V=R.context)==null?void 0:V.elements.domReference,te)})||Er(k.nodesRef.current,me).find(R=>{var ne,V,ae;return[(ne=R.context)==null?void 0:ne.elements.floating,kn((V=R.context)==null?void 0:V.elements.floating)].includes(te)||((ae=R.context)==null?void 0:ae.elements.domReference)===te})));if(se===w&&L&&li(L,P),d&&se!==w&&!(de!=null&&de.isConnected)&&xt(nt(L))===nt(L).body){Ve(L)&&L.focus();const R=j.current,ne=re(),V=ne[R]||ne[ne.length-1]||L;Ve(V)&&V.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(M||!u)&&te&&$e&&!N.current&&te!==ai()&&($.current=!0,_(!1,oe,"focus-out"))})}const X=!!(!k&&A);function Y(){So(_e),b.current.insideReactTree=!0,_e.current=window.setTimeout(()=>{b.current.insideReactTree=!1})}if(C&&Ve(w))return w.addEventListener("focusout",J),w.addEventListener("pointerdown",K),C.addEventListener("focusout",J),X&&C.addEventListener("focusout",Y,!0),()=>{w.removeEventListener("focusout",J),w.removeEventListener("pointerdown",K),C.removeEventListener("focusout",J),X&&C.removeEventListener("focusout",Y,!0)}},[o,w,C,L,u,k,A,_,h,d,re,M,S,P,b]);const ue=I.useRef(null),we=I.useRef(null),ye=si([ue,A==null?void 0:A.beforeInsideRef]),B=si([we,A==null?void 0:A.afterInsideRef]);I.useEffect(()=>{var K,J;if(o||!C)return;const X=Array.from((A==null||(K=A.portalNode)==null?void 0:K.querySelectorAll("["+an("portal")+"]"))||[]),oe=(J=(k?Er(k.nodesRef.current,S()):[]).find(de=>{var me;return _o(((me=de.context)==null?void 0:me.elements.domReference)||null)}))==null||(J=J.context)==null?void 0:J.elements.domReference,te=[C,oe,...X,...x(),O.current,D.current,ue.current,we.current,A==null?void 0:A.beforeOutsideRef.current,A==null?void 0:A.afterOutsideRef.current,P.current.includes("reference")||M?w:null].filter(de=>de!=null),se=u||M?ni(te,!F,F):ni(te);return()=>{se()}},[o,w,C,u,P,A,M,T,F,k,S,x]),Ae(()=>{if(o||!Ve(L))return;const K=nt(L),J=xt(K);queueMicrotask(()=>{const X=Z(L),Y=U.current,oe=(typeof Y=="number"?X[Y]:Y.current)||L,te=We(L,J);!y&&!te&&p&&Nt(oe,{preventScroll:oe===L})})},[o,p,L,y,Z,U]),Ae(()=>{if(o||!L)return;const K=nt(L),J=xt(K);wl(J);function X(te){let{reason:se,event:de,nested:me}=te;if(["hover","safe-polygon"].includes(se)&&de.type==="mouseleave"&&($.current=!0),se==="outside-press")if(me)$.current=!1;else if(kr(de)||Mr(de))$.current=!1;else{let $e=!1;document.createElement("div").focus({get preventScroll(){return $e=!0,!1}}),$e?$.current=!1:$.current=!0}}m.on("openchange",X);const Y=K.createElement("span");Y.setAttribute("tabindex","-1"),Y.setAttribute("aria-hidden","true"),Object.assign(Y.style,Tn),fe&&w&&w.insertAdjacentElement("afterend",Y);function oe(){if(typeof z.current=="boolean"){const te=w||ai();return te&&te.isConnected?te:Y}return z.current.current||Y}return()=>{m.off("openchange",X);const te=xt(K),se=We(C,te)||k&&Ot(k.nodesRef.current,S(),!1).some(me=>{var $e;return We(($e=me.context)==null?void 0:$e.elements.floating,te)}),de=oe();queueMicrotask(()=>{const me=yl(de);z.current&&!$.current&&Ve(me)&&(!(me!==te&&te!==K.body)||se)&&me.focus({preventScroll:!0}),Y.remove()})}},[o,C,L,z,b,m,k,fe,w,S]),I.useEffect(()=>(queueMicrotask(()=>{$.current=!1}),()=>{queueMicrotask($o)}),[o]),Ae(()=>{if(!o&&A)return A.setFocusManagerState({modal:u,closeOnFocusOut:h,open:p,onOpenChange:_,domReference:w}),()=>{A.setFocusManagerState(null)}},[o,A,u,p,_,h,w]),Ae(()=>{o||L&&li(L,P)},[o,L,P]);function pe(K){return o||!f||!u?null:l.jsx(Cl,{ref:K==="start"?O:D,onClick:J=>_(!1,J.nativeEvent),children:typeof f=="string"?f:"Dismiss"})}const Ee=!o&&T&&(u?!M:!0)&&(fe||u);return l.jsxs(l.Fragment,{children:[Ee&&l.jsx(zn,{"data-type":"inside",ref:ye,onFocus:K=>{if(u){const X=Z();Nt(r[0]==="reference"?X[0]:X[X.length-1])}else if(A!=null&&A.preserveTabOrder&&A.portalNode)if($.current=!1,nn(K,A.portalNode)){const X=Or(w);X==null||X.focus()}else{var J;(J=A.beforeOutsideRef.current)==null||J.focus()}}}),!M&&pe("start"),t,pe("end"),Ee&&l.jsx(zn,{"data-type":"inside",ref:B,onFocus:K=>{if(u)Nt(Z()[0]);else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(h&&($.current=!0),nn(K,A.portalNode)){const X=Pr(w);X==null||X.focus()}else{var J;(J=A.afterOutsideRef.current)==null||J.focus()}}})]})}function ci(e){return Ve(e.target)&&e.target.tagName==="BUTTON"}function xl(e){return Ve(e.target)&&e.target.tagName==="A"}function ui(e){return Ir(e)}function $l(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,dataRef:r,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:d=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0,stickIfOpen:h=!0}=n,g=I.useRef(),c=I.useRef(!1),p=I.useMemo(()=>({onPointerDown(_){g.current=_.pointerType},onMouseDown(_){const m=g.current;_.button===0&&a!=="click"&&(Fr(m)&&u||(t&&d&&(!(r.current.openEvent&&h)||r.current.openEvent.type==="mousedown")?o(!1,_.nativeEvent,"click"):(_.preventDefault(),o(!0,_.nativeEvent,"click"))))},onClick(_){const m=g.current;if(a==="mousedown"&&g.current){g.current=void 0;return}Fr(m)&&u||(t&&d&&(!(r.current.openEvent&&h)||r.current.openEvent.type==="click")?o(!1,_.nativeEvent,"click"):o(!0,_.nativeEvent,"click"))},onKeyDown(_){g.current=void 0,!(_.defaultPrevented||!f||ci(_))&&(_.key===" "&&!ui(i)&&(_.preventDefault(),c.current=!0),!xl(_)&&_.key==="Enter"&&o(!(t&&d),_.nativeEvent,"click"))},onKeyUp(_){_.defaultPrevented||!f||ci(_)||ui(i)||_.key===" "&&c.current&&(c.current=!1,o(!(t&&d),_.nativeEvent,"click"))}}),[r,i,a,u,f,o,t,h,d]);return I.useMemo(()=>s?{reference:p}:{},[s,p])}const Il={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},El={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},di=e=>{var n,t;return{escapeKey:typeof e=="boolean"?e:(n=e==null?void 0:e.escapeKey)!=null?n:!1,outsidePress:typeof e=="boolean"?e:(t=e==null?void 0:e.outsidePress)!=null?t:!0}};function kl(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,elements:r,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:d=!0,outsidePressEvent:u="pointerdown",referencePress:f=!1,referencePressEvent:h="pointerdown",ancestorScroll:g=!1,bubbles:c,capture:p}=n,_=Nn(),m=Re(typeof d=="function"?d:()=>!1),b=typeof d=="function"?m:d,w=I.useRef(!1),{escapeKey:C,outsidePress:S}=di(c),{escapeKey:x,outsidePress:y}=di(p),M=I.useRef(!1),E=Re(k=>{var A;if(!t||!s||!a||k.key!=="Escape"||M.current)return;const O=(A=i.current.floatingContext)==null?void 0:A.nodeId,D=_?Ot(_.nodesRef.current,O):[];if(!C&&(k.stopPropagation(),D.length>0)){let $=!0;if(D.forEach(N=>{var j;if((j=N.context)!=null&&j.open&&!N.context.dataRef.current.__escapeKeyBubbles){$=!1;return}}),!$)return}o(!1,ga(k)?k.nativeEvent:k,"escape-key")}),T=Re(k=>{var A;const O=()=>{var D;E(k),(D=$t(k))==null||D.removeEventListener("keydown",O)};(A=$t(k))==null||A.addEventListener("keydown",O)}),F=Re(k=>{var A;const O=i.current.insideReactTree;i.current.insideReactTree=!1;const D=w.current;if(w.current=!1,u==="click"&&D||O||typeof b=="function"&&!b(k))return;const $=$t(k),N="["+an("inert")+"]",j=nt(r.floating).querySelectorAll(N);let _e=De($)?$:null;for(;_e&&!gt(_e);){const Z=_t(_e);if(gt(Z)||!De(Z))break;_e=Z}if(j.length&&De($)&&!da($)&&!We($,r.floating)&&Array.from(j).every(Z=>!We(_e,Z)))return;if(Ve($)&&z){const Z=gt($),ue=tt($),we=/auto|scroll/,ye=Z||we.test(ue.overflowX),B=Z||we.test(ue.overflowY),pe=ye&&$.clientWidth>0&&$.scrollWidth>$.clientWidth,Ee=B&&$.clientHeight>0&&$.scrollHeight>$.clientHeight,K=ue.direction==="rtl",J=Ee&&(K?k.offsetX<=$.offsetWidth-$.clientWidth:k.offsetX>$.clientWidth),X=pe&&k.offsetY>$.clientHeight;if(J||X)return}const fe=(A=i.current.floatingContext)==null?void 0:A.nodeId,L=_&&Ot(_.nodesRef.current,fe).some(Z=>{var ue;return go(k,(ue=Z.context)==null?void 0:ue.elements.floating)});if(go(k,r.floating)||go(k,r.domReference)||L)return;const re=_?Ot(_.nodesRef.current,fe):[];if(re.length>0){let Z=!0;if(re.forEach(ue=>{var we;if((we=ue.context)!=null&&we.open&&!ue.context.dataRef.current.__outsidePressBubbles){Z=!1;return}}),!Z)return}o(!1,k,"outside-press")}),P=Re(k=>{var A;const O=()=>{var D;F(k),(D=$t(k))==null||D.removeEventListener(u,O)};(A=$t(k))==null||A.addEventListener(u,O)});I.useEffect(()=>{if(!t||!s)return;i.current.__escapeKeyBubbles=C,i.current.__outsidePressBubbles=S;let k=-1;function A(j){o(!1,j,"ancestor-scroll")}function O(){window.clearTimeout(k),M.current=!0}function D(){k=window.setTimeout(()=>{M.current=!1},bn()?5:0)}const $=nt(r.floating);a&&($.addEventListener("keydown",x?T:E,x),$.addEventListener("compositionstart",O),$.addEventListener("compositionend",D)),b&&$.addEventListener(u,y?P:F,y);let N=[];return g&&(De(r.domReference)&&(N=Ct(r.domReference)),De(r.floating)&&(N=N.concat(Ct(r.floating))),!De(r.reference)&&r.reference&&r.reference.contextElement&&(N=N.concat(Ct(r.reference.contextElement)))),N=N.filter(j=>{var _e;return j!==((_e=$.defaultView)==null?void 0:_e.visualViewport)}),N.forEach(j=>{j.addEventListener("scroll",A,{passive:!0})}),()=>{a&&($.removeEventListener("keydown",x?T:E,x),$.removeEventListener("compositionstart",O),$.removeEventListener("compositionend",D)),b&&$.removeEventListener(u,y?P:F,y),N.forEach(j=>{j.removeEventListener("scroll",A)}),window.clearTimeout(k)}},[i,r,a,b,u,t,o,g,s,C,S,E,x,T,F,y,P]),I.useEffect(()=>{i.current.insideReactTree=!1},[i,b,u]);const U=I.useMemo(()=>({onKeyDown:E,...f&&{[Il[h]]:k=>{o(!1,k.nativeEvent,"reference-press")},...h!=="click"&&{onClick(k){o(!1,k.nativeEvent,"reference-press")}}}}),[E,o,f,h]),z=I.useMemo(()=>({onKeyDown:E,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[El[u]]:()=>{i.current.insideReactTree=!0}}),[E,u,i]);return I.useMemo(()=>s?{reference:U,floating:z}:{},[s,U,z])}function Ml(e){const{open:n=!1,onOpenChange:t,elements:o}=e,r=wo(),i=I.useRef({}),[s]=I.useState(()=>ul()),a=Co()!=null;if(process.env.NODE_ENV!=="production"){const c=o.reference;c&&!De(c)&&cl("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]=I.useState(o.reference),f=Re((c,p,_)=>{i.current.openEvent=c?p:void 0,s.emit("openchange",{open:c,event:p,reason:_,nested:a}),t==null||t(c,p,_)}),h=I.useMemo(()=>({setPositionReference:u}),[]),g=I.useMemo(()=>({reference:d||o.reference||null,floating:o.floating||null,domReference:o.reference}),[d,o.reference,o.floating]);return I.useMemo(()=>({dataRef:i,open:n,onOpenChange:f,elements:g,events:s,floatingId:r,refs:h}),[n,f,g,s,r,h])}function Fl(e){e===void 0&&(e={});const{nodeId:n}=e,t=Ml({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||t,r=o.elements,[i,s]=I.useState(null),[a,d]=I.useState(null),f=(r==null?void 0:r.domReference)||i,h=I.useRef(null),g=Nn();Ae(()=>{f&&(h.current=f)},[f]);const c=el({...e,elements:{...r,...a&&{reference:a}}}),p=I.useCallback(C=>{const S=De(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;d(S),c.refs.setReference(S)},[c.refs]),_=I.useCallback(C=>{(De(C)||C===null)&&(h.current=C,s(C)),(De(c.refs.reference.current)||c.refs.reference.current===null||C!==null&&!De(C))&&c.refs.setReference(C)},[c.refs]),m=I.useMemo(()=>({...c.refs,setReference:_,setPositionReference:p,domReference:h}),[c.refs,_,p]),b=I.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),w=I.useMemo(()=>({...c,...o,refs:m,elements:b,nodeId:n}),[c,m,b,n,o]);return Ae(()=>{o.dataRef.current.floatingContext=w;const C=g==null?void 0:g.nodesRef.current.find(S=>S.id===n);C&&(C.context=w)}),I.useMemo(()=>({...c,context:w,refs:m,elements:b}),[c,m,b,w])}function Io(e,n,t){const o=new Map,r=t==="item";let i=e;if(r&&e){const{[Kr]:s,[Xr]:a,...d}=e;i=d}return{...t==="floating"&&{tabIndex:-1,[il]:""},...i,...n.map(s=>{const a=s?s[t]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(d=>{let[u,f]=d;if(!(r&&[Kr,Xr].includes(u)))if(u.indexOf("on")===0){if(o.has(u)||o.set(u,[]),typeof f=="function"){var h;(h=o.get(u))==null||h.push(f),s[u]=function(){for(var g,c=arguments.length,p=new Array(c),_=0;_<c;_++)p[_]=arguments[_];return(g=o.get(u))==null?void 0:g.map(m=>m(...p)).find(m=>m!==void 0)}}}else s[u]=f}),s),{})}}function Al(e){e===void 0&&(e=[]);const n=e.map(a=>a==null?void 0:a.reference),t=e.map(a=>a==null?void 0:a.floating),o=e.map(a=>a==null?void 0:a.item),r=I.useCallback(a=>Io(a,e,"reference"),n),i=I.useCallback(a=>Io(a,e,"floating"),t),s=I.useCallback(a=>Io(a,e,"item"),o);return I.useMemo(()=>({getReferenceProps:r,getFloatingProps:i,getItemProps:s}),[r,i,s])}const Dl="Escape";function Rn(e,n,t){switch(e){case"vertical":return n;case"horizontal":return t;default:return n||t}}function qn(e,n){return Rn(n,e===Yr||e===Pn,e===on||e===rn)}function Eo(e,n,t){return Rn(n,e===Pn,t?e===on:e===rn)||e==="Enter"||e===" "||e===""}function fi(e,n,t){return Rn(n,t?e===on:e===rn,e===Pn)}function gi(e,n,t,o){const r=t?e===rn:e===on,i=e===Yr;return n==="both"||n==="horizontal"&&o&&o>1?e===Dl:Rn(n,r,i)}function Ol(e,n){const{open:t,onOpenChange:o,elements:r,floatingId:i}=e,{listRef:s,activeIndex:a,onNavigate:d=()=>{},enabled:u=!0,selectedIndex:f=null,allowEscape:h=!1,loop:g=!1,nested:c=!1,rtl:p=!1,virtual:_=!1,focusItemOnOpen:m="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:w=!0,disabledIndices:C=void 0,orientation:S="vertical",parentOrientation:x,cols:y=1,scrollItemIntoView:M=!0,virtualItemRef:E,itemSizes:T,dense:F=!1}=n;process.env.NODE_ENV!=="production"&&(h&&(g||yo("`useListNavigation` looping must be enabled to allow escaping."),_||yo("`useListNavigation` must be virtual to allow escaping.")),S==="vertical"&&y>1&&yo("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const P=kn(r.floating),U=Ue(P),z=Co(),k=Nn();Ae(()=>{e.dataRef.current.orientation=S},[e,S]);const A=Re(()=>{d($.current===-1?null:$.current)}),O=_o(r.domReference),D=I.useRef(m),$=I.useRef(f??-1),N=I.useRef(null),j=I.useRef(!0),_e=I.useRef(A),fe=I.useRef(!!r.floating),L=I.useRef(t),re=I.useRef(!1),Z=I.useRef(!1),ue=Ue(C),we=Ue(t),ye=Ue(M),B=Ue(f),[pe,Ee]=I.useState(),[K,J]=I.useState(),X=Re(()=>{function R(he){if(_){var Ce;(Ce=he.id)!=null&&Ce.endsWith("-fui-option")&&(he.id=i+"-"+Math.random().toString(16).slice(2,10)),Ee(he.id),k==null||k.events.emit("virtualfocus",he),E&&(E.current=he)}else Nt(he,{sync:re.current,preventScroll:!0})}const ne=s.current[$.current],V=Z.current;ne&&R(ne),(re.current?he=>he():requestAnimationFrame)(()=>{const he=s.current[$.current]||ne;if(!he)return;ne||R(he);const Ce=ye.current;Ce&&oe&&(V||!j.current)&&(he.scrollIntoView==null||he.scrollIntoView(typeof Ce=="boolean"?{block:"nearest",inline:"nearest"}:Ce))})});Ae(()=>{u&&(t&&r.floating?D.current&&f!=null&&(Z.current=!0,$.current=f,A()):fe.current&&($.current=-1,_e.current()))},[u,t,r.floating,f,A]),Ae(()=>{if(u&&t&&r.floating)if(a==null){if(re.current=!1,B.current!=null)return;if(fe.current&&($.current=-1,X()),(!L.current||!fe.current)&&D.current&&(N.current!=null||D.current===!0&&N.current==null)){let R=0;const ne=()=>{s.current[0]==null?(R<2&&(R?requestAnimationFrame:queueMicrotask)(ne),R++):($.current=N.current==null||Eo(N.current,S,p)||c?po(s,ue.current):Ar(s,ue.current),N.current=null,A())};ne()}}else en(s,a)||($.current=a,X(),Z.current=!1)},[u,t,r.floating,a,B,c,s,S,p,A,X,ue]),Ae(()=>{var R;if(!u||r.floating||!k||_||!fe.current)return;const ne=k.nodesRef.current,V=(R=ne.find(Ce=>Ce.id===z))==null||(R=R.context)==null?void 0:R.elements.floating,ae=xt(nt(r.floating)),he=ne.some(Ce=>Ce.context&&We(Ce.context.elements.floating,ae));V&&!he&&j.current&&V.focus({preventScroll:!0})},[u,r.floating,k,z,_]),Ae(()=>{if(!u||!k||!_||z)return;function R(ne){J(ne.id),E&&(E.current=ne)}return k.events.on("virtualfocus",R),()=>{k.events.off("virtualfocus",R)}},[u,k,_,z,E]),Ae(()=>{_e.current=A,L.current=t,fe.current=!!r.floating}),Ae(()=>{t||(N.current=null,D.current=m)},[t,m]);const Y=a!=null,oe=I.useMemo(()=>{function R(V){if(!we.current)return;const ae=s.current.indexOf(V);ae!==-1&&$.current!==ae&&($.current=ae,A())}return{onFocus(V){let{currentTarget:ae}=V;re.current=!0,R(ae)},onClick:V=>{let{currentTarget:ae}=V;return ae.focus({preventScroll:!0})},onMouseMove(V){let{currentTarget:ae}=V;re.current=!0,Z.current=!1,b&&R(ae)},onPointerLeave(V){let{pointerType:ae}=V;if(!(!j.current||ae==="touch")&&(re.current=!0,!!b&&($.current=-1,A(),!_))){var he;(he=U.current)==null||he.focus({preventScroll:!0})}}}},[we,U,b,s,A,_]),te=I.useCallback(()=>{var R;return x??(k==null||(R=k.nodesRef.current.find(ne=>ne.id===z))==null||(R=R.context)==null||(R=R.dataRef)==null?void 0:R.current.orientation)},[z,k,x]),se=Re(R=>{if(j.current=!1,re.current=!0,R.which===229||!we.current&&R.currentTarget===U.current)return;if(c&&gi(R.key,S,p,y)){qn(R.key,te())||ze(R),o(!1,R.nativeEvent,"list-navigation"),Ve(r.domReference)&&(_?k==null||k.events.emit("virtualfocus",r.domReference):r.domReference.focus());return}const ne=$.current,V=po(s,C),ae=Ar(s,C);if(O||(R.key==="Home"&&(ze(R),$.current=V,A()),R.key==="End"&&(ze(R),$.current=ae,A())),y>1){const he=T||Array.from({length:s.current.length},()=>({width:1,height:1})),Ce=ba(he,y,F),Be=Ce.findIndex(ie=>ie!=null&&!Fn(s,ie,C)),Je=Ce.reduce((ie,Oe,le)=>Oe!=null&&!Fn(s,Oe,C)?le:ie,-1),Ge=Ce[va({current:Ce.map(ie=>ie!=null?s.current[ie]:null)},{event:R,orientation:S,loop:g,rtl:p,cols:y,disabledIndices:ya([...(typeof C!="function"?C:null)||s.current.map((ie,Oe)=>Fn(s,Oe,C)?Oe:void 0),void 0],Ce),minIndex:Be,maxIndex:Je,prevIndex:wa($.current>ae?V:$.current,he,Ce,y,R.key===Pn?"bl":R.key===(p?on:rn)?"tr":"tl"),stopEvent:!0})];if(Ge!=null&&($.current=Ge,A()),S==="both")return}if(qn(R.key,S)){if(ze(R),t&&!_&&xt(R.currentTarget.ownerDocument)===R.currentTarget){$.current=Eo(R.key,S,p)?V:ae,A();return}Eo(R.key,S,p)?g?$.current=ne>=ae?h&&ne!==s.current.length?-1:V:qe(s,{startingIndex:ne,disabledIndices:C}):$.current=Math.min(ae,qe(s,{startingIndex:ne,disabledIndices:C})):g?$.current=ne<=V?h&&ne!==-1?s.current.length:ae:qe(s,{startingIndex:ne,decrement:!0,disabledIndices:C}):$.current=Math.max(V,qe(s,{startingIndex:ne,decrement:!0,disabledIndices:C})),en(s,$.current)&&($.current=-1),A()}}),de=I.useMemo(()=>_&&t&&Y&&{"aria-activedescendant":K||pe},[_,t,Y,K,pe]),me=I.useMemo(()=>({"aria-orientation":S==="both"?void 0:S,...O?{}:de,onKeyDown:se,onPointerMove(){j.current=!0}}),[de,se,S,O]),$e=I.useMemo(()=>{function R(V){m==="auto"&&kr(V.nativeEvent)&&(D.current=!0)}function ne(V){D.current=m,m==="auto"&&Mr(V.nativeEvent)&&(D.current=!0)}return{...de,onKeyDown(V){j.current=!1;const ae=V.key.startsWith("Arrow"),he=["Home","End"].includes(V.key),Ce=ae||he,Be=fi(V.key,S,p),Je=gi(V.key,S,p,y),Ge=fi(V.key,te(),p),ie=qn(V.key,S),Oe=(c?Ge:ie)||V.key==="Enter"||V.key.trim()==="";if(_&&t){const Ke=k==null?void 0:k.nodesRef.current.find(ge=>ge.parentId==null),q=k&&Ke?fa(k.nodesRef.current,Ke.id):null;if(Ce&&q&&E){const ge=new KeyboardEvent("keydown",{key:V.key,bubbles:!0});if(Be||Je){var le,ke;const Pe=((le=q.context)==null?void 0:le.elements.domReference)===V.currentTarget,Te=Je&&!Pe?(ke=q.context)==null?void 0:ke.elements.domReference:Be?s.current.find(at=>(at==null?void 0:at.id)===pe):null;Te&&(ze(V),Te.dispatchEvent(ge),J(void 0))}if((ie||he)&&q.context&&q.context.open&&q.parentId&&V.currentTarget!==q.context.elements.domReference){var wt;ze(V),(wt=q.context.elements.domReference)==null||wt.dispatchEvent(ge);return}}return se(V)}if(!(!t&&!w&&ae)){if(Oe){const Ke=qn(V.key,te());N.current=c&&Ke?null:V.key}if(c){Ge&&(ze(V),t?($.current=po(s,ue.current),A()):o(!0,V.nativeEvent,"list-navigation"));return}ie&&(f!=null&&($.current=f),ze(V),!t&&w?o(!0,V.nativeEvent,"list-navigation"):se(V),t&&A())}},onFocus(){t&&!_&&($.current=-1,A())},onPointerDown:ne,onPointerEnter:ne,onMouseDown:R,onClick:R}},[pe,de,y,se,ue,m,s,c,A,o,t,w,S,te,p,f,k,_,E]);return I.useMemo(()=>u?{reference:$e,floating:me,item:oe}:{},[u,$e,me,oe])}const Pl=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Nl(e,n){var t,o;n===void 0&&(n={});const{open:r,elements:i,floatingId:s}=e,{enabled:a=!0,role:d="dialog"}=n,u=wo(),f=((t=i.domReference)==null?void 0:t.id)||u,h=I.useMemo(()=>{var w;return((w=kn(i.floating))==null?void 0:w.id)||s},[i.floating,s]),g=(o=Pl.get(d))!=null?o:d,p=Co()!=null,_=I.useMemo(()=>g==="tooltip"||d==="label"?{["aria-"+(d==="label"?"labelledby":"describedby")]:r?h:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":g==="alertdialog"?"dialog":g,"aria-controls":r?h:void 0,...g==="listbox"&&{role:"combobox"},...g==="menu"&&{id:f},...g==="menu"&&p&&{role:"menuitem"},...d==="select"&&{"aria-autocomplete":"none"},...d==="combobox"&&{"aria-autocomplete":"list"}},[g,h,p,r,f,d]),m=I.useMemo(()=>{const w={id:h,...g&&{role:g}};return g==="tooltip"||d==="label"?w:{...w,...g==="menu"&&{"aria-labelledby":f}}},[g,h,f,d]),b=I.useCallback(w=>{let{active:C,selected:S}=w;const x={role:"option",...C&&{id:h+"-fui-option"}};switch(d){case"select":case"combobox":return{...x,"aria-selected":S}}return{}},[h,d]);return I.useMemo(()=>a?{reference:_,floating:m,item:b}:{},[a,_,m,b])}const _i=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(n,t)=>(t?"-":"")+n.toLowerCase());function Ht(e,n){return typeof e=="function"?e(n):e}function Ll(e,n){const[t,o]=I.useState(e);return e&&!t&&o(!0),I.useEffect(()=>{if(!e&&t){const r=setTimeout(()=>o(!1),n);return()=>clearTimeout(r)}},[e,t,n]),t}function Vl(e,n){n===void 0&&(n={});const{open:t,elements:{floating:o}}=e,{duration:r=250}=n,s=(typeof r=="number"?r:r.close)||0,[a,d]=I.useState("unmounted"),u=Ll(t,s);return!u&&a==="close"&&d("unmounted"),Ae(()=>{if(o){if(t){d("initial");const f=requestAnimationFrame(()=>{Jn.flushSync(()=>{d("open")})});return()=>{cancelAnimationFrame(f)}}d("close")}},[t,o]),{isMounted:u,status:a}}function Tl(e,n){n===void 0&&(n={});const{initial:t={opacity:0},open:o,close:r,common:i,duration:s=250}=n,a=e.placement,d=a.split("-")[0],u=I.useMemo(()=>({side:d,placement:a}),[d,a]),f=typeof s=="number",h=(f?s:s.open)||0,g=(f?s:s.close)||0,[c,p]=I.useState(()=>({...Ht(i,u),...Ht(t,u)})),{isMounted:_,status:m}=Vl(e,{duration:s}),b=Ue(t),w=Ue(o),C=Ue(r),S=Ue(i);return Ae(()=>{const x=Ht(b.current,u),y=Ht(C.current,u),M=Ht(S.current,u),E=Ht(w.current,u)||Object.keys(x).reduce((T,F)=>(T[F]="",T),{});if(m==="initial"&&p(T=>({transitionProperty:T.transitionProperty,...M,...x})),m==="open"&&p({transitionProperty:Object.keys(E).map(_i).join(","),transitionDuration:h+"ms",...M,...E}),m==="close"){const T=y||x;p({transitionProperty:Object.keys(T).map(_i).join(","),transitionDuration:g+"ms",...M,...T})}},[g,C,b,w,S,h,m,u]),{isMounted:_,styles:c}}function zl(e,n){var t;const{open:o,dataRef:r}=e,{listRef:i,activeIndex:s,onMatch:a,onTypingChange:d,enabled:u=!0,findMatch:f=null,resetMs:h=750,ignoreKeys:g=[],selectedIndex:c=null}=n,p=I.useRef(-1),_=I.useRef(""),m=I.useRef((t=c??s)!=null?t:-1),b=I.useRef(null),w=Re(a),C=Re(d),S=Ue(f),x=Ue(g);Ae(()=>{o&&(So(p),b.current=null,_.current="")},[o]),Ae(()=>{if(o&&_.current===""){var F;m.current=(F=c??s)!=null?F:-1}},[o,c,s]);const y=Re(F=>{F?r.current.typing||(r.current.typing=F,C(F)):r.current.typing&&(r.current.typing=F,C(F))}),M=Re(F=>{function P(O,D,$){const N=S.current?S.current(D,$):D.find(j=>(j==null?void 0:j.toLocaleLowerCase().indexOf($.toLocaleLowerCase()))===0);return N?O.indexOf(N):-1}const U=i.current;if(_.current.length>0&&_.current[0]!==" "&&(P(U,U,_.current)===-1?y(!1):F.key===" "&&ze(F)),U==null||x.current.includes(F.key)||F.key.length!==1||F.ctrlKey||F.metaKey||F.altKey)return;o&&F.key!==" "&&(ze(F),y(!0)),U.every(O=>{var D,$;return O?((D=O[0])==null?void 0:D.toLocaleLowerCase())!==(($=O[1])==null?void 0:$.toLocaleLowerCase()):!0})&&_.current===F.key&&(_.current="",m.current=b.current),_.current+=F.key,So(p),p.current=window.setTimeout(()=>{_.current="",m.current=b.current,y(!1)},h);const k=m.current,A=P(U,[...U.slice((k||0)+1),...U.slice(0,(k||0)+1)],_.current);A!==-1?(w(A),b.current=A):F.key!==" "&&(_.current="",y(!1))}),E=I.useMemo(()=>({onKeyDown:M}),[M]),T=I.useMemo(()=>({onKeyDown:M,onKeyUp(F){F.key===" "&&y(!1)}}),[M,y]);return I.useMemo(()=>u?{reference:E,floating:T}:{},[u,E,T])}function Gt(e,n,t){let o=t.initialDeps??[],r;function i(){var s,a,d,u;let f;t.key&&((s=t.debug)!=null&&s.call(t))&&(f=Date.now());const h=e();if(!(h.length!==o.length||h.some((p,_)=>o[_]!==p)))return r;o=h;let c;if(t.key&&((a=t.debug)!=null&&a.call(t))&&(c=Date.now()),r=n(...h),t.key&&((d=t.debug)!=null&&d.call(t))){const p=Math.round((Date.now()-f)*100)/100,_=Math.round((Date.now()-c)*100)/100,m=_/16,b=(w,C)=>{for(w=String(w);w.length<C;)w=" "+w;return w};console.info(`%c⏱ ${b(_,5)} /${b(p,5)} ms`,`
|
|
5
|
+
font-size: .6rem;
|
|
6
|
+
font-weight: bold;
|
|
7
|
+
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(u=t==null?void 0:t.onChange)==null||u.call(t,r),r}return i.updateDeps=s=>{o=s},i}function pi(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const Rl=(e,n)=>Math.abs(e-n)<1.01,ql=(e,n,t)=>{let o;return function(...r){e.clearTimeout(o),o=e.setTimeout(()=>n.apply(this,r),t)}},hi=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},jl=e=>e,Bl=e=>{const n=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let r=n;r<=t;r++)o.push(r);return o},Hl=(e,n)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;const r=s=>{const{width:a,height:d}=s;n({width:Math.round(a),height:Math.round(d)})};if(r(hi(t)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver(s=>{const a=()=>{const d=s[0];if(d!=null&&d.borderBoxSize){const u=d.borderBoxSize[0];if(u){r({width:u.inlineSize,height:u.blockSize});return}}r(hi(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},mi={passive:!0},vi=typeof window>"u"?!0:"onscrollend"in window,Gl=(e,n)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;let r=0;const i=e.options.useScrollendEvent&&vi?()=>{}:ql(o,()=>{n(r,!1)},e.options.isScrollingResetDelay),s=f=>()=>{const{horizontal:h,isRtl:g}=e.options;r=h?t.scrollLeft*(g&&-1||1):t.scrollTop,i(),n(r,f)},a=s(!0),d=s(!1);d(),t.addEventListener("scroll",a,mi);const u=e.options.useScrollendEvent&&vi;return u&&t.addEventListener("scrollend",d,mi),()=>{t.removeEventListener("scroll",a),u&&t.removeEventListener("scrollend",d)}},Wl=(e,n,t)=>{if(n!=null&&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"]},Ul=(e,{adjustments:n=0,behavior:t},o)=>{var r,i;const s=e+n;(i=(r=o.scrollElement)==null?void 0:r.scrollTo)==null||i.call(r,{[o.options.horizontal?"left":"top"]:s,behavior:t})};class Kl{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const o=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(r=>{r.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var r;(r=o())==null||r.disconnect(),t=null},observe:r=>{var i;return(i=o())==null?void 0:i.observe(r,{box:"border-box"})},unobserve:r=>{var i;return(i=o())==null?void 0:i.unobserve(r)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([o,r])=>{typeof r>"u"&&delete t[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:jl,rangeExtractor:Bl,onChange:()=>{},measureElement:Wl,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var o,r;(r=(o=this.options).onChange)==null||r.call(o,this,t)},this.maybeNotify=Gt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,o)=>{const r=new Map,i=new Map;for(let s=o-1;s>=0;s--){const a=t[s];if(r.has(a.lane))continue;const d=i.get(a.lane);if(d==null||a.end>d.end?i.set(a.lane,a):a.end<d.end&&r.set(a.lane,!0),r.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=Gt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,o,r,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:s}),{key:!1}),this.getMeasurements=Gt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const d=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,d);for(let f=d;f<t;f++){const h=i(f),g=this.options.lanes===1?u[f-1]:this.getFurthestMeasurement(u,f),c=g?g.end+this.options.gap:o+r,p=a.get(h),_=typeof p=="number"?p:this.options.estimateSize(f),m=c+_,b=g?g.lane:f%this.options.lanes;u[f]={index:f,start:c,size:_,end:m,key:h,lane:b}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Gt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,o,r,i)=>this.range=t.length>0&&o>0?Xl({measurements:t,outerSize:o,scrollOffset:r,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Gt(()=>{let t=null,o=null;const r=this.calculateRange();return r&&(t=r.startIndex,o=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,o]},(t,o,r,i,s)=>i===null||s===null?[]:t({startIndex:i,endIndex:s,overscan:o,count:r}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const o=this.options.indexAttribute,r=t.getAttribute(o);return r?parseInt(r,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(t,o)=>{const r=this.indexFromElement(t),i=this.measurementsCache[r];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==t&&(a&&this.observer.unobserve(a),this.observer.observe(t),this.elementsCache.set(s,t)),t.isConnected&&this.resizeItem(r,this.options.measureElement(t,o,this))},this.resizeItem=(t,o)=>{const r=this.measurementsCache[t];if(!r)return;const i=this.itemSizeCache.get(r.key)??r.size,s=o-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,s,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,o)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((o,r)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(r))});return}this._measureElement(t,void 0)},this.getVirtualItems=Gt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,o)=>{const r=[];for(let i=0,s=t.length;i<s;i++){const a=t[i],d=o[a];r.push(d)}return r},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const o=this.getMeasurements();if(o.length!==0)return pi(o[bi(0,o.length-1,r=>pi(o[r]).start,t)])},this.getOffsetForAlignment=(t,o,r=0)=>{const i=this.getSize(),s=this.getScrollOffset();o==="auto"&&(o=t>=s+i?"end":"start"),o==="center"?t+=(r-i)/2:o==="end"&&(t-=i);const a=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,o="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const r=this.measurementsCache[t];if(!r)return;const i=this.getSize(),s=this.getScrollOffset();if(o==="auto")if(r.end>=s+i-this.options.scrollPaddingEnd)o="end";else if(r.start<=s+this.options.scrollPaddingStart)o="start";else return[s,o];const a=o==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,o,r.size),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:o="start",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,o),{adjustments:void 0,behavior:r})},this.scrollToIndex=(t,{align:o="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let i=0;const s=10,a=u=>{if(!this.targetWindow)return;const f=this.getOffsetForIndex(t,u);if(!f){console.warn("Failed to get offset for index:",t);return}const[h,g]=f;this._scrollToOffset(h,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const c=this.getScrollOffset(),p=this.getOffsetForIndex(t,g);if(!p){console.warn("Failed to get offset for index:",t);return}Rl(p[0],c)||d(g)})},d=u=>{this.targetWindow&&(i++,i<s?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,s),this.targetWindow.requestAnimationFrame(()=>a(u))):console.warn(`Failed to scroll to index ${t} after ${s} attempts.`))};a(o)},this.scrollBy=(t,{behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var t;const o=this.getMeasurements();let r;if(o.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((t=o[o.length-1])==null?void 0:t.end)??0;else{const i=Array(this.options.lanes).fill(null);let s=o.length-1;for(;s>=0&&i.some(a=>a===null);){const a=o[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}r=Math.max(...i.filter(a=>a!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:o,behavior:r})=>{this.options.scrollToFn(t,{behavior:r,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(n)}}const bi=(e,n,t,o)=>{for(;e<=n;){const r=(e+n)/2|0,i=t(r);if(i<o)e=r+1;else if(i>o)n=r-1;else return r}return e>0?e-1:0};function Xl({measurements:e,outerSize:n,scrollOffset:t,lanes:o}){const r=e.length-1,i=d=>e[d].start;if(e.length<=o)return{startIndex:0,endIndex:r};let s=bi(0,r,i,t),a=s;if(o===1)for(;a<r&&e[a].end<t+n;)a++;else if(o>1){const d=Array(o).fill(0);for(;a<r&&d.some(f=>f<t+n);){const f=e[a];d[f.lane]=f.end,a++}const u=Array(o).fill(t+n);for(;s>=0&&u.some(f=>f>=t);){const f=e[s];u[f.lane]=f.start,s--}s=Math.max(0,s-s%o),a=Math.min(r,a+(o-1-a%o))}return{startIndex:s,endIndex:a}}const wi=typeof document<"u"?I.useLayoutEffect:I.useEffect;function Yl(e){const n=I.useReducer(()=>({}),{})[1],t={...e,onChange:(r,i)=>{var s;i?Zn.flushSync(n):n(),(s=e.onChange)==null||s.call(e,r,i)}},[o]=I.useState(()=>new Kl(t));return o.setOptions(t),wi(()=>o._didMount(),[]),wi(()=>o._willUpdate()),o}function Zl(e){return Yl({observeElementRect:Hl,observeElementOffset:Gl,scrollToFn:Ul,...e})}function Jl(e,n){const[t,o]=I.useState(e);return I.useEffect(()=>{const r=setTimeout(()=>{o(e)},n);return()=>{clearTimeout(r)}},[e,n]),t}function jn(e){const n=I.useCallback(r=>{const i=window.matchMedia(e);return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[e]),t=()=>window.matchMedia(e).matches,o=()=>{throw Error("useMediaQuery is a client-only hook")};return I.useSyncExternalStore(n,t,o)}const yi=({size:e="1em",...n})=>l.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:l.jsx("path",{d:"m6 9 6 6 6-6"})}),Ci=({size:e="1em",...n})=>l.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:[l.jsx("path",{d:"M18 6 6 18"}),l.jsx("path",{d:"m6 6 12 12"})]}),Ql=({size:e="1em",...n})=>l.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:l.jsx("path",{d:"M20 6 9 17l-5-5"})}),ec=({size:e="1em",...n})=>l.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:[l.jsx("circle",{cx:"11",cy:"11",r:"8"}),l.jsx("path",{d:"m21 21-4.3-4.3"})]}),tc=({size:e="1em",...n})=>l.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:l.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})});function Bn(e,n){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[n]??"":e)}function Wt(e,n){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[n]??"":e)}function ln(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function Si(e,n,t,o){if(!n)return!1;const r=Wt(e,o);return t&&Array.isArray(n)?n.some(i=>Wt(i,o)===r):Wt(n,o)===r}function ko(e,n,t,o){if(!n.trim())return e;const r=n.toLowerCase().trim();return o?e.filter(i=>o(i,n)):e.filter(i=>Bn(i,t).toLowerCase().includes(r))}function xi(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 $i(e){const n=[];let t=0;for(const o of e){n.push({tipo:"grupo",datos:null,nombreGrupo:o.grupo,indice:t++});for(const r of o.opciones)n.push({tipo:"opcion",datos:r,indice:t++})}return n}function Ii(e,n,t,o){return n.trim()?e.map(r=>({...r,opciones:ko(r.opciones,n,t,o)})).filter(r=>r.opciones.length>0):e}function nc(e){return e.map((n,t)=>n.tipo==="grupo"||n.datos&&ln(n.datos)?t:null).filter(n=>n!==null)}function oc(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 rc(e,n,t){return e!==void 0?e:n==="invalid"?!0:n==="valid"?!1:!!t}function ic(e,n="Opción"){return Array.from({length:e},(t,o)=>`${n} ${o+1}`)}function sc(e){return Array.from({length:e},(n,t)=>({id:`usr-${t+1}`,nombre:`Usuario ${t+1}`,email:`usuario${t+1}@test.com`}))}const G={contenedor_base:"_contenedor_base_wsyf6_1",tam_sm:"_tam_sm_wsyf6_39",tam_lg:"_tam_lg_wsyf6_53",radio_none:"_radio_none_wsyf6_67",radio_sm:"_radio_sm_wsyf6_75",radio_md:"_radio_md_wsyf6_83",radio_lg:"_radio_lg_wsyf6_91",radio_full:"_radio_full_wsyf6_99",color_default:"_color_default_wsyf6_107",color_primary:"_color_primary_wsyf6_109",color_secondary:"_color_secondary_wsyf6_117",color_success:"_color_success_wsyf6_125",color_warning:"_color_warning_wsyf6_133",color_danger:"_color_danger_wsyf6_141",etiqueta:"_etiqueta_wsyf6_149",marca_requerido:"_marca_requerido_wsyf6_167",trigger:"_trigger_wsyf6_193",variante_bordered:"_variante_bordered_wsyf6_223",variante_faded:"_variante_faded_wsyf6_233",variante_underlined:"_variante_underlined_wsyf6_243",variante_ghost:"_variante_ghost_wsyf6_259",deshabilitado:"_deshabilitado_wsyf6_271",solo_lectura:"_solo_lectura_wsyf6_291",abierto:"_abierto_wsyf6_301",valido:"_valido_wsyf6_309",invalido:"_invalido_wsyf6_317",contenido_inicio:"_contenido_inicio_wsyf6_369",contenido_final:"_contenido_final_wsyf6_371",valor_wrapper:"_valor_wrapper_wsyf6_389",valor_texto:"_valor_texto_wsyf6_409",placeholder:"_placeholder_wsyf6_429",chip_multi:"_chip_multi_wsyf6_439",chip_texto:"_chip_texto_wsyf6_473",chip_cerrar:"_chip_cerrar_wsyf6_485",contador_multi:"_contador_multi_wsyf6_525",acciones:"_acciones_wsyf6_539",boton_limpiar:"_boton_limpiar_wsyf6_553",tiene_valor:"_tiene_valor_wsyf6_605",icono_chevron:"_icono_chevron_wsyf6_615",icono_spinner:"_icono_spinner_wsyf6_637",girarSpinner:"_girarSpinner_wsyf6_1",menu:"_menu_wsyf6_671",buscador_wrapper:"_buscador_wrapper_wsyf6_697",buscador_interno:"_buscador_interno_wsyf6_709",icono_buscar:"_icono_buscar_wsyf6_739",input_busqueda:"_input_busqueda_wsyf6_751",lista_opciones:"_lista_opciones_wsyf6_783",lista_virtual:"_lista_virtual_wsyf6_807",contenedor_virtual:"_contenedor_virtual_wsyf6_815",encabezado_grupo:"_encabezado_grupo_wsyf6_823",opcion:"_opcion_wsyf6_855",opcion_virtual:"_opcion_virtual_wsyf6_881",activo:"_activo_wsyf6_889",seleccionado:"_seleccionado_wsyf6_897",opcion_check:"_opcion_check_wsyf6_929",opcion_contenido:"_opcion_contenido_wsyf6_957",sin_resultados:"_sin_resultados_wsyf6_973",descripcion:"_descripcion_wsyf6_987",mensaje_error:"_mensaje_error_wsyf6_999",ancho_total:"_ancho_total_wsyf6_1011",sin_animacion:"_sin_animacion_wsyf6_1019",contenedor_nativo:"_contenedor_nativo_wsyf6_1029",select_nativo:"_select_nativo_wsyf6_1037"};function ac(e){const{options:n=[],value:t,onChange:o,onValueChange:r,optionLabelKey:i="label",optionValueKey:s="id",label:a,placeholder:d="Seleccione una opción",description:u,errorMessage:f,isRequired:h=!1,isInvalid:g,id:c,name:p,classNames:_,startContent:m,endContent:b,esInvalido:w,estaDeshabilitadoReal:C,clasesBase:S,renderizarValorMostrado:x}=e,y=v.useId(),M=c??`select-nativo-${y}`,E=u?`${M}-desc`:void 0,T=w?`${M}-err`:void 0,F=v.useCallback(O=>Bn(O,i),[i]),P=v.useCallback(O=>Wt(O,s),[s]),U=v.useCallback(O=>{o==null||o(O),r==null||r(O)},[o,r]),z=v.useCallback(O=>{const D=O.target.value;if(!D){U(null);return}const $=n.find(N=>P(N)===D);$&&U($)},[n,P,U]),k=typeof g=="string"?g:null,A=typeof f=="function"?f({invalido:w,mensaje:k}):f??k;return l.jsxs("div",{className:S,children:[a&&l.jsxs("label",{className:W(G.etiqueta,_==null?void 0:_.label),htmlFor:M,children:[a,h&&l.jsx("span",{className:G.marca_requerido,children:"*"})]}),l.jsxs("div",{className:G.contenedor_nativo,children:[l.jsxs("div",{className:W(G.trigger,_==null?void 0:_.trigger),children:[m&&l.jsx("span",{className:G.contenido_inicio,children:m}),l.jsx("div",{className:W(G.valor_wrapper,_==null?void 0:_.value),children:x()}),l.jsxs("div",{className:G.acciones,children:[b&&l.jsx("span",{className:G.contenido_final,children:b}),l.jsx("span",{className:G.icono_chevron,children:l.jsx(yi,{size:"1em"})})]})]}),l.jsxs("select",{id:M,name:p,className:G.select_nativo,value:t?P(t):"",onChange:z,disabled:C,required:h,children:[l.jsx("option",{value:"",children:d}),n.map(O=>l.jsx("option",{value:P(O),disabled:ln(O),children:F(O)},P(O)))]})]}),u&&!w&&l.jsx("div",{id:E,className:W(G.descripcion,_==null?void 0:_.description),children:u}),w&&A&&l.jsx("div",{id:T,className:W(G.mensaje_error,_==null?void 0:_.errorMessage),children:A})]})}const lc="(max-width: 768px)";function cc(e,n){const{options:t=[],value:o,defaultValue:r,onChange:i,onValueChange:s,optionLabelKey:a="label",optionValueKey:d="id",renderOption:u,renderValue:f,variant:h="bordered",color:g="default",size:c="md",radius:p="md",fullWidth:_=!0,disableAnimation:m=!1,label:b,placeholder:w="Seleccione una opción",description:C,errorMessage:S,emptyMessage:x="No hay opciones",noResultsMessage:y="Sin resultados",isRequired:M=!1,isDisabled:E=!1,isReadOnly:T=!1,isLoading:F=!1,isClearable:P=!0,isInvalid:U,validationState:z,isMultiple:k=!1,isSearchable:A=!1,isVirtualized:O=!1,estimatedOptionHeight:D=36,filterFn:$,validate:N,onOpen:j,onClose:_e,onSearchChange:fe,onClear:L,onFocus:re,onBlur:Z,id:ue,name:we,className:ye,classNames:B,startContent:pe,endContent:Ee,menuZIndex:K,portalContainer:J}=e,X=v.useRef(null),Y=v.useRef([]),oe=v.useRef(null),te=v.useRef(null),se=v.useId(),de=ue??`select-${se}`,$e=jn(lc)&&!A&&!k,[R,ne]=v.useState(!1),[V,ae]=v.useState(null),[he,Ce]=v.useState(""),Be=o!==void 0,[Je,Ge]=v.useState(r??null),ie=Be?o:Je,Oe=E||F,le=v.useCallback(H=>Bn(H,a),[a]),ke=v.useCallback(H=>Wt(H,d),[d]),wt=v.useCallback(H=>Si(H,ie,k,d),[ie,k,d]),Ke=v.useMemo(()=>xi(t),[t]),q=v.useMemo(()=>!A||!he.trim()?t:Ke?Ii(t,he,a,$):ko(t,he,a,$),[t,he,A,$,a,Ke]),ge=v.useMemo(()=>Ke?$i(q):q.map((H,Se)=>({tipo:"opcion",datos:H,indice:Se})),[q,Ke]),Pe=v.useMemo(()=>oc(ie,N),[ie,N]),Te=v.useMemo(()=>rc(U,z,Pe),[U,z,Pe]),at=z==="valid"&&!Te,{refs:At,floatingStyles:Qe,context:et}=Fl({open:R,onOpenChange:H=>{Oe||T||(ne(H),H?(j==null||j(),Ce(""),ae(null)):_e==null||_e())},strategy:"fixed",transform:!1,placement:"bottom-start",middleware:[tl(4),ol({padding:8}),nl({padding:8}),rl({apply({rects:H,elements:Se}){Object.assign(Se.floating.style,{width:`${H.reference.width}px`})},padding:8})],whileElementsMounted:Wa}),{isMounted:rt,styles:Ko}=Tl(et,{duration:m?0:150,initial:{opacity:0,transform:"translateY(-4px)"},open:{opacity:1,transform:"translateY(0)"},close:{opacity:0,transform:"translateY(-4px)"},common:{transformOrigin:"top"}}),Kn=Zl({count:ge.length,getScrollElement:()=>oe.current,estimateSize:H=>{var Se;return((Se=ge[H])==null?void 0:Se.tipo)==="grupo"?32:D},overscan:5,enabled:O&&R}),Ru=$l(et,{enabled:!Oe&&!T}),qu=kl(et),ju=Nl(et,{role:"listbox"}),Bu=v.useMemo(()=>nc(ge),[ge]),Hu=Ol(et,{listRef:Y,activeIndex:V,onNavigate:ae,loop:!0,virtual:O,disabledIndices:Bu}),Yi=v.useRef([]);v.useEffect(()=>{Yi.current=ge.map(H=>H.tipo==="opcion"&&H.datos?le(H.datos):null)},[ge,le]);const Gu=zl(et,{listRef:Yi,activeIndex:V,onMatch:R?ae:void 0,enabled:!A}),{getReferenceProps:Wu,getFloatingProps:Uu,getItemProps:Zi}=Al([Ru,qu,ju,Hu,Gu]),Dt=v.useCallback(H=>{Be||Ge(H),i==null||i(H),s==null||s(H)},[Be,i,s]),Xn=v.useCallback(H=>{if(!ln(H))if(k){const Se=Array.isArray(ie)?ie:[],dt=Se.some(it=>ke(it)===ke(H));Dt(dt?Se.filter(it=>ke(it)!==ke(H)):[...Se,H])}else Dt(H),ne(!1)},[k,ie,ke,Dt]),Ku=v.useCallback(H=>{var Se;H.stopPropagation(),Dt(k?[]:null),L==null||L(),(Se=X.current)==null||Se.focus()},[k,Dt,L]),Ji=v.useCallback((H,Se)=>{Se.stopPropagation(),!(!k||!Array.isArray(ie))&&Dt(ie.filter(dt=>ke(dt)!==ke(H)))},[k,ie,ke,Dt]),Xu=v.useCallback(H=>{Ce(H.target.value),fe==null||fe(H.target.value),ae(0)},[fe]),Yu=v.useCallback(H=>{if(H.key==="Enter"&&V!==null){H.preventDefault();const Se=ge[V];(Se==null?void 0:Se.tipo)==="opcion"&&Se.datos&&Xn(Se.datos)}},[V,ge,Xn]);v.useEffect(()=>{R&&A&&requestAnimationFrame(()=>{var H;return(H=te.current)==null?void 0:H.focus()})},[R,A]),v.useEffect(()=>{O&&V!==null&&Kn.scrollToIndex(V,{align:"auto",behavior:"smooth"})},[V,O,Kn]),v.useImperativeHandle(n,()=>({focus:()=>{var H;return(H=X.current)==null?void 0:H.focus()},blur:()=>{var H;return(H=X.current)==null?void 0:H.blur()},open:()=>ne(!0),close:()=>ne(!1),clear:()=>Dt(k?[]:null)}));const Yn=k?Array.isArray(ie)&&ie.length>0:ie!=null,Qi=v.useCallback(()=>{if(f)return f(ie??null);if(!Yn)return l.jsx("span",{className:G.placeholder,children:w});if(k&&Array.isArray(ie)){if(ie.length===0)return l.jsx("span",{className:G.placeholder,children:w});const H=ie.slice(0,2),Se=ie.length-2;return l.jsxs(l.Fragment,{children:[H.map(dt=>l.jsxs("span",{className:G.chip_multi,children:[l.jsx("span",{className:G.chip_texto,children:le(dt)}),!T&&!Oe&&l.jsx("button",{type:"button",className:G.chip_cerrar,onClick:it=>Ji(dt,it),children:l.jsx(Ci,{size:"1em"})})]},ke(dt))),Se>0&&l.jsxs("span",{className:G.contador_multi,children:["+",Se]})]})}return l.jsx("span",{className:G.valor_texto,children:le(ie)})},[f,ie,Yn,w,k,T,Oe,ke,le,Ji]),es=v.useCallback((H,Se,dt)=>{if(H.tipo==="grupo")return l.jsx("li",{className:W(G.encabezado_grupo,O&&G.opcion_virtual),style:dt,children:H.nombreGrupo},`grupo-${H.nombreGrupo}`);const it=H.datos,os=wt(it),rs=V===Se,Zu=ln(it),Ju=u?u(it,{isSelected:os,isActive:rs}):l.jsxs(l.Fragment,{children:[l.jsx("span",{className:G.opcion_check,children:l.jsx(Ql,{size:"1em"})}),l.jsx("span",{className:G.opcion_contenido,children:le(it)})]});return l.jsx("li",{ref:Qu=>{Y.current[Se]=Qu},className:W(G.opcion,O&&G.opcion_virtual,{[G.activo]:rs,[G.seleccionado]:os,[G.deshabilitado]:Zu},B==null?void 0:B.option),style:dt,...Zi({onClick:()=>Xn(it)}),children:Ju},ke(it))},[O,V,wt,u,le,ke,B==null?void 0:B.option,Zi,Xn]),ts=typeof S=="function"?S({invalido:Te,mensaje:Pe}):S??Pe,ns=W(G.contenedor_base,G[`variante_${h}`],G[`tam_${c}`],G[`radio_${p}`],G[`color_${g}`],{[G.ancho_total]:_,[G.sin_animacion]:m,[G.deshabilitado]:Oe,[G.solo_lectura]:T,[G.invalido]:Te,[G.valido]:at,[G.abierto]:R,[G.tiene_valor]:Yn},B==null?void 0:B.base,ye);return $e&&!Ke?l.jsx(ac,{...e,esInvalido:Te,estaDeshabilitadoReal:Oe,clasesBase:ns,renderizarValorMostrado:Qi}):l.jsxs("div",{className:ns,children:[b&&l.jsxs("label",{className:W(G.etiqueta,B==null?void 0:B.label),htmlFor:de,children:[b,M&&l.jsx("span",{className:G.marca_requerido,children:"*"})]}),l.jsxs("div",{ref:H=>{At.setReference(H),X.current=H},id:de,tabIndex:Oe?-1:0,className:W(G.trigger,B==null?void 0:B.trigger),onFocus:re,onBlur:Z,...Wu(),children:[pe&&l.jsx("span",{className:G.contenido_inicio,children:pe}),l.jsx("div",{className:W(G.valor_wrapper,B==null?void 0:B.value),children:Qi()}),l.jsxs("div",{className:G.acciones,children:[P&&Yn&&!T&&!Oe&&l.jsx("button",{type:"button",className:W(G.boton_limpiar,B==null?void 0:B.clearButton),onClick:Ku,tabIndex:-1,children:l.jsx(Ci,{size:"1em"})}),Ee&&l.jsx("span",{className:G.contenido_final,children:Ee}),F?l.jsx("span",{className:G.icono_spinner,children:l.jsx(tc,{size:"1em"})}):l.jsx("span",{className:G.icono_chevron,children:l.jsx(yi,{size:"1em"})})]})]}),we&&l.jsx("input",{type:"hidden",name:we,value:k&&Array.isArray(ie)?ie.map(ke).join(","):ie?ke(ie):""}),rt&&l.jsx(vl,{root:J,children:l.jsx(Sl,{context:et,modal:!1,initialFocus:A?te:-1,children:l.jsxs("div",{ref:At.setFloating,style:{...Qe,...Ko,zIndex:K??void 0},className:W(G.menu,B==null?void 0:B.menu),...Uu(),children:[A&&l.jsx("div",{className:G.buscador_wrapper,children:l.jsxs("div",{className:G.buscador_interno,children:[l.jsx("span",{className:G.icono_buscar,children:l.jsx(ec,{size:"1em"})}),l.jsx("input",{ref:te,type:"text",className:W(G.input_busqueda,B==null?void 0:B.searchInput),placeholder:"Buscar...",value:he,onChange:Xu,onKeyDown:Yu})]})}),l.jsx("ul",{ref:oe,className:W(G.lista_opciones,O&&G.lista_virtual),children:ge.length===0?l.jsx("li",{className:G.sin_resultados,children:he?y:x}):O?l.jsx("div",{className:G.contenedor_virtual,style:{height:`${Kn.getTotalSize()}px`,width:"100%",position:"relative"},children:Kn.getVirtualItems().map(H=>es(ge[H.index],H.index,{position:"absolute",top:0,left:0,width:"100%",height:`${H.size}px`,transform:`translateY(${H.start}px)`}))}):ge.map((H,Se)=>es(H,Se))})]})})}),C&&!Te&&l.jsx("div",{className:W(G.descripcion,B==null?void 0:B.description),children:C}),Te&&ts&&l.jsx("div",{className:W(G.mensaje_error,B==null?void 0:B.errorMessage),children:ts})]})}const Ei=v.forwardRef(cc);Ei.displayName="Select";/**
|
|
8
|
+
* table-core
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) TanStack
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the MIT license found in the
|
|
13
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
14
|
+
*
|
|
15
|
+
* @license MIT
|
|
16
|
+
*/function Et(e,n){return typeof e=="function"?e(n):e}function Ze(e,n){return t=>{n.setState(o=>({...o,[e]:Et(t,o[e])}))}}function Hn(e){return e instanceof Function}function uc(e){return Array.isArray(e)&&e.every(n=>typeof n=="number")}function dc(e,n){const t=[],o=r=>{r.forEach(i=>{t.push(i);const s=n(i);s!=null&&s.length&&o(s)})};return o(e),t}function Q(e,n,t){let o=[],r;return i=>{let s;t.key&&t.debug&&(s=Date.now());const a=e(i);if(!(a.length!==o.length||a.some((f,h)=>o[h]!==f)))return r;o=a;let u;if(t.key&&t.debug&&(u=Date.now()),r=n(...a),t==null||t.onChange==null||t.onChange(r),t.key&&t.debug&&t!=null&&t.debug()){const f=Math.round((Date.now()-s)*100)/100,h=Math.round((Date.now()-u)*100)/100,g=h/16,c=(p,_)=>{for(p=String(p);p.length<_;)p=" "+p;return p};console.info(`%c⏱ ${c(h,5)} /${c(f,5)} ms`,`
|
|
17
|
+
font-size: .6rem;
|
|
18
|
+
font-weight: bold;
|
|
19
|
+
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,t==null?void 0:t.key)}return r}}function ee(e,n,t,o){return{debug:()=>{var r;return(r=e==null?void 0:e.debugAll)!=null?r:e[n]},key:process.env.NODE_ENV==="development"&&t,onChange:o}}function fc(e,n,t,o){const r=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${n.id}_${t.id}`,row:n,column:t,getValue:()=>n.getValue(o),renderValue:r,getContext:Q(()=>[e,t,n,i],(s,a,d,u)=>({table:s,column:a,row:d,cell:u,getValue:u.getValue,renderValue:u.renderValue}),ee(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,t,n,e)},{}),i}function gc(e,n,t,o){var r,i;const a={...e._getDefaultColumnDef(),...n},d=a.accessorKey;let u=(r=(i=a.id)!=null?i:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?r:typeof a.header=="string"?a.header:void 0,f;if(a.accessorFn?f=a.accessorFn:d&&(d.includes(".")?f=g=>{let c=g;for(const _ of d.split(".")){var p;c=(p=c)==null?void 0:p[_],process.env.NODE_ENV!=="production"&&c===void 0&&console.warn(`"${_}" in deeply nested key "${d}" returned undefined.`)}return c}:f=g=>g[a.accessorKey]),!u)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let h={id:`${String(u)}`,accessorFn:f,parent:o,depth:t,columnDef:a,columns:[],getFlatColumns:Q(()=>[!0],()=>{var g;return[h,...(g=h.columns)==null?void 0:g.flatMap(c=>c.getFlatColumns())]},ee(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Q(()=>[e._getOrderColumnsFn()],g=>{var c;if((c=h.columns)!=null&&c.length){let p=h.columns.flatMap(_=>_.getLeafColumns());return g(p)}return[h]},ee(e.options,"debugColumns","column.getLeafColumns"))};for(const g of e._features)g.createColumn==null||g.createColumn(h,e);return h}const je="debugHeaders";function ki(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=[],a=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(a),s.push(d)};return a(i),s},getContext:()=>({table:e,header:i,column:n})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const _c={createTable:e=>{e.getHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,r)=>{var i,s;const a=(i=o==null?void 0:o.map(h=>t.find(g=>g.id===h)).filter(Boolean))!=null?i:[],d=(s=r==null?void 0:r.map(h=>t.find(g=>g.id===h)).filter(Boolean))!=null?s:[],u=t.filter(h=>!(o!=null&&o.includes(h.id))&&!(r!=null&&r.includes(h.id)));return Gn(n,[...a,...u,...d],e)},ee(e.options,je,"getHeaderGroups")),e.getCenterHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,r)=>(t=t.filter(i=>!(o!=null&&o.includes(i.id))&&!(r!=null&&r.includes(i.id))),Gn(n,t,e,"center")),ee(e.options,je,"getCenterHeaderGroups")),e.getLeftHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,t,o)=>{var r;const i=(r=o==null?void 0:o.map(s=>t.find(a=>a.id===s)).filter(Boolean))!=null?r:[];return Gn(n,i,e,"left")},ee(e.options,je,"getLeftHeaderGroups")),e.getRightHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,t,o)=>{var r;const i=(r=o==null?void 0:o.map(s=>t.find(a=>a.id===s)).filter(Boolean))!=null?r:[];return Gn(n,i,e,"right")},ee(e.options,je,"getRightHeaderGroups")),e.getFooterGroups=Q(()=>[e.getHeaderGroups()],n=>[...n].reverse(),ee(e.options,je,"getFooterGroups")),e.getLeftFooterGroups=Q(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),ee(e.options,je,"getLeftFooterGroups")),e.getCenterFooterGroups=Q(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),ee(e.options,je,"getCenterFooterGroups")),e.getRightFooterGroups=Q(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),ee(e.options,je,"getRightFooterGroups")),e.getFlatHeaders=Q(()=>[e.getHeaderGroups()],n=>n.map(t=>t.headers).flat(),ee(e.options,je,"getFlatHeaders")),e.getLeftFlatHeaders=Q(()=>[e.getLeftHeaderGroups()],n=>n.map(t=>t.headers).flat(),ee(e.options,je,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Q(()=>[e.getCenterHeaderGroups()],n=>n.map(t=>t.headers).flat(),ee(e.options,je,"getCenterFlatHeaders")),e.getRightFlatHeaders=Q(()=>[e.getRightHeaderGroups()],n=>n.map(t=>t.headers).flat(),ee(e.options,je,"getRightFlatHeaders")),e.getCenterLeafHeaders=Q(()=>[e.getCenterFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ee(e.options,je,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Q(()=>[e.getLeftFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ee(e.options,je,"getLeftLeafHeaders")),e.getRightLeafHeaders=Q(()=>[e.getRightFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ee(e.options,je,"getRightLeafHeaders")),e.getLeafHeaders=Q(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,t,o)=>{var r,i,s,a,d,u;return[...(r=(i=n[0])==null?void 0:i.headers)!=null?r:[],...(s=(a=t[0])==null?void 0:a.headers)!=null?s:[],...(d=(u=o[0])==null?void 0:u.headers)!=null?d:[]].map(f=>f.getLeafHeaders()).flat()},ee(e.options,je,"getLeafHeaders"))}};function Gn(e,n,t,o){var r,i;let s=0;const a=function(g,c){c===void 0&&(c=1),s=Math.max(s,c),g.filter(p=>p.getIsVisible()).forEach(p=>{var _;(_=p.columns)!=null&&_.length&&a(p.columns,c+1)},0)};a(e);let d=[];const u=(g,c)=>{const p={depth:c,id:[o,`${c}`].filter(Boolean).join("_"),headers:[]},_=[];g.forEach(m=>{const b=[..._].reverse()[0],w=m.column.depth===p.depth;let C,S=!1;if(w&&m.column.parent?C=m.column.parent:(C=m.column,S=!0),b&&(b==null?void 0:b.column)===C)b.subHeaders.push(m);else{const x=ki(t,C,{id:[o,c,C.id,m==null?void 0:m.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${_.filter(y=>y.column===C).length}`:void 0,depth:c,index:_.length});x.subHeaders.push(m),_.push(x)}p.headers.push(m),m.headerGroup=p}),d.push(p),c>0&&u(_,c-1)},f=n.map((g,c)=>ki(t,g,{depth:s,index:c}));u(f,s-1),d.reverse();const h=g=>g.filter(p=>p.column.getIsVisible()).map(p=>{let _=0,m=0,b=[0];p.subHeaders&&p.subHeaders.length?(b=[],h(p.subHeaders).forEach(C=>{let{colSpan:S,rowSpan:x}=C;_+=S,b.push(x)})):_=1;const w=Math.min(...b);return m=m+w,p.colSpan=_,p.rowSpan=m,{colSpan:_,rowSpan:m}});return h((r=(i=d[0])==null?void 0:i.headers)!=null?r:[]),d}const Mo=(e,n,t,o,r,i,s)=>{let a={id:n,index:o,original:t,depth:r,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(a._valuesCache.hasOwnProperty(d))return a._valuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return a._valuesCache[d]=u.accessorFn(a.original,o),a._valuesCache[d]},getUniqueValues:d=>{if(a._uniqueValuesCache.hasOwnProperty(d))return a._uniqueValuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[d]=u.columnDef.getUniqueValues(a.original,o),a._uniqueValuesCache[d]):(a._uniqueValuesCache[d]=[a.getValue(d)],a._uniqueValuesCache[d])},renderValue:d=>{var u;return(u=a.getValue(d))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>dc(a.subRows,d=>d.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let d=[],u=a;for(;;){const f=u.getParentRow();if(!f)break;d.push(f),u=f}return d.reverse()},getAllCells:Q(()=>[e.getAllLeafColumns()],d=>d.map(u=>fc(e,a,u,u.id)),ee(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Q(()=>[a.getAllCells()],d=>d.reduce((u,f)=>(u[f.column.id]=f,u),{}),ee(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(a,e)}return a},pc={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()}}},Mi=(e,n,t)=>{var o,r;const i=t==null||(o=t.toString())==null?void 0:o.toLowerCase();return!!(!((r=e.getValue(n))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(i))};Mi.autoRemove=e=>st(e);const Fi=(e,n,t)=>{var o;return!!(!((o=e.getValue(n))==null||(o=o.toString())==null)&&o.includes(t))};Fi.autoRemove=e=>st(e);const Ai=(e,n,t)=>{var o;return((o=e.getValue(n))==null||(o=o.toString())==null?void 0:o.toLowerCase())===(t==null?void 0:t.toLowerCase())};Ai.autoRemove=e=>st(e);const Di=(e,n,t)=>{var o;return(o=e.getValue(n))==null?void 0:o.includes(t)};Di.autoRemove=e=>st(e);const Oi=(e,n,t)=>!t.some(o=>{var r;return!((r=e.getValue(n))!=null&&r.includes(o))});Oi.autoRemove=e=>st(e)||!(e!=null&&e.length);const Pi=(e,n,t)=>t.some(o=>{var r;return(r=e.getValue(n))==null?void 0:r.includes(o)});Pi.autoRemove=e=>st(e)||!(e!=null&&e.length);const Ni=(e,n,t)=>e.getValue(n)===t;Ni.autoRemove=e=>st(e);const Li=(e,n,t)=>e.getValue(n)==t;Li.autoRemove=e=>st(e);const Fo=(e,n,t)=>{let[o,r]=t;const i=e.getValue(n);return i>=o&&i<=r};Fo.resolveFilterValue=e=>{let[n,t]=e,o=typeof n!="number"?parseFloat(n):n,r=typeof t!="number"?parseFloat(t):t,i=n===null||Number.isNaN(o)?-1/0:o,s=t===null||Number.isNaN(r)?1/0:r;if(i>s){const a=i;i=s,s=a}return[i,s]},Fo.autoRemove=e=>st(e)||st(e[0])&&st(e[1]);const ht={includesString:Mi,includesStringSensitive:Fi,equalsString:Ai,arrIncludes:Di,arrIncludesAll:Oi,arrIncludesSome:Pi,equals:Ni,weakEquals:Li,inNumberRange:Fo};function st(e){return e==null||e===""}const hc={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ze("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const t=n.getCoreRowModel().flatRows[0],o=t==null?void 0:t.getValue(e.id);return typeof o=="string"?ht.includesString:typeof o=="number"?ht.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?ht.equals:Array.isArray(o)?ht.arrIncludes:ht.weakEquals},e.getFilterFn=()=>{var t,o;return Hn(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:ht[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,o,r;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((o=n.options.enableColumnFilters)!=null?o:!0)&&((r=n.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=n.getState().columnFilters)==null||(t=t.find(o=>o.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,o;return(t=(o=n.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?t:-1},e.setFilterValue=t=>{n.setColumnFilters(o=>{const r=e.getFilterFn(),i=o==null?void 0:o.find(f=>f.id===e.id),s=Et(t,i?i.value:void 0);if(Vi(r,s,e)){var a;return(a=o==null?void 0:o.filter(f=>f.id!==e.id))!=null?a:[]}const d={id:e.id,value:s};if(i){var u;return(u=o==null?void 0:o.map(f=>f.id===e.id?d:f))!=null?u:[]}return o!=null&&o.length?[...o,d]:[d]})}},createRow:(e,n)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=n=>{const t=e.getAllLeafColumns(),o=r=>{var i;return(i=Et(n,r))==null?void 0:i.filter(s=>{const a=t.find(d=>d.id===s.id);if(a){const d=a.getFilterFn();if(Vi(d,s.value,a))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 Vi(e,n,t){return(e&&e.autoRemove?e.autoRemove(n,t):!1)||typeof n>"u"||typeof n=="string"&&!n}const Ao={sum:(e,n,t)=>t.reduce((o,r)=>{const i=r.getValue(e);return o+(typeof i=="number"?i:0)},0),min:(e,n,t)=>{let o;return t.forEach(r=>{const i=r.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},max:(e,n,t)=>{let o;return t.forEach(r=>{const i=r.getValue(e);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},extent:(e,n,t)=>{let o,r;return t.forEach(i=>{const s=i.getValue(e);s!=null&&(o===void 0?s>=s&&(o=r=s):(o>s&&(o=s),r<s&&(r=s)))}),[o,r]},mean:(e,n)=>{let t=0,o=0;if(n.forEach(r=>{let i=r.getValue(e);i!=null&&(i=+i)>=i&&(++t,o+=i)}),t)return o/t},median:(e,n)=>{if(!n.length)return;const t=n.map(i=>i.getValue(e));if(!uc(t))return;if(t.length===1)return t[0];const o=Math.floor(t.length/2),r=t.sort((i,s)=>i-s);return t.length%2!==0?r[o]:(r[o-1]+r[o])/2},unique:(e,n)=>Array.from(new Set(n.map(t=>t.getValue(e))).values()),uniqueCount:(e,n)=>new Set(n.map(t=>t.getValue(e))).size,count:(e,n)=>n.length},mc={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:Ze("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==null?void 0:t.getValue(e.id);if(typeof o=="number")return Ao.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Ao.extent},e.getAggregationFn=()=>{var t,o;if(!e)throw new Error;return Hn(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:Ao[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=n=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(n),e.resetGrouping=n=>{var t,o;e.setGrouping(n?[]:(t=(o=e.initialState)==null?void 0:o.grouping)!=null?t:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,n)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const o=n.getColumn(t);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[t]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,n,t,o)=>{e.getIsGrouped=()=>n.getIsGrouped()&&n.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&n.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=t.subRows)!=null&&r.length)}}};function vc(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 bc={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ze("columnOrder",e)}),createColumn:(e,n)=>{e.getIndex=Q(t=>[cn(n,t)],t=>t.findIndex(o=>o.id===e.id),ee(n.options,"debugColumns","getIndex")),e.getIsFirstColumn=t=>{var o;return((o=cn(n,t)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=t=>{var o;const r=cn(n,t);return((o=r[r.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=n=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(n),e.resetColumnOrder=n=>{var t;e.setColumnOrder(n?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=Q(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,t,o)=>r=>{let i=[];if(!(n!=null&&n.length))i=r;else{const s=[...n],a=[...r];for(;a.length&&s.length;){const d=s.shift(),u=a.findIndex(f=>f.id===d);u>-1&&i.push(a.splice(u,1)[0])}i=[...i,...a]}return vc(i,t,o)},ee(e.options,"debugTable","_getOrderColumnsFn"))}},Do=()=>({left:[],right:[]}),wc={getInitialState:e=>({columnPinning:Do(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ze("columnPinning",e)}),createColumn:(e,n)=>{e.pin=t=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);n.setColumnPinning(r=>{var i,s;if(t==="right"){var a,d;return{left:((a=r==null?void 0:r.left)!=null?a:[]).filter(h=>!(o!=null&&o.includes(h))),right:[...((d=r==null?void 0:r.right)!=null?d:[]).filter(h=>!(o!=null&&o.includes(h))),...o]}}if(t==="left"){var u,f;return{left:[...((u=r==null?void 0:r.left)!=null?u:[]).filter(h=>!(o!=null&&o.includes(h))),...o],right:((f=r==null?void 0:r.right)!=null?f:[]).filter(h=>!(o!=null&&o.includes(h)))}}return{left:((i=r==null?void 0:r.left)!=null?i:[]).filter(h=>!(o!=null&&o.includes(h))),right:((s=r==null?void 0:r.right)!=null?s:[]).filter(h=>!(o!=null&&o.includes(h)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,i,s;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((i=(s=n.options.enableColumnPinning)!=null?s:n.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(a=>a.id),{left:o,right:r}=n.getState().columnPinning,i=t.some(a=>o==null?void 0:o.includes(a)),s=t.some(a=>r==null?void 0:r.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var t,o;const r=e.getIsPinned();return r?(t=(o=n.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?t:-1:0}},createRow:(e,n)=>{e.getCenterVisibleCells=Q(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(t,o,r)=>{const i=[...o??[],...r??[]];return t.filter(s=>!i.includes(s.column.id))},ee(n.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=Q(()=>[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"})),ee(n.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=Q(()=>[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"})),ee(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?Do():(t=(o=e.initialState)==null?void 0:o.columnPinning)!=null?t:Do())},e.getIsSomeColumnsPinned=n=>{var t;const o=e.getState().columnPinning;if(!n){var r,i;return!!((r=o.left)!=null&&r.length||(i=o.right)!=null&&i.length)}return!!((t=o[n])!=null&&t.length)},e.getLeftLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,t)=>(t??[]).map(o=>n.find(r=>r.id===o)).filter(Boolean),ee(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,t)=>(t??[]).map(o=>n.find(r=>r.id===o)).filter(Boolean),ee(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o)=>{const r=[...t??[],...o??[]];return n.filter(i=>!r.includes(i.id))},ee(e.options,"debugColumns","getCenterLeafColumns"))}};function yc(e){return e||(typeof document<"u"?document:null)}const Wn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Oo=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Cc={getDefaultColumnDef:()=>Wn,getInitialState:e=>({columnSizing:{},columnSizingInfo:Oo(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ze("columnSizing",e),onColumnSizingInfoChange:Ze("columnSizingInfo",e)}),createColumn:(e,n)=>{e.getSize=()=>{var t,o,r;const i=n.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:Wn.minSize,(o=i??e.columnDef.size)!=null?o:Wn.size),(r=e.columnDef.maxSize)!=null?r:Wn.maxSize)},e.getStart=Q(t=>[t,cn(n,t),n.getState().columnSizing],(t,o)=>o.slice(0,e.getIndex(t)).reduce((r,i)=>r+i.getSize(),0),ee(n.options,"debugColumns","getStart")),e.getAfter=Q(t=>[t,cn(n,t),n.getState().columnSizing],(t,o)=>o.slice(e.getIndex(t)+1).reduce((r,i)=>r+i.getSize(),0),ee(n.options,"debugColumns","getAfter")),e.resetSize=()=>{n.setColumnSizing(t=>{let{[e.id]:o,...r}=t;return r})},e.getCanResize=()=>{var t,o;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((o=n.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>n.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,n)=>{e.getSize=()=>{let t=0;const o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var i;t+=(i=r.column.getSize())!=null?i:0}};return o(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=t=>{const o=n.getColumn(e.column.id),r=o==null?void 0:o.getCanResize();return i=>{if(!o||!r||(i.persist==null||i.persist(),Po(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(b=>[b.column.id,b.column.getSize()]):[[o.id,o.getSize()]],d=Po(i)?Math.round(i.touches[0].clientX):i.clientX,u={},f=(b,w)=>{typeof w=="number"&&(n.setColumnSizingInfo(C=>{var S,x;const y=n.options.columnResizeDirection==="rtl"?-1:1,M=(w-((S=C==null?void 0:C.startOffset)!=null?S:0))*y,E=Math.max(M/((x=C==null?void 0:C.startSize)!=null?x:0),-.999999);return C.columnSizingStart.forEach(T=>{let[F,P]=T;u[F]=Math.round(Math.max(P+P*E,0)*100)/100}),{...C,deltaOffset:M,deltaPercentage:E}}),(n.options.columnResizeMode==="onChange"||b==="end")&&n.setColumnSizing(C=>({...C,...u})))},h=b=>f("move",b),g=b=>{f("end",b),n.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},c=yc(t),p={moveHandler:b=>h(b.clientX),upHandler:b=>{c==null||c.removeEventListener("mousemove",p.moveHandler),c==null||c.removeEventListener("mouseup",p.upHandler),g(b.clientX)}},_={moveHandler:b=>(b.cancelable&&(b.preventDefault(),b.stopPropagation()),h(b.touches[0].clientX),!1),upHandler:b=>{var w;c==null||c.removeEventListener("touchmove",_.moveHandler),c==null||c.removeEventListener("touchend",_.upHandler),b.cancelable&&(b.preventDefault(),b.stopPropagation()),g((w=b.touches[0])==null?void 0:w.clientX)}},m=Sc()?{passive:!1}:!1;Po(i)?(c==null||c.addEventListener("touchmove",_.moveHandler,m),c==null||c.addEventListener("touchend",_.upHandler,m)):(c==null||c.addEventListener("mousemove",p.moveHandler,m),c==null||c.addEventListener("mouseup",p.upHandler,m)),n.setColumnSizingInfo(b=>({...b,startOffset:d,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,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?Oo():(t=e.initialState.columnSizingInfo)!=null?t:Oo())},e.getTotalSize=()=>{var n,t;return(n=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getLeftTotalSize=()=>{var n,t;return(n=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getCenterTotalSize=()=>{var n,t;return(n=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getRightTotalSize=()=>{var n,t;return(n=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0}}};let Un=null;function Sc(){if(typeof Un=="boolean")return Un;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 Un=e,Un}function Po(e){return e.type==="touchstart"}const xc={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ze("columnVisibility",e)}),createColumn:(e,n)=>{e.toggleVisibility=t=>{e.getCanHide()&&n.setColumnVisibility(o=>({...o,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,o;const r=e.columns;return(t=r.length?r.some(i=>i.getIsVisible()):(o=n.getState().columnVisibility)==null?void 0:o[e.id])!=null?t:!0},e.getCanHide=()=>{var t,o;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((o=n.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,n)=>{e._getAllVisibleCells=Q(()=>[e.getAllCells(),n.getState().columnVisibility],t=>t.filter(o=>o.column.getIsVisible()),ee(n.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=Q(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,o,r)=>[...t,...o,...r],ee(n.options,"debugRows","getVisibleCells"))},createTable:e=>{const n=(t,o)=>Q(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ee(e.options,"debugColumns",t));e.getVisibleFlatColumns=n("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=n("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=n("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=n("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=n("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var o;e.setColumnVisibility(t?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=t=>{var o;t=(o=t)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,i)=>({...r,[i.id]:t||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(t=>!(t.getIsVisible!=null&&t.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(t=>t.getIsVisible==null?void 0:t.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var o;e.toggleAllColumnsVisible((o=t.target)==null?void 0:o.checked)}}};function cn(e,n){return n?n==="center"?e.getCenterVisibleLeafColumns():n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const $c={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()}}},Ic={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ze("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:n=>{var t;const o=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[n.id])==null?void 0:t.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,n)=>{e.getCanGlobalFilter=()=>{var t,o,r,i;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((o=n.options.enableGlobalFilter)!=null?o:!0)&&((r=n.options.enableFilters)!=null?r:!0)&&((i=n.options.getColumnCanGlobalFilter==null?void 0:n.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ht.includesString,e.getGlobalFilterFn=()=>{var n,t;const{globalFilterFn:o}=e.options;return Hn(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(n=(t=e.options.filterFns)==null?void 0:t[o])!=null?n:ht[o]},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)}}},Ec={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ze("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let n=!1,t=!1;e._autoResetExpanded=()=>{var o,r;if(!n){e._queue(()=>{n=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var r,i;e.setExpanded(o?{}:(r=(i=e.initialState)==null?void 0:i.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");o=Math.max(o,s.length)}),o},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,n)=>{e.toggleExpanded=t=>{n.setExpanded(o=>{var r;const i=o===!0?!0:!!(o!=null&&o[e.id]);let s={};if(o===!0?Object.keys(n.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=o,t=(r=t)!=null?r:!i,!i&&t)return{...s,[e.id]:!0};if(i&&!t){const{[e.id]:a,...d}=s;return d}return o})},e.getIsExpanded=()=>{var t;const o=n.getState().expanded;return!!((t=n.options.getIsRowExpanded==null?void 0:n.options.getIsRowExpanded(e))!=null?t:o===!0||o!=null&&o[e.id])},e.getCanExpand=()=>{var t,o,r;return(t=n.options.getRowCanExpand==null?void 0:n.options.getRowCanExpand(e))!=null?t:((o=n.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let t=!0,o=e;for(;t&&o.parentId;)o=n.getRow(o.parentId,!0),t=o.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},No=0,Lo=10,Vo=()=>({pageIndex:No,pageSize:Lo}),kc={getInitialState:e=>({...e,pagination:{...Vo(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ze("pagination",e)}),createTable:e=>{let n=!1,t=!1;e._autoResetPageIndex=()=>{var o,r;if(!n){e._queue(()=>{n=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=o=>{const r=i=>Et(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?Vo():(r=e.initialState.pagination)!=null?r:Vo())},e.setPageIndex=o=>{e.setPagination(r=>{let i=Et(o,r.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...r,pageIndex:i}})},e.resetPageIndex=o=>{var r,i;e.setPageIndex(o?No:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:No)},e.resetPageSize=o=>{var r,i;e.setPageSize(o?Lo:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:Lo)},e.setPageSize=o=>{e.setPagination(r=>{const i=Math.max(1,Et(o,r.pageSize)),s=r.pageSize*r.pageIndex,a=Math.floor(s/i);return{...r,pageIndex:a,pageSize:i}})},e.setPageCount=o=>e.setPagination(r=>{var i;let s=Et(o,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...r,pageCount:s}}),e.getPageOptions=Q(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((i,s)=>s)),r},ee(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}}},To=()=>({top:[],bottom:[]}),Mc={getInitialState:e=>({rowPinning:To(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ze("rowPinning",e)}),createRow:(e,n)=>{e.pin=(t,o,r)=>{const i=o?e.getLeafRows().map(d=>{let{id:u}=d;return u}):[],s=r?e.getParentRows().map(d=>{let{id:u}=d;return u}):[],a=new Set([...s,e.id,...i]);n.setRowPinning(d=>{var u,f;if(t==="bottom"){var h,g;return{top:((h=d==null?void 0:d.top)!=null?h:[]).filter(_=>!(a!=null&&a.has(_))),bottom:[...((g=d==null?void 0:d.bottom)!=null?g:[]).filter(_=>!(a!=null&&a.has(_))),...Array.from(a)]}}if(t==="top"){var c,p;return{top:[...((c=d==null?void 0:d.top)!=null?c:[]).filter(_=>!(a!=null&&a.has(_))),...Array.from(a)],bottom:((p=d==null?void 0:d.bottom)!=null?p:[]).filter(_=>!(a!=null&&a.has(_)))}}return{top:((u=d==null?void 0:d.top)!=null?u:[]).filter(_=>!(a!=null&&a.has(_))),bottom:((f=d==null?void 0:d.bottom)!=null?f:[]).filter(_=>!(a!=null&&a.has(_)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:o,enablePinning:r}=n.options;return typeof o=="function"?o(e):(t=o??r)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:o,bottom:r}=n.getState().rowPinning,i=t.some(a=>o==null?void 0:o.includes(a)),s=t.some(a=>r==null?void 0:r.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var t,o;const r=e.getIsPinned();if(!r)return-1;const i=(t=r==="top"?n.getTopRows():n.getBottomRows())==null?void 0:t.map(s=>{let{id:a}=s;return a});return(o=i==null?void 0: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?To():(t=(o=e.initialState)==null?void 0:o.rowPinning)!=null?t:To())},e.getIsSomeRowsPinned=n=>{var t;const o=e.getState().rowPinning;if(!n){var r,i;return!!((r=o.top)!=null&&r.length||(i=o.bottom)!=null&&i.length)}return!!((t=o[n])!=null&&t.length)},e._getPinnedRows=(n,t,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(t??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(t??[]).map(s=>n.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:o}))},e.getTopRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(n,t)=>e._getPinnedRows(n,t,"top"),ee(e.options,"debugRows","getTopRows")),e.getBottomRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(n,t)=>e._getPinnedRows(n,t,"bottom"),ee(e.options,"debugRows","getBottomRows")),e.getCenterRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(n,t,o)=>{const r=new Set([...t??[],...o??[]]);return n.filter(i=>!r.has(i.id))},ee(e.options,"debugRows","getCenterRows"))}},Fc={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ze("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=n=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(n),e.resetRowSelection=n=>{var t;return e.setRowSelection(n?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=n=>{e.setRowSelection(t=>{n=typeof n<"u"?n:!e.getIsAllRowsSelected();const o={...t},r=e.getPreGroupedRowModel().flatRows;return n?r.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):r.forEach(i=>{delete o[i.id]}),o})},e.toggleAllPageRowsSelected=n=>e.setRowSelection(t=>{const o=typeof n<"u"?n:!e.getIsAllPageRowsSelected(),r={...t};return e.getRowModel().rows.forEach(i=>{zo(r,i.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,t)=>Object.keys(n).length?Ro(e,t):{rows:[],flatRows:[],rowsById:{}},ee(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,t)=>Object.keys(n).length?Ro(e,t):{rows:[],flatRows:[],rowsById:{}},ee(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,t)=>Object.keys(n).length?Ro(e,t):{rows:[],flatRows:[],rowsById:{}},ee(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const n=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let o=!!(n.length&&Object.keys(t).length);return o&&n.some(r=>r.getCanSelect()&&!t[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:t}=e.getState();let o=!!n.length;return o&&n.some(r=>!t[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var n;const t=Object.keys((n=e.getState().rowSelection)!=null?n:{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:n.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>n=>{e.toggleAllRowsSelected(n.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>n=>{e.toggleAllPageRowsSelected(n.target.checked)}},createRow:(e,n)=>{e.toggleSelected=(t,o)=>{const r=e.getIsSelected();n.setRowSelection(i=>{var s;if(t=typeof t<"u"?t:!r,e.getCanSelect()&&r===t)return i;const a={...i};return zo(a,e.id,t,(s=o==null?void 0:o.selectChildren)!=null?s:!0,n),a})},e.getIsSelected=()=>{const{rowSelection:t}=n.getState();return qo(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=n.getState();return jo(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=n.getState();return jo(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof n.options.enableRowSelection=="function"?n.options.enableRowSelection(e):(t=n.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof n.options.enableSubRowSelection=="function"?n.options.enableSubRowSelection(e):(t=n.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof n.options.enableMultiRowSelection=="function"?n.options.enableMultiRowSelection(e):(t=n.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return o=>{var r;t&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}}},zo=(e,n,t,o,r)=>{var i;const s=r.getRow(n,!0);t?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[n]=!0)):delete e[n],o&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>zo(e,a.id,t,o,r))};function Ro(e,n){const t=e.getState().rowSelection,o=[],r={},i=function(s,a){return s.map(d=>{var u;const f=qo(d,t);if(f&&(o.push(d),r[d.id]=d),(u=d.subRows)!=null&&u.length&&(d={...d,subRows:i(d.subRows)}),f)return d}).filter(Boolean)};return{rows:i(n.rows),flatRows:o,rowsById:r}}function qo(e,n){var t;return(t=n[e.id])!=null?t:!1}function jo(e,n,t){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!r)&&(s.getCanSelect()&&(qo(s,n)?i=!0:r=!1),s.subRows&&s.subRows.length)){const a=jo(s,n);a==="all"?i=!0:(a==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}const Bo=/([0-9]+)/gm,Ac=(e,n,t)=>Ti(kt(e.getValue(t)).toLowerCase(),kt(n.getValue(t)).toLowerCase()),Dc=(e,n,t)=>Ti(kt(e.getValue(t)),kt(n.getValue(t))),Oc=(e,n,t)=>Ho(kt(e.getValue(t)).toLowerCase(),kt(n.getValue(t)).toLowerCase()),Pc=(e,n,t)=>Ho(kt(e.getValue(t)),kt(n.getValue(t))),Nc=(e,n,t)=>{const o=e.getValue(t),r=n.getValue(t);return o>r?1:o<r?-1:0},Lc=(e,n,t)=>Ho(e.getValue(t),n.getValue(t));function Ho(e,n){return e===n?0:e>n?1:-1}function kt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Ti(e,n){const t=e.split(Bo).filter(Boolean),o=n.split(Bo).filter(Boolean);for(;t.length&&o.length;){const r=t.shift(),i=o.shift(),s=parseInt(r,10),a=parseInt(i,10),d=[s,a].sort();if(isNaN(d[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(d[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return t.length-o.length}const un={alphanumeric:Ac,alphanumericCaseSensitive:Dc,text:Oc,textCaseSensitive:Pc,datetime:Nc,basic:Lc},Vc=[_c,xc,bc,wc,pc,hc,$c,Ic,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ze("sorting",e),isMultiSortEvent:n=>n.shiftKey}),createColumn:(e,n)=>{e.getAutoSortingFn=()=>{const t=n.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const r of t){const i=r==null?void 0:r.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return un.datetime;if(typeof i=="string"&&(o=!0,i.split(Bo).length>1))return un.alphanumeric}return o?un.text:un.basic},e.getAutoSortDir=()=>{const t=n.getFilteredRowModel().flatRows[0];return typeof(t==null?void 0:t.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,o;if(!e)throw new Error;return Hn(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 r=e.getNextSortingOrder(),i=typeof t<"u"&&t!==null;n.setSorting(s=>{const a=s==null?void 0:s.find(c=>c.id===e.id),d=s==null?void 0:s.findIndex(c=>c.id===e.id);let u=[],f,h=i?t:r==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&o?a?f="toggle":f="add":s!=null&&s.length&&d!==s.length-1?f="replace":a?f="toggle":f="replace",f==="toggle"&&(i||r||(f="remove")),f==="add"){var g;u=[...s,{id:e.id,desc:h}],u.splice(0,u.length-((g=n.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else f==="toggle"?u=s.map(c=>c.id===e.id?{...c,desc:h}:c):f==="remove"?u=s.filter(c=>c.id!==e.id):u=[{id:e.id,desc:h}];return u})},e.getFirstSortDir=()=>{var t,o;return((t=(o=e.columnDef.sortDescFirst)!=null?o:n.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var o,r;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((o=n.options.enableSortingRemoval)==null||o)&&(!(t&&(r=n.options.enableMultiRemove)!=null)||r)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var t,o;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((o=n.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,o;return(t=(o=e.columnDef.enableMultiSort)!=null?o:n.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const o=(t=n.getState().sorting)==null?void 0:t.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,o;return(t=(o=n.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?t:-1},e.clearSorting=()=>{n.setSorting(t=>t!=null&&t.length?t.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return o=>{t&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?n.options.isMultiSortEvent==null?void 0:n.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=n=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(n),e.resetSorting=n=>{var t,o;e.setSorting(n?[]:(t=(o=e.initialState)==null?void 0:o.sorting)!=null?t:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},mc,Ec,kc,Mc,Fc,Cc];function Tc(e){var n,t;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...Vc,...(n=e._features)!=null?n:[]];let r={_features:o};const i=r._features.reduce((g,c)=>Object.assign(g,c.getDefaultOptions==null?void 0:c.getDefaultOptions(r)),{}),s=g=>r.options.mergeOptions?r.options.mergeOptions(i,g):{...i,...g};let d={...{},...(t=e.initialState)!=null?t:{}};r._features.forEach(g=>{var c;d=(c=g.getInitialState==null?void 0:g.getInitialState(d))!=null?c:d});const u=[];let f=!1;const h={_features:o,options:{...i,...e},initialState:d,_queue:g=>{u.push(g),f||(f=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();f=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{r.setState(r.initialState)},setOptions:g=>{const c=Et(g,r.options);r.options=s(c)},getState:()=>r.options.state,setState:g=>{r.options.onStateChange==null||r.options.onStateChange(g)},_getRowId:(g,c,p)=>{var _;return(_=r.options.getRowId==null?void 0:r.options.getRowId(g,c,p))!=null?_:`${p?[p.id,c].join("."):c}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(g,c)=>{let p=(c?r.getPrePaginationRowModel():r.getRowModel()).rowsById[g];if(!p&&(p=r.getCoreRowModel().rowsById[g],!p))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${g}`):new Error;return p},_getDefaultColumnDef:Q(()=>[r.options.defaultColumn],g=>{var c;return g=(c=g)!=null?c:{},{header:p=>{const _=p.header.column.columnDef;return _.accessorKey?_.accessorKey:_.accessorFn?_.id:null},cell:p=>{var _,m;return(_=(m=p.renderValue())==null||m.toString==null?void 0:m.toString())!=null?_:null},...r._features.reduce((p,_)=>Object.assign(p,_.getDefaultColumnDef==null?void 0:_.getDefaultColumnDef()),{}),...g}},ee(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:Q(()=>[r._getColumnDefs()],g=>{const c=function(p,_,m){return m===void 0&&(m=0),p.map(b=>{const w=gc(r,b,m,_),C=b;return w.columns=C.columns?c(C.columns,w,m+1):[],w})};return c(g)},ee(e,"debugColumns","getAllColumns")),getAllFlatColumns:Q(()=>[r.getAllColumns()],g=>g.flatMap(c=>c.getFlatColumns()),ee(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Q(()=>[r.getAllFlatColumns()],g=>g.reduce((c,p)=>(c[p.id]=p,c),{}),ee(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Q(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(g,c)=>{let p=g.flatMap(_=>_.getLeafColumns());return c(p)},ee(e,"debugColumns","getAllLeafColumns")),getColumn:g=>{const c=r._getAllFlatColumnsById()[g];return process.env.NODE_ENV!=="production"&&!c&&console.error(`[Table] Column with id '${g}' does not exist.`),c}};Object.assign(r,h);for(let g=0;g<r._features.length;g++){const c=r._features[g];c==null||c.createTable==null||c.createTable(r)}return r}function zc(){return e=>Q(()=>[e.options.data],n=>{const t={rows:[],flatRows:[],rowsById:{}},o=function(r,i,s){i===void 0&&(i=0);const a=[];for(let u=0;u<r.length;u++){const f=Mo(e,e._getRowId(r[u],u,s),r[u],u,i,void 0,s==null?void 0:s.id);if(t.flatRows.push(f),t.rowsById[f.id]=f,a.push(f),e.options.getSubRows){var d;f.originalSubRows=e.options.getSubRows(r[u],u),(d=f.originalSubRows)!=null&&d.length&&(f.subRows=o(f.originalSubRows,i+1,f))}}return a};return t.rows=o(n),t},ee(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Rc(e){const n=[],t=o=>{var r;n.push(o),(r=o.subRows)!=null&&r.length&&o.getIsExpanded()&&o.subRows.forEach(t)};return e.rows.forEach(t),{rows:n,flatRows:e.flatRows,rowsById:e.rowsById}}function qc(e,n,t){return t.options.filterFromLeafRows?jc(e,n,t):Bc(e,n,t)}function jc(e,n,t){var o;const r=[],i={},s=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,a=function(d,u){u===void 0&&(u=0);const f=[];for(let g=0;g<d.length;g++){var h;let c=d[g];const p=Mo(t,c.id,c.original,c.index,c.depth,void 0,c.parentId);if(p.columnFilters=c.columnFilters,(h=c.subRows)!=null&&h.length&&u<s){if(p.subRows=a(c.subRows,u+1),c=p,n(c)&&!p.subRows.length){f.push(c),i[c.id]=c,r.push(c);continue}if(n(c)||p.subRows.length){f.push(c),i[c.id]=c,r.push(c);continue}}else c=p,n(c)&&(f.push(c),i[c.id]=c,r.push(c))}return f};return{rows:a(e),flatRows:r,rowsById:i}}function Bc(e,n,t){var o;const r=[],i={},s=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,a=function(d,u){u===void 0&&(u=0);const f=[];for(let g=0;g<d.length;g++){let c=d[g];if(n(c)){var h;if((h=c.subRows)!=null&&h.length&&u<s){const _=Mo(t,c.id,c.original,c.index,c.depth,void 0,c.parentId);_.subRows=a(c.subRows,u+1),c=_}f.push(c),r.push(c),i[c.id]=c}}return f};return{rows:a(e),flatRows:r,rowsById:i}}function Hc(){return e=>Q(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(n,t,o)=>{if(!n.rows.length||!(t!=null&&t.length)&&!o){for(let g=0;g<n.flatRows.length;g++)n.flatRows[g].columnFilters={},n.flatRows[g].columnFiltersMeta={};return n}const r=[],i=[];(t??[]).forEach(g=>{var c;const p=e.getColumn(g.id);if(!p)return;const _=p.getFilterFn();if(!_){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${p.id}.`);return}r.push({id:g.id,filterFn:_,resolvedValue:(c=_.resolveFilterValue==null?void 0:_.resolveFilterValue(g.value))!=null?c:g.value})});const s=(t??[]).map(g=>g.id),a=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(g=>g.getCanGlobalFilter());o&&a&&d.length&&(s.push("__global__"),d.forEach(g=>{var c;i.push({id:g.id,filterFn:a,resolvedValue:(c=a.resolveFilterValue==null?void 0:a.resolveFilterValue(o))!=null?c:o})}));let u,f;for(let g=0;g<n.flatRows.length;g++){const c=n.flatRows[g];if(c.columnFilters={},r.length)for(let p=0;p<r.length;p++){u=r[p];const _=u.id;c.columnFilters[_]=u.filterFn(c,_,u.resolvedValue,m=>{c.columnFiltersMeta[_]=m})}if(i.length){for(let p=0;p<i.length;p++){f=i[p];const _=f.id;if(f.filterFn(c,_,f.resolvedValue,m=>{c.columnFiltersMeta[_]=m})){c.columnFilters.__global__=!0;break}}c.columnFilters.__global__!==!0&&(c.columnFilters.__global__=!1)}}const h=g=>{for(let c=0;c<s.length;c++)if(g.columnFilters[s[c]]===!1)return!1;return!0};return qc(n.rows,h,e)},ee(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Gc(e){return n=>Q(()=>[n.getState().pagination,n.getPrePaginationRowModel(),n.options.paginateExpandedRows?void 0:n.getState().expanded],(t,o)=>{if(!o.rows.length)return o;const{pageSize:r,pageIndex:i}=t;let{rows:s,flatRows:a,rowsById:d}=o;const u=r*i,f=u+r;s=s.slice(u,f);let h;n.options.paginateExpandedRows?h={rows:s,flatRows:a,rowsById:d}:h=Rc({rows:s,flatRows:a,rowsById:d}),h.flatRows=[];const g=c=>{h.flatRows.push(c),c.subRows.length&&c.subRows.forEach(g)};return h.rows.forEach(g),h},ee(n.options,"debugTable","getPaginationRowModel"))}function Wc(){return e=>Q(()=>[e.getState().sorting,e.getPreSortedRowModel()],(n,t)=>{if(!t.rows.length||!(n!=null&&n.length))return t;const o=e.getState().sorting,r=[],i=o.filter(d=>{var u;return(u=e.getColumn(d.id))==null?void 0:u.getCanSort()}),s={};i.forEach(d=>{const u=e.getColumn(d.id);u&&(s[d.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const a=d=>{const u=d.map(f=>({...f}));return u.sort((f,h)=>{for(let c=0;c<i.length;c+=1){var g;const p=i[c],_=s[p.id],m=_.sortUndefined,b=(g=p==null?void 0:p.desc)!=null?g:!1;let w=0;if(m){const C=f.getValue(p.id),S=h.getValue(p.id),x=C===void 0,y=S===void 0;if(x||y){if(m==="first")return x?-1:1;if(m==="last")return x?1:-1;w=x&&y?0:x?m:-m}}if(w===0&&(w=_.sortingFn(f,h,p.id)),w!==0)return b&&(w*=-1),_.invertSorting&&(w*=-1),w}return f.index-h.index}),u.forEach(f=>{var h;r.push(f),(h=f.subRows)!=null&&h.length&&(f.subRows=a(f.subRows))}),u};return{rows:a(t.rows),flatRows:r,rowsById:t.rowsById}},ee(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
20
|
+
* react-table
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) TanStack
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
26
|
+
*
|
|
27
|
+
* @license MIT
|
|
28
|
+
*/function Ut(e,n){return e?Uc(e)?I.createElement(e,n):e:null}function Uc(e){return Kc(e)||typeof e=="function"||Xc(e)}function Kc(e){return typeof e=="function"&&(()=>{const n=Object.getPrototypeOf(e);return n.prototype&&n.prototype.isReactComponent})()}function Xc(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Yc(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=I.useState(()=>({current:Tc(n)})),[o,r]=I.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:s=>{r(s),e.onStateChange==null||e.onStateChange(s)}})),t.current}function Zc(e,n,t=3){const o=Math.floor(t/2);let r=e-o;r<1&&(r=1),r+t-1>n&&(r=Math.max(1,n-t+1));const i=Math.min(t,n);return Array.from({length:i},(s,a)=>r+a)}function Jc(e,n){return n===0?0:e>=n?n-1:e<0?0:e}const ot={checkbox_wrapper:"_checkbox_wrapper_43ivv_1",label_text:"_label_text_43ivv_21",input:"_input_43ivv_37",radius_none:"_radius_none_43ivv_163",radius_sm:"_radius_sm_43ivv_171",radius_md:"_radius_md_43ivv_179",radius_lg:"_radius_lg_43ivv_187",radius_full:"_radius_full_43ivv_195",sm:"_sm_43ivv_203",lg:"_lg_43ivv_233",secondary:"_secondary_43ivv_263",success:"_success_43ivv_271",warning:"_warning_43ivv_279",danger:"_danger_43ivv_287",disabled:"_disabled_43ivv_361",readonly:"_readonly_43ivv_361",no_animation:"_no_animation_43ivv_509",only_icon:"_only_icon_43ivv_521",line_through:"_line_through_43ivv_573"},dn=v.forwardRef((e,n)=>{const{children:t,isSelected:o,defaultChecked:r,isIndeterminate:i=!1,isDisabled:s=!1,isReadOnly:a=!1,lineThrough:d=!1,onlyIcon:u=!1,disableAnimation:f=!1,size:h="md",color:g="primary",radius:c="md",className:p="",classNames:_={},onChange:m,...b}=e,w=v.useId(),[C,S]=v.useState(r??!1),x=o!==void 0?o:C;v.useEffect(()=>{n&&typeof n=="object"&&n.current&&(n.current.indeterminate=i??!1)},[i,n]);const y=M=>{if(s||a)return;const E=M.target.checked;o===void 0&&S(E),m==null||m(E)};return l.jsxs("label",{className:W(ot.checkbox_wrapper,ot[h],ot[g],ot[`radius_${c}`],{[ot.checked]:x,[ot.disabled]:s,[ot.readonly]:a,[ot.line_through]:d&&x},_.base,p),children:[l.jsx("input",{ref:n,id:w,type:"checkbox",className:W(ot.input,{[ot.only_icon]:u,[ot.no_animation]:f},_.wrapper),checked:x,onChange:y,disabled:s,readOnly:a,...b}),t&&l.jsx("span",{className:W(ot.label_text,_.label),children:t})]})});dn.displayName="Checkbox";const Lt={checkbox_group:"_checkbox_group_1sn8p_1",group_label:"_group_label_1sn8p_13",checkbox_list:"_checkbox_list_1sn8p_27",vertical:"_vertical_1sn8p_35",horizontal:"_horizontal_1sn8p_45",description:"_description_1sn8p_55",error_message:"_error_message_1sn8p_69"},Qc=({label:e,children:n,description:t,errorMessage:o,isInvalid:r,orientation:i="vertical",className:s="",value:a=[],onChange:d,isDisabled:u,isReadOnly:f})=>{const h=(g,c)=>{if(!d)return;const p=c?[...a,g]:a.filter(_=>_!==g);d(p)};return l.jsxs("div",{className:W(Lt.checkbox_group,s),children:[e&&l.jsx("span",{className:Lt.group_label,children:e}),l.jsx("div",{role:"group",className:W(Lt.checkbox_list,{[Lt.horizontal]:i==="horizontal",[Lt.vertical]:i==="vertical"}),children:v.Children.map(n,g=>{if(!v.isValidElement(g))return g;const c=g.props;return v.cloneElement(g,{isDisabled:u||c.isDisabled,isReadOnly:f||c.isReadOnly,isSelected:c.value?a.includes(c.value):c.isSelected,onChange:p=>{var _;c.value&&h(c.value,p),(_=c.onChange)==null||_.call(c,p)}})})}),r&&o?l.jsx("span",{className:Lt.error_message,children:o}):t?l.jsx("span",{className:Lt.description,children:t}):null]})},Ne={contenedor:"_contenedor_fe47o_1",contenedor_superior:"_contenedor_superior_fe47o_17",input_con_icono:"_input_con_icono_fe47o_35",icono_busqueda:"_icono_busqueda_fe47o_45",input_busqueda:"_input_busqueda_fe47o_65",contenedor_acciones_botones:"_contenedor_acciones_botones_fe47o_93",contenedor_acciones:"_contenedor_acciones_fe47o_93",boton_basico:"_boton_basico_fe47o_127",texto_filtros:"_texto_filtros_fe47o_141",menu_configuraciones:"_menu_configuraciones_fe47o_173",boton_excel:"_boton_excel_fe47o_183",contenedor_tabla:"_contenedor_tabla_fe47o_203",encabezados:"_encabezados_fe47o_221",contenedor_datos:"_contenedor_datos_fe47o_239",datos:"_datos_fe47o_247",seleccionada:"_seleccionada_fe47o_283",columna:"_columna_fe47o_299",boton_acciones:"_boton_acciones_fe47o_345"},mt=v.createContext(null);function eu({children:e,data:n,columns:t,controls:o,loading:r,primerasColumnas:i,tamanioPaginaInicial:s=10,filtros:a,descargarExcel:d,actualizarTabla:u,selectorFilas:f=[],sinDatosProps:h}){const[g,c]=v.useState(""),p=Jl(g,200),_=jn("only screen and (max-width: 830px)"),[m,b]=v.useState({pageIndex:0,pageSize:s}),[w,C]=v.useState({}),S=v.useMemo(()=>{const D=[];if(f.length>0&&!_){const $={id:"select",header:({table:N})=>l.jsx(dn,{color:"secondary",isSelected:N.getIsAllPageRowsSelected(),isIndeterminate:N.getIsSomePageRowsSelected()&&!N.getIsAllPageRowsSelected(),onChange:j=>N.toggleAllPageRowsSelected(!!j)}),cell:({row:N})=>l.jsx(dn,{color:"secondary",isSelected:N.getIsSelected(),isDisabled:!N.getCanSelect(),onChange:j=>N.toggleSelected(j)}),enableSorting:!1,enableHiding:!1};D.push($)}if(D.push(...t),o!=null&&o.length){const $={id:"actions",header:"Acciones",cell:N=>l.jsx("div",{className:Ne.contenedor_acciones,children:o.map(j=>l.jsx("button",{type:"button",title:j.nombre,onClick:()=>j.evento(N.row.original),className:Ne.boton_acciones,children:j.icono},j.id))}),enableSorting:!1,enableHiding:!1};D.push($)}return D},[t,o,f,_]),x=v.useMemo(()=>S.map(D=>"accessorKey"in D?String(D.accessorKey):"id"in D?String(D.id):"").filter(Boolean),[S]),[y,M]=v.useState(x),E=Yc({data:n,columns:S,state:{pagination:m,globalFilter:p,columnOrder:y,rowSelection:w},enableRowSelection:f.length>0,onRowSelectionChange:C,onPaginationChange:b,onColumnOrderChange:M,getCoreRowModel:zc(),getSortedRowModel:Wc(),getFilteredRowModel:Hc(),getPaginationRowModel:Gc(),autoResetPageIndex:!1}),T=E.getPageCount();v.useEffect(()=>{const D=Jc(m.pageIndex,T);D!==m.pageIndex&&b($=>({...$,pageIndex:D}))},[T]),v.useEffect(()=>{p!==void 0&&E.setPageIndex(0)},[p]);const F=v.useMemo(()=>E.getAllLeafColumns().filter(D=>D.id!=="actions"&&D.id!=="select"),[E]),P=v.useCallback(D=>{const $=t.find(j=>"accessorKey"in j?j.accessorKey===D:j.id===D),N=$==null?void 0:$.header;return typeof N=="string"||typeof N=="number"?String(N):D},[t]),U=v.useCallback(()=>{E.setColumnVisibility({}),E.setPageSize(s),E.setPageIndex(0),E.resetRowSelection(),M(x)},[E,s,x]),z=v.useCallback(D=>{const $=Math.max(1,Math.min(200,D));E.setPageSize($),E.setPageIndex(0)},[E]),k=v.useCallback(D=>{M($=>typeof D=="function"?D($):D)},[]),O={state:{ordenColumnas:y,table:E,columns:S,controls:o,loading:r,primerasColumnas:[String(i[0]),String(i[1])],inputBusqueda:g,setInputBusqueda:c,filtros:a,descargarExcel:d,actualizarTabla:u,selectorFilas:f,sinDatosProps:h},todasLasColumnas:F,etiquetaColumna:P,restaurarConfiguracion:U,cambiarPageSize:z,cambiarOrdenColumnas:k};return l.jsx(mt.Provider,{value:O,children:e})}function zi(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.jsx("path",{fill:"currentColor",d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function Ri(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.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 tu(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.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 nu(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.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 ou(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.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 ru(e){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[l.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"}),l.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 iu(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[l.jsx("circle",{cx:"12",cy:"12",r:"3"}),l.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 su(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:l.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 au(e){return l.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",...e,children:[l.jsx("rect",{x:"6",y:"3.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),l.jsx("rect",{x:"6",y:"7.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),l.jsx("rect",{x:"6",y:"11.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"})]})}function lu(e){return l.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[l.jsx("rect",{x:"3",y:"3",width:"4",height:"14",rx:"1",fill:"currentColor"}),l.jsx("rect",{x:"8",y:"3",width:"9",height:"14",rx:"1",fill:"currentColor",opacity:".3"})]})}function cu(e){return l.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[l.jsx("rect",{x:"3",y:"3",width:"14",height:"4",rx:"1",fill:"currentColor"}),l.jsx("rect",{x:"3",y:"8",width:"14",height:"9",rx:"1",fill:"currentColor",opacity:".3"})]})}function qi(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.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 uu(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.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 du(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:l.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 fu(e){v.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function gu(e,n,t){v.useEffect(()=>{if(!n)return;const o=i=>{const s=i.target;t.some(d=>{var u;return(u=d.current)==null?void 0:u.contains(s)})||e()},r=setTimeout(()=>{document.addEventListener("mousedown",o)},100);return()=>{clearTimeout(r),document.removeEventListener("mousedown",o)}},[n,e,...t])}function ji(e,n){v.useEffect(()=>{if(!n)return;const t=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[n,e])}function _u(e,n,t,{width:o,margin:r=0,offsetRight:i=0,offsetLeft:s=0,offsetTop:a=0,offsetBottom:d=0}){const[u,f]=v.useState({top:0,left:0}),h=jn("only screen and (max-width: 480px)");return v.useEffect(()=>{if(!t||!e.current)return;const g=()=>{var b;const c=e.current.getBoundingClientRect();let p=c.bottom+a,_=0;if(h)_=window.innerWidth-o-r;else{const w=c.right-o+i-s;_=Math.max(r,Math.min(w,window.innerWidth-o-r))}const m=((b=n.current)==null?void 0:b.offsetHeight)||400;p+m>window.innerHeight-r&&(p=c.top-m-d,p<r&&(p=c.bottom+a)),f({top:p,left:_})};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[t,h,o,r,i,s,a,d,e,n]),u}const vt={contenedor:"_contenedor_xw36f_1",popover:"_popover_xw36f_9",popover_entrada:"_popover_entrada_xw36f_43",desvanecerDeslizarEntrada:"_desvanecerDeslizarEntrada_xw36f_1",popover_salida:"_popover_salida_xw36f_51",desvanecerDeslizarSalida:"_desvanecerDeslizarSalida_xw36f_1",ventana:"_ventana_xw36f_123",panel:"_panel_xw36f_141",panel_forward:"_panel_forward_xw36f_159",panelForwardIn:"_panelForwardIn_xw36f_1",panel_backward:"_panel_backward_xw36f_167",panelBackwardIn:"_panelBackwardIn_xw36f_1",header:"_header_xw36f_223",titulo:"_titulo_xw36f_247"},pu=({titulo:e,onBack:n})=>l.jsxs("header",{className:vt.header,children:[l.jsx(lt,{isIconOnly:!0,variant:"light",onClick:n,"aria-label":"Regresar",children:l.jsx(zi,{})}),l.jsx("h3",{className:vt.titulo,children:e})]}),Vt={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 hu(){const e=v.useContext(mt),{state:n,todasLasColumnas:t,etiquetaColumna:o,cambiarOrdenColumnas:r}=e||{},{table:i,ordenColumnas:s}=n||{},[a,d]=v.useState(null);if(!t||!o||!i||!s)return null;const u=g=>c=>{d(g),c.dataTransfer.effectAllowed="move",c.dataTransfer.setData("text/plain",g)},f=g=>c=>{c.preventDefault(),!(!a||a===g)&&(r==null||r(p=>{const _=[...p],m=_.indexOf(a),b=_.indexOf(g);return m===-1||b===-1?p:(_.splice(m,1),_.splice(b,0,a),_)}))},h=()=>d(null);return l.jsx("div",{className:Vt.contenedor,children:l.jsx("ul",{className:Vt.lista,children:s.map(g=>{var b;const c=t.find(w=>w.id===g);if(!c)return null;const p=((b=c.getCanHide)==null?void 0:b.call(c))??!0,_=c.getIsVisible(),m=a===c.id;return l.jsxs("li",{className:`${Vt.item} ${m?Vt.item_dragging:""}`,draggable:!0,onDragStart:u(c.id),onDragOver:f(c.id),onDrop:h,onDragEnd:h,children:[l.jsx("span",{className:Vt.icono_drag,"aria-label":"Arrastrar columna",children:l.jsx(au,{})}),l.jsx("span",{className:Vt.nombre,children:o(c.id)}),l.jsx(dn,{size:"md",color:"primary",isSelected:_,isDisabled:!p,onChange:w=>c.toggleVisibility(w),className:Vt.checkbox})]},c.id)})})})}const fn={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function mu(){const e=v.useContext(mt),{state:n,cambiarPageSize:t}=e||{},{table:o}=n||{},[r,i]=v.useState(""),s=v.useRef(null);if(!o)return null;const a=o.getState().pagination.pageSize;v.useEffect(()=>i(String(a)),[a]);const d=c=>Math.max(Go,Math.min(Wo,c)),u=c=>{const p=a+c;p>=Go&&p<=Wo&&(t==null||t(p))},f=()=>{const c=parseInt(r,10),p=!isNaN(c)&&c>0?d(c):a;t==null||t(p),i(String(p))},h=c=>{var _;const p={Enter:()=>{var m;f(),(m=s.current)==null||m.blur()},Escape:()=>{var m;i(String(a)),(m=s.current)==null||m.blur()},ArrowUp:()=>{c.preventDefault(),u(1),setTimeout(()=>{var m;return(m=s.current)==null?void 0:m.select()},0)},ArrowDown:()=>{c.preventDefault(),u(-1),setTimeout(()=>{var m;return(m=s.current)==null?void 0:m.select()},0)}};(_=p[c.key])==null||_.call(p)},g=c=>{const p=c.target.value;(p===""||/^\d+$/.test(p))&&i(p)};return l.jsxs("div",{className:fn.contenido,children:[l.jsx("p",{className:fn.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),l.jsxs("div",{className:fn.control,children:[l.jsx(lt,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>u(-1),"aria-label":"Disminuir filas",disabled:a<=Go,children:l.jsx(uu,{style:{fontSize:"var(--gaps-6)"}})}),l.jsx("div",{className:fn.valor,children:l.jsx("input",{ref:s,type:"text",inputMode:"numeric",value:r,onChange:g,onKeyDown:h,onFocus:()=>{var c;return(c=s.current)==null?void 0:c.select()},onBlur:f,className:fn.input,"aria-label":"Número de filas por página"})}),l.jsx(lt,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>u(1),"aria-label":"Aumentar filas",disabled:a>=Wo,children:l.jsx(qi,{})})]})]})}const He={contenedor:"_contenedor_1syil_1",menu:"_menu_1syil_11",item:"_item_1syil_25",icono_contenedor:"_icono_contenedor_1syil_71",texto:"_texto_1syil_109",nombre:"_nombre_1syil_123",descripcion:"_descripcion_1syil_135",chevron:"_chevron_1syil_151",divider:"_divider_1syil_175"};function vu({navegar:e}){const n=v.useContext(mt);return l.jsxs("div",{className:He.contenedor,children:[l.jsx("nav",{className:He.menu,children:yu.map(({id:t,icono:o,nombre:r,descripcion:i})=>l.jsxs("button",{className:He.item,onClick:()=>e(t),children:[l.jsx("div",{className:He.icono_contenedor,children:l.jsx(o,{})}),l.jsxs("div",{className:He.texto,children:[l.jsx("span",{className:He.nombre,children:r}),l.jsx("span",{className:He.descripcion,children:i})]}),l.jsx(Ri,{className:He.chevron})]},t))}),l.jsx("div",{className:He.divider}),l.jsx("div",{className:He.menu,children:l.jsxs("button",{className:He.item,onClick:n==null?void 0:n.restaurarConfiguracion,children:[l.jsx("div",{className:He.icono_contenedor,children:l.jsx(su,{})}),l.jsxs("div",{className:He.texto,children:[l.jsx("span",{className:He.nombre,children:"Restaurar configuración"}),l.jsx("span",{className:He.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const Go=1,Wo=200,Bi=250,bu=200,wu={panelPrincipal:{component:vu},panelColumnas:{component:hu,titulo:"Columnas visibles"},panelFilas:{component:mu,titulo:"Filas por página"}},yu=[{id:"panelColumnas",icono:lu,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:cu,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}];function Cu(){const[e,n]=v.useState(!1),[t,o]=v.useState(!1),[r,i]=v.useState("panelPrincipal"),[s,a]=v.useState(null),d=v.useRef(null),u=v.useRef(null),f=v.useRef(null);fu(t),gu(()=>g(),t,[d,u]),ji(()=>g(),t);const h=_u(d,u,t,{width:Bi,offsetRight:6,offsetTop:-2});v.useEffect(()=>{e&&(o(!0),a(null))},[e]),v.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);function g(){t&&(n(!1),f.current=window.setTimeout(()=>{o(!1),i("panelPrincipal"),a(null)},bu))}function c(m){a(m==="panelPrincipal"?"backward":"forward"),i(m)}const p=wu[r],_=p.component;return l.jsxs("div",{className:vt.contenedor,children:[l.jsx(lt,{isIconOnly:!0,ref:d,variant:"light",onClick:()=>n(m=>!m),"aria-haspopup":"dialog","aria-expanded":e,children:l.jsx(iu,{})}),t&&d.current&&Zn.createPortal(l.jsx("div",{ref:u,className:`${vt.popover} ${e?vt.popover_entrada:vt.popover_salida}`,role:"dialog",style:{top:`${h.top}px`,left:`${h.left}px`,width:Bi},children:l.jsx("div",{className:vt.ventana,children:l.jsxs("div",{className:W([vt.panel,vt[`panel_${s}`]]),children:[p.titulo&&l.jsx(pu,{titulo:p.titulo,onBack:()=>c("panelPrincipal")}),l.jsx(_,{navegar:c})]},r)})}),document.body)]})}function Su(e){return e?{asc:" ↑",desc:" ↓"}[e]??null:null}function Kt(e,n){const t=new Map;n.getFlatHeaders().forEach(s=>t.set(s.column.id,s));const o=t.get(e);if(o)return Ut(o.column.columnDef.header,o.getContext());const r=n.getAllLeafColumns().find(s=>s.id===e),i=r==null?void 0:r.columnDef.header;return typeof i=="string"||typeof i=="number"?i:(r==null?void 0:r.id)??e}function Hi(e,n){const t=e.getVisibleCells().find(o=>o.column.id===n);return t?Ut(t.column.columnDef.cell,t.getContext()):null}function Gi(e,n){return n?e.getVisibleCells().map(o=>o.column.id).includes(n):!1}function xu(e,n,t){return e.getVisibleCells().filter(o=>o.column.id!=="actions"&&o.column.id!==n&&o.column.id!==t)}function $u(e,n){if(n===0)return"";if(n===1)return Uo(e[0].nombre.toLowerCase());if(n===2)return`${Uo(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const t=e.slice(0,2).map(r=>r.nombre.toLowerCase()),o=n-2;return`${Uo(t.join(", "))} y ${o>1?`otros ${o}`:"otro"} más`}function Uo(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Iu(){var u;const e=(u=v.useContext(mt))==null?void 0:u.state,{inputBusqueda:n,setInputBusqueda:t,filtros:o,actualizarTabla:r,descargarExcel:i}=e||{},{abrirFiltros:s,filtrosAplicados:a=[]}=o||{},d=(a==null?void 0:a.length)||0;return l.jsxs("section",{className:Ne.contenedor_superior,children:[l.jsxs("div",{className:Ne.input_con_icono,children:[l.jsx(tu,{className:Ne.icono_busqueda}),l.jsx("input",{type:"text",placeholder:"Buscar...",value:n??"",onChange:f=>t&&t(f.target.value),className:Ne.input_busqueda})]}),l.jsxs("div",{className:Ne.contenedor_acciones_botones,children:[l.jsxs("div",{className:Ne.contenedor_acciones,children:[r!==void 0&&l.jsxs(lt,{variant:"light",className:Ne.boton_basico,disabled:r==null?void 0:r.cargando,onClick:r==null?void 0:r.onClick,children:[l.jsx(ru,{}),r!=null&&r.cargando?"Actualizando...":"Actualizar tabla"]}),s!==void 0&&l.jsxs(lt,{onClick:s,variant:"light",className:Ne.boton_basico,children:[l.jsx(ou,{})," Filtros"]}),d>0?l.jsxs("div",{className:Ne.texto_filtros,children:[l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:l.jsx("path",{d:"M2 4h12M4 8h8M6 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),l.jsx("p",{children:$u(a,d)})]}):null]}),i!==void 0?l.jsxs(lt,{onClick:i,className:`${Ne.boton_basico} ${Ne.boton_excel}`,children:[l.jsx(nu,{})," Excel"]}):null]}),l.jsx("div",{className:Ne.menu_configuraciones,children:l.jsx(Cu,{})})]})}const Mt={contenedor_paginacion:"_contenedor_paginacion_1di9q_1",info_paginacion:"_info_paginacion_1di9q_19",contenedor_botones:"_contenedor_botones_1di9q_35",boton_paginacion:"_boton_paginacion_1di9q_71",pagina_activa:"_pagina_activa_1di9q_89",boton_num_paginacion:"_boton_num_paginacion_1di9q_99"};function Eu(){var c;const e=(c=v.useContext(mt))==null?void 0:c.state,{table:n}=e||{};if(!n)return null;const t=n.getPrePaginationRowModel().rows.length,o=n.getPageCount()||1,{pageIndex:r}=n.getState().pagination,i=r+1,s=Zc(i,o),a=n.getCanPreviousPage(),d=n.getCanNextPage(),u=o>1,f=()=>{a&&n.previousPage()},h=()=>{d&&n.nextPage()},g=p=>{n.setPageIndex(p-1)};return l.jsxs("section",{className:Mt.contenedor_paginacion,children:[l.jsxs("p",{className:Mt.info_paginacion,children:["Documentos: ",t]}),u&&l.jsxs("div",{className:Mt.contenedor_botones,children:[a&&l.jsx(zi,{onClick:f,"aria-disabled":!a,className:Mt.boton_paginacion}),s.map(p=>l.jsx("button",{type:"button",onClick:()=>g(p),className:p===i?Mt.pagina_activa:Mt.boton_num_paginacion,children:p},p)),d&&l.jsx(Ri,{onClick:h,"aria-disabled":!d,className:Mt.boton_paginacion})]}),l.jsxs("p",{className:Mt.info_paginacion,children:["Página ",i," de ",o]})]})}const be={contenedor_tabla_cards:"_contenedor_tabla_cards_1xee4_1",contenedor_card:"_contenedor_card_1xee4_11",contenedor_encabezado_card:"_contenedor_encabezado_card_1xee4_25",contenedor_columna_card:"_contenedor_columna_card_1xee4_47",card_label:"_card_label_1xee4_57",card_valor:"_card_valor_1xee4_69",card_segundo_valor:"_card_segundo_valor_1xee4_83",contenedor_contenido_cards:"_contenedor_contenido_cards_1xee4_93",contenedor_fila_card:"_contenedor_fila_card_1xee4_105",card_fila_label:"_card_fila_label_1xee4_119",card_fila_valor:"_card_fila_valor_1xee4_137",contenedor_acciones_card:"_contenedor_acciones_card_1xee4_153",boton_acciones:"_boton_acciones_1xee4_171",boton_card:"_boton_card_1xee4_207"},Ft={contenedor:"_contenedor_1dqtq_1",envolvedor_cuadricula:"_envolvedor_cuadricula_1dqtq_33",svg_cuadricula:"_svg_cuadricula_1dqtq_61",envolvedor_contenido:"_envolvedor_contenido_1dqtq_77",icono_carpeta:"_icono_carpeta_1dqtq_97",titulo:"_titulo_1dqtq_111",descripcion:"_descripcion_1dqtq_129",boton_agregar:"_boton_agregar_1dqtq_145"};function Wi(){const e=v.useContext(mt),{sinDatosProps:n}=(e==null?void 0:e.state)||{},{alAgregarRegistro:t,titulo:o="No se encontraron resultados",descripcion:r="No hay datos que coincidan con tus filtros. Intenta buscar por otra variable o agrega un nuevo registro.",etiquetaAccion:i="Agregar nuevo registro"}=n||{};return l.jsxs("div",{className:Ft.contenedor,children:[l.jsx(ku,{}),l.jsxs("div",{className:Ft.envolvedor_contenido,children:[l.jsx(Mu,{}),l.jsx("h3",{className:Ft.titulo,children:o}),l.jsx("p",{className:Ft.descripcion,children:r}),t?l.jsxs(lt,{onClick:t,variant:"bordered",className:Ft.boton_agregar,children:[l.jsx(qi,{})," ",i]}):null]})]})}function ku(){return l.jsx("div",{className:Ft.envolvedor_cuadricula,children:l.jsxs("svg",{className:Ft.svg_cuadricula,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("defs",{children:l.jsx("pattern",{id:"patronCuadricula",width:"40",height:"40",patternUnits:"userSpaceOnUse",children:l.jsx("path",{d:"M 40 0 L 0 0 0 40",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),l.jsx("rect",{width:"100%",height:"100%",fill:"url(#patronCuadricula)"})]})})}function Mu(){return l.jsxs("svg",{className:Ft.icono_carpeta,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.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)"}),l.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"}),l.jsx("circle",{cx:"35",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),l.jsx("circle",{cx:"55",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),l.jsx("path",{d:"M42 65H48",stroke:"var(--color-primary-text)",strokeWidth:"1.5",strokeLinecap:"round"}),l.jsx("circle",{cx:"78",cy:"78",r:"14",fill:"var(--brand-primary)"}),l.jsx("path",{d:"M78 71V85M71 78H85",stroke:"var(--base)",strokeWidth:"2.5",strokeLinecap:"round"})]})}const bt={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 Fu({filas:e,cantidadControles:n=0,table:t,idPrimeraColumna:o,idSegundaColumna:r}){const s=t.getAllLeafColumns().filter(d=>d.id!=="actions"&&d.id!==o&&d.id!==r),a=["25vw","30vw","20vw","28vw","22vw","26vw"];return l.jsx("section",{className:be.contenedor_tabla_cards,children:Array.from({length:e}).map((d,u)=>l.jsxs("article",{className:be.contenedor_card,children:[l.jsxs("div",{className:be.contenedor_encabezado_card,children:[l.jsx("div",{className:be.contenedor_columna_card,children:o&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:be.card_label,children:Kt(o,t)}),l.jsx("div",{className:be.card_valor,children:l.jsx("div",{className:`${bt.skeleton_elemento} ${bt.skeleton_elemento_encabezado}`})})]})}),l.jsx("div",{className:be.contenedor_columna_card,children:r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:be.card_label,children:Kt(r,t)}),l.jsx("div",{className:be.card_segundo_valor,children:l.jsx("div",{className:`${bt.skeleton_elemento} ${bt.skeleton_elemento_encabezado_segundo}`})})]})})]}),l.jsx("div",{className:be.contenedor_contenido_cards,children:s.map((f,h)=>l.jsxs("div",{className:be.contenedor_fila_card,children:[l.jsx("div",{className:be.card_fila_label,children:Kt(f.id,t)}),l.jsx("div",{className:be.card_fila_valor,children:l.jsx("div",{className:`${bt.skeleton_elemento} ${bt.skeleton_elemento_contenido}`,style:{width:a[h%a.length]}})})]},f.id))}),n>0&&l.jsx("div",{className:be.contenedor_acciones_card,children:Array.from({length:Math.min(n,3)}).map((f,h)=>l.jsx("div",{className:bt.skeleton_accion,children:l.jsx("div",{className:`${bt.skeleton_elemento} ${bt.skeleton_elemento_encabezado}`})},`accion-${h}`))})]},`skeleton-card-${u}`))})}function Ui(e,n){if(n)return e.find(t=>t.accessorKey===n||t.id!==void 0&&t.id===String(n))}function Ki(e){if(e)return e.id??e.accessorKey}const Au=({fila:e,controls:n})=>((n==null?void 0:n.length)??0)>0?l.jsx("div",{className:be.contenedor_acciones_card,children:n==null?void 0:n.map(o=>l.jsxs("button",{type:"button",title:o.nombre,onClick:()=>o.evento(e.original),className:`${be.boton_acciones} ${be.boton_card}`,children:[o.icono," ",o.nombre]},o.id))}):null,Du=({columnasRestantes:e,table:n})=>e.length===0?null:l.jsx("div",{className:be.contenedor_contenido_cards,children:e.map(t=>l.jsxs("div",{className:be.contenedor_fila_card,children:[l.jsx("div",{className:be.card_fila_label,children:Kt(t.column.id,n)}),l.jsx("div",{className:be.card_fila_valor,children:Ut(t.column.columnDef.cell,t.getContext())})]},t.id))}),Ou=({fila:e,table:n,idPrimeraColumna:t,idSegundaColumna:o})=>{const r=Gi(e,t),i=Gi(e,o);return l.jsxs("div",{className:be.contenedor_encabezado_card,children:[l.jsx("div",{className:be.contenedor_columna_card,children:t&&r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:be.card_label,children:Kt(t,n)}),l.jsx("div",{className:be.card_valor,children:Hi(e,t)})]})}),l.jsx("div",{className:be.contenedor_columna_card,children:o&&i&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:be.card_label,children:Kt(o,n)}),l.jsx("div",{className:be.card_segundo_valor,children:Hi(e,o)})]})})]})};function Pu(){var h;const e=(h=v.useContext(mt))==null?void 0:h.state,{table:n,controls:t,primerasColumnas:o,loading:r,columns:i}=e||{};if(!n)return null;const s=i&&o?Ui(i,o[0]):void 0,a=i&&o?Ui(i,o[1]):void 0,d=Ki(s),u=Ki(a);if(r)return l.jsx(Fu,{filas:3,cantidadControles:(t==null?void 0:t.length)??0,table:n,idPrimeraColumna:d,idSegundaColumna:u});const f=n.getRowModel().rows;return f.length===0?l.jsx("article",{className:be.contenedor_card,children:l.jsx(Wi,{})}):l.jsx("section",{className:be.contenedor_tabla_cards,children:f.map(g=>{const c=xu(g,d,u);return l.jsxs("article",{className:be.contenedor_card,children:[l.jsx(Ou,{fila:g,table:n,idPrimeraColumna:d,idSegundaColumna:u}),l.jsx(Du,{columnasRestantes:c,table:n}),l.jsx(Au,{fila:g,controls:t})]},g.id)})})}const Xi={filas:"_filas_un2v3_1",columnas:"_columnas_un2v3_43"},Nu=({columnas:e,filas:n})=>l.jsx(l.Fragment,{children:Array.from({length:n}).map((t,o)=>l.jsx("tr",{className:Xi.filas,children:Array.from({length:e}).map((r,i)=>l.jsx("td",{className:Xi.columnas},`sk-cell-${o}-${i}`))},`sk-row-${o}`))}),Tt={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 Lu({totalSeleccionadas:e,acciones:n,filasSeleccionadas:t,onLimpiarSeleccion:o}){const[r,i]=v.useState(0),[s,a]=v.useState([]),[d,u]=v.useState([]),f=e>0,h=v.useRef(null);return ji(o,f),v.useEffect(()=>{f&&(i(e),a(n),u(t))},[e,n,t,f]),l.jsx(hn,{mostrar:f,tipo:"escalar",className:Tt.contenedor,children:l.jsxs("div",{ref:h,className:Tt.barra,children:[l.jsxs("div",{className:Tt.info,children:[l.jsx(lt,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:o,"aria-label":"Limpiar selección",className:Tt.btn_cerrar,children:l.jsx(du,{})}),l.jsxs("p",{className:Tt.contador,children:[r," filas seleccionadas"]})]}),l.jsx("div",{className:Tt.separador}),l.jsx("div",{className:Tt.acciones,children:s.map(g=>l.jsx("div",{children:g.componente(d)},g.id))})]})})}function Vu(){var h;const e=(h=v.useContext(mt))==null?void 0:h.state,{table:n,loading:t,columns:o,selectorFilas:r=[]}=e||{};if(!n)return null;const i=n.getHeaderGroups(),s=n.getRowModel().rows,a=(o==null?void 0:o.length)??0,d=n.getSelectedRowModel().rows,u=d.length,f=()=>{n.resetRowSelection()};return l.jsxs(l.Fragment,{children:[l.jsxs("table",{className:Ne.contenedor_tabla,children:[l.jsx("thead",{children:i.map(g=>l.jsx("tr",{children:g.headers.map(c=>{var _;const p=(_=c.column.columnDef.meta)==null?void 0:_.style;return l.jsx("th",{className:Ne.encabezados,style:p,children:c.id==="select"?l.jsx("div",{children:Ut(c.column.columnDef.header,c.getContext())}):l.jsxs("div",{onClick:c.column.getToggleSortingHandler(),children:[Ut(c.column.columnDef.header,c.getContext()),Su(c.column.getIsSorted())]})},c.id)})},g.id))}),t&&l.jsx(Nu,{columnas:a,filas:10}),!t&&l.jsx("tbody",{className:Ne.contenedor_datos,children:s.length===0?l.jsx("tr",{children:l.jsx("td",{colSpan:a,style:{backgroundColor:"var(--base)"},children:l.jsx(Wi,{})})}):s.map(g=>l.jsx("tr",{className:`${Ne.datos} ${g.getIsSelected()?Ne.seleccionada:""}`,children:g.getVisibleCells().map(c=>{var _;const p=(_=c.column.columnDef.meta)==null?void 0:_.style;return l.jsx("td",{className:Ne.columna,style:p,children:Ut(c.column.columnDef.cell,c.getContext())},c.id)})},g.id))})]}),(r==null?void 0:r.length)>0?l.jsx(Lu,{totalSeleccionadas:u,acciones:r,filasSeleccionadas:d.map(g=>g.original),onLimpiarSeleccion:f}):null]})}function Tu({id:e}){const n=jn("only screen and (max-width: 830px)");return l.jsxs("main",{className:Ne.contenedor,id:e,children:[l.jsx(Iu,{}),n?l.jsx(Pu,{}):l.jsx(Vu,{}),l.jsx(Eu,{})]})}function zu({id:e,...n}){return l.jsx(eu,{...n,children:l.jsx(Tu,{id:e})})}ce.BadgeVoz=to,ce.Boton=lt,ce.Checkbox=dn,ce.CheckboxGroup=Qc,ce.FirmaManual=Qo,ce.GrabacionIcono=sr,ce.InputDate=ir,ce.InputNumeric=rr,ce.InputText=er,ce.MicrofonoIcono=Qn,ce.Select=Ei,ce.SonidoIcono=eo,ce.TablaDatos=zu,ce.TextArea=lr,ce.Transicion=hn,ce.aplanarOpcionesAgrupadas=$i,ce.esOpcionesAgrupadas=xi,ce.estaDeshabilitada=ln,ce.estaSeleccionada=Si,ce.fechaEnRango=ys,ce.filtrarOpciones=ko,ce.filtrarOpcionesAgrupadas=Ii,ce.formatearFecha=bs,ce.formatearNumero=Xt,ce.generarOpcionesAleatorias=ic,ce.generarUsuariosPrueba=sc,ce.obtenerFechaHoy=ws,ce.obtenerLabelOpcion=Bn,ce.obtenerValorOpcion=Wt,ce.parsearNumero=tr,ce.procesarValidacion=nr,ce.redondearDecimales=or,ce.restringirRango=pn,ce.useReconocimientoVoz=ar,Object.defineProperty(ce,Symbol.toStringTag,{value:"Module"})}));
|