@burdenoff/microfe-store 2026.510.113

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 (141) hide show
  1. package/README.md +217 -0
  2. package/dist/StoreAdminRoot.d.ts +22 -0
  3. package/dist/StoreAdminRoot.js +23 -0
  4. package/dist/StoreAdminRoot.js.map +1 -0
  5. package/dist/StoreAdminRoutes.d.ts +9 -0
  6. package/dist/StoreAdminRoutes.js +69 -0
  7. package/dist/StoreAdminRoutes.js.map +1 -0
  8. package/dist/StoreRoot.d.ts +31 -0
  9. package/dist/StoreRoot.js +139 -0
  10. package/dist/StoreRoot.js.map +1 -0
  11. package/dist/StoreRoutes.d.ts +12 -0
  12. package/dist/StoreRoutes.js +285 -0
  13. package/dist/StoreRoutes.js.map +1 -0
  14. package/dist/components/InstallAppModal.d.ts +26 -0
  15. package/dist/components/InstallAppModal.js +287 -0
  16. package/dist/components/InstallAppModal.js.map +1 -0
  17. package/dist/components/RouteGuards.d.ts +17 -0
  18. package/dist/components/RouteGuards.js +26 -0
  19. package/dist/components/RouteGuards.js.map +1 -0
  20. package/dist/components/cart/CartDrawer.d.ts +35 -0
  21. package/dist/components/cart/CartDrawer.js +162 -0
  22. package/dist/components/cart/CartDrawer.js.map +1 -0
  23. package/dist/components/index.d.ts +9 -0
  24. package/dist/components/index.js +3 -0
  25. package/dist/components/marketplace/ProductCard.d.ts +18 -0
  26. package/dist/components/marketplace/ProductCard.js +2 -0
  27. package/dist/dev/main.d.ts +1 -0
  28. package/dist/generated/global-operations.d.ts +2012 -0
  29. package/dist/generated/global-operations.js +1444 -0
  30. package/dist/generated/global-operations.js.map +1 -0
  31. package/dist/generated/global-types.d.ts +20856 -0
  32. package/dist/generated/global-types.js +14 -0
  33. package/dist/generated/global-types.js.map +1 -0
  34. package/dist/generated/wspace-operations.d.ts +1 -0
  35. package/dist/generated/wspace-types.d.ts +53362 -0
  36. package/dist/hooks/index.d.ts +12 -0
  37. package/dist/hooks/useBackendCart.d.ts +73 -0
  38. package/dist/hooks/useBackendCart.js +171 -0
  39. package/dist/hooks/useBackendCart.js.map +1 -0
  40. package/dist/hooks/useCart.d.ts +62 -0
  41. package/dist/hooks/useCart.js +90 -0
  42. package/dist/hooks/useCart.js.map +1 -0
  43. package/dist/hooks/useInstallations.d.ts +43 -0
  44. package/dist/hooks/useInstallations.js +140 -0
  45. package/dist/hooks/useInstallations.js.map +1 -0
  46. package/dist/hooks/useOrders.d.ts +40 -0
  47. package/dist/hooks/useOrders.js +73 -0
  48. package/dist/hooks/useOrders.js.map +1 -0
  49. package/dist/hooks/useProductSearch.d.ts +22 -0
  50. package/dist/hooks/useProductSearch.js +59 -0
  51. package/dist/hooks/useProductSearch.js.map +1 -0
  52. package/dist/hooks/useStoreGraphQL.d.ts +475 -0
  53. package/dist/hooks/useStoreGraphQL.js +751 -0
  54. package/dist/hooks/useStoreGraphQL.js.map +1 -0
  55. package/dist/hooks/useStoreGraphQLWithContext.d.ts +48 -0
  56. package/dist/hooks/useStoreGraphQLWithContext.js +39 -0
  57. package/dist/hooks/useStoreGraphQLWithContext.js.map +1 -0
  58. package/dist/hooks/useStorePermissions.d.ts +63 -0
  59. package/dist/hooks/useStorePermissions.js +88 -0
  60. package/dist/hooks/useStorePermissions.js.map +1 -0
  61. package/dist/index.d.ts +44 -0
  62. package/dist/index.js +13 -0
  63. package/dist/pages/AdminDashboardPage.d.ts +3 -0
  64. package/dist/pages/AdminDashboardPage.js +491 -0
  65. package/dist/pages/AdminDashboardPage.js.map +1 -0
  66. package/dist/pages/AdminReviewModerationPage.d.ts +3 -0
  67. package/dist/pages/AdminReviewModerationPage.js +247 -0
  68. package/dist/pages/AdminReviewModerationPage.js.map +1 -0
  69. package/dist/pages/AdminStoresPage.d.ts +3 -0
  70. package/dist/pages/AdminStoresPage.js +442 -0
  71. package/dist/pages/AdminStoresPage.js.map +1 -0
  72. package/dist/pages/AdminSubmissionsQueuePage.d.ts +3 -0
  73. package/dist/pages/AdminSubmissionsQueuePage.js +387 -0
  74. package/dist/pages/AdminSubmissionsQueuePage.js.map +1 -0
  75. package/dist/pages/AppDetailPage.d.ts +3 -0
  76. package/dist/pages/AppDetailPage.js +166 -0
  77. package/dist/pages/AppDetailPage.js.map +1 -0
  78. package/dist/pages/AppSettingsPage.d.ts +3 -0
  79. package/dist/pages/AppSettingsPage.js +100 -0
  80. package/dist/pages/AppSettingsPage.js.map +1 -0
  81. package/dist/pages/CartPage.d.ts +8 -0
  82. package/dist/pages/CartPage.js +259 -0
  83. package/dist/pages/CartPage.js.map +1 -0
  84. package/dist/pages/InstalledAppsPage.d.ts +8 -0
  85. package/dist/pages/InstalledAppsPage.js +290 -0
  86. package/dist/pages/InstalledAppsPage.js.map +1 -0
  87. package/dist/pages/MarketplaceHomePage.d.ts +3 -0
  88. package/dist/pages/MarketplaceHomePage.js +1118 -0
  89. package/dist/pages/MarketplaceHomePage.js.map +1 -0
  90. package/dist/pages/MyLicensesPage.d.ts +3 -0
  91. package/dist/pages/MyLicensesPage.js +146 -0
  92. package/dist/pages/MyLicensesPage.js.map +1 -0
  93. package/dist/pages/OrderConfirmationPage.d.ts +3 -0
  94. package/dist/pages/OrderConfirmationPage.js +178 -0
  95. package/dist/pages/OrderConfirmationPage.js.map +1 -0
  96. package/dist/pages/OrdersPage.d.ts +8 -0
  97. package/dist/pages/OrdersPage.js +358 -0
  98. package/dist/pages/OrdersPage.js.map +1 -0
  99. package/dist/pages/ProductCategoryPage.d.ts +3 -0
  100. package/dist/pages/ProductCategoryPage.js +83 -0
  101. package/dist/pages/ProductCategoryPage.js.map +1 -0
  102. package/dist/pages/ProductDetailPage.d.ts +8 -0
  103. package/dist/pages/ProductDetailPage.js +1205 -0
  104. package/dist/pages/ProductDetailPage.js.map +1 -0
  105. package/dist/pages/ProductReviewsPage.d.ts +3 -0
  106. package/dist/pages/ProductReviewsPage.js +86 -0
  107. package/dist/pages/ProductReviewsPage.js.map +1 -0
  108. package/dist/pages/PublisherDashboardPage.d.ts +3 -0
  109. package/dist/pages/PublisherDashboardPage.js +154 -0
  110. package/dist/pages/PublisherDashboardPage.js.map +1 -0
  111. package/dist/pages/PublisherRevenuePage.d.ts +3 -0
  112. package/dist/pages/PublisherRevenuePage.js +138 -0
  113. package/dist/pages/PublisherRevenuePage.js.map +1 -0
  114. package/dist/pages/PublisherSubmissionsPage.d.ts +3 -0
  115. package/dist/pages/PublisherSubmissionsPage.js +174 -0
  116. package/dist/pages/PublisherSubmissionsPage.js.map +1 -0
  117. package/dist/pages/PublisherSubmitPage.d.ts +3 -0
  118. package/dist/pages/PublisherSubmitPage.js +224 -0
  119. package/dist/pages/PublisherSubmitPage.js.map +1 -0
  120. package/dist/pages/SearchResultsPage.d.ts +3 -0
  121. package/dist/pages/SearchResultsPage.js +125 -0
  122. package/dist/pages/SearchResultsPage.js.map +1 -0
  123. package/dist/pages/StoresPage.d.ts +3 -0
  124. package/dist/pages/StoresPage.js +154 -0
  125. package/dist/pages/StoresPage.js.map +1 -0
  126. package/dist/providers/StoreProvider.d.ts +38 -0
  127. package/dist/providers/StoreProvider.js +51 -0
  128. package/dist/providers/StoreProvider.js.map +1 -0
  129. package/dist/store/storeStore.d.ts +69 -0
  130. package/dist/store/storeStore.js +68 -0
  131. package/dist/store/storeStore.js.map +1 -0
  132. package/dist/translations/en.d.ts +518 -0
  133. package/dist/translations/en.js +514 -0
  134. package/dist/translations/en.js.map +1 -0
  135. package/dist/types/index.d.ts +575 -0
  136. package/dist/utils/index.d.ts +67 -0
  137. package/dist/utils/index.js +114 -0
  138. package/dist/utils/index.js.map +1 -0
  139. package/dist/utils/nativeBridge.d.ts +2 -0
  140. package/dist/utils/nativeBridge.js +2 -0
  141. package/package.json +105 -0
@@ -0,0 +1,751 @@
1
+ import { useStore as e } from "../providers/StoreProvider.js";
2
+ import { useStoreGraphQLWithContext as t } from "./useStoreGraphQLWithContext.js";
3
+ import { BrowseStoreDocument as n, CategoriesDocument as r, CheckEntitlementDocument as i, CreateReviewDocument as a, DeleteReviewDocument as o, DeveloperEarningsDocument as s, FeaturedProductsDocument as c, FilterOptionsDocument as l, HomeGroupedProductsDocument as u, MarkReviewHelpfulDocument as d, MyEntitlementsDocument as f, MyPublishedProductsDocument as p, ProductReviewsDocument as m, SearchSuggestionsDocument as h, StoreProductDetailsDocument as g, TrendingSearchesDocument as _, UpdateReviewDocument as v, UserReviewForProductDocument as y, WorkspaceStoreOrdersDocument as b } from "../generated/global-operations.js";
4
+ import { useCallback as x, useEffect as S, useMemo as C, useRef as w, useState as T } from "react";
5
+ import { useApolloClient as E } from "@apollo/client/react";
6
+ //#region src/hooks/useStoreGraphQL.ts
7
+ function D() {
8
+ return E();
9
+ }
10
+ function O(e = {}) {
11
+ let t = D(), [r, i] = T([]), [a, o] = T(0), [s, c] = T(!1), [l, u] = T(void 0), [d, f] = T(!0), [p, m] = T(null), h = JSON.stringify(e), g = x(async () => {
12
+ f(!0), m(null);
13
+ try {
14
+ let e = await t.query({
15
+ query: n,
16
+ variables: { input: JSON.parse(h) },
17
+ fetchPolicy: "network-only"
18
+ });
19
+ i(e.data?.browseStore?.products ?? []), o(e.data?.browseStore?.totalCount ?? 0), c(e.data?.browseStore?.hasMore ?? !1), u(e.data?.browseStore?.facets);
20
+ } catch (e) {
21
+ m(e);
22
+ } finally {
23
+ f(!1);
24
+ }
25
+ }, [t, h]);
26
+ return S(() => {
27
+ g();
28
+ }, [g]), {
29
+ products: r,
30
+ totalCount: a,
31
+ hasMore: s,
32
+ facets: l,
33
+ loading: d,
34
+ error: p,
35
+ refetch: g
36
+ };
37
+ }
38
+ function k(r = {}, i) {
39
+ let { query: a, hasOrganizationContext: o } = t(), s = E(), { defaultCompatibleWith: c } = e(), [l, u] = T([]), [d, f] = T(0), [p, m] = T(!1), [h, g] = T(void 0), [_, v] = T(!i?.skip), [y, b] = T(null), [w, D] = T(r.pagination?.offset ?? 0), O = i?.skip, k = C(() => {
40
+ if (!c) return r;
41
+ let e = { ...r };
42
+ return e.filter ? (e.filter = { ...e.filter }, e.filter.compatibleWith || (e.filter.compatibleWith = c)) : e.filter = { compatibleWith: c }, e;
43
+ }, [r, c]), A = C(() => {
44
+ let { pagination: e, ...t } = k;
45
+ return JSON.stringify(t);
46
+ }, [k]), j = r.pagination?.limit ?? 30, M = x(async (e, t) => {
47
+ if (O) {
48
+ v(!1);
49
+ return;
50
+ }
51
+ v(!0), b(null);
52
+ try {
53
+ let r = {
54
+ ...JSON.parse(A),
55
+ pagination: {
56
+ ...k.pagination,
57
+ limit: j,
58
+ offset: e
59
+ }
60
+ }, i;
61
+ i = o ? await a({
62
+ query: n,
63
+ variables: { input: r },
64
+ fetchPolicy: "network-only"
65
+ }) : await s.query({
66
+ query: n,
67
+ variables: { input: r },
68
+ fetchPolicy: "network-only"
69
+ });
70
+ let c = i.data?.browseStore?.products ?? [];
71
+ u(t ? (e) => [...e, ...c] : c), f(i.data?.browseStore?.totalCount ?? 0), m(i.data?.browseStore?.hasMore ?? !1), g(i.data?.browseStore?.facets), D(e + c.length);
72
+ } catch (e) {
73
+ b(e);
74
+ } finally {
75
+ v(!1);
76
+ }
77
+ }, [
78
+ a,
79
+ s,
80
+ o,
81
+ A,
82
+ O,
83
+ j,
84
+ k.pagination
85
+ ]);
86
+ return S(() => {
87
+ M(r.pagination?.offset ?? 0, !1);
88
+ }, [A, O]), {
89
+ products: l,
90
+ totalCount: d,
91
+ hasMore: p,
92
+ facets: h,
93
+ loading: _,
94
+ error: y,
95
+ refetch: () => M(r.pagination?.offset ?? 0, !1),
96
+ loadMore: x(() => {
97
+ !p || _ || M(w, !0);
98
+ }, [
99
+ M,
100
+ p,
101
+ _,
102
+ w
103
+ ])
104
+ };
105
+ }
106
+ function A() {
107
+ let e = D(), [t, r] = T([]), [i, a] = T(0), [o, s] = T(!1), [c, l] = T(void 0), [u, d] = T(!1), [f, p] = T(null);
108
+ return {
109
+ browseStore: x(async (t = {}) => {
110
+ d(!0), p(null);
111
+ try {
112
+ let i = (await e.query({
113
+ query: n,
114
+ variables: { input: t },
115
+ fetchPolicy: "network-only"
116
+ })).data?.browseStore;
117
+ return r(i?.products ?? []), a(i?.totalCount ?? 0), s(i?.hasMore ?? !1), l(i?.facets), i;
118
+ } catch (e) {
119
+ return p(e), null;
120
+ } finally {
121
+ d(!1);
122
+ }
123
+ }, [e]),
124
+ products: t,
125
+ totalCount: i,
126
+ hasMore: o,
127
+ facets: c,
128
+ loading: u,
129
+ error: f
130
+ };
131
+ }
132
+ function j(e) {
133
+ let { query: n, hasOrganizationContext: r } = t(), i = E(), [a, o] = T(null), [s, c] = T(!0), [l, u] = T(null), d = !e.id && !e.slug, f = JSON.stringify(e), p = w(null), m = x(async () => {
134
+ if (d) {
135
+ c(!1);
136
+ return;
137
+ }
138
+ if (p.current !== f) {
139
+ p.current = f, c(!0), u(null);
140
+ try {
141
+ o((r ? await n({
142
+ query: g,
143
+ variables: { input: JSON.parse(f) },
144
+ fetchPolicy: "network-only"
145
+ }) : await i.query({
146
+ query: g,
147
+ variables: { input: JSON.parse(f) },
148
+ fetchPolicy: "network-only"
149
+ })).data?.storeProductDetails ?? null);
150
+ } catch (e) {
151
+ u(e);
152
+ } finally {
153
+ c(!1);
154
+ }
155
+ }
156
+ }, [
157
+ i,
158
+ r,
159
+ f,
160
+ n,
161
+ d
162
+ ]);
163
+ return S(() => {
164
+ m();
165
+ }, [m]), {
166
+ data: a,
167
+ loading: s,
168
+ error: l,
169
+ refetch: () => (p.current = null, m())
170
+ };
171
+ }
172
+ function M() {
173
+ let { query: e, hasOrganizationContext: n } = t(), r = E(), [i, a] = T(null), [o, s] = T(!1), [c, l] = T(null);
174
+ return {
175
+ getProductDetails: x(async (t) => {
176
+ s(!0), l(null);
177
+ try {
178
+ let i = (n ? await e({
179
+ query: g,
180
+ variables: { input: t }
181
+ }) : await r.query({
182
+ query: g,
183
+ variables: { input: t }
184
+ })).data?.storeProductDetails ?? null;
185
+ return a(i), i;
186
+ } catch (e) {
187
+ return l(e), null;
188
+ } finally {
189
+ s(!1);
190
+ }
191
+ }, [
192
+ r,
193
+ n,
194
+ e
195
+ ]),
196
+ data: i,
197
+ loading: o,
198
+ error: c
199
+ };
200
+ }
201
+ function N(t) {
202
+ let n = D(), { defaultCompatibleWith: r } = e(), [i, a] = T(null), [o, s] = T(!t?.skip), [c, l] = T(null), d = t?.skip, f = x(async () => {
203
+ if (d) {
204
+ s(!1);
205
+ return;
206
+ }
207
+ s(!0), l(null);
208
+ try {
209
+ a((await n.query({
210
+ query: u,
211
+ variables: { compatibleWith: r ?? null },
212
+ fetchPolicy: "cache-first"
213
+ })).data?.homeGroupedProducts ?? null);
214
+ } catch (e) {
215
+ l(e);
216
+ } finally {
217
+ s(!1);
218
+ }
219
+ }, [
220
+ n,
221
+ r,
222
+ d
223
+ ]);
224
+ return S(() => {
225
+ f();
226
+ }, [f]), {
227
+ data: i,
228
+ featured: i?.featured ?? [],
229
+ mostDownloaded: i?.mostDownloaded ?? [],
230
+ recentlyAdded: i?.recentlyAdded ?? [],
231
+ freeItems: i?.freeItems ?? [],
232
+ loading: o,
233
+ error: c,
234
+ refetch: f
235
+ };
236
+ }
237
+ function P(e) {
238
+ let t = D(), [n, r] = T([]), [i, a] = T(!0), [o, s] = T(null), l = x(async () => {
239
+ a(!0), s(null);
240
+ try {
241
+ r((await t.query({
242
+ query: c,
243
+ variables: { limit: e },
244
+ fetchPolicy: "cache-first"
245
+ })).data?.featuredProducts ?? []);
246
+ } catch (e) {
247
+ s(e);
248
+ } finally {
249
+ a(!1);
250
+ }
251
+ }, [t, e]);
252
+ return S(() => {
253
+ l();
254
+ }, [l]), {
255
+ products: n,
256
+ loading: i,
257
+ error: o,
258
+ refetch: l
259
+ };
260
+ }
261
+ function F(e, t) {
262
+ let n = D(), [r, i] = T([]), [a, o] = T(!1), [s, c] = T(null), l = e.length < 2, u = x(async () => {
263
+ if (l) {
264
+ i([]);
265
+ return;
266
+ }
267
+ o(!0), c(null);
268
+ try {
269
+ i((await n.query({
270
+ query: h,
271
+ variables: {
272
+ query: e,
273
+ limit: t?.limit,
274
+ types: t?.types
275
+ },
276
+ fetchPolicy: "network-only"
277
+ })).data?.searchSuggestions ?? []);
278
+ } catch (e) {
279
+ c(e);
280
+ } finally {
281
+ o(!1);
282
+ }
283
+ }, [
284
+ n,
285
+ e,
286
+ t?.limit,
287
+ t?.types,
288
+ l
289
+ ]);
290
+ return S(() => {
291
+ u();
292
+ }, [u]), {
293
+ suggestions: r,
294
+ loading: a,
295
+ error: s,
296
+ refetch: u
297
+ };
298
+ }
299
+ function I() {
300
+ let e = D(), [t, n] = T([]), [r, i] = T(!1), [a, o] = T(null);
301
+ return {
302
+ getSuggestions: x(async (t, r) => {
303
+ if (t.length < 2) return n([]), [];
304
+ i(!0), o(null);
305
+ try {
306
+ let i = (await e.query({
307
+ query: h,
308
+ variables: {
309
+ query: t,
310
+ limit: r?.limit,
311
+ types: r?.types
312
+ },
313
+ fetchPolicy: "network-only"
314
+ })).data?.searchSuggestions ?? [];
315
+ return n(i), i;
316
+ } catch (e) {
317
+ return o(e), [];
318
+ } finally {
319
+ i(!1);
320
+ }
321
+ }, [e]),
322
+ suggestions: t,
323
+ loading: r,
324
+ error: a
325
+ };
326
+ }
327
+ function L(e) {
328
+ let t = D(), [n, r] = T([]), [i, a] = T(!0), [o, s] = T(null), c = x(async () => {
329
+ a(!0), s(null);
330
+ try {
331
+ r((await t.query({
332
+ query: _,
333
+ variables: {
334
+ limit: e?.limit,
335
+ type: e?.type
336
+ },
337
+ fetchPolicy: "cache-first"
338
+ })).data?.trendingSearches ?? []);
339
+ } catch (e) {
340
+ s(e);
341
+ } finally {
342
+ a(!1);
343
+ }
344
+ }, [
345
+ t,
346
+ e?.limit,
347
+ e?.type
348
+ ]);
349
+ return S(() => {
350
+ c();
351
+ }, [c]), {
352
+ terms: n,
353
+ loading: i,
354
+ error: o,
355
+ refetch: c
356
+ };
357
+ }
358
+ function R(e) {
359
+ let t = D(), [n, r] = T(null), [i, a] = T(!0), [o, s] = T(null), c = x(async () => {
360
+ a(!0), s(null);
361
+ try {
362
+ r((await t.query({
363
+ query: l,
364
+ variables: {
365
+ type: e?.type,
366
+ withProducts: e?.withProducts
367
+ },
368
+ fetchPolicy: "cache-first"
369
+ })).data?.filterOptions ?? null);
370
+ } catch (e) {
371
+ s(e);
372
+ } finally {
373
+ a(!1);
374
+ }
375
+ }, [
376
+ t,
377
+ e?.type,
378
+ e?.withProducts
379
+ ]);
380
+ return S(() => {
381
+ c();
382
+ }, [c]), {
383
+ filterOptions: n,
384
+ loading: i,
385
+ error: o,
386
+ refetch: c
387
+ };
388
+ }
389
+ function z() {
390
+ let e = D(), [t, n] = T([]), [i, a] = T(!0), [o, s] = T(null), c = x(async () => {
391
+ a(!0), s(null);
392
+ try {
393
+ n((await e.query({
394
+ query: r,
395
+ fetchPolicy: "cache-first"
396
+ })).data?.categories ?? []);
397
+ } catch (e) {
398
+ s(e);
399
+ } finally {
400
+ a(!1);
401
+ }
402
+ }, [e]);
403
+ return S(() => {
404
+ c();
405
+ }, [c]), {
406
+ categories: t,
407
+ loading: i,
408
+ error: o,
409
+ refetch: c
410
+ };
411
+ }
412
+ function B(e, t) {
413
+ let n = D(), [r, i] = T([]), [a, o] = T(!0), [s, c] = T(null), l = x(async () => {
414
+ if (!e) {
415
+ o(!1);
416
+ return;
417
+ }
418
+ o(!0), c(null);
419
+ try {
420
+ i((await n.query({
421
+ query: m,
422
+ variables: {
423
+ productId: e,
424
+ status: t?.status
425
+ },
426
+ fetchPolicy: "cache-first"
427
+ })).data?.productReviews ?? []);
428
+ } catch (e) {
429
+ c(e);
430
+ } finally {
431
+ o(!1);
432
+ }
433
+ }, [
434
+ n,
435
+ e,
436
+ t?.status
437
+ ]);
438
+ return S(() => {
439
+ l();
440
+ }, [l]), {
441
+ reviews: r,
442
+ loading: a,
443
+ error: s,
444
+ refetch: l
445
+ };
446
+ }
447
+ function V(e) {
448
+ let t = D(), [n, r] = T(null), [i, a] = T(!0), [o, s] = T(null), c = x(async () => {
449
+ if (!e) {
450
+ a(!1);
451
+ return;
452
+ }
453
+ a(!0), s(null);
454
+ try {
455
+ r((await t.query({
456
+ query: y,
457
+ variables: { productId: e },
458
+ fetchPolicy: "network-only"
459
+ })).data?.userReviewForProduct ?? null);
460
+ } catch (e) {
461
+ s(e);
462
+ } finally {
463
+ a(!1);
464
+ }
465
+ }, [t, e]);
466
+ return S(() => {
467
+ c();
468
+ }, [c]), {
469
+ review: n,
470
+ loading: i,
471
+ error: o,
472
+ refetch: c
473
+ };
474
+ }
475
+ function H() {
476
+ let e = D(), [t, n] = T(null), [r, i] = T(!1), [o, s] = T(null);
477
+ return {
478
+ createReview: x(async (t) => {
479
+ i(!0), s(null);
480
+ try {
481
+ let r = (await e.mutate({
482
+ mutation: a,
483
+ variables: { input: t }
484
+ })).data?.createReview ?? null;
485
+ return n(r), r;
486
+ } catch (e) {
487
+ return s(e), null;
488
+ } finally {
489
+ i(!1);
490
+ }
491
+ }, [e]),
492
+ review: t,
493
+ loading: r,
494
+ error: o
495
+ };
496
+ }
497
+ function U() {
498
+ let e = D(), [t, n] = T(null), [r, i] = T(!1), [a, o] = T(null);
499
+ return {
500
+ updateReview: x(async (t, r) => {
501
+ i(!0), o(null);
502
+ try {
503
+ let i = (await e.mutate({
504
+ mutation: v,
505
+ variables: {
506
+ id: t,
507
+ input: r
508
+ }
509
+ })).data?.updateReview ?? null;
510
+ return n(i), i;
511
+ } catch (e) {
512
+ return o(e), null;
513
+ } finally {
514
+ i(!1);
515
+ }
516
+ }, [e]),
517
+ review: t,
518
+ loading: r,
519
+ error: a
520
+ };
521
+ }
522
+ function W() {
523
+ let e = D(), [t, n] = T(!1), [r, i] = T(null);
524
+ return {
525
+ deleteReview: x(async (t) => {
526
+ n(!0), i(null);
527
+ try {
528
+ return (await e.mutate({
529
+ mutation: o,
530
+ variables: { id: t }
531
+ })).data?.deleteReview ?? !1;
532
+ } catch (e) {
533
+ return i(e), !1;
534
+ } finally {
535
+ n(!1);
536
+ }
537
+ }, [e]),
538
+ loading: t,
539
+ error: r
540
+ };
541
+ }
542
+ function G() {
543
+ let e = D(), [t, n] = T(!1), [r, i] = T(null);
544
+ return {
545
+ markHelpful: x(async (t) => {
546
+ n(!0), i(null);
547
+ try {
548
+ return (await e.mutate({
549
+ mutation: d,
550
+ variables: { id: t }
551
+ })).data?.markReviewHelpful ?? null;
552
+ } catch (e) {
553
+ return i(e), null;
554
+ } finally {
555
+ n(!1);
556
+ }
557
+ }, [e]),
558
+ loading: t,
559
+ error: r
560
+ };
561
+ }
562
+ function K() {
563
+ let { query: e, hasOrganizationContext: n } = t(), r = E(), [i, a] = T([]), [o, s] = T(!1), [c, l] = T(0), [u, d] = T(!0), [p, m] = T(null), h = x(async (t = 0, i = !1) => {
564
+ d(!0), m(null);
565
+ try {
566
+ let o = {
567
+ limit: 20,
568
+ offset: t
569
+ }, c = (n ? await e({
570
+ query: f,
571
+ variables: o,
572
+ fetchPolicy: "network-only"
573
+ }) : await r.query({
574
+ query: f,
575
+ variables: o,
576
+ fetchPolicy: "network-only"
577
+ })).data?.myEntitlements ?? [];
578
+ a(i ? (e) => [...e, ...c] : c), s(c.length === 20), l(t);
579
+ } catch (e) {
580
+ m(e);
581
+ } finally {
582
+ d(!1);
583
+ }
584
+ }, [
585
+ r,
586
+ n,
587
+ e
588
+ ]);
589
+ return S(() => {
590
+ h(0);
591
+ }, [h]), {
592
+ entitlements: i,
593
+ hasMore: o,
594
+ loading: u,
595
+ error: p,
596
+ refetch: () => h(0),
597
+ loadMore: x(() => {
598
+ !o || u || h(c + 20, !0);
599
+ }, [
600
+ h,
601
+ o,
602
+ u,
603
+ c
604
+ ])
605
+ };
606
+ }
607
+ function q(e) {
608
+ let t = D(), [n, r] = T(null), [a, o] = T(!0), [s, c] = T(null), l = x(async () => {
609
+ if (!e) {
610
+ o(!1);
611
+ return;
612
+ }
613
+ o(!0), c(null);
614
+ try {
615
+ r((await t.query({
616
+ query: i,
617
+ variables: { productId: e },
618
+ fetchPolicy: "network-only"
619
+ })).data?.checkEntitlement ?? null);
620
+ } catch (e) {
621
+ c(e);
622
+ } finally {
623
+ o(!1);
624
+ }
625
+ }, [t, e]);
626
+ return S(() => {
627
+ l();
628
+ }, [l]), {
629
+ entitlement: n,
630
+ loading: a,
631
+ error: s,
632
+ refetch: l
633
+ };
634
+ }
635
+ function J(e, t, n, r) {
636
+ let i = D(), [a, o] = T([]), [s, c] = T(0), [l, u] = T(!0), [d, f] = T(null), p = x(async () => {
637
+ if (!e) {
638
+ u(!1);
639
+ return;
640
+ }
641
+ u(!0), f(null);
642
+ try {
643
+ let a = await i.query({
644
+ query: b,
645
+ variables: {
646
+ billingAccountId: e,
647
+ page: t,
648
+ limit: n,
649
+ status: r?.status,
650
+ search: r?.search
651
+ },
652
+ fetchPolicy: "network-only"
653
+ });
654
+ o(a.data?.workspaceStoreOrders?.orders ?? []), c(a.data?.workspaceStoreOrders?.total ?? 0);
655
+ } catch (e) {
656
+ f(e);
657
+ } finally {
658
+ u(!1);
659
+ }
660
+ }, [
661
+ i,
662
+ e,
663
+ t,
664
+ n,
665
+ r?.status,
666
+ r?.search
667
+ ]);
668
+ return S(() => {
669
+ p();
670
+ }, [p]), {
671
+ orders: a,
672
+ total: s,
673
+ loading: l,
674
+ error: d,
675
+ refetch: p
676
+ };
677
+ }
678
+ function Y() {
679
+ let e = D(), [t, n] = T([]), [r, i] = T(!1), [a, o] = T(0), [s, c] = T(!0), [l, u] = T(null), d = x(async (t = 0, r = !1) => {
680
+ c(!0), u(null);
681
+ try {
682
+ let a = (await e.query({
683
+ query: p,
684
+ variables: {
685
+ limit: 20,
686
+ offset: t
687
+ },
688
+ fetchPolicy: "network-only"
689
+ })).data?.publishedProducts ?? [];
690
+ n(r ? (e) => [...e, ...a] : a), i(a.length === 20), o(t + a.length);
691
+ } catch (e) {
692
+ u(e);
693
+ } finally {
694
+ c(!1);
695
+ }
696
+ }, [e]), f = x(() => {
697
+ !r || s || d(a, !0);
698
+ }, [
699
+ d,
700
+ r,
701
+ s,
702
+ a
703
+ ]);
704
+ return S(() => {
705
+ d(0, !1);
706
+ }, [d]), {
707
+ products: t,
708
+ hasMore: r,
709
+ loading: s,
710
+ error: l,
711
+ refetch: () => d(0, !1),
712
+ loadMore: f
713
+ };
714
+ }
715
+ function X(e) {
716
+ let { query: n, hasOrganizationContext: r } = t(), i = E(), [a, o] = T(null), [c, l] = T(!0), [u, d] = T(null), f = x(async () => {
717
+ l(!0), d(null);
718
+ try {
719
+ o((r ? await n({
720
+ query: s,
721
+ variables: { input: e },
722
+ fetchPolicy: "network-only"
723
+ }) : await i.query({
724
+ query: s,
725
+ variables: { input: e },
726
+ fetchPolicy: "network-only"
727
+ })).data?.developerEarnings ?? null);
728
+ } catch (e) {
729
+ d(e);
730
+ } finally {
731
+ l(!1);
732
+ }
733
+ }, [
734
+ i,
735
+ r,
736
+ e,
737
+ n
738
+ ]);
739
+ return S(() => {
740
+ f();
741
+ }, [f]), {
742
+ earnings: a,
743
+ loading: c,
744
+ error: u,
745
+ refetch: f
746
+ };
747
+ }
748
+ //#endregion
749
+ export { O as useBrowseStore, k as useBrowseStoreWithContext, z as useCategories, q as useCheckEntitlement, H as useCreateReview, W as useDeleteReview, X as useDeveloperEarnings, P as useFeaturedProducts, R as useFilterOptions, N as useHomeGroupedProducts, A as useLazyBrowseStore, I as useLazySearchSuggestions, M as useLazyStoreProductDetails, G as useMarkReviewHelpful, K as useMyEntitlements, Y as useMyPublishedProducts, B as useProductReviews, F as useSearchSuggestions, j as useStoreProductDetails, L as useTrendingSearches, U as useUpdateReview, V as useUserReviewForProduct, J as useWorkspaceStoreOrders };
750
+
751
+ //# sourceMappingURL=useStoreGraphQL.js.map