@wssto2/vue-core 0.16.0 → 0.18.0

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.
Files changed (160) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +5 -3
  3. package/bin/architecture/engine.mjs +3 -0
  4. package/bin/architecture/permissions.mjs +56 -0
  5. package/bin/architecture/rules.mjs +17 -0
  6. package/bin/commands/check-architecture.mjs +19 -0
  7. package/bin/config.mjs +2 -0
  8. package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-BH3f0hda.js → AccessGate.vue_vue_type_script_setup_true_lang-Bg8JFAOT.js} +1 -1
  9. package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js → ActionRow.vue_vue_type_script_setup_true_lang-B5IMNnTf.js} +4 -4
  10. package/dist/{Activity-DOUuIkZR.js → Activity-CiYn5E6A.js} +7 -7
  11. package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-d_dPurWG.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-oXWQTfBs.js} +1 -1
  12. package/dist/{Changes-BfcbVgmu.js → Changes-Cy8STpLX.js} +3 -3
  13. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-B5hSkJ2N.js → CollectionPage.vue_vue_type_script_setup_true_lang-Dr6nFNBB.js} +6 -6
  14. package/dist/{DataTable.vue_vue_type_script_setup_true_lang-DbRS37n3.js → DataTable.vue_vue_type_script_setup_true_lang-D372wlxR.js} +1 -1
  15. package/dist/{DateField.vue_vue_type_script_setup_true_lang-DzCvYHAf.js → DateField.vue_vue_type_script_setup_true_lang-D0KcfW8R.js} +17 -16
  16. package/dist/{DeadLetters-CuMvfXH8.js → DeadLetters-DhJkMpd_.js} +4 -4
  17. package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-dsO1m9Mm.js → FormGroup.vue_vue_type_script_setup_true_lang-lvAuBG-0.js} +2 -2
  18. package/dist/FormRow.vue_vue_type_script_setup_true_lang-CpgNVQF4.js +160 -0
  19. package/dist/{FormView.vue_vue_type_script_setup_true_lang-Bq_Qa4py.js → FormView.vue_vue_type_script_setup_true_lang-D01Jr4UU.js} +5 -5
  20. package/dist/{General-B5vcSEhP.js → General-CwTPC5UP.js} +10 -10
  21. package/dist/{IncidentRecord-wmStcEag.js → IncidentRecord-hXEGuLGg.js} +13 -13
  22. package/dist/{IncidentsList-CFx5tsxP.js → IncidentsList-C41VyDwK.js} +6 -6
  23. package/dist/{NewRolePage-CZxAp7LR.js → NewRolePage-BYYZJkK7.js} +3 -3
  24. package/dist/{NumberField.vue_vue_type_script_setup_true_lang-U-_kcnGr.js → NumberField.vue_vue_type_script_setup_true_lang-BhNZgEW6.js} +7 -6
  25. package/dist/{PersonAccess.vue_vue_type_script_setup_true_lang-BPDh9s2m.js → PersonAccess.vue_vue_type_script_setup_true_lang-mYFuG-Y3.js} +56 -56
  26. package/dist/{ProfilePage-B-T8kBcc.js → ProfilePage-DGEsIycR.js} +13 -13
  27. package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-Bt5mT19g.js → RecordHeader.vue_vue_type_script_setup_true_lang-B3BnYg1x.js} +1 -1
  28. package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-DOiFuJnH.js → ResourcePage.vue_vue_type_script_setup_true_lang-1iZtj3rh.js} +1 -1
  29. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-CqSsNPCw.js → RoleEditor.vue_vue_type_script_setup_true_lang-BslSDDiM.js} +9 -9
  30. package/dist/{RolePage-zcUWpuDE.js → RolePage-C08ZUqw1.js} +9 -9
  31. package/dist/{RolesPage-C7_zWw-c.js → RolesPage-FOuY1VKg.js} +10 -10
  32. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-BlCx9dVL.js → SectionNavigator.vue_vue_type_script_setup_true_lang-DCTFxfPB.js} +2 -2
  33. package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-zv_AxpBn.js → SegmentedField.vue_vue_type_script_setup_true_lang-CLR6EvzO.js} +13 -12
  34. package/dist/{SelectField.vue_vue_type_script_setup_true_lang-CLkoPbGm.js → SelectField.vue_vue_type_script_setup_true_lang-D5xYofdb.js} +10 -9
  35. package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-C2D_D5Hi.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-CDr4WNIb.js} +9 -9
  36. package/dist/{ServiceAccountRecord-BYxpHzTR.js → ServiceAccountRecord-kWwIQGZb.js} +12 -12
  37. package/dist/{ServiceAccountsList-BUuK-RUj.js → ServiceAccountsList-CKy9_YHP.js} +8 -8
  38. package/dist/{Sessions-Cm-Kilwl.js → Sessions-BDc8gdYH.js} +4 -4
  39. package/dist/{SettingsPage-Bavl0K-F.js → SettingsPage-t-8kmFVT.js} +13 -13
  40. package/dist/{SignIn-SfEhFiyM.js → SignIn-CqtkvtCZ.js} +7 -7
  41. package/dist/{SignInPage-BU0n2ehq.js → SignInPage-DcdNKZIb.js} +4 -4
  42. package/dist/{SignIns-Ahbn5cO6.js → SignIns-D4-nGu0B.js} +3 -3
  43. package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-Ds4q0bbl.js → SwitchField.vue_vue_type_script_setup_true_lang-CLtcuofe.js} +15 -14
  44. package/dist/{TextField.vue_vue_type_script_setup_true_lang-CWIeeZRE.js → TextField.vue_vue_type_script_setup_true_lang-CVGh-p3J.js} +7 -6
  45. package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-D2j4s96s.js → TextareaField.vue_vue_type_script_setup_true_lang-YxUlNHSk.js} +6 -5
  46. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-C1mLvOkc.js → TimeField.vue_vue_type_script_setup_true_lang-DHNC_MLt.js} +30 -29
  47. package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-jCXYFLtq.js → Timestamp.vue_vue_type_script_setup_true_lang-d_KuxWjH.js} +1 -1
  48. package/dist/{UserRecord-3pCKMHkq.js → UserRecord-CwZCr9Im.js} +10 -10
  49. package/dist/{UsersList-vw3aDpvo.js → UsersList-Cn19sFgv.js} +4 -4
  50. package/dist/access/index.js +4 -4
  51. package/dist/app/application.d.ts +2 -0
  52. package/dist/app/index.js +2 -2
  53. package/dist/app/validate.d.ts +3 -1
  54. package/dist/{application-CHPpOssP.js → application-CDSweJb9.js} +144 -142
  55. package/dist/collection/DynamicCollection.vue.d.ts +69 -0
  56. package/dist/collection/authors.d.ts +27 -0
  57. package/dist/collection/definition.d.ts +4 -4
  58. package/dist/collection/dynamicColumns.d.ts +13 -0
  59. package/dist/collection/index.d.ts +3 -0
  60. package/dist/collection/index.js +196 -142
  61. package/dist/config/index.d.ts +42 -0
  62. package/dist/config/index.js +12 -3
  63. package/dist/content/Panel.vue.d.ts +1 -1
  64. package/dist/content/index.js +2 -2
  65. package/dist/{contributions-9CPT-Z5v.js → contributions-B0x5x5xD.js} +1 -1
  66. package/dist/form/CommandDialog.vue.d.ts +1 -1
  67. package/dist/form/DateField.vue.d.ts +1 -1
  68. package/dist/form/DateTimeField.vue.d.ts +1 -1
  69. package/dist/form/FileField.vue.d.ts +1 -1
  70. package/dist/form/FormRow.vue.d.ts +2 -2
  71. package/dist/form/I18nField.vue.d.ts +2 -2
  72. package/dist/form/TextField.vue.d.ts +1 -1
  73. package/dist/form/TextareaField.vue.d.ts +2 -2
  74. package/dist/form/date/value.d.ts +21 -0
  75. package/dist/form/dynamic/DynamicForm.vue.d.ts +46 -0
  76. package/dist/form/dynamic/RepeatField.vue.d.ts +47 -0
  77. package/dist/form/dynamic/ResourceField.vue.d.ts +38 -0
  78. package/dist/form/dynamic/ResourcePickerList.vue.d.ts +12 -0
  79. package/dist/form/dynamic/RichTextField.vue.d.ts +40 -0
  80. package/dist/form/dynamic/localeMode.d.ts +5 -0
  81. package/dist/form/dynamic/resources.d.ts +34 -0
  82. package/dist/form/dynamic/schema.d.ts +73 -0
  83. package/dist/form/dynamic/validator.d.ts +30 -0
  84. package/dist/form/dynamic/visibility.d.ts +12 -0
  85. package/dist/form/index.d.ts +12 -0
  86. package/dist/form/index.js +2100 -1260
  87. package/dist/format/format.d.ts +8 -2
  88. package/dist/format/index.js +1 -1
  89. package/dist/format-C_HXlOYQ.js +136 -0
  90. package/dist/{guards-6fJxfUtk.js → guards-CNJ0ATVC.js} +1 -1
  91. package/dist/i18n/index.d.ts +14 -2
  92. package/dist/i18n/index.js +86 -75
  93. package/dist/i18n/messages.d.ts +10 -1
  94. package/dist/i18n/runtime.d.ts +3 -1
  95. package/dist/identity/index.js +3 -3
  96. package/dist/identity/profile/EmailChangeDialog.vue.d.ts +2 -2
  97. package/dist/identity/users/list.d.ts +1 -1
  98. package/dist/incidents/index.js +1 -1
  99. package/dist/{index-D9_xqF5g.js → index-1HS7O2-e.js} +9 -9
  100. package/dist/{index-nByFc1eL.js → index-BA2w8uwD.js} +86 -86
  101. package/dist/{index-Ct7W_gYE.js → index-SLJWm40T.js} +4 -4
  102. package/dist/index.d.ts +1 -1
  103. package/dist/index.js +1 -1
  104. package/dist/modal/DiscardChangesModal.vue.d.ts +2 -2
  105. package/dist/modal/Modal.vue.d.ts +2 -2
  106. package/dist/modal/Sheet.vue.d.ts +2 -2
  107. package/dist/modules/identity/routes.d.ts +1 -1
  108. package/dist/modules/identity/schemas.d.ts +2 -2
  109. package/dist/{navigation-DMJ6akat.js → navigation-d-JAPBGA.js} +1 -1
  110. package/dist/{neighbors-BpypL3Wb.js → neighbors-Dg_LU9ry.js} +1 -1
  111. package/dist/notifications/index.js +1 -1
  112. package/dist/onboarding/index.js +1 -1
  113. package/dist/options-mOOX6JSS.js +214 -0
  114. package/dist/overlay/AlertDialog.vue.d.ts +3 -3
  115. package/dist/overlay/Menu.vue.d.ts +2 -2
  116. package/dist/overlay/PhotoViewer.vue.d.ts +2 -2
  117. package/dist/overlay/Popover.vue.d.ts +2 -2
  118. package/dist/page/SectionNavigator.vue.d.ts +1 -1
  119. package/dist/page/SectionPanel.vue.d.ts +1 -1
  120. package/dist/page/index.js +3 -3
  121. package/dist/phone/index.js +57 -56
  122. package/dist/platform/index.d.ts +10 -1
  123. package/dist/platform/index.js +16 -15
  124. package/dist/platform/platform.d.ts +4 -2
  125. package/dist/{platform-ORzRR3Tw.js → platform-DU9QFts8.js} +7 -6
  126. package/dist/playwright/config.d.ts +33 -0
  127. package/dist/playwright/index.d.ts +2 -0
  128. package/dist/playwright/index.js +192 -171
  129. package/dist/resource/index.js +1 -1
  130. package/dist/resources-BZLlAtoS.js +62 -0
  131. package/dist/router/index.js +3 -3
  132. package/dist/{rowLayout-QKfNHsML.js → rowLayout-PIuD7MGo.js} +2 -2
  133. package/dist/{sections-CSpJN0Z7.js → sections-BpiRLntE.js} +1 -1
  134. package/dist/{serverMessages-Ce8-MK4e.js → serverMessages-C_KkDvpT.js} +1 -1
  135. package/dist/shell/index.js +4 -4
  136. package/dist/state/NextStepPanel.vue.d.ts +63 -0
  137. package/dist/state/PhaseTiles.vue.d.ts +20 -0
  138. package/dist/state/PhaseTrack.vue.d.ts +48 -0
  139. package/dist/state/RequirementList.vue.d.ts +10 -0
  140. package/dist/state/TodoRow.vue.d.ts +52 -0
  141. package/dist/state/index.d.ts +9 -0
  142. package/dist/state/index.js +731 -126
  143. package/dist/state/phaseStep.d.ts +7 -0
  144. package/dist/state/phaseTile.d.ts +10 -0
  145. package/dist/state/requirementItem.d.ts +16 -0
  146. package/dist/state/todoRow.d.ts +8 -0
  147. package/dist/{state-QDaxntgR.js → state-z1iPF1DT.js} +1 -1
  148. package/dist/styles.css +1 -1
  149. package/dist/{suggestions-q_v3M7G6.js → suggestions-DeMgs_ki.js} +1 -1
  150. package/dist/testing/format.d.ts +1 -1
  151. package/dist/testing/index.js +31 -31
  152. package/dist/{useCommand-DAMgQ5NE.js → useCommand-DQKvro1n.js} +2 -2
  153. package/dist/{useGroupSheet-B-Hs4gNO.js → useGroupSheet-CRw3MUmX.js} +3 -3
  154. package/dist/{usePreferences-BfMXVbSO.js → usePreferences-DB29UTFD.js} +1 -1
  155. package/dist/{useRecordDialog-QPKFH1Ww.js → useRecordDialog-0azHxxvm.js} +1 -1
  156. package/dist/{useResourceForm-Oa6bk3NI.js → useResourceForm-zVuWerSn.js} +1 -1
  157. package/dist/{useTypedEntry-CITij2C_.js → useTypedEntry-BsMV66Yc.js} +46 -45
  158. package/package.json +6 -1
  159. package/dist/format-Cp1h0vsC.js +0 -125
  160. package/dist/options-B48UiYsG.js +0 -368
@@ -1,109 +1,110 @@
1
- import { a as ot, _ as We, c as nt, f as st } from "../FormGroup.vue_vue_type_script_setup_true_lang-dsO1m9Mm.js";
2
- import { E as Bo, b as Lo, d as To, p as qo, r as zo, u as Vo, e as Do, g as Ro } from "../FormGroup.vue_vue_type_script_setup_true_lang-dsO1m9Mm.js";
3
- import { f as qe } from "../useCommand-DAMgQ5NE.js";
4
- import { _ as Io, a as jo, u as Oo } from "../useCommand-DAMgQ5NE.js";
5
- import { ref as P, computed as h, defineComponent as G, openBlock as d, createBlock as R, mergeProps as J, unref as s, createSlots as Z, withCtx as f, createElementVNode as p, normalizeClass as j, createElementBlock as y, Fragment as de, renderList as $e, createVNode as I, createCommentVNode as q, toDisplayString as C, renderSlot as S, mergeDefaults as ce, useModel as re, useId as Re, withKeys as Se, withModifiers as pe, createTextVNode as H, mergeModels as le, useTemplateRef as U, shallowRef as Ne, watch as ge, normalizeProps as ze, guardReactiveProps as Ve, nextTick as xe, provide as rt, inject as Je, onBeforeUnmount as Ze, getCurrentScope as it, onScopeDispose as ut, toValue as dt, shallowReactive as Ae, normalizeStyle as ct, resolveDynamicComponent as ft } from "vue";
6
- import { a as Xe } from "../leaveGuard-Cc8yeLxM.js";
7
- import { M as No, c as Ao, i as Go, l as Ko, u as Po } from "../leaveGuard-Cc8yeLxM.js";
8
- import { _ as Uo } from "../LeaveGuardRoot.vue_vue_type_script_setup_true_lang-CrGrjrlO.js";
9
- import { u as Wo } from "../useResourceForm-Oa6bk3NI.js";
10
- import { _ as X } from "../Icon.vue_vue_type_script_lang-BhhsFYwp.js";
11
- import { u as Qe, _ as ye, f as fe, b as me, a as et, e as Me, g as mt, j as vt, k as pt } from "../options-B48UiYsG.js";
12
- import { d as Zo, h as Xo, m as Qo } from "../options-B48UiYsG.js";
13
- import { useI18n as oe } from "vue-i18n";
14
- import { b as bt } from "../controlSurface-t7OEFESJ.js";
15
- import { a as gt } from "../TextField.vue_vue_type_script_setup_true_lang-CWIeeZRE.js";
16
- import { _ as tn } from "../TextField.vue_vue_type_script_setup_true_lang-CWIeeZRE.js";
17
- import { u as yt, l as ht } from "../suggestions-q_v3M7G6.js";
18
- import { r as ln } from "../suggestions-q_v3M7G6.js";
19
- import { s as _e, u as Ge, i as kt, o as Ce, e as Fe, k as xt, _ as wt, l as $t, c as _t, b as Ct, t as Te, g as St, q as Ft } from "../useTypedEntry-CITij2C_.js";
20
- import { u as Bt, a as Lt, s as Tt } from "../DateField.vue_vue_type_script_setup_true_lang-DzCvYHAf.js";
21
- import { _ as nn } from "../DateField.vue_vue_type_script_setup_true_lang-DzCvYHAf.js";
22
- import { _ as tt } from "../DateButton.vue_vue_type_script_setup_true_lang-CovKG5lN.js";
23
- import { u as at } from "../format-Cp1h0vsC.js";
24
- import { u as Ie } from "../mediaQuery-CygcXmFW.js";
25
- import { _ as je } from "../Popover.vue_vue_type_script_setup_true_lang-BK8HL_V0.js";
26
- import { u as qt } from "../TimeField.vue_vue_type_script_setup_true_lang-C1mLvOkc.js";
27
- import { _ as rn } from "../TimeField.vue_vue_type_script_setup_true_lang-C1mLvOkc.js";
28
- import { _ as be } from "../Button.vue_vue_type_script_setup_true_lang-JrqhO99l.js";
29
- import { _ as dn } from "../FormView.vue_vue_type_script_setup_true_lang-Bq_Qa4py.js";
30
- import { a as zt } from "../environment-Dva-SG8D.js";
31
- import { _ as Vt } from "../NumberField.vue_vue_type_script_setup_true_lang-U-_kcnGr.js";
32
- import { _ as Dt } from "../Sheet.vue_vue_type_script_setup_true_lang-BG8HUNfs.js";
33
- import { b as Rt, a as Ke } from "../SelectField.vue_vue_type_script_setup_true_lang-CLkoPbGm.js";
34
- import { _ as fn, u as mn } from "../SelectField.vue_vue_type_script_setup_true_lang-CLkoPbGm.js";
35
- import { _ as pn, b as bn, a as gn, u as yn } from "../useGroupSheet-B-Hs4gNO.js";
36
- import { _ as Pe } from "../PhotoViewer.vue_vue_type_script_setup_true_lang-DmMg1T_V.js";
37
- import { _ as kn } from "../SegmentedField.vue_vue_type_script_setup_true_lang-zv_AxpBn.js";
38
- import { _ as wn } from "../SwitchField.vue_vue_type_script_setup_true_lang-Ds4q0bbl.js";
39
- import { _ as _n } from "../TextareaField.vue_vue_type_script_setup_true_lang-D2j4s96s.js";
40
- import { _ as Mt } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-d_dPurWG.js";
41
- import { _ as It, a as jt } from "../SectionList.vue_vue_type_script_setup_true_lang-CodyVezo.js";
42
- import { p as Ot } from "../sectionIndex-BS0ic5W7.js";
43
- import { u as Et } from "../useSaveChrome-DB9OwIjT.js";
44
- import { u as Sn } from "../useRecordDialog-QPKFH1Ww.js";
45
- import { matchedRouteKey as Nt, onBeforeRouteLeave as At } from "vue-router";
46
- function Gt(l) {
47
- const a = P(null);
1
+ import { a as St, _ as it, c as Ft, f as qt, E as Bt } from "../FormGroup.vue_vue_type_script_setup_true_lang-lvAuBG-0.js";
2
+ import { b as Ir, d as Ar, p as Nr, r as Pr, u as Kr, e as Gr, g as Hr } from "../FormGroup.vue_vue_type_script_setup_true_lang-lvAuBG-0.js";
3
+ import { f as Me } from "../useCommand-DQKvro1n.js";
4
+ import { _ as Yr, a as Jr, u as Zr } from "../useCommand-DQKvro1n.js";
5
+ import { ref as H, computed as q, defineComponent as J, openBlock as d, createBlock as z, mergeProps as N, unref as s, createSlots as ie, withCtx as k, createElementVNode as x, normalizeClass as W, createElementBlock as g, Fragment as ee, renderList as ce, createVNode as U, createCommentVNode as j, toDisplayString as B, renderSlot as R, mergeDefaults as me, useModel as ke, useId as Ie, withKeys as Fe, withModifiers as he, createTextVNode as Z, mergeModels as ve, useTemplateRef as oe, shallowRef as We, watch as be, normalizeProps as Re, guardReactiveProps as Ue, nextTick as we, provide as ut, inject as De, onBeforeUnmount as ze, getCurrentScope as Lt, onScopeDispose as Tt, toValue as Dt, shallowReactive as Ye, normalizeStyle as zt, resolveDynamicComponent as jt, onMounted as dt, withDirectives as ct, vModelText as mt } from "vue";
6
+ import { a as ft } from "../leaveGuard-Cc8yeLxM.js";
7
+ import { M as Qr, c as en, i as tn, l as an, u as ln } from "../leaveGuard-Cc8yeLxM.js";
8
+ import { _ as rn } from "../LeaveGuardRoot.vue_vue_type_script_setup_true_lang-CrGrjrlO.js";
9
+ import { u as sn } from "../useResourceForm-zVuWerSn.js";
10
+ import { _ as ue } from "../Icon.vue_vue_type_script_lang-BhhsFYwp.js";
11
+ import { _ as ye, u as Ae } from "../options-mOOX6JSS.js";
12
+ import { g as dn, m as cn } from "../options-mOOX6JSS.js";
13
+ import { u as qe, f as fe, b as pe, a as pt, _ as Ot, e as Mt, g as Rt } from "../FormRow.vue_vue_type_script_setup_true_lang-CpgNVQF4.js";
14
+ import { c as fn } from "../FormRow.vue_vue_type_script_setup_true_lang-CpgNVQF4.js";
15
+ import { useI18n as re } from "vue-i18n";
16
+ import { b as Ut } from "../controlSurface-t7OEFESJ.js";
17
+ import { a as Et, _ as Je } from "../TextField.vue_vue_type_script_setup_true_lang-CVGh-p3J.js";
18
+ import { u as It, l as At } from "../suggestions-DeMgs_ki.js";
19
+ import { r as vn } from "../suggestions-DeMgs_ki.js";
20
+ import { o as Ce, q as Nt, m as Pt, s as Se, u as Ze, i as Kt, e as Be, k as Gt, _ as Ht, l as Wt, c as Yt, b as Jt, t as Oe, g as Zt, v as Xt } from "../useTypedEntry-BsMV66Yc.js";
21
+ import { u as Qt, a as ea, s as ta, _ as aa } from "../DateField.vue_vue_type_script_setup_true_lang-D0KcfW8R.js";
22
+ import { _ as vt } from "../DateButton.vue_vue_type_script_setup_true_lang-CovKG5lN.js";
23
+ import { u as bt } from "../format-C_HXlOYQ.js";
24
+ import { u as Ne } from "../mediaQuery-CygcXmFW.js";
25
+ import { _ as Pe } from "../Popover.vue_vue_type_script_setup_true_lang-BK8HL_V0.js";
26
+ import { u as la } from "../TimeField.vue_vue_type_script_setup_true_lang-DHNC_MLt.js";
27
+ import { _ as yn } from "../TimeField.vue_vue_type_script_setup_true_lang-DHNC_MLt.js";
28
+ import { _ as ae } from "../Button.vue_vue_type_script_setup_true_lang-JrqhO99l.js";
29
+ import { _ as hn } from "../FormView.vue_vue_type_script_setup_true_lang-D01Jr4UU.js";
30
+ import { a as yt } from "../environment-Dva-SG8D.js";
31
+ import { _ as gt } from "../NumberField.vue_vue_type_script_setup_true_lang-BhNZgEW6.js";
32
+ import { _ as oa } from "../Sheet.vue_vue_type_script_setup_true_lang-BG8HUNfs.js";
33
+ import { b as ra, a as Xe, _ as na } from "../SelectField.vue_vue_type_script_setup_true_lang-D5xYofdb.js";
34
+ import { u as _n } from "../SelectField.vue_vue_type_script_setup_true_lang-D5xYofdb.js";
35
+ import { _ as wn, b as $n, a as Vn, u as Cn } from "../useGroupSheet-CRw3MUmX.js";
36
+ import { _ as Qe } from "../PhotoViewer.vue_vue_type_script_setup_true_lang-DmMg1T_V.js";
37
+ import { _ as Fn } from "../SegmentedField.vue_vue_type_script_setup_true_lang-CLR6EvzO.js";
38
+ import { _ as sa } from "../SwitchField.vue_vue_type_script_setup_true_lang-CLtcuofe.js";
39
+ import { _ as et } from "../TextareaField.vue_vue_type_script_setup_true_lang-YxUlNHSk.js";
40
+ import { _ as ia } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-oXWQTfBs.js";
41
+ import { _ as ua, a as da } from "../SectionList.vue_vue_type_script_setup_true_lang-CodyVezo.js";
42
+ import { p as ca } from "../sectionIndex-BS0ic5W7.js";
43
+ import { u as ma } from "../useSaveChrome-DB9OwIjT.js";
44
+ import { u as Bn } from "../useRecordDialog-0azHxxvm.js";
45
+ import { matchedRouteKey as fa, onBeforeRouteLeave as pa } from "vue-router";
46
+ import { t as Ke, c as ht, _ as kt } from "../resources-BZLlAtoS.js";
47
+ function va(l) {
48
+ const t = H(null);
48
49
  return {
49
- isDirty: h(() => a.value !== null && JSON.stringify(l()) !== a.value),
50
- markClean: () => a.value = JSON.stringify(l())
50
+ isDirty: q(() => t.value !== null && JSON.stringify(l()) !== t.value),
51
+ markClean: () => t.value = JSON.stringify(l())
51
52
  };
52
53
  }
53
- function no(l) {
54
- const a = P(!1), e = Gt(l), { confirmDiscard: t } = Xe(() => a.value && e.isDirty.value);
54
+ function kr(l) {
55
+ const t = H(!1), e = va(l), { confirmDiscard: a } = ft(() => t.value && e.isDirty.value);
55
56
  return {
56
57
  /** The sheet was just filled: its current values are the baseline. */
57
58
  opened: () => {
58
- e.markClean(), a.value = !0;
59
+ e.markClean(), t.value = !0;
59
60
  },
60
61
  /** The sheet closes with nothing to lose (after a save, or once it has closed). */
61
62
  closed: () => {
62
- a.value = !1;
63
+ t.value = !1;
63
64
  },
64
- beforeDismiss: t
65
+ beforeDismiss: a
65
66
  };
66
67
  }
67
- const He = (l, a) => {
68
- const e = Number(a);
68
+ const tt = (l, t) => {
69
+ const e = Number(t);
69
70
  if (Number.isInteger(e) && Math.abs(e) < 1e4) return String(e);
70
- const t = Number.isInteger(e) ? 0 : 2;
71
- return l.number(e, { minimumFractionDigits: t, maximumFractionDigits: t });
71
+ const a = Number.isInteger(e) ? 0 : 2;
72
+ return l.number(e, { minimumFractionDigits: a, maximumFractionDigits: a });
72
73
  };
73
- function so({ i18n: l, format: a }) {
74
- const { t: e, te: t } = l.global, o = (r) => `validation_errors.${r}`, n = (r) => `core.validation_errors.${r}`, u = (r, m) => ({ message: e(t(o(r)) ? o(r) : n(r), m) });
75
- return (r) => {
76
- switch (r.code) {
74
+ function _r({ i18n: l, format: t }) {
75
+ const { t: e, te: a } = l.global, r = (u) => `validation_errors.${u}`, i = (u) => `core.validation_errors.${u}`, p = (u, b) => ({ message: e(a(r(u)) ? r(u) : i(u), b) });
76
+ return (u) => {
77
+ switch (u.code) {
77
78
  case "invalid_type":
78
- return u("required");
79
+ return p("required");
79
80
  case "too_small":
80
- return r.origin === "string" ? Number(r.minimum) === 1 ? u("required") : u("min", { min: Number(r.minimum) }) : r.origin === "number" ? u("min_value", { min: He(a, r.minimum) }) : void 0;
81
+ return u.origin === "string" ? Number(u.minimum) === 1 ? p("required") : p("min", { min: Number(u.minimum) }) : u.origin === "number" ? p("min_value", { min: tt(t, u.minimum) }) : void 0;
81
82
  case "too_big":
82
- return r.origin === "string" ? u("max", { max: Number(r.maximum) }) : r.origin === "number" ? u("max_value", { max: He(a, r.maximum) }) : void 0;
83
+ return u.origin === "string" ? p("max", { max: Number(u.maximum) }) : u.origin === "number" ? p("max_value", { max: tt(t, u.maximum) }) : void 0;
83
84
  case "invalid_format":
84
- return r.format !== void 0 && ["email", "url", "date", "datetime"].includes(r.format) ? u(r.format) : void 0;
85
+ return u.format !== void 0 && ["email", "url", "date", "datetime"].includes(u.format) ? p(u.format) : void 0;
85
86
  case "custom": {
86
- const m = r.params?.code;
87
- if (typeof m != "string") return;
88
- if (m === "required") return u("required");
89
- const k = t(o(m)) ? o(m) : t(n(m)) ? n(m) : null;
90
- return k === null ? void 0 : { message: e(k) };
87
+ const b = u.params?.code;
88
+ if (typeof b != "string") return;
89
+ if (b === "required") return p("required");
90
+ const _ = a(r(b)) ? r(b) : a(i(b)) ? i(b) : null;
91
+ return _ === null ? void 0 : { message: e(_) };
91
92
  }
92
93
  default:
93
94
  return;
94
95
  }
95
96
  };
96
97
  }
97
- const Kt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Pt = ["name", "value", "checked", "disabled", "onChange"], Ht = { class: "min-w-0 flex-1" }, Ut = { class: "block text-body font-semibold text-content-strong" }, Yt = {
98
+ const ba = ["id", "aria-label", "aria-describedby", "aria-invalid"], ya = ["name", "value", "checked", "disabled", "onChange"], ga = { class: "min-w-0 flex-1" }, ha = { class: "block text-body font-semibold text-content-strong" }, ka = {
98
99
  key: 0,
99
100
  class: "mt-0.5 block text-footnote text-content-muted"
100
- }, Wt = {
101
+ }, _a = {
101
102
  key: 1,
102
103
  class: "flex size-5 shrink-0 items-center justify-center rounded-full bg-control-on text-white",
103
104
  "aria-hidden": "true"
104
- }, ro = /* @__PURE__ */ G({
105
+ }, xr = /* @__PURE__ */ J({
105
106
  __name: "CardSelectField",
106
- props: /* @__PURE__ */ ce({
107
+ props: /* @__PURE__ */ me({
107
108
  label: {},
108
109
  labelHidden: { type: Boolean },
109
110
  hint: {},
@@ -117,90 +118,90 @@ const Kt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Pt = ["name
117
118
  modelValue: {},
118
119
  options: {},
119
120
  columns: {}
120
- }, { ...me, modelValue: null, columns: 2 }),
121
+ }, { ...pe, modelValue: null, columns: 2 }),
121
122
  emits: ["update:modelValue"],
122
- setup(l, { emit: a }) {
123
- const e = l, t = a, { editable: o } = Qe(e), n = { 1: "grid-cols-1", 2: "grid-cols-2", 3: "grid-cols-3", 4: "grid-cols-4" }, u = h(() => n[e.columns]);
124
- return (r, m) => (d(), R(ye, J(s(fe)(e), {
125
- value: e.options.find((k) => k.value === e.modelValue)?.label ?? null,
123
+ setup(l, { emit: t }) {
124
+ const e = l, a = t, { editable: r } = qe(e), i = { 1: "grid-cols-1", 2: "grid-cols-2", 3: "grid-cols-3", 4: "grid-cols-4" }, p = q(() => i[e.columns]);
125
+ return (u, b) => (d(), z(ye, N(s(fe)(e), {
126
+ value: e.options.find((_) => _.value === e.modelValue)?.label ?? null,
126
127
  "row-layout": "stacked"
127
- }), Z({
128
- default: f(({ id: k, describedby: x, invalid: $ }) => [
129
- p("div", {
130
- id: k,
128
+ }), ie({
129
+ default: k(({ id: _, describedby: V, invalid: $ }) => [
130
+ x("div", {
131
+ id: _,
131
132
  role: "radiogroup",
132
133
  "aria-label": e.label,
133
- "aria-describedby": x,
134
+ "aria-describedby": V,
134
135
  "aria-invalid": $ || void 0,
135
- class: j(["grid w-full gap-2.5", u.value]),
136
+ class: W(["grid w-full gap-2.5", p.value]),
136
137
  "data-test": "card-select"
137
138
  }, [
138
- (d(!0), y(de, null, $e(e.options, (i) => (d(), y("label", {
139
- key: i.value,
140
- class: j(["relative flex items-center gap-3 rounded-group bg-fill p-3.5 transition-colors duration-motion-fast focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-border-focus", [i.value === e.modelValue ? "bg-tint-soft ring-[1.5px] ring-inset ring-border-selected" : "hover:bg-fill-strong", e.disabled || !s(o) || i.disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer"]])
139
+ (d(!0), g(ee, null, ce(e.options, (n) => (d(), g("label", {
140
+ key: n.value,
141
+ class: W(["relative flex items-center gap-3 rounded-group bg-fill p-3.5 transition-colors duration-motion-fast focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-border-focus", [n.value === e.modelValue ? "bg-tint-soft ring-[1.5px] ring-inset ring-border-selected" : "hover:bg-fill-strong", e.disabled || !s(r) || n.disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer"]])
141
142
  }, [
142
- p("input", {
143
+ x("input", {
143
144
  type: "radio",
144
145
  class: "sr-only",
145
- name: e.name ?? k,
146
- value: i.value,
147
- checked: i.value === e.modelValue,
148
- disabled: e.disabled || !s(o) || i.disabled,
149
- onChange: (v) => t("update:modelValue", i.value)
150
- }, null, 40, Pt),
151
- i.icon ? (d(), y("span", {
146
+ name: e.name ?? _,
147
+ value: n.value,
148
+ checked: n.value === e.modelValue,
149
+ disabled: e.disabled || !s(r) || n.disabled,
150
+ onChange: (c) => a("update:modelValue", n.value)
151
+ }, null, 40, ya),
152
+ n.icon ? (d(), g("span", {
152
153
  key: 0,
153
- class: j(["flex size-9 shrink-0 items-center justify-center rounded-control", i.value === e.modelValue ? "bg-control-on text-white" : "bg-fill-strong text-content-muted"])
154
+ class: W(["flex size-9 shrink-0 items-center justify-center rounded-control", n.value === e.modelValue ? "bg-control-on text-white" : "bg-fill-strong text-content-muted"])
154
155
  }, [
155
- I(s(X), {
156
- name: i.icon,
156
+ U(s(ue), {
157
+ name: n.icon,
157
158
  size: 18
158
159
  }, null, 8, ["name"])
159
- ], 2)) : q("", !0),
160
- p("span", Ht, [
161
- p("span", Ut, C(i.label), 1),
162
- i.description ? (d(), y("span", Yt, C(i.description), 1)) : q("", !0)
160
+ ], 2)) : j("", !0),
161
+ x("span", ga, [
162
+ x("span", ha, B(n.label), 1),
163
+ n.description ? (d(), g("span", ka, B(n.description), 1)) : j("", !0)
163
164
  ]),
164
- i.value === e.modelValue ? (d(), y("span", Wt, [
165
- I(s(X), {
165
+ n.value === e.modelValue ? (d(), g("span", _a, [
166
+ U(s(ue), {
166
167
  name: "checkCustom",
167
168
  size: 12
168
169
  })
169
- ])) : q("", !0)
170
+ ])) : j("", !0)
170
171
  ], 2))), 128))
171
- ], 10, Kt)
172
+ ], 10, ba)
172
173
  ]),
173
174
  _: 2
174
175
  }, [
175
- r.$slots.trailing ? {
176
+ u.$slots.trailing ? {
176
177
  name: "trailing",
177
- fn: f(() => [
178
- S(r.$slots, "trailing")
178
+ fn: k(() => [
179
+ R(u.$slots, "trailing")
179
180
  ]),
180
181
  key: "0"
181
182
  } : void 0,
182
- r.$slots.labelTrailing ? {
183
+ u.$slots.labelTrailing ? {
183
184
  name: "labelTrailing",
184
- fn: f(() => [
185
- S(r.$slots, "labelTrailing")
185
+ fn: k(() => [
186
+ R(u.$slots, "labelTrailing")
186
187
  ]),
187
188
  key: "1"
188
189
  } : void 0,
189
- r.$slots.readonly ? {
190
+ u.$slots.readonly ? {
190
191
  name: "readonly",
191
- fn: f(() => [
192
- S(r.$slots, "readonly")
192
+ fn: k(() => [
193
+ R(u.$slots, "readonly")
193
194
  ]),
194
195
  key: "2"
195
196
  } : void 0
196
197
  ]), 1040, ["value"]));
197
198
  }
198
- }), Jt = ["data-field-error"], Zt = ["aria-checked", "aria-disabled", "aria-describedby", "aria-invalid", "tabindex", "onKeydown"], Xt = { class: "flex min-w-0 flex-1 flex-col items-start" }, Qt = {
199
+ }), xa = ["data-field-error"], wa = ["aria-checked", "aria-disabled", "aria-describedby", "aria-invalid", "tabindex", "onKeydown"], $a = { class: "flex min-w-0 flex-1 flex-col items-start" }, Va = {
199
200
  key: 0,
200
201
  class: "flex shrink-0 items-center gap-2.5"
201
- }, ea = ["id"], io = /* @__PURE__ */ G({
202
+ }, Ca = ["id"], wr = /* @__PURE__ */ J({
202
203
  __name: "CheckboxField",
203
- props: /* @__PURE__ */ le({
204
+ props: /* @__PURE__ */ ve({
204
205
  label: {},
205
206
  description: { default: void 0 },
206
207
  disabled: { type: Boolean, default: !1 },
@@ -212,76 +213,77 @@ const Kt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Pt = ["name
212
213
  }),
213
214
  emits: ["update:modelValue"],
214
215
  setup(l) {
215
- const a = l, e = re(l, "modelValue"), t = !!et(), o = Re(), n = () => {
216
- a.disabled || (e.value = !e.value);
216
+ const t = l, e = ke(l, "modelValue"), a = !!pt(), r = Ie(), i = () => {
217
+ t.disabled || (e.value = !e.value);
217
218
  };
218
- return (u, r) => (d(), y("div", {
219
- "data-field-error": a.error ? "true" : void 0
219
+ return (p, u) => (d(), g("div", {
220
+ class: "group/check",
221
+ "data-field-error": t.error ? "true" : void 0
220
222
  }, [
221
- p("div", {
223
+ x("div", {
222
224
  role: "checkbox",
223
225
  "aria-checked": e.value,
224
- "aria-disabled": a.disabled || void 0,
225
- "aria-describedby": a.error ? `${s(o)}-error` : void 0,
226
- "aria-invalid": a.error ? !0 : void 0,
227
- tabindex: a.disabled ? -1 : 0,
226
+ "aria-disabled": t.disabled || void 0,
227
+ "aria-describedby": t.error ? `${s(r)}-error` : void 0,
228
+ "aria-invalid": t.error ? !0 : void 0,
229
+ tabindex: t.disabled ? -1 : 0,
228
230
  "data-test": "checkbox",
229
- class: j(["group/check flex items-center transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-border-focus", [a.variant === "row" ? "gap-3 pl-row-inset focus-visible:-outline-offset-2" : "gap-2.5 rounded-control px-2 py-1.5 focus-visible:outline-offset-1", t && a.variant === "row" ? "first:rounded-t-group last:rounded-b-group" : "", a.disabled ? "cursor-not-allowed" : a.variant === "row" ? "cursor-pointer hover:bg-fill/60 active:bg-fill" : "cursor-pointer hover:bg-fill"]]),
230
- onClick: n,
231
+ class: W(["flex items-center transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-border-focus", [t.variant === "row" ? "gap-3 pl-row-inset focus-visible:-outline-offset-2" : "gap-2.5 rounded-control px-2 py-1.5 focus-visible:outline-offset-1", a && t.variant === "row" ? "group-first/check:rounded-t-group group-last/check:rounded-b-group" : "", t.disabled ? "cursor-not-allowed" : t.variant === "row" ? "cursor-pointer hover:bg-fill/60 active:bg-fill" : "cursor-pointer hover:bg-fill"]]),
232
+ onClick: i,
231
233
  onKeydown: [
232
- Se(pe(n, ["prevent"]), ["space"]),
233
- Se(pe(n, ["prevent"]), ["enter"])
234
+ Fe(he(i, ["prevent"]), ["space"]),
235
+ Fe(he(i, ["prevent"]), ["enter"])
234
236
  ]
235
237
  }, [
236
- p("span", {
237
- class: j(["flex shrink-0 items-center justify-center rounded-full border-2", [a.variant === "row" ? "size-5.5" : "size-5", e.value ? a.disabled ? "border-content-disabled bg-content-disabled text-white" : "border-control-on bg-control-on text-white" : "border-border-control"]]),
238
+ x("span", {
239
+ class: W(["flex shrink-0 items-center justify-center rounded-full border-2", [t.variant === "row" ? "size-5.5" : "size-5", e.value ? t.disabled ? "border-content-disabled bg-content-disabled text-white" : "border-control-on bg-control-on text-white" : "border-border-control"]]),
238
240
  "aria-hidden": "true"
239
241
  }, [
240
- e.value ? (d(), R(s(X), {
242
+ e.value ? (d(), z(s(ue), {
241
243
  key: 0,
242
244
  name: "checkCustom",
243
245
  size: 12
244
- })) : q("", !0)
246
+ })) : j("", !0)
245
247
  ], 2),
246
- p("div", {
247
- class: j(["flex min-w-0 flex-1 items-center gap-3", a.variant === "row" ? "min-h-row border-t border-border-separator py-2 pr-row-inset group-first/check:border-t-0" : ""])
248
+ x("div", {
249
+ class: W(["flex min-w-0 flex-1 items-center gap-3", t.variant === "row" ? "min-h-row border-t border-border-separator py-2 pr-row-inset group-first/check:border-t-0" : ""])
248
250
  }, [
249
- p("div", Xt, [
250
- p("p", {
251
- class: j(["w-full text-body", [a.variant === "row" ? "break-words" : "truncate", a.disabled ? "text-content-muted" : e.value ? "text-content-strong" : "text-content"]])
252
- }, C(a.label), 3),
253
- a.description ? (d(), y("p", {
251
+ x("div", $a, [
252
+ x("p", {
253
+ class: W(["w-full text-body", [t.variant === "row" ? "break-words" : "truncate", t.disabled ? "text-content-muted" : e.value ? "text-content-strong" : "text-content"]])
254
+ }, B(t.label), 3),
255
+ t.description ? (d(), g("p", {
254
256
  key: 0,
255
- class: j(["tabular-nums text-content-muted", a.variant === "row" ? "text-footnote" : "text-xs"])
256
- }, C(a.description), 3)) : q("", !0),
257
- S(u.$slots, "default")
257
+ class: W(["tabular-nums text-content-muted", t.variant === "row" ? "text-footnote" : "text-xs"])
258
+ }, B(t.description), 3)) : j("", !0),
259
+ R(p.$slots, "default")
258
260
  ]),
259
- u.$slots.trailing ? (d(), y("div", Qt, [
260
- S(u.$slots, "trailing")
261
- ])) : q("", !0)
261
+ p.$slots.trailing ? (d(), g("div", Va, [
262
+ R(p.$slots, "trailing")
263
+ ])) : j("", !0)
262
264
  ], 2)
263
- ], 42, Zt),
264
- a.error ? (d(), y("p", {
265
+ ], 42, wa),
266
+ t.error ? (d(), g("p", {
265
267
  key: 0,
266
- id: `${s(o)}-error`,
268
+ id: `${s(r)}-error`,
267
269
  role: "alert",
268
270
  class: "flex items-start gap-1.5 px-2 pt-1 text-footnote text-content-destructive"
269
271
  }, [
270
- I(s(X), {
272
+ U(s(ue), {
271
273
  name: "alertTriangle",
272
274
  size: 14,
273
275
  class: "mt-px shrink-0"
274
276
  }),
275
- H(" " + C(a.error), 1)
276
- ], 8, ea)) : q("", !0)
277
- ], 8, Jt));
277
+ Z(" " + B(t.error), 1)
278
+ ], 8, Ca)) : j("", !0)
279
+ ], 8, xa));
278
280
  }
279
- }), ta = {
281
+ }), Sa = {
280
282
  key: 0,
281
283
  class: "text-body text-content-muted"
282
- }, aa = ["id", "aria-label", "aria-describedby", "aria-invalid"], la = ["aria-pressed", "disabled", "onClick"], uo = /* @__PURE__ */ G({
284
+ }, Fa = ["id", "aria-label", "aria-describedby", "aria-invalid"], qa = ["aria-pressed", "disabled", "onClick"], $r = /* @__PURE__ */ J({
283
285
  __name: "ChoiceChips",
284
- props: /* @__PURE__ */ le(/* @__PURE__ */ ce({
286
+ props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
285
287
  label: {},
286
288
  labelHidden: { type: Boolean },
287
289
  hint: {},
@@ -293,77 +295,77 @@ const Kt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Pt = ["name
293
295
  presentation: {},
294
296
  name: {},
295
297
  options: {}
296
- }, { ...me }), {
298
+ }, { ...pe }), {
297
299
  modelValue: { default: () => [] },
298
300
  modelModifiers: {}
299
301
  }),
300
302
  emits: ["update:modelValue"],
301
303
  setup(l) {
302
- const a = l, e = re(l, "modelValue"), t = (o) => e.value = e.value.includes(o) ? e.value.filter((n) => n !== o) : [...e.value, o];
303
- return (o, n) => (d(), R(ye, J(s(fe)(a), {
304
- value: a.options.filter((u) => e.value.includes(u.value)).map((u) => u.label).join(", ") || null,
304
+ const t = l, e = ke(l, "modelValue"), a = (r) => e.value = e.value.includes(r) ? e.value.filter((i) => i !== r) : [...e.value, r];
305
+ return (r, i) => (d(), z(ye, N(s(fe)(t), {
306
+ value: t.options.filter((p) => e.value.includes(p.value)).map((p) => p.label).join(", ") || null,
305
307
  "row-layout": "stacked"
306
- }), Z({
307
- default: f(({ id: u, describedby: r, invalid: m }) => [
308
- a.options.length === 0 ? (d(), y("span", ta, "—")) : (d(), y("div", {
308
+ }), ie({
309
+ default: k(({ id: p, describedby: u, invalid: b }) => [
310
+ t.options.length === 0 ? (d(), g("span", Sa, "—")) : (d(), g("div", {
309
311
  key: 1,
310
- id: u,
312
+ id: p,
311
313
  role: "group",
312
- "aria-label": a.label,
313
- "aria-describedby": r,
314
- "aria-invalid": m || void 0,
314
+ "aria-label": t.label,
315
+ "aria-describedby": u,
316
+ "aria-invalid": b || void 0,
315
317
  class: "flex flex-wrap gap-1.5 py-1",
316
318
  "data-test": "choice-chips"
317
319
  }, [
318
- (d(!0), y(de, null, $e(a.options, (k) => (d(), y("button", {
319
- key: k.value,
320
+ (d(!0), g(ee, null, ce(t.options, (_) => (d(), g("button", {
321
+ key: _.value,
320
322
  type: "button",
321
- "aria-pressed": e.value.includes(k.value),
322
- disabled: a.disabled || k.disabled,
323
- class: j(["inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-full px-3 text-subheadline transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-not-allowed disabled:opacity-60", e.value.includes(k.value) ? "bg-tint-soft font-semibold text-content-link" : "bg-fill font-medium text-content-strong hover:bg-fill-strong"]),
324
- onClick: (x) => t(k.value)
323
+ "aria-pressed": e.value.includes(_.value),
324
+ disabled: t.disabled || _.disabled,
325
+ class: W(["inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-full px-3 text-subheadline transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-not-allowed disabled:opacity-60", e.value.includes(_.value) ? "bg-tint-soft font-semibold text-content-link" : "bg-fill font-medium text-content-strong hover:bg-fill-strong"]),
326
+ onClick: (V) => a(_.value)
325
327
  }, [
326
- e.value.includes(k.value) ? (d(), R(s(X), {
328
+ e.value.includes(_.value) ? (d(), z(s(ue), {
327
329
  key: 0,
328
330
  name: "checkCustom",
329
331
  size: 12
330
- })) : q("", !0),
331
- H(" " + C(k.label), 1)
332
- ], 10, la))), 128))
333
- ], 8, aa))
332
+ })) : j("", !0),
333
+ Z(" " + B(_.label), 1)
334
+ ], 10, qa))), 128))
335
+ ], 8, Fa))
334
336
  ]),
335
337
  _: 2
336
338
  }, [
337
- o.$slots.trailing ? {
339
+ r.$slots.trailing ? {
338
340
  name: "trailing",
339
- fn: f(() => [
340
- S(o.$slots, "trailing")
341
+ fn: k(() => [
342
+ R(r.$slots, "trailing")
341
343
  ]),
342
344
  key: "0"
343
345
  } : void 0,
344
- o.$slots.labelTrailing ? {
346
+ r.$slots.labelTrailing ? {
345
347
  name: "labelTrailing",
346
- fn: f(() => [
347
- S(o.$slots, "labelTrailing")
348
+ fn: k(() => [
349
+ R(r.$slots, "labelTrailing")
348
350
  ]),
349
351
  key: "1"
350
352
  } : void 0,
351
- o.$slots.readonly ? {
353
+ r.$slots.readonly ? {
352
354
  name: "readonly",
353
- fn: f(() => [
354
- S(o.$slots, "readonly")
355
+ fn: k(() => [
356
+ R(r.$slots, "readonly")
355
357
  ]),
356
358
  key: "2"
357
359
  } : void 0
358
360
  ]), 1040, ["value"]));
359
361
  }
360
- }), oa = {
362
+ }), Ba = {
361
363
  key: 0,
362
364
  class: "flex shrink-0 items-center",
363
365
  "data-test": "field-value"
364
- }, na = ["id", "value", "name", "placeholder", "disabled", "required", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-required", "aria-invalid", "aria-describedby"], sa = { class: "block break-words text-body text-content-strong" }, co = /* @__PURE__ */ G({
366
+ }, La = ["id", "value", "name", "placeholder", "disabled", "required", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-required", "aria-invalid", "aria-describedby"], Ta = { class: "block break-words text-body text-content-strong" }, Vr = /* @__PURE__ */ J({
365
367
  __name: "ComboField",
366
- props: /* @__PURE__ */ le(/* @__PURE__ */ ce({
368
+ props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
367
369
  label: {},
368
370
  labelHidden: { type: Boolean },
369
371
  hint: {},
@@ -384,104 +386,104 @@ const Kt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Pt = ["name
384
386
  recents: {},
385
387
  width: {},
386
388
  rowLayout: {}
387
- }, { ...me, options: void 0, search: void 0, selected: null, placeholder: void 0, minLength: 1, debounce: 300, limit: 30, recents: void 0, width: "md", rowLayout: void 0 }), {
389
+ }, { ...pe, options: void 0, search: void 0, selected: null, placeholder: void 0, minLength: 1, debounce: 300, limit: 30, recents: void 0, width: "md", rowLayout: void 0 }), {
388
390
  modelValue: { default: null },
389
391
  modelModifiers: {}
390
392
  }),
391
- emits: /* @__PURE__ */ le(["picked", "focus", "blur"], ["update:modelValue"]),
392
- setup(l, { expose: a, emit: e }) {
393
- const t = l, o = re(l, "modelValue"), n = e, { t: u } = oe(), r = !!et(), m = Me("text", () => t.error ? "error" : t.disabled ? "locked" : "rest"), k = h(() => t.rowLayout === "stacked"), x = h(() => r && !k.value ? bt(t.width) : "w-full"), $ = U("input"), i = U("anchor"), v = Ne(null), g = Ne(""), T = yt({
394
- source: () => t.search ?? t.options,
395
- minLength: () => t.minLength,
396
- debounce: () => t.debounce,
397
- limit: () => t.limit,
393
+ emits: /* @__PURE__ */ ve(["picked", "focus", "blur"], ["update:modelValue"]),
394
+ setup(l, { expose: t, emit: e }) {
395
+ const a = l, r = ke(l, "modelValue"), i = e, { t: p } = re(), u = !!pt(), b = Ae("text", () => a.error ? "error" : a.disabled ? "locked" : "rest"), _ = q(() => a.rowLayout === "stacked"), V = q(() => u && !_.value ? Ut(a.width) : "w-full"), $ = oe("input"), n = oe("anchor"), c = We(null), m = We(""), h = It({
396
+ source: () => a.search ?? a.options,
397
+ minLength: () => a.minLength,
398
+ debounce: () => a.debounce,
399
+ limit: () => a.limit,
398
400
  listAllWhenEmpty: !0,
399
- recents: () => t.recents
400
- }), { items: w, open: F, status: O, highlighted: E, showingRecent: N } = T, V = h(() => {
401
- const z = o.value;
402
- return z === null ? null : [v.value, t.selected, ...t.options ?? []].find((A) => A?.value === z) ?? null;
401
+ recents: () => a.recents
402
+ }), { items: v, open: y, status: S, highlighted: L, showingRecent: T } = h, C = q(() => {
403
+ const D = r.value;
404
+ return D === null ? null : [c.value, a.selected, ...a.options ?? []].find((Q) => Q?.value === D) ?? null;
403
405
  });
404
- ge(V, (z) => {
405
- F.value || (g.value = z?.label ?? "");
406
+ be(C, (D) => {
407
+ y.value || (m.value = D?.label ?? "");
406
408
  }, { immediate: !0 });
407
- function Q(z) {
408
- g.value = z.target.value, T.ask(g.value), g.value === "" && (o.value = null, v.value = null);
409
+ function P(D) {
410
+ m.value = D.target.value, h.ask(m.value), m.value === "" && (r.value = null, c.value = null);
409
411
  }
410
- function ee(z) {
411
- n("focus", z), t.disabled || T.show("");
412
+ function Y(D) {
413
+ i("focus", D), a.disabled || h.show("");
412
414
  }
413
- function ne(z) {
414
- T.close(), T.remember(z), v.value = z, o.value = z.value, g.value = z.label, n("picked", z);
415
+ function M(D) {
416
+ h.close(), h.remember(D), c.value = D, r.value = D.value, m.value = D.label, i("picked", D);
415
417
  }
416
- function ie(z) {
417
- T.close(), g.value = V.value?.label ?? "", n("blur", z);
418
+ function O(D) {
419
+ h.close(), m.value = C.value?.label ?? "", i("blur", D);
418
420
  }
419
- const ue = h(() => ht(F.value, w.value.length, O.value, !0));
420
- return a({ focus: () => $.value?.focus() }), (z, A) => (d(), R(ye, J(s(fe)(t), {
421
- value: V.value?.label ?? null,
422
- "row-layout": t.rowLayout
423
- }), Z({
424
- default: f(({ id: K, describedby: te, invalid: Y }) => [
425
- p("div", {
421
+ const X = q(() => At(y.value, v.value.length, S.value, !0));
422
+ return t({ focus: () => $.value?.focus() }), (D, Q) => (d(), z(ye, N(s(fe)(a), {
423
+ value: C.value?.label ?? null,
424
+ "row-layout": a.rowLayout
425
+ }), ie({
426
+ default: k(({ id: te, describedby: ne, invalid: le }) => [
427
+ x("div", {
426
428
  ref_key: "anchor",
427
- ref: i,
428
- class: j(["flex items-center gap-1.5", [s(m), x.value]])
429
+ ref: n,
430
+ class: W(["flex items-center gap-1.5", [s(b), V.value]])
429
431
  }, [
430
- z.$slots.value && V.value ? (d(), y("span", oa, [
431
- S(z.$slots, "value", {
432
- option: V.value
432
+ D.$slots.value && C.value ? (d(), g("span", Ba, [
433
+ R(D.$slots, "value", {
434
+ option: C.value
433
435
  })
434
- ])) : q("", !0),
435
- p("input", {
436
- id: K,
436
+ ])) : j("", !0),
437
+ x("input", {
438
+ id: te,
437
439
  ref_key: "input",
438
440
  ref: $,
439
441
  role: "combobox",
440
442
  type: "text",
441
443
  autocomplete: "off",
442
- value: g.value,
443
- name: t.name,
444
- placeholder: t.placeholder,
445
- disabled: t.disabled,
446
- required: t.required,
444
+ value: m.value,
445
+ name: a.name,
446
+ placeholder: a.placeholder,
447
+ disabled: a.disabled,
448
+ required: a.required,
447
449
  "aria-autocomplete": "list",
448
- "aria-expanded": ue.value,
449
- "aria-controls": `${K}-list`,
450
- "aria-activedescendant": ue.value && s(w).length > 0 ? `${K}-option-${s(E)}` : void 0,
451
- "aria-required": t.required || void 0,
452
- "aria-invalid": Y || void 0,
453
- "aria-describedby": te,
454
- class: j(["block w-full min-w-0 border-0 bg-transparent px-0 py-1 text-body text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed", r && !k.value ? "compact:text-right" : ""]),
455
- onInput: Q,
456
- onFocus: ee,
457
- onBlur: ie,
458
- onKeydown: A[0] || (A[0] = (se) => s(T).keydown(se, { pick: ne, enterNeedsMove: !1 }))
459
- }, null, 42, na),
460
- I(s(X), {
450
+ "aria-expanded": X.value,
451
+ "aria-controls": `${te}-list`,
452
+ "aria-activedescendant": X.value && s(v).length > 0 ? `${te}-option-${s(L)}` : void 0,
453
+ "aria-required": a.required || void 0,
454
+ "aria-invalid": le || void 0,
455
+ "aria-describedby": ne,
456
+ class: W(["block w-full min-w-0 border-0 bg-transparent px-0 py-1 text-body text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed", u && !_.value ? "compact:text-right" : ""]),
457
+ onInput: P,
458
+ onFocus: Y,
459
+ onBlur: O,
460
+ onKeydown: Q[0] || (Q[0] = (de) => s(h).keydown(de, { pick: M, enterNeedsMove: !1 }))
461
+ }, null, 42, La),
462
+ U(s(ue), {
461
463
  name: "search",
462
464
  size: 14,
463
465
  class: "shrink-0 text-content-muted"
464
466
  })
465
467
  ], 2),
466
- I(gt, {
467
- id: K,
468
- anchor: i.value,
469
- open: s(F),
470
- items: s(w),
471
- highlighted: s(E),
472
- query: g.value,
473
- status: s(O),
474
- recent: s(N),
468
+ U(Et, {
469
+ id: te,
470
+ anchor: n.value,
471
+ open: s(y),
472
+ items: s(v),
473
+ highlighted: s(L),
474
+ query: m.value,
475
+ status: s(S),
476
+ recent: s(T),
475
477
  "empty-message": !0,
476
- selected: o.value,
477
- hint: s(u)("core.form.suggestions.keys_pick"),
478
- onPick: ne,
479
- onHover: A[1] || (A[1] = (se) => s(T).highlight(se))
480
- }, Z({ _: 2 }, [
481
- z.$slots.option ? {
478
+ selected: r.value,
479
+ hint: s(p)("core.form.suggestions.keys_pick"),
480
+ onPick: M,
481
+ onHover: Q[1] || (Q[1] = (de) => s(h).highlight(de))
482
+ }, ie({ _: 2 }, [
483
+ D.$slots.option ? {
482
484
  name: "option",
483
- fn: f((se) => [
484
- S(z.$slots, "option", ze(Ve(se)))
485
+ fn: k((de) => [
486
+ R(D.$slots, "option", Re(Ue(de)))
485
487
  ]),
486
488
  key: "0"
487
489
  } : void 0
@@ -489,32 +491,32 @@ const Kt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Pt = ["name
489
491
  ]),
490
492
  _: 2
491
493
  }, [
492
- z.$slots.trailing ? {
494
+ D.$slots.trailing ? {
493
495
  name: "trailing",
494
- fn: f(() => [
495
- S(z.$slots, "trailing")
496
+ fn: k(() => [
497
+ R(D.$slots, "trailing")
496
498
  ]),
497
499
  key: "0"
498
500
  } : void 0,
499
- z.$slots.labelTrailing ? {
501
+ D.$slots.labelTrailing ? {
500
502
  name: "labelTrailing",
501
- fn: f(() => [
502
- S(z.$slots, "labelTrailing")
503
+ fn: k(() => [
504
+ R(D.$slots, "labelTrailing")
503
505
  ]),
504
506
  key: "1"
505
507
  } : void 0,
506
- z.$slots.readonly ? {
508
+ D.$slots.readonly ? {
507
509
  name: "readonly",
508
- fn: f(() => [
509
- S(z.$slots, "readonly")
510
+ fn: k(() => [
511
+ R(D.$slots, "readonly")
510
512
  ]),
511
513
  key: "2"
512
- } : z.$slots.value && V.value ? {
514
+ } : D.$slots.value && C.value ? {
513
515
  name: "readonly",
514
- fn: f(() => [
515
- p("span", sa, [
516
- S(z.$slots, "value", {
517
- option: V.value
516
+ fn: k(() => [
517
+ x("span", Ta, [
518
+ R(D.$slots, "value", {
519
+ option: C.value
518
520
  })
519
521
  ])
520
522
  ]),
@@ -522,18 +524,40 @@ const Kt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Pt = ["name
522
524
  } : void 0
523
525
  ]), 1040, ["value", "row-layout"]));
524
526
  }
525
- }), ra = {
527
+ }), _t = /^(0000-00-00|1970-01-01|0001-01-01)/, at = (l) => String(l).padStart(2, "0"), xt = (l) => Pt(l.getFullYear(), l.getMonth() + 1, l.getDate()), Da = (l) => `${at(l.getHours())}:${at(l.getMinutes())}`;
528
+ function za(l) {
529
+ if (l == null || l === "") return null;
530
+ if (l instanceof Date) return Number.isNaN(l.getTime()) ? null : xt(l);
531
+ if (_t.test(l)) return null;
532
+ const t = /^(\d{4}-\d{2}-\d{2})/.exec(l);
533
+ return t && Nt(t[1]) ? t[1] : null;
534
+ }
535
+ function wt(l) {
536
+ if (l == null || l === "" || typeof l == "string" && _t.test(l)) return null;
537
+ const t = l instanceof Date ? l : ja(l);
538
+ if (Number.isNaN(t.getTime())) return null;
539
+ const e = xt(t);
540
+ return e ? Ce(e, Da(t)) : null;
541
+ }
542
+ function ja(l) {
543
+ const t = /^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?$/.exec(l);
544
+ return t ? new Date(Number(t[1]), Number(t[2]) - 1, Number(t[3]), Number(t[4] ?? 0), Number(t[5] ?? 0), Number(t[6] ?? 0)) : new Date(l);
545
+ }
546
+ function Cr(l = /* @__PURE__ */ new Date()) {
547
+ return wt(l) ?? "";
548
+ }
549
+ const Oa = {
526
550
  key: 0,
527
551
  class: "whitespace-normal"
528
- }, ia = { class: "whitespace-nowrap" }, ua = { class: "whitespace-nowrap" }, da = ["id", "name", "value", "placeholder", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], ca = ["aria-label", "onClick"], fa = {
552
+ }, Ma = { class: "whitespace-nowrap" }, Ra = { class: "whitespace-nowrap" }, Ua = ["id", "name", "value", "placeholder", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], Ea = ["aria-label", "onClick"], Ia = {
529
553
  class: "-m-3 flex",
530
554
  "data-test": "date-time-popover"
531
- }, ma = { class: "flex w-75 flex-col gap-2.5 border-r border-border-separator p-3.5" }, va = {
555
+ }, Aa = { class: "flex w-75 flex-col gap-2.5 border-r border-border-separator p-3.5" }, Na = {
532
556
  key: 0,
533
557
  class: "border-t border-border-separator pt-2.5"
534
- }, pa = { class: "flex w-48 flex-col gap-2.5 px-3 py-3.5" }, ba = ["for"], ga = ["id", "value", "placeholder", "aria-invalid"], ya = ["onClick"], fo = /* @__PURE__ */ G({
558
+ }, Pa = { class: "flex w-48 flex-col gap-2.5 px-3 py-3.5" }, Ka = ["for"], Ga = ["id", "value", "placeholder", "aria-invalid"], Ha = ["onClick"], Wa = /* @__PURE__ */ J({
535
559
  __name: "DateTimeField",
536
- props: /* @__PURE__ */ le(/* @__PURE__ */ ce({
560
+ props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
537
561
  label: {},
538
562
  labelHidden: { type: Boolean },
539
563
  hint: {},
@@ -550,190 +574,190 @@ const Kt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Pt = ["name
550
574
  openOn: {},
551
575
  minuteStep: {},
552
576
  quickPicks: {}
553
- }, { ...me, min: void 0, max: void 0, disabledDates: void 0, openOn: void 0, minuteStep: 1, quickPicks: void 0 }), {
577
+ }, { ...pe, min: void 0, max: void 0, disabledDates: void 0, openOn: void 0, minuteStep: 1, quickPicks: void 0 }), {
554
578
  modelValue: { default: null },
555
579
  modelModifiers: {}
556
580
  }),
557
- emits: /* @__PURE__ */ le(["focus", "blur"], ["update:modelValue"]),
558
- setup(l, { expose: a, emit: e }) {
559
- const t = l, o = re(l, "modelValue"), n = e, { t: u } = oe(), r = at(), m = Ie(), k = U("input"), x = U("popover"), $ = U("calendar"), i = U("sheet"), v = h(() => ({ min: t.min?.slice(0, 10), max: t.max?.slice(0, 10), disabled: t.disabledDates })), g = h(() => t.min && t.min.length === 10 ? `${t.min}T00:00` : t.min), T = h(() => t.max && t.max.length === 10 ? `${t.max}T23:59` : t.max), w = (_, c) => !St(c, { disabled: t.disabledDates }) && (!g.value || _ >= g.value) && (!T.value || _ <= T.value), F = Bt(() => v.value), O = qt(() => t.minuteStep), E = h(() => _e(o.value));
560
- function N(_) {
561
- const { date: c, time: B } = Tt(_), M = c === null ? E.value.day ?? Fe() : F.parse(c);
562
- if (!M) return { error: F.invalidMessage() };
563
- let b = E.value.time ?? Te(t.minuteStep);
564
- if (B !== null) {
565
- const L = O.parse(B);
566
- if ("error" in L) return L;
567
- b = L.value;
581
+ emits: /* @__PURE__ */ ve(["focus", "blur"], ["update:modelValue"]),
582
+ setup(l, { expose: t, emit: e }) {
583
+ const a = l, r = ke(l, "modelValue"), i = e, { t: p } = re(), u = bt(), b = Ne(), _ = oe("input"), V = oe("popover"), $ = oe("calendar"), n = oe("sheet"), c = q(() => ({ min: a.min?.slice(0, 10), max: a.max?.slice(0, 10), disabled: a.disabledDates })), m = q(() => a.min && a.min.length === 10 ? `${a.min}T00:00` : a.min), h = q(() => a.max && a.max.length === 10 ? `${a.max}T23:59` : a.max), v = (o, f) => !Zt(f, { disabled: a.disabledDates }) && (!m.value || o >= m.value) && (!h.value || o <= h.value), y = Qt(() => c.value), S = la(() => a.minuteStep), L = q(() => Se(r.value));
584
+ function T(o) {
585
+ const { date: f, time: E } = ta(o), G = f === null ? L.value.day ?? Be() : y.parse(f);
586
+ if (!G) return { error: y.invalidMessage() };
587
+ let F = L.value.time ?? Oe(a.minuteStep);
588
+ if (E !== null) {
589
+ const I = S.parse(E);
590
+ if ("error" in I) return I;
591
+ F = I.value;
568
592
  }
569
- const D = Ce(M, b);
570
- return w(D, M) ? { value: D } : { error: F.unavailableMessage() };
593
+ const K = Ce(G, F);
594
+ return v(K, G) ? { value: K } : { error: y.unavailableMessage() };
571
595
  }
572
- const V = Ge({ model: o, display: (_) => `${r.date(_e(_).day)} ${_e(_).time ?? ""}`.trim(), parse: N }), Q = h({
573
- get: () => E.value.time,
574
- set: (_) => {
575
- _ && kt(_) && (o.value = Ce(E.value.day ?? Fe(), _));
596
+ const C = Ze({ model: r, display: (o) => `${u.date(Se(o).day)} ${Se(o).time ?? ""}`.trim(), parse: T }), P = q({
597
+ get: () => L.value.time,
598
+ set: (o) => {
599
+ o && Kt(o) && (r.value = Ce(L.value.day ?? Be(), o));
576
600
  }
577
- }), ee = Ge({ model: Q, display: (_) => _, parse: O.parse }), ne = Lt(() => t.quickPicks ?? (m.value ? void 0 : []), () => m.value, () => v.value), ie = h(() => t.error || V.message.value || ee.message.value), ue = h(() => o.value ? r.dateTime(o.value) : null), z = Me("date", () => ie.value ? "error" : t.disabled ? "locked" : "rest"), A = h(() => {
578
- const _ = V.typed.value;
579
- return _ ? _e(_).day ?? null : null;
580
- }), K = h(() => A.value ?? (xt(E.value.day) ? E.value.day : null)), te = h(() => V.typed.value ? _e(V.typed.value).time : E.value.time);
581
- function Y(_) {
582
- _ && V.set(Ce(_, E.value.time ?? Te(t.minuteStep)));
601
+ }), Y = Ze({ model: P, display: (o) => o, parse: S.parse }), M = ea(() => a.quickPicks ?? (b.value ? void 0 : []), () => b.value, () => c.value), O = q(() => a.error || C.message.value || Y.message.value), X = q(() => r.value ? u.dateTime(r.value) : null), D = Ae("date", () => O.value ? "error" : a.disabled ? "locked" : "rest"), Q = q(() => {
602
+ const o = C.typed.value;
603
+ return o ? Se(o).day ?? null : null;
604
+ }), te = q(() => Q.value ?? (Gt(L.value.day) ? L.value.day : null)), ne = q(() => C.typed.value ? Se(C.typed.value).time : L.value.time);
605
+ function le(o) {
606
+ o && C.set(Ce(o, L.value.time ?? Oe(a.minuteStep)));
583
607
  }
584
- function se(_) {
585
- _ && V.set(Ce(E.value.day ?? Fe(), _));
608
+ function de(o) {
609
+ o && C.set(Ce(L.value.day ?? Be(), o));
586
610
  }
587
- function he(_) {
588
- V.set(Ce(Fe(), Te(t.minuteStep))), _();
611
+ function _e(o) {
612
+ C.set(Ce(Be(), Oe(a.minuteStep))), o();
589
613
  }
590
- const we = Re();
591
- async function ke(_) {
592
- t.disabled || (x.value?.present(), _ && (await xe(), await xe(), $.value?.focus()));
614
+ const ge = Ie();
615
+ async function w(o) {
616
+ a.disabled || (V.value?.present(), o && (await we(), await we(), $.value?.focus()));
593
617
  }
594
- function ae(_) {
595
- _.key === "Enter" ? (V.commit(), x.value?.dismiss()) : _.key === "ArrowDown" && (_.preventDefault(), ke(!0));
618
+ function A(o) {
619
+ o.key === "Enter" ? (C.commit(), V.value?.dismiss()) : o.key === "ArrowDown" && (o.preventDefault(), w(!0));
596
620
  }
597
- return a({ focus: () => k.value?.focus() }), (_, c) => (d(), R(ye, J({ ...s(fe)(t), error: ie.value }, {
598
- value: ue.value,
621
+ return t({ focus: () => _.value?.focus() }), (o, f) => (d(), z(ye, N({ ...s(fe)(a), error: O.value }, {
622
+ value: X.value,
599
623
  "value-style": "numeric"
600
- }), Z({
601
- default: f(({ id: B, describedby: M, invalid: b }) => [
602
- s(m) ? (d(), y(de, { key: 0 }, [
603
- I(tt, J({ id: B, "aria-describedby": M }, {
604
- disabled: t.disabled,
605
- invalid: b,
606
- placeholder: s(u)("core.form.select.choose"),
607
- onClick: c[0] || (c[0] = (D) => i.value?.present())
624
+ }), ie({
625
+ default: k(({ id: E, describedby: G, invalid: F }) => [
626
+ s(b) ? (d(), g(ee, { key: 0 }, [
627
+ U(vt, N({ id: E, "aria-describedby": G }, {
628
+ disabled: a.disabled,
629
+ invalid: F,
630
+ placeholder: s(p)("core.form.select.choose"),
631
+ onClick: f[0] || (f[0] = (K) => n.value?.present())
608
632
  }), {
609
- default: f(() => [
610
- o.value ? (d(), y("span", ra, [
611
- p("span", ia, C(s(r).date(E.value.day)), 1),
612
- c[8] || (c[8] = H(C(" "), -1)),
613
- p("span", ua, C(E.value.time), 1)
614
- ])) : q("", !0)
633
+ default: k(() => [
634
+ r.value ? (d(), g("span", Oa, [
635
+ x("span", Ma, B(s(u).date(L.value.day)), 1),
636
+ f[8] || (f[8] = Z(B(" "), -1)),
637
+ x("span", Ra, B(L.value.time), 1)
638
+ ])) : j("", !0)
615
639
  ]),
616
640
  _: 1
617
641
  }, 16, ["disabled", "invalid", "placeholder"]),
618
- I(wt, {
642
+ U(Ht, {
619
643
  ref_key: "sheet",
620
- ref: i,
621
- title: t.label ?? s(u)("core.form.date.calendar"),
644
+ ref: n,
645
+ title: a.label ?? s(p)("core.form.date.calendar"),
622
646
  mode: "datetime",
623
- "model-value": o.value,
624
- min: v.value.min,
625
- max: v.value.max,
626
- "disabled-dates": t.disabledDates,
627
- "open-on": t.openOn,
628
- shortcuts: s(ne),
629
- step: t.minuteStep,
630
- clearable: !t.required,
631
- "onUpdate:modelValue": s(V).set
647
+ "model-value": r.value,
648
+ min: c.value.min,
649
+ max: c.value.max,
650
+ "disabled-dates": a.disabledDates,
651
+ "open-on": a.openOn,
652
+ shortcuts: s(M),
653
+ step: a.minuteStep,
654
+ clearable: !a.required,
655
+ "onUpdate:modelValue": s(C).set
632
656
  }, null, 8, ["title", "model-value", "min", "max", "disabled-dates", "open-on", "shortcuts", "step", "clearable", "onUpdate:modelValue"])
633
- ], 64)) : (d(), R(je, {
657
+ ], 64)) : (d(), z(Pe, {
634
658
  key: 1,
635
659
  ref_key: "popover",
636
- ref: x,
637
- label: t.label ?? s(u)("core.form.date.calendar"),
660
+ ref: V,
661
+ label: a.label ?? s(p)("core.form.date.calendar"),
638
662
  width: "auto",
639
663
  placement: "bottom-start",
640
664
  arrow: !1,
641
665
  autofocus: !1
642
666
  }, {
643
- trigger: f(({ attrs: D, presented: L }) => [
644
- p("div", {
645
- class: j(["inline-flex max-w-full items-center gap-2", s(z)])
667
+ trigger: k(({ attrs: K, presented: I }) => [
668
+ x("div", {
669
+ class: W(["inline-flex max-w-full items-center gap-2", s(D)])
646
670
  }, [
647
- p("input", J({
648
- id: B,
671
+ x("input", N({
672
+ id: E,
649
673
  ref_key: "input",
650
- ref: k
651
- }, D, {
674
+ ref: _
675
+ }, K, {
652
676
  type: "text",
653
677
  role: "combobox",
654
678
  autocomplete: "off",
655
679
  size: "20",
656
- name: t.name,
657
- value: s(V).text.value,
658
- placeholder: s(F).placeholder.value,
659
- disabled: t.disabled,
660
- required: t.required,
661
- "aria-required": t.required || void 0,
662
- "aria-invalid": b || void 0,
663
- "aria-describedby": M,
680
+ name: a.name,
681
+ value: s(C).text.value,
682
+ placeholder: s(y).placeholder.value,
683
+ disabled: a.disabled,
684
+ required: a.required,
685
+ "aria-required": a.required || void 0,
686
+ "aria-invalid": F || void 0,
687
+ "aria-describedby": G,
664
688
  class: "block min-h-7 min-w-0 border-0 bg-transparent py-1 pl-2.5 text-body tabular-nums text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed",
665
- onInput: c[1] || (c[1] = (W) => s(V).input(W.target.value)),
666
- onFocus: c[2] || (c[2] = (W) => n("focus", W)),
667
- onBlur: c[3] || (c[3] = (W) => {
668
- s(V).commit(), n("blur", W);
689
+ onInput: f[1] || (f[1] = (se) => s(C).input(se.target.value)),
690
+ onFocus: f[2] || (f[2] = (se) => i("focus", se)),
691
+ onBlur: f[3] || (f[3] = (se) => {
692
+ s(C).commit(), i("blur", se);
669
693
  }),
670
- onKeydown: ae,
671
- onClick: c[4] || (c[4] = (W) => ke(!1))
672
- }), null, 16, da),
673
- t.disabled ? q("", !0) : (d(), y("button", {
694
+ onKeydown: A,
695
+ onClick: f[4] || (f[4] = (se) => w(!1))
696
+ }), null, 16, Ua),
697
+ a.disabled ? j("", !0) : (d(), g("button", {
674
698
  key: 0,
675
699
  type: "button",
676
700
  tabindex: "-1",
677
- "aria-label": s(u)("core.form.date.open"),
701
+ "aria-label": s(p)("core.form.date.open"),
678
702
  class: "mr-2 flex shrink-0 cursor-pointer items-center text-content-link",
679
- onClick: (W) => L ? x.value?.dismiss() : ke(!0)
703
+ onClick: (se) => I ? V.value?.dismiss() : w(!0)
680
704
  }, [
681
- I(s(X), {
705
+ U(s(ue), {
682
706
  name: "calendarLine",
683
707
  size: 18
684
708
  })
685
- ], 8, ca))
709
+ ], 8, Ea))
686
710
  ], 2)
687
711
  ]),
688
- default: f(({ dismiss: D }) => [
689
- p("div", fa, [
690
- p("div", ma, [
691
- I($t, {
712
+ default: k(({ dismiss: K }) => [
713
+ x("div", Ia, [
714
+ x("div", Aa, [
715
+ U(Wt, {
692
716
  ref_key: "calendar",
693
717
  ref: $,
694
- "model-value": K.value,
695
- min: v.value.min,
696
- max: v.value.max,
697
- "disabled-dates": t.disabledDates,
698
- "open-on": t.openOn,
699
- "onUpdate:modelValue": Y
718
+ "model-value": te.value,
719
+ min: c.value.min,
720
+ max: c.value.max,
721
+ "disabled-dates": a.disabledDates,
722
+ "open-on": a.openOn,
723
+ "onUpdate:modelValue": le
700
724
  }, null, 8, ["model-value", "min", "max", "disabled-dates", "open-on"]),
701
- s(ne).length > 0 ? (d(), y("div", va, [
702
- I(_t, {
703
- items: s(ne),
704
- selected: K.value,
705
- onPick: Y
725
+ s(M).length > 0 ? (d(), g("div", Na, [
726
+ U(Yt, {
727
+ items: s(M),
728
+ selected: te.value,
729
+ onPick: le
706
730
  }, null, 8, ["items", "selected"])
707
- ])) : q("", !0)
731
+ ])) : j("", !0)
708
732
  ]),
709
- p("div", pa, [
710
- p("label", {
711
- for: s(we),
733
+ x("div", Pa, [
734
+ x("label", {
735
+ for: s(ge),
712
736
  class: "text-footnote font-semibold text-content-muted"
713
- }, C(s(u)("core.form.time.label")), 9, ba),
714
- p("input", {
715
- id: s(we),
737
+ }, B(s(p)("core.form.time.label")), 9, Ka),
738
+ x("input", {
739
+ id: s(ge),
716
740
  type: "text",
717
741
  autocomplete: "off",
718
742
  inputmode: "numeric",
719
- value: s(ee).text.value,
720
- placeholder: s(O).placeholder.value,
721
- "aria-invalid": s(ee).message.value ? !0 : void 0,
743
+ value: s(Y).text.value,
744
+ placeholder: s(S).placeholder.value,
745
+ "aria-invalid": s(Y).message.value ? !0 : void 0,
722
746
  class: "rounded-control bg-fill p-1.5 text-center text-[20px] font-semibold tabular-nums text-content-strong placeholder:text-base placeholder:font-normal placeholder:text-content-disabled focus:outline-2 focus:outline-border-focus",
723
- onInput: c[5] || (c[5] = (L) => s(ee).input(L.target.value)),
724
- onBlur: c[6] || (c[6] = (L) => s(ee).commit()),
725
- onKeydown: c[7] || (c[7] = Se(pe((L) => s(ee).commit(), ["prevent"]), ["enter"]))
726
- }, null, 40, ga),
727
- I(Ct, {
728
- "model-value": te.value,
729
- step: t.minuteStep,
730
- "onUpdate:modelValue": se
747
+ onInput: f[5] || (f[5] = (I) => s(Y).input(I.target.value)),
748
+ onBlur: f[6] || (f[6] = (I) => s(Y).commit()),
749
+ onKeydown: f[7] || (f[7] = Fe(he((I) => s(Y).commit(), ["prevent"]), ["enter"]))
750
+ }, null, 40, Ga),
751
+ U(Jt, {
752
+ "model-value": ne.value,
753
+ step: a.minuteStep,
754
+ "onUpdate:modelValue": de
731
755
  }, null, 8, ["model-value", "step"]),
732
- p("button", {
756
+ x("button", {
733
757
  type: "button",
734
758
  class: "cursor-pointer self-start rounded-full bg-tint-soft px-2.5 py-1.5 text-footnote font-medium text-content-link focus-visible:outline-2 focus-visible:outline-border-focus",
735
- onClick: (L) => he(D)
736
- }, C(s(u)("core.form.time.now")), 9, ya)
759
+ onClick: (I) => _e(K)
760
+ }, B(s(p)("core.form.time.now")), 9, Ha)
737
761
  ])
738
762
  ])
739
763
  ]),
@@ -742,51 +766,51 @@ const Kt = ["id", "aria-label", "aria-describedby", "aria-invalid"], Pt = ["name
742
766
  ]),
743
767
  _: 2
744
768
  }, [
745
- _.$slots.trailing ? {
769
+ o.$slots.trailing ? {
746
770
  name: "trailing",
747
- fn: f(() => [
748
- S(_.$slots, "trailing")
771
+ fn: k(() => [
772
+ R(o.$slots, "trailing")
749
773
  ]),
750
774
  key: "0"
751
775
  } : void 0,
752
- _.$slots.labelTrailing ? {
776
+ o.$slots.labelTrailing ? {
753
777
  name: "labelTrailing",
754
- fn: f(() => [
755
- S(_.$slots, "labelTrailing")
778
+ fn: k(() => [
779
+ R(o.$slots, "labelTrailing")
756
780
  ]),
757
781
  key: "1"
758
782
  } : void 0,
759
- _.$slots.readonly ? {
783
+ o.$slots.readonly ? {
760
784
  name: "readonly",
761
- fn: f(() => [
762
- S(_.$slots, "readonly")
785
+ fn: k(() => [
786
+ R(o.$slots, "readonly")
763
787
  ]),
764
788
  key: "2"
765
789
  } : void 0
766
790
  ]), 1040, ["value"]));
767
791
  }
768
792
  });
769
- function lt(l, a = {}) {
770
- const e = a.accept ?? [];
793
+ function $t(l, t = {}) {
794
+ const e = t.accept ?? [];
771
795
  if (e.length > 0) {
772
- const t = l.name.lastIndexOf("."), o = t === -1 ? "" : l.name.slice(t).toLowerCase(), n = l.type.toLowerCase();
773
- if (!e.some((r) => {
774
- const m = r.trim().toLowerCase();
775
- return m.startsWith(".") ? m === o : m.endsWith("/*") ? n.startsWith(m.slice(0, -1)) : m === n;
796
+ const a = l.name.lastIndexOf("."), r = a === -1 ? "" : l.name.slice(a).toLowerCase(), i = l.type.toLowerCase();
797
+ if (!e.some((u) => {
798
+ const b = u.trim().toLowerCase();
799
+ return b.startsWith(".") ? b === r : b.endsWith("/*") ? i.startsWith(b.slice(0, -1)) : b === i;
776
800
  })) return "invalid_type";
777
801
  }
778
- return (a.maxSize ?? 0) > 0 && l.size > (a.maxSize ?? 0) ? "too_large" : null;
802
+ return (t.maxSize ?? 0) > 0 && l.size > (t.maxSize ?? 0) ? "too_large" : null;
779
803
  }
780
- function Be(l) {
804
+ function Le(l) {
781
805
  return l < 1024 ? `${l} B` : l < 1024 * 1024 ? `${Math.round(l / 1024)} KB` : `${(l / (1024 * 1024)).toFixed(l % (1024 * 1024) === 0 ? 0 : 1)} MB`;
782
806
  }
783
- const ha = { class: "w-full" }, ka = ["id", "accept", "disabled", "aria-describedby", "aria-invalid"], xa = {
807
+ const Ya = { class: "w-full" }, Ja = ["id", "accept", "disabled", "aria-describedby", "aria-invalid"], Za = {
784
808
  key: 0,
785
809
  class: "flex items-center gap-3 rounded-group bg-fill p-3",
786
810
  "data-test": "file-selected"
787
- }, wa = { class: "min-w-0 flex-1" }, $a = { class: "truncate text-body font-medium text-content-strong" }, _a = { class: "text-footnote text-content-muted" }, Ca = ["disabled", "aria-label", "title"], Sa = ["aria-disabled"], Fa = { class: "font-semibold text-content-link" }, Ba = { class: "text-content-muted" }, mo = /* @__PURE__ */ G({
811
+ }, Xa = { class: "min-w-0 flex-1" }, Qa = { class: "truncate text-body font-medium text-content-strong" }, el = { class: "text-footnote text-content-muted" }, tl = ["disabled", "aria-label", "title"], al = ["aria-disabled"], ll = { class: "font-semibold text-content-link" }, ol = { class: "text-content-muted" }, Sr = /* @__PURE__ */ J({
788
812
  __name: "FileField",
789
- props: /* @__PURE__ */ le(/* @__PURE__ */ ce({
813
+ props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
790
814
  label: {},
791
815
  labelHidden: { type: Boolean },
792
816
  hint: {},
@@ -800,91 +824,91 @@ const ha = { class: "w-full" }, ka = ["id", "accept", "disabled", "aria-describe
800
824
  variant: {},
801
825
  accept: {},
802
826
  maxSize: {}
803
- }, { ...me, variant: "button", accept: () => [], maxSize: 0 }), {
827
+ }, { ...pe, variant: "button", accept: () => [], maxSize: 0 }), {
804
828
  modelValue: { default: null },
805
829
  modelModifiers: {}
806
830
  }),
807
831
  emits: ["update:modelValue"],
808
- setup(l, { expose: a }) {
809
- const e = l, t = re(l, "modelValue"), { t: o } = oe(), n = U("chooser"), u = P(!1), r = P(null), m = h(() => {
832
+ setup(l, { expose: t }) {
833
+ const e = l, a = ke(l, "modelValue"), { t: r } = re(), i = oe("chooser"), p = H(!1), u = H(null), b = q(() => {
810
834
  if (e.hint) return e.hint;
811
835
  const $ = [];
812
- return e.accept.length && $.push(o("core.form.file.allowed", { formats: e.accept.map((i) => i.replace(/^\./, "").toUpperCase()).join(", ") })), e.maxSize > 0 && $.push(o("core.form.file.max_size", { size: Be(e.maxSize) })), $.join(" · ") || void 0;
836
+ return e.accept.length && $.push(r("core.form.file.allowed", { formats: e.accept.map((n) => n.replace(/^\./, "").toUpperCase()).join(", ") })), e.maxSize > 0 && $.push(r("core.form.file.max_size", { size: Le(e.maxSize) })), $.join(" · ") || void 0;
813
837
  });
814
- function k($) {
838
+ function _($) {
815
839
  if (!$) return;
816
- const i = lt($, { accept: e.accept, maxSize: e.maxSize });
817
- i ? (r.value = i === "invalid_type" ? o("core.form.file.invalid_type") : o("core.form.file.too_large", { size: Be(e.maxSize) }), t.value = null) : (r.value = null, t.value = $);
840
+ const n = $t($, { accept: e.accept, maxSize: e.maxSize });
841
+ n ? (u.value = n === "invalid_type" ? r("core.form.file.invalid_type") : r("core.form.file.too_large", { size: Le(e.maxSize) }), a.value = null) : (u.value = null, a.value = $);
818
842
  }
819
- function x() {
820
- t.value = null, r.value = null;
843
+ function V() {
844
+ a.value = null, u.value = null;
821
845
  }
822
- return ge(t, ($) => {
823
- !$ && n.value && (n.value.value = "");
824
- }), a({ clear: x }), ($, i) => (d(), R(ye, J({ ...s(fe)(e), hint: m.value, error: r.value ?? e.error }, {
825
- value: t.value?.name ?? null,
846
+ return be(a, ($) => {
847
+ !$ && i.value && (i.value.value = "");
848
+ }), t({ clear: V }), ($, n) => (d(), z(ye, N({ ...s(fe)(e), hint: b.value, error: u.value ?? e.error }, {
849
+ value: a.value?.name ?? null,
826
850
  "row-layout": "stacked"
827
- }), Z({
828
- default: f(({ id: v, describedby: g, invalid: T }) => [
829
- p("div", ha, [
830
- p("input", {
831
- id: v,
851
+ }), ie({
852
+ default: k(({ id: c, describedby: m, invalid: h }) => [
853
+ x("div", Ya, [
854
+ x("input", {
855
+ id: c,
832
856
  ref_key: "chooser",
833
- ref: n,
857
+ ref: i,
834
858
  type: "file",
835
859
  class: "sr-only",
836
860
  tabindex: "-1",
837
861
  accept: e.accept.join(",") || void 0,
838
862
  disabled: e.disabled,
839
- "aria-describedby": g,
840
- "aria-invalid": T || void 0,
841
- onChange: i[0] || (i[0] = (w) => k(w.target.files?.[0]))
842
- }, null, 40, ka),
843
- t.value ? (d(), y("div", xa, [
844
- p("div", wa, [
845
- p("p", $a, C(t.value.name), 1),
846
- p("p", _a, C(s(Be)(t.value.size)), 1)
863
+ "aria-describedby": m,
864
+ "aria-invalid": h || void 0,
865
+ onChange: n[0] || (n[0] = (v) => _(v.target.files?.[0]))
866
+ }, null, 40, Ja),
867
+ a.value ? (d(), g("div", Za, [
868
+ x("div", Xa, [
869
+ x("p", Qa, B(a.value.name), 1),
870
+ x("p", el, B(s(Le)(a.value.size)), 1)
847
871
  ]),
848
- p("button", {
872
+ x("button", {
849
873
  type: "button",
850
874
  disabled: e.disabled,
851
- "aria-label": s(o)("core.form.file.remove"),
852
- title: s(o)("core.form.file.remove"),
875
+ "aria-label": s(r)("core.form.file.remove"),
876
+ title: s(r)("core.form.file.remove"),
853
877
  class: "flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full text-content-muted hover:bg-fill-strong focus-visible:outline-2 focus-visible:outline-border-focus disabled:cursor-not-allowed",
854
- onClick: x
878
+ onClick: V
855
879
  }, [
856
- I(s(X), {
880
+ U(s(ue), {
857
881
  name: "close",
858
882
  size: 14
859
883
  })
860
- ], 8, Ca)
861
- ])) : e.variant === "dropzone" ? (d(), y("div", {
884
+ ], 8, tl)
885
+ ])) : e.variant === "dropzone" ? (d(), g("div", {
862
886
  key: 1,
863
887
  role: "button",
864
888
  tabindex: "0",
865
889
  "data-test": "file-dropzone",
866
890
  "aria-disabled": e.disabled || void 0,
867
- class: j(["cursor-pointer rounded-group border-2 border-dashed p-6 text-center text-body transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-border-focus", u.value ? "border-border-focus bg-tint-soft" : "border-border-control hover:bg-fill"]),
868
- onClick: i[1] || (i[1] = (w) => !e.disabled && n.value?.click()),
891
+ class: W(["cursor-pointer rounded-group border-2 border-dashed p-6 text-center text-body transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-border-focus", p.value ? "border-border-focus bg-tint-soft" : "border-border-control hover:bg-fill"]),
892
+ onClick: n[1] || (n[1] = (v) => !e.disabled && i.value?.click()),
869
893
  onKeydown: [
870
- i[2] || (i[2] = Se(pe((w) => !e.disabled && n.value?.click(), ["prevent"]), ["enter"])),
871
- i[3] || (i[3] = Se(pe((w) => !e.disabled && n.value?.click(), ["prevent"]), ["space"]))
894
+ n[2] || (n[2] = Fe(he((v) => !e.disabled && i.value?.click(), ["prevent"]), ["enter"])),
895
+ n[3] || (n[3] = Fe(he((v) => !e.disabled && i.value?.click(), ["prevent"]), ["space"]))
872
896
  ],
873
- onDragover: i[4] || (i[4] = pe((w) => u.value = !0, ["prevent"])),
874
- onDragleave: i[5] || (i[5] = pe((w) => u.value = !1, ["prevent"])),
875
- onDrop: i[6] || (i[6] = pe((w) => {
876
- u.value = !1, e.disabled || k(w.dataTransfer?.files?.[0]);
897
+ onDragover: n[4] || (n[4] = he((v) => p.value = !0, ["prevent"])),
898
+ onDragleave: n[5] || (n[5] = he((v) => p.value = !1, ["prevent"])),
899
+ onDrop: n[6] || (n[6] = he((v) => {
900
+ p.value = !1, e.disabled || _(v.dataTransfer?.files?.[0]);
877
901
  }, ["prevent"]))
878
902
  }, [
879
- p("span", Fa, C(s(o)("core.form.file.choose")), 1),
880
- p("span", Ba, C(" " + s(o)("core.form.file.drop")), 1)
881
- ], 42, Sa)) : (d(), R(be, {
903
+ x("span", ll, B(s(r)("core.form.file.choose")), 1),
904
+ x("span", ol, B(" " + s(r)("core.form.file.drop")), 1)
905
+ ], 42, al)) : (d(), z(ae, {
882
906
  key: 2,
883
907
  disabled: e.disabled,
884
- onClick: i[7] || (i[7] = (w) => n.value?.click())
908
+ onClick: n[7] || (n[7] = (v) => i.value?.click())
885
909
  }, {
886
- default: f(() => [
887
- H(C(s(o)("core.form.file.choose")), 1)
910
+ default: k(() => [
911
+ Z(B(s(r)("core.form.file.choose")), 1)
888
912
  ]),
889
913
  _: 1
890
914
  }, 8, ["disabled"]))
@@ -894,28 +918,28 @@ const ha = { class: "w-full" }, ka = ["id", "accept", "disabled", "aria-describe
894
918
  }, [
895
919
  $.$slots.trailing ? {
896
920
  name: "trailing",
897
- fn: f(() => [
898
- S($.$slots, "trailing")
921
+ fn: k(() => [
922
+ R($.$slots, "trailing")
899
923
  ]),
900
924
  key: "0"
901
925
  } : void 0,
902
926
  $.$slots.labelTrailing ? {
903
927
  name: "labelTrailing",
904
- fn: f(() => [
905
- S($.$slots, "labelTrailing")
928
+ fn: k(() => [
929
+ R($.$slots, "labelTrailing")
906
930
  ]),
907
931
  key: "1"
908
932
  } : void 0,
909
933
  $.$slots.readonly ? {
910
934
  name: "readonly",
911
- fn: f(() => [
912
- S($.$slots, "readonly")
935
+ fn: k(() => [
936
+ R($.$slots, "readonly")
913
937
  ]),
914
938
  key: "2"
915
939
  } : void 0
916
940
  ]), 1040, ["value"]));
917
941
  }
918
- }), La = ["disabled"], vo = /* @__PURE__ */ G({
942
+ }), rl = ["disabled"], Fr = /* @__PURE__ */ J({
919
943
  __name: "FormGroupButton",
920
944
  props: {
921
945
  label: {},
@@ -923,18 +947,18 @@ const ha = { class: "w-full" }, ka = ["id", "accept", "disabled", "aria-describe
923
947
  disabled: { type: Boolean, default: !1 }
924
948
  },
925
949
  emits: ["click"],
926
- setup(l, { emit: a }) {
927
- const e = l, t = a;
928
- return (o, n) => (d(), R(ot, null, {
929
- default: f(() => [
930
- I(mt, { layout: "stacked" }, {
931
- default: f(() => [
932
- p("button", {
950
+ setup(l, { emit: t }) {
951
+ const e = l, a = t;
952
+ return (r, i) => (d(), z(St, null, {
953
+ default: k(() => [
954
+ U(Ot, { layout: "stacked" }, {
955
+ default: k(() => [
956
+ x("button", {
933
957
  type: "button",
934
958
  disabled: e.disabled,
935
- class: j(["w-full py-1 text-center text-body focus-visible:outline-2 focus-visible:outline-border-focus disabled:text-content-disabled", e.tone === "critical" ? "text-content-destructive" : "text-content-link"]),
936
- onClick: n[0] || (n[0] = (u) => t("click"))
937
- }, C(e.label), 11, La)
959
+ class: W(["w-full py-1 text-center text-body focus-visible:outline-2 focus-visible:outline-border-focus disabled:text-content-disabled", e.tone === "critical" ? "text-content-destructive" : "text-content-link"]),
960
+ onClick: i[0] || (i[0] = (p) => a("click"))
961
+ }, B(e.label), 11, rl)
938
962
  ]),
939
963
  _: 1
940
964
  })
@@ -942,31 +966,31 @@ const ha = { class: "w-full" }, ka = ["id", "accept", "disabled", "aria-describe
942
966
  _: 1
943
967
  }));
944
968
  }
945
- }), po = /* @__PURE__ */ G({
969
+ }), qr = /* @__PURE__ */ J({
946
970
  __name: "FormIndent",
947
971
  setup(l) {
948
- return rt(vt, pt() + 1), (a, e) => S(a.$slots, "default");
972
+ return ut(Mt, Rt() + 1), (t, e) => R(t.$slots, "default");
949
973
  }
950
974
  });
951
- function Ta(l, a) {
952
- return a.filter((e) => (l?.[e] ?? "").trim() === "");
975
+ function nl(l, t) {
976
+ return t.filter((e) => (l?.[e] ?? "").trim() === "");
953
977
  }
954
- const qa = ["id", "aria-labelledby"], za = ["id", "value", "lang", "name", "rows", "placeholder", "maxlength", "disabled", "aria-required", "aria-invalid", "aria-describedby"], Va = ["id", "value", "lang", "name", "placeholder", "maxlength", "disabled", "aria-required", "aria-invalid", "aria-describedby"], Da = {
978
+ const sl = ["id", "aria-labelledby"], il = ["id", "value", "lang", "name", "rows", "placeholder", "maxlength", "disabled", "aria-required", "aria-invalid", "aria-describedby"], ul = ["id", "value", "lang", "name", "placeholder", "maxlength", "disabled", "aria-required", "aria-invalid", "aria-describedby"], dl = {
955
979
  key: 0,
956
980
  class: "mt-1.5 flex items-center gap-2"
957
- }, Ra = {
981
+ }, cl = {
958
982
  key: 0,
959
983
  class: "flex-1 text-footnote text-status-warning-content",
960
984
  "data-test": "i18n-missing"
961
- }, Ma = {
985
+ }, ml = {
962
986
  key: 1,
963
987
  class: "flex-1"
964
- }, Ia = ["aria-label"], ja = ["id", "aria-selected", "tabindex", "aria-controls", "aria-label", "title", "onClick", "onKeydown"], Oa = ["data-state"], Ea = { class: "w-full" }, Na = { class: "whitespace-pre-line break-words text-body text-content-strong" }, Aa = ["aria-expanded"], Ga = { class: "flex-1" }, Ka = {
988
+ }, fl = ["aria-label"], pl = ["id", "aria-selected", "tabindex", "aria-controls", "aria-label", "title", "onClick", "onKeydown"], vl = ["data-state"], bl = { class: "w-full" }, yl = { class: "whitespace-pre-line break-words text-body text-content-strong" }, gl = ["aria-expanded"], hl = { class: "flex-1" }, kl = {
965
989
  key: 0,
966
990
  class: "mt-1 flex flex-col gap-1.5"
967
- }, Pa = ["title"], bo = /* @__PURE__ */ G({
991
+ }, _l = ["title"], xl = /* @__PURE__ */ J({
968
992
  __name: "I18nField",
969
- props: /* @__PURE__ */ le(/* @__PURE__ */ ce({
993
+ props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
970
994
  label: {},
971
995
  labelHidden: { type: Boolean },
972
996
  hint: {},
@@ -984,213 +1008,213 @@ const qa = ["id", "aria-labelledby"], za = ["id", "value", "lang", "name", "rows
984
1008
  rows: {},
985
1009
  placeholder: {},
986
1010
  maxLength: {}
987
- }, { ...me, locales: void 0, defaultLocale: void 0, requiredLocales: () => [], multiline: !1, rows: 3, placeholder: void 0, maxLength: void 0 }), {
1011
+ }, { ...pe, locales: void 0, defaultLocale: void 0, requiredLocales: () => [], multiline: !1, rows: 3, placeholder: void 0, maxLength: void 0 }), {
988
1012
  modelValue: { default: () => ({}) },
989
1013
  modelModifiers: {}
990
1014
  }),
991
1015
  emits: ["update:modelValue"],
992
- setup(l, { expose: a }) {
993
- const e = l, t = re(l, "modelValue"), { t: o, locale: n, availableLocales: u } = oe(), r = at(), m = Je(zt, null), k = Re(), x = U("field"), $ = U("root"), { editable: i } = Qe(e), v = Me(e.multiline ? "area" : "text", () => e.error || Y.value ? "error" : e.disabled ? "locked" : "rest"), g = h(() => e.locales ?? m?.locales ?? u), T = h(() => e.defaultLocale ?? g.value[0] ?? ""), w = h(() => g.value.includes(T.value) ? [T.value, ...g.value.filter((b) => b !== T.value)] : g.value), F = P(null), O = h(() => F.value !== null && w.value.includes(F.value) ? F.value : w.value.includes(n.value) ? n.value : T.value), E = (b) => t.value[b] ?? "", N = (b) => E(b).trim() !== "", V = (b) => b.toUpperCase();
994
- function Q(b) {
1016
+ setup(l, { expose: t }) {
1017
+ const e = l, a = ke(l, "modelValue"), { t: r, locale: i, availableLocales: p } = re(), u = bt(), b = De(yt, null), _ = Ie(), V = oe("field"), $ = oe("root"), { editable: n } = qe(e), c = Ae(e.multiline ? "area" : "text", () => e.error || le.value ? "error" : e.disabled ? "locked" : "rest"), m = q(() => e.locales ?? b?.locales ?? p), h = q(() => e.defaultLocale ?? m.value[0] ?? ""), v = q(() => m.value.includes(h.value) ? [h.value, ...m.value.filter((F) => F !== h.value)] : m.value), y = H(null), S = q(() => y.value !== null && v.value.includes(y.value) ? y.value : v.value.includes(i.value) ? i.value : h.value), L = (F) => a.value[F] ?? "", T = (F) => L(F).trim() !== "", C = (F) => F.toUpperCase();
1018
+ function P(F) {
995
1019
  try {
996
- return new Intl.DisplayNames([r.intlLocale], { type: "language" }).of(b) ?? V(b);
1020
+ return new Intl.DisplayNames([u.intlLocale], { type: "language" }).of(F) ?? C(F);
997
1021
  } catch {
998
- return V(b);
1022
+ return C(F);
999
1023
  }
1000
1024
  }
1001
- const ee = (b) => b.map(Q).join(", ");
1002
- function ne(b, D) {
1003
- t.value = { ...t.value, [b]: D };
1025
+ const Y = (F) => F.map(P).join(", ");
1026
+ function M(F, K) {
1027
+ a.value = { ...a.value, [F]: K };
1004
1028
  }
1005
- const ie = (b) => `${k}-tab-${b}`;
1006
- function ue(b, D) {
1007
- F.value = b, D && xe(() => x.value?.focus());
1029
+ const O = (F) => `${_}-tab-${F}`;
1030
+ function X(F, K) {
1031
+ y.value = F, K && we(() => V.value?.focus());
1008
1032
  }
1009
- function z(b, D) {
1010
- const L = w.value.length - 1, W = { ArrowRight: D + 1, ArrowLeft: D - 1, Home: 0, End: L }[b.key];
1011
- if (W === void 0) return;
1012
- b.preventDefault();
1013
- const ve = w.value[(W + w.value.length) % w.value.length];
1014
- ve !== void 0 && (ue(ve, !1), xe(() => document.getElementById(ie(ve))?.focus()));
1033
+ function D(F, K) {
1034
+ const I = v.value.length - 1, se = { ArrowRight: K + 1, ArrowLeft: K - 1, Home: 0, End: I }[F.key];
1035
+ if (se === void 0) return;
1036
+ F.preventDefault();
1037
+ const xe = v.value[(se + v.value.length) % v.value.length];
1038
+ xe !== void 0 && (X(xe, !1), we(() => document.getElementById(O(xe))?.focus()));
1015
1039
  }
1016
- const A = P(!1);
1017
- function K(b) {
1018
- $.value?.contains(b.relatedTarget) || (A.value = !0);
1040
+ const Q = H(!1);
1041
+ function te(F) {
1042
+ $.value?.contains(F.relatedTarget) || (Q.value = !0);
1019
1043
  }
1020
- const te = h(() => Ta(t.value, e.requiredLocales)), Y = h(() => A.value && te.value.length > 0 ? o("core.form.i18n.required", { languages: ee(te.value) }) : void 0), se = h(() => e.requiredLocales.length > 0 ? te.value.length === 0 : w.value.some(N)), he = h(() => w.value.filter((b) => !N(b) && !(Y.value && te.value.includes(b)))), we = h(() => N(T.value) && w.value.some((b) => b !== T.value && !N(b)));
1021
- function ke() {
1022
- const b = E(T.value);
1023
- t.value = { ...t.value, ...Object.fromEntries(w.value.filter((D) => !N(D)).map((D) => [D, b])) };
1044
+ const ne = q(() => nl(a.value, e.requiredLocales)), le = q(() => Q.value && ne.value.length > 0 ? r("core.form.i18n.required", { languages: Y(ne.value) }) : void 0), de = q(() => e.requiredLocales.length > 0 ? ne.value.length === 0 : v.value.some(T)), _e = q(() => v.value.filter((F) => !T(F) && !(le.value && ne.value.includes(F)))), ge = q(() => T(h.value) && v.value.some((F) => F !== h.value && !T(F)));
1045
+ function w() {
1046
+ const F = L(h.value);
1047
+ a.value = { ...a.value, ...Object.fromEntries(v.value.filter((K) => !T(K)).map((K) => [K, F])) };
1024
1048
  }
1025
- const ae = h(() => [n.value, T.value, ...w.value].find((b) => w.value.includes(b) && N(b))), _ = h(() => w.value.filter((b) => b !== ae.value)), c = h(() => _.value.filter(N).length), B = P(!1), M = h(() => e.label && !i.value && ae.value ? `${e.label} · ${V(ae.value)}` : e.label);
1026
- return a({ focus: () => x.value?.focus() }), (b, D) => (d(), R(ye, J({ ...s(fe)(e), label: M.value, error: e.error ?? Y.value, required: e.required || e.requiredLocales.length > 0 }, {
1027
- value: s(i) ? se.value ? "written" : null : ae.value ? E(ae.value) : null,
1049
+ const A = q(() => [i.value, h.value, ...v.value].find((F) => v.value.includes(F) && T(F))), o = q(() => v.value.filter((F) => F !== A.value)), f = q(() => o.value.filter(T).length), E = H(!1), G = q(() => e.label && !n.value && A.value ? `${e.label} · ${C(A.value)}` : e.label);
1050
+ return t({ focus: () => V.value?.focus() }), (F, K) => (d(), z(ye, N({ ...s(fe)(e), label: G.value, error: e.error ?? le.value, required: e.required || e.requiredLocales.length > 0 }, {
1051
+ value: s(n) ? de.value ? "written" : null : A.value ? L(A.value) : null,
1028
1052
  "row-layout": "stacked"
1029
- }), Z({
1030
- default: f(({ id: L, describedby: W, invalid: ve }) => [
1031
- p("div", {
1053
+ }), ie({
1054
+ default: k(({ id: I, describedby: se, invalid: xe }) => [
1055
+ x("div", {
1032
1056
  ref_key: "root",
1033
1057
  ref: $,
1034
1058
  class: "w-full",
1035
- onFocusout: K
1059
+ onFocusout: te
1036
1060
  }, [
1037
- p("div", {
1038
- id: `${s(k)}-panel`,
1061
+ x("div", {
1062
+ id: `${s(_)}-panel`,
1039
1063
  role: "tabpanel",
1040
- "aria-labelledby": ie(O.value)
1064
+ "aria-labelledby": O(S.value)
1041
1065
  }, [
1042
- p("div", {
1043
- class: j(["w-full", s(v)])
1066
+ x("div", {
1067
+ class: W(["w-full", s(c)])
1044
1068
  }, [
1045
- e.multiline ? (d(), y("textarea", {
1069
+ e.multiline ? (d(), g("textarea", {
1046
1070
  key: 0,
1047
- id: L,
1071
+ id: I,
1048
1072
  ref_key: "field",
1049
- ref: x,
1050
- value: E(O.value),
1051
- lang: O.value,
1073
+ ref: V,
1074
+ value: L(S.value),
1075
+ lang: S.value,
1052
1076
  name: e.name,
1053
1077
  rows: e.rows,
1054
1078
  placeholder: e.placeholder,
1055
1079
  maxlength: e.maxLength,
1056
1080
  disabled: e.disabled,
1057
1081
  "aria-required": e.required || void 0,
1058
- "aria-invalid": ve || void 0,
1059
- "aria-describedby": W,
1082
+ "aria-invalid": xe || void 0,
1083
+ "aria-describedby": se,
1060
1084
  "data-test": "i18n-input",
1061
1085
  class: "block w-full resize-y border-0 bg-transparent px-0 py-1 text-body text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed",
1062
- onInput: D[0] || (D[0] = (Le) => ne(O.value, Le.target.value))
1063
- }, null, 40, za)) : (d(), y("input", {
1086
+ onInput: K[0] || (K[0] = (je) => M(S.value, je.target.value))
1087
+ }, null, 40, il)) : (d(), g("input", {
1064
1088
  key: 1,
1065
- id: L,
1089
+ id: I,
1066
1090
  ref_key: "field",
1067
- ref: x,
1068
- value: E(O.value),
1069
- lang: O.value,
1091
+ ref: V,
1092
+ value: L(S.value),
1093
+ lang: S.value,
1070
1094
  type: "text",
1071
1095
  name: e.name,
1072
1096
  placeholder: e.placeholder,
1073
1097
  maxlength: e.maxLength,
1074
1098
  disabled: e.disabled,
1075
1099
  "aria-required": e.required || void 0,
1076
- "aria-invalid": ve || void 0,
1077
- "aria-describedby": W,
1100
+ "aria-invalid": xe || void 0,
1101
+ "aria-describedby": se,
1078
1102
  "data-test": "i18n-input",
1079
1103
  class: "block w-full min-w-0 border-0 bg-transparent px-0 py-1 text-body text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed",
1080
- onInput: D[1] || (D[1] = (Le) => ne(O.value, Le.target.value))
1081
- }, null, 40, Va))
1104
+ onInput: K[1] || (K[1] = (je) => M(S.value, je.target.value))
1105
+ }, null, 40, ul))
1082
1106
  ], 2)
1083
- ], 8, qa),
1084
- he.value.length > 0 || we.value ? (d(), y("div", Da, [
1085
- he.value.length > 0 ? (d(), y("p", Ra, C(s(o)("core.form.i18n.missing", { languages: ee(he.value) })), 1)) : (d(), y("span", Ma)),
1086
- we.value && !e.disabled ? (d(), y("button", {
1107
+ ], 8, sl),
1108
+ _e.value.length > 0 || ge.value ? (d(), g("div", dl, [
1109
+ _e.value.length > 0 ? (d(), g("p", cl, B(s(r)("core.form.i18n.missing", { languages: Y(_e.value) })), 1)) : (d(), g("span", ml)),
1110
+ ge.value && !e.disabled ? (d(), g("button", {
1087
1111
  key: 2,
1088
1112
  type: "button",
1089
1113
  "data-test": "i18n-copy",
1090
1114
  class: "shrink-0 cursor-pointer rounded-control bg-tint-soft px-2.5 py-1.5 text-footnote font-medium text-content-link transition-colors duration-motion-fast hover:bg-fill focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
1091
- onClick: ke
1092
- }, C(s(o)("core.form.i18n.copy", { language: V(T.value) })), 1)) : q("", !0)
1093
- ])) : q("", !0)
1115
+ onClick: w
1116
+ }, B(s(r)("core.form.i18n.copy", { language: C(h.value) })), 1)) : j("", !0)
1117
+ ])) : j("", !0)
1094
1118
  ], 544)
1095
1119
  ]),
1096
- labelTrailing: f(() => [
1097
- p("div", {
1120
+ labelTrailing: k(() => [
1121
+ x("div", {
1098
1122
  role: "tablist",
1099
- "aria-label": s(o)("core.form.i18n.languages"),
1123
+ "aria-label": s(r)("core.form.i18n.languages"),
1100
1124
  class: "flex shrink-0 gap-0.5 rounded-control bg-fill p-0.5",
1101
1125
  "data-test": "i18n-tabs"
1102
1126
  }, [
1103
- (d(!0), y(de, null, $e(w.value, (L, W) => (d(), y("button", {
1104
- id: ie(L),
1105
- key: L,
1127
+ (d(!0), g(ee, null, ce(v.value, (I, se) => (d(), g("button", {
1128
+ id: O(I),
1129
+ key: I,
1106
1130
  type: "button",
1107
1131
  role: "tab",
1108
- "aria-selected": L === O.value,
1109
- tabindex: L === O.value ? 0 : -1,
1110
- "aria-controls": `${s(k)}-panel`,
1111
- "aria-label": s(o)(N(L) ? "core.form.i18n.tab_written" : "core.form.i18n.tab_empty", { language: Q(L) }),
1112
- title: Q(L),
1113
- class: j(["flex min-h-7 cursor-pointer items-center gap-1.5 rounded-control px-2.5 py-1 text-footnote font-semibold transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", L === O.value ? "bg-segment-selected text-content-strong shadow-sm" : "text-content-muted hover:text-content-strong"]),
1114
- onClick: (ve) => ue(L, !0),
1115
- onKeydown: (ve) => z(ve, W)
1132
+ "aria-selected": I === S.value,
1133
+ tabindex: I === S.value ? 0 : -1,
1134
+ "aria-controls": `${s(_)}-panel`,
1135
+ "aria-label": s(r)(T(I) ? "core.form.i18n.tab_written" : "core.form.i18n.tab_empty", { language: P(I) }),
1136
+ title: P(I),
1137
+ class: W(["flex min-h-7 cursor-pointer items-center gap-1.5 rounded-control px-2.5 py-1 text-footnote font-semibold transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", I === S.value ? "bg-segment-selected text-content-strong shadow-sm" : "text-content-muted hover:text-content-strong"]),
1138
+ onClick: (xe) => X(I, !0),
1139
+ onKeydown: (xe) => D(xe, se)
1116
1140
  }, [
1117
- H(C(V(L)) + " ", 1),
1118
- p("span", {
1141
+ Z(B(C(I)) + " ", 1),
1142
+ x("span", {
1119
1143
  "aria-hidden": "true",
1120
- class: j(["size-1.5 rounded-full", N(L) ? "bg-status-success-solid" : Y.value && te.value.includes(L) ? "bg-content-destructive" : "bg-content-disabled"]),
1144
+ class: W(["size-1.5 rounded-full", T(I) ? "bg-status-success-solid" : le.value && ne.value.includes(I) ? "bg-content-destructive" : "bg-content-disabled"]),
1121
1145
  "data-test": "i18n-dot",
1122
- "data-state": N(L) ? "written" : Y.value && te.value.includes(L) ? "required" : "empty"
1123
- }, null, 10, Oa)
1124
- ], 42, ja))), 128))
1125
- ], 8, Ia)
1146
+ "data-state": T(I) ? "written" : le.value && ne.value.includes(I) ? "required" : "empty"
1147
+ }, null, 10, vl)
1148
+ ], 42, pl))), 128))
1149
+ ], 8, fl)
1126
1150
  ]),
1127
1151
  _: 2
1128
1152
  }, [
1129
- ae.value ? {
1153
+ A.value ? {
1130
1154
  name: "readonly",
1131
- fn: f(() => [
1132
- p("div", Ea, [
1133
- p("p", Na, C(E(ae.value)), 1),
1134
- _.value.length > 0 ? (d(), y(de, { key: 0 }, [
1135
- p("button", {
1155
+ fn: k(() => [
1156
+ x("div", bl, [
1157
+ x("p", yl, B(L(A.value)), 1),
1158
+ o.value.length > 0 ? (d(), g(ee, { key: 0 }, [
1159
+ x("button", {
1136
1160
  type: "button",
1137
- "aria-expanded": B.value,
1161
+ "aria-expanded": E.value,
1138
1162
  class: "mt-1.5 flex w-full cursor-pointer items-center gap-2 text-left text-footnote text-content-muted focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
1139
- onClick: D[2] || (D[2] = (L) => B.value = !B.value)
1163
+ onClick: K[2] || (K[2] = (I) => E.value = !E.value)
1140
1164
  }, [
1141
- p("span", Ga, C(s(o)("core.form.i18n.more", { count: _.value.length, filled: c.value })), 1),
1142
- I(s(X), {
1165
+ x("span", hl, B(s(r)("core.form.i18n.more", { count: o.value.length, filled: f.value })), 1),
1166
+ U(s(ue), {
1143
1167
  name: "arrowRightSLine",
1144
1168
  size: 16,
1145
- class: j(["shrink-0 transition-transform duration-motion-fast", B.value ? "rotate-90" : ""])
1169
+ class: W(["shrink-0 transition-transform duration-motion-fast", E.value ? "rotate-90" : ""])
1146
1170
  }, null, 8, ["class"])
1147
- ], 8, Aa),
1148
- B.value ? (d(), y("dl", Ka, [
1149
- (d(!0), y(de, null, $e(_.value, (L) => (d(), y("div", {
1150
- key: L,
1171
+ ], 8, gl),
1172
+ E.value ? (d(), g("dl", kl, [
1173
+ (d(!0), g(ee, null, ce(o.value, (I) => (d(), g("div", {
1174
+ key: I,
1151
1175
  class: "flex gap-2 text-body"
1152
1176
  }, [
1153
- p("dt", {
1177
+ x("dt", {
1154
1178
  class: "w-8 shrink-0 text-footnote font-semibold leading-6 text-content-muted",
1155
- title: Q(L)
1156
- }, C(V(L)), 9, Pa),
1157
- p("dd", {
1158
- class: j(["min-w-0 flex-1 whitespace-pre-line break-words", N(L) ? "text-content-strong" : "text-content-disabled"])
1159
- }, C(N(L) ? E(L) : s(o)("core.state.no_value")), 3)
1179
+ title: P(I)
1180
+ }, B(C(I)), 9, _l),
1181
+ x("dd", {
1182
+ class: W(["min-w-0 flex-1 whitespace-pre-line break-words", T(I) ? "text-content-strong" : "text-content-disabled"])
1183
+ }, B(T(I) ? L(I) : s(r)("core.state.no_value")), 3)
1160
1184
  ]))), 128))
1161
- ])) : q("", !0)
1162
- ], 64)) : q("", !0)
1185
+ ])) : j("", !0)
1186
+ ], 64)) : j("", !0)
1163
1187
  ])
1164
1188
  ]),
1165
1189
  key: "0"
1166
1190
  } : void 0,
1167
- b.$slots.trailing ? {
1191
+ F.$slots.trailing ? {
1168
1192
  name: "trailing",
1169
- fn: f(() => [
1170
- S(b.$slots, "trailing")
1193
+ fn: k(() => [
1194
+ R(F.$slots, "trailing")
1171
1195
  ]),
1172
1196
  key: "1"
1173
1197
  } : void 0
1174
1198
  ]), 1040, ["value"]));
1175
1199
  }
1176
- }), Ha = "unsupported_characters", Ua = /[\u{10000}-\u{10FFFF}]/u;
1177
- function Ya(l) {
1178
- return Ua.test(l);
1200
+ }), wl = "unsupported_characters", $l = /[\u{10000}-\u{10FFFF}]/u;
1201
+ function Vl(l) {
1202
+ return $l.test(l);
1179
1203
  }
1180
- function De(l, a, e) {
1204
+ function Ee(l, t, e) {
1181
1205
  if (typeof l == "string")
1182
- Ya(l) && e.addIssue({ code: "custom", path: a, params: { code: Ha } });
1206
+ Vl(l) && e.addIssue({ code: "custom", path: t, params: { code: wl } });
1183
1207
  else if (Array.isArray(l))
1184
- l.forEach((t, o) => De(t, [...a, o], e));
1208
+ l.forEach((a, r) => Ee(a, [...t, r], e));
1185
1209
  else if (l && typeof l == "object")
1186
- for (const [t, o] of Object.entries(l)) De(o, [...a, t], e);
1210
+ for (const [a, r] of Object.entries(l)) Ee(r, [...t, a], e);
1187
1211
  }
1188
- function go(l, a) {
1189
- De(l, [], a);
1212
+ function Br(l, t) {
1213
+ Ee(l, [], t);
1190
1214
  }
1191
- const yo = /* @__PURE__ */ G({
1215
+ const Lr = /* @__PURE__ */ J({
1192
1216
  __name: "MoneyField",
1193
- props: /* @__PURE__ */ ce({
1217
+ props: /* @__PURE__ */ me({
1194
1218
  label: {},
1195
1219
  labelHidden: { type: Boolean },
1196
1220
  hint: {},
@@ -1207,50 +1231,50 @@ const yo = /* @__PURE__ */ G({
1207
1231
  blankZero: { type: Boolean },
1208
1232
  negative: { type: Boolean },
1209
1233
  width: {}
1210
- }, { ...me, modelValue: void 0, decimals: 2, blankZero: !1, negative: !1, width: "sm" }),
1234
+ }, { ...pe, modelValue: void 0, decimals: 2, blankZero: !1, negative: !1, width: "sm" }),
1211
1235
  emits: ["update:modelValue", "focus", "blur"],
1212
- setup(l, { expose: a, emit: e }) {
1213
- const t = l, o = e, n = U("field");
1214
- return a({ focus: () => n.value?.focus() }), (u, r) => (d(), R(Vt, J({
1236
+ setup(l, { expose: t, emit: e }) {
1237
+ const a = l, r = e, i = oe("field");
1238
+ return t({ focus: () => i.value?.focus() }), (p, u) => (d(), z(gt, N({
1215
1239
  ref_key: "field",
1216
- ref: n,
1217
- "model-value": t.modelValue,
1218
- "onUpdate:modelValue": r[0] || (r[0] = (m) => o("update:modelValue", m))
1219
- }, s(fe)(t), {
1220
- decimals: t.decimals,
1221
- negative: t.negative,
1222
- "blank-zero": t.blankZero,
1223
- suffix: t.currency,
1224
- width: t.width,
1225
- onFocus: r[1] || (r[1] = (m) => o("focus", m)),
1226
- onBlur: r[2] || (r[2] = (m) => o("blur", m))
1227
- }), Z({ _: 2 }, [
1228
- u.$slots.trailing ? {
1240
+ ref: i,
1241
+ "model-value": a.modelValue,
1242
+ "onUpdate:modelValue": u[0] || (u[0] = (b) => r("update:modelValue", b))
1243
+ }, s(fe)(a), {
1244
+ decimals: a.decimals,
1245
+ negative: a.negative,
1246
+ "blank-zero": a.blankZero,
1247
+ suffix: a.currency,
1248
+ width: a.width,
1249
+ onFocus: u[1] || (u[1] = (b) => r("focus", b)),
1250
+ onBlur: u[2] || (u[2] = (b) => r("blur", b))
1251
+ }), ie({ _: 2 }, [
1252
+ p.$slots.trailing ? {
1229
1253
  name: "trailing",
1230
- fn: f(() => [
1231
- S(u.$slots, "trailing")
1254
+ fn: k(() => [
1255
+ R(p.$slots, "trailing")
1232
1256
  ]),
1233
1257
  key: "0"
1234
1258
  } : void 0,
1235
- u.$slots.labelTrailing ? {
1259
+ p.$slots.labelTrailing ? {
1236
1260
  name: "labelTrailing",
1237
- fn: f(() => [
1238
- S(u.$slots, "labelTrailing")
1261
+ fn: k(() => [
1262
+ R(p.$slots, "labelTrailing")
1239
1263
  ]),
1240
1264
  key: "1"
1241
1265
  } : void 0,
1242
- u.$slots.readonly ? {
1266
+ p.$slots.readonly ? {
1243
1267
  name: "readonly",
1244
- fn: f(() => [
1245
- S(u.$slots, "readonly")
1268
+ fn: k(() => [
1269
+ R(p.$slots, "readonly")
1246
1270
  ]),
1247
1271
  key: "2"
1248
1272
  } : void 0
1249
1273
  ]), 1040, ["model-value", "decimals", "negative", "blank-zero", "suffix", "width"]));
1250
1274
  }
1251
- }), Wa = { class: "flex flex-col gap-2" }, Ja = ["onClick"], ho = /* @__PURE__ */ G({
1275
+ }), Cl = { class: "flex flex-col gap-2" }, Sl = ["onClick"], Tr = /* @__PURE__ */ J({
1252
1276
  __name: "MonthYearField",
1253
- props: /* @__PURE__ */ le(/* @__PURE__ */ ce({
1277
+ props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
1254
1278
  label: {},
1255
1279
  labelHidden: { type: Boolean },
1256
1280
  hint: {},
@@ -1264,7 +1288,7 @@ const yo = /* @__PURE__ */ G({
1264
1288
  minYear: {},
1265
1289
  maxYear: {},
1266
1290
  placeholder: {}
1267
- }, { ...me, placeholder: void 0, minYear: 1970, maxYear: () => (/* @__PURE__ */ new Date()).getFullYear() + 1 }), {
1291
+ }, { ...pe, placeholder: void 0, minYear: 1970, maxYear: () => (/* @__PURE__ */ new Date()).getFullYear() + 1 }), {
1268
1292
  month: { default: null },
1269
1293
  monthModifiers: {},
1270
1294
  year: { default: null },
@@ -1272,59 +1296,59 @@ const yo = /* @__PURE__ */ G({
1272
1296
  }),
1273
1297
  emits: ["update:month", "update:year"],
1274
1298
  setup(l) {
1275
- const a = l, e = re(l, "month"), t = re(l, "year"), { t: o } = oe(), n = h(() => e.value !== null && e.value >= 1 && e.value <= 12), u = (x, $) => o(`core.form.months.${$}.${x}`), r = h(() => n.value && t.value !== null ? o("core.form.months.with_year", { month: u(e.value, "long"), year: t.value }) : t.value !== null ? String(t.value) : n.value ? u(e.value, "long") : "");
1276
- function m(x, $) {
1277
- e.value = x.month, t.value = x.year, $();
1299
+ const t = l, e = ke(l, "month"), a = ke(l, "year"), { t: r } = re(), i = q(() => e.value !== null && e.value >= 1 && e.value <= 12), p = (V, $) => r(`core.form.months.${$}.${V}`), u = q(() => i.value && a.value !== null ? r("core.form.months.with_year", { month: p(e.value, "long"), year: a.value }) : a.value !== null ? String(a.value) : i.value ? p(e.value, "long") : "");
1300
+ function b(V, $) {
1301
+ e.value = V.month, a.value = V.year, $();
1278
1302
  }
1279
- function k(x) {
1280
- e.value = null, t.value = null, x();
1303
+ function _(V) {
1304
+ e.value = null, a.value = null, V();
1281
1305
  }
1282
- return (x, $) => (d(), R(ye, J(s(fe)(a), {
1283
- value: r.value || null
1284
- }), Z({
1285
- default: f(({ id: i, describedby: v, invalid: g }) => [
1286
- I(je, {
1287
- label: a.label ?? r.value,
1306
+ return (V, $) => (d(), z(ye, N(s(fe)(t), {
1307
+ value: u.value || null
1308
+ }), ie({
1309
+ default: k(({ id: n, describedby: c, invalid: m }) => [
1310
+ U(Pe, {
1311
+ label: t.label ?? u.value,
1288
1312
  width: "sm",
1289
1313
  placement: "bottom-start",
1290
1314
  arrow: !1
1291
1315
  }, {
1292
- trigger: f(({ toggle: T, presented: w }) => [
1293
- I(tt, J({ id: i, "aria-describedby": v }, {
1294
- expanded: w,
1295
- disabled: a.disabled,
1296
- invalid: g,
1297
- placeholder: a.placeholder ?? s(o)("core.form.select.choose"),
1298
- onClick: T
1316
+ trigger: k(({ toggle: h, presented: v }) => [
1317
+ U(vt, N({ id: n, "aria-describedby": c }, {
1318
+ expanded: v,
1319
+ disabled: t.disabled,
1320
+ invalid: m,
1321
+ placeholder: t.placeholder ?? s(r)("core.form.select.choose"),
1322
+ onClick: h
1299
1323
  }), {
1300
- default: f(() => [
1301
- r.value ? (d(), y(de, { key: 0 }, [
1302
- H(C(r.value), 1),
1303
- I(s(X), {
1324
+ default: k(() => [
1325
+ u.value ? (d(), g(ee, { key: 0 }, [
1326
+ Z(B(u.value), 1),
1327
+ U(s(ue), {
1304
1328
  name: "calendarLine",
1305
1329
  size: 16,
1306
1330
  class: "ml-2 shrink-0 text-content-muted"
1307
1331
  })
1308
- ], 64)) : q("", !0)
1332
+ ], 64)) : j("", !0)
1309
1333
  ]),
1310
1334
  _: 1
1311
1335
  }, 16, ["expanded", "disabled", "invalid", "placeholder", "onClick"])
1312
1336
  ]),
1313
- default: f(({ dismiss: T }) => [
1314
- p("div", Wa, [
1315
- I(Ft, {
1337
+ default: k(({ dismiss: h }) => [
1338
+ x("div", Cl, [
1339
+ U(Xt, {
1316
1340
  month: e.value,
1317
- year: t.value,
1318
- "min-year": a.minYear,
1319
- "max-year": a.maxYear,
1320
- onPick: (w) => m(w, T)
1341
+ year: a.value,
1342
+ "min-year": t.minYear,
1343
+ "max-year": t.maxYear,
1344
+ onPick: (v) => b(v, h)
1321
1345
  }, null, 8, ["month", "year", "min-year", "max-year", "onPick"]),
1322
- n.value || t.value !== null ? (d(), y("button", {
1346
+ i.value || a.value !== null ? (d(), g("button", {
1323
1347
  key: 0,
1324
1348
  type: "button",
1325
1349
  class: "cursor-pointer self-start rounded-control px-1 text-footnote text-content-link",
1326
- onClick: (w) => k(T)
1327
- }, C(s(o)("core.form.select.clear")), 9, Ja)) : q("", !0)
1350
+ onClick: (v) => _(h)
1351
+ }, B(s(r)("core.form.select.clear")), 9, Sl)) : j("", !0)
1328
1352
  ])
1329
1353
  ]),
1330
1354
  _: 2
@@ -1332,32 +1356,32 @@ const yo = /* @__PURE__ */ G({
1332
1356
  ]),
1333
1357
  _: 2
1334
1358
  }, [
1335
- x.$slots.trailing ? {
1359
+ V.$slots.trailing ? {
1336
1360
  name: "trailing",
1337
- fn: f(() => [
1338
- S(x.$slots, "trailing")
1361
+ fn: k(() => [
1362
+ R(V.$slots, "trailing")
1339
1363
  ]),
1340
1364
  key: "0"
1341
1365
  } : void 0,
1342
- x.$slots.labelTrailing ? {
1366
+ V.$slots.labelTrailing ? {
1343
1367
  name: "labelTrailing",
1344
- fn: f(() => [
1345
- S(x.$slots, "labelTrailing")
1368
+ fn: k(() => [
1369
+ R(V.$slots, "labelTrailing")
1346
1370
  ]),
1347
1371
  key: "1"
1348
1372
  } : void 0,
1349
- x.$slots.readonly ? {
1373
+ V.$slots.readonly ? {
1350
1374
  name: "readonly",
1351
- fn: f(() => [
1352
- S(x.$slots, "readonly")
1375
+ fn: k(() => [
1376
+ R(V.$slots, "readonly")
1353
1377
  ]),
1354
1378
  key: "2"
1355
1379
  } : void 0
1356
1380
  ]), 1040, ["value"]));
1357
1381
  }
1358
- }), Za = { class: "flex min-w-0 flex-wrap items-center gap-1.5 py-0.5" }, Xa = { class: "truncate" }, Qa = ["disabled", "aria-label", "onClick"], el = ["id", "disabled", "aria-expanded", "aria-invalid", "aria-describedby", "aria-busy"], tl = ["id", "disabled", "aria-invalid", "aria-describedby", "aria-busy", "onClick"], al = { class: "max-h-72 overflow-y-auto" }, ll = { class: "flex items-center justify-between gap-2" }, Ue = "inline-flex min-h-7 cursor-pointer items-center gap-1 rounded-control bg-fill px-2.5 py-1 text-body text-content-muted hover:bg-fill-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-not-allowed disabled:opacity-45", ko = /* @__PURE__ */ G({
1382
+ }), Fl = { class: "flex min-w-0 flex-wrap items-center gap-1.5 py-0.5" }, ql = { class: "truncate" }, Bl = ["disabled", "aria-label", "onClick"], Ll = ["id", "disabled", "aria-expanded", "aria-invalid", "aria-describedby", "aria-busy"], Tl = ["id", "disabled", "aria-invalid", "aria-describedby", "aria-busy", "onClick"], Dl = { class: "max-h-72 overflow-y-auto" }, zl = { class: "flex items-center justify-between gap-2" }, lt = "inline-flex min-h-7 cursor-pointer items-center gap-1 rounded-control bg-fill px-2.5 py-1 text-body text-content-muted hover:bg-fill-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-not-allowed disabled:opacity-45", jl = /* @__PURE__ */ J({
1359
1383
  __name: "MultiSelectField",
1360
- props: /* @__PURE__ */ le(/* @__PURE__ */ ce({
1384
+ props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
1361
1385
  label: {},
1362
1386
  labelHidden: { type: Boolean },
1363
1387
  hint: {},
@@ -1372,114 +1396,114 @@ const yo = /* @__PURE__ */ G({
1372
1396
  selected: {},
1373
1397
  placeholder: {},
1374
1398
  searchFrom: {}
1375
- }, { ...me, selected: () => [], placeholder: void 0, searchFrom: 9 }), {
1399
+ }, { ...pe, selected: () => [], placeholder: void 0, searchFrom: 9 }), {
1376
1400
  modelValue: { default: () => [] },
1377
1401
  modelModifiers: {}
1378
1402
  }),
1379
1403
  emits: ["update:modelValue"],
1380
1404
  setup(l) {
1381
- const a = l, e = re(l, "modelValue"), { t } = oe(), o = Ie(), n = U("sheet"), u = P(!1), r = Rt(() => a.options, (i) => {
1382
- const v = e.value.filter((g) => i.some((T) => T.value === g));
1383
- v.length !== e.value.length && (e.value = v);
1384
- }), m = h(() => e.value.flatMap((i) => {
1385
- const v = r.known.value.find((g) => g.value === i) ?? a.selected.find((g) => g.value === i);
1386
- return v ? [v] : [];
1387
- })), k = h(() => a.placeholder ?? t("core.form.select.choose"));
1388
- function x(i) {
1389
- i !== null && (e.value = e.value.includes(i) ? e.value.filter((v) => v !== i) : [...e.value, i]);
1405
+ const t = l, e = ke(l, "modelValue"), { t: a } = re(), r = Ne(), i = oe("sheet"), p = H(!1), u = ra(() => t.options, (n) => {
1406
+ const c = e.value.filter((m) => n.some((h) => h.value === m));
1407
+ c.length !== e.value.length && (e.value = c);
1408
+ }), b = q(() => e.value.flatMap((n) => {
1409
+ const c = u.known.value.find((m) => m.value === n) ?? t.selected.find((m) => m.value === n);
1410
+ return c ? [c] : [];
1411
+ })), _ = q(() => t.placeholder ?? a("core.form.select.choose"));
1412
+ function V(n) {
1413
+ n !== null && (e.value = e.value.includes(n) ? e.value.filter((c) => c !== n) : [...e.value, n]);
1390
1414
  }
1391
- const $ = (i) => e.value = e.value.filter((v) => v !== i);
1392
- return (i, v) => (d(), R(ye, J(s(fe)(a), {
1393
- value: m.value.length ? m.value.map((g) => g.label).join(", ") : null,
1415
+ const $ = (n) => e.value = e.value.filter((c) => c !== n);
1416
+ return (n, c) => (d(), z(ye, N(s(fe)(t), {
1417
+ value: b.value.length ? b.value.map((m) => m.label).join(", ") : null,
1394
1418
  "row-layout": "stacked"
1395
- }), Z({
1396
- default: f(({ id: g, describedby: T, invalid: w }) => [
1397
- p("div", Za, [
1398
- (d(!0), y(de, null, $e(m.value, (F) => (d(), y("span", {
1399
- key: String(F.value),
1419
+ }), ie({
1420
+ default: k(({ id: m, describedby: h, invalid: v }) => [
1421
+ x("div", Fl, [
1422
+ (d(!0), g(ee, null, ce(b.value, (y) => (d(), g("span", {
1423
+ key: String(y.value),
1400
1424
  "data-test": "chip",
1401
1425
  class: "inline-flex min-h-7 max-w-full items-center gap-1 rounded-full bg-tint-soft pl-3 pr-1 text-subheadline font-medium text-content-link"
1402
1426
  }, [
1403
- p("span", Xa, C(F.label), 1),
1404
- p("button", {
1427
+ x("span", ql, B(y.label), 1),
1428
+ x("button", {
1405
1429
  type: "button",
1406
- disabled: a.disabled,
1407
- "aria-label": `${s(t)("core.form.select.clear")}: ${F.label}`,
1430
+ disabled: t.disabled,
1431
+ "aria-label": `${s(a)("core.form.select.clear")}: ${y.label}`,
1408
1432
  class: "flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-full hover:bg-fill focus-visible:outline-2 focus-visible:outline-border-focus disabled:cursor-not-allowed",
1409
- onClick: (O) => $(F.value)
1433
+ onClick: (S) => $(y.value)
1410
1434
  }, [
1411
- I(s(X), {
1435
+ U(s(ue), {
1412
1436
  name: "close",
1413
1437
  size: 12
1414
1438
  })
1415
- ], 8, Qa)
1439
+ ], 8, Bl)
1416
1440
  ]))), 128)),
1417
- s(o) ? (d(), y("button", {
1441
+ s(r) ? (d(), g("button", {
1418
1442
  key: 0,
1419
- id: g,
1443
+ id: m,
1420
1444
  type: "button",
1421
- disabled: a.disabled,
1445
+ disabled: t.disabled,
1422
1446
  "aria-haspopup": "dialog",
1423
- "aria-expanded": u.value,
1424
- "aria-invalid": w || void 0,
1425
- "aria-describedby": T,
1426
- "aria-busy": s(r).loading.value || void 0,
1427
- class: j(Ue),
1428
- onClick: v[0] || (v[0] = (F) => n.value?.present())
1447
+ "aria-expanded": p.value,
1448
+ "aria-invalid": v || void 0,
1449
+ "aria-describedby": h,
1450
+ "aria-busy": s(u).loading.value || void 0,
1451
+ class: W(lt),
1452
+ onClick: c[0] || (c[0] = (y) => i.value?.present())
1429
1453
  }, [
1430
- s(r).loading.value ? (d(), R(s(X), {
1454
+ s(u).loading.value ? (d(), z(s(ue), {
1431
1455
  key: 0,
1432
1456
  name: "loader4Line",
1433
1457
  size: 14,
1434
1458
  class: "shrink-0 animate-spin"
1435
- })) : q("", !0),
1436
- H(" " + C(m.value.length ? s(t)("core.actions.edit") : k.value), 1)
1437
- ], 8, el)) : (d(), R(je, {
1459
+ })) : j("", !0),
1460
+ Z(" " + B(b.value.length ? s(a)("core.actions.edit") : _.value), 1)
1461
+ ], 8, Ll)) : (d(), z(Pe, {
1438
1462
  key: 1,
1439
- label: a.label ?? k.value,
1463
+ label: t.label ?? _.value,
1440
1464
  width: "lg",
1441
1465
  "match-trigger-width": "",
1442
1466
  placement: "bottom-start",
1443
1467
  arrow: !1
1444
1468
  }, {
1445
- trigger: f(({ toggle: F, attrs: O }) => [
1446
- p("button", J({
1447
- id: g,
1469
+ trigger: k(({ toggle: y, attrs: S }) => [
1470
+ x("button", N({
1471
+ id: m,
1448
1472
  type: "button"
1449
- }, O, {
1473
+ }, S, {
1450
1474
  "aria-haspopup": "listbox",
1451
- disabled: a.disabled,
1452
- "aria-invalid": w || void 0,
1453
- "aria-describedby": T,
1454
- "aria-busy": s(r).loading.value || void 0,
1455
- class: Ue,
1456
- onClick: F
1475
+ disabled: t.disabled,
1476
+ "aria-invalid": v || void 0,
1477
+ "aria-describedby": h,
1478
+ "aria-busy": s(u).loading.value || void 0,
1479
+ class: lt,
1480
+ onClick: y
1457
1481
  }), [
1458
- s(r).loading.value ? (d(), R(s(X), {
1482
+ s(u).loading.value ? (d(), z(s(ue), {
1459
1483
  key: 0,
1460
1484
  name: "loader4Line",
1461
1485
  size: 14,
1462
1486
  class: "shrink-0 animate-spin"
1463
- })) : q("", !0),
1464
- H(" " + C(m.value.length ? s(t)("core.actions.edit") : k.value), 1)
1465
- ], 16, tl)
1487
+ })) : j("", !0),
1488
+ Z(" " + B(b.value.length ? s(a)("core.actions.edit") : _.value), 1)
1489
+ ], 16, Tl)
1466
1490
  ]),
1467
- default: f(() => [
1468
- p("div", al, [
1469
- I(Ke, {
1470
- options: s(r).rows.value,
1471
- status: s(r).status.value,
1491
+ default: k(() => [
1492
+ x("div", Dl, [
1493
+ U(Xe, {
1494
+ options: s(u).rows.value,
1495
+ status: s(u).status.value,
1472
1496
  "model-value": e.value,
1473
1497
  multiple: "",
1474
- "search-from": a.searchFrom,
1498
+ "search-from": t.searchFrom,
1475
1499
  presentation: "plain",
1476
- onSelect: x,
1477
- onRetry: v[1] || (v[1] = (F) => s(r).reload())
1478
- }, Z({ _: 2 }, [
1479
- i.$slots.option ? {
1500
+ onSelect: V,
1501
+ onRetry: c[1] || (c[1] = (y) => s(u).reload())
1502
+ }, ie({ _: 2 }, [
1503
+ n.$slots.option ? {
1480
1504
  name: "option",
1481
- fn: f((F) => [
1482
- S(i.$slots, "option", ze(Ve(F)))
1505
+ fn: k((y) => [
1506
+ R(n.$slots, "option", Re(Ue(y)))
1483
1507
  ]),
1484
1508
  key: "0"
1485
1509
  } : void 0
@@ -1489,88 +1513,88 @@ const yo = /* @__PURE__ */ G({
1489
1513
  _: 2
1490
1514
  }, 1032, ["label"]))
1491
1515
  ]),
1492
- s(o) ? (d(), R(Dt, {
1516
+ s(r) ? (d(), z(oa, {
1493
1517
  key: 0,
1494
1518
  ref_key: "sheet",
1495
- ref: n,
1496
- title: a.label ?? k.value,
1519
+ ref: i,
1520
+ title: t.label ?? _.value,
1497
1521
  grouped: "",
1498
- onPresented: v[5] || (v[5] = (F) => u.value = !0),
1499
- onDismissed: v[6] || (v[6] = (F) => u.value = !1)
1522
+ onPresented: c[5] || (c[5] = (y) => p.value = !0),
1523
+ onDismissed: c[6] || (c[6] = (y) => p.value = !1)
1500
1524
  }, {
1501
- footer: f(() => [
1502
- p("div", ll, [
1503
- I(be, {
1525
+ footer: k(() => [
1526
+ x("div", zl, [
1527
+ U(ae, {
1504
1528
  prominence: "plain",
1505
1529
  disabled: e.value.length === 0,
1506
- onClick: v[3] || (v[3] = (F) => e.value = [])
1530
+ onClick: c[3] || (c[3] = (y) => e.value = [])
1507
1531
  }, {
1508
- default: f(() => [
1509
- H(C(s(t)("core.form.select.clear")), 1)
1532
+ default: k(() => [
1533
+ Z(B(s(a)("core.form.select.clear")), 1)
1510
1534
  ]),
1511
1535
  _: 1
1512
1536
  }, 8, ["disabled"]),
1513
- I(be, {
1537
+ U(ae, {
1514
1538
  prominence: "primary",
1515
- onClick: v[4] || (v[4] = (F) => n.value?.dismiss())
1539
+ onClick: c[4] || (c[4] = (y) => i.value?.dismiss())
1516
1540
  }, {
1517
- default: f(() => [
1518
- H(C(s(t)("core.form.select.done")), 1)
1541
+ default: k(() => [
1542
+ Z(B(s(a)("core.form.select.done")), 1)
1519
1543
  ]),
1520
1544
  _: 1
1521
1545
  })
1522
1546
  ])
1523
1547
  ]),
1524
- default: f(() => [
1525
- I(Ke, {
1526
- options: s(r).rows.value,
1527
- status: s(r).status.value,
1548
+ default: k(() => [
1549
+ U(Xe, {
1550
+ options: s(u).rows.value,
1551
+ status: s(u).status.value,
1528
1552
  "model-value": e.value,
1529
1553
  multiple: "",
1530
- "search-from": a.searchFrom,
1531
- onSelect: x,
1532
- onRetry: v[2] || (v[2] = (F) => s(r).reload())
1533
- }, Z({ _: 2 }, [
1534
- i.$slots.option ? {
1554
+ "search-from": t.searchFrom,
1555
+ onSelect: V,
1556
+ onRetry: c[2] || (c[2] = (y) => s(u).reload())
1557
+ }, ie({ _: 2 }, [
1558
+ n.$slots.option ? {
1535
1559
  name: "option",
1536
- fn: f((F) => [
1537
- S(i.$slots, "option", ze(Ve(F)))
1560
+ fn: k((y) => [
1561
+ R(n.$slots, "option", Re(Ue(y)))
1538
1562
  ]),
1539
1563
  key: "0"
1540
1564
  } : void 0
1541
1565
  ]), 1032, ["options", "status", "model-value", "search-from"])
1542
1566
  ]),
1543
1567
  _: 3
1544
- }, 8, ["title"])) : q("", !0)
1568
+ }, 8, ["title"])) : j("", !0)
1545
1569
  ]),
1546
1570
  _: 2
1547
1571
  }, [
1548
- i.$slots.trailing ? {
1572
+ n.$slots.trailing ? {
1549
1573
  name: "trailing",
1550
- fn: f(() => [
1551
- S(i.$slots, "trailing")
1574
+ fn: k(() => [
1575
+ R(n.$slots, "trailing")
1552
1576
  ]),
1553
1577
  key: "0"
1554
1578
  } : void 0,
1555
- i.$slots.labelTrailing ? {
1579
+ n.$slots.labelTrailing ? {
1556
1580
  name: "labelTrailing",
1557
- fn: f(() => [
1558
- S(i.$slots, "labelTrailing")
1581
+ fn: k(() => [
1582
+ R(n.$slots, "labelTrailing")
1559
1583
  ]),
1560
1584
  key: "1"
1561
1585
  } : void 0,
1562
- i.$slots.readonly ? {
1586
+ n.$slots.readonly ? {
1563
1587
  name: "readonly",
1564
- fn: f(() => [
1565
- S(i.$slots, "readonly")
1588
+ fn: k(() => [
1589
+ R(n.$slots, "readonly")
1566
1590
  ]),
1567
1591
  key: "2"
1568
1592
  } : void 0
1569
1593
  ]), 1040, ["value"]));
1570
1594
  }
1571
- }), ol = ["aria-label"], nl = ["src"], sl = { class: "flex flex-wrap items-center gap-3" }, rl = ["id", "accept", "disabled", "aria-describedby", "aria-invalid"], il = ["aria-label"], ul = ["src"], xo = /* @__PURE__ */ G({
1595
+ }), Ol = ["aria-label"], Ml = ["src"], Rl = { class: "flex flex-wrap items-center gap-3" }, Ul = ["id", "accept", "disabled", "aria-describedby", "aria-invalid"], El = ["aria-label"], Il = ["src"], Dr = /* @__PURE__ */ J({
1572
1596
  __name: "PhotoField",
1573
- props: /* @__PURE__ */ le(/* @__PURE__ */ ce({
1597
+ props: /* @__PURE__ */ ve(/* @__PURE__ */ me({
1574
1598
  label: {},
1575
1599
  labelHidden: { type: Boolean },
1576
1600
  hint: {},
@@ -1583,181 +1607,181 @@ const yo = /* @__PURE__ */ G({
1583
1607
  name: {},
1584
1608
  accept: {},
1585
1609
  maxSize: {}
1586
- }, { ...me, accept: () => ["image/jpeg", "image/png", "image/webp", "image/gif"], maxSize: 5 * 1024 * 1024 }), {
1610
+ }, { ...pe, accept: () => ["image/jpeg", "image/png", "image/webp", "image/gif"], maxSize: 5 * 1024 * 1024 }), {
1587
1611
  modelValue: { default: null },
1588
1612
  modelModifiers: {}
1589
1613
  }),
1590
1614
  emits: ["update:modelValue"],
1591
1615
  setup(l) {
1592
- const a = l, e = re(l, "modelValue"), { t } = oe(), o = U("chooser"), n = P(null), u = P(null);
1593
- function r() {
1594
- u.value && URL.revokeObjectURL(u.value), u.value = null;
1616
+ const t = l, e = ke(l, "modelValue"), { t: a } = re(), r = oe("chooser"), i = H(null), p = H(null);
1617
+ function u() {
1618
+ p.value && URL.revokeObjectURL(p.value), p.value = null;
1595
1619
  }
1596
- ge(
1620
+ be(
1597
1621
  e,
1598
- (i) => {
1599
- r(), i instanceof File && (u.value = URL.createObjectURL(i)), i === null && o.value && (o.value.value = "");
1622
+ (n) => {
1623
+ u(), n instanceof File && (p.value = URL.createObjectURL(n)), n === null && r.value && (r.value.value = "");
1600
1624
  },
1601
1625
  { immediate: !0 }
1602
- ), Ze(r);
1603
- const m = h(() => e.value instanceof File ? u.value : e.value), k = U("viewer"), x = h(() => m.value ? [{ src: m.value, alt: a.label ?? t("core.viewer.label"), downloadName: e.value instanceof File ? e.value.name : void 0 }] : []);
1604
- function $(i) {
1605
- if (!i) return;
1606
- const v = lt(i, { accept: a.accept, maxSize: a.maxSize });
1607
- v ? n.value = v === "invalid_type" ? t("core.form.file.invalid_type") : t("core.form.file.too_large", { size: Be(a.maxSize) }) : (n.value = null, e.value = i);
1626
+ ), ze(u);
1627
+ const b = q(() => e.value instanceof File ? p.value : e.value), _ = oe("viewer"), V = q(() => b.value ? [{ src: b.value, alt: t.label ?? a("core.viewer.label"), downloadName: e.value instanceof File ? e.value.name : void 0 }] : []);
1628
+ function $(n) {
1629
+ if (!n) return;
1630
+ const c = $t(n, { accept: t.accept, maxSize: t.maxSize });
1631
+ c ? i.value = c === "invalid_type" ? a("core.form.file.invalid_type") : a("core.form.file.too_large", { size: Le(t.maxSize) }) : (i.value = null, e.value = n);
1608
1632
  }
1609
- return (i, v) => (d(), R(ye, J({ ...s(fe)(a), error: n.value ?? a.error }, {
1610
- value: m.value ? s(t)("core.form.file.choose") : null,
1633
+ return (n, c) => (d(), z(ye, N({ ...s(fe)(t), error: i.value ?? t.error }, {
1634
+ value: b.value ? s(a)("core.form.file.choose") : null,
1611
1635
  "row-layout": "stacked"
1612
- }), Z({
1613
- readonly: f(() => [
1614
- m.value ? (d(), y("button", {
1636
+ }), ie({
1637
+ readonly: k(() => [
1638
+ b.value ? (d(), g("button", {
1615
1639
  key: 0,
1616
1640
  type: "button",
1617
- "aria-label": s(t)("core.viewer.open"),
1641
+ "aria-label": s(a)("core.viewer.open"),
1618
1642
  "data-test": "photo-open",
1619
1643
  class: "block cursor-zoom-in rounded-group focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
1620
- onClick: v[0] || (v[0] = (g) => k.value?.present(0))
1644
+ onClick: c[0] || (c[0] = (m) => _.value?.present(0))
1621
1645
  }, [
1622
- p("img", {
1623
- src: m.value,
1646
+ x("img", {
1647
+ src: b.value,
1624
1648
  alt: "",
1625
1649
  class: "size-40 rounded-group object-cover"
1626
- }, null, 8, nl)
1627
- ], 8, ol)) : q("", !0),
1628
- m.value ? (d(), R(Pe, {
1650
+ }, null, 8, Ml)
1651
+ ], 8, Ol)) : j("", !0),
1652
+ b.value ? (d(), z(Qe, {
1629
1653
  key: 1,
1630
1654
  ref_key: "viewer",
1631
- ref: k,
1632
- items: x.value
1633
- }, null, 8, ["items"])) : q("", !0)
1655
+ ref: _,
1656
+ items: V.value
1657
+ }, null, 8, ["items"])) : j("", !0)
1634
1658
  ]),
1635
- default: f(({ id: g, describedby: T, invalid: w }) => [
1636
- p("div", sl, [
1637
- p("input", {
1638
- id: g,
1659
+ default: k(({ id: m, describedby: h, invalid: v }) => [
1660
+ x("div", Rl, [
1661
+ x("input", {
1662
+ id: m,
1639
1663
  ref_key: "chooser",
1640
- ref: o,
1664
+ ref: r,
1641
1665
  type: "file",
1642
1666
  class: "sr-only",
1643
1667
  tabindex: "-1",
1644
- accept: a.accept.join(","),
1645
- disabled: a.disabled,
1646
- "aria-describedby": T,
1647
- "aria-invalid": w || void 0,
1648
- onChange: v[1] || (v[1] = (F) => $(F.target.files?.[0]))
1649
- }, null, 40, rl),
1650
- m.value ? (d(), y("button", {
1668
+ accept: t.accept.join(","),
1669
+ disabled: t.disabled,
1670
+ "aria-describedby": h,
1671
+ "aria-invalid": v || void 0,
1672
+ onChange: c[1] || (c[1] = (y) => $(y.target.files?.[0]))
1673
+ }, null, 40, Ul),
1674
+ b.value ? (d(), g("button", {
1651
1675
  key: 0,
1652
1676
  type: "button",
1653
- "aria-label": s(t)("core.viewer.open"),
1677
+ "aria-label": s(a)("core.viewer.open"),
1654
1678
  "data-test": "photo-open",
1655
1679
  class: "block cursor-zoom-in rounded-group focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
1656
- onClick: v[2] || (v[2] = (F) => k.value?.present(0))
1680
+ onClick: c[2] || (c[2] = (y) => _.value?.present(0))
1657
1681
  }, [
1658
- p("img", {
1659
- src: m.value,
1682
+ x("img", {
1683
+ src: b.value,
1660
1684
  alt: "",
1661
1685
  "data-test": "photo-preview",
1662
1686
  class: "size-28 rounded-group object-cover"
1663
- }, null, 8, ul)
1664
- ], 8, il)) : q("", !0),
1665
- I(be, {
1666
- disabled: a.disabled,
1667
- onClick: v[3] || (v[3] = (F) => o.value?.click())
1687
+ }, null, 8, Il)
1688
+ ], 8, El)) : j("", !0),
1689
+ U(ae, {
1690
+ disabled: t.disabled,
1691
+ onClick: c[3] || (c[3] = (y) => r.value?.click())
1668
1692
  }, {
1669
- default: f(() => [
1670
- H(C(s(t)("core.form.file.choose")), 1)
1693
+ default: k(() => [
1694
+ Z(B(s(a)("core.form.file.choose")), 1)
1671
1695
  ]),
1672
1696
  _: 1
1673
1697
  }, 8, ["disabled"]),
1674
- m.value ? (d(), R(be, {
1698
+ b.value ? (d(), z(ae, {
1675
1699
  key: 1,
1676
1700
  prominence: "plain",
1677
1701
  tone: "critical",
1678
- disabled: a.disabled,
1679
- onClick: v[4] || (v[4] = (F) => {
1680
- e.value = null, n.value = null;
1702
+ disabled: t.disabled,
1703
+ onClick: c[4] || (c[4] = (y) => {
1704
+ e.value = null, i.value = null;
1681
1705
  })
1682
1706
  }, {
1683
- default: f(() => [
1684
- H(C(s(t)("core.form.file.remove")), 1)
1707
+ default: k(() => [
1708
+ Z(B(s(a)("core.form.file.remove")), 1)
1685
1709
  ]),
1686
1710
  _: 1
1687
- }, 8, ["disabled"])) : q("", !0)
1711
+ }, 8, ["disabled"])) : j("", !0)
1688
1712
  ]),
1689
- m.value ? (d(), R(Pe, {
1713
+ b.value ? (d(), z(Qe, {
1690
1714
  key: 0,
1691
1715
  ref_key: "viewer",
1692
- ref: k,
1693
- items: x.value
1694
- }, null, 8, ["items"])) : q("", !0)
1716
+ ref: _,
1717
+ items: V.value
1718
+ }, null, 8, ["items"])) : j("", !0)
1695
1719
  ]),
1696
1720
  _: 2
1697
1721
  }, [
1698
- i.$slots.trailing ? {
1722
+ n.$slots.trailing ? {
1699
1723
  name: "trailing",
1700
- fn: f(() => [
1701
- S(i.$slots, "trailing")
1724
+ fn: k(() => [
1725
+ R(n.$slots, "trailing")
1702
1726
  ]),
1703
1727
  key: "0"
1704
1728
  } : void 0,
1705
- i.$slots.labelTrailing ? {
1729
+ n.$slots.labelTrailing ? {
1706
1730
  name: "labelTrailing",
1707
- fn: f(() => [
1708
- S(i.$slots, "labelTrailing")
1731
+ fn: k(() => [
1732
+ R(n.$slots, "labelTrailing")
1709
1733
  ]),
1710
1734
  key: "1"
1711
1735
  } : void 0
1712
1736
  ]), 1040, ["value"]));
1713
1737
  }
1714
- }), dl = { hidden: "" }, cl = /* @__PURE__ */ G({
1738
+ }), Al = { hidden: "" }, Nl = /* @__PURE__ */ J({
1715
1739
  __name: "EditorChrome",
1716
1740
  props: {
1717
1741
  options: {}
1718
1742
  },
1719
1743
  setup(l) {
1720
- return Et(l.options), (e, t) => (d(), y("span", dl));
1744
+ return ma(l.options), (e, a) => (d(), g("span", Al));
1721
1745
  }
1722
1746
  });
1723
- function fl(l) {
1724
- const a = P(0);
1747
+ function Pl(l) {
1748
+ const t = H(0);
1725
1749
  let e = 0;
1726
- const t = () => {
1750
+ const a = () => {
1727
1751
  e || (e = requestAnimationFrame(() => {
1728
- e = 0, a.value++;
1752
+ e = 0, t.value++;
1729
1753
  }));
1730
- }, o = typeof MutationObserver > "u" ? null : new MutationObserver(t);
1731
- ge(
1754
+ }, r = typeof MutationObserver > "u" ? null : new MutationObserver(a);
1755
+ be(
1732
1756
  () => l.sections.value,
1733
- (r) => {
1734
- o?.disconnect();
1735
- for (const m of r)
1736
- o?.observe(m.element, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["data-field-error", "data-field-required", "data-field-filled"] });
1737
- t();
1757
+ (u) => {
1758
+ r?.disconnect();
1759
+ for (const b of u)
1760
+ r?.observe(b.element, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["data-field-error", "data-field-required", "data-field-filled"] });
1761
+ a();
1738
1762
  },
1739
1763
  { immediate: !0 }
1740
- ), it() && ut(() => {
1741
- o?.disconnect(), e && cancelAnimationFrame(e);
1764
+ ), Lt() && Tt(() => {
1765
+ r?.disconnect(), e && cancelAnimationFrame(e);
1742
1766
  });
1743
- const n = h(() => (a.value, Object.fromEntries(
1744
- l.sections.value.map((r) => [
1745
- r.id,
1767
+ const i = q(() => (t.value, Object.fromEntries(
1768
+ l.sections.value.map((u) => [
1769
+ u.id,
1746
1770
  {
1747
- errors: r.element.querySelectorAll("[data-field-error]").length,
1748
- required: { total: r.element.querySelectorAll("[data-field-required]").length, filled: r.element.querySelectorAll("[data-field-required][data-field-filled]").length }
1771
+ errors: u.element.querySelectorAll("[data-field-error]").length,
1772
+ required: { total: u.element.querySelectorAll("[data-field-required]").length, filled: u.element.querySelectorAll("[data-field-required][data-field-filled]").length }
1749
1773
  }
1750
1774
  ])
1751
- ))), u = h(() => Object.values(n.value).reduce((r, m) => ({ filled: r.filled + m.required.filled, total: r.total + m.required.total }), { filled: 0, total: 0 }));
1752
- return { states: n, totals: u };
1775
+ ))), p = q(() => Object.values(i.value).reduce((u, b) => ({ filled: u.filled + b.required.filled, total: u.total + b.required.total }), { filled: 0, total: 0 }));
1776
+ return { states: i, totals: p };
1753
1777
  }
1754
- const ml = {
1778
+ const Kl = {
1755
1779
  class: "grid min-w-0 grid-cols-1 items-start gap-8 lg:grid-cols-[12.5rem_minmax(0,1fr)]",
1756
1780
  "data-test": "editor-page"
1757
- }, vl = {
1781
+ }, Gl = {
1758
1782
  key: 0,
1759
1783
  class: "sticky top-[calc(var(--app-bar-height)+1.5rem+var(--shell-banner-h,0px))] hidden min-w-0 flex-col gap-4 self-start lg:flex"
1760
- }, wo = /* @__PURE__ */ G({
1784
+ }, zr = /* @__PURE__ */ J({
1761
1785
  __name: "EditorPage",
1762
1786
  props: {
1763
1787
  title: {},
@@ -1769,105 +1793,105 @@ const ml = {
1769
1793
  disabledWhileClean: { type: Boolean, default: !1 }
1770
1794
  },
1771
1795
  emits: ["save", "cancel"],
1772
- setup(l, { emit: a }) {
1773
- const e = l, t = a, { t: o } = oe(), n = Ie(), u = Ot(), { states: r, totals: m } = fl(u), k = U("content"), x = h(
1796
+ setup(l, { emit: t }) {
1797
+ const e = l, a = t, { t: r } = re(), i = Ne(), p = ca(), { states: u, totals: b } = Pl(p), _ = oe("content"), V = q(
1774
1798
  () => e.form ? {
1775
1799
  form: e.form,
1776
- label: () => e.saveLabel ?? o("core.actions.save"),
1800
+ label: () => e.saveLabel ?? r("core.actions.save"),
1777
1801
  allowed: () => e.canSave,
1778
1802
  disabledWhileClean: () => e.disabledWhileClean,
1779
1803
  save: () => {
1780
- e.form?.submitting.value || t("save");
1804
+ e.form?.submitting.value || a("save");
1781
1805
  },
1782
1806
  cancel: () => {
1783
- e.form?.reset(), t("cancel");
1807
+ e.form?.reset(), a("cancel");
1784
1808
  }
1785
1809
  } : null
1786
1810
  );
1787
- ge(
1811
+ be(
1788
1812
  () => e.form?.failure.value,
1789
- async (i) => {
1790
- i?.kind === "invalid" && (await xe(), await qe(k.value ?? document, u));
1813
+ async (n) => {
1814
+ n?.kind === "invalid" && (await we(), await Me(_.value ?? document, p));
1791
1815
  }
1792
1816
  );
1793
- function $(i) {
1794
- const v = u.sections.value.find((g) => g.id === i)?.element;
1795
- v && xe(() => qe(v));
1817
+ function $(n) {
1818
+ const c = p.sections.value.find((m) => m.id === n)?.element;
1819
+ c && we(() => Me(c));
1796
1820
  }
1797
- return (i, v) => (d(), R(Mt, {
1821
+ return (n, c) => (d(), z(ia, {
1798
1822
  title: e.title,
1799
1823
  back: e.back,
1800
1824
  width: "content"
1801
- }, Z({
1802
- default: f(() => [
1803
- x.value ? (d(), R(cl, {
1825
+ }, ie({
1826
+ default: k(() => [
1827
+ V.value ? (d(), z(Nl, {
1804
1828
  key: 0,
1805
- options: x.value
1806
- }, null, 8, ["options"])) : q("", !0),
1807
- p("div", ml, [
1808
- s(n) ? q("", !0) : (d(), y("aside", vl, [
1809
- I(It, {
1829
+ options: V.value
1830
+ }, null, 8, ["options"])) : j("", !0),
1831
+ x("div", Kl, [
1832
+ s(i) ? j("", !0) : (d(), g("aside", Gl, [
1833
+ U(ua, {
1810
1834
  standalone: "",
1811
- states: s(r),
1812
- progress: s(m),
1835
+ states: s(u),
1836
+ progress: s(b),
1813
1837
  onSelect: $
1814
1838
  }, null, 8, ["states", "progress"]),
1815
- S(i.$slots, "aside")
1839
+ R(n.$slots, "aside")
1816
1840
  ])),
1817
- p("div", {
1841
+ x("div", {
1818
1842
  ref_key: "content",
1819
- ref: k,
1843
+ ref: _,
1820
1844
  class: "flex min-w-0 flex-col gap-section-gap"
1821
1845
  }, [
1822
- e.form ? (d(), R(We, {
1846
+ e.form ? (d(), z(it, {
1823
1847
  key: 0,
1824
1848
  form: e.form,
1825
1849
  label: e.fieldLabel,
1826
- scope: k.value
1827
- }, null, 8, ["form", "label", "scope"])) : q("", !0),
1828
- S(i.$slots, "default")
1850
+ scope: _.value
1851
+ }, null, 8, ["form", "label", "scope"])) : j("", !0),
1852
+ R(n.$slots, "default")
1829
1853
  ], 512)
1830
1854
  ]),
1831
- s(n) ? (d(), R(jt, {
1855
+ s(i) ? (d(), z(da, {
1832
1856
  key: 1,
1833
- states: s(r)
1834
- }, null, 8, ["states"])) : q("", !0)
1857
+ states: s(u)
1858
+ }, null, 8, ["states"])) : j("", !0)
1835
1859
  ]),
1836
1860
  _: 2
1837
1861
  }, [
1838
- i.$slots.header ? {
1862
+ n.$slots.header ? {
1839
1863
  name: "header",
1840
- fn: f(() => [
1841
- S(i.$slots, "header")
1864
+ fn: k(() => [
1865
+ R(n.$slots, "header")
1842
1866
  ]),
1843
1867
  key: "0"
1844
1868
  } : void 0,
1845
- i.$slots.pager ? {
1869
+ n.$slots.pager ? {
1846
1870
  name: "pager",
1847
- fn: f(() => [
1848
- S(i.$slots, "pager")
1871
+ fn: k(() => [
1872
+ R(n.$slots, "pager")
1849
1873
  ]),
1850
1874
  key: "1"
1851
1875
  } : void 0,
1852
- i.$slots.notices ? {
1876
+ n.$slots.notices ? {
1853
1877
  name: "notices",
1854
- fn: f(() => [
1855
- S(i.$slots, "notices")
1878
+ fn: k(() => [
1879
+ R(n.$slots, "notices")
1856
1880
  ]),
1857
1881
  key: "2"
1858
1882
  } : void 0,
1859
- i.$slots.bottom ? {
1883
+ n.$slots.bottom ? {
1860
1884
  name: "bottom",
1861
- fn: f(() => [
1862
- S(i.$slots, "bottom")
1885
+ fn: k(() => [
1886
+ R(n.$slots, "bottom")
1863
1887
  ]),
1864
1888
  key: "3"
1865
1889
  } : void 0
1866
1890
  ]), 1032, ["title", "back"]));
1867
1891
  }
1868
- }), pl = ["value", "aria-label", "disabled", "aria-invalid", "placeholder"], $o = /* @__PURE__ */ G({
1892
+ }), Hl = ["value", "aria-label", "disabled", "aria-invalid", "placeholder"], jr = /* @__PURE__ */ J({
1869
1893
  __name: "NumberCell",
1870
- props: /* @__PURE__ */ le({
1894
+ props: /* @__PURE__ */ ve({
1871
1895
  label: {},
1872
1896
  min: { default: 0 },
1873
1897
  max: { default: 9999 },
@@ -1881,346 +1905,346 @@ const ml = {
1881
1905
  }),
1882
1906
  emits: ["update:modelValue"],
1883
1907
  setup(l) {
1884
- const a = l, e = re(l, "modelValue");
1885
- function t(n) {
1886
- const u = n.target.value.replace(/\D/g, "");
1887
- e.value = u === "" ? null : Math.min(a.max, Math.max(a.min, Number(u)));
1908
+ const t = l, e = ke(l, "modelValue");
1909
+ function a(i) {
1910
+ const p = i.target.value.replace(/\D/g, "");
1911
+ e.value = p === "" ? null : Math.min(t.max, Math.max(t.min, Number(p)));
1888
1912
  }
1889
- const o = (n) => n.target.value = e.value === null ? "" : String(e.value);
1890
- return (n, u) => (d(), y("input", {
1913
+ const r = (i) => i.target.value = e.value === null ? "" : String(e.value);
1914
+ return (i, p) => (d(), g("input", {
1891
1915
  value: e.value ?? "",
1892
1916
  type: "text",
1893
1917
  inputmode: "numeric",
1894
1918
  autocomplete: "off",
1895
- "aria-label": a.label,
1896
- disabled: a.disabled,
1897
- "aria-invalid": a.invalid || void 0,
1898
- placeholder: a.placeholder,
1899
- class: j(["rounded-control bg-fill px-2 py-1 text-right text-body tabular-nums text-content-strong transition-[background-color,box-shadow] duration-motion-fast ease-motion-standard placeholder:text-content-disabled focus:bg-surface-cell focus:outline-none focus:ring-[1.5px] focus:ring-inset focus:ring-border-focus disabled:opacity-45", [a.wide ? "w-28" : "w-16", a.invalid ? "bg-status-danger-surface ring-[1.5px] ring-inset ring-border-destructive" : ""]]),
1900
- onInput: t,
1901
- onBlur: o
1902
- }, null, 42, pl));
1919
+ "aria-label": t.label,
1920
+ disabled: t.disabled,
1921
+ "aria-invalid": t.invalid || void 0,
1922
+ placeholder: t.placeholder,
1923
+ class: W(["rounded-control bg-fill px-2 py-1 text-right text-body tabular-nums text-content-strong transition-[background-color,box-shadow] duration-motion-fast ease-motion-standard placeholder:text-content-disabled focus:bg-surface-cell focus:outline-none focus:ring-[1.5px] focus:ring-inset focus:ring-border-focus disabled:opacity-45", [t.wide ? "w-28" : "w-16", t.invalid ? "bg-status-danger-surface ring-[1.5px] ring-inset ring-border-destructive" : ""]]),
1924
+ onInput: a,
1925
+ onBlur: r
1926
+ }, null, 42, Hl));
1903
1927
  }
1904
- }), Oe = "vue-core:step-draft:";
1905
- function Ee(l) {
1928
+ }), Ge = "vue-core:step-draft:";
1929
+ function He(l) {
1906
1930
  try {
1907
1931
  return (l.storage === "local" ? window.localStorage : window.sessionStorage) ?? null;
1908
1932
  } catch {
1909
1933
  return null;
1910
1934
  }
1911
1935
  }
1912
- function bl(l) {
1936
+ function Wl(l) {
1913
1937
  try {
1914
- const a = Ee(l)?.getItem(Oe + l.key);
1915
- if (!a) return null;
1916
- const e = JSON.parse(a);
1938
+ const t = He(l)?.getItem(Ge + l.key);
1939
+ if (!t) return null;
1940
+ const e = JSON.parse(t);
1917
1941
  return !e || e.version !== (l.version ?? 1) || typeof e.values != "object" || e.values === null || typeof e.step != "string" || !Array.isArray(e.passed) ? null : e;
1918
1942
  } catch {
1919
1943
  return null;
1920
1944
  }
1921
1945
  }
1922
- function gl(l, a) {
1946
+ function Yl(l, t) {
1923
1947
  try {
1924
- const e = Ee(l);
1948
+ const e = He(l);
1925
1949
  if (!e) return !1;
1926
- const t = (o, n) => typeof Blob < "u" && n instanceof Blob ? null : n;
1927
- return e.setItem(Oe + l.key, JSON.stringify({ version: l.version ?? 1, ...a }, t)), !0;
1950
+ const a = (r, i) => typeof Blob < "u" && i instanceof Blob ? null : i;
1951
+ return e.setItem(Ge + l.key, JSON.stringify({ version: l.version ?? 1, ...t }, a)), !0;
1928
1952
  } catch {
1929
1953
  return !1;
1930
1954
  }
1931
1955
  }
1932
- function Ye(l) {
1956
+ function ot(l) {
1933
1957
  try {
1934
- Ee(l)?.removeItem(Oe + l.key);
1958
+ He(l)?.removeItem(Ge + l.key);
1935
1959
  } catch {
1936
1960
  }
1937
1961
  }
1938
- function yl(l, a) {
1939
- for (const [e, t] of Object.entries(l)) {
1940
- if (!(e in a)) continue;
1941
- const o = a[e];
1942
- (o === null || t === null || t === void 0 || typeof o == typeof t && Array.isArray(o) === Array.isArray(t)) && (l[e] = o);
1962
+ function Jl(l, t) {
1963
+ for (const [e, a] of Object.entries(l)) {
1964
+ if (!(e in t)) continue;
1965
+ const r = t[e];
1966
+ (r === null || a === null || a === void 0 || typeof r == typeof a && Array.isArray(r) === Array.isArray(a)) && (l[e] = r);
1943
1967
  }
1944
1968
  }
1945
- function _o(l, a) {
1946
- const { t: e } = oe(), t = h(() => dt(a.steps));
1947
- if (t.value.length === 0) throw new Error("useStepForm: a flow needs at least one step.");
1948
- const o = P(t.value[0].name), n = Ae(/* @__PURE__ */ new Set()), u = Ae(/* @__PURE__ */ new Set([t.value[0].name])), r = P(null), m = P(!1), k = P(0), x = P(!1), $ = P(!1);
1949
- let i = !1, v = 0;
1950
- const g = h(() => Math.max(0, t.value.findIndex((c) => c.name === o.value))), T = (c) => c.fields?.filter((B) => l.errors.has(B)).length ?? 0, w = h(
1951
- () => t.value.map((c, B) => {
1952
- const M = T(c), b = B === g.value;
1969
+ function Or(l, t) {
1970
+ const { t: e } = re(), a = q(() => Dt(t.steps));
1971
+ if (a.value.length === 0) throw new Error("useStepForm: a flow needs at least one step.");
1972
+ const r = H(a.value[0].name), i = Ye(/* @__PURE__ */ new Set()), p = Ye(/* @__PURE__ */ new Set([a.value[0].name])), u = H(null), b = H(!1), _ = H(0), V = H(!1), $ = H(!1);
1973
+ let n = !1, c = 0;
1974
+ const m = q(() => Math.max(0, a.value.findIndex((f) => f.name === r.value))), h = (f) => f.fields?.filter((E) => l.errors.has(E)).length ?? 0, v = q(
1975
+ () => a.value.map((f, E) => {
1976
+ const G = h(f), F = E === m.value;
1953
1977
  return {
1954
- name: c.name,
1955
- label: c.label,
1956
- position: B + 1,
1957
- state: b ? "current" : n.has(c.name) && M === 0 ? "done" : "todo",
1958
- errors: M,
1959
- reachable: !b && (u.has(c.name) || B < g.value)
1978
+ name: f.name,
1979
+ label: f.label,
1980
+ position: E + 1,
1981
+ state: F ? "current" : i.has(f.name) && G === 0 ? "done" : "todo",
1982
+ errors: G,
1983
+ reachable: !F && (p.has(f.name) || E < m.value)
1960
1984
  };
1961
1985
  })
1962
- ), F = h(() => w.value[g.value]), O = h(() => w.value.length), E = h(() => g.value === 0), N = h(() => g.value === O.value - 1), V = h(() => m.value || l.submitting.value);
1963
- function Q(c) {
1964
- const B = t.value[c];
1965
- B && (r.value = c > g.value ? "forward" : "back", o.value = B.name, u.add(B.name), v = c, x.value = !1);
1986
+ ), y = q(() => v.value[m.value]), S = q(() => v.value.length), L = q(() => m.value === 0), T = q(() => m.value === S.value - 1), C = q(() => b.value || l.submitting.value);
1987
+ function P(f) {
1988
+ const E = a.value[f];
1989
+ E && (u.value = f > m.value ? "forward" : "back", r.value = E.name, p.add(E.name), c = f, V.value = !1);
1966
1990
  }
1967
- ge(
1968
- () => t.value.map((c) => c.name).join("\0"),
1991
+ be(
1992
+ () => a.value.map((f) => f.name).join("\0"),
1969
1993
  () => {
1970
- const c = t.value, B = c.findIndex((b) => b.name === o.value), M = B === -1 ? Math.min(v, c.length - 1) : B;
1971
- o.value = c[M].name, v = M, c.forEach((b, D) => {
1972
- D > M && (n.delete(b.name), u.delete(b.name));
1973
- }), u.add(o.value);
1974
- for (const b of [n, u]) for (const D of [...b]) c.some((L) => L.name === D) || b.delete(D);
1994
+ const f = a.value, E = f.findIndex((F) => F.name === r.value), G = E === -1 ? Math.min(c, f.length - 1) : E;
1995
+ r.value = f[G].name, c = G, f.forEach((F, K) => {
1996
+ K > G && (i.delete(F.name), p.delete(F.name));
1997
+ }), p.add(r.value);
1998
+ for (const F of [i, p]) for (const K of [...F]) f.some((I) => I.name === K) || F.delete(K);
1975
1999
  }
1976
2000
  );
1977
- function ee(c) {
1978
- const B = c.fields;
1979
- if (!B?.length) return !0;
1980
- const M = Object.entries(l.errors.all()).filter(([D]) => !B.includes(st(D))), b = l.check(c.fields);
1981
- return M.length > 0 && l.errors.set({ ...Object.fromEntries(M), ...l.errors.all() }), b;
2001
+ function Y(f) {
2002
+ const E = f.fields;
2003
+ if (!E?.length) return !0;
2004
+ const G = Object.entries(l.errors.all()).filter(([K]) => !E.includes(qt(K))), F = l.check(f.fields);
2005
+ return G.length > 0 && l.errors.set({ ...Object.fromEntries(G), ...l.errors.all() }), F;
1982
2006
  }
1983
- async function ne(c) {
1984
- if (!ee(c))
1985
- return k.value++, !1;
1986
- if (!c.beforeNext) return !0;
1987
- m.value = !0;
2007
+ async function M(f) {
2008
+ if (!Y(f))
2009
+ return _.value++, !1;
2010
+ if (!f.beforeNext) return !0;
2011
+ b.value = !0;
1988
2012
  try {
1989
- if (await c.beforeNext()) return !0;
2013
+ if (await f.beforeNext()) return !0;
1990
2014
  } finally {
1991
- m.value = !1;
2015
+ b.value = !1;
1992
2016
  }
1993
- return k.value++, !1;
2017
+ return _.value++, !1;
1994
2018
  }
1995
- async function ie() {
1996
- const c = await l.submit(a.submit, a.submitOptions);
1997
- if (c.status === "saved" || c.status === "saved-refresh-failed")
1998
- return i = !0, Y(), a.onSaved?.(c.value), !0;
1999
- if (c.status === "failed" && (k.value++, F.value.errors === 0)) {
2000
- const B = w.value.findIndex((M) => M.errors > 0);
2001
- B !== -1 && Q(B);
2019
+ async function O() {
2020
+ const f = await l.submit(t.submit, t.submitOptions);
2021
+ if (f.status === "saved" || f.status === "saved-refresh-failed")
2022
+ return n = !0, le(), t.onSaved?.(f.value), !0;
2023
+ if (f.status === "failed" && (_.value++, y.value.errors === 0)) {
2024
+ const E = v.value.findIndex((G) => G.errors > 0);
2025
+ E !== -1 && P(E);
2002
2026
  }
2003
2027
  return !1;
2004
2028
  }
2005
- async function ue() {
2006
- if (V.value) return !1;
2007
- const c = t.value[g.value];
2008
- return await ne(c) ? (n.add(c.name), g.value < O.value - 1 ? (Q(g.value + 1), !0) : ie()) : !1;
2029
+ async function X() {
2030
+ if (C.value) return !1;
2031
+ const f = a.value[m.value];
2032
+ return await M(f) ? (i.add(f.name), m.value < S.value - 1 ? (P(m.value + 1), !0) : O()) : !1;
2009
2033
  }
2010
- async function z(c) {
2011
- if (V.value) return !1;
2012
- const B = t.value.findIndex((M) => M.name === c);
2013
- if (B === -1) return !1;
2014
- if (B <= g.value)
2015
- return B < g.value && Q(B), !0;
2016
- if (!u.has(c)) return !1;
2017
- for (; g.value < B; ) if (!await ue()) return !1;
2018
- return g.value === B;
2034
+ async function D(f) {
2035
+ if (C.value) return !1;
2036
+ const E = a.value.findIndex((G) => G.name === f);
2037
+ if (E === -1) return !1;
2038
+ if (E <= m.value)
2039
+ return E < m.value && P(E), !0;
2040
+ if (!p.has(f)) return !1;
2041
+ for (; m.value < E; ) if (!await X()) return !1;
2042
+ return m.value === E;
2019
2043
  }
2020
- const A = a.draft;
2021
- let K;
2022
- function te() {
2023
- if (K = void 0, !(!A || i)) {
2044
+ const Q = t.draft;
2045
+ let te;
2046
+ function ne() {
2047
+ if (te = void 0, !(!Q || n)) {
2024
2048
  if (!l.dirty.value) {
2025
- Ye(A), $.value = !1;
2049
+ ot(Q), $.value = !1;
2026
2050
  return;
2027
2051
  }
2028
- $.value = gl(A, { values: nt(l.values), step: o.value, passed: [...n] });
2052
+ $.value = Yl(Q, { values: Ft(l.values), step: r.value, passed: [...i] });
2029
2053
  }
2030
2054
  }
2031
- function Y() {
2032
- i = !0, clearTimeout(K), K = void 0, $.value = !1, A && Ye(A);
2055
+ function le() {
2056
+ n = !0, clearTimeout(te), te = void 0, $.value = !1, Q && ot(Q);
2033
2057
  }
2034
- if (A) {
2035
- const c = bl(A);
2036
- if (c) {
2037
- yl(l.values, c.values);
2038
- const B = t.value.map((M) => M.name);
2039
- B.includes(c.step) && (o.value = c.step);
2040
- for (const M of c.passed) B.includes(M) && n.add(M);
2041
- for (const M of [...n, o.value]) u.add(M);
2042
- v = g.value, x.value = l.dirty.value, $.value = x.value;
2058
+ if (Q) {
2059
+ const f = Wl(Q);
2060
+ if (f) {
2061
+ Jl(l.values, f.values);
2062
+ const E = a.value.map((G) => G.name);
2063
+ E.includes(f.step) && (r.value = f.step);
2064
+ for (const G of f.passed) E.includes(G) && i.add(G);
2065
+ for (const G of [...i, r.value]) p.add(G);
2066
+ c = m.value, V.value = l.dirty.value, $.value = V.value;
2043
2067
  }
2044
- ge(
2045
- [() => l.values, o, () => [...n].join("\0")],
2068
+ be(
2069
+ [() => l.values, r, () => [...i].join("\0")],
2046
2070
  () => {
2047
- i || (clearTimeout(K), K = setTimeout(te, 400));
2071
+ n || (clearTimeout(te), te = setTimeout(ne, 400));
2048
2072
  },
2049
2073
  { deep: !0 }
2050
- ), Ze(() => {
2051
- K !== void 0 && (clearTimeout(K), te());
2074
+ ), ze(() => {
2075
+ te !== void 0 && (clearTimeout(te), ne());
2052
2076
  });
2053
2077
  }
2054
- const { confirmDiscard: se } = Xe(() => !i && l.dirty.value);
2055
- Je(Nt, null) && At(() => (i || Y(), !0));
2056
- async function he() {
2057
- const c = await se();
2058
- return c && Y(), c;
2078
+ const { confirmDiscard: de } = ft(() => !n && l.dirty.value);
2079
+ De(fa, null) && pa(() => (n || le(), !0));
2080
+ async function _e() {
2081
+ const f = await de();
2082
+ return f && le(), f;
2059
2083
  }
2060
- function we() {
2061
- l.reset(), n.clear(), u.clear(), r.value = null, o.value = t.value[0].name, u.add(o.value), v = 0, x.value = !1, Y(), i = !1;
2084
+ function ge() {
2085
+ l.reset(), i.clear(), p.clear(), u.value = null, r.value = a.value[0].name, p.add(r.value), c = 0, V.value = !1, le(), n = !1;
2062
2086
  }
2063
- const ke = h(() => {
2064
- const c = [e("core.steps.position", { current: g.value + 1, total: O.value }), F.value.label];
2065
- return $.value && c.push(e("core.steps.draft_saved")), c.join(" · ");
2066
- }), ae = h(() => {
2067
- const c = t.value[g.value];
2068
- return c.nextLabel ? c.nextLabel : N.value ? a.submitLabel ?? e("core.actions.save") : e("core.steps.next_named", { step: t.value[g.value + 1].label });
2069
- }), _ = h(() => E.value ? null : t.value[g.value - 1].label);
2087
+ const w = q(() => {
2088
+ const f = [e("core.steps.position", { current: m.value + 1, total: S.value }), y.value.label];
2089
+ return $.value && f.push(e("core.steps.draft_saved")), f.join(" · ");
2090
+ }), A = q(() => {
2091
+ const f = a.value[m.value];
2092
+ return f.nextLabel ? f.nextLabel : T.value ? t.submitLabel ?? e("core.actions.save") : e("core.steps.next_named", { step: a.value[m.value + 1].label });
2093
+ }), o = q(() => L.value ? null : a.value[m.value - 1].label);
2070
2094
  return {
2071
- steps: w,
2072
- current: F,
2073
- index: g,
2074
- count: O,
2075
- isFirst: E,
2076
- isLast: N,
2077
- busy: V,
2078
- direction: r,
2079
- subtitle: ke,
2080
- nextLabel: ae,
2081
- backLabel: _,
2082
- restored: x,
2083
- refusals: k,
2095
+ steps: v,
2096
+ current: y,
2097
+ index: m,
2098
+ count: S,
2099
+ isFirst: L,
2100
+ isLast: T,
2101
+ busy: C,
2102
+ direction: u,
2103
+ subtitle: w,
2104
+ nextLabel: A,
2105
+ backLabel: o,
2106
+ restored: V,
2107
+ refusals: _,
2084
2108
  errors: l.errors,
2085
2109
  failure: l.failure,
2086
- next: ue,
2087
- back: () => Q(g.value - 1),
2088
- goTo: z,
2089
- restart: we,
2090
- confirmDiscard: he,
2091
- bindDialog: () => ({ subtitle: ke.value, primaryLabel: ae.value, status: V.value ? "processing" : "idle", beforeDismiss: he })
2110
+ next: X,
2111
+ back: () => P(m.value - 1),
2112
+ goTo: D,
2113
+ restart: ge,
2114
+ confirmDiscard: _e,
2115
+ bindDialog: () => ({ subtitle: w.value, primaryLabel: A.value, status: C.value ? "processing" : "idle", beforeDismiss: _e })
2092
2116
  };
2093
2117
  }
2094
- const hl = {
2118
+ const Zl = {
2095
2119
  class: "flex flex-wrap items-center gap-2.5 border-t border-border-separator pt-3.5",
2096
2120
  "data-test": "step-navigation"
2097
- }, kl = /* @__PURE__ */ G({
2121
+ }, Xl = /* @__PURE__ */ J({
2098
2122
  __name: "StepNavigation",
2099
2123
  props: {
2100
2124
  flow: {}
2101
2125
  },
2102
2126
  emits: ["cancel"],
2103
2127
  setup(l) {
2104
- const a = l, { t: e } = oe();
2105
- return (t, o) => (d(), y("div", hl, [
2106
- a.flow.backLabel.value ? (d(), R(be, {
2128
+ const t = l, { t: e } = re();
2129
+ return (a, r) => (d(), g("div", Zl, [
2130
+ t.flow.backLabel.value ? (d(), z(ae, {
2107
2131
  key: 0,
2108
2132
  prominence: "plain",
2109
2133
  icon: "arrowLeftSLine",
2110
- disabled: a.flow.busy.value,
2134
+ disabled: t.flow.busy.value,
2111
2135
  "data-test": "step-back",
2112
- onClick: o[0] || (o[0] = (n) => a.flow.back())
2136
+ onClick: r[0] || (r[0] = (i) => t.flow.back())
2113
2137
  }, {
2114
- default: f(() => [
2115
- H(C(a.flow.backLabel.value), 1)
2138
+ default: k(() => [
2139
+ Z(B(t.flow.backLabel.value), 1)
2116
2140
  ]),
2117
2141
  _: 1
2118
- }, 8, ["disabled"])) : q("", !0),
2119
- o[3] || (o[3] = p("div", { class: "grow" }, null, -1)),
2120
- I(be, {
2142
+ }, 8, ["disabled"])) : j("", !0),
2143
+ r[3] || (r[3] = x("div", { class: "grow" }, null, -1)),
2144
+ U(ae, {
2121
2145
  prominence: "plain",
2122
2146
  "data-test": "step-cancel",
2123
- onClick: o[1] || (o[1] = (n) => t.$emit("cancel"))
2147
+ onClick: r[1] || (r[1] = (i) => a.$emit("cancel"))
2124
2148
  }, {
2125
- default: f(() => [
2126
- H(C(s(e)("core.actions.cancel")), 1)
2149
+ default: k(() => [
2150
+ Z(B(s(e)("core.actions.cancel")), 1)
2127
2151
  ]),
2128
2152
  _: 1
2129
2153
  }),
2130
- I(be, {
2154
+ U(ae, {
2131
2155
  prominence: "primary",
2132
- processing: a.flow.busy.value,
2156
+ processing: t.flow.busy.value,
2133
2157
  "data-test": "step-next",
2134
- onClick: o[2] || (o[2] = (n) => a.flow.next())
2158
+ onClick: r[2] || (r[2] = (i) => t.flow.next())
2135
2159
  }, {
2136
- default: f(() => [
2137
- H(C(a.flow.nextLabel.value), 1)
2160
+ default: k(() => [
2161
+ Z(B(t.flow.nextLabel.value), 1)
2138
2162
  ]),
2139
2163
  _: 1
2140
2164
  }, 8, ["processing"])
2141
2165
  ]));
2142
2166
  }
2143
- }), xl = ["aria-label"], wl = ["aria-current"], $l = ["aria-label"], _l = {
2167
+ }), Ql = ["aria-label"], eo = ["aria-current"], to = ["aria-label"], ao = {
2144
2168
  key: 2,
2145
2169
  class: "sr-only"
2146
- }, Cl = {
2170
+ }, lo = {
2147
2171
  key: 1,
2148
2172
  "data-test": "step-dots",
2149
2173
  class: "flex justify-center gap-1.5",
2150
2174
  "aria-hidden": "true"
2151
- }, Sl = ["data-state"], Fl = /* @__PURE__ */ G({
2175
+ }, oo = ["data-state"], ro = /* @__PURE__ */ J({
2152
2176
  __name: "StepProgress",
2153
2177
  props: {
2154
2178
  flow: {},
2155
2179
  progress: { default: "bar" }
2156
2180
  },
2157
2181
  setup(l) {
2158
- const a = l, { t: e } = oe();
2159
- return (t, o) => a.progress === "bar" ? (d(), y("ol", {
2182
+ const t = l, { t: e } = re();
2183
+ return (a, r) => t.progress === "bar" ? (d(), g("ol", {
2160
2184
  key: 0,
2161
2185
  "aria-label": s(e)("core.steps.label"),
2162
2186
  "data-test": "step-bar",
2163
2187
  class: "grid min-w-0 gap-2",
2164
- style: ct({ gridTemplateColumns: `repeat(${a.flow.count.value}, minmax(0, 1fr))` })
2188
+ style: zt({ gridTemplateColumns: `repeat(${t.flow.count.value}, minmax(0, 1fr))` })
2165
2189
  }, [
2166
- (d(!0), y(de, null, $e(a.flow.steps.value, (n) => (d(), y("li", {
2167
- key: n.name,
2190
+ (d(!0), g(ee, null, ce(t.flow.steps.value, (i) => (d(), g("li", {
2191
+ key: i.name,
2168
2192
  class: "flex min-w-0",
2169
- "aria-current": n.state === "current" ? "step" : void 0
2193
+ "aria-current": i.state === "current" ? "step" : void 0
2170
2194
  }, [
2171
- (d(), R(ft(n.reachable ? "button" : "div"), {
2172
- type: n.reachable ? "button" : void 0,
2173
- disabled: n.reachable ? a.flow.busy.value : void 0,
2174
- "data-test": `step-${n.name}`,
2175
- "data-state": n.errors > 0 ? "error" : n.state,
2176
- class: j(["group flex min-w-0 flex-1 flex-col gap-1.5 text-left", n.reachable ? "cursor-pointer rounded-control focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-default" : ""]),
2177
- onClick: (u) => n.reachable ? a.flow.goTo(n.name) : void 0
2195
+ (d(), z(jt(i.reachable ? "button" : "div"), {
2196
+ type: i.reachable ? "button" : void 0,
2197
+ disabled: i.reachable ? t.flow.busy.value : void 0,
2198
+ "data-test": `step-${i.name}`,
2199
+ "data-state": i.errors > 0 ? "error" : i.state,
2200
+ class: W(["group flex min-w-0 flex-1 flex-col gap-1.5 text-left", i.reachable ? "cursor-pointer rounded-control focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-default" : ""]),
2201
+ onClick: (p) => i.reachable ? t.flow.goTo(i.name) : void 0
2178
2202
  }, {
2179
- default: f(() => [
2180
- p("span", {
2181
- class: j(["h-1 rounded-full transition-colors duration-motion-normal", n.errors > 0 ? "bg-status-danger-solid" : n.state === "current" ? "bg-tint" : n.state === "done" ? "bg-control-on" : "bg-fill-strong"]),
2203
+ default: k(() => [
2204
+ x("span", {
2205
+ class: W(["h-1 rounded-full transition-colors duration-motion-normal", i.errors > 0 ? "bg-status-danger-solid" : i.state === "current" ? "bg-tint" : i.state === "done" ? "bg-control-on" : "bg-fill-strong"]),
2182
2206
  "aria-hidden": "true"
2183
2207
  }, null, 2),
2184
- p("span", {
2185
- class: j(["flex min-w-0 items-center gap-1.5 text-footnote", n.state === "current" ? "font-bold text-content-strong" : n.state === "done" ? "font-medium text-content-link" : "font-medium text-content-muted"])
2208
+ x("span", {
2209
+ class: W(["flex min-w-0 items-center gap-1.5 text-footnote", i.state === "current" ? "font-bold text-content-strong" : i.state === "done" ? "font-medium text-content-link" : "font-medium text-content-muted"])
2186
2210
  }, [
2187
- n.state === "done" ? (d(), R(s(X), {
2211
+ i.state === "done" ? (d(), z(s(ue), {
2188
2212
  key: 0,
2189
2213
  name: "checkCustom",
2190
2214
  size: 12,
2191
2215
  class: "shrink-0"
2192
- })) : q("", !0),
2193
- p("span", {
2194
- class: j(["truncate", n.reachable ? "group-hover:text-content-link" : ""])
2195
- }, C(n.position) + ". " + C(n.label), 3),
2196
- n.errors > 0 ? (d(), y("span", {
2216
+ })) : j("", !0),
2217
+ x("span", {
2218
+ class: W(["truncate", i.reachable ? "group-hover:text-content-link" : ""])
2219
+ }, B(i.position) + ". " + B(i.label), 3),
2220
+ i.errors > 0 ? (d(), g("span", {
2197
2221
  key: 1,
2198
2222
  "data-test": "step-errors",
2199
- "aria-label": s(e)("core.form.sections.errors", { count: n.errors }),
2223
+ "aria-label": s(e)("core.form.sections.errors", { count: i.errors }),
2200
2224
  class: "min-w-4.5 shrink-0 rounded-full bg-status-danger-solid px-1.5 text-center text-caption font-semibold text-white"
2201
- }, C(n.errors), 9, $l)) : q("", !0),
2202
- n.state === "done" ? (d(), y("span", _l, C(s(e)("core.steps.done")), 1)) : q("", !0)
2225
+ }, B(i.errors), 9, to)) : j("", !0),
2226
+ i.state === "done" ? (d(), g("span", ao, B(s(e)("core.steps.done")), 1)) : j("", !0)
2203
2227
  ], 2)
2204
2228
  ]),
2205
2229
  _: 2
2206
2230
  }, 1032, ["type", "disabled", "data-test", "data-state", "class", "onClick"]))
2207
- ], 8, wl))), 128))
2208
- ], 12, xl)) : (d(), y("div", Cl, [
2209
- (d(!0), y(de, null, $e(a.flow.steps.value, (n) => (d(), y("span", {
2210
- key: n.name,
2211
- class: j(["h-1.5 rounded-full transition-all duration-motion-fast", [n.state === "current" ? "w-4.5" : "w-1.5", n.errors > 0 ? "bg-status-danger-solid" : n.state === "todo" && n.position > a.flow.index.value ? "bg-fill-strong" : "bg-tint"]]),
2212
- "data-state": n.errors > 0 ? "error" : n.state
2213
- }, null, 10, Sl))), 128))
2231
+ ], 8, eo))), 128))
2232
+ ], 12, Ql)) : (d(), g("div", lo, [
2233
+ (d(!0), g(ee, null, ce(t.flow.steps.value, (i) => (d(), g("span", {
2234
+ key: i.name,
2235
+ class: W(["h-1.5 rounded-full transition-all duration-motion-fast", [i.state === "current" ? "w-4.5" : "w-1.5", i.errors > 0 ? "bg-status-danger-solid" : i.state === "todo" && i.position > t.flow.index.value ? "bg-fill-strong" : "bg-tint"]]),
2236
+ "data-state": i.errors > 0 ? "error" : i.state
2237
+ }, null, 10, oo))), 128))
2214
2238
  ]));
2215
2239
  }
2216
- }), Bl = ["data-step"], Ll = {
2240
+ }), no = ["data-step"], so = {
2217
2241
  class: "sr-only",
2218
2242
  "aria-live": "polite"
2219
- }, Tl = {
2243
+ }, io = {
2220
2244
  key: 1,
2221
2245
  "data-test": "step-restored",
2222
2246
  class: "flex items-center gap-2 text-footnote text-content-muted"
2223
- }, Co = /* @__PURE__ */ G({
2247
+ }, Mr = /* @__PURE__ */ J({
2224
2248
  __name: "StepForm",
2225
2249
  props: {
2226
2250
  flow: {},
@@ -2229,151 +2253,967 @@ const hl = {
2229
2253
  },
2230
2254
  emits: ["cancel"],
2231
2255
  setup(l) {
2232
- const a = l, { t: e } = oe(), t = U("body"), o = U("root");
2233
- function n(u) {
2234
- for (let r = u.parentElement; r; r = r.parentElement) {
2235
- const m = getComputedStyle(r).overflowY;
2236
- if ((m === "auto" || m === "scroll") && r.scrollHeight > r.clientHeight) return u.getBoundingClientRect().top < r.getBoundingClientRect().top;
2256
+ const t = l, { t: e } = re(), a = oe("body"), r = oe("root");
2257
+ function i(p) {
2258
+ for (let u = p.parentElement; u; u = u.parentElement) {
2259
+ const b = getComputedStyle(u).overflowY;
2260
+ if ((b === "auto" || b === "scroll") && u.scrollHeight > u.clientHeight) return p.getBoundingClientRect().top < u.getBoundingClientRect().top;
2237
2261
  }
2238
- return u.getBoundingClientRect().top < 0;
2262
+ return p.getBoundingClientRect().top < 0;
2239
2263
  }
2240
- return ge(() => a.flow.current.value.name, async () => {
2241
- await xe(), o.value && n(o.value) && o.value.scrollIntoView?.({ block: "start" }), t.value?.focus({ preventScroll: !0 });
2242
- }), ge(() => a.flow.refusals.value, async () => {
2243
- await xe(), t.value && await qe(t.value);
2244
- }), (u, r) => (d(), y("div", {
2264
+ return be(() => t.flow.current.value.name, async () => {
2265
+ await we(), r.value && i(r.value) && r.value.scrollIntoView?.({ block: "start" }), a.value?.focus({ preventScroll: !0 });
2266
+ }), be(() => t.flow.refusals.value, async () => {
2267
+ await we(), a.value && await Me(a.value);
2268
+ }), (p, u) => (d(), g("div", {
2245
2269
  ref_key: "root",
2246
- ref: o,
2270
+ ref: r,
2247
2271
  class: "flex min-w-0 flex-col gap-group-gap",
2248
2272
  "data-test": "step-form",
2249
- "data-step": a.flow.current.value.name
2273
+ "data-step": t.flow.current.value.name
2250
2274
  }, [
2251
- a.progress !== "none" ? (d(), R(Fl, {
2275
+ t.progress !== "none" ? (d(), z(ro, {
2252
2276
  key: 0,
2253
- flow: a.flow,
2254
- progress: a.progress
2255
- }, null, 8, ["flow", "progress"])) : q("", !0),
2256
- p("p", Ll, C(a.flow.subtitle.value), 1),
2257
- a.flow.restored.value ? (d(), y("div", Tl, [
2258
- p("span", null, C(s(e)("core.steps.restored")), 1),
2259
- I(be, {
2277
+ flow: t.flow,
2278
+ progress: t.progress
2279
+ }, null, 8, ["flow", "progress"])) : j("", !0),
2280
+ x("p", so, B(t.flow.subtitle.value), 1),
2281
+ t.flow.restored.value ? (d(), g("div", io, [
2282
+ x("span", null, B(s(e)("core.steps.restored")), 1),
2283
+ U(ae, {
2260
2284
  prominence: "link",
2261
2285
  size: "sm",
2262
- onClick: r[0] || (r[0] = (m) => a.flow.restart())
2286
+ onClick: u[0] || (u[0] = (b) => t.flow.restart())
2263
2287
  }, {
2264
- default: f(() => [
2265
- H(C(s(e)("core.steps.start_over")), 1)
2288
+ default: k(() => [
2289
+ Z(B(s(e)("core.steps.start_over")), 1)
2266
2290
  ]),
2267
2291
  _: 1
2268
2292
  })
2269
- ])) : q("", !0),
2270
- (d(), R(We, {
2271
- key: a.flow.current.value.name,
2272
- form: a.flow
2293
+ ])) : j("", !0),
2294
+ (d(), z(it, {
2295
+ key: t.flow.current.value.name,
2296
+ form: t.flow
2273
2297
  }, null, 8, ["form"])),
2274
- (d(), y("form", {
2275
- key: a.flow.current.value.name,
2298
+ (d(), g("form", {
2299
+ key: t.flow.current.value.name,
2276
2300
  ref_key: "body",
2277
- ref: t,
2301
+ ref: a,
2278
2302
  tabindex: "-1",
2279
2303
  novalidate: "",
2280
2304
  "data-test": "step-body",
2281
- class: j(["flex min-w-0 flex-col gap-group-gap outline-none", a.flow.direction.value === "back" ? "animate-step-back" : a.flow.direction.value === "forward" ? "animate-step-in" : ""]),
2282
- onSubmit: r[1] || (r[1] = pe((m) => a.flow.next(), ["prevent"]))
2305
+ class: W(["flex min-w-0 flex-col gap-group-gap outline-none", t.flow.direction.value === "back" ? "animate-step-back" : t.flow.direction.value === "forward" ? "animate-step-in" : ""]),
2306
+ onSubmit: u[1] || (u[1] = he((b) => t.flow.next(), ["prevent"]))
2283
2307
  }, [
2284
- S(u.$slots, a.flow.current.value.name),
2285
- r[3] || (r[3] = p("button", {
2308
+ R(p.$slots, t.flow.current.value.name),
2309
+ u[3] || (u[3] = x("button", {
2286
2310
  type: "submit",
2287
2311
  class: "sr-only",
2288
2312
  tabindex: "-1",
2289
2313
  "aria-hidden": "true"
2290
2314
  }, null, -1))
2291
2315
  ], 34)),
2292
- a.navigation === "inline" ? (d(), R(kl, {
2316
+ t.navigation === "inline" ? (d(), z(Xl, {
2293
2317
  key: 2,
2294
- flow: a.flow,
2295
- onCancel: r[2] || (r[2] = (m) => u.$emit("cancel"))
2296
- }, null, 8, ["flow"])) : q("", !0)
2297
- ], 8, Bl));
2318
+ flow: t.flow,
2319
+ onCancel: u[2] || (u[2] = (b) => p.$emit("cancel"))
2320
+ }, null, 8, ["flow"])) : j("", !0)
2321
+ ], 8, no));
2322
+ }
2323
+ }), rt = Symbol("vue-core.dynamicForm.locale"), uo = { class: "flex w-full flex-col gap-3" }, co = { class: "mb-2 flex items-center justify-between" }, mo = { class: "text-sm font-medium text-muted" }, fo = {
2324
+ key: 0,
2325
+ class: "flex gap-1"
2326
+ }, po = { key: 0 }, vo = /* @__PURE__ */ J({
2327
+ __name: "RepeatField",
2328
+ props: /* @__PURE__ */ me({
2329
+ label: {},
2330
+ labelHidden: { type: Boolean },
2331
+ hint: {},
2332
+ error: {},
2333
+ required: { type: Boolean },
2334
+ editable: { type: Boolean },
2335
+ disabled: { type: Boolean },
2336
+ lockedReason: {},
2337
+ presentation: {},
2338
+ name: {},
2339
+ fields: {},
2340
+ modelValue: {},
2341
+ locales: {},
2342
+ defaultLocale: {},
2343
+ errors: {},
2344
+ resources: {},
2345
+ addLabel: {},
2346
+ localeMode: {}
2347
+ }, { ...pe, modelValue: () => [], locales: void 0, defaultLocale: void 0, errors: () => ({}), resources: void 0, addLabel: void 0, localeMode: "perField" }),
2348
+ emits: ["update:modelValue"],
2349
+ setup(l, { emit: t }) {
2350
+ const e = l, a = t, { t: r } = re(), { editable: i } = qe(e);
2351
+ let p = 0;
2352
+ const u = H([]);
2353
+ be(() => e.modelValue.length, (m) => {
2354
+ for (; u.value.length < m; ) u.value.push(p++);
2355
+ u.value.length = m;
2356
+ }, { immediate: !0 });
2357
+ const b = (m) => a("update:modelValue", m), _ = () => {
2358
+ u.value.push(p++), b([...e.modelValue, {}]);
2359
+ }, V = (m) => {
2360
+ u.value.splice(m, 1), b(e.modelValue.filter((h, v) => v !== m));
2361
+ };
2362
+ function $(m, h) {
2363
+ const v = m + h;
2364
+ if (v < 0 || v >= e.modelValue.length) return;
2365
+ const y = [...e.modelValue];
2366
+ [y[m], y[v]] = [y[v], y[m]], [u.value[m], u.value[v]] = [u.value[v], u.value[m]], b(y);
2367
+ }
2368
+ const n = (m, h) => b(e.modelValue.map((v, y) => y === m ? h : { ...v }));
2369
+ function c(m) {
2370
+ const h = `${m}.`;
2371
+ return Object.fromEntries(Object.entries(e.errors).filter(([v]) => v.startsWith(h)).map(([v, y]) => [v.slice(h.length), y]));
2372
+ }
2373
+ return (m, h) => (d(), z(ye, N(s(fe)(e), {
2374
+ "row-layout": "stacked",
2375
+ value: null,
2376
+ error: e.error ?? e.errors[""]?.[0]
2377
+ }), {
2378
+ default: k(() => [
2379
+ x("div", uo, [
2380
+ (d(!0), g(ee, null, ce(e.modelValue, (v, y) => (d(), g("div", {
2381
+ key: u.value[y],
2382
+ class: "rounded-md border border-border p-3",
2383
+ "data-repeat-row": ""
2384
+ }, [
2385
+ x("div", co, [
2386
+ x("span", mo, B(s(r)("core.form.dynamic.repeat.row", { n: y + 1 })), 1),
2387
+ s(i) && !e.disabled ? (d(), g("div", fo, [
2388
+ U(ae, N({
2389
+ size: "xs",
2390
+ prominence: "plain",
2391
+ icon: "arrowUpSLine",
2392
+ disabled: y === 0
2393
+ }, { ref_for: !0 }, { "aria-label": s(r)("core.form.dynamic.repeat.up", { n: y + 1 }) }, {
2394
+ "data-move": "up",
2395
+ onClick: (S) => $(y, -1)
2396
+ }), null, 16, ["disabled", "onClick"]),
2397
+ U(ae, N({
2398
+ size: "xs",
2399
+ prominence: "plain",
2400
+ icon: "arrowDownSLine",
2401
+ disabled: y === e.modelValue.length - 1
2402
+ }, { ref_for: !0 }, { "aria-label": s(r)("core.form.dynamic.repeat.down", { n: y + 1 }) }, {
2403
+ "data-move": "down",
2404
+ onClick: (S) => $(y, 1)
2405
+ }), null, 16, ["disabled", "onClick"]),
2406
+ U(ae, N({
2407
+ size: "xs",
2408
+ prominence: "plain",
2409
+ tone: "critical",
2410
+ icon: "deleteBin2Line"
2411
+ }, { ref_for: !0 }, { "aria-label": s(r)("core.form.dynamic.repeat.remove", { n: y + 1 }) }, {
2412
+ "data-remove": "",
2413
+ onClick: (S) => V(y)
2414
+ }), null, 16, ["onClick"])
2415
+ ])) : j("", !0)
2416
+ ]),
2417
+ U(Io, {
2418
+ schema: { fields: e.fields },
2419
+ "model-value": v,
2420
+ locales: e.locales,
2421
+ "default-locale": e.defaultLocale,
2422
+ errors: c(y),
2423
+ resources: e.resources,
2424
+ readonly: !s(i) || e.disabled,
2425
+ "locale-mode": e.localeMode,
2426
+ "onUpdate:modelValue": (S) => n(y, S)
2427
+ }, null, 8, ["schema", "model-value", "locales", "default-locale", "errors", "resources", "readonly", "locale-mode", "onUpdate:modelValue"])
2428
+ ]))), 128)),
2429
+ s(i) && !e.disabled ? (d(), g("div", po, [
2430
+ U(ae, {
2431
+ icon: "addLine",
2432
+ "data-add": "",
2433
+ onClick: _
2434
+ }, {
2435
+ default: k(() => [
2436
+ Z(B(e.addLabel ?? s(r)("core.form.dynamic.repeat.add")), 1)
2437
+ ]),
2438
+ _: 1
2439
+ })
2440
+ ])) : j("", !0)
2441
+ ])
2442
+ ]),
2443
+ _: 1
2444
+ }, 16, ["error"]));
2445
+ }
2446
+ }), bo = { class: "flex flex-col gap-3 p-4" }, yo = ["placeholder", "aria-label"], go = {
2447
+ key: 0,
2448
+ role: "alert",
2449
+ class: "text-sm text-critical"
2450
+ }, ho = {
2451
+ key: 1,
2452
+ class: "text-sm text-muted"
2453
+ }, ko = {
2454
+ key: 2,
2455
+ class: "text-sm text-muted"
2456
+ }, _o = {
2457
+ key: 3,
2458
+ class: "grid grid-cols-3 gap-2 sm:grid-cols-4"
2459
+ }, xo = ["onClick"], wo = ["src", "alt"], $o = {
2460
+ key: 0,
2461
+ class: "truncate text-xs"
2462
+ }, Vo = { class: "flex justify-between" }, Vt = /* @__PURE__ */ J({
2463
+ __name: "ResourcePickerList",
2464
+ props: {
2465
+ source: {},
2466
+ accept: {}
2467
+ },
2468
+ emits: ["select"],
2469
+ setup(l, { emit: t }) {
2470
+ const e = l, a = t, { t: r } = re(), i = H(""), p = H(1), u = H(1), b = H([]), _ = H("loading");
2471
+ let V = null, $;
2472
+ async function n() {
2473
+ V?.abort();
2474
+ const h = V = new AbortController();
2475
+ _.value = "loading";
2476
+ try {
2477
+ const v = await e.source.list({ search: i.value.trim(), page: p.value, pageSize: 24, ...e.accept !== void 0 ? { accept: e.accept } : {} }, { signal: h.signal });
2478
+ if (h.signal.aborted) return;
2479
+ b.value = v.rows, u.value = Math.max(1, v.lastPage), _.value = "loaded";
2480
+ } catch {
2481
+ h.signal.aborted || (_.value = "failed");
2482
+ }
2483
+ }
2484
+ function c() {
2485
+ clearTimeout($), $ = setTimeout(() => {
2486
+ p.value = 1, n();
2487
+ }, 250);
2488
+ }
2489
+ function m(h) {
2490
+ p.value += h, n();
2491
+ }
2492
+ return dt(() => void n()), ze(() => {
2493
+ clearTimeout($), V?.abort();
2494
+ }), (h, v) => (d(), g("div", bo, [
2495
+ ct(x("input", {
2496
+ "onUpdate:modelValue": v[0] || (v[0] = (y) => i.value = y),
2497
+ type: "search",
2498
+ class: "w-full rounded-md border border-border bg-surface px-3 py-2 text-sm",
2499
+ placeholder: s(r)("core.form.dynamic.resource.search"),
2500
+ "aria-label": s(r)("core.form.dynamic.resource.search"),
2501
+ onInput: c
2502
+ }, null, 40, yo), [
2503
+ [mt, i.value]
2504
+ ]),
2505
+ _.value === "failed" ? (d(), g("p", go, B(s(r)("core.form.dynamic.resource.failed")), 1)) : _.value === "loading" && b.value.length === 0 ? (d(), g("p", ho, B(s(r)("core.form.dynamic.resource.loading")), 1)) : b.value.length === 0 ? (d(), g("p", ko, B(s(r)("core.form.dynamic.resource.empty")), 1)) : (d(), g("ul", _o, [
2506
+ (d(!0), g(ee, null, ce(b.value, (y) => (d(), g("li", {
2507
+ key: y.id
2508
+ }, [
2509
+ x("button", {
2510
+ type: "button",
2511
+ class: "flex w-full flex-col gap-1 rounded-md border border-border p-1 text-left hover:border-accent focus-visible:outline-2",
2512
+ onClick: (S) => a("select", y)
2513
+ }, [
2514
+ x("img", {
2515
+ src: s(Ke)(e.source, y.id),
2516
+ alt: y.name ?? "",
2517
+ class: "aspect-square w-full rounded object-cover",
2518
+ loading: "lazy"
2519
+ }, null, 8, wo),
2520
+ y.name ? (d(), g("span", $o, B(y.name), 1)) : j("", !0)
2521
+ ], 8, xo)
2522
+ ]))), 128))
2523
+ ])),
2524
+ x("div", Vo, [
2525
+ U(ae, {
2526
+ prominence: "plain",
2527
+ disabled: p.value <= 1,
2528
+ onClick: v[1] || (v[1] = (y) => m(-1))
2529
+ }, {
2530
+ default: k(() => [
2531
+ Z(B(s(r)("core.form.dynamic.resource.previous")), 1)
2532
+ ]),
2533
+ _: 1
2534
+ }, 8, ["disabled"]),
2535
+ U(ae, {
2536
+ prominence: "plain",
2537
+ disabled: p.value >= u.value,
2538
+ onClick: v[2] || (v[2] = (y) => m(1))
2539
+ }, {
2540
+ default: k(() => [
2541
+ Z(B(s(r)("core.form.dynamic.resource.next")), 1)
2542
+ ]),
2543
+ _: 1
2544
+ }, 8, ["disabled"])
2545
+ ])
2546
+ ]));
2547
+ }
2548
+ }), Co = ["id"], So = ["src"], Fo = {
2549
+ key: 0,
2550
+ class: "mt-1 flex justify-between"
2551
+ }, qo = {
2552
+ key: 0,
2553
+ class: "text-sm text-muted"
2554
+ }, Bo = /* @__PURE__ */ J({
2555
+ __name: "ResourceField",
2556
+ props: /* @__PURE__ */ me({
2557
+ label: {},
2558
+ labelHidden: { type: Boolean },
2559
+ hint: {},
2560
+ error: {},
2561
+ required: { type: Boolean },
2562
+ editable: { type: Boolean },
2563
+ disabled: { type: Boolean },
2564
+ lockedReason: {},
2565
+ presentation: {},
2566
+ name: {},
2567
+ source: {},
2568
+ multiple: { type: Boolean },
2569
+ accept: {},
2570
+ modelValue: {}
2571
+ }, { ...pe, multiple: !1, accept: void 0, modelValue: void 0 }),
2572
+ emits: ["update:modelValue"],
2573
+ setup(l, { emit: t }) {
2574
+ const e = l, a = t, { t: r } = re(), { editable: i } = qe(e), p = ht(), u = q(() => Array.isArray(e.modelValue) ? [...e.modelValue] : e.modelValue === null || e.modelValue === void 0 || e.modelValue === "" ? [] : [e.modelValue]);
2575
+ function b($) {
2576
+ a("update:modelValue", e.multiple ? $ : $[0] ?? null);
2577
+ }
2578
+ async function _($) {
2579
+ const n = await p.pick({ title: e.label ?? r("core.form.dynamic.resource.title") });
2580
+ if (!n) return;
2581
+ const c = [...u.value];
2582
+ e.multiple && $ === void 0 ? c.push(n.id) : c[$ ?? 0] = n.id, b(c);
2583
+ }
2584
+ const V = ($) => b(u.value.filter((n, c) => c !== $));
2585
+ return ($, n) => (d(), z(ye, N(s(fe)(e), {
2586
+ "row-layout": "stacked",
2587
+ value: u.value.length > 0 ? u.value.join(", ") : null
2588
+ }), {
2589
+ default: k(({ id: c }) => [
2590
+ x("div", {
2591
+ id: c,
2592
+ class: "flex flex-wrap items-start gap-2"
2593
+ }, [
2594
+ (d(!0), g(ee, null, ce(u.value, (m, h) => (d(), g("div", {
2595
+ key: `${m}-${h}`,
2596
+ class: "relative w-24",
2597
+ "data-resource": ""
2598
+ }, [
2599
+ x("img", {
2600
+ src: s(Ke)(e.source, m),
2601
+ alt: "",
2602
+ class: "aspect-square w-full rounded-md border border-border object-cover"
2603
+ }, null, 8, So),
2604
+ s(i) && !e.disabled ? (d(), g("div", Fo, [
2605
+ U(ae, {
2606
+ size: "xs",
2607
+ prominence: "plain",
2608
+ onClick: (v) => _(h)
2609
+ }, {
2610
+ default: k(() => [
2611
+ Z(B(s(r)("core.form.dynamic.resource.change")), 1)
2612
+ ]),
2613
+ _: 1
2614
+ }, 8, ["onClick"]),
2615
+ U(ae, N({
2616
+ size: "xs",
2617
+ prominence: "plain",
2618
+ tone: "critical",
2619
+ icon: "close"
2620
+ }, { ref_for: !0 }, { "aria-label": s(r)("core.form.dynamic.resource.remove") }, {
2621
+ onClick: (v) => V(h)
2622
+ }), null, 16, ["onClick"])
2623
+ ])) : j("", !0)
2624
+ ]))), 128)),
2625
+ u.value.length === 0 && !s(i) ? (d(), g("p", qo, B(s(r)("core.form.dynamic.resource.none")), 1)) : j("", !0),
2626
+ s(i) && !e.disabled && (e.multiple || u.value.length === 0) ? (d(), z(ae, {
2627
+ key: 1,
2628
+ icon: "addLine",
2629
+ onClick: n[0] || (n[0] = (m) => _())
2630
+ }, {
2631
+ default: k(() => [
2632
+ Z(B(s(r)("core.form.dynamic.resource.choose")), 1)
2633
+ ]),
2634
+ _: 1
2635
+ })) : j("", !0)
2636
+ ], 8, Co),
2637
+ U(kt, { picker: s(p) }, {
2638
+ default: k(({ select: m }) => [
2639
+ U(Vt, {
2640
+ source: e.source,
2641
+ accept: e.accept,
2642
+ onSelect: m
2643
+ }, null, 8, ["source", "accept", "onSelect"])
2644
+ ]),
2645
+ _: 1
2646
+ }, 8, ["picker"])
2647
+ ]),
2648
+ _: 1
2649
+ }, 16, ["value"]));
2650
+ }
2651
+ }), Lo = { class: "w-full rounded-md border border-border bg-surface" }, To = ["aria-label"], Do = ["data-tool", "aria-label", "title", "aria-pressed", "disabled", "onClick"], zo = ["aria-label", "placeholder"], jo = {
2652
+ key: 2,
2653
+ role: "alert",
2654
+ class: "p-3 text-sm text-critical"
2655
+ }, Oo = ["id"], nt = /* @__PURE__ */ J({
2656
+ __name: "RichTextField",
2657
+ props: /* @__PURE__ */ me({
2658
+ label: {},
2659
+ labelHidden: { type: Boolean },
2660
+ hint: {},
2661
+ error: {},
2662
+ required: { type: Boolean },
2663
+ editable: { type: Boolean },
2664
+ disabled: { type: Boolean },
2665
+ lockedReason: {},
2666
+ presentation: {},
2667
+ name: {},
2668
+ modelValue: {},
2669
+ images: {},
2670
+ video: { type: Boolean },
2671
+ placeholder: {}
2672
+ }, { ...pe, modelValue: "", images: void 0, video: !1, placeholder: void 0 }),
2673
+ emits: ["update:modelValue"],
2674
+ setup(l, { emit: t }) {
2675
+ const e = l, a = t, { t: r } = re(), { editable: i } = qe(e), p = oe("host"), u = H(!1), b = H(!1), _ = ht(), V = H(null), $ = H("");
2676
+ let n = null, c = "", m = null;
2677
+ const h = H({}), v = () => n ? n.getText().trim() === "" && !n.root.querySelector("img, iframe") ? "" : n.getSemanticHTML() : "";
2678
+ function y(M) {
2679
+ n && (n.setContents(n.clipboard.convert({ html: M }), "silent"), c = v());
2680
+ }
2681
+ dt(async () => {
2682
+ try {
2683
+ const { default: M } = await import("quill");
2684
+ if (!p.value) return;
2685
+ n = new M(p.value, { modules: { toolbar: !1 }, placeholder: e.placeholder, readOnly: !i.value || e.disabled });
2686
+ } catch {
2687
+ u.value = !0;
2688
+ return;
2689
+ }
2690
+ y(e.modelValue), n.on("text-change", (M, O, X) => {
2691
+ c = v(), X === "user" && a("update:modelValue", c);
2692
+ }), n.on("selection-change", (M) => {
2693
+ M && (m = M, h.value = n?.getFormat(M) ?? {});
2694
+ }), b.value = !0;
2695
+ }), ze(() => n?.disable()), be(() => e.modelValue, (M) => {
2696
+ M !== c && y(M);
2697
+ }), be(() => !i.value || e.disabled, (M) => n?.enable(!M));
2698
+ const S = (M, O) => {
2699
+ if (!n) return;
2700
+ n.focus();
2701
+ const X = n.getFormat();
2702
+ n.format(M, X[M] === O ? !1 : O, "user"), h.value = n.getFormat();
2703
+ }, L = (M, O = !0) => h.value[M] === O;
2704
+ function T(M) {
2705
+ m = n?.getSelection() ?? m, $.value = "", V.value = M;
2706
+ }
2707
+ async function C() {
2708
+ const M = $.value.trim(), O = V.value;
2709
+ if (V.value = null, !n || M === "" || !O) return;
2710
+ n.focus(), m && n.setSelection(m);
2711
+ const X = m ?? { index: n.getLength() };
2712
+ O === "link" ? n.format("link", M, "user") : n.insertEmbed(X.index, "video", M, "user");
2713
+ }
2714
+ async function P() {
2715
+ m = n?.getSelection() ?? m;
2716
+ const M = await _.pick({ title: r("core.form.dynamic.rich_text.image") });
2717
+ if (!M || !n || !e.images) return;
2718
+ const O = { thumbnail: e.images.image ?? e.images.thumbnail };
2719
+ n.insertEmbed(m?.index ?? n.getLength(), "image", Ke(O, M.id), "user");
2720
+ }
2721
+ const Y = q(() => [
2722
+ { key: "heading", label: r("core.form.dynamic.rich_text.heading"), text: "H", on: L("header", 2), run: () => S("header", 2) },
2723
+ { key: "bold", label: r("core.form.dynamic.rich_text.bold"), text: "B", on: L("bold"), run: () => S("bold", !0) },
2724
+ { key: "italic", label: r("core.form.dynamic.rich_text.italic"), text: "I", on: L("italic"), run: () => S("italic", !0) },
2725
+ { key: "bullets", label: r("core.form.dynamic.rich_text.bullets"), text: "•", on: L("list", "bullet"), run: () => S("list", "bullet") },
2726
+ { key: "numbers", label: r("core.form.dynamic.rich_text.numbers"), text: "1.", on: L("list", "ordered"), run: () => S("list", "ordered") },
2727
+ { key: "link", label: r("core.form.dynamic.rich_text.link"), text: "↗", on: typeof h.value.link == "string", run: () => T("link") },
2728
+ ...e.images ? [{ key: "image", label: r("core.form.dynamic.rich_text.image"), text: "▣", on: !1, run: () => void P() }] : [],
2729
+ ...e.video ? [{ key: "video", label: r("core.form.dynamic.rich_text.video"), text: "▶", on: !1, run: () => T("video") }] : []
2730
+ ]);
2731
+ return (M, O) => (d(), z(ye, N(s(fe)(e), {
2732
+ "row-layout": "stacked",
2733
+ value: null
2734
+ }), {
2735
+ default: k(({ id: X }) => [
2736
+ x("div", Lo, [
2737
+ s(i) && !e.disabled ? (d(), g("div", {
2738
+ key: 0,
2739
+ class: "flex flex-wrap gap-1 border-b border-border p-1",
2740
+ role: "toolbar",
2741
+ "aria-label": e.label
2742
+ }, [
2743
+ (d(!0), g(ee, null, ce(Y.value, (D) => (d(), g("button", {
2744
+ key: D.key,
2745
+ type: "button",
2746
+ "data-tool": D.key,
2747
+ "aria-label": D.label,
2748
+ title: D.label,
2749
+ "aria-pressed": D.on,
2750
+ disabled: !b.value,
2751
+ class: "min-w-8 rounded px-2 py-1 text-sm font-medium hover:bg-surface-muted aria-pressed:bg-surface-muted",
2752
+ onMousedown: O[0] || (O[0] = he(() => {
2753
+ }, ["prevent"])),
2754
+ onClick: D.run
2755
+ }, B(D.text), 41, Do))), 128))
2756
+ ], 8, To)) : j("", !0),
2757
+ V.value ? (d(), g("form", {
2758
+ key: 1,
2759
+ class: "flex gap-2 border-b border-border p-2",
2760
+ onSubmit: he(C, ["prevent"])
2761
+ }, [
2762
+ ct(x("input", {
2763
+ "onUpdate:modelValue": O[1] || (O[1] = (D) => $.value = D),
2764
+ type: "url",
2765
+ class: "w-full rounded-md border border-border bg-surface px-2 py-1 text-sm",
2766
+ "aria-label": V.value === "link" ? s(r)("core.form.dynamic.rich_text.link_prompt") : s(r)("core.form.dynamic.rich_text.video_prompt"),
2767
+ placeholder: V.value === "link" ? s(r)("core.form.dynamic.rich_text.link_prompt") : s(r)("core.form.dynamic.rich_text.video_prompt")
2768
+ }, null, 8, zo), [
2769
+ [mt, $.value]
2770
+ ]),
2771
+ U(ae, {
2772
+ type: "submit",
2773
+ size: "sm"
2774
+ }, {
2775
+ default: k(() => [...O[2] || (O[2] = [
2776
+ Z("OK", -1)
2777
+ ])]),
2778
+ _: 1
2779
+ })
2780
+ ], 32)) : j("", !0),
2781
+ u.value ? (d(), g("p", jo, B(s(r)("core.form.dynamic.rich_text.failed")), 1)) : j("", !0),
2782
+ x("div", {
2783
+ id: X,
2784
+ ref_key: "host",
2785
+ ref: p,
2786
+ class: W(["min-h-32 px-3 py-2 text-sm [&_.ql-clipboard]:absolute [&_.ql-clipboard]:-left-[100000px] [&_.ql-editor]:min-h-28 [&_.ql-editor]:outline-none [&_.ql-editor_h2]:text-lg [&_.ql-editor_h2]:font-semibold [&_.ql-editor_img]:max-w-full [&_.ql-editor_ol]:pl-6 [&_.ql-editor_li[data-list=bullet]]:list-disc [&_.ql-editor_li[data-list=ordered]]:list-decimal [&_.ql-editor_a]:text-accent [&_.ql-editor_a]:underline [&_.ql-ui]:hidden [&_.ql-editor.ql-blank::before]:text-muted [&_.ql-editor.ql-blank::before]:content-[attr(data-placeholder)]", { hidden: u.value }])
2787
+ }, null, 10, Oo)
2788
+ ]),
2789
+ e.images ? (d(), z(kt, {
2790
+ key: 0,
2791
+ picker: s(_)
2792
+ }, {
2793
+ default: k(({ select: D }) => [
2794
+ U(Vt, {
2795
+ source: e.images,
2796
+ accept: "image/*",
2797
+ onSelect: D
2798
+ }, null, 8, ["source", "onSelect"])
2799
+ ]),
2800
+ _: 1
2801
+ }, 8, ["picker"])) : j("", !0)
2802
+ ]),
2803
+ _: 1
2804
+ }, 16));
2298
2805
  }
2299
2806
  });
2807
+ function $e(l) {
2808
+ return l == null ? !0 : typeof l == "string" ? l.trim() === "" : Array.isArray(l) ? l.length === 0 : typeof l == "object" ? Object.values(l).every($e) : !1;
2809
+ }
2810
+ function Te(l, t) {
2811
+ if (l === t) return !0;
2812
+ if (typeof l != "object" || typeof t != "object" || l === null || t === null || Array.isArray(l) !== Array.isArray(t)) return !1;
2813
+ const e = l, a = t, r = Object.keys(e);
2814
+ return r.length === Object.keys(a).length && r.every((i) => i in a && Te(e[i], a[i]));
2815
+ }
2816
+ function Mo(l, t) {
2817
+ const e = t[l.field];
2818
+ return "eq" in l ? Te(e, l.eq) : "ne" in l ? !Te(e, l.ne) : "in" in l ? Array.isArray(l.in) ? l.in.some((a) => Te(e, a)) : null : "empty" in l ? $e(e) : "not_empty" in l ? !$e(e) : null;
2819
+ }
2820
+ function Ct(l, t) {
2821
+ if (!l) return !0;
2822
+ const e = (l.all ?? l.any ?? []).map((a) => Mo(a, t)).filter((a) => a !== null);
2823
+ return e.length === 0 ? !0 : l.all ? e.every(Boolean) : e.some(Boolean);
2824
+ }
2825
+ const Ro = {
2826
+ class: "flex w-full flex-col gap-4",
2827
+ "data-dynamic-form": ""
2828
+ }, Uo = ["aria-label"], Eo = ["id", "aria-selected", "data-locale", "data-error", "onClick"], Io = /* @__PURE__ */ J({
2829
+ __name: "DynamicForm",
2830
+ props: {
2831
+ schema: {},
2832
+ modelValue: { default: () => ({}) },
2833
+ locales: { default: void 0 },
2834
+ defaultLocale: { default: void 0 },
2835
+ errors: { default: () => ({}) },
2836
+ readonly: { type: Boolean, default: !1 },
2837
+ localeMode: { default: "perField" },
2838
+ resources: { default: void 0 }
2839
+ },
2840
+ emits: ["update:modelValue"],
2841
+ setup(l, { emit: t }) {
2842
+ const e = l, a = t, { t: r, availableLocales: i } = re(), p = De(yt, null), u = q(() => e.locales ?? p?.locales ?? i), b = q(() => e.defaultLocale ?? u.value[0] ?? ""), _ = q(() => e.errors instanceof Bt ? e.errors.all() : e.errors);
2843
+ function V(w) {
2844
+ const A = _.value[w]?.[0];
2845
+ if (A !== void 0) return A;
2846
+ const o = Object.keys(_.value).find((f) => f.startsWith(`${w}.`));
2847
+ return o === void 0 ? void 0 : _.value[o]?.[0];
2848
+ }
2849
+ const $ = (w) => Object.fromEntries(Object.entries(_.value).filter(([A]) => A.startsWith(`${w}.`)).map(([A, o]) => [A.slice(w.length + 1), o])), n = q(() => e.schema.fields.filter((w) => Ct(w.visible_when, e.modelValue)));
2850
+ function c(w, A) {
2851
+ a("update:modelValue", { ...e.modelValue, [w]: A });
2852
+ }
2853
+ const m = (w) => !!w.translatable && (w.kind === "text" || w.kind === "textarea" || w.kind === "rich_text"), h = (w) => m(w) && (e.localeMode === "form" || w.kind === "rich_text"), v = De(rt, null), y = q(() => e.localeMode === "form" && v !== null), S = H(null), L = q(() => y.value && v ? v.value : S.value !== null && u.value.includes(S.value) ? S.value : b.value), T = q(() => !y.value && n.value.some(h));
2854
+ ut(rt, L);
2855
+ const C = (w) => typeof e.modelValue[w.key] == "object" && e.modelValue[w.key] !== null ? e.modelValue[w.key] : {}, P = (w) => _.value[`${w.key}.${L.value}`]?.[0] ?? _.value[w.key]?.[0], Y = (w) => n.value.some((A) => m(A) && _.value[`${A.key}.${w}`] !== void 0);
2856
+ function M(w, A, o) {
2857
+ c(w.key, { ...C(w), [A]: o });
2858
+ }
2859
+ const O = (w, A = w.key) => ({
2860
+ label: w.label,
2861
+ hint: w.props?.hint,
2862
+ required: w.required === !0,
2863
+ error: w.kind === "collection" ? _.value[w.key]?.[0] : V(w.key),
2864
+ editable: !e.readonly,
2865
+ name: w.key,
2866
+ "data-field-key": A
2867
+ }), X = (w, A) => w.validation?.some((o) => o.rule === A) === !0, D = (w) => {
2868
+ const A = w.validation?.find((o) => o.rule === "max")?.args?.[0];
2869
+ return typeof A == "number" ? A : void 0;
2870
+ }, Q = (w) => Array.isArray(e.modelValue[w.key]) ? e.modelValue[w.key] : [], te = (w) => typeof e.modelValue[w.key] == "number" ? e.modelValue[w.key] : null, ne = (w) => typeof e.modelValue[w.key] == "string" && e.modelValue[w.key] !== "" ? e.modelValue[w.key] : null, le = (w) => {
2871
+ const A = e.modelValue[w.key];
2872
+ return typeof A == "string" || typeof A == "number" ? A : null;
2873
+ }, de = (w) => Array.isArray(e.modelValue[w.key]) ? e.modelValue[w.key] : [], _e = (w) => Array.isArray(e.modelValue[w.key]) ? e.modelValue[w.key] : [], ge = (w) => typeof e.modelValue[w.key] == "string" ? e.modelValue[w.key] : "";
2874
+ return (w, A) => (d(), g("div", Ro, [
2875
+ T.value ? (d(), g("div", {
2876
+ key: 0,
2877
+ role: "tablist",
2878
+ "aria-label": s(r)("core.form.dynamic.language"),
2879
+ class: "flex gap-1"
2880
+ }, [
2881
+ (d(!0), g(ee, null, ce(u.value, (o) => (d(), g("button", {
2882
+ id: `dynamic-locale-${o}`,
2883
+ key: o,
2884
+ type: "button",
2885
+ role: "tab",
2886
+ "aria-selected": o === L.value,
2887
+ "data-locale": o,
2888
+ "data-error": Y(o) || void 0,
2889
+ class: "rounded-md px-3 py-1 text-sm font-medium uppercase aria-selected:bg-surface-muted data-[error]:text-critical",
2890
+ onClick: (f) => S.value = o
2891
+ }, B(o), 9, Eo))), 128))
2892
+ ], 8, Uo)) : j("", !0),
2893
+ (d(!0), g(ee, null, ce(n.value, (o) => (d(), g(ee, {
2894
+ key: o.key
2895
+ }, [
2896
+ m(o) ? (d(), g(ee, { key: 0 }, [
2897
+ h(o) ? (d(), g(ee, { key: 0 }, [
2898
+ o.kind === "rich_text" ? (d(), z(nt, N({
2899
+ key: 0,
2900
+ ref_for: !0
2901
+ }, O(o), {
2902
+ error: P(o),
2903
+ "model-value": C(o)[L.value] ?? "",
2904
+ images: e.resources,
2905
+ video: o.props?.video,
2906
+ "onUpdate:modelValue": (f) => M(o, L.value, f)
2907
+ }), null, 16, ["error", "model-value", "images", "video", "onUpdate:modelValue"])) : o.kind === "textarea" ? (d(), z(et, N({
2908
+ key: 1,
2909
+ ref_for: !0
2910
+ }, O(o), {
2911
+ error: P(o),
2912
+ "model-value": C(o)[L.value] ?? "",
2913
+ rows: o.props?.rows,
2914
+ placeholder: o.props?.placeholder,
2915
+ "max-length": D(o),
2916
+ "onUpdate:modelValue": (f) => M(o, L.value, f)
2917
+ }), null, 16, ["error", "model-value", "rows", "placeholder", "max-length", "onUpdate:modelValue"])) : (d(), z(Je, N({
2918
+ key: 2,
2919
+ ref_for: !0
2920
+ }, O(o), {
2921
+ error: P(o),
2922
+ "model-value": C(o)[L.value] ?? "",
2923
+ placeholder: o.props?.placeholder,
2924
+ "max-length": D(o),
2925
+ "onUpdate:modelValue": (f) => M(o, L.value, f)
2926
+ }), null, 16, ["error", "model-value", "placeholder", "max-length", "onUpdate:modelValue"]))
2927
+ ], 64)) : (d(), z(xl, N({
2928
+ key: 1,
2929
+ ref_for: !0
2930
+ }, O(o), {
2931
+ "model-value": C(o),
2932
+ locales: u.value,
2933
+ "default-locale": b.value,
2934
+ "required-locales": o.required ? [b.value] : [],
2935
+ multiline: o.kind === "textarea",
2936
+ rows: o.props?.rows,
2937
+ placeholder: o.props?.placeholder,
2938
+ "max-length": D(o),
2939
+ "onUpdate:modelValue": (f) => c(o.key, f)
2940
+ }), null, 16, ["model-value", "locales", "default-locale", "required-locales", "multiline", "rows", "placeholder", "max-length", "onUpdate:modelValue"]))
2941
+ ], 64)) : o.kind === "text" ? (d(), z(Je, N({
2942
+ key: 1,
2943
+ ref_for: !0
2944
+ }, O(o), {
2945
+ type: X(o, "email") ? "email" : X(o, "url") ? "url" : "text",
2946
+ "model-value": ge(o),
2947
+ placeholder: o.props?.placeholder,
2948
+ "max-length": D(o),
2949
+ "onUpdate:modelValue": (f) => c(o.key, f)
2950
+ }), null, 16, ["type", "model-value", "placeholder", "max-length", "onUpdate:modelValue"])) : o.kind === "textarea" ? (d(), z(et, N({
2951
+ key: 2,
2952
+ ref_for: !0
2953
+ }, O(o), {
2954
+ "model-value": ge(o),
2955
+ rows: o.props?.rows,
2956
+ placeholder: o.props?.placeholder,
2957
+ "max-length": D(o),
2958
+ "onUpdate:modelValue": (f) => c(o.key, f)
2959
+ }), null, 16, ["model-value", "rows", "placeholder", "max-length", "onUpdate:modelValue"])) : o.kind === "rich_text" ? (d(), z(nt, N({
2960
+ key: 3,
2961
+ ref_for: !0
2962
+ }, O(o), {
2963
+ "model-value": ge(o),
2964
+ images: e.resources,
2965
+ video: o.props?.video,
2966
+ "onUpdate:modelValue": (f) => c(o.key, f)
2967
+ }), null, 16, ["model-value", "images", "video", "onUpdate:modelValue"])) : o.kind === "number" ? (d(), z(gt, N({
2968
+ key: 4,
2969
+ ref_for: !0
2970
+ }, O(o), {
2971
+ "model-value": te(o),
2972
+ placeholder: o.props?.placeholder,
2973
+ "onUpdate:modelValue": (f) => c(o.key, f)
2974
+ }), null, 16, ["model-value", "placeholder", "onUpdate:modelValue"])) : o.kind === "boolean" ? (d(), z(sa, N({
2975
+ key: 5,
2976
+ ref_for: !0
2977
+ }, O(o), {
2978
+ "model-value": e.modelValue[o.key] === !0,
2979
+ "onUpdate:modelValue": (f) => c(o.key, f)
2980
+ }), null, 16, ["model-value", "onUpdate:modelValue"])) : o.kind === "select" ? (d(), z(na, N({
2981
+ key: 6,
2982
+ ref_for: !0
2983
+ }, O(o), {
2984
+ options: o.options ?? [],
2985
+ "model-value": le(o),
2986
+ clearable: !o.required,
2987
+ placeholder: o.props?.placeholder,
2988
+ "onUpdate:modelValue": (f) => c(o.key, f)
2989
+ }), null, 16, ["options", "model-value", "clearable", "placeholder", "onUpdate:modelValue"])) : o.kind === "multi_select" ? (d(), z(jl, N({
2990
+ key: 7,
2991
+ ref_for: !0
2992
+ }, O(o), {
2993
+ options: o.options ?? [],
2994
+ "model-value": de(o),
2995
+ placeholder: o.props?.placeholder,
2996
+ "onUpdate:modelValue": (f) => c(o.key, f)
2997
+ }), null, 16, ["options", "model-value", "placeholder", "onUpdate:modelValue"])) : o.kind === "date" ? (d(), z(aa, N({
2998
+ key: 8,
2999
+ ref_for: !0
3000
+ }, O(o), {
3001
+ "model-value": ne(o),
3002
+ "onUpdate:modelValue": (f) => c(o.key, f)
3003
+ }), null, 16, ["model-value", "onUpdate:modelValue"])) : o.kind === "datetime" ? (d(), z(Wa, N({
3004
+ key: 9,
3005
+ ref_for: !0
3006
+ }, O(o), {
3007
+ "model-value": ne(o),
3008
+ "onUpdate:modelValue": (f) => c(o.key, f)
3009
+ }), null, 16, ["model-value", "onUpdate:modelValue"])) : o.kind === "image" || o.kind === "document" || o.kind === "gallery" ? (d(), g(ee, { key: 10 }, [
3010
+ e.resources ? (d(), z(Bo, N({
3011
+ key: 0,
3012
+ ref_for: !0
3013
+ }, O(o), {
3014
+ source: e.resources,
3015
+ multiple: o.kind === "gallery",
3016
+ accept: o.props?.accept ?? (o.kind === "image" ? "image/*" : void 0),
3017
+ "model-value": o.kind === "gallery" ? Q(o) : e.modelValue[o.key],
3018
+ "onUpdate:modelValue": (f) => c(o.key, f)
3019
+ }), null, 16, ["source", "multiple", "accept", "model-value", "onUpdate:modelValue"])) : j("", !0)
3020
+ ], 64)) : o.kind === "collection" ? (d(), z(vo, N({
3021
+ key: 11,
3022
+ ref_for: !0
3023
+ }, O(o), {
3024
+ fields: o.children ?? [],
3025
+ "model-value": _e(o),
3026
+ locales: u.value,
3027
+ "default-locale": b.value,
3028
+ errors: $(o.key),
3029
+ resources: e.resources,
3030
+ "add-label": o.props?.addLabel,
3031
+ "locale-mode": e.localeMode,
3032
+ "onUpdate:modelValue": (f) => c(o.key, f)
3033
+ }), null, 16, ["fields", "model-value", "locales", "default-locale", "errors", "resources", "add-label", "locale-mode", "onUpdate:modelValue"])) : j("", !0)
3034
+ ], 64))), 128))
3035
+ ]));
3036
+ }
3037
+ }), Ve = (l) => {
3038
+ const [t] = l.args ?? [];
3039
+ if (typeof t != "number" || !Number.isFinite(t)) throw new Error(`buildValidator: the "${l.rule}" rule needs a number argument.`);
3040
+ return t;
3041
+ }, st = (l) => typeof l == "string" || typeof l == "number";
3042
+ function Rr(l, t) {
3043
+ const e = t.zod, { messages: a = {} } = t, r = e.any().refine(() => !1, { params: { code: "required" }, ...a.required !== void 0 ? { error: a.required } : {} }), i = (c) => c !== void 0 ? { error: c } : {};
3044
+ function p(c) {
3045
+ const m = c.validation ?? [], h = (T) => m.find((C) => C.rule === T), v = h("min"), y = h("max"), S = () => {
3046
+ let T = e.string(i(a.type));
3047
+ v && (T = T.min(Ve(v))), y && (T = T.max(Ve(y)));
3048
+ const C = [T];
3049
+ h("email") && C.push(e.email(i(a.email))), h("url") && C.push(e.url(i(a.url)));
3050
+ const P = h("regex")?.args?.[0];
3051
+ if (typeof P == "string") C.push(e.string().regex(new RegExp(P), i(a.regex)));
3052
+ else if (h("regex")) throw new Error(`buildValidator: the "regex" rule of "${c.key}" needs a pattern string.`);
3053
+ return C;
3054
+ }, L = (T) => {
3055
+ let C = e.array(T);
3056
+ return v && (C = C.min(Ve(v))), y && (C = C.max(Ve(y))), C;
3057
+ };
3058
+ switch (c.kind) {
3059
+ case "text":
3060
+ case "textarea":
3061
+ case "rich_text":
3062
+ return c.translatable ? [e.record(e.string(), e.unknown()).superRefine((T, C) => {
3063
+ for (const [P, Y] of Object.entries(T))
3064
+ if (!$e(Y))
3065
+ for (const M of S()) for (const O of M.safeParse(Y).error?.issues ?? []) C.addIssue({ ...O, path: [P, ...O.path] });
3066
+ })] : S();
3067
+ case "number": {
3068
+ let T = e.number(i(a.type));
3069
+ return v && (T = T.min(Ve(v))), y && (T = T.max(Ve(y))), [T];
3070
+ }
3071
+ case "boolean":
3072
+ return [e.boolean(i(a.type))];
3073
+ case "select": {
3074
+ const T = (c.options ?? []).map((C) => C.value);
3075
+ return [e.union([e.string(), e.number()], i(a.type)).refine((C) => T.includes(C), { params: { code: "invalid_choice" } })];
3076
+ }
3077
+ case "multi_select": {
3078
+ const T = (c.options ?? []).map((C) => C.value);
3079
+ return [L(e.union([e.string(), e.number()])), e.array(e.unknown()).refine((C) => C.every((P) => T.includes(P)), { params: { code: "invalid_choice" } })];
3080
+ }
3081
+ case "date":
3082
+ return [e.string(i(a.type)).refine((T) => za(T) !== null, { params: { code: "date" } })];
3083
+ case "datetime":
3084
+ return [e.string(i(a.type)).refine((T) => wt(T) !== null, { params: { code: "datetime" } })];
3085
+ case "image":
3086
+ case "document":
3087
+ return [e.custom(st, i(a.type))];
3088
+ case "gallery":
3089
+ return [L(e.custom(st))];
3090
+ case "collection":
3091
+ return [L(e.record(e.string(), e.unknown()))];
3092
+ }
3093
+ }
3094
+ const u = /* @__PURE__ */ new Map(), b = (c) => {
3095
+ for (const m of c)
3096
+ u.set(m, p(m)), m.children && b(m.children);
3097
+ };
3098
+ b(l.fields);
3099
+ const _ = (c, m) => c.kind === "boolean" ? m == null : $e(m), V = (c) => c.required === !0 || c.validation?.some((m) => m.rule === "required") === !0, $ = (c, m) => {
3100
+ if (!c.translatable || typeof m != "object" || m === null) return _(c, m);
3101
+ const h = m;
3102
+ return t.defaultLocale !== void 0 ? $e(h[t.defaultLocale]) : $e(h);
3103
+ };
3104
+ function n(c, m, h, v) {
3105
+ const y = {};
3106
+ for (const S of c) {
3107
+ if (!Ct(S.visible_when, m)) continue;
3108
+ const L = m[S.key], T = [...h, S.key];
3109
+ if (y[S.key] = L, S.kind === "text" || S.kind === "textarea" || S.kind === "rich_text" ? $(S, L) : _(S, L)) {
3110
+ if (V(S)) for (const P of r.safeParse(L).error?.issues ?? []) v.push({ path: T, message: P.message });
3111
+ continue;
3112
+ }
3113
+ for (const P of u.get(S) ?? [])
3114
+ for (const Y of P.safeParse(L).error?.issues ?? [])
3115
+ v.push({ path: [...T, ...Y.path], message: Y.message });
3116
+ S.kind === "collection" && S.children && Array.isArray(L) && L.every((P) => typeof P == "object" && P !== null) && (y[S.key] = L.map((P, Y) => n(S.children, P, [...T, Y], v)));
3117
+ }
3118
+ return y;
3119
+ }
3120
+ return {
3121
+ safeParse(c) {
3122
+ const m = typeof c == "object" && c !== null ? c : {}, h = [], v = n(l.fields, m, [], h);
3123
+ return h.length > 0 ? { success: !1, error: { issues: h } } : { success: !0, data: v };
3124
+ }
3125
+ };
3126
+ }
2300
3127
  export {
2301
- $t as Calendar,
2302
- ro as CardSelectField,
2303
- io as CheckboxField,
2304
- uo as ChoiceChips,
2305
- co as ComboField,
2306
- Io as CommandDialog,
2307
- nn as DateField,
2308
- fo as DateTimeField,
2309
- wo as EditorPage,
2310
- Bo as ErrorBag,
3128
+ Wt as Calendar,
3129
+ xr as CardSelectField,
3130
+ wr as CheckboxField,
3131
+ $r as ChoiceChips,
3132
+ Vr as ComboField,
3133
+ Yr as CommandDialog,
3134
+ aa as DateField,
3135
+ Wa as DateTimeField,
3136
+ Io as DynamicForm,
3137
+ zr as EditorPage,
3138
+ Bt as ErrorBag,
2311
3139
  ye as Field,
2312
- mo as FileField,
2313
- We as FormErrors,
2314
- ot as FormGroup,
2315
- vo as FormGroupButton,
2316
- po as FormIndent,
2317
- mt as FormRow,
2318
- dn as FormView,
2319
- Lo as GroupEditAction,
2320
- pn as GroupSheet,
2321
- bo as I18nField,
2322
- Uo as LeaveGuardRoot,
2323
- No as MissingLeaveGuardRootError,
2324
- yo as MoneyField,
2325
- ho as MonthYearField,
2326
- ko as MultiSelectField,
2327
- $o as NumberCell,
2328
- Vt as NumberField,
2329
- Ke as OptionList,
2330
- bn as OtpInput,
2331
- xo as PhotoField,
2332
- gn as RecordGroupScope,
2333
- kn as SegmentedField,
2334
- fn as SelectField,
2335
- Co as StepForm,
2336
- kl as StepNavigation,
2337
- Fl as StepProgress,
2338
- wn as SwitchField,
2339
- tn as TextField,
2340
- _n as TextareaField,
2341
- rn as TimeField,
2342
- lt as checkFile,
2343
- To as createFieldGroups,
2344
- Ao as createLeaveGuard,
2345
- me as fieldDefaults,
2346
- jo as fieldKey,
3140
+ Sr as FileField,
3141
+ it as FormErrors,
3142
+ St as FormGroup,
3143
+ Fr as FormGroupButton,
3144
+ qr as FormIndent,
3145
+ Ot as FormRow,
3146
+ hn as FormView,
3147
+ Ir as GroupEditAction,
3148
+ wn as GroupSheet,
3149
+ xl as I18nField,
3150
+ rn as LeaveGuardRoot,
3151
+ Qr as MissingLeaveGuardRootError,
3152
+ Lr as MoneyField,
3153
+ Tr as MonthYearField,
3154
+ jl as MultiSelectField,
3155
+ jr as NumberCell,
3156
+ gt as NumberField,
3157
+ Xe as OptionList,
3158
+ $n as OtpInput,
3159
+ Dr as PhotoField,
3160
+ Vn as RecordGroupScope,
3161
+ vo as RepeatField,
3162
+ Bo as ResourceField,
3163
+ nt as RichTextField,
3164
+ Fn as SegmentedField,
3165
+ na as SelectField,
3166
+ Mr as StepForm,
3167
+ Xl as StepNavigation,
3168
+ ro as StepProgress,
3169
+ sa as SwitchField,
3170
+ Je as TextField,
3171
+ et as TextareaField,
3172
+ yn as TimeField,
3173
+ Rr as buildValidator,
3174
+ $t as checkFile,
3175
+ Ar as createFieldGroups,
3176
+ en as createLeaveGuard,
3177
+ wt as dateTimeValue,
3178
+ za as dateValue,
3179
+ Ct as evaluateVisibility,
3180
+ pe as fieldDefaults,
3181
+ Jr as fieldKey,
2347
3182
  fe as fieldProps,
2348
- qe as focusFirstError,
2349
- Zo as formEditableKey,
2350
- Be as formatBytes,
2351
- Xo as groupOptions,
2352
- Ya as hasUnsupportedCharacters,
2353
- Go as installLeaveGuard,
2354
- Ko as leaveGuardKey,
2355
- Qo as matchOptions,
2356
- Ta as missingLocales,
2357
- qo as provideRecordGroups,
2358
- ln as recentChoicesKey,
2359
- zo as recordGroupsKey,
2360
- go as refineStorableText,
2361
- Ha as unsupportedCharactersCode,
2362
- Oo as useCommand,
2363
- Gt as useDirtySnapshot,
2364
- Qe as useFieldMode,
2365
- Vo as useForm,
2366
- yn as useGroupSheet,
2367
- Do as useHiddenFieldErrors,
2368
- Xe as useLeaveGuard,
2369
- Po as useLeaveGuardContext,
2370
- mn as useOptions,
2371
- Sn as useRecordDialog,
2372
- Ro as useRecordGroups,
2373
- Wo as useResourceForm,
2374
- Et as useSaveChrome,
2375
- fl as useSectionStates,
2376
- no as useSheetDiscardGuard,
2377
- _o as useStepForm,
2378
- so as zodErrorMap
3183
+ Me as focusFirstError,
3184
+ fn as formEditableKey,
3185
+ Le as formatBytes,
3186
+ dn as groupOptions,
3187
+ Vl as hasUnsupportedCharacters,
3188
+ tn as installLeaveGuard,
3189
+ $e as isEmptyValue,
3190
+ an as leaveGuardKey,
3191
+ cn as matchOptions,
3192
+ nl as missingLocales,
3193
+ Cr as now,
3194
+ ja as parseDateValue,
3195
+ Nr as provideRecordGroups,
3196
+ vn as recentChoicesKey,
3197
+ Pr as recordGroupsKey,
3198
+ Br as refineStorableText,
3199
+ Ke as thumbnailUrl,
3200
+ Be as today,
3201
+ wl as unsupportedCharactersCode,
3202
+ Zr as useCommand,
3203
+ va as useDirtySnapshot,
3204
+ qe as useFieldMode,
3205
+ Kr as useForm,
3206
+ Cn as useGroupSheet,
3207
+ Gr as useHiddenFieldErrors,
3208
+ ft as useLeaveGuard,
3209
+ ln as useLeaveGuardContext,
3210
+ _n as useOptions,
3211
+ Bn as useRecordDialog,
3212
+ Hr as useRecordGroups,
3213
+ sn as useResourceForm,
3214
+ ma as useSaveChrome,
3215
+ Pl as useSectionStates,
3216
+ kr as useSheetDiscardGuard,
3217
+ Or as useStepForm,
3218
+ _r as zodErrorMap
2379
3219
  };