@tokenoftrust/storefront-runner 2.0.3 → 2.0.5

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 (178) hide show
  1. package/apps/storefront/.astro/content.d.ts +159 -0
  2. package/apps/storefront/.astro/integrations/_astrojs_cloudflare/cloudflare.d.ts +1 -0
  3. package/apps/storefront/.astro/types.d.ts +3 -0
  4. package/apps/storefront/migrations-apps/0011_dt_tracking_tenant_databases.sql +23 -0
  5. package/apps/storefront/node_modules/.bin/acorn +43 -0
  6. package/apps/storefront/node_modules/.bin/astro +43 -0
  7. package/apps/storefront/node_modules/.bin/astro-check +43 -0
  8. package/apps/storefront/node_modules/.bin/browserslist +43 -0
  9. package/apps/storefront/node_modules/.bin/cf-wrangler +43 -0
  10. package/apps/storefront/node_modules/.bin/depcruise +43 -0
  11. package/apps/storefront/node_modules/.bin/depcruise-baseline +43 -0
  12. package/apps/storefront/node_modules/.bin/depcruise-fmt +43 -0
  13. package/apps/storefront/node_modules/.bin/depcruise-wrap-stream-in-html +43 -0
  14. package/apps/storefront/node_modules/.bin/dependency-cruise +43 -0
  15. package/apps/storefront/node_modules/.bin/dependency-cruiser +43 -0
  16. package/apps/storefront/node_modules/.bin/drizzle-kit +43 -0
  17. package/apps/storefront/node_modules/.bin/esbuild +43 -0
  18. package/apps/storefront/node_modules/.bin/jiti +43 -0
  19. package/apps/storefront/node_modules/.bin/playwright +43 -0
  20. package/apps/storefront/node_modules/.bin/playwright-core +43 -0
  21. package/apps/storefront/node_modules/.bin/prettier +43 -0
  22. package/apps/storefront/node_modules/.bin/rollup +43 -0
  23. package/apps/storefront/node_modules/.bin/tsc +43 -0
  24. package/apps/storefront/node_modules/.bin/tsserver +43 -0
  25. package/apps/storefront/node_modules/.bin/tsx +43 -0
  26. package/apps/storefront/node_modules/.bin/vite +43 -0
  27. package/apps/storefront/node_modules/.bin/vitest +43 -0
  28. package/apps/storefront/node_modules/.bin/workerd +43 -0
  29. package/apps/storefront/node_modules/.bin/wrangler +43 -0
  30. package/apps/storefront/node_modules/.bin/wrangler2 +43 -0
  31. package/apps/storefront/node_modules/.bin/yaml +43 -0
  32. package/apps/storefront/node_modules/.vite/deps/@astrojs_preact_client__js.js +58 -0
  33. package/apps/storefront/node_modules/.vite/deps/@astrojs_preact_client__js.js.map +1 -0
  34. package/apps/storefront/node_modules/.vite/deps/@astrojs_preact_n_@preact_signals.js +741 -0
  35. package/apps/storefront/node_modules/.vite/deps/@astrojs_preact_n_@preact_signals.js.map +1 -0
  36. package/apps/storefront/node_modules/.vite/deps/@astrojs_preact_server__js.js +2549 -0
  37. package/apps/storefront/node_modules/.vite/deps/@astrojs_preact_server__js.js.map +1 -0
  38. package/apps/storefront/node_modules/.vite/deps/_metadata.json +150 -0
  39. package/apps/storefront/node_modules/.vite/deps/astro-BIHuWFxm.js +434 -0
  40. package/apps/storefront/node_modules/.vite/deps/astro-BIHuWFxm.js.map +1 -0
  41. package/apps/storefront/node_modules/.vite/deps/astro_n_aria-query.js +6390 -0
  42. package/apps/storefront/node_modules/.vite/deps/astro_n_aria-query.js.map +1 -0
  43. package/apps/storefront/node_modules/.vite/deps/astro_n_axobject-query.js +2705 -0
  44. package/apps/storefront/node_modules/.vite/deps/astro_n_axobject-query.js.map +1 -0
  45. package/apps/storefront/node_modules/.vite/deps/astro_n_html-escaper.js +65 -0
  46. package/apps/storefront/node_modules/.vite/deps/astro_n_html-escaper.js.map +1 -0
  47. package/apps/storefront/node_modules/.vite/deps/astro_runtime_client_dev-toolbar_entrypoint__js.js +455 -0
  48. package/apps/storefront/node_modules/.vite/deps/astro_runtime_client_dev-toolbar_entrypoint__js.js.map +1 -0
  49. package/apps/storefront/node_modules/.vite/deps/audit-DKDpcdEI.js +1535 -0
  50. package/apps/storefront/node_modules/.vite/deps/audit-DKDpcdEI.js.map +1 -0
  51. package/apps/storefront/node_modules/.vite/deps/highlight-B9UoX1wa.js +48 -0
  52. package/apps/storefront/node_modules/.vite/deps/highlight-B9UoX1wa.js.map +1 -0
  53. package/apps/storefront/node_modules/.vite/deps/icons-BWi2wI9n.js +42 -0
  54. package/apps/storefront/node_modules/.vite/deps/icons-BWi2wI9n.js.map +1 -0
  55. package/apps/storefront/node_modules/.vite/deps/package.json +3 -0
  56. package/apps/storefront/node_modules/.vite/deps/preact.js +310 -0
  57. package/apps/storefront/node_modules/.vite/deps/preact.js.map +1 -0
  58. package/apps/storefront/node_modules/.vite/deps/preact_compat.js +420 -0
  59. package/apps/storefront/node_modules/.vite/deps/preact_compat.js.map +1 -0
  60. package/apps/storefront/node_modules/.vite/deps/preact_compat_jsx-runtime.js +4 -0
  61. package/apps/storefront/node_modules/.vite/deps/preact_debug.js +236 -0
  62. package/apps/storefront/node_modules/.vite/deps/preact_debug.js.map +1 -0
  63. package/apps/storefront/node_modules/.vite/deps/preact_devtools.js +12 -0
  64. package/apps/storefront/node_modules/.vite/deps/preact_devtools.js.map +1 -0
  65. package/apps/storefront/node_modules/.vite/deps/preact_hooks.js +192 -0
  66. package/apps/storefront/node_modules/.vite/deps/preact_hooks.js.map +1 -0
  67. package/apps/storefront/node_modules/.vite/deps/preact_jsx-dev-runtime.js +3 -0
  68. package/apps/storefront/node_modules/.vite/deps/preact_jsx-runtime.js +92 -0
  69. package/apps/storefront/node_modules/.vite/deps/preact_jsx-runtime.js.map +1 -0
  70. package/apps/storefront/node_modules/.vite/deps/preact_test-utils.js +59 -0
  71. package/apps/storefront/node_modules/.vite/deps/preact_test-utils.js.map +1 -0
  72. package/apps/storefront/node_modules/.vite/deps/rolldown-runtime-BPOCksWG.js +24 -0
  73. package/apps/storefront/node_modules/.vite/deps/settings-BVDV0Roj.js +189 -0
  74. package/apps/storefront/node_modules/.vite/deps/settings-BVDV0Roj.js.map +1 -0
  75. package/apps/storefront/node_modules/.vite/deps/static-html-DveYqwMo.js +13 -0
  76. package/apps/storefront/node_modules/.vite/deps/static-html-DveYqwMo.js.map +1 -0
  77. package/apps/storefront/node_modules/.vite/deps/toolbar-B3VIHCXg.js +458 -0
  78. package/apps/storefront/node_modules/.vite/deps/toolbar-B3VIHCXg.js.map +1 -0
  79. package/apps/storefront/node_modules/.vite/deps/ui-library-BK6ricUd.js +1016 -0
  80. package/apps/storefront/node_modules/.vite/deps/ui-library-BK6ricUd.js.map +1 -0
  81. package/apps/storefront/node_modules/.vite/deps/window-BvxDenKN.js +32 -0
  82. package/apps/storefront/node_modules/.vite/deps/window-BvxDenKN.js.map +1 -0
  83. package/apps/storefront/node_modules/.vite/deps/xray-YFiRUU0Z.js +113 -0
  84. package/apps/storefront/node_modules/.vite/deps/xray-YFiRUU0Z.js.map +1 -0
  85. package/apps/storefront/node_modules/.vite/deps_ssr/_metadata.json +8 -0
  86. package/apps/storefront/node_modules/.vite/deps_ssr/package.json +3 -0
  87. package/apps/storefront/src/components/chrome/MegaMenu.astro +11 -1
  88. package/apps/storefront/src/components/chrome/NavDropdown.astro +49 -7
  89. package/apps/storefront/src/components/chrome/SiteFooter.astro +29 -4
  90. package/apps/storefront/src/components/chrome/SiteHeader.astro +39 -6
  91. package/apps/storefront/src/components/chrome/UtilityNav.astro +13 -1
  92. package/apps/storefront/src/components/islands/MobileNav.tsx +42 -2
  93. package/apps/storefront/src/layouts/Layout.astro +65 -7
  94. package/apps/storefront/src/lib/apps/registryAccess.ts +45 -0
  95. package/apps/storefront/src/lib/auth/adminEntry.ts +4 -4
  96. package/apps/storefront/src/lib/chrome/ctaIdentity.ts +21 -0
  97. package/apps/storefront/src/lib/chrome/examples/tokenoftrust.chrome.example.json +22 -22
  98. package/apps/storefront/src/lib/chrome/trackingPlacements.ts +36 -0
  99. package/apps/storefront/src/lib/d1/schema-apps.ts +57 -0
  100. package/apps/storefront/src/lib/rawChrome.ts +73 -14
  101. package/apps/storefront/src/lib/rawMarketingHtml.ts +30 -0
  102. package/apps/storefront/src/lib/shared/capability.ts +68 -0
  103. package/apps/storefront/src/lib/shared/developerInvites.ts +1250 -0
  104. package/apps/storefront/src/lib/shared/invitePreflight.ts +123 -0
  105. package/apps/storefront/src/lib/storyblok/provider.ts +21 -5
  106. package/apps/storefront/src/lib/tracking/collectorAllowlist.ts +40 -0
  107. package/apps/storefront/src/lib/tracking/collectorIngest.ts +188 -0
  108. package/apps/storefront/src/lib/tracking/d1Control.ts +180 -0
  109. package/apps/storefront/src/lib/tracking/interactionCollector.ts +202 -0
  110. package/apps/storefront/src/lib/tracking/interactionHealth.ts +252 -0
  111. package/apps/storefront/src/lib/tracking/interactionSchema.ts +107 -0
  112. package/apps/storefront/src/lib/tracking/interactionStore.ts +0 -0
  113. package/apps/storefront/src/lib/tracking/pruneRollup.ts +260 -0
  114. package/apps/storefront/src/lib/tracking/publishSafetyNet.ts +162 -0
  115. package/apps/storefront/src/lib/tracking/tenantD1Registry.ts +214 -0
  116. package/apps/storefront/src/lib/tracking/tenantReadAccess.ts +138 -0
  117. package/apps/storefront/src/lib/tracking-writeback/rewriteTrackingIds.ts +175 -0
  118. package/apps/storefront/src/lib/tracking-writeback/writebackCandidate.ts +110 -0
  119. package/apps/storefront/src/lib/webhooks/deliveryEngine.ts +38 -4
  120. package/apps/storefront/src/lib/webhooks/emit.ts +1 -1
  121. package/apps/storefront/src/lib/webhooks/getDispatcher.ts +1 -1
  122. package/apps/storefront/src/pages/api/admin/interaction-insights.ts +101 -0
  123. package/apps/storefront/src/pages/api/auth/magic-exchange.ts +1 -1
  124. package/apps/storefront/src/pages/api/tracking/interaction.ts +123 -0
  125. package/apps/storefront/src/pages/index.astro +1 -1
  126. package/apps/storefront/src/pages/products/[handle].astro +1 -1
  127. package/apps/storefront/src/pages/style-guide/[tenant]/[theme].astro +33 -14
  128. package/apps/storefront/src/workers/pruneRollupWorker.ts +120 -0
  129. package/package.json +1 -1
  130. package/packages/public-runtime/node_modules/.bin/tsc +43 -0
  131. package/packages/public-runtime/node_modules/.bin/tsserver +43 -0
  132. package/packages/public-runtime/node_modules/.bin/vitest +43 -0
  133. package/packages/public-runtime/src/chrome.ts +18 -7
  134. package/packages/public-runtime/src/index.ts +10 -0
  135. package/packages/public-runtime/src/integration/index.ts +1 -0
  136. package/packages/public-runtime/src/integration/interaction-tracking-gate.ts +142 -0
  137. package/packages/public-runtime/src/interaction-tracking.ts +364 -0
  138. package/packages/public-runtime/src/tracking-id-derivation.ts +1008 -0
  139. package/pnpm-workspace.yaml +3 -0
  140. package/scripts/tenant/validate.mjs +306 -1
  141. package/scripts/tot-dev.mjs +59 -3
  142. package/tenants/home/public/js/storefront.js +6 -87
  143. package/apps/storefront/src/lib/apps/adminService.ts +0 -116
  144. package/apps/storefront/src/lib/apps/adminSession.ts +0 -214
  145. package/apps/storefront/src/lib/apps/apiAuth.ts +0 -91
  146. package/apps/storefront/src/lib/apps/apiRoute.ts +0 -35
  147. package/apps/storefront/src/lib/apps/catalogMapper.ts +0 -39
  148. package/apps/storefront/src/lib/apps/consentConfigStore.ts +0 -228
  149. package/apps/storefront/src/lib/apps/gtmMigrationInstall.ts +0 -447
  150. package/apps/storefront/src/lib/apps/gtmMigrationReport.ts +0 -367
  151. package/apps/storefront/src/lib/apps/gtmMigrationTab.ts +0 -315
  152. package/apps/storefront/src/lib/apps/healthAggregate.ts +0 -66
  153. package/apps/storefront/src/lib/apps/integrationLifecycle.ts +0 -614
  154. package/apps/storefront/src/lib/apps/integrationLifecycleController.ts +0 -125
  155. package/apps/storefront/src/lib/apps/integrationReadModel.ts +0 -563
  156. package/apps/storefront/src/lib/apps/integrationsTab.ts +0 -547
  157. package/apps/storefront/src/lib/apps/integrationsView.ts +0 -106
  158. package/apps/storefront/src/lib/apps/managedAnalyticsService.ts +0 -599
  159. package/apps/storefront/src/lib/apps/tenantIntegrationMaterialization.ts +0 -170
  160. package/apps/storefront/src/lib/apps/tokenIssuer.ts +0 -121
  161. package/apps/storefront/src/lib/apps/tokenVerifier.ts +0 -148
  162. package/apps/storefront/src/lib/apps/v84CleanCloneReplayContext.ts +0 -16
  163. package/apps/storefront/src/lib/apps/v84CloneLifecycleCacheEvidence.ts +0 -105
  164. package/apps/storefront/src/lib/apps/v84CloneLifecycleEvidence.ts +0 -177
  165. package/apps/storefront/src/lib/apps/v84CloneLifecycleMaterialization.ts +0 -251
  166. package/apps/storefront/src/lib/apps/v84CloneLifecycleSemantics.ts +0 -241
  167. package/apps/storefront/src/lib/apps/v84CloneMigrationEvidence.ts +0 -211
  168. package/apps/storefront/src/lib/apps/v84CloneNativeInstallEvidence.ts +0 -409
  169. package/apps/storefront/src/lib/apps/v84NonportableCodeCoaching.ts +0 -368
  170. package/apps/storefront/src/lib/apps/v84NonportableRouteContract.ts +0 -188
  171. package/apps/storefront/src/lib/apps/v84NonportableRouteDogfood.ts +0 -291
  172. package/apps/storefront/src/lib/apps/ws1ManagedAnalyticsClient.ts +0 -95
  173. package/apps/storefront/src/lib/content-edit/applyDiff.ts +0 -91
  174. package/apps/storefront/src/lib/content-edit/client.ts +0 -286
  175. package/apps/storefront/src/lib/content-edit/index.ts +0 -14
  176. package/apps/storefront/src/lib/content-edit/route.ts +0 -25
  177. package/apps/storefront/src/lib/content-edit/types.ts +0 -19
  178. package/apps/storefront/src/pages/api/content-edit/ai-edit.ts +0 -164
@@ -0,0 +1,741 @@
1
+ import { Component as C$1, Fragment as S$1, isValidElement as t$1, options as l$2 } from "./preact.js";
2
+ import { useEffect as h$2, useMemo as T$2, useRef as A$1 } from "./preact_hooks.js";
3
+ //#region ../../node_modules/.pnpm/@preact+signals-core@1.14.4/node_modules/@preact/signals-core/dist/signals-core.module.js
4
+ var i = Symbol.for("preact-signals");
5
+ function t() {
6
+ if (!(v > 1)) {
7
+ var i, t = !1;
8
+ (function() {
9
+ var i = c;
10
+ c = void 0;
11
+ while (void 0 !== i) {
12
+ var t = i.S;
13
+ if (t.v === i.v) {
14
+ for (var n = t.t; void 0 !== n; n = n.x) if (n.i === i.i) n.i = t.i;
15
+ }
16
+ i = i.o;
17
+ }
18
+ })();
19
+ while (void 0 !== h$1) {
20
+ var n = h$1;
21
+ h$1 = void 0;
22
+ s++;
23
+ while (void 0 !== n) {
24
+ var r = n.u;
25
+ n.u = void 0;
26
+ n.f &= -3;
27
+ if (!(8 & n.f) && w$1(n)) try {
28
+ n.c();
29
+ } catch (n) {
30
+ if (!t) {
31
+ i = n;
32
+ t = !0;
33
+ }
34
+ }
35
+ n = r;
36
+ }
37
+ }
38
+ s = 0;
39
+ v--;
40
+ if (t) throw i;
41
+ } else v--;
42
+ }
43
+ function n(i) {
44
+ if (v > 0) return i();
45
+ e = ++u;
46
+ v++;
47
+ try {
48
+ return i();
49
+ } finally {
50
+ t();
51
+ }
52
+ }
53
+ var r;
54
+ var o = void 0;
55
+ function f(i) {
56
+ var t = o, n = r;
57
+ o = void 0;
58
+ r = void 0;
59
+ try {
60
+ return i();
61
+ } finally {
62
+ o = t;
63
+ r = n;
64
+ }
65
+ }
66
+ var h$1 = void 0;
67
+ var v = 0;
68
+ var s = 0;
69
+ var u = 0;
70
+ var e = 0;
71
+ var c = void 0;
72
+ var d$1 = 0;
73
+ function a(i) {
74
+ if (void 0 !== o) {
75
+ var t = i.n;
76
+ if (void 0 === t || t.t !== o) {
77
+ t = {
78
+ i: 0,
79
+ S: i,
80
+ p: o.s,
81
+ n: void 0,
82
+ t: o,
83
+ e: void 0,
84
+ x: void 0,
85
+ r: t
86
+ };
87
+ if (void 0 !== o.s) o.s.n = t;
88
+ o.s = t;
89
+ i.n = t;
90
+ if (32 & o.f) i.S(t);
91
+ return t;
92
+ } else if (-1 === t.i) {
93
+ t.i = 0;
94
+ if (void 0 !== t.n) {
95
+ t.n.p = t.p;
96
+ if (void 0 !== t.p) t.p.n = t.n;
97
+ t.p = o.s;
98
+ t.n = void 0;
99
+ o.s.n = t;
100
+ o.s = t;
101
+ }
102
+ return t;
103
+ }
104
+ }
105
+ }
106
+ function l(i, t) {
107
+ this.v = i;
108
+ this.i = 0;
109
+ this.n = void 0;
110
+ this.t = void 0;
111
+ this.l = 0;
112
+ this.W = null == t ? void 0 : t.watched;
113
+ this.Z = null == t ? void 0 : t.unwatched;
114
+ this.name = null == t ? void 0 : t.name;
115
+ }
116
+ l.prototype.brand = i;
117
+ l.prototype.h = function() {
118
+ return !0;
119
+ };
120
+ l.prototype.S = function(i) {
121
+ var t = this, n = this.t;
122
+ if (n !== i && void 0 === i.e) {
123
+ i.x = n;
124
+ this.t = i;
125
+ if (void 0 !== n) n.e = i;
126
+ else f(function() {
127
+ var i;
128
+ null == (i = t.W) || i.call(t);
129
+ });
130
+ }
131
+ };
132
+ l.prototype.U = function(i) {
133
+ var t = this;
134
+ if (void 0 !== this.t) {
135
+ var n = i.e, r = i.x;
136
+ if (void 0 !== n) {
137
+ n.x = r;
138
+ i.e = void 0;
139
+ }
140
+ if (void 0 !== r) {
141
+ r.e = n;
142
+ i.x = void 0;
143
+ }
144
+ if (i === this.t) {
145
+ this.t = r;
146
+ if (void 0 === r) f(function() {
147
+ var i;
148
+ null == (i = t.Z) || i.call(t);
149
+ });
150
+ }
151
+ }
152
+ };
153
+ l.prototype.subscribe = function(i) {
154
+ var t = this;
155
+ return j(function() {
156
+ var n = t.value;
157
+ f(function() {
158
+ return i(n);
159
+ });
160
+ }, { name: "sub" });
161
+ };
162
+ l.prototype.valueOf = function() {
163
+ return this.value;
164
+ };
165
+ l.prototype.toString = function() {
166
+ return this.value + "";
167
+ };
168
+ l.prototype.toJSON = function() {
169
+ return this.value;
170
+ };
171
+ l.prototype.peek = function() {
172
+ var i = this;
173
+ return f(function() {
174
+ return i.value;
175
+ });
176
+ };
177
+ Object.defineProperty(l.prototype, "value", {
178
+ get: function() {
179
+ var i = a(this);
180
+ if (void 0 !== i) i.i = this.i;
181
+ return this.v;
182
+ },
183
+ set: function(i) {
184
+ if (i !== this.v) {
185
+ if (s > 100) throw new Error("Cycle detected");
186
+ (function(i) {
187
+ if (0 !== v && 0 === s) {
188
+ if (i.l !== e) {
189
+ i.l = e;
190
+ c = {
191
+ S: i,
192
+ v: i.v,
193
+ i: i.i,
194
+ o: c
195
+ };
196
+ }
197
+ }
198
+ })(this);
199
+ this.v = i;
200
+ this.i++;
201
+ d$1++;
202
+ v++;
203
+ try {
204
+ for (var n = this.t; void 0 !== n; n = n.x) n.t.N();
205
+ } finally {
206
+ t();
207
+ }
208
+ }
209
+ }
210
+ });
211
+ function y(i, t) {
212
+ return new l(i, t);
213
+ }
214
+ function w$1(i) {
215
+ for (var t = i.s; void 0 !== t; t = t.n) if (t.S.i !== t.i || !t.S.h() || t.S.i !== t.i) return !0;
216
+ return !1;
217
+ }
218
+ function _$1(i) {
219
+ for (var t = i.s; void 0 !== t; t = t.n) {
220
+ var n = t.S.n;
221
+ if (void 0 !== n) t.r = n;
222
+ t.S.n = t;
223
+ t.i = -1;
224
+ if (void 0 === t.n) {
225
+ i.s = t;
226
+ break;
227
+ }
228
+ }
229
+ }
230
+ function b$1(i) {
231
+ var t = i.s, n = void 0;
232
+ while (void 0 !== t) {
233
+ var r = t.p;
234
+ if (-1 === t.i) {
235
+ t.S.U(t);
236
+ if (void 0 !== r) r.n = t.n;
237
+ if (void 0 !== t.n) t.n.p = r;
238
+ } else n = t;
239
+ t.S.n = t.r;
240
+ if (void 0 !== t.r) t.r = void 0;
241
+ t = r;
242
+ }
243
+ i.s = n;
244
+ }
245
+ function p$1(i, t) {
246
+ l.call(this, void 0, t);
247
+ this.x = i;
248
+ this.s = void 0;
249
+ this.g = d$1 - 1;
250
+ this.f = 4;
251
+ }
252
+ p$1.prototype = new l();
253
+ p$1.prototype.h = function() {
254
+ this.f &= -3;
255
+ if (1 & this.f) return !1;
256
+ if (32 == (36 & this.f)) return !0;
257
+ this.f &= -5;
258
+ if (this.g === d$1) return !0;
259
+ this.g = d$1;
260
+ this.f |= 1;
261
+ if (this.i > 0 && !w$1(this)) {
262
+ this.f &= -2;
263
+ return !0;
264
+ }
265
+ var i = o;
266
+ try {
267
+ _$1(this);
268
+ o = this;
269
+ var t = this.x();
270
+ if (16 & this.f || this.v !== t || 0 === this.i) {
271
+ this.v = t;
272
+ this.f &= -17;
273
+ this.i++;
274
+ }
275
+ } catch (i) {
276
+ this.v = i;
277
+ this.f |= 16;
278
+ this.i++;
279
+ }
280
+ o = i;
281
+ b$1(this);
282
+ this.f &= -2;
283
+ return !0;
284
+ };
285
+ p$1.prototype.S = function(i) {
286
+ if (void 0 === this.t) {
287
+ this.f |= 36;
288
+ for (var t = this.s; void 0 !== t; t = t.n) t.S.S(t);
289
+ }
290
+ l.prototype.S.call(this, i);
291
+ };
292
+ p$1.prototype.U = function(i) {
293
+ if (void 0 !== this.t) {
294
+ l.prototype.U.call(this, i);
295
+ if (void 0 === this.t) {
296
+ this.f &= -33;
297
+ for (var t = this.s; void 0 !== t; t = t.n) t.S.U(t);
298
+ }
299
+ }
300
+ };
301
+ p$1.prototype.N = function() {
302
+ if (!(2 & this.f)) {
303
+ this.f |= 6;
304
+ for (var i = this.t; void 0 !== i; i = i.x) i.t.N();
305
+ }
306
+ };
307
+ Object.defineProperty(p$1.prototype, "value", { get: function() {
308
+ if (1 & this.f) throw new Error("Cycle detected");
309
+ var i = a(this);
310
+ this.h();
311
+ if (void 0 !== i) i.i = this.i;
312
+ if (16 & this.f) throw this.v;
313
+ return this.v;
314
+ } });
315
+ function g(i, t) {
316
+ return new p$1(i, t);
317
+ }
318
+ function S(i) {
319
+ var n = i.m;
320
+ i.m = void 0;
321
+ if ("function" == typeof n) {
322
+ v++;
323
+ var r = o;
324
+ o = void 0;
325
+ try {
326
+ n();
327
+ } catch (t) {
328
+ i.f &= -2;
329
+ i.f |= 8;
330
+ m$1(i);
331
+ throw t;
332
+ } finally {
333
+ o = r;
334
+ t();
335
+ }
336
+ }
337
+ }
338
+ function m$1(i) {
339
+ for (var t = i.s; void 0 !== t; t = t.n) t.S.U(t);
340
+ i.x = void 0;
341
+ i.s = void 0;
342
+ S(i);
343
+ }
344
+ function x$1(i) {
345
+ if (o !== this) throw new Error("Out-of-order effect");
346
+ b$1(this);
347
+ o = i;
348
+ this.f &= -2;
349
+ if (8 & this.f) m$1(this);
350
+ t();
351
+ }
352
+ function E(i, t) {
353
+ this.x = i;
354
+ this.m = void 0;
355
+ this.s = void 0;
356
+ this.u = void 0;
357
+ this.f = 32;
358
+ this.name = null == t ? void 0 : t.name;
359
+ if (r) r.push(this);
360
+ }
361
+ E.prototype.c = function() {
362
+ var i = this.S();
363
+ try {
364
+ if (8 & this.f) return;
365
+ if (void 0 === this.x) return;
366
+ var t = this.x();
367
+ if ("function" == typeof t) this.m = t;
368
+ } finally {
369
+ i();
370
+ }
371
+ };
372
+ E.prototype.S = function() {
373
+ if (1 & this.f) throw new Error("Cycle detected");
374
+ this.f |= 1;
375
+ this.f &= -9;
376
+ S(this);
377
+ _$1(this);
378
+ v++;
379
+ var i = o;
380
+ o = this;
381
+ return x$1.bind(this, i);
382
+ };
383
+ E.prototype.N = function() {
384
+ if (!(2 & this.f)) {
385
+ this.f |= 2;
386
+ this.u = h$1;
387
+ h$1 = this;
388
+ }
389
+ };
390
+ E.prototype.d = function() {
391
+ this.f |= 8;
392
+ if (!(1 & this.f)) m$1(this);
393
+ };
394
+ E.prototype.dispose = function() {
395
+ this.d();
396
+ };
397
+ function j(i, t) {
398
+ var n = new E(i, t);
399
+ try {
400
+ n.c();
401
+ } catch (i) {
402
+ n.d();
403
+ throw i;
404
+ }
405
+ var r = n.d.bind(n);
406
+ r[Symbol.dispose] = r;
407
+ return r;
408
+ }
409
+ function C(i) {
410
+ return function() {
411
+ var t = arguments, r = this;
412
+ return n(function() {
413
+ return f(function() {
414
+ return i.apply(r, [].slice.call(t));
415
+ });
416
+ });
417
+ };
418
+ }
419
+ function O() {
420
+ var i = r;
421
+ r = [];
422
+ return function() {
423
+ var t = r;
424
+ if (r && i) i = i.concat(r);
425
+ r = i;
426
+ return t;
427
+ };
428
+ }
429
+ var k$1 = function(i) {
430
+ for (var t in i) {
431
+ var n = i[t];
432
+ if ("function" == typeof n) i[t] = C(n);
433
+ else if ("object" == typeof n && null !== n && !("brand" in n)) k$1(n);
434
+ }
435
+ };
436
+ function T(i) {
437
+ return function() {
438
+ var t, n, o = O();
439
+ try {
440
+ n = i.apply(void 0, [].slice.call(arguments));
441
+ } catch (i) {
442
+ r = void 0;
443
+ throw i;
444
+ } finally {
445
+ t = o();
446
+ }
447
+ k$1(n);
448
+ n[Symbol.dispose] = C(function() {
449
+ if (t) for (var i = 0; i < t.length; i++) t[i].dispose();
450
+ t = void 0;
451
+ });
452
+ return n;
453
+ };
454
+ }
455
+ //#endregion
456
+ //#region ../../node_modules/.pnpm/@preact+signals@2.11.1_preact@10.29.8/node_modules/@preact/signals/dist/signals.module.js
457
+ var l$1;
458
+ var h;
459
+ var d;
460
+ var p = "undefined" != typeof window && !!window.__PREACT_SIGNALS_DEVTOOLS__;
461
+ var m = [];
462
+ var _ = [];
463
+ j(function() {
464
+ l$1 = this.N;
465
+ })();
466
+ function g$1(i, r) {
467
+ l$2[i] = r.bind(null, l$2[i] || function() {});
468
+ }
469
+ function b(i) {
470
+ if (d) {
471
+ var n = d;
472
+ d = void 0;
473
+ n();
474
+ }
475
+ d = i && i.S();
476
+ }
477
+ function y$1(i) {
478
+ var n = this, t = i.data, f = useSignal(t);
479
+ f.name = "ReactiveDom";
480
+ f.value = t;
481
+ var e = T$2(function() {
482
+ var i = n, t = n.__v;
483
+ while (t = t.__) if (t.__c) {
484
+ t.__c.__$f |= 4;
485
+ break;
486
+ }
487
+ var o = g(function() {
488
+ var i = f.value.value;
489
+ return 0 === i ? 0 : !0 === i ? "" : i || "";
490
+ }), e = g(function() {
491
+ return !Array.isArray(o.value) && !t$1(o.value);
492
+ }), a = j(function() {
493
+ this.N = F;
494
+ if (e.value) {
495
+ var n = o.value;
496
+ if (i.__v && i.__v.__e && 3 === i.__v.__e.nodeType) i.__v.__e.data = n;
497
+ }
498
+ }), v = n.__$u.d;
499
+ n.__$u.d = function() {
500
+ a();
501
+ v.call(this);
502
+ };
503
+ return [e, o];
504
+ }, []), a = e[0], v = e[1];
505
+ return a.value ? v.peek() : v.value;
506
+ }
507
+ y$1.displayName = "ReactiveTextNode";
508
+ Object.defineProperties(l.prototype, {
509
+ constructor: {
510
+ configurable: !0,
511
+ value: void 0
512
+ },
513
+ type: {
514
+ configurable: !0,
515
+ value: y$1
516
+ },
517
+ props: {
518
+ configurable: !0,
519
+ get: function() {
520
+ var i = this;
521
+ return { data: { get value() {
522
+ return i.value;
523
+ } } };
524
+ }
525
+ },
526
+ __b: {
527
+ configurable: !0,
528
+ value: 1
529
+ }
530
+ });
531
+ g$1("__b", function(i, n) {
532
+ if ("string" == typeof n.type) {
533
+ var r, t = n.props;
534
+ for (var o in t) if ("children" !== o) {
535
+ var f = t[o];
536
+ if (f instanceof l) {
537
+ if (!r) n.__np = r = {};
538
+ r[o] = f;
539
+ t[o] = f.peek();
540
+ }
541
+ }
542
+ }
543
+ i(n);
544
+ });
545
+ g$1("__r", function(i, n) {
546
+ i(n);
547
+ if (n.type !== S$1) {
548
+ b();
549
+ var r, o = n.__c;
550
+ if (o) {
551
+ o.__$f &= -2;
552
+ if (void 0 === (r = o.__$u)) o.__$u = r = function(i, n) {
553
+ var r;
554
+ j(function() {
555
+ r = this;
556
+ }, { name: n });
557
+ r.c = i;
558
+ return r;
559
+ }(function(i) {
560
+ return function() {
561
+ var n;
562
+ if (p) null == (n = this.y) || n.call(this);
563
+ i.__$f |= 1;
564
+ i.setState({});
565
+ };
566
+ }(o), "function" == typeof n.type ? n.type.displayName || n.type.name : "");
567
+ }
568
+ h = o;
569
+ b(r);
570
+ }
571
+ });
572
+ g$1("__e", function(i, n, r, t) {
573
+ b();
574
+ h = void 0;
575
+ i(n, r, t);
576
+ });
577
+ g$1("diffed", function(i, n) {
578
+ b();
579
+ h = void 0;
580
+ var r;
581
+ if ("string" == typeof n.type && (r = n.__e)) {
582
+ var t = n.__np, o = n.props, f = r.U;
583
+ if (f) for (var e in f) {
584
+ var u = f[e];
585
+ if (!(void 0 === u || t && e in t)) {
586
+ u.d();
587
+ f[e] = void 0;
588
+ }
589
+ }
590
+ if (t) {
591
+ if (!f) {
592
+ f = {};
593
+ r.U = f;
594
+ }
595
+ for (var a in t) {
596
+ var c = f[a], v = t[a];
597
+ if (void 0 === c) {
598
+ c = w(r, a, v, o);
599
+ f[a] = c;
600
+ } else c.o(v, o);
601
+ }
602
+ }
603
+ }
604
+ i(n);
605
+ });
606
+ function w(i, n, r, t) {
607
+ var o = n in i && void 0 === i.ownerSVGElement, f = y(r);
608
+ return {
609
+ o: function(i, n) {
610
+ f.value = i;
611
+ t = n;
612
+ },
613
+ d: j(function() {
614
+ this.N = F;
615
+ var r = f.value.value;
616
+ if (t[n] !== r) {
617
+ t[n] = r;
618
+ if (o) i[n] = r;
619
+ else if (null != r && (!1 !== r || "-" === n[4])) i.setAttribute(n, r);
620
+ else i.removeAttribute(n);
621
+ }
622
+ })
623
+ };
624
+ }
625
+ g$1("unmount", function(i, n) {
626
+ if ("string" == typeof n.type) {
627
+ var r = n.__e;
628
+ if (r) {
629
+ var t = r.U;
630
+ if (t) {
631
+ r.U = void 0;
632
+ for (var o in t) {
633
+ var f = t[o];
634
+ if (f) f.d();
635
+ }
636
+ }
637
+ }
638
+ var e = n.__np;
639
+ if (e) {
640
+ var u = n.props;
641
+ for (var a in e) u[a] = e[a];
642
+ }
643
+ n.__np = void 0;
644
+ } else {
645
+ var c = n.__c;
646
+ if (c) {
647
+ var v = c.__$u;
648
+ if (v) {
649
+ c.__$u = void 0;
650
+ v.d();
651
+ }
652
+ }
653
+ }
654
+ i(n);
655
+ });
656
+ g$1("__h", function(i, n, r, t) {
657
+ if (t < 3) n.__$f |= 2;
658
+ i(n, r, t);
659
+ });
660
+ C$1.prototype.shouldComponentUpdate = function(i, n) {
661
+ if (this.__R) return !0;
662
+ var r = this.__$u, t = r && void 0 !== r.s;
663
+ for (var o in n) return !0;
664
+ if (this.__f || "boolean" == typeof this.u && !0 === this.u) {
665
+ var f = 2 & this.__$f;
666
+ if (!(t || f || 4 & this.__$f)) return !0;
667
+ if (1 & this.__$f) return !0;
668
+ } else {
669
+ if (!(t || 4 & this.__$f)) return !0;
670
+ if (3 & this.__$f) return !0;
671
+ }
672
+ for (var e in i) if ("__source" !== e && i[e] !== this.props[e]) return !0;
673
+ for (var u in this.props) if (!(u in i)) return !0;
674
+ return !1;
675
+ };
676
+ function useSignal(i, n) {
677
+ return T$2(function() {
678
+ return y(i, n);
679
+ }, []);
680
+ }
681
+ function useComputed(i, n) {
682
+ var r = A$1(i);
683
+ r.current = i;
684
+ h.__$f |= 4;
685
+ return T$2(function() {
686
+ return g(function() {
687
+ return r.current();
688
+ }, n);
689
+ }, []);
690
+ }
691
+ var k = "undefined" == typeof requestAnimationFrame ? setTimeout : function(i) {
692
+ var n = function() {
693
+ clearTimeout(r);
694
+ cancelAnimationFrame(t);
695
+ i();
696
+ }, r = setTimeout(n, 35), t = requestAnimationFrame(n);
697
+ };
698
+ var q = function(i) {
699
+ queueMicrotask(function() {
700
+ queueMicrotask(i);
701
+ });
702
+ };
703
+ function A() {
704
+ n(function() {
705
+ var i;
706
+ while (i = m.shift()) l$1.call(i);
707
+ });
708
+ }
709
+ function T$1() {
710
+ if (1 === m.push(this)) (l$2.requestAnimationFrame || k)(A);
711
+ }
712
+ function x() {
713
+ n(function() {
714
+ var i;
715
+ while (i = _.shift()) l$1.call(i);
716
+ });
717
+ }
718
+ function F() {
719
+ if (1 === _.push(this)) (l$2.requestAnimationFrame || q)(x);
720
+ }
721
+ function useSignalEffect(i, n) {
722
+ var r = A$1(i);
723
+ r.current = i;
724
+ h$2(function() {
725
+ return j(function() {
726
+ this.N = T$1;
727
+ return r.current();
728
+ }, n);
729
+ }, []);
730
+ }
731
+ function M(i) {
732
+ var n = T$2(function() {
733
+ return i();
734
+ }, []);
735
+ h$2(function() {
736
+ return n[Symbol.dispose];
737
+ }, [n]);
738
+ return n;
739
+ }
740
+ //#endregion
741
+ export { l as Signal, C as action, n as batch, g as computed, T as createModel, j as effect, y as signal, f as untracked, useComputed, M as useModel, useSignal, useSignalEffect };