treege 3.0.0-beta.8 → 3.0.0-beta.80

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 (216) hide show
  1. package/LICENSE +18 -12
  2. package/README.md +448 -79
  3. package/dist/DefaultSubmitButton-Bk5U_6Qm.js +1819 -0
  4. package/dist/ThemeContext-DeWmeqHK.js +978 -0
  5. package/dist/editor/components/input/ComboboxWithCreate.d.ts +2 -1
  6. package/dist/editor/components/styles/EditorStyles.d.ts +2 -0
  7. package/dist/editor/constants/defaultNode.d.ts +1 -1
  8. package/dist/editor/constants/edgeTypes.d.ts +3 -2
  9. package/dist/editor/constants/inputTypeIcons.d.ts +3 -0
  10. package/dist/editor/constants/nodeSpacing.d.ts +25 -0
  11. package/dist/editor/constants/nodeTypes.d.ts +4 -5
  12. package/dist/editor/context/OpenApiContext.d.ts +79 -0
  13. package/dist/editor/context/TreegeEditorRuntimeProvider.d.ts +78 -0
  14. package/dist/editor/features/TreegeEditor/TreegeEditor.d.ts +1 -1
  15. package/dist/editor/features/TreegeEditor/controls/MiniMapControl.d.ts +6 -0
  16. package/dist/editor/features/TreegeEditor/dialogs/AuthorizeDialog.d.ts +20 -0
  17. package/dist/editor/features/TreegeEditor/dialogs/ChangeNodeTypeDialog.d.ts +2 -0
  18. package/dist/editor/features/TreegeEditor/dialogs/DeleteNodeDialog.d.ts +2 -0
  19. package/dist/editor/features/TreegeEditor/dialogs/HeadersDialog.d.ts +19 -0
  20. package/dist/editor/features/TreegeEditor/dialogs/OpenApiDialog.d.ts +6 -0
  21. package/dist/editor/features/TreegeEditor/edges/ConditionalEdge.d.ts +2 -2
  22. package/dist/editor/features/TreegeEditor/edges/DefaultEdge.d.ts +3 -0
  23. package/dist/editor/features/TreegeEditor/forms/HttpConfigForm.d.ts +4 -1
  24. package/dist/editor/features/TreegeEditor/forms/JsonTemplateEditor.d.ts +13 -0
  25. package/dist/editor/features/TreegeEditor/forms/OptionsMappingFields.d.ts +34 -0
  26. package/dist/editor/features/TreegeEditor/forms/OptionsSourceForm.d.ts +7 -0
  27. package/dist/editor/features/TreegeEditor/forms/SensitiveHeaderWarning.d.ts +13 -0
  28. package/dist/editor/features/TreegeEditor/forms/SubmitConfigForm.d.ts +7 -0
  29. package/dist/editor/features/TreegeEditor/inputs/ApiUrlCombobox.d.ts +20 -0
  30. package/dist/editor/features/TreegeEditor/inputs/ComboboxPattern.d.ts +2 -1
  31. package/dist/editor/features/TreegeEditor/inputs/OptionImageField.d.ts +6 -0
  32. package/dist/editor/features/TreegeEditor/inputs/SelectNodeGroup.d.ts +22 -1
  33. package/dist/editor/features/TreegeEditor/layout/AutoLayout.d.ts +15 -0
  34. package/dist/editor/features/TreegeEditor/listeners/FlowChangeEmitter.d.ts +19 -0
  35. package/dist/editor/features/TreegeEditor/nodes/TreegeNode.d.ts +5 -0
  36. package/dist/editor/features/TreegeEditor/nodes/components/BottomHandleDropdown.d.ts +25 -0
  37. package/dist/editor/features/TreegeEditor/nodes/components/NodeGroupBadge.d.ts +6 -0
  38. package/dist/editor/features/TreegeEditor/nodes/components/NodeImage.d.ts +5 -0
  39. package/dist/editor/features/TreegeEditor/nodes/components/NodeImageButton.d.ts +6 -0
  40. package/dist/editor/features/TreegeEditor/nodes/components/NodeInputPreview.d.ts +12 -0
  41. package/dist/editor/features/TreegeEditor/nodes/components/NodeLabelInput.d.ts +10 -0
  42. package/dist/editor/features/TreegeEditor/nodes/components/NodeMoreMenu.d.ts +6 -0
  43. package/dist/editor/features/TreegeEditor/nodes/components/NodeRequiredButton.d.ts +6 -0
  44. package/dist/editor/features/TreegeEditor/nodes/components/NodeStackOrderButtons.d.ts +6 -0
  45. package/dist/editor/features/TreegeEditor/nodes/components/NodeTypeBadge.d.ts +7 -0
  46. package/dist/editor/features/TreegeEditor/nodes/components/NodeTypePickerMenuContent.d.ts +12 -0
  47. package/dist/editor/features/TreegeEditor/nodes/layout/NodeWrapper.d.ts +4 -2
  48. package/dist/editor/features/TreegeEditor/panel/AIGeneratorDialog.d.ts +16 -0
  49. package/dist/editor/features/TreegeEditor/panel/ActionsPanel.d.ts +7 -2
  50. package/dist/editor/features/TreegeEditor/panel/MultiSelectionPanel.d.ts +7 -0
  51. package/dist/editor/hooks/useAvailableParentFields.d.ts +13 -0
  52. package/dist/editor/hooks/useFlowActions.d.ts +6 -2
  53. package/dist/editor/hooks/useFlowConnections.d.ts +14 -0
  54. package/dist/editor/hooks/useFlowContent.d.ts +16 -0
  55. package/dist/editor/hooks/useHistoryStore.d.ts +26 -0
  56. package/dist/editor/hooks/useIsStackedEdge.d.ts +8 -0
  57. package/dist/editor/hooks/useKeyValueRows.d.ts +15 -0
  58. package/dist/editor/hooks/useNodesSelection.d.ts +5 -5
  59. package/dist/editor/hooks/useStackPosition.d.ts +14 -0
  60. package/dist/editor/hooks/useTranslate.d.ts +1 -1
  61. package/dist/editor/hooks/useUndoRedo.d.ts +31 -0
  62. package/dist/editor/types/ai.d.ts +65 -0
  63. package/dist/editor/types/editor.d.ts +106 -10
  64. package/dist/editor/types/openapi.d.ts +106 -0
  65. package/dist/editor/utils/aiFlowGenerator.d.ts +5 -0
  66. package/dist/editor/utils/cleanEmptyData.d.ts +18 -0
  67. package/dist/editor/utils/cleanNodeConfig.d.ts +5 -0
  68. package/dist/editor/utils/dagreLayout.d.ts +8 -0
  69. package/dist/editor/utils/edge.d.ts +50 -0
  70. package/dist/editor/utils/groupColor.d.ts +14 -0
  71. package/dist/editor/utils/image.d.ts +7 -0
  72. package/dist/editor/utils/inputTypeIcon.d.ts +6 -0
  73. package/dist/editor/utils/jsonBindTarget.d.ts +15 -0
  74. package/dist/editor/utils/openApiPayload.d.ts +12 -0
  75. package/dist/editor/utils/openapi.d.ts +35 -0
  76. package/dist/editor/utils/sensitiveHeaders.d.ts +20 -0
  77. package/dist/editor/utils/stackPositionIndex.d.ts +9 -0
  78. package/dist/editor-Dw_ODEe1.js +6507 -0
  79. package/dist/editor.js +3 -7
  80. package/dist/main.js +6 -52
  81. package/dist/renderer/context/TreegeRenderRuntimeProvider.d.ts +135 -0
  82. package/dist/renderer/context/TreegeRendererProvider.d.ts +15 -0
  83. package/dist/renderer/features/TreegeRenderer/native/TreegeRenderer.d.ts +19 -11
  84. package/dist/renderer/features/TreegeRenderer/native/components/DefaultFormWrapper.d.ts +7 -7
  85. package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputLabel.d.ts +10 -0
  86. package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputWrapper.d.ts +9 -0
  87. package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputs.d.ts +20 -15
  88. package/dist/renderer/features/TreegeRenderer/native/components/DefaultLoadingSkeleton.d.ts +8 -0
  89. package/dist/renderer/features/TreegeRenderer/native/components/DefaultStep.d.ts +3 -0
  90. package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButton.d.ts +9 -7
  91. package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButtonWrapper.d.ts +11 -0
  92. package/dist/renderer/features/TreegeRenderer/native/components/DefaultUI.d.ts +8 -7
  93. package/dist/renderer/features/TreegeRenderer/native/components/DependencyHint.d.ts +15 -0
  94. package/dist/renderer/features/TreegeRenderer/native/components/OptionItemContent.d.ts +17 -0
  95. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAddressInput.d.ts +3 -0
  96. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAutocompleteInput.d.ts +3 -0
  97. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultCheckboxInput.d.ts +3 -0
  98. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateInput.d.ts +3 -0
  99. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateRangeInput.d.ts +3 -0
  100. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultFileInput.d.ts +3 -0
  101. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHiddenInput.d.ts +3 -0
  102. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHttpInput.d.ts +3 -0
  103. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultNumberInput.d.ts +3 -0
  104. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultPasswordInput.d.ts +3 -0
  105. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultRadioInput.d.ts +3 -0
  106. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSelectInput.d.ts +3 -0
  107. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSubmitInput.d.ts +11 -0
  108. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSwitchInput.d.ts +3 -0
  109. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextInput.d.ts +3 -0
  110. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextareaInput.d.ts +3 -0
  111. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeInput.d.ts +3 -0
  112. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeRangeInput.d.ts +3 -0
  113. package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +97 -24
  114. package/dist/renderer/features/TreegeRenderer/web/TreegeRenderer.d.ts +1 -1
  115. package/dist/renderer/features/TreegeRenderer/web/components/DefaultFormWrapper.d.ts +3 -2
  116. package/dist/renderer/features/TreegeRenderer/web/components/DefaultInputLabel.d.ts +9 -0
  117. package/dist/renderer/features/TreegeRenderer/web/components/DefaultInputWrapper.d.ts +9 -0
  118. package/dist/renderer/features/TreegeRenderer/web/components/DefaultLoadingSkeleton.d.ts +7 -0
  119. package/dist/renderer/features/TreegeRenderer/web/components/DefaultStep.d.ts +3 -0
  120. package/dist/renderer/features/TreegeRenderer/web/components/DefaultSubmitButton.d.ts +5 -1
  121. package/dist/renderer/features/TreegeRenderer/web/components/DependencyHint.d.ts +22 -0
  122. package/dist/renderer/features/TreegeRenderer/web/components/OptionItemContent.d.ts +17 -0
  123. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.d.ts +1 -1
  124. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAutocompleteInput.d.ts +1 -1
  125. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts +1 -1
  126. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.d.ts +1 -1
  127. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateRangeInput.d.ts +1 -1
  128. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultFileInput.d.ts +1 -1
  129. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHiddenInput.d.ts +1 -1
  130. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHttpInput.d.ts +1 -1
  131. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultNumberInput.d.ts +1 -1
  132. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultPasswordInput.d.ts +1 -1
  133. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.d.ts +1 -1
  134. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSelectInput.d.ts +1 -1
  135. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSubmitInput.d.ts +11 -0
  136. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.d.ts +1 -1
  137. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.d.ts +1 -1
  138. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextInput.d.ts +1 -1
  139. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeInput.d.ts +1 -1
  140. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeRangeInput.d.ts +1 -1
  141. package/dist/renderer/features/TreegeRenderer/web/components/styles/RendererStyles.d.ts +2 -0
  142. package/dist/renderer/hooks/useInputOptions.d.ts +28 -0
  143. package/dist/renderer/hooks/useRenderNode.d.ts +62 -0
  144. package/dist/renderer/hooks/useSubmitHandler.d.ts +36 -0
  145. package/dist/renderer/hooks/useTranslate.d.ts +7 -5
  146. package/dist/renderer/index.d.ts +5 -2
  147. package/dist/renderer/index.native.d.ts +20 -0
  148. package/dist/renderer/types/renderer.d.ts +316 -42
  149. package/dist/renderer/utils/flow.d.ts +1 -18
  150. package/dist/renderer/utils/form.d.ts +54 -2
  151. package/dist/renderer/utils/http.d.ts +177 -0
  152. package/dist/renderer/utils/jsonTemplate.d.ts +30 -0
  153. package/dist/renderer/utils/node.d.ts +29 -1
  154. package/dist/renderer/utils/sanitize.d.ts +85 -0
  155. package/dist/renderer/utils/sanitize.native.d.ts +69 -0
  156. package/dist/renderer/utils/step.d.ts +27 -0
  157. package/dist/renderer/utils/submit.d.ts +49 -0
  158. package/dist/renderer/utils/templateDependencies.d.ts +17 -0
  159. package/dist/renderer-CN83AtIp.js +256 -0
  160. package/dist/renderer-native.d.ts +2 -0
  161. package/dist/renderer-native.js +3703 -0
  162. package/dist/renderer.js +5 -45
  163. package/dist/shared/components/ui/badge.d.ts +2 -2
  164. package/dist/shared/components/ui/button.d.ts +3 -3
  165. package/dist/shared/components/ui/collapsible.d.ts +1 -1
  166. package/dist/shared/components/ui/command.d.ts +1 -1
  167. package/dist/shared/components/ui/dropdown-menu.d.ts +1 -1
  168. package/dist/shared/components/ui/field.d.ts +24 -0
  169. package/dist/shared/components/ui/form.d.ts +1 -1
  170. package/dist/shared/components/ui/item.d.ts +23 -0
  171. package/dist/shared/components/ui/popover.d.ts +10 -2
  172. package/dist/shared/components/ui/select.d.ts +3 -1
  173. package/dist/shared/components/ui/sheet.d.ts +1 -1
  174. package/dist/shared/components/ui/skeleton.d.ts +3 -0
  175. package/dist/shared/components/ui/toggle-group.d.ts +7 -0
  176. package/dist/shared/components/ui/toggle.d.ts +9 -0
  177. package/dist/shared/components/ui/tooltip.d.ts +1 -1
  178. package/dist/shared/constants/colors.d.ts +45 -0
  179. package/dist/shared/constants/inputType.d.ts +6 -0
  180. package/dist/shared/constants/node.d.ts +0 -1
  181. package/dist/shared/context/PortalContainerContext.d.ts +5 -0
  182. package/dist/shared/context/ThemeContext.d.ts +2 -0
  183. package/dist/shared/context/ThemeContext.native.d.ts +22 -0
  184. package/dist/shared/hooks/useMediaQuery.d.ts +12 -0
  185. package/dist/shared/hooks/useThemeColors.d.ts +37 -0
  186. package/dist/shared/locales/ar.json.d.ts +258 -19
  187. package/dist/shared/locales/de.json.d.ts +259 -20
  188. package/dist/shared/locales/en.json.d.ts +260 -21
  189. package/dist/shared/locales/es.json.d.ts +259 -20
  190. package/dist/shared/locales/fr.json.d.ts +259 -20
  191. package/dist/shared/locales/it.json.d.ts +259 -20
  192. package/dist/shared/locales/pt.json.d.ts +259 -20
  193. package/dist/shared/types/edge.d.ts +6 -0
  194. package/dist/shared/types/node.d.ts +153 -18
  195. package/dist/shared/utils/httpRecord.d.ts +20 -0
  196. package/dist/shared/utils/inputTypeGuards.d.ts +7 -0
  197. package/dist/shared/utils/nodeTypeGuards.d.ts +1 -6
  198. package/dist/shared/utils/normalizeLabel.d.ts +21 -0
  199. package/dist/useRenderNode-BZ7fZJxT.js +527 -0
  200. package/package.json +54 -22
  201. package/dist/ThemeContext-BIvs8Kw-.js +0 -758
  202. package/dist/TreegeEditor-Lv5Tn9_F.js +0 -2152
  203. package/dist/TreegeRenderer-D3EvsEfJ.js +0 -1413
  204. package/dist/editor/context/TreegeEditorContext.d.ts +0 -12
  205. package/dist/editor/features/TreegeEditor/forms/FlowNodeForm.d.ts +0 -2
  206. package/dist/editor/features/TreegeEditor/inputs/SelectInputType.d.ts +0 -7
  207. package/dist/editor/features/TreegeEditor/nodes/FlowNode.d.ts +0 -6
  208. package/dist/editor/features/TreegeEditor/nodes/GroupNode.d.ts +0 -6
  209. package/dist/editor/features/TreegeEditor/nodes/InputNode.d.ts +0 -6
  210. package/dist/editor/features/TreegeEditor/nodes/UINode.d.ts +0 -6
  211. package/dist/editor/hooks/useEdgesSelection.d.ts +0 -11
  212. package/dist/renderer/context/TreegeConfigContext.d.ts +0 -39
  213. package/dist/renderer/context/TreegeRendererContext.d.ts +0 -25
  214. package/dist/renderer/features/TreegeRenderer/native/components/DefaultGroup.d.ts +0 -7
  215. package/dist/renderer/features/TreegeRenderer/web/components/DefaultGroup.d.ts +0 -6
  216. /package/dist/editor/components/{data-display/logo.d.ts → branding/Logo.d.ts} +0 -0
@@ -0,0 +1,3703 @@
1
+ import { A as e, B as t, C as n, F as r, H as i, O as a, P as o, T as s, _ as c, a as l, b as u, c as d, g as f, h as p, i as m, j as h, k as g, l as _, m as v, n as y, o as b, r as x, s as S, t as C, x as w } from "./ThemeContext-DeWmeqHK.js";
2
+ import { a as T, c as E, i as D, l as O, n as k, o as A, r as j, s as ee, t as te } from "./useRenderNode-BZ7fZJxT.js";
3
+ import { useCallback as ne, useEffect as M, useMemo as re, useRef as N, useState as P } from "react";
4
+ import { Fragment as ie, jsx as F, jsxs as I } from "react/jsx-runtime";
5
+ import { ActivityIndicator as ae, Alert as oe, Animated as se, FlatList as ce, Image as L, Modal as le, ScrollView as R, StyleSheet as z, Switch as ue, Text as B, TextInput as de, TouchableOpacity as V, View as H } from "react-native";
6
+ //#region src/renderer/features/TreegeRenderer/native/components/DefaultFormWrapper.tsx
7
+ var fe = ({ children: e }) => /* @__PURE__ */ F(H, {
8
+ style: pe.container,
9
+ children: e
10
+ }), pe = z.create({ container: { padding: 16 } }), me = ({ label: e, required: t, style: n }) => {
11
+ let { colors: r } = y();
12
+ return e ? /* @__PURE__ */ I(B, {
13
+ style: [
14
+ he.label,
15
+ { color: r.textSecondary },
16
+ n
17
+ ],
18
+ children: [e, t && /* @__PURE__ */ F(B, {
19
+ style: { color: r.error },
20
+ children: "*"
21
+ })]
22
+ }) : null;
23
+ }, he = z.create({ label: {
24
+ fontSize: 14,
25
+ fontWeight: "500",
26
+ marginBottom: 8
27
+ } }), ge = async (e, t) => {
28
+ if (!e || e.trim().length < 3) return [];
29
+ try {
30
+ let n = await fetch(`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(e)}&format=jsonv2&addressdetails=1&limit=5`, { headers: {
31
+ Accept: "application/json",
32
+ "User-Agent": "Treege Renderer",
33
+ ...t && { "Accept-Language": t }
34
+ } });
35
+ return n.ok ? (await n.json()).map((e) => ({
36
+ label: e.display_name,
37
+ value: e.display_name
38
+ })) : [];
39
+ } catch (e) {
40
+ return console.error("Nominatim fetch error:", e), [];
41
+ }
42
+ }, _e = async (e, t) => {
43
+ if (!e || e.trim().length < 3) return [];
44
+ try {
45
+ let n = await fetch(`https://maps.googleapis.com/maps/api/place/autocomplete/json?input=${encodeURIComponent(e)}&key=${t}`);
46
+ if (!n.ok) return console.warn("Google Places API request failed:", n.status), [];
47
+ let r = await n.json();
48
+ return r.status !== "OK" && r.status !== "ZERO_RESULTS" ? (console.warn("Google Places API status:", r.status), []) : (r.predictions || []).map((e) => ({
49
+ label: e.description,
50
+ value: e.description
51
+ }));
52
+ } catch (e) {
53
+ return console.error("Google Places fetch error:", e), [];
54
+ }
55
+ }, ve = ({ field: e, extra: t }) => {
56
+ let [n, i] = P(""), [a, o] = P([]), [s, c] = P(!1), [l, u] = P(!1), { value: d, placeholder: f, id: p, name: m } = e, { InputLabel: g, node: _, setValue: v, error: b, label: x, helperText: S } = t, { language: C, googleApiKey: w } = r(), T = h(), { colors: E } = y(), D = ne((e) => {
57
+ v(e.value), i(""), c(!1), o([]);
58
+ }, [v]), O = () => {
59
+ c(!1);
60
+ };
61
+ return M(() => {
62
+ if (!n || n.trim().length < 3) {
63
+ o([]), u(!1);
64
+ return;
65
+ }
66
+ u(!0);
67
+ let e = setTimeout(async () => {
68
+ o(w ? await _e(n, w) : await ge(n, C)), u(!1);
69
+ }, 300);
70
+ return () => {
71
+ clearTimeout(e), u(!1);
72
+ };
73
+ }, [
74
+ n,
75
+ C,
76
+ w
77
+ ]), /* @__PURE__ */ I(H, {
78
+ style: U.container,
79
+ children: [
80
+ /* @__PURE__ */ F(g, {
81
+ label: x,
82
+ required: _.data.required
83
+ }),
84
+ /* @__PURE__ */ I(V, {
85
+ style: [
86
+ U.trigger,
87
+ {
88
+ backgroundColor: E.input,
89
+ borderColor: E.border
90
+ },
91
+ b && { borderColor: E.error }
92
+ ],
93
+ onPress: () => c(!0),
94
+ activeOpacity: .7,
95
+ children: [/* @__PURE__ */ F(B, {
96
+ style: [
97
+ U.triggerText,
98
+ { color: E.text },
99
+ !d && { color: E.textMuted }
100
+ ],
101
+ numberOfLines: 1,
102
+ children: d || f || T("renderer.defaultAddressInput.enterAddress")
103
+ }), /* @__PURE__ */ F(B, {
104
+ style: U.icon,
105
+ children: "📍"
106
+ })]
107
+ }),
108
+ /* @__PURE__ */ F(le, {
109
+ visible: s,
110
+ transparent: !0,
111
+ animationType: "fade",
112
+ onRequestClose: O,
113
+ children: /* @__PURE__ */ F(V, {
114
+ style: U.modalOverlay,
115
+ activeOpacity: 1,
116
+ onPress: O,
117
+ children: /* @__PURE__ */ I(V, {
118
+ style: [U.modalContent, { backgroundColor: E.card }],
119
+ activeOpacity: 1,
120
+ onPress: () => {},
121
+ children: [
122
+ /* @__PURE__ */ I(H, {
123
+ style: [U.modalHeader, { borderBottomColor: E.separator }],
124
+ children: [/* @__PURE__ */ F(B, {
125
+ style: [U.modalTitle, { color: E.text }],
126
+ children: x || f || T("renderer.defaultAddressInput.enterAddress")
127
+ }), /* @__PURE__ */ F(V, {
128
+ onPress: O,
129
+ children: /* @__PURE__ */ F(B, {
130
+ style: [U.closeButton, { color: E.textMuted }],
131
+ children: "✕"
132
+ })
133
+ })]
134
+ }),
135
+ /* @__PURE__ */ I(H, {
136
+ style: U.searchContainer,
137
+ children: [/* @__PURE__ */ F(de, {
138
+ style: [U.searchInput, {
139
+ backgroundColor: E.muted,
140
+ borderColor: E.border,
141
+ color: E.text
142
+ }],
143
+ placeholder: f || T("renderer.defaultAddressInput.enterAddress"),
144
+ placeholderTextColor: E.textMuted,
145
+ value: n,
146
+ onChangeText: i,
147
+ autoFocus: !0,
148
+ autoCapitalize: "none",
149
+ autoCorrect: !1
150
+ }), l && /* @__PURE__ */ F(ae, {
151
+ size: "small",
152
+ color: E.primary,
153
+ style: U.searchLoader
154
+ })]
155
+ }),
156
+ l ? /* @__PURE__ */ I(H, {
157
+ style: U.loadingContainer,
158
+ children: [/* @__PURE__ */ F(ae, {
159
+ size: "small",
160
+ color: E.primary
161
+ }), /* @__PURE__ */ F(B, {
162
+ style: [U.loadingText, { color: E.textMuted }],
163
+ children: T("renderer.defaultAddressInput.searching")
164
+ })]
165
+ }) : /* @__PURE__ */ F(ce, {
166
+ data: a,
167
+ keyExtractor: (e, t) => t.toString(),
168
+ style: U.suggestionsList,
169
+ contentContainerStyle: U.suggestionsListContent,
170
+ keyboardShouldPersistTaps: "handled",
171
+ ListEmptyComponent: n.length >= 3 ? /* @__PURE__ */ F(H, {
172
+ style: U.emptyContainer,
173
+ children: /* @__PURE__ */ F(B, {
174
+ style: [U.emptyText, { color: E.textMuted }],
175
+ children: T("renderer.defaultAddressInput.noAddressesFound")
176
+ })
177
+ }) : /* @__PURE__ */ F(H, {
178
+ style: U.emptyContainer,
179
+ children: /* @__PURE__ */ F(B, {
180
+ style: [U.emptyText, { color: E.textMuted }],
181
+ children: T("renderer.defaultAddressInput.typeMinChars")
182
+ })
183
+ }),
184
+ renderItem: ({ item: e }) => /* @__PURE__ */ I(V, {
185
+ style: U.suggestionItem,
186
+ onPress: () => D(e),
187
+ activeOpacity: .7,
188
+ children: [/* @__PURE__ */ F(B, {
189
+ style: U.suggestionIcon,
190
+ children: "📍"
191
+ }), /* @__PURE__ */ F(B, {
192
+ style: [U.suggestionText, { color: E.text }],
193
+ numberOfLines: 2,
194
+ children: e.label
195
+ })]
196
+ })
197
+ })
198
+ ]
199
+ })
200
+ })
201
+ }),
202
+ b && /* @__PURE__ */ F(B, {
203
+ style: [U.error, { color: E.error }],
204
+ children: b
205
+ }),
206
+ S && !b && /* @__PURE__ */ F(B, {
207
+ style: [U.helperText, { color: E.textMuted }],
208
+ children: S
209
+ })
210
+ ]
211
+ });
212
+ }, U = z.create({
213
+ closeButton: {
214
+ fontSize: 24,
215
+ fontWeight: "300"
216
+ },
217
+ container: { marginBottom: 16 },
218
+ emptyContainer: {
219
+ alignItems: "center",
220
+ paddingVertical: 24
221
+ },
222
+ emptyText: { fontSize: 14 },
223
+ error: {
224
+ fontSize: 12,
225
+ marginTop: 4
226
+ },
227
+ helperText: {
228
+ fontSize: 12,
229
+ marginTop: 4
230
+ },
231
+ icon: { fontSize: 16 },
232
+ loadingContainer: {
233
+ alignItems: "center",
234
+ flexDirection: "row",
235
+ justifyContent: "center",
236
+ paddingVertical: 24
237
+ },
238
+ loadingText: {
239
+ fontSize: 14,
240
+ marginLeft: 8
241
+ },
242
+ modalContent: {
243
+ borderRadius: 12,
244
+ maxHeight: "80%",
245
+ padding: 16,
246
+ width: "90%"
247
+ },
248
+ modalHeader: {
249
+ alignItems: "center",
250
+ borderBottomWidth: 1,
251
+ flexDirection: "row",
252
+ justifyContent: "space-between",
253
+ marginBottom: 12,
254
+ paddingBottom: 12
255
+ },
256
+ modalOverlay: {
257
+ alignItems: "center",
258
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
259
+ flex: 1,
260
+ justifyContent: "center"
261
+ },
262
+ modalTitle: {
263
+ fontSize: 18,
264
+ fontWeight: "600"
265
+ },
266
+ searchContainer: {
267
+ marginBottom: 12,
268
+ position: "relative"
269
+ },
270
+ searchInput: {
271
+ borderRadius: 6,
272
+ borderWidth: 1,
273
+ fontSize: 14,
274
+ paddingHorizontal: 12,
275
+ paddingRight: 40,
276
+ paddingVertical: 10
277
+ },
278
+ searchLoader: {
279
+ position: "absolute",
280
+ right: 12,
281
+ top: "50%",
282
+ transform: [{ translateY: -10 }]
283
+ },
284
+ suggestionIcon: {
285
+ fontSize: 16,
286
+ marginRight: 8
287
+ },
288
+ suggestionItem: {
289
+ alignItems: "center",
290
+ borderRadius: 6,
291
+ flexDirection: "row",
292
+ paddingHorizontal: 12,
293
+ paddingVertical: 12
294
+ },
295
+ suggestionsList: {
296
+ flexGrow: 0,
297
+ flexShrink: 1
298
+ },
299
+ suggestionsListContent: { flexGrow: 0 },
300
+ suggestionText: {
301
+ flex: 1,
302
+ fontSize: 14
303
+ },
304
+ trigger: {
305
+ alignItems: "center",
306
+ borderRadius: 6,
307
+ borderWidth: 1,
308
+ flexDirection: "row",
309
+ justifyContent: "space-between",
310
+ paddingHorizontal: 12,
311
+ paddingVertical: 10
312
+ },
313
+ triggerText: {
314
+ flex: 1,
315
+ fontSize: 14
316
+ }
317
+ }), ye = ({ label: e, description: t, image: n, disabled: r }) => {
318
+ let { colors: i } = y();
319
+ return /* @__PURE__ */ I(H, {
320
+ style: be.content,
321
+ children: [n ? /* @__PURE__ */ F(L, {
322
+ source: { uri: n },
323
+ style: be.image
324
+ }) : null, /* @__PURE__ */ I(H, {
325
+ style: be.textWrapper,
326
+ children: [/* @__PURE__ */ F(B, {
327
+ style: [be.label, { color: r ? i.textMuted : i.text }],
328
+ children: e
329
+ }), t ? /* @__PURE__ */ F(B, {
330
+ style: [be.description, { color: i.textMuted }],
331
+ children: t
332
+ }) : null]
333
+ })]
334
+ });
335
+ }, be = z.create({
336
+ content: {
337
+ alignItems: "center",
338
+ flex: 1,
339
+ flexDirection: "row",
340
+ gap: 12
341
+ },
342
+ description: {
343
+ fontSize: 12,
344
+ marginTop: 2
345
+ },
346
+ image: {
347
+ borderRadius: 6,
348
+ height: 40,
349
+ width: 40
350
+ },
351
+ label: { fontSize: 14 },
352
+ textWrapper: { flex: 1 }
353
+ }), xe = ({ field: e, extra: t }) => {
354
+ let [n, r] = P(!1), [i, a] = P(""), { value: o, placeholder: s } = e, { InputLabel: c, node: l, setValue: u, error: d, label: f, helperText: p } = t, m = h(), { colors: g } = y(), _ = l.data.options || [], v = _.find((e) => e.value === o), b = re(() => {
355
+ if (!i.trim()) return _;
356
+ let e = i.toLowerCase();
357
+ return _.filter((t) => m(t.label).toLowerCase().includes(e) || t.value.toLowerCase().includes(e));
358
+ }, [
359
+ _,
360
+ i,
361
+ m
362
+ ]), x = (e) => {
363
+ u(e === o ? "" : e), r(!1), a("");
364
+ }, S = () => {
365
+ r(!1), a("");
366
+ };
367
+ return /* @__PURE__ */ I(H, {
368
+ style: W.container,
369
+ children: [
370
+ /* @__PURE__ */ F(c, {
371
+ label: f,
372
+ required: l.data.required
373
+ }),
374
+ /* @__PURE__ */ I(V, {
375
+ style: [
376
+ W.trigger,
377
+ {
378
+ backgroundColor: g.input,
379
+ borderColor: g.border
380
+ },
381
+ d && { borderColor: g.error }
382
+ ],
383
+ onPress: () => r(!0),
384
+ activeOpacity: .7,
385
+ children: [
386
+ /* @__PURE__ */ F(B, {
387
+ style: [
388
+ W.triggerText,
389
+ { color: g.text },
390
+ !o && { color: g.textMuted }
391
+ ],
392
+ numberOfLines: 1,
393
+ children: o && v ? m(v.label) : s || m("renderer.defaultAutocompleteInput.selectOption")
394
+ }),
395
+ o ? /* @__PURE__ */ F(V, {
396
+ onPress: () => u(""),
397
+ hitSlop: {
398
+ bottom: 8,
399
+ left: 8,
400
+ right: 8,
401
+ top: 8
402
+ },
403
+ style: W.clearButton,
404
+ children: /* @__PURE__ */ F(B, {
405
+ style: [W.clearIcon, { color: g.textMuted }],
406
+ children: "✕"
407
+ })
408
+ }) : null,
409
+ /* @__PURE__ */ F(B, {
410
+ style: [W.arrow, { color: g.textMuted }],
411
+ children: "▼"
412
+ })
413
+ ]
414
+ }),
415
+ /* @__PURE__ */ F(le, {
416
+ visible: n,
417
+ transparent: !0,
418
+ animationType: "fade",
419
+ onRequestClose: S,
420
+ children: /* @__PURE__ */ F(V, {
421
+ style: W.modalOverlay,
422
+ activeOpacity: 1,
423
+ onPress: S,
424
+ children: /* @__PURE__ */ I(V, {
425
+ style: [W.modalContent, { backgroundColor: g.card }],
426
+ activeOpacity: 1,
427
+ onPress: () => {},
428
+ children: [
429
+ /* @__PURE__ */ I(H, {
430
+ style: [W.modalHeader, { borderBottomColor: g.separator }],
431
+ children: [/* @__PURE__ */ F(B, {
432
+ style: [W.modalTitle, { color: g.text }],
433
+ children: f || s || m("renderer.defaultAutocompleteInput.selectOption")
434
+ }), /* @__PURE__ */ F(V, {
435
+ onPress: S,
436
+ children: /* @__PURE__ */ F(B, {
437
+ style: [W.closeButton, { color: g.textMuted }],
438
+ children: "✕"
439
+ })
440
+ })]
441
+ }),
442
+ /* @__PURE__ */ F(H, {
443
+ style: W.searchContainer,
444
+ children: /* @__PURE__ */ F(de, {
445
+ style: [W.searchInput, {
446
+ backgroundColor: g.muted,
447
+ borderColor: g.border,
448
+ color: g.text
449
+ }],
450
+ placeholder: s || m("renderer.defaultAutocompleteInput.search"),
451
+ placeholderTextColor: g.textMuted,
452
+ value: i,
453
+ onChangeText: a,
454
+ autoFocus: !0,
455
+ autoCapitalize: "none",
456
+ autoCorrect: !1
457
+ })
458
+ }),
459
+ /* @__PURE__ */ F(ce, {
460
+ data: b,
461
+ keyExtractor: (e) => e.value,
462
+ style: W.optionsList,
463
+ contentContainerStyle: W.optionsListContent,
464
+ ListEmptyComponent: /* @__PURE__ */ F(H, {
465
+ style: W.emptyContainer,
466
+ children: /* @__PURE__ */ F(B, {
467
+ style: [W.emptyText, { color: g.textMuted }],
468
+ children: m("renderer.defaultAutocompleteInput.noResults")
469
+ })
470
+ }),
471
+ renderItem: ({ item: e }) => {
472
+ let t = e.value === o;
473
+ return /* @__PURE__ */ I(V, {
474
+ style: [W.option, t && { backgroundColor: g.primaryLight }],
475
+ onPress: () => x(e.value),
476
+ disabled: e.disabled,
477
+ activeOpacity: .7,
478
+ children: [/* @__PURE__ */ F(ye, {
479
+ label: m(e.label) || e.value,
480
+ description: m(e.description),
481
+ image: e.image,
482
+ disabled: e.disabled
483
+ }), t && /* @__PURE__ */ F(B, {
484
+ style: [W.checkmark, { color: g.primary }],
485
+ children: "✓"
486
+ })]
487
+ });
488
+ }
489
+ })
490
+ ]
491
+ })
492
+ })
493
+ }),
494
+ d && /* @__PURE__ */ F(B, {
495
+ style: [W.error, { color: g.error }],
496
+ children: d
497
+ }),
498
+ p && !d && /* @__PURE__ */ F(B, {
499
+ style: [W.helperText, { color: g.textMuted }],
500
+ children: p
501
+ })
502
+ ]
503
+ });
504
+ }, W = z.create({
505
+ arrow: { fontSize: 12 },
506
+ checkmark: {
507
+ fontSize: 18,
508
+ fontWeight: "700"
509
+ },
510
+ clearButton: {
511
+ marginRight: 8,
512
+ paddingHorizontal: 2
513
+ },
514
+ clearIcon: { fontSize: 14 },
515
+ closeButton: {
516
+ fontSize: 24,
517
+ fontWeight: "300"
518
+ },
519
+ container: { marginBottom: 16 },
520
+ emptyContainer: {
521
+ alignItems: "center",
522
+ paddingVertical: 24
523
+ },
524
+ emptyText: { fontSize: 14 },
525
+ error: {
526
+ fontSize: 12,
527
+ marginTop: 4
528
+ },
529
+ helperText: {
530
+ fontSize: 12,
531
+ marginTop: 4
532
+ },
533
+ modalContent: {
534
+ borderRadius: 12,
535
+ maxHeight: "80%",
536
+ padding: 16,
537
+ width: "90%"
538
+ },
539
+ modalHeader: {
540
+ alignItems: "center",
541
+ borderBottomWidth: 1,
542
+ flexDirection: "row",
543
+ justifyContent: "space-between",
544
+ marginBottom: 12,
545
+ paddingBottom: 12
546
+ },
547
+ modalOverlay: {
548
+ alignItems: "center",
549
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
550
+ flex: 1,
551
+ justifyContent: "center"
552
+ },
553
+ modalTitle: {
554
+ fontSize: 18,
555
+ fontWeight: "600"
556
+ },
557
+ option: {
558
+ alignItems: "center",
559
+ borderRadius: 6,
560
+ flexDirection: "row",
561
+ justifyContent: "space-between",
562
+ paddingHorizontal: 12,
563
+ paddingVertical: 12
564
+ },
565
+ optionsList: {
566
+ flexGrow: 0,
567
+ flexShrink: 1
568
+ },
569
+ optionsListContent: { flexGrow: 0 },
570
+ searchContainer: { marginBottom: 12 },
571
+ searchInput: {
572
+ borderRadius: 6,
573
+ borderWidth: 1,
574
+ fontSize: 14,
575
+ paddingHorizontal: 12,
576
+ paddingVertical: 10
577
+ },
578
+ trigger: {
579
+ alignItems: "center",
580
+ borderRadius: 6,
581
+ borderWidth: 1,
582
+ flexDirection: "row",
583
+ justifyContent: "space-between",
584
+ paddingHorizontal: 12,
585
+ paddingVertical: 10
586
+ },
587
+ triggerText: {
588
+ flex: 1,
589
+ fontSize: 14
590
+ }
591
+ }), Se = ({ field: e, extra: t }) => {
592
+ let n = h(), { value: r } = e, { InputLabel: i, node: a, setValue: o, error: s, label: c, helperText: l } = t, { colors: u } = y(), d = a.data.options || [], f = d.length > 0, p = Array.isArray(r) ? r : [], m = typeof r == "boolean" ? r : !1, g = (e) => {
593
+ o(f ? p.includes(e) ? p.filter((t) => t !== e) : [...p, e] : !m);
594
+ }, _ = (e) => f ? p.includes(e) : m;
595
+ return /* @__PURE__ */ I(H, {
596
+ style: G.container,
597
+ children: [
598
+ /* @__PURE__ */ F(i, {
599
+ label: c,
600
+ required: a.data.required
601
+ }),
602
+ d.length > 0 ? d.map((e) => {
603
+ let t = n(e.description);
604
+ return /* @__PURE__ */ I(V, {
605
+ style: G.option,
606
+ onPress: () => g(e.value),
607
+ disabled: e.disabled,
608
+ activeOpacity: .7,
609
+ accessible: !0,
610
+ accessibilityRole: "checkbox",
611
+ accessibilityState: {
612
+ checked: _(e.value),
613
+ disabled: e.disabled
614
+ },
615
+ accessibilityLabel: n(e.label) || e.value,
616
+ children: [
617
+ /* @__PURE__ */ F(H, {
618
+ style: [
619
+ G.checkbox,
620
+ {
621
+ backgroundColor: u.input,
622
+ borderColor: u.border
623
+ },
624
+ _(e.value) && {
625
+ backgroundColor: u.primary,
626
+ borderColor: u.primary
627
+ }
628
+ ],
629
+ children: _(e.value) && /* @__PURE__ */ F(B, {
630
+ style: G.checkmark,
631
+ children: "✓"
632
+ })
633
+ }),
634
+ e.image ? /* @__PURE__ */ F(L, {
635
+ source: { uri: e.image },
636
+ style: G.image
637
+ }) : null,
638
+ /* @__PURE__ */ I(H, {
639
+ style: G.optionTextContainer,
640
+ children: [/* @__PURE__ */ F(B, {
641
+ style: [
642
+ G.optionLabel,
643
+ { color: u.textSecondary },
644
+ e.disabled && { color: u.textMuted }
645
+ ],
646
+ children: n(e.label) || e.value
647
+ }), t && /* @__PURE__ */ F(B, {
648
+ style: [G.optionDescription, { color: u.textMuted }],
649
+ children: t
650
+ })]
651
+ })
652
+ ]
653
+ }, e.value);
654
+ }) : /* @__PURE__ */ I(V, {
655
+ style: G.option,
656
+ onPress: () => g(""),
657
+ activeOpacity: .7,
658
+ accessible: !0,
659
+ accessibilityRole: "checkbox",
660
+ accessibilityState: { checked: m },
661
+ accessibilityLabel: c || a.data.name,
662
+ children: [/* @__PURE__ */ F(H, {
663
+ style: [
664
+ G.checkbox,
665
+ {
666
+ backgroundColor: u.input,
667
+ borderColor: u.border
668
+ },
669
+ m && {
670
+ backgroundColor: u.primary,
671
+ borderColor: u.primary
672
+ }
673
+ ],
674
+ children: m && /* @__PURE__ */ F(B, {
675
+ style: G.checkmark,
676
+ children: "✓"
677
+ })
678
+ }), c && /* @__PURE__ */ F(B, {
679
+ style: [G.optionLabel, { color: u.textSecondary }],
680
+ children: c
681
+ })]
682
+ }),
683
+ s && /* @__PURE__ */ F(B, {
684
+ style: [G.error, { color: u.error }],
685
+ children: s
686
+ }),
687
+ l && !s && /* @__PURE__ */ F(B, {
688
+ style: [G.helperText, { color: u.textMuted }],
689
+ children: l
690
+ })
691
+ ]
692
+ });
693
+ }, G = z.create({
694
+ checkbox: {
695
+ alignItems: "center",
696
+ borderRadius: 4,
697
+ borderWidth: 2,
698
+ height: 20,
699
+ justifyContent: "center",
700
+ marginRight: 12,
701
+ width: 20
702
+ },
703
+ checkmark: {
704
+ color: "#FFFFFF",
705
+ fontSize: 14,
706
+ fontWeight: "700"
707
+ },
708
+ container: { marginBottom: 16 },
709
+ error: {
710
+ fontSize: 12,
711
+ marginTop: 4
712
+ },
713
+ helperText: {
714
+ fontSize: 12,
715
+ marginTop: 4
716
+ },
717
+ image: {
718
+ borderRadius: 4,
719
+ height: 32,
720
+ marginRight: 8,
721
+ width: 32
722
+ },
723
+ option: {
724
+ alignItems: "flex-start",
725
+ flexDirection: "row",
726
+ marginBottom: 8
727
+ },
728
+ optionDescription: {
729
+ fontSize: 12,
730
+ marginTop: 2
731
+ },
732
+ optionLabel: { fontSize: 14 },
733
+ optionTextContainer: { flex: 1 }
734
+ }), Ce = ({ field: e, extra: t }) => {
735
+ let [n, r] = P(!1), { value: i, placeholder: a } = e, { InputLabel: o, node: s, setValue: c, error: l, label: u, helperText: d } = t, { colors: f } = y(), p = h(), m = i ? new Date(i) : void 0, { year: g, month: _, today: v } = re(() => {
736
+ let e = m || /* @__PURE__ */ new Date(), t = e.getFullYear(), n = e.getMonth(), r = /* @__PURE__ */ new Date();
737
+ return r.setHours(0, 0, 0, 0), {
738
+ month: n,
739
+ today: r,
740
+ year: t
741
+ };
742
+ }, [m]), [b, x] = P(g), [S, C] = P(_), w = [
743
+ "January",
744
+ "February",
745
+ "March",
746
+ "April",
747
+ "May",
748
+ "June",
749
+ "July",
750
+ "August",
751
+ "September",
752
+ "October",
753
+ "November",
754
+ "December"
755
+ ], T = re(() => {
756
+ let e = new Date(b, S, 1).getDay(), t = new Date(b, S + 1, 0).getDate(), n = new Date(b, S, 0).getDate(), r = [];
757
+ for (let t = e - 1; t >= 0; t--) r.push({
758
+ date: new Date(b, S - 1, n - t),
759
+ day: n - t,
760
+ isCurrentMonth: !1
761
+ });
762
+ for (let e = 1; e <= t; e++) r.push({
763
+ date: new Date(b, S, e),
764
+ day: e,
765
+ isCurrentMonth: !0
766
+ });
767
+ let i = 42 - r.length;
768
+ for (let e = 1; e <= i; e++) r.push({
769
+ date: new Date(b, S + 1, e),
770
+ day: e,
771
+ isCurrentMonth: !1
772
+ });
773
+ return r;
774
+ }, [b, S]), E = ne((e) => {
775
+ s.data.disablePast && e < v || (c(e.toISOString()), r(!1));
776
+ }, [
777
+ s.data.disablePast,
778
+ v,
779
+ c
780
+ ]), D = () => {
781
+ S === 0 ? (C(11), x(b - 1)) : C(S - 1);
782
+ }, O = () => {
783
+ S === 11 ? (C(0), x(b + 1)) : C(S + 1);
784
+ }, k = () => m ? m.toLocaleDateString() : a || p("renderer.defaultInputs.selectDate"), A = (e) => s.data.disablePast ? e < v : !1, j = (e) => m ? e.getDate() === m.getDate() && e.getMonth() === m.getMonth() && e.getFullYear() === m.getFullYear() : !1;
785
+ return /* @__PURE__ */ I(H, {
786
+ style: K.container,
787
+ children: [
788
+ /* @__PURE__ */ F(o, {
789
+ label: u,
790
+ required: s.data.required
791
+ }),
792
+ /* @__PURE__ */ I(V, {
793
+ style: [
794
+ K.trigger,
795
+ {
796
+ backgroundColor: f.input,
797
+ borderColor: f.border
798
+ },
799
+ l && { borderColor: f.error }
800
+ ],
801
+ onPress: () => r(!0),
802
+ activeOpacity: .7,
803
+ children: [/* @__PURE__ */ F(B, {
804
+ style: [
805
+ K.triggerText,
806
+ { color: f.text },
807
+ !i && { color: f.textMuted }
808
+ ],
809
+ numberOfLines: 1,
810
+ children: k()
811
+ }), /* @__PURE__ */ F(B, {
812
+ style: K.icon,
813
+ children: "📅"
814
+ })]
815
+ }),
816
+ /* @__PURE__ */ F(le, {
817
+ visible: n,
818
+ transparent: !0,
819
+ animationType: "fade",
820
+ onRequestClose: () => r(!1),
821
+ children: /* @__PURE__ */ F(V, {
822
+ style: K.modalOverlay,
823
+ activeOpacity: 1,
824
+ onPress: () => r(!1),
825
+ children: /* @__PURE__ */ I(V, {
826
+ style: [K.modalContent, { backgroundColor: f.card }],
827
+ activeOpacity: 1,
828
+ onPress: () => {},
829
+ children: [
830
+ /* @__PURE__ */ I(H, {
831
+ style: [K.modalHeader, { borderBottomColor: f.separator }],
832
+ children: [/* @__PURE__ */ F(B, {
833
+ style: [K.modalTitle, { color: f.text }],
834
+ children: u || a || p("renderer.defaultInputs.selectDate")
835
+ }), /* @__PURE__ */ F(V, {
836
+ onPress: () => r(!1),
837
+ children: /* @__PURE__ */ F(B, {
838
+ style: [K.closeButton, { color: f.textMuted }],
839
+ children: "✕"
840
+ })
841
+ })]
842
+ }),
843
+ /* @__PURE__ */ I(H, {
844
+ style: K.calendarHeader,
845
+ children: [
846
+ /* @__PURE__ */ F(V, {
847
+ onPress: D,
848
+ style: K.navButton,
849
+ children: /* @__PURE__ */ F(B, {
850
+ style: [K.navButtonText, { color: f.primary }],
851
+ children: "‹"
852
+ })
853
+ }),
854
+ /* @__PURE__ */ I(B, {
855
+ style: [K.monthYear, { color: f.text }],
856
+ children: [
857
+ w[S],
858
+ " ",
859
+ b
860
+ ]
861
+ }),
862
+ /* @__PURE__ */ F(V, {
863
+ onPress: O,
864
+ style: K.navButton,
865
+ children: /* @__PURE__ */ F(B, {
866
+ style: [K.navButtonText, { color: f.primary }],
867
+ children: "›"
868
+ })
869
+ })
870
+ ]
871
+ }),
872
+ /* @__PURE__ */ F(H, {
873
+ style: K.weekDays,
874
+ children: [
875
+ "Sun",
876
+ "Mon",
877
+ "Tue",
878
+ "Wed",
879
+ "Thu",
880
+ "Fri",
881
+ "Sat"
882
+ ].map((e) => /* @__PURE__ */ F(B, {
883
+ style: [K.weekDay, { color: f.textMuted }],
884
+ children: e
885
+ }, e))
886
+ }),
887
+ /* @__PURE__ */ F(ce, {
888
+ data: T,
889
+ keyExtractor: (e, t) => `${e.date.getTime()}-${t}`,
890
+ numColumns: 7,
891
+ scrollEnabled: !1,
892
+ style: K.calendar,
893
+ contentContainerStyle: K.calendarContent,
894
+ renderItem: ({ item: e }) => {
895
+ let t = A(e.date), n = j(e.date);
896
+ return /* @__PURE__ */ F(V, {
897
+ style: [
898
+ K.dayCell,
899
+ !e.isCurrentMonth && K.dayCellOtherMonth,
900
+ n && {
901
+ backgroundColor: f.primary,
902
+ borderRadius: 20
903
+ },
904
+ t && K.dayCellDisabled
905
+ ],
906
+ onPress: () => E(e.date),
907
+ disabled: t,
908
+ activeOpacity: .7,
909
+ children: /* @__PURE__ */ F(B, {
910
+ style: [
911
+ K.dayText,
912
+ { color: f.text },
913
+ !e.isCurrentMonth && { color: f.textMuted },
914
+ n && {
915
+ color: f.background,
916
+ fontWeight: "600"
917
+ },
918
+ t && { color: f.textMuted }
919
+ ],
920
+ children: e.day
921
+ })
922
+ });
923
+ }
924
+ })
925
+ ]
926
+ })
927
+ })
928
+ }),
929
+ l && /* @__PURE__ */ F(B, {
930
+ style: [K.error, { color: f.error }],
931
+ children: l
932
+ }),
933
+ d && !l && /* @__PURE__ */ F(B, {
934
+ style: [K.helperText, { color: f.textMuted }],
935
+ children: d
936
+ })
937
+ ]
938
+ });
939
+ }, K = z.create({
940
+ calendar: {
941
+ flexGrow: 0,
942
+ flexShrink: 1
943
+ },
944
+ calendarContent: { flexGrow: 0 },
945
+ calendarHeader: {
946
+ alignItems: "center",
947
+ flexDirection: "row",
948
+ justifyContent: "space-between",
949
+ marginBottom: 16,
950
+ paddingHorizontal: 8
951
+ },
952
+ closeButton: {
953
+ fontSize: 24,
954
+ fontWeight: "300"
955
+ },
956
+ container: { marginBottom: 16 },
957
+ dayCell: {
958
+ alignItems: "center",
959
+ aspectRatio: 1,
960
+ flex: 1,
961
+ justifyContent: "center",
962
+ margin: 2,
963
+ maxWidth: "14.28%"
964
+ },
965
+ dayCellDisabled: { opacity: .3 },
966
+ dayCellOtherMonth: { opacity: .3 },
967
+ dayText: { fontSize: 14 },
968
+ error: {
969
+ fontSize: 12,
970
+ marginTop: 4
971
+ },
972
+ helperText: {
973
+ fontSize: 12,
974
+ marginTop: 4
975
+ },
976
+ icon: { fontSize: 16 },
977
+ modalContent: {
978
+ borderRadius: 12,
979
+ maxHeight: "80%",
980
+ padding: 16,
981
+ width: "90%"
982
+ },
983
+ modalHeader: {
984
+ alignItems: "center",
985
+ borderBottomWidth: 1,
986
+ flexDirection: "row",
987
+ justifyContent: "space-between",
988
+ marginBottom: 16,
989
+ paddingBottom: 12
990
+ },
991
+ modalOverlay: {
992
+ alignItems: "center",
993
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
994
+ flex: 1,
995
+ justifyContent: "center"
996
+ },
997
+ modalTitle: {
998
+ fontSize: 18,
999
+ fontWeight: "600"
1000
+ },
1001
+ monthYear: {
1002
+ fontSize: 16,
1003
+ fontWeight: "600"
1004
+ },
1005
+ navButton: { padding: 8 },
1006
+ navButtonText: {
1007
+ fontSize: 24,
1008
+ fontWeight: "600"
1009
+ },
1010
+ trigger: {
1011
+ alignItems: "center",
1012
+ borderRadius: 6,
1013
+ borderWidth: 1,
1014
+ flexDirection: "row",
1015
+ justifyContent: "space-between",
1016
+ paddingHorizontal: 12,
1017
+ paddingVertical: 10
1018
+ },
1019
+ triggerText: {
1020
+ flex: 1,
1021
+ fontSize: 14
1022
+ },
1023
+ weekDay: {
1024
+ flex: 1,
1025
+ fontSize: 12,
1026
+ fontWeight: "600",
1027
+ maxWidth: "14.28%",
1028
+ textAlign: "center"
1029
+ },
1030
+ weekDays: {
1031
+ flexDirection: "row",
1032
+ marginBottom: 8
1033
+ }
1034
+ }), we = ({ field: e, extra: t }) => {
1035
+ let [n, r] = P(!1), [i, a] = P(!0), { value: o } = e, { InputLabel: s, node: c, setValue: l, error: u, label: d, helperText: f } = t, p = h(), { colors: m } = y(), g = Array.isArray(o) ? o : [], _ = g[0] ? new Date(g[0]) : void 0, v = g[1] ? new Date(g[1]) : void 0, { year: b, month: x, today: S } = re(() => {
1036
+ let e = _ || /* @__PURE__ */ new Date(), t = e.getFullYear(), n = e.getMonth(), r = /* @__PURE__ */ new Date();
1037
+ return r.setHours(0, 0, 0, 0), {
1038
+ month: n,
1039
+ today: r,
1040
+ year: t
1041
+ };
1042
+ }, [_]), [C, w] = P(b), [T, E] = P(x), D = [
1043
+ "January",
1044
+ "February",
1045
+ "March",
1046
+ "April",
1047
+ "May",
1048
+ "June",
1049
+ "July",
1050
+ "August",
1051
+ "September",
1052
+ "October",
1053
+ "November",
1054
+ "December"
1055
+ ], O = re(() => {
1056
+ let e = new Date(C, T, 1).getDay(), t = new Date(C, T + 1, 0).getDate(), n = new Date(C, T, 0).getDate(), r = [];
1057
+ for (let t = e - 1; t >= 0; t--) r.push({
1058
+ date: new Date(C, T - 1, n - t),
1059
+ day: n - t,
1060
+ isCurrentMonth: !1
1061
+ });
1062
+ for (let e = 1; e <= t; e++) r.push({
1063
+ date: new Date(C, T, e),
1064
+ day: e,
1065
+ isCurrentMonth: !0
1066
+ });
1067
+ let i = 42 - r.length;
1068
+ for (let e = 1; e <= i; e++) r.push({
1069
+ date: new Date(C, T + 1, e),
1070
+ day: e,
1071
+ isCurrentMonth: !1
1072
+ });
1073
+ return r;
1074
+ }, [C, T]), k = ne((e) => {
1075
+ c.data.disablePast && e < S || (i ? (l([e.toISOString(), v?.toISOString()]), a(!1)) : (l(_ && e < _ ? [e.toISOString(), _.toISOString()] : [_?.toISOString(), e.toISOString()]), r(!1), a(!0)));
1076
+ }, [
1077
+ c.data.disablePast,
1078
+ S,
1079
+ i,
1080
+ _,
1081
+ v,
1082
+ l
1083
+ ]), A = () => {
1084
+ T === 0 ? (E(11), w(C - 1)) : E(T - 1);
1085
+ }, j = () => {
1086
+ T === 11 ? (E(0), w(C + 1)) : E(T + 1);
1087
+ }, ee = () => _ && v ? `${_.toLocaleDateString()} - ${v.toLocaleDateString()}` : _ ? _.toLocaleDateString() : p("renderer.defaultInputs.selectDateRange"), te = (e) => c.data.disablePast ? e < S : !1, M = (e) => _ && v ? e >= _ && e <= v : !1, N = (e) => {
1088
+ if (!(_ || v)) return !1;
1089
+ let t = _ && e.getDate() === _.getDate() && e.getMonth() === _.getMonth() && e.getFullYear() === _.getFullYear(), n = v && e.getDate() === v.getDate() && e.getMonth() === v.getMonth() && e.getFullYear() === v.getFullYear();
1090
+ return t || n;
1091
+ };
1092
+ return /* @__PURE__ */ I(H, {
1093
+ style: q.container,
1094
+ children: [
1095
+ /* @__PURE__ */ F(s, {
1096
+ label: d,
1097
+ required: c.data.required
1098
+ }),
1099
+ /* @__PURE__ */ I(V, {
1100
+ style: [
1101
+ q.trigger,
1102
+ {
1103
+ backgroundColor: m.input,
1104
+ borderColor: m.border
1105
+ },
1106
+ u && { borderColor: m.error }
1107
+ ],
1108
+ onPress: () => r(!0),
1109
+ activeOpacity: .7,
1110
+ children: [/* @__PURE__ */ F(B, {
1111
+ style: [
1112
+ q.triggerText,
1113
+ { color: m.text },
1114
+ !_ && { color: m.textMuted }
1115
+ ],
1116
+ numberOfLines: 1,
1117
+ children: ee()
1118
+ }), /* @__PURE__ */ F(B, {
1119
+ style: q.icon,
1120
+ children: "📅"
1121
+ })]
1122
+ }),
1123
+ /* @__PURE__ */ F(le, {
1124
+ visible: n,
1125
+ transparent: !0,
1126
+ animationType: "fade",
1127
+ onRequestClose: () => r(!1),
1128
+ children: /* @__PURE__ */ F(V, {
1129
+ style: q.modalOverlay,
1130
+ activeOpacity: 1,
1131
+ onPress: () => r(!1),
1132
+ children: /* @__PURE__ */ I(V, {
1133
+ style: [q.modalContent, { backgroundColor: m.card }],
1134
+ activeOpacity: 1,
1135
+ onPress: () => {},
1136
+ children: [
1137
+ /* @__PURE__ */ I(H, {
1138
+ style: [q.modalHeader, { borderBottomColor: m.separator }],
1139
+ children: [/* @__PURE__ */ F(B, {
1140
+ style: [q.modalTitle, { color: m.text }],
1141
+ children: d || p("renderer.defaultInputs.selectDateRange")
1142
+ }), /* @__PURE__ */ F(V, {
1143
+ onPress: () => r(!1),
1144
+ children: /* @__PURE__ */ F(B, {
1145
+ style: [q.closeButton, { color: m.textMuted }],
1146
+ children: "✕"
1147
+ })
1148
+ })]
1149
+ }),
1150
+ /* @__PURE__ */ F(H, {
1151
+ style: [q.rangeIndicator, { backgroundColor: m.primaryLight }],
1152
+ children: /* @__PURE__ */ F(B, {
1153
+ style: [q.rangeIndicatorText, { color: m.primary }],
1154
+ children: p(i ? "renderer.defaultInputs.startDate" : "renderer.defaultInputs.endDate")
1155
+ })
1156
+ }),
1157
+ /* @__PURE__ */ I(H, {
1158
+ style: q.calendarHeader,
1159
+ children: [
1160
+ /* @__PURE__ */ F(V, {
1161
+ onPress: A,
1162
+ style: q.navButton,
1163
+ children: /* @__PURE__ */ F(B, {
1164
+ style: [q.navButtonText, { color: m.primary }],
1165
+ children: "‹"
1166
+ })
1167
+ }),
1168
+ /* @__PURE__ */ I(B, {
1169
+ style: [q.monthYear, { color: m.text }],
1170
+ children: [
1171
+ D[T],
1172
+ " ",
1173
+ C
1174
+ ]
1175
+ }),
1176
+ /* @__PURE__ */ F(V, {
1177
+ onPress: j,
1178
+ style: q.navButton,
1179
+ children: /* @__PURE__ */ F(B, {
1180
+ style: [q.navButtonText, { color: m.primary }],
1181
+ children: "›"
1182
+ })
1183
+ })
1184
+ ]
1185
+ }),
1186
+ /* @__PURE__ */ F(H, {
1187
+ style: q.weekDays,
1188
+ children: [
1189
+ "Sun",
1190
+ "Mon",
1191
+ "Tue",
1192
+ "Wed",
1193
+ "Thu",
1194
+ "Fri",
1195
+ "Sat"
1196
+ ].map((e) => /* @__PURE__ */ F(B, {
1197
+ style: [q.weekDay, { color: m.textMuted }],
1198
+ children: e
1199
+ }, e))
1200
+ }),
1201
+ /* @__PURE__ */ F(ce, {
1202
+ data: O,
1203
+ keyExtractor: (e, t) => `${e.date.getTime()}-${t}`,
1204
+ numColumns: 7,
1205
+ scrollEnabled: !1,
1206
+ style: q.calendar,
1207
+ contentContainerStyle: q.calendarContent,
1208
+ renderItem: ({ item: e }) => {
1209
+ let t = te(e.date), n = M(e.date), r = N(e.date);
1210
+ return /* @__PURE__ */ F(V, {
1211
+ style: [
1212
+ q.dayCell,
1213
+ !e.isCurrentMonth && q.dayCellOtherMonth,
1214
+ n && { backgroundColor: m.primaryLight },
1215
+ r && {
1216
+ backgroundColor: m.primary,
1217
+ borderRadius: 20
1218
+ },
1219
+ t && q.dayCellDisabled
1220
+ ],
1221
+ onPress: () => k(e.date),
1222
+ disabled: t,
1223
+ activeOpacity: .7,
1224
+ children: /* @__PURE__ */ F(B, {
1225
+ style: [
1226
+ q.dayText,
1227
+ { color: m.text },
1228
+ !e.isCurrentMonth && { color: m.textMuted },
1229
+ n && { color: m.primary },
1230
+ r && {
1231
+ color: m.background,
1232
+ fontWeight: "600"
1233
+ },
1234
+ t && { color: m.textMuted }
1235
+ ],
1236
+ children: e.day
1237
+ })
1238
+ });
1239
+ }
1240
+ })
1241
+ ]
1242
+ })
1243
+ })
1244
+ }),
1245
+ u && /* @__PURE__ */ F(B, {
1246
+ style: [q.error, { color: m.error }],
1247
+ children: u
1248
+ }),
1249
+ f && !u && /* @__PURE__ */ F(B, {
1250
+ style: [q.helperText, { color: m.textMuted }],
1251
+ children: f
1252
+ })
1253
+ ]
1254
+ });
1255
+ }, q = z.create({
1256
+ calendar: {
1257
+ flexGrow: 0,
1258
+ flexShrink: 1
1259
+ },
1260
+ calendarContent: { flexGrow: 0 },
1261
+ calendarHeader: {
1262
+ alignItems: "center",
1263
+ flexDirection: "row",
1264
+ justifyContent: "space-between",
1265
+ marginBottom: 16,
1266
+ paddingHorizontal: 8
1267
+ },
1268
+ closeButton: {
1269
+ fontSize: 24,
1270
+ fontWeight: "300"
1271
+ },
1272
+ container: { marginBottom: 16 },
1273
+ dayCell: {
1274
+ alignItems: "center",
1275
+ aspectRatio: 1,
1276
+ flex: 1,
1277
+ justifyContent: "center",
1278
+ margin: 2,
1279
+ maxWidth: "14.28%"
1280
+ },
1281
+ dayCellDisabled: { opacity: .3 },
1282
+ dayCellOtherMonth: { opacity: .3 },
1283
+ dayText: { fontSize: 14 },
1284
+ error: {
1285
+ fontSize: 12,
1286
+ marginTop: 4
1287
+ },
1288
+ helperText: {
1289
+ fontSize: 12,
1290
+ marginTop: 4
1291
+ },
1292
+ icon: { fontSize: 16 },
1293
+ modalContent: {
1294
+ borderRadius: 12,
1295
+ maxHeight: "80%",
1296
+ padding: 16,
1297
+ width: "90%"
1298
+ },
1299
+ modalHeader: {
1300
+ alignItems: "center",
1301
+ borderBottomWidth: 1,
1302
+ flexDirection: "row",
1303
+ justifyContent: "space-between",
1304
+ marginBottom: 12,
1305
+ paddingBottom: 12
1306
+ },
1307
+ modalOverlay: {
1308
+ alignItems: "center",
1309
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
1310
+ flex: 1,
1311
+ justifyContent: "center"
1312
+ },
1313
+ modalTitle: {
1314
+ fontSize: 18,
1315
+ fontWeight: "600"
1316
+ },
1317
+ monthYear: {
1318
+ fontSize: 16,
1319
+ fontWeight: "600"
1320
+ },
1321
+ navButton: { padding: 8 },
1322
+ navButtonText: {
1323
+ fontSize: 24,
1324
+ fontWeight: "600"
1325
+ },
1326
+ rangeIndicator: {
1327
+ alignItems: "center",
1328
+ borderRadius: 6,
1329
+ marginBottom: 12,
1330
+ paddingVertical: 8
1331
+ },
1332
+ rangeIndicatorText: {
1333
+ fontSize: 14,
1334
+ fontWeight: "600"
1335
+ },
1336
+ trigger: {
1337
+ alignItems: "center",
1338
+ borderRadius: 6,
1339
+ borderWidth: 1,
1340
+ flexDirection: "row",
1341
+ justifyContent: "space-between",
1342
+ paddingHorizontal: 12,
1343
+ paddingVertical: 10
1344
+ },
1345
+ triggerText: {
1346
+ flex: 1,
1347
+ fontSize: 14
1348
+ },
1349
+ weekDay: {
1350
+ flex: 1,
1351
+ fontSize: 12,
1352
+ fontWeight: "600",
1353
+ maxWidth: "14.28%",
1354
+ textAlign: "center"
1355
+ },
1356
+ weekDays: {
1357
+ flexDirection: "row",
1358
+ marginBottom: 8
1359
+ }
1360
+ }), Te = ({ field: e, extra: t }) => {
1361
+ let [n, r] = P(null), [i, a] = P(!0), { value: o } = e, { InputLabel: s, node: c, setValue: l, error: u, label: d, helperText: f } = t, { colors: p } = y(), m = h(), g = Array.isArray(o) ? o : o ? [o] : [], _ = c.data.multiple, v = ne(async () => {
1362
+ if (n) try {
1363
+ let e = (await n({ allowMultiSelection: _ })).map((e) => ({
1364
+ data: e.uri,
1365
+ lastModified: Date.now(),
1366
+ name: e.name,
1367
+ size: e.size,
1368
+ type: e.type || "application/octet-stream"
1369
+ }));
1370
+ l(_ ? [...g, ...e] : e[0] || null);
1371
+ } catch (e) {
1372
+ e.code !== "DOCUMENT_PICKER_CANCELED" && oe.alert("Error", m("renderer.defaultInputs.filePickerError"));
1373
+ }
1374
+ }, [
1375
+ n,
1376
+ g,
1377
+ _,
1378
+ l,
1379
+ m
1380
+ ]), b = ne((e) => {
1381
+ let t = g.filter((t, n) => n !== e);
1382
+ l(t.length > 0 ? t : null);
1383
+ }, [g, l]), x = (e) => e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
1384
+ return M(() => {
1385
+ (async () => {
1386
+ try {
1387
+ let { pick: e } = await import("react-native-document-picker");
1388
+ r(() => e);
1389
+ } catch {
1390
+ r(null);
1391
+ } finally {
1392
+ a(!1);
1393
+ }
1394
+ })();
1395
+ }, []), i ? null : n ? /* @__PURE__ */ I(H, {
1396
+ style: J.container,
1397
+ children: [
1398
+ /* @__PURE__ */ F(s, {
1399
+ label: d,
1400
+ required: c.data.required
1401
+ }),
1402
+ g.length > 0 && /* @__PURE__ */ F(H, {
1403
+ style: J.filesList,
1404
+ children: g.map((e, t) => /* @__PURE__ */ I(H, {
1405
+ style: [J.fileItem, {
1406
+ backgroundColor: p.card,
1407
+ borderColor: p.separator
1408
+ }],
1409
+ children: [
1410
+ /* @__PURE__ */ F(H, {
1411
+ style: [J.fileIcon, { backgroundColor: p.muted }],
1412
+ children: /* @__PURE__ */ F(B, {
1413
+ style: J.fileIconText,
1414
+ children: "📄"
1415
+ })
1416
+ }),
1417
+ /* @__PURE__ */ I(H, {
1418
+ style: J.fileInfo,
1419
+ children: [/* @__PURE__ */ F(B, {
1420
+ style: [J.fileName, { color: p.text }],
1421
+ numberOfLines: 1,
1422
+ children: e.name
1423
+ }), e.size > 0 && /* @__PURE__ */ F(B, {
1424
+ style: [J.fileSize, { color: p.textMuted }],
1425
+ children: x(e.size)
1426
+ })]
1427
+ }),
1428
+ /* @__PURE__ */ F(V, {
1429
+ style: J.removeButton,
1430
+ onPress: () => b(t),
1431
+ activeOpacity: .7,
1432
+ children: /* @__PURE__ */ F(B, {
1433
+ style: [J.removeButtonText, { color: p.textMuted }],
1434
+ children: "✕"
1435
+ })
1436
+ })
1437
+ ]
1438
+ }, `${e.name}-${t}`))
1439
+ }),
1440
+ /* @__PURE__ */ F(V, {
1441
+ style: [J.pickButton, {
1442
+ backgroundColor: p.input,
1443
+ borderColor: p.border
1444
+ }],
1445
+ onPress: v,
1446
+ activeOpacity: .7,
1447
+ children: /* @__PURE__ */ F(B, {
1448
+ style: [J.pickButtonText, { color: p.textMuted }],
1449
+ children: g.length === 0 ? m(_ ? "renderer.defaultInputs.selectFiles" : "renderer.defaultInputs.selectFile") : m(_ ? "renderer.defaultInputs.addMoreFiles" : "renderer.defaultInputs.replaceFile")
1450
+ })
1451
+ }),
1452
+ u && /* @__PURE__ */ F(B, {
1453
+ style: [J.error, { color: p.error }],
1454
+ children: u
1455
+ }),
1456
+ f && !u && /* @__PURE__ */ F(B, {
1457
+ style: [J.helperText, { color: p.textMuted }],
1458
+ children: f
1459
+ })
1460
+ ]
1461
+ }) : /* @__PURE__ */ I(H, {
1462
+ style: J.container,
1463
+ children: [
1464
+ /* @__PURE__ */ F(s, {
1465
+ label: d,
1466
+ required: c.data.required
1467
+ }),
1468
+ /* @__PURE__ */ F(H, {
1469
+ style: [J.unavailableContainer, {
1470
+ backgroundColor: p.errorLight,
1471
+ borderColor: p.error
1472
+ }],
1473
+ children: /* @__PURE__ */ F(B, {
1474
+ style: [J.unavailableText, { color: p.error }],
1475
+ children: m("renderer.defaultInputs.filePickerUnavailable")
1476
+ })
1477
+ }),
1478
+ f && /* @__PURE__ */ F(B, {
1479
+ style: [J.helperText, { color: p.textMuted }],
1480
+ children: f
1481
+ })
1482
+ ]
1483
+ });
1484
+ }, J = z.create({
1485
+ container: { marginBottom: 16 },
1486
+ error: {
1487
+ fontSize: 12,
1488
+ marginTop: 4
1489
+ },
1490
+ fileIcon: {
1491
+ alignItems: "center",
1492
+ borderRadius: 6,
1493
+ height: 40,
1494
+ justifyContent: "center",
1495
+ width: 40
1496
+ },
1497
+ fileIconText: { fontSize: 20 },
1498
+ fileInfo: {
1499
+ flex: 1,
1500
+ marginLeft: 12
1501
+ },
1502
+ fileItem: {
1503
+ alignItems: "center",
1504
+ borderRadius: 6,
1505
+ borderWidth: 1,
1506
+ flexDirection: "row",
1507
+ marginBottom: 8,
1508
+ padding: 12
1509
+ },
1510
+ fileName: {
1511
+ fontSize: 14,
1512
+ fontWeight: "500"
1513
+ },
1514
+ fileSize: {
1515
+ fontSize: 12,
1516
+ marginTop: 2
1517
+ },
1518
+ filesList: { marginBottom: 12 },
1519
+ helperText: {
1520
+ fontSize: 12,
1521
+ marginTop: 4
1522
+ },
1523
+ pickButton: {
1524
+ alignItems: "center",
1525
+ borderRadius: 6,
1526
+ borderStyle: "dashed",
1527
+ borderWidth: 2,
1528
+ justifyContent: "center",
1529
+ paddingVertical: 16
1530
+ },
1531
+ pickButtonText: {
1532
+ fontSize: 14,
1533
+ fontWeight: "500"
1534
+ },
1535
+ removeButton: { padding: 4 },
1536
+ removeButtonText: { fontSize: 18 },
1537
+ unavailableContainer: {
1538
+ alignItems: "center",
1539
+ borderRadius: 6,
1540
+ borderWidth: 1,
1541
+ justifyContent: "center",
1542
+ paddingVertical: 16
1543
+ },
1544
+ unavailableText: {
1545
+ fontSize: 12,
1546
+ textAlign: "center"
1547
+ }
1548
+ }), Ee = (e) => null, De = ({ missing: e, children: t }) => {
1549
+ let n = h(), { colors: r } = y();
1550
+ return /* @__PURE__ */ I(ie, { children: [t, e.length > 0 && /* @__PURE__ */ I(H, {
1551
+ style: Oe.container,
1552
+ children: [/* @__PURE__ */ F(B, {
1553
+ style: [Oe.title, { color: r.textMuted }],
1554
+ children: n("renderer.dependencyHint.title")
1555
+ }), e.map((e) => /* @__PURE__ */ I(B, {
1556
+ style: [Oe.item, { color: r.textMuted }],
1557
+ children: [
1558
+ "•",
1559
+ " ",
1560
+ e.label
1561
+ ]
1562
+ }, e.id))]
1563
+ })] });
1564
+ }, Oe = z.create({
1565
+ container: {
1566
+ gap: 2,
1567
+ marginTop: 4
1568
+ },
1569
+ item: { fontSize: 12 },
1570
+ title: {
1571
+ fontSize: 12,
1572
+ fontWeight: "500"
1573
+ }
1574
+ }), ke = (e) => e.replace(/<[^>]*>/g, ""), Ae = (e) => e.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&#x27;/g, "'").replace(/&#x2F;/g, "/"), je = (e, t = {}) => e == null || e === "" ? "" : Ae(ke(String(e))), Me = 100, Ne = (e, t = {}, n = 0, r = /* @__PURE__ */ new WeakSet()) => {
1575
+ if (n > Me) return console.warn(`sanitizeHttpResponse: Maximum depth (${Me}) exceeded.`), typeof e == "string" ? je(e, t) : "[Max Depth Exceeded]";
1576
+ if (e == null) return e;
1577
+ if (typeof e == "string") return je(e, t);
1578
+ if (Array.isArray(e)) return e.map((e) => Ne(e, t, n + 1, r));
1579
+ if (typeof e == "object") {
1580
+ if (r.has(e)) return console.warn("sanitizeHttpResponse: Circular reference detected. Breaking cycle to prevent infinite recursion."), "[Circular Reference]";
1581
+ r.add(e);
1582
+ let i = {};
1583
+ for (let [a, o] of Object.entries(e)) i[a] = Ne(o, t, n + 1, r);
1584
+ return r.delete(e), i;
1585
+ }
1586
+ return e;
1587
+ }, Pe = (e) => {
1588
+ let t = e.matchAll(/{{([\w-]+)}}/g);
1589
+ return Array.from(t, (e) => e[1]);
1590
+ }, Fe = (e, t) => Pe(e).every((e) => {
1591
+ let n = t[e];
1592
+ return n != null && n !== "";
1593
+ }), Ie = (e, t, n = !1) => e.replace(/{{([\w-]+)}}/g, (e, r) => {
1594
+ let i = t[r], a = i == null ? "" : String(i);
1595
+ return n ? encodeURIComponent(a) : a;
1596
+ }), Le = ({ field: t, extra: i }) => {
1597
+ let [o, l] = P(!1), [d, f] = P(null), [p, m] = P([]), [_, v] = P(""), [b, x] = P(!1), { value: C, placeholder: T } = t, { InputLabel: E, node: D, setValue: O, error: k, label: A, helperText: j, missingDependencies: ee } = i, { formValues: te, inputNodes: ie, headers: oe, baseUrl: se } = r(), { colors: L } = y(), { httpConfig: R } = D.data, z = h(), ue = N(!1), fe = N(!1), pe = N(""), me = N(R), he = N(te), ge = N(ie), _e = N(oe), ve = N(se), U = N(O), be = N(null), xe = N(null), W = N(D.data.normalizeOptionLabels !== !1), Se = re(() => R?.url ? Pe(R.url) : [], [R?.url]), G = Se.length > 0, Ce = re(() => Se.map((e) => `${e}:${String(te[e] ?? "")}`).join("|"), [Se, te]), K = re(() => R?.url ? G ? Fe(R.url, te) : !0 : !1, [
1598
+ R?.url,
1599
+ G,
1600
+ te
1601
+ ]), we = ne(async (t) => {
1602
+ xe.current && xe.current.abort();
1603
+ let r = new AbortController();
1604
+ xe.current = r;
1605
+ let i = me.current, o = he.current, d = U.current;
1606
+ if (!i?.url) {
1607
+ f(z("renderer.defaultHttpInput.noUrlConfigured")), xe.current = null;
1608
+ return;
1609
+ }
1610
+ if (i.url && !Fe(i.url, o)) {
1611
+ xe.current = null;
1612
+ return;
1613
+ }
1614
+ l(!0), f(null);
1615
+ try {
1616
+ let l = g(Ie(i.url, o, !0), ve.current), p = w(i.searchParam && t ? `${l}${l.includes("?") ? "&" : "?"}${i.searchParam}=${encodeURIComponent(t)}` : l, a(i.queryParams, o)), h = s({ "Content-Type": "application/json" }, a(_e.current, o), a(i.headers, o)), _ = [
1617
+ "POST",
1618
+ "PUT",
1619
+ "PATCH"
1620
+ ].includes(i.method || "") ? i.sendAllFormValues ? JSON.stringify(S(o, ge.current)) : u(i.body, o, ge.current) : void 0, v = setTimeout(() => r.abort(), 3e4), y = await fetch(p, {
1621
+ body: _ || void 0,
1622
+ headers: Object.fromEntries(Object.entries(h).filter(([, e]) => e)),
1623
+ method: i.method || "GET",
1624
+ signal: r.signal
1625
+ });
1626
+ if (clearTimeout(v), !y.ok) {
1627
+ f(`HTTP Error ${y.status}: ${y.statusText}`);
1628
+ return;
1629
+ }
1630
+ let b = e(await y.text());
1631
+ if (!b.ok) {
1632
+ f(z("renderer.defaultHttpInput.invalidJson"));
1633
+ return;
1634
+ }
1635
+ let x = Ne(b.value), C = i.responsePath ? n(x, i.responsePath) : x;
1636
+ if (i.responseMapping && Array.isArray(C)) {
1637
+ let { valueField: e = "value", labelField: t = "label", descriptionField: r, imageField: a } = i.responseMapping, o = W.current;
1638
+ m(C.map((i) => {
1639
+ let s = r ? n(i, r) : void 0, l = a ? n(i, a) : void 0, u = String(n(i, t) || "");
1640
+ return {
1641
+ description: s != null && s !== "" ? String(s) : void 0,
1642
+ image: typeof l == "string" && l !== "" ? l : void 0,
1643
+ label: o ? c(u) : u,
1644
+ value: String(n(i, e) || "")
1645
+ };
1646
+ }));
1647
+ } else d(typeof C == "string" ? C : JSON.stringify(C));
1648
+ } catch (e) {
1649
+ if (e instanceof Error && e.name === "AbortError") return;
1650
+ f(e instanceof Error ? e.message : z("renderer.defaultHttpInput.fetchFailed")), console.error("HTTP Input fetch error:", e);
1651
+ } finally {
1652
+ xe.current === r && (l(!1), xe.current = null);
1653
+ }
1654
+ }, [z]);
1655
+ if (M(() => {
1656
+ me.current = R, he.current = te, ge.current = ie, _e.current = oe, ve.current = se, U.current = O, be.current = we, W.current = D.data.normalizeOptionLabels !== !1;
1657
+ }, [
1658
+ R,
1659
+ te,
1660
+ ie,
1661
+ oe,
1662
+ se,
1663
+ O,
1664
+ we,
1665
+ D.data.normalizeOptionLabels
1666
+ ]), M(() => () => {
1667
+ xe.current && xe.current.abort(), ue.current = !1, fe.current = !1;
1668
+ }, []), M(() => {
1669
+ if (ue.current) return;
1670
+ ue.current = !0;
1671
+ let e = me.current, t = he.current, n = be.current, r = e?.url && Fe(e.url, t);
1672
+ e?.fetchOnMount && r && n && (n(), e.url && (pe.current = Pe(e.url).map((e) => `${e}:${String(t[e] ?? "")}`).join("|")));
1673
+ }, []), M(() => {
1674
+ if (!ue.current || !G || pe.current === Ce || !K) return;
1675
+ let e = setTimeout(() => {
1676
+ we(), pe.current = Ce;
1677
+ }, 500);
1678
+ return () => clearTimeout(e);
1679
+ }, [
1680
+ Ce,
1681
+ G,
1682
+ K,
1683
+ we
1684
+ ]), M(() => {
1685
+ if (!fe.current) {
1686
+ fe.current = !0;
1687
+ return;
1688
+ }
1689
+ let e = me.current, t = he.current, n = be.current, r = e?.url && Fe(e.url, t);
1690
+ e?.fetchOnMount && r && n && (n(), e.url && (pe.current = Pe(e.url).map((e) => `${e}:${String(t[e] ?? "")}`).join("|")));
1691
+ }, [re(() => JSON.stringify({
1692
+ body: R?.body,
1693
+ fetchOnMount: R?.fetchOnMount,
1694
+ headers: R?.headers,
1695
+ method: R?.method,
1696
+ queryParams: R?.queryParams,
1697
+ responseMapping: R?.responseMapping,
1698
+ responsePath: R?.responsePath,
1699
+ searchParam: R?.searchParam,
1700
+ sendAllFormValues: R?.sendAllFormValues,
1701
+ url: R?.url
1702
+ }), [R])]), M(() => {
1703
+ if (!(R?.searchParam && _)) return;
1704
+ let e = setTimeout(() => {
1705
+ we(_);
1706
+ }, 300);
1707
+ return () => clearTimeout(e);
1708
+ }, [
1709
+ _,
1710
+ R?.searchParam,
1711
+ we
1712
+ ]), R?.responseMapping) {
1713
+ let e = Array.isArray(C) ? C[0] : C, t = p.find((t) => t.value === e);
1714
+ if (R.searchParam) {
1715
+ let n = o && R?.showLoading;
1716
+ return /* @__PURE__ */ I(H, {
1717
+ style: Y.container,
1718
+ children: [
1719
+ /* @__PURE__ */ F(E, {
1720
+ label: A,
1721
+ required: D.data.required
1722
+ }),
1723
+ /* @__PURE__ */ F(De, {
1724
+ missing: ee,
1725
+ children: /* @__PURE__ */ I(V, {
1726
+ style: [
1727
+ Y.trigger,
1728
+ {
1729
+ backgroundColor: L.input,
1730
+ borderColor: L.border
1731
+ },
1732
+ k && { borderColor: L.error },
1733
+ ee.length > 0 && { backgroundColor: L.muted }
1734
+ ],
1735
+ onPress: () => x(!0),
1736
+ disabled: ee.length > 0,
1737
+ activeOpacity: .7,
1738
+ children: [
1739
+ /* @__PURE__ */ F(B, {
1740
+ style: [
1741
+ Y.triggerText,
1742
+ { color: L.text },
1743
+ !t && { color: L.textMuted }
1744
+ ],
1745
+ numberOfLines: 1,
1746
+ children: t?.label || T || z("renderer.defaultHttpInput.search")
1747
+ }),
1748
+ n && /* @__PURE__ */ F(ae, {
1749
+ size: "small",
1750
+ color: L.primary,
1751
+ style: Y.triggerLoader
1752
+ }),
1753
+ e ? /* @__PURE__ */ F(V, {
1754
+ onPress: () => O(""),
1755
+ hitSlop: {
1756
+ bottom: 8,
1757
+ left: 8,
1758
+ right: 8,
1759
+ top: 8
1760
+ },
1761
+ style: Y.clearButton,
1762
+ children: /* @__PURE__ */ F(B, {
1763
+ style: [Y.clearIcon, { color: L.textMuted }],
1764
+ children: "✕"
1765
+ })
1766
+ }) : null,
1767
+ /* @__PURE__ */ F(B, {
1768
+ style: [Y.arrow, { color: L.textMuted }],
1769
+ children: "▼"
1770
+ })
1771
+ ]
1772
+ })
1773
+ }),
1774
+ /* @__PURE__ */ F(le, {
1775
+ visible: b,
1776
+ transparent: !0,
1777
+ animationType: "fade",
1778
+ onRequestClose: () => x(!1),
1779
+ children: /* @__PURE__ */ F(V, {
1780
+ style: Y.modalOverlay,
1781
+ activeOpacity: 1,
1782
+ onPress: () => x(!1),
1783
+ children: /* @__PURE__ */ I(V, {
1784
+ style: [Y.modalContent, { backgroundColor: L.card }],
1785
+ activeOpacity: 1,
1786
+ onPress: () => {},
1787
+ children: [
1788
+ /* @__PURE__ */ I(H, {
1789
+ style: [Y.modalHeader, { borderBottomColor: L.separator }],
1790
+ children: [/* @__PURE__ */ F(B, {
1791
+ style: [Y.modalTitle, { color: L.text }],
1792
+ children: A || T || z("renderer.defaultHttpInput.search")
1793
+ }), /* @__PURE__ */ F(V, {
1794
+ onPress: () => x(!1),
1795
+ children: /* @__PURE__ */ F(B, {
1796
+ style: [Y.closeButton, { color: L.textMuted }],
1797
+ children: "✕"
1798
+ })
1799
+ })]
1800
+ }),
1801
+ /* @__PURE__ */ F(H, {
1802
+ style: Y.searchContainer,
1803
+ children: /* @__PURE__ */ F(de, {
1804
+ style: [Y.searchInput, {
1805
+ backgroundColor: L.muted,
1806
+ borderColor: L.border,
1807
+ color: L.text
1808
+ }],
1809
+ placeholder: z("renderer.defaultHttpInput.search"),
1810
+ placeholderTextColor: L.textMuted,
1811
+ value: _,
1812
+ onChangeText: (e) => {
1813
+ v(e), f(null);
1814
+ },
1815
+ autoFocus: !0,
1816
+ autoCapitalize: "none",
1817
+ autoCorrect: !1
1818
+ })
1819
+ }),
1820
+ o ? /* @__PURE__ */ F(H, {
1821
+ style: Y.loadingContainer,
1822
+ children: /* @__PURE__ */ F(ae, {
1823
+ size: "small",
1824
+ color: L.primary
1825
+ })
1826
+ }) : d ? /* @__PURE__ */ I(H, {
1827
+ style: Y.errorContainer,
1828
+ children: [/* @__PURE__ */ F(B, {
1829
+ style: [Y.errorText, { color: L.error }],
1830
+ children: d
1831
+ }), /* @__PURE__ */ F(V, {
1832
+ onPress: () => we(_),
1833
+ style: Y.retryButton,
1834
+ children: /* @__PURE__ */ F(B, {
1835
+ style: [Y.retryButtonText, { color: L.primary }],
1836
+ children: z("renderer.defaultHttpInput.retry")
1837
+ })
1838
+ })]
1839
+ }) : /* @__PURE__ */ F(ce, {
1840
+ data: p,
1841
+ keyExtractor: (e) => e.value,
1842
+ style: Y.optionsList,
1843
+ contentContainerStyle: Y.optionsListContent,
1844
+ ListEmptyComponent: /* @__PURE__ */ F(H, {
1845
+ style: Y.emptyContainer,
1846
+ children: /* @__PURE__ */ F(B, {
1847
+ style: [Y.emptyText, { color: L.textMuted }],
1848
+ children: z("renderer.defaultHttpInput.noResults")
1849
+ })
1850
+ }),
1851
+ renderItem: ({ item: t }) => {
1852
+ let n = t.value === e;
1853
+ return /* @__PURE__ */ I(V, {
1854
+ style: [Y.option, n && { backgroundColor: L.primaryLight }],
1855
+ onPress: () => {
1856
+ O(t.value), x(!1);
1857
+ },
1858
+ activeOpacity: .7,
1859
+ children: [/* @__PURE__ */ F(ye, {
1860
+ label: t.label,
1861
+ description: t.description,
1862
+ image: t.image
1863
+ }), n && /* @__PURE__ */ F(B, {
1864
+ style: [Y.checkmark, { color: L.primary }],
1865
+ children: "✓"
1866
+ })]
1867
+ });
1868
+ }
1869
+ })
1870
+ ]
1871
+ })
1872
+ })
1873
+ }),
1874
+ k && /* @__PURE__ */ F(B, {
1875
+ style: [Y.error, { color: L.error }],
1876
+ children: k
1877
+ }),
1878
+ j && !k && /* @__PURE__ */ F(B, {
1879
+ style: [Y.helperText, { color: L.textMuted }],
1880
+ children: j
1881
+ })
1882
+ ]
1883
+ });
1884
+ }
1885
+ let n = o && R?.showLoading, r = ee.length === 0 && p.length === 0 && !n ? d ?? z("renderer.defaultHttpInput.noDataAvailable") : void 0;
1886
+ return /* @__PURE__ */ I(H, {
1887
+ style: Y.container,
1888
+ children: [
1889
+ /* @__PURE__ */ F(E, {
1890
+ label: A,
1891
+ required: D.data.required
1892
+ }),
1893
+ /* @__PURE__ */ F(De, {
1894
+ missing: ee,
1895
+ children: /* @__PURE__ */ I(V, {
1896
+ style: [
1897
+ Y.trigger,
1898
+ {
1899
+ backgroundColor: L.input,
1900
+ borderColor: L.border
1901
+ },
1902
+ k && { borderColor: L.error },
1903
+ (n || p.length === 0) && { backgroundColor: L.muted }
1904
+ ],
1905
+ onPress: () => x(!0),
1906
+ disabled: n || p.length === 0,
1907
+ activeOpacity: .7,
1908
+ children: [
1909
+ /* @__PURE__ */ F(B, {
1910
+ style: [
1911
+ Y.triggerText,
1912
+ { color: L.text },
1913
+ !t && { color: L.textMuted }
1914
+ ],
1915
+ numberOfLines: 1,
1916
+ children: t?.label || T || z("renderer.defaultHttpInput.selectOption")
1917
+ }),
1918
+ n && /* @__PURE__ */ F(ae, {
1919
+ size: "small",
1920
+ color: L.primary,
1921
+ style: Y.triggerLoader
1922
+ }),
1923
+ e ? /* @__PURE__ */ F(V, {
1924
+ onPress: () => O(""),
1925
+ hitSlop: {
1926
+ bottom: 8,
1927
+ left: 8,
1928
+ right: 8,
1929
+ top: 8
1930
+ },
1931
+ style: Y.clearButton,
1932
+ children: /* @__PURE__ */ F(B, {
1933
+ style: [Y.clearIcon, { color: L.textMuted }],
1934
+ children: "✕"
1935
+ })
1936
+ }) : null,
1937
+ /* @__PURE__ */ F(B, {
1938
+ style: [Y.arrow, { color: L.textMuted }],
1939
+ children: "▼"
1940
+ })
1941
+ ]
1942
+ })
1943
+ }),
1944
+ r && /* @__PURE__ */ F(B, {
1945
+ style: [Y.disabledMessage, { color: L.error }],
1946
+ children: r
1947
+ }),
1948
+ /* @__PURE__ */ F(le, {
1949
+ visible: b,
1950
+ transparent: !0,
1951
+ animationType: "fade",
1952
+ onRequestClose: () => x(!1),
1953
+ children: /* @__PURE__ */ F(V, {
1954
+ style: Y.modalOverlay,
1955
+ activeOpacity: 1,
1956
+ onPress: () => x(!1),
1957
+ children: /* @__PURE__ */ I(V, {
1958
+ style: [Y.modalContent, { backgroundColor: L.card }],
1959
+ activeOpacity: 1,
1960
+ onPress: () => {},
1961
+ children: [/* @__PURE__ */ I(H, {
1962
+ style: [Y.modalHeader, { borderBottomColor: L.separator }],
1963
+ children: [/* @__PURE__ */ F(B, {
1964
+ style: [Y.modalTitle, { color: L.text }],
1965
+ children: A || T || z("renderer.defaultHttpInput.selectOption")
1966
+ }), /* @__PURE__ */ F(V, {
1967
+ onPress: () => x(!1),
1968
+ children: /* @__PURE__ */ F(B, {
1969
+ style: [Y.closeButton, { color: L.textMuted }],
1970
+ children: "✕"
1971
+ })
1972
+ })]
1973
+ }), /* @__PURE__ */ F(ce, {
1974
+ data: p,
1975
+ keyExtractor: (e) => e.value,
1976
+ style: Y.optionsList,
1977
+ contentContainerStyle: Y.optionsListContent,
1978
+ renderItem: ({ item: t }) => {
1979
+ let n = t.value === e;
1980
+ return /* @__PURE__ */ I(V, {
1981
+ style: [Y.option, n && { backgroundColor: L.primaryLight }],
1982
+ onPress: () => {
1983
+ O(t.value), x(!1);
1984
+ },
1985
+ activeOpacity: .7,
1986
+ children: [/* @__PURE__ */ F(ye, {
1987
+ label: t.label,
1988
+ description: t.description,
1989
+ image: t.image
1990
+ }), n && /* @__PURE__ */ F(B, {
1991
+ style: [Y.checkmark, { color: L.primary }],
1992
+ children: "✓"
1993
+ })]
1994
+ });
1995
+ }
1996
+ })]
1997
+ })
1998
+ })
1999
+ }),
2000
+ k && /* @__PURE__ */ F(B, {
2001
+ style: [Y.error, { color: L.error }],
2002
+ children: k
2003
+ }),
2004
+ j && !k && /* @__PURE__ */ F(B, {
2005
+ style: [Y.helperText, { color: L.textMuted }],
2006
+ children: j
2007
+ })
2008
+ ]
2009
+ });
2010
+ }
2011
+ return /* @__PURE__ */ I(H, {
2012
+ style: Y.container,
2013
+ children: [
2014
+ /* @__PURE__ */ F(E, {
2015
+ label: A,
2016
+ required: D.data.required
2017
+ }),
2018
+ /* @__PURE__ */ F(de, {
2019
+ style: [Y.input, {
2020
+ backgroundColor: L.muted,
2021
+ borderColor: L.border,
2022
+ color: L.textMuted
2023
+ }],
2024
+ value: typeof C == "string" ? C : JSON.stringify(C),
2025
+ editable: !1
2026
+ }),
2027
+ k && /* @__PURE__ */ F(B, {
2028
+ style: [Y.error, { color: L.error }],
2029
+ children: k
2030
+ }),
2031
+ j && !k && /* @__PURE__ */ F(B, {
2032
+ style: [Y.helperText, { color: L.textMuted }],
2033
+ children: j
2034
+ })
2035
+ ]
2036
+ });
2037
+ }, Y = z.create({
2038
+ arrow: { fontSize: 12 },
2039
+ checkmark: {
2040
+ fontSize: 18,
2041
+ fontWeight: "700"
2042
+ },
2043
+ clearButton: {
2044
+ marginRight: 8,
2045
+ paddingHorizontal: 2
2046
+ },
2047
+ clearIcon: { fontSize: 14 },
2048
+ closeButton: {
2049
+ fontSize: 24,
2050
+ fontWeight: "300"
2051
+ },
2052
+ container: { marginBottom: 16 },
2053
+ disabledMessage: {
2054
+ fontSize: 12,
2055
+ marginTop: 4
2056
+ },
2057
+ emptyContainer: {
2058
+ alignItems: "center",
2059
+ paddingVertical: 24
2060
+ },
2061
+ emptyText: { fontSize: 14 },
2062
+ error: {
2063
+ fontSize: 12,
2064
+ marginTop: 4
2065
+ },
2066
+ errorContainer: {
2067
+ alignItems: "center",
2068
+ paddingVertical: 16
2069
+ },
2070
+ errorText: {
2071
+ fontSize: 14,
2072
+ textAlign: "center"
2073
+ },
2074
+ helperText: {
2075
+ fontSize: 12,
2076
+ marginTop: 4
2077
+ },
2078
+ input: {
2079
+ borderRadius: 6,
2080
+ borderWidth: 1,
2081
+ fontSize: 14,
2082
+ paddingHorizontal: 12,
2083
+ paddingVertical: 10
2084
+ },
2085
+ loadingContainer: {
2086
+ alignItems: "center",
2087
+ paddingVertical: 24
2088
+ },
2089
+ modalContent: {
2090
+ borderRadius: 12,
2091
+ maxHeight: "80%",
2092
+ padding: 16,
2093
+ width: "90%"
2094
+ },
2095
+ modalHeader: {
2096
+ alignItems: "center",
2097
+ borderBottomWidth: 1,
2098
+ flexDirection: "row",
2099
+ justifyContent: "space-between",
2100
+ marginBottom: 12,
2101
+ paddingBottom: 12
2102
+ },
2103
+ modalOverlay: {
2104
+ alignItems: "center",
2105
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
2106
+ flex: 1,
2107
+ justifyContent: "center"
2108
+ },
2109
+ modalTitle: {
2110
+ fontSize: 18,
2111
+ fontWeight: "600"
2112
+ },
2113
+ option: {
2114
+ alignItems: "center",
2115
+ borderRadius: 6,
2116
+ flexDirection: "row",
2117
+ justifyContent: "space-between",
2118
+ paddingHorizontal: 12,
2119
+ paddingVertical: 12
2120
+ },
2121
+ optionsList: {
2122
+ flexGrow: 0,
2123
+ flexShrink: 1
2124
+ },
2125
+ optionsListContent: { flexGrow: 0 },
2126
+ retryButton: { marginTop: 12 },
2127
+ retryButtonText: {
2128
+ fontSize: 14,
2129
+ textDecorationLine: "underline"
2130
+ },
2131
+ searchContainer: { marginBottom: 12 },
2132
+ searchInput: {
2133
+ borderRadius: 6,
2134
+ borderWidth: 1,
2135
+ fontSize: 14,
2136
+ paddingHorizontal: 12,
2137
+ paddingVertical: 10
2138
+ },
2139
+ trigger: {
2140
+ alignItems: "center",
2141
+ borderRadius: 6,
2142
+ borderWidth: 1,
2143
+ flexDirection: "row",
2144
+ justifyContent: "space-between",
2145
+ paddingHorizontal: 12,
2146
+ paddingVertical: 10
2147
+ },
2148
+ triggerLoader: { marginRight: 8 },
2149
+ triggerText: {
2150
+ flex: 1,
2151
+ fontSize: 14
2152
+ }
2153
+ }), Re = ({ field: e, extra: t }) => {
2154
+ let { value: n, placeholder: r, name: i } = e, [a, o] = P(n?.toString() ?? ""), { InputLabel: s, node: c, setValue: l, error: u, label: d, helperText: f } = t, { colors: p } = y();
2155
+ return M(() => {
2156
+ o(n?.toString() ?? "");
2157
+ }, [n]), /* @__PURE__ */ I(H, {
2158
+ style: ze.container,
2159
+ children: [
2160
+ /* @__PURE__ */ F(s, {
2161
+ label: d,
2162
+ required: c.data.required
2163
+ }),
2164
+ /* @__PURE__ */ F(de, {
2165
+ style: [
2166
+ ze.input,
2167
+ {
2168
+ backgroundColor: p.input,
2169
+ borderColor: p.border,
2170
+ color: p.text
2171
+ },
2172
+ u && { borderColor: p.error }
2173
+ ],
2174
+ value: a,
2175
+ onChangeText: (e) => {
2176
+ if (o(e), e.trim() === "") {
2177
+ l(null);
2178
+ return;
2179
+ }
2180
+ let t = Number(e);
2181
+ Number.isNaN(t) || l(t);
2182
+ },
2183
+ placeholder: r,
2184
+ placeholderTextColor: p.textMuted,
2185
+ keyboardType: "numeric",
2186
+ accessibilityLabel: i
2187
+ }),
2188
+ u && /* @__PURE__ */ F(B, {
2189
+ style: [ze.error, { color: p.error }],
2190
+ children: u
2191
+ }),
2192
+ f && !u && /* @__PURE__ */ F(B, {
2193
+ style: [ze.helperText, { color: p.textMuted }],
2194
+ children: f
2195
+ })
2196
+ ]
2197
+ });
2198
+ }, ze = z.create({
2199
+ container: { marginBottom: 16 },
2200
+ error: {
2201
+ fontSize: 12,
2202
+ marginTop: 4
2203
+ },
2204
+ helperText: {
2205
+ fontSize: 12,
2206
+ marginTop: 4
2207
+ },
2208
+ input: {
2209
+ borderRadius: 6,
2210
+ borderWidth: 1,
2211
+ fontSize: 14,
2212
+ paddingHorizontal: 12,
2213
+ paddingVertical: 8
2214
+ }
2215
+ }), Be = ({ field: e, extra: t }) => {
2216
+ let [n, r] = P(!1), { value: i, placeholder: a, name: o } = e, { InputLabel: s, node: c, setValue: l, error: u, label: d, helperText: f } = t, { colors: p } = y();
2217
+ return /* @__PURE__ */ I(H, {
2218
+ style: Ve.container,
2219
+ children: [
2220
+ /* @__PURE__ */ F(s, {
2221
+ label: d,
2222
+ required: c.data.required
2223
+ }),
2224
+ /* @__PURE__ */ I(H, {
2225
+ style: Ve.inputWrapper,
2226
+ children: [/* @__PURE__ */ F(de, {
2227
+ style: [
2228
+ Ve.input,
2229
+ {
2230
+ backgroundColor: p.input,
2231
+ borderColor: p.border,
2232
+ color: p.text
2233
+ },
2234
+ u && { borderColor: p.error }
2235
+ ],
2236
+ value: i ?? "",
2237
+ onChangeText: l,
2238
+ placeholder: a,
2239
+ placeholderTextColor: p.textMuted,
2240
+ secureTextEntry: !n,
2241
+ accessibilityLabel: o
2242
+ }), /* @__PURE__ */ F(V, {
2243
+ style: Ve.toggleButton,
2244
+ onPress: () => r(!n),
2245
+ activeOpacity: .7,
2246
+ children: /* @__PURE__ */ F(B, {
2247
+ style: [Ve.toggleText, { color: p.primary }],
2248
+ children: n ? "Hide" : "Show"
2249
+ })
2250
+ })]
2251
+ }),
2252
+ u && /* @__PURE__ */ F(B, {
2253
+ style: [Ve.error, { color: p.error }],
2254
+ children: u
2255
+ }),
2256
+ f && !u && /* @__PURE__ */ F(B, {
2257
+ style: [Ve.helperText, { color: p.textMuted }],
2258
+ children: f
2259
+ })
2260
+ ]
2261
+ });
2262
+ }, Ve = z.create({
2263
+ container: { marginBottom: 16 },
2264
+ error: {
2265
+ fontSize: 12,
2266
+ marginTop: 4
2267
+ },
2268
+ helperText: {
2269
+ fontSize: 12,
2270
+ marginTop: 4
2271
+ },
2272
+ input: {
2273
+ borderRadius: 6,
2274
+ borderWidth: 1,
2275
+ flex: 1,
2276
+ fontSize: 14,
2277
+ paddingHorizontal: 12,
2278
+ paddingVertical: 8
2279
+ },
2280
+ inputWrapper: {
2281
+ alignItems: "center",
2282
+ flexDirection: "row",
2283
+ position: "relative"
2284
+ },
2285
+ toggleButton: {
2286
+ paddingHorizontal: 12,
2287
+ paddingVertical: 8,
2288
+ position: "absolute",
2289
+ right: 0
2290
+ },
2291
+ toggleText: {
2292
+ fontSize: 12,
2293
+ fontWeight: "600"
2294
+ }
2295
+ }), He = ({ field: e, extra: t }) => {
2296
+ let { value: n } = e, { InputLabel: r, node: i, setValue: a, error: o, label: s, helperText: c } = t, { colors: l } = y(), u = h(), d = i.data.options || [], f = n || "", p = i.data.variant !== "default", m = (e) => {
2297
+ a(e);
2298
+ };
2299
+ return /* @__PURE__ */ I(H, {
2300
+ style: X.container,
2301
+ children: [
2302
+ /* @__PURE__ */ F(r, {
2303
+ label: s,
2304
+ required: i.data.required
2305
+ }),
2306
+ d.map((e) => {
2307
+ let t = f === e.value, n = u(e.label) || e.value, r = u(e.description);
2308
+ return p ? /* @__PURE__ */ I(V, {
2309
+ style: [
2310
+ X.card,
2311
+ {
2312
+ backgroundColor: l.input,
2313
+ borderColor: l.border
2314
+ },
2315
+ t && {
2316
+ backgroundColor: `${l.primary}10`,
2317
+ borderColor: l.primary
2318
+ },
2319
+ e.disabled && { opacity: .5 }
2320
+ ],
2321
+ onPress: () => m(e.value),
2322
+ disabled: e.disabled,
2323
+ activeOpacity: .7,
2324
+ children: [
2325
+ e.image && /* @__PURE__ */ F(L, {
2326
+ source: { uri: e.image },
2327
+ style: X.cardImage
2328
+ }),
2329
+ /* @__PURE__ */ I(H, {
2330
+ style: X.cardTextContainer,
2331
+ children: [/* @__PURE__ */ F(B, {
2332
+ style: [X.cardLabel, { color: l.textSecondary }],
2333
+ children: n
2334
+ }), r && /* @__PURE__ */ F(B, {
2335
+ style: [X.cardDescription, { color: l.textMuted }],
2336
+ children: r
2337
+ })]
2338
+ }),
2339
+ /* @__PURE__ */ F(H, {
2340
+ style: [
2341
+ X.radio,
2342
+ X.cardRadio,
2343
+ {
2344
+ backgroundColor: l.input,
2345
+ borderColor: l.border
2346
+ },
2347
+ t && { borderColor: l.primary }
2348
+ ],
2349
+ children: t && /* @__PURE__ */ F(H, { style: [X.radioInner, { backgroundColor: l.primary }] })
2350
+ })
2351
+ ]
2352
+ }, e.value) : /* @__PURE__ */ I(V, {
2353
+ style: X.option,
2354
+ onPress: () => m(e.value),
2355
+ disabled: e.disabled,
2356
+ activeOpacity: .7,
2357
+ children: [
2358
+ /* @__PURE__ */ F(H, {
2359
+ style: [
2360
+ X.radio,
2361
+ {
2362
+ backgroundColor: l.input,
2363
+ borderColor: l.border
2364
+ },
2365
+ t && { borderColor: l.primary }
2366
+ ],
2367
+ children: t && /* @__PURE__ */ F(H, { style: [X.radioInner, { backgroundColor: l.primary }] })
2368
+ }),
2369
+ e.image && /* @__PURE__ */ F(L, {
2370
+ source: { uri: e.image },
2371
+ style: X.image
2372
+ }),
2373
+ /* @__PURE__ */ I(H, {
2374
+ style: X.optionTextContainer,
2375
+ children: [/* @__PURE__ */ F(B, {
2376
+ style: [
2377
+ X.optionLabel,
2378
+ { color: l.textSecondary },
2379
+ e.disabled && { color: l.textMuted }
2380
+ ],
2381
+ children: n
2382
+ }), r && /* @__PURE__ */ F(B, {
2383
+ style: [X.optionDescription, { color: l.textMuted }],
2384
+ children: r
2385
+ })]
2386
+ })
2387
+ ]
2388
+ }, e.value);
2389
+ }),
2390
+ o && /* @__PURE__ */ F(B, {
2391
+ style: [X.error, { color: l.error }],
2392
+ children: o
2393
+ }),
2394
+ c && !o && /* @__PURE__ */ F(B, {
2395
+ style: [X.helperText, { color: l.textMuted }],
2396
+ children: c
2397
+ })
2398
+ ]
2399
+ });
2400
+ }, X = z.create({
2401
+ card: {
2402
+ alignItems: "center",
2403
+ borderRadius: 8,
2404
+ borderWidth: 1,
2405
+ flexDirection: "row",
2406
+ marginBottom: 8,
2407
+ padding: 16
2408
+ },
2409
+ cardDescription: {
2410
+ fontSize: 12,
2411
+ marginTop: 4
2412
+ },
2413
+ cardImage: {
2414
+ borderRadius: 4,
2415
+ height: 40,
2416
+ marginRight: 12,
2417
+ width: 40
2418
+ },
2419
+ cardLabel: {
2420
+ fontSize: 14,
2421
+ fontWeight: "500"
2422
+ },
2423
+ cardRadio: {
2424
+ marginLeft: 12,
2425
+ marginRight: 0
2426
+ },
2427
+ cardTextContainer: { flex: 1 },
2428
+ container: { marginBottom: 16 },
2429
+ error: {
2430
+ fontSize: 12,
2431
+ marginTop: 4
2432
+ },
2433
+ helperText: {
2434
+ fontSize: 12,
2435
+ marginTop: 4
2436
+ },
2437
+ image: {
2438
+ borderRadius: 4,
2439
+ height: 32,
2440
+ marginRight: 8,
2441
+ width: 32
2442
+ },
2443
+ option: {
2444
+ alignItems: "center",
2445
+ flexDirection: "row",
2446
+ marginBottom: 8
2447
+ },
2448
+ optionDescription: {
2449
+ fontSize: 12,
2450
+ marginTop: 2
2451
+ },
2452
+ optionLabel: { fontSize: 14 },
2453
+ optionTextContainer: { flex: 1 },
2454
+ radio: {
2455
+ alignItems: "center",
2456
+ borderRadius: 10,
2457
+ borderWidth: 2,
2458
+ height: 20,
2459
+ justifyContent: "center",
2460
+ marginRight: 12,
2461
+ width: 20
2462
+ },
2463
+ radioInner: {
2464
+ borderRadius: 5,
2465
+ height: 10,
2466
+ width: 10
2467
+ }
2468
+ }), Ue = ({ field: e, extra: t }) => {
2469
+ let [n, r] = P(!1), { value: i, placeholder: a } = e, { InputLabel: o, node: s, setValue: c, error: l, label: u, helperText: d } = t, { colors: f } = y(), p = h(), m = s.data.options || [], g = s.data.multiple, _ = Array.isArray(i) ? i : i ? [i] : [], v = (e) => {
2470
+ g ? c(_.includes(e) ? _.filter((t) => t !== e) : [..._, e]) : (c(e), r(!1));
2471
+ };
2472
+ return /* @__PURE__ */ I(H, {
2473
+ style: Z.container,
2474
+ children: [
2475
+ /* @__PURE__ */ F(o, {
2476
+ label: u,
2477
+ required: s.data.required
2478
+ }),
2479
+ /* @__PURE__ */ I(V, {
2480
+ style: [
2481
+ Z.trigger,
2482
+ {
2483
+ backgroundColor: f.input,
2484
+ borderColor: f.border
2485
+ },
2486
+ l && { borderColor: f.error }
2487
+ ],
2488
+ onPress: () => r(!0),
2489
+ activeOpacity: .7,
2490
+ children: [
2491
+ /* @__PURE__ */ F(B, {
2492
+ style: [
2493
+ Z.triggerText,
2494
+ { color: f.text },
2495
+ _.length === 0 && { color: f.textMuted }
2496
+ ],
2497
+ children: (() => {
2498
+ if (_.length === 0) return a || "Select...";
2499
+ if (g) return m.filter((e) => _.includes(e.value)).map((e) => p(e.label) || e.value).join(", ");
2500
+ let e = m.find((e) => e.value === _[0]);
2501
+ return e ? p(e.label) || e.value : a || "Select...";
2502
+ })()
2503
+ }),
2504
+ _.length > 0 && /* @__PURE__ */ F(V, {
2505
+ onPress: () => c(g ? [] : ""),
2506
+ hitSlop: {
2507
+ bottom: 8,
2508
+ left: 8,
2509
+ right: 8,
2510
+ top: 8
2511
+ },
2512
+ style: Z.clearButton,
2513
+ children: /* @__PURE__ */ F(B, {
2514
+ style: [Z.clearIcon, { color: f.textMuted }],
2515
+ children: "✕"
2516
+ })
2517
+ }),
2518
+ /* @__PURE__ */ F(B, {
2519
+ style: [Z.arrow, { color: f.textMuted }],
2520
+ children: "▼"
2521
+ })
2522
+ ]
2523
+ }),
2524
+ /* @__PURE__ */ F(le, {
2525
+ visible: n,
2526
+ transparent: !0,
2527
+ animationType: "fade",
2528
+ onRequestClose: () => r(!1),
2529
+ children: /* @__PURE__ */ F(V, {
2530
+ style: Z.modalOverlay,
2531
+ activeOpacity: 1,
2532
+ onPress: () => r(!1),
2533
+ children: /* @__PURE__ */ I(H, {
2534
+ style: [Z.modalContent, { backgroundColor: f.card }],
2535
+ onStartShouldSetResponder: () => !0,
2536
+ children: [
2537
+ /* @__PURE__ */ I(H, {
2538
+ style: [Z.modalHeader, { borderBottomColor: f.border }],
2539
+ children: [/* @__PURE__ */ F(B, {
2540
+ style: [Z.modalTitle, { color: f.text }],
2541
+ children: u || a || p("renderer.defaultSelectInput.selectOption")
2542
+ }), /* @__PURE__ */ F(V, {
2543
+ onPress: () => r(!1),
2544
+ children: /* @__PURE__ */ F(B, {
2545
+ style: [Z.closeButton, { color: f.textMuted }],
2546
+ children: "✕"
2547
+ })
2548
+ })]
2549
+ }),
2550
+ /* @__PURE__ */ F(R, {
2551
+ style: Z.optionsList,
2552
+ children: m.map((e) => {
2553
+ let t = _.includes(e.value);
2554
+ return /* @__PURE__ */ I(V, {
2555
+ style: [Z.option, t && { backgroundColor: `${f.primary}20` }],
2556
+ onPress: () => v(e.value),
2557
+ disabled: e.disabled,
2558
+ activeOpacity: .7,
2559
+ children: [/* @__PURE__ */ F(ye, {
2560
+ label: p(e.label) || e.value,
2561
+ description: p(e.description),
2562
+ image: e.image,
2563
+ disabled: e.disabled
2564
+ }), t && /* @__PURE__ */ F(B, {
2565
+ style: [Z.checkmark, { color: f.primary }],
2566
+ children: "✓"
2567
+ })]
2568
+ }, e.value);
2569
+ })
2570
+ }),
2571
+ g && /* @__PURE__ */ F(V, {
2572
+ style: [Z.doneButton, { backgroundColor: f.primary }],
2573
+ onPress: () => r(!1),
2574
+ children: /* @__PURE__ */ F(B, {
2575
+ style: Z.doneButtonText,
2576
+ children: "Done"
2577
+ })
2578
+ })
2579
+ ]
2580
+ })
2581
+ })
2582
+ }),
2583
+ l && /* @__PURE__ */ F(B, {
2584
+ style: [Z.error, { color: f.error }],
2585
+ children: l
2586
+ }),
2587
+ d && !l && /* @__PURE__ */ F(B, {
2588
+ style: [Z.helperText, { color: f.textMuted }],
2589
+ children: d
2590
+ })
2591
+ ]
2592
+ });
2593
+ }, Z = z.create({
2594
+ arrow: { fontSize: 12 },
2595
+ checkmark: {
2596
+ fontSize: 18,
2597
+ fontWeight: "700"
2598
+ },
2599
+ clearButton: {
2600
+ marginRight: 8,
2601
+ paddingHorizontal: 2
2602
+ },
2603
+ clearIcon: { fontSize: 14 },
2604
+ closeButton: {
2605
+ fontSize: 24,
2606
+ fontWeight: "300"
2607
+ },
2608
+ container: { marginBottom: 16 },
2609
+ doneButton: {
2610
+ alignItems: "center",
2611
+ borderRadius: 6,
2612
+ marginTop: 12,
2613
+ paddingVertical: 12
2614
+ },
2615
+ doneButtonText: {
2616
+ color: "#FFFFFF",
2617
+ fontSize: 16,
2618
+ fontWeight: "600"
2619
+ },
2620
+ error: {
2621
+ fontSize: 12,
2622
+ marginTop: 4
2623
+ },
2624
+ helperText: {
2625
+ fontSize: 12,
2626
+ marginTop: 4
2627
+ },
2628
+ modalContent: {
2629
+ borderRadius: 12,
2630
+ maxHeight: "80%",
2631
+ padding: 16,
2632
+ width: "90%"
2633
+ },
2634
+ modalHeader: {
2635
+ alignItems: "center",
2636
+ borderBottomWidth: 1,
2637
+ flexDirection: "row",
2638
+ justifyContent: "space-between",
2639
+ marginBottom: 12,
2640
+ paddingBottom: 12
2641
+ },
2642
+ modalOverlay: {
2643
+ alignItems: "center",
2644
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
2645
+ flex: 1,
2646
+ justifyContent: "center"
2647
+ },
2648
+ modalTitle: {
2649
+ fontSize: 18,
2650
+ fontWeight: "600"
2651
+ },
2652
+ option: {
2653
+ alignItems: "center",
2654
+ borderRadius: 6,
2655
+ flexDirection: "row",
2656
+ justifyContent: "space-between",
2657
+ paddingHorizontal: 12,
2658
+ paddingVertical: 12
2659
+ },
2660
+ optionsList: { maxHeight: 300 },
2661
+ trigger: {
2662
+ alignItems: "center",
2663
+ borderRadius: 6,
2664
+ borderWidth: 1,
2665
+ flexDirection: "row",
2666
+ justifyContent: "space-between",
2667
+ paddingHorizontal: 12,
2668
+ paddingVertical: 10
2669
+ },
2670
+ triggerText: {
2671
+ flex: 1,
2672
+ fontSize: 14
2673
+ }
2674
+ }), We = (e) => null, Ge = ({ field: e, extra: t }) => {
2675
+ let { value: n } = e, { InputLabel: r, node: i, setValue: a, error: o, label: s, helperText: c } = t, { colors: l } = y(), u = !!n;
2676
+ return /* @__PURE__ */ I(H, {
2677
+ style: Ke.container,
2678
+ children: [
2679
+ /* @__PURE__ */ I(H, {
2680
+ style: Ke.row,
2681
+ children: [/* @__PURE__ */ F(H, {
2682
+ style: Ke.labelContainer,
2683
+ children: /* @__PURE__ */ F(r, {
2684
+ label: s,
2685
+ required: i.data.required
2686
+ })
2687
+ }), /* @__PURE__ */ F(ue, {
2688
+ trackColor: {
2689
+ false: l.border,
2690
+ true: `${l.primary}80`
2691
+ },
2692
+ thumbColor: u ? l.primary : l.card,
2693
+ ios_backgroundColor: l.border,
2694
+ onValueChange: a,
2695
+ value: u
2696
+ })]
2697
+ }),
2698
+ o && /* @__PURE__ */ F(B, {
2699
+ style: [Ke.error, { color: l.error }],
2700
+ children: o
2701
+ }),
2702
+ c && !o && /* @__PURE__ */ F(B, {
2703
+ style: [Ke.helperText, { color: l.textMuted }],
2704
+ children: c
2705
+ })
2706
+ ]
2707
+ });
2708
+ }, Ke = z.create({
2709
+ container: { marginBottom: 16 },
2710
+ error: {
2711
+ fontSize: 12,
2712
+ marginTop: 4
2713
+ },
2714
+ helperText: {
2715
+ fontSize: 12,
2716
+ marginTop: 4
2717
+ },
2718
+ labelContainer: { flex: 1 },
2719
+ row: {
2720
+ alignItems: "center",
2721
+ flexDirection: "row",
2722
+ justifyContent: "space-between"
2723
+ }
2724
+ }), qe = ({ field: e, extra: t }) => {
2725
+ let { value: n, placeholder: r, name: i } = e, { InputLabel: a, node: o, setValue: s, error: c, label: l, helperText: u } = t, { colors: d } = y();
2726
+ return /* @__PURE__ */ I(H, {
2727
+ style: Je.container,
2728
+ children: [
2729
+ /* @__PURE__ */ F(a, {
2730
+ label: l,
2731
+ required: o.data.required
2732
+ }),
2733
+ /* @__PURE__ */ F(de, {
2734
+ style: [
2735
+ Je.textarea,
2736
+ {
2737
+ backgroundColor: d.input,
2738
+ borderColor: d.border,
2739
+ color: d.text
2740
+ },
2741
+ c && { borderColor: d.error }
2742
+ ],
2743
+ value: n ?? "",
2744
+ onChangeText: s,
2745
+ placeholder: r,
2746
+ placeholderTextColor: d.textMuted,
2747
+ multiline: !0,
2748
+ numberOfLines: 4,
2749
+ textAlignVertical: "top",
2750
+ accessibilityLabel: i
2751
+ }),
2752
+ c && /* @__PURE__ */ F(B, {
2753
+ style: [Je.error, { color: d.error }],
2754
+ children: c
2755
+ }),
2756
+ u && !c && /* @__PURE__ */ F(B, {
2757
+ style: [Je.helperText, { color: d.textMuted }],
2758
+ children: u
2759
+ })
2760
+ ]
2761
+ });
2762
+ }, Je = z.create({
2763
+ container: { marginBottom: 16 },
2764
+ error: {
2765
+ fontSize: 12,
2766
+ marginTop: 4
2767
+ },
2768
+ helperText: {
2769
+ fontSize: 12,
2770
+ marginTop: 4
2771
+ },
2772
+ textarea: {
2773
+ borderRadius: 6,
2774
+ borderWidth: 1,
2775
+ fontSize: 14,
2776
+ minHeight: 100,
2777
+ paddingHorizontal: 12,
2778
+ paddingVertical: 8
2779
+ }
2780
+ }), Ye = ({ field: e, extra: t }) => {
2781
+ let { value: n, placeholder: r, name: i } = e, { InputLabel: a, node: o, setValue: s, error: c, label: l, helperText: u } = t, { colors: d } = y();
2782
+ return /* @__PURE__ */ I(H, {
2783
+ style: Xe.container,
2784
+ children: [
2785
+ /* @__PURE__ */ F(a, {
2786
+ label: l,
2787
+ required: o.data.required
2788
+ }),
2789
+ /* @__PURE__ */ F(de, {
2790
+ style: [
2791
+ Xe.input,
2792
+ {
2793
+ backgroundColor: d.input,
2794
+ borderColor: d.border,
2795
+ color: d.text
2796
+ },
2797
+ c && { borderColor: d.error }
2798
+ ],
2799
+ value: n ?? "",
2800
+ onChangeText: s,
2801
+ placeholder: r,
2802
+ placeholderTextColor: d.textMuted,
2803
+ accessibilityLabel: i
2804
+ }),
2805
+ c && /* @__PURE__ */ F(B, {
2806
+ style: [Xe.error, { color: d.error }],
2807
+ children: c
2808
+ }),
2809
+ u && !c && /* @__PURE__ */ F(B, {
2810
+ style: [Xe.helperText, { color: d.textMuted }],
2811
+ children: u
2812
+ })
2813
+ ]
2814
+ });
2815
+ }, Xe = z.create({
2816
+ container: { marginBottom: 16 },
2817
+ error: {
2818
+ fontSize: 12,
2819
+ marginTop: 4
2820
+ },
2821
+ helperText: {
2822
+ fontSize: 12,
2823
+ marginTop: 4
2824
+ },
2825
+ input: {
2826
+ borderRadius: 6,
2827
+ borderWidth: 1,
2828
+ fontSize: 14,
2829
+ paddingHorizontal: 12,
2830
+ paddingVertical: 8
2831
+ }
2832
+ }), Ze = ({ field: e, extra: t }) => {
2833
+ let { value: n, placeholder: r } = e, i = (n || "").split(":"), a = Number.parseInt(i[0], 10), o = Number.parseInt(i[1], 10), s = Number.isNaN(a) ? 0 : a, c = Number.isNaN(o) ? 0 : o, [l, u] = P(s || 0), [d, f] = P(c || 0), [p, m] = P(!1), { InputLabel: g, node: _, setValue: v, error: b, label: x, helperText: S } = t, { colors: C } = y(), w = h(), T = N(null), E = N(null), D = Array.from({ length: 24 }, (e, t) => t), O = Array.from({ length: 60 }, (e, t) => t), k = () => n || r || w("renderer.defaultInputs.selectTime"), A = ne(() => {
2834
+ v(`${String(l).padStart(2, "0")}:${String(d).padStart(2, "0")}`), m(!1);
2835
+ }, [
2836
+ l,
2837
+ d,
2838
+ v
2839
+ ]);
2840
+ return /* @__PURE__ */ I(H, {
2841
+ style: Q.container,
2842
+ children: [
2843
+ /* @__PURE__ */ F(g, {
2844
+ label: x,
2845
+ required: _.data.required
2846
+ }),
2847
+ /* @__PURE__ */ I(V, {
2848
+ style: [
2849
+ Q.trigger,
2850
+ {
2851
+ backgroundColor: C.input,
2852
+ borderColor: C.border
2853
+ },
2854
+ b && { borderColor: C.error }
2855
+ ],
2856
+ onPress: () => {
2857
+ u(s || 0), f(c || 0), m(!0);
2858
+ },
2859
+ activeOpacity: .7,
2860
+ children: [/* @__PURE__ */ F(B, {
2861
+ style: [
2862
+ Q.triggerText,
2863
+ { color: C.text },
2864
+ !n && { color: C.textMuted }
2865
+ ],
2866
+ numberOfLines: 1,
2867
+ children: k()
2868
+ }), /* @__PURE__ */ F(B, {
2869
+ style: Q.icon,
2870
+ children: "🕐"
2871
+ })]
2872
+ }),
2873
+ /* @__PURE__ */ F(le, {
2874
+ visible: p,
2875
+ transparent: !0,
2876
+ animationType: "fade",
2877
+ onRequestClose: () => m(!1),
2878
+ children: /* @__PURE__ */ F(V, {
2879
+ style: Q.modalOverlay,
2880
+ activeOpacity: 1,
2881
+ onPress: () => m(!1),
2882
+ children: /* @__PURE__ */ I(V, {
2883
+ style: [Q.modalContent, { backgroundColor: C.card }],
2884
+ activeOpacity: 1,
2885
+ onPress: () => {},
2886
+ children: [
2887
+ /* @__PURE__ */ I(H, {
2888
+ style: [Q.modalHeader, { borderBottomColor: C.separator }],
2889
+ children: [/* @__PURE__ */ F(B, {
2890
+ style: [Q.modalTitle, { color: C.text }],
2891
+ children: x || r || w("renderer.defaultInputs.selectTime")
2892
+ }), /* @__PURE__ */ F(V, {
2893
+ onPress: () => m(!1),
2894
+ children: /* @__PURE__ */ F(B, {
2895
+ style: [Q.closeButton, { color: C.textMuted }],
2896
+ children: "✕"
2897
+ })
2898
+ })]
2899
+ }),
2900
+ /* @__PURE__ */ I(H, {
2901
+ style: Q.pickerContainer,
2902
+ children: [
2903
+ /* @__PURE__ */ I(H, {
2904
+ style: Q.pickerColumn,
2905
+ children: [/* @__PURE__ */ F(B, {
2906
+ style: [Q.pickerLabel, { color: C.textMuted }],
2907
+ children: "Hour"
2908
+ }), /* @__PURE__ */ F(R, {
2909
+ ref: T,
2910
+ style: Q.picker,
2911
+ contentContainerStyle: Q.pickerContent,
2912
+ showsVerticalScrollIndicator: !1,
2913
+ children: D.map((e) => /* @__PURE__ */ F(V, {
2914
+ style: [Q.pickerItem, l === e && { backgroundColor: C.primary }],
2915
+ onPress: () => u(e),
2916
+ activeOpacity: .7,
2917
+ children: /* @__PURE__ */ F(B, {
2918
+ style: [
2919
+ Q.pickerItemText,
2920
+ { color: C.text },
2921
+ l === e && {
2922
+ color: C.background,
2923
+ fontWeight: "600"
2924
+ }
2925
+ ],
2926
+ children: String(e).padStart(2, "0")
2927
+ })
2928
+ }, e))
2929
+ })]
2930
+ }),
2931
+ /* @__PURE__ */ F(B, {
2932
+ style: [Q.pickerSeparator, { color: C.text }],
2933
+ children: ":"
2934
+ }),
2935
+ /* @__PURE__ */ I(H, {
2936
+ style: Q.pickerColumn,
2937
+ children: [/* @__PURE__ */ F(B, {
2938
+ style: [Q.pickerLabel, { color: C.textMuted }],
2939
+ children: "Minute"
2940
+ }), /* @__PURE__ */ F(R, {
2941
+ ref: E,
2942
+ style: Q.picker,
2943
+ contentContainerStyle: Q.pickerContent,
2944
+ showsVerticalScrollIndicator: !1,
2945
+ children: O.map((e) => /* @__PURE__ */ F(V, {
2946
+ style: [Q.pickerItem, d === e && { backgroundColor: C.primary }],
2947
+ onPress: () => f(e),
2948
+ activeOpacity: .7,
2949
+ children: /* @__PURE__ */ F(B, {
2950
+ style: [
2951
+ Q.pickerItemText,
2952
+ { color: C.text },
2953
+ d === e && {
2954
+ color: C.background,
2955
+ fontWeight: "600"
2956
+ }
2957
+ ],
2958
+ children: String(e).padStart(2, "0")
2959
+ })
2960
+ }, e))
2961
+ })]
2962
+ })
2963
+ ]
2964
+ }),
2965
+ /* @__PURE__ */ F(V, {
2966
+ style: [Q.confirmButton, { backgroundColor: C.primary }],
2967
+ onPress: A,
2968
+ activeOpacity: .7,
2969
+ children: /* @__PURE__ */ F(B, {
2970
+ style: [Q.confirmButtonText, { color: C.background }],
2971
+ children: "Confirm"
2972
+ })
2973
+ })
2974
+ ]
2975
+ })
2976
+ })
2977
+ }),
2978
+ b && /* @__PURE__ */ F(B, {
2979
+ style: [Q.error, { color: C.error }],
2980
+ children: b
2981
+ }),
2982
+ S && !b && /* @__PURE__ */ F(B, {
2983
+ style: [Q.helperText, { color: C.textMuted }],
2984
+ children: S
2985
+ })
2986
+ ]
2987
+ });
2988
+ }, Q = z.create({
2989
+ closeButton: {
2990
+ fontSize: 24,
2991
+ fontWeight: "300"
2992
+ },
2993
+ confirmButton: {
2994
+ alignItems: "center",
2995
+ borderRadius: 6,
2996
+ marginTop: 16,
2997
+ paddingVertical: 12
2998
+ },
2999
+ confirmButtonText: {
3000
+ fontSize: 16,
3001
+ fontWeight: "600"
3002
+ },
3003
+ container: { marginBottom: 16 },
3004
+ error: {
3005
+ fontSize: 12,
3006
+ marginTop: 4
3007
+ },
3008
+ helperText: {
3009
+ fontSize: 12,
3010
+ marginTop: 4
3011
+ },
3012
+ icon: { fontSize: 16 },
3013
+ modalContent: {
3014
+ borderRadius: 12,
3015
+ padding: 16,
3016
+ width: "80%"
3017
+ },
3018
+ modalHeader: {
3019
+ alignItems: "center",
3020
+ borderBottomWidth: 1,
3021
+ flexDirection: "row",
3022
+ justifyContent: "space-between",
3023
+ marginBottom: 16,
3024
+ paddingBottom: 12
3025
+ },
3026
+ modalOverlay: {
3027
+ alignItems: "center",
3028
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
3029
+ flex: 1,
3030
+ justifyContent: "center"
3031
+ },
3032
+ modalTitle: {
3033
+ fontSize: 18,
3034
+ fontWeight: "600"
3035
+ },
3036
+ picker: { maxHeight: 200 },
3037
+ pickerColumn: { flex: 1 },
3038
+ pickerContainer: {
3039
+ alignItems: "center",
3040
+ flexDirection: "row",
3041
+ gap: 8
3042
+ },
3043
+ pickerContent: { paddingVertical: 8 },
3044
+ pickerItem: {
3045
+ alignItems: "center",
3046
+ borderRadius: 6,
3047
+ marginVertical: 2,
3048
+ paddingVertical: 10
3049
+ },
3050
+ pickerItemText: { fontSize: 18 },
3051
+ pickerLabel: {
3052
+ fontSize: 12,
3053
+ fontWeight: "600",
3054
+ marginBottom: 8,
3055
+ textAlign: "center"
3056
+ },
3057
+ pickerSeparator: {
3058
+ fontSize: 24,
3059
+ fontWeight: "600"
3060
+ },
3061
+ trigger: {
3062
+ alignItems: "center",
3063
+ borderRadius: 6,
3064
+ borderWidth: 1,
3065
+ flexDirection: "row",
3066
+ justifyContent: "space-between",
3067
+ paddingHorizontal: 12,
3068
+ paddingVertical: 10
3069
+ },
3070
+ triggerText: {
3071
+ flex: 1,
3072
+ fontSize: 14
3073
+ }
3074
+ }), Qe = ({ field: e, extra: t }) => {
3075
+ let [n, r] = P(!1), [i, a] = P(!0), { value: o } = e, { InputLabel: s, node: c, setValue: l, error: u, label: d, helperText: f } = t, { colors: p } = y(), m = h(), g = Array.isArray(o) ? o : [], _ = g[0] || "", v = g[1] || "", b = _.split(":"), x = Number.parseInt(b[0], 10), S = Number.parseInt(b[1], 10), C = Number.isNaN(x) ? 0 : x, w = Number.isNaN(S) ? 0 : S, T = v.split(":"), E = Number.parseInt(T[0], 10), D = Number.parseInt(T[1], 10), O = Number.isNaN(E) ? 0 : E, k = Number.isNaN(D) ? 0 : D, [A, j] = P(0), [ee, te] = P(0), M = Array.from({ length: 24 }, (e, t) => t), re = Array.from({ length: 60 }, (e, t) => t), N = () => _ && v ? `${_} - ${v}` : _ || m("renderer.defaultInputs.selectTimeRange"), ie = ne(() => {
3076
+ let e = `${String(A).padStart(2, "0")}:${String(ee).padStart(2, "0")}`;
3077
+ i ? (l([e, v]), a(!1), j(O || 0), te(k || 0)) : (l([_, e]), r(!1), a(!0));
3078
+ }, [
3079
+ i,
3080
+ A,
3081
+ ee,
3082
+ _,
3083
+ v,
3084
+ O,
3085
+ k,
3086
+ l
3087
+ ]);
3088
+ return /* @__PURE__ */ I(H, {
3089
+ style: $.container,
3090
+ children: [
3091
+ /* @__PURE__ */ F(s, {
3092
+ label: d,
3093
+ required: c.data.required
3094
+ }),
3095
+ /* @__PURE__ */ I(V, {
3096
+ style: [
3097
+ $.trigger,
3098
+ {
3099
+ backgroundColor: p.input,
3100
+ borderColor: p.border
3101
+ },
3102
+ u && { borderColor: p.error }
3103
+ ],
3104
+ onPress: () => {
3105
+ j(C || 0), te(w || 0), a(!0), r(!0);
3106
+ },
3107
+ activeOpacity: .7,
3108
+ children: [/* @__PURE__ */ F(B, {
3109
+ style: [
3110
+ $.triggerText,
3111
+ { color: p.text },
3112
+ !_ && { color: p.textMuted }
3113
+ ],
3114
+ numberOfLines: 1,
3115
+ children: N()
3116
+ }), /* @__PURE__ */ F(B, {
3117
+ style: $.icon,
3118
+ children: "🕐"
3119
+ })]
3120
+ }),
3121
+ /* @__PURE__ */ F(le, {
3122
+ visible: n,
3123
+ transparent: !0,
3124
+ animationType: "fade",
3125
+ onRequestClose: () => r(!1),
3126
+ children: /* @__PURE__ */ F(V, {
3127
+ style: $.modalOverlay,
3128
+ activeOpacity: 1,
3129
+ onPress: () => r(!1),
3130
+ children: /* @__PURE__ */ I(V, {
3131
+ style: [$.modalContent, { backgroundColor: p.card }],
3132
+ activeOpacity: 1,
3133
+ onPress: () => {},
3134
+ children: [
3135
+ /* @__PURE__ */ I(H, {
3136
+ style: [$.modalHeader, { borderBottomColor: p.separator }],
3137
+ children: [/* @__PURE__ */ F(B, {
3138
+ style: [$.modalTitle, { color: p.text }],
3139
+ children: d || m("renderer.defaultInputs.selectTimeRange")
3140
+ }), /* @__PURE__ */ F(V, {
3141
+ onPress: () => r(!1),
3142
+ children: /* @__PURE__ */ F(B, {
3143
+ style: [$.closeButton, { color: p.textMuted }],
3144
+ children: "✕"
3145
+ })
3146
+ })]
3147
+ }),
3148
+ /* @__PURE__ */ F(H, {
3149
+ style: [$.rangeIndicator, { backgroundColor: p.primaryLight }],
3150
+ children: /* @__PURE__ */ F(B, {
3151
+ style: [$.rangeIndicatorText, { color: p.primary }],
3152
+ children: m(i ? "renderer.defaultInputs.startTime" : "renderer.defaultInputs.endTime")
3153
+ })
3154
+ }),
3155
+ /* @__PURE__ */ I(H, {
3156
+ style: $.pickerContainer,
3157
+ children: [
3158
+ /* @__PURE__ */ I(H, {
3159
+ style: $.pickerColumn,
3160
+ children: [/* @__PURE__ */ F(B, {
3161
+ style: [$.pickerLabel, { color: p.textMuted }],
3162
+ children: "Hour"
3163
+ }), /* @__PURE__ */ F(R, {
3164
+ style: $.picker,
3165
+ contentContainerStyle: $.pickerContent,
3166
+ showsVerticalScrollIndicator: !1,
3167
+ children: M.map((e) => /* @__PURE__ */ F(V, {
3168
+ style: [$.pickerItem, A === e && { backgroundColor: p.primary }],
3169
+ onPress: () => j(e),
3170
+ activeOpacity: .7,
3171
+ children: /* @__PURE__ */ F(B, {
3172
+ style: [
3173
+ $.pickerItemText,
3174
+ { color: p.text },
3175
+ A === e && {
3176
+ color: p.background,
3177
+ fontWeight: "600"
3178
+ }
3179
+ ],
3180
+ children: String(e).padStart(2, "0")
3181
+ })
3182
+ }, e))
3183
+ })]
3184
+ }),
3185
+ /* @__PURE__ */ F(B, {
3186
+ style: [$.pickerSeparator, { color: p.text }],
3187
+ children: ":"
3188
+ }),
3189
+ /* @__PURE__ */ I(H, {
3190
+ style: $.pickerColumn,
3191
+ children: [/* @__PURE__ */ F(B, {
3192
+ style: [$.pickerLabel, { color: p.textMuted }],
3193
+ children: "Minute"
3194
+ }), /* @__PURE__ */ F(R, {
3195
+ style: $.picker,
3196
+ contentContainerStyle: $.pickerContent,
3197
+ showsVerticalScrollIndicator: !1,
3198
+ children: re.map((e) => /* @__PURE__ */ F(V, {
3199
+ style: [$.pickerItem, ee === e && { backgroundColor: p.primary }],
3200
+ onPress: () => te(e),
3201
+ activeOpacity: .7,
3202
+ children: /* @__PURE__ */ F(B, {
3203
+ style: [
3204
+ $.pickerItemText,
3205
+ { color: p.text },
3206
+ ee === e && {
3207
+ color: p.background,
3208
+ fontWeight: "600"
3209
+ }
3210
+ ],
3211
+ children: String(e).padStart(2, "0")
3212
+ })
3213
+ }, e))
3214
+ })]
3215
+ })
3216
+ ]
3217
+ }),
3218
+ /* @__PURE__ */ F(V, {
3219
+ style: [$.confirmButton, { backgroundColor: p.primary }],
3220
+ onPress: ie,
3221
+ activeOpacity: .7,
3222
+ children: /* @__PURE__ */ F(B, {
3223
+ style: [$.confirmButtonText, { color: p.background }],
3224
+ children: i ? "Next" : "Confirm"
3225
+ })
3226
+ })
3227
+ ]
3228
+ })
3229
+ })
3230
+ }),
3231
+ u && /* @__PURE__ */ F(B, {
3232
+ style: [$.error, { color: p.error }],
3233
+ children: u
3234
+ }),
3235
+ f && !u && /* @__PURE__ */ F(B, {
3236
+ style: [$.helperText, { color: p.textMuted }],
3237
+ children: f
3238
+ })
3239
+ ]
3240
+ });
3241
+ }, $ = z.create({
3242
+ closeButton: {
3243
+ fontSize: 24,
3244
+ fontWeight: "300"
3245
+ },
3246
+ confirmButton: {
3247
+ alignItems: "center",
3248
+ borderRadius: 6,
3249
+ marginTop: 16,
3250
+ paddingVertical: 12
3251
+ },
3252
+ confirmButtonText: {
3253
+ fontSize: 16,
3254
+ fontWeight: "600"
3255
+ },
3256
+ container: { marginBottom: 16 },
3257
+ error: {
3258
+ fontSize: 12,
3259
+ marginTop: 4
3260
+ },
3261
+ helperText: {
3262
+ fontSize: 12,
3263
+ marginTop: 4
3264
+ },
3265
+ icon: { fontSize: 16 },
3266
+ modalContent: {
3267
+ borderRadius: 12,
3268
+ padding: 16,
3269
+ width: "80%"
3270
+ },
3271
+ modalHeader: {
3272
+ alignItems: "center",
3273
+ borderBottomWidth: 1,
3274
+ flexDirection: "row",
3275
+ justifyContent: "space-between",
3276
+ marginBottom: 12,
3277
+ paddingBottom: 12
3278
+ },
3279
+ modalOverlay: {
3280
+ alignItems: "center",
3281
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
3282
+ flex: 1,
3283
+ justifyContent: "center"
3284
+ },
3285
+ modalTitle: {
3286
+ fontSize: 18,
3287
+ fontWeight: "600"
3288
+ },
3289
+ picker: { maxHeight: 200 },
3290
+ pickerColumn: { flex: 1 },
3291
+ pickerContainer: {
3292
+ alignItems: "center",
3293
+ flexDirection: "row",
3294
+ gap: 8
3295
+ },
3296
+ pickerContent: { paddingVertical: 8 },
3297
+ pickerItem: {
3298
+ alignItems: "center",
3299
+ borderRadius: 6,
3300
+ marginVertical: 2,
3301
+ paddingVertical: 10
3302
+ },
3303
+ pickerItemText: { fontSize: 18 },
3304
+ pickerLabel: {
3305
+ fontSize: 12,
3306
+ fontWeight: "600",
3307
+ marginBottom: 8,
3308
+ textAlign: "center"
3309
+ },
3310
+ pickerSeparator: {
3311
+ fontSize: 24,
3312
+ fontWeight: "600"
3313
+ },
3314
+ rangeIndicator: {
3315
+ alignItems: "center",
3316
+ borderRadius: 6,
3317
+ marginBottom: 12,
3318
+ paddingVertical: 8
3319
+ },
3320
+ rangeIndicatorText: {
3321
+ fontSize: 14,
3322
+ fontWeight: "600"
3323
+ },
3324
+ trigger: {
3325
+ alignItems: "center",
3326
+ borderRadius: 6,
3327
+ borderWidth: 1,
3328
+ flexDirection: "row",
3329
+ justifyContent: "space-between",
3330
+ paddingHorizontal: 12,
3331
+ paddingVertical: 10
3332
+ },
3333
+ triggerText: {
3334
+ flex: 1,
3335
+ fontSize: 14
3336
+ }
3337
+ }), $e = {
3338
+ address: ve,
3339
+ autocomplete: xe,
3340
+ checkbox: Se,
3341
+ date: Ce,
3342
+ daterange: we,
3343
+ file: Te,
3344
+ hidden: Ee,
3345
+ http: Le,
3346
+ number: Re,
3347
+ password: Be,
3348
+ radio: He,
3349
+ select: Ue,
3350
+ submit: We,
3351
+ switch: Ge,
3352
+ text: Ye,
3353
+ textarea: qe,
3354
+ time: Ze,
3355
+ timerange: Qe
3356
+ }, et = ({ step: e, label: t, children: n, canGoBack: r, isLastStep: a, canContinue: o, isSubmitting: s, onBack: c, onContinue: l }) => {
3357
+ let { colors: u } = y(), d = h(), f = !o || s, p = e.nodes.find((e) => i(e) && e.data.type === "submit"), m = p && i(p) ? d(p.data.label) : void 0, g = a ? m || d("renderer.defaultSubmitButton.submit") : d("renderer.step.continue");
3358
+ return /* @__PURE__ */ I(H, { children: [
3359
+ t ? /* @__PURE__ */ F(B, {
3360
+ style: [tt.label, { color: u.text }],
3361
+ children: t
3362
+ }) : null,
3363
+ /* @__PURE__ */ F(H, {
3364
+ style: tt.content,
3365
+ children: n
3366
+ }),
3367
+ /* @__PURE__ */ I(H, {
3368
+ style: tt.actions,
3369
+ children: [r ? /* @__PURE__ */ F(V, {
3370
+ style: [
3371
+ tt.backButton,
3372
+ { borderColor: u.border },
3373
+ s && tt.disabled
3374
+ ],
3375
+ onPress: c,
3376
+ disabled: s,
3377
+ activeOpacity: .7,
3378
+ children: /* @__PURE__ */ F(B, {
3379
+ style: [tt.backButtonText, { color: u.text }],
3380
+ children: d("renderer.step.back")
3381
+ })
3382
+ }) : /* @__PURE__ */ F(H, {}), /* @__PURE__ */ F(V, {
3383
+ style: [
3384
+ tt.continueButton,
3385
+ { backgroundColor: u.primary },
3386
+ f && {
3387
+ backgroundColor: u.primaryDisabled,
3388
+ opacity: .6
3389
+ }
3390
+ ],
3391
+ onPress: l,
3392
+ disabled: f,
3393
+ activeOpacity: .7,
3394
+ children: s ? /* @__PURE__ */ F(ae, { color: u.primaryForeground }) : /* @__PURE__ */ F(B, {
3395
+ style: [tt.continueButtonText, { color: u.primaryForeground }],
3396
+ children: g
3397
+ })
3398
+ })]
3399
+ })
3400
+ ] });
3401
+ }, tt = z.create({
3402
+ actions: {
3403
+ alignItems: "center",
3404
+ flexDirection: "row",
3405
+ justifyContent: "space-between",
3406
+ marginTop: 24
3407
+ },
3408
+ backButton: {
3409
+ borderRadius: 6,
3410
+ borderWidth: 1,
3411
+ paddingHorizontal: 16,
3412
+ paddingVertical: 10
3413
+ },
3414
+ backButtonText: {
3415
+ fontSize: 14,
3416
+ fontWeight: "500"
3417
+ },
3418
+ content: { gap: 8 },
3419
+ continueButton: {
3420
+ alignItems: "center",
3421
+ borderRadius: 6,
3422
+ justifyContent: "center",
3423
+ paddingHorizontal: 24,
3424
+ paddingVertical: 12
3425
+ },
3426
+ continueButtonText: {
3427
+ fontSize: 14,
3428
+ fontWeight: "600"
3429
+ },
3430
+ disabled: { opacity: .5 },
3431
+ label: {
3432
+ fontSize: 16,
3433
+ fontWeight: "600",
3434
+ marginBottom: 12
3435
+ }
3436
+ }), nt = ({ children: e = "Submit", disabled: t, isSubmitting: n, onPress: r }) => {
3437
+ let { colors: i } = y();
3438
+ return /* @__PURE__ */ F(V, {
3439
+ style: [
3440
+ rt.button,
3441
+ { backgroundColor: i.primary },
3442
+ (t || n) && {
3443
+ backgroundColor: i.primaryDisabled,
3444
+ opacity: .6
3445
+ }
3446
+ ],
3447
+ disabled: t || n,
3448
+ onPress: r,
3449
+ activeOpacity: .7,
3450
+ children: n ? /* @__PURE__ */ F(ae, { color: i.primaryForeground }) : /* @__PURE__ */ F(B, {
3451
+ style: [rt.buttonText, { color: i.primaryForeground }],
3452
+ children: e
3453
+ })
3454
+ });
3455
+ }, rt = z.create({
3456
+ button: {
3457
+ alignItems: "center",
3458
+ borderRadius: 6,
3459
+ justifyContent: "center",
3460
+ marginTop: 16,
3461
+ paddingHorizontal: 24,
3462
+ paddingVertical: 12
3463
+ },
3464
+ buttonText: {
3465
+ fontSize: 16,
3466
+ fontWeight: "600"
3467
+ }
3468
+ }), it = ({ children: e }) => e, at = ({ node: e }) => {
3469
+ let t = h(), { colors: n } = y(), r = t(e.data?.label);
3470
+ return /* @__PURE__ */ F(B, {
3471
+ style: [st.title, { color: n.text }],
3472
+ children: r
3473
+ });
3474
+ }, ot = () => {
3475
+ let { colors: e } = y();
3476
+ return /* @__PURE__ */ F(H, { style: [st.divider, { backgroundColor: e.separator }] });
3477
+ }, st = z.create({
3478
+ divider: {
3479
+ height: 1,
3480
+ marginBottom: 16,
3481
+ marginTop: 0
3482
+ },
3483
+ title: {
3484
+ fontSize: 20,
3485
+ fontWeight: "700",
3486
+ marginBottom: 16
3487
+ }
3488
+ }), ct = {
3489
+ divider: ot,
3490
+ title: at
3491
+ }, lt = ({ node: e, children: t }) => {
3492
+ let { image: n } = e.data;
3493
+ return /* @__PURE__ */ I(H, { children: [n && /* @__PURE__ */ F(L, {
3494
+ source: { uri: n },
3495
+ style: ut.image,
3496
+ resizeMode: "cover"
3497
+ }), t] });
3498
+ }, ut = z.create({ image: {
3499
+ borderRadius: 6,
3500
+ height: 160,
3501
+ marginBottom: 8,
3502
+ width: "100%"
3503
+ } }), dt = ({ style: e }) => {
3504
+ let { colors: t } = y(), n = N(new se.Value(.5)).current;
3505
+ return M(() => {
3506
+ let e = se.loop(se.sequence([se.timing(n, {
3507
+ duration: 600,
3508
+ toValue: 1,
3509
+ useNativeDriver: !0
3510
+ }), se.timing(n, {
3511
+ duration: 600,
3512
+ toValue: .5,
3513
+ useNativeDriver: !0
3514
+ })]));
3515
+ return e.start(), () => e.stop();
3516
+ }, [n]), /* @__PURE__ */ F(se.View, { style: [
3517
+ pt.bar,
3518
+ {
3519
+ backgroundColor: t.muted,
3520
+ opacity: n
3521
+ },
3522
+ e
3523
+ ] });
3524
+ }, ft = () => /* @__PURE__ */ I(H, {
3525
+ accessibilityState: { busy: !0 },
3526
+ children: [
3527
+ /* @__PURE__ */ F(dt, { style: pt.title }),
3528
+ /* @__PURE__ */ F(H, {
3529
+ style: pt.fields,
3530
+ children: [
3531
+ 0,
3532
+ 1,
3533
+ 2
3534
+ ].map((e) => /* @__PURE__ */ I(H, {
3535
+ style: pt.field,
3536
+ children: [/* @__PURE__ */ F(dt, { style: pt.fieldLabel }), /* @__PURE__ */ F(dt, { style: pt.fieldInput })]
3537
+ }, e))
3538
+ }),
3539
+ /* @__PURE__ */ F(H, {
3540
+ style: pt.actions,
3541
+ children: /* @__PURE__ */ F(dt, { style: pt.button })
3542
+ })
3543
+ ]
3544
+ }), pt = z.create({
3545
+ actions: {
3546
+ alignItems: "flex-end",
3547
+ marginTop: 24
3548
+ },
3549
+ bar: { borderRadius: 6 },
3550
+ button: {
3551
+ height: 44,
3552
+ width: 120
3553
+ },
3554
+ field: { gap: 8 },
3555
+ fieldInput: {
3556
+ height: 44,
3557
+ width: "100%"
3558
+ },
3559
+ fieldLabel: {
3560
+ height: 16,
3561
+ width: "25%"
3562
+ },
3563
+ fields: { gap: 24 },
3564
+ title: {
3565
+ height: 24,
3566
+ marginBottom: 24,
3567
+ width: "33%"
3568
+ }
3569
+ }), mt = ({ baseUrl: e, components: t, contentContainerStyle: n, flow: r, googleApiKey: i, headers: a, initialValues: s, isLoading: c = !1, isSubmitting: l = !1, language: u, onBack: d, onChange: f, onSubmit: p, showPoweredBy: m, style: h, theme: g, validate: _, validationMode: v }) => {
3570
+ let { colors: b } = y(), { canContinueStep: x, canSubmit: S, clearSubmitMessage: C, config: w, currentStep: T, currentStepGroupNode: E, currentStepIndex: D, formErrors: O, formValues: A, goToNextStep: j, goToPreviousStep: ee, handleSubmit: M, inputNodes: N, isFirstStep: P, isLastStep: ie, isSubmitting: ae, missingRequiredFields: oe, setFieldValue: se, steps: ce, submitMessage: L, t: le } = k({
3571
+ baseUrl: e,
3572
+ components: t,
3573
+ flow: r,
3574
+ googleApiKey: i,
3575
+ headers: a,
3576
+ initialValues: s,
3577
+ language: u,
3578
+ onChange: f,
3579
+ onSubmit: p,
3580
+ showPoweredBy: m,
3581
+ theme: g,
3582
+ validate: _,
3583
+ validationMode: v
3584
+ }), z = l || ae, { FormWrapper: ue, SubmitButtonWrapper: de, renderNode: V } = te({
3585
+ config: w,
3586
+ DefaultFormWrapper: fe,
3587
+ DefaultInputLabel: me,
3588
+ DefaultInputWrapper: lt,
3589
+ DefaultSubmitButton: nt,
3590
+ DefaultSubmitButtonWrapper: it,
3591
+ defaultInputRenderers: $e,
3592
+ defaultUI: ct,
3593
+ formErrors: O,
3594
+ formValues: A,
3595
+ inputNodes: N,
3596
+ isSubmitting: z,
3597
+ missingRequiredFields: oe,
3598
+ setFieldValue: se
3599
+ }), pe = w.components.step ?? et, he = w.components.loadingSkeleton ?? ft, ge = re(() => le(E?.data?.label), [le, E]), _e = ne(() => {
3600
+ if (ie) {
3601
+ M();
3602
+ return;
3603
+ }
3604
+ j();
3605
+ }, [
3606
+ ie,
3607
+ M,
3608
+ j
3609
+ ]), ve = ne(() => {
3610
+ if (P) {
3611
+ d?.();
3612
+ return;
3613
+ }
3614
+ ee();
3615
+ }, [
3616
+ P,
3617
+ d,
3618
+ ee
3619
+ ]), U = !P || !!d;
3620
+ return /* @__PURE__ */ F(R, {
3621
+ nestedScrollEnabled: !0,
3622
+ style: [
3623
+ gt.container,
3624
+ { backgroundColor: b.background },
3625
+ h
3626
+ ],
3627
+ contentContainerStyle: n,
3628
+ children: c ? /* @__PURE__ */ F(he, {}) : /* @__PURE__ */ I(o, {
3629
+ value: {
3630
+ baseUrl: w.baseUrl,
3631
+ flow: r,
3632
+ formErrors: O,
3633
+ formValues: A,
3634
+ googleApiKey: w.googleApiKey,
3635
+ headers: w.headers,
3636
+ inputNodes: N,
3637
+ language: w.language,
3638
+ setFieldValue: se
3639
+ },
3640
+ children: [/* @__PURE__ */ I(ue, {
3641
+ onSubmit: M,
3642
+ children: [T && /* @__PURE__ */ F(de, {
3643
+ missingFields: oe,
3644
+ children: /* @__PURE__ */ F(pe, {
3645
+ step: T,
3646
+ groupNode: E,
3647
+ stepIndex: D,
3648
+ totalSteps: ce.length,
3649
+ isFirstStep: P,
3650
+ isLastStep: ie,
3651
+ canContinue: x && (!ie || S),
3652
+ canGoBack: U,
3653
+ isSubmitting: z,
3654
+ onBack: ve,
3655
+ onContinue: _e,
3656
+ label: ge,
3657
+ children: T.nodes.map((e) => V(e))
3658
+ })
3659
+ }), w.showPoweredBy && /* @__PURE__ */ F(B, {
3660
+ style: [gt.poweredBy, { color: b.textMuted }],
3661
+ children: "Powered by Treege"
3662
+ })]
3663
+ }), L && /* @__PURE__ */ I(H, {
3664
+ style: [gt.message, { backgroundColor: L.type === "success" ? b.successBg : b.errorBg }],
3665
+ children: [/* @__PURE__ */ F(B, {
3666
+ style: [gt.messageText, { color: L.type === "success" ? b.success : b.error }],
3667
+ children: L.message
3668
+ }), /* @__PURE__ */ F(B, {
3669
+ style: [gt.messageClose, { color: L.type === "success" ? b.success : b.error }],
3670
+ onPress: C,
3671
+ children: le("common.close")
3672
+ })]
3673
+ })]
3674
+ })
3675
+ });
3676
+ }, ht = (e) => /* @__PURE__ */ F(C, {
3677
+ theme: e.theme,
3678
+ storageKey: "treege-renderer-theme",
3679
+ children: /* @__PURE__ */ F(mt, { ...e })
3680
+ }), gt = z.create({
3681
+ container: { flex: 1 },
3682
+ message: {
3683
+ borderRadius: 6,
3684
+ marginVertical: 16,
3685
+ padding: 16
3686
+ },
3687
+ messageClose: {
3688
+ fontSize: 14,
3689
+ marginTop: 8,
3690
+ textDecorationLine: "underline"
3691
+ },
3692
+ messageText: {
3693
+ fontSize: 14,
3694
+ fontWeight: "500"
3695
+ },
3696
+ poweredBy: {
3697
+ fontSize: 12,
3698
+ paddingVertical: 8,
3699
+ textAlign: "right"
3700
+ }
3701
+ });
3702
+ //#endregion
3703
+ export { ve as DefaultAddressInput, xe as DefaultAutocompleteInput, Se as DefaultCheckboxInput, Ce as DefaultDateInput, we as DefaultDateRangeInput, ot as DefaultDividerUI, Te as DefaultFileInput, Ee as DefaultHiddenInput, Le as DefaultHttpInput, me as DefaultInputLabel, Re as DefaultNumberInput, Be as DefaultPasswordInput, He as DefaultRadioInput, Ue as DefaultSelectInput, Ge as DefaultSwitchInput, Ye as DefaultTextInput, qe as DefaultTextareaInput, Ze as DefaultTimeInput, Qe as DefaultTimeRangeInput, at as DefaultTitleUI, ht as TreegeRenderer, E as TreegeRendererProvider, x as applyReferenceTransformation, m as buildInitialFormValues, l as calculateReferenceFieldUpdates, b as checkFormFieldHasValue, S as convertFormValuesToNamedFormat, $e as defaultInputRenderers, ct as defaultUI, A as evaluateCondition, ee as evaluateConditions, v as fileToSerializable, p as filesToSerializable, j as findStartNode, D as getFlowRenderState, t as getTranslatedText, d as isFieldEmpty, T as isStartNode, _ as resolveNodeDefaultValue, je as sanitize, Ne as sanitizeHttpResponse, f as serializableToFile, k as useTreegeRenderer, O as useTreegeRendererConfig };