@web-canvas-ui/react 0.1.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/README.md +415 -205
  2. package/index.js +3660 -0
  3. package/package.json +36 -27
  4. package/types/canvas-handle.d.ts +22 -0
  5. package/types/components/Button/button.d.ts +22 -0
  6. package/types/components/Button/logic.d.ts +3 -0
  7. package/types/components/CanvasView/canvasView.d.ts +28 -0
  8. package/types/components/CanvasView/index.d.ts +2 -0
  9. package/types/components/Carousel/carousel.d.ts +31 -0
  10. package/types/components/Carousel/logic.d.ts +2 -0
  11. package/types/components/Checkbox/checkbox.d.ts +8 -0
  12. package/types/components/ChoiceGroup/choiceGroup.d.ts +38 -0
  13. package/{components/ChoiceGroup/index.ts → types/components/ChoiceGroup/index.d.ts} +1 -1
  14. package/types/components/ChoiceGroup/logic.d.ts +3 -0
  15. package/types/components/Circle/circle.d.ts +9 -0
  16. package/types/components/Collapse/collapse.d.ts +32 -0
  17. package/types/components/Collapse/logic.d.ts +1 -0
  18. package/types/components/CustomDraw/customDraw.d.ts +22 -0
  19. package/types/components/CustomDraw/index.d.ts +2 -0
  20. package/types/components/DatePicker/datePicker.d.ts +24 -0
  21. package/types/components/Dialog/dialog.d.ts +20 -0
  22. package/types/components/Dropdown/dropdown.d.ts +30 -0
  23. package/types/components/Dropdown/logic.d.ts +5 -0
  24. package/types/components/Form/form.d.ts +42 -0
  25. package/types/components/Form/index.d.ts +2 -0
  26. package/{components/Grid/grid.ts → types/components/Grid/grid.d.ts} +3 -4
  27. package/{components/GridItem/gridItem.ts → types/components/GridItem/gridItem.d.ts} +1 -4
  28. package/{components/Group/group.ts → types/components/Group/group.d.ts} +1 -4
  29. package/types/components/Icon/icon.d.ts +14 -0
  30. package/types/components/Image/image.d.ts +12 -0
  31. package/types/components/Input/input.d.ts +32 -0
  32. package/types/components/Progress/progress.d.ts +15 -0
  33. package/types/components/Radio/radio.d.ts +8 -0
  34. package/types/components/Rect/rect.d.ts +11 -0
  35. package/types/components/Slider/logic.d.ts +1 -0
  36. package/types/components/Slider/slider.d.ts +17 -0
  37. package/types/components/Switch/logic.d.ts +2 -0
  38. package/types/components/Switch/switch.d.ts +14 -0
  39. package/types/components/Tabs/logic.d.ts +2 -0
  40. package/types/components/Tabs/tabs.d.ts +35 -0
  41. package/types/components/Text/text.d.ts +39 -0
  42. package/types/components/Textarea/textarea.d.ts +10 -0
  43. package/types/components/Upload/index.d.ts +2 -0
  44. package/types/components/Upload/upload.d.ts +30 -0
  45. package/types/components/Video/index.d.ts +4 -0
  46. package/types/components/Video/logic.d.ts +56 -0
  47. package/types/components/Video/video.d.ts +54 -0
  48. package/types/components/draw-utils.d.ts +48 -0
  49. package/types/components/shared.d.ts +7 -0
  50. package/types/components/size.d.ts +6 -0
  51. package/{components/types.ts → types/components/types.d.ts} +5 -13
  52. package/types/engine/accessibility.d.ts +5 -0
  53. package/types/engine/carousel.d.ts +10 -0
  54. package/types/engine/events.d.ts +14 -0
  55. package/types/engine/forms.d.ts +21 -0
  56. package/types/engine/hit-test.d.ts +31 -0
  57. package/types/engine/images.d.ts +8 -0
  58. package/types/engine/interaction.d.ts +12 -0
  59. package/types/engine/layout.d.ts +6 -0
  60. package/types/engine/nodes.d.ts +19 -0
  61. package/types/engine/state.d.ts +91 -0
  62. package/types/engine/text-controls.d.ts +10 -0
  63. package/types/engine/transform.d.ts +13 -0
  64. package/types/engine/uploads.d.ts +5 -0
  65. package/types/engine/videos.d.ts +28 -0
  66. package/types/engine/vnodes.d.ts +36 -0
  67. package/types/engine.d.ts +38 -0
  68. package/types/image-assets.d.ts +2 -0
  69. package/types/input-bridge.d.ts +54 -0
  70. package/types/react/Canvas.d.ts +4 -0
  71. package/types/react/components.d.ts +31 -0
  72. package/types/react/index.d.ts +5 -0
  73. package/types/renderer.d.ts +20 -0
  74. package/types/scene.d.ts +15 -0
  75. package/{types.ts → types/types.d.ts} +48 -142
  76. package/types/video-assets.d.ts +28 -0
  77. package/Canvas.tsx +0 -142
  78. package/__tests__/pure-logic.test.ts +0 -153
  79. package/__tests__/scene-and-node.test.ts +0 -131
  80. package/__tests__/scratch-space.test.ts +0 -30
  81. package/__tests__/textarea-caret.test.ts +0 -96
  82. package/__tests__/utils.test.ts +0 -114
  83. package/canvas-handle.ts +0 -114
  84. package/components/Button/button.ts +0 -57
  85. package/components/Button/logic.ts +0 -11
  86. package/components/CanvasView/canvasView.ts +0 -103
  87. package/components/CanvasView/index.ts +0 -7
  88. package/components/Carousel/carousel.ts +0 -107
  89. package/components/Carousel/logic.ts +0 -36
  90. package/components/Checkbox/checkbox.ts +0 -14
  91. package/components/ChoiceGroup/choiceGroup.ts +0 -172
  92. package/components/ChoiceGroup/logic.ts +0 -14
  93. package/components/Circle/circle.ts +0 -31
  94. package/components/Collapse/collapse.ts +0 -69
  95. package/components/Collapse/logic.ts +0 -14
  96. package/components/CustomDraw/customDraw.ts +0 -50
  97. package/components/CustomDraw/index.ts +0 -7
  98. package/components/DatePicker/datePicker.ts +0 -70
  99. package/components/Dialog/dialog.ts +0 -102
  100. package/components/Dropdown/dropdown.ts +0 -125
  101. package/components/Dropdown/logic.ts +0 -29
  102. package/components/Icon/icon.ts +0 -669
  103. package/components/Image/image.ts +0 -69
  104. package/components/Input/input.ts +0 -139
  105. package/components/Progress/progress.ts +0 -59
  106. package/components/Radio/radio.ts +0 -14
  107. package/components/Rect/rect.ts +0 -35
  108. package/components/Slider/logic.ts +0 -19
  109. package/components/Slider/slider.ts +0 -58
  110. package/components/Switch/logic.ts +0 -8
  111. package/components/Switch/switch.ts +0 -37
  112. package/components/Tabs/logic.ts +0 -14
  113. package/components/Tabs/tabs.ts +0 -78
  114. package/components/Text/text.ts +0 -95
  115. package/components/Textarea/textarea.ts +0 -16
  116. package/components/Upload/index.ts +0 -2
  117. package/components/Upload/upload.ts +0 -66
  118. package/components/draw-utils.ts +0 -230
  119. package/components/shared.ts +0 -15
  120. package/components/size.ts +0 -20
  121. package/components.ts +0 -98
  122. package/engine/__tests__/carousel.test.ts +0 -218
  123. package/engine/__tests__/hit-test.test.ts +0 -282
  124. package/engine/__tests__/layout.test.ts +0 -474
  125. package/engine/carousel.ts +0 -150
  126. package/engine/events.ts +0 -73
  127. package/engine/hit-test.ts +0 -321
  128. package/engine/images.ts +0 -41
  129. package/engine/interaction.ts +0 -442
  130. package/engine/layout.ts +0 -355
  131. package/engine/nodes.ts +0 -166
  132. package/engine/state.ts +0 -75
  133. package/engine/text-controls.ts +0 -122
  134. package/engine/transform.ts +0 -61
  135. package/engine/vnodes.ts +0 -204
  136. package/engine.ts +0 -162
  137. package/image-assets.ts +0 -37
  138. package/index.ts +0 -78
  139. package/input-bridge.ts +0 -285
  140. package/renderer.ts +0 -303
  141. package/scene.ts +0 -122
  142. package/theme.scss +0 -234
  143. package/web-canvas-ui-react-0.1.1.tgz +0 -0
  144. /package/{components/Button/index.ts → types/components/Button/index.d.ts} +0 -0
  145. /package/{components/Carousel/index.ts → types/components/Carousel/index.d.ts} +0 -0
  146. /package/{components/Checkbox/index.ts → types/components/Checkbox/index.d.ts} +0 -0
  147. /package/{components/Circle/index.ts → types/components/Circle/index.d.ts} +0 -0
  148. /package/{components/Collapse/index.ts → types/components/Collapse/index.d.ts} +0 -0
  149. /package/{components/DatePicker/index.ts → types/components/DatePicker/index.d.ts} +0 -0
  150. /package/{components/Dialog/index.ts → types/components/Dialog/index.d.ts} +0 -0
  151. /package/{components/Dropdown/index.ts → types/components/Dropdown/index.d.ts} +0 -0
  152. /package/{components/Grid/index.ts → types/components/Grid/index.d.ts} +0 -0
  153. /package/{components/GridItem/index.ts → types/components/GridItem/index.d.ts} +0 -0
  154. /package/{components/Group/index.ts → types/components/Group/index.d.ts} +0 -0
  155. /package/{components/Icon/index.ts → types/components/Icon/index.d.ts} +0 -0
  156. /package/{components/Image/index.ts → types/components/Image/index.d.ts} +0 -0
  157. /package/{components/Input/index.ts → types/components/Input/index.d.ts} +0 -0
  158. /package/{components/Progress/index.ts → types/components/Progress/index.d.ts} +0 -0
  159. /package/{components/Radio/index.ts → types/components/Radio/index.d.ts} +0 -0
  160. /package/{components/Rect/index.ts → types/components/Rect/index.d.ts} +0 -0
  161. /package/{components/Slider/index.ts → types/components/Slider/index.d.ts} +0 -0
  162. /package/{components/Switch/index.ts → types/components/Switch/index.d.ts} +0 -0
  163. /package/{components/Tabs/index.ts → types/components/Tabs/index.d.ts} +0 -0
  164. /package/{components/Text/index.ts → types/components/Text/index.d.ts} +0 -0
  165. /package/{components/Textarea/index.ts → types/components/Textarea/index.d.ts} +0 -0
package/index.js ADDED
@@ -0,0 +1,3660 @@
1
+ import e, { forwardRef as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a } from "react";
2
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
3
+ // tools/angular-build/.stage/react/components/shared.ts
4
+ var c = Symbol.for("rnative55.web-canvas-ui.kind");
5
+ function l(e) {
6
+ let t = (() => null);
7
+ return t.displayName = e[0].toUpperCase() + e.slice(1), t[c] = e, t;
8
+ }
9
+ // tools/angular-build/.stage/react/components/Group/group.ts
10
+ var u = l("group"), d = /* @__PURE__ */ new WeakMap();
11
+ function f() {
12
+ let e = () => {
13
+ let e = d.get(t);
14
+ if (!e) throw Error("Form controller is not attached to a mounted Form.");
15
+ return e;
16
+ }, t = {
17
+ getValues: () => e().getValues(),
18
+ getFieldValue: (t) => e().getFieldValue(t),
19
+ setFieldValue: (t, n) => e().setFieldValue(t, n)
20
+ };
21
+ return d.set(t, null), t;
22
+ }
23
+ function p(e, t) {
24
+ if (!d.has(e)) throw TypeError("Use createFormController() to create a Form controller.");
25
+ let n = d.get(e);
26
+ if (n && n.owner !== t.owner) throw Error("A Form controller can only be attached to one Form.");
27
+ d.set(e, t);
28
+ }
29
+ function m(e, t) {
30
+ d.get(e)?.owner === t && d.set(e, null);
31
+ }
32
+ var h = l("form"), g = l("formItem"), _ = l("grid"), v = l("gridItem");
33
+ // tools/angular-build/.stage/react/components/draw-utils.ts
34
+ function y(e, t) {
35
+ return typeof e == "number" && Number.isFinite(e) ? e : t;
36
+ }
37
+ function b(e, t) {
38
+ return typeof e == "string" ? e : t;
39
+ }
40
+ var x = 1.2, S = "…", C = /[\u2e80-\u9fff\uac00-\ud7af]/u;
41
+ function w(e) {
42
+ return (t) => e.measureText(t).width;
43
+ }
44
+ function T(e, t, n) {
45
+ let r = [];
46
+ for (let i of t.split("\n")) {
47
+ let t = "";
48
+ for (let a of i.split(/(\s+)/).filter(Boolean)) {
49
+ let i = t + a;
50
+ if (t && e(i) <= n) t = i;
51
+ else if (t || !/^\s+$/.test(a)) {
52
+ if (!t && e(a) <= n) t = a;
53
+ else {
54
+ t && !C.test(a) && (r.push(t.trimEnd()), t = "");
55
+ for (let i of Array.from(a)) t && e(t + i) > n && (r.push(t.trimEnd()), t = ""), t += i;
56
+ }
57
+ }
58
+ }
59
+ r.push(t);
60
+ }
61
+ return r;
62
+ }
63
+ function ee(e, t, n) {
64
+ let r = Array.from(t), i = 0, a = r.length;
65
+ for (; i < a;) {
66
+ let t = Math.ceil((i + a) / 2);
67
+ e(r.slice(0, t).join("") + S) <= n ? i = t : a = t - 1;
68
+ }
69
+ return r.slice(0, i).join("") + S;
70
+ }
71
+ function te(e, t, n) {
72
+ return !t || e(t) <= n ? t : ee(e, t, n);
73
+ }
74
+ function ne(e, t, n, r) {
75
+ let i = T(e, t, n);
76
+ if (i.length <= r) return i;
77
+ let a = i.slice(0, r);
78
+ return a[r - 1] = ee(e, a[r - 1], n), a;
79
+ }
80
+ function re(e, t, n, r = 0) {
81
+ return n > 0 ? r > 0 ? ne(e, t, n, Math.max(1, Math.round(r))) : T(e, t, n) : [t];
82
+ }
83
+ function ie(e, t, n) {
84
+ return T(w(e), t, n);
85
+ }
86
+ function E(e, t, n) {
87
+ return te(w(e), t, n);
88
+ }
89
+ var ae = null, oe = !1, D = "";
90
+ function se() {
91
+ return oe || (oe = !0, typeof document < "u" && (ae = document.createElement("canvas").getContext("2d"))), ae;
92
+ }
93
+ function O(e, t) {
94
+ let n = se();
95
+ return n ? (D !== t && (n.font = t, D = t), n.measureText(e).width) : ce(e, t);
96
+ }
97
+ function ce(e, t) {
98
+ let n = parseFloat(t) || 14;
99
+ return Array.from(e).reduce((e, t) => {
100
+ let r = C.test(t);
101
+ return e + n * (r ? 1 : .62);
102
+ }, 0);
103
+ }
104
+ function le(e, t, n, r, i, a, o) {
105
+ if (e.beginPath(), e.rect(0, 0, i, a), e.clip(), !(n > 0) || !(r > 0) || !(i > 0) || !(a > 0)) return;
106
+ if (o === "fill") {
107
+ e.drawImage(t, 0, 0, i, a);
108
+ return;
109
+ }
110
+ let s = o === "cover" ? Math.max(i / n, a / r) : o === "none" ? 1 : o === "scale-down" ? Math.min(1, i / n, a / r) : Math.min(i / n, a / r);
111
+ if (o === "cover") {
112
+ let o = i / s, c = a / s;
113
+ e.drawImage(t, (n - o) / 2, (r - c) / 2, o, c, 0, 0, i, a);
114
+ return;
115
+ }
116
+ let c = n * s, l = r * s;
117
+ e.drawImage(t, (i - c) / 2, (a - l) / 2, c, l);
118
+ }
119
+ var ue = null;
120
+ function de() {
121
+ if (ue !== null) return ue;
122
+ let e = typeof document > "u" ? null : document.body;
123
+ if (!e) return 0;
124
+ let t = document.createElement("div");
125
+ t.style.position = "absolute", t.style.top = "-9999px", t.style.width = "100px", t.style.height = "100px", t.style.overflowY = "scroll";
126
+ let n = document.createElement("div");
127
+ return n.style.width = "10px", n.style.height = "200px", t.appendChild(n), e.appendChild(t), ue = Math.max(0, t.offsetWidth - t.clientWidth), t.remove(), ue;
128
+ }
129
+ var fe = 0, pe = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap();
130
+ function he(e, t) {
131
+ me.set(e, me.get(t) ?? t);
132
+ }
133
+ function ge() {
134
+ fe += 1;
135
+ }
136
+ function k(e, t, n) {
137
+ if (typeof getComputedStyle != "function") return n;
138
+ let r = me.get(e.canvas) ?? e.canvas, i = pe.get(r);
139
+ i || (i = /* @__PURE__ */ new Map(), pe.set(r, i));
140
+ let a = i.get(t);
141
+ if (a && a.generation === fe) return a.value;
142
+ let o = getComputedStyle(r).getPropertyValue(t).trim() || n;
143
+ return i.set(t, {
144
+ generation: fe,
145
+ value: o
146
+ }), o;
147
+ }
148
+ // tools/angular-build/.stage/react/components/Rect/rect.ts
149
+ var _e = l("rect");
150
+ function ve(e, t) {
151
+ let n = y(t.width, 100), r = y(t.height, 40), i = Math.max(0, Math.min(y(t.radius, 0), n / 2, r / 2));
152
+ e.beginPath(), e.roundRect(0, 0, n, r, i), e.fillStyle = b(t.color, k(e, "--canvas-ui-rect-background", "transparent")), e.fill(), t.stroke && (e.strokeStyle = b(t.stroke, k(e, "--canvas-ui-rect-border", "#000")), e.lineWidth = y(t.strokeWidth, 1), e.stroke());
153
+ }
154
+ // tools/angular-build/.stage/react/components/Circle/circle.ts
155
+ var ye = l("circle");
156
+ function be(e, t) {
157
+ let n = y(t.radius, 10);
158
+ e.beginPath(), e.arc(0, 0, n, 0, Math.PI * 2), e.fillStyle = b(t.color, k(e, "--canvas-ui-circle-background", "#e74c3c")), e.fill(), t.stroke && (e.strokeStyle = b(t.stroke, k(e, "--canvas-ui-circle-border", "#000")), e.lineWidth = y(t.strokeWidth, 1), e.stroke());
159
+ }
160
+ // tools/angular-build/.stage/react/components/Text/text.ts
161
+ var xe = 16, Se = l("text");
162
+ function Ce(e, t) {
163
+ return e > 0 ? Math.max(1, Math.floor(e / (t * x))) : 0;
164
+ }
165
+ function we(e) {
166
+ let t = y(e.fontSize, xe), n = `${t}px ${b(e.fontFamily, "sans-serif")}`, r = (e) => O(e, n), i = String(e.text ?? ""), a = y(e.width, y(e._availableWidth, 0)), o = re(r, i, a, y(e.maxLines, Ce(y(e._availableHeight, 0), t)));
167
+ return {
168
+ lines: o,
169
+ width: a > 0 ? a : r(i),
170
+ height: o.length * t * x
171
+ };
172
+ }
173
+ function Te(e, t) {
174
+ let n = y(t.fontSize, xe);
175
+ e.font = `${n}px ${b(t.fontFamily, "sans-serif")}`, e.textBaseline = t.baseline ?? "top";
176
+ let r = t.textAlign === "center" || t.textAlign === "right" ? t.textAlign : "left";
177
+ e.textAlign = r, e.fillStyle = b(t.color, k(e, "--canvas-ui-text-color", "#333"));
178
+ let i = we(t), a = r === "center" ? i.width / 2 : r === "right" ? i.width : 0;
179
+ i.lines.forEach((t, r) => {
180
+ e.fillText(t, a, r * n * x);
181
+ }), e.textAlign = "left";
182
+ }
183
+ // tools/angular-build/.stage/react/components/Input/input.ts
184
+ var Ee = l("input");
185
+ function De(e, t, n = !1) {
186
+ let r = y(t.width, 200), i = y(t.height, 36), a = Math.max(0, Math.min(y(t.borderRadius, 4), r / 2, i / 2)), o = y(t.padding, 8), s = String(t.value ?? ""), c = String(t.placeholder ?? ""), l = t.type === "password" ? "•".repeat(s.length) : s;
187
+ e.beginPath(), e.roundRect(0, 0, r, i, a), e.fillStyle = b(t.bgColor, k(e, "--canvas-ui-input-background", "#fff")), e.fill(), e.strokeStyle = t.focused ? b(t.focusBorderColor, k(e, "--canvas-ui-input-focus-border", "#1677ff")) : b(t.borderColor, k(e, "--canvas-ui-input-border", "#d9d9d9")), e.lineWidth = 1, e.stroke(), e.save(), e.beginPath(), e.rect(0, 0, r, i), e.clip();
188
+ let u = y(t.fontSize, 14);
189
+ e.font = `${u}px ${b(t.fontFamily, "sans-serif")}`, e.textBaseline = n ? "top" : "middle", e.fillStyle = s ? b(t.color, k(e, "--canvas-ui-input-color", "#333")) : k(e, "--canvas-ui-input-placeholder-color", "#999");
190
+ let d = u * 1.35, f = y(t._scrollClientWidth, 0), p = n && f > 0 ? Math.max(0, r - f) : n && y(t._scrollHeight, 0) > i ? de() : 0, m = Math.max(1, r - o * 2 - p), h = n ? ie(e, l || c, m) : [], g = n ? Math.max(y(t._scrollHeight, 0), h.length * d + o * 2) : 0, _ = n ? Math.max(0, Math.min(g - i, y(t._scrollTop, 0))) : 0;
191
+ if (n ? (h.forEach((t, n) => {
192
+ e.fillText(t, o, o + n * d - _);
193
+ }), g > i && Oe(e, r, i, g, _)) : e.fillText(l || c, o, i / 2), t.focused && !t.disabled) {
194
+ let r = Math.max(0, Math.min(y(t.cursorPos, s.length), l.length)), a, c;
195
+ if (n) {
196
+ let t = [], n = 0;
197
+ for (let e of h) {
198
+ let r = l.indexOf(e, n);
199
+ r < 0 && (r = n), t.length > 0 && e === "" && l[r] === "\n" && (r += 1), t.push(r), n = r + e.length;
200
+ }
201
+ let i = 0;
202
+ for (let e = 1; e < t.length && !(r < t[e]); e++) i = e;
203
+ a = e.measureText(l.slice(t[i] ?? 0, r)).width, c = o + i * d - _;
204
+ } else a = e.measureText(l.slice(0, r)).width, c = (i - u) / 2;
205
+ e.fillStyle = b(t.color, k(e, "--canvas-ui-input-color", "#333")), (!n || c + u >= 0 && c <= i) && e.fillRect(o + a, c, 1, u);
206
+ }
207
+ e.restore();
208
+ }
209
+ function Oe(e, t, n, r, i) {
210
+ let a = Math.min(n, Math.max(16, n * n / r)), o = r - n, s = o > 0 ? (n - a) * i / o : 0;
211
+ e.fillStyle = "rgba(0, 0, 0, 0.08)", e.fillRect(t - 5, 0, 5, n), e.fillStyle = "rgba(0, 0, 0, 0.35)", e.beginPath(), e.roundRect(t - 5 + 1, s, 3, a, 2), e.fill();
212
+ }
213
+ // tools/angular-build/.stage/react/components/Textarea/textarea.ts
214
+ var ke = l("textarea");
215
+ function Ae(e, t) {
216
+ De(e, t, !0);
217
+ }
218
+ // tools/angular-build/.stage/react/components/Dropdown/dropdown.ts
219
+ var je = l("dropdown");
220
+ function Me(e, t) {
221
+ let n = y(t.width, 200), r = y(t.height, 36), i = Fe(t.options).find((e) => e.value === String(t.value ?? ""));
222
+ Pe(e, n, r, y(t.borderRadius, 4), t, !!(t.focused || t.open)), e.font = `${y(t.fontSize, 14)}px sans-serif`, e.textBaseline = "middle", e.fillStyle = i ? b(t.color, k(e, "--canvas-ui-dropdown-color", "#333")) : k(e, "--canvas-ui-dropdown-placeholder-color", "#999"), e.fillText(E(e, i?.label ?? b(t.placeholder, "Select..."), Math.max(0, n - 34)), 8, r / 2), e.fillStyle = b(t.color, k(e, "--canvas-ui-dropdown-color", "#555")), e.beginPath(), e.moveTo(n - 18, r / 2 - 3), e.lineTo(n - 12, r / 2 + 3), e.lineTo(n - 6, r / 2 - 3), e.stroke();
223
+ }
224
+ function Ne(e, t) {
225
+ let n = y(t.width, 200), r = y(t.height, 36);
226
+ e.font = `${y(t.fontSize, 14)}px sans-serif`, e.textBaseline = "middle", Fe(t.options).forEach((i, a) => {
227
+ let o = r * (a + 1);
228
+ e.fillStyle = k(e, "--canvas-ui-dropdown-option-background", "#fff"), e.fillRect(0, o, n, r), e.strokeStyle = k(e, "--canvas-ui-dropdown-option-border", "#e3e7ed"), e.strokeRect(0, o, n, r), e.fillStyle = i.disabled ? k(e, "--canvas-ui-dropdown-disabled-color", "#aaa") : b(t.color, k(e, "--canvas-ui-dropdown-color", "#333")), e.fillText(E(e, i.label, Math.max(0, n - 16)), 8, o + r / 2);
229
+ });
230
+ }
231
+ function Pe(e, t, n, r, i, a) {
232
+ e.beginPath(), e.roundRect(0, 0, t, n, r), e.fillStyle = b(i.bgColor, k(e, "--canvas-ui-dropdown-background", "#fff")), e.fill(), e.strokeStyle = a ? b(i.focusBorderColor, k(e, "--canvas-ui-dropdown-focus-border", "#1677ff")) : b(i.borderColor, k(e, "--canvas-ui-dropdown-border", "#d9d9d9")), e.stroke();
233
+ }
234
+ function Fe(e) {
235
+ return Array.isArray(e) ? e.map((e) => typeof e == "string" ? {
236
+ label: e,
237
+ value: e
238
+ } : e) : [];
239
+ }
240
+ // tools/angular-build/.stage/react/components/Dropdown/logic.ts
241
+ function A(e) {
242
+ return Array.isArray(e) ? e.flatMap((e) => {
243
+ if (typeof e == "string") return [{
244
+ label: e,
245
+ value: e
246
+ }];
247
+ if (!e || typeof e != "object") return [];
248
+ let t = e;
249
+ return typeof t.label != "string" || typeof t.value != "string" ? [] : [{
250
+ label: t.label,
251
+ value: t.value,
252
+ disabled: t.disabled === !0
253
+ }];
254
+ }) : [];
255
+ }
256
+ function Ie(e, t) {
257
+ return A(e)[t];
258
+ }
259
+ function Le(e, t) {
260
+ e.setProps({
261
+ value: t.value,
262
+ open: !1
263
+ });
264
+ let n = e.props.onChange;
265
+ typeof n == "function" && n(t.value);
266
+ }
267
+ // tools/angular-build/.stage/react/components/Slider/slider.ts
268
+ var Re = l("slider");
269
+ function ze(e, t) {
270
+ let n = y(t.width, 160), r = y(t.height, 32), i = y(t.min, 0), a = y(t.max, 100), o = Math.max(i, Math.min(a, y(t.value, i))), s = a === i ? 0 : (o - i) / (a - i), c = r / 2, l = Math.min(8, r / 3), u = l + s * Math.max(0, n - l * 2);
271
+ e.beginPath(), e.roundRect(l, c - 3, Math.max(0, n - l * 2), 6, 3), e.fillStyle = b(t.trackColor, k(e, "--canvas-ui-slider-track", "#f0f0f0")), e.fill(), e.beginPath(), e.roundRect(l, c - 3, Math.max(0, u - l), 6, 3), e.fillStyle = b(t.activeColor, k(e, "--canvas-ui-slider-active", "#1677ff")), e.fill(), e.beginPath(), e.arc(u, c, l, 0, Math.PI * 2), e.fillStyle = b(t.thumbColor, k(e, "--canvas-ui-slider-thumb", "#fff")), e.fill(), e.strokeStyle = b(t.activeColor, k(e, "--canvas-ui-slider-active", "#1677ff")), e.stroke();
272
+ }
273
+ // tools/angular-build/.stage/react/components/Slider/logic.ts
274
+ function Be(e, t, n) {
275
+ let r = Math.min(8, y(e.height, 32) / 3), i = y(e.min, 0), a = y(e.max, 100);
276
+ if (a <= i) return;
277
+ let o = Math.max(2 ** -52, y(e.step, 1)), s = i + Math.max(0, Math.min(1, (n - r) / Math.max(1, t - r * 2))) * (a - i);
278
+ return Math.max(i, Math.min(a, i + Math.round((s - i) / o) * o));
279
+ }
280
+ // tools/angular-build/.stage/react/components/Switch/switch.ts
281
+ var Ve = l("switch");
282
+ function He(e, t) {
283
+ let n = y(t.width, 44), r = y(t.height, 24), i = r / 2, a = !!t.checked;
284
+ e.beginPath(), e.roundRect(0, 0, n, r, i), e.fillStyle = a ? b(t.onColor, k(e, "--canvas-ui-switch-on", "#1677ff")) : b(t.offColor, k(e, "--canvas-ui-switch-off", "#d9d9d9")), e.fill(), e.beginPath(), e.arc(a ? n - i : i, i, Math.max(1, i - 3), 0, Math.PI * 2), e.fillStyle = b(t.thumbColor, k(e, "--canvas-ui-switch-thumb", "#fff")), e.fill();
285
+ }
286
+ // tools/angular-build/.stage/react/components/Switch/logic.ts
287
+ function Ue(e) {
288
+ let t = !e.props.checked;
289
+ e.setProps({ checked: t });
290
+ let n = e.props.onChange;
291
+ typeof n == "function" && n(t);
292
+ }
293
+ // tools/angular-build/.stage/react/components/DatePicker/datePicker.ts
294
+ var We = l("datePicker");
295
+ function Ge(e, t) {
296
+ let n = y(t.width, 200), r = y(t.height, 36), i = Math.max(0, Math.min(y(t.borderRadius, 4), n / 2, r / 2)), a = String(t.value ?? "");
297
+ e.beginPath(), e.roundRect(0, 0, n, r, i), e.fillStyle = b(t.bgColor, k(e, "--canvas-ui-input-background", "#fff")), e.fill(), e.strokeStyle = t.focused ? b(t.focusBorderColor, k(e, "--canvas-ui-input-focus-border", "#1677ff")) : b(t.borderColor, k(e, "--canvas-ui-input-border", "#d9d9d9")), e.stroke(), e.font = `${y(t.fontSize, 14)}px sans-serif`, e.textBaseline = "middle", e.fillStyle = a ? b(t.color, k(e, "--canvas-ui-input-color", "#333")) : k(e, "--canvas-ui-input-placeholder-color", "#999"), e.fillText(a || b(t.placeholder, "Select date"), 8, r / 2), e.fillStyle = b(t.color, k(e, "--canvas-ui-input-color", "#666")), e.strokeStyle = e.fillStyle, e.lineWidth = 1.4;
298
+ let o = n - 20, s = r / 2 - 7;
299
+ e.strokeRect(o, s + 2, 13, 12), e.beginPath(), e.moveTo(o, s + 5), e.lineTo(o + 13, s + 5), e.moveTo(o + 3, s), e.lineTo(o + 3, s + 4), e.moveTo(o + 10, s), e.lineTo(o + 10, s + 4), e.stroke();
300
+ }
301
+ // tools/angular-build/.stage/react/components/size.ts
302
+ function Ke(e, t) {
303
+ return y(qe(e)?.width, y(e.width, t));
304
+ }
305
+ function j(e, t) {
306
+ return y(qe(e)?.height, y(e.height, t));
307
+ }
308
+ function qe(e) {
309
+ let t = e.size;
310
+ if (typeof t == "object" && t && !Array.isArray(t)) return t;
311
+ }
312
+ // tools/angular-build/.stage/react/components/ChoiceGroup/choiceGroup.ts
313
+ function M(e) {
314
+ return Array.isArray(e) ? e.map((e) => typeof e == "string" ? {
315
+ label: e,
316
+ value: e
317
+ } : e) : [];
318
+ }
319
+ function Je(e) {
320
+ let t = M(e.options), n = e.direction !== "vertical", r = y(e.gap, 12), i = y(e.fontSize, 14), a = y(e.optionHeight, 28), o = t.reduce((e, t) => e + N(t.label, i), 0) + r * Math.max(0, t.length - 1), s = t.length * a + r * Math.max(0, t.length - 1);
321
+ return {
322
+ width: Ke(e, n ? o : 200),
323
+ height: j(e, n ? a : s)
324
+ };
325
+ }
326
+ function Ye(e, t, n) {
327
+ let r = M(t.options), i = t.direction !== "vertical", a = y(t.gap, 12), o = y(t.fontSize, 14), s = y(t.optionHeight, 28), c = t.value;
328
+ e.font = `${o}px sans-serif`, e.textBaseline = "middle", e.lineWidth = 1;
329
+ let l = 0, u = 0;
330
+ for (let d of r) {
331
+ let r = Array.isArray(c) ? c.includes(d.value) : c === d.value, f = u + s / 2, p = l + 9, m = d.disabled === !0;
332
+ e.strokeStyle = m ? b(t.disabledColor, k(e, "--canvas-ui-choice-disabled", "#bfbfbf")) : b(t.borderColor, k(e, "--canvas-ui-choice-border", "#d9d9d9")), e.fillStyle = m ? k(e, "--canvas-ui-choice-disabled-background", "#f5f5f5") : "#fff", n === "radio" ? (e.beginPath(), e.arc(p, f, 8, 0, Math.PI * 2), e.fill(), e.stroke(), r && (e.beginPath(), e.arc(p, f, 4, 0, Math.PI * 2), e.fillStyle = b(t.activeColor, k(e, "--canvas-ui-choice-active", "#1677ff")), e.fill())) : (e.beginPath(), e.roundRect(l + 1, f - 8, 16, 16, 3), e.fill(), e.stroke(), r && (e.strokeStyle = b(t.activeColor, k(e, "--canvas-ui-choice-active", "#1677ff")), e.lineWidth = 2, e.beginPath(), e.moveTo(l + 5, f), e.lineTo(l + 8, f + 3), e.lineTo(l + 13, f - 4), e.stroke(), e.lineWidth = 1)), e.fillStyle = m ? b(t.disabledColor, k(e, "--canvas-ui-choice-disabled", "#bfbfbf")) : b(t.color, k(e, "--canvas-ui-choice-color", "#333")), e.fillText(d.label, l + 23, f), i ? l += N(d.label, o) + a : u += s + a;
333
+ }
334
+ }
335
+ function Xe(e, t, n) {
336
+ let r = M(e.options), i = e.direction !== "vertical", a = y(e.gap, 12), o = y(e.fontSize, 14), s = y(e.optionHeight, 28), c = Je(e);
337
+ if (i) {
338
+ let e = 0;
339
+ for (let i of r) {
340
+ let r = N(i.label, o);
341
+ if (t >= e && t <= e + r && n >= 0 && n <= c.height) return i;
342
+ e += r + a;
343
+ }
344
+ return;
345
+ }
346
+ let l = Math.floor(n / (s + a));
347
+ return n - l * (s + a) <= s && t >= 0 && t <= c.width ? r[l] : void 0;
348
+ }
349
+ function N(e, t) {
350
+ return Math.max(24, O(e, `${t}px sans-serif`)) + 24;
351
+ }
352
+ // tools/angular-build/.stage/react/components/ChoiceGroup/logic.ts
353
+ function Ze(e, t) {
354
+ return e === t.value ? void 0 : t.value;
355
+ }
356
+ function Qe(e, t) {
357
+ let n = Array.isArray(e) ? e.filter((e) => typeof e == "string") : [];
358
+ return n.includes(t.value) ? n.filter((e) => e !== t.value) : [...n, t.value];
359
+ }
360
+ // tools/angular-build/.stage/react/components/Radio/radio.ts
361
+ var $e = l("radio");
362
+ function et(e, t) {
363
+ Ye(e, t, "radio");
364
+ }
365
+ // tools/angular-build/.stage/react/components/Checkbox/checkbox.ts
366
+ var tt = l("checkbox");
367
+ function nt(e, t) {
368
+ Ye(e, t, "checkbox");
369
+ }
370
+ // tools/angular-build/.stage/react/components/Icon/icon.ts
371
+ var rt = {
372
+ home: { paths: ["M3 10 L12 3 L21 10 M5 9 V21 H19 V9 M9 21 V14 H15 V21"] },
373
+ house: { paths: ["M2 11 L12 2 L22 11 M4 10 V21 H20 V10 M9 21 V14 H15 V21", "M3 11 H6 M18 11 H21"] },
374
+ building: { paths: ["M4 21 V4 H16 V21 M16 9 H21 V21 M2 21 H22", "M7 7 H9 M12 7 H14 M7 11 H9 M12 11 H14 M7 15 H9 M12 15 H14 M18 12 H19 M18 16 H19"] },
375
+ apartment: { paths: ["M3 21 V3 H21 V21 M2 21 H22", "M7 7 H9 M15 7 H17 M7 11 H9 M15 11 H17 M7 15 H9 M15 15 H17 M10 21 V18 H14 V21"] },
376
+ store: { paths: ["M4 10 V21 H20 V10 M2 10 L4 3 H20 L22 10 M2 10 Q5 14 8 10 Q11 14 14 10 Q17 14 22 10", "M8 21 V14 H16 V21"] },
377
+ mapPin: {
378
+ paths: ["M12 22 C9 18 4 13 4 9 A8 8 0 0 1 20 9 C20 13 15 18 12 22 Z"],
379
+ circles: [[
380
+ 12,
381
+ 9,
382
+ 2.5
383
+ ]]
384
+ },
385
+ map: { paths: ["M3 6 L9 3 L15 6 L21 3 V18 L15 21 L9 18 L3 21 Z", "M9 3 V18 M15 6 V21"] },
386
+ globe: { paths: ["M12 22 A10 10 0 1 0 12 2 A10 10 0 1 0 12 22 Z", "M2 12 H22 M12 2 C7 7 7 17 12 22 M12 2 C17 7 17 17 12 22 M4 7 H20 M4 17 H20"] },
387
+ compass: { paths: ["M12 22 A10 10 0 1 0 12 2 A10 10 0 1 0 12 22 Z", "M15.5 8.5 L13 13 L8.5 15.5 L11 11 Z M12 2 V4 M22 12 H20"] },
388
+ navigation: { paths: ["M12 2 L21 21 L12 17 L3 21 Z M12 17 V9"] },
389
+ flag: { paths: ["M5 22 V3 M5 4 C10 1 14 8 20 4 V15 C14 19 10 12 5 15"] },
390
+ mountain: { paths: ["M2 21 L8 9 L11 14 L16 5 L22 21 Z M6 21 L10 14 M13 11 L16 15"] },
391
+ tree: { paths: ["M12 22 V15 M5 15 L12 4 L19 15 Z M7 10 L12 2 L17 10 Z M8 22 H16"] },
392
+ leaf: { paths: ["M21 3 C10 3 4 6 4 14 C4 18 7 21 11 20 C19 18 21 11 21 3 Z M3 21 L14 10 M8 16 L8 12 M12 12 L16 12"] },
393
+ flower: {
394
+ paths: ["M12 13 V22 M12 18 C8 16 7 19 6 21 M12 18 C16 16 17 19 18 21"],
395
+ circles: [
396
+ [
397
+ 12,
398
+ 7,
399
+ 2
400
+ ],
401
+ [
402
+ 12,
403
+ 3,
404
+ 2
405
+ ],
406
+ [
407
+ 16,
408
+ 7,
409
+ 2
410
+ ],
411
+ [
412
+ 12,
413
+ 11,
414
+ 2
415
+ ],
416
+ [
417
+ 8,
418
+ 7,
419
+ 2
420
+ ]
421
+ ]
422
+ },
423
+ sun: { paths: ["M12 7 A5 5 0 1 0 12 17 A5 5 0 1 0 12 7 Z", "M12 2 V4 M12 20 V22 M2 12 H4 M20 12 H22 M5 5 L6.5 6.5 M17.5 17.5 L19 19 M19 5 L17.5 6.5 M6.5 17.5 L5 19"] },
424
+ moon: { paths: ["M20 15 A8 8 0 0 1 9 4 A9 9 0 1 0 20 15 Z"] },
425
+ cloud: { paths: ["M7 18 H18 A4 4 0 0 0 18 10 A7 7 0 0 0 5 11 A3.5 3.5 0 0 0 7 18 Z"] },
426
+ rain: { paths: ["M7 14 H18 A4 4 0 0 0 18 6 A7 7 0 0 0 5 7 A3.5 3.5 0 0 0 7 14 Z", "M8 17 L7 20 M13 17 L12 20 M18 17 L17 20"] },
427
+ snow: { paths: ["M12 2 V22 M3.3 7 L20.7 17 M3.3 17 L20.7 7", "M9 4 L12 7 L15 4 M9 20 L12 17 L15 20 M4 10 L8 9 L7 5 M20 14 L16 15 L17 19 M4 14 L8 15 L7 19 M20 10 L16 9 L17 5"] },
428
+ fire: { paths: ["M12 22 C5 22 4 16 7 11 C8 9 9 7 9 4 C13 7 14 10 13 12 C16 11 17 8 17 7 C23 15 19 22 12 22 Z", "M12 19 C9 19 9 16 11 14 C12 13 13 12 13 11 C17 14 16 19 12 19 Z"] },
429
+ water: { paths: ["M12 2 C9 7 4 12 4 16 A8 8 0 0 0 20 16 C20 12 15 7 12 2 Z", "M8 17 C9 19 11 20 13 20"] },
430
+ wind: { paths: ["M3 8 H16 C20 8 20 3 17 3 C15 3 14 4 14 5 M2 12 H20 C23 12 23 17 20 17 C18 17 17 16 17 15 M4 16 H11"] },
431
+ car: {
432
+ paths: ["M3 16 L5 8 H19 L21 16 V20 H3 Z M5 8 L7 4 H17 L19 8 M3 13 H21 M6 20 V22 M18 20 V22"],
433
+ circles: [[
434
+ 7,
435
+ 17,
436
+ 1
437
+ ], [
438
+ 17,
439
+ 17,
440
+ 1
441
+ ]]
442
+ },
443
+ bus: {
444
+ paths: ["M5 3 H19 A2 2 0 0 1 21 5 V19 H3 V5 A2 2 0 0 1 5 3 Z M3 12 H21 M6 6 H10 V10 H6 Z M14 6 H18 V10 H14 Z M6 19 V22 M18 19 V22"],
445
+ circles: [[
446
+ 7,
447
+ 16,
448
+ 1
449
+ ], [
450
+ 17,
451
+ 16,
452
+ 1
453
+ ]]
454
+ },
455
+ train: {
456
+ paths: ["M7 3 H17 A3 3 0 0 1 20 6 V16 A3 3 0 0 1 17 19 H7 A3 3 0 0 1 4 16 V6 A3 3 0 0 1 7 3 Z M4 12 H20 M8 22 L10 19 M16 22 L14 19"],
457
+ circles: [[
458
+ 8,
459
+ 7,
460
+ 1
461
+ ], [
462
+ 16,
463
+ 7,
464
+ 1
465
+ ]]
466
+ },
467
+ plane: { paths: ["M2 13 L10 11 L14 3 L17 3 L16 10 L22 12 L22 14 L15 14 L12 21 L10 21 L10 14 L3 16 Z"] },
468
+ bicycle: { paths: ["M5 18 A3 3 0 1 0 5 24 A3 3 0 1 0 5 18 Z M19 18 A3 3 0 1 0 19 24 A3 3 0 1 0 19 18 Z M5 21 L9 13 L13 21 H5 L11 16 L15 11 L19 21 M13 11 H17 M9 13 H6"] },
469
+ ship: { paths: ["M3 14 L6 8 H18 L21 14 L19 19 H5 Z M8 8 V4 H15 V8 M2 21 Q6 19 10 21 Q14 19 18 21 Q20 20 22 21"] },
470
+ rocket: {
471
+ paths: ["M12 2 C17 5 19 10 19 16 L12 21 L5 16 C5 10 7 5 12 2 Z M8 16 L4 20 V14 M16 16 L20 20 V14 M9 22 H15"],
472
+ circles: [[
473
+ 12,
474
+ 9,
475
+ 2
476
+ ]]
477
+ },
478
+ truck: {
479
+ paths: ["M2 6 H15 V18 H2 Z M15 11 H19 L22 14 V18 H15 Z M5 18 V21 M19 18 V21 M15 14 H21"],
480
+ circles: [[
481
+ 6,
482
+ 18,
483
+ 1.5
484
+ ], [
485
+ 18,
486
+ 18,
487
+ 1.5
488
+ ]]
489
+ },
490
+ walk: { paths: ["M12 3 A2 2 0 1 0 12 7 A2 2 0 1 0 12 3 Z M11 9 L8 14 L4 16 M10 12 L15 14 L18 19 M8 14 L10 18 L8 22 M15 14 L14 18 L17 22"] },
491
+ phone: {
492
+ paths: ["M7 2 H17 A2 2 0 0 1 19 4 V20 A2 2 0 0 1 17 22 H7 A2 2 0 0 1 5 20 V4 A2 2 0 0 1 7 2 Z M5 18 H19 M10 5 H14"],
493
+ circles: [[
494
+ 12,
495
+ 20,
496
+ .6
497
+ ]]
498
+ },
499
+ message: { paths: ["M3 4 H21 V17 H11 L5 21 V17 H3 Z M7 9 H17 M7 13 H14"] },
500
+ mail: { paths: ["M3 5 H21 V19 H3 Z M3 6 L12 13 L21 6"] },
501
+ bell: {
502
+ paths: ["M5 17 H19 L17 14 V9 A5 5 0 0 0 7 9 V14 Z M10 20 H14"],
503
+ circles: [[
504
+ 12,
505
+ 3,
506
+ 1
507
+ ]]
508
+ },
509
+ calendar: { paths: ["M3 5 H21 V21 H3 Z M3 9 H21 M7 2 V7 M17 2 V7 M7 13 H9 M12 13 H14 M17 13 H19 M7 17 H9 M12 17 H14"] },
510
+ clock: { paths: ["M12 22 A10 10 0 1 0 12 2 A10 10 0 1 0 12 22 Z M12 6 V12 L16 14"] },
511
+ alarm: { paths: ["M12 22 A8 8 0 1 0 12 6 A8 8 0 1 0 12 22 Z M12 10 V14 L15 16 M4 3 L2 6 M20 3 L22 6 M8 22 L6 24 M16 22 L18 24"] },
512
+ camera: {
513
+ paths: ["M3 7 H7 L9 4 H15 L17 7 H21 V20 H3 Z"],
514
+ circles: [[
515
+ 12,
516
+ 13,
517
+ 4
518
+ ], [
519
+ 12,
520
+ 13,
521
+ 2
522
+ ]]
523
+ },
524
+ image: {
525
+ paths: ["M3 4 H21 V20 H3 Z M4 18 L10 11 L14 15 L17 12 L21 17"],
526
+ circles: [[
527
+ 8,
528
+ 8,
529
+ 1.5
530
+ ]]
531
+ },
532
+ video: { paths: ["M3 6 H15 V18 H3 Z M15 10 L21 7 V17 L15 14 Z"] },
533
+ music: {
534
+ paths: ["M10 17 V5 L21 3 V15 M10 8 L21 6"],
535
+ circles: [[
536
+ 7,
537
+ 18,
538
+ 3
539
+ ], [
540
+ 18,
541
+ 16,
542
+ 3
543
+ ]]
544
+ },
545
+ microphone: { paths: ["M12 15 A3 3 0 0 0 15 12 V5 A3 3 0 0 0 9 5 V12 A3 3 0 0 0 12 15 Z M5 11 A7 7 0 0 0 19 11 M12 18 V22 M8 22 H16"] },
546
+ headphones: { paths: ["M3 13 V11 A9 9 0 0 1 21 11 V13 M3 13 H7 V20 H5 A2 2 0 0 1 3 18 Z M21 13 H17 V20 H19 A2 2 0 0 0 21 18 Z"] },
547
+ play: {
548
+ paths: ["M6 3 L21 12 L6 21 Z"],
549
+ filled: [0]
550
+ },
551
+ pause: {
552
+ paths: ["M6 4 H10 V20 H6 Z M14 4 H18 V20 H14 Z"],
553
+ filled: [0, 1]
554
+ },
555
+ stop: {
556
+ paths: ["M5 5 H19 V19 H5 Z"],
557
+ filled: [0]
558
+ },
559
+ record: {
560
+ paths: ["M3 12 A9 9 0 1 0 21 12 A9 9 0 1 0 3 12 Z"],
561
+ circles: [[
562
+ 12,
563
+ 12,
564
+ 3
565
+ ]]
566
+ },
567
+ volume: { paths: ["M3 9 H7 L13 4 V20 L7 15 H3 Z M17 9 Q21 12 17 15 M19 6 Q25 12 19 18"] },
568
+ wifi: {
569
+ paths: ["M2 8 Q12 0 22 8 M5 12 Q12 6 19 12 M8 16 Q12 12 16 16"],
570
+ circles: [[
571
+ 12,
572
+ 20,
573
+ 1
574
+ ]]
575
+ },
576
+ bluetooth: { paths: ["M12 2 L18 7 L12 12 L18 17 L12 22 V2 M5 7 L18 17 M5 17 L18 7"] },
577
+ battery: { paths: ["M3 7 H20 V19 H3 Z M20 10 H22 V16 H20 M6 10 V16 M10 10 V16 M14 10 V16"] },
578
+ signal: { paths: ["M3 20 V16 H6 V20 Z M9 20 V12 H12 V20 Z M15 20 V8 H18 V20 Z M21 20 V4 H24 V20 Z"] },
579
+ power: { paths: ["M12 2 V12 M6 5 A9 9 0 1 0 18 5"] },
580
+ monitor: { paths: ["M2 4 H22 V18 H2 Z M8 22 H16 M12 18 V22"] },
581
+ laptop: { paths: ["M4 4 H20 V16 H4 Z M2 20 H22 L20 17 H4 Z"] },
582
+ tablet: {
583
+ paths: ["M6 2 H18 A2 2 0 0 1 20 4 V20 A2 2 0 0 1 18 22 H6 A2 2 0 0 1 4 20 V4 A2 2 0 0 1 6 2 Z M4 18 H20"],
584
+ circles: [[
585
+ 12,
586
+ 20,
587
+ .6
588
+ ]]
589
+ },
590
+ keyboard: { paths: ["M2 6 H22 V18 H2 Z M5 9 H6 M9 9 H10 M13 9 H14 M17 9 H18 M5 12 H6 M9 12 H10 M13 12 H14 M17 12 H18 M7 15 H17"] },
591
+ mouse: { paths: ["M12 22 A8 8 0 0 0 20 14 V10 A8 8 0 0 0 4 10 V14 A8 8 0 0 0 12 22 Z M12 3 V11"] },
592
+ printer: {
593
+ paths: ["M6 8 V3 H18 V8 M6 17 H4 A2 2 0 0 1 2 15 V10 A2 2 0 0 1 4 8 H20 A2 2 0 0 1 22 10 V15 A2 2 0 0 1 20 17 H18 M6 14 H18 V21 H6 Z"],
594
+ circles: [[
595
+ 18,
596
+ 11,
597
+ .8
598
+ ]]
599
+ },
600
+ folder: { paths: ["M2 6 H10 L12 9 H22 V20 H2 Z M2 9 H22"] },
601
+ file: { paths: ["M5 2 H15 L20 7 V22 H5 Z M15 2 V7 H20 M8 12 H17 M8 16 H17"] },
602
+ document: { paths: ["M4 3 H17 L21 7 V21 H4 Z M17 3 V7 H21 M8 11 H17 M8 15 H17 M8 18 H14"] },
603
+ download: { paths: ["M12 2 V16 M6 10 L12 16 L18 10 M4 20 H20"] },
604
+ upload: { paths: ["M12 16 V2 M6 8 L12 2 L18 8 M4 20 H20"] },
605
+ share: {
606
+ paths: ["M6 12 L18 5 M6 12 L18 19"],
607
+ circles: [
608
+ [
609
+ 5,
610
+ 12,
611
+ 3
612
+ ],
613
+ [
614
+ 19,
615
+ 4,
616
+ 3
617
+ ],
618
+ [
619
+ 19,
620
+ 20,
621
+ 3
622
+ ]
623
+ ]
624
+ },
625
+ link: { paths: ["M9 15 L15 9 M7 17 L5 19 A4 4 0 0 1 2 13 L7 8 A4 4 0 0 1 13 8 M17 7 L19 5 A4 4 0 0 1 22 11 L17 16 A4 4 0 0 1 11 16"] },
626
+ search: {
627
+ paths: ["M15 15 L22 22"],
628
+ circles: [[
629
+ 10,
630
+ 10,
631
+ 7
632
+ ]]
633
+ },
634
+ settings: {
635
+ paths: ["M12 2 L14 4 L17 4 L18 7 L21 9 L20 12 L21 15 L18 17 L17 20 L14 20 L12 22 L10 20 L7 20 L6 17 L3 15 L4 12 L3 9 L6 7 L7 4 L10 4 Z"],
636
+ circles: [[
637
+ 12,
638
+ 12,
639
+ 3
640
+ ]]
641
+ },
642
+ sliders: {
643
+ paths: ["M3 6 H21 M3 12 H21 M3 18 H21"],
644
+ circles: [
645
+ [
646
+ 8,
647
+ 6,
648
+ 2
649
+ ],
650
+ [
651
+ 15,
652
+ 12,
653
+ 2
654
+ ],
655
+ [
656
+ 10,
657
+ 18,
658
+ 2
659
+ ]
660
+ ]
661
+ },
662
+ menu: { paths: ["M3 6 H21 M3 12 H21 M3 18 H21"] },
663
+ close: { paths: ["M5 5 L19 19 M19 5 L5 19"] },
664
+ check: { paths: ["M3 12 L9 18 L21 5"] },
665
+ plus: { paths: ["M12 3 V21 M3 12 H21"] },
666
+ minus: { paths: ["M3 12 H21"] },
667
+ edit: { paths: ["M4 16 L15 5 L19 9 L8 20 L3 21 Z M13 7 L17 11 M3 21 L4 16"] },
668
+ trash: { paths: ["M4 7 H20 M10 3 H14 M6 7 L7 21 H17 L18 7 M10 11 V17 M14 11 V17"] },
669
+ copy: { paths: ["M8 8 H20 V21 H8 Z M5 16 H3 V3 H15 V5"] },
670
+ save: { paths: ["M3 3 H18 L21 6 V21 H3 Z M7 3 V9 H16 V3 M7 21 V14 H17 V21"] },
671
+ lock: { paths: ["M5 11 H19 V21 H5 Z M8 11 V7 A4 4 0 0 1 16 7 V11"] },
672
+ unlock: { paths: ["M5 11 H19 V21 H5 Z M8 11 V7 A4 4 0 0 1 15 4"] },
673
+ key: {
674
+ paths: ["M14 10 L22 2 M18 6 L21 9 M15 9 L18 12"],
675
+ circles: [[
676
+ 8,
677
+ 14,
678
+ 6
679
+ ]]
680
+ },
681
+ user: {
682
+ paths: ["M4 21 C4 16 8 14 12 14 C16 14 20 16 20 21"],
683
+ circles: [[
684
+ 12,
685
+ 7,
686
+ 4
687
+ ]]
688
+ },
689
+ users: {
690
+ paths: ["M2 21 C2 17 5 15 9 15 M22 21 C22 17 19 15 15 15 M8 21 C8 16 11 14 15 14 C19 14 22 16 22 21"],
691
+ circles: [[
692
+ 8,
693
+ 7,
694
+ 3
695
+ ], [
696
+ 17,
697
+ 7,
698
+ 3
699
+ ]]
700
+ },
701
+ heart: {
702
+ paths: ["M12 21 L4 13 C-1 7 7 1 12 7 C17 1 25 7 20 13 Z"],
703
+ filled: [0]
704
+ },
705
+ star: {
706
+ paths: ["M12 2 L15 9 L22 10 L17 15 L18 22 L12 18 L6 22 L7 15 L2 10 L9 9 Z"],
707
+ filled: [0]
708
+ },
709
+ bookmark: { paths: ["M6 3 H18 V22 L12 18 L6 22 Z"] },
710
+ cart: {
711
+ paths: ["M2 3 H5 L8 17 H19 L22 7 H6 M9 21 H9.1 M18 21 H18.1"],
712
+ circles: [[
713
+ 10,
714
+ 21,
715
+ 1.5
716
+ ], [
717
+ 18,
718
+ 21,
719
+ 1.5
720
+ ]]
721
+ },
722
+ bag: { paths: ["M3 8 H21 L19 21 H5 Z M8 8 V6 A4 4 0 0 1 16 6 V8"] },
723
+ gift: { paths: ["M3 10 H21 V21 H3 Z M2 6 H22 V10 H2 Z M12 6 V21 M12 6 C5 7 5 2 8 2 C11 2 12 6 12 6 C12 6 13 2 16 2 C19 2 19 7 12 6 Z"] },
724
+ creditCard: { paths: ["M2 5 H22 V19 H2 Z M2 10 H22 M6 15 H11"] },
725
+ wallet: {
726
+ paths: ["M3 6 H19 A2 2 0 0 1 21 8 V20 H3 A2 2 0 0 1 1 18 V6 A3 3 0 0 1 4 3 H18 V6 M15 12 H21 V17 H15 A2 2 0 0 1 15 12 Z"],
727
+ circles: [[
728
+ 17,
729
+ 14.5,
730
+ .7
731
+ ]]
732
+ },
733
+ chart: { paths: ["M3 21 V3 M3 21 H22 M7 17 L11 12 L15 15 L21 7"] },
734
+ pieChart: { paths: ["M12 2 V12 H22 A10 10 0 1 1 12 2 Z M14 2 A8 8 0 0 1 22 10 H14 Z"] },
735
+ barChart: { paths: ["M3 21 H22 M5 18 V11 H9 V18 Z M12 18 V5 H16 V18 Z M19 18 V8 H22 V18 Z"] },
736
+ analytics: { paths: ["M3 21 V3 M3 21 H22 M6 17 L10 13 L13 15 L19 7 M16 7 H19 V10"] },
737
+ shield: { paths: ["M12 2 L21 6 V12 C21 17 17 20 12 22 C7 20 3 17 3 12 V6 Z M8 12 L11 15 L17 9"] },
738
+ warning: {
739
+ paths: ["M12 3 L22 21 H2 Z M12 9 V14"],
740
+ circles: [[
741
+ 12,
742
+ 18,
743
+ .8
744
+ ]]
745
+ },
746
+ info: {
747
+ paths: ["M12 22 A10 10 0 1 0 12 2 A10 10 0 1 0 12 22 M12 11 V17"],
748
+ circles: [[
749
+ 12,
750
+ 7,
751
+ .8
752
+ ]]
753
+ },
754
+ help: {
755
+ paths: ["M12 22 A10 10 0 1 0 12 2 A10 10 0 1 0 12 22 M9 9 A3 3 0 1 1 14 12 C12 13 12 14 12 15"],
756
+ circles: [[
757
+ 12,
758
+ 18,
759
+ .7
760
+ ]]
761
+ },
762
+ question: {
763
+ paths: ["M12 22 A10 10 0 1 0 12 2 A10 10 0 1 0 12 22 M9 9 A3 3 0 1 1 14 12 C12 13 12 14 12 15"],
764
+ circles: [[
765
+ 12,
766
+ 18,
767
+ .7
768
+ ]]
769
+ },
770
+ tag: {
771
+ paths: ["M3 4 H13 L22 13 L13 22 L3 12 Z"],
772
+ circles: [[
773
+ 8,
774
+ 9,
775
+ 1
776
+ ]]
777
+ },
778
+ puzzle: { paths: ["M3 3 H9 A3 3 0 1 0 15 3 H21 V9 A3 3 0 1 1 21 15 V21 H15 A3 3 0 1 0 9 21 H3 V15 A3 3 0 1 1 3 9 Z"] },
779
+ code: { paths: ["M8 5 L2 12 L8 19 M16 5 L22 12 L16 19 M14 3 L10 21"] },
780
+ database: { paths: ["M3 5 C3 1 21 1 21 5 V19 C21 23 3 23 3 19 Z M3 5 C3 9 21 9 21 5 M3 12 C3 16 21 16 21 12"] },
781
+ cloudDownload: { paths: ["M7 15 H17 A4 4 0 0 0 17 7 A7 7 0 0 0 4 8 A3.5 3.5 0 0 0 7 15 Z M12 12 V21 M8 17 L12 21 L16 17"] }
782
+ }, it = l("icon");
783
+ function at(e, t) {
784
+ let n = t.name;
785
+ if (typeof n != "string" || !Object.prototype.hasOwnProperty.call(rt, n)) throw Error(`Unknown Canvas UI icon: ${String(n)}.`);
786
+ let r = rt[n], i = y(t.size, 24);
787
+ if (i <= 0) throw RangeError("Icon size must be greater than zero.");
788
+ if (t.variant !== void 0 && t.variant !== "outline" && t.variant !== "solid") throw TypeError(`Unknown Canvas UI icon variant: ${String(t.variant)}.`);
789
+ let a = t.variant === "solid" ? "solid" : "outline", o = y(t.strokeWidth, 2);
790
+ if (o <= 0) throw RangeError("Icon strokeWidth must be greater than zero.");
791
+ e.save(), e.translate(i / 2, i / 2), e.scale(i / 24, i / 24), e.translate(-12, -12), e.strokeStyle = b(t.color, k(e, "--canvas-ui-icon-color", "#333")), e.fillStyle = e.strokeStyle, e.lineWidth = (a === "solid" ? Math.max(o, 4) : o) * 24 / i, e.lineCap = "round", e.lineJoin = "round";
792
+ for (let t = 0; t < r.paths.length; t++) e.beginPath(), ot(e, r.paths[t]), a === "solid" && r.filled?.includes(t) && e.fill(), e.stroke();
793
+ for (let [t, n, i] of r.circles ?? []) e.beginPath(), e.arc(t, n, i, 0, Math.PI * 2), a === "solid" ? e.fill() : e.stroke();
794
+ e.restore();
795
+ }
796
+ function ot(e, t) {
797
+ let n = t.match(/[A-Z]|-?(?:\d+\.?\d*|\.\d+)/g) ?? [], r = 0, i = 0, a = 0, o = 0;
798
+ for (let t = 0; t < n.length;) {
799
+ let s = n[t++], c = () => Number(n[t++]);
800
+ switch (s) {
801
+ case "M":
802
+ r = c(), i = c(), a = r, o = i, e.moveTo(r, i);
803
+ break;
804
+ case "L":
805
+ r = c(), i = c(), e.lineTo(r, i);
806
+ break;
807
+ case "H":
808
+ r = c(), e.lineTo(r, i);
809
+ break;
810
+ case "V":
811
+ i = c(), e.lineTo(r, i);
812
+ break;
813
+ case "C": {
814
+ let t = c(), n = c(), a = c(), o = c();
815
+ r = c(), i = c(), e.bezierCurveTo(t, n, a, o, r, i);
816
+ break;
817
+ }
818
+ case "Q": {
819
+ let t = c(), n = c();
820
+ r = c(), i = c(), e.quadraticCurveTo(t, n, r, i);
821
+ break;
822
+ }
823
+ case "A": {
824
+ let t = c(), n = c(), a = c(), o = c() !== 0, s = c() !== 0, l = c(), u = c();
825
+ st(e, r, i, t, n, a, o, s, l, u), r = l, i = u;
826
+ break;
827
+ }
828
+ case "Z":
829
+ e.closePath(), r = a, i = o;
830
+ break;
831
+ default: throw Error(`Unsupported path command: ${s}.`);
832
+ }
833
+ }
834
+ }
835
+ function st(e, t, n, r, i, a, o, s, c, l) {
836
+ let u = Math.abs(r), d = Math.abs(i);
837
+ if (u === 0 || d === 0 || t === c && n === l) {
838
+ e.lineTo(c, l);
839
+ return;
840
+ }
841
+ let f = a * Math.PI / 180, p = Math.cos(f), m = Math.sin(f), h = (t - c) / 2, g = (n - l) / 2, _ = p * h + m * g, v = -m * h + p * g, y = _ ** 2 / u ** 2 + v ** 2 / d ** 2;
842
+ if (y > 1) {
843
+ let e = Math.sqrt(y);
844
+ u *= e, d *= e;
845
+ }
846
+ let b = Math.max(0, u ** 2 * d ** 2 - u ** 2 * v ** 2 - d ** 2 * _ ** 2), x = u ** 2 * v ** 2 + d ** 2 * _ ** 2, S = x === 0 ? 0 : (o === s ? -1 : 1) * Math.sqrt(b / x), C = S * u * v / d, w = S * -d * _ / u, T = p * C - m * w + (t + c) / 2, ee = m * C + p * w + (n + l) / 2, te = (_ - C) / u, ne = (v - w) / d, re = (-_ - C) / u, ie = (-v - w) / d, E = Math.atan2(ne, te), ae = te * ie - ne * re, oe = te * re + ne * ie, D = Math.atan2(ae, oe);
847
+ s && D < 0 && (D += Math.PI * 2), !s && D > 0 && (D -= Math.PI * 2), e.ellipse(T, ee, u, d, f, E, E + D, !s);
848
+ }
849
+ function ct(e) {
850
+ let t = Array.isArray(e.value) ? e.value : [];
851
+ return y(e.height, 40) + t.length * 28;
852
+ }
853
+ var lt = l("upload");
854
+ function ut(e, t) {
855
+ let n = y(t.width, 120), r = y(t.height, 40), i = y(t.borderRadius, 6);
856
+ e.beginPath(), e.roundRect(0, 0, n, r, i), e.fillStyle = b(t.backgroundColor, k(e, "--canvas-ui-button-background", "#1677ff")), e.fill(), t.borderColor && (e.strokeStyle = b(t.borderColor, "#1677ff"), e.stroke());
857
+ let a = t._uploadError ? "Invalid file" : b(t.text, "Choose File"), o = b(t.textColor, k(e, "--canvas-ui-button-color", "#fff")), s = y(t.fontSize, 15), c = y(t.iconSize, Math.round(s * 1.1));
858
+ e.font = `${s}px sans-serif`, e.textBaseline = "middle", e.textAlign = "left";
859
+ let l = E(e, a, Math.max(0, n - 12 - c - 6)), u = l ? e.measureText(l).width : 0, d = (n - (c + (l ? 6 : 0) + u)) / 2, f = r / 2;
860
+ e.save(), e.translate(d, f - c / 2), at(e, {
861
+ name: t.icon ?? "upload",
862
+ size: c,
863
+ color: o
864
+ }), e.restore(), d += c + (l ? 6 : 0), e.fillStyle = o, e.fillText(l, d, f);
865
+ let p = t.value ?? [];
866
+ e.font = "13px sans-serif", e.textAlign = "left";
867
+ for (let [t, i] of p.entries()) {
868
+ let a = r + t * 28;
869
+ e.fillStyle = k(e, "--canvas-ui-input-color", "#333"), e.fillText(E(e, i.name, Math.max(0, n - 32)), 4, a + 14), e.textAlign = "center", e.fillText("×", n - 12, a + 14), e.textAlign = "left";
870
+ }
871
+ }
872
+ // tools/angular-build/.stage/react/components/Carousel/carousel.ts
873
+ var dt = l("carousel"), ft = l("carouselItem");
874
+ function pt(e, t) {
875
+ let n = y(t.width, 300), r = y(t.height, 180);
876
+ e.fillStyle = b(t.backgroundColor, "transparent"), e.fillRect(0, 0, n, r);
877
+ }
878
+ function mt(e, t) {
879
+ let n = y(t.width, 300), r = y(t.height, 180), i = y(t._itemCount, 0);
880
+ if (!(i < 2)) {
881
+ if (t.showArrows !== !1) {
882
+ let i = b(t.arrowColor, k(e, "--canvas-ui-carousel-arrow", "#fff")), a = r / 2;
883
+ ht(e, 22, a, -1, i), ht(e, n - 22, a, 1, i);
884
+ }
885
+ if (t.showDots !== !1) {
886
+ let a = b(t.dotColor, k(e, "--canvas-ui-carousel-dot", "rgba(255,255,255,0.65)")), o = b(t.activeDotColor, k(e, "--canvas-ui-carousel-active-dot", "#1677ff")), s = (n - (i - 1) * 14) / 2, c = r - 14;
887
+ e.beginPath();
888
+ for (let t = 0; t < i; t++) e.moveTo(s + t * 14 + 4, c), e.arc(s + t * 14, c, 4, 0, Math.PI * 2);
889
+ e.fillStyle = a, e.fill();
890
+ let l = Math.max(0, Math.min(i - 1, y(t._activeIndex, 0)));
891
+ e.beginPath(), e.arc(s + l * 14, c, 4, 0, Math.PI * 2), e.fillStyle = o, e.fill();
892
+ }
893
+ }
894
+ }
895
+ function ht(e, t, n, r, i) {
896
+ e.fillStyle = "rgba(0, 0, 0, 0.3)", e.beginPath(), e.arc(t, n, 16, 0, Math.PI * 2), e.fill(), e.strokeStyle = i, e.lineWidth = 2, e.beginPath(), e.moveTo(t - r * 3, n - 6), e.lineTo(t + r * 3, n), e.lineTo(t - r * 3, n + 6), e.stroke();
897
+ }
898
+ // tools/angular-build/.stage/react/components/Carousel/logic.ts
899
+ function gt(e, t, n, r, i, a, o) {
900
+ if (!(r < 2 || t < 0 || t > a || n < 0 || n > o)) {
901
+ if (e.showArrows !== !1 && Math.abs(n - o / 2) <= 20) {
902
+ if (t <= 42) return i - 1;
903
+ if (t >= a - 42) return i + 1;
904
+ }
905
+ if (e.showDots !== !1 && n >= o - 26) {
906
+ let e = (a - (r - 1) * 14) / 2, n = Math.round((t - e) / 14);
907
+ if (n >= 0 && n < r && Math.abs(t - (e + n * 14)) <= 9) return n;
908
+ }
909
+ }
910
+ }
911
+ function _t(e, t, n, r) {
912
+ return n <= 0 ? 0 : r ? (e % n + n) % n : Math.max(0, Math.min(n - 1, e));
913
+ }
914
+ // tools/angular-build/.stage/react/components/Button/button.ts
915
+ var vt = l("button");
916
+ function yt(e, t) {
917
+ let n = y(t.width, 120), r = y(t.height, 40), i = y(t.borderRadius, 6);
918
+ e.beginPath(), e.roundRect(0, 0, n, r, i), e.fillStyle = t.pressed ? k(e, "--canvas-ui-button-pressed-background", "#0958d9") : b(t.backgroundColor, k(e, "--canvas-ui-button-background", "#1677ff")), e.fill(), t.borderColor && (e.strokeStyle = b(t.borderColor, k(e, "--canvas-ui-button-border", "#1677ff")), e.stroke()), e.font = `${y(t.fontSize, 15)}px sans-serif`, e.textBaseline = "middle", e.textAlign = "center", e.fillStyle = b(t.fontColor, k(e, "--canvas-ui-button-color", "#fff")), e.fillText(E(e, String(t.text ?? ""), Math.max(0, n - 16)), n / 2, r / 2), e.textAlign = "left";
919
+ }
920
+ // tools/angular-build/.stage/react/components/Button/logic.ts
921
+ function bt(e, t) {
922
+ e.setProps({ pressed: t });
923
+ }
924
+ function xt(e) {
925
+ if (e.props.disabled === !0) return;
926
+ let t = e.props.onClick;
927
+ typeof t == "function" && t();
928
+ }
929
+ // tools/angular-build/.stage/react/image-assets.ts
930
+ var St = /* @__PURE__ */ new Map();
931
+ function Ct(e) {
932
+ let t = St.get(e);
933
+ if (t) return t;
934
+ let n = new Image(), r = {
935
+ image: n,
936
+ error: null,
937
+ listeners: /* @__PURE__ */ new Set()
938
+ };
939
+ return St.set(e, r), n.onload = () => r.listeners.forEach((e) => e(null)), n.onerror = () => {
940
+ r.error = /* @__PURE__ */ Error(`Canvas image failed to load: ${e}`), r.listeners.forEach((e) => e(r.error));
941
+ }, n.src = e, r;
942
+ }
943
+ function wt(e) {
944
+ let t = Ct(e);
945
+ return t.image.complete && t.image.naturalWidth > 0 ? t.image : null;
946
+ }
947
+ function Tt(e, t) {
948
+ let n = Ct(e);
949
+ return n.listeners.add(t), n.image.complete && t(n.error), () => n.listeners.delete(t);
950
+ }
951
+ // tools/angular-build/.stage/react/components/Image/image.ts
952
+ var Et = l("image");
953
+ function Dt(e, t) {
954
+ let n = t.src;
955
+ if (typeof n != "string" || !n) return;
956
+ let r = wt(n);
957
+ if (!r) return;
958
+ let i = y(t.width, r.naturalWidth), a = y(t.height, r.naturalHeight);
959
+ e.save(), le(e, r, r.naturalWidth, r.naturalHeight, i, a, t.objectFit ?? "contain"), e.restore();
960
+ }
961
+ // tools/angular-build/.stage/react/components/Dialog/dialog.ts
962
+ var Ot = l("dialog");
963
+ function kt(e, t) {
964
+ let n = y(t._viewportWidth, e.canvas.width), r = y(t._viewportHeight, e.canvas.height), i = y(t.width, 420), a = y(t.height, 240), o = (n - i) / 2, s = (r - a) / 2;
965
+ e.fillStyle = k(e, "--canvas-ui-dialog-mask", "rgba(0, 0, 0, 0.45)"), e.fillRect(0, 0, n, r), e.fillStyle = k(e, "--canvas-ui-dialog-background", "#fff"), e.beginPath(), e.roundRect(o, s, i, a, 8), e.fill(), e.fillStyle = k(e, "--canvas-ui-dialog-title-color", "#1f1f1f"), e.font = "600 16px sans-serif", e.textBaseline = "middle", e.fillText(E(e, String(t.title ?? "Confirm"), Math.max(0, i - 48)), o + 24, s + 28), e.strokeStyle = k(e, "--canvas-ui-dialog-border", "#f0f0f0"), e.beginPath(), e.moveTo(o, s + 56), e.lineTo(o + i, s + 56), e.moveTo(o, s + a - 56), e.lineTo(o + i, s + a - 56), e.stroke(), At(e, o + i - 196, s + a - 44, 80, 32, String(t.cancelText ?? "Cancel"), !1), At(e, o + i - 104, s + a - 44, 80, 32, String(t.confirmText ?? "OK"), !0);
966
+ }
967
+ function At(e, t, n, r, i, a, o) {
968
+ e.beginPath(), e.roundRect(t, n, r, i, 6), e.fillStyle = o ? k(e, "--canvas-ui-dialog-confirm-background", "#1677ff") : k(e, "--canvas-ui-dialog-cancel-background", "#fff"), e.fill(), e.strokeStyle = o ? k(e, "--canvas-ui-dialog-confirm-background", "#1677ff") : k(e, "--canvas-ui-dialog-border", "#d9d9d9"), e.stroke(), e.fillStyle = o ? k(e, "--canvas-ui-dialog-confirm-color", "#fff") : k(e, "--canvas-ui-dialog-cancel-color", "#333"), e.font = "14px sans-serif", e.textAlign = "center", e.textBaseline = "middle", e.fillText(E(e, a, Math.max(0, r - 16)), t + r / 2, n + i / 2), e.textAlign = "left";
969
+ }
970
+ // tools/angular-build/.stage/react/components/Progress/progress.ts
971
+ var jt = l("progress");
972
+ function Mt(e, t) {
973
+ let n = y(t.width, 200), r = y(t.height, 12), i = y(t.min, 0), a = y(t.max, 100), o = Math.max(i, Math.min(a, y(t.value, i))), s = a > i ? (o - i) / (a - i) : 0, c = Math.max(0, Math.min(y(t.borderRadius, r / 2), r / 2, n / 2));
974
+ e.beginPath(), e.roundRect(0, 0, n, r, c), e.fillStyle = b(t.trackColor, k(e, "--canvas-ui-progress-track", "#f0f0f0")), e.fill(), s > 0 && (e.save(), e.beginPath(), e.roundRect(0, 0, n, r, c), e.clip(), e.fillStyle = b(t.color, k(e, "--canvas-ui-progress-active", "#1677ff")), e.fillRect(0, 0, n * s, r), e.restore()), t.showText && (e.font = `${Math.max(10, r)}px sans-serif`, e.textBaseline = "middle", e.fillStyle = b(t.textColor, k(e, "--canvas-ui-progress-text", "#333")), e.fillText(`${Math.round(s * 100)}%`, n + 8, r / 2));
975
+ }
976
+ // tools/angular-build/.stage/react/components/Tabs/tabs.ts
977
+ var Nt = l("tabs"), Pt = l("tabItem");
978
+ function Ft(e, t) {
979
+ let n = y(t.width, 300), r = y(t.headerHeight, 40), i = t._tabItems ?? [];
980
+ if (!i.length) return;
981
+ let a = n / i.length;
982
+ e.fillStyle = b(t.backgroundColor, k(e, "--canvas-ui-tabs-background", "#fff")), e.fillRect(0, 0, n, r), e.font = "14px sans-serif", e.textAlign = "center", e.textBaseline = "middle", i.forEach((n, i) => {
983
+ e.fillStyle = n.disabled ? k(e, "--canvas-ui-tabs-disabled-color", "#bfbfbf") : n.selected ? b(t.activeColor, k(e, "--canvas-ui-tabs-active-color", "#1677ff")) : b(t.textColor, k(e, "--canvas-ui-tabs-color", "#595959")), e.fillText(E(e, n.title, Math.max(0, a - 16)), a * (i + .5), r / 2), n.selected && (e.fillStyle = b(t.indicatorColor, k(e, "--canvas-ui-tabs-indicator", "#1677ff")), e.fillRect(a * i, r - 2, a, 2));
984
+ }), e.textAlign = "left";
985
+ }
986
+ // tools/angular-build/.stage/react/components/Tabs/logic.ts
987
+ function It(e, t, n, r, i) {
988
+ if (n >= i || e.length === 0) return;
989
+ let a = e[Math.floor(t / (r / e.length))];
990
+ if (a && !a.props.disabled && typeof a.props.id == "string") return a.props.id;
991
+ }
992
+ // tools/angular-build/.stage/react/components/Collapse/collapse.ts
993
+ var Lt = l("collapse"), Rt = l("collapseItem");
994
+ function zt(e, t) {
995
+ let n = y(t._collapseWidth, 300), r = y(t._collapseHeaderHeight, 40);
996
+ e.fillStyle = b(t.backgroundColor, k(e, "--canvas-ui-collapse-header-background", "#fafafa")), e.fillRect(0, 0, n, r), e.strokeStyle = b(t.borderColor, k(e, "--canvas-ui-collapse-border", "#d9d9d9")), e.strokeRect(0, 0, n, r), e.font = "14px sans-serif", e.textBaseline = "middle", e.fillStyle = t.disabled ? k(e, "--canvas-ui-collapse-disabled-color", "#bfbfbf") : b(t.textColor, k(e, "--canvas-ui-collapse-color", "#262626")), e.fillText(E(e, `${t._expanded ? "−" : "+"} ${String(t.title ?? "")}`, Math.max(0, n - 24)), 12, r / 2);
997
+ }
998
+ // tools/angular-build/.stage/react/components/Collapse/logic.ts
999
+ function Bt(e, t, n) {
1000
+ let r = new Set(e);
1001
+ return r.has(t) ? r.delete(t) : (n && r.clear(), r.add(t)), [...r];
1002
+ }
1003
+ // tools/angular-build/.stage/react/components/CustomDraw/customDraw.ts
1004
+ var Vt = l("customDraw");
1005
+ function Ht(e, t) {
1006
+ let n = t.draw;
1007
+ if (typeof n != "function") throw TypeError("<CustomDraw> requires a draw(context, size) function.");
1008
+ let r = Ut(t.width, "width"), i = Ut(t.height, "height");
1009
+ e.save();
1010
+ try {
1011
+ n(e, {
1012
+ width: r,
1013
+ height: i
1014
+ });
1015
+ } finally {
1016
+ e.restore();
1017
+ }
1018
+ }
1019
+ function Ut(e, t) {
1020
+ if (typeof e != "number" || !Number.isFinite(e) || e < 0) throw RangeError(`<CustomDraw> ${t} must be a non-negative finite number.`);
1021
+ return e;
1022
+ }
1023
+ // tools/angular-build/.stage/react/components/CanvasView/canvasView.ts
1024
+ var Wt = l("canvasView");
1025
+ function Gt(e, t) {
1026
+ let n = t.source;
1027
+ if (!qt(n)) throw TypeError("<CanvasView> requires an HTMLCanvasElement source.");
1028
+ if (n === e.canvas) throw TypeError("<CanvasView> cannot draw the destination Canvas into itself.");
1029
+ let r = Kt(t.width, "width"), i = Kt(t.height, "height");
1030
+ if (!n.width || !n.height || !r || !i) return;
1031
+ let a = {
1032
+ width: r,
1033
+ height: i
1034
+ }, o = t.fit ?? "contain";
1035
+ e.save();
1036
+ try {
1037
+ if (e.beginPath(), e.rect(0, 0, a.width, a.height), e.clip(), o === "fill") {
1038
+ e.drawImage(n, 0, 0, a.width, a.height);
1039
+ return;
1040
+ }
1041
+ if (o !== "contain" && o !== "cover") throw RangeError("<CanvasView> fit must be \"contain\", \"cover\", or \"fill\".");
1042
+ let t = o === "cover" ? Math.max(a.width / n.width, a.height / n.height) : Math.min(a.width / n.width, a.height / n.height), r = n.width * t, i = n.height * t;
1043
+ e.drawImage(n, (a.width - r) / 2, (a.height - i) / 2, r, i);
1044
+ } finally {
1045
+ e.restore();
1046
+ }
1047
+ }
1048
+ function Kt(e, t) {
1049
+ if (typeof e != "number" || !Number.isFinite(e) || e < 0) throw RangeError(`<CanvasView> ${t} must be a non-negative finite number.`);
1050
+ return e;
1051
+ }
1052
+ function qt(e) {
1053
+ return typeof e == "object" && !!e && "nodeName" in e && e.nodeName === "CANVAS" && "width" in e && typeof e.width == "number" && "height" in e && typeof e.height == "number" && "getContext" in e && typeof e.getContext == "function";
1054
+ }
1055
+ // tools/angular-build/.stage/react/video-assets.ts
1056
+ var Jt = /* @__PURE__ */ new Map();
1057
+ function Yt(e, t) {
1058
+ e.preload = "auto", e.playsInline = !0, e.crossOrigin = "anonymous";
1059
+ let n = !0, r = () => {
1060
+ n = !1, t.onReady();
1061
+ }, i = () => {
1062
+ n ? (n = !1, e.removeAttribute("crossorigin"), e.load()) : t.onFail(/* @__PURE__ */ Error(`Canvas video failed to load: ${e.src}`));
1063
+ }, a = () => {
1064
+ t.onTime(e.currentTime, e.duration);
1065
+ }, o = () => t.onSeeked?.();
1066
+ return e.addEventListener("loadeddata", r), e.addEventListener("error", i), e.addEventListener("timeupdate", a), e.addEventListener("seeked", o), e.addEventListener("canplay", o), () => {
1067
+ e.removeEventListener("loadeddata", r), e.removeEventListener("error", i), e.removeEventListener("timeupdate", a), e.removeEventListener("seeked", o), e.removeEventListener("canplay", o);
1068
+ };
1069
+ }
1070
+ function Xt(e) {
1071
+ let t = Jt.get(e);
1072
+ if (t) return t.refs += 1, t;
1073
+ let n = document.createElement("video"), r = {
1074
+ video: n,
1075
+ error: null,
1076
+ refs: 1,
1077
+ loadListeners: /* @__PURE__ */ new Set(),
1078
+ timeListeners: /* @__PURE__ */ new Set()
1079
+ };
1080
+ return Yt(n, {
1081
+ onReady: () => {
1082
+ r.error = null, r.loadListeners.forEach((e) => e(null));
1083
+ },
1084
+ onFail: (e) => {
1085
+ r.error = e, r.loadListeners.forEach((t) => t(e));
1086
+ },
1087
+ onTime: (e, t) => {
1088
+ r.timeListeners.forEach((n) => n(e, t));
1089
+ }
1090
+ }), Jt.set(e, r), n.src = e, r;
1091
+ }
1092
+ function Zt(e) {
1093
+ return Xt(e).video;
1094
+ }
1095
+ function Qt(e) {
1096
+ return Jt.get(e)?.video ?? null;
1097
+ }
1098
+ function $t(e, t, n, r) {
1099
+ let i = document.createElement("video"), a = Yt(i, {
1100
+ onReady: () => t(null),
1101
+ onFail: (e) => t(e),
1102
+ onTime: (e, t) => n(e, t),
1103
+ onSeeked: r
1104
+ });
1105
+ i.src = e;
1106
+ let o = {
1107
+ src: e,
1108
+ video: i,
1109
+ frame: void 0,
1110
+ captureFrame: () => {
1111
+ if (i.readyState < 2 || i.seeking || !i.videoWidth || !i.videoHeight) return;
1112
+ let e = o.frame ?? document.createElement("canvas"), t = e.getContext("2d");
1113
+ if (!t) throw Error("Canvas 2D context is not available for video seeking.");
1114
+ e.width !== i.videoWidth && (e.width = i.videoWidth), e.height !== i.videoHeight && (e.height = i.videoHeight), t.drawImage(i, 0, 0), o.frame = e;
1115
+ },
1116
+ dispose: () => {
1117
+ o.fullscreenCleanup?.(), a(), i.pause(), i.removeAttribute("src"), i.load(), o.frame = void 0;
1118
+ }
1119
+ };
1120
+ return o;
1121
+ }
1122
+ // tools/angular-build/.stage/react/components/Video/logic.ts
1123
+ var en = "11px sans-serif", tn = 24, nn = 32, P = 24;
1124
+ function F(e) {
1125
+ let t = Math.max(0, Math.floor(y(e, 0))), n = t % 60, r = Math.floor(t / 60) % 60, i = Math.floor(t / 3600), a = (e) => String(e).padStart(2, "0");
1126
+ return i > 0 ? `${i}:${a(r)}:${a(n)}` : `${r}:${a(n)}`;
1127
+ }
1128
+ function rn(e, t, n) {
1129
+ let r = Math.min(Math.max(tn, Math.round(t / 6)), nn, Math.max(0, t)), i = t - r, a = {
1130
+ x: 4,
1131
+ y: i + Math.max(0, (r - P) / 2),
1132
+ width: P,
1133
+ height: Math.min(P, r)
1134
+ }, o = a.x + P + 6, s = {
1135
+ x: Math.max(0, e - 28),
1136
+ y: a.y,
1137
+ width: e >= 56 ? P : 0,
1138
+ height: a.height
1139
+ }, c = Math.max(0, e - 40 - n - o);
1140
+ return {
1141
+ bar: {
1142
+ y: i,
1143
+ height: r
1144
+ },
1145
+ play: a,
1146
+ fullscreen: s,
1147
+ track: {
1148
+ x: o,
1149
+ y: i + r / 2 - 2,
1150
+ width: c,
1151
+ height: 4
1152
+ }
1153
+ };
1154
+ }
1155
+ function an(e, t, n) {
1156
+ return n < e.bar.y || n > e.bar.y + e.bar.height ? null : t >= e.play.x && t <= e.play.x + e.play.width ? "play" : e.fullscreen.width > 0 && t >= e.fullscreen.x && t <= e.fullscreen.x + e.fullscreen.width ? "fullscreen" : e.track.width > 0 && t >= e.track.x - 4 && t <= e.track.x + e.track.width + 4 ? "track" : null;
1157
+ }
1158
+ function on(e, t) {
1159
+ return e.track.width <= 0 ? 0 : Math.max(0, Math.min(1, (t - e.track.x) / e.track.width));
1160
+ }
1161
+ function sn(e, t) {
1162
+ e.paused ? e.play().catch(() => void 0) : e.pause(), t?.(e.paused);
1163
+ }
1164
+ function cn(e, t, n, r) {
1165
+ if (!Number.isFinite(e.duration) || e.duration <= 0) return;
1166
+ let i = Math.max(0, Math.min(e.duration, t * e.duration));
1167
+ Math.abs(e.currentTime - i) > 1e-4 && (r?.(), e.currentTime = i), n?.(i);
1168
+ }
1169
+ // tools/angular-build/.stage/react/components/Video/video.ts
1170
+ var ln = l("video");
1171
+ function un(e, t, n) {
1172
+ if (typeof t.muted == "boolean" && (e.muted = t.muted), typeof t.loop == "boolean" && (e.loop = t.loop), typeof t.currentTime == "number" && Number.isFinite(t.currentTime)) {
1173
+ let r = Math.max(0, t.currentTime);
1174
+ Math.abs(e.currentTime - r) > 1e-4 && (n?.(), e.currentTime = r);
1175
+ }
1176
+ t.paused === !1 || t.autoplay && t.paused !== !0 ? e.paused && e.play().catch(() => void 0) : t.paused === !0 && !e.paused && e.pause();
1177
+ }
1178
+ function dn(e, t) {
1179
+ let n = t.src;
1180
+ if (typeof n != "string" || !n) return;
1181
+ let r = t._videoElement ?? Qt(n) ?? Zt(n), i = y(t.width, r.videoWidth), a = y(t.height, r.videoHeight), o = r.readyState >= 2 && !r.seeking && r.videoWidth > 0 ? r : t._videoFrame;
1182
+ o && (e.save(), le(e, o, o === r ? r.videoWidth : o.width, o === r ? r.videoHeight : o.height, i, a, t.objectFit ?? "contain"), e.restore()), t.controls === !0 && (t.controlsOnHover !== !0 || t._videoControlsVisible === !0) && hn(e, t, r, i, a);
1183
+ }
1184
+ var fn = "rgba(0, 0, 0, 0.55)", pn = "#fff", mn = "rgba(255, 255, 255, 0.35)";
1185
+ function hn(e, t, n, r, i) {
1186
+ let a = Number.isFinite(n.duration) && n.duration > 0 ? n.duration : 0, o = typeof t._videoScrubRatio == "number" ? a * Math.min(1, Math.max(0, t._videoScrubRatio)) : a > 0 ? Math.min(Math.max(0, n.currentTime), a) : 0, s = `${F(o)} / ${F(a)}`, c = O(s, en), l = rn(r, i, c);
1187
+ if (r <= 0 || i <= 0 || l.bar.height <= 0) return;
1188
+ let u = b(t.controlsColor, pn), d = l.track.y + l.track.height / 2;
1189
+ if (e.fillStyle = b(t.controlsBarColor, fn), e.fillRect(0, l.bar.y, r, l.bar.height), _n(e, u, l.play.x + l.play.width / 2, d, n.paused || n.ended), l.fullscreen.width > 0 && gn(e, u, l.fullscreen.x + l.fullscreen.width / 2, d), l.track.width <= 0) return;
1190
+ e.fillStyle = b(t.controlsTrackColor, mn), e.beginPath(), e.roundRect(l.track.x, l.track.y, l.track.width, l.track.height, 2), e.fill();
1191
+ let f = a > 0 ? o / a : 0;
1192
+ f > 0 && (e.fillStyle = u, e.beginPath(), e.roundRect(l.track.x, l.track.y, l.track.width * f, l.track.height, 2), e.fill()), e.beginPath(), e.arc(l.track.x + l.track.width * f, d, 4, 0, Math.PI * 2), e.fillStyle = u, e.fill(), e.font = en, e.textBaseline = "middle", e.textAlign = "left", e.fillText(s, r - 36 - c, d);
1193
+ }
1194
+ function gn(e, t, n, r) {
1195
+ e.strokeStyle = t, e.lineWidth = 1.5, e.beginPath(), e.moveTo(n - 6, r - 2), e.lineTo(n - 6, r - 6), e.lineTo(n - 2, r - 6), e.moveTo(n + 2, r - 6), e.lineTo(n + 6, r - 6), e.lineTo(n + 6, r - 2), e.moveTo(n + 6, r + 2), e.lineTo(n + 6, r + 6), e.lineTo(n + 2, r + 6), e.moveTo(n - 2, r + 6), e.lineTo(n - 6, r + 6), e.lineTo(n - 6, r + 2), e.stroke();
1196
+ }
1197
+ function _n(e, t, n, r, i) {
1198
+ e.fillStyle = t, e.beginPath(), i ? (e.moveTo(n - 4, r - 6), e.lineTo(n - 4, r + 6), e.lineTo(n + 6, r)) : (e.moveTo(n - 5, r - 6), e.lineTo(n - 5, r + 6), e.lineTo(n - 1, r + 6), e.lineTo(n - 1, r - 6), e.moveTo(n + 1, r - 6), e.lineTo(n + 1, r + 6), e.lineTo(n + 5, r + 6), e.lineTo(n + 5, r - 6)), e.closePath(), e.fill();
1199
+ }
1200
+ // tools/angular-build/.stage/react/react/components.ts
1201
+ var vn = /* @__PURE__ */ new WeakMap();
1202
+ function I(t, n) {
1203
+ if (t == null || typeof t == "boolean") return [];
1204
+ if (Array.isArray(t)) return t.flatMap((e, t) => I(e, `${n}.${t}`));
1205
+ if (typeof t == "string" || typeof t == "number") return [];
1206
+ if (!e.isValidElement(t)) throw Error(`Unsupported child inside <Canvas> at ${n}. Use Canvas UI components.`);
1207
+ if (t.type === e.Fragment) return I(t.props.children, n);
1208
+ let r = t.type[c];
1209
+ if (!r) throw Error(`Unsupported component inside <Canvas> at ${n}. Use Canvas UI components.`);
1210
+ if (r === "grid") {
1211
+ let e = vn.get(t);
1212
+ if (e) return e;
1213
+ }
1214
+ let i = { ...t.props }, a = i.children;
1215
+ delete i.children;
1216
+ let o = t.key ?? (typeof i.key == "string" ? i.key : null);
1217
+ delete i.key, r === "grid" && i.virtual === !0 && (i._gridCacheToken = t);
1218
+ let s = r === "group" || r === "form" || r === "formItem" || r === "grid" || r === "gridItem" || r === "dialog" || r === "tabs" || r === "tabItem" || r === "collapse" || r === "collapseItem" || r === "carousel" || r === "carouselItem";
1219
+ if (!s && a != null && typeof a != "boolean" && (r !== "button" || typeof a != "string" && typeof a != "number")) throw Error(r === "button" ? "<Button> accepts only text children; components and elements are not supported." : `<${r}> does not accept children.${r === "text" ? " Use the text prop instead." : ""}`);
1220
+ r === "button" && i.text === void 0 && (i.text = typeof a == "string" || typeof a == "number" ? String(a) : "");
1221
+ let l = [{
1222
+ type: r,
1223
+ key: o,
1224
+ props: i,
1225
+ children: s ? I(a, n) : []
1226
+ }];
1227
+ return r === "grid" && i.virtual === !0 && vn.set(t, l), l;
1228
+ }
1229
+ function yn(e) {
1230
+ return I(e, "canvas");
1231
+ }
1232
+ // tools/angular-build/.stage/react/scene.ts
1233
+ var bn = class e {
1234
+ children = [];
1235
+ parent = null;
1236
+ dirty = !0;
1237
+ type;
1238
+ props;
1239
+ constructor(e, t = {}) {
1240
+ this.type = e, this.props = t;
1241
+ }
1242
+ setProps(e) {
1243
+ this.replaceProps({
1244
+ ...this.props,
1245
+ ...e
1246
+ });
1247
+ }
1248
+ replaceProps(e) {
1249
+ let t = /* @__PURE__ */ new Set([...Object.keys(this.props), ...Object.keys(e)]), n = !1;
1250
+ for (let r of t) if (this.props[r] !== e[r]) {
1251
+ n = !0;
1252
+ break;
1253
+ }
1254
+ n && (this.props = e, this.markDirty());
1255
+ }
1256
+ markDirty() {
1257
+ this.dirty = !0, this.parent?.markDirty();
1258
+ }
1259
+ syncChildren(t, n) {
1260
+ let r = [...this.children], i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map();
1261
+ if (t.some((e) => typeof e.props._gridVirtualIndex == "number")) for (let e of r) typeof e.props._gridVirtualIndex == "number" && a.set(e.props._gridVirtualIndex, e);
1262
+ let o = t.map((t, o) => {
1263
+ let s = t.key === null ? null : `${t.type}:${t.key}`, c = s === null ? typeof t.props._gridVirtualIndex == "number" ? a.get(t.props._gridVirtualIndex) : r[o]?.type === t.type && (r[o].props._gridVirtualIndex === void 0 || r[o].props._gridVirtualIndex === o) && !i.has(r[o]) ? r[o] : void 0 : r.find((e) => e.props._key === s && e.type === t.type && !i.has(e)), l = c?.type === t.type && !i.has(c) ? c : void 0, u = l ?? new e(t.type);
1264
+ l ? i.add(l) : u.parent = this;
1265
+ let d = {
1266
+ ...t.props,
1267
+ _key: s
1268
+ };
1269
+ return (t.type === "input" || t.type === "datePicker" || t.type === "textarea" || t.type === "dropdown" || t.type === "slider") && (d.value === void 0 && (d.value = l?.props.value ?? d.defaultValue ?? (t.type === "slider" ? d.min ?? 0 : "")), (t.type === "input" || t.type === "datePicker" || t.type === "textarea") && (d.focused = l?.props.focused ?? !1, d.cursorPos = l?.props.cursorPos ?? String(d.value).length), t.type === "dropdown" && (d.open = l?.props.open ?? !1)), t.type === "switch" && (d.checked = d.checked ?? l?.props.checked ?? d.defaultChecked ?? !1), (t.type === "radio" || t.type === "checkbox") && (d.value = d.value ?? l?.props.value ?? d.defaultValue ?? (t.type === "checkbox" ? [] : "")), t.type === "upload" && (d._controlledValue = t.props.value !== void 0, d.value = d.value ?? l?.props.value ?? d.defaultValue ?? [], d._uploadError = l?.props._formResetVersion === d._formResetVersion ? l?.props._uploadError : void 0), u.replaceProps(d), u.syncChildren(t.children, n), u;
1270
+ });
1271
+ for (let e of r) !i.has(e) && !o.includes(e) && (n(e), e.parent = null);
1272
+ (o.length !== this.children.length || o.some((e, t) => this.children[t] !== e)) && (this.children.splice(0, this.children.length, ...o), this.markDirty());
1273
+ }
1274
+ traverse(e) {
1275
+ e(this), this.children.forEach((t) => t.traverse(e));
1276
+ }
1277
+ };
1278
+ function xn(e, t, n) {
1279
+ let r = e.props._gridVirtualIndex;
1280
+ return e.key === null ? `${n}/i${typeof r == "number" ? r : t}` : `${n}/k${e.key}`;
1281
+ }
1282
+ // tools/angular-build/.stage/react/renderer.ts
1283
+ var Sn = {
1284
+ rect: ve,
1285
+ circle: be,
1286
+ customDraw: Ht,
1287
+ canvasView: Gt,
1288
+ text: Te,
1289
+ input: De,
1290
+ datePicker: Ge,
1291
+ radio: et,
1292
+ checkbox: nt,
1293
+ upload: ut,
1294
+ carousel: pt,
1295
+ textarea: Ae,
1296
+ dropdown: Me,
1297
+ slider: ze,
1298
+ switch: He,
1299
+ button: yt,
1300
+ image: Dt,
1301
+ icon: at,
1302
+ progress: Mt,
1303
+ tabs: Ft,
1304
+ collapseItem: zt,
1305
+ video: dn
1306
+ };
1307
+ function Cn(e) {
1308
+ return e;
1309
+ }
1310
+ var wn = .5, Tn = class {
1311
+ gridCaches = /* @__PURE__ */ new WeakMap();
1312
+ cacheEnabled = !0;
1313
+ invalidateGridCache() {
1314
+ this.gridCaches = /* @__PURE__ */ new WeakMap();
1315
+ }
1316
+ render(e, t, n = !0) {
1317
+ this.cacheEnabled = n, n || this.invalidateGridCache();
1318
+ let r = e.canvas;
1319
+ e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.clearRect(0, 0, r.width, r.height), e.restore(), this.drawNode(e, t), this.drawDialogs(e, t), this.drawDropdownOverlays(e, t), t.traverse((e) => {
1320
+ e.dirty = !1;
1321
+ });
1322
+ }
1323
+ safeDraw(e, t, n) {
1324
+ if (t) {
1325
+ e.save();
1326
+ try {
1327
+ t(e, n.props);
1328
+ } catch (e) {
1329
+ console.error(`[canvas-ui] Skipped drawing <${n.type}> after a render error:`, e);
1330
+ } finally {
1331
+ e.restore();
1332
+ }
1333
+ }
1334
+ }
1335
+ drawNode(e, t) {
1336
+ if (t.props.visible !== !1 && t.type !== "dialog") {
1337
+ if (e.save(), e.translate(L(t.props.x, 0), L(t.props.y, 0)), e.rotate(L(t.props.rotation, 0)), e.scale(L(t.props.scaleX, 1), L(t.props.scaleY, 1)), t.props.disabled === !0 && (e.globalAlpha *= wn), t.type === "gridItem" && typeof t.props.backgroundColor == "string" && Dn(e, t), t.type !== "root" && this.safeDraw(e, Sn[t.type], t), t.type === "grid" && typeof t.props.height == "number") this.drawCachedGrid(e, t) || this.drawGrid(e, t);
1338
+ else if (t.type === "tabs") {
1339
+ let n = L(t.props.width, 300), r = L(t.props.height, 200), i = L(t.props.headerHeight, 40);
1340
+ e.save(), e.beginPath(), e.rect(0, i, n, Math.max(0, r - i)), e.clip(), t.children.forEach((t) => this.drawNode(e, t)), e.restore();
1341
+ } else t.type === "carousel" ? (e.save(), e.beginPath(), e.rect(0, 0, L(t.props.width, 300), L(t.props.height, 180)), e.clip(), t.children.forEach((t) => this.drawNode(e, t)), e.restore(), this.safeDraw(e, Cn(mt), t)) : t.children.forEach((t) => this.drawNode(e, t));
1342
+ e.restore();
1343
+ }
1344
+ }
1345
+ drawGrid(e, t) {
1346
+ e.save(), e.beginPath(), e.rect(0, 0, L(t.props._gridWidth, L(t.props.width, 0)), L(t.props.height, 0)), e.clip(), t.children.forEach((t) => this.drawNode(e, t)), e.restore(), On(e, t);
1347
+ }
1348
+ drawCachedGrid(e, t) {
1349
+ if (!this.cacheEnabled || t.props.virtual !== !0 || e.globalAlpha !== 1 || e.globalCompositeOperation !== "source-over" || e.filter !== "none" || e.shadowColor !== "rgba(0, 0, 0, 0)" || En(t)) return !1;
1350
+ let n = e.getTransform();
1351
+ if (n.b !== 0 || n.c !== 0 || n.a <= 0 || n.d <= 0) return !1;
1352
+ let r = L(t.props._gridWidth, L(t.props.width, 0)), i = L(t.props.height, 0), a = Math.floor(n.e), o = Math.floor(n.f), s = n.e - a, c = n.f - o, l = Math.ceil(s + r * n.a), u = Math.ceil(c + i * n.d);
1353
+ if (l <= 0 || u <= 0 || l > 4096 || u > 4096) return !1;
1354
+ let d = this.gridCaches.get(t);
1355
+ if (!d || t.dirty || d.sourceCanvas !== e.canvas || d.width !== r || d.height !== i || d.scaleX !== n.a || d.scaleY !== n.d || d.offsetX !== s || d.offsetY !== c) {
1356
+ let a = d?.canvas ?? e.canvas.ownerDocument.createElement("canvas");
1357
+ a.width = l, a.height = u;
1358
+ let o = a.getContext("2d");
1359
+ if (!o) return this.gridCaches.delete(t), !1;
1360
+ he(a, e.canvas), o.setTransform(n.a, 0, 0, n.d, s, c), this.drawGrid(o, t), d = {
1361
+ canvas: a,
1362
+ sourceCanvas: e.canvas,
1363
+ width: r,
1364
+ height: i,
1365
+ scaleX: n.a,
1366
+ scaleY: n.d,
1367
+ offsetX: s,
1368
+ offsetY: c
1369
+ }, this.gridCaches.set(t, d);
1370
+ }
1371
+ return e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.drawImage(d.canvas, a, o), e.restore(), !0;
1372
+ }
1373
+ drawDialogs(e, t) {
1374
+ if (t.props.visible !== !1) {
1375
+ if (t.type === "dialog") {
1376
+ if (!t.props.open) return;
1377
+ e.save(), e.translate(L(t.props.x, 0), L(t.props.y, 0)), e.rotate(L(t.props.rotation, 0)), e.scale(L(t.props.scaleX, 1), L(t.props.scaleY, 1)), t.props.disabled === !0 && (e.globalAlpha *= wn), this.safeDraw(e, Cn(kt), t);
1378
+ let n = L(t.props._dialogPanelX, 0), r = L(t.props._dialogPanelY, 0), i = L(t.props.width, 420), a = L(t.props.height, 240);
1379
+ e.save(), e.beginPath(), e.rect(n + 12, r + 56, Math.max(0, i - 24), Math.max(0, a - 112)), e.clip(), t.children.forEach((t) => this.drawNode(e, t)), e.restore(), e.restore();
1380
+ } else t.children.forEach((t) => this.drawDialogs(e, t));
1381
+ }
1382
+ }
1383
+ drawDropdownOverlays(e, t) {
1384
+ t.props.visible !== !1 && (e.save(), e.translate(L(t.props.x, 0), L(t.props.y, 0)), e.rotate(L(t.props.rotation, 0)), e.scale(L(t.props.scaleX, 1), L(t.props.scaleY, 1)), t.props.disabled === !0 && (e.globalAlpha *= wn), t.type === "dropdown" && t.props.open && this.safeDraw(e, Cn(Ne), t), t.type === "grid" && typeof t.props.height == "number" || t.type === "carousel" ? (e.save(), e.beginPath(), e.rect(0, 0, t.type === "grid" ? L(t.props._gridWidth, L(t.props.width, 0)) : L(t.props.width, 300), L(t.props.height, t.type === "carousel" ? 180 : 0)), e.clip(), t.children.forEach((t) => this.drawDropdownOverlays(e, t)), e.restore()) : t.children.forEach((t) => this.drawDropdownOverlays(e, t)), e.restore());
1385
+ }
1386
+ };
1387
+ function En(e) {
1388
+ for (let t of e.children) if (t.type === "video" || t.type === "image" || t.type === "customDraw" || t.type === "canvasView" || En(t)) return !0;
1389
+ return !1;
1390
+ }
1391
+ function Dn(e, t) {
1392
+ e.fillStyle = t.props.backgroundColor, e.fillRect(0, 0, L(t.props._gridItemWidth, 0), L(t.props._gridItemHeight, 0));
1393
+ }
1394
+ function On(e, t) {
1395
+ let n = L(t.props.height, 0), r = L(t.props._gridContentHeight, n);
1396
+ if (n <= 0 || r <= n) return;
1397
+ let i = L(t.props._gridWidth, L(t.props.width, 0)), a = Math.max(0, i - 6), o = Math.min(n, Math.max(18, n * n / r)), s = r - n, c = (n - o) * L(t.props._scrollTop, 0) / s;
1398
+ e.fillStyle = "rgba(0, 0, 0, 0.08)", e.fillRect(a, 0, 6, n), e.fillStyle = "rgba(0, 0, 0, 0.35)", e.beginPath(), e.roundRect(a + 1, c, 4, o, 3), e.fill();
1399
+ }
1400
+ function L(e, t) {
1401
+ return typeof e == "number" && Number.isFinite(e) ? e : t;
1402
+ }
1403
+ // tools/angular-build/.stage/react/types.ts
1404
+ var R = [
1405
+ 1,
1406
+ 0,
1407
+ 0,
1408
+ 1,
1409
+ 0,
1410
+ 0
1411
+ ];
1412
+ // tools/angular-build/.stage/react/engine/transform.ts
1413
+ function z(e, t) {
1414
+ let n = y(t.rotation, 0), r = y(t.scaleX, 1), i = y(t.scaleY, 1), a = Math.cos(n), o = Math.sin(n), s = a * r, c = o * r, l = -o * i, u = a * i, d = y(t.x, 0), f = y(t.y, 0), [p, m, h, g, _, v] = e;
1415
+ return [
1416
+ p * s + h * c,
1417
+ m * s + g * c,
1418
+ p * l + h * u,
1419
+ m * l + g * u,
1420
+ p * d + h * f + _,
1421
+ m * d + g * f + v
1422
+ ];
1423
+ }
1424
+ function B(e, t, n) {
1425
+ let [r, i, a, o, s, c] = n, l = r * o - i * a;
1426
+ if (!l) return null;
1427
+ let u = e - s, d = t - c;
1428
+ return {
1429
+ x: (o * u - a * d) / l,
1430
+ y: (-i * u + r * d) / l
1431
+ };
1432
+ }
1433
+ function V(e) {
1434
+ let t = [], n = e;
1435
+ for (; n;) t.push(n), n = n.parent;
1436
+ return t.reverse().reduce((e, t) => z(t.type === "dialog" ? R : e, t.props), R);
1437
+ }
1438
+ // tools/angular-build/.stage/react/engine/nodes.ts
1439
+ function H(e) {
1440
+ let t = e;
1441
+ for (; t;) {
1442
+ if (t.props.visible === !1) return !1;
1443
+ t = t.parent;
1444
+ }
1445
+ return !0;
1446
+ }
1447
+ function kn(e) {
1448
+ let t = null, n = (e) => {
1449
+ e.props.visible !== !1 && (e.type === "dialog" ? e.props.open === !0 && (t = e) : e.children.forEach(n));
1450
+ };
1451
+ return n(e), t;
1452
+ }
1453
+ function An(e) {
1454
+ if (e.type === "root") throw Error("The Canvas root is not an event target.");
1455
+ let t = e.props._key, n = typeof t == "string" ? t.indexOf(":") : -1;
1456
+ return {
1457
+ type: e.type,
1458
+ key: typeof t != "string" || n < 0 ? null : t.slice(n + 1)
1459
+ };
1460
+ }
1461
+ function jn(e) {
1462
+ return typeof e == "object" && !!e && "nodeName" in e && e.nodeName === "CANVAS" && "width" in e && typeof e.width == "number" && "height" in e && typeof e.height == "number";
1463
+ }
1464
+ function Mn(e) {
1465
+ return e === "button" || e === "upload" || e === "switch" || e === "slider" || e === "dropdown" || e === "tabs" || e === "collapse" || e === "grid" || e === "radio" || e === "checkbox" || e === "carousel" || e === "customDraw" || e === "canvasView";
1466
+ }
1467
+ function U(e, t) {
1468
+ let n = e.parent;
1469
+ for (; n;) {
1470
+ if (n === t) return !0;
1471
+ n = n.parent;
1472
+ }
1473
+ return !1;
1474
+ }
1475
+ function W(e, t) {
1476
+ let n = t && e.props._userVisible !== !1;
1477
+ e.setProps({ visible: n }), e.children.forEach((e) => W(e, n));
1478
+ }
1479
+ function G(e) {
1480
+ if (e.type === "radio" || e.type === "checkbox") return Je(e.props);
1481
+ if (e.type === "icon") {
1482
+ let t = y(e.props.size, 24);
1483
+ return {
1484
+ width: t,
1485
+ height: t
1486
+ };
1487
+ }
1488
+ if (e.type === "customDraw") return {
1489
+ width: y(e.props.width, 0),
1490
+ height: y(e.props.height, 0)
1491
+ };
1492
+ if (e.type === "text") return {
1493
+ width: Ke(e.props, y(e.props._textWidth, 0)),
1494
+ height: j(e.props, y(e.props._textHeight, 0))
1495
+ };
1496
+ if (e.type === "video") {
1497
+ let t = e.props._videoElement;
1498
+ return {
1499
+ width: y(e.props.width, t?.videoWidth ?? 300),
1500
+ height: y(e.props.height, t?.videoHeight ?? 150)
1501
+ };
1502
+ }
1503
+ let t = e.type === "upload" ? 120 : e.type === "switch" ? 44 : e.type === "slider" ? 160 : e.type === "button" ? 120 : 200, n = e.type === "upload" ? 40 : e.type === "switch" ? 24 : e.type === "slider" ? 32 : e.type === "button" ? 40 : 36;
1504
+ return e.type === "switch" || e.type === "slider" ? {
1505
+ width: y(e.props.width, t),
1506
+ height: y(e.props.height, n)
1507
+ } : e.type === "upload" ? {
1508
+ width: y(e.props.width, t),
1509
+ height: ct(e.props)
1510
+ } : e.type === "button" || e.type === "dropdown" || e.type === "datePicker" ? {
1511
+ width: y(e.props.width, t),
1512
+ height: y(e.props.height, n)
1513
+ } : {
1514
+ width: Ke(e.props, t),
1515
+ height: j(e.props, n)
1516
+ };
1517
+ }
1518
+ function Nn(e, t, n = null) {
1519
+ if (n && !U(e, n)) return !1;
1520
+ let r = e;
1521
+ for (; r;) {
1522
+ if (r.props.visible === !1) return !1;
1523
+ if (r.type === "dialog") return r === n && r.props.open === !0;
1524
+ if (r.type === "grid" && typeof r.props.height == "number") {
1525
+ let [e, n, i, a, o, s] = t.transform, c = B(e * t.width / 2 + i * t.height / 2 + o, n * t.width / 2 + a * t.height / 2 + s, V(r)), l = y(r.props._gridWidth, y(r.props.width, 0)), u = y(r.props.height, 0);
1526
+ if (!c || c.x < 0 || c.x > l || c.y < 0 || c.y > u) return !1;
1527
+ }
1528
+ r = r.parent;
1529
+ }
1530
+ return !0;
1531
+ }
1532
+ function Pn(e, t) {
1533
+ let [n, r, i, a, o, s] = t;
1534
+ return {
1535
+ x: n * e.x + i * e.y + o,
1536
+ y: r * e.x + a * e.y + s
1537
+ };
1538
+ }
1539
+ function Fn(e, t, n, r) {
1540
+ if (!e.length) return [];
1541
+ let i = [], a = (e) => r ? e[t] >= n : e[t] <= n, o = e[e.length - 1];
1542
+ for (let r of e) {
1543
+ if (a(r) !== a(o)) {
1544
+ let e = (n - o[t]) / (r[t] - o[t]);
1545
+ i.push({
1546
+ x: o.x + (r.x - o.x) * e,
1547
+ y: o.y + (r.y - o.y) * e
1548
+ });
1549
+ }
1550
+ a(r) && i.push(r), o = r;
1551
+ }
1552
+ return i;
1553
+ }
1554
+ function K(e, t, n) {
1555
+ if (!Nn(e, t, n)) return {
1556
+ ...t,
1557
+ visible: !1
1558
+ };
1559
+ if (!n) return {
1560
+ ...t,
1561
+ visible: t.visible,
1562
+ clipPath: void 0
1563
+ };
1564
+ let r = V(n), i = y(n.props._dialogPanelX, 0), a = y(n.props._dialogPanelY, 0), o = y(n.props.width, 420), s = y(n.props.height, 240), c = i + 12, l = a + 56, u = c + Math.max(0, o - 24), d = l + Math.max(0, s - 112), f = [
1565
+ {
1566
+ x: 0,
1567
+ y: 0
1568
+ },
1569
+ {
1570
+ x: t.width,
1571
+ y: 0
1572
+ },
1573
+ {
1574
+ x: t.width,
1575
+ y: t.height
1576
+ },
1577
+ {
1578
+ x: 0,
1579
+ y: t.height
1580
+ }
1581
+ ].map((e) => {
1582
+ let n = Pn(e, t.transform);
1583
+ return B(n.x, n.y, r);
1584
+ });
1585
+ if (f.some((e) => e === null) || u <= c || d <= l) return {
1586
+ ...t,
1587
+ visible: !1
1588
+ };
1589
+ let p = f.filter((e) => e !== null);
1590
+ if (p.every((e) => e.x >= c && e.x <= u && e.y >= l && e.y <= d)) return {
1591
+ ...t,
1592
+ clipPath: void 0
1593
+ };
1594
+ if (p = Fn(p, "x", c, !0), p = Fn(p, "x", u, !1), p = Fn(p, "y", l, !0), p = Fn(p, "y", d, !1), p.length < 3) return {
1595
+ ...t,
1596
+ visible: !1
1597
+ };
1598
+ let m = p.map((e) => {
1599
+ let n = Pn(e, r);
1600
+ return B(n.x, n.y, t.transform);
1601
+ });
1602
+ if (m.some((e) => e === null)) return {
1603
+ ...t,
1604
+ visible: !1
1605
+ };
1606
+ let h = `polygon(${m.filter((e) => e !== null).map((e) => `${e.x}px ${e.y}px`).join(", ")})`;
1607
+ return {
1608
+ ...t,
1609
+ clipPath: h
1610
+ };
1611
+ }
1612
+ // tools/angular-build/.stage/react/engine/text-controls.ts
1613
+ function In(e, t, n) {
1614
+ let r = /* @__PURE__ */ new Map();
1615
+ e.scene.traverse((e) => {
1616
+ let t = e.props._canvasInputId;
1617
+ typeof t == "string" && r.set(t, e);
1618
+ });
1619
+ let i = new Set(n.map((e) => e.id));
1620
+ for (let [e, n] of t.textControls) i.has(e) && r.get(e) === n.node || (n.dispose(), t.textControls.delete(e), t.inputValues.delete(e));
1621
+ let a = kn(e.scene);
1622
+ for (let i of n) {
1623
+ let n = r.get(i.id);
1624
+ if (!n) continue;
1625
+ let o = K(n, i.layout, a), s = i.props.value ?? t.inputValues.get(i.id) ?? i.props.defaultValue ?? "";
1626
+ n.setProps({
1627
+ ...n.props,
1628
+ ...i.props,
1629
+ value: s,
1630
+ _canvasInputId: i.id,
1631
+ _controlledValue: i.props.value !== void 0
1632
+ });
1633
+ let c = t.textControls.get(i.id);
1634
+ if (c) {
1635
+ c.layout = o, e.inputBridge.update(i.id, {
1636
+ ...i.props,
1637
+ value: s
1638
+ }, o);
1639
+ continue;
1640
+ }
1641
+ let l = {
1642
+ input: (e, r) => {
1643
+ n.props._controlledValue !== !0 && t.inputValues.set(i.id, e), n.setProps({
1644
+ value: e,
1645
+ cursorPos: r
1646
+ });
1647
+ let a = n.props.onChange;
1648
+ typeof a == "function" && a(e);
1649
+ },
1650
+ selection: (e) => n.setProps({ cursorPos: e }),
1651
+ focus: () => {
1652
+ n.setProps({ focused: !0 });
1653
+ let e = n.props.onFocus;
1654
+ typeof e == "function" && e();
1655
+ },
1656
+ blur: () => {
1657
+ n.setProps({ focused: !1 });
1658
+ let e = n.props.onBlur;
1659
+ typeof e == "function" && e();
1660
+ },
1661
+ scroll: (e, t, r, i) => {
1662
+ (n.props._scrollTop !== e || n.props._scrollHeight !== t || n.props._scrollClientHeight !== r || n.props._scrollClientWidth !== i) && n.setProps({
1663
+ _scrollTop: e,
1664
+ _scrollHeight: t,
1665
+ _scrollClientHeight: r,
1666
+ _scrollClientWidth: i
1667
+ });
1668
+ }
1669
+ }, u = e.inputBridge.mount(i.id, {
1670
+ ...i.props,
1671
+ value: s
1672
+ }, o, l);
1673
+ t.textControls.set(i.id, {
1674
+ node: n,
1675
+ dispose: u,
1676
+ layout: o
1677
+ });
1678
+ }
1679
+ }
1680
+ function q(e, t) {
1681
+ let n = kn(e.scene);
1682
+ for (let r of t.textControls.values()) r.layout = K(r.node, {
1683
+ ...r.layout,
1684
+ visible: !0
1685
+ }, n), e.inputBridge.update(String(r.node.props._canvasInputId), r.node.props, r.layout);
1686
+ }
1687
+ function Ln(e, t) {
1688
+ t.children.forEach((t) => Ln(e, t));
1689
+ let n = t.props._canvasInputId;
1690
+ typeof n == "string" && (e.textControls.get(n)?.dispose(), e.textControls.delete(n), e.inputValues.delete(n));
1691
+ }
1692
+ // tools/angular-build/.stage/react/engine/images.ts
1693
+ function Rn(e, t, n) {
1694
+ let r = /* @__PURE__ */ new Set(), i = (e) => e.forEach((e) => {
1695
+ e.type === "image" && typeof e.props.src == "string" && e.props.src && r.add(e.props.src), i(e.children);
1696
+ });
1697
+ i(n);
1698
+ for (let [e, n] of t.imageSubscriptions) r.has(e) || (n(), t.imageSubscriptions.delete(e));
1699
+ for (let n of r) {
1700
+ if (t.imageSubscriptions.has(n)) continue;
1701
+ let r = Tt(n, (t) => {
1702
+ e.scene.markDirty(), t && e.scene.traverse((e) => {
1703
+ e.type === "image" && e.props.src === n && e.props.onError?.(t);
1704
+ });
1705
+ });
1706
+ t.imageSubscriptions.set(n, r);
1707
+ }
1708
+ }
1709
+ // tools/angular-build/.stage/react/engine/videos.ts
1710
+ function zn(e, t) {
1711
+ if (e.fullscreenCleanup) return;
1712
+ let n = e.video, r = n.ownerDocument, i = (e) => {
1713
+ let n = e instanceof Error ? e : /* @__PURE__ */ Error(`Video fullscreen failed: ${String(e)}`), r = t.props.onError;
1714
+ typeof r == "function" ? r(n) : console.error("[canvas-ui] Failed to enter video fullscreen:", n);
1715
+ };
1716
+ if (!r.body) {
1717
+ i(/* @__PURE__ */ Error("Video fullscreen requires a document body."));
1718
+ return;
1719
+ }
1720
+ let a = n.getAttribute("style"), o = n.controls, s = !1, c = () => {
1721
+ r.fullscreenElement === n ? s = !0 : s && p();
1722
+ }, l = () => {
1723
+ s = !0;
1724
+ }, u = () => {
1725
+ t.setProps({ paused: n.paused }), t.props.onPausedChange?.(n.paused);
1726
+ }, d = () => t.setProps({ currentTime: void 0 }), f = () => {
1727
+ t.markDirty(), t.props.onSeek?.(n.currentTime);
1728
+ }, p = () => {
1729
+ s && t.setProps({ paused: n.paused }), r.removeEventListener("fullscreenchange", c), n.removeEventListener("webkitbeginfullscreen", l), n.removeEventListener("webkitendfullscreen", p), n.removeEventListener("play", u), n.removeEventListener("pause", u), n.removeEventListener("seeking", d), n.removeEventListener("seeked", f), n.controls = o, a === null ? n.removeAttribute("style") : n.setAttribute("style", a), n.remove(), e.fullscreenCleanup = void 0, t.markDirty();
1730
+ };
1731
+ e.fullscreenCleanup = p, r.addEventListener("fullscreenchange", c), n.addEventListener("webkitbeginfullscreen", l), n.addEventListener("webkitendfullscreen", p), n.addEventListener("play", u), n.addEventListener("pause", u), n.addEventListener("seeking", d), n.addEventListener("seeked", f);
1732
+ try {
1733
+ n.controls = !0, n.style.cssText = "position:fixed;inset:0;width:100%;height:100%;object-fit:contain;background:#000;z-index:2147483647", r.body.appendChild(n), typeof n.requestFullscreen == "function" ? n.requestFullscreen().catch((t) => {
1734
+ e.fullscreenCleanup === p && (p(), i(t));
1735
+ }) : typeof n.webkitEnterFullscreen == "function" ? n.webkitEnterFullscreen() : (p(), i(/* @__PURE__ */ Error("Native video fullscreen is not supported by this browser.")));
1736
+ } catch (e) {
1737
+ p(), i(e);
1738
+ }
1739
+ }
1740
+ function Bn(e, t) {
1741
+ let n = t.videoNodes;
1742
+ n.length = 0, e.scene.traverse((e) => {
1743
+ if (e.type !== "video") return;
1744
+ let t = e.props.src;
1745
+ typeof t == "string" && t && n.push(e);
1746
+ }), t.hoveredVideo && (!n.includes(t.hoveredVideo) || t.hoveredVideo.props.controls !== !0 || t.hoveredVideo.props.controlsOnHover !== !0 || t.hoveredVideo.props.visible === !1 || t.hoveredVideo.props.disabled === !0) && (t.hoveredVideo = null);
1747
+ for (let [e, r] of t.videoElements) {
1748
+ let i = e.props.src;
1749
+ n.includes(e) && r.src === i || (r.dispose(), t.videoElements.delete(e));
1750
+ }
1751
+ for (let r of n) {
1752
+ let n = r.props.src, i = t.videoElements.get(r);
1753
+ i && i.src === n || (i = $t(n, (t) => {
1754
+ e.scene.markDirty(), t && r.props.onError?.(t);
1755
+ }, (e, t) => {
1756
+ r.props.onTimeUpdate?.(e, t);
1757
+ }, () => e.scene.markDirty()), t.videoElements.set(r, i)), r.props._videoElement = i.video, r.props._videoFrame = i.frame, r.props._videoControlsVisible = t.hoveredVideo === r;
1758
+ }
1759
+ for (let e of t.videoFrames.keys()) n.includes(e) || t.videoFrames.delete(e);
1760
+ }
1761
+ function Vn(e, t) {
1762
+ let n = t.videoNodes;
1763
+ if (n.length === 0 && t.videoFrames.size === 0) return;
1764
+ let r = !1;
1765
+ for (let e of n) {
1766
+ let n = e.props.src;
1767
+ if (typeof n != "string" || !n || e.props.visible === !1) continue;
1768
+ let i = t.videoElements.get(e);
1769
+ if (!i || i.src !== n) continue;
1770
+ let a = i.video, o = e.props;
1771
+ un(a, i.fullscreenCleanup ? {
1772
+ ...o,
1773
+ paused: void 0,
1774
+ autoplay: !1,
1775
+ currentTime: void 0
1776
+ } : o, () => {
1777
+ i.captureFrame(), e.props._videoFrame = i.frame;
1778
+ });
1779
+ let s = t.videoFrames.get(e);
1780
+ if (!s || s.src !== n) {
1781
+ t.videoFrames.set(e, {
1782
+ src: n,
1783
+ time: -1,
1784
+ playing: !1
1785
+ }), r = !0;
1786
+ continue;
1787
+ }
1788
+ let c = !a.paused && !a.ended, l = a.currentTime;
1789
+ (c || l !== s.time || s.playing) && (r = !0), s.time = l, s.playing = c;
1790
+ }
1791
+ r && e.scene.markDirty();
1792
+ }
1793
+ // tools/angular-build/.stage/react/engine/vnodes.ts
1794
+ function Hn(e) {
1795
+ let t = Wn(e), n = t.children.map((e, t) => {
1796
+ let n = y(e.props.y, 0);
1797
+ return {
1798
+ child: e,
1799
+ index: t,
1800
+ top: n,
1801
+ bottom: n + y(e.props._availableHeight, 0),
1802
+ maxBottom: 0
1803
+ };
1804
+ });
1805
+ n.sort((e, t) => e.top - t.top || e.index - t.index);
1806
+ let r = -Infinity;
1807
+ for (let e of n) r = Math.max(r, e.bottom), e.maxBottom = r;
1808
+ return {
1809
+ token: e.props._gridCacheToken,
1810
+ width: t.width,
1811
+ contentHeight: t.contentHeight,
1812
+ entries: n
1813
+ };
1814
+ }
1815
+ function Un(e, t, n, r) {
1816
+ let i = t - r, a = t + n + r, o = 0, s = e.entries.length;
1817
+ for (; o < s;) {
1818
+ let t = Math.floor((o + s) / 2);
1819
+ e.entries[t].maxBottom < i ? o = t + 1 : s = t;
1820
+ }
1821
+ let c = [];
1822
+ for (let t = o; t < e.entries.length; t++) {
1823
+ let n = e.entries[t];
1824
+ if (n.top > a) break;
1825
+ n.bottom >= i && c.push(n);
1826
+ }
1827
+ return c.sort((e, t) => e.index - t.index).map(({ child: e, index: n }) => ({
1828
+ ...e,
1829
+ props: {
1830
+ ...e.props,
1831
+ _gridVirtualIndex: n,
1832
+ _gridBaseY: e.props.y,
1833
+ y: y(e.props.y, 0) - t
1834
+ }
1835
+ }));
1836
+ }
1837
+ function Wn(e) {
1838
+ let t = e.props.columns, n = e.props.cellWidth, r = e.props.width, i = e.props.cellHeight, a = e.props.gap ?? 0;
1839
+ if (!Number.isInteger(t) || t < 1) throw RangeError("Grid columns must be a positive integer.");
1840
+ if (typeof i != "number" || !Number.isFinite(i) || i <= 0) throw RangeError("Grid cellHeight must be a positive finite number.");
1841
+ if (typeof a != "number" || !Number.isFinite(a) || a < 0) throw RangeError("Grid gap must be a non-negative finite number.");
1842
+ if (r !== void 0 && (typeof r != "number" || !Number.isFinite(r) || r <= 0)) throw RangeError("Grid width must be a positive finite number when provided.");
1843
+ if (e.props.height !== void 0 && (typeof e.props.height != "number" || !Number.isFinite(e.props.height) || e.props.height <= 0)) throw RangeError("Grid height must be a positive finite number when provided.");
1844
+ let o = n === void 0 ? typeof r == "number" && Number.isFinite(r) && r > 0 ? (r - a * (t - 1)) / t : NaN : n;
1845
+ if (typeof o != "number" || !Number.isFinite(o) || o <= 0) throw RangeError("Grid requires a positive finite cellWidth, or a positive width large enough for its columns and gaps.");
1846
+ let s = typeof r == "number" && Number.isFinite(r) ? r : o * t + a * (t - 1), c = /* @__PURE__ */ new Set(), l = 0, u = 0;
1847
+ return {
1848
+ children: e.children.map((e) => {
1849
+ let n = e.type === "gridItem", r = n ? e.props.columnSpan ?? 1 : 1, s = n ? e.props.rowSpan ?? 1 : 1;
1850
+ if (!Number.isInteger(r) || r < 1 || r > t) throw RangeError("GridItem columnSpan must be a positive integer no greater than Grid columns.");
1851
+ if (!Number.isInteger(s) || s < 1) throw RangeError("GridItem rowSpan must be a positive integer.");
1852
+ let d = Math.floor(l / t), f = l % t;
1853
+ for (; f + r > t || !Kn(c, d, f, r, s);) l++, d = Math.floor(l / t), f = l % t;
1854
+ for (let e = d; e < d + s; e++) for (let t = f; t < f + r; t++) c.add(`${e}:${t}`);
1855
+ u = Math.max(u, d * (i + a) + s * i + (s - 1) * a), l++;
1856
+ let p = o * r + a * (r - 1), m = i * s + a * (s - 1);
1857
+ return {
1858
+ ...e,
1859
+ props: {
1860
+ ...e.props,
1861
+ x: y(e.props.x, 0) + f * (o + a),
1862
+ y: y(e.props.y, 0) + d * (i + a),
1863
+ _availableWidth: p,
1864
+ _availableHeight: m,
1865
+ ...n ? {
1866
+ _gridItemWidth: p,
1867
+ _gridItemHeight: m
1868
+ } : {}
1869
+ },
1870
+ children: n ? Gn(e.children, p, m) : e.children
1871
+ };
1872
+ }),
1873
+ contentHeight: u,
1874
+ width: s
1875
+ };
1876
+ }
1877
+ function Gn(e, t, n) {
1878
+ return e.map((e) => ({
1879
+ ...e,
1880
+ props: {
1881
+ ...e.props,
1882
+ _availableWidth: t,
1883
+ _availableHeight: n
1884
+ }
1885
+ }));
1886
+ }
1887
+ function Kn(e, t, n, r, i) {
1888
+ for (let a = t; a < t + i; a++) for (let t = n; t < n + r; t++) if (e.has(`${a}:${t}`)) return !1;
1889
+ return !0;
1890
+ }
1891
+ function qn(e, t, n) {
1892
+ return e.map((e) => ({
1893
+ ...e,
1894
+ props: {
1895
+ ...e.props,
1896
+ x: y(e.props.x, 0) + t,
1897
+ y: y(e.props.y, 0) + n
1898
+ }
1899
+ }));
1900
+ }
1901
+ function Jn(e, t) {
1902
+ return e.map((e) => {
1903
+ let n = typeof e.props._userVisible == "boolean" ? e.props._userVisible : e.props.visible !== !1, r = t && n;
1904
+ return {
1905
+ ...e,
1906
+ props: {
1907
+ ...e.props,
1908
+ visible: r,
1909
+ _userVisible: n
1910
+ },
1911
+ children: Jn(e.children, r)
1912
+ };
1913
+ });
1914
+ }
1915
+ function Yn(e, t, n, r) {
1916
+ return t ? e === t.from ? -t.direction * r * n : e === t.to ? t.direction * r * (1 - n) : 0 : 0;
1917
+ }
1918
+ function Xn(e) {
1919
+ let t = y(e.height, 0), n = y(e._gridContentHeight, t), r = y(e._gridWidth, y(e.width, 0)), i = Math.max(0, n - t), a = i > 0 ? Math.min(t, Math.max(18, t * t / n)) : t;
1920
+ return {
1921
+ width: r,
1922
+ height: t,
1923
+ maxScroll: i,
1924
+ thumbHeight: a,
1925
+ trackX: Math.max(0, r - 6),
1926
+ thumbY: i > 0 ? (t - a) * y(e._scrollTop, 0) / i : 0
1927
+ };
1928
+ }
1929
+ // tools/angular-build/.stage/react/engine/carousel.ts
1930
+ function Zn(e, t) {
1931
+ return e.duration <= 0 ? 1 : Math.max(0, Math.min(1, (t - e.startedAt) / e.duration));
1932
+ }
1933
+ function Qn(e, t, n, r) {
1934
+ let i = y(e.props.width, 300);
1935
+ e.children.filter((e) => e.type === "carouselItem").forEach((e, a) => {
1936
+ let o = n ? (a === n.from || a === n.to) && e.props._userVisible !== !1 : a === t && e.props._userVisible !== !1, s = y(e.props._carouselBaseX, y(e.props.x, 0)), c = Yn(a, n, r, i);
1937
+ e.setProps({ x: s + c }), W(e, o);
1938
+ });
1939
+ }
1940
+ function $n(e, t, n) {
1941
+ for (let e of t.textControls.values()) U(e.node, n) && (e.layout = {
1942
+ ...e.layout,
1943
+ transform: V(e.node)
1944
+ });
1945
+ q(e, t);
1946
+ }
1947
+ function er(e, t, n, r) {
1948
+ let i = n.children.filter((e) => e.type === "carouselItem");
1949
+ if (!i.length) return;
1950
+ let a = y(n.props._activeIndex, 0), o = _t(r, a, i.length, n.props.loop !== !1);
1951
+ if (o === a) return;
1952
+ let s = String(n.props._stateKey ?? "");
1953
+ if (t.carouselTransitions.has(s)) return;
1954
+ let c = Math.max(0, y(n.props.transitionDuration, 450));
1955
+ if (c > 0) {
1956
+ let i = {
1957
+ from: a,
1958
+ to: o,
1959
+ direction: r > a ? 1 : -1,
1960
+ startedAt: t.currentFrameTime,
1961
+ duration: c
1962
+ };
1963
+ t.carouselTransitions.set(s, i), t.carouselFrameTimes.set(s, t.currentFrameTime), n.setProps({
1964
+ _activeIndex: o,
1965
+ _transitionProgress: 0
1966
+ }), Qn(n, o, i, 0), $n(e, t, n), n.props.activeIndex === void 0 && t.carouselSelections.set(s, o), n.props.onChange?.(o);
1967
+ } else t.carouselFrameTimes.set(s, t.currentFrameTime), n.props.activeIndex === void 0 && (t.carouselSelections.set(s, o), n.setProps({ _activeIndex: o }), i.forEach((e, t) => {
1968
+ W(e, t === o && e.props._userVisible !== !1);
1969
+ }), q(e, t)), n.props.onChange?.(o);
1970
+ }
1971
+ function tr(e, t, n) {
1972
+ t.currentFrameTime = n;
1973
+ let r = /* @__PURE__ */ new Set(), i = !1;
1974
+ e.scene.traverse((a) => {
1975
+ if (a.type !== "carousel") return;
1976
+ let o = String(a.props._stateKey ?? "");
1977
+ r.add(o);
1978
+ let s = t.carouselTransitions.get(o);
1979
+ if (s) {
1980
+ if (i = !0, n - s.startedAt >= s.duration) t.carouselTransitions.delete(o), a.setProps({ _transitionProgress: 1 }), Qn(a, s.to, null, 1), $n(e, t, a), t.carouselFrameTimes.set(o, n);
1981
+ else {
1982
+ let r = Zn(s, n);
1983
+ a.setProps({ _transitionProgress: r });
1984
+ let i = r * r * (3 - 2 * r);
1985
+ Qn(a, s.to, s, i), $n(e, t, a);
1986
+ }
1987
+ return;
1988
+ }
1989
+ if (!H(a) || a.props.autoplay === !1 || a.children.filter((e) => e.type === "carouselItem").length < 2) {
1990
+ t.carouselFrameTimes.delete(o);
1991
+ return;
1992
+ }
1993
+ let c = t.carouselFrameTimes.get(o);
1994
+ if (c === void 0) {
1995
+ t.carouselFrameTimes.set(o, n);
1996
+ return;
1997
+ }
1998
+ let l = Math.max(250, y(a.props.interval, 3e3));
1999
+ n - c < l || (t.carouselFrameTimes.set(o, n), er(e, t, a, y(a.props._activeIndex, 0) + 1), i = !0);
2000
+ });
2001
+ for (let e of t.carouselFrameTimes.keys()) r.has(e) || t.carouselFrameTimes.delete(e);
2002
+ for (let e of t.carouselTransitions.keys()) r.has(e) || t.carouselTransitions.delete(e);
2003
+ return i;
2004
+ }
2005
+ // tools/angular-build/.stage/react/engine/forms.ts
2006
+ function nr(e) {
2007
+ e.attachedController && m(e.attachedController, e), e.attachedController = void 0;
2008
+ }
2009
+ function rr(e) {
2010
+ e.controller !== void 0 && e.binding && (p(e.controller, e.binding), e.attachedController = e.controller);
2011
+ }
2012
+ var ir = /* @__PURE__ */ new Set([
2013
+ "input",
2014
+ "textarea",
2015
+ "datePicker",
2016
+ "radio",
2017
+ "checkbox",
2018
+ "dropdown",
2019
+ "slider",
2020
+ "switch",
2021
+ "upload"
2022
+ ]);
2023
+ function J(e) {
2024
+ return Array.isArray(e) ? e.slice() : e;
2025
+ }
2026
+ function Y(e) {
2027
+ return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, J(t)]));
2028
+ }
2029
+ function ar(e) {
2030
+ return typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e) || Array.isArray(e) && (e.every((e) => typeof e == "string") || typeof File < "u" && e.every((e) => e instanceof File));
2031
+ }
2032
+ function or(e) {
2033
+ return typeof e == "string" ? e.trim().length === 0 : e === !1 || Array.isArray(e) && !e.length;
2034
+ }
2035
+ function sr(e, t, n) {
2036
+ let r = (i) => {
2037
+ if (i >= t.length) return;
2038
+ let a = t[i], o = or(e);
2039
+ if (a.required && o) return a.message ?? "This field is required.";
2040
+ if (!o && a.minLength !== void 0 && (typeof e == "string" || Array.isArray(e)) && e.length < a.minLength) return a.message ?? `Minimum length is ${a.minLength}.`;
2041
+ if (!o && a.maxLength !== void 0 && (typeof e == "string" || Array.isArray(e)) && e.length > a.maxLength) return a.message ?? `Maximum length is ${a.maxLength}.`;
2042
+ if (!o && a.pattern && typeof e == "string") {
2043
+ let t = a.pattern.lastIndex;
2044
+ a.pattern.lastIndex = 0;
2045
+ let n = a.pattern.test(e);
2046
+ if (a.pattern.lastIndex = t, !n) return a.message ?? "Invalid format.";
2047
+ }
2048
+ let s = a.validator?.(e, n), c = (e) => {
2049
+ if (e !== void 0 && typeof e != "string") throw TypeError("Form validators must return a string or undefined.");
2050
+ return e ? a.message ?? e : r(i + 1);
2051
+ };
2052
+ return s instanceof Promise ? s.then(c) : c(s);
2053
+ };
2054
+ return r(0);
2055
+ }
2056
+ function cr(e) {
2057
+ return `Validation failed: ${e instanceof Error ? e.message : String(e)}`;
2058
+ }
2059
+ function lr(e, t) {
2060
+ let n = {}, r = [], i = (e, t) => {
2061
+ t && Object.defineProperty(n, e.name, {
2062
+ value: t,
2063
+ enumerable: !0,
2064
+ configurable: !0
2065
+ });
2066
+ };
2067
+ for (let n of e) {
2068
+ let e = sr(t[n.name], n.rules, t);
2069
+ e instanceof Promise ? r.push(e.then((e) => i(n, e), (e) => i(n, cr(e)))) : i(n, e);
2070
+ }
2071
+ return r.length ? Promise.all(r).then(() => n) : n;
2072
+ }
2073
+ function ur(e) {
2074
+ let t = e.props, n = e.type === "switch" ? t.checked ?? t.defaultChecked : t.value ?? t.defaultValue;
2075
+ if (n !== void 0) {
2076
+ if (!ar(n)) throw TypeError(`Invalid initial value for <${e.type}> in <FormItem>.`);
2077
+ return J(n);
2078
+ }
2079
+ return e.type === "checkbox" || e.type === "upload" ? [] : e.type === "switch" ? !1 : e.type === "slider" ? typeof t.min == "number" ? t.min : 0 : "";
2080
+ }
2081
+ function dr(e, t) {
2082
+ return e === "checkbox" ? Array.isArray(t) && t.every((e) => typeof e == "string") : e === "upload" ? Array.isArray(t) && (t.length === 0 || typeof File < "u" && t.every((e) => e instanceof File)) : e === "switch" ? typeof t == "boolean" : e === "slider" ? typeof t == "number" : typeof t == "string";
2083
+ }
2084
+ function fr(e, t, n, r) {
2085
+ t.activeFormKeys.add(r);
2086
+ let i = n.props, a = t.forms.get(r);
2087
+ a || (a = {
2088
+ values: {},
2089
+ errors: {},
2090
+ attempted: !1,
2091
+ revision: 0,
2092
+ submission: 0,
2093
+ resetVersion: 0,
2094
+ validationEpoch: 0,
2095
+ fieldValidations: /* @__PURE__ */ new Map()
2096
+ }, t.forms.set(r, a));
2097
+ let o = a, s = [], c = /* @__PURE__ */ new Set(), l = (e) => t.forms.get(r) === o && o.revision === e, u = (e, t, n) => {
2098
+ e instanceof Promise ? e.then((e) => {
2099
+ l(t) && n(e);
2100
+ }) : l(t) && n(e);
2101
+ }, d = (t, n, r, a) => {
2102
+ if (!ar(r) || !dr(n, r)) throw TypeError(`Invalid value for form field "${t}".`);
2103
+ o.values[t] = J(r);
2104
+ let c = ++o.revision;
2105
+ o.attempted && (o.validationEpoch++, u(lr(s, Y(o.values)), c, (t) => {
2106
+ o.errors = t, e.refreshVirtualGrids();
2107
+ })), e.refreshVirtualGrids(), typeof a == "function" && a(r), i.onValuesChange?.(Y(o.values));
2108
+ };
2109
+ function f(t) {
2110
+ if (t.type === "form") throw Error("Nested <Form> components are not supported.");
2111
+ if (t.type === "formItem") {
2112
+ let n = t.props.name;
2113
+ if (typeof n != "string" || !n) throw Error("<FormItem> requires a name.");
2114
+ if (c.has(n)) throw Error(`Duplicate <FormItem> name: ${n}`);
2115
+ c.add(n);
2116
+ let r = t.children.filter((e) => ir.has(e.type));
2117
+ if (r.length !== 1 || t.children.length !== 1) throw Error(`<FormItem name="${n}"> requires exactly one direct form control.`);
2118
+ let a = r[0], l = i.initialValues && Object.hasOwn(i.initialValues, n) ? i.initialValues[n] : ur(a);
2119
+ if (!ar(l) || !dr(a.type, l)) throw TypeError(`Invalid initial value for form field "${n}".`);
2120
+ let f = t.props.rules;
2121
+ if (f !== void 0 && !Array.isArray(f)) throw TypeError("FormItem rules must be an array.");
2122
+ s.push({
2123
+ name: n,
2124
+ kind: a.type,
2125
+ initial: J(l),
2126
+ rules: f ?? []
2127
+ }), Object.hasOwn(o.values, n) && dr(a.type, o.values[n]) || (o.revision++, Object.defineProperty(o.values, n, {
2128
+ value: J(l),
2129
+ writable: !0,
2130
+ enumerable: !0,
2131
+ configurable: !0
2132
+ }), delete o.errors[n]);
2133
+ let p = a.props.onChange, m = (e) => d(n, a.type, e, p), h = a.props.onBlur, g = () => {
2134
+ let t = o.revision, r = o.validationEpoch, i = (o.fieldValidations.get(n) ?? 0) + 1;
2135
+ o.fieldValidations.set(n, i);
2136
+ let a = s.find((e) => e.name === n);
2137
+ a && u(lr([a], Y(o.values)), t, (t) => {
2138
+ o.validationEpoch === r && o.fieldValidations.get(n) === i && (Object.hasOwn(t, n) ? Object.defineProperty(o.errors, n, {
2139
+ value: t[n],
2140
+ writable: !0,
2141
+ enumerable: !0,
2142
+ configurable: !0
2143
+ }) : delete o.errors[n], e.refreshVirtualGrids());
2144
+ }), typeof h == "function" && h();
2145
+ }, _ = {
2146
+ ...a,
2147
+ props: {
2148
+ ...a.props,
2149
+ [a.type === "switch" ? "checked" : "value"]: J(o.values[n]),
2150
+ _formError: Object.hasOwn(o.errors, n) ? o.errors[n] : void 0,
2151
+ _formResetVersion: o.resetVersion,
2152
+ onChange: m,
2153
+ onBlur: g,
2154
+ _formBlur: g
2155
+ }
2156
+ }, v = {
2157
+ type: "text",
2158
+ key: "$form-error",
2159
+ props: {
2160
+ y: typeof t.props.errorY == "number" ? t.props.errorY : (a.type === "upload" ? ct({
2161
+ ...a.props,
2162
+ value: o.values[n]
2163
+ }) : a.type === "radio" || a.type === "checkbox" ? Je(a.props).height : j(a.props, a.type === "switch" ? 24 : a.type === "slider" ? 32 : 36)) + 4,
2164
+ text: Object.hasOwn(o.errors, n) ? o.errors[n] : "",
2165
+ color: t.props.errorColor ?? "#d93025",
2166
+ fontSize: t.props.errorFontSize ?? 12
2167
+ },
2168
+ children: []
2169
+ };
2170
+ return {
2171
+ ...t,
2172
+ props: {
2173
+ ...t.props,
2174
+ _formItemManaged: !0
2175
+ },
2176
+ children: [_, v]
2177
+ };
2178
+ }
2179
+ if (t.type === "button" && (t.props.formAction === "submit" || t.props.formAction === "reset")) {
2180
+ let n = t.props.onClick;
2181
+ return {
2182
+ ...t,
2183
+ props: {
2184
+ ...t.props,
2185
+ onClick: () => {
2186
+ if (t.props.formAction === "reset") o.values = Object.fromEntries(s.map((e) => [e.name, J(e.initial)])), o.errors = {}, o.attempted = !1, o.revision++, o.submission++, o.resetVersion++, o.validationEpoch++, o.fieldValidations.clear(), e.refreshVirtualGrids(), i.onReset?.();
2187
+ else {
2188
+ o.attempted = !0, o.validationEpoch++;
2189
+ let t = Y(o.values), n = o.revision, r = ++o.submission;
2190
+ u(lr(s, t), n, (n) => {
2191
+ o.submission === r && (o.errors = n, e.refreshVirtualGrids(), Object.keys(n).length ? i.onInvalid?.({ ...n }, t) : i.onSubmit?.(t));
2192
+ });
2193
+ }
2194
+ typeof n == "function" && n();
2195
+ }
2196
+ }
2197
+ };
2198
+ }
2199
+ let n = t.children.map(f);
2200
+ return {
2201
+ ...t,
2202
+ props: t.type === "grid" && t.props.virtual === !0 ? {
2203
+ ...t.props,
2204
+ _gridCacheToken: n
2205
+ } : t.props,
2206
+ children: n
2207
+ };
2208
+ }
2209
+ let p = n.children.map(f);
2210
+ for (let e of Object.keys(o.values)) c.has(e) || (o.revision++, delete o.values[e], delete o.errors[e]);
2211
+ return o.controller = i.controller, o.binding = o.controller === void 0 ? void 0 : {
2212
+ owner: o,
2213
+ getValues: () => Y(o.values),
2214
+ getFieldValue: (e) => {
2215
+ if (!Object.hasOwn(o.values, e)) throw Error(`Unknown form field "${e}".`);
2216
+ return J(o.values[e]);
2217
+ },
2218
+ setFieldValue: (e, t) => {
2219
+ let n = s.find((t) => t.name === e);
2220
+ if (!n) throw Error(`Unknown form field "${e}".`);
2221
+ d(e, n.kind, t);
2222
+ }
2223
+ }, p;
2224
+ }
2225
+ // tools/angular-build/.stage/react/engine/layout.ts
2226
+ var pr = 100;
2227
+ function mr(e) {
2228
+ return we(e);
2229
+ }
2230
+ function hr(e) {
2231
+ let t = y(e.props.height, 0);
2232
+ if (t > 0) return t;
2233
+ let n = pr;
2234
+ for (let t of e.children) {
2235
+ let e = t.type === "text" ? mr(t.props).height : y(t.props.height, 0);
2236
+ n = Math.max(n, y(t.props.y, 0) + e);
2237
+ }
2238
+ return n;
2239
+ }
2240
+ function gr(e, t) {
2241
+ let n = e[t];
2242
+ return Array.isArray(n) ? n.join(",") : typeof n == "string" ? n : "";
2243
+ }
2244
+ function _r(e, t, n, r) {
2245
+ let i = n.activeKey;
2246
+ if (typeof i == "string") return i;
2247
+ let a = e.tabSelections.get(t), o = typeof n.defaultActiveKey == "string" ? n.defaultActiveKey : String(r[0]?.props.id ?? ""), s = a ?? o;
2248
+ return e.tabSelections.set(t, s), s;
2249
+ }
2250
+ function vr(e, t, n) {
2251
+ if (Array.isArray(n.activeKeys)) {
2252
+ let e = n.activeKeys.filter((e) => typeof e == "string");
2253
+ return new Set(n.accordion ? e.slice(0, 1) : e);
2254
+ }
2255
+ let r = e.collapseSelections.get(t), i = Array.isArray(n.defaultActiveKeys) ? n.defaultActiveKeys.filter((e) => typeof e == "string") : [], a = n.accordion ? i.slice(0, 1) : i, o = r ?? new Set(a);
2256
+ return e.collapseSelections.set(t, o), o;
2257
+ }
2258
+ function yr(e, t) {
2259
+ let n = y(e.props.headerHeight, 40), r = y(e.props.width, 300), i = 0;
2260
+ for (let a of e.children) {
2261
+ if (a.type !== "collapseItem") continue;
2262
+ let e = t.has(String(a.props.id ?? ""));
2263
+ a.setProps({
2264
+ y: i + y(a.props._userY, 0),
2265
+ _expanded: e,
2266
+ _collapseWidth: r,
2267
+ _collapseHeaderHeight: n
2268
+ }), a.children.forEach((t) => W(t, e)), i += n + (e ? br(a) : 0);
2269
+ }
2270
+ }
2271
+ function br(e) {
2272
+ return y(e.props._collapseBodyHeight, y(e.props.height, pr));
2273
+ }
2274
+ function xr(e, t, n, r, i, a, o) {
2275
+ return n.map((n, s) => {
2276
+ let c = xn(n, s, a), l = n.props;
2277
+ if (n.type === "formItem" && l._formItemManaged !== !0) throw Error("<FormItem> must be used inside <Form>.");
2278
+ let u = z(n.type === "dialog" ? R : r, l), d = i && l.visible !== !1 && (n.type !== "dialog" || l.open === !0), f = { ...l };
2279
+ if (f._userVisible = typeof l._userVisible == "boolean" ? l._userVisible : l.visible !== !1, n.type === "text") {
2280
+ let e = mr(f);
2281
+ f._textWidth = e.width, f._textHeight = e.height;
2282
+ }
2283
+ if (n.type === "input" || n.type === "datePicker" || n.type === "textarea") {
2284
+ let e = `${n.type}:${c}`;
2285
+ f._canvasInputId = e, f._controlledValue = l.value !== void 0, o.push({
2286
+ id: e,
2287
+ props: l,
2288
+ layout: {
2289
+ width: y(l.width, 200),
2290
+ height: y(l.height, 36),
2291
+ transform: u,
2292
+ visible: d
2293
+ }
2294
+ });
2295
+ }
2296
+ let p = n.children;
2297
+ if (n.type === "form" && (p = fr(e, t, n, c)), n.type === "grid") {
2298
+ let e = c;
2299
+ if (l.virtual === !0 && typeof l.height != "number") throw RangeError("Virtual Grid requires a positive finite height.");
2300
+ let r = l.virtual === !0 ? t.virtualGridLayouts.get(e) : void 0;
2301
+ r && r.token !== l._gridCacheToken && (r = void 0), l.virtual === !0 && t.activeVirtualGridKeys.add(e), l.virtual === !0 && !r && (r = Hn(n), t.virtualGridLayouts.set(e, r));
2302
+ let i = r ?? Wn(n), a = typeof l.height == "number" ? Math.max(0, i.contentHeight - l.height) : 0, o = Math.max(0, Math.min(a, t.gridScrollPositions.get(e) ?? 0));
2303
+ t.gridScrollPositions.set(e, o), f._gridStateKey = e, f._gridWidth = i.width, f._gridContentHeight = i.contentHeight, f._scrollTop = o, p = "entries" in i ? Un(i, o, y(l.height, 0), y(l.cellHeight, 0) + y(l.gap, 0)) : i.children.map((e) => ({
2304
+ ...e,
2305
+ props: {
2306
+ ...e.props,
2307
+ _gridBaseY: e.props.y,
2308
+ y: y(e.props.y, 0) - o
2309
+ }
2310
+ }));
2311
+ }
2312
+ if (n.type === "dialog") {
2313
+ f._viewportWidth = e.context.canvas.width / e.pixelRatio, f._viewportHeight = e.context.canvas.height / e.pixelRatio;
2314
+ let t = y(l.width, 420), n = y(l.height, 240), r = (y(f._viewportWidth, 0) - t) / 2, i = (y(f._viewportHeight, 0) - n) / 2;
2315
+ f._dialogPanelX = r, f._dialogPanelY = i, p = qn(p, r + 24, i + 64);
2316
+ } else if (n.type === "tabs") {
2317
+ let e = p.filter((e) => e.type === "tabItem"), n = `${c}:${gr(l, "defaultActiveKey")}`, r = _r(t, n, l, e);
2318
+ f._activeKey = r, f._tabItems = e.map((e) => ({
2319
+ title: e.props.title,
2320
+ disabled: e.props.disabled,
2321
+ selected: e.props.id === r
2322
+ }));
2323
+ let i = y(l.headerHeight, 40);
2324
+ p = p.map((e) => ({
2325
+ ...e,
2326
+ props: {
2327
+ ...e.props,
2328
+ visible: e.type !== "tabItem" || e.props.visible !== !1 && e.props.id === r,
2329
+ _userVisible: e.props._userVisible ?? e.props.visible !== !1
2330
+ },
2331
+ children: e.type === "tabItem" ? Jn(qn(e.children, 0, i), e.props.visible !== !1 && e.props.id === r) : e.children
2332
+ })), f._stateKey = n;
2333
+ } else if (n.type === "carousel") {
2334
+ let e = p.filter((e) => e.type === "carouselItem"), n = c, r = l.activeIndex, i = typeof r == "number" && Number.isInteger(r) ? r : t.carouselSelections.get(n) ?? (typeof l.defaultActiveIndex == "number" ? l.defaultActiveIndex : 0), a = i, o = t.carouselTransitions.get(n);
2335
+ o && r !== void 0 && i !== o.to && (t.carouselTransitions.delete(n), o = void 0);
2336
+ let s = e.length ? Math.max(0, Math.min(e.length - 1, a)) : 0;
2337
+ o && (o.from >= e.length || o.to >= e.length) && (t.carouselTransitions.delete(n), o = void 0), o && (a = o.to), l.activeIndex === void 0 && t.carouselSelections.set(n, s), f._stateKey = n, f._activeIndex = o ? o.to : s, f._itemCount = e.length, f._transitionProgress = o ? Zn(o, t.currentFrameTime) : 1;
2338
+ let u = y(f._transitionProgress, 1), d = u * u * (3 - 2 * u);
2339
+ p = p.map((t) => ({
2340
+ ...t,
2341
+ props: {
2342
+ ...t.props,
2343
+ _carouselBaseX: t.props._carouselBaseX ?? y(t.props.x, 0),
2344
+ x: t.type === "carouselItem" ? y(t.props.x, 0) + Yn(e.indexOf(t), o, d, y(l.width, 300)) : t.props.x,
2345
+ visible: t.type !== "carouselItem" || t.props.visible !== !1 && (o ? e.indexOf(t) === o.from || e.indexOf(t) === o.to : e[s] === t),
2346
+ _userVisible: t.props._userVisible ?? t.props.visible !== !1
2347
+ },
2348
+ children: t.type === "carouselItem" ? Jn(t.children, t.props.visible !== !1 && (o ? e.indexOf(t) === o.from || e.indexOf(t) === o.to : e[s] === t)) : t.children
2349
+ }));
2350
+ } else if (n.type === "collapse") {
2351
+ let e = `${c}:${gr(l, "defaultActiveKeys")}`, n = vr(t, e, l), r = y(l.headerHeight, 40), i = y(l.width, 300), a = 0;
2352
+ p = p.map((e) => {
2353
+ if (e.type !== "collapseItem") return e;
2354
+ let t = n.has(String(e.props.id ?? "")), o = hr(e), s = t ? o : 0, c = {
2355
+ ...e,
2356
+ props: {
2357
+ ...e.props,
2358
+ x: y(e.props.x, 0),
2359
+ y: a + y(e.props.y, 0),
2360
+ _userY: y(e.props.y, 0),
2361
+ visible: e.props.visible !== !1,
2362
+ _userVisible: e.props._userVisible ?? e.props.visible !== !1,
2363
+ _expanded: t,
2364
+ _collapseWidth: i,
2365
+ _collapseHeaderHeight: r,
2366
+ _collapseBodyHeight: o,
2367
+ backgroundColor: e.props.backgroundColor ?? l.backgroundColor,
2368
+ textColor: e.props.textColor ?? l.textColor,
2369
+ borderColor: e.props.borderColor ?? l.borderColor
2370
+ },
2371
+ children: Jn(qn(e.children, 0, r), t && e.props.visible !== !1)
2372
+ };
2373
+ return a += r + s, c;
2374
+ }), f._stateKey = e, f._activeKeys = [...n];
2375
+ }
2376
+ return {
2377
+ ...n,
2378
+ props: f,
2379
+ children: xr(e, t, p, u, d, c, o)
2380
+ };
2381
+ });
2382
+ }
2383
+ // tools/angular-build/.stage/react/engine/uploads.ts
2384
+ function Sr(e) {
2385
+ return Array.isArray(e.props.value) ? e.props.value : [];
2386
+ }
2387
+ function Cr(e, t) {
2388
+ let n = t.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
2389
+ if (!n.length) return !0;
2390
+ let r = e.name.toLowerCase(), i = e.type.toLowerCase();
2391
+ return n.some((e) => e.startsWith(".") ? r.endsWith(e) : e.endsWith("/*") ? i.startsWith(e.slice(0, -1)) : i === e);
2392
+ }
2393
+ function wr(e, t, n) {
2394
+ (e.props.value === void 0 || e.props._controlledValue !== !0) && e.setProps({ value: n });
2395
+ let r = e.props.onChange;
2396
+ typeof r == "function" && r([...n]), t.refreshVirtualGrids();
2397
+ }
2398
+ function Tr(e, t) {
2399
+ if (e.props.disabled) return;
2400
+ let n = typeof e.props.accept == "string" ? e.props.accept : "", r = e.props.maxSize;
2401
+ if (r !== void 0 && (typeof r != "number" || !Number.isFinite(r) || r < 0)) throw RangeError("Upload maxSize must be a non-negative finite number of bytes.");
2402
+ t.inputBridge.pickFiles(n || void 0, !!e.props.multiple, (i) => {
2403
+ if (!e.parent || e.props.disabled) return;
2404
+ let a = [], o = [];
2405
+ for (let e of i) Cr(e, n) ? typeof r == "number" && e.size > r ? o.push({
2406
+ file: e,
2407
+ reason: "size"
2408
+ }) : a.push(e) : o.push({
2409
+ file: e,
2410
+ reason: "type"
2411
+ });
2412
+ e.setProps({ _uploadError: o.length ? "Some files have an invalid type or size." : void 0 });
2413
+ let s = e.props.onReject;
2414
+ a.length ? wr(e, t, e.props.multiple ? [...Sr(e), ...a] : [a[0]]) : t.refreshVirtualGrids(), o.length && typeof s == "function" && s(o);
2415
+ });
2416
+ }
2417
+ function Er(e, t, n) {
2418
+ if (e.props.disabled) return;
2419
+ let r = Sr(e);
2420
+ n < 0 || n >= r.length || (e.setProps({ _uploadError: void 0 }), wr(e, t, r.filter((e, t) => t !== n)));
2421
+ }
2422
+ function Dr(e, t, n) {
2423
+ let r = y(e.props.height, 40), i = y(e.props.width, 120), a = Math.floor((n - r) / 28);
2424
+ return t >= i - 24 && t <= i && n >= r && a < Sr(e).length ? a : void 0;
2425
+ }
2426
+ // tools/angular-build/.stage/react/engine/hit-test.ts
2427
+ function Or(e, t, n, r) {
2428
+ let i = t.getBoundingClientRect();
2429
+ return !i.width || !i.height ? null : {
2430
+ x: (n - i.left) * t.width / i.width / e.pixelRatio,
2431
+ y: (r - i.top) * t.height / i.height / e.pixelRatio
2432
+ };
2433
+ }
2434
+ function X(e, t, n, r, i) {
2435
+ let a = t.getBoundingClientRect();
2436
+ if (!a.width || !a.height) return null;
2437
+ let o = (n - a.left) * t.width / a.width / e.pixelRatio, s = (r - a.top) * t.height / a.height / e.pixelRatio, c = null, l = (e, t) => {
2438
+ let n = e.type === "dialog" ? z(R, e.props) : z(t, e.props);
2439
+ if (e === i) return c = B(o, s, n), !0;
2440
+ for (let t of e.children) if (l(t, n)) return !0;
2441
+ return !1;
2442
+ };
2443
+ return l(e.scene, R), c;
2444
+ }
2445
+ function kr(e, t, n, r, i) {
2446
+ let a = i.parent;
2447
+ for (; a && a.type !== "dialog";) {
2448
+ if (a.type === "grid" && typeof a.props.height == "number" || a.type === "carousel") {
2449
+ let i = X(e, t, n, r, a), o = a.type === "grid" ? y(a.props._gridWidth, y(a.props.width, 0)) : y(a.props.width, 300), s = y(a.props.height, a.type === "carousel" ? 180 : 0);
2450
+ if (!i || i.x < 0 || i.x > o || i.y < 0 || i.y > s) return !1;
2451
+ }
2452
+ a = a.parent;
2453
+ }
2454
+ return !0;
2455
+ }
2456
+ function Ar(e, t, n, r) {
2457
+ let i = t.getBoundingClientRect();
2458
+ if (!i.width || !i.height) return null;
2459
+ let a = (n - i.left) * t.width / i.width / e.pixelRatio, o = (r - i.top) * t.height / i.height / e.pixelRatio, s = [], c = (e, t, n, r) => {
2460
+ let i = n && e.props.visible !== !1;
2461
+ if (!i || e.type === "dialog" && (r || e.props.open !== !0)) return;
2462
+ let a = e.type === "dialog" ? z(R, e.props) : z(t, e.props);
2463
+ (Mn(e.type) || e.type === "dialog" && e.props.open === !0 || (e.type === "text" || e.type === "image" || e.type === "icon") && typeof e.props.onClick == "function" || e.type === "video" && e.props.controls === !0) && s.push({
2464
+ node: e,
2465
+ transform: a
2466
+ }), e.children.forEach((t) => c(t, a, i, r || e.type === "dialog"));
2467
+ };
2468
+ c(e.scene, R, !0, !1);
2469
+ let l = [...s].reverse().find((e) => e.node.type === "dialog");
2470
+ for (let i = s.length - 1; i >= 0; i--) {
2471
+ let c = s[i];
2472
+ if (l && c.node !== l.node && !U(c.node, l.node) || c.node.type !== "dropdown" || !c.node.props.open || c.node.props.disabled || !kr(e, t, n, r, c.node)) continue;
2473
+ let u = B(a, o, c.transform);
2474
+ if (!u) continue;
2475
+ let { width: d, height: f } = G(c.node), p = A(c.node.props.options).length * f;
2476
+ if (u.x >= 0 && u.x <= d && u.y >= f && u.y <= f + p) return {
2477
+ node: c.node,
2478
+ x: u.x,
2479
+ y: u.y
2480
+ };
2481
+ }
2482
+ for (let i = s.length - 1; i >= 0; i--) {
2483
+ let c = s[i];
2484
+ if (l && c.node !== l.node && !U(c.node, l.node) || !kr(e, t, n, r, c.node)) continue;
2485
+ let u = B(a, o, c.transform);
2486
+ if (!u) continue;
2487
+ if (c.node.type === "customDraw") {
2488
+ let { width: e, height: t } = G(c.node);
2489
+ if (u.x < 0 || u.x > e || u.y < 0 || u.y > t) continue;
2490
+ let n = c.node.props.hitTest;
2491
+ if (typeof n == "function" && !n(u.x, u.y, {
2492
+ width: e,
2493
+ height: t
2494
+ })) continue;
2495
+ return {
2496
+ node: c.node,
2497
+ x: u.x,
2498
+ y: u.y
2499
+ };
2500
+ }
2501
+ if (c.node.type === "canvasView") {
2502
+ let e = c.node.props.source;
2503
+ if (!jn(e) || !e.width || !e.height) continue;
2504
+ let { width: t, height: n } = G(c.node);
2505
+ if (u.x < 0 || u.x > t || u.y < 0 || u.y > n) continue;
2506
+ if ((c.node.props.fit ?? "contain") === "contain") {
2507
+ let r = Math.min(t / e.width, n / e.height), i = e.width * r, a = e.height * r, o = (t - i) / 2, s = (n - a) / 2;
2508
+ if (u.x < o || u.x > o + i || u.y < s || u.y > s + a) continue;
2509
+ }
2510
+ return {
2511
+ node: c.node,
2512
+ x: u.x,
2513
+ y: u.y
2514
+ };
2515
+ }
2516
+ if (c.node.type === "dialog") return {
2517
+ node: c.node,
2518
+ x: u.x,
2519
+ y: u.y
2520
+ };
2521
+ if (c.node.type === "tabs") {
2522
+ let e = y(c.node.props.width, 300), t = y(c.node.props.height, 200);
2523
+ if (u.x >= 0 && u.x <= e && u.y >= 0 && u.y <= t) return {
2524
+ node: c.node,
2525
+ x: u.x,
2526
+ y: u.y
2527
+ };
2528
+ continue;
2529
+ }
2530
+ if (c.node.type === "carousel") {
2531
+ let e = y(c.node.props.width, 300), t = y(c.node.props.height, 180);
2532
+ if (u.x >= 0 && u.x <= e && u.y >= 0 && u.y <= t) return {
2533
+ node: c.node,
2534
+ x: u.x,
2535
+ y: u.y
2536
+ };
2537
+ continue;
2538
+ }
2539
+ if (c.node.type === "grid") {
2540
+ if (typeof c.node.props.height != "number") continue;
2541
+ let e = y(c.node.props._gridWidth, y(c.node.props.width, 0)), t = y(c.node.props.height, 0);
2542
+ if (u.x >= 0 && u.x <= e && u.y >= 0 && u.y <= t) return {
2543
+ node: c.node,
2544
+ x: u.x,
2545
+ y: u.y
2546
+ };
2547
+ continue;
2548
+ }
2549
+ if (c.node.type === "collapse") {
2550
+ let e = y(c.node.props.width, 300), t = c.node.children.reduce((e, t) => e + y(t.props._collapseHeaderHeight, 40) + (t.props._expanded ? y(t.props.height, 100) : 0), 0);
2551
+ if (u.x >= 0 && u.x <= e && u.y >= 0 && u.y <= t) return {
2552
+ node: c.node,
2553
+ x: u.x,
2554
+ y: u.y
2555
+ };
2556
+ continue;
2557
+ }
2558
+ let { width: d, height: f } = G(c.node), p = c.node.type === "dropdown" && c.node.props.open ? A(c.node.props.options).length * f : 0;
2559
+ if (u.x >= 0 && u.x <= d && u.y >= 0 && u.y <= f + p) return {
2560
+ node: c.node,
2561
+ x: u.x,
2562
+ y: u.y
2563
+ };
2564
+ }
2565
+ return null;
2566
+ }
2567
+ function jr(e, t, n, r) {
2568
+ let i = [], a = [];
2569
+ e.scene.traverse((e) => {
2570
+ e.type === "dialog" && e.props.open === !0 && H(e) && a.push(e), e.type === "carousel" && H(e) && i.push(e);
2571
+ });
2572
+ let o = a[a.length - 1];
2573
+ for (let a of i.reverse()) {
2574
+ if (o && !U(a, o)) continue;
2575
+ let i = X(e, t, n, r, a);
2576
+ if (!i) continue;
2577
+ let s = y(a.props.width, 300), c = y(a.props.height, 180), l = a.children.filter((e) => e.type === "carouselItem").length, u = y(a.props._activeIndex, 0), d = gt(a.props, i.x, i.y, l, u, s, c);
2578
+ if (d !== void 0) return {
2579
+ node: a,
2580
+ index: d
2581
+ };
2582
+ }
2583
+ return null;
2584
+ }
2585
+ function Mr(e, t, n, r) {
2586
+ let i = [];
2587
+ e.scene.traverse((e) => {
2588
+ e.type === "grid" && typeof e.props.height == "number" && i.push(e);
2589
+ });
2590
+ for (let a of i.reverse()) {
2591
+ if (!kr(e, t, n, r, a)) continue;
2592
+ let i = X(e, t, n, r, a);
2593
+ if (!i) continue;
2594
+ let o = Xn(a.props);
2595
+ if (!(o.maxScroll <= 0 || i.x < o.trackX || i.x > o.width || i.y < o.thumbY || i.y > o.thumbY + o.thumbHeight)) return {
2596
+ node: a,
2597
+ pointerY: i.y,
2598
+ scrollTop: y(a.props._scrollTop, 0)
2599
+ };
2600
+ }
2601
+ return null;
2602
+ }
2603
+ // tools/angular-build/.stage/react/engine/events.ts
2604
+ function Nr(e, t, n, r, i) {
2605
+ e.onEvent?.({
2606
+ type: t,
2607
+ target: r ? An(r.node) : null,
2608
+ x: i.x,
2609
+ y: i.y,
2610
+ localX: r?.x,
2611
+ localY: r?.y,
2612
+ pointerId: n.pointerId
2613
+ });
2614
+ }
2615
+ function Pr(e, t, n, r, i) {
2616
+ let a = t.props.source;
2617
+ if (!jn(a)) return;
2618
+ let { width: o, height: s } = G(t);
2619
+ if (!o || !s || !a.width || !a.height) return;
2620
+ let c = t.props.fit ?? "contain", l = c === "cover" ? Math.max(o / a.width, s / a.height) : c === "fill" ? null : Math.min(o / a.width, s / a.height), u = l === null ? o : a.width * l, d = l === null ? s : a.height * l, f = (o - u) / 2, p = (s - d) / 2, m = l === null ? n * a.width / o : (n - f) / l, h = l === null ? r * a.height / s : (r - p) / l, g = t.props.onPointerEvent;
2621
+ typeof g == "function" && g({
2622
+ type: e,
2623
+ source: a,
2624
+ x: n,
2625
+ y: r,
2626
+ sourceX: m,
2627
+ sourceY: h,
2628
+ sourceWidth: a.width,
2629
+ sourceHeight: a.height,
2630
+ pointerId: i.pointerId,
2631
+ pointerType: i.pointerType,
2632
+ pressure: i.pressure,
2633
+ isPrimary: i.isPrimary,
2634
+ button: i.button,
2635
+ buttons: i.buttons
2636
+ });
2637
+ }
2638
+ // tools/angular-build/.stage/react/engine/interaction.ts
2639
+ function Fr(e, t, n) {
2640
+ let r = jr(e, n.currentTarget, n.clientX, n.clientY), i = Mr(e, n.currentTarget, n.clientX, n.clientY), a = r?.node ?? i?.node, o = a ? X(e, n.currentTarget, n.clientX, n.clientY, a) : null, s = a ? {
2641
+ node: a,
2642
+ x: o?.x ?? 0,
2643
+ y: o?.y ?? 0
2644
+ } : Ar(e, n.currentTarget, n.clientX, n.clientY), c = Or(e, n.currentTarget, n.clientX, n.clientY);
2645
+ if (c && (t.pointerSequences.set(n.pointerId, {
2646
+ target: s?.node ?? null,
2647
+ x: c.x,
2648
+ y: c.y,
2649
+ eligible: s?.node.props.disabled !== !0
2650
+ }), Nr(e, "pointerdown", n, s, c), s?.node.type === "canvasView" && Pr("pointerdown", s.node, s.x, s.y, n)), n.pointerType === "touch") {
2651
+ let e = s?.node.type === "video" && s.node.props.controls === !0 && s.node.props.controlsOnHover === !0 && !s.node.props.disabled ? s.node : null;
2652
+ if (e !== t.hoveredVideo) {
2653
+ if (Rr(t, e), e) {
2654
+ n.preventDefault();
2655
+ return;
2656
+ }
2657
+ } else if (e && !an(Jr(t, e), s?.x ?? 0, s?.y ?? 0)) {
2658
+ Rr(t, null), n.preventDefault();
2659
+ return;
2660
+ }
2661
+ } else t.activeVideo || zr(t, s?.node ?? null);
2662
+ if (r) {
2663
+ er(e, t, r.node, r.index), n.currentTarget.setPointerCapture(n.pointerId), n.preventDefault();
2664
+ return;
2665
+ }
2666
+ if (i) {
2667
+ t.activeGridScroll = i, n.currentTarget.setPointerCapture(n.pointerId), n.preventDefault();
2668
+ return;
2669
+ }
2670
+ if (Kr(e.scene, s?.node), !s || s.node.props.disabled) return;
2671
+ let { node: l, x: u, y: d } = s;
2672
+ if (l.type === "slider") t.activeSlider = l, qr(l, u);
2673
+ else if (l.type === "video" && l.props.controls === !0) {
2674
+ let n = an(Jr(t, l), u, d);
2675
+ if (n === "play") Yr(t, l);
2676
+ else if (n === "fullscreen") {
2677
+ let e = t.videoElements.get(l);
2678
+ e && zn(e, l);
2679
+ } else if (n === "track") t.activeVideo = l, Xr(e, t, l, u);
2680
+ else return;
2681
+ } else if (l.type === "switch") Ue(l);
2682
+ else if (l.type === "radio") {
2683
+ let e = Xe(l.props, u, d), t = e && !e.disabled ? Ze(l.props.value, e) : void 0;
2684
+ if (t === void 0) return;
2685
+ l.props._controlledValue !== !0 && l.setProps({ value: t }), l.props.onChange?.(t);
2686
+ } else if (l.type === "checkbox") {
2687
+ let e = Xe(l.props, u, d);
2688
+ if (!e || e.disabled) return;
2689
+ let t = Qe(l.props.value, e);
2690
+ l.props._controlledValue !== !0 && l.setProps({ value: t }), l.props.onChange?.(t);
2691
+ } else if (l.type === "upload") {
2692
+ let t = Dr(l, u, d);
2693
+ t === void 0 ? d <= y(l.props.height, 40) && Tr(l, e) : Er(l, e, t);
2694
+ } else if (l.type === "button") t.activeButton = l, bt(l, !0);
2695
+ else if (l.type === "tabs") {
2696
+ let n = It(l.children.filter((e) => e.type === "tabItem"), u, d, y(l.props.width, 300), y(l.props.headerHeight, 40));
2697
+ if (n === void 0) return;
2698
+ Ur(e, t, l, n);
2699
+ } else if (l.type === "collapse") {
2700
+ let n = y(l.props.headerHeight, 40), r = [...l.children].reverse().find((e) => {
2701
+ let t = y(e.props.y, 0);
2702
+ return d >= t && d <= t + n;
2703
+ });
2704
+ if (r && !r.props.disabled && typeof r.props.id == "string") Wr(e, t, l, r);
2705
+ else return;
2706
+ } else if (l.type === "dialog") {
2707
+ Gr(l, u, d), n.preventDefault();
2708
+ return;
2709
+ } else if (l.type === "dropdown") {
2710
+ let e = y(l.props.height, 36);
2711
+ if (l.props.open) {
2712
+ let t = Math.floor(d / e) - 1, n = Ie(l.props.options, t);
2713
+ d >= e && n && !n.disabled ? Le(l, n) : l.setProps({ open: !1 });
2714
+ } else l.setProps({ open: !0 });
2715
+ } else if (l.type !== "customDraw" && l.type !== "canvasView" && l.type !== "text" && l.type !== "image" && l.type !== "icon") return;
2716
+ n.currentTarget.setPointerCapture(n.pointerId), n.preventDefault();
2717
+ }
2718
+ function Ir(e, t, n) {
2719
+ let r = Ar(e, n.currentTarget, n.clientX, n.clientY);
2720
+ n.pointerType !== "touch" && !t.activeVideo && zr(t, r?.node ?? null);
2721
+ let i = Or(e, n.currentTarget, n.clientX, n.clientY);
2722
+ i && Nr(e, "pointermove", n, r, i);
2723
+ let a = t.pointerSequences.get(n.pointerId), o = a?.target?.type === "canvasView" ? a.target : r?.node.type === "canvasView" ? r.node : null;
2724
+ if (o) {
2725
+ let t = o === r?.node ? r : X(e, n.currentTarget, n.clientX, n.clientY, o);
2726
+ t && Pr("pointermove", o, t.x, t.y, n);
2727
+ }
2728
+ if (t.activeGridScroll) {
2729
+ let r = t.activeGridScroll, i = X(e, n.currentTarget, n.clientX, n.clientY, r.node);
2730
+ if (i) {
2731
+ let n = Xn(r.node.props), a = n.height - n.thumbHeight;
2732
+ a > 0 && Hr(e, t, r.node, r.scrollTop + (i.y - r.pointerY) * n.maxScroll / a);
2733
+ }
2734
+ return;
2735
+ }
2736
+ if (t.activeVideo) {
2737
+ let r = t.activeVideo, i = X(e, n.currentTarget, n.clientX, n.clientY, r);
2738
+ i && Xr(e, t, r, i.x);
2739
+ return;
2740
+ }
2741
+ if (!t.activeSlider) return;
2742
+ let s = X(e, n.currentTarget, n.clientX, n.clientY, t.activeSlider);
2743
+ s && qr(t.activeSlider, s.x);
2744
+ }
2745
+ function Lr(e, t, n, r = !1) {
2746
+ let i = r ? null : Ar(e, n.currentTarget, n.clientX, n.clientY), a = Or(e, n.currentTarget, n.clientX, n.clientY), o = t.pointerSequences.get(n.pointerId);
2747
+ if (t.pointerSequences.delete(n.pointerId), a) {
2748
+ Nr(e, r ? "pointercancel" : "pointerup", n, i, a);
2749
+ let t = o?.target?.type === "canvasView" ? o.target : i?.node.type === "canvasView" ? i.node : null;
2750
+ if (t) {
2751
+ let i = X(e, n.currentTarget, n.clientX, n.clientY, t);
2752
+ i && Pr(r ? "pointercancel" : "pointerup", t, i.x, i.y, n);
2753
+ }
2754
+ if (!r && o?.eligible && o.target === (i?.node ?? null) && Math.hypot(a.x - o.x, a.y - o.y) <= 8) {
2755
+ if (e.onEvent?.({
2756
+ type: "click",
2757
+ target: i ? An(i.node) : null,
2758
+ x: a.x,
2759
+ y: a.y,
2760
+ localX: i?.x,
2761
+ localY: i?.y,
2762
+ pointerId: n.pointerId
2763
+ }), i?.node.type === "canvasView" && Pr("click", i.node, i.x, i.y, n), i && i.node.props.disabled !== !0 && (i.node.type === "text" || i.node.type === "image" || i.node.type === "icon")) {
2764
+ let e = i.node.props.onClick;
2765
+ typeof e == "function" && e();
2766
+ }
2767
+ if (i?.node.type === "customDraw") {
2768
+ let e = i.node.props.onClick;
2769
+ if (typeof e == "function") {
2770
+ let t = G(i.node);
2771
+ e({
2772
+ x: i.x,
2773
+ y: i.y,
2774
+ canvasX: a.x,
2775
+ canvasY: a.y,
2776
+ width: t.width,
2777
+ height: t.height,
2778
+ pointerId: n.pointerId
2779
+ });
2780
+ }
2781
+ }
2782
+ }
2783
+ }
2784
+ if (t.activeVideo) {
2785
+ let n = t.activeVideo;
2786
+ r ? n.setProps({ _videoScrubRatio: void 0 }) : Zr(e, t, n);
2787
+ }
2788
+ if (t.activeSlider = null, t.activeVideo = null, t.activeGridScroll = null, n.pointerType !== "touch") {
2789
+ let e = n.currentTarget.getBoundingClientRect();
2790
+ zr(t, !r && n.clientX >= e.left && n.clientX <= e.left + e.width && n.clientY >= e.top && n.clientY <= e.top + e.height ? i?.node ?? null : null);
2791
+ }
2792
+ if (t.activeButton) {
2793
+ let e = t.activeButton;
2794
+ bt(e, !1), i?.node === e && xt(e), t.activeButton = null;
2795
+ }
2796
+ n.currentTarget.hasPointerCapture(n.pointerId) && n.currentTarget.releasePointerCapture(n.pointerId);
2797
+ }
2798
+ function Rr(e, t) {
2799
+ e.hoveredVideo !== t && (e.hoveredVideo?.setProps({ _videoControlsVisible: !1 }), e.hoveredVideo = t, t?.setProps({ _videoControlsVisible: !0 }));
2800
+ }
2801
+ function zr(e, t) {
2802
+ Rr(e, t?.type === "video" && t.props.controls === !0 && t.props.controlsOnHover === !0 && t.props.disabled !== !0 ? t : null);
2803
+ }
2804
+ function Br(e, t) {
2805
+ t !== "touch" && !e.activeVideo && Rr(e, null);
2806
+ }
2807
+ function Vr(e, t, n) {
2808
+ let r = Ar(e, n.currentTarget, n.clientX, n.clientY), i = Or(e, n.currentTarget, n.clientX, n.clientY);
2809
+ i && e.onEvent?.({
2810
+ type: "wheel",
2811
+ target: r ? An(r.node) : null,
2812
+ x: i.x,
2813
+ y: i.y,
2814
+ localX: r?.x,
2815
+ localY: r?.y,
2816
+ deltaY: n.deltaY
2817
+ });
2818
+ let a = r?.node ?? null;
2819
+ for (; a && a.type !== "grid";) a = a.parent;
2820
+ if (!a || typeof a.props.height != "number") return;
2821
+ let o = X(e, n.currentTarget, n.clientX, n.clientY, a), s = y(a.props._gridWidth, y(a.props.width, 0)), c = y(a.props.height, 0), l = y(a.props._gridContentHeight, c);
2822
+ if (!o || o.x < 0 || o.x > s || o.y < 0 || o.y > c || l <= c) return;
2823
+ let u = n.currentTarget.getBoundingClientRect();
2824
+ if (!u.height) return;
2825
+ let [d, f, p, m] = V(a), h = d * m - f * p;
2826
+ if (!h) return;
2827
+ let g = n.deltaY * n.currentTarget.height / u.height / e.pixelRatio, _ = y(a.props._scrollTop, 0) + g * d / h;
2828
+ Hr(e, t, a, _), n.preventDefault();
2829
+ }
2830
+ function Hr(e, t, n, r) {
2831
+ let i = Math.max(0, y(n.props._gridContentHeight, 0) - y(n.props.height, 0)), a = Math.max(0, Math.min(i, r));
2832
+ if (a === n.props._scrollTop) return !1;
2833
+ n.setProps({ _scrollTop: a });
2834
+ let o = String(n.props._gridStateKey ?? "");
2835
+ if (t.gridScrollPositions.set(o, a), n.props.virtual === !0) return e.refreshVirtualGrids(), n.props.onScroll?.(a), !0;
2836
+ for (let e of n.children) e.setProps({ y: y(e.props._gridBaseY, y(e.props.y, 0)) - a });
2837
+ for (let e of t.textControls.values()) U(e.node, n) && (e.layout = {
2838
+ ...e.layout,
2839
+ transform: V(e.node)
2840
+ });
2841
+ return q(e, t), n.props.onScroll?.(a), !0;
2842
+ }
2843
+ function Ur(e, t, n, r) {
2844
+ let i = String(n.props._stateKey ?? "");
2845
+ n.props.activeKey === void 0 && (t.tabSelections.set(i, r), n.setProps({
2846
+ _activeKey: r,
2847
+ _tabItems: n.children.map((e) => ({
2848
+ title: e.props.title,
2849
+ disabled: e.props.disabled,
2850
+ selected: e.props.id === r
2851
+ }))
2852
+ }), n.children.forEach((e) => {
2853
+ e.type === "tabItem" && W(e, e.props.id === r);
2854
+ }), q(e, t)), n.props.onChange?.(r);
2855
+ }
2856
+ function Wr(e, t, n, r) {
2857
+ let i = String(n.props._stateKey ?? ""), a = new Set(Array.isArray(n.props._activeKeys) ? n.props._activeKeys.filter((e) => typeof e == "string") : vr(t, i, n.props)), o = String(r.props.id), s = Bt([...a], o, !!n.props.accordion);
2858
+ a.clear(), s.forEach((e) => a.add(e)), n.props.activeKeys === void 0 && (t.collapseSelections.set(i, a), n.setProps({ _activeKeys: [...a] }), yr(n, a), q(e, t)), n.props.onChange?.([...a]);
2859
+ }
2860
+ function Gr(e, t, n) {
2861
+ let r = y(e.props.width, 420), i = y(e.props.height, 240), a = y(e.props._dialogPanelX, 0), o = y(e.props._dialogPanelY, 0), s = t, c = n, l = s >= a && s <= a + r && c >= o && c <= o + i;
2862
+ if (!l && e.props.closeOnBackdrop !== !1) {
2863
+ e.props.onCancel?.();
2864
+ return;
2865
+ }
2866
+ let u = o + i - 44;
2867
+ !l || c < u || c > u + 32 || (s >= a + r - 104 && s <= a + r - 24 ? e.props.onConfirm?.() : s >= a + r - 196 && s <= a + r - 116 && e.props.onCancel?.());
2868
+ }
2869
+ function Kr(e, t) {
2870
+ e.traverse((e) => {
2871
+ e !== t && e.type === "dropdown" && e.props.open && e.setProps({ open: !1 });
2872
+ });
2873
+ }
2874
+ function qr(e, t) {
2875
+ let { width: n } = G(e), r = Be(e.props, n, t);
2876
+ r !== void 0 && e.props.value !== r && (e.setProps({ value: r }), e.props.onChange?.(r));
2877
+ }
2878
+ function Jr(e, t) {
2879
+ let { width: n, height: r } = G(t), i = e.videoElements.get(t)?.video, a = typeof t.props._videoScrubRatio == "number" ? t.props._videoScrubRatio : null;
2880
+ return rn(n, r, O(`${F(a === null ? i?.currentTime ?? 0 : (i?.duration ?? 0) * a)} / ${F(i?.duration ?? 0)}`, en));
2881
+ }
2882
+ function Yr(e, t) {
2883
+ let n = e.videoElements.get(t);
2884
+ n && (sn(n.video, t.props.onPausedChange), t.setProps({ paused: n.video.paused }));
2885
+ }
2886
+ function Xr(e, t, n, r) {
2887
+ let i = on(Jr(t, n), r);
2888
+ n.setProps({ _videoScrubRatio: i }), e.scene.markDirty();
2889
+ }
2890
+ function Zr(e, t, n) {
2891
+ let r = n.props._videoScrubRatio;
2892
+ if (typeof r != "number") return;
2893
+ n.setProps({
2894
+ _videoScrubRatio: void 0,
2895
+ currentTime: void 0
2896
+ });
2897
+ let i = t.videoElements.get(n);
2898
+ i && (cn(i.video, r, n.props.onSeek, () => {
2899
+ i.captureFrame(), n.props._videoFrame = i.frame;
2900
+ }), e.scene.markDirty());
2901
+ }
2902
+ // tools/angular-build/.stage/react/engine/accessibility.ts
2903
+ var Qr = /* @__PURE__ */ new WeakMap(), $r = 0;
2904
+ function ei(e) {
2905
+ let t = Qr.get(e);
2906
+ return t || (t = `canvas-control-${++$r}`, Qr.set(e, t)), t;
2907
+ }
2908
+ function Z(e, t) {
2909
+ return typeof e.props.ariaLabel == "string" && e.props.ariaLabel.trim() ? e.props.ariaLabel : t;
2910
+ }
2911
+ function Q(e) {
2912
+ return typeof e.props._formError == "string" && e.props._formError ? e.props._formError : void 0;
2913
+ }
2914
+ function $(e, t) {
2915
+ return K(e, {
2916
+ ...G(e),
2917
+ transform: V(e),
2918
+ visible: !0
2919
+ }, t);
2920
+ }
2921
+ function ti(e, t) {
2922
+ let n = e.scene, r = kn(n), i = [], a = [], o = (e) => {
2923
+ e.layout.visible && (i.push(e), a.push(e.id));
2924
+ }, s = (e) => () => {
2925
+ e(), t();
2926
+ };
2927
+ if (n.traverse((n) => {
2928
+ if (!H(n)) return;
2929
+ let i = ei(n);
2930
+ if (n.type === "input" || n.type === "textarea" || n.type === "datePicker") {
2931
+ let e = n.props._canvasInputId;
2932
+ typeof e == "string" && $(n, r).visible && a.push(e);
2933
+ return;
2934
+ }
2935
+ let c = n.props.disabled === !0, l = typeof n.props._formBlur == "function" ? () => {
2936
+ let e = n.props._formBlur;
2937
+ typeof e == "function" && e();
2938
+ } : void 0;
2939
+ if (n.type === "button") o({
2940
+ id: i,
2941
+ kind: "button",
2942
+ label: Z(n, String(n.props.text || "Button")),
2943
+ layout: $(n, r),
2944
+ disabled: c,
2945
+ activate: s(() => xt(n))
2946
+ });
2947
+ else if (n.type === "upload") {
2948
+ let t = y(n.props.width, 120), a = y(n.props.height, 40), u = V(n);
2949
+ o({
2950
+ id: i,
2951
+ kind: "button",
2952
+ label: Z(n, String(n.props.text || "Choose File")),
2953
+ layout: K(n, {
2954
+ width: t,
2955
+ height: a,
2956
+ transform: u,
2957
+ visible: !0
2958
+ }, r),
2959
+ disabled: c,
2960
+ error: Q(n) ?? (typeof n.props._uploadError == "string" ? n.props._uploadError : void 0),
2961
+ blur: l,
2962
+ activate: s(() => Tr(n, e))
2963
+ }), (Array.isArray(n.props.value) ? n.props.value : []).forEach((l, d) => o({
2964
+ id: `${i}:remove:${d}`,
2965
+ kind: "button",
2966
+ label: `Remove ${l.name}`,
2967
+ layout: K(n, {
2968
+ width: 24,
2969
+ height: 28,
2970
+ transform: z(u, {
2971
+ x: t - 24,
2972
+ y: a + d * 28
2973
+ }),
2974
+ visible: !0
2975
+ }, r),
2976
+ disabled: c,
2977
+ activate: s(() => Er(n, e, d))
2978
+ }));
2979
+ } else if (n.type === "switch") o({
2980
+ id: i,
2981
+ kind: "switch",
2982
+ label: Z(n, "Switch"),
2983
+ layout: $(n, r),
2984
+ disabled: c,
2985
+ checked: !!n.props.checked,
2986
+ error: Q(n),
2987
+ blur: l,
2988
+ activate: s(() => {
2989
+ n.props.disabled || Ue(n);
2990
+ })
2991
+ });
2992
+ else if (n.type === "radio" || n.type === "checkbox") {
2993
+ let e = M(n.props.options), t = n.props.direction !== "vertical", a = y(n.props.gap, 12), u = y(n.props.fontSize, 14), d = y(n.props.optionHeight, 28), f = G(n), p = 0, m = /* @__PURE__ */ new Map();
2994
+ e.forEach((e) => {
2995
+ let h = m.get(e.value) ?? 0;
2996
+ m.set(e.value, h + 1);
2997
+ let g = t ? N(e.label, u) : f.width, _ = K(n, {
2998
+ width: g,
2999
+ height: t ? f.height : d,
3000
+ transform: z(V(n), t ? { x: p } : { y: p }),
3001
+ visible: !0
3002
+ }, r), v = n.props.value;
3003
+ o({
3004
+ id: `${i}:${JSON.stringify(e.value)}:${h}`,
3005
+ kind: n.type === "radio" ? "radio" : "checkbox",
3006
+ label: Z(n, "") ? `${Z(n, "")}: ${e.label}` : e.label,
3007
+ layout: _,
3008
+ disabled: c || e.disabled === !0,
3009
+ checked: Array.isArray(v) ? v.includes(e.value) : v === e.value,
3010
+ group: i,
3011
+ error: Q(n),
3012
+ blur: l,
3013
+ activate: s(() => {
3014
+ if (n.props.disabled || e.disabled) return;
3015
+ let t = n.type === "radio" ? Ze(n.props.value, e) : Qe(n.props.value, e);
3016
+ if (t === void 0) return;
3017
+ n.props._controlledValue !== !0 && n.setProps({ value: t });
3018
+ let r = n.props.onChange;
3019
+ typeof r == "function" && r(t);
3020
+ })
3021
+ }), p += (t ? g : d) + a;
3022
+ });
3023
+ } else if (n.type === "slider") {
3024
+ let e = y(n.props.min, 0), a = y(n.props.max, 100);
3025
+ o({
3026
+ id: i,
3027
+ kind: "slider",
3028
+ label: Z(n, "Slider"),
3029
+ layout: $(n, r),
3030
+ disabled: c || a <= e,
3031
+ min: e,
3032
+ max: a,
3033
+ step: Math.max(2 ** -52, y(n.props.step, 1)),
3034
+ value: y(n.props.value, e),
3035
+ error: Q(n),
3036
+ blur: l,
3037
+ change: (e) => {
3038
+ let r = Number(e);
3039
+ if (!Number.isFinite(r) || n.props.disabled || n.props.value === r) return;
3040
+ n.setProps({ value: r });
3041
+ let i = n.props.onChange;
3042
+ typeof i == "function" && i(r), t();
3043
+ }
3044
+ });
3045
+ } else n.type === "dropdown" && o({
3046
+ id: i,
3047
+ kind: "select",
3048
+ label: Z(n, String(n.props.placeholder || "Select")),
3049
+ layout: $(n, r),
3050
+ disabled: c,
3051
+ value: String(n.props.value ?? ""),
3052
+ options: A(n.props.options),
3053
+ error: Q(n),
3054
+ blur: l,
3055
+ change: (e) => {
3056
+ if (n.props.disabled) return;
3057
+ let r = A(n.props.options).find((t) => t.value === e);
3058
+ r && !r.disabled && (Le(n, r), t());
3059
+ }
3060
+ });
3061
+ }), r) {
3062
+ let e = y(r.props.width, 420), t = y(r.props.height, 240), n = y(r.props._dialogPanelX, 0), i = y(r.props._dialogPanelY, 0), a = V(r);
3063
+ for (let [c, l, u] of [[
3064
+ "cancel",
3065
+ 196,
3066
+ "Cancel"
3067
+ ], [
3068
+ "confirm",
3069
+ 104,
3070
+ "OK"
3071
+ ]]) o({
3072
+ id: `${ei(r)}-${c}`,
3073
+ kind: "button",
3074
+ label: String(r.props[c === "cancel" ? "cancelText" : "confirmText"] ?? u),
3075
+ layout: {
3076
+ width: 80,
3077
+ height: 32,
3078
+ visible: !0,
3079
+ transform: z(a, {
3080
+ x: n + e - l,
3081
+ y: i + t - 44
3082
+ })
3083
+ },
3084
+ disabled: r.props.disabled === !0,
3085
+ activate: s(() => {
3086
+ let e = r.props[c === "cancel" ? "onCancel" : "onConfirm"];
3087
+ typeof e == "function" && e();
3088
+ })
3089
+ });
3090
+ }
3091
+ return {
3092
+ controls: i,
3093
+ order: a,
3094
+ dialog: r ? {
3095
+ id: ei(r),
3096
+ label: Z(r, String(r.props.title ?? "Dialog")),
3097
+ cancel: () => {
3098
+ let e = r.props.onCancel;
3099
+ typeof e == "function" && e(), t();
3100
+ }
3101
+ } : void 0
3102
+ };
3103
+ }
3104
+ // tools/angular-build/.stage/react/engine/state.ts
3105
+ var ni = class {
3106
+ textControls = /* @__PURE__ */ new Map();
3107
+ inputValues = /* @__PURE__ */ new Map();
3108
+ imageSubscriptions = /* @__PURE__ */ new Map();
3109
+ videoElements = /* @__PURE__ */ new Map();
3110
+ videoFrames = /* @__PURE__ */ new Map();
3111
+ videoNodes = [];
3112
+ tabSelections = /* @__PURE__ */ new Map();
3113
+ carouselSelections = /* @__PURE__ */ new Map();
3114
+ carouselFrameTimes = /* @__PURE__ */ new Map();
3115
+ carouselTransitions = /* @__PURE__ */ new Map();
3116
+ collapseSelections = /* @__PURE__ */ new Map();
3117
+ gridScrollPositions = /* @__PURE__ */ new Map();
3118
+ virtualGridLayouts = /* @__PURE__ */ new Map();
3119
+ activeVirtualGridKeys = /* @__PURE__ */ new Set();
3120
+ forms = /* @__PURE__ */ new Map();
3121
+ activeFormKeys = /* @__PURE__ */ new Set();
3122
+ pointerSequences = /* @__PURE__ */ new Map();
3123
+ activeSlider = null;
3124
+ activeButton = null;
3125
+ activeGridScroll = null;
3126
+ activeVideo = null;
3127
+ hoveredVideo = null;
3128
+ currentFrameTime = 0;
3129
+ }, ri = class {
3130
+ scene = new bn("root");
3131
+ renderer = new Tn();
3132
+ state = new ni();
3133
+ context;
3134
+ core;
3135
+ animationFrame = null;
3136
+ themeObserver = null;
3137
+ running = !1;
3138
+ tree = [];
3139
+ constructor(e, t, n, r = 1, i) {
3140
+ this.context = e, this.core = {
3141
+ scene: this.scene,
3142
+ renderer: this.renderer,
3143
+ context: e,
3144
+ inputBridge: t,
3145
+ pixelRatio: r,
3146
+ onFrame: n,
3147
+ onEvent: i,
3148
+ refreshVirtualGrids: () => this.reconcile()
3149
+ };
3150
+ }
3151
+ update(e) {
3152
+ this.tree = e;
3153
+ for (let [e, t] of this.state.virtualGridLayouts) t.token === void 0 && this.state.virtualGridLayouts.delete(e);
3154
+ this.reconcile();
3155
+ }
3156
+ reconcile() {
3157
+ let e = [];
3158
+ this.state.activeVirtualGridKeys.clear(), this.state.activeFormKeys.clear();
3159
+ let t = xr(this.core, this.state, this.tree, R, !0, "root", e);
3160
+ for (let e of this.state.virtualGridLayouts.keys()) this.state.activeVirtualGridKeys.has(e) || this.state.virtualGridLayouts.delete(e);
3161
+ for (let e of this.state.forms.keys()) if (!this.state.activeFormKeys.has(e)) {
3162
+ let t = this.state.forms.get(e);
3163
+ t && nr(t), this.state.forms.delete(e);
3164
+ }
3165
+ for (let e of this.state.forms.values()) e.attachedController !== e.controller && nr(e);
3166
+ this.state.forms.forEach(rr), this.scene.syncChildren(t, (e) => Ln(this.state, e));
3167
+ let n = kn(this.scene);
3168
+ this.core.inputBridge.prepareAccessibility?.(n ? ei(n) : void 0), In(this.core, this.state, e), Rn(this.core, this.state, t), Bn(this.core, this.state), this.syncAccessibility();
3169
+ }
3170
+ render() {
3171
+ this.renderer.render(this.context, this.scene);
3172
+ }
3173
+ syncAccessibility() {
3174
+ this.core.inputBridge.syncAccessibility?.(ti(this.core, () => this.syncAccessibility()));
3175
+ }
3176
+ requestRender() {
3177
+ this.renderer.invalidateGridCache(), this.scene.markDirty();
3178
+ }
3179
+ renderTo(e, t, n) {
3180
+ e.save(), e.scale(t, n), this.renderer.render(e, this.scene, !1), e.restore();
3181
+ }
3182
+ start() {
3183
+ if (this.running) return;
3184
+ this.running = !0;
3185
+ let e = this.context.canvas.ownerDocument.defaultView?.MutationObserver;
3186
+ if (e) {
3187
+ this.themeObserver = new e(() => {
3188
+ ge(), this.renderer.invalidateGridCache(), this.scene.markDirty();
3189
+ });
3190
+ let t = this.context.canvas;
3191
+ for (; t;) this.themeObserver.observe(t, {
3192
+ attributes: !0,
3193
+ attributeFilter: ["class", "style"]
3194
+ }), t = t.parentElement;
3195
+ }
3196
+ let t = (e) => {
3197
+ this.running && (tr(this.core, this.state, e) && this.syncAccessibility(), Vn(this.core, this.state), this.scene.dirty && this.render(), this.core.onFrame?.(e), this.running && (this.animationFrame = requestAnimationFrame(t)));
3198
+ };
3199
+ this.animationFrame = requestAnimationFrame(t);
3200
+ }
3201
+ pointerDown(e) {
3202
+ Fr(this.core, this.state, e), this.syncAccessibility();
3203
+ }
3204
+ pointerMove(e) {
3205
+ Ir(this.core, this.state, e), (this.state.activeSlider || this.state.activeGridScroll) && this.syncAccessibility();
3206
+ }
3207
+ pointerLeave(e) {
3208
+ Br(this.state, e);
3209
+ }
3210
+ pointerUp(e, t = !1) {
3211
+ Lr(this.core, this.state, e, t), this.syncAccessibility();
3212
+ }
3213
+ wheel(e) {
3214
+ Vr(this.core, this.state, e), this.syncAccessibility();
3215
+ }
3216
+ destroy() {
3217
+ this.running = !1, this.animationFrame !== null && cancelAnimationFrame(this.animationFrame), this.animationFrame = null, this.themeObserver?.disconnect(), this.themeObserver = null;
3218
+ for (let e of this.state.textControls.values()) e.dispose();
3219
+ this.state.textControls.clear(), this.state.inputValues.clear(), this.state.imageSubscriptions.forEach((e) => e()), this.state.imageSubscriptions.clear(), this.state.videoElements.forEach((e) => e.dispose()), this.state.videoElements.clear(), this.state.videoFrames.clear(), this.state.videoNodes.length = 0, this.state.tabSelections.clear(), this.state.carouselSelections.clear(), this.state.carouselFrameTimes.clear(), this.state.carouselTransitions.clear(), this.state.collapseSelections.clear(), this.state.gridScrollPositions.clear(), this.state.virtualGridLayouts.clear(), this.state.activeVirtualGridKeys.clear(), this.state.forms.forEach(nr), this.state.forms.clear(), this.tree = [], this.state.pointerSequences.clear(), this.state.activeSlider = null, this.state.activeButton = null, this.state.activeGridScroll = null, this.state.activeVideo = null, this.state.hoveredVideo = null, this.core.inputBridge.destroy();
3220
+ }
3221
+ }, ii = 0;
3222
+ function ai(e, t) {
3223
+ let n = "padding" in e && typeof e.padding == "number" ? e.padding : 8, r = typeof e.fontSize == "number" ? e.fontSize : 14;
3224
+ return {
3225
+ fontFamily: ("fontFamily" in e && typeof e.fontFamily == "string" ? e.fontFamily : "") || "sans-serif",
3226
+ fontSize: `${r}px`,
3227
+ letterSpacing: "0px",
3228
+ fontKerning: "auto",
3229
+ textRendering: "auto",
3230
+ paddingLeft: `${n}px`,
3231
+ paddingRight: `${n}px`,
3232
+ ...t ? {
3233
+ paddingTop: `${n}px`,
3234
+ paddingBottom: `${n}px`,
3235
+ lineHeight: "1.35",
3236
+ overflowY: "auto",
3237
+ overflowX: "hidden"
3238
+ } : {}
3239
+ };
3240
+ }
3241
+ var oi = class {
3242
+ mounted = /* @__PURE__ */ new Map();
3243
+ accessible = /* @__PURE__ */ new Map();
3244
+ errors = /* @__PURE__ */ new Map();
3245
+ fileInputs = /* @__PURE__ */ new Set();
3246
+ originalDisplay;
3247
+ overlayHidden = !1;
3248
+ selectionTracked = 0;
3249
+ overlay;
3250
+ dialogElement = null;
3251
+ dialogId;
3252
+ returnFocus = null;
3253
+ returnFocusId;
3254
+ dialogCancel;
3255
+ constructor(e) {
3256
+ this.overlay = e, this.originalDisplay = e.style.display;
3257
+ }
3258
+ mount(e, t, n, r) {
3259
+ this.unmount(e);
3260
+ let i = document.createElement(e.startsWith("textarea:") ? "textarea" : "input");
3261
+ return i instanceof HTMLInputElement && (i.autocomplete = "off"), Object.assign(i.style, {
3262
+ position: "absolute",
3263
+ left: "0",
3264
+ top: "0",
3265
+ margin: "0",
3266
+ padding: "0",
3267
+ border: "0",
3268
+ outline: "0",
3269
+ opacity: "0",
3270
+ color: "transparent",
3271
+ caretColor: "transparent",
3272
+ background: "transparent",
3273
+ boxSizing: "border-box",
3274
+ transformOrigin: "0 0",
3275
+ pointerEvents: "auto"
3276
+ }), i.addEventListener("input", this.handleInput), i.addEventListener("select", this.handleSelection), i.addEventListener("focus", this.handleFocus), i.addEventListener("blur", this.handleBlur), i instanceof HTMLTextAreaElement && i.addEventListener("scroll", this.handleTextareaScroll), this.trackSelections(), this.mounted.set(e, {
3277
+ element: i,
3278
+ events: r
3279
+ }), this.overlay.appendChild(i), this.update(e, t, n), () => this.unmount(e);
3280
+ }
3281
+ update(e, t, n) {
3282
+ let r = this.mounted.get(e);
3283
+ if (!r) return;
3284
+ let { element: i } = r, a = t.value ?? t.defaultValue ?? "";
3285
+ i instanceof HTMLInputElement && (i.type = e.startsWith("datePicker:") ? "date" : "type" in t ? t.type ?? "text" : "text"), i.placeholder = t.placeholder ?? "", i.setAttribute("aria-label", t.ariaLabel || t.placeholder || "Canvas input");
3286
+ let o = "_formError" in t && typeof t._formError == "string" ? t._formError : void 0;
3287
+ this.setError(e, i, o);
3288
+ let s = this.errors.get(e);
3289
+ s && (s.hidden = !n.visible), i.disabled = t.disabled ?? !1;
3290
+ let c = "maxLength" in t ? t.maxLength : void 0;
3291
+ typeof c == "number" && Number.isInteger(c) && c >= 0 ? i.maxLength = c : i.removeAttribute("maxLength"), i.value !== a && (i.value = a);
3292
+ let l = i instanceof HTMLTextAreaElement;
3293
+ !n.visible && i === this.overlay.ownerDocument.activeElement && i.blur(), Object.assign(i.style, {
3294
+ display: n.visible ? "block" : "none",
3295
+ width: `${n.width}px`,
3296
+ height: `${n.height}px`,
3297
+ transform: `matrix(${n.transform.join(",")})`,
3298
+ clipPath: n.clipPath ?? "",
3299
+ resize: "none",
3300
+ whiteSpace: l ? "pre-wrap" : "normal",
3301
+ ...ai(t, l)
3302
+ }), l && (i.wrap = "soft", r.events.scroll(i.scrollTop, i.scrollHeight, i.clientHeight, i.clientWidth));
3303
+ }
3304
+ pickFiles(e, t, n) {
3305
+ let r = document.createElement("input");
3306
+ r.type = "file", r.accept = e ?? "", r.multiple = t, Object.assign(r.style, {
3307
+ position: "fixed",
3308
+ width: "1px",
3309
+ height: "1px",
3310
+ opacity: "0",
3311
+ pointerEvents: "none"
3312
+ });
3313
+ let i = () => {
3314
+ r.removeEventListener("change", a), r.removeEventListener("cancel", i), r.remove(), this.fileInputs.delete(r);
3315
+ }, a = () => {
3316
+ let e = Array.from(r.files ?? []);
3317
+ i(), e.length && n(e);
3318
+ };
3319
+ r.addEventListener("change", a, { once: !0 }), r.addEventListener("cancel", i, { once: !0 }), this.fileInputs.add(r), this.overlay.ownerDocument.body.appendChild(r), r.click();
3320
+ }
3321
+ focus(e) {
3322
+ this.mounted.get(e)?.element.focus();
3323
+ }
3324
+ setOverlayVisible(e) {
3325
+ if (e) {
3326
+ if (!this.overlayHidden) return;
3327
+ this.overlay.style.display = this.originalDisplay, this.overlayHidden = !1;
3328
+ return;
3329
+ }
3330
+ if (this.overlayHidden) return;
3331
+ let t = this.overlay.ownerDocument.activeElement;
3332
+ t instanceof HTMLElement && this.overlay.contains(t) && t.blur(), this.overlay.style.display = "none", this.overlayHidden = !0;
3333
+ }
3334
+ prepareAccessibility(e) {
3335
+ if (!this.dialogId && e) {
3336
+ let e = this.overlay.ownerDocument.activeElement;
3337
+ this.returnFocus = e instanceof HTMLElement ? e : null, this.returnFocusId = [...this.accessible.entries()].find(([, t]) => t.element === e)?.[0];
3338
+ }
3339
+ }
3340
+ syncAccessibility(e) {
3341
+ let t = this.dialogId, n = e.dialog?.id;
3342
+ if (n && !this.dialogElement) {
3343
+ let e = this.overlay.ownerDocument.createElement("div");
3344
+ e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), e.tabIndex = -1, Object.assign(e.style, {
3345
+ position: "absolute",
3346
+ inset: "0",
3347
+ pointerEvents: "none"
3348
+ }), e.addEventListener("keydown", this.handleDialogKey), this.overlay.appendChild(e), this.dialogElement = e;
3349
+ }
3350
+ this.dialogElement && e.dialog && (this.dialogElement.setAttribute("aria-label", e.dialog.label), this.dialogCancel = e.dialog.cancel);
3351
+ let r = new Set(e.controls.map((e) => e.id)), i = this.overlay.ownerDocument.activeElement, a = [...this.accessible].find(([e, t]) => e.includes(":remove:") && !r.has(e) && t.element === i)?.[0].split(":remove:")[0];
3352
+ for (let [e, t] of this.accessible) r.has(e) || (t.element.remove(), t.ring.remove(), this.removeError(e), this.accessible.delete(e));
3353
+ for (let t of e.controls) this.updateAccessible(t);
3354
+ let o = n ? this.dialogElement : this.overlay;
3355
+ if (!o) return;
3356
+ if (!n && this.dialogElement) {
3357
+ for (let e of this.mounted.values()) this.dialogElement.contains(e.element) && this.overlay.appendChild(e.element);
3358
+ for (let e of this.accessible.values()) this.dialogElement.contains(e.element) && this.overlay.appendChild(e.element);
3359
+ }
3360
+ let s = e.order.flatMap((e) => {
3361
+ let t = this.mounted.get(e)?.element ?? this.accessible.get(e)?.element;
3362
+ return t ? [t] : [];
3363
+ }), c = new Set(s), l = null;
3364
+ for (let e of [...s].reverse()) {
3365
+ let t = e.nextElementSibling;
3366
+ for (; t && !c.has(t);) t = t.nextElementSibling;
3367
+ (e.parentElement !== o || t !== l) && o.insertBefore(e, l), l = e;
3368
+ }
3369
+ let u = new Set(e.order);
3370
+ for (let [e, t] of this.errors) {
3371
+ let r = n && u.has(e) ? o : this.overlay;
3372
+ t.parentElement !== r && r.appendChild(t);
3373
+ }
3374
+ if (!n && this.dialogElement && (this.dialogElement.removeEventListener("keydown", this.handleDialogKey), this.dialogElement.remove(), this.dialogElement = null, this.dialogCancel = void 0), this.dialogId = n, n && n !== t) (this.dialogFocusable()[0] ?? this.dialogElement)?.focus();
3375
+ else if (t && !n) {
3376
+ let e = this.returnFocusId ? this.accessible.get(this.returnFocusId)?.element : this.returnFocus;
3377
+ e?.isConnected && e.focus(), this.returnFocus = null, this.returnFocusId = void 0;
3378
+ } else a && this.accessible.get(a)?.element.focus();
3379
+ }
3380
+ updateAccessible(e) {
3381
+ let t = this.accessible.get(e.id);
3382
+ if (t && t.control.kind !== e.kind && (t.element.remove(), t.ring.remove(), this.removeError(e.id), this.accessible.delete(e.id), t = void 0), !t) {
3383
+ let n = this.overlay.ownerDocument, r = e.kind === "button" || e.kind === "switch" ? n.createElement("button") : e.kind === "select" ? n.createElement("select") : n.createElement("input");
3384
+ r instanceof HTMLButtonElement && (r.type = "button"), r instanceof HTMLInputElement && (r.type = e.kind === "slider" ? "range" : e.kind === "radio" ? "radio" : "checkbox");
3385
+ let i = n.createElement("div");
3386
+ i.setAttribute("aria-hidden", "true"), Object.assign(i.style, {
3387
+ position: "absolute",
3388
+ left: "0",
3389
+ top: "0",
3390
+ pointerEvents: "none",
3391
+ outline: "2px solid #1677ff",
3392
+ outlineOffset: "2px",
3393
+ display: "none",
3394
+ transformOrigin: "0 0",
3395
+ boxSizing: "border-box"
3396
+ }), Object.assign(r.style, {
3397
+ position: "absolute",
3398
+ left: "0",
3399
+ top: "0",
3400
+ margin: "0",
3401
+ opacity: "0",
3402
+ pointerEvents: "none",
3403
+ transformOrigin: "0 0",
3404
+ boxSizing: "border-box"
3405
+ });
3406
+ let a = {
3407
+ element: r,
3408
+ ring: i,
3409
+ control: e
3410
+ };
3411
+ r.addEventListener("focus", () => {
3412
+ a.ring.style.display = "block";
3413
+ }), r.addEventListener("blur", () => {
3414
+ a.ring.style.display = "none", a.control.blur?.();
3415
+ }), r.addEventListener("click", () => {
3416
+ (a.control.kind === "button" || a.control.kind === "switch") && a.control.activate?.();
3417
+ }), r.addEventListener("change", () => {
3418
+ a.control.kind === "checkbox" || a.control.kind === "radio" ? a.control.activate?.() : a.control.kind === "select" && a.control.change?.(a.element.value);
3419
+ }), r.addEventListener("input", () => {
3420
+ a.control.kind === "slider" && a.control.change?.(a.element.value);
3421
+ }), this.overlay.appendChild(i), this.overlay.appendChild(r), this.accessible.set(e.id, a), t = a;
3422
+ }
3423
+ t.control = e;
3424
+ let { element: n, ring: r } = t;
3425
+ if (n.setAttribute("aria-label", e.label), n.disabled = e.disabled, e.kind === "switch" && (n.setAttribute("role", "switch"), n.setAttribute("aria-checked", String(!!e.checked))), n instanceof HTMLInputElement && (e.kind === "radio" && (n.name = e.group ?? e.id), (e.kind === "radio" || e.kind === "checkbox") && (n.checked = !!e.checked), e.kind === "slider" && (n.min = String(e.min), n.max = String(e.max), n.step = String(e.step), n.value = String(e.value))), n instanceof HTMLSelectElement) {
3426
+ let t = e.options ?? [], r = JSON.stringify([t, e.label]), i = "__canvas_ui_placeholder__";
3427
+ for (; t.some((e) => e.value === i);) i += "_";
3428
+ if (n.dataset.options !== r) {
3429
+ n.replaceChildren();
3430
+ let a = this.overlay.ownerDocument.createElement("option");
3431
+ a.value = i, a.textContent = e.label, a.disabled = !0, n.appendChild(a);
3432
+ for (let e of t) {
3433
+ let t = this.overlay.ownerDocument.createElement("option");
3434
+ t.value = e.value, t.textContent = e.label, t.disabled = e.disabled === !0, n.appendChild(t);
3435
+ }
3436
+ n.dataset.options = r;
3437
+ }
3438
+ let a = String(e.value ?? "");
3439
+ n.value = t.some((e) => e.value === a) ? a : i;
3440
+ }
3441
+ this.setError(e.id, n, e.error);
3442
+ let { width: i, height: a, transform: o, clipPath: s } = e.layout, c = {
3443
+ width: `${i}px`,
3444
+ height: `${a}px`,
3445
+ transform: `matrix(${o.join(",")})`,
3446
+ clipPath: s ?? ""
3447
+ };
3448
+ Object.assign(n.style, c), Object.assign(r.style, c);
3449
+ }
3450
+ setError(e, t, n) {
3451
+ if (!n) {
3452
+ this.removeError(e), t.removeAttribute("aria-invalid"), t.removeAttribute("aria-describedby");
3453
+ return;
3454
+ }
3455
+ let r = this.errors.get(e);
3456
+ r || (r = this.overlay.ownerDocument.createElement("span"), r.id = `canvas-ui-error-${++ii}`, r.setAttribute("aria-live", "polite"), Object.assign(r.style, {
3457
+ position: "absolute",
3458
+ width: "1px",
3459
+ height: "1px",
3460
+ overflow: "hidden",
3461
+ clipPath: "inset(50%)"
3462
+ }), this.overlay.appendChild(r), this.errors.set(e, r)), r.textContent !== n && (r.textContent = n), t.setAttribute("aria-invalid", "true"), t.setAttribute("aria-describedby", r.id);
3463
+ }
3464
+ removeError(e) {
3465
+ this.errors.get(e)?.remove(), this.errors.delete(e);
3466
+ }
3467
+ dialogFocusable() {
3468
+ if (!this.dialogElement) return [];
3469
+ let e = Array.from(this.dialogElement.querySelectorAll("input, textarea, select, button")).filter((e) => !("disabled" in e && e.disabled) && e.style.display !== "none");
3470
+ return e.filter((t) => {
3471
+ if (!(t instanceof HTMLInputElement) || t.type !== "radio") return !0;
3472
+ let n = e.filter((e) => e instanceof HTMLInputElement && e.type === "radio" && e.name === t.name);
3473
+ return t === (n.find((e) => e.checked) ?? n[0]);
3474
+ });
3475
+ }
3476
+ handleDialogKey = (e) => {
3477
+ if (e.key === "Escape" && !e.defaultPrevented) e.preventDefault(), this.dialogCancel?.();
3478
+ else if (e.key === "Tab") {
3479
+ let t = this.dialogFocusable();
3480
+ if (!t.length) {
3481
+ e.preventDefault(), this.dialogElement?.focus();
3482
+ return;
3483
+ }
3484
+ let n = t.indexOf(this.overlay.ownerDocument.activeElement), r = e.shiftKey ? n <= 0 ? t.length - 1 : n - 1 : n < 0 || n === t.length - 1 ? 0 : n + 1;
3485
+ e.preventDefault(), t[r].focus();
3486
+ }
3487
+ };
3488
+ unmount(e) {
3489
+ let t = this.mounted.get(e);
3490
+ if (!t) return;
3491
+ let { element: n } = t;
3492
+ n.removeEventListener("input", this.handleInput), n.removeEventListener("select", this.handleSelection), n.removeEventListener("focus", this.handleFocus), n.removeEventListener("blur", this.handleBlur), n instanceof HTMLTextAreaElement && n.removeEventListener("scroll", this.handleTextareaScroll), this.untrackSelections(), n.remove(), this.removeError(e), this.mounted.delete(e);
3493
+ }
3494
+ destroy() {
3495
+ this.setOverlayVisible(!0);
3496
+ for (let e of this.mounted.keys()) this.unmount(e);
3497
+ for (let e of this.accessible.values()) e.element.remove(), e.ring.remove();
3498
+ this.accessible.clear();
3499
+ for (let e of this.errors.keys()) this.removeError(e);
3500
+ this.dialogElement?.removeEventListener("keydown", this.handleDialogKey), this.dialogElement?.remove(), this.dialogElement = null, this.fileInputs.forEach((e) => e.remove()), this.fileInputs.clear();
3501
+ }
3502
+ find(e) {
3503
+ for (let t of this.mounted.values()) if (t.element === e) return t;
3504
+ }
3505
+ handleInput = (e) => {
3506
+ let t = this.find(e.currentTarget);
3507
+ t && t.events.input(t.element.value, t.element.selectionStart ?? t.element.value.length);
3508
+ };
3509
+ handleSelection = (e) => {
3510
+ let t = this.find(e.currentTarget);
3511
+ t && t.events.selection(t.element.selectionStart ?? t.element.value.length);
3512
+ };
3513
+ trackSelections() {
3514
+ this.selectionTracked++ === 0 && this.overlay.ownerDocument.addEventListener("selectionchange", this.handleSelectionChange);
3515
+ }
3516
+ untrackSelections() {
3517
+ --this.selectionTracked === 0 && this.overlay.ownerDocument.removeEventListener("selectionchange", this.handleSelectionChange);
3518
+ }
3519
+ handleSelectionChange = () => {
3520
+ let e = this.overlay.ownerDocument.activeElement;
3521
+ if (!(e instanceof HTMLInputElement) && !(e instanceof HTMLTextAreaElement)) return;
3522
+ let t = this.find(e);
3523
+ t && t.events.selection(t.element.selectionStart ?? t.element.value.length);
3524
+ };
3525
+ handleFocus = (e) => this.find(e.currentTarget)?.events.focus();
3526
+ handleBlur = (e) => this.find(e.currentTarget)?.events.blur();
3527
+ handleTextareaScroll = (e) => {
3528
+ let t = this.find(e.currentTarget);
3529
+ t?.element instanceof HTMLTextAreaElement && t.events.scroll(t.element.scrollTop, t.element.scrollHeight, t.element.clientHeight, t.element.clientWidth);
3530
+ };
3531
+ };
3532
+ // tools/angular-build/.stage/react/canvas-handle.ts
3533
+ function si() {
3534
+ return Math.max(1, window.devicePixelRatio || 1);
3535
+ }
3536
+ function ci(e = {}, t) {
3537
+ return typeof e == "string" ? {
3538
+ type: e,
3539
+ quality: t
3540
+ } : {
3541
+ ...e,
3542
+ type: e.type ?? "image/png"
3543
+ };
3544
+ }
3545
+ function li(e, t, n) {
3546
+ try {
3547
+ return e.toDataURL(t, n);
3548
+ } catch (e) {
3549
+ throw fi(e) ? pi() : e;
3550
+ }
3551
+ }
3552
+ function ui(e, t, n) {
3553
+ return new Promise((r, i) => {
3554
+ try {
3555
+ e.toBlob((e) => {
3556
+ e ? r(e) : i(/* @__PURE__ */ Error("Canvas image export failed."));
3557
+ }, t, n);
3558
+ } catch (e) {
3559
+ i(fi(e) ? pi() : e);
3560
+ }
3561
+ });
3562
+ }
3563
+ function di(e, t, n, r) {
3564
+ let i = n.pixelRatio ?? r;
3565
+ if (!Number.isFinite(i) || i <= 0) throw RangeError("Export pixelRatio must be a positive finite number.");
3566
+ let a = n.width ?? e.width / r, o = n.height ?? e.height / r;
3567
+ if (!Number.isFinite(a) || a <= 0 || !Number.isFinite(o) || o <= 0) throw RangeError("Export width and height must be positive finite numbers.");
3568
+ let s = document.createElement("canvas");
3569
+ s.width = Math.max(1, Math.round(a * i)), s.height = Math.max(1, Math.round(o * i));
3570
+ let c = s.getContext("2d");
3571
+ if (!c) throw Error("Canvas 2D context is not available for image export.");
3572
+ return t ? t.renderTo(c, s.width / a, s.height / o) : c.drawImage(e, 0, 0, s.width, s.height), s;
3573
+ }
3574
+ function fi(e) {
3575
+ return typeof e == "object" && !!e && "name" in e && e.name === "SecurityError";
3576
+ }
3577
+ function pi() {
3578
+ return /* @__PURE__ */ Error("Canvas 导出失败:画布包含未授权跨域读取的图片。请配置图片服务器 CORS(Access-Control-Allow-Origin),或移除该跨域图片后重试。");
3579
+ }
3580
+ // tools/angular-build/.stage/react/react/Canvas.tsx
3581
+ var mi = t(function({ width: e, height: t, style: c, className: l, ariaLabel: u = "Canvas", onFrame: d, onEvent: f, children: p }, m) {
3582
+ let h = a(null), g = a(null), _ = a(null), v = a(null), y = a(1), b = i(() => yn(p), [p]), x = a(d);
3583
+ x.current = d;
3584
+ let S = a(void 0);
3585
+ return S.current = f, r(m, () => ({
3586
+ getCanvas: () => h.current,
3587
+ requestRender: () => v.current?.requestRender(),
3588
+ toDataURL: (e = {}, t) => {
3589
+ let n = h.current;
3590
+ if (!n) throw Error("Canvas is not mounted.");
3591
+ let r = ci(e, t);
3592
+ return li(di(n, v.current, r, y.current), r.type, r.quality);
3593
+ },
3594
+ toBlob: (e = {}, t) => new Promise((n, r) => {
3595
+ let i = h.current;
3596
+ if (!i) {
3597
+ r(/* @__PURE__ */ Error("Canvas is not mounted."));
3598
+ return;
3599
+ }
3600
+ let a = ci(e, t);
3601
+ ui(di(i, v.current, a, y.current), a.type, a.quality).then(n, r);
3602
+ })
3603
+ }), []), n(() => {
3604
+ let n = h.current, r = g.current, i = _.current;
3605
+ if (!n || !r || !i) return;
3606
+ let a = si();
3607
+ y.current = a, n.width = Math.round(e * a), n.height = Math.round(t * a);
3608
+ let o = n.getContext("2d");
3609
+ if (!o) throw Error("Canvas 2D context is not available.");
3610
+ o.scale(a, a);
3611
+ let s = new ri(o, new oi(r), (e) => x.current?.(e), a, (e) => S.current?.(e));
3612
+ v.current = s, s.update(b), s.start();
3613
+ let c = (e) => {
3614
+ s.wheel({
3615
+ currentTarget: n,
3616
+ clientX: e.clientX,
3617
+ clientY: e.clientY,
3618
+ deltaY: e.deltaY,
3619
+ preventDefault: () => e.preventDefault()
3620
+ });
3621
+ };
3622
+ return i.addEventListener("wheel", c, { passive: !1 }), () => {
3623
+ i.removeEventListener("wheel", c), s.destroy(), v.current = null;
3624
+ };
3625
+ }, [e, t]), n(() => {
3626
+ v.current?.update(b);
3627
+ }, [b]), /* @__PURE__ */ s("div", {
3628
+ ref: _,
3629
+ className: l,
3630
+ style: {
3631
+ ...c,
3632
+ position: "relative",
3633
+ width: e,
3634
+ height: t
3635
+ },
3636
+ children: [/* @__PURE__ */ o("canvas", {
3637
+ ref: h,
3638
+ "aria-label": u,
3639
+ style: {
3640
+ display: "block",
3641
+ width: "100%",
3642
+ height: "100%"
3643
+ },
3644
+ onPointerDown: (e) => v.current?.pointerDown(e),
3645
+ onPointerMove: (e) => v.current?.pointerMove(e),
3646
+ onPointerLeave: (e) => v.current?.pointerLeave(e.pointerType),
3647
+ onPointerUp: (e) => v.current?.pointerUp(e),
3648
+ onPointerCancel: (e) => v.current?.pointerUp(e, !0)
3649
+ }), /* @__PURE__ */ o("div", {
3650
+ ref: g,
3651
+ style: {
3652
+ position: "absolute",
3653
+ inset: 0,
3654
+ overflow: "hidden",
3655
+ pointerEvents: "none"
3656
+ }
3657
+ })]
3658
+ });
3659
+ });
3660
+ export { vt as Button, mi as Canvas, Wt as CanvasView, dt as Carousel, ft as CarouselItem, tt as Checkbox, ye as Circle, Lt as Collapse, Rt as CollapseItem, Vt as CustomDraw, We as DatePicker, Ot as Dialog, je as Dropdown, h as Form, g as FormItem, _ as Grid, v as GridItem, u as Group, it as Icon, Et as Image, Ee as Input, jt as Progress, $e as Radio, _e as Rect, Re as Slider, Ve as Switch, Pt as TabItem, Nt as Tabs, Se as Text, ke as Textarea, lt as Upload, ln as Video, f as createFormController };