@televet/kibble-ui 5.0.26-sc.2 → 5.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{anatomy-BsrdhlLN.js → anatomy-B0LtI6sf.js} +2 -2
- package/dist/chunks/{anatomy-BsrdhlLN.js.map → anatomy-B0LtI6sf.js.map} +1 -1
- package/dist/chunks/{anatomy-ByfITE1W.js → anatomy-DKlFmIC5.js} +11 -11
- package/dist/chunks/{anatomy-ByfITE1W.js.map → anatomy-DKlFmIC5.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-DgR3EqDJ.js → avatarGroup.component-BPhQpVYM.js} +2 -2
- package/dist/chunks/{avatarGroup.component-DgR3EqDJ.js.map → avatarGroup.component-BPhQpVYM.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-CIj4qETQ.js → avatarGroup.component-CJCQSIyr.js} +2 -2
- package/dist/chunks/{avatarGroup.component-CIj4qETQ.js.map → avatarGroup.component-CJCQSIyr.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-ITatUbCf.js → buttonGroup.component-CO5lC36l.js} +2 -2
- package/dist/chunks/{buttonGroup.component-ITatUbCf.js.map → buttonGroup.component-CO5lC36l.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-BDN5oxew.js → buttonGroup.component-pR0mvmm7.js} +2 -2
- package/dist/chunks/{buttonGroup.component-BDN5oxew.js.map → buttonGroup.component-pR0mvmm7.js.map} +1 -1
- package/dist/chunks/calendar.component-6Z5lc-eR.js +2 -0
- package/dist/chunks/calendar.component-6Z5lc-eR.js.map +1 -0
- package/dist/chunks/calendar.component-Dx7c4EIy.js +62 -0
- package/dist/chunks/calendar.component-Dx7c4EIy.js.map +1 -0
- package/dist/chunks/{checkbox.component-CId1KMX3.js → checkbox.component-C132vkan.js} +2 -2
- package/dist/chunks/{checkbox.component-CId1KMX3.js.map → checkbox.component-C132vkan.js.map} +1 -1
- package/dist/chunks/{checkbox.component-2QYi-1Um.js → checkbox.component-DUJCiZr2.js} +2 -2
- package/dist/chunks/{checkbox.component-2QYi-1Um.js.map → checkbox.component-DUJCiZr2.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-7ACU5_4p.js → checkboxGroup.component-2U0ZW1TD.js} +2 -2
- package/dist/chunks/{checkboxGroup.component-7ACU5_4p.js.map → checkboxGroup.component-2U0ZW1TD.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-MS4j5Kq3.js → checkboxGroup.component-DW9qUlSm.js} +3 -3
- package/dist/chunks/{checkboxGroup.component-MS4j5Kq3.js.map → checkboxGroup.component-DW9qUlSm.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-9rv6mttl.js → conversationCard.component-CscMIq51.js} +2 -2
- package/dist/chunks/{conversationCard.component-9rv6mttl.js.map → conversationCard.component-CscMIq51.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-DCLDx0JX.js → conversationCard.component-xIYvp6K5.js} +3 -3
- package/dist/chunks/{conversationCard.component-DCLDx0JX.js.map → conversationCard.component-xIYvp6K5.js.map} +1 -1
- package/dist/chunks/{datePicker.component-Dbxjqbki.js → datePicker.component-BuGpHTzS.js} +2 -2
- package/dist/chunks/{datePicker.component-Dbxjqbki.js.map → datePicker.component-BuGpHTzS.js.map} +1 -1
- package/dist/chunks/{datePicker.component-BkCLLBbA.js → datePicker.component-DeK6pPeC.js} +5 -5
- package/dist/chunks/{datePicker.component-BkCLLBbA.js.map → datePicker.component-DeK6pPeC.js.map} +1 -1
- package/dist/chunks/{datePicker.provider-u-PZcKWc.js → datePicker.provider-C1vLiJEb.js} +6 -6
- package/dist/chunks/{datePicker.provider-u-PZcKWc.js.map → datePicker.provider-C1vLiJEb.js.map} +1 -1
- package/dist/chunks/{datePicker.provider-CclRyVCb.js → datePicker.provider-i35-VNAb.js} +2 -2
- package/dist/chunks/{datePicker.provider-CclRyVCb.js.map → datePicker.provider-i35-VNAb.js.map} +1 -1
- package/dist/chunks/dateTimePicker.component-BwKD6TeU.js +306 -0
- package/dist/chunks/dateTimePicker.component-BwKD6TeU.js.map +1 -0
- package/dist/chunks/dateTimePicker.component-C7SFD9Py.js +2 -0
- package/dist/chunks/dateTimePicker.component-C7SFD9Py.js.map +1 -0
- package/dist/chunks/endOfMonth-ClO3w4vF.js +2 -0
- package/dist/chunks/endOfMonth-ClO3w4vF.js.map +1 -0
- package/dist/chunks/endOfMonth-D0kCU08_.js +19 -0
- package/dist/chunks/endOfMonth-D0kCU08_.js.map +1 -0
- package/dist/chunks/{format-CqTHHSak.js → format-dJJ72A--.js} +3 -3
- package/dist/chunks/{format-CqTHHSak.js.map → format-dJJ72A--.js.map} +1 -1
- package/dist/chunks/isToday-Q8lj3mkM.js +23 -0
- package/dist/chunks/{isToday-iCYsPDMT.js.map → isToday-Q8lj3mkM.js.map} +1 -1
- package/dist/chunks/{menu.component-B-8F68kW.js → menu.component-D2V9Q1Y5.js} +2 -2
- package/dist/chunks/{menu.component-B-8F68kW.js.map → menu.component-D2V9Q1Y5.js.map} +1 -1
- package/dist/chunks/{menu.component-C6x9T6yo.js → menu.component-WHzMw5ZI.js} +3 -3
- package/dist/chunks/{menu.component-C6x9T6yo.js.map → menu.component-WHzMw5ZI.js.map} +1 -1
- package/dist/chunks/{numberInput.component-DbvfT3X-.js → numberInput.component-CRDRjrTH.js} +2 -2
- package/dist/chunks/{numberInput.component-DbvfT3X-.js.map → numberInput.component-CRDRjrTH.js.map} +1 -1
- package/dist/chunks/{numberInput.component-DCqJn2Ct.js → numberInput.component-DGPEz0Fv.js} +2 -2
- package/dist/chunks/{numberInput.component-DCqJn2Ct.js.map → numberInput.component-DGPEz0Fv.js.map} +1 -1
- package/dist/chunks/{pinInput.types-CRndmftA.js → pinInput.types-Can9f1Eu.js} +2 -2
- package/dist/chunks/{pinInput.types-CRndmftA.js.map → pinInput.types-Can9f1Eu.js.map} +1 -1
- package/dist/chunks/{pinInput.types-DqQt83Gy.js → pinInput.types-bIGh7aUS.js} +2 -2
- package/dist/chunks/{pinInput.types-DqQt83Gy.js.map → pinInput.types-bIGh7aUS.js.map} +1 -1
- package/dist/chunks/{popover.component-C9PY02k_.js → popover.component-DIYT1Lc0.js} +2 -2
- package/dist/chunks/{popover.component-C9PY02k_.js.map → popover.component-DIYT1Lc0.js.map} +1 -1
- package/dist/chunks/{popover.component-CiRGriH0.js → popover.component-DTjA1GSd.js} +2 -2
- package/dist/chunks/{popover.component-CiRGriH0.js.map → popover.component-DTjA1GSd.js.map} +1 -1
- package/dist/chunks/{popover.recipe-DhiHO7Ev.js → popover.recipe-CtptsJg6.js} +2 -2
- package/dist/chunks/{popover.recipe-DhiHO7Ev.js.map → popover.recipe-CtptsJg6.js.map} +1 -1
- package/dist/chunks/{popover.recipe-Bg7XkURN.js → popover.recipe-DPwwsWLb.js} +2 -2
- package/dist/chunks/{popover.recipe-Bg7XkURN.js.map → popover.recipe-DPwwsWLb.js.map} +1 -1
- package/dist/chunks/{radioGroup.types-CAXsF2Kb.js → radioGroup.types-DzSpA07h.js} +3 -3
- package/dist/chunks/{radioGroup.types-CAXsF2Kb.js.map → radioGroup.types-DzSpA07h.js.map} +1 -1
- package/dist/chunks/{radioGroup.types-CJ0YVfw_.js → radioGroup.types-U1ep9nrN.js} +2 -2
- package/dist/chunks/{radioGroup.types-CJ0YVfw_.js.map → radioGroup.types-U1ep9nrN.js.map} +1 -1
- package/dist/chunks/{rating.component-BAZbrMUk.js → rating.component-BWBPSEEk.js} +2 -2
- package/dist/chunks/{rating.component-BAZbrMUk.js.map → rating.component-BWBPSEEk.js.map} +1 -1
- package/dist/chunks/{rating.component-zhZb2naU.js → rating.component-DsHkKmA7.js} +2 -2
- package/dist/chunks/{rating.component-zhZb2naU.js.map → rating.component-DsHkKmA7.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-elJxBu6D.js → ratingDots.component-BhWM7kTg.js} +2 -2
- package/dist/chunks/{ratingDots.component-elJxBu6D.js.map → ratingDots.component-BhWM7kTg.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-DdCKYqlJ.js → ratingDots.component-CZ370iI3.js} +2 -2
- package/dist/chunks/{ratingDots.component-DdCKYqlJ.js.map → ratingDots.component-CZ370iI3.js.map} +1 -1
- package/dist/chunks/{select.component-qfwHZeAS.js → select.component-DckP-f8y.js} +3 -3
- package/dist/chunks/{select.component-qfwHZeAS.js.map → select.component-DckP-f8y.js.map} +1 -1
- package/dist/chunks/{select.component-Bz5vEwHi.js → select.component-OrsHXCMz.js} +2 -2
- package/dist/chunks/{select.component-Bz5vEwHi.js.map → select.component-OrsHXCMz.js.map} +1 -1
- package/dist/chunks/{switch.component-BjQDRlc3.js → switch.component-BYEMhBCA.js} +2 -2
- package/dist/chunks/{switch.component-BjQDRlc3.js.map → switch.component-BYEMhBCA.js.map} +1 -1
- package/dist/chunks/{switch.component-B7aBQUCG.js → switch.component-DjN67nap.js} +2 -2
- package/dist/chunks/{switch.component-B7aBQUCG.js.map → switch.component-DjN67nap.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-vtBWiOLi.js → tagBlock.component-B899iqQP.js} +2 -2
- package/dist/chunks/{tagBlock.component-vtBWiOLi.js.map → tagBlock.component-B899iqQP.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-D--q_dqh.js → tagBlock.component-CT7_RyJ-.js} +2 -2
- package/dist/chunks/{tagBlock.component-D--q_dqh.js.map → tagBlock.component-CT7_RyJ-.js.map} +1 -1
- package/dist/chunks/{textInput.component-D3OYUjHL.js → textInput.component-BeiTxTkS.js} +2 -2
- package/dist/chunks/{textInput.component-D3OYUjHL.js.map → textInput.component-BeiTxTkS.js.map} +1 -1
- package/dist/chunks/{textInput.component-Cj9j8DqH.js → textInput.component-CwTc0h_F.js} +2 -2
- package/dist/chunks/{textInput.component-Cj9j8DqH.js.map → textInput.component-CwTc0h_F.js.map} +1 -1
- package/dist/chunks/{textarea.component-DnJ9y2v3.js → textarea.component-BIg_XX_R.js} +2 -2
- package/dist/chunks/{textarea.component-DnJ9y2v3.js.map → textarea.component-BIg_XX_R.js.map} +1 -1
- package/dist/chunks/{textarea.component-Cb3kTPuL.js → textarea.component-C6Wt1Pk8.js} +2 -2
- package/dist/chunks/{textarea.component-Cb3kTPuL.js.map → textarea.component-C6Wt1Pk8.js.map} +1 -1
- package/dist/chunks/theme.provider-C_F9M-W3.js +28 -0
- package/dist/chunks/{theme.provider-CUMlVRCg.js.map → theme.provider-C_F9M-W3.js.map} +1 -1
- package/dist/chunks/{theme.provider-BiwmZ1Gw.js → theme.provider-CtbJ04tc.js} +403 -414
- package/dist/chunks/{theme.provider-BiwmZ1Gw.js.map → theme.provider-CtbJ04tc.js.map} +1 -1
- package/dist/chunks/{timePicker.component-CkYqU0UZ.js → timePicker.component-CsvyXSRc.js} +4 -4
- package/dist/chunks/{timePicker.component-CkYqU0UZ.js.map → timePicker.component-CsvyXSRc.js.map} +1 -1
- package/dist/chunks/{timePicker.component-wuq0ZnAY.js → timePicker.component-D5hw80VV.js} +2 -2
- package/dist/chunks/{timePicker.component-wuq0ZnAY.js.map → timePicker.component-D5hw80VV.js.map} +1 -1
- package/dist/chunks/{timeRange.component-FoG-HHMx.js → timeRange.component-9Bs6kd18.js} +2 -2
- package/dist/chunks/{timeRange.component-FoG-HHMx.js.map → timeRange.component-9Bs6kd18.js.map} +1 -1
- package/dist/chunks/{timeRange.component-4vXrNask.js → timeRange.component-D3Db8lvh.js} +2 -2
- package/dist/chunks/{timeRange.component-4vXrNask.js.map → timeRange.component-D3Db8lvh.js.map} +1 -1
- package/dist/chunks/{timestamp.component-DkLjxUsy.js → timestamp.component-DiZwy6CA.js} +3 -3
- package/dist/chunks/{timestamp.component-DkLjxUsy.js.map → timestamp.component-DiZwy6CA.js.map} +1 -1
- package/dist/chunks/{withFormControl-tp8w4b63.js → withFormControl-DW9A6BSL.js} +25 -24
- package/dist/chunks/{withFormControl-tp8w4b63.js.map → withFormControl-DW9A6BSL.js.map} +1 -1
- package/dist/chunks/{withFormControl-BQWcby9D.js → withFormControl-QV_Jridv.js} +2 -2
- package/dist/chunks/{withFormControl-BQWcby9D.js.map → withFormControl-QV_Jridv.js.map} +1 -1
- package/dist/cjs/components/AvatarGroup/index.cjs +1 -1
- package/dist/cjs/components/ButtonGroup/index.cjs +1 -1
- package/dist/cjs/components/Calendar/index.cjs +1 -1
- package/dist/cjs/components/Checkbox/index.cjs +1 -1
- package/dist/cjs/components/CheckboxGroup/index.cjs +1 -1
- package/dist/cjs/components/ConversationCard/index.cjs +1 -1
- package/dist/cjs/components/DatePicker/index.cjs +1 -1
- package/dist/cjs/components/DateTimePicker/index.cjs +1 -1
- package/dist/cjs/components/Menu/index.cjs +1 -1
- package/dist/cjs/components/NumberInput/index.cjs +1 -1
- package/dist/cjs/components/PinInput/index.cjs +1 -1
- package/dist/cjs/components/Popover/index.cjs +1 -1
- package/dist/cjs/components/RadioGroup/index.cjs +1 -1
- package/dist/cjs/components/Rating/index.cjs +1 -1
- package/dist/cjs/components/RatingDots/index.cjs +1 -1
- package/dist/cjs/components/Select/index.cjs +1 -1
- package/dist/cjs/components/Switch/index.cjs +1 -1
- package/dist/cjs/components/TagBlock/index.cjs +1 -1
- package/dist/cjs/components/TextInput/index.cjs +1 -1
- package/dist/cjs/components/Textarea/index.cjs +1 -1
- package/dist/cjs/components/TimePicker/index.cjs +1 -1
- package/dist/cjs/components/TimeRange/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/theme/index.cjs +1 -1
- package/dist/esm/cli/generate-theme-types.js +0 -0
- package/dist/esm/cli/postinstall.js +0 -0
- package/dist/esm/components/AvatarGroup/index.js +1 -1
- package/dist/esm/components/ButtonGroup/index.js +1 -1
- package/dist/esm/components/Calendar/index.js +4 -2
- package/dist/esm/components/Checkbox/index.js +1 -1
- package/dist/esm/components/CheckboxGroup/index.js +1 -1
- package/dist/esm/components/ConversationCard/index.js +1 -1
- package/dist/esm/components/DatePicker/index.js +2 -2
- package/dist/esm/components/DateTimePicker/index.js +1 -1
- package/dist/esm/components/Menu/index.js +1 -1
- package/dist/esm/components/NumberInput/index.js +1 -1
- package/dist/esm/components/PinInput/index.js +1 -1
- package/dist/esm/components/Popover/index.js +1 -1
- package/dist/esm/components/RadioGroup/index.js +1 -1
- package/dist/esm/components/Rating/index.js +1 -1
- package/dist/esm/components/RatingDots/index.js +1 -1
- package/dist/esm/components/Select/index.js +1 -1
- package/dist/esm/components/Switch/index.js +1 -1
- package/dist/esm/components/TagBlock/index.js +1 -1
- package/dist/esm/components/TextInput/index.js +1 -1
- package/dist/esm/components/Textarea/index.js +1 -1
- package/dist/esm/components/TimePicker/index.js +1 -1
- package/dist/esm/components/TimeRange/index.js +1 -1
- package/dist/esm/components/Timestamp/index.js +1 -1
- package/dist/esm/components/index.js +126 -124
- package/dist/esm/index.js +154 -153
- package/dist/esm/theme/index.js +4 -5
- package/dist/types/components/Calendar/calendar.component.d.ts +19 -1
- package/dist/types/components/Calendar/calendar.utils.d.ts +3 -0
- package/dist/types/components/Calendar/calendarFooterButton.component.d.ts +31 -0
- package/dist/types/components/Calendar/calendarTodayButton.component.d.ts +10 -0
- package/dist/types/components/Calendar/index.d.ts +2 -0
- package/dist/types/theme/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/chunks/calendar.component-D-1uis5P.js +0 -18
- package/dist/chunks/calendar.component-D-1uis5P.js.map +0 -1
- package/dist/chunks/calendar.component-zZHTvsvc.js +0 -2
- package/dist/chunks/calendar.component-zZHTvsvc.js.map +0 -1
- package/dist/chunks/dateTimePicker.component-49q0KN3k.js +0 -2
- package/dist/chunks/dateTimePicker.component-49q0KN3k.js.map +0 -1
- package/dist/chunks/dateTimePicker.component-jPa4WzsR.js +0 -317
- package/dist/chunks/dateTimePicker.component-jPa4WzsR.js.map +0 -1
- package/dist/chunks/isToday-iCYsPDMT.js +0 -23
- package/dist/chunks/theme.provider-CUMlVRCg.js +0 -28
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anatomy-ByfITE1W.js","sources":["../../node_modules/@zag-js/combobox/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/fieldset/fieldset.anatomy.js","../../node_modules/@chakra-ui/react/dist/esm/anatomy.js"],"sourcesContent":["import { createAnatomy } from '@zag-js/anatomy';\nimport { ListCollection } from '@zag-js/collection';\nimport { raf, setCaretToEnd, nextTick, scrollIntoView, observeAttributes, clickIfLink, query, dataAttr, ariaAttr, isDownloadingEvent, isOpeningInNewTab, isContextMenuEvent, isLeftClick, getEventKey, isComposingEvent, isAnchorElement } from '@zag-js/dom-query';\nimport { getPlacement, getPlacementStyles } from '@zag-js/popper';\nimport { match, remove, addOrRemove, isBoolean, isEqual, createSplitProps, ensure } from '@zag-js/utils';\nimport { ariaHidden } from '@zag-js/aria-hidden';\nimport { setup } from '@zag-js/core';\nimport { trackDismissableElement } from '@zag-js/dismissable';\nimport { createProps } from '@zag-js/types';\n\n// src/combobox.anatomy.ts\nvar anatomy = createAnatomy(\"combobox\").parts(\n \"root\",\n \"clearTrigger\",\n \"content\",\n \"control\",\n \"input\",\n \"item\",\n \"itemGroup\",\n \"itemGroupLabel\",\n \"itemIndicator\",\n \"itemText\",\n \"label\",\n \"list\",\n \"positioner\",\n \"trigger\"\n);\nvar parts = anatomy.build();\nvar collection = (options) => {\n return new ListCollection(options);\n};\ncollection.empty = () => {\n return new ListCollection({ items: [] });\n};\nvar getRootId = (ctx) => ctx.ids?.root ?? `combobox:${ctx.id}`;\nvar getLabelId = (ctx) => ctx.ids?.label ?? `combobox:${ctx.id}:label`;\nvar getControlId = (ctx) => ctx.ids?.control ?? `combobox:${ctx.id}:control`;\nvar getInputId = (ctx) => ctx.ids?.input ?? `combobox:${ctx.id}:input`;\nvar getContentId = (ctx) => ctx.ids?.content ?? `combobox:${ctx.id}:content`;\nvar getPositionerId = (ctx) => ctx.ids?.positioner ?? `combobox:${ctx.id}:popper`;\nvar getTriggerId = (ctx) => ctx.ids?.trigger ?? `combobox:${ctx.id}:toggle-btn`;\nvar getClearTriggerId = (ctx) => ctx.ids?.clearTrigger ?? `combobox:${ctx.id}:clear-btn`;\nvar getItemGroupId = (ctx, id) => ctx.ids?.itemGroup?.(id) ?? `combobox:${ctx.id}:optgroup:${id}`;\nvar getItemGroupLabelId = (ctx, id) => ctx.ids?.itemGroupLabel?.(id) ?? `combobox:${ctx.id}:optgroup-label:${id}`;\nvar getItemId = (ctx, id) => ctx.ids?.item?.(id) ?? `combobox:${ctx.id}:option:${id}`;\nvar getContentEl = (ctx) => ctx.getById(getContentId(ctx));\nvar getInputEl = (ctx) => ctx.getById(getInputId(ctx));\nvar getPositionerEl = (ctx) => ctx.getById(getPositionerId(ctx));\nvar getControlEl = (ctx) => ctx.getById(getControlId(ctx));\nvar getTriggerEl = (ctx) => ctx.getById(getTriggerId(ctx));\nvar getClearTriggerEl = (ctx) => ctx.getById(getClearTriggerId(ctx));\nvar getItemEl = (ctx, value) => {\n if (value == null) return;\n const selector = `[role=option][data-value=\"${CSS.escape(value)}\"]`;\n return query(getContentEl(ctx), selector);\n};\nvar focusInputEl = (ctx) => {\n const inputEl = getInputEl(ctx);\n if (ctx.isActiveElement(inputEl)) return;\n inputEl?.focus({ preventScroll: true });\n};\nvar focusTriggerEl = (ctx) => {\n const triggerEl = getTriggerEl(ctx);\n if (ctx.isActiveElement(triggerEl)) return;\n triggerEl?.focus({ preventScroll: true });\n};\n\n// src/combobox.connect.ts\nfunction connect(service, normalize) {\n const { context, prop, state, send, scope, computed, event } = service;\n const translations = prop(\"translations\");\n const collection2 = prop(\"collection\");\n const disabled = prop(\"disabled\");\n const interactive = computed(\"isInteractive\");\n const invalid = prop(\"invalid\");\n const readOnly = prop(\"readOnly\");\n const open = state.hasTag(\"open\");\n const focused = state.hasTag(\"focused\");\n const composite = prop(\"composite\");\n const highlightedValue = context.get(\"highlightedValue\");\n const popperStyles = getPlacementStyles({\n ...prop(\"positioning\"),\n placement: context.get(\"currentPlacement\")\n });\n function getItemState(props2) {\n const disabled2 = collection2.getItemDisabled(props2.item);\n const value = collection2.getItemValue(props2.item);\n ensure(value, () => `[zag-js] No value found for item ${JSON.stringify(props2.item)}`);\n return {\n value,\n disabled: Boolean(disabled2 || disabled2),\n highlighted: highlightedValue === value,\n selected: context.get(\"value\").includes(value)\n };\n }\n return {\n focused,\n open,\n inputValue: context.get(\"inputValue\"),\n highlightedValue,\n highlightedItem: context.get(\"highlightedItem\"),\n value: context.get(\"value\"),\n valueAsString: computed(\"valueAsString\"),\n hasSelectedItems: computed(\"hasSelectedItems\"),\n selectedItems: context.get(\"selectedItems\"),\n collection: prop(\"collection\"),\n multiple: !!prop(\"multiple\"),\n disabled: !!disabled,\n syncSelectedItems() {\n send({ type: \"SELECTED_ITEMS.SYNC\" });\n },\n reposition(options = {}) {\n send({ type: \"POSITIONING.SET\", options });\n },\n setHighlightValue(value) {\n send({ type: \"HIGHLIGHTED_VALUE.SET\", value });\n },\n clearHighlightValue() {\n send({ type: \"HIGHLIGHTED_VALUE.CLEAR\" });\n },\n selectValue(value) {\n send({ type: \"ITEM.SELECT\", value });\n },\n setValue(value) {\n send({ type: \"VALUE.SET\", value });\n },\n setInputValue(value, reason = \"script\") {\n send({ type: \"INPUT_VALUE.SET\", value, src: reason });\n },\n clearValue(value) {\n if (value != null) {\n send({ type: \"ITEM.CLEAR\", value });\n } else {\n send({ type: \"VALUE.CLEAR\" });\n }\n },\n focus() {\n getInputEl(scope)?.focus();\n },\n setOpen(nextOpen, reason = \"script\") {\n const open2 = state.hasTag(\"open\");\n if (open2 === nextOpen) return;\n send({ type: nextOpen ? \"OPEN\" : \"CLOSE\", src: reason });\n },\n getRootProps() {\n return normalize.element({\n ...parts.root.attrs,\n dir: prop(\"dir\"),\n id: getRootId(scope),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly)\n });\n },\n getLabelProps() {\n return normalize.label({\n ...parts.label.attrs,\n dir: prop(\"dir\"),\n htmlFor: getInputId(scope),\n id: getLabelId(scope),\n \"data-readonly\": dataAttr(readOnly),\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-focus\": dataAttr(focused),\n onClick(event2) {\n if (composite) return;\n event2.preventDefault();\n getTriggerEl(scope)?.focus({ preventScroll: true });\n }\n });\n },\n getControlProps() {\n return normalize.element({\n ...parts.control.attrs,\n dir: prop(\"dir\"),\n id: getControlId(scope),\n \"data-state\": open ? \"open\" : \"closed\",\n \"data-focus\": dataAttr(focused),\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid)\n });\n },\n getPositionerProps() {\n return normalize.element({\n ...parts.positioner.attrs,\n dir: prop(\"dir\"),\n id: getPositionerId(scope),\n style: popperStyles.floating\n });\n },\n getInputProps() {\n return normalize.input({\n ...parts.input.attrs,\n dir: prop(\"dir\"),\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n \"data-autofocus\": dataAttr(prop(\"autoFocus\")),\n name: prop(\"name\"),\n form: prop(\"form\"),\n disabled,\n required: prop(\"required\"),\n autoComplete: \"off\",\n autoCorrect: \"off\",\n autoCapitalize: \"none\",\n spellCheck: \"false\",\n readOnly,\n placeholder: prop(\"placeholder\"),\n id: getInputId(scope),\n type: \"text\",\n role: \"combobox\",\n defaultValue: context.get(\"inputValue\"),\n \"aria-autocomplete\": computed(\"autoComplete\") ? \"both\" : \"list\",\n \"aria-controls\": getContentId(scope),\n \"aria-expanded\": open,\n \"data-state\": open ? \"open\" : \"closed\",\n \"aria-activedescendant\": highlightedValue ? getItemId(scope, highlightedValue) : void 0,\n onClick(event2) {\n if (event2.defaultPrevented) return;\n if (!prop(\"openOnClick\")) return;\n if (!interactive) return;\n send({ type: \"INPUT.CLICK\", src: \"input-click\" });\n },\n onFocus() {\n if (disabled) return;\n send({ type: \"INPUT.FOCUS\" });\n },\n onBlur() {\n if (disabled) return;\n send({ type: \"INPUT.BLUR\" });\n },\n onChange(event2) {\n send({ type: \"INPUT.CHANGE\", value: event2.currentTarget.value, src: \"input-change\" });\n },\n onKeyDown(event2) {\n if (event2.defaultPrevented) return;\n if (!interactive) return;\n if (event2.ctrlKey || event2.shiftKey || isComposingEvent(event2)) return;\n const openOnKeyPress = prop(\"openOnKeyPress\");\n const isModifierKey = event2.ctrlKey || event2.metaKey || event2.shiftKey;\n const keypress = true;\n const keymap = {\n ArrowDown(event3) {\n if (!openOnKeyPress && !open) return;\n send({ type: event3.altKey ? \"OPEN\" : \"INPUT.ARROW_DOWN\", keypress, src: \"arrow-key\" });\n event3.preventDefault();\n },\n ArrowUp() {\n if (!openOnKeyPress && !open) return;\n send({ type: event2.altKey ? \"CLOSE\" : \"INPUT.ARROW_UP\", keypress, src: \"arrow-key\" });\n event2.preventDefault();\n },\n Home(event3) {\n if (isModifierKey) return;\n send({ type: \"INPUT.HOME\", keypress });\n if (open) {\n event3.preventDefault();\n }\n },\n End(event3) {\n if (isModifierKey) return;\n send({ type: \"INPUT.END\", keypress });\n if (open) {\n event3.preventDefault();\n }\n },\n Enter(event3) {\n send({ type: \"INPUT.ENTER\", keypress, src: \"item-select\" });\n const submittable = computed(\"isCustomValue\") && prop(\"allowCustomValue\");\n if (open && !submittable) {\n event3.preventDefault();\n }\n if (highlightedValue == null) return;\n const itemEl = getItemEl(scope, highlightedValue);\n if (isAnchorElement(itemEl)) {\n prop(\"navigate\")?.({ value: highlightedValue, node: itemEl, href: itemEl.href });\n }\n },\n Escape() {\n send({ type: \"INPUT.ESCAPE\", keypress, src: \"escape-key\" });\n event2.preventDefault();\n }\n };\n const key = getEventKey(event2, { dir: prop(\"dir\") });\n const exec = keymap[key];\n exec?.(event2);\n }\n });\n },\n getTriggerProps(props2 = {}) {\n return normalize.button({\n ...parts.trigger.attrs,\n dir: prop(\"dir\"),\n id: getTriggerId(scope),\n \"aria-haspopup\": composite ? \"listbox\" : \"dialog\",\n type: \"button\",\n tabIndex: props2.focusable ? void 0 : -1,\n \"aria-label\": translations.triggerLabel,\n \"aria-expanded\": open,\n \"data-state\": open ? \"open\" : \"closed\",\n \"aria-controls\": open ? getContentId(scope) : void 0,\n disabled,\n \"data-invalid\": dataAttr(invalid),\n \"data-focusable\": dataAttr(props2.focusable),\n \"data-readonly\": dataAttr(readOnly),\n \"data-disabled\": dataAttr(disabled),\n onFocus() {\n if (!props2.focusable) return;\n send({ type: \"INPUT.FOCUS\", src: \"trigger\" });\n },\n onClick(event2) {\n if (event2.defaultPrevented) return;\n if (!interactive) return;\n if (!isLeftClick(event2)) return;\n send({ type: \"TRIGGER.CLICK\", src: \"trigger-click\" });\n },\n onPointerDown(event2) {\n if (!interactive) return;\n if (event2.pointerType === \"touch\") return;\n if (!isLeftClick(event2)) return;\n event2.preventDefault();\n queueMicrotask(() => {\n getInputEl(scope)?.focus({ preventScroll: true });\n });\n },\n onKeyDown(event2) {\n if (event2.defaultPrevented) return;\n if (composite) return;\n const keyMap = {\n ArrowDown() {\n send({ type: \"INPUT.ARROW_DOWN\", src: \"arrow-key\" });\n },\n ArrowUp() {\n send({ type: \"INPUT.ARROW_UP\", src: \"arrow-key\" });\n }\n };\n const key = getEventKey(event2, { dir: prop(\"dir\") });\n const exec = keyMap[key];\n if (exec) {\n exec(event2);\n event2.preventDefault();\n }\n }\n });\n },\n getContentProps() {\n return normalize.element({\n ...parts.content.attrs,\n dir: prop(\"dir\"),\n id: getContentId(scope),\n role: !composite ? \"dialog\" : \"listbox\",\n tabIndex: -1,\n hidden: !open,\n \"data-state\": open ? \"open\" : \"closed\",\n \"data-placement\": context.get(\"currentPlacement\"),\n \"aria-labelledby\": getLabelId(scope),\n \"aria-multiselectable\": prop(\"multiple\") && composite ? true : void 0,\n \"data-empty\": dataAttr(collection2.size === 0),\n onPointerDown(event2) {\n if (!isLeftClick(event2)) return;\n event2.preventDefault();\n }\n });\n },\n getListProps() {\n return normalize.element({\n ...parts.list.attrs,\n role: !composite ? \"listbox\" : void 0,\n \"data-empty\": dataAttr(collection2.size === 0),\n \"aria-labelledby\": getLabelId(scope),\n \"aria-multiselectable\": prop(\"multiple\") && !composite ? true : void 0\n });\n },\n getClearTriggerProps() {\n return normalize.button({\n ...parts.clearTrigger.attrs,\n dir: prop(\"dir\"),\n id: getClearTriggerId(scope),\n type: \"button\",\n tabIndex: -1,\n disabled,\n \"data-invalid\": dataAttr(invalid),\n \"aria-label\": translations.clearTriggerLabel,\n \"aria-controls\": getInputId(scope),\n hidden: !context.get(\"value\").length,\n onPointerDown(event2) {\n if (!isLeftClick(event2)) return;\n event2.preventDefault();\n },\n onClick(event2) {\n if (event2.defaultPrevented) return;\n if (!interactive) return;\n send({ type: \"VALUE.CLEAR\", src: \"clear-trigger\" });\n }\n });\n },\n getItemState,\n getItemProps(props2) {\n const itemState = getItemState(props2);\n const value = itemState.value;\n return normalize.element({\n ...parts.item.attrs,\n dir: prop(\"dir\"),\n id: getItemId(scope, value),\n role: \"option\",\n tabIndex: -1,\n \"data-highlighted\": dataAttr(itemState.highlighted),\n \"data-state\": itemState.selected ? \"checked\" : \"unchecked\",\n \"aria-selected\": ariaAttr(itemState.highlighted),\n \"aria-disabled\": ariaAttr(itemState.disabled),\n \"data-disabled\": dataAttr(itemState.disabled),\n \"data-value\": itemState.value,\n onPointerMove() {\n if (itemState.disabled) return;\n if (itemState.highlighted) return;\n send({ type: \"ITEM.POINTER_MOVE\", value });\n },\n onPointerLeave() {\n if (props2.persistFocus) return;\n if (itemState.disabled) return;\n const prev = event.previous();\n const mouseMoved = prev?.type.includes(\"POINTER\");\n if (!mouseMoved) return;\n send({ type: \"ITEM.POINTER_LEAVE\", value });\n },\n onClick(event2) {\n if (isDownloadingEvent(event2)) return;\n if (isOpeningInNewTab(event2)) return;\n if (isContextMenuEvent(event2)) return;\n if (itemState.disabled) return;\n send({ type: \"ITEM.CLICK\", src: \"item-select\", value });\n }\n });\n },\n getItemTextProps(props2) {\n const itemState = getItemState(props2);\n return normalize.element({\n ...parts.itemText.attrs,\n dir: prop(\"dir\"),\n \"data-state\": itemState.selected ? \"checked\" : \"unchecked\",\n \"data-disabled\": dataAttr(itemState.disabled),\n \"data-highlighted\": dataAttr(itemState.highlighted)\n });\n },\n getItemIndicatorProps(props2) {\n const itemState = getItemState(props2);\n return normalize.element({\n \"aria-hidden\": true,\n ...parts.itemIndicator.attrs,\n dir: prop(\"dir\"),\n \"data-state\": itemState.selected ? \"checked\" : \"unchecked\",\n hidden: !itemState.selected\n });\n },\n getItemGroupProps(props2) {\n const { id } = props2;\n return normalize.element({\n ...parts.itemGroup.attrs,\n dir: prop(\"dir\"),\n id: getItemGroupId(scope, id),\n \"aria-labelledby\": getItemGroupLabelId(scope, id),\n \"data-empty\": dataAttr(collection2.size === 0),\n role: \"group\"\n });\n },\n getItemGroupLabelProps(props2) {\n const { htmlFor } = props2;\n return normalize.element({\n ...parts.itemGroupLabel.attrs,\n dir: prop(\"dir\"),\n id: getItemGroupLabelId(scope, htmlFor),\n role: \"presentation\"\n });\n }\n };\n}\nvar { guards, createMachine, choose } = setup();\nvar { and, not } = guards;\nvar machine = createMachine({\n props({ props: props2 }) {\n return {\n loopFocus: true,\n openOnClick: false,\n defaultValue: [],\n closeOnSelect: !props2.multiple,\n allowCustomValue: false,\n inputBehavior: \"none\",\n selectionBehavior: props2.multiple ? \"clear\" : \"replace\",\n openOnKeyPress: true,\n openOnChange: true,\n composite: true,\n navigate({ node }) {\n clickIfLink(node);\n },\n collection: collection.empty(),\n ...props2,\n positioning: {\n placement: \"bottom\",\n sameWidth: true,\n ...props2.positioning\n },\n translations: {\n triggerLabel: \"Toggle suggestions\",\n clearTriggerLabel: \"Clear value\",\n ...props2.translations\n }\n };\n },\n initialState({ prop }) {\n const open = prop(\"open\") || prop(\"defaultOpen\");\n return open ? \"suggesting\" : \"idle\";\n },\n context({ prop, bindable, getContext, getEvent }) {\n return {\n currentPlacement: bindable(() => ({\n defaultValue: void 0\n })),\n value: bindable(() => ({\n defaultValue: prop(\"defaultValue\"),\n value: prop(\"value\"),\n isEqual,\n hash(value) {\n return value.join(\",\");\n },\n onChange(value) {\n const context = getContext();\n const prevSelectedItems = context.get(\"selectedItems\");\n const collection2 = prop(\"collection\");\n const nextItems = value.map((v) => {\n const item = prevSelectedItems.find((item2) => collection2.getItemValue(item2) === v);\n return item || collection2.find(v);\n });\n context.set(\"selectedItems\", nextItems);\n prop(\"onValueChange\")?.({ value, items: nextItems });\n }\n })),\n highlightedValue: bindable(() => ({\n defaultValue: prop(\"defaultHighlightedValue\") || null,\n value: prop(\"highlightedValue\"),\n onChange(value) {\n const item = prop(\"collection\").find(value);\n prop(\"onHighlightChange\")?.({ highlightedValue: value, highlightedItem: item });\n }\n })),\n inputValue: bindable(() => {\n let inputValue = prop(\"inputValue\") || prop(\"defaultInputValue\") || \"\";\n const value = prop(\"defaultValue\") || prop(\"value\") || [];\n if (!inputValue.trim() && !prop(\"multiple\")) {\n const valueAsString = prop(\"collection\").stringifyMany(value);\n inputValue = match(prop(\"selectionBehavior\"), {\n preserve: inputValue || valueAsString,\n replace: valueAsString,\n clear: \"\"\n });\n }\n return {\n defaultValue: inputValue,\n value: prop(\"inputValue\"),\n onChange(value2) {\n const event = getEvent();\n const reason = (event.previousEvent || event).src;\n prop(\"onInputValueChange\")?.({ inputValue: value2, reason });\n }\n };\n }),\n highlightedItem: bindable(() => {\n const highlightedValue = prop(\"highlightedValue\");\n const highlightedItem = prop(\"collection\").find(highlightedValue);\n return { defaultValue: highlightedItem };\n }),\n selectedItems: bindable(() => {\n const value = prop(\"value\") || prop(\"defaultValue\") || [];\n const selectedItems = prop(\"collection\").findMany(value);\n return { defaultValue: selectedItems };\n })\n };\n },\n computed: {\n isInputValueEmpty: ({ context }) => context.get(\"inputValue\").length === 0,\n isInteractive: ({ prop }) => !(prop(\"readOnly\") || prop(\"disabled\")),\n autoComplete: ({ prop }) => prop(\"inputBehavior\") === \"autocomplete\",\n autoHighlight: ({ prop }) => prop(\"inputBehavior\") === \"autohighlight\",\n hasSelectedItems: ({ context }) => context.get(\"value\").length > 0,\n valueAsString: ({ context, prop }) => prop(\"collection\").stringifyItems(context.get(\"selectedItems\")),\n isCustomValue: ({ context, computed }) => context.get(\"inputValue\") !== computed(\"valueAsString\")\n },\n watch({ context, prop, track, action, send }) {\n track([() => context.hash(\"value\")], () => {\n action([\"syncSelectedItems\"]);\n });\n track([() => context.get(\"inputValue\")], () => {\n action([\"syncInputValue\"]);\n });\n track([() => context.get(\"highlightedValue\")], () => {\n action([\"syncHighlightedItem\", \"autofillInputValue\"]);\n });\n track([() => prop(\"open\")], () => {\n action([\"toggleVisibility\"]);\n });\n track([() => prop(\"collection\").toString()], () => {\n send({ type: \"CHILDREN_CHANGE\" });\n });\n },\n on: {\n \"SELECTED_ITEMS.SYNC\": {\n actions: [\"syncSelectedItems\"]\n },\n \"HIGHLIGHTED_VALUE.SET\": {\n actions: [\"setHighlightedValue\"]\n },\n \"HIGHLIGHTED_VALUE.CLEAR\": {\n actions: [\"clearHighlightedValue\"]\n },\n \"ITEM.SELECT\": {\n actions: [\"selectItem\"]\n },\n \"ITEM.CLEAR\": {\n actions: [\"clearItem\"]\n },\n \"VALUE.SET\": {\n actions: [\"setValue\"]\n },\n \"INPUT_VALUE.SET\": {\n actions: [\"setInputValue\"]\n },\n \"POSITIONING.SET\": {\n actions: [\"reposition\"]\n }\n },\n entry: choose([\n {\n guard: \"autoFocus\",\n actions: [\"setInitialFocus\"]\n }\n ]),\n states: {\n idle: {\n tags: [\"idle\", \"closed\"],\n entry: [\"scrollContentToTop\", \"clearHighlightedValue\"],\n on: {\n \"CONTROLLED.OPEN\": {\n target: \"interacting\"\n },\n \"TRIGGER.CLICK\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"setInitialFocus\", \"highlightFirstSelectedItem\", \"invokeOnOpen\"]\n },\n {\n target: \"interacting\",\n actions: [\"setInitialFocus\", \"highlightFirstSelectedItem\", \"invokeOnOpen\"]\n }\n ],\n \"INPUT.CLICK\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"highlightFirstSelectedItem\", \"invokeOnOpen\"]\n },\n {\n target: \"interacting\",\n actions: [\"highlightFirstSelectedItem\", \"invokeOnOpen\"]\n }\n ],\n \"INPUT.FOCUS\": {\n target: \"focused\"\n },\n OPEN: [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnOpen\"]\n },\n {\n target: \"interacting\",\n actions: [\"invokeOnOpen\"]\n }\n ],\n \"VALUE.CLEAR\": {\n target: \"focused\",\n actions: [\"clearInputValue\", \"clearSelectedItems\", \"setInitialFocus\"]\n }\n }\n },\n focused: {\n tags: [\"focused\", \"closed\"],\n entry: [\"scrollContentToTop\", \"clearHighlightedValue\"],\n on: {\n \"CONTROLLED.OPEN\": [\n {\n guard: \"isChangeEvent\",\n target: \"suggesting\"\n },\n {\n target: \"interacting\"\n }\n ],\n \"INPUT.CHANGE\": [\n {\n guard: and(\"isOpenControlled\", \"openOnChange\"),\n actions: [\"setInputValue\", \"invokeOnOpen\", \"highlightFirstItemIfNeeded\"]\n },\n {\n guard: \"openOnChange\",\n target: \"suggesting\",\n actions: [\"setInputValue\", \"invokeOnOpen\", \"highlightFirstItemIfNeeded\"]\n },\n {\n actions: [\"setInputValue\"]\n }\n ],\n \"LAYER.INTERACT_OUTSIDE\": {\n target: \"idle\"\n },\n \"INPUT.ESCAPE\": {\n guard: and(\"isCustomValue\", not(\"allowCustomValue\")),\n actions: [\"revertInputValue\"]\n },\n \"INPUT.BLUR\": {\n target: \"idle\"\n },\n \"INPUT.CLICK\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"highlightFirstSelectedItem\", \"invokeOnOpen\"]\n },\n {\n target: \"interacting\",\n actions: [\"highlightFirstSelectedItem\", \"invokeOnOpen\"]\n }\n ],\n \"TRIGGER.CLICK\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"setInitialFocus\", \"highlightFirstSelectedItem\", \"invokeOnOpen\"]\n },\n {\n target: \"interacting\",\n actions: [\"setInitialFocus\", \"highlightFirstSelectedItem\", \"invokeOnOpen\"]\n }\n ],\n \"INPUT.ARROW_DOWN\": [\n // == group 1 ==\n {\n guard: and(\"isOpenControlled\", \"autoComplete\"),\n actions: [\"invokeOnOpen\"]\n },\n {\n guard: \"autoComplete\",\n target: \"interacting\",\n actions: [\"invokeOnOpen\"]\n },\n // == group 2 ==\n {\n guard: \"isOpenControlled\",\n actions: [\"highlightFirstOrSelectedItem\", \"invokeOnOpen\"]\n },\n {\n target: \"interacting\",\n actions: [\"highlightFirstOrSelectedItem\", \"invokeOnOpen\"]\n }\n ],\n \"INPUT.ARROW_UP\": [\n // == group 1 ==\n {\n guard: \"autoComplete\",\n target: \"interacting\",\n actions: [\"invokeOnOpen\"]\n },\n {\n guard: \"autoComplete\",\n target: \"interacting\",\n actions: [\"invokeOnOpen\"]\n },\n // == group 2 ==\n {\n target: \"interacting\",\n actions: [\"highlightLastOrSelectedItem\", \"invokeOnOpen\"]\n },\n {\n target: \"interacting\",\n actions: [\"highlightLastOrSelectedItem\", \"invokeOnOpen\"]\n }\n ],\n OPEN: [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnOpen\"]\n },\n {\n target: \"interacting\",\n actions: [\"invokeOnOpen\"]\n }\n ],\n \"VALUE.CLEAR\": {\n actions: [\"clearInputValue\", \"clearSelectedItems\"]\n }\n }\n },\n interacting: {\n tags: [\"open\", \"focused\"],\n entry: [\"setInitialFocus\"],\n effects: [\"scrollToHighlightedItem\", \"trackDismissableLayer\", \"trackPlacement\", \"hideOtherElements\"],\n on: {\n \"CONTROLLED.CLOSE\": [\n {\n guard: \"restoreFocus\",\n target: \"focused\",\n actions: [\"setFinalFocus\"]\n },\n {\n target: \"idle\"\n }\n ],\n CHILDREN_CHANGE: [\n {\n guard: \"isHighlightedItemRemoved\",\n actions: [\"clearHighlightedValue\"]\n },\n {\n actions: [\"scrollToHighlightedItem\"]\n }\n ],\n \"INPUT.HOME\": {\n actions: [\"highlightFirstItem\"]\n },\n \"INPUT.END\": {\n actions: [\"highlightLastItem\"]\n },\n \"INPUT.ARROW_DOWN\": [\n {\n guard: and(\"autoComplete\", \"isLastItemHighlighted\"),\n actions: [\"clearHighlightedValue\", \"scrollContentToTop\"]\n },\n {\n actions: [\"highlightNextItem\"]\n }\n ],\n \"INPUT.ARROW_UP\": [\n {\n guard: and(\"autoComplete\", \"isFirstItemHighlighted\"),\n actions: [\"clearHighlightedValue\"]\n },\n {\n actions: [\"highlightPrevItem\"]\n }\n ],\n \"INPUT.ENTER\": [\n // == group 1 ==\n {\n guard: and(\"isOpenControlled\", \"isCustomValue\", not(\"hasHighlightedItem\"), not(\"allowCustomValue\")),\n actions: [\"revertInputValue\", \"invokeOnClose\"]\n },\n {\n guard: and(\"isCustomValue\", not(\"hasHighlightedItem\"), not(\"allowCustomValue\")),\n target: \"focused\",\n actions: [\"revertInputValue\", \"invokeOnClose\"]\n },\n // == group 2 ==\n {\n guard: and(\"isOpenControlled\", \"closeOnSelect\"),\n actions: [\"selectHighlightedItem\", \"invokeOnClose\"]\n },\n {\n guard: \"closeOnSelect\",\n target: \"focused\",\n actions: [\"selectHighlightedItem\", \"invokeOnClose\", \"setFinalFocus\"]\n },\n {\n actions: [\"selectHighlightedItem\"]\n }\n ],\n \"INPUT.CHANGE\": [\n {\n guard: \"autoComplete\",\n target: \"suggesting\",\n actions: [\"setInputValue\"]\n },\n {\n target: \"suggesting\",\n actions: [\"clearHighlightedValue\", \"setInputValue\"]\n }\n ],\n \"ITEM.POINTER_MOVE\": {\n actions: [\"setHighlightedValue\"]\n },\n \"ITEM.POINTER_LEAVE\": {\n actions: [\"clearHighlightedValue\"]\n },\n \"ITEM.CLICK\": [\n {\n guard: and(\"isOpenControlled\", \"closeOnSelect\"),\n actions: [\"selectItem\", \"invokeOnClose\"]\n },\n {\n guard: \"closeOnSelect\",\n target: \"focused\",\n actions: [\"selectItem\", \"invokeOnClose\", \"setFinalFocus\"]\n },\n {\n actions: [\"selectItem\"]\n }\n ],\n \"LAYER.ESCAPE\": [\n {\n guard: and(\"isOpenControlled\", \"autoComplete\"),\n actions: [\"syncInputValue\", \"invokeOnClose\"]\n },\n {\n guard: \"autoComplete\",\n target: \"focused\",\n actions: [\"syncInputValue\", \"invokeOnClose\"]\n },\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"focused\",\n actions: [\"invokeOnClose\", \"setFinalFocus\"]\n }\n ],\n \"TRIGGER.CLICK\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"focused\",\n actions: [\"invokeOnClose\"]\n }\n ],\n \"LAYER.INTERACT_OUTSIDE\": [\n // == group 1 ==\n {\n guard: and(\"isOpenControlled\", \"isCustomValue\", not(\"allowCustomValue\")),\n actions: [\"revertInputValue\", \"invokeOnClose\"]\n },\n {\n guard: and(\"isCustomValue\", not(\"allowCustomValue\")),\n target: \"idle\",\n actions: [\"revertInputValue\", \"invokeOnClose\"]\n },\n // == group 2 ==\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"idle\",\n actions: [\"invokeOnClose\"]\n }\n ],\n CLOSE: [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"focused\",\n actions: [\"invokeOnClose\", \"setFinalFocus\"]\n }\n ],\n \"VALUE.CLEAR\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"clearInputValue\", \"clearSelectedItems\", \"invokeOnClose\"]\n },\n {\n target: \"focused\",\n actions: [\"clearInputValue\", \"clearSelectedItems\", \"invokeOnClose\", \"setFinalFocus\"]\n }\n ]\n }\n },\n suggesting: {\n tags: [\"open\", \"focused\"],\n effects: [\"trackDismissableLayer\", \"scrollToHighlightedItem\", \"trackPlacement\", \"hideOtherElements\"],\n entry: [\"setInitialFocus\"],\n on: {\n \"CONTROLLED.CLOSE\": [\n {\n guard: \"restoreFocus\",\n target: \"focused\",\n actions: [\"setFinalFocus\"]\n },\n {\n target: \"idle\"\n }\n ],\n CHILDREN_CHANGE: [\n {\n guard: \"autoHighlight\",\n actions: [\"highlightFirstItem\"]\n },\n {\n guard: \"isHighlightedItemRemoved\",\n actions: [\"clearHighlightedValue\"]\n }\n ],\n \"INPUT.ARROW_DOWN\": {\n target: \"interacting\",\n actions: [\"highlightNextItem\"]\n },\n \"INPUT.ARROW_UP\": {\n target: \"interacting\",\n actions: [\"highlightPrevItem\"]\n },\n \"INPUT.HOME\": {\n target: \"interacting\",\n actions: [\"highlightFirstItem\"]\n },\n \"INPUT.END\": {\n target: \"interacting\",\n actions: [\"highlightLastItem\"]\n },\n \"INPUT.ENTER\": [\n // == group 1 ==\n {\n guard: and(\"isOpenControlled\", \"isCustomValue\", not(\"hasHighlightedItem\"), not(\"allowCustomValue\")),\n actions: [\"revertInputValue\", \"invokeOnClose\"]\n },\n {\n guard: and(\"isCustomValue\", not(\"hasHighlightedItem\"), not(\"allowCustomValue\")),\n target: \"focused\",\n actions: [\"revertInputValue\", \"invokeOnClose\"]\n },\n // == group 2 ==\n {\n guard: and(\"isOpenControlled\", \"closeOnSelect\"),\n actions: [\"selectHighlightedItem\", \"invokeOnClose\"]\n },\n {\n guard: \"closeOnSelect\",\n target: \"focused\",\n actions: [\"selectHighlightedItem\", \"invokeOnClose\", \"setFinalFocus\"]\n },\n {\n actions: [\"selectHighlightedItem\"]\n }\n ],\n \"INPUT.CHANGE\": {\n actions: [\"setInputValue\"]\n },\n \"LAYER.ESCAPE\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"focused\",\n actions: [\"invokeOnClose\"]\n }\n ],\n \"ITEM.POINTER_MOVE\": {\n target: \"interacting\",\n actions: [\"setHighlightedValue\"]\n },\n \"ITEM.POINTER_LEAVE\": {\n actions: [\"clearHighlightedValue\"]\n },\n \"LAYER.INTERACT_OUTSIDE\": [\n // == group 1 ==\n {\n guard: and(\"isOpenControlled\", \"isCustomValue\", not(\"allowCustomValue\")),\n actions: [\"revertInputValue\", \"invokeOnClose\"]\n },\n {\n guard: and(\"isCustomValue\", not(\"allowCustomValue\")),\n target: \"idle\",\n actions: [\"revertInputValue\", \"invokeOnClose\"]\n },\n // == group 2 ==\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"idle\",\n actions: [\"invokeOnClose\"]\n }\n ],\n \"TRIGGER.CLICK\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"focused\",\n actions: [\"invokeOnClose\"]\n }\n ],\n \"ITEM.CLICK\": [\n {\n guard: and(\"isOpenControlled\", \"closeOnSelect\"),\n actions: [\"selectItem\", \"invokeOnClose\"]\n },\n {\n guard: \"closeOnSelect\",\n target: \"focused\",\n actions: [\"selectItem\", \"invokeOnClose\", \"setFinalFocus\"]\n },\n {\n actions: [\"selectItem\"]\n }\n ],\n CLOSE: [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"focused\",\n actions: [\"invokeOnClose\", \"setFinalFocus\"]\n }\n ],\n \"VALUE.CLEAR\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"clearInputValue\", \"clearSelectedItems\", \"invokeOnClose\"]\n },\n {\n target: \"focused\",\n actions: [\"clearInputValue\", \"clearSelectedItems\", \"invokeOnClose\", \"setFinalFocus\"]\n }\n ]\n }\n }\n },\n implementations: {\n guards: {\n isInputValueEmpty: ({ computed }) => computed(\"isInputValueEmpty\"),\n autoComplete: ({ computed, prop }) => computed(\"autoComplete\") && !prop(\"multiple\"),\n autoHighlight: ({ computed }) => computed(\"autoHighlight\"),\n isFirstItemHighlighted: ({ prop, context }) => prop(\"collection\").firstValue === context.get(\"highlightedValue\"),\n isLastItemHighlighted: ({ prop, context }) => prop(\"collection\").lastValue === context.get(\"highlightedValue\"),\n isCustomValue: ({ computed }) => computed(\"isCustomValue\"),\n allowCustomValue: ({ prop }) => !!prop(\"allowCustomValue\"),\n hasHighlightedItem: ({ context }) => context.get(\"highlightedValue\") != null,\n closeOnSelect: ({ prop }) => !!prop(\"closeOnSelect\"),\n isOpenControlled: ({ prop }) => prop(\"open\") != null,\n openOnChange: ({ prop, context }) => {\n const openOnChange = prop(\"openOnChange\");\n if (isBoolean(openOnChange)) return openOnChange;\n return !!openOnChange?.({ inputValue: context.get(\"inputValue\") });\n },\n restoreFocus: ({ event }) => event.restoreFocus == null ? true : !!event.restoreFocus,\n isChangeEvent: ({ event }) => event.previousEvent?.type === \"INPUT.CHANGE\",\n autoFocus: ({ prop }) => !!prop(\"autoFocus\"),\n isHighlightedItemRemoved: ({ prop, context }) => !prop(\"collection\").has(context.get(\"highlightedValue\"))\n },\n effects: {\n trackDismissableLayer({ send, prop, scope }) {\n if (prop(\"disableLayer\")) return;\n const contentEl = () => getContentEl(scope);\n return trackDismissableElement(contentEl, {\n defer: true,\n exclude: () => [getInputEl(scope), getTriggerEl(scope), getClearTriggerEl(scope)],\n onFocusOutside: prop(\"onFocusOutside\"),\n onPointerDownOutside: prop(\"onPointerDownOutside\"),\n onInteractOutside: prop(\"onInteractOutside\"),\n onEscapeKeyDown(event) {\n event.preventDefault();\n event.stopPropagation();\n send({ type: \"LAYER.ESCAPE\", src: \"escape-key\" });\n },\n onDismiss() {\n send({ type: \"LAYER.INTERACT_OUTSIDE\", src: \"interact-outside\", restoreFocus: false });\n }\n });\n },\n hideOtherElements({ scope }) {\n return ariaHidden([\n getInputEl(scope),\n getContentEl(scope),\n getTriggerEl(scope),\n getClearTriggerEl(scope)\n ]);\n },\n trackPlacement({ context, prop, scope }) {\n const anchorEl = () => getControlEl(scope) || getTriggerEl(scope);\n const positionerEl = () => getPositionerEl(scope);\n context.set(\"currentPlacement\", prop(\"positioning\").placement);\n return getPlacement(anchorEl, positionerEl, {\n ...prop(\"positioning\"),\n defer: true,\n onComplete(data) {\n context.set(\"currentPlacement\", data.placement);\n }\n });\n },\n scrollToHighlightedItem({ context, prop, scope, event }) {\n const inputEl = getInputEl(scope);\n let cleanups = [];\n const exec = (immediate) => {\n const pointer = event.current().type.includes(\"POINTER\");\n const highlightedValue = context.get(\"highlightedValue\");\n if (pointer || !highlightedValue) return;\n const itemEl = getItemEl(scope, highlightedValue);\n const contentEl = getContentEl(scope);\n const scrollToIndexFn = prop(\"scrollToIndexFn\");\n if (scrollToIndexFn) {\n const highlightedIndex = prop(\"collection\").indexOf(highlightedValue);\n scrollToIndexFn({ index: highlightedIndex, immediate });\n return;\n }\n const raf_cleanup = raf(() => {\n scrollIntoView(itemEl, { rootEl: contentEl, block: \"nearest\" });\n });\n cleanups.push(raf_cleanup);\n };\n const rafCleanup = raf(() => exec(true));\n cleanups.push(rafCleanup);\n const observerCleanup = observeAttributes(inputEl, {\n attributes: [\"aria-activedescendant\"],\n callback: () => exec(false)\n });\n cleanups.push(observerCleanup);\n return () => {\n cleanups.forEach((cleanup) => cleanup());\n };\n }\n },\n actions: {\n reposition({ context, prop, scope, event }) {\n const controlEl = () => getControlEl(scope);\n const positionerEl = () => getPositionerEl(scope);\n getPlacement(controlEl, positionerEl, {\n ...prop(\"positioning\"),\n ...event.options,\n defer: true,\n listeners: false,\n onComplete(data) {\n context.set(\"currentPlacement\", data.placement);\n }\n });\n },\n setHighlightedValue({ context, event }) {\n if (event.value == null) return;\n context.set(\"highlightedValue\", event.value);\n },\n clearHighlightedValue({ context }) {\n context.set(\"highlightedValue\", null);\n },\n selectHighlightedItem(params) {\n const { context, prop } = params;\n const collection2 = prop(\"collection\");\n const highlightedValue = context.get(\"highlightedValue\");\n if (!highlightedValue || !collection2.has(highlightedValue)) return;\n const nextValue = prop(\"multiple\") ? addOrRemove(context.get(\"value\"), highlightedValue) : [highlightedValue];\n prop(\"onSelect\")?.({ value: nextValue, itemValue: highlightedValue });\n context.set(\"value\", nextValue);\n const inputValue = match(prop(\"selectionBehavior\"), {\n preserve: context.get(\"inputValue\"),\n replace: collection2.stringifyMany(nextValue),\n clear: \"\"\n });\n context.set(\"inputValue\", inputValue);\n },\n scrollToHighlightedItem({ context, prop, scope }) {\n nextTick(() => {\n const highlightedValue = context.get(\"highlightedValue\");\n if (highlightedValue == null) return;\n const itemEl = getItemEl(scope, highlightedValue);\n const contentEl = getContentEl(scope);\n const scrollToIndexFn = prop(\"scrollToIndexFn\");\n if (scrollToIndexFn) {\n const highlightedIndex = prop(\"collection\").indexOf(highlightedValue);\n scrollToIndexFn({ index: highlightedIndex, immediate: true });\n return;\n }\n scrollIntoView(itemEl, { rootEl: contentEl, block: \"nearest\" });\n });\n },\n selectItem(params) {\n const { context, event, flush, prop } = params;\n if (event.value == null) return;\n flush(() => {\n const nextValue = prop(\"multiple\") ? addOrRemove(context.get(\"value\"), event.value) : [event.value];\n prop(\"onSelect\")?.({ value: nextValue, itemValue: event.value });\n context.set(\"value\", nextValue);\n const inputValue = match(prop(\"selectionBehavior\"), {\n preserve: context.get(\"inputValue\"),\n replace: prop(\"collection\").stringifyMany(nextValue),\n clear: \"\"\n });\n context.set(\"inputValue\", inputValue);\n });\n },\n clearItem(params) {\n const { context, event, flush, prop } = params;\n if (event.value == null) return;\n flush(() => {\n const nextValue = remove(context.get(\"value\"), event.value);\n context.set(\"value\", nextValue);\n const inputValue = match(prop(\"selectionBehavior\"), {\n preserve: context.get(\"inputValue\"),\n replace: prop(\"collection\").stringifyMany(nextValue),\n clear: \"\"\n });\n context.set(\"inputValue\", inputValue);\n });\n },\n setInitialFocus({ scope }) {\n raf(() => {\n focusInputEl(scope);\n });\n },\n setFinalFocus({ scope }) {\n raf(() => {\n const triggerEl = getTriggerEl(scope);\n if (triggerEl?.dataset.focusable == null) {\n focusInputEl(scope);\n } else {\n focusTriggerEl(scope);\n }\n });\n },\n syncInputValue({ context, scope, event }) {\n const inputEl = getInputEl(scope);\n if (!inputEl) return;\n inputEl.value = context.get(\"inputValue\");\n queueMicrotask(() => {\n if (event.current().type === \"INPUT.CHANGE\") return;\n setCaretToEnd(inputEl);\n });\n },\n setInputValue({ context, event }) {\n context.set(\"inputValue\", event.value);\n },\n clearInputValue({ context }) {\n context.set(\"inputValue\", \"\");\n },\n revertInputValue({ context, prop, computed }) {\n const selectionBehavior = prop(\"selectionBehavior\");\n const inputValue = match(selectionBehavior, {\n replace: computed(\"hasSelectedItems\") ? computed(\"valueAsString\") : \"\",\n preserve: context.get(\"inputValue\"),\n clear: \"\"\n });\n context.set(\"inputValue\", inputValue);\n },\n setValue(params) {\n const { context, flush, event, prop } = params;\n flush(() => {\n context.set(\"value\", event.value);\n const inputValue = match(prop(\"selectionBehavior\"), {\n preserve: context.get(\"inputValue\"),\n replace: prop(\"collection\").stringifyMany(event.value),\n clear: \"\"\n });\n context.set(\"inputValue\", inputValue);\n });\n },\n clearSelectedItems(params) {\n const { context, flush, prop } = params;\n flush(() => {\n context.set(\"value\", []);\n const inputValue = match(prop(\"selectionBehavior\"), {\n preserve: context.get(\"inputValue\"),\n replace: prop(\"collection\").stringifyMany([]),\n clear: \"\"\n });\n context.set(\"inputValue\", inputValue);\n });\n },\n scrollContentToTop({ prop, scope }) {\n const scrollToIndexFn = prop(\"scrollToIndexFn\");\n if (scrollToIndexFn) {\n scrollToIndexFn({ index: 0, immediate: true });\n } else {\n const contentEl = getContentEl(scope);\n if (!contentEl) return;\n contentEl.scrollTop = 0;\n }\n },\n invokeOnOpen({ prop, event }) {\n const reason = getOpenChangeReason(event);\n prop(\"onOpenChange\")?.({ open: true, reason });\n },\n invokeOnClose({ prop, event }) {\n const reason = getOpenChangeReason(event);\n prop(\"onOpenChange\")?.({ open: false, reason });\n },\n highlightFirstItem({ context, prop, scope }) {\n const exec = getContentEl(scope) ? queueMicrotask : raf;\n exec(() => {\n const value = prop(\"collection\").firstValue;\n if (value) context.set(\"highlightedValue\", value);\n });\n },\n highlightFirstItemIfNeeded({ computed, action }) {\n if (!computed(\"autoHighlight\")) return;\n action([\"highlightFirstItem\"]);\n },\n highlightLastItem({ context, prop, scope }) {\n const exec = getContentEl(scope) ? queueMicrotask : raf;\n exec(() => {\n const value = prop(\"collection\").lastValue;\n if (value) context.set(\"highlightedValue\", value);\n });\n },\n highlightNextItem({ context, prop }) {\n let value = null;\n const highlightedValue = context.get(\"highlightedValue\");\n const collection2 = prop(\"collection\");\n if (highlightedValue) {\n value = collection2.getNextValue(highlightedValue);\n if (!value && prop(\"loopFocus\")) value = collection2.firstValue;\n } else {\n value = collection2.firstValue;\n }\n if (value) context.set(\"highlightedValue\", value);\n },\n highlightPrevItem({ context, prop }) {\n let value = null;\n const highlightedValue = context.get(\"highlightedValue\");\n const collection2 = prop(\"collection\");\n if (highlightedValue) {\n value = collection2.getPreviousValue(highlightedValue);\n if (!value && prop(\"loopFocus\")) value = collection2.lastValue;\n } else {\n value = collection2.lastValue;\n }\n if (value) context.set(\"highlightedValue\", value);\n },\n highlightFirstSelectedItem({ context, prop }) {\n raf(() => {\n const [value] = prop(\"collection\").sort(context.get(\"value\"));\n if (value) context.set(\"highlightedValue\", value);\n });\n },\n highlightFirstOrSelectedItem({ context, prop, computed }) {\n raf(() => {\n let value = null;\n if (computed(\"hasSelectedItems\")) {\n value = prop(\"collection\").sort(context.get(\"value\"))[0];\n } else {\n value = prop(\"collection\").firstValue;\n }\n if (value) context.set(\"highlightedValue\", value);\n });\n },\n highlightLastOrSelectedItem({ context, prop, computed }) {\n raf(() => {\n const collection2 = prop(\"collection\");\n let value = null;\n if (computed(\"hasSelectedItems\")) {\n value = collection2.sort(context.get(\"value\"))[0];\n } else {\n value = collection2.lastValue;\n }\n if (value) context.set(\"highlightedValue\", value);\n });\n },\n autofillInputValue({ context, computed, prop, event, scope }) {\n const inputEl = getInputEl(scope);\n const collection2 = prop(\"collection\");\n if (!computed(\"autoComplete\") || !inputEl || !event.keypress) return;\n const valueText = collection2.stringify(context.get(\"highlightedValue\"));\n raf(() => {\n inputEl.value = valueText || context.get(\"inputValue\");\n });\n },\n syncSelectedItems(params) {\n queueMicrotask(() => {\n const { context, prop } = params;\n const collection2 = prop(\"collection\");\n const value = context.get(\"value\");\n const selectedItems = value.map((v) => {\n const item = context.get(\"selectedItems\").find((item2) => collection2.getItemValue(item2) === v);\n return item || collection2.find(v);\n });\n context.set(\"selectedItems\", selectedItems);\n const inputValue = match(prop(\"selectionBehavior\"), {\n preserve: context.get(\"inputValue\"),\n replace: collection2.stringifyMany(value),\n clear: \"\"\n });\n context.set(\"inputValue\", inputValue);\n });\n },\n syncHighlightedItem({ context, prop }) {\n const item = prop(\"collection\").find(context.get(\"highlightedValue\"));\n context.set(\"highlightedItem\", item);\n },\n toggleVisibility({ event, send, prop }) {\n send({ type: prop(\"open\") ? \"CONTROLLED.OPEN\" : \"CONTROLLED.CLOSE\", previousEvent: event });\n }\n }\n }\n});\nfunction getOpenChangeReason(event) {\n return (event.previousEvent || event).src;\n}\nvar props = createProps()([\n \"allowCustomValue\",\n \"autoFocus\",\n \"closeOnSelect\",\n \"collection\",\n \"composite\",\n \"defaultHighlightedValue\",\n \"defaultInputValue\",\n \"defaultOpen\",\n \"defaultValue\",\n \"dir\",\n \"disabled\",\n \"disableLayer\",\n \"form\",\n \"getRootNode\",\n \"highlightedValue\",\n \"id\",\n \"ids\",\n \"inputBehavior\",\n \"inputValue\",\n \"invalid\",\n \"loopFocus\",\n \"multiple\",\n \"name\",\n \"navigate\",\n \"onFocusOutside\",\n \"onHighlightChange\",\n \"onInputValueChange\",\n \"onInteractOutside\",\n \"onOpenChange\",\n \"onOpenChange\",\n \"onPointerDownOutside\",\n \"onSelect\",\n \"onValueChange\",\n \"open\",\n \"openOnChange\",\n \"openOnClick\",\n \"openOnKeyPress\",\n \"placeholder\",\n \"positioning\",\n \"readOnly\",\n \"required\",\n \"scrollToIndexFn\",\n \"selectionBehavior\",\n \"translations\",\n \"value\"\n]);\nvar splitProps = createSplitProps(props);\nvar itemGroupLabelProps = createProps()([\"htmlFor\"]);\nvar splitItemGroupLabelProps = createSplitProps(itemGroupLabelProps);\nvar itemGroupProps = createProps()([\"id\"]);\nvar splitItemGroupProps = createSplitProps(itemGroupProps);\nvar itemProps = createProps()([\"item\", \"persistFocus\"]);\nvar splitItemProps = createSplitProps(itemProps);\n\nexport { anatomy, collection, connect, itemGroupLabelProps, itemGroupProps, itemProps, machine, props, splitItemGroupLabelProps, splitItemGroupProps, splitItemProps, splitProps };\n","'use client';\nimport { createAnatomy } from '@zag-js/anatomy';\n\nconst fieldsetAnatomy = createAnatomy(\"fieldset\").parts(\"root\", \"errorText\", \"helperText\", \"legend\");\nconst parts = fieldsetAnatomy.build();\n\nexport { fieldsetAnatomy, parts };\n","\"use strict\";\nimport { comboboxAnatomy as comboboxAnatomy$1 } from '@ark-ui/react';\nimport { accordionAnatomy as accordionAnatomy$1 } from '@ark-ui/react/accordion';\nimport { createAnatomy } from '@ark-ui/react/anatomy';\nimport { clipboardAnatomy as clipboardAnatomy$1 } from '@ark-ui/react/clipboard';\nimport { colorPickerAnatomy as colorPickerAnatomy$1 } from '@ark-ui/react/color-picker';\nimport { dialogAnatomy as dialogAnatomy$1 } from '@ark-ui/react/dialog';\nimport { editableAnatomy as editableAnatomy$1 } from '@ark-ui/react/editable';\nimport { fieldAnatomy as fieldAnatomy$1 } from '@ark-ui/react/field';\nimport { fieldsetAnatomy as fieldsetAnatomy$1 } from '@ark-ui/react/fieldset';\nimport { fileUploadAnatomy as fileUploadAnatomy$1 } from '@ark-ui/react/file-upload';\nimport { menuAnatomy as menuAnatomy$1 } from '@ark-ui/react/menu';\nimport { popoverAnatomy as popoverAnatomy$1 } from '@ark-ui/react/popover';\nimport { radioGroupAnatomy as radioGroupAnatomy$1 } from '@ark-ui/react/radio-group';\nimport { ratingGroupAnatomy as ratingGroupAnatomy$1 } from '@ark-ui/react/rating-group';\nimport { selectAnatomy as selectAnatomy$1 } from '@ark-ui/react/select';\nimport { sliderAnatomy as sliderAnatomy$1 } from '@ark-ui/react/slider';\nimport { switchAnatomy as switchAnatomy$1 } from '@ark-ui/react/switch';\nexport { treeViewAnatomy } from '@ark-ui/react/tree-view';\nexport { avatarAnatomy } from '@ark-ui/react/avatar';\nexport { checkboxAnatomy } from '@ark-ui/react/checkbox';\nexport { collapsibleAnatomy } from '@ark-ui/react/collapsible';\nexport { hoverCardAnatomy } from '@ark-ui/react/hover-card';\nexport { numberInputAnatomy } from '@ark-ui/react/number-input';\nexport { pinInputAnatomy } from '@ark-ui/react/pin-input';\nexport { progressAnatomy } from '@ark-ui/react/progress';\nexport { qrCodeAnatomy } from '@ark-ui/react/qr-code';\nexport { segmentGroupAnatomy } from '@ark-ui/react/segment-group';\nexport { tooltipAnatomy } from '@ark-ui/react/tooltip';\n\nconst accordionAnatomy = accordionAnatomy$1.extendWith(\"itemBody\");\nconst actionBarAnatomy = createAnatomy(\"action-bar\").parts(\n \"positioner\",\n \"content\",\n \"separator\",\n \"selectionTrigger\",\n \"closeTrigger\"\n);\nconst alertAnatomy = createAnatomy(\"alert\").parts(\n \"title\",\n \"description\",\n \"root\",\n \"indicator\",\n \"content\"\n);\nconst breadcrumbAnatomy = createAnatomy(\"breadcrumb\").parts(\n \"link\",\n \"currentLink\",\n \"item\",\n \"list\",\n \"root\",\n \"ellipsis\",\n \"separator\"\n);\nconst blockquoteAnatomy = createAnatomy(\"blockquote\").parts(\n \"root\",\n \"icon\",\n \"content\",\n \"caption\"\n);\nconst cardAnatomy = createAnatomy(\"card\").parts(\n \"root\",\n \"header\",\n \"body\",\n \"footer\",\n \"title\",\n \"description\"\n);\nconst checkboxCardAnatomy = createAnatomy(\"checkbox-card\", [\n \"root\",\n \"control\",\n \"label\",\n \"description\",\n \"addon\",\n \"indicator\",\n \"content\"\n]);\nconst dataListAnatomy = createAnatomy(\"data-list\").parts(\n \"root\",\n \"item\",\n \"itemLabel\",\n \"itemValue\"\n);\nconst dialogAnatomy = dialogAnatomy$1.extendWith(\n \"header\",\n \"body\",\n \"footer\",\n \"backdrop\"\n);\nconst drawerAnatomy = dialogAnatomy$1.extendWith(\n \"header\",\n \"body\",\n \"footer\",\n \"backdrop\"\n);\nconst editableAnatomy = editableAnatomy$1.extendWith(\"textarea\");\nconst emptyStateAnatomy = createAnatomy(\"empty-state\", [\n \"root\",\n \"content\",\n \"indicator\",\n \"title\",\n \"description\"\n]);\nconst fieldAnatomy = fieldAnatomy$1.extendWith(\"requiredIndicator\");\nconst fieldsetAnatomy = fieldsetAnatomy$1.extendWith(\"content\");\nconst fileUploadAnatomy = fileUploadAnatomy$1.extendWith(\n \"itemContent\",\n \"dropzoneContent\",\n \"fileText\"\n);\nconst listAnatomy = createAnatomy(\"list\").parts(\n \"root\",\n \"item\",\n \"indicator\"\n);\nconst menuAnatomy = menuAnatomy$1.extendWith(\"itemCommand\");\nconst nativeSelectAnatomy = createAnatomy(\"select\").parts(\n \"root\",\n \"field\",\n \"indicator\"\n);\nconst popoverAnatomy = popoverAnatomy$1.extendWith(\n \"header\",\n \"body\",\n \"footer\"\n);\nconst radioGroupAnatomy = radioGroupAnatomy$1.extendWith(\n \"itemAddon\",\n \"itemIndicator\"\n);\nconst radioCardAnatomy = radioGroupAnatomy.extendWith(\n \"itemContent\",\n \"itemDescription\"\n);\nconst ratingGroupAnatomy = ratingGroupAnatomy$1.extendWith(\"itemIndicator\");\nconst selectAnatomy = selectAnatomy$1.extendWith(\"indicatorGroup\");\nconst comboboxAnatomy = comboboxAnatomy$1.extendWith(\n \"indicatorGroup\",\n \"empty\"\n);\nconst sliderAnatomy = sliderAnatomy$1.extendWith(\"markerIndicator\");\nconst statAnatomy = createAnatomy(\"stat\").parts(\n \"root\",\n \"label\",\n \"helpText\",\n \"valueText\",\n \"valueUnit\",\n \"indicator\"\n);\nconst statusAnatomy = createAnatomy(\"status\").parts(\"root\", \"indicator\");\nconst stepsAnatomy = createAnatomy(\"steps\", [\n \"root\",\n \"list\",\n \"item\",\n \"trigger\",\n \"indicator\",\n \"separator\",\n \"content\",\n \"title\",\n \"description\",\n \"nextTrigger\",\n \"prevTrigger\",\n \"progress\"\n]);\nconst switchAnatomy = switchAnatomy$1.extendWith(\"indicator\");\nconst tableAnatomy = createAnatomy(\"table\").parts(\n \"root\",\n \"header\",\n \"body\",\n \"row\",\n \"columnHeader\",\n \"cell\",\n \"footer\",\n \"caption\"\n);\nconst toastAnatomy = createAnatomy(\"toast\").parts(\n \"root\",\n \"title\",\n \"description\",\n \"indicator\",\n \"closeTrigger\",\n \"actionTrigger\"\n);\nconst tabsAnatomy = createAnatomy(\"tabs\").parts(\n \"root\",\n \"trigger\",\n \"list\",\n \"content\",\n \"contentGroup\",\n \"indicator\"\n);\nconst tagAnatomy = createAnatomy(\"tag\").parts(\n \"root\",\n \"label\",\n \"closeTrigger\",\n \"startElement\",\n \"endElement\"\n);\nconst timelineAnatomy = createAnatomy(\"timeline\").parts(\n \"root\",\n \"item\",\n \"content\",\n \"separator\",\n \"indicator\",\n \"connector\",\n \"title\",\n \"description\"\n);\nconst colorPickerAnatomy = colorPickerAnatomy$1.extendWith(\"channelText\");\nconst codeBlockAnatomy = createAnatomy(\"code-block\", [\n \"root\",\n \"content\",\n \"title\",\n \"header\",\n \"footer\",\n \"control\",\n \"overlay\",\n \"code\",\n \"codeText\",\n \"copyTrigger\",\n \"copyIndicator\",\n \"collapseTrigger\",\n \"collapseIndicator\",\n \"collapseText\"\n]);\nconst clipboardAnatomy = clipboardAnatomy$1.extendWith(\"valueText\");\n\nexport { accordionAnatomy, actionBarAnatomy, alertAnatomy, blockquoteAnatomy, breadcrumbAnatomy, cardAnatomy, checkboxCardAnatomy, clipboardAnatomy, codeBlockAnatomy, colorPickerAnatomy, comboboxAnatomy, dataListAnatomy, dialogAnatomy, drawerAnatomy, editableAnatomy, emptyStateAnatomy, fieldAnatomy, fieldsetAnatomy, fileUploadAnatomy, listAnatomy, menuAnatomy, nativeSelectAnatomy, popoverAnatomy, radioCardAnatomy, radioGroupAnatomy, ratingGroupAnatomy, selectAnatomy, sliderAnatomy, statAnatomy, statusAnatomy, stepsAnatomy, switchAnatomy, tableAnatomy, tabsAnatomy, tagAnatomy, timelineAnatomy, toastAnatomy };\n"],"names":["anatomy","createAnatomy","createProps","fieldsetAnatomy","accordionAnatomy","accordionAnatomy$1","actionBarAnatomy","alertAnatomy","breadcrumbAnatomy","blockquoteAnatomy","cardAnatomy","checkboxCardAnatomy","dataListAnatomy","dialogAnatomy","dialogAnatomy$1","drawerAnatomy","editableAnatomy","editableAnatomy$1","emptyStateAnatomy","fieldAnatomy","fieldAnatomy$1","fieldsetAnatomy$1","fileUploadAnatomy","fileUploadAnatomy$1","listAnatomy","menuAnatomy","menuAnatomy$1","nativeSelectAnatomy","popoverAnatomy","popoverAnatomy$1","radioGroupAnatomy","radioGroupAnatomy$1","radioCardAnatomy","ratingGroupAnatomy","ratingGroupAnatomy$1","selectAnatomy","selectAnatomy$1","comboboxAnatomy","comboboxAnatomy$1","sliderAnatomy","sliderAnatomy$1","statAnatomy","statusAnatomy","stepsAnatomy","switchAnatomy","switchAnatomy$1","tableAnatomy","toastAnatomy","tabsAnatomy","tagAnatomy","timelineAnatomy","colorPickerAnatomy","colorPickerAnatomy$1","codeBlockAnatomy","clipboardAnatomy$1"],"mappings":"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","x_google_ignoreList":[0,1,2]}
|
|
1
|
+
{"version":3,"file":"anatomy-DKlFmIC5.js","sources":["../../node_modules/@zag-js/combobox/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/fieldset/fieldset.anatomy.js","../../node_modules/@chakra-ui/react/dist/esm/anatomy.js"],"sourcesContent":["import { createAnatomy } from '@zag-js/anatomy';\nimport { ListCollection } from '@zag-js/collection';\nimport { raf, setCaretToEnd, nextTick, scrollIntoView, observeAttributes, clickIfLink, query, dataAttr, ariaAttr, isDownloadingEvent, isOpeningInNewTab, isContextMenuEvent, isLeftClick, getEventKey, isComposingEvent, isAnchorElement } from '@zag-js/dom-query';\nimport { getPlacement, getPlacementStyles } from '@zag-js/popper';\nimport { match, remove, addOrRemove, isBoolean, isEqual, createSplitProps, ensure } from '@zag-js/utils';\nimport { ariaHidden } from '@zag-js/aria-hidden';\nimport { setup } from '@zag-js/core';\nimport { trackDismissableElement } from '@zag-js/dismissable';\nimport { createProps } from '@zag-js/types';\n\n// src/combobox.anatomy.ts\nvar anatomy = createAnatomy(\"combobox\").parts(\n \"root\",\n \"clearTrigger\",\n \"content\",\n \"control\",\n \"input\",\n \"item\",\n \"itemGroup\",\n \"itemGroupLabel\",\n \"itemIndicator\",\n \"itemText\",\n \"label\",\n \"list\",\n \"positioner\",\n \"trigger\"\n);\nvar parts = anatomy.build();\nvar collection = (options) => {\n return new ListCollection(options);\n};\ncollection.empty = () => {\n return new ListCollection({ items: [] });\n};\nvar getRootId = (ctx) => ctx.ids?.root ?? `combobox:${ctx.id}`;\nvar getLabelId = (ctx) => ctx.ids?.label ?? `combobox:${ctx.id}:label`;\nvar getControlId = (ctx) => ctx.ids?.control ?? `combobox:${ctx.id}:control`;\nvar getInputId = (ctx) => ctx.ids?.input ?? `combobox:${ctx.id}:input`;\nvar getContentId = (ctx) => ctx.ids?.content ?? `combobox:${ctx.id}:content`;\nvar getPositionerId = (ctx) => ctx.ids?.positioner ?? `combobox:${ctx.id}:popper`;\nvar getTriggerId = (ctx) => ctx.ids?.trigger ?? `combobox:${ctx.id}:toggle-btn`;\nvar getClearTriggerId = (ctx) => ctx.ids?.clearTrigger ?? `combobox:${ctx.id}:clear-btn`;\nvar getItemGroupId = (ctx, id) => ctx.ids?.itemGroup?.(id) ?? `combobox:${ctx.id}:optgroup:${id}`;\nvar getItemGroupLabelId = (ctx, id) => ctx.ids?.itemGroupLabel?.(id) ?? `combobox:${ctx.id}:optgroup-label:${id}`;\nvar getItemId = (ctx, id) => ctx.ids?.item?.(id) ?? `combobox:${ctx.id}:option:${id}`;\nvar getContentEl = (ctx) => ctx.getById(getContentId(ctx));\nvar getInputEl = (ctx) => ctx.getById(getInputId(ctx));\nvar getPositionerEl = (ctx) => ctx.getById(getPositionerId(ctx));\nvar getControlEl = (ctx) => ctx.getById(getControlId(ctx));\nvar getTriggerEl = (ctx) => ctx.getById(getTriggerId(ctx));\nvar getClearTriggerEl = (ctx) => ctx.getById(getClearTriggerId(ctx));\nvar getItemEl = (ctx, value) => {\n if (value == null) return;\n const selector = `[role=option][data-value=\"${CSS.escape(value)}\"]`;\n return query(getContentEl(ctx), selector);\n};\nvar focusInputEl = (ctx) => {\n const inputEl = getInputEl(ctx);\n if (ctx.isActiveElement(inputEl)) return;\n inputEl?.focus({ preventScroll: true });\n};\nvar focusTriggerEl = (ctx) => {\n const triggerEl = getTriggerEl(ctx);\n if (ctx.isActiveElement(triggerEl)) return;\n triggerEl?.focus({ preventScroll: true });\n};\n\n// src/combobox.connect.ts\nfunction connect(service, normalize) {\n const { context, prop, state, send, scope, computed, event } = service;\n const translations = prop(\"translations\");\n const collection2 = prop(\"collection\");\n const disabled = prop(\"disabled\");\n const interactive = computed(\"isInteractive\");\n const invalid = prop(\"invalid\");\n const readOnly = prop(\"readOnly\");\n const open = state.hasTag(\"open\");\n const focused = state.hasTag(\"focused\");\n const composite = prop(\"composite\");\n const highlightedValue = context.get(\"highlightedValue\");\n const popperStyles = getPlacementStyles({\n ...prop(\"positioning\"),\n placement: context.get(\"currentPlacement\")\n });\n function getItemState(props2) {\n const disabled2 = collection2.getItemDisabled(props2.item);\n const value = collection2.getItemValue(props2.item);\n ensure(value, () => `[zag-js] No value found for item ${JSON.stringify(props2.item)}`);\n return {\n value,\n disabled: Boolean(disabled2 || disabled2),\n highlighted: highlightedValue === value,\n selected: context.get(\"value\").includes(value)\n };\n }\n return {\n focused,\n open,\n inputValue: context.get(\"inputValue\"),\n highlightedValue,\n highlightedItem: context.get(\"highlightedItem\"),\n value: context.get(\"value\"),\n valueAsString: computed(\"valueAsString\"),\n hasSelectedItems: computed(\"hasSelectedItems\"),\n selectedItems: context.get(\"selectedItems\"),\n collection: prop(\"collection\"),\n multiple: !!prop(\"multiple\"),\n disabled: !!disabled,\n syncSelectedItems() {\n send({ type: \"SELECTED_ITEMS.SYNC\" });\n },\n reposition(options = {}) {\n send({ type: \"POSITIONING.SET\", options });\n },\n setHighlightValue(value) {\n send({ type: \"HIGHLIGHTED_VALUE.SET\", value });\n },\n clearHighlightValue() {\n send({ type: \"HIGHLIGHTED_VALUE.CLEAR\" });\n },\n selectValue(value) {\n send({ type: \"ITEM.SELECT\", value });\n },\n setValue(value) {\n send({ type: \"VALUE.SET\", value });\n },\n setInputValue(value, reason = \"script\") {\n send({ type: \"INPUT_VALUE.SET\", value, src: reason });\n },\n clearValue(value) {\n if (value != null) {\n send({ type: \"ITEM.CLEAR\", value });\n } else {\n send({ type: \"VALUE.CLEAR\" });\n }\n },\n focus() {\n getInputEl(scope)?.focus();\n },\n setOpen(nextOpen, reason = \"script\") {\n const open2 = state.hasTag(\"open\");\n if (open2 === nextOpen) return;\n send({ type: nextOpen ? \"OPEN\" : \"CLOSE\", src: reason });\n },\n getRootProps() {\n return normalize.element({\n ...parts.root.attrs,\n dir: prop(\"dir\"),\n id: getRootId(scope),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly)\n });\n },\n getLabelProps() {\n return normalize.label({\n ...parts.label.attrs,\n dir: prop(\"dir\"),\n htmlFor: getInputId(scope),\n id: getLabelId(scope),\n \"data-readonly\": dataAttr(readOnly),\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-focus\": dataAttr(focused),\n onClick(event2) {\n if (composite) return;\n event2.preventDefault();\n getTriggerEl(scope)?.focus({ preventScroll: true });\n }\n });\n },\n getControlProps() {\n return normalize.element({\n ...parts.control.attrs,\n dir: prop(\"dir\"),\n id: getControlId(scope),\n \"data-state\": open ? \"open\" : \"closed\",\n \"data-focus\": dataAttr(focused),\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid)\n });\n },\n getPositionerProps() {\n return normalize.element({\n ...parts.positioner.attrs,\n dir: prop(\"dir\"),\n id: getPositionerId(scope),\n style: popperStyles.floating\n });\n },\n getInputProps() {\n return normalize.input({\n ...parts.input.attrs,\n dir: prop(\"dir\"),\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n \"data-autofocus\": dataAttr(prop(\"autoFocus\")),\n name: prop(\"name\"),\n form: prop(\"form\"),\n disabled,\n required: prop(\"required\"),\n autoComplete: \"off\",\n autoCorrect: \"off\",\n autoCapitalize: \"none\",\n spellCheck: \"false\",\n readOnly,\n placeholder: prop(\"placeholder\"),\n id: getInputId(scope),\n type: \"text\",\n role: \"combobox\",\n defaultValue: context.get(\"inputValue\"),\n \"aria-autocomplete\": computed(\"autoComplete\") ? \"both\" : \"list\",\n \"aria-controls\": getContentId(scope),\n \"aria-expanded\": open,\n \"data-state\": open ? \"open\" : \"closed\",\n \"aria-activedescendant\": highlightedValue ? getItemId(scope, highlightedValue) : void 0,\n onClick(event2) {\n if (event2.defaultPrevented) return;\n if (!prop(\"openOnClick\")) return;\n if (!interactive) return;\n send({ type: \"INPUT.CLICK\", src: \"input-click\" });\n },\n onFocus() {\n if (disabled) return;\n send({ type: \"INPUT.FOCUS\" });\n },\n onBlur() {\n if (disabled) return;\n send({ type: \"INPUT.BLUR\" });\n },\n onChange(event2) {\n send({ type: \"INPUT.CHANGE\", value: event2.currentTarget.value, src: \"input-change\" });\n },\n onKeyDown(event2) {\n if (event2.defaultPrevented) return;\n if (!interactive) return;\n if (event2.ctrlKey || event2.shiftKey || isComposingEvent(event2)) return;\n const openOnKeyPress = prop(\"openOnKeyPress\");\n const isModifierKey = event2.ctrlKey || event2.metaKey || event2.shiftKey;\n const keypress = true;\n const keymap = {\n ArrowDown(event3) {\n if (!openOnKeyPress && !open) return;\n send({ type: event3.altKey ? \"OPEN\" : \"INPUT.ARROW_DOWN\", keypress, src: \"arrow-key\" });\n event3.preventDefault();\n },\n ArrowUp() {\n if (!openOnKeyPress && !open) return;\n send({ type: event2.altKey ? \"CLOSE\" : \"INPUT.ARROW_UP\", keypress, src: \"arrow-key\" });\n event2.preventDefault();\n },\n Home(event3) {\n if (isModifierKey) return;\n send({ type: \"INPUT.HOME\", keypress });\n if (open) {\n event3.preventDefault();\n }\n },\n End(event3) {\n if (isModifierKey) return;\n send({ type: \"INPUT.END\", keypress });\n if (open) {\n event3.preventDefault();\n }\n },\n Enter(event3) {\n send({ type: \"INPUT.ENTER\", keypress, src: \"item-select\" });\n const submittable = computed(\"isCustomValue\") && prop(\"allowCustomValue\");\n if (open && !submittable) {\n event3.preventDefault();\n }\n if (highlightedValue == null) return;\n const itemEl = getItemEl(scope, highlightedValue);\n if (isAnchorElement(itemEl)) {\n prop(\"navigate\")?.({ value: highlightedValue, node: itemEl, href: itemEl.href });\n }\n },\n Escape() {\n send({ type: \"INPUT.ESCAPE\", keypress, src: \"escape-key\" });\n event2.preventDefault();\n }\n };\n const key = getEventKey(event2, { dir: prop(\"dir\") });\n const exec = keymap[key];\n exec?.(event2);\n }\n });\n },\n getTriggerProps(props2 = {}) {\n return normalize.button({\n ...parts.trigger.attrs,\n dir: prop(\"dir\"),\n id: getTriggerId(scope),\n \"aria-haspopup\": composite ? \"listbox\" : \"dialog\",\n type: \"button\",\n tabIndex: props2.focusable ? void 0 : -1,\n \"aria-label\": translations.triggerLabel,\n \"aria-expanded\": open,\n \"data-state\": open ? \"open\" : \"closed\",\n \"aria-controls\": open ? getContentId(scope) : void 0,\n disabled,\n \"data-invalid\": dataAttr(invalid),\n \"data-focusable\": dataAttr(props2.focusable),\n \"data-readonly\": dataAttr(readOnly),\n \"data-disabled\": dataAttr(disabled),\n onFocus() {\n if (!props2.focusable) return;\n send({ type: \"INPUT.FOCUS\", src: \"trigger\" });\n },\n onClick(event2) {\n if (event2.defaultPrevented) return;\n if (!interactive) return;\n if (!isLeftClick(event2)) return;\n send({ type: \"TRIGGER.CLICK\", src: \"trigger-click\" });\n },\n onPointerDown(event2) {\n if (!interactive) return;\n if (event2.pointerType === \"touch\") return;\n if (!isLeftClick(event2)) return;\n event2.preventDefault();\n queueMicrotask(() => {\n getInputEl(scope)?.focus({ preventScroll: true });\n });\n },\n onKeyDown(event2) {\n if (event2.defaultPrevented) return;\n if (composite) return;\n const keyMap = {\n ArrowDown() {\n send({ type: \"INPUT.ARROW_DOWN\", src: \"arrow-key\" });\n },\n ArrowUp() {\n send({ type: \"INPUT.ARROW_UP\", src: \"arrow-key\" });\n }\n };\n const key = getEventKey(event2, { dir: prop(\"dir\") });\n const exec = keyMap[key];\n if (exec) {\n exec(event2);\n event2.preventDefault();\n }\n }\n });\n },\n getContentProps() {\n return normalize.element({\n ...parts.content.attrs,\n dir: prop(\"dir\"),\n id: getContentId(scope),\n role: !composite ? \"dialog\" : \"listbox\",\n tabIndex: -1,\n hidden: !open,\n \"data-state\": open ? \"open\" : \"closed\",\n \"data-placement\": context.get(\"currentPlacement\"),\n \"aria-labelledby\": getLabelId(scope),\n \"aria-multiselectable\": prop(\"multiple\") && composite ? true : void 0,\n \"data-empty\": dataAttr(collection2.size === 0),\n onPointerDown(event2) {\n if (!isLeftClick(event2)) return;\n event2.preventDefault();\n }\n });\n },\n getListProps() {\n return normalize.element({\n ...parts.list.attrs,\n role: !composite ? \"listbox\" : void 0,\n \"data-empty\": dataAttr(collection2.size === 0),\n \"aria-labelledby\": getLabelId(scope),\n \"aria-multiselectable\": prop(\"multiple\") && !composite ? true : void 0\n });\n },\n getClearTriggerProps() {\n return normalize.button({\n ...parts.clearTrigger.attrs,\n dir: prop(\"dir\"),\n id: getClearTriggerId(scope),\n type: \"button\",\n tabIndex: -1,\n disabled,\n \"data-invalid\": dataAttr(invalid),\n \"aria-label\": translations.clearTriggerLabel,\n \"aria-controls\": getInputId(scope),\n hidden: !context.get(\"value\").length,\n onPointerDown(event2) {\n if (!isLeftClick(event2)) return;\n event2.preventDefault();\n },\n onClick(event2) {\n if (event2.defaultPrevented) return;\n if (!interactive) return;\n send({ type: \"VALUE.CLEAR\", src: \"clear-trigger\" });\n }\n });\n },\n getItemState,\n getItemProps(props2) {\n const itemState = getItemState(props2);\n const value = itemState.value;\n return normalize.element({\n ...parts.item.attrs,\n dir: prop(\"dir\"),\n id: getItemId(scope, value),\n role: \"option\",\n tabIndex: -1,\n \"data-highlighted\": dataAttr(itemState.highlighted),\n \"data-state\": itemState.selected ? \"checked\" : \"unchecked\",\n \"aria-selected\": ariaAttr(itemState.highlighted),\n \"aria-disabled\": ariaAttr(itemState.disabled),\n \"data-disabled\": dataAttr(itemState.disabled),\n \"data-value\": itemState.value,\n onPointerMove() {\n if (itemState.disabled) return;\n if (itemState.highlighted) return;\n send({ type: \"ITEM.POINTER_MOVE\", value });\n },\n onPointerLeave() {\n if (props2.persistFocus) return;\n if (itemState.disabled) return;\n const prev = event.previous();\n const mouseMoved = prev?.type.includes(\"POINTER\");\n if (!mouseMoved) return;\n send({ type: \"ITEM.POINTER_LEAVE\", value });\n },\n onClick(event2) {\n if (isDownloadingEvent(event2)) return;\n if (isOpeningInNewTab(event2)) return;\n if (isContextMenuEvent(event2)) return;\n if (itemState.disabled) return;\n send({ type: \"ITEM.CLICK\", src: \"item-select\", value });\n }\n });\n },\n getItemTextProps(props2) {\n const itemState = getItemState(props2);\n return normalize.element({\n ...parts.itemText.attrs,\n dir: prop(\"dir\"),\n \"data-state\": itemState.selected ? \"checked\" : \"unchecked\",\n \"data-disabled\": dataAttr(itemState.disabled),\n \"data-highlighted\": dataAttr(itemState.highlighted)\n });\n },\n getItemIndicatorProps(props2) {\n const itemState = getItemState(props2);\n return normalize.element({\n \"aria-hidden\": true,\n ...parts.itemIndicator.attrs,\n dir: prop(\"dir\"),\n \"data-state\": itemState.selected ? \"checked\" : \"unchecked\",\n hidden: !itemState.selected\n });\n },\n getItemGroupProps(props2) {\n const { id } = props2;\n return normalize.element({\n ...parts.itemGroup.attrs,\n dir: prop(\"dir\"),\n id: getItemGroupId(scope, id),\n \"aria-labelledby\": getItemGroupLabelId(scope, id),\n \"data-empty\": dataAttr(collection2.size === 0),\n role: \"group\"\n });\n },\n getItemGroupLabelProps(props2) {\n const { htmlFor } = props2;\n return normalize.element({\n ...parts.itemGroupLabel.attrs,\n dir: prop(\"dir\"),\n id: getItemGroupLabelId(scope, htmlFor),\n role: \"presentation\"\n });\n }\n };\n}\nvar { guards, createMachine, choose } = setup();\nvar { and, not } = guards;\nvar machine = createMachine({\n props({ props: props2 }) {\n return {\n loopFocus: true,\n openOnClick: false,\n defaultValue: [],\n closeOnSelect: !props2.multiple,\n allowCustomValue: false,\n inputBehavior: \"none\",\n selectionBehavior: props2.multiple ? \"clear\" : \"replace\",\n openOnKeyPress: true,\n openOnChange: true,\n composite: true,\n navigate({ node }) {\n clickIfLink(node);\n },\n collection: collection.empty(),\n ...props2,\n positioning: {\n placement: \"bottom\",\n sameWidth: true,\n ...props2.positioning\n },\n translations: {\n triggerLabel: \"Toggle suggestions\",\n clearTriggerLabel: \"Clear value\",\n ...props2.translations\n }\n };\n },\n initialState({ prop }) {\n const open = prop(\"open\") || prop(\"defaultOpen\");\n return open ? \"suggesting\" : \"idle\";\n },\n context({ prop, bindable, getContext, getEvent }) {\n return {\n currentPlacement: bindable(() => ({\n defaultValue: void 0\n })),\n value: bindable(() => ({\n defaultValue: prop(\"defaultValue\"),\n value: prop(\"value\"),\n isEqual,\n hash(value) {\n return value.join(\",\");\n },\n onChange(value) {\n const context = getContext();\n const prevSelectedItems = context.get(\"selectedItems\");\n const collection2 = prop(\"collection\");\n const nextItems = value.map((v) => {\n const item = prevSelectedItems.find((item2) => collection2.getItemValue(item2) === v);\n return item || collection2.find(v);\n });\n context.set(\"selectedItems\", nextItems);\n prop(\"onValueChange\")?.({ value, items: nextItems });\n }\n })),\n highlightedValue: bindable(() => ({\n defaultValue: prop(\"defaultHighlightedValue\") || null,\n value: prop(\"highlightedValue\"),\n onChange(value) {\n const item = prop(\"collection\").find(value);\n prop(\"onHighlightChange\")?.({ highlightedValue: value, highlightedItem: item });\n }\n })),\n inputValue: bindable(() => {\n let inputValue = prop(\"inputValue\") || prop(\"defaultInputValue\") || \"\";\n const value = prop(\"defaultValue\") || prop(\"value\") || [];\n if (!inputValue.trim() && !prop(\"multiple\")) {\n const valueAsString = prop(\"collection\").stringifyMany(value);\n inputValue = match(prop(\"selectionBehavior\"), {\n preserve: inputValue || valueAsString,\n replace: valueAsString,\n clear: \"\"\n });\n }\n return {\n defaultValue: inputValue,\n value: prop(\"inputValue\"),\n onChange(value2) {\n const event = getEvent();\n const reason = (event.previousEvent || event).src;\n prop(\"onInputValueChange\")?.({ inputValue: value2, reason });\n }\n };\n }),\n highlightedItem: bindable(() => {\n const highlightedValue = prop(\"highlightedValue\");\n const highlightedItem = prop(\"collection\").find(highlightedValue);\n return { defaultValue: highlightedItem };\n }),\n selectedItems: bindable(() => {\n const value = prop(\"value\") || prop(\"defaultValue\") || [];\n const selectedItems = prop(\"collection\").findMany(value);\n return { defaultValue: selectedItems };\n })\n };\n },\n computed: {\n isInputValueEmpty: ({ context }) => context.get(\"inputValue\").length === 0,\n isInteractive: ({ prop }) => !(prop(\"readOnly\") || prop(\"disabled\")),\n autoComplete: ({ prop }) => prop(\"inputBehavior\") === \"autocomplete\",\n autoHighlight: ({ prop }) => prop(\"inputBehavior\") === \"autohighlight\",\n hasSelectedItems: ({ context }) => context.get(\"value\").length > 0,\n valueAsString: ({ context, prop }) => prop(\"collection\").stringifyItems(context.get(\"selectedItems\")),\n isCustomValue: ({ context, computed }) => context.get(\"inputValue\") !== computed(\"valueAsString\")\n },\n watch({ context, prop, track, action, send }) {\n track([() => context.hash(\"value\")], () => {\n action([\"syncSelectedItems\"]);\n });\n track([() => context.get(\"inputValue\")], () => {\n action([\"syncInputValue\"]);\n });\n track([() => context.get(\"highlightedValue\")], () => {\n action([\"syncHighlightedItem\", \"autofillInputValue\"]);\n });\n track([() => prop(\"open\")], () => {\n action([\"toggleVisibility\"]);\n });\n track([() => prop(\"collection\").toString()], () => {\n send({ type: \"CHILDREN_CHANGE\" });\n });\n },\n on: {\n \"SELECTED_ITEMS.SYNC\": {\n actions: [\"syncSelectedItems\"]\n },\n \"HIGHLIGHTED_VALUE.SET\": {\n actions: [\"setHighlightedValue\"]\n },\n \"HIGHLIGHTED_VALUE.CLEAR\": {\n actions: [\"clearHighlightedValue\"]\n },\n \"ITEM.SELECT\": {\n actions: [\"selectItem\"]\n },\n \"ITEM.CLEAR\": {\n actions: [\"clearItem\"]\n },\n \"VALUE.SET\": {\n actions: [\"setValue\"]\n },\n \"INPUT_VALUE.SET\": {\n actions: [\"setInputValue\"]\n },\n \"POSITIONING.SET\": {\n actions: [\"reposition\"]\n }\n },\n entry: choose([\n {\n guard: \"autoFocus\",\n actions: [\"setInitialFocus\"]\n }\n ]),\n states: {\n idle: {\n tags: [\"idle\", \"closed\"],\n entry: [\"scrollContentToTop\", \"clearHighlightedValue\"],\n on: {\n \"CONTROLLED.OPEN\": {\n target: \"interacting\"\n },\n \"TRIGGER.CLICK\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"setInitialFocus\", \"highlightFirstSelectedItem\", \"invokeOnOpen\"]\n },\n {\n target: \"interacting\",\n actions: [\"setInitialFocus\", \"highlightFirstSelectedItem\", \"invokeOnOpen\"]\n }\n ],\n \"INPUT.CLICK\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"highlightFirstSelectedItem\", \"invokeOnOpen\"]\n },\n {\n target: \"interacting\",\n actions: [\"highlightFirstSelectedItem\", \"invokeOnOpen\"]\n }\n ],\n \"INPUT.FOCUS\": {\n target: \"focused\"\n },\n OPEN: [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnOpen\"]\n },\n {\n target: \"interacting\",\n actions: [\"invokeOnOpen\"]\n }\n ],\n \"VALUE.CLEAR\": {\n target: \"focused\",\n actions: [\"clearInputValue\", \"clearSelectedItems\", \"setInitialFocus\"]\n }\n }\n },\n focused: {\n tags: [\"focused\", \"closed\"],\n entry: [\"scrollContentToTop\", \"clearHighlightedValue\"],\n on: {\n \"CONTROLLED.OPEN\": [\n {\n guard: \"isChangeEvent\",\n target: \"suggesting\"\n },\n {\n target: \"interacting\"\n }\n ],\n \"INPUT.CHANGE\": [\n {\n guard: and(\"isOpenControlled\", \"openOnChange\"),\n actions: [\"setInputValue\", \"invokeOnOpen\", \"highlightFirstItemIfNeeded\"]\n },\n {\n guard: \"openOnChange\",\n target: \"suggesting\",\n actions: [\"setInputValue\", \"invokeOnOpen\", \"highlightFirstItemIfNeeded\"]\n },\n {\n actions: [\"setInputValue\"]\n }\n ],\n \"LAYER.INTERACT_OUTSIDE\": {\n target: \"idle\"\n },\n \"INPUT.ESCAPE\": {\n guard: and(\"isCustomValue\", not(\"allowCustomValue\")),\n actions: [\"revertInputValue\"]\n },\n \"INPUT.BLUR\": {\n target: \"idle\"\n },\n \"INPUT.CLICK\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"highlightFirstSelectedItem\", \"invokeOnOpen\"]\n },\n {\n target: \"interacting\",\n actions: [\"highlightFirstSelectedItem\", \"invokeOnOpen\"]\n }\n ],\n \"TRIGGER.CLICK\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"setInitialFocus\", \"highlightFirstSelectedItem\", \"invokeOnOpen\"]\n },\n {\n target: \"interacting\",\n actions: [\"setInitialFocus\", \"highlightFirstSelectedItem\", \"invokeOnOpen\"]\n }\n ],\n \"INPUT.ARROW_DOWN\": [\n // == group 1 ==\n {\n guard: and(\"isOpenControlled\", \"autoComplete\"),\n actions: [\"invokeOnOpen\"]\n },\n {\n guard: \"autoComplete\",\n target: \"interacting\",\n actions: [\"invokeOnOpen\"]\n },\n // == group 2 ==\n {\n guard: \"isOpenControlled\",\n actions: [\"highlightFirstOrSelectedItem\", \"invokeOnOpen\"]\n },\n {\n target: \"interacting\",\n actions: [\"highlightFirstOrSelectedItem\", \"invokeOnOpen\"]\n }\n ],\n \"INPUT.ARROW_UP\": [\n // == group 1 ==\n {\n guard: \"autoComplete\",\n target: \"interacting\",\n actions: [\"invokeOnOpen\"]\n },\n {\n guard: \"autoComplete\",\n target: \"interacting\",\n actions: [\"invokeOnOpen\"]\n },\n // == group 2 ==\n {\n target: \"interacting\",\n actions: [\"highlightLastOrSelectedItem\", \"invokeOnOpen\"]\n },\n {\n target: \"interacting\",\n actions: [\"highlightLastOrSelectedItem\", \"invokeOnOpen\"]\n }\n ],\n OPEN: [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnOpen\"]\n },\n {\n target: \"interacting\",\n actions: [\"invokeOnOpen\"]\n }\n ],\n \"VALUE.CLEAR\": {\n actions: [\"clearInputValue\", \"clearSelectedItems\"]\n }\n }\n },\n interacting: {\n tags: [\"open\", \"focused\"],\n entry: [\"setInitialFocus\"],\n effects: [\"scrollToHighlightedItem\", \"trackDismissableLayer\", \"trackPlacement\", \"hideOtherElements\"],\n on: {\n \"CONTROLLED.CLOSE\": [\n {\n guard: \"restoreFocus\",\n target: \"focused\",\n actions: [\"setFinalFocus\"]\n },\n {\n target: \"idle\"\n }\n ],\n CHILDREN_CHANGE: [\n {\n guard: \"isHighlightedItemRemoved\",\n actions: [\"clearHighlightedValue\"]\n },\n {\n actions: [\"scrollToHighlightedItem\"]\n }\n ],\n \"INPUT.HOME\": {\n actions: [\"highlightFirstItem\"]\n },\n \"INPUT.END\": {\n actions: [\"highlightLastItem\"]\n },\n \"INPUT.ARROW_DOWN\": [\n {\n guard: and(\"autoComplete\", \"isLastItemHighlighted\"),\n actions: [\"clearHighlightedValue\", \"scrollContentToTop\"]\n },\n {\n actions: [\"highlightNextItem\"]\n }\n ],\n \"INPUT.ARROW_UP\": [\n {\n guard: and(\"autoComplete\", \"isFirstItemHighlighted\"),\n actions: [\"clearHighlightedValue\"]\n },\n {\n actions: [\"highlightPrevItem\"]\n }\n ],\n \"INPUT.ENTER\": [\n // == group 1 ==\n {\n guard: and(\"isOpenControlled\", \"isCustomValue\", not(\"hasHighlightedItem\"), not(\"allowCustomValue\")),\n actions: [\"revertInputValue\", \"invokeOnClose\"]\n },\n {\n guard: and(\"isCustomValue\", not(\"hasHighlightedItem\"), not(\"allowCustomValue\")),\n target: \"focused\",\n actions: [\"revertInputValue\", \"invokeOnClose\"]\n },\n // == group 2 ==\n {\n guard: and(\"isOpenControlled\", \"closeOnSelect\"),\n actions: [\"selectHighlightedItem\", \"invokeOnClose\"]\n },\n {\n guard: \"closeOnSelect\",\n target: \"focused\",\n actions: [\"selectHighlightedItem\", \"invokeOnClose\", \"setFinalFocus\"]\n },\n {\n actions: [\"selectHighlightedItem\"]\n }\n ],\n \"INPUT.CHANGE\": [\n {\n guard: \"autoComplete\",\n target: \"suggesting\",\n actions: [\"setInputValue\"]\n },\n {\n target: \"suggesting\",\n actions: [\"clearHighlightedValue\", \"setInputValue\"]\n }\n ],\n \"ITEM.POINTER_MOVE\": {\n actions: [\"setHighlightedValue\"]\n },\n \"ITEM.POINTER_LEAVE\": {\n actions: [\"clearHighlightedValue\"]\n },\n \"ITEM.CLICK\": [\n {\n guard: and(\"isOpenControlled\", \"closeOnSelect\"),\n actions: [\"selectItem\", \"invokeOnClose\"]\n },\n {\n guard: \"closeOnSelect\",\n target: \"focused\",\n actions: [\"selectItem\", \"invokeOnClose\", \"setFinalFocus\"]\n },\n {\n actions: [\"selectItem\"]\n }\n ],\n \"LAYER.ESCAPE\": [\n {\n guard: and(\"isOpenControlled\", \"autoComplete\"),\n actions: [\"syncInputValue\", \"invokeOnClose\"]\n },\n {\n guard: \"autoComplete\",\n target: \"focused\",\n actions: [\"syncInputValue\", \"invokeOnClose\"]\n },\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"focused\",\n actions: [\"invokeOnClose\", \"setFinalFocus\"]\n }\n ],\n \"TRIGGER.CLICK\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"focused\",\n actions: [\"invokeOnClose\"]\n }\n ],\n \"LAYER.INTERACT_OUTSIDE\": [\n // == group 1 ==\n {\n guard: and(\"isOpenControlled\", \"isCustomValue\", not(\"allowCustomValue\")),\n actions: [\"revertInputValue\", \"invokeOnClose\"]\n },\n {\n guard: and(\"isCustomValue\", not(\"allowCustomValue\")),\n target: \"idle\",\n actions: [\"revertInputValue\", \"invokeOnClose\"]\n },\n // == group 2 ==\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"idle\",\n actions: [\"invokeOnClose\"]\n }\n ],\n CLOSE: [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"focused\",\n actions: [\"invokeOnClose\", \"setFinalFocus\"]\n }\n ],\n \"VALUE.CLEAR\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"clearInputValue\", \"clearSelectedItems\", \"invokeOnClose\"]\n },\n {\n target: \"focused\",\n actions: [\"clearInputValue\", \"clearSelectedItems\", \"invokeOnClose\", \"setFinalFocus\"]\n }\n ]\n }\n },\n suggesting: {\n tags: [\"open\", \"focused\"],\n effects: [\"trackDismissableLayer\", \"scrollToHighlightedItem\", \"trackPlacement\", \"hideOtherElements\"],\n entry: [\"setInitialFocus\"],\n on: {\n \"CONTROLLED.CLOSE\": [\n {\n guard: \"restoreFocus\",\n target: \"focused\",\n actions: [\"setFinalFocus\"]\n },\n {\n target: \"idle\"\n }\n ],\n CHILDREN_CHANGE: [\n {\n guard: \"autoHighlight\",\n actions: [\"highlightFirstItem\"]\n },\n {\n guard: \"isHighlightedItemRemoved\",\n actions: [\"clearHighlightedValue\"]\n }\n ],\n \"INPUT.ARROW_DOWN\": {\n target: \"interacting\",\n actions: [\"highlightNextItem\"]\n },\n \"INPUT.ARROW_UP\": {\n target: \"interacting\",\n actions: [\"highlightPrevItem\"]\n },\n \"INPUT.HOME\": {\n target: \"interacting\",\n actions: [\"highlightFirstItem\"]\n },\n \"INPUT.END\": {\n target: \"interacting\",\n actions: [\"highlightLastItem\"]\n },\n \"INPUT.ENTER\": [\n // == group 1 ==\n {\n guard: and(\"isOpenControlled\", \"isCustomValue\", not(\"hasHighlightedItem\"), not(\"allowCustomValue\")),\n actions: [\"revertInputValue\", \"invokeOnClose\"]\n },\n {\n guard: and(\"isCustomValue\", not(\"hasHighlightedItem\"), not(\"allowCustomValue\")),\n target: \"focused\",\n actions: [\"revertInputValue\", \"invokeOnClose\"]\n },\n // == group 2 ==\n {\n guard: and(\"isOpenControlled\", \"closeOnSelect\"),\n actions: [\"selectHighlightedItem\", \"invokeOnClose\"]\n },\n {\n guard: \"closeOnSelect\",\n target: \"focused\",\n actions: [\"selectHighlightedItem\", \"invokeOnClose\", \"setFinalFocus\"]\n },\n {\n actions: [\"selectHighlightedItem\"]\n }\n ],\n \"INPUT.CHANGE\": {\n actions: [\"setInputValue\"]\n },\n \"LAYER.ESCAPE\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"focused\",\n actions: [\"invokeOnClose\"]\n }\n ],\n \"ITEM.POINTER_MOVE\": {\n target: \"interacting\",\n actions: [\"setHighlightedValue\"]\n },\n \"ITEM.POINTER_LEAVE\": {\n actions: [\"clearHighlightedValue\"]\n },\n \"LAYER.INTERACT_OUTSIDE\": [\n // == group 1 ==\n {\n guard: and(\"isOpenControlled\", \"isCustomValue\", not(\"allowCustomValue\")),\n actions: [\"revertInputValue\", \"invokeOnClose\"]\n },\n {\n guard: and(\"isCustomValue\", not(\"allowCustomValue\")),\n target: \"idle\",\n actions: [\"revertInputValue\", \"invokeOnClose\"]\n },\n // == group 2 ==\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"idle\",\n actions: [\"invokeOnClose\"]\n }\n ],\n \"TRIGGER.CLICK\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"focused\",\n actions: [\"invokeOnClose\"]\n }\n ],\n \"ITEM.CLICK\": [\n {\n guard: and(\"isOpenControlled\", \"closeOnSelect\"),\n actions: [\"selectItem\", \"invokeOnClose\"]\n },\n {\n guard: \"closeOnSelect\",\n target: \"focused\",\n actions: [\"selectItem\", \"invokeOnClose\", \"setFinalFocus\"]\n },\n {\n actions: [\"selectItem\"]\n }\n ],\n CLOSE: [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"focused\",\n actions: [\"invokeOnClose\", \"setFinalFocus\"]\n }\n ],\n \"VALUE.CLEAR\": [\n {\n guard: \"isOpenControlled\",\n actions: [\"clearInputValue\", \"clearSelectedItems\", \"invokeOnClose\"]\n },\n {\n target: \"focused\",\n actions: [\"clearInputValue\", \"clearSelectedItems\", \"invokeOnClose\", \"setFinalFocus\"]\n }\n ]\n }\n }\n },\n implementations: {\n guards: {\n isInputValueEmpty: ({ computed }) => computed(\"isInputValueEmpty\"),\n autoComplete: ({ computed, prop }) => computed(\"autoComplete\") && !prop(\"multiple\"),\n autoHighlight: ({ computed }) => computed(\"autoHighlight\"),\n isFirstItemHighlighted: ({ prop, context }) => prop(\"collection\").firstValue === context.get(\"highlightedValue\"),\n isLastItemHighlighted: ({ prop, context }) => prop(\"collection\").lastValue === context.get(\"highlightedValue\"),\n isCustomValue: ({ computed }) => computed(\"isCustomValue\"),\n allowCustomValue: ({ prop }) => !!prop(\"allowCustomValue\"),\n hasHighlightedItem: ({ context }) => context.get(\"highlightedValue\") != null,\n closeOnSelect: ({ prop }) => !!prop(\"closeOnSelect\"),\n isOpenControlled: ({ prop }) => prop(\"open\") != null,\n openOnChange: ({ prop, context }) => {\n const openOnChange = prop(\"openOnChange\");\n if (isBoolean(openOnChange)) return openOnChange;\n return !!openOnChange?.({ inputValue: context.get(\"inputValue\") });\n },\n restoreFocus: ({ event }) => event.restoreFocus == null ? true : !!event.restoreFocus,\n isChangeEvent: ({ event }) => event.previousEvent?.type === \"INPUT.CHANGE\",\n autoFocus: ({ prop }) => !!prop(\"autoFocus\"),\n isHighlightedItemRemoved: ({ prop, context }) => !prop(\"collection\").has(context.get(\"highlightedValue\"))\n },\n effects: {\n trackDismissableLayer({ send, prop, scope }) {\n if (prop(\"disableLayer\")) return;\n const contentEl = () => getContentEl(scope);\n return trackDismissableElement(contentEl, {\n defer: true,\n exclude: () => [getInputEl(scope), getTriggerEl(scope), getClearTriggerEl(scope)],\n onFocusOutside: prop(\"onFocusOutside\"),\n onPointerDownOutside: prop(\"onPointerDownOutside\"),\n onInteractOutside: prop(\"onInteractOutside\"),\n onEscapeKeyDown(event) {\n event.preventDefault();\n event.stopPropagation();\n send({ type: \"LAYER.ESCAPE\", src: \"escape-key\" });\n },\n onDismiss() {\n send({ type: \"LAYER.INTERACT_OUTSIDE\", src: \"interact-outside\", restoreFocus: false });\n }\n });\n },\n hideOtherElements({ scope }) {\n return ariaHidden([\n getInputEl(scope),\n getContentEl(scope),\n getTriggerEl(scope),\n getClearTriggerEl(scope)\n ]);\n },\n trackPlacement({ context, prop, scope }) {\n const anchorEl = () => getControlEl(scope) || getTriggerEl(scope);\n const positionerEl = () => getPositionerEl(scope);\n context.set(\"currentPlacement\", prop(\"positioning\").placement);\n return getPlacement(anchorEl, positionerEl, {\n ...prop(\"positioning\"),\n defer: true,\n onComplete(data) {\n context.set(\"currentPlacement\", data.placement);\n }\n });\n },\n scrollToHighlightedItem({ context, prop, scope, event }) {\n const inputEl = getInputEl(scope);\n let cleanups = [];\n const exec = (immediate) => {\n const pointer = event.current().type.includes(\"POINTER\");\n const highlightedValue = context.get(\"highlightedValue\");\n if (pointer || !highlightedValue) return;\n const itemEl = getItemEl(scope, highlightedValue);\n const contentEl = getContentEl(scope);\n const scrollToIndexFn = prop(\"scrollToIndexFn\");\n if (scrollToIndexFn) {\n const highlightedIndex = prop(\"collection\").indexOf(highlightedValue);\n scrollToIndexFn({ index: highlightedIndex, immediate });\n return;\n }\n const raf_cleanup = raf(() => {\n scrollIntoView(itemEl, { rootEl: contentEl, block: \"nearest\" });\n });\n cleanups.push(raf_cleanup);\n };\n const rafCleanup = raf(() => exec(true));\n cleanups.push(rafCleanup);\n const observerCleanup = observeAttributes(inputEl, {\n attributes: [\"aria-activedescendant\"],\n callback: () => exec(false)\n });\n cleanups.push(observerCleanup);\n return () => {\n cleanups.forEach((cleanup) => cleanup());\n };\n }\n },\n actions: {\n reposition({ context, prop, scope, event }) {\n const controlEl = () => getControlEl(scope);\n const positionerEl = () => getPositionerEl(scope);\n getPlacement(controlEl, positionerEl, {\n ...prop(\"positioning\"),\n ...event.options,\n defer: true,\n listeners: false,\n onComplete(data) {\n context.set(\"currentPlacement\", data.placement);\n }\n });\n },\n setHighlightedValue({ context, event }) {\n if (event.value == null) return;\n context.set(\"highlightedValue\", event.value);\n },\n clearHighlightedValue({ context }) {\n context.set(\"highlightedValue\", null);\n },\n selectHighlightedItem(params) {\n const { context, prop } = params;\n const collection2 = prop(\"collection\");\n const highlightedValue = context.get(\"highlightedValue\");\n if (!highlightedValue || !collection2.has(highlightedValue)) return;\n const nextValue = prop(\"multiple\") ? addOrRemove(context.get(\"value\"), highlightedValue) : [highlightedValue];\n prop(\"onSelect\")?.({ value: nextValue, itemValue: highlightedValue });\n context.set(\"value\", nextValue);\n const inputValue = match(prop(\"selectionBehavior\"), {\n preserve: context.get(\"inputValue\"),\n replace: collection2.stringifyMany(nextValue),\n clear: \"\"\n });\n context.set(\"inputValue\", inputValue);\n },\n scrollToHighlightedItem({ context, prop, scope }) {\n nextTick(() => {\n const highlightedValue = context.get(\"highlightedValue\");\n if (highlightedValue == null) return;\n const itemEl = getItemEl(scope, highlightedValue);\n const contentEl = getContentEl(scope);\n const scrollToIndexFn = prop(\"scrollToIndexFn\");\n if (scrollToIndexFn) {\n const highlightedIndex = prop(\"collection\").indexOf(highlightedValue);\n scrollToIndexFn({ index: highlightedIndex, immediate: true });\n return;\n }\n scrollIntoView(itemEl, { rootEl: contentEl, block: \"nearest\" });\n });\n },\n selectItem(params) {\n const { context, event, flush, prop } = params;\n if (event.value == null) return;\n flush(() => {\n const nextValue = prop(\"multiple\") ? addOrRemove(context.get(\"value\"), event.value) : [event.value];\n prop(\"onSelect\")?.({ value: nextValue, itemValue: event.value });\n context.set(\"value\", nextValue);\n const inputValue = match(prop(\"selectionBehavior\"), {\n preserve: context.get(\"inputValue\"),\n replace: prop(\"collection\").stringifyMany(nextValue),\n clear: \"\"\n });\n context.set(\"inputValue\", inputValue);\n });\n },\n clearItem(params) {\n const { context, event, flush, prop } = params;\n if (event.value == null) return;\n flush(() => {\n const nextValue = remove(context.get(\"value\"), event.value);\n context.set(\"value\", nextValue);\n const inputValue = match(prop(\"selectionBehavior\"), {\n preserve: context.get(\"inputValue\"),\n replace: prop(\"collection\").stringifyMany(nextValue),\n clear: \"\"\n });\n context.set(\"inputValue\", inputValue);\n });\n },\n setInitialFocus({ scope }) {\n raf(() => {\n focusInputEl(scope);\n });\n },\n setFinalFocus({ scope }) {\n raf(() => {\n const triggerEl = getTriggerEl(scope);\n if (triggerEl?.dataset.focusable == null) {\n focusInputEl(scope);\n } else {\n focusTriggerEl(scope);\n }\n });\n },\n syncInputValue({ context, scope, event }) {\n const inputEl = getInputEl(scope);\n if (!inputEl) return;\n inputEl.value = context.get(\"inputValue\");\n queueMicrotask(() => {\n if (event.current().type === \"INPUT.CHANGE\") return;\n setCaretToEnd(inputEl);\n });\n },\n setInputValue({ context, event }) {\n context.set(\"inputValue\", event.value);\n },\n clearInputValue({ context }) {\n context.set(\"inputValue\", \"\");\n },\n revertInputValue({ context, prop, computed }) {\n const selectionBehavior = prop(\"selectionBehavior\");\n const inputValue = match(selectionBehavior, {\n replace: computed(\"hasSelectedItems\") ? computed(\"valueAsString\") : \"\",\n preserve: context.get(\"inputValue\"),\n clear: \"\"\n });\n context.set(\"inputValue\", inputValue);\n },\n setValue(params) {\n const { context, flush, event, prop } = params;\n flush(() => {\n context.set(\"value\", event.value);\n const inputValue = match(prop(\"selectionBehavior\"), {\n preserve: context.get(\"inputValue\"),\n replace: prop(\"collection\").stringifyMany(event.value),\n clear: \"\"\n });\n context.set(\"inputValue\", inputValue);\n });\n },\n clearSelectedItems(params) {\n const { context, flush, prop } = params;\n flush(() => {\n context.set(\"value\", []);\n const inputValue = match(prop(\"selectionBehavior\"), {\n preserve: context.get(\"inputValue\"),\n replace: prop(\"collection\").stringifyMany([]),\n clear: \"\"\n });\n context.set(\"inputValue\", inputValue);\n });\n },\n scrollContentToTop({ prop, scope }) {\n const scrollToIndexFn = prop(\"scrollToIndexFn\");\n if (scrollToIndexFn) {\n scrollToIndexFn({ index: 0, immediate: true });\n } else {\n const contentEl = getContentEl(scope);\n if (!contentEl) return;\n contentEl.scrollTop = 0;\n }\n },\n invokeOnOpen({ prop, event }) {\n const reason = getOpenChangeReason(event);\n prop(\"onOpenChange\")?.({ open: true, reason });\n },\n invokeOnClose({ prop, event }) {\n const reason = getOpenChangeReason(event);\n prop(\"onOpenChange\")?.({ open: false, reason });\n },\n highlightFirstItem({ context, prop, scope }) {\n const exec = getContentEl(scope) ? queueMicrotask : raf;\n exec(() => {\n const value = prop(\"collection\").firstValue;\n if (value) context.set(\"highlightedValue\", value);\n });\n },\n highlightFirstItemIfNeeded({ computed, action }) {\n if (!computed(\"autoHighlight\")) return;\n action([\"highlightFirstItem\"]);\n },\n highlightLastItem({ context, prop, scope }) {\n const exec = getContentEl(scope) ? queueMicrotask : raf;\n exec(() => {\n const value = prop(\"collection\").lastValue;\n if (value) context.set(\"highlightedValue\", value);\n });\n },\n highlightNextItem({ context, prop }) {\n let value = null;\n const highlightedValue = context.get(\"highlightedValue\");\n const collection2 = prop(\"collection\");\n if (highlightedValue) {\n value = collection2.getNextValue(highlightedValue);\n if (!value && prop(\"loopFocus\")) value = collection2.firstValue;\n } else {\n value = collection2.firstValue;\n }\n if (value) context.set(\"highlightedValue\", value);\n },\n highlightPrevItem({ context, prop }) {\n let value = null;\n const highlightedValue = context.get(\"highlightedValue\");\n const collection2 = prop(\"collection\");\n if (highlightedValue) {\n value = collection2.getPreviousValue(highlightedValue);\n if (!value && prop(\"loopFocus\")) value = collection2.lastValue;\n } else {\n value = collection2.lastValue;\n }\n if (value) context.set(\"highlightedValue\", value);\n },\n highlightFirstSelectedItem({ context, prop }) {\n raf(() => {\n const [value] = prop(\"collection\").sort(context.get(\"value\"));\n if (value) context.set(\"highlightedValue\", value);\n });\n },\n highlightFirstOrSelectedItem({ context, prop, computed }) {\n raf(() => {\n let value = null;\n if (computed(\"hasSelectedItems\")) {\n value = prop(\"collection\").sort(context.get(\"value\"))[0];\n } else {\n value = prop(\"collection\").firstValue;\n }\n if (value) context.set(\"highlightedValue\", value);\n });\n },\n highlightLastOrSelectedItem({ context, prop, computed }) {\n raf(() => {\n const collection2 = prop(\"collection\");\n let value = null;\n if (computed(\"hasSelectedItems\")) {\n value = collection2.sort(context.get(\"value\"))[0];\n } else {\n value = collection2.lastValue;\n }\n if (value) context.set(\"highlightedValue\", value);\n });\n },\n autofillInputValue({ context, computed, prop, event, scope }) {\n const inputEl = getInputEl(scope);\n const collection2 = prop(\"collection\");\n if (!computed(\"autoComplete\") || !inputEl || !event.keypress) return;\n const valueText = collection2.stringify(context.get(\"highlightedValue\"));\n raf(() => {\n inputEl.value = valueText || context.get(\"inputValue\");\n });\n },\n syncSelectedItems(params) {\n queueMicrotask(() => {\n const { context, prop } = params;\n const collection2 = prop(\"collection\");\n const value = context.get(\"value\");\n const selectedItems = value.map((v) => {\n const item = context.get(\"selectedItems\").find((item2) => collection2.getItemValue(item2) === v);\n return item || collection2.find(v);\n });\n context.set(\"selectedItems\", selectedItems);\n const inputValue = match(prop(\"selectionBehavior\"), {\n preserve: context.get(\"inputValue\"),\n replace: collection2.stringifyMany(value),\n clear: \"\"\n });\n context.set(\"inputValue\", inputValue);\n });\n },\n syncHighlightedItem({ context, prop }) {\n const item = prop(\"collection\").find(context.get(\"highlightedValue\"));\n context.set(\"highlightedItem\", item);\n },\n toggleVisibility({ event, send, prop }) {\n send({ type: prop(\"open\") ? \"CONTROLLED.OPEN\" : \"CONTROLLED.CLOSE\", previousEvent: event });\n }\n }\n }\n});\nfunction getOpenChangeReason(event) {\n return (event.previousEvent || event).src;\n}\nvar props = createProps()([\n \"allowCustomValue\",\n \"autoFocus\",\n \"closeOnSelect\",\n \"collection\",\n \"composite\",\n \"defaultHighlightedValue\",\n \"defaultInputValue\",\n \"defaultOpen\",\n \"defaultValue\",\n \"dir\",\n \"disabled\",\n \"disableLayer\",\n \"form\",\n \"getRootNode\",\n \"highlightedValue\",\n \"id\",\n \"ids\",\n \"inputBehavior\",\n \"inputValue\",\n \"invalid\",\n \"loopFocus\",\n \"multiple\",\n \"name\",\n \"navigate\",\n \"onFocusOutside\",\n \"onHighlightChange\",\n \"onInputValueChange\",\n \"onInteractOutside\",\n \"onOpenChange\",\n \"onOpenChange\",\n \"onPointerDownOutside\",\n \"onSelect\",\n \"onValueChange\",\n \"open\",\n \"openOnChange\",\n \"openOnClick\",\n \"openOnKeyPress\",\n \"placeholder\",\n \"positioning\",\n \"readOnly\",\n \"required\",\n \"scrollToIndexFn\",\n \"selectionBehavior\",\n \"translations\",\n \"value\"\n]);\nvar splitProps = createSplitProps(props);\nvar itemGroupLabelProps = createProps()([\"htmlFor\"]);\nvar splitItemGroupLabelProps = createSplitProps(itemGroupLabelProps);\nvar itemGroupProps = createProps()([\"id\"]);\nvar splitItemGroupProps = createSplitProps(itemGroupProps);\nvar itemProps = createProps()([\"item\", \"persistFocus\"]);\nvar splitItemProps = createSplitProps(itemProps);\n\nexport { anatomy, collection, connect, itemGroupLabelProps, itemGroupProps, itemProps, machine, props, splitItemGroupLabelProps, splitItemGroupProps, splitItemProps, splitProps };\n","'use client';\nimport { createAnatomy } from '@zag-js/anatomy';\n\nconst fieldsetAnatomy = createAnatomy(\"fieldset\").parts(\"root\", \"errorText\", \"helperText\", \"legend\");\nconst parts = fieldsetAnatomy.build();\n\nexport { fieldsetAnatomy, parts };\n","\"use strict\";\nimport { comboboxAnatomy as comboboxAnatomy$1 } from '@ark-ui/react';\nimport { accordionAnatomy as accordionAnatomy$1 } from '@ark-ui/react/accordion';\nimport { createAnatomy } from '@ark-ui/react/anatomy';\nimport { clipboardAnatomy as clipboardAnatomy$1 } from '@ark-ui/react/clipboard';\nimport { colorPickerAnatomy as colorPickerAnatomy$1 } from '@ark-ui/react/color-picker';\nimport { dialogAnatomy as dialogAnatomy$1 } from '@ark-ui/react/dialog';\nimport { editableAnatomy as editableAnatomy$1 } from '@ark-ui/react/editable';\nimport { fieldAnatomy as fieldAnatomy$1 } from '@ark-ui/react/field';\nimport { fieldsetAnatomy as fieldsetAnatomy$1 } from '@ark-ui/react/fieldset';\nimport { fileUploadAnatomy as fileUploadAnatomy$1 } from '@ark-ui/react/file-upload';\nimport { menuAnatomy as menuAnatomy$1 } from '@ark-ui/react/menu';\nimport { popoverAnatomy as popoverAnatomy$1 } from '@ark-ui/react/popover';\nimport { radioGroupAnatomy as radioGroupAnatomy$1 } from '@ark-ui/react/radio-group';\nimport { ratingGroupAnatomy as ratingGroupAnatomy$1 } from '@ark-ui/react/rating-group';\nimport { selectAnatomy as selectAnatomy$1 } from '@ark-ui/react/select';\nimport { sliderAnatomy as sliderAnatomy$1 } from '@ark-ui/react/slider';\nimport { switchAnatomy as switchAnatomy$1 } from '@ark-ui/react/switch';\nexport { treeViewAnatomy } from '@ark-ui/react/tree-view';\nexport { avatarAnatomy } from '@ark-ui/react/avatar';\nexport { checkboxAnatomy } from '@ark-ui/react/checkbox';\nexport { collapsibleAnatomy } from '@ark-ui/react/collapsible';\nexport { hoverCardAnatomy } from '@ark-ui/react/hover-card';\nexport { numberInputAnatomy } from '@ark-ui/react/number-input';\nexport { pinInputAnatomy } from '@ark-ui/react/pin-input';\nexport { progressAnatomy } from '@ark-ui/react/progress';\nexport { qrCodeAnatomy } from '@ark-ui/react/qr-code';\nexport { segmentGroupAnatomy } from '@ark-ui/react/segment-group';\nexport { tooltipAnatomy } from '@ark-ui/react/tooltip';\n\nconst accordionAnatomy = accordionAnatomy$1.extendWith(\"itemBody\");\nconst actionBarAnatomy = createAnatomy(\"action-bar\").parts(\n \"positioner\",\n \"content\",\n \"separator\",\n \"selectionTrigger\",\n \"closeTrigger\"\n);\nconst alertAnatomy = createAnatomy(\"alert\").parts(\n \"title\",\n \"description\",\n \"root\",\n \"indicator\",\n \"content\"\n);\nconst breadcrumbAnatomy = createAnatomy(\"breadcrumb\").parts(\n \"link\",\n \"currentLink\",\n \"item\",\n \"list\",\n \"root\",\n \"ellipsis\",\n \"separator\"\n);\nconst blockquoteAnatomy = createAnatomy(\"blockquote\").parts(\n \"root\",\n \"icon\",\n \"content\",\n \"caption\"\n);\nconst cardAnatomy = createAnatomy(\"card\").parts(\n \"root\",\n \"header\",\n \"body\",\n \"footer\",\n \"title\",\n \"description\"\n);\nconst checkboxCardAnatomy = createAnatomy(\"checkbox-card\", [\n \"root\",\n \"control\",\n \"label\",\n \"description\",\n \"addon\",\n \"indicator\",\n \"content\"\n]);\nconst dataListAnatomy = createAnatomy(\"data-list\").parts(\n \"root\",\n \"item\",\n \"itemLabel\",\n \"itemValue\"\n);\nconst dialogAnatomy = dialogAnatomy$1.extendWith(\n \"header\",\n \"body\",\n \"footer\",\n \"backdrop\"\n);\nconst drawerAnatomy = dialogAnatomy$1.extendWith(\n \"header\",\n \"body\",\n \"footer\",\n \"backdrop\"\n);\nconst editableAnatomy = editableAnatomy$1.extendWith(\"textarea\");\nconst emptyStateAnatomy = createAnatomy(\"empty-state\", [\n \"root\",\n \"content\",\n \"indicator\",\n \"title\",\n \"description\"\n]);\nconst fieldAnatomy = fieldAnatomy$1.extendWith(\"requiredIndicator\");\nconst fieldsetAnatomy = fieldsetAnatomy$1.extendWith(\"content\");\nconst fileUploadAnatomy = fileUploadAnatomy$1.extendWith(\n \"itemContent\",\n \"dropzoneContent\",\n \"fileText\"\n);\nconst listAnatomy = createAnatomy(\"list\").parts(\n \"root\",\n \"item\",\n \"indicator\"\n);\nconst menuAnatomy = menuAnatomy$1.extendWith(\"itemCommand\");\nconst nativeSelectAnatomy = createAnatomy(\"select\").parts(\n \"root\",\n \"field\",\n \"indicator\"\n);\nconst popoverAnatomy = popoverAnatomy$1.extendWith(\n \"header\",\n \"body\",\n \"footer\"\n);\nconst radioGroupAnatomy = radioGroupAnatomy$1.extendWith(\n \"itemAddon\",\n \"itemIndicator\"\n);\nconst radioCardAnatomy = radioGroupAnatomy.extendWith(\n \"itemContent\",\n \"itemDescription\"\n);\nconst ratingGroupAnatomy = ratingGroupAnatomy$1.extendWith(\"itemIndicator\");\nconst selectAnatomy = selectAnatomy$1.extendWith(\"indicatorGroup\");\nconst comboboxAnatomy = comboboxAnatomy$1.extendWith(\n \"indicatorGroup\",\n \"empty\"\n);\nconst sliderAnatomy = sliderAnatomy$1.extendWith(\"markerIndicator\");\nconst statAnatomy = createAnatomy(\"stat\").parts(\n \"root\",\n \"label\",\n \"helpText\",\n \"valueText\",\n \"valueUnit\",\n \"indicator\"\n);\nconst statusAnatomy = createAnatomy(\"status\").parts(\"root\", \"indicator\");\nconst stepsAnatomy = createAnatomy(\"steps\", [\n \"root\",\n \"list\",\n \"item\",\n \"trigger\",\n \"indicator\",\n \"separator\",\n \"content\",\n \"title\",\n \"description\",\n \"nextTrigger\",\n \"prevTrigger\",\n \"progress\"\n]);\nconst switchAnatomy = switchAnatomy$1.extendWith(\"indicator\");\nconst tableAnatomy = createAnatomy(\"table\").parts(\n \"root\",\n \"header\",\n \"body\",\n \"row\",\n \"columnHeader\",\n \"cell\",\n \"footer\",\n \"caption\"\n);\nconst toastAnatomy = createAnatomy(\"toast\").parts(\n \"root\",\n \"title\",\n \"description\",\n \"indicator\",\n \"closeTrigger\",\n \"actionTrigger\"\n);\nconst tabsAnatomy = createAnatomy(\"tabs\").parts(\n \"root\",\n \"trigger\",\n \"list\",\n \"content\",\n \"contentGroup\",\n \"indicator\"\n);\nconst tagAnatomy = createAnatomy(\"tag\").parts(\n \"root\",\n \"label\",\n \"closeTrigger\",\n \"startElement\",\n \"endElement\"\n);\nconst timelineAnatomy = createAnatomy(\"timeline\").parts(\n \"root\",\n \"item\",\n \"content\",\n \"separator\",\n \"indicator\",\n \"connector\",\n \"title\",\n \"description\"\n);\nconst colorPickerAnatomy = colorPickerAnatomy$1.extendWith(\"channelText\");\nconst codeBlockAnatomy = createAnatomy(\"code-block\", [\n \"root\",\n \"content\",\n \"title\",\n \"header\",\n \"footer\",\n \"control\",\n \"overlay\",\n \"code\",\n \"codeText\",\n \"copyTrigger\",\n \"copyIndicator\",\n \"collapseTrigger\",\n \"collapseIndicator\",\n \"collapseText\"\n]);\nconst clipboardAnatomy = clipboardAnatomy$1.extendWith(\"valueText\");\n\nexport { accordionAnatomy, actionBarAnatomy, alertAnatomy, blockquoteAnatomy, breadcrumbAnatomy, cardAnatomy, checkboxCardAnatomy, clipboardAnatomy, codeBlockAnatomy, colorPickerAnatomy, comboboxAnatomy, dataListAnatomy, dialogAnatomy, drawerAnatomy, editableAnatomy, emptyStateAnatomy, fieldAnatomy, fieldsetAnatomy, fileUploadAnatomy, listAnatomy, menuAnatomy, nativeSelectAnatomy, popoverAnatomy, radioCardAnatomy, radioGroupAnatomy, ratingGroupAnatomy, selectAnatomy, sliderAnatomy, statAnatomy, statusAnatomy, stepsAnatomy, switchAnatomy, tableAnatomy, tabsAnatomy, tagAnatomy, timelineAnatomy, toastAnatomy };\n"],"names":["anatomy","createAnatomy","createProps","fieldsetAnatomy","accordionAnatomy","accordionAnatomy$1","actionBarAnatomy","alertAnatomy","breadcrumbAnatomy","blockquoteAnatomy","cardAnatomy","checkboxCardAnatomy","dataListAnatomy","dialogAnatomy","dialogAnatomy$1","drawerAnatomy","editableAnatomy","editableAnatomy$1","emptyStateAnatomy","fieldAnatomy","fieldAnatomy$1","fieldsetAnatomy$1","fileUploadAnatomy","fileUploadAnatomy$1","listAnatomy","menuAnatomy","menuAnatomy$1","nativeSelectAnatomy","popoverAnatomy","popoverAnatomy$1","radioGroupAnatomy","radioGroupAnatomy$1","radioCardAnatomy","ratingGroupAnatomy","ratingGroupAnatomy$1","selectAnatomy","selectAnatomy$1","comboboxAnatomy","comboboxAnatomy$1","sliderAnatomy","sliderAnatomy$1","statAnatomy","statusAnatomy","stepsAnatomy","switchAnatomy","switchAnatomy$1","tableAnatomy","toastAnatomy","tabsAnatomy","tagAnatomy","timelineAnatomy","colorPickerAnatomy","colorPickerAnatomy$1","codeBlockAnatomy","clipboardAnatomy$1"],"mappings":"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","x_google_ignoreList":[0,1,2]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import { useMemo as i, useState as l, createElement as k } from "react";
|
|
3
3
|
import { a as M, A as p } from "./avatar.component-BL6D6Lw_.js";
|
|
4
|
-
import { M as N } from "./menu.component-
|
|
4
|
+
import { M as N } from "./menu.component-WHzMw5ZI.js";
|
|
5
5
|
import { W as R } from "./text.component-DhuUgP3j.js";
|
|
6
6
|
import { B as G } from "./button.component-BO6oee_V.js";
|
|
7
7
|
import { T as O } from "./tooltip.component-CHohp2qn.js";
|
|
@@ -72,4 +72,4 @@ const X = ({
|
|
|
72
72
|
export {
|
|
73
73
|
X as A
|
|
74
74
|
};
|
|
75
|
-
//# sourceMappingURL=avatarGroup.component-
|
|
75
|
+
//# sourceMappingURL=avatarGroup.component-BPhQpVYM.js.map
|
package/dist/chunks/{avatarGroup.component-DgR3EqDJ.js.map → avatarGroup.component-BPhQpVYM.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatarGroup.component-
|
|
1
|
+
{"version":3,"file":"avatarGroup.component-BPhQpVYM.js","sources":["../../src/components/AvatarGroup/avatarGroup.component.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport { AvatarGroup as CAvatarGroup, AvatarGroupProps as CAvatarGroupProps } from '@chakra-ui/react/avatar';\nimport { Avatar, AvatarProps } from 'components/Avatar/avatar.component';\nimport { AvatarSize, AvatarVariant } from 'components/Avatar/avatar.types';\nimport { Menu, MenuProps } from 'components/Menu';\nimport { Text } from 'components/Text/text.component';\nimport { Button, ButtonProps } from 'components/Button';\nimport { Tooltip } from 'components/Tooltip/tooltip.component';\nimport { Box } from '@chakra-ui/react/box';\n\nexport interface AvatarGroupProps extends CAvatarGroupProps {\n /** Tooltip text for when the add button is hovered. */\n addButtonTooltipText?: string;\n /** Array of avatars to display in the group. */\n avatars: AvatarProps[];\n /** Maximum number of avatars to display before it shows a counter instead. */\n max?: number;\n /** Callback function when the add button is clicked. */\n onAdd?: () => void;\n /** Callback function when the remove button is clicked. */\n onRemove?: (value?: string) => void;\n /** If true, an add button will be displayed at the end of the avatar group.\n * @default true\n */\n showAddButton?: boolean;\n /** If true, a remove button will be displayed when hovering over an avatar.\n * @default false\n */\n showRemoveAvatarButton?: boolean;\n /** Size of the avatars in the group.\n * @default md\n */\n size?: AvatarSize;\n /** Variant of the avatars in the group.\n * @default default\n */\n variant?: AvatarVariant;\n /** Props to customize the add button Menu. See `Menu` for more information. */\n menuProps?: Omit<MenuProps, 'buttonProps'>;\n /** Data test id for the avatar group.\n * @default kibble-avatar-group\n */\n 'data-testid'?: string;\n}\n\nexport const AvatarGroup = ({\n avatars,\n max = 3,\n onAdd,\n onRemove,\n showAddButton = true,\n showRemoveAvatarButton = false,\n size = 'md',\n variant = 'default',\n menuProps,\n addButtonTooltipText,\n ['data-testid']: dataTestId = 'kibble-avatar-group',\n ...rest\n}: AvatarGroupProps): React.JSX.Element => {\n const mergedNames = useMemo(() => avatars.map((avatar) => avatar.name).join(', '), [avatars]);\n const spacing = size === 'xs' || size === 'sm' ? -1 : -2;\n const [hideTooltip, setHideTooltip] = useState(false);\n const [menuOpen, setMenuOpen] = useState(false);\n\n const buttonProps: ButtonProps = useMemo(() => {\n return {\n size: size === 'xl' ? 'lg' : size,\n variant: 'ghostNeutral',\n borderRadius: 'full',\n borderWidth: '1px',\n iconName: 'plus',\n borderColor: 'border',\n };\n }, [size]);\n\n return (\n <CAvatarGroup\n className=\"AvatarGroup\"\n data-testid={dataTestId}\n gap={0}\n spaceX={spacing}\n stacking=\"first-on-top\"\n size={size}\n {...rest}\n >\n {avatars.length > max ? (\n <Avatar size={size} variant=\"contrast\" showRemoveButton={false} tooltipProps={{ label: mergedNames }}>\n <Text size={size === 'xs' || size === 'sm' ? 'xs' : 'sm'} variant=\"onContrast\">\n {avatars.length.toString()}\n </Text>\n </Avatar>\n ) : (\n avatars.map((avatar) => (\n <Avatar\n {...avatar}\n key={avatar.name}\n size={size}\n variant={variant || avatar.variant}\n showRemoveButton={showRemoveAvatarButton}\n onRemove={onRemove}\n />\n ))\n )}\n {showAddButton && (\n <Tooltip disabled={!addButtonTooltipText?.length || hideTooltip} label={addButtonTooltipText || ''}>\n {menuProps ? (\n <Box>\n <Menu\n open={menuOpen}\n data-testid={`${dataTestId}-add-button`}\n {...menuProps}\n onOpenChange={({ open }) => {\n setHideTooltip(open);\n setMenuOpen(open);\n }}\n buttonProps={{\n ...buttonProps,\n hideCaret: true,\n }}\n />\n </Box>\n ) : (\n <Button {...buttonProps} onClick={onAdd} />\n )}\n </Tooltip>\n )}\n </CAvatarGroup>\n );\n};\n"],"names":["AvatarGroup","avatars","max","onAdd","onRemove","showAddButton","showRemoveAvatarButton","size","variant","menuProps","addButtonTooltipText","dataTestId","rest","mergedNames","useMemo","avatar","spacing","hideTooltip","setHideTooltip","useState","menuOpen","setMenuOpen","buttonProps","jsxs","CAvatarGroup","jsx","Avatar","Text","createElement","Tooltip","Box","Menu","open","Button"],"mappings":";;;;;;;;AA6CO,MAAMA,IAAc,CAAC;AAAA,EAC1B,SAAAC;AAAA,EACA,KAAAC,IAAM;AAAA,EACN,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,wBAAAC,IAAyB;AAAA,EACzB,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,WAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,CAAC,gBAAgBC,IAAa;AAAA,EAC9B,GAAGC;AACL,MAA2C;AACzC,QAAMC,IAAcC,EAAQ,MAAMb,EAAQ,IAAI,CAACc,MAAWA,EAAO,IAAI,EAAE,KAAK,IAAI,GAAG,CAACd,CAAO,CAAC,GACtFe,IAAUT,MAAS,QAAQA,MAAS,OAAO,KAAK,IAChD,CAACU,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9C,CAACC,GAAUC,CAAW,IAAIF,EAAS,EAAK,GAExCG,IAA2BR,EAAQ,OAChC;AAAA,IACL,MAAMP,MAAS,OAAO,OAAOA;AAAA,IAC7B,SAAS;AAAA,IACT,cAAc;AAAA,IACd,aAAa;AAAA,IACb,UAAU;AAAA,IACV,aAAa;AAAA,EACf,IACC,CAACA,CAAI,CAAC;AAGP,SAAAgB,gBAAAA,EAAA;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,eAAab;AAAA,MACb,KAAK;AAAA,MACL,QAAQK;AAAA,MACR,UAAS;AAAA,MACT,MAAAT;AAAA,MACC,GAAGK;AAAA,MAEH,UAAA;AAAA,QAAAX,EAAQ,SAASC,IACfuB,gBAAAA,EAAAA,IAAAC,GAAA,EAAO,MAAAnB,GAAY,SAAQ,YAAW,kBAAkB,IAAO,cAAc,EAAE,OAAOM,EAAY,GACjG,gCAACc,GAAK,EAAA,MAAMpB,MAAS,QAAQA,MAAS,OAAO,OAAO,MAAM,SAAQ,cAC/D,UAAAN,EAAQ,OAAO,YAClB,EACF,CAAA,IAEAA,EAAQ,IAAI,CAACc,MACX,gBAAAa;AAAA,UAACF;AAAA,UAAA;AAAA,YACE,GAAGX;AAAA,YACJ,KAAKA,EAAO;AAAA,YACZ,MAAAR;AAAA,YACA,SAASC,KAAWO,EAAO;AAAA,YAC3B,kBAAkBT;AAAA,YAClB,UAAAF;AAAA,UAAA;AAAA,QAAA,CAEH;AAAA,QAEFC,KACCoB,gBAAAA,EAAA,IAACI,GAAQ,EAAA,UAAU,CAACnB,GAAsB,UAAUO,GAAa,OAAOP,KAAwB,IAC7F,UAAAD,0BACEqB,GACC,EAAA,UAAAL,gBAAAA,EAAA;AAAA,UAACM;AAAA,UAAA;AAAA,YACC,MAAMX;AAAA,YACN,eAAa,GAAGT,CAAU;AAAA,YACzB,GAAGF;AAAA,YACJ,cAAc,CAAC,EAAE,MAAAuB,QAAW;AAC1B,cAAAd,EAAec,CAAI,GACnBX,EAAYW,CAAI;AAAA,YAClB;AAAA,YACA,aAAa;AAAA,cACX,GAAGV;AAAA,cACH,WAAW;AAAA,YAAA;AAAA,UACb;AAAA,QAAA,GAEJ,IAECG,gBAAAA,EAAA,IAAAQ,GAAA,EAAQ,GAAGX,GAAa,SAASnB,GAAO,EAE7C,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const o=require("./jsx-runtime-BjDatQAs.js"),r=require("react"),s=require("./avatar.component-BGgZoVJS.js"),f=require("./menu.component-
|
|
2
|
-
//# sourceMappingURL=avatarGroup.component-
|
|
1
|
+
"use strict";const o=require("./jsx-runtime-BjDatQAs.js"),r=require("react"),s=require("./avatar.component-BGgZoVJS.js"),f=require("./menu.component-D2V9Q1Y5.js"),A=require("./text.component-BDDz5KQP.js"),C=require("./button.component-DjdgBXDC.js"),_=require("./tooltip.component-DBw-hAPU.js"),k=require("./index-BQRnVsAg.js"),G=({avatars:n,max:c=3,onAdd:l,onRemove:m,showAddButton:x=!0,showRemoveAvatarButton:d=!1,size:t="md",variant:j="default",menuProps:a,addButtonTooltipText:u,["data-testid"]:i="kibble-avatar-group",...h})=>{const b=r.useMemo(()=>n.map(e=>e.name).join(", "),[n]),g=t==="xs"||t==="sm"?-1:-2,[R,v]=r.useState(!1),[q,E]=r.useState(!1),p=r.useMemo(()=>({size:t==="xl"?"lg":t,variant:"ghostNeutral",borderRadius:"full",borderWidth:"1px",iconName:"plus",borderColor:"border"}),[t]);return o.jsxRuntimeExports.jsxs(s.AvatarGroup,{className:"AvatarGroup","data-testid":i,gap:0,spaceX:g,stacking:"first-on-top",size:t,...h,children:[n.length>c?o.jsxRuntimeExports.jsx(s.Avatar,{size:t,variant:"contrast",showRemoveButton:!1,tooltipProps:{label:b},children:o.jsxRuntimeExports.jsx(A.WrappedText,{size:t==="xs"||t==="sm"?"xs":"sm",variant:"onContrast",children:n.length.toString()})}):n.map(e=>r.createElement(s.Avatar,{...e,key:e.name,size:t,variant:j||e.variant,showRemoveButton:d,onRemove:m})),x&&o.jsxRuntimeExports.jsx(_.Tooltip,{disabled:!u?.length||R,label:u||"",children:a?o.jsxRuntimeExports.jsx(k.Box,{children:o.jsxRuntimeExports.jsx(f.Menu,{open:q,"data-testid":`${i}-add-button`,...a,onOpenChange:({open:e})=>{v(e),E(e)},buttonProps:{...p,hideCaret:!0}})}):o.jsxRuntimeExports.jsx(C.Button,{...p,onClick:l})})]})};exports.AvatarGroup=G;
|
|
2
|
+
//# sourceMappingURL=avatarGroup.component-CJCQSIyr.js.map
|
package/dist/chunks/{avatarGroup.component-CIj4qETQ.js.map → avatarGroup.component-CJCQSIyr.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatarGroup.component-
|
|
1
|
+
{"version":3,"file":"avatarGroup.component-CJCQSIyr.js","sources":["../../src/components/AvatarGroup/avatarGroup.component.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport { AvatarGroup as CAvatarGroup, AvatarGroupProps as CAvatarGroupProps } from '@chakra-ui/react/avatar';\nimport { Avatar, AvatarProps } from 'components/Avatar/avatar.component';\nimport { AvatarSize, AvatarVariant } from 'components/Avatar/avatar.types';\nimport { Menu, MenuProps } from 'components/Menu';\nimport { Text } from 'components/Text/text.component';\nimport { Button, ButtonProps } from 'components/Button';\nimport { Tooltip } from 'components/Tooltip/tooltip.component';\nimport { Box } from '@chakra-ui/react/box';\n\nexport interface AvatarGroupProps extends CAvatarGroupProps {\n /** Tooltip text for when the add button is hovered. */\n addButtonTooltipText?: string;\n /** Array of avatars to display in the group. */\n avatars: AvatarProps[];\n /** Maximum number of avatars to display before it shows a counter instead. */\n max?: number;\n /** Callback function when the add button is clicked. */\n onAdd?: () => void;\n /** Callback function when the remove button is clicked. */\n onRemove?: (value?: string) => void;\n /** If true, an add button will be displayed at the end of the avatar group.\n * @default true\n */\n showAddButton?: boolean;\n /** If true, a remove button will be displayed when hovering over an avatar.\n * @default false\n */\n showRemoveAvatarButton?: boolean;\n /** Size of the avatars in the group.\n * @default md\n */\n size?: AvatarSize;\n /** Variant of the avatars in the group.\n * @default default\n */\n variant?: AvatarVariant;\n /** Props to customize the add button Menu. See `Menu` for more information. */\n menuProps?: Omit<MenuProps, 'buttonProps'>;\n /** Data test id for the avatar group.\n * @default kibble-avatar-group\n */\n 'data-testid'?: string;\n}\n\nexport const AvatarGroup = ({\n avatars,\n max = 3,\n onAdd,\n onRemove,\n showAddButton = true,\n showRemoveAvatarButton = false,\n size = 'md',\n variant = 'default',\n menuProps,\n addButtonTooltipText,\n ['data-testid']: dataTestId = 'kibble-avatar-group',\n ...rest\n}: AvatarGroupProps): React.JSX.Element => {\n const mergedNames = useMemo(() => avatars.map((avatar) => avatar.name).join(', '), [avatars]);\n const spacing = size === 'xs' || size === 'sm' ? -1 : -2;\n const [hideTooltip, setHideTooltip] = useState(false);\n const [menuOpen, setMenuOpen] = useState(false);\n\n const buttonProps: ButtonProps = useMemo(() => {\n return {\n size: size === 'xl' ? 'lg' : size,\n variant: 'ghostNeutral',\n borderRadius: 'full',\n borderWidth: '1px',\n iconName: 'plus',\n borderColor: 'border',\n };\n }, [size]);\n\n return (\n <CAvatarGroup\n className=\"AvatarGroup\"\n data-testid={dataTestId}\n gap={0}\n spaceX={spacing}\n stacking=\"first-on-top\"\n size={size}\n {...rest}\n >\n {avatars.length > max ? (\n <Avatar size={size} variant=\"contrast\" showRemoveButton={false} tooltipProps={{ label: mergedNames }}>\n <Text size={size === 'xs' || size === 'sm' ? 'xs' : 'sm'} variant=\"onContrast\">\n {avatars.length.toString()}\n </Text>\n </Avatar>\n ) : (\n avatars.map((avatar) => (\n <Avatar\n {...avatar}\n key={avatar.name}\n size={size}\n variant={variant || avatar.variant}\n showRemoveButton={showRemoveAvatarButton}\n onRemove={onRemove}\n />\n ))\n )}\n {showAddButton && (\n <Tooltip disabled={!addButtonTooltipText?.length || hideTooltip} label={addButtonTooltipText || ''}>\n {menuProps ? (\n <Box>\n <Menu\n open={menuOpen}\n data-testid={`${dataTestId}-add-button`}\n {...menuProps}\n onOpenChange={({ open }) => {\n setHideTooltip(open);\n setMenuOpen(open);\n }}\n buttonProps={{\n ...buttonProps,\n hideCaret: true,\n }}\n />\n </Box>\n ) : (\n <Button {...buttonProps} onClick={onAdd} />\n )}\n </Tooltip>\n )}\n </CAvatarGroup>\n );\n};\n"],"names":["AvatarGroup","avatars","max","onAdd","onRemove","showAddButton","showRemoveAvatarButton","size","variant","menuProps","addButtonTooltipText","dataTestId","rest","mergedNames","useMemo","avatar","spacing","hideTooltip","setHideTooltip","useState","menuOpen","setMenuOpen","buttonProps","jsxs","CAvatarGroup","jsx","Avatar","Text","createElement","Tooltip","Box","Menu","open","Button"],"mappings":"uUA6CaA,EAAc,CAAC,CAC1B,QAAAC,EACA,IAAAC,EAAM,EACN,MAAAC,EACA,SAAAC,EACA,cAAAC,EAAgB,GAChB,uBAAAC,EAAyB,GACzB,KAAAC,EAAO,KACP,QAAAC,EAAU,UACV,UAAAC,EACA,qBAAAC,EACA,CAAC,eAAgBC,EAAa,sBAC9B,GAAGC,CACL,IAA2C,CACzC,MAAMC,EAAcC,EAAA,QAAQ,IAAMb,EAAQ,IAAKc,GAAWA,EAAO,IAAI,EAAE,KAAK,IAAI,EAAG,CAACd,CAAO,CAAC,EACtFe,EAAUT,IAAS,MAAQA,IAAS,KAAO,GAAK,GAChD,CAACU,EAAaC,CAAc,EAAIC,EAAAA,SAAS,EAAK,EAC9C,CAACC,EAAUC,CAAW,EAAIF,EAAAA,SAAS,EAAK,EAExCG,EAA2BR,EAAAA,QAAQ,KAChC,CACL,KAAMP,IAAS,KAAO,KAAOA,EAC7B,QAAS,eACT,aAAc,OACd,YAAa,MACb,SAAU,OACV,YAAa,QACf,GACC,CAACA,CAAI,CAAC,EAGP,OAAAgB,EAAA,kBAAA,KAACC,EAAA,YAAA,CACC,UAAU,cACV,cAAab,EACb,IAAK,EACL,OAAQK,EACR,SAAS,eACT,KAAAT,EACC,GAAGK,EAEH,SAAA,CAAAX,EAAQ,OAASC,EACfuB,EAAAA,kBAAAA,IAAAC,EAAAA,OAAA,CAAO,KAAAnB,EAAY,QAAQ,WAAW,iBAAkB,GAAO,aAAc,CAAE,MAAOM,CAAY,EACjG,iCAACc,EAAAA,YAAK,CAAA,KAAMpB,IAAS,MAAQA,IAAS,KAAO,KAAO,KAAM,QAAQ,aAC/D,SAAAN,EAAQ,OAAO,WAClB,CACF,CAAA,EAEAA,EAAQ,IAAKc,GACXa,EAAA,cAACF,EAAA,OAAA,CACE,GAAGX,EACJ,IAAKA,EAAO,KACZ,KAAAR,EACA,QAASC,GAAWO,EAAO,QAC3B,iBAAkBT,EAClB,SAAAF,CAAA,CAAA,CAEH,EAEFC,GACCoB,EAAA,kBAAA,IAACI,UAAQ,CAAA,SAAU,CAACnB,GAAsB,QAAUO,EAAa,MAAOP,GAAwB,GAC7F,SAAAD,0BACEqB,EACC,IAAA,CAAA,SAAAL,EAAA,kBAAA,IAACM,EAAA,KAAA,CACC,KAAMX,EACN,cAAa,GAAGT,CAAU,cACzB,GAAGF,EACJ,aAAc,CAAC,CAAE,KAAAuB,KAAW,CAC1Bd,EAAec,CAAI,EACnBX,EAAYW,CAAI,CAClB,EACA,YAAa,CACX,GAAGV,EACH,UAAW,EAAA,CACb,CAAA,EAEJ,EAECG,EAAA,kBAAA,IAAAQ,SAAA,CAAQ,GAAGX,EAAa,QAASnB,EAAO,CAE7C,CAAA,CAAA,CAAA,CAEJ,CAEJ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import { forwardRef as y, useMemo as c } from "react";
|
|
3
3
|
import { B as G } from "./button.component-BO6oee_V.js";
|
|
4
|
-
import { M as P } from "./menu.component-
|
|
4
|
+
import { M as P } from "./menu.component-WHzMw5ZI.js";
|
|
5
5
|
import { u as d } from "./use-recipe-d63ABaZ3.js";
|
|
6
6
|
import { a as R } from "./icon-button-CcZMCNUJ.js";
|
|
7
7
|
import { G as k } from "./group-CplNJpRQ.js";
|
|
@@ -67,4 +67,4 @@ const $ = y(
|
|
|
67
67
|
export {
|
|
68
68
|
E as B
|
|
69
69
|
};
|
|
70
|
-
//# sourceMappingURL=buttonGroup.component-
|
|
70
|
+
//# sourceMappingURL=buttonGroup.component-CO5lC36l.js.map
|
package/dist/chunks/{buttonGroup.component-ITatUbCf.js.map → buttonGroup.component-CO5lC36l.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buttonGroup.component-
|
|
1
|
+
{"version":3,"file":"buttonGroup.component-CO5lC36l.js","sources":["../../node_modules/@chakra-ui/react/dist/esm/components/button/button-group.js","../../src/components/ButtonGroup/buttonGroup.component.tsx"],"sourcesContent":["\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { forwardRef, useMemo } from 'react';\nimport { useRecipe } from '../../styled-system/use-recipe.js';\nimport { ButtonPropsProvider } from './button.js';\nimport { Group } from '../group/group.js';\n\nconst ButtonGroup = forwardRef(\n function ButtonGroup2(props, ref) {\n const recipe = useRecipe({ key: \"button\" });\n const [variantProps, otherProps] = useMemo(\n () => recipe.splitVariantProps(props),\n [props, recipe]\n );\n return /* @__PURE__ */ jsx(ButtonPropsProvider, { value: variantProps, children: /* @__PURE__ */ jsx(Group, { ref, ...otherProps }) });\n }\n);\n\nexport { ButtonGroup };\n","import React, { useMemo } from 'react';\nimport { ButtonGroup as CButtonGroup, ButtonGroupProps as CButtonGroupProps } from '@chakra-ui/react/button';\nimport { GroupedButton } from './buttonGroup.types';\nimport { ButtonConfigVariant, ButtonSize, ButtonVariant } from 'components/Button/button.types';\nimport { Button } from 'components/Button/button.component';\nimport { SystemStyleObject, useRecipe } from '@chakra-ui/react/styled-system';\nimport { Menu, MenuProps } from 'components/Menu/menu.component';\n\nexport interface ButtonGroupProps extends CButtonGroupProps {\n /** An array of button objects to be rendered in the group. */\n buttons: GroupedButton[];\n /** Determines wether the button should render a contrasting variant. */\n onContrast?: boolean;\n /** Size of the button group.\n * @default md\n */\n size?: ButtonSize;\n /** Variants are used to adjust the button look and feel. Choose a variant that aligns with the button intent and role in the overall design. */\n variant?: ButtonVariant;\n /** If provided, a Menu will be rendered as the last element in the group. See `Menu` for more information. */\n menuProps?: MenuProps;\n /** Data test id for the button group.\n * @default kibble-button-group\n */\n 'data-testid'?: string;\n}\n\nexport const ButtonGroup = ({\n attached = true,\n borderColor,\n buttons,\n menuProps,\n onContrast = false,\n size = 'md',\n variant = 'primary',\n ['data-testid']: dataTestId = 'kibble-button-group',\n ...rest\n}: ButtonGroupProps): React.JSX.Element => {\n const computedVariant = useMemo(\n () => `${variant}${onContrast ? 'OnContrast' : ''}` as ButtonConfigVariant,\n [onContrast, variant],\n );\n const recipe = useRecipe({ key: 'button' });\n const styles = recipe({ variant: computedVariant })['@layer recipes'];\n const computedBorderColor =\n styles?.borderColor !== 'var(--chakra-colors-transparent)' ? styles?.borderColor : styles?.color;\n\n const buttonStyles: SystemStyleObject = {\n borderWidth: '1px',\n borderColor: borderColor || computedBorderColor,\n };\n\n return (\n <CButtonGroup className=\"ButtonGroup\" data-testid={dataTestId} attached={attached} {...rest}>\n {buttons.map(({ key, ...rest }, index) => (\n <Button\n key={key || index}\n size={size}\n variant={variant}\n onContrast={onContrast}\n {...rest}\n {...(attached && buttonStyles)}\n />\n ))}\n {menuProps && (\n <Menu\n data-testid={`${dataTestId}-menu`}\n positioning={{ placement: 'bottom' }}\n {...menuProps}\n buttonProps={{\n ...menuProps.buttonProps,\n size,\n variant,\n onContrast,\n ...(attached && {\n ...buttonStyles,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n }),\n }}\n />\n )}\n </CButtonGroup>\n );\n};\n"],"names":["ButtonGroup","forwardRef","props","ref","recipe","useRecipe","variantProps","otherProps","useMemo","jsx","ButtonPropsProvider","Group","attached","borderColor","buttons","menuProps","onContrast","size","variant","dataTestId","rest","computedVariant","styles","computedBorderColor","buttonStyles","jsxs","CButtonGroup","key","index","Button","Menu"],"mappings":";;;;;;;AAQA,MAAMA,IAAcC;AAAA,EAClB,SAAsBC,GAAOC,GAAK;AAChC,UAAMC,IAASC,EAAU,EAAE,KAAK,SAAQ,CAAE,GACpC,CAACC,GAAcC,CAAU,IAAIC;AAAA,MACjC,MAAMJ,EAAO,kBAAkBF,CAAK;AAAA,MACpC,CAACA,GAAOE,CAAM;AAAA,IACf;AACD,WAAuBK,gBAAAA,EAAG,IAACC,GAAqB,EAAE,OAAOJ,GAAc,UAA0BG,gBAAAA,MAAIE,GAAO,EAAE,KAAAR,GAAK,GAAGI,EAAU,CAAE,EAAC,CAAE;AAAA,EACzI;AACA,GCUaP,IAAc,CAAC;AAAA,EAC1B,UAAAY,IAAW;AAAA,EACX,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,CAAC,gBAAgBC,IAAa;AAAA,EAC9B,GAAGC;AACL,MAA2C;AACzC,QAAMC,IAAkBb;AAAA,IACtB,MAAM,GAAGU,CAAO,GAAGF,IAAa,eAAe,EAAE;AAAA,IACjD,CAACA,GAAYE,CAAO;AAAA,EACtB,GAEMI,IADSjB,EAAU,EAAE,KAAK,UAAU,EACpB,EAAE,SAASgB,EAAgB,CAAC,EAAE,gBAAgB,GAC9DE,IACJD,GAAQ,gBAAgB,qCAAqCA,GAAQ,cAAcA,GAAQ,OAEvFE,IAAkC;AAAA,IACtC,aAAa;AAAA,IACb,aAAaX,KAAeU;AAAA,EAC9B;AAGE,SAAAE,gBAAAA,OAACC,KAAa,WAAU,eAAc,eAAaP,GAAY,UAAAP,GAAqB,GAAGQ,GACpF,UAAA;AAAA,IAAAN,EAAQ,IAAI,CAAC,EAAE,KAAAa,GAAK,GAAGP,EAAAA,GAAQQ,MAC9BnB,gBAAAA,EAAA;AAAA,MAACoB;AAAA,MAAA;AAAA,QAEC,MAAAZ;AAAA,QACA,SAAAC;AAAA,QACA,YAAAF;AAAA,QACC,GAAGI;AAAAA,QACH,GAAIR,KAAYY;AAAA,MAAA;AAAA,MALZG,KAAOC;AAAA,IAAA,CAOf;AAAA,IACAb,KACCN,gBAAAA,EAAA;AAAA,MAACqB;AAAA,MAAA;AAAA,QACC,eAAa,GAAGX,CAAU;AAAA,QAC1B,aAAa,EAAE,WAAW,SAAS;AAAA,QAClC,GAAGJ;AAAA,QACJ,aAAa;AAAA,UACX,GAAGA,EAAU;AAAA,UACb,MAAAE;AAAA,UACA,SAAAC;AAAA,UACA,YAAAF;AAAA,UACA,GAAIJ,KAAY;AAAA,YACd,GAAGY;AAAA,YACH,qBAAqB;AAAA,YACrB,wBAAwB;AAAA,UAAA;AAAA,QAC1B;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GAEJ;AAEJ;","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("./jsx-runtime-BjDatQAs.js"),p=require("react"),q=require("./button.component-DjdgBXDC.js"),f=require("./menu.component-
|
|
2
|
-
//# sourceMappingURL=buttonGroup.component-
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-BjDatQAs.js"),p=require("react"),q=require("./button.component-DjdgBXDC.js"),f=require("./menu.component-D2V9Q1Y5.js"),a=require("./use-recipe-DaPWl_pL.js"),y=require("./icon-button-B9rScw-E.js"),G=require("./group-_vcW9myt.js"),E=p.forwardRef(function(s,i){const t=a.useRecipe({key:"button"}),[o,u]=p.useMemo(()=>t.splitVariantProps(s),[s,t]);return e.jsxRuntimeExports.jsx(y.ButtonPropsProvider,{value:o,children:e.jsxRuntimeExports.jsx(G.Group,{ref:i,...u})})}),P=({attached:r=!0,borderColor:s,buttons:i,menuProps:t,onContrast:o=!1,size:u="md",variant:n="primary",["data-testid"]:d="kibble-button-group",...l})=>{const x=p.useMemo(()=>`${n}${o?"OnContrast":""}`,[o,n]),c=a.useRecipe({key:"button"})({variant:x})["@layer recipes"],b=c?.borderColor!=="var(--chakra-colors-transparent)"?c?.borderColor:c?.color,m={borderWidth:"1px",borderColor:s||b};return e.jsxRuntimeExports.jsxs(E,{className:"ButtonGroup","data-testid":d,attached:r,...l,children:[i.map(({key:R,...j},B)=>e.jsxRuntimeExports.jsx(q.Button,{size:u,variant:n,onContrast:o,...j,...r&&m},R||B)),t&&e.jsxRuntimeExports.jsx(f.Menu,{"data-testid":`${d}-menu`,positioning:{placement:"bottom"},...t,buttonProps:{...t.buttonProps,size:u,variant:n,onContrast:o,...r&&{...m,borderTopLeftRadius:0,borderBottomLeftRadius:0}}})]})};exports.ButtonGroup=P;
|
|
2
|
+
//# sourceMappingURL=buttonGroup.component-pR0mvmm7.js.map
|
package/dist/chunks/{buttonGroup.component-BDN5oxew.js.map → buttonGroup.component-pR0mvmm7.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buttonGroup.component-
|
|
1
|
+
{"version":3,"file":"buttonGroup.component-pR0mvmm7.js","sources":["../../node_modules/@chakra-ui/react/dist/esm/components/button/button-group.js","../../src/components/ButtonGroup/buttonGroup.component.tsx"],"sourcesContent":["\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { forwardRef, useMemo } from 'react';\nimport { useRecipe } from '../../styled-system/use-recipe.js';\nimport { ButtonPropsProvider } from './button.js';\nimport { Group } from '../group/group.js';\n\nconst ButtonGroup = forwardRef(\n function ButtonGroup2(props, ref) {\n const recipe = useRecipe({ key: \"button\" });\n const [variantProps, otherProps] = useMemo(\n () => recipe.splitVariantProps(props),\n [props, recipe]\n );\n return /* @__PURE__ */ jsx(ButtonPropsProvider, { value: variantProps, children: /* @__PURE__ */ jsx(Group, { ref, ...otherProps }) });\n }\n);\n\nexport { ButtonGroup };\n","import React, { useMemo } from 'react';\nimport { ButtonGroup as CButtonGroup, ButtonGroupProps as CButtonGroupProps } from '@chakra-ui/react/button';\nimport { GroupedButton } from './buttonGroup.types';\nimport { ButtonConfigVariant, ButtonSize, ButtonVariant } from 'components/Button/button.types';\nimport { Button } from 'components/Button/button.component';\nimport { SystemStyleObject, useRecipe } from '@chakra-ui/react/styled-system';\nimport { Menu, MenuProps } from 'components/Menu/menu.component';\n\nexport interface ButtonGroupProps extends CButtonGroupProps {\n /** An array of button objects to be rendered in the group. */\n buttons: GroupedButton[];\n /** Determines wether the button should render a contrasting variant. */\n onContrast?: boolean;\n /** Size of the button group.\n * @default md\n */\n size?: ButtonSize;\n /** Variants are used to adjust the button look and feel. Choose a variant that aligns with the button intent and role in the overall design. */\n variant?: ButtonVariant;\n /** If provided, a Menu will be rendered as the last element in the group. See `Menu` for more information. */\n menuProps?: MenuProps;\n /** Data test id for the button group.\n * @default kibble-button-group\n */\n 'data-testid'?: string;\n}\n\nexport const ButtonGroup = ({\n attached = true,\n borderColor,\n buttons,\n menuProps,\n onContrast = false,\n size = 'md',\n variant = 'primary',\n ['data-testid']: dataTestId = 'kibble-button-group',\n ...rest\n}: ButtonGroupProps): React.JSX.Element => {\n const computedVariant = useMemo(\n () => `${variant}${onContrast ? 'OnContrast' : ''}` as ButtonConfigVariant,\n [onContrast, variant],\n );\n const recipe = useRecipe({ key: 'button' });\n const styles = recipe({ variant: computedVariant })['@layer recipes'];\n const computedBorderColor =\n styles?.borderColor !== 'var(--chakra-colors-transparent)' ? styles?.borderColor : styles?.color;\n\n const buttonStyles: SystemStyleObject = {\n borderWidth: '1px',\n borderColor: borderColor || computedBorderColor,\n };\n\n return (\n <CButtonGroup className=\"ButtonGroup\" data-testid={dataTestId} attached={attached} {...rest}>\n {buttons.map(({ key, ...rest }, index) => (\n <Button\n key={key || index}\n size={size}\n variant={variant}\n onContrast={onContrast}\n {...rest}\n {...(attached && buttonStyles)}\n />\n ))}\n {menuProps && (\n <Menu\n data-testid={`${dataTestId}-menu`}\n positioning={{ placement: 'bottom' }}\n {...menuProps}\n buttonProps={{\n ...menuProps.buttonProps,\n size,\n variant,\n onContrast,\n ...(attached && {\n ...buttonStyles,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n }),\n }}\n />\n )}\n </CButtonGroup>\n );\n};\n"],"names":["ButtonGroup","forwardRef","props","ref","recipe","useRecipe","variantProps","otherProps","useMemo","jsx","ButtonPropsProvider","Group","attached","borderColor","buttons","menuProps","onContrast","size","variant","dataTestId","rest","computedVariant","styles","computedBorderColor","buttonStyles","jsxs","CButtonGroup","key","index","Button","Menu"],"mappings":"iRAQMA,EAAcC,EAAU,WAC5B,SAAsBC,EAAOC,EAAK,CAChC,MAAMC,EAASC,EAAS,UAAC,CAAE,IAAK,QAAQ,CAAE,EACpC,CAACC,EAAcC,CAAU,EAAIC,EAAO,QACxC,IAAMJ,EAAO,kBAAkBF,CAAK,EACpC,CAACA,EAAOE,CAAM,CACf,EACD,OAAuBK,EAAG,kBAAA,IAACC,EAAmB,oBAAE,CAAE,MAAOJ,EAAc,SAA0BG,wBAAIE,EAAAA,MAAO,CAAE,IAAAR,EAAK,GAAGI,CAAU,CAAE,CAAC,CAAE,CACzI,CACA,ECUaP,EAAc,CAAC,CAC1B,SAAAY,EAAW,GACX,YAAAC,EACA,QAAAC,EACA,UAAAC,EACA,WAAAC,EAAa,GACb,KAAAC,EAAO,KACP,QAAAC,EAAU,UACV,CAAC,eAAgBC,EAAa,sBAC9B,GAAGC,CACL,IAA2C,CACzC,MAAMC,EAAkBb,EAAA,QACtB,IAAM,GAAGU,CAAO,GAAGF,EAAa,aAAe,EAAE,GACjD,CAACA,EAAYE,CAAO,CACtB,EAEMI,EADSjB,EAAA,UAAU,CAAE,IAAK,SAAU,EACpB,CAAE,QAASgB,CAAgB,CAAC,EAAE,gBAAgB,EAC9DE,EACJD,GAAQ,cAAgB,mCAAqCA,GAAQ,YAAcA,GAAQ,MAEvFE,EAAkC,CACtC,YAAa,MACb,YAAaX,GAAeU,CAC9B,EAGE,OAAAE,yBAACC,GAAa,UAAU,cAAc,cAAaP,EAAY,SAAAP,EAAqB,GAAGQ,EACpF,SAAA,CAAAN,EAAQ,IAAI,CAAC,CAAE,IAAAa,EAAK,GAAGP,CAAAA,EAAQQ,IAC9BnB,EAAA,kBAAA,IAACoB,EAAA,OAAA,CAEC,KAAAZ,EACA,QAAAC,EACA,WAAAF,EACC,GAAGI,EACH,GAAIR,GAAYY,CAAA,EALZG,GAAOC,CAAA,CAOf,EACAb,GACCN,EAAA,kBAAA,IAACqB,EAAA,KAAA,CACC,cAAa,GAAGX,CAAU,QAC1B,YAAa,CAAE,UAAW,QAAS,EAClC,GAAGJ,EACJ,YAAa,CACX,GAAGA,EAAU,YACb,KAAAE,EACA,QAAAC,EACA,WAAAF,EACA,GAAIJ,GAAY,CACd,GAAGY,EACH,oBAAqB,EACrB,uBAAwB,CAAA,CAC1B,CACF,CAAA,CACF,EAEJ,CAEJ","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const s=require("./jsx-runtime-BjDatQAs.js"),k=require("./index-BQRnVsAg.js"),c=require("./datePicker.provider-i35-VNAb.js"),j=require("./divider.component-BX3zyB7O.js"),b=require("./button.component-DjdgBXDC.js"),x=require("./format-CK7Imh-5.js"),u=require("./endOfMonth-ClO3w4vF.js"),R={today:"Today",thisWeek:"This Week",thisMonth:"This Month"},h=({footer:e,["data-testid"]:o="kibble-calendar-footer"})=>{const{goToDate:a,onDateSelect:n,onQuickOptionSelect:i}=c.useDatePickerContext(),d=()=>{if(e.type==="custom"){e.onClick();return}const r=new Date;switch(e.value){case"today":{const t=x.startOfDay(r);a(t),n(t);break}case"thisWeek":{const t=x.startOfWeek(r,{weekStartsOn:1}),l=u.endOfWeek(r,{weekStartsOn:1});a(t),i({startDate:t,endDate:l});break}case"thisMonth":{const t=u.startOfMonth(r),l=u.endOfMonth(r);a(t),i({startDate:t,endDate:l});break}}e.onClick?.()},m=e.type==="custom"?e.label:e.label??R[e.value];return s.jsxRuntimeExports.jsx(k.Box,{"data-testid":o,bg:"background.secondarySubtle",borderRadius:"md",p:2,w:"full",children:s.jsxRuntimeExports.jsx(b.Button,{variant:"secondarySubtle",size:"md",w:"full",onClick:d,children:m})})},D=["today"],p=e=>!D.includes(e),E=({["data-testid"]:e="kibble-calendar",withDateRange:o=!0,withHeaderTriggers:a=!1,footer:n,...i})=>{const d=o||n?.type==="preset"&&p(n.value);return s.jsxRuntimeExports.jsx(k.Box,{className:"Calendar","data-testid":e,maxW:n?"360px":"340px",children:s.jsxRuntimeExports.jsxs(c.DatePickerProvider,{withDateRange:d,...i,standalone:!0,children:[s.jsxRuntimeExports.jsx(c.DatePickerHeader,{withTriggers:a}),s.jsxRuntimeExports.jsx(j.Divider,{}),s.jsxRuntimeExports.jsx(c.DatePickerCalendar,{}),n&&s.jsxRuntimeExports.jsx(h,{footer:n})]})})};exports.Calendar=E;exports.CalendarFooterButton=h;exports.isRangePreset=p;
|
|
2
|
+
//# sourceMappingURL=calendar.component-6Z5lc-eR.js.map
|