@boxcustodia/library 2.0.0-alpha.30 → 2.0.0-alpha.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),p=require("../select/select.cjs.js"),w=require("../../node_modules/react-day-picker/dist/esm/DayPicker.cjs.js"),N=require("../../node_modules/date-fns/locale/es.cjs.js"),j=require("../../node_modules/lucide-react/dist/esm/icons/chevron-left.cjs.js"),C=require("../../node_modules/lucide-react/dist/esm/icons/chevron-right.cjs.js"),f=require("../../node_modules/lucide-react/dist/esm/icons/chevron-down.cjs.js"),r=require("../../lib/cn.cjs.js"),b=new Date().getFullYear(),D=new Date(b-100,0),k=new Date(b+100,11);function q({options:d=[],value:l,onChange:o}){const i=d.map(e=>({label:e.label??"",value:e.value??0})),c=i.find(e=>e.value===Number(l))??null;return s.jsx(p.Select,{items:i,value:c,icon:s.jsx(f.default,{className:p.selectTriggerIconClassName}),"aria-invalid":!1,className:"py-1 h-7 border-none font-medium! w-fit! [&>span]:capitalize",getLabel:e=>e.label,getId:e=>String(e.value),onValueChange:e=>{!o||e===null||o({target:{value:String(e.value)}})}})}const g="relative flex size-(--cell-size) text-base sm:text-sm items-center justify-center rounded-lg text-foreground not-in-data-selected:hover:bg-accent disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0";function S({className:d,classNames:l,showOutsideDays:o=!0,components:i,mode:c="single",captionLayout:e="dropdown",startMonth:x=D,endMonth:v=k,...h}){const u={button_next:g,button_previous:g,caption_label:"text-base sm:text-sm font-medium flex items-center gap-2 h-full",day:"size-(--cell-size) text-sm py-px",day_button:r.cn(g,"in-data-disabled:pointer-events-none in-[.range-middle]:rounded-none in-[.range-end:not(.range-start)]:rounded-s-none in-[.range-start:not(.range-end)]:rounded-e-none in-[.range-middle]:in-data-selected:bg-accent in-data-selected:bg-primary in-[.range-middle]:in-data-selected:text-foreground in-data-disabled:text-muted-foreground/72 in-data-outside:text-muted-foreground/72 in-data-selected:in-data-outside:text-primary-foreground in-data-selected:text-primary-foreground in-data-disabled:line-through outline-none in-[[data-selected]:not(.range-middle)]:transition-[color,background-color,border-radius,box-shadow] focus-visible:z-1 focus-visible:ring-[3px] focus-visible:ring-ring/50"),dropdown:"absolute bg-popover inset-0 opacity-0",dropdown_root:"relative has-focus:border-ring has-focus:ring-ring/50 has-focus:ring-[3px] border border-input shadow-xs/5 rounded-lg px-[calc(--spacing(3)-1px)] h-9 sm:h-8 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:-me-1",dropdowns:"w-full flex items-center text-base sm:text-sm justify-center h-(--cell-size) gap-1.5 *:[span]:font-medium",hidden:"invisible",month:"w-full",month_caption:"relative mx-(--cell-size) px-1 mb-1 flex h-(--cell-size) items-center justify-center z-2",months:"relative flex flex-col sm:flex-row gap-2",nav:"absolute top-0 flex w-full justify-between z-1",outside:"text-muted-foreground data-selected:bg-accent/50 data-selected:text-muted-foreground",range_end:"range-end",range_middle:"range-middle",range_start:"range-start",today:"*:after:pointer-events-none *:after:absolute *:after:bottom-1 *:after:start-1/2 *:after:z-1 *:after:size-[3px] *:after:-translate-x-1/2 *:after:rounded-full *:after:bg-primary [&[data-selected]:not(.range-middle)>*]:after:bg-background [&[data-disabled]>*]:after:bg-foreground/30 *:after:transition-colors",week_number:"size-(--cell-size) p-0 text-xs font-medium text-muted-foreground/72",weekday:"size-(--cell-size) p-0 text-xs font-medium text-muted-foreground/72"},z=Object.keys(u).reduce((t,n)=>{const a=l?.[n],m=u[n];return t[n]=a?r.cn(m,a):m,t},{...u}),y={...{Dropdown:q,Chevron:({className:t,orientation:n,...a})=>n==="left"?s.jsx(j.default,{className:r.cn(t,"rtl:rotate-180"),...a,"aria-hidden":"true"}):n==="right"?s.jsx(C.default,{className:r.cn(t,"rtl:rotate-180"),...a,"aria-hidden":"true"}):s.jsx(f.default,{className:t,...a,"aria-hidden":"true"})},...i},_={className:r.cn("w-fit [--cell-size:--spacing(10)] sm:[--cell-size:--spacing(9)]","rounded-xl border bg-background","in-data-[slot=popover-popup]:rounded-none in-data-[slot=popover-popup]:border-0 in-data-[slot=popover-popup]:bg-transparent in-data-[slot=popover-popup]:p-0",d),classNames:z,components:y,"data-slot":"calendar",formatters:{formatMonthDropdown:t=>t.toLocaleString("es",{month:"short"})},locale:N.es,weekStartsOn:1,captionLayout:e,startMonth:x,endMonth:v,mode:c,showOutsideDays:o,...h};return s.jsx(w.DayPicker,{..._})}exports.Calendar=S;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),f=require("../select/select.cjs.js"),w=require("../../node_modules/react-day-picker/dist/esm/DayPicker.cjs.js"),N=require("../../node_modules/date-fns/locale/es.cjs.js"),j=require("../../node_modules/lucide-react/dist/esm/icons/chevron-left.cjs.js"),C=require("../../node_modules/lucide-react/dist/esm/icons/chevron-right.cjs.js"),b=require("../../node_modules/lucide-react/dist/esm/icons/chevron-down.cjs.js"),r=require("../../lib/cn.cjs.js"),x=new Date().getFullYear(),D=new Date(x-100,0),k=new Date(x+100,11);function q({options:l=[],value:c,onChange:o}){const i=l.map(e=>({label:e.label??"",value:e.value??0})),u=i.find(e=>e.value===Number(c))??null;return s.jsx(f.Select,{items:i,value:u?.value??null,icon:s.jsx(b.default,{className:f.selectTriggerIconClassName}),"aria-invalid":!1,className:"py-1 h-7 border-none font-medium! w-fit! [&>span]:capitalize",getLabel:e=>e.label,getId:e=>e.value,onValueChange:(e,d)=>{!o||d===null||o({target:{value:String(d.value)}})}})}const m="relative flex size-(--cell-size) text-base sm:text-sm items-center justify-center rounded-lg text-foreground not-in-data-selected:hover:bg-accent disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0";function T({className:l,classNames:c,showOutsideDays:o=!0,components:i,mode:u="single",captionLayout:e="dropdown",startMonth:d=D,endMonth:v=k,...h}){const g={button_next:m,button_previous:m,caption_label:"text-base sm:text-sm font-medium flex items-center gap-2 h-full",day:"size-(--cell-size) text-sm py-px",day_button:r.cn(m,"in-data-disabled:pointer-events-none in-[.range-middle]:rounded-none in-[.range-end:not(.range-start)]:rounded-s-none in-[.range-start:not(.range-end)]:rounded-e-none in-[.range-middle]:in-data-selected:bg-accent in-data-selected:bg-primary in-[.range-middle]:in-data-selected:text-foreground in-data-disabled:text-muted-foreground/72 in-data-outside:text-muted-foreground/72 in-data-selected:in-data-outside:text-primary-foreground in-data-selected:text-primary-foreground in-data-disabled:line-through outline-none in-[[data-selected]:not(.range-middle)]:transition-[color,background-color,border-radius,box-shadow] focus-visible:z-1 focus-visible:ring-[3px] focus-visible:ring-ring/50"),dropdown:"absolute bg-popover inset-0 opacity-0",dropdown_root:"relative has-focus:border-ring has-focus:ring-ring/50 has-focus:ring-[3px] border border-input shadow-xs/5 rounded-lg px-[calc(--spacing(3)-1px)] h-9 sm:h-8 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:-me-1",dropdowns:"w-full flex items-center text-base sm:text-sm justify-center h-(--cell-size) gap-1.5 *:[span]:font-medium",hidden:"invisible",month:"w-full",month_caption:"relative mx-(--cell-size) px-1 mb-1 flex h-(--cell-size) items-center justify-center z-2",months:"relative flex flex-col sm:flex-row gap-2",nav:"absolute top-0 flex w-full justify-between z-1",outside:"text-muted-foreground data-selected:bg-accent/50 data-selected:text-muted-foreground",range_end:"range-end",range_middle:"range-middle",range_start:"range-start",today:"*:after:pointer-events-none *:after:absolute *:after:bottom-1 *:after:start-1/2 *:after:z-1 *:after:size-[3px] *:after:-translate-x-1/2 *:after:rounded-full *:after:bg-primary [&[data-selected]:not(.range-middle)>*]:after:bg-background [&[data-disabled]>*]:after:bg-foreground/30 *:after:transition-colors",week_number:"size-(--cell-size) p-0 text-xs font-medium text-muted-foreground/72",weekday:"size-(--cell-size) p-0 text-xs font-medium text-muted-foreground/72"},z=Object.keys(g).reduce((t,n)=>{const a=c?.[n],p=g[n];return t[n]=a?r.cn(p,a):p,t},{...g}),_={...{Dropdown:q,Chevron:({className:t,orientation:n,...a})=>n==="left"?s.jsx(j.default,{className:r.cn(t,"rtl:rotate-180"),...a,"aria-hidden":"true"}):n==="right"?s.jsx(C.default,{className:r.cn(t,"rtl:rotate-180"),...a,"aria-hidden":"true"}):s.jsx(b.default,{className:t,...a,"aria-hidden":"true"})},...i},y={className:r.cn("w-fit [--cell-size:--spacing(10)] sm:[--cell-size:--spacing(9)]","rounded-xl border bg-background","in-data-[slot=popover-popup]:rounded-none in-data-[slot=popover-popup]:border-0 in-data-[slot=popover-popup]:bg-transparent in-data-[slot=popover-popup]:p-0",l),classNames:z,components:_,"data-slot":"calendar",formatters:{formatMonthDropdown:t=>t.toLocaleString("es",{month:"short"})},locale:N.es,weekStartsOn:1,captionLayout:e,startMonth:d,endMonth:v,mode:u,showOutsideDays:o,...h};return s.jsx(w.DayPicker,{...y})}exports.Calendar=T;
@@ -5,55 +5,55 @@ import { DayPicker as C } from "../../node_modules/react-day-picker/dist/esm/Day
5
5
  import { es as N } from "../../node_modules/date-fns/locale/es.es.js";
6
6
  import D from "../../node_modules/lucide-react/dist/esm/icons/chevron-left.es.js";
7
7
  import k from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.es.js";
8
- import g from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.es.js";
8
+ import f from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.es.js";
9
9
  import { cn as r } from "../../lib/cn.es.js";
10
- const f = (/* @__PURE__ */ new Date()).getFullYear(), T = new Date(f - 100, 0), j = new Date(f + 100, 11);
11
- function S({
12
- options: d = [],
13
- value: l,
10
+ const b = (/* @__PURE__ */ new Date()).getFullYear(), T = new Date(b - 100, 0), j = new Date(b + 100, 11);
11
+ function L({
12
+ options: l = [],
13
+ value: u,
14
14
  onChange: s
15
15
  }) {
16
- const i = d.map((e) => ({
16
+ const i = l.map((e) => ({
17
17
  label: e.label ?? "",
18
18
  value: e.value ?? 0
19
- })), c = i.find((e) => e.value === Number(l)) ?? null;
19
+ })), c = i.find((e) => e.value === Number(u)) ?? null;
20
20
  return /* @__PURE__ */ o(
21
21
  w,
22
22
  {
23
23
  items: i,
24
- value: c,
25
- icon: /* @__PURE__ */ o(g, { className: y }),
24
+ value: c?.value ?? null,
25
+ icon: /* @__PURE__ */ o(f, { className: y }),
26
26
  "aria-invalid": !1,
27
27
  className: "py-1 h-7 border-none font-medium! w-fit! [&>span]:capitalize",
28
28
  getLabel: (e) => e.label,
29
- getId: (e) => String(e.value),
30
- onValueChange: (e) => {
31
- !s || e === null || s({
32
- target: { value: String(e.value) }
29
+ getId: (e) => e.value,
30
+ onValueChange: (e, d) => {
31
+ !s || d === null || s({
32
+ target: { value: String(d.value) }
33
33
  });
34
34
  }
35
35
  }
36
36
  );
37
37
  }
38
- const m = "relative flex size-(--cell-size) text-base sm:text-sm items-center justify-center rounded-lg text-foreground not-in-data-selected:hover:bg-accent disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0";
38
+ const p = "relative flex size-(--cell-size) text-base sm:text-sm items-center justify-center rounded-lg text-foreground not-in-data-selected:hover:bg-accent disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0";
39
39
  function R({
40
- className: d,
41
- classNames: l,
40
+ className: l,
41
+ classNames: u,
42
42
  showOutsideDays: s = !0,
43
43
  components: i,
44
44
  mode: c = "single",
45
45
  captionLayout: e = "dropdown",
46
- startMonth: b = T,
47
- endMonth: x = j,
48
- ...v
46
+ startMonth: d = T,
47
+ endMonth: v = j,
48
+ ...x
49
49
  }) {
50
- const u = {
51
- button_next: m,
52
- button_previous: m,
50
+ const m = {
51
+ button_next: p,
52
+ button_previous: p,
53
53
  caption_label: "text-base sm:text-sm font-medium flex items-center gap-2 h-full",
54
54
  day: "size-(--cell-size) text-sm py-px",
55
55
  day_button: r(
56
- m,
56
+ p,
57
57
  "in-data-disabled:pointer-events-none in-[.range-middle]:rounded-none in-[.range-end:not(.range-start)]:rounded-s-none in-[.range-start:not(.range-end)]:rounded-e-none in-[.range-middle]:in-data-selected:bg-accent in-data-selected:bg-primary in-[.range-middle]:in-data-selected:text-foreground in-data-disabled:text-muted-foreground/72 in-data-outside:text-muted-foreground/72 in-data-selected:in-data-outside:text-primary-foreground in-data-selected:text-primary-foreground in-data-disabled:line-through outline-none in-[[data-selected]:not(.range-middle)]:transition-[color,background-color,border-radius,box-shadow] focus-visible:z-1 focus-visible:ring-[3px] focus-visible:ring-ring/50"
58
58
  ),
59
59
  dropdown: "absolute bg-popover inset-0 opacity-0",
@@ -72,16 +72,16 @@ function R({
72
72
  week_number: "size-(--cell-size) p-0 text-xs font-medium text-muted-foreground/72",
73
73
  weekday: "size-(--cell-size) p-0 text-xs font-medium text-muted-foreground/72"
74
74
  }, h = Object.keys(
75
- u
75
+ m
76
76
  ).reduce(
77
77
  (t, n) => {
78
- const a = l?.[n], p = u[n];
79
- return t[n] = a ? r(p, a) : p, t;
78
+ const a = u?.[n], g = m[n];
79
+ return t[n] = a ? r(g, a) : g, t;
80
80
  },
81
- { ...u }
81
+ { ...m }
82
82
  ), z = {
83
83
  ...{
84
- Dropdown: S,
84
+ Dropdown: L,
85
85
  Chevron: ({
86
86
  className: t,
87
87
  orientation: n,
@@ -100,7 +100,7 @@ function R({
100
100
  ...a,
101
101
  "aria-hidden": "true"
102
102
  }
103
- ) : /* @__PURE__ */ o(g, { className: t, ...a, "aria-hidden": "true" })
103
+ ) : /* @__PURE__ */ o(f, { className: t, ...a, "aria-hidden": "true" })
104
104
  },
105
105
  ...i
106
106
  }, _ = {
@@ -111,7 +111,7 @@ function R({
111
111
  // to avoid a double border.
112
112
  "rounded-xl border bg-background",
113
113
  "in-data-[slot=popover-popup]:rounded-none in-data-[slot=popover-popup]:border-0 in-data-[slot=popover-popup]:bg-transparent in-data-[slot=popover-popup]:p-0",
114
- d
114
+ l
115
115
  ),
116
116
  classNames: h,
117
117
  components: z,
@@ -122,11 +122,11 @@ function R({
122
122
  locale: N,
123
123
  weekStartsOn: 1,
124
124
  captionLayout: e,
125
- startMonth: b,
126
- endMonth: x,
125
+ startMonth: d,
126
+ endMonth: v,
127
127
  mode: c,
128
128
  showOutsideDays: s,
129
- ...v
129
+ ...x
130
130
  };
131
131
  return /* @__PURE__ */ o(
132
132
  C,
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),B=require("react"),S=require("../input/input.cjs.js"),_=require("../../node_modules/lucide-react/dist/esm/icons/chevrons-up-down.cjs.js"),Q=require("../field/field.cjs.js"),R=require("../../node_modules/lucide-react/dist/esm/icons/x.cjs.js"),U=require("../../hooks/internal/use-isomorphic-layout-effect.cjs.js"),X=require("../../node_modules/@base-ui/react/combobox/root/utils/useFilter.cjs.js"),J=require("../../node_modules/@base-ui/react/combobox/root/ComboboxRoot.cjs.js"),N=require("../../node_modules/@base-ui/react/combobox/input/ComboboxInput.cjs.js"),b=require("../../lib/cn.cjs.js"),K=require("../../node_modules/@base-ui/react/combobox/input-group/ComboboxInputGroup.cjs.js"),y=require("../../node_modules/@base-ui/react/combobox/trigger/ComboboxTrigger.cjs.js"),w=require("../../node_modules/@base-ui/react/combobox/value/ComboboxValue.cjs.js"),Y=require("../../node_modules/@base-ui/react/combobox/portal/ComboboxPortal.cjs.js"),Z=require("../../node_modules/@base-ui/react/combobox/positioner/ComboboxPositioner.cjs.js"),oo=require("../../node_modules/@base-ui/react/combobox/popup/ComboboxPopup.cjs.js"),eo=require("../../node_modules/@base-ui/react/combobox/item/ComboboxItem.cjs.js"),to=require("../../node_modules/@base-ui/react/combobox/item-indicator/ComboboxItemIndicator.cjs.js"),ro=require("../../node_modules/@base-ui/react/separator/Separator.cjs.js"),so=require("../../node_modules/@base-ui/react/combobox/group/ComboboxGroup.cjs.js"),no=require("../../node_modules/@base-ui/react/combobox/group-label/ComboboxGroupLabel.cjs.js"),io=require("../../node_modules/@base-ui/react/combobox/empty/ComboboxEmpty.cjs.js"),ao=require("../../node_modules/@base-ui/react/combobox/row/ComboboxRow.cjs.js"),lo=require("../scroll-area/scroll-area.cjs.js"),co=require("../../node_modules/@base-ui/react/combobox/list/ComboboxList.cjs.js"),bo=require("../../node_modules/@base-ui/react/combobox/clear/ComboboxClear.cjs.js"),uo=require("../../node_modules/@base-ui/react/combobox/status/ComboboxStatus.cjs.js"),mo=require("../../node_modules/@base-ui/react/combobox/collection/ComboboxCollection.cjs.js"),xo=require("../../node_modules/@base-ui/react/field/validity/FieldValidity.cjs.js"),po=require("../../node_modules/@base-ui/react/combobox/chip/ComboboxChip.cjs.js"),fo=require("../../node_modules/@base-ui/react/combobox/chip-remove/ComboboxChipRemove.cjs.js"),ho=require("../../node_modules/@base-ui/react/combobox/icon/ComboboxIcon.cjs.js"),go=require("../../node_modules/@base-ui/react/combobox/chips/ComboboxChips.cjs.js");function Co(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const r in o)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(o,r);Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>o[r]})}}return e.default=o,Object.freeze(e)}const m=Co(B),f=m.createContext({chipsRef:null,multiple:!1});function P({...o}){const e=m.useRef(null);return t.jsx(f.Provider,{value:{chipsRef:e,multiple:!!o.multiple},children:t.jsx(J.ComboboxRoot,{...o})})}function T({className:o,...e}){return t.jsx(N.ComboboxInput,{className:b.cn("min-w-12 flex-1 text-base outline-none placeholder:text-muted-foreground sm:text-sm [[data-slot=combobox-chip]+&]:ps-0.5",o),"data-slot":"combobox-chips-input",...e})}function L({className:o,showTrigger:e=!0,showClear:r=!1,startAddon:s,triggerProps:i,clearProps:n,...a}){return t.jsxs(K.ComboboxInputGroup,{className:"relative not-has-[>*.w-full]:w-fit w-full text-foreground has-disabled:opacity-64","data-slot":"combobox-input-group",children:[s&&t.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:-mx-0.5","data-slot":"combobox-start-addon",children:s}),t.jsx(N.ComboboxInput,{className:b.cn(s&&"*:data-[slot=combobox-input]:ps-[calc(--spacing(8.5)-1px)] sm:*:data-[slot=combobox-input]:ps-[calc(--spacing(8)-1px)]","pr-6",o),"data-slot":"combobox-input",render:l=>t.jsx(S.Input,{className:"has-disabled:opacity-100",nativeInput:!0,...l}),...a}),t.jsx(I,{showTrigger:e,showClear:r,triggerProps:i,clearProps:n})]})}function $({className:o,children:e,...r}){return t.jsx(y.ComboboxTrigger,{className:o,"data-slot":"combobox-trigger",...r,children:e})}function vo({className:o,placeholder:e,children:r,showClear:s,clearProps:i,...n}){const a=t.jsx(y.ComboboxTrigger,{className:b.cn("relative flex w-full items-center rounded-md border border-input bg-background px-3 py-2 pe-9 text-sm outline-none transition-shadow","focus-visible:border-ring","aria-invalid:border-error focus-visible:aria-invalid:ring-error/20","data-disabled:cursor-not-allowed data-disabled:opacity-50","data-placeholder:text-muted-foreground",o),"data-slot":"combobox-select-trigger",...n,children:r??t.jsx(w.ComboboxValue,{placeholder:e})});return s?t.jsxs("div",{className:"relative w-full text-foreground has-disabled:opacity-64","data-slot":"combobox-select-trigger-group",children:[a,t.jsx(I,{showTrigger:!0,showClear:!0,clearProps:i})]}):t.jsx(y.ComboboxTrigger,{className:b.cn("relative flex w-full items-center rounded-md border border-input bg-background px-3 py-2 pe-9 text-sm outline-none transition-shadow","focus-visible:border-ring","aria-invalid:border-error focus-visible:aria-invalid:ring-error/20","data-disabled:cursor-not-allowed data-disabled:opacity-50","data-placeholder:text-muted-foreground",o),"data-slot":"combobox-select-trigger",...n,children:r??t.jsxs(t.Fragment,{children:[t.jsx(w.ComboboxValue,{placeholder:e}),t.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute end-0.5 top-1/2 inline-flex size-8 -translate-y-1/2 items-center justify-center text-muted-foreground opacity-80 sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4",children:t.jsx(_.default,{})})]})})}function jo({className:o,...e}){return t.jsx("div",{className:"border-b p-2","data-slot":"combobox-search-input-wrapper",children:t.jsx(N.ComboboxInput,{className:b.cn("flex h-9 w-full rounded-md bg-transparent text-base placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed disabled:opacity-64 sm:h-8 sm:text-sm",o),autoComplete:"off","data-slot":"combobox-search-input",...e})})}function k({className:o,children:e,side:r="bottom",sideOffset:s=4,alignOffset:i,align:n="start",anchor:a,portalProps:l,...c}){const{chipsRef:u}=m.useContext(f),p=a??u;return t.jsx(Y.ComboboxPortal,{...l,children:t.jsx(Z.ComboboxPositioner,{align:n,alignOffset:i,anchor:p,className:"z-50 select-none","data-slot":"combobox-positioner",side:r,sideOffset:s,children:t.jsx(oo.ComboboxPopup,{className:b.cn("relative flex max-h-[min(var(--available-height),23rem)] min-w-(--anchor-width) max-w-(--available-width) origin-(--transform-origin) flex-1 flex-col rounded-lg border bg-popover not-dark:bg-clip-padding text-foreground shadow-lg/5","before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]","duration-100 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95","data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",o),"data-slot":"combobox-popup",...c,children:e})})})}function G({className:o,children:e,...r}){return t.jsxs(eo.ComboboxItem,{className:b.cn("flex justify-between min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 px-2 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",o),"data-slot":"combobox-item",...r,children:[e,t.jsx(to.ComboboxItemIndicator,{className:"col-end-1",children:t.jsx("svg",{"aria-hidden":"true",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M5.252 12.7 10.2 18.63 18.748 5.37"})})})]})}function yo({className:o,...e}){return t.jsx(ro.Separator,{className:b.cn("mx-2 my-1 h-px bg-border last:hidden",o),"data-slot":"combobox-separator",...e})}function wo({className:o,...e}){return t.jsx(so.ComboboxGroup,{className:b.cn("[[role=group]+&]:mt-1.5",o),"data-slot":"combobox-group",...e})}function No({className:o,...e}){return t.jsx(no.ComboboxGroupLabel,{className:b.cn("px-2 py-1.5 font-medium text-muted-foreground text-xs",o),"data-slot":"combobox-group-label",...e})}function E({className:o,...e}){return t.jsx(io.ComboboxEmpty,{className:b.cn("not-empty:p-2 text-center text-base text-muted-foreground sm:text-sm",o),"data-slot":"combobox-empty",...e})}function Io({className:o,...e}){return t.jsx(ao.ComboboxRow,{className:o,"data-slot":"combobox-row",...e})}function F({...o}){return t.jsx(w.ComboboxValue,{"data-slot":"combobox-value",...o})}function V({className:o,...e}){return t.jsx(lo.ScrollArea,{scrollbarGutter:!0,scrollFade:!0,children:t.jsx(co.ComboboxList,{className:b.cn("not-empty:scroll-py-1 not-empty:px-1 not-empty:py-1 in-data-has-overflow-y:pe-3",o),"data-slot":"combobox-list",...e})})}function O({className:o,...e}){return t.jsx(bo.ComboboxClear,{className:o,"data-slot":"combobox-clear",...e})}const q="absolute end-0.5 top-1/2 inline-flex size-8 shrink-0 -translate-y-1/2 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0";function I({showTrigger:o=!0,showClear:e=!1,triggerProps:r,clearProps:s}){return!o&&!e?null:t.jsxs("div",{className:"text-muted-foreground hover:text-foreground transition-colors",children:[o&&t.jsx($,{className:b.cn(q,"text-muted-foreground has-[+[data-slot=combobox-clear]]:hidden"),...r,children:t.jsx(ho.ComboboxIcon,{"data-slot":"combobox-icon",children:t.jsx(_.default,{})})}),e&&t.jsx(O,{className:q,...s,children:t.jsx(R.default,{})})]})}function zo({className:o,...e}){return t.jsx(uo.ComboboxStatus,{className:b.cn("px-3 py-2 font-medium text-muted-foreground text-xs empty:m-0 empty:p-0",o),"data-slot":"combobox-status",...e})}function qo(o){return t.jsx(mo.ComboboxCollection,{"data-slot":"combobox-collection",...o})}function M({className:o,children:e,startAddon:r,...s}){const{chipsRef:i}=m.useContext(f),n=Q.useIsInsideFieldRoot(),a=l=>t.jsxs(go.ComboboxChips,{"aria-invalid":l,className:b.cn(S.inputBaseClasses,"relative inline-flex pr-6 w-full flex-wrap gap-1","placeholder:text-muted-foreground","focus-within:border-ring","aria-invalid:border-error focus-within:aria-invalid:ring-error/20","has-disabled:cursor-not-allowed has-disabled:opacity-50",o),"data-slot":"combobox-chips",ref:i,...s,children:[r&&t.jsx("div",{"aria-hidden":"true",className:"flex shrink-0 items-center ps-2 opacity-80 has-[+[data-slot=combobox-chip]]:pe-2 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:-ms-0.5 [&_svg]:-me-1.5","data-slot":"combobox-start-addon",children:r}),e]});return n?t.jsx(xo.FieldValidity,{children:({validity:l})=>a(l.valid===!1?!0:void 0)}):a(void 0)}function W({children:o,removeProps:e,...r}){return t.jsxs(po.ComboboxChip,{className:"flex my-auto items-center pl-1 rounded-[calc(var(--radius-md)-1px)] bg-accent font-medium text-accent-foreground text-sm outline-none sm:text-xs/(--text-xs--line-height) [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5 h-6","data-slot":"combobox-chip",...r,children:[o,t.jsx(A,{...e})]})}function A(o){return t.jsx(fo.ComboboxChipRemove,{"aria-label":"Quitar",className:"h-full shrink-0 cursor-pointer px-1 opacity-80 hover:opacity-100 [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5","data-slot":"combobox-chip-remove",...o,children:t.jsx(R.default,{})})}const v=4,So=24,_o=36,Ro=68;function j(o,e){const r=o-So-_o;let s=0,i=0;for(let n=0;n<e.length;n++){const a=e[n],l=n<e.length-1;if(s+(n>0?v:0)+a+(l?v+Ro:0)>r)break;s+=(n>0?v:0)+a,i++}return i}function Po(o,e){const[r,s]=m.useState(null),i=m.useRef([]),n=r===null||r.items!==o;return U.useIsomorphicLayoutEffect(()=>{if(!n)return;const a=e?.current;if(!a)return;const l=a.querySelectorAll('[data-slot="combobox-chip"]');i.current=Array.from(l).map(u=>u.offsetWidth);const c=j(a.clientWidth,i.current);s({items:o,visible:c})},[n,o,e]),m.useEffect(()=>{const a=i.current.length>0&&i.current.every(d=>d===0);if(!n&&!a)return;const l=e?.current;if(!l)return;const c=l.querySelectorAll('[data-slot="combobox-chip"]');if(!c.length)return;const u=Array.from(c).map(d=>d.offsetWidth);if(u.every(d=>d===0))return;i.current=u;const p=j(l.clientWidth,u);s(d=>d?{...d,visible:p}:{items:o,visible:p})},[n,o,e]),m.useEffect(()=>{const a=e?.current;if(!a)return;const l=new ResizeObserver(()=>{if(!i.current.length)return;const c=j(a.clientWidth,i.current);s(u=>u?{...u,visible:c}:null)});return l.observe(a),()=>l.disconnect()},[e]),{visibleCount:r?.visible??o,isMeasuring:n}}function To({value:o,getLabel:e,getId:r}){const{chipsRef:s}=m.useContext(f),{visibleCount:i,isMeasuring:n}=Po(o.length,s),a=n?o:o.slice(0,i),l=n?0:o.length-i;return t.jsxs(t.Fragment,{children:[a.map(c=>t.jsx(W,{"aria-label":e(c),children:e(c)},r(c))),l>0&&t.jsxs("span",{className:"flex items-center whitespace-nowrap px-1 text-sm text-muted-foreground",children:["+",l," más"]})]})}function Lo(o){if(o==null)return"";if(typeof o=="string"||typeof o=="number")return String(o);if(typeof o=="object"){const e=o;if("label"in e)return String(e.label);if("name"in e)return String(e.name);if("title"in e)return String(e.title)}return String(o)}function $o(o){if(o==null)return"";if(typeof o=="string"||typeof o=="number")return String(o);if(typeof o=="object"){const e=o;if("id"in e)return String(e.id);if("value"in e)return String(e.value)}return String(o)}function ko({placeholder:o,showClear:e,startAddon:r,className:s}){return t.jsx(L,{className:s,placeholder:o,showClear:e,startAddon:r})}function Go({getLabel:o,getId:e,showClear:r,startAddon:s,className:i}){return t.jsxs(M,{className:i,startAddon:s,children:[t.jsx(F,{children:n=>t.jsx(To,{value:n,getLabel:o,getId:e})}),t.jsx(I,{showTrigger:!r,showClear:r})]})}function Eo(o){const{items:e,getLabel:r,getId:s,renderItem:i,placeholder:n,emptyText:a="Sin resultados.",multiple:l,onValueChange:c,value:u,defaultValue:p,startAddon:d,classNames:x,showClear:z=!0,searchable:D=!0,...H}=o,g=r??Lo,C=s??$o;return t.jsxs(P,{items:e,itemToStringLabel:g,itemToStringValue:C,multiple:l,onValueChange:c,value:u,defaultValue:p,autoHighlight:!0,loopFocus:!0,...H,children:[l?t.jsx(Go,{getLabel:g,getId:C,showClear:z,startAddon:d,className:x?.chips}):t.jsx(ko,{placeholder:n,showClear:z,startAddon:d,className:x?.input}),t.jsxs(k,{className:x?.popup,children:[l&&D&&t.jsx("div",{className:"border-b p-2","data-slot":"combobox-chips-input-wrapper",children:t.jsx(T,{className:x?.chipsInput,placeholder:n})}),t.jsx(E,{className:x?.empty,children:a}),t.jsx(V,{className:x?.list,children:h=>t.jsx(G,{value:h,className:x?.item,children:i?i(h):g(h)},C(h))})]})]})}const Fo=X.useComboboxFilter;exports.Combobox=Eo;exports.ComboboxChip=W;exports.ComboboxChipRemove=A;exports.ComboboxChips=M;exports.ComboboxChipsInput=T;exports.ComboboxClear=O;exports.ComboboxCollection=qo;exports.ComboboxContext=f;exports.ComboboxEmpty=E;exports.ComboboxGroup=wo;exports.ComboboxGroupLabel=No;exports.ComboboxInput=L;exports.ComboboxItem=G;exports.ComboboxList=V;exports.ComboboxPopup=k;exports.ComboboxRoot=P;exports.ComboboxRow=Io;exports.ComboboxSearchInput=jo;exports.ComboboxSelectTrigger=vo;exports.ComboboxSeparator=yo;exports.ComboboxStatus=zo;exports.ComboboxTrigger=$;exports.ComboboxValue=F;exports.useComboboxFilter=Fo;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),eo=require("react"),V=require("../input/input.cjs.js"),$=require("../../node_modules/lucide-react/dist/esm/icons/chevrons-up-down.cjs.js"),to=require("../field/field.cjs.js"),k=require("../../node_modules/lucide-react/dist/esm/icons/x.cjs.js"),ro=require("../../hooks/internal/use-isomorphic-layout-effect.cjs.js"),so=require("../../node_modules/@base-ui/react/combobox/root/utils/useFilter.cjs.js"),no=require("../../node_modules/@base-ui/react/combobox/root/ComboboxRoot.cjs.js"),q=require("../../node_modules/@base-ui/react/combobox/input/ComboboxInput.cjs.js"),d=require("../../lib/cn.cjs.js"),io=require("../../node_modules/@base-ui/react/combobox/input-group/ComboboxInputGroup.cjs.js"),I=require("../../node_modules/@base-ui/react/combobox/trigger/ComboboxTrigger.cjs.js"),z=require("../../node_modules/@base-ui/react/combobox/value/ComboboxValue.cjs.js"),ao=require("../../node_modules/@base-ui/react/combobox/portal/ComboboxPortal.cjs.js"),lo=require("../../node_modules/@base-ui/react/combobox/positioner/ComboboxPositioner.cjs.js"),co=require("../../node_modules/@base-ui/react/combobox/popup/ComboboxPopup.cjs.js"),bo=require("../../node_modules/@base-ui/react/combobox/item/ComboboxItem.cjs.js"),uo=require("../../node_modules/@base-ui/react/combobox/item-indicator/ComboboxItemIndicator.cjs.js"),mo=require("../../node_modules/@base-ui/react/separator/Separator.cjs.js"),xo=require("../../node_modules/@base-ui/react/combobox/group/ComboboxGroup.cjs.js"),po=require("../../node_modules/@base-ui/react/combobox/group-label/ComboboxGroupLabel.cjs.js"),fo=require("../../node_modules/@base-ui/react/combobox/empty/ComboboxEmpty.cjs.js"),ho=require("../../node_modules/@base-ui/react/combobox/row/ComboboxRow.cjs.js"),go=require("../scroll-area/scroll-area.cjs.js"),Co=require("../../node_modules/@base-ui/react/combobox/list/ComboboxList.cjs.js"),vo=require("../../node_modules/@base-ui/react/combobox/clear/ComboboxClear.cjs.js"),jo=require("../../node_modules/@base-ui/react/combobox/status/ComboboxStatus.cjs.js"),yo=require("../../node_modules/@base-ui/react/combobox/collection/ComboboxCollection.cjs.js"),wo=require("../../node_modules/@base-ui/react/field/validity/FieldValidity.cjs.js"),No=require("../../node_modules/@base-ui/react/combobox/chip/ComboboxChip.cjs.js"),So=require("../../node_modules/@base-ui/react/combobox/chip-remove/ComboboxChipRemove.cjs.js"),Io=require("../../node_modules/@base-ui/react/combobox/icon/ComboboxIcon.cjs.js"),zo=require("../../node_modules/@base-ui/react/combobox/chips/ComboboxChips.cjs.js");function qo(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const r in o)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(o,r);Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>o[r]})}}return e.default=o,Object.freeze(e)}const p=qo(eo),C=p.createContext({chipsRef:null,multiple:!1});function E({...o}){const e=p.useRef(null);return t.jsx(C.Provider,{value:{chipsRef:e,multiple:!!o.multiple},children:t.jsx(no.ComboboxRoot,{...o})})}function L({className:o,...e}){return t.jsx(q.ComboboxInput,{className:d.cn("min-w-12 flex-1 text-base outline-none placeholder:text-muted-foreground sm:text-sm [[data-slot=combobox-chip]+&]:ps-0.5",o),"data-slot":"combobox-chips-input",...e})}function G({className:o,showTrigger:e=!0,showClear:r=!1,startAddon:s,triggerProps:a,clearProps:n,...l}){return t.jsxs(io.ComboboxInputGroup,{className:"relative not-has-[>*.w-full]:w-fit w-full text-foreground has-disabled:opacity-64","data-slot":"combobox-input-group",children:[s&&t.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:-mx-0.5","data-slot":"combobox-start-addon",children:s}),t.jsx(q.ComboboxInput,{className:d.cn(s&&"*:data-[slot=combobox-input]:ps-[calc(--spacing(8.5)-1px)] sm:*:data-[slot=combobox-input]:ps-[calc(--spacing(8)-1px)]","pr-6",o),"data-slot":"combobox-input",render:i=>t.jsx(V.Input,{className:"has-disabled:opacity-100",nativeInput:!0,...i}),...l}),t.jsx(_,{showTrigger:e,showClear:r,triggerProps:a,clearProps:n})]})}function F({className:o,children:e,...r}){return t.jsx(I.ComboboxTrigger,{className:o,"data-slot":"combobox-trigger",...r,children:e})}function _o({className:o,placeholder:e,children:r,showClear:s,clearProps:a,...n}){const l=t.jsx(I.ComboboxTrigger,{className:d.cn("relative flex w-full items-center rounded-md border border-input bg-background px-3 py-2 pe-9 text-sm outline-none transition-shadow","focus-visible:border-ring","aria-invalid:border-error focus-visible:aria-invalid:ring-error/20","data-disabled:cursor-not-allowed data-disabled:opacity-50","data-placeholder:text-muted-foreground",o),"data-slot":"combobox-select-trigger",...n,children:r??t.jsx(z.ComboboxValue,{placeholder:e})});return s?t.jsxs("div",{className:"relative w-full text-foreground has-disabled:opacity-64","data-slot":"combobox-select-trigger-group",children:[l,t.jsx(_,{showTrigger:!0,showClear:!0,clearProps:a})]}):t.jsx(I.ComboboxTrigger,{className:d.cn("relative flex w-full items-center rounded-md border border-input bg-background px-3 py-2 pe-9 text-sm outline-none transition-shadow","focus-visible:border-ring","aria-invalid:border-error focus-visible:aria-invalid:ring-error/20","data-disabled:cursor-not-allowed data-disabled:opacity-50","data-placeholder:text-muted-foreground",o),"data-slot":"combobox-select-trigger",...n,children:r??t.jsxs(t.Fragment,{children:[t.jsx(z.ComboboxValue,{placeholder:e}),t.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute end-0.5 top-1/2 inline-flex size-8 -translate-y-1/2 items-center justify-center text-muted-foreground opacity-80 sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4",children:t.jsx($.default,{})})]})})}function Ro({className:o,...e}){return t.jsx("div",{className:"border-b p-2","data-slot":"combobox-search-input-wrapper",children:t.jsx(q.ComboboxInput,{className:d.cn("flex h-9 w-full rounded-md bg-transparent text-base placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed disabled:opacity-64 sm:h-8 sm:text-sm",o),autoComplete:"off","data-slot":"combobox-search-input",...e})})}function O({className:o,children:e,side:r="bottom",sideOffset:s=4,alignOffset:a,align:n="start",anchor:l,portalProps:i,...b}){const{chipsRef:u}=p.useContext(C),f=l??u;return t.jsx(ao.ComboboxPortal,{...i,children:t.jsx(lo.ComboboxPositioner,{align:n,alignOffset:a,anchor:f,className:"z-50 select-none","data-slot":"combobox-positioner",side:r,sideOffset:s,children:t.jsx(co.ComboboxPopup,{className:d.cn("relative flex max-h-[min(var(--available-height),23rem)] min-w-(--anchor-width) max-w-(--available-width) origin-(--transform-origin) flex-1 flex-col rounded-lg border bg-popover not-dark:bg-clip-padding text-foreground shadow-lg/5","before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]","duration-100 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95","data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",o),"data-slot":"combobox-popup",...b,children:e})})})}function D({className:o,children:e,...r}){return t.jsxs(bo.ComboboxItem,{className:d.cn("flex justify-between min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 px-2 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",o),"data-slot":"combobox-item",...r,children:[e,t.jsx(uo.ComboboxItemIndicator,{className:"col-end-1",children:t.jsx("svg",{"aria-hidden":"true",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M5.252 12.7 10.2 18.63 18.748 5.37"})})})]})}function Po({className:o,...e}){return t.jsx(mo.Separator,{className:d.cn("mx-2 my-1 h-px bg-border last:hidden",o),"data-slot":"combobox-separator",...e})}function To({className:o,...e}){return t.jsx(xo.ComboboxGroup,{className:d.cn("[[role=group]+&]:mt-1.5",o),"data-slot":"combobox-group",...e})}function Vo({className:o,...e}){return t.jsx(po.ComboboxGroupLabel,{className:d.cn("px-2 py-1.5 font-medium text-muted-foreground text-xs",o),"data-slot":"combobox-group-label",...e})}function M({className:o,...e}){return t.jsx(fo.ComboboxEmpty,{className:d.cn("not-empty:p-2 text-center text-base text-muted-foreground sm:text-sm",o),"data-slot":"combobox-empty",...e})}function $o({className:o,...e}){return t.jsx(ho.ComboboxRow,{className:o,"data-slot":"combobox-row",...e})}function W({...o}){return t.jsx(z.ComboboxValue,{"data-slot":"combobox-value",...o})}function A({className:o,...e}){return t.jsx(go.ScrollArea,{scrollbarGutter:!0,scrollFade:!0,children:t.jsx(Co.ComboboxList,{className:d.cn("not-empty:scroll-py-1 not-empty:px-1 not-empty:py-1 in-data-has-overflow-y:pe-3",o),"data-slot":"combobox-list",...e})})}function B({className:o,...e}){return t.jsx(vo.ComboboxClear,{className:o,"data-slot":"combobox-clear",...e})}const T="absolute end-0.5 top-1/2 inline-flex size-8 shrink-0 -translate-y-1/2 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0";function _({showTrigger:o=!0,showClear:e=!1,triggerProps:r,clearProps:s}){return!o&&!e?null:t.jsxs("div",{className:"text-muted-foreground hover:text-foreground transition-colors",children:[o&&t.jsx(F,{className:d.cn(T,"text-muted-foreground has-[+[data-slot=combobox-clear]]:hidden"),...r,children:t.jsx(Io.ComboboxIcon,{"data-slot":"combobox-icon",children:t.jsx($.default,{})})}),e&&t.jsx(B,{className:T,...s,children:t.jsx(k.default,{})})]})}function ko({className:o,...e}){return t.jsx(jo.ComboboxStatus,{className:d.cn("px-3 py-2 font-medium text-muted-foreground text-xs empty:m-0 empty:p-0",o),"data-slot":"combobox-status",...e})}function Eo(o){return t.jsx(yo.ComboboxCollection,{"data-slot":"combobox-collection",...o})}function H({className:o,children:e,startAddon:r,...s}){const{chipsRef:a}=p.useContext(C),n=to.useIsInsideFieldRoot(),l=i=>t.jsxs(zo.ComboboxChips,{"aria-invalid":i,className:d.cn(V.inputBaseClasses,"relative inline-flex pr-6 w-full flex-wrap gap-1","placeholder:text-muted-foreground","focus-within:border-ring","aria-invalid:border-error focus-within:aria-invalid:ring-error/20","has-disabled:cursor-not-allowed has-disabled:opacity-50",o),"data-slot":"combobox-chips",ref:a,...s,children:[r&&t.jsx("div",{"aria-hidden":"true",className:"flex shrink-0 items-center ps-2 opacity-80 has-[+[data-slot=combobox-chip]]:pe-2 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:-ms-0.5 [&_svg]:-me-1.5","data-slot":"combobox-start-addon",children:r}),e]});return n?t.jsx(wo.FieldValidity,{children:({validity:i})=>l(i.valid===!1?!0:void 0)}):l(void 0)}function K({children:o,removeProps:e,...r}){return t.jsxs(No.ComboboxChip,{className:"flex my-auto items-center pl-1 rounded-[calc(var(--radius-md)-1px)] bg-accent font-medium text-accent-foreground text-sm outline-none sm:text-xs/(--text-xs--line-height) [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5 h-6","data-slot":"combobox-chip",...r,children:[o,t.jsx(Q,{...e})]})}function Q(o){return t.jsx(So.ComboboxChipRemove,{"aria-label":"Quitar",className:"h-full shrink-0 cursor-pointer px-1 opacity-80 hover:opacity-100 [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5","data-slot":"combobox-chip-remove",...o,children:t.jsx(k.default,{})})}const N=4,Lo=24,Go=36,Fo=68;function S(o,e){const r=o-Lo-Go;let s=0,a=0;for(let n=0;n<e.length;n++){const l=e[n],i=n<e.length-1;if(s+(n>0?N:0)+l+(i?N+Fo:0)>r)break;s+=(n>0?N:0)+l,a++}return a}function Oo(o,e){const[r,s]=p.useState(null),a=p.useRef([]),n=r===null||r.items!==o;return ro.useIsomorphicLayoutEffect(()=>{if(!n)return;const l=e?.current;if(!l)return;const i=l.querySelectorAll('[data-slot="combobox-chip"]');a.current=Array.from(i).map(u=>u.offsetWidth);const b=S(l.clientWidth,a.current);s({items:o,visible:b})},[n,o,e]),p.useEffect(()=>{const l=a.current.length>0&&a.current.every(x=>x===0);if(!n&&!l)return;const i=e?.current;if(!i)return;const b=i.querySelectorAll('[data-slot="combobox-chip"]');if(!b.length)return;const u=Array.from(b).map(x=>x.offsetWidth);if(u.every(x=>x===0))return;a.current=u;const f=S(i.clientWidth,u);s(x=>x?{...x,visible:f}:{items:o,visible:f})},[n,o,e]),p.useEffect(()=>{const l=e?.current;if(!l)return;const i=new ResizeObserver(()=>{if(!a.current.length)return;const b=S(l.clientWidth,a.current);s(u=>u?{...u,visible:b}:null)});return i.observe(l),()=>i.disconnect()},[e]),{visibleCount:r?.visible??o,isMeasuring:n}}function Do({value:o,getLabel:e,getId:r}){const{chipsRef:s}=p.useContext(C),{visibleCount:a,isMeasuring:n}=Oo(o.length,s),l=n?o:o.slice(0,a),i=n?0:o.length-a;return t.jsxs(t.Fragment,{children:[l.map(b=>t.jsx(K,{"aria-label":e(b),children:e(b)},r(b))),i>0&&t.jsxs("span",{className:"flex items-center whitespace-nowrap px-1 text-sm text-muted-foreground",children:["+",i," más"]})]})}function Mo(o){if(o==null)return"";if(typeof o=="string"||typeof o=="number")return String(o);if(typeof o=="object"){const e=o;if("label"in e)return String(e.label);if("name"in e)return String(e.name);if("title"in e)return String(e.title)}return String(o)}function Wo(o){if(o==null)return"";if(typeof o=="string"||typeof o=="number")return String(o);if(typeof o=="object"){const e=o;if("id"in e)return String(e.id);if("value"in e)return String(e.value)}return String(o)}function Ao({placeholder:o,showClear:e,startAddon:r,className:s}){return t.jsx(G,{className:s,placeholder:o,showClear:e,startAddon:r})}function Bo({getLabel:o,getId:e,showClear:r,startAddon:s,className:a}){return t.jsxs(H,{className:a,startAddon:s,children:[t.jsx(W,{children:n=>t.jsx(Do,{value:n,getLabel:o,getId:e})}),t.jsx(_,{showTrigger:!r,showClear:r})]})}function Ho(o){const{items:e,getLabel:r,getId:s,renderItem:a,placeholder:n,emptyText:l="Sin resultados.",multiple:i,onValueChange:b,value:u,defaultValue:f,startAddon:x,classNames:h,showClear:R=!0,searchable:U=!0,...X}=o,y=r??Mo,g=s??Wo,v=c=>String(g(c)),j=c=>e.find(m=>v(m)===c)??null,P=p.useRef(!1);if(process.env.NODE_ENV!=="production"&&!P.current){const c=new Set,m=new Set;for(const oo of e){const w=v(oo);c.has(w)&&m.add(w),c.add(w)}m.size>0&&(P.current=!0,console.warn(`[Combobox] Multiple items resolve to the same id (${[...m].join(", ")}). Provide a \`getId\` that returns a unique value per item.`))}const J=i?u?.map(c=>j(String(c))).filter(Boolean):u==null?u:j(String(u)),Y=i?f?.map(c=>j(String(c))).filter(Boolean):f==null?void 0:j(String(f)),Z=c=>{if(i){const m=c??[];b?.(m.map(g),m)}else{const m=c??null;b?.(m?g(m):null,m)}};return t.jsxs(E,{items:e,itemToStringLabel:y,itemToStringValue:g,multiple:i,onValueChange:Z,value:J,defaultValue:Y,isItemEqualToValue:(c,m)=>v(c)===v(m),autoHighlight:!0,loopFocus:!0,...X,children:[i?t.jsx(Bo,{getLabel:y,getId:g,showClear:R,startAddon:x,className:h?.chips}):t.jsx(Ao,{placeholder:n,showClear:R,startAddon:x,className:h?.input}),t.jsxs(O,{className:h?.popup,children:[i&&U&&t.jsx("div",{className:"border-b p-2","data-slot":"combobox-chips-input-wrapper",children:t.jsx(L,{className:h?.chipsInput,placeholder:n})}),t.jsx(M,{className:h?.empty,children:l}),t.jsx(A,{className:h?.list,children:c=>t.jsx(D,{value:c,className:h?.item,children:a?a(c):y(c)},g(c))})]})]})}const Ko=so.useComboboxFilter;exports.Combobox=Ho;exports.ComboboxChip=K;exports.ComboboxChipRemove=Q;exports.ComboboxChips=H;exports.ComboboxChipsInput=L;exports.ComboboxClear=B;exports.ComboboxCollection=Eo;exports.ComboboxContext=C;exports.ComboboxEmpty=M;exports.ComboboxGroup=To;exports.ComboboxGroupLabel=Vo;exports.ComboboxInput=G;exports.ComboboxItem=D;exports.ComboboxList=A;exports.ComboboxPopup=O;exports.ComboboxRoot=E;exports.ComboboxRow=$o;exports.ComboboxSearchInput=Ro;exports.ComboboxSelectTrigger=_o;exports.ComboboxSeparator=Po;exports.ComboboxStatus=ko;exports.ComboboxTrigger=F;exports.ComboboxValue=W;exports.useComboboxFilter=Ko;