@burdenoff/microfe-timecampus 2026.1123.1 → 2026.1124.2

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 (26) hide show
  1. package/dist/generated/wspace-operations.d.ts +977 -1
  2. package/dist/generated/wspace-operations.js +1749 -1458
  3. package/dist/generated/wspace-operations.js.map +1 -1
  4. package/dist/generated/wspace-types.d.ts +241 -1
  5. package/dist/generated/wspace-types.js +8 -6
  6. package/dist/generated/wspace-types.js.map +1 -1
  7. package/dist/index.js +8 -8
  8. package/dist/timecampus/index.js +2 -2
  9. package/dist/timecampus/pages/channels/ChannelsPage.js +10 -8
  10. package/dist/timecampus/pages/channels/ChannelsPage.js.map +1 -1
  11. package/dist/timecampus/pages/channels/channelCatalog.d.ts +2 -10
  12. package/dist/timecampus/pages/channels/channelCatalog.js +5 -5
  13. package/dist/timecampus/pages/channels/channelCatalog.js.map +1 -1
  14. package/dist/timecampus/pages/extend/AppletDeveloperPage.js +519 -245
  15. package/dist/timecampus/pages/extend/AppletDeveloperPage.js.map +1 -1
  16. package/dist/timecampus/pages/extend/MarketplaceCertificationPage.js +147 -113
  17. package/dist/timecampus/pages/extend/MarketplaceCertificationPage.js.map +1 -1
  18. package/dist/timecampus/pages/extend/SandboxedAppletWidget.d.ts +2 -0
  19. package/dist/timecampus/pages/extend/SandboxedAppletWidget.js +3 -1
  20. package/dist/timecampus/pages/extend/SandboxedAppletWidget.js.map +1 -1
  21. package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js +369 -120
  22. package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js.map +1 -1
  23. package/dist/timecampus/pages/extend/appletPublishingHelpers.d.ts +10 -0
  24. package/dist/timecampus/pages/extend/appletPublishingHelpers.js +74 -16
  25. package/dist/timecampus/pages/extend/appletPublishingHelpers.js.map +1 -1
  26. package/package.json +1 -1
@@ -5,118 +5,209 @@ import { EmptyState as r } from "../../components/EmptyState.js";
5
5
  import { ToastContainer as i, useToast as a } from "../../components/Toast.js";
6
6
  import { formatDate as o } from "../../utils/helpers.js";
7
7
  import { useTimeCampus as s } from "../../providers/TimeCampusProvider.js";
8
- import { useAddThirdPartyAppletVersionMutation as c, useArchiveThirdPartyAppletMutation as l, useCreateThirdPartyAppletMutation as u, useDelistAppletFromMarketplaceMutation as d, useListAppletDataScopesQuery as f, useListMyThirdPartyAppletsQuery as p, useSubmitAppletToMarketplaceMutation as ee, useSubmitThirdPartyAppletVersionMutation as m, useUpdateThirdPartyAppletVersionMutation as h, useValidateAppletManifestLazyQuery as g, useWithdrawAppletFromMarketplaceMutation as te, useWithdrawThirdPartyAppletVersionMutation as ne } from "../../../generated/wspace-operations.js";
9
- import { catalogueIcon as _ } from "./extendHelpers.js";
10
- import { appletStatus as v, errorText as y, manifestForNextVersion as b, manifestText as re, marketplaceOffer as x, parseManifestText as S, starterManifest as C } from "./appletPublishingHelpers.js";
11
- import { useMemo as w, useState as T } from "react";
12
- import { CheckCircle2 as E, FilePlus2 as D, Globe as O, Pencil as k, Send as A, Trash2 as j, Undo2 as M } from "lucide-react";
13
- import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
14
- import { GlassCard as I } from "@burdenoff/fe-libs/ui";
8
+ import { useAddThirdPartyAppletVersionMutation as c, useArchiveThirdPartyAppletMutation as l, useCreateThirdPartyAppletMutation as u, useDelistAppletFromMarketplaceMutation as d, useGetMarketplaceDeveloperRevenueQuery as f, useListAppletDataScopesQuery as p, useListMyThirdPartyAppletsQuery as m, useRelistMarketplaceListingMutation as h, useSetMarketplacePricingMutation as g, useSubmitAppletToMarketplaceMutation as _, useSubmitThirdPartyAppletVersionMutation as v, useUnlistMarketplaceListingMutation as ee, useUpdateThirdPartyAppletVersionMutation as te, useValidateAppletManifestLazyQuery as y, useWithdrawAppletFromMarketplaceMutation as ne, useWithdrawThirdPartyAppletVersionMutation as re } from "../../../generated/wspace-operations.js";
9
+ import { TimeCampusMarketplacePricingModel as b } from "../../../generated/wspace-types.js";
10
+ import { catalogueIcon as x } from "./extendHelpers.js";
11
+ import { appletStatus as S, developerSharePercent as C, errorText as w, formatAppletPrice as T, formatUsd as E, manifestForNextVersion as ie, manifestText as ae, marketplaceOffer as D, parseManifestText as oe, starterManifest as O } from "./appletPublishingHelpers.js";
12
+ import { useMemo as se, useState as k } from "react";
13
+ import { CheckCircle2 as ce, DollarSign as A, ExternalLink as le, EyeOff as j, FilePlus2 as M, Globe as N, Pencil as P, RotateCcw as F, Send as I, Trash2 as L, Undo2 as R } from "lucide-react";
14
+ import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
15
+ import { GlassCard as H } from "@burdenoff/fe-libs/ui";
15
16
  // src/timecampus/pages/extend/AppletDeveloperPage.tsx
16
- var L = ["ListMyThirdPartyApplets"], R = "inline-flex items-center justify-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50", z = "inline-flex items-center justify-center gap-1.5 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-surface-hover disabled:opacity-50";
17
- function B(e) {
17
+ var U = ["ListMyThirdPartyApplets", "GetMarketplaceDeveloperRevenue"], W = "inline-flex items-center justify-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50", G = "inline-flex items-center justify-center gap-1.5 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-surface-hover disabled:opacity-50";
18
+ function K(e) {
18
19
  return e.kind === "new" ? "Register a new applet" : e.kind === "version" ? `New version of ${e.appletName}` : `Edit ${e.appletName} v${e.version}`;
19
20
  }
20
- function V(e) {
21
+ function ue(e) {
21
22
  return e.kind === "new" ? "Register applet" : e.kind === "version" ? "Add version" : "Save draft";
22
23
  }
23
- function H({ applet: e, busy: n, onOffer: r, onWithdraw: i, onDelist: a }) {
24
- let s = e.marketplace, c = x(e), l = s?.latestSubmission, u = s ? v(s.status) : null, d = l ? v(l.status) : null;
25
- return /* @__PURE__ */ F("div", {
24
+ function q({ applet: e, busy: n, onOffer: r, onWithdraw: i, onSavePricing: a, onUnlist: s, onRelist: c, onDelist: l }) {
25
+ let u = e.marketplace, d = D(e), f = u?.latestSubmission, p = u ? S(u.status) : null, m = f ? S(f.status) : null, [h, g] = k(u?.pricingModel ?? b.Free), [_, v] = k(u && u.priceUsd > 0 ? u.priceUsd.toFixed(2) : "9.00");
26
+ return /* @__PURE__ */ V("div", {
26
27
  className: "flex flex-col gap-2 rounded-md border border-border-subtle bg-bg-sunken/40 p-3",
27
28
  "data-testid": `developer-marketplace-${e.key}`,
28
29
  children: [
29
- /* @__PURE__ */ F("div", {
30
+ /* @__PURE__ */ V("div", {
30
31
  className: "flex flex-wrap items-center gap-2",
31
32
  children: [
32
- /* @__PURE__ */ P(O, {
33
+ /* @__PURE__ */ B(N, {
33
34
  className: "h-4 w-4 text-text-tertiary",
34
35
  "aria-hidden": "true"
35
36
  }),
36
- /* @__PURE__ */ P("p", {
37
+ /* @__PURE__ */ B("p", {
37
38
  className: "text-sm font-medium text-text-primary",
38
39
  children: "Public marketplace"
39
40
  }),
40
- u && /* @__PURE__ */ P(t, {
41
- label: u.label,
42
- variant: u.variant,
41
+ p && /* @__PURE__ */ B(t, {
42
+ label: p.label,
43
+ variant: p.variant,
43
44
  dot: !0
45
+ }),
46
+ u && /* @__PURE__ */ B(t, {
47
+ label: T(u.pricingModel, u.priceUsd),
48
+ variant: u.pricingModel === b.Free ? "muted" : "info"
44
49
  })
45
50
  ]
46
51
  }),
47
- s ? /* @__PURE__ */ F(N, { children: [
48
- s.liveSubmission && /* @__PURE__ */ F("p", {
52
+ u ? /* @__PURE__ */ V(z, { children: [
53
+ u.liveSubmission && /* @__PURE__ */ V("p", {
49
54
  className: "text-xs text-text-secondary",
50
55
  children: [
51
56
  "v",
52
- s.liveSubmission.version,
53
- " is live in the marketplace",
54
- s.liveSubmission.certifiedAt ? ` since ${o(s.liveSubmission.certifiedAt)}` : "",
55
- "."
57
+ u.liveSubmission.version,
58
+ " is",
59
+ " ",
60
+ u.status === "UNLISTED" ? "unlisted (existing installs keep working)" : "live in the marketplace",
61
+ u.liveSubmission.certifiedAt ? ` since ${o(u.liveSubmission.certifiedAt)}` : "",
62
+ ". Revenue share:",
63
+ " ",
64
+ C(u.platformFeeRateBps),
65
+ "% developer /",
66
+ " ",
67
+ 100 - C(u.platformFeeRateBps),
68
+ "% platform."
56
69
  ]
57
70
  }),
58
- l && d && l.id !== s.liveSubmission?.id && /* @__PURE__ */ F("p", {
71
+ f && m && f.id !== u.liveSubmission?.id && /* @__PURE__ */ V("p", {
59
72
  className: "flex flex-wrap items-center gap-2 text-xs text-text-secondary",
60
73
  children: [
61
74
  "Latest submission v",
62
- l.version,
63
- /* @__PURE__ */ P(t, {
64
- label: d.label,
65
- variant: d.variant
75
+ f.version,
76
+ /* @__PURE__ */ B(t, {
77
+ label: m.label,
78
+ variant: m.variant
66
79
  })
67
80
  ]
68
81
  }),
69
- l?.reviewNotes && /* @__PURE__ */ F("p", {
82
+ f?.reviewNotes && /* @__PURE__ */ V("p", {
70
83
  className: "text-xs text-text-secondary",
71
- children: ["Platform reviewer notes: ", l.reviewNotes]
84
+ children: ["Platform reviewer notes: ", f.reviewNotes]
72
85
  }),
73
- s.suspendedReason && /* @__PURE__ */ F("p", {
86
+ u.suspendedReason && /* @__PURE__ */ V("p", {
74
87
  className: "text-xs text-status-warning-text",
75
- children: ["Suspended by the platform: ", s.suspendedReason]
88
+ children: [
89
+ u.status === "REVOKED" ? "Permanently revoked by the platform" : "Suspended by the platform",
90
+ ": ",
91
+ u.suspendedReason
92
+ ]
93
+ }),
94
+ /* @__PURE__ */ V("div", {
95
+ className: "mt-1 flex flex-wrap items-end gap-2 rounded-md border border-border-subtle bg-bg-surface p-2.5",
96
+ children: [
97
+ /* @__PURE__ */ V("label", {
98
+ className: "flex flex-col gap-1 text-xs text-text-secondary",
99
+ children: ["Pricing model", /* @__PURE__ */ V("select", {
100
+ value: h,
101
+ onChange: (e) => g(e.target.value),
102
+ "aria-label": `Pricing model for ${e.name}`,
103
+ className: "rounded-md border border-border-subtle bg-bg-surface px-2 py-1 text-xs text-text-primary",
104
+ children: [
105
+ /* @__PURE__ */ B("option", {
106
+ value: b.Free,
107
+ children: "Free"
108
+ }),
109
+ /* @__PURE__ */ B("option", {
110
+ value: b.OneTime,
111
+ children: "One-time (USD)"
112
+ }),
113
+ /* @__PURE__ */ B("option", {
114
+ value: b.PerSeatMonthly,
115
+ children: "Per seat / month (USD)"
116
+ })
117
+ ]
118
+ })]
119
+ }),
120
+ h !== b.Free && /* @__PURE__ */ V("label", {
121
+ className: "flex flex-col gap-1 text-xs text-text-secondary",
122
+ children: ["Price (USD, min $1.00)", /* @__PURE__ */ B("input", {
123
+ type: "number",
124
+ min: 1,
125
+ max: 1e4,
126
+ step: "0.01",
127
+ value: _,
128
+ onChange: (e) => v(e.target.value),
129
+ "aria-label": `USD price for ${e.name}`,
130
+ className: "w-28 rounded-md border border-border-subtle bg-bg-surface px-2 py-1 text-xs text-text-primary"
131
+ })]
132
+ }),
133
+ /* @__PURE__ */ V("button", {
134
+ type: "button",
135
+ className: G,
136
+ disabled: n,
137
+ onClick: () => {
138
+ let e = h === b.Free ? 0 : Number.parseFloat(_);
139
+ a(h, Number.isFinite(e) ? e : 0);
140
+ },
141
+ children: [/* @__PURE__ */ B(A, {
142
+ className: "h-3.5 w-3.5",
143
+ "aria-hidden": "true"
144
+ }), "Save pricing"]
145
+ })
146
+ ]
76
147
  })
77
- ] }) : /* @__PURE__ */ P("p", {
148
+ ] }) : /* @__PURE__ */ B("p", {
78
149
  className: "text-xs text-text-secondary",
79
150
  children: "Offer this applet to every TimeCampus workspace. The TimeCampus platform team certifies each version before other workspaces can install it."
80
151
  }),
81
- /* @__PURE__ */ F("div", {
152
+ /* @__PURE__ */ V("div", {
82
153
  className: "flex flex-wrap gap-2",
83
154
  children: [
84
- c.canOffer ? /* @__PURE__ */ F("button", {
155
+ d.canOffer ? /* @__PURE__ */ V("button", {
85
156
  type: "button",
86
- className: z,
157
+ className: G,
87
158
  disabled: n,
88
159
  onClick: r,
89
- "aria-label": `Offer ${e.name} v${c.version} in the marketplace`,
160
+ "aria-label": `Offer ${e.name} v${d.version} in the marketplace`,
90
161
  children: [
91
- /* @__PURE__ */ P(O, {
162
+ /* @__PURE__ */ B(N, {
92
163
  className: "h-4 w-4",
93
164
  "aria-hidden": "true"
94
165
  }),
95
166
  "Offer v",
96
- c.version,
167
+ d.version,
97
168
  " in the marketplace"
98
169
  ]
99
- }) : /* @__PURE__ */ P("p", {
170
+ }) : /* @__PURE__ */ B("p", {
100
171
  className: "text-xs text-text-tertiary",
101
- children: c.reason
172
+ children: d.reason
102
173
  }),
103
- l?.status === "IN_REVIEW" && /* @__PURE__ */ F("button", {
174
+ f?.status === "IN_REVIEW" && /* @__PURE__ */ V("button", {
104
175
  type: "button",
105
- className: z,
176
+ className: G,
106
177
  disabled: n,
107
178
  onClick: i,
108
- children: [/* @__PURE__ */ P(M, {
179
+ children: [/* @__PURE__ */ B(R, {
109
180
  className: "h-4 w-4",
110
181
  "aria-hidden": "true"
111
182
  }), "Withdraw from certification"]
112
183
  }),
113
- s && /* @__PURE__ */ F("button", {
184
+ u?.status === "PUBLISHED" && /* @__PURE__ */ V("button", {
185
+ type: "button",
186
+ className: G,
187
+ disabled: n,
188
+ onClick: s,
189
+ children: [/* @__PURE__ */ B(j, {
190
+ className: "h-4 w-4",
191
+ "aria-hidden": "true"
192
+ }), "Unlist"]
193
+ }),
194
+ u?.status === "UNLISTED" && /* @__PURE__ */ V("button", {
195
+ type: "button",
196
+ className: G,
197
+ disabled: n,
198
+ onClick: c,
199
+ children: [/* @__PURE__ */ B(F, {
200
+ className: "h-4 w-4",
201
+ "aria-hidden": "true"
202
+ }), "Re-list"]
203
+ }),
204
+ u && /* @__PURE__ */ V("button", {
114
205
  type: "button",
115
- className: z,
206
+ className: G,
116
207
  disabled: n,
117
- onClick: a,
208
+ onClick: l,
118
209
  "aria-label": `Remove ${e.name} from the marketplace`,
119
- children: [/* @__PURE__ */ P(j, {
210
+ children: [/* @__PURE__ */ B(L, {
120
211
  className: "h-4 w-4",
121
212
  "aria-hidden": "true"
122
213
  }), "Remove from marketplace"]
@@ -126,108 +217,108 @@ function H({ applet: e, busy: n, onOffer: r, onWithdraw: i, onDelist: a }) {
126
217
  ]
127
218
  });
128
219
  }
129
- function U({ applet: e, busy: n, onEditVersion: r, onNewVersion: i, onSubmit: a, onWithdraw: s, onArchive: c, marketplace: l }) {
130
- let u = _(e.icon), d = v(e.status), f = e.versions.some((e) => e.status === "DRAFT" || e.status === "IN_REVIEW");
131
- return /* @__PURE__ */ F(I, {
220
+ function de({ applet: e, busy: n, onEditVersion: r, onNewVersion: i, onSubmit: a, onWithdraw: s, onArchive: c, marketplace: l }) {
221
+ let u = x(e.icon), d = S(e.status), f = e.versions.some((e) => e.status === "DRAFT" || e.status === "IN_REVIEW");
222
+ return /* @__PURE__ */ V(H, {
132
223
  treatment: "glass",
133
224
  className: "flex flex-col gap-3 p-5",
134
225
  "data-testid": `developer-applet-${e.key}`,
135
226
  children: [
136
- /* @__PURE__ */ F("div", {
227
+ /* @__PURE__ */ V("div", {
137
228
  className: "flex flex-wrap items-start gap-3",
138
229
  children: [
139
- /* @__PURE__ */ P("div", {
230
+ /* @__PURE__ */ B("div", {
140
231
  className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary",
141
- children: /* @__PURE__ */ P(u, {
232
+ children: /* @__PURE__ */ B(u, {
142
233
  className: "h-5 w-5",
143
234
  "aria-hidden": "true"
144
235
  })
145
236
  }),
146
- /* @__PURE__ */ F("div", {
237
+ /* @__PURE__ */ V("div", {
147
238
  className: "min-w-0 flex-1",
148
- children: [/* @__PURE__ */ P("h3", {
239
+ children: [/* @__PURE__ */ B("h3", {
149
240
  className: "truncate text-base font-semibold text-text-primary",
150
241
  children: e.name
151
- }), /* @__PURE__ */ F("p", {
242
+ }), /* @__PURE__ */ V("p", {
152
243
  className: "text-xs text-text-tertiary",
153
244
  children: [
154
- /* @__PURE__ */ P("code", { children: e.key }),
245
+ /* @__PURE__ */ B("code", { children: e.key }),
155
246
  " · registered",
156
247
  " ",
157
248
  o(e.createdAt)
158
249
  ]
159
250
  })]
160
251
  }),
161
- /* @__PURE__ */ P(t, {
252
+ /* @__PURE__ */ B(t, {
162
253
  label: d.label,
163
254
  variant: d.variant,
164
255
  dot: !0
165
256
  })
166
257
  ]
167
258
  }),
168
- /* @__PURE__ */ P("p", {
259
+ /* @__PURE__ */ B("p", {
169
260
  className: "text-sm text-text-secondary",
170
261
  children: e.description
171
262
  }),
172
- /* @__PURE__ */ P("ul", {
263
+ /* @__PURE__ */ B("ul", {
173
264
  className: "divide-y divide-border-subtle rounded-md border border-border-subtle",
174
265
  children: e.versions.map((i) => {
175
- let o = v(i.status);
176
- return /* @__PURE__ */ F("li", {
266
+ let o = S(i.status);
267
+ return /* @__PURE__ */ V("li", {
177
268
  className: "flex flex-col gap-2 px-3 py-2 sm:flex-row sm:items-center sm:justify-between",
178
269
  "data-testid": `developer-version-${e.key}-${i.version}`,
179
- children: [/* @__PURE__ */ F("div", {
270
+ children: [/* @__PURE__ */ V("div", {
180
271
  className: "min-w-0",
181
272
  children: [
182
- /* @__PURE__ */ F("p", {
273
+ /* @__PURE__ */ V("p", {
183
274
  className: "flex items-center gap-2 text-sm text-text-primary",
184
275
  children: [
185
276
  "v",
186
277
  i.version,
187
- /* @__PURE__ */ P(t, {
278
+ /* @__PURE__ */ B(t, {
188
279
  label: o.label,
189
280
  variant: o.variant
190
281
  })
191
282
  ]
192
283
  }),
193
- i.reviewNotes && /* @__PURE__ */ F("p", {
284
+ i.reviewNotes && /* @__PURE__ */ V("p", {
194
285
  className: "text-xs text-text-secondary",
195
286
  children: ["Reviewer notes: ", i.reviewNotes]
196
287
  }),
197
- i.suspendedReason && /* @__PURE__ */ F("p", {
288
+ i.suspendedReason && /* @__PURE__ */ V("p", {
198
289
  className: "text-xs text-status-warning-text",
199
290
  children: ["Suspended: ", i.suspendedReason]
200
291
  })
201
292
  ]
202
- }), /* @__PURE__ */ F("div", {
293
+ }), /* @__PURE__ */ V("div", {
203
294
  className: "flex flex-wrap gap-2",
204
295
  children: [
205
- (i.status === "DRAFT" || i.status === "REJECTED") && /* @__PURE__ */ F("button", {
296
+ (i.status === "DRAFT" || i.status === "REJECTED") && /* @__PURE__ */ V("button", {
206
297
  type: "button",
207
- className: z,
298
+ className: G,
208
299
  disabled: n,
209
300
  onClick: () => r(i.id, i.version, i.manifest),
210
- children: [/* @__PURE__ */ P(k, {
301
+ children: [/* @__PURE__ */ B(P, {
211
302
  className: "h-4 w-4",
212
303
  "aria-hidden": "true"
213
304
  }), "Edit"]
214
305
  }),
215
- i.status === "DRAFT" && /* @__PURE__ */ F("button", {
306
+ i.status === "DRAFT" && /* @__PURE__ */ V("button", {
216
307
  type: "button",
217
- className: R,
308
+ className: W,
218
309
  disabled: n,
219
310
  onClick: () => a(i.id),
220
- children: [/* @__PURE__ */ P(A, {
311
+ children: [/* @__PURE__ */ B(I, {
221
312
  className: "h-4 w-4",
222
313
  "aria-hidden": "true"
223
314
  }), "Submit for review"]
224
315
  }),
225
- i.status === "IN_REVIEW" && /* @__PURE__ */ F("button", {
316
+ i.status === "IN_REVIEW" && /* @__PURE__ */ V("button", {
226
317
  type: "button",
227
- className: z,
318
+ className: G,
228
319
  disabled: n,
229
320
  onClick: () => s(i.id),
230
- children: [/* @__PURE__ */ P(M, {
321
+ children: [/* @__PURE__ */ B(R, {
231
322
  className: "h-4 w-4",
232
323
  "aria-hidden": "true"
233
324
  }), "Withdraw"]
@@ -237,30 +328,30 @@ function U({ applet: e, busy: n, onEditVersion: r, onNewVersion: i, onSubmit: a,
237
328
  }, i.id);
238
329
  })
239
330
  }),
240
- /* @__PURE__ */ P(H, {
331
+ /* @__PURE__ */ B(q, {
241
332
  applet: e,
242
333
  busy: n,
243
334
  ...l
244
335
  }),
245
- /* @__PURE__ */ F("div", {
336
+ /* @__PURE__ */ V("div", {
246
337
  className: "flex flex-wrap gap-2",
247
- children: [/* @__PURE__ */ F("button", {
338
+ children: [/* @__PURE__ */ V("button", {
248
339
  type: "button",
249
- className: z,
340
+ className: G,
250
341
  disabled: n || f,
251
342
  onClick: i,
252
343
  title: f ? "Finish or withdraw the open version first" : void 0,
253
- children: [/* @__PURE__ */ P(D, {
344
+ children: [/* @__PURE__ */ B(M, {
254
345
  className: "h-4 w-4",
255
346
  "aria-hidden": "true"
256
347
  }), "New version"]
257
- }), /* @__PURE__ */ F("button", {
348
+ }), /* @__PURE__ */ V("button", {
258
349
  type: "button",
259
- className: z,
350
+ className: G,
260
351
  disabled: n,
261
352
  onClick: c,
262
353
  "aria-label": `Archive ${e.name}`,
263
- children: [/* @__PURE__ */ P(j, {
354
+ children: [/* @__PURE__ */ B(L, {
264
355
  className: "h-4 w-4",
265
356
  "aria-hidden": "true"
266
357
  }), "Archive"]
@@ -269,215 +360,398 @@ function U({ applet: e, busy: n, onEditVersion: r, onNewVersion: i, onSubmit: a,
269
360
  ]
270
361
  });
271
362
  }
272
- function W() {
273
- let { workspaceId: t = "" } = s(), { toasts: o, addToast: _, dismissToast: v } = a(), x = typeof window > "u" ? "" : window.location.origin, [D, O] = T({ kind: "new" }), [k, A] = T(() => C(x)), [j, M] = T([]), [N, H] = T(!1), { data: W, loading: G, error: K } = p({ skip: !t }), { data: q } = f({ skip: !t }), [J] = g({ fetchPolicy: "network-only" }), [Y] = u({ refetchQueries: L }), [ie] = c({ refetchQueries: L }), [ae] = h({ refetchQueries: L }), [oe] = m({ refetchQueries: L }), [se] = ne({ refetchQueries: L }), [ce] = l({ refetchQueries: L }), [le] = ee({ refetchQueries: L }), [ue] = te({ refetchQueries: L }), [de] = d({ refetchQueries: L }), X = w(() => W?.timeCampusMyThirdPartyApplets ?? [], [W]), fe = q?.timeCampusAppletDataScopes ?? [], Z = () => {
274
- O({ kind: "new" }), A(C(x)), M([]);
363
+ function J() {
364
+ let { workspaceId: t = "" } = s(), { toasts: b, addToast: x, dismissToast: S } = a(), D = typeof window > "u" ? "" : window.location.origin, [A, j] = k({ kind: "new" }), [M, N] = k(() => O(D)), [P, F] = k([]), [I, L] = k(!1), { data: R, loading: z, error: q } = m({ skip: !t }), { data: J } = p({ skip: !t }), { data: fe } = f({ skip: !t }), [pe] = y({ fetchPolicy: "network-only" }), [me] = u({ refetchQueries: U }), [he] = c({ refetchQueries: U }), [ge] = te({ refetchQueries: U }), [_e] = v({ refetchQueries: U }), [ve] = re({ refetchQueries: U }), [ye] = l({ refetchQueries: U }), [be] = _({ refetchQueries: U }), [xe] = g({ refetchQueries: U }), [Se] = ne({ refetchQueries: U }), [Ce] = ee({ refetchQueries: U }), [we] = h({ refetchQueries: U }), [Te] = d({ refetchQueries: U }), Y = fe?.timeCampusMarketplaceDeveloperRevenue, X = se(() => R?.timeCampusMyThirdPartyApplets ?? [], [R]), Ee = J?.timeCampusAppletDataScopes ?? [], Z = () => {
365
+ j({ kind: "new" }), N(O(D)), F([]);
275
366
  }, Q = async () => {
276
- let e = S(k);
277
- if (!e.ok) return M([e.error]), null;
278
- let t = await J({ variables: { manifest: e.manifest } }), n = t.data?.validateTimeCampusAppletManifest;
279
- return n ? (M(n.errors), n.valid ? e.manifest : null) : (M([y(t.error)]), null);
280
- }, pe = async () => {
281
- await Q() && _({
367
+ let e = oe(M);
368
+ if (!e.ok) return F([e.error]), null;
369
+ let t = await pe({ variables: { manifest: e.manifest } }), n = t.data?.validateTimeCampusAppletManifest;
370
+ return n ? (F(n.errors), n.valid ? e.manifest : null) : (F([w(t.error)]), null);
371
+ }, De = async () => {
372
+ await Q() && x({
282
373
  title: "Manifest is valid",
283
374
  variant: "success"
284
375
  });
285
- }, me = async () => {
286
- H(!0);
376
+ }, Oe = async () => {
377
+ L(!0);
287
378
  try {
288
379
  let e = await Q();
289
380
  if (!e) return;
290
- D.kind === "new" ? (await Y({ variables: { manifest: e } }), _({
381
+ A.kind === "new" ? (await me({ variables: { manifest: e } }), x({
291
382
  title: "Applet registered as a draft",
292
383
  description: "Submit it for review when it is ready.",
293
384
  variant: "success"
294
- })) : D.kind === "version" ? (await ie({ variables: {
295
- appletId: D.appletId,
385
+ })) : A.kind === "version" ? (await he({ variables: {
386
+ appletId: A.appletId,
296
387
  manifest: e
297
- } }), _({
388
+ } }), x({
298
389
  title: "New draft version added",
299
390
  variant: "success"
300
- })) : (await ae({ variables: {
301
- versionId: D.versionId,
391
+ })) : (await ge({ variables: {
392
+ versionId: A.versionId,
302
393
  manifest: e
303
- } }), _({
394
+ } }), x({
304
395
  title: "Draft saved",
305
396
  variant: "success"
306
397
  })), Z();
307
398
  } catch (e) {
308
- _({
309
- title: y(e),
399
+ x({
400
+ title: w(e),
310
401
  variant: "error"
311
402
  });
312
403
  } finally {
313
- H(!1);
404
+ L(!1);
314
405
  }
315
406
  }, $ = async (e, t) => {
316
- H(!0);
407
+ L(!0);
317
408
  try {
318
- await e(), _({
409
+ await e(), x({
319
410
  title: t,
320
411
  variant: "success"
321
412
  });
322
413
  } catch (e) {
323
- _({
324
- title: y(e),
414
+ x({
415
+ title: w(e),
325
416
  variant: "error"
326
417
  });
327
418
  } finally {
328
- H(!1);
419
+ L(!1);
329
420
  }
330
421
  };
331
- return /* @__PURE__ */ F(e, {
422
+ return /* @__PURE__ */ V(e, {
332
423
  title: "Applet Developer",
333
424
  description: "Build and publish your own TimeCampus applets",
334
425
  purpose: "Describe an applet with a JSON manifest: its name and icon, the TimeCampus data scopes it reads, its HTTPS entry point and the widgets it adds. Each version goes to a reviewer before anyone can install it. Widgets run in a sandboxed iframe and get data only through the host bridge — never an API token.",
335
- children: [/* @__PURE__ */ P(i, {
336
- toasts: o,
337
- onDismiss: v
338
- }), /* @__PURE__ */ F("div", {
339
- className: "grid grid-cols-1 gap-6 xl:grid-cols-2",
340
- children: [/* @__PURE__ */ P("section", {
341
- "aria-labelledby": "manifest-editor-heading",
342
- children: /* @__PURE__ */ F(I, {
426
+ children: [
427
+ /* @__PURE__ */ B(i, {
428
+ toasts: b,
429
+ onDismiss: S
430
+ }),
431
+ /* @__PURE__ */ V("div", {
432
+ className: "grid grid-cols-1 gap-6 xl:grid-cols-2",
433
+ children: [/* @__PURE__ */ B("section", {
434
+ "aria-labelledby": "manifest-editor-heading",
435
+ children: /* @__PURE__ */ V(H, {
436
+ treatment: "glass",
437
+ className: "flex flex-col gap-3 p-5",
438
+ children: [
439
+ /* @__PURE__ */ V("div", {
440
+ className: "flex items-center justify-between gap-2",
441
+ children: [/* @__PURE__ */ B("h2", {
442
+ id: "manifest-editor-heading",
443
+ className: "text-base font-semibold text-text-primary",
444
+ children: K(A)
445
+ }), A.kind !== "new" && /* @__PURE__ */ B("button", {
446
+ type: "button",
447
+ className: G,
448
+ onClick: Z,
449
+ children: "Cancel"
450
+ })]
451
+ }),
452
+ /* @__PURE__ */ V("label", {
453
+ className: "flex flex-col gap-1 text-sm text-text-secondary",
454
+ children: ["Manifest (JSON)", /* @__PURE__ */ B("textarea", {
455
+ value: M,
456
+ onChange: (e) => N(e.target.value),
457
+ spellCheck: !1,
458
+ rows: 22,
459
+ className: "w-full rounded-md border border-border-subtle bg-bg-surface p-3 font-mono text-xs text-text-primary",
460
+ "aria-label": "Applet manifest JSON",
461
+ "data-testid": "applet-manifest-editor"
462
+ })]
463
+ }),
464
+ P.length > 0 && /* @__PURE__ */ B("ul", {
465
+ className: "list-disc rounded-md bg-status-error-bg py-2 pl-6 pr-3 text-xs text-status-error-text",
466
+ "data-testid": "applet-manifest-problems",
467
+ children: P.map((e) => /* @__PURE__ */ B("li", { children: e }, e))
468
+ }),
469
+ /* @__PURE__ */ V("div", {
470
+ className: "flex flex-wrap gap-2",
471
+ children: [/* @__PURE__ */ V("button", {
472
+ type: "button",
473
+ className: G,
474
+ onClick: De,
475
+ disabled: I,
476
+ children: [/* @__PURE__ */ B(ce, {
477
+ className: "h-4 w-4",
478
+ "aria-hidden": "true"
479
+ }), "Validate"]
480
+ }), /* @__PURE__ */ B("button", {
481
+ type: "button",
482
+ className: W,
483
+ onClick: Oe,
484
+ disabled: I,
485
+ children: ue(A)
486
+ })]
487
+ }),
488
+ /* @__PURE__ */ V("div", {
489
+ className: "text-xs text-text-tertiary",
490
+ children: [
491
+ /* @__PURE__ */ B("p", {
492
+ className: "mb-1 font-medium text-text-secondary",
493
+ children: "Data scopes a manifest can ask for"
494
+ }),
495
+ /* @__PURE__ */ B("ul", {
496
+ className: "list-disc pl-5",
497
+ children: Ee.map((e) => /* @__PURE__ */ V("li", { children: [
498
+ /* @__PURE__ */ B("code", { children: e.key }),
499
+ " — ",
500
+ e.description
501
+ ] }, e.key))
502
+ }),
503
+ /* @__PURE__ */ V("p", {
504
+ className: "mt-2",
505
+ children: [
506
+ "Your widget page asks the host for data with",
507
+ " ",
508
+ /* @__PURE__ */ B("code", { children: "parent.postMessage({ protocol: \"timecampus.applet.v1\", type: \"request\", requestId, scope }, \"*\")" }),
509
+ " ",
510
+ "and receives a ",
511
+ /* @__PURE__ */ B("code", { children: "response" }),
512
+ " message back."
513
+ ]
514
+ })
515
+ ]
516
+ })
517
+ ]
518
+ })
519
+ }), /* @__PURE__ */ V("section", {
520
+ "aria-labelledby": "my-applets-heading",
521
+ children: [/* @__PURE__ */ B("h2", {
522
+ id: "my-applets-heading",
523
+ className: "mb-3 text-base font-semibold text-text-primary",
524
+ children: "Your applets"
525
+ }), z && !R ? /* @__PURE__ */ B(n, {
526
+ variant: "card",
527
+ count: 2
528
+ }) : q ? /* @__PURE__ */ B(r, {
529
+ title: "Couldn't load your applets",
530
+ description: w(q),
531
+ illustration: "error-state"
532
+ }) : X.length === 0 ? /* @__PURE__ */ B(r, {
533
+ title: "No applets yet",
534
+ description: "Register your first applet with the manifest editor. The starter manifest uses the sample widget TimeCampus serves.",
535
+ illustration: "empty-generic"
536
+ }) : /* @__PURE__ */ B("div", {
537
+ className: "flex flex-col gap-4",
538
+ children: X.map((e) => /* @__PURE__ */ B(de, {
539
+ applet: e,
540
+ busy: I,
541
+ onEditVersion: (t, n, r) => {
542
+ j({
543
+ kind: "edit",
544
+ versionId: t,
545
+ version: n,
546
+ appletName: e.name
547
+ }), N(ae(r)), F([]);
548
+ },
549
+ onNewVersion: () => {
550
+ j({
551
+ kind: "version",
552
+ appletId: e.id,
553
+ appletName: e.name
554
+ }), N(ie(e.latestVersion.manifest)), F([]);
555
+ },
556
+ onSubmit: (e) => $(() => _e({ variables: { versionId: e } }), "Submitted for review"),
557
+ onWithdraw: (e) => $(() => ve({ variables: { versionId: e } }), "Withdrawn from review"),
558
+ marketplace: {
559
+ onOffer: () => void $(() => be({ variables: { appletId: e.id } }), "Sent for platform certification"),
560
+ onWithdraw: () => void $(() => Se({ variables: { appletId: e.id } }), "Withdrawn from platform certification"),
561
+ onSavePricing: (t, n) => void $(() => xe({ variables: {
562
+ appletId: e.id,
563
+ pricingModel: t,
564
+ priceUsd: n
565
+ } }), `Pricing updated to ${T(t, n)}`),
566
+ onUnlist: () => void $(() => Ce({ variables: { appletId: e.id } }), `${e.name} unlisted (existing installs keep working)`),
567
+ onRelist: () => void $(() => we({ variables: { appletId: e.id } }), `${e.name} is listed in the marketplace again`),
568
+ onDelist: () => {
569
+ window.confirm(`Remove ${e.name} from the marketplace? It is removed from every workspace that installed it.`) && $(() => Te({ variables: { appletId: e.id } }), `${e.name} removed from the marketplace`);
570
+ }
571
+ },
572
+ onArchive: () => {
573
+ window.confirm(`Archive ${e.name}? It is removed from every dashboard in this workspace and from the marketplace.`) && $(() => ye({ variables: { id: e.id } }), `${e.name} archived`);
574
+ }
575
+ }, e.id))
576
+ })]
577
+ })]
578
+ }),
579
+ Y && /* @__PURE__ */ B("section", {
580
+ className: "mt-6",
581
+ "aria-labelledby": "developer-revenue-heading",
582
+ "data-testid": "developer-revenue-section",
583
+ children: /* @__PURE__ */ V(H, {
343
584
  treatment: "glass",
344
- className: "flex flex-col gap-3 p-5",
585
+ className: "flex flex-col gap-4 p-5",
345
586
  children: [
346
- /* @__PURE__ */ F("div", {
347
- className: "flex items-center justify-between gap-2",
348
- children: [/* @__PURE__ */ P("h2", {
349
- id: "manifest-editor-heading",
587
+ /* @__PURE__ */ V("div", {
588
+ className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
589
+ children: [/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("h2", {
590
+ id: "developer-revenue-heading",
350
591
  className: "text-base font-semibold text-text-primary",
351
- children: B(D)
352
- }), D.kind !== "new" && /* @__PURE__ */ P("button", {
353
- type: "button",
354
- className: z,
355
- onClick: Z,
356
- children: "Cancel"
357
- })]
358
- }),
359
- /* @__PURE__ */ F("label", {
360
- className: "flex flex-col gap-1 text-sm text-text-secondary",
361
- children: ["Manifest (JSON)", /* @__PURE__ */ P("textarea", {
362
- value: k,
363
- onChange: (e) => A(e.target.value),
364
- spellCheck: !1,
365
- rows: 22,
366
- className: "w-full rounded-md border border-border-subtle bg-bg-surface p-3 font-mono text-xs text-text-primary",
367
- "aria-label": "Applet manifest JSON",
368
- "data-testid": "applet-manifest-editor"
369
- })]
370
- }),
371
- j.length > 0 && /* @__PURE__ */ P("ul", {
372
- className: "list-disc rounded-md bg-status-error-bg py-2 pl-6 pr-3 text-xs text-status-error-text",
373
- "data-testid": "applet-manifest-problems",
374
- children: j.map((e) => /* @__PURE__ */ P("li", { children: e }, e))
375
- }),
376
- /* @__PURE__ */ F("div", {
377
- className: "flex flex-wrap gap-2",
378
- children: [/* @__PURE__ */ F("button", {
379
- type: "button",
380
- className: z,
381
- onClick: pe,
382
- disabled: N,
383
- children: [/* @__PURE__ */ P(E, {
592
+ children: "Marketplace revenue & payouts"
593
+ }), /* @__PURE__ */ V("p", {
594
+ className: "text-xs text-text-secondary",
595
+ children: [
596
+ "Developers keep",
597
+ " ",
598
+ C(Y.summary.platformFeeRateBps),
599
+ "% of net sales. Earnings clear after a",
600
+ " ",
601
+ Y.summary.holdWindowDays,
602
+ "-day hold window; payouts run",
603
+ " ",
604
+ Y.summary.payoutSchedule.toLowerCase(),
605
+ " once payable balance reaches",
606
+ " ",
607
+ E(Y.summary.minimumPayoutThresholdUsd),
608
+ "."
609
+ ]
610
+ })] }), /* @__PURE__ */ V("a", {
611
+ href: Y.summary.payoutsUrl,
612
+ className: G,
613
+ "data-testid": "developer-payouts-link",
614
+ children: [/* @__PURE__ */ B(le, {
384
615
  className: "h-4 w-4",
385
616
  "aria-hidden": "true"
386
- }), "Validate"]
387
- }), /* @__PURE__ */ P("button", {
388
- type: "button",
389
- className: R,
390
- onClick: me,
391
- disabled: N,
392
- children: V(D)
617
+ }), "Manage payouts & bank account"]
393
618
  })]
394
619
  }),
395
- /* @__PURE__ */ F("div", {
396
- className: "text-xs text-text-tertiary",
620
+ /* @__PURE__ */ V("div", {
621
+ className: "grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5",
397
622
  children: [
398
- /* @__PURE__ */ P("p", {
399
- className: "mb-1 font-medium text-text-secondary",
400
- children: "Data scopes a manifest can ask for"
623
+ /* @__PURE__ */ V("div", {
624
+ className: "rounded-md border border-border-subtle bg-bg-sunken/40 p-3",
625
+ children: [/* @__PURE__ */ B("p", {
626
+ className: "text-xs text-text-tertiary",
627
+ children: "Gross sales"
628
+ }), /* @__PURE__ */ B("p", {
629
+ className: "text-lg font-semibold text-text-primary",
630
+ children: E(Y.summary.totalGrossUsd)
631
+ })]
401
632
  }),
402
- /* @__PURE__ */ P("ul", {
403
- className: "list-disc pl-5",
404
- children: fe.map((e) => /* @__PURE__ */ F("li", { children: [
405
- /* @__PURE__ */ P("code", { children: e.key }),
406
- " — ",
407
- e.description
408
- ] }, e.key))
633
+ /* @__PURE__ */ V("div", {
634
+ className: "rounded-md border border-border-subtle bg-bg-sunken/40 p-3",
635
+ children: [/* @__PURE__ */ B("p", {
636
+ className: "text-xs text-text-tertiary",
637
+ children: "Net developer share"
638
+ }), /* @__PURE__ */ B("p", {
639
+ className: "text-lg font-semibold text-text-primary",
640
+ children: E(Y.summary.totalDeveloperNetUsd)
641
+ })]
409
642
  }),
410
- /* @__PURE__ */ F("p", {
411
- className: "mt-2",
412
- children: [
413
- "Your widget page asks the host for data with",
414
- " ",
415
- /* @__PURE__ */ P("code", { children: "parent.postMessage({ protocol: \"timecampus.applet.v1\", type: \"request\", requestId, scope }, \"*\")" }),
416
- " ",
417
- "and receives a ",
418
- /* @__PURE__ */ P("code", { children: "response" }),
419
- " message back."
420
- ]
643
+ /* @__PURE__ */ V("div", {
644
+ className: "rounded-md border border-border-subtle bg-bg-sunken/40 p-3",
645
+ children: [/* @__PURE__ */ B("p", {
646
+ className: "text-xs text-text-tertiary",
647
+ children: "30-day hold"
648
+ }), /* @__PURE__ */ B("p", {
649
+ className: "text-lg font-semibold text-text-primary",
650
+ children: E(Y.summary.pendingHoldUsd)
651
+ })]
652
+ }),
653
+ /* @__PURE__ */ V("div", {
654
+ className: "rounded-md border border-border-subtle bg-bg-sunken/40 p-3",
655
+ children: [/* @__PURE__ */ B("p", {
656
+ className: "text-xs text-text-tertiary",
657
+ children: "Payable balance"
658
+ }), /* @__PURE__ */ B("p", {
659
+ className: "text-lg font-semibold text-text-primary",
660
+ children: E(Y.summary.payableUsd)
661
+ })]
662
+ }),
663
+ /* @__PURE__ */ V("div", {
664
+ className: "rounded-md border border-border-subtle bg-bg-sunken/40 p-3",
665
+ children: [/* @__PURE__ */ B("p", {
666
+ className: "text-xs text-text-tertiary",
667
+ children: "Refunded"
668
+ }), /* @__PURE__ */ B("p", {
669
+ className: "text-lg font-semibold text-text-primary",
670
+ children: E(Y.summary.totalRefundedUsd)
671
+ })]
421
672
  })
422
673
  ]
674
+ }),
675
+ Y.sales.length === 0 ? /* @__PURE__ */ B("p", {
676
+ className: "text-xs text-text-tertiary",
677
+ children: "No paid applet sales yet. Set a price on a certified listing to start selling in the TimeCampus Marketplace."
678
+ }) : /* @__PURE__ */ B("div", {
679
+ className: "overflow-x-auto",
680
+ children: /* @__PURE__ */ V("table", {
681
+ className: "w-full text-left text-xs",
682
+ children: [/* @__PURE__ */ B("thead", { children: /* @__PURE__ */ V("tr", {
683
+ className: "border-b border-border-subtle text-text-tertiary",
684
+ children: [
685
+ /* @__PURE__ */ B("th", {
686
+ className: "py-2 pr-3 font-medium",
687
+ children: "Order"
688
+ }),
689
+ /* @__PURE__ */ B("th", {
690
+ className: "py-2 pr-3 font-medium",
691
+ children: "Applet"
692
+ }),
693
+ /* @__PURE__ */ B("th", {
694
+ className: "py-2 pr-3 font-medium",
695
+ children: "Model"
696
+ }),
697
+ /* @__PURE__ */ B("th", {
698
+ className: "py-2 pr-3 font-medium",
699
+ children: "Gross"
700
+ }),
701
+ /* @__PURE__ */ B("th", {
702
+ className: "py-2 pr-3 font-medium",
703
+ children: "Net"
704
+ }),
705
+ /* @__PURE__ */ B("th", {
706
+ className: "py-2 pr-3 font-medium",
707
+ children: "Status"
708
+ }),
709
+ /* @__PURE__ */ B("th", {
710
+ className: "py-2 font-medium",
711
+ children: "Available"
712
+ })
713
+ ]
714
+ }) }), /* @__PURE__ */ B("tbody", {
715
+ className: "divide-y divide-border-subtle",
716
+ children: Y.sales.map((e) => /* @__PURE__ */ V("tr", { children: [
717
+ /* @__PURE__ */ B("td", {
718
+ className: "py-2 pr-3 font-mono text-text-primary",
719
+ children: e.orderNumber
720
+ }),
721
+ /* @__PURE__ */ B("td", {
722
+ className: "py-2 pr-3 text-text-primary",
723
+ children: e.appletName
724
+ }),
725
+ /* @__PURE__ */ B("td", {
726
+ className: "py-2 pr-3 text-text-secondary",
727
+ children: e.pricingModel === "PER_SEAT_MONTHLY" ? `${e.seatCount} seats / mo` : "One-time"
728
+ }),
729
+ /* @__PURE__ */ B("td", {
730
+ className: "py-2 pr-3 text-text-primary",
731
+ children: E(e.grossAmount)
732
+ }),
733
+ /* @__PURE__ */ B("td", {
734
+ className: "py-2 pr-3 text-text-primary",
735
+ children: E(e.developerNetAmount)
736
+ }),
737
+ /* @__PURE__ */ V("td", {
738
+ className: "py-2 pr-3 text-text-secondary",
739
+ children: [e.status, e.refundAmount ? ` (refund ${E(e.refundAmount)})` : ""]
740
+ }),
741
+ /* @__PURE__ */ B("td", {
742
+ className: "py-2 text-text-tertiary",
743
+ children: e.earningAvailableAt ? o(e.earningAvailableAt) : "—"
744
+ })
745
+ ] }, e.id))
746
+ })]
747
+ })
423
748
  })
424
749
  ]
425
750
  })
426
- }), /* @__PURE__ */ F("section", {
427
- "aria-labelledby": "my-applets-heading",
428
- children: [/* @__PURE__ */ P("h2", {
429
- id: "my-applets-heading",
430
- className: "mb-3 text-base font-semibold text-text-primary",
431
- children: "Your applets"
432
- }), G && !W ? /* @__PURE__ */ P(n, {
433
- variant: "card",
434
- count: 2
435
- }) : K ? /* @__PURE__ */ P(r, {
436
- title: "Couldn't load your applets",
437
- description: y(K),
438
- illustration: "error-state"
439
- }) : X.length === 0 ? /* @__PURE__ */ P(r, {
440
- title: "No applets yet",
441
- description: "Register your first applet with the manifest editor. The starter manifest uses the sample widget TimeCampus serves.",
442
- illustration: "empty-generic"
443
- }) : /* @__PURE__ */ P("div", {
444
- className: "flex flex-col gap-4",
445
- children: X.map((e) => /* @__PURE__ */ P(U, {
446
- applet: e,
447
- busy: N,
448
- onEditVersion: (t, n, r) => {
449
- O({
450
- kind: "edit",
451
- versionId: t,
452
- version: n,
453
- appletName: e.name
454
- }), A(re(r)), M([]);
455
- },
456
- onNewVersion: () => {
457
- O({
458
- kind: "version",
459
- appletId: e.id,
460
- appletName: e.name
461
- }), A(b(e.latestVersion.manifest)), M([]);
462
- },
463
- onSubmit: (e) => $(() => oe({ variables: { versionId: e } }), "Submitted for review"),
464
- onWithdraw: (e) => $(() => se({ variables: { versionId: e } }), "Withdrawn from review"),
465
- marketplace: {
466
- onOffer: () => void $(() => le({ variables: { appletId: e.id } }), "Sent for platform certification"),
467
- onWithdraw: () => void $(() => ue({ variables: { appletId: e.id } }), "Withdrawn from platform certification"),
468
- onDelist: () => {
469
- window.confirm(`Remove ${e.name} from the marketplace? It is removed from every workspace that installed it.`) && $(() => de({ variables: { appletId: e.id } }), `${e.name} removed from the marketplace`);
470
- }
471
- },
472
- onArchive: () => {
473
- window.confirm(`Archive ${e.name}? It is removed from every dashboard in this workspace and from the marketplace.`) && $(() => ce({ variables: { id: e.id } }), `${e.name} archived`);
474
- }
475
- }, e.id))
476
- })]
477
- })]
478
- })]
751
+ })
752
+ ]
479
753
  });
480
754
  }
481
- export { W as AppletDeveloperPage };
755
+ export { J as AppletDeveloperPage };
482
756
 
483
757
  //# sourceMappingURL=AppletDeveloperPage.js.map