@burdenoff/microfe-store 2026.625.4 → 2026.625.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.
@@ -1,17 +1,17 @@
1
1
  import { useStore as e } from "../providers/StoreProvider.js";
2
2
  import { useCallback as t, useEffect as n, useReducer as r, useState as i } from "react";
3
- import { AlertCircle as a, Building2 as o, CheckCircle as s, Info as c, Loader2 as l, X as u } from "lucide-react";
4
- import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
5
- import { graphqlFetch as m } from "@burdenoff/fe-libs/shared/graphql";
3
+ import { AlertCircle as a, Building2 as o, CheckCircle as s, Info as c, Loader2 as l, ShieldCheck as u, X as d } from "lucide-react";
4
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
5
+ import { graphqlFetch as h } from "@burdenoff/fe-libs/shared/graphql";
6
6
  //#region src/components/InstallAppModal.tsx
7
- var h = "query MyWorkspaces { myWorkspaces { items { id name slug type status organizationId } total } }", g = "mutation InstallWorkspaceApps($workspaceIds: [ID!]!, $input: InstallWorkspaceAppInput!) { installWorkspaceApps(workspaceIds: $workspaceIds, input: $input) { successCount failedCount results { success workspaceId error } } }", _ = "mutation RecordAppInstallation($input: RecordAppInstallationInput!) { recordAppInstallation(input: $input) { id status workspaceId version } }", v = "mutation InstallPurchasedApp($orderId: ID, $productId: String!, $workspaceId: String!) { installPurchasedApp(orderId: $orderId, productId: $productId, workspaceId: $workspaceId) { success alreadyInstalled installation { id productId workspaceId status version } error message } }", y = "mutation CreateProductEntitlement($input: CreateProductEntitlementInput!) { createProductEntitlement(input: $input) { id status productId workspaceId } }", b = new Set([
7
+ var g = "query MyWorkspaces { myWorkspaces { items { id name slug type status organizationId } total } }", _ = "mutation InstallWorkspaceApps($workspaceIds: [ID!]!, $input: InstallWorkspaceAppInput!) { installWorkspaceApps(workspaceIds: $workspaceIds, input: $input) { successCount failedCount results { success workspaceId error } } }", v = "mutation RecordAppInstallation($input: RecordAppInstallationInput!) { recordAppInstallation(input: $input) { id status workspaceId version } }", y = "mutation InstallPurchasedApp($orderId: ID, $productId: String!, $workspaceId: String!) { installPurchasedApp(orderId: $orderId, productId: $productId, workspaceId: $workspaceId) { success alreadyInstalled installation { id productId workspaceId status version } error message } }", b = "mutation CreateProductEntitlement($input: CreateProductEntitlementInput!) { createProductEntitlement(input: $input) { id status productId workspaceId } }", x = new Set([
8
8
  "VIBEMODULE",
9
9
  "NODE",
10
10
  "CONSOLE",
11
11
  "DASHBOARD",
12
12
  "PARSER",
13
13
  "DATASINK"
14
- ]), x = {
14
+ ]), S = {
15
15
  ALREADY_INSTALLED: "This app is already installed in the selected workspace.",
16
16
  QUOTA_EXCEEDED: "Installation limit reached. Please upgrade your plan or contact support.",
17
17
  PERMISSION_DENIED: "You do not have permission to install apps in this workspace.",
@@ -20,19 +20,19 @@ var h = "query MyWorkspaces { myWorkspaces { items { id name slug type status or
20
20
  ENTITLEMENT_EXPIRED: "Your license for this app has expired.",
21
21
  UNSUPPORTED_TYPE: "This product type cannot be installed in the selected workspace."
22
22
  };
23
- function S(e) {
24
- for (let [t, n] of Object.entries(x)) if (e.toUpperCase().includes(t)) return n;
23
+ function C(e) {
24
+ for (let [t, n] of Object.entries(S)) if (e.toUpperCase().includes(t)) return n;
25
25
  return "Installation failed. Please try again or contact support.";
26
26
  }
27
- var C = {
27
+ var w = {
28
28
  selectedWorkspace: null,
29
29
  installing: !1,
30
30
  installError: null,
31
31
  installInfo: null
32
32
  };
33
- function w(e, t) {
33
+ function T(e, t) {
34
34
  switch (t.type) {
35
- case "reset": return C;
35
+ case "reset": return w;
36
36
  case "selectWorkspace": return {
37
37
  ...e,
38
38
  selectedWorkspace: t.workspaceId
@@ -58,14 +58,14 @@ function w(e, t) {
58
58
  default: return e;
59
59
  }
60
60
  }
61
- function T(r) {
61
+ function E(r) {
62
62
  let { authToken: a } = e(), [o, s] = i([]), [c, l] = i(!1), [u, d] = i(null), f = t(async () => {
63
63
  if (!r) {
64
64
  l(!0), d(null);
65
65
  try {
66
- let e = await m({
66
+ let e = await h({
67
67
  gateway: "global",
68
- query: h,
68
+ query: g,
69
69
  authToken: a || void 0
70
70
  });
71
71
  if (e.errors?.length) throw Error(e.errors[0]?.message ?? "GraphQL error");
@@ -86,268 +86,335 @@ function T(r) {
86
86
  refetch: f
87
87
  };
88
88
  }
89
- var E = ({ isOpen: t, onClose: n, app: i, orderId: h, purchaseState: x = "free", onInstallSuccess: E, onInstallError: D }) => {
90
- let { authToken: O, user: k } = e(), [A, j] = r(w, C), { selectedWorkspace: M, installing: N, installError: P, installInfo: F } = A, { workspaces: I, loading: L, error: R } = T(!t), z = I.filter((e) => e.status === "ACTIVE"), B = async () => {
91
- if (!M) return;
92
- let e = z.find((e) => e.id === M);
89
+ var D = ({ isOpen: t, onClose: g, app: S, orderId: D, purchaseState: O = "free", onInstallSuccess: k, onInstallError: A }) => {
90
+ let { authToken: j, user: M } = e(), [N, P] = r(T, w), { selectedWorkspace: F, installing: I, installError: L, installInfo: R } = N, z = S.requiredPermissions ?? [], [B, V] = i(z.length > 0 ? "permissions" : "workspace");
91
+ n(() => {
92
+ t && (V(z.length > 0 ? "permissions" : "workspace"), P({ type: "reset" }));
93
+ }, [t, z.length]);
94
+ let { workspaces: H, loading: U, error: W } = E(!t || B === "permissions"), G = H.filter((e) => e.status === "ACTIVE"), K = async () => {
95
+ if (!F) return;
96
+ let e = G.find((e) => e.id === F);
93
97
  if (!e) return;
94
- let t = k?.id;
95
- j({ type: "startInstall" });
98
+ let t = M?.id;
99
+ P({ type: "startInstall" });
96
100
  try {
97
- if (!h && x !== "purchased") {
101
+ if (!D && O !== "purchased") {
98
102
  if (!t) throw Error("Unable to identify the current user for license creation");
99
- await m({
103
+ await h({
100
104
  gateway: "global",
101
- query: y,
105
+ query: b,
102
106
  variables: { input: {
103
- productId: i.id,
107
+ productId: S.id,
104
108
  purchasedBy: t,
105
109
  workspaceId: e.id,
106
110
  metadata: {
107
111
  source: "store-ui",
108
- productType: i.type
112
+ productType: S.type
109
113
  }
110
114
  } },
111
- authToken: O || void 0
115
+ authToken: j || void 0
112
116
  });
113
117
  }
114
- let r = await m({
118
+ let n = await h({
115
119
  gateway: "global",
116
- query: v,
120
+ query: y,
117
121
  variables: {
118
- orderId: h ?? null,
119
- productId: i.id,
122
+ orderId: D ?? null,
123
+ productId: S.id,
120
124
  workspaceId: e.id
121
125
  },
122
- authToken: O || void 0
126
+ authToken: j || void 0
123
127
  });
124
- if (r.errors?.length) throw Error(r.errors[0]?.message ?? "Installation failed");
125
- let a = r.data?.installPurchasedApp;
126
- if (a?.success) a.alreadyInstalled ? j({
128
+ if (n.errors?.length) throw Error(n.errors[0]?.message ?? "Installation failed");
129
+ let r = n.data?.installPurchasedApp;
130
+ if (r?.success) r.alreadyInstalled ? P({
127
131
  type: "setInfo",
128
- info: a.message || "Already installed on this workspace"
129
- }) : (E?.(e.id, e.name), n());
132
+ info: r.message || "Already installed on this workspace"
133
+ }) : (k?.(e.id, e.name), g());
130
134
  else {
131
- let e = a?.error || "Installation failed";
132
- j({
135
+ let e = r?.error || "Installation failed";
136
+ P({
133
137
  type: "setError",
134
- error: S(e)
135
- }), D?.(Error(e));
138
+ error: C(e)
139
+ }), A?.(Error(e));
136
140
  }
137
141
  } catch (e) {
138
142
  let t = e instanceof Error ? e.message : "Installation failed";
139
- j({
143
+ P({
140
144
  type: "setError",
141
- error: S(t)
142
- }), D?.(Error(t));
145
+ error: C(t)
146
+ }), A?.(Error(t));
143
147
  } finally {
144
- j({ type: "finishInstall" });
148
+ P({ type: "finishInstall" });
145
149
  }
146
- }, V = async () => {
147
- if (!M) return;
148
- let e = z.find((e) => e.id === M);
150
+ }, q = async () => {
151
+ if (!F) return;
152
+ let e = G.find((e) => e.id === F);
149
153
  if (e) {
150
- j({ type: "startInstall" });
154
+ P({ type: "startInstall" });
151
155
  try {
152
- let t = await m({
156
+ let t = await h({
153
157
  gateway: "workspace",
154
- query: g,
158
+ query: _,
155
159
  variables: {
156
160
  workspaceIds: [e.id],
157
161
  input: {
158
- appName: i.slug || i.name.toLowerCase().replace(/\s+/g, "-"),
159
- displayName: i.name,
160
- version: i.version || "1.0.0",
161
- type: i.type || "app",
162
+ appName: S.slug || S.name.toLowerCase().replace(/\s+/g, "-"),
163
+ displayName: S.name,
164
+ version: S.version || "1.0.0",
165
+ type: S.type || "app",
162
166
  manifest: {
163
- productId: i.id,
164
- icon: i.icon
167
+ productId: S.id,
168
+ icon: S.icon
165
169
  }
166
170
  }
167
171
  },
168
- authToken: O || void 0,
172
+ authToken: j || void 0,
169
173
  workspaceId: e.id,
170
174
  workspaceToken: !0
171
175
  });
172
176
  if (t.errors?.length) throw Error(t.errors[0]?.message ?? "Installation failed");
173
- let r = t.data?.installWorkspaceApps;
174
- if (r?.successCount && r.successCount > 0) {
177
+ let n = t.data?.installWorkspaceApps;
178
+ if (n?.successCount && n.successCount > 0) {
175
179
  try {
176
- await m({
180
+ await h({
177
181
  gateway: "global",
178
- query: _,
182
+ query: v,
179
183
  variables: { input: {
180
- productId: i.id,
184
+ productId: S.id,
181
185
  workspaceId: e.id,
182
186
  workspaceName: e.name,
183
187
  workspaceType: e.type,
184
188
  organizationId: e.organizationId,
185
- version: i.version || "1.0.0",
189
+ version: S.version || "1.0.0",
186
190
  manifest: {
187
- productId: i.id,
188
- icon: i.icon,
189
- slug: i.slug,
190
- type: i.type
191
+ productId: S.id,
192
+ icon: S.icon,
193
+ slug: S.slug,
194
+ type: S.type
191
195
  }
192
196
  } },
193
- authToken: O || void 0
197
+ authToken: j || void 0
194
198
  });
195
199
  } catch {}
196
- E?.(e.id, e.name), n();
200
+ k?.(e.id, e.name), g();
197
201
  } else {
198
- let e = r?.results?.[0]?.error || "Installation failed";
199
- j({
202
+ let e = n?.results?.[0]?.error || "Installation failed";
203
+ P({
200
204
  type: "setError",
201
- error: S(e)
202
- }), D?.(Error(e));
205
+ error: C(e)
206
+ }), A?.(Error(e));
203
207
  }
204
208
  } catch (e) {
205
209
  let t = e instanceof Error ? e.message : "Installation failed";
206
- j({
210
+ P({
207
211
  type: "setError",
208
- error: S(t)
209
- }), D?.(Error(t));
212
+ error: C(t)
213
+ }), A?.(Error(t));
210
214
  } finally {
211
- j({ type: "finishInstall" });
215
+ P({ type: "finishInstall" });
212
216
  }
213
217
  }
218
+ }, J = async () => {
219
+ let e = S.type?.toUpperCase() ?? "";
220
+ O === "purchased" || D || x.has(e) ? await K() : await q();
214
221
  };
215
- return t ? /* @__PURE__ */ p("div", {
222
+ if (!t) return null;
223
+ let Y = B === "permissions" ? "Review Permissions" : "Install App";
224
+ return /* @__PURE__ */ m("div", {
216
225
  className: "fixed inset-0 z-50 flex items-center justify-center",
217
- children: [/* @__PURE__ */ f("button", {
226
+ children: [/* @__PURE__ */ p("button", {
218
227
  type: "button",
219
228
  "aria-label": "Close modal",
220
229
  className: "absolute inset-0 bg-bg-overlay/50 backdrop-blur-sm",
221
- onClick: n
222
- }), /* @__PURE__ */ p("dialog", {
230
+ onClick: g
231
+ }), /* @__PURE__ */ m("dialog", {
223
232
  open: !0,
224
233
  "aria-modal": "true",
225
234
  "aria-labelledby": "install-app-modal-title",
226
235
  className: "relative z-10 mx-4 w-full max-w-lg rounded-2xl border border-border-default bg-bg-surface shadow-2xl",
227
236
  children: [
228
- /* @__PURE__ */ p("div", {
237
+ /* @__PURE__ */ m("div", {
229
238
  className: "flex items-center justify-between border-b border-border-default px-6 py-4",
230
- children: [/* @__PURE__ */ p("div", {
239
+ children: [/* @__PURE__ */ m("div", {
231
240
  className: "flex items-center gap-3",
232
- children: [i.icon ? /* @__PURE__ */ f("img", {
233
- src: i.icon,
234
- alt: i.name,
241
+ children: [S.icon ? /* @__PURE__ */ p("img", {
242
+ src: S.icon,
243
+ alt: S.name,
235
244
  className: "size-10 rounded-lg object-cover"
236
- }) : /* @__PURE__ */ f("div", {
245
+ }) : /* @__PURE__ */ p("div", {
237
246
  className: "flex size-10 items-center justify-center rounded-lg bg-bg-sunken text-lg font-bold text-text-muted",
238
- children: i.name.charAt(0)
239
- }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h2", {
247
+ children: S.name.charAt(0)
248
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h2", {
240
249
  id: "install-app-modal-title",
241
250
  className: "text-lg font-semibold text-text-primary",
242
- children: "Install App"
243
- }), /* @__PURE__ */ f("p", {
251
+ children: Y
252
+ }), /* @__PURE__ */ p("p", {
244
253
  className: "text-sm text-text-muted",
245
- children: i.name
254
+ children: S.name
246
255
  })] })]
247
- }), /* @__PURE__ */ f("button", {
256
+ }), /* @__PURE__ */ p("button", {
248
257
  type: "button",
249
- onClick: n,
258
+ onClick: g,
250
259
  "aria-label": "Close install dialog",
251
260
  className: "cursor-pointer rounded-lg p-2 text-text-muted transition-colors hover:bg-bg-sunken hover:text-text-primary",
252
- children: /* @__PURE__ */ f(u, { className: "size-5" })
261
+ children: /* @__PURE__ */ p(d, { className: "size-5" })
253
262
  })]
254
263
  }),
255
- /* @__PURE__ */ p("div", {
264
+ B === "permissions" && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ m("div", {
256
265
  className: "px-6 py-4",
257
- children: [/* @__PURE__ */ f("p", {
258
- className: "mb-4 text-text-secondary",
259
- children: "Select the workspace where you want to install this app:"
260
- }), /* @__PURE__ */ f("div", {
261
- className: "max-h-72 overflow-y-auto rounded-lg border border-border-default",
262
- children: L ? /* @__PURE__ */ f("div", {
263
- className: "flex items-center justify-center py-12",
264
- children: /* @__PURE__ */ f(l, { className: "size-8 animate-spin text-text-muted" })
265
- }) : R ? /* @__PURE__ */ p("div", {
266
- className: "flex flex-col items-center justify-center py-12 text-center",
267
- children: [
268
- /* @__PURE__ */ f(a, { className: "mb-2 size-8 text-status-error-text" }),
269
- /* @__PURE__ */ f("p", {
270
- className: "text-sm text-status-error-text",
271
- children: "Failed to load workspaces"
272
- }),
273
- /* @__PURE__ */ f("p", {
274
- className: "text-xs text-text-muted mt-1",
275
- children: R.message
276
- })
277
- ]
278
- }) : z.length === 0 ? /* @__PURE__ */ p("div", {
279
- className: "flex flex-col items-center justify-center py-12 text-center",
280
- children: [/* @__PURE__ */ f(o, { className: "mb-2 size-8 text-text-muted" }), /* @__PURE__ */ f("p", {
281
- className: "text-sm text-text-muted",
282
- children: "No workspaces available"
283
- })]
284
- }) : /* @__PURE__ */ f("div", {
285
- className: "divide-y divide-border-default",
286
- children: z.map((e) => /* @__PURE__ */ p("button", {
287
- type: "button",
288
- onClick: () => j({
289
- type: "selectWorkspace",
290
- workspaceId: e.id
291
- }),
292
- className: `w-full cursor-pointer flex items-center gap-3 px-4 py-3 text-left transition-colors ${M === e.id ? "bg-action-primary-bg/10" : "transition-colors hover:bg-bg-sunken"}`,
266
+ children: [
267
+ /* @__PURE__ */ m("p", {
268
+ className: "mb-1 text-sm text-text-secondary",
269
+ children: [/* @__PURE__ */ p("span", {
270
+ className: "font-medium text-text-primary",
271
+ children: S.name
272
+ }), " requests access to the following data in your workspace. You must accept to continue."]
273
+ }),
274
+ /* @__PURE__ */ p("div", {
275
+ className: "mt-4 max-h-72 overflow-y-auto space-y-2",
276
+ children: z.map((e) => /* @__PURE__ */ m("div", {
277
+ className: "flex items-center gap-3 rounded-lg bg-bg-sunken px-4 py-3",
278
+ children: [/* @__PURE__ */ p(u, { className: "size-5 flex-shrink-0 text-status-success-text" }), /* @__PURE__ */ p("span", {
279
+ className: "text-sm text-text-primary",
280
+ children: e
281
+ })]
282
+ }, e))
283
+ }),
284
+ /* @__PURE__ */ p("p", {
285
+ className: "mt-3 text-xs text-text-muted",
286
+ children: "These permissions will be recorded. You will be notified if they change in a future version."
287
+ })
288
+ ]
289
+ }), /* @__PURE__ */ m("div", {
290
+ className: "border-t border-border-default px-6 py-4 flex items-center justify-end gap-3",
291
+ children: [/* @__PURE__ */ p("button", {
292
+ type: "button",
293
+ onClick: g,
294
+ className: "cursor-pointer rounded-lg border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
295
+ children: "Cancel"
296
+ }), /* @__PURE__ */ m("button", {
297
+ type: "button",
298
+ onClick: () => V("workspace"),
299
+ className: "cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-opacity hover:opacity-90 inline-flex items-center gap-2",
300
+ children: [/* @__PURE__ */ p(s, { className: "size-4" }), "Accept & Continue"]
301
+ })]
302
+ })] }),
303
+ B === "workspace" && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ m("div", {
304
+ className: "px-6 py-4",
305
+ children: [
306
+ z.length > 0 && /* @__PURE__ */ m("div", {
307
+ className: "mb-3 flex items-center gap-2 rounded-lg bg-status-success-bg-subtle px-3 py-2 text-sm text-status-success-text",
308
+ children: [/* @__PURE__ */ p(s, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ m("span", { children: [
309
+ "Permissions accepted (",
310
+ z.length,
311
+ " permission",
312
+ z.length === 1 ? "" : "s",
313
+ ")"
314
+ ] })]
315
+ }),
316
+ /* @__PURE__ */ p("p", {
317
+ className: "mb-4 text-text-secondary",
318
+ children: "Select the workspace where you want to install this app:"
319
+ }),
320
+ /* @__PURE__ */ p("div", {
321
+ className: "max-h-64 overflow-y-auto rounded-lg border border-border-default",
322
+ children: U ? /* @__PURE__ */ p("div", {
323
+ className: "flex items-center justify-center py-12",
324
+ children: /* @__PURE__ */ p(l, { className: "size-8 animate-spin text-text-muted" })
325
+ }) : W ? /* @__PURE__ */ m("div", {
326
+ className: "flex flex-col items-center justify-center py-12 text-center",
293
327
  children: [
294
- /* @__PURE__ */ f("div", {
295
- className: "flex size-10 items-center justify-center rounded-lg bg-action-primary-bg/10 text-text-link",
296
- children: /* @__PURE__ */ f(o, { className: "size-5" })
297
- }),
298
- /* @__PURE__ */ p("div", {
299
- className: "flex-1 min-w-0",
300
- children: [/* @__PURE__ */ f("p", {
301
- className: "font-medium text-text-primary truncate",
302
- children: e.name
303
- }), e.slug ? /* @__PURE__ */ p("p", {
304
- className: "text-xs text-text-muted truncate",
305
- children: ["/", e.slug]
306
- }) : null]
328
+ /* @__PURE__ */ p(a, { className: "mb-2 size-8 text-status-error-text" }),
329
+ /* @__PURE__ */ p("p", {
330
+ className: "text-sm text-status-error-text",
331
+ children: "Failed to load workspaces"
307
332
  }),
308
- M === e.id && /* @__PURE__ */ f(s, { className: "size-5 flex-shrink-0 text-action-primary-bg" })
333
+ /* @__PURE__ */ p("p", {
334
+ className: "text-xs text-text-muted mt-1",
335
+ children: W.message
336
+ })
309
337
  ]
310
- }, e.id))
338
+ }) : G.length === 0 ? /* @__PURE__ */ m("div", {
339
+ className: "flex flex-col items-center justify-center py-12 text-center",
340
+ children: [/* @__PURE__ */ p(o, { className: "mb-2 size-8 text-text-muted" }), /* @__PURE__ */ p("p", {
341
+ className: "text-sm text-text-muted",
342
+ children: "No workspaces available"
343
+ })]
344
+ }) : /* @__PURE__ */ p("div", {
345
+ className: "divide-y divide-border-default",
346
+ children: G.map((e) => /* @__PURE__ */ m("button", {
347
+ type: "button",
348
+ onClick: () => P({
349
+ type: "selectWorkspace",
350
+ workspaceId: e.id
351
+ }),
352
+ className: `w-full cursor-pointer flex items-center gap-3 px-4 py-3 text-left transition-colors ${F === e.id ? "bg-action-primary-bg/10" : "transition-colors hover:bg-bg-sunken"}`,
353
+ children: [
354
+ /* @__PURE__ */ p("div", {
355
+ className: "flex size-10 items-center justify-center rounded-lg bg-action-primary-bg/10 text-text-link",
356
+ children: /* @__PURE__ */ p(o, { className: "size-5" })
357
+ }),
358
+ /* @__PURE__ */ m("div", {
359
+ className: "flex-1 min-w-0",
360
+ children: [/* @__PURE__ */ p("p", {
361
+ className: "font-medium text-text-primary truncate",
362
+ children: e.name
363
+ }), e.slug ? /* @__PURE__ */ m("p", {
364
+ className: "text-xs text-text-muted truncate",
365
+ children: ["/", e.slug]
366
+ }) : null]
367
+ }),
368
+ F === e.id && /* @__PURE__ */ p(s, { className: "size-5 flex-shrink-0 text-action-primary-bg" })
369
+ ]
370
+ }, e.id))
371
+ })
311
372
  })
312
- })]
313
- }),
314
- /* @__PURE__ */ p("div", {
373
+ ]
374
+ }), /* @__PURE__ */ m("div", {
315
375
  className: "border-t border-border-default px-6 py-4",
316
376
  children: [
317
- F && /* @__PURE__ */ p("div", {
377
+ R && /* @__PURE__ */ m("div", {
318
378
  className: "mb-3 flex items-center gap-2 rounded-lg bg-status-info-bg-subtle px-3 py-2 text-sm text-status-info-text",
319
- children: [/* @__PURE__ */ f(c, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ f("span", { children: F })]
379
+ children: [/* @__PURE__ */ p(c, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ p("span", { children: R })]
320
380
  }),
321
- P && /* @__PURE__ */ p("div", {
381
+ L && /* @__PURE__ */ m("div", {
322
382
  className: "mb-3 flex items-center gap-2 rounded-lg bg-status-error-bg-subtle/10 px-3 py-2 text-sm text-status-error-text",
323
- children: [/* @__PURE__ */ f(a, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ f("span", { children: P })]
383
+ children: [/* @__PURE__ */ p(a, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ p("span", { children: L })]
324
384
  }),
325
- /* @__PURE__ */ p("div", {
385
+ /* @__PURE__ */ m("div", {
326
386
  className: "flex items-center justify-end gap-3",
327
- children: [/* @__PURE__ */ f("button", {
328
- type: "button",
329
- onClick: n,
330
- disabled: N,
331
- className: "cursor-pointer rounded-lg border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50",
332
- children: "Cancel"
333
- }), /* @__PURE__ */ f("button", {
334
- type: "button",
335
- onClick: async () => {
336
- let e = i.type?.toUpperCase() ?? "";
337
- x === "purchased" || h || b.has(e) ? await B() : await V();
338
- },
339
- disabled: !M || N,
340
- className: "cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-opacity hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center gap-2",
341
- children: N ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(l, { className: "size-4 animate-spin" }), "Installing…"] }) : "Install App"
342
- })]
387
+ children: [
388
+ z.length > 0 && /* @__PURE__ */ p("button", {
389
+ type: "button",
390
+ onClick: () => V("permissions"),
391
+ disabled: I,
392
+ className: "cursor-pointer rounded-lg border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50",
393
+ children: "Back"
394
+ }),
395
+ /* @__PURE__ */ p("button", {
396
+ type: "button",
397
+ onClick: g,
398
+ disabled: I,
399
+ className: "cursor-pointer rounded-lg border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50",
400
+ children: "Cancel"
401
+ }),
402
+ /* @__PURE__ */ p("button", {
403
+ type: "button",
404
+ onClick: J,
405
+ disabled: !F || I,
406
+ className: "cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-opacity hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center gap-2",
407
+ children: I ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(l, { className: "size-4 animate-spin" }), "Installing…"] }) : "Install App"
408
+ })
409
+ ]
343
410
  })
344
411
  ]
345
- })
412
+ })] })
346
413
  ]
347
414
  })]
348
- }) : null;
415
+ });
349
416
  };
350
417
  //#endregion
351
- export { E as InstallAppModal };
418
+ export { D as InstallAppModal };
352
419
 
353
420
  //# sourceMappingURL=InstallAppModal.js.map