@burdenoff/fe-libs 2026.823.2 → 2026.825.1

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.
@@ -28,6 +28,10 @@ export { usePWA } from './usePWA';
28
28
  export { useHasAnimated } from './useHasAnimated';
29
29
  export { useReferralAttribution } from './useReferralAttribution';
30
30
  export { useRecordProductVisit } from './useRecordProductVisit';
31
+ export { usePushDeviceRegistration } from './usePushDeviceRegistration';
32
+ export type { UsePushDeviceRegistrationOptions } from './usePushDeviceRegistration';
33
+ export { getOrCreatePushDeviceId, registerPushDevice, unregisterPushDevice, PUSH_DEVICE_ID_STORAGE_KEY, } from '../native/push-registration';
34
+ export type { PushDevicePlatform, PushDeviceRegistrationOptions, RegisterPushDeviceOptions, UnregisterPushDeviceOptions, } from '../native/push-registration';
31
35
  export { useQuotaErrorToast, dispatchQuotaExhausted, QUOTA_EXHAUSTED_EVENT, } from './useQuotaErrorToast';
32
36
  export type { UseQuotaErrorToastOptions, QuotaExhaustedEventDetail } from './useQuotaErrorToast';
33
37
  export { useUpgradePrompt, publishPlanUsageSnapshot, PLAN_USAGE_SNAPSHOT_EVENT, } from './useUpgradePrompt';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAc,MAAM,OAAO,CAAC;AACnC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,oBAAoB,8CAA2D,CAAC;AAE7F;;GAEG;AACH,wBAAgB,uBAAuB,2BAMtC;AAOD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,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AM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAG9E,cAAc,aAAa,CAAC;AAG5B,cAAc,WAAW,CAAC;AAG1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,YAAY,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,kBAAkB,EAClB,6BAA6B,EAC7B,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAGjG,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,cAAc,EACd,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,GACpB,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,10 @@
1
+ export interface UsePushDeviceRegistrationOptions {
2
+ /** Override the app-shell-provided product slug. */
3
+ productSlug?: string;
4
+ /** Shipped as registration metadata. Defaults to the shell's `__APP_VERSION__`. */
5
+ appVersion?: string;
6
+ /** Set false to disable the side effect entirely (e.g. during E2E runs). */
7
+ enabled?: boolean;
8
+ }
9
+ export declare function usePushDeviceRegistration(options?: UsePushDeviceRegistrationOptions): void;
10
+ //# sourceMappingURL=usePushDeviceRegistration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePushDeviceRegistration.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/usePushDeviceRegistration.ts"],"names":[],"mappings":"AAiDA,MAAM,WAAW,gCAAgC;IAC/C,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mFAAmF;IACnF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAiBD,wBAAgB,yBAAyB,CAAC,OAAO,GAAE,gCAAqC,GAAG,IAAI,CA4C9F"}
@@ -0,0 +1,54 @@
1
+ import { useAppShell as e } from "../providers/shell/AppShellContext.js";
2
+ import { useAuth as t } from "../providers/shell/AuthProvider.js";
3
+ import { logManager as n } from "../logger/LogManager.js";
4
+ import "../../shared-logger.js";
5
+ import { installPushDeviceRegistration as r, unregisterPushDevice as i } from "../native/push-registration.js";
6
+ import { useEffect as a, useRef as o } from "react";
7
+ //#region src/shared/hooks/usePushDeviceRegistration.ts
8
+ var s = n.getLogger("usePushDeviceRegistration");
9
+ function c() {
10
+ let e = globalThis.__APP_VERSION__;
11
+ return typeof e == "string" && e.length > 0 ? e : void 0;
12
+ }
13
+ function l() {
14
+ if (!(typeof navigator > "u")) return navigator.language || void 0;
15
+ }
16
+ function u(n = {}) {
17
+ let { productSlug: u } = e(), { user: d, tokens: f } = t(), p = n.productSlug ?? u, m = n.enabled !== !1, h = d?.id, g = f?.accessToken, _ = o(null);
18
+ a(() => {
19
+ if (m && p) {
20
+ if (!h || !g) {
21
+ let e = _.current;
22
+ if (!e) return;
23
+ _.current = null, i({ authToken: e.accessToken }).catch((e) => {
24
+ s.warn("[usePushDeviceRegistration] unregister failed", { error: e instanceof Error ? e.message : String(e) });
25
+ });
26
+ return;
27
+ }
28
+ return _.current = {
29
+ userId: h,
30
+ accessToken: g
31
+ }, r({
32
+ productSlug: p,
33
+ getAuthToken: () => _.current?.accessToken,
34
+ getUserId: () => _.current?.userId,
35
+ appVersion: n.appVersion ?? c(),
36
+ locale: l(),
37
+ onError: (e) => {
38
+ s.warn("[usePushDeviceRegistration] registration failed", {
39
+ productSlug: p,
40
+ error: e.message
41
+ });
42
+ }
43
+ });
44
+ }
45
+ }, [
46
+ m,
47
+ p,
48
+ h,
49
+ g,
50
+ n.appVersion
51
+ ]);
52
+ }
53
+ //#endregion
54
+ export { u as usePushDeviceRegistration };
@@ -0,0 +1,124 @@
1
+ import { PushTokenEventDetail } from './types';
2
+ /**
3
+ * Dispatched by `shell-native/push.ts` on OS registration. Re-declared here
4
+ * rather than imported: `shared/*` must not depend on `shell-native/*`.
5
+ */
6
+ export declare const PUSH_TOKEN_EVENT = "burdenoff:pushToken";
7
+ /**
8
+ * Stable per-install device id, independent of the OS token (which rotates).
9
+ * The backend retires the previous row for the same `deviceId` when a rotated
10
+ * token arrives, so this key is what stops a registry filling with dead tokens.
11
+ */
12
+ export declare const PUSH_DEVICE_ID_STORAGE_KEY = "burdenoff:deviceId";
13
+ export type PushDevicePlatform = PushTokenEventDetail['platform'];
14
+ /**
15
+ * `global-auth-svc` `registerDeviceToken`. `productSlug` is a top-level
16
+ * argument because `global-channel-svc` resolves the Firebase project (the
17
+ * fleet is split across five of them) from the DEVICE row — a device minted by
18
+ * one app install belongs to exactly one project. It is mirrored into
19
+ * `metadata` so a consumer reading the free-form blob sees the same value.
20
+ *
21
+ * NOTE the shape of the arguments: no `userId`, no `actorId`, no `id`. The
22
+ * mutation is `@rbac(scopeType: "self")`, which is an AUTHENTICATION gate only;
23
+ * an identity-shaped argument on a self-scoped field would let any
24
+ * authenticated caller register a device for anybody.
25
+ */
26
+ export declare const REGISTER_DEVICE_TOKEN_MUTATION = "\n mutation RegisterDeviceToken(\n $deviceId: String!\n $token: String!\n $platform: String!\n $productSlug: String!\n $metadata: JSONObject\n ) {\n registerDeviceToken(\n deviceId: $deviceId\n token: $token\n platform: $platform\n productSlug: $productSlug\n metadata: $metadata\n ) {\n id\n deviceId\n platform\n lastUsedAt\n }\n }\n";
27
+ /**
28
+ * Pre-`productSlug` spelling of the same mutation, used only as a fallback (see
29
+ * `isUnknownProductSlugArgumentError`). The product slug still travels in
30
+ * `metadata`, so a device registered through this path is recoverable.
31
+ */
32
+ export declare const REGISTER_DEVICE_TOKEN_MUTATION_LEGACY = "\n mutation RegisterDeviceToken(\n $deviceId: String!\n $token: String!\n $platform: String!\n $metadata: JSONObject\n ) {\n registerDeviceToken(\n deviceId: $deviceId\n token: $token\n platform: $platform\n metadata: $metadata\n ) {\n id\n deviceId\n platform\n lastUsedAt\n }\n }\n";
33
+ export declare const UNREGISTER_DEVICE_TOKEN_MUTATION = "\n mutation UnregisterDeviceToken($deviceId: String!) {\n unregisterDeviceToken(deviceId: $deviceId)\n }\n";
34
+ /** The exact `graphqlFetch` options this module sends. */
35
+ export interface PushRegistrationRequest {
36
+ gateway: 'global';
37
+ query: string;
38
+ operationName: string;
39
+ variables: Record<string, unknown>;
40
+ authToken?: string;
41
+ /**
42
+ * Always true: registration is fire-and-forget background sync. A failure
43
+ * (offline, cold subgraph, a token attached a beat after login) must never
44
+ * raise the global "[Burdenoff backend error]" toast.
45
+ */
46
+ suppressGlobalErrorEvent: true;
47
+ }
48
+ export interface PushRegistrationResponse {
49
+ data?: unknown;
50
+ errors?: Array<{
51
+ message: string;
52
+ extensions?: Record<string, unknown>;
53
+ }>;
54
+ }
55
+ export type PushRegistrationTransport = (request: PushRegistrationRequest) => Promise<PushRegistrationResponse>;
56
+ /**
57
+ * Stable per-install id, persisted in `localStorage`. When storage is
58
+ * unavailable (private mode, storage disabled) the id is still stable for the
59
+ * lifetime of the page — a fresh id per call would create one registry row per
60
+ * launch.
61
+ */
62
+ export declare function getOrCreatePushDeviceId(): string;
63
+ export interface RegisterPushDeviceOptions {
64
+ /** The OS push token (APNs/FCM) or, on web, the serialised subscription. */
65
+ token: string;
66
+ platform: PushDevicePlatform;
67
+ /** Product slug, e.g. `vibecontrols` — resolves the Firebase project. */
68
+ productSlug: string;
69
+ /**
70
+ * Access token, passed explicitly. Profile storage may not be flushed yet
71
+ * immediately after login, so relying on `graphqlFetch`'s storage fallback
72
+ * would race the very call we care about.
73
+ */
74
+ authToken?: string;
75
+ appVersion?: string;
76
+ locale?: string;
77
+ /** Only used to scope the "already sent this" cache — never sent. */
78
+ userId?: string;
79
+ deviceId?: string;
80
+ transport?: PushRegistrationTransport;
81
+ }
82
+ /**
83
+ * Register (or refresh) this device. Idempotent on the backend, and additionally
84
+ * de-duplicated here so a remount storm cannot hammer the mutation.
85
+ *
86
+ * Resolves `true` when the backend accepted the registration.
87
+ */
88
+ export declare function registerPushDevice(options: RegisterPushDeviceOptions): Promise<boolean>;
89
+ export interface UnregisterPushDeviceOptions {
90
+ authToken?: string;
91
+ deviceId?: string;
92
+ transport?: PushRegistrationTransport;
93
+ }
94
+ /**
95
+ * Revoke this device's registration — call on explicit logout / push opt-out.
96
+ * Clears the de-duplication cache so a subsequent login re-registers.
97
+ */
98
+ export declare function unregisterPushDevice(options?: UnregisterPushDeviceOptions): Promise<boolean>;
99
+ export interface PushDeviceRegistrationOptions {
100
+ productSlug: string;
101
+ /** Read lazily so a token arriving mid-session picks up the current token. */
102
+ getAuthToken?: () => string | null | undefined;
103
+ getUserId?: () => string | null | undefined;
104
+ appVersion?: string;
105
+ locale?: string;
106
+ transport?: PushRegistrationTransport;
107
+ /** Called with the outcome of every attempt (logging hook for the shell). */
108
+ onResult?: (registered: boolean) => void;
109
+ onError?: (error: Error) => void;
110
+ }
111
+ /**
112
+ * Listen for `burdenoff:pushToken` AND replay the token boot already captured.
113
+ *
114
+ * The replay is not optional: the OS `registration` callback fires during
115
+ * `bootNativeShell()`, before React mounts, so a listener-only implementation
116
+ * misses the token on every cold start.
117
+ *
118
+ * Returns a disposer. Safe to call again after login — the de-duplication cache
119
+ * means an unchanged (user, device, product, token) tuple is not re-sent.
120
+ */
121
+ export declare function installPushDeviceRegistration(options: PushDeviceRegistrationOptions): () => void;
122
+ /** Test seam — clears the module-level device id and de-duplication caches. */
123
+ export declare function resetPushDeviceRegistrationForTests(): void;
124
+ //# sourceMappingURL=push-registration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-registration.d.ts","sourceRoot":"","sources":["../../../src/shared/native/push-registration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,uBAAuB,CAAC;AAE/D,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAElE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,8BAA8B,4ZAqB1C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,gWAmBjD,CAAC;AAEF,eAAO,MAAM,gCAAgC,oHAI5C,CAAC;AAEF,0DAA0D;AAC1D,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,QAAQ,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,wBAAwB,EAAE,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EA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AAC;IAChB,SAAS,CAAC,EAAE,yBAAyB,CAAC;IACtC,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAYD;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,6BAA6B,GAAG,MAAM,IAAI,CA+BhG;AAED,+EAA+E;AAC/E,wBAAgB,mCAAmC,IAAI,IAAI,CAI1D"}
@@ -0,0 +1,120 @@
1
+ //#region src/shared/native/push-registration.ts
2
+ var e = "burdenoff:pushToken", t = "burdenoff:deviceId", n = "\n mutation RegisterDeviceToken(\n $deviceId: String!\n $token: String!\n $platform: String!\n $productSlug: String!\n $metadata: JSONObject\n ) {\n registerDeviceToken(\n deviceId: $deviceId\n token: $token\n platform: $platform\n productSlug: $productSlug\n metadata: $metadata\n ) {\n id\n deviceId\n platform\n lastUsedAt\n }\n }\n", r = "\n mutation RegisterDeviceToken(\n $deviceId: String!\n $token: String!\n $platform: String!\n $metadata: JSONObject\n ) {\n registerDeviceToken(\n deviceId: $deviceId\n token: $token\n platform: $platform\n metadata: $metadata\n ) {\n id\n deviceId\n platform\n lastUsedAt\n }\n }\n", i = "\n mutation UnregisterDeviceToken($deviceId: String!) {\n unregisterDeviceToken(deviceId: $deviceId)\n }\n", a = null;
3
+ async function o(e) {
4
+ if (!a) {
5
+ let { graphqlFetch: e } = await import("../graphql/fetch.js");
6
+ a = (t) => e(t);
7
+ }
8
+ return a(e);
9
+ }
10
+ var s = null;
11
+ function c() {
12
+ let e = typeof globalThis > "u" ? void 0 : globalThis.crypto;
13
+ return e && typeof e.randomUUID == "function" ? e.randomUUID() : `device-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 12)}`;
14
+ }
15
+ function l() {
16
+ if (s) return s;
17
+ if (typeof window < "u") try {
18
+ let e = window.localStorage.getItem(t);
19
+ if (e) return s = e, e;
20
+ } catch {}
21
+ let e = c();
22
+ if (s = e, typeof window < "u") try {
23
+ window.localStorage.setItem(t, e);
24
+ } catch {}
25
+ return e;
26
+ }
27
+ function u(e) {
28
+ return (e.errors ?? []).some((e) => e.message.includes("productSlug") && !e.message.includes("metadata"));
29
+ }
30
+ var d = null;
31
+ function f(e, t) {
32
+ return [
33
+ e.userId ?? "",
34
+ t,
35
+ e.productSlug,
36
+ e.platform,
37
+ e.token
38
+ ].join("|");
39
+ }
40
+ async function p(e) {
41
+ let t = e.token.trim(), i = e.productSlug.trim();
42
+ if (!t || !i) return !1;
43
+ let a = e.deviceId ?? l(), s = f({
44
+ ...e,
45
+ token: t
46
+ }, a);
47
+ if (d === s) return !0;
48
+ let c = e.transport ?? o, p = {
49
+ deviceId: a,
50
+ token: t,
51
+ platform: e.platform,
52
+ productSlug: i,
53
+ metadata: {
54
+ productSlug: i,
55
+ ...e.appVersion ? { appVersion: e.appVersion } : {},
56
+ ...e.locale ? { locale: e.locale } : {}
57
+ }
58
+ }, m = {
59
+ gateway: "global",
60
+ query: n,
61
+ operationName: "RegisterDeviceToken",
62
+ variables: p,
63
+ ...e.authToken ? { authToken: e.authToken } : {},
64
+ suppressGlobalErrorEvent: !0
65
+ }, h = await c(m);
66
+ if (u(h)) {
67
+ let e = { ...p };
68
+ delete e.productSlug, h = await c({
69
+ ...m,
70
+ query: r,
71
+ variables: e
72
+ });
73
+ }
74
+ return h.errors?.length ? !1 : (d = s, !0);
75
+ }
76
+ async function m(e = {}) {
77
+ d = null;
78
+ let t = e.deviceId ?? l();
79
+ return !(await (e.transport ?? o)({
80
+ gateway: "global",
81
+ query: i,
82
+ operationName: "UnregisterDeviceToken",
83
+ variables: { deviceId: t },
84
+ ...e.authToken ? { authToken: e.authToken } : {},
85
+ suppressGlobalErrorEvent: !0
86
+ })).errors?.length;
87
+ }
88
+ function h(e) {
89
+ if (!e || typeof e != "object") return null;
90
+ let t = e;
91
+ return typeof t.value != "string" || t.value.length === 0 || t.platform !== "ios" && t.platform !== "android" && t.platform !== "web" ? null : {
92
+ value: t.value,
93
+ platform: t.platform
94
+ };
95
+ }
96
+ function g(t) {
97
+ if (typeof window > "u") return () => void 0;
98
+ let n = (e) => {
99
+ p({
100
+ token: e.value,
101
+ platform: e.platform,
102
+ productSlug: t.productSlug,
103
+ authToken: t.getAuthToken?.() ?? void 0,
104
+ userId: t.getUserId?.() ?? void 0,
105
+ appVersion: t.appVersion,
106
+ locale: t.locale,
107
+ transport: t.transport
108
+ }).then((e) => t.onResult?.(e)).catch((e) => {
109
+ t.onError?.(e instanceof Error ? e : Error(String(e)));
110
+ });
111
+ }, r = (e) => {
112
+ let t = h(e.detail);
113
+ t && n(t);
114
+ };
115
+ window.addEventListener(e, r);
116
+ let i = h(window.__burdenoffPushToken);
117
+ return i && n(i), () => window.removeEventListener(e, r);
118
+ }
119
+ //#endregion
120
+ export { t as PUSH_DEVICE_ID_STORAGE_KEY, l as getOrCreatePushDeviceId, g as installPushDeviceRegistration, p as registerPushDevice, m as unregisterPushDevice };
@@ -167,8 +167,18 @@ export interface BurdenoffDesktopBridge {
167
167
  };
168
168
  }
169
169
  export interface PushTokenEventDetail {
170
+ /**
171
+ * The OS push token. On `web` this is the serialised Web Push subscription
172
+ * (`serializeWebPushSubscription`), which is that platform's device identity.
173
+ */
170
174
  value: string;
171
- platform: 'ios' | 'android';
175
+ /**
176
+ * `web` is included because a browser subscription is registered through the
177
+ * same `burdenoff:pushToken` event as the native token. Consumers that only
178
+ * understand native tokens must ignore the platforms they do not handle
179
+ * rather than assume the union is exhaustive at two members.
180
+ */
181
+ platform: 'ios' | 'android' | 'web';
172
182
  }
173
183
  declare global {
174
184
  interface Window {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/shared/native/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAk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I,IAAI,CAAC;QACd,IAAI,IAAI,IAAI,CAAC;QACb,KAAK,IAAI,IAAI,CAAC;QACd,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;KAC/B,CAAC;CACH;AAED,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,QAAQ,EAAE,KAAK,GAAG,SAAS,GAAG,KAAK,CAAC;CACrC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,uBAAuB,CAAC,EAAE,qBAAqB,CAAC;QAChD,qBAAqB,CAAC,EAAE,UAAU,CAAC;QACnC,kBAAkB,CAAC,EAAE,sBAAsB,CAAC;QAC5C,uBAAuB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;QAChE,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;QAC5C,eAAe,CAAC,EAAE;YAAE,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAAA;SAAE,CAAC;KAC1D;CACF;AAED,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,OAAO,CAAC;CACjB"}
@@ -29,16 +29,18 @@ import "./shared-logger.js";
29
29
  import { useHasAnimated as X } from "./shared/hooks/useHasAnimated.js";
30
30
  import { useReferralAttribution as Z } from "./shared/hooks/useReferralAttribution.js";
31
31
  import { useRecordProductVisit as Q } from "./shared/hooks/useRecordProductVisit.js";
32
- import { QUOTA_EXHAUSTED_EVENT as ne, dispatchQuotaExhausted as re, useQuotaErrorToast as ie } from "./shared/hooks/useQuotaErrorToast.js";
33
- import { PLAN_USAGE_SNAPSHOT_EVENT as ae, publishPlanUsageSnapshot as oe, useUpgradePrompt as se } from "./shared/hooks/useUpgradePrompt.js";
34
- import { appendContextToPath as ce, useCurrentContextSearchParams as le } from "./shared/hooks/useCurrentContextSearchParams.js";
35
- import ue, { use as de } from "react";
32
+ import { PUSH_DEVICE_ID_STORAGE_KEY as ne, getOrCreatePushDeviceId as re, registerPushDevice as ie, unregisterPushDevice as ae } from "./shared/native/push-registration.js";
33
+ import { usePushDeviceRegistration as oe } from "./shared/hooks/usePushDeviceRegistration.js";
34
+ import { QUOTA_EXHAUSTED_EVENT as se, dispatchQuotaExhausted as ce, useQuotaErrorToast as le } from "./shared/hooks/useQuotaErrorToast.js";
35
+ import { PLAN_USAGE_SNAPSHOT_EVENT as ue, publishPlanUsageSnapshot as de, useUpgradePrompt as fe } from "./shared/hooks/useUpgradePrompt.js";
36
+ import { appendContextToPath as pe, useCurrentContextSearchParams as me } from "./shared/hooks/useCurrentContextSearchParams.js";
37
+ import he, { use as ge } from "react";
36
38
  //#region src/shared/hooks/index.ts
37
- var $ = ue.createContext(null);
38
- function fe() {
39
- let e = de($);
39
+ var $ = he.createContext(null);
40
+ function _e() {
41
+ let e = ge($);
40
42
  if (!e) throw Error("useMicrofrontendContext must be used within a MicrofrontendProvider");
41
43
  return e;
42
44
  }
43
45
  //#endregion
44
- export { S as BREAKPOINTS, a as ConsoleTransport, G as GLOBAL_SHORTCUT_CATEGORIES, n as LogLevel, r as LogManager, ee as Logger, B as MODIFIER_KEYS, $ as MicrofrontendContext, ae as PLAN_USAGE_SNAPSHOT_EVENT, V as PLATFORM_TYPES, ne as QUOTA_EXHAUSTED_EVENT, ce as appendContextToPath, K as createGlobalShortcuts, s as detectPlatform, re as dispatchQuotaExhausted, c as formatKeyCombo, l as getDisplayKeysForPlatform, q as getGlobalShortcutsByCategory, u as getShortcutLabel, d as isMac, f as isMobileDevice, p as isTabletDevice, i as logManager, m as matchesKeyCombo, J as mergeShortcuts, h as normalizeKey, g as normalizePlatformCombo, _ as parseKeyCombo, oe as publishPlanUsageSnapshot, v as shouldEnableKeyboardShortcuts, y as shouldIgnoreShortcut, R as useAsync, z as useAsyncImmediate, C as useBreakpoint, F as useConditionalToggle, e as useCopyToClipboard, le as useCurrentContextSearchParams, b as useDebounce, k as useExclusiveMenu, X as useHasAnimated, U as useHotkeys, D as useKeyPress, O as useKeyboardShortcut, H as useKeyboardShortcuts, A as useLocalStorage, Y as useLogger, t as useMediaQuery, fe as useMicrofrontendContext, w as useMobileBreakpoint, T as useOnClickOutside, E as useOnClickOutsideWithRef, o as usePWA, te as usePagination, M as usePrevious, N as usePreviousDistinct, P as usePreviousHistory, ie as useQuotaErrorToast, Q as useRecordProductVisit, Z as useReferralAttribution, j as useSessionStorage, W as useShortcutHelp, x as useThrottle, I as useToggle, L as useToggleObject, se as useUpgradePrompt };
46
+ export { S as BREAKPOINTS, a as ConsoleTransport, G as GLOBAL_SHORTCUT_CATEGORIES, n as LogLevel, r as LogManager, ee as Logger, B as MODIFIER_KEYS, $ as MicrofrontendContext, ue as PLAN_USAGE_SNAPSHOT_EVENT, V as PLATFORM_TYPES, ne as PUSH_DEVICE_ID_STORAGE_KEY, se as QUOTA_EXHAUSTED_EVENT, pe as appendContextToPath, K as createGlobalShortcuts, s as detectPlatform, ce as dispatchQuotaExhausted, c as formatKeyCombo, l as getDisplayKeysForPlatform, q as getGlobalShortcutsByCategory, re as getOrCreatePushDeviceId, u as getShortcutLabel, d as isMac, f as isMobileDevice, p as isTabletDevice, i as logManager, m as matchesKeyCombo, J as mergeShortcuts, h as normalizeKey, g as normalizePlatformCombo, _ as parseKeyCombo, de as publishPlanUsageSnapshot, ie as registerPushDevice, v as shouldEnableKeyboardShortcuts, y as shouldIgnoreShortcut, ae as unregisterPushDevice, R as useAsync, z as useAsyncImmediate, C as useBreakpoint, F as useConditionalToggle, e as useCopyToClipboard, me as useCurrentContextSearchParams, b as useDebounce, k as useExclusiveMenu, X as useHasAnimated, U as useHotkeys, D as useKeyPress, O as useKeyboardShortcut, H as useKeyboardShortcuts, A as useLocalStorage, Y as useLogger, t as useMediaQuery, _e as useMicrofrontendContext, w as useMobileBreakpoint, T as useOnClickOutside, E as useOnClickOutsideWithRef, o as usePWA, te as usePagination, M as usePrevious, N as usePreviousDistinct, P as usePreviousHistory, oe as usePushDeviceRegistration, le as useQuotaErrorToast, Q as useRecordProductVisit, Z as useReferralAttribution, j as useSessionStorage, W as useShortcutHelp, x as useThrottle, I as useToggle, L as useToggleObject, fe as useUpgradePrompt };
package/dist/shared.js CHANGED
@@ -105,29 +105,31 @@ import { useLogger as Wi } from "./shared/logger/useLogger.js";
105
105
  import { useHasAnimated as Gi } from "./shared/hooks/useHasAnimated.js";
106
106
  import { useReferralAttribution as Ki } from "./shared/hooks/useReferralAttribution.js";
107
107
  import { useRecordProductVisit as qi } from "./shared/hooks/useRecordProductVisit.js";
108
- import { QUOTA_EXHAUSTED_EVENT as Ji, dispatchQuotaExhausted as Yi, useQuotaErrorToast as Xi } from "./shared/hooks/useQuotaErrorToast.js";
109
- import { PLAN_USAGE_SNAPSHOT_EVENT as Zi, publishPlanUsageSnapshot as Qi, useUpgradePrompt as $i } from "./shared/hooks/useUpgradePrompt.js";
110
- import { appendContextToPath as ea, useCurrentContextSearchParams as ta } from "./shared/hooks/useCurrentContextSearchParams.js";
111
- import { MicrofrontendContext as na, useMicrofrontendContext as ra } from "./shared-hooks.js";
112
- import { detectDeviceType as ia, getResponsiveSelector as aa } from "./shared/tours/types.js";
113
- import { useTourPlayer as oa } from "./shared/tours/useTourPlayer.js";
114
- import { TourSpotlight as sa } from "./shared/tours/TourSpotlight.js";
115
- import { TourTooltip as ca } from "./shared/tours/TourTooltip.js";
116
- import { TourPlayerProvider as la, useIsTourPlaying as ua, useStartTour as da, useStopTour as fa, useTourPlayerContext as pa } from "./shared/tours/TourPlayerProvider.js";
117
- import { TourPlayer as ma, TourTriggerButton as ha, usePlayTour as ga } from "./shared/tours/TourPlayer.js";
118
- import { getTourContextRank as _a, getTourRouteCatalog as va, getTourRouteModules as ya, getTourRoutePages as ba, isTourVisibleForContext as xa, normalizeTourPath as Sa, registerTourRouteCatalog as Ca, resolveTourTargetPath as wa } from "./shared/tours/routeCatalog.js";
119
- import { withTourProgressStatus as Ta } from "./shared/tours/progress.js";
120
- import { ToursProvider as Ea, useAutoStartTour as Da, useSafeToursContext as Oa, useTours as ka, useToursContext as Aa } from "./shared/tours/ToursContext.js";
121
- import { TourInitializer as ja } from "./shared/tours/TourInitializer.js";
122
- import { AppShellProvider as Ma, resolveAppShellObservabilityConfig as Na } from "./shared/providers/AppShellProvider.js";
123
- import { MicrofrontendProvider as Pa } from "./shared-providers.js";
124
- import { TourTrigger as Fa } from "./shared/tours/TourTrigger.js";
108
+ import { PUSH_DEVICE_ID_STORAGE_KEY as Ji, getOrCreatePushDeviceId as Yi, registerPushDevice as Xi, unregisterPushDevice as Zi } from "./shared/native/push-registration.js";
109
+ import { usePushDeviceRegistration as Qi } from "./shared/hooks/usePushDeviceRegistration.js";
110
+ import { QUOTA_EXHAUSTED_EVENT as $i, dispatchQuotaExhausted as ea, useQuotaErrorToast as ta } from "./shared/hooks/useQuotaErrorToast.js";
111
+ import { PLAN_USAGE_SNAPSHOT_EVENT as na, publishPlanUsageSnapshot as ra, useUpgradePrompt as ia } from "./shared/hooks/useUpgradePrompt.js";
112
+ import { appendContextToPath as aa, useCurrentContextSearchParams as oa } from "./shared/hooks/useCurrentContextSearchParams.js";
113
+ import { MicrofrontendContext as sa, useMicrofrontendContext as ca } from "./shared-hooks.js";
114
+ import { detectDeviceType as la, getResponsiveSelector as ua } from "./shared/tours/types.js";
115
+ import { useTourPlayer as da } from "./shared/tours/useTourPlayer.js";
116
+ import { TourSpotlight as fa } from "./shared/tours/TourSpotlight.js";
117
+ import { TourTooltip as pa } from "./shared/tours/TourTooltip.js";
118
+ import { TourPlayerProvider as ma, useIsTourPlaying as ha, useStartTour as ga, useStopTour as _a, useTourPlayerContext as va } from "./shared/tours/TourPlayerProvider.js";
119
+ import { TourPlayer as ya, TourTriggerButton as ba, usePlayTour as xa } from "./shared/tours/TourPlayer.js";
120
+ import { getTourContextRank as Sa, getTourRouteCatalog as Ca, getTourRouteModules as wa, getTourRoutePages as Ta, isTourVisibleForContext as Ea, normalizeTourPath as Da, registerTourRouteCatalog as Oa, resolveTourTargetPath as ka } from "./shared/tours/routeCatalog.js";
121
+ import { withTourProgressStatus as Aa } from "./shared/tours/progress.js";
122
+ import { ToursProvider as ja, useAutoStartTour as Ma, useSafeToursContext as Na, useTours as Pa, useToursContext as Fa } from "./shared/tours/ToursContext.js";
123
+ import { TourInitializer as Ia } from "./shared/tours/TourInitializer.js";
124
+ import { AppShellProvider as La, resolveAppShellObservabilityConfig as Ra } from "./shared/providers/AppShellProvider.js";
125
+ import { MicrofrontendProvider as za } from "./shared-providers.js";
126
+ import { TourTrigger as Ba } from "./shared/tours/TourTrigger.js";
125
127
  import "./shared-tours.js";
126
- import { acknowledgeNativePurchase as Ia, getNativeProducts as La, getNativePurchases as Ra, installNativeIAP as za, isNativeIAPAvailable as Ba, purchaseNativeProduct as Va, restoreNativePurchases as Ha } from "./shared/native/purchases.js";
127
- import { getNativeEntryRoutes as Ua, shouldShowNativeWelcome as Wa } from "./shared/native/entry.js";
128
+ import { acknowledgeNativePurchase as Va, getNativeProducts as Ha, getNativePurchases as Ua, installNativeIAP as Wa, isNativeIAPAvailable as Ga, purchaseNativeProduct as Ka, restoreNativePurchases as qa } from "./shared/native/purchases.js";
129
+ import { getNativeEntryRoutes as Ja, shouldShowNativeWelcome as Ya } from "./shared/native/entry.js";
128
130
  import "./shared-native.js";
129
131
  import "./shared/actors/index.js";
130
132
  //#region src/shared/index.ts
131
- var Ga = "1.0.0";
133
+ var Xa = "1.0.0";
132
134
  //#endregion
133
- export { Rr as ASSISTANT_WIDGET_TOGGLE_EVENT, er as AccessDenied, Gn as ActorIdentity, ri as AnalyticsConsentBanner, ct as ApolloClient, lt as ApolloProvider, ur as AppErrorBoundary, an as AppInitializer, Ma as AppShellProvider, zr as AssistantWidget, je as BACKEND_ERROR_EVENT, gi as BREAKPOINTS, ni as BackendAuditSink, ti as BroadcastChannelSink, ve as COMMON_SHELL_LESS_ROUTES, Me as CONNECTION_STATUS_EVENT, sr as ConditionalShell, fn as ConsoleTransport, _r as ContextConversationWidget, we as DEFAULT_PAGE_SIZE, ye as DEFAULT_SHELL_CONFIG, I as DESKTOP_UPDATE_UNSUPPORTED, L as DESKTOP_WINDOW_STATE_DEFAULT, $r as DesktopUpdateToast, ei as DevtoolsSink, Jn as ErrorBoundary, nr as ErrorFallback, li as EventBusProvider, Ga as FE_SHARED_VERSION, dr as FeatureFlagProvider, gr as FeatureGate, Te as GATEWAYS, Bi as GLOBAL_SHORTCUT_CATEGORIES, tt as GatewayProvider, ut as InMemoryCache, jr as KeyboardHelpDialogWrapper, rr as LoadingFallback, cn as LogLevel, un as LogManager, ln as Logger, Fi as MODIFIER_KEYS, Br as Markdown, na as MicrofrontendContext, or as MicrofrontendErrorBoundary, Pa as MicrofrontendProvider, ci as OtelBrowserSink, Zi as PLAN_USAGE_SNAPSHOT_EVENT, Ii as PLATFORM_TYPES, me as PRODUCTS, he as PRODUCT_URLS, Vn as PULL_TO_REFRESH_THRESHOLD, lr as PWAInstallBanner, ir as PageLoadingFallback, Zn as PermissionButton, tr as PermissionDenied, Qn as PermissionGate, $n as PermissionLink, vn as QUOTA_EXHAUSTED_CODE, Ji as QUOTA_EXHAUSTED_EVENT, Mr as QuotaMeter, yn as RESOURCE_CAP_EXCEEDED_CODE, Yn as RequireAuth, Xn as RequireGuest, ii as RybbitSink, Ye as SSELink, Vt as SSORedirectSpinner, Kt as SSO_DEPOSITED_PARAM, bn as STORAGE_QUOTA_EXCEEDED_CODE, Ln as SafeAreaView, ar as SectionLoadingFallback, ja as TourInitializer, ma as TourPlayer, la as TourPlayerProvider, sa as TourSpotlight, ca as TourTooltip, Fa as TourTrigger, ha as TourTriggerButton, Ea as ToursProvider, xn as UPGRADE_ERROR_CODES, Nr as UPGRADE_PROMPT_EVENT, Ir as UpgradeInlineBanner, Pr as UpgradePromptModal, st as WsLink, Ia as acknowledgeNativePurchase, r as alertTokens, ea as appendContextToPath, _t as attemptTokenRefresh, qt as beginSsoNavigation, R as bootDesktopShell, Kn as buildActorFallback, Sn as buildQuotaExhaustedMessage, Jt as buildSsoDepositUrl, m as capitalizeFirst, h as capitalizeWords, i as categoryTokens, Ht as checkRemoteSLO, Ut as checkSLO, vt as clearAuthSessionStorage, Be as clearGraphqlFetchResponseCache, Wt as clearLocalAuthState, Ct as clearSSoCookie, wt as clearShellSsoCookies, Yt as clearSsoDepositState, Xt as clearSsoNavigation, pn as clearUserContext, Dn as cn, Hn as computePullOffset, Un as computePullProgress, Zt as consumeSsoDepositMarker, n as createApolloClient, ui as createEventBus, Vi as createGlobalShortcuts, Xe as createGraphQLClient, gn as createProfileScopedStorage, z as desktopCheckForUpdates, B as desktopDeepLinkToPath, V as desktopInstallUpdate, H as desktopNotify, U as desktopOpenExternal, W as desktopSetBadgeCount, G as desktopSetLocale, K as desktopSetTheme, q as desktopSetTrayQuickActions, ia as detectDeviceType, vr as detectPlatform, Ne as dispatchBackendErrorEvent, Yi as dispatchQuotaExhausted, Fr as dispatchUpgradePrompt, Pe as extractBackendError, Cn as extractQuotaExhaustedExtensions, wn as extractUpgradeErrorExtensions, g as formatBytes, _ as formatCompactNumber, v as formatCurrency, y as formatCurrencyCompact, b as formatDate, x as formatDateTime, S as formatDuration, yr as formatKeyCombo, C as formatList, w as formatNumber, T as formatOrdinal, E as formatPercentage, D as formatRelativeTime, O as formatTime, a as getAlertTokens, o as getCategoryTokens, J as getDesktopAuthBridgeConfig, Y as getDesktopBridge, X as getDesktopGatewayBases, Z as getDesktopGatewayUrls, Q as getDesktopRuntimeConfig, $ as getDesktopUpdateState, ee as getDesktopWindowState, br as getDisplayKeysForPlatform, Ee as getGatewayConfig, De as getGatewayUrl, Ze as getGlobalClient, Hi as getGlobalShortcutsByCategory, Oe as getGraphQLEndpoint, te as getLegacyDesktopRuntime, jt as getNativeBridge, Ua as getNativeEntryRoutes, La as getNativeProducts, Ra as getNativePurchases, Mt as getPlatform, ge as getProductUrl, _e as getProductsWithUrls, _n as getProfileScopedKey, s as getProgressTokens, aa as getResponsiveSelector, Gt as getSSORedirectUrl, Tt as getSSoCookie, be as getShellConfig, xr as getShortcutLabel, c as getStatusBadgeTokens, l as getStatusTokens, Ve as getStoredAuthToken, He as getStoredLocale, Ue as getStoredOrganizationId, We as getStoredProjectId, Ge as getStoredWorkspaceId, Ke as getStoredWorkspaceToken, _a as getTourContextRank, va as getTourRouteCatalog, ya as getTourRouteModules, ba as getTourRoutePages, u as getTrendTokens, Qe as getWorkspaceClient, ke as getWorkspaceTokenPayload, dt as gql, qe as graphqlFetch, yt as hasAuthGraphQLErrors, $e as initializeAppClients, mn as initializeLogger, ne as installDesktopDeepLinkHandler, re as installDesktopNavigateHandler, le as installGatewayFetchRewrite, za as installNativeIAP, Fe as isAbortError, Nt as isAndroid, bt as isAuthGraphQLError, xt as isAuthNetworkError, Ie as isBackendErrorDisplay, P as isChunkLoadError, ie as isDesktop, Pt as isElectron, Ft as isIOS, It as isInstalledApp, Sr as isMac, Cr as isMobileDevice, Lt as isNative, Ba as isNativeIAPAvailable, Tn as isQuotaExhaustedError, Et as isSharedSsoCookieDomain, xe as isShellLessRoute, Qt as isSsoNavigationPending, Rt as isStandalonePWA, wr as isTabletDevice, xa as isTourVisibleForContext, Le as isTransportError, Dt as isTrustedSsoOrigin, En as isUpgradeError, zt as isWeb, Bt as isWebBrowser, Ae as isWorkspaceTokenValidForContext, F as lazyWithRetry, dn as logManager, Re as markConnectionHealthy, $t as markSsoDepositDone, en as markSsoDepositPending, Tr as matchesKeyCombo, Ui as mergeShortcuts, tn as mintSsoSessionTokens, On as nativeActionSheet, kn as nativeConfirm, An as nativeCopyText, jn as nativeImpact, Mn as nativeNotify, Nn as nativeOpenUrl, Pn as nativeSelection, Fn as nativeShare, In as nativeToast, Er as normalizeKey, Dr as normalizePlatformCombo, Sa as normalizeTourPath, ae as onDesktopUpdateState, oe as onDesktopWindowState, Or as parseKeyCombo, k as pluralize, d as progressTokens, Qi as publishPlanUsageSnapshot, Va as purchaseNativeProduct, ai as readAnalyticsConsent, oi as readAnalyticsConsentChoice, Rn as readInitialNetworkStatus, Ot as readShellSsoCookie, nn as readSsoDepositState, St as redirectToLogin, zn as reduceNetworkStatus, se as registerDesktopNavigator, Ca as registerTourRouteCatalog, et as resetAppClients, Jr as resolveActionSheetOutcome, Na as resolveAppShellObservabilityConfig, fe as resolveAuthBridgeConfig, ue as resolveGatewayBases, Je as resolveGatewayUrl, ce as resolveGatewayUrls, pe as resolveShellAuthBridgeConfig, wa as resolveTourTargetPath, Ha as restoreNativePurchases, si as setAnalyticsConsent, kt as setSSoCookie, At as setShellSsoCookies, hn as setUserContext, rn as shouldAttemptSsoDeposit, kr as shouldEnableKeyboardShortcuts, Ar as shouldIgnoreShortcut, Se as shouldShowBreadcrumb, Wa as shouldShowNativeWelcome, Ce as shouldShowSidebar, ze as shouldToastBackendError, A as slugify, f as statusTokens, de as suppressConsole, j as toCamelCase, M as toPascalCase, p as trendTokens, N as truncateText, Yr as useActionSheet, qn as useActorProfiles, ft as useApolloClient, Wr as useAppState, Ni as useAsync, Pi as useAsyncImmediate, Da as useAutoStartTour, _i as useBreakpoint, ki as useConditionalToggle, e as useCopyToClipboard, ta as useCurrentContextSearchParams, mi as useDebounce, Xr as useDesktop, Zr as useDesktopUpdateState, Qr as useDesktopWindowState, Gr as useDeviceInfo, di as useEvent, fi as useEventBus, pi as useEventEmitter, Ci as useExclusiveMenu, pr as useFeatureFlag, mr as useFeatureFlagDetails, hr as useFeatureFlagValue, fr as useFeatureFlags, nt as useGateway, rt as useGatewayClient, Kr as useHaptics, Gi as useHasAnimated, ot as useHasAuthToken, Ri as useHotkeys, ua as useIsTourPlaying, xi as useKeyPress, Si as useKeyboardShortcut, Li as useKeyboardShortcuts, pt as useLazyQuery, wi as useLocalStorage, Wi as useLogger, t as useMediaQuery, ra as useMicrofrontendContext, vi as useMobileBreakpoint, mt as useMutation, Ur as useNativeKeyboard, Vr as useNativePlatform, Bn as useNetworkStatus, yi as useOnClickOutside, bi as useOnClickOutsideWithRef, cr as usePWA, Mi as usePagination, ga as usePlayTour, Ei as usePrevious, Di as usePreviousDistinct, Oi as usePreviousHistory, Wn as usePullToRefresh, ht as useQuery, Xi as useQuotaErrorToast, qi as useRecordProductVisit, Ki as useReferralAttribution, on as useRegistryHelpers, Hr as useSafeArea, it as useSafeGateway, at as useSafeGatewayClient, Oa as useSafeToursContext, Ti as useSessionStorage, sn as useShellNavigate, zi as useShortcutHelp, da as useStartTour, qr as useStatusBar, fa as useStopTour, gt as useSubscription, hi as useThrottle, Ai as useToggle, ji as useToggleObject, oa as useTourPlayer, pa as useTourPlayerContext, ka as useTours, Aa as useToursContext, $i as useUpgradePrompt, Lr as useVoiceInput, Ta as withTourProgressStatus };
135
+ export { Rr as ASSISTANT_WIDGET_TOGGLE_EVENT, er as AccessDenied, Gn as ActorIdentity, ri as AnalyticsConsentBanner, ct as ApolloClient, lt as ApolloProvider, ur as AppErrorBoundary, an as AppInitializer, La as AppShellProvider, zr as AssistantWidget, je as BACKEND_ERROR_EVENT, gi as BREAKPOINTS, ni as BackendAuditSink, ti as BroadcastChannelSink, ve as COMMON_SHELL_LESS_ROUTES, Me as CONNECTION_STATUS_EVENT, sr as ConditionalShell, fn as ConsoleTransport, _r as ContextConversationWidget, we as DEFAULT_PAGE_SIZE, ye as DEFAULT_SHELL_CONFIG, I as DESKTOP_UPDATE_UNSUPPORTED, L as DESKTOP_WINDOW_STATE_DEFAULT, $r as DesktopUpdateToast, ei as DevtoolsSink, Jn as ErrorBoundary, nr as ErrorFallback, li as EventBusProvider, Xa as FE_SHARED_VERSION, dr as FeatureFlagProvider, gr as FeatureGate, Te as GATEWAYS, Bi as GLOBAL_SHORTCUT_CATEGORIES, tt as GatewayProvider, ut as InMemoryCache, jr as KeyboardHelpDialogWrapper, rr as LoadingFallback, cn as LogLevel, un as LogManager, ln as Logger, Fi as MODIFIER_KEYS, Br as Markdown, sa as MicrofrontendContext, or as MicrofrontendErrorBoundary, za as MicrofrontendProvider, ci as OtelBrowserSink, na as PLAN_USAGE_SNAPSHOT_EVENT, Ii as PLATFORM_TYPES, me as PRODUCTS, he as PRODUCT_URLS, Vn as PULL_TO_REFRESH_THRESHOLD, Ji as PUSH_DEVICE_ID_STORAGE_KEY, lr as PWAInstallBanner, ir as PageLoadingFallback, Zn as PermissionButton, tr as PermissionDenied, Qn as PermissionGate, $n as PermissionLink, vn as QUOTA_EXHAUSTED_CODE, $i as QUOTA_EXHAUSTED_EVENT, Mr as QuotaMeter, yn as RESOURCE_CAP_EXCEEDED_CODE, Yn as RequireAuth, Xn as RequireGuest, ii as RybbitSink, Ye as SSELink, Vt as SSORedirectSpinner, Kt as SSO_DEPOSITED_PARAM, bn as STORAGE_QUOTA_EXCEEDED_CODE, Ln as SafeAreaView, ar as SectionLoadingFallback, Ia as TourInitializer, ya as TourPlayer, ma as TourPlayerProvider, fa as TourSpotlight, pa as TourTooltip, Ba as TourTrigger, ba as TourTriggerButton, ja as ToursProvider, xn as UPGRADE_ERROR_CODES, Nr as UPGRADE_PROMPT_EVENT, Ir as UpgradeInlineBanner, Pr as UpgradePromptModal, st as WsLink, Va as acknowledgeNativePurchase, r as alertTokens, aa as appendContextToPath, _t as attemptTokenRefresh, qt as beginSsoNavigation, R as bootDesktopShell, Kn as buildActorFallback, Sn as buildQuotaExhaustedMessage, Jt as buildSsoDepositUrl, m as capitalizeFirst, h as capitalizeWords, i as categoryTokens, Ht as checkRemoteSLO, Ut as checkSLO, vt as clearAuthSessionStorage, Be as clearGraphqlFetchResponseCache, Wt as clearLocalAuthState, Ct as clearSSoCookie, wt as clearShellSsoCookies, Yt as clearSsoDepositState, Xt as clearSsoNavigation, pn as clearUserContext, Dn as cn, Hn as computePullOffset, Un as computePullProgress, Zt as consumeSsoDepositMarker, n as createApolloClient, ui as createEventBus, Vi as createGlobalShortcuts, Xe as createGraphQLClient, gn as createProfileScopedStorage, z as desktopCheckForUpdates, B as desktopDeepLinkToPath, V as desktopInstallUpdate, H as desktopNotify, U as desktopOpenExternal, W as desktopSetBadgeCount, G as desktopSetLocale, K as desktopSetTheme, q as desktopSetTrayQuickActions, la as detectDeviceType, vr as detectPlatform, Ne as dispatchBackendErrorEvent, ea as dispatchQuotaExhausted, Fr as dispatchUpgradePrompt, Pe as extractBackendError, Cn as extractQuotaExhaustedExtensions, wn as extractUpgradeErrorExtensions, g as formatBytes, _ as formatCompactNumber, v as formatCurrency, y as formatCurrencyCompact, b as formatDate, x as formatDateTime, S as formatDuration, yr as formatKeyCombo, C as formatList, w as formatNumber, T as formatOrdinal, E as formatPercentage, D as formatRelativeTime, O as formatTime, a as getAlertTokens, o as getCategoryTokens, J as getDesktopAuthBridgeConfig, Y as getDesktopBridge, X as getDesktopGatewayBases, Z as getDesktopGatewayUrls, Q as getDesktopRuntimeConfig, $ as getDesktopUpdateState, ee as getDesktopWindowState, br as getDisplayKeysForPlatform, Ee as getGatewayConfig, De as getGatewayUrl, Ze as getGlobalClient, Hi as getGlobalShortcutsByCategory, Oe as getGraphQLEndpoint, te as getLegacyDesktopRuntime, jt as getNativeBridge, Ja as getNativeEntryRoutes, Ha as getNativeProducts, Ua as getNativePurchases, Yi as getOrCreatePushDeviceId, Mt as getPlatform, ge as getProductUrl, _e as getProductsWithUrls, _n as getProfileScopedKey, s as getProgressTokens, ua as getResponsiveSelector, Gt as getSSORedirectUrl, Tt as getSSoCookie, be as getShellConfig, xr as getShortcutLabel, c as getStatusBadgeTokens, l as getStatusTokens, Ve as getStoredAuthToken, He as getStoredLocale, Ue as getStoredOrganizationId, We as getStoredProjectId, Ge as getStoredWorkspaceId, Ke as getStoredWorkspaceToken, Sa as getTourContextRank, Ca as getTourRouteCatalog, wa as getTourRouteModules, Ta as getTourRoutePages, u as getTrendTokens, Qe as getWorkspaceClient, ke as getWorkspaceTokenPayload, dt as gql, qe as graphqlFetch, yt as hasAuthGraphQLErrors, $e as initializeAppClients, mn as initializeLogger, ne as installDesktopDeepLinkHandler, re as installDesktopNavigateHandler, le as installGatewayFetchRewrite, Wa as installNativeIAP, Fe as isAbortError, Nt as isAndroid, bt as isAuthGraphQLError, xt as isAuthNetworkError, Ie as isBackendErrorDisplay, P as isChunkLoadError, ie as isDesktop, Pt as isElectron, Ft as isIOS, It as isInstalledApp, Sr as isMac, Cr as isMobileDevice, Lt as isNative, Ga as isNativeIAPAvailable, Tn as isQuotaExhaustedError, Et as isSharedSsoCookieDomain, xe as isShellLessRoute, Qt as isSsoNavigationPending, Rt as isStandalonePWA, wr as isTabletDevice, Ea as isTourVisibleForContext, Le as isTransportError, Dt as isTrustedSsoOrigin, En as isUpgradeError, zt as isWeb, Bt as isWebBrowser, Ae as isWorkspaceTokenValidForContext, F as lazyWithRetry, dn as logManager, Re as markConnectionHealthy, $t as markSsoDepositDone, en as markSsoDepositPending, Tr as matchesKeyCombo, Ui as mergeShortcuts, tn as mintSsoSessionTokens, On as nativeActionSheet, kn as nativeConfirm, An as nativeCopyText, jn as nativeImpact, Mn as nativeNotify, Nn as nativeOpenUrl, Pn as nativeSelection, Fn as nativeShare, In as nativeToast, Er as normalizeKey, Dr as normalizePlatformCombo, Da as normalizeTourPath, ae as onDesktopUpdateState, oe as onDesktopWindowState, Or as parseKeyCombo, k as pluralize, d as progressTokens, ra as publishPlanUsageSnapshot, Ka as purchaseNativeProduct, ai as readAnalyticsConsent, oi as readAnalyticsConsentChoice, Rn as readInitialNetworkStatus, Ot as readShellSsoCookie, nn as readSsoDepositState, St as redirectToLogin, zn as reduceNetworkStatus, se as registerDesktopNavigator, Xi as registerPushDevice, Oa as registerTourRouteCatalog, et as resetAppClients, Jr as resolveActionSheetOutcome, Ra as resolveAppShellObservabilityConfig, fe as resolveAuthBridgeConfig, ue as resolveGatewayBases, Je as resolveGatewayUrl, ce as resolveGatewayUrls, pe as resolveShellAuthBridgeConfig, ka as resolveTourTargetPath, qa as restoreNativePurchases, si as setAnalyticsConsent, kt as setSSoCookie, At as setShellSsoCookies, hn as setUserContext, rn as shouldAttemptSsoDeposit, kr as shouldEnableKeyboardShortcuts, Ar as shouldIgnoreShortcut, Se as shouldShowBreadcrumb, Ya as shouldShowNativeWelcome, Ce as shouldShowSidebar, ze as shouldToastBackendError, A as slugify, f as statusTokens, de as suppressConsole, j as toCamelCase, M as toPascalCase, p as trendTokens, N as truncateText, Zi as unregisterPushDevice, Yr as useActionSheet, qn as useActorProfiles, ft as useApolloClient, Wr as useAppState, Ni as useAsync, Pi as useAsyncImmediate, Ma as useAutoStartTour, _i as useBreakpoint, ki as useConditionalToggle, e as useCopyToClipboard, oa as useCurrentContextSearchParams, mi as useDebounce, Xr as useDesktop, Zr as useDesktopUpdateState, Qr as useDesktopWindowState, Gr as useDeviceInfo, di as useEvent, fi as useEventBus, pi as useEventEmitter, Ci as useExclusiveMenu, pr as useFeatureFlag, mr as useFeatureFlagDetails, hr as useFeatureFlagValue, fr as useFeatureFlags, nt as useGateway, rt as useGatewayClient, Kr as useHaptics, Gi as useHasAnimated, ot as useHasAuthToken, Ri as useHotkeys, ha as useIsTourPlaying, xi as useKeyPress, Si as useKeyboardShortcut, Li as useKeyboardShortcuts, pt as useLazyQuery, wi as useLocalStorage, Wi as useLogger, t as useMediaQuery, ca as useMicrofrontendContext, vi as useMobileBreakpoint, mt as useMutation, Ur as useNativeKeyboard, Vr as useNativePlatform, Bn as useNetworkStatus, yi as useOnClickOutside, bi as useOnClickOutsideWithRef, cr as usePWA, Mi as usePagination, xa as usePlayTour, Ei as usePrevious, Di as usePreviousDistinct, Oi as usePreviousHistory, Wn as usePullToRefresh, Qi as usePushDeviceRegistration, ht as useQuery, ta as useQuotaErrorToast, qi as useRecordProductVisit, Ki as useReferralAttribution, on as useRegistryHelpers, Hr as useSafeArea, it as useSafeGateway, at as useSafeGatewayClient, Na as useSafeToursContext, Ti as useSessionStorage, sn as useShellNavigate, zi as useShortcutHelp, ga as useStartTour, qr as useStatusBar, _a as useStopTour, gt as useSubscription, hi as useThrottle, Ai as useToggle, ji as useToggleObject, da as useTourPlayer, va as useTourPlayerContext, Pa as useTours, Fa as useToursContext, ia as useUpgradePrompt, Lr as useVoiceInput, Aa as withTourProgressStatus };
@@ -44,11 +44,12 @@ export { configureKeyboard, keyboardHandlers, KEYBOARD_HEIGHT_CSS_VAR, KEYBOARD_
44
44
  export { getLastNetworkStatus, installNetworkListener, NETWORK_STATUS_EVENT } from './network';
45
45
  export { applyStatusBarTheme, DARK_FAMILY_THEMES, installStatusBarThemeListener, isDarkThemeName, resolveDocumentIsDark, statusBarDetailIsDark, type StatusBarThemeDetail, } from './system-bars';
46
46
  export { notifyOtaReady } from './ota';
47
- export { installPushNotifications, requestPushPermission, PUSH_TOKEN_EVENT } from './push';
47
+ export { emitPushToken, installPushNotifications, requestPushPermission, PUSH_TOKEN_EVENT, } from './push';
48
+ export { getWebPushManifestConfig, getWebPushSubscription, installWebPushMessageBridge, isWebPushSupported, requestWebPushPermission, resetWebPushForTests, resolveVapidPublicKey, serializeWebPushSubscription, subscribeWebPush, unsubscribeWebPush, urlBase64ToUint8Array, SW_NOTIFICATION_CLICK_MESSAGE, SW_PUSH_SUBSCRIPTION_CHANGE_MESSAGE, WEB_PUSH_MANIFEST_KEY, type WebPushManifestConfig, type WebPushSubscribeOptions, } from './web-push';
48
49
  export { installPwa, installPwaPrompt, isPwaEligibleHost, resetPwaForTests, PWA_INSTALLED_EVENT, PWA_INSTALL_AVAILABLE_EVENT, PWA_UPDATE_READY_EVENT, } from './pwa';
49
50
  export { configureElectronGlobalKey, getDesktopBridge, getElectronGlobalKey, getLegacyElectronBridge, isDesktopShell, } from './desktop-bridge';
50
51
  export { defineCapacitorConfig, type CapacitorConfigLike } from './capacitor-config';
51
- export { defineWebManifest, type WebManifestIcon, type WebManifestLike, type WebManifestShortcut, } from './web-manifest';
52
+ export { defineWebManifest, type WebManifestIcon, type WebManifestLike, type WebManifestPushConfig, type WebManifestShortcut, } from './web-manifest';
52
53
  export { renderServiceWorker, SERVICE_WORKER_TEMPLATE } from './service-worker';
53
54
  export type { AuthInterceptOptions, BackButtonHandlers, BeforeInstallPromptEventLike, BootNativeShellOptions, CapacitorListenerHandleLike, CapacitorUpdaterLike, DeepLinkDetail, LegacyElectronBridge, MobileRuntimeHooks, NativeConfig, NativePreviewMode, NativeShellHandle, NativeShellPlatform, NetworkHooks, NetworkStatusDetail, OptionalPluginLoaders, PushActionPerformedLike, PushNotificationSchemaLike, PushNotificationsLike, PushNotificationsLoader, PushOptions, PushPermissionStateLike, PushTokenLike, PwaOptions, SplashOptions, UpdaterLoader, } from './types';
54
55
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell-native/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAAE,eAAe,EAAE,4BAA4B,EAAE,MAAM,QAAQ,CAAC;AAGvE,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AAGnB,OAAO,EA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EAC1B,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,qBAAqB,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EACL,iBAAiB,EACjB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,mBAAmB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAGhF,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,4BAA4B,EAC5B,sBAAsB,EACtB,2BAA2B,EAC3B,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,uBAAuB,EACvB,aAAa,EACb,UAAU,EACV,aAAa,EACb,aAAa,GACd,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell-native/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAAE,eAAe,EAAE,4BAA4B,EAAE,MAAM,QAAQ,CAAC;AAGvE,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,uBAAuB,EAC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
+ import { PushTokenEventDetail } from '../shared/native/types';
1
2
  import { PushNotificationsLoader, PushOptions } from './types';
2
3
  export declare const PUSH_TOKEN_EVENT = "burdenoff:pushToken";
4
+ /**
5
+ * Publish a push token to the rest of the app: `window.__burdenoffPushToken`
6
+ * (so a consumer mounting later can replay it — the OS `registration` callback
7
+ * fires during boot, before React exists) plus the `burdenoff:pushToken` event.
8
+ *
9
+ * Shared with `web-push.ts` so a browser subscription and a native token reach
10
+ * `installPushDeviceRegistration()` through exactly one code path.
11
+ */
12
+ export declare function emitPushToken(value: string, platform: PushTokenEventDetail['platform']): void;
3
13
  /**
4
14
  * Install push listeners (registration → dispatch `burdenoff:pushToken` + set
5
15
  * `window.__burdenoffPushToken`; notification tap → deep-link navigator).
@@ -1 +1 @@
1
- {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/shell-native/push.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAGV,uBAAuB,EACvB,WAAW,EACZ,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAkCtD;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,uBAAuB,EAC/B,OAAO,GAAE,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,sBAAsB,GAAG,wBAAwB,CAAM,GAC7F,OAAO,CAAC,IAAI,CAAC,CAsCf;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,CAc9D"}
1
+ {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/shell-native/push.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAGV,uBAAuB,EACvB,WAAW,EACZ,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAEtD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,CAAC,UAAU,CAAC,GAAG,IAAI,CAK7F;AAkCD;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,uBAAuB,EAC/B,OAAO,GAAE,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,sBAAsB,GAAG,wBAAwB,CAAM,GAC7F,OAAO,CAAC,IAAI,CAAC,CAoCf;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,CAc9D"}
@@ -1,18 +1,27 @@
1
1
  import { getNativePlatform as e, isRealNativePlatform as t } from "./platform.js";
2
2
  import { navigateDeepLinkPath as n } from "./deep-link.js";
3
3
  //#region src/shell-native/push.ts
4
- var r = "burdenoff:pushToken", i = null, a = null;
5
- async function o() {
6
- if (i) return i;
7
- if (!a || !t()) return null;
4
+ var r = "burdenoff:pushToken";
5
+ function i(e, t) {
6
+ if (typeof window > "u") return;
7
+ let n = {
8
+ value: e,
9
+ platform: t
10
+ };
11
+ window.__burdenoffPushToken = n, window.dispatchEvent(new CustomEvent(r, { detail: n }));
12
+ }
13
+ var a = null, o = null;
14
+ async function s() {
15
+ if (a) return a;
16
+ if (!o || !t()) return null;
8
17
  try {
9
- i = (await a()).PushNotifications ?? null;
18
+ a = (await o()).PushNotifications ?? null;
10
19
  } catch {
11
- i = null;
20
+ a = null;
12
21
  }
13
- return i;
22
+ return a;
14
23
  }
15
- function s(e) {
24
+ function c(e) {
16
25
  let t = e.notification.data;
17
26
  if (!t || typeof t != "object") return null;
18
27
  let n = t.route;
@@ -26,30 +35,26 @@ function s(e) {
26
35
  }
27
36
  return null;
28
37
  }
29
- async function c(t, c = {}) {
30
- a !== t && (i = null, a = t);
31
- let l = await o();
38
+ async function l(t, r = {}) {
39
+ o !== t && (a = null, o = t);
40
+ let l = await s();
32
41
  if (!l) return;
33
42
  let u = e();
34
43
  if (u !== "web") try {
35
44
  await l.addListener("registration", (e) => {
36
- let t = {
37
- value: e.value,
38
- platform: u
39
- };
40
- window.__burdenoffPushToken = t, window.dispatchEvent(new CustomEvent(r, { detail: t })), c.onToken?.(e.value, u);
45
+ i(e.value, u), r.onToken?.(e.value, u);
41
46
  }), await l.addListener("registrationError", (e) => {
42
47
  console.debug("[shell-native] Push registration error:", e.error);
43
48
  }), await l.addListener("pushNotificationReceived", (e) => {
44
- c.onNotificationReceived?.(e);
49
+ r.onNotificationReceived?.(e);
45
50
  }), await l.addListener("pushNotificationActionPerformed", (e) => {
46
- let t = s(e);
47
- t && n(t), c.onNotificationAction?.(e);
51
+ let t = c(e);
52
+ t && n(t), r.onNotificationAction?.(e);
48
53
  }), (await l.checkPermissions()).receive === "granted" && await l.register();
49
54
  } catch {}
50
55
  }
51
- async function l() {
52
- let e = await o();
56
+ async function u() {
57
+ let e = await s();
53
58
  if (!e) return !1;
54
59
  try {
55
60
  let t = await e.checkPermissions();
@@ -59,4 +64,4 @@ async function l() {
59
64
  }
60
65
  }
61
66
  //#endregion
62
- export { r as PUSH_TOKEN_EVENT, c as installPushNotifications, l as requestPushPermission };
67
+ export { r as PUSH_TOKEN_EVENT, i as emitPushToken, l as installPushNotifications, u as requestPushPermission };
@@ -1,5 +1,13 @@
1
1
  import { NativeConfig } from './types';
2
2
  export declare const SERVICE_WORKER_TEMPLATE: string;
3
- /** Render the canonical sw.js for a product (`version` defaults to `v1`). */
3
+ /**
4
+ * Render the canonical sw.js for a product (`version` defaults to `v1`).
5
+ *
6
+ * NOTE ON `version`: bumping it invalidates every cache on activate, and it is
7
+ * also what forces an already-installed service worker to be replaced promptly.
8
+ * A push/notificationclick change only reaches installed clients through the
9
+ * hourly `registration.update()` poll unless the version is bumped
10
+ * deliberately, so bump it in the release that enables push.
11
+ */
4
12
  export declare function renderServiceWorker(cfg: NativeConfig, version?: string): string;
5
13
  //# sourceMappingURL=service-worker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"service-worker.d.ts","sourceRoot":"","sources":["../../src/shell-native/service-worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,uBAAuB,QAyInC,CAAC;AAEF,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,YAAY,EAAE,OAAO,SAAO,GAAG,MAAM,CAK7E"}
1
+ {"version":3,"file":"service-worker.d.ts","sourceRoot":"","sources":["../../src/shell-native/service-worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,uBAAuB,QA8OnC,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,YAAY,EAAE,OAAO,SAAO,GAAG,MAAM,CAI7E"}
@@ -136,9 +136,110 @@ self.addEventListener('message', (event) => {
136
136
  self.skipWaiting();
137
137
  }
138
138
  });
139
+
140
+ // ---------------------------------------------------------------------------
141
+ // Push notifications.
142
+ //
143
+ // The deep-link contract is shared with the native path (fe-libs
144
+ // shell-native/push.ts): an app-relative "data.route" wins, "data.url" is
145
+ // reduced to pathname + search + hash, and anything else just opens the app.
146
+ // A push MUST show a notification -- "userVisibleOnly" is mandatory when
147
+ // subscribing and browsers revoke the subscription of an origin that pushes
148
+ // silently.
149
+ // ---------------------------------------------------------------------------
150
+
151
+ function pushNotificationRoute(data) {
152
+ if (!data || typeof data !== 'object') return null;
153
+ if (typeof data.route === 'string' && data.route.startsWith('/')) return data.route;
154
+ if (typeof data.url === 'string') {
155
+ try {
156
+ const parsed = new URL(data.url, self.location.origin);
157
+ return (parsed.pathname || '/') + parsed.search + parsed.hash;
158
+ } catch (_err) {
159
+ if (data.url.startsWith('/')) return data.url;
160
+ }
161
+ }
162
+ return null;
163
+ }
164
+
165
+ function readPushPayload(event) {
166
+ if (!event.data) return {};
167
+ try {
168
+ return event.data.json() || {};
169
+ } catch (_err) {
170
+ try {
171
+ return { notification: { body: event.data.text() } };
172
+ } catch (_textErr) {
173
+ return {};
174
+ }
175
+ }
176
+ }
177
+
178
+ self.addEventListener('push', (event) => {
179
+ const payload = readPushPayload(event);
180
+ const notification = payload.notification || {};
181
+ const data = payload.data || notification.data || {};
182
+ const title = notification.title || payload.title || '{{DISPLAY_NAME}}';
183
+ const options = {
184
+ body: notification.body || payload.body || '',
185
+ icon: notification.icon || '/icons/icon-192x192.png',
186
+ badge: '/icons/icon-96x96.png',
187
+ data: {
188
+ route: pushNotificationRoute(data),
189
+ notificationId: data.notificationId || null,
190
+ payload: data,
191
+ },
192
+ };
193
+ const tag = notification.tag || data.notificationId;
194
+ if (tag) options.tag = tag;
195
+ event.waitUntil(self.registration.showNotification(title, options));
196
+ });
197
+
198
+ self.addEventListener('notificationclick', (event) => {
199
+ event.notification.close();
200
+ const data = event.notification.data || {};
201
+ const route = typeof data.route === 'string' && data.route.startsWith('/') ? data.route : '/';
202
+ event.waitUntil(
203
+ self.clients.matchAll({ type: 'window', includeUncontrolled: true }).then((clients) => {
204
+ for (const client of clients) {
205
+ if (typeof client.focus !== 'function') continue;
206
+ // The app is already open: hand the route to the running router instead
207
+ // of reloading the SPA (openWindow would boot a second instance).
208
+ client.postMessage({ type: 'BURDENOFF_NOTIFICATION_CLICK', route: route, data: data });
209
+ return client.focus();
210
+ }
211
+ return self.clients.openWindow(route);
212
+ })
213
+ );
214
+ });
215
+
216
+ self.addEventListener('pushsubscriptionchange', (event) => {
217
+ const previous = event.oldSubscription || null;
218
+ const applicationServerKey =
219
+ previous && previous.options ? previous.options.applicationServerKey : null;
220
+ if (!applicationServerKey) return;
221
+ // Re-subscribe with the SAME application server key (a different key would
222
+ // produce a subscription the sender's project cannot push to), then tell the
223
+ // page: only it holds the access token "registerDeviceToken" needs.
224
+ event.waitUntil(
225
+ self.registration.pushManager
226
+ .subscribe({ userVisibleOnly: true, applicationServerKey: applicationServerKey })
227
+ .then((subscription) =>
228
+ self.clients.matchAll({ type: 'window', includeUncontrolled: true }).then((clients) => {
229
+ for (const client of clients) {
230
+ client.postMessage({
231
+ type: 'BURDENOFF_PUSH_SUBSCRIPTION_CHANGE',
232
+ subscription: subscription.toJSON(),
233
+ });
234
+ }
235
+ })
236
+ )
237
+ .catch(() => undefined)
238
+ );
239
+ });
139
240
  `;
140
241
  function t(t, n = "v1") {
141
- return e.replaceAll("{{SLUG}}", t.slug).replaceAll("{{CACHE_VERSION}}", n);
242
+ return e.replaceAll("{{SLUG}}", t.slug).replaceAll("{{DISPLAY_NAME}}", t.displayName).replaceAll("{{CACHE_VERSION}}", n);
142
243
  }
143
244
  //#endregion
144
245
  export { e as SERVICE_WORKER_TEMPLATE, t as renderServiceWorker };
@@ -1,7 +1,7 @@
1
1
  import { NativePreviewMode } from '../shared/native/types';
2
2
  export type { NativePreviewMode } from '../shared/native/types';
3
3
  /** Capacitor platform string, possibly overridden by a presentation preview. */
4
- export type NativeShellPlatform = "ios" | "android" | "web";
4
+ export type NativeShellPlatform = 'ios' | 'android' | 'web';
5
5
  /**
6
6
  * Per-shell native configuration — the shape of each product's `native.config.json`.
7
7
  *
@@ -65,12 +65,24 @@ export interface NativeConfig {
65
65
  status?: string;
66
66
  };
67
67
  push?: boolean;
68
+ /**
69
+ * Browser Web Push configuration for this product. Supplied by the fleet
70
+ * generator from the confidential product -> Firebase project map; stamped
71
+ * into `public/manifest.json` (see `defineWebManifest`) because the service
72
+ * worker cannot read build variables. Public key only — never a private one.
73
+ */
74
+ webPush?: {
75
+ /** VAPID application-server PUBLIC key, base64url. Client-safe. */
76
+ vapidPublicKey: string;
77
+ /** Firebase project this product routes through, e.g. `burdenoff-push-4`. */
78
+ fcmProject?: string;
79
+ };
68
80
  ota?: {
69
81
  /** CapGo mobile app id (usually the Capacitor appId). */
70
82
  mobileAppId?: string;
71
83
  channel?: string;
72
84
  };
73
- orientation?: "portrait" | "any";
85
+ orientation?: 'portrait' | 'any';
74
86
  devServerPort?: number;
75
87
  /** Manifest `background_color` (splash + PWA). Falls back to `brandColor`. */
76
88
  backgroundColor?: string;
@@ -161,7 +173,7 @@ export interface PushActionPerformedLike {
161
173
  actionId?: string;
162
174
  notification: PushNotificationSchemaLike;
163
175
  }
164
- export type PushPermissionStateLike = "prompt" | "prompt-with-rationale" | "granted" | "denied";
176
+ export type PushPermissionStateLike = 'prompt' | 'prompt-with-rationale' | 'granted' | 'denied';
165
177
  /** Structural subset of `@capacitor/push-notifications`' `PushNotifications`. */
166
178
  export interface PushNotificationsLike {
167
179
  checkPermissions(): Promise<{
@@ -171,12 +183,12 @@ export interface PushNotificationsLike {
171
183
  receive: PushPermissionStateLike;
172
184
  }>;
173
185
  register(): Promise<void>;
174
- addListener(eventName: "registration", listener: (token: PushTokenLike) => void): Promise<CapacitorListenerHandleLike>;
175
- addListener(eventName: "registrationError", listener: (error: {
186
+ addListener(eventName: 'registration', listener: (token: PushTokenLike) => void): Promise<CapacitorListenerHandleLike>;
187
+ addListener(eventName: 'registrationError', listener: (error: {
176
188
  error: string;
177
189
  }) => void): Promise<CapacitorListenerHandleLike>;
178
- addListener(eventName: "pushNotificationReceived", listener: (notification: PushNotificationSchemaLike) => void): Promise<CapacitorListenerHandleLike>;
179
- addListener(eventName: "pushNotificationActionPerformed", listener: (action: PushActionPerformedLike) => void): Promise<CapacitorListenerHandleLike>;
190
+ addListener(eventName: 'pushNotificationReceived', listener: (notification: PushNotificationSchemaLike) => void): Promise<CapacitorListenerHandleLike>;
191
+ addListener(eventName: 'pushNotificationActionPerformed', listener: (action: PushActionPerformedLike) => void): Promise<CapacitorListenerHandleLike>;
180
192
  }
181
193
  export type UpdaterLoader = () => Promise<{
182
194
  CapacitorUpdater: CapacitorUpdaterLike;
@@ -193,7 +205,7 @@ export interface OptionalPluginLoaders {
193
205
  export interface PushOptions {
194
206
  enabled: boolean;
195
207
  /** Called with the APNs/FCM token once registration succeeds. */
196
- onToken?(token: string, platform: "ios" | "android"): void;
208
+ onToken?(token: string, platform: 'ios' | 'android'): void;
197
209
  /** Called when the user taps a notification (after the deep-link navigator ran). */
198
210
  onNotificationAction?(action: PushActionPerformedLike): void;
199
211
  /** Called when a notification is received in the foreground. */
@@ -278,7 +290,7 @@ export interface NetworkStatusDetail {
278
290
  export interface BeforeInstallPromptEventLike extends Event {
279
291
  readonly platforms?: string[];
280
292
  readonly userChoice?: Promise<{
281
- outcome: "accepted" | "dismissed";
293
+ outcome: 'accepted' | 'dismissed';
282
294
  platform: string;
283
295
  }>;
284
296
  prompt(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shell-native/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,gFAAgF;AAChF,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,OAAO,CAAC,EAAE;QACR,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EA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;IACtC,6EAA6E;IAC7E,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACvD,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC;CACjD;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,oDAAoD;AACpD,MAAM,WAAW,4BAA6B,SAAQ,KAAK;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;QAC5B,OAAO,EAAE,UAAU,GAAG,WAAW,CAAC;QAClC,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,qFAAqF;QACrF,2BAA2B,CAAC,EAAE,4BAA4B,GAAG,IAAI,CAAC;KACnE;CACF"}
@@ -10,6 +10,26 @@ export interface WebManifestShortcut {
10
10
  url: string;
11
11
  description?: string;
12
12
  }
13
+ /**
14
+ * Non-standard manifest member carrying this product's Web Push configuration.
15
+ *
16
+ * WHY THE MANIFEST: the VAPID application-server key is per Firebase PROJECT
17
+ * (the fleet is split across five) and the service worker cannot read
18
+ * `import.meta.env` — it is a static `public/` file, not a Vite entry. The
19
+ * manifest is the per-product artefact the fleet generator ALREADY stamps from
20
+ * `native.config.json`, so the key rides an existing mechanism instead of a new
21
+ * build variable that has to be added to both environment blocks of 38
22
+ * `static-site-deploy.yml` files (miss one and that environment ships
23
+ * `undefined` with no build error).
24
+ *
25
+ * The public half of a VAPID pair is client-safe: it is handed to the push
26
+ * service on every subscribe. The private half stays in `confidential/`.
27
+ * Unknown manifest members are ignored by the spec and by every browser.
28
+ */
29
+ export interface WebManifestPushConfig {
30
+ vapid_public_key: string;
31
+ fcm_project?: string;
32
+ }
13
33
  export interface WebManifestLike {
14
34
  id: string;
15
35
  name: string;
@@ -28,6 +48,7 @@ export interface WebManifestLike {
28
48
  lang: string;
29
49
  related_applications: unknown[];
30
50
  prefer_related_applications: boolean;
51
+ burdenoff_push?: WebManifestPushConfig;
31
52
  }
32
53
  export declare function defineWebManifest(cfg: NativeConfig, extra?: {
33
54
  shortcuts?: WebManifestShortcut[];
@@ -1 +1 @@
1
- {"version":3,"file":"web-manifest.d.ts","sourceRoot":"","sources":["../../src/shell-native/web-manifest.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE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AAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAClC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB,EAAE,OAAO,EAAE,CAAC;IAChC,2BAA2B,EAAE,OAAO,CAAC;IACrC,cAAc,CAAC,EAAE,qBAAqB,CAAC;CACxC;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,YAAY,EACjB,KAAK,GAAE;IAAE,SAAS,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CAAO,GACvE,eAAe,CA+DjB"}
@@ -49,7 +49,10 @@ function e(e, t = {}) {
49
49
  related_applications: [],
50
50
  prefer_related_applications: !1
51
51
  };
52
- return t.shortcuts?.length && (n.shortcuts = t.shortcuts), n;
52
+ return t.shortcuts?.length && (n.shortcuts = t.shortcuts), e.webPush?.vapidPublicKey && (n.burdenoff_push = {
53
+ vapid_public_key: e.webPush.vapidPublicKey,
54
+ ...e.webPush.fcmProject ? { fcm_project: e.webPush.fcmProject } : {}
55
+ }), n;
53
56
  }
54
57
  //#endregion
55
58
  export { e as defineWebManifest };
@@ -0,0 +1,74 @@
1
+ /** Manifest member the fleet generator stamps with the per-project push config. */
2
+ export declare const WEB_PUSH_MANIFEST_KEY = "burdenoff_push";
3
+ export interface WebPushManifestConfig {
4
+ /** VAPID application-server public key, base64url, client-safe. */
5
+ vapid_public_key?: string;
6
+ /** Firebase project the product routes through, e.g. `burdenoff-push-4`. */
7
+ fcm_project?: string;
8
+ }
9
+ /** True when this browser can subscribe to Web Push at all. */
10
+ export declare function isWebPushSupported(): boolean;
11
+ /**
12
+ * Read the generated manifest's push block. Cached for the page: the manifest
13
+ * is a static asset and one fetch per session is plenty.
14
+ */
15
+ export declare function getWebPushManifestConfig(): Promise<WebPushManifestConfig | null>;
16
+ /** Resolve the VAPID public key for this shell, or null when push is unconfigured. */
17
+ export declare function resolveVapidPublicKey(explicit?: string): Promise<string | null>;
18
+ /**
19
+ * base64url (what the routing table stores) → the `BufferSource`
20
+ * `pushManager.subscribe()` wants.
21
+ *
22
+ * Backed by an explicit `ArrayBuffer` rather than `new Uint8Array(length)`:
23
+ * the latter is typed `Uint8Array<ArrayBufferLike>`, which could be a
24
+ * `SharedArrayBuffer` and so is not a `BufferSource`.
25
+ */
26
+ export declare function urlBase64ToUint8Array(base64Url: string): Uint8Array<ArrayBuffer>;
27
+ /**
28
+ * The device identity we register for a browser: the endpoint plus the two
29
+ * client keys a sender needs to encrypt a payload (RFC 8291). Stable for the
30
+ * life of the subscription and re-issued by the service worker's
31
+ * `pushsubscriptionchange` handler when the browser rotates it.
32
+ */
33
+ export declare function serializeWebPushSubscription(subscription: PushSubscription): string;
34
+ /** The current subscription, if this browser already has one. */
35
+ export declare function getWebPushSubscription(): Promise<PushSubscription | null>;
36
+ export interface WebPushSubscribeOptions {
37
+ /** Overrides the manifest-resolved key. */
38
+ vapidPublicKey?: string;
39
+ }
40
+ /**
41
+ * Subscribe (or reuse an existing subscription) and publish it as a push token.
42
+ * Assumes permission is ALREADY granted — it never prompts, so it is safe to
43
+ * call on a returning session to refresh the registration.
44
+ */
45
+ export declare function subscribeWebPush(options?: WebPushSubscribeOptions): Promise<PushSubscription | null>;
46
+ /**
47
+ * Ask for notification permission and subscribe on grant.
48
+ *
49
+ * CALL THIS FROM A USER GESTURE, IN CONTEXT — never at boot. See the module
50
+ * docblock: the prompt is one-shot on iOS and sticky everywhere.
51
+ *
52
+ * ```ts
53
+ * <Switch onCheckedChange={async (on) => {
54
+ * if (on) await requestWebPushPermission();
55
+ * else await unsubscribeWebPush();
56
+ * }} />
57
+ * ```
58
+ */
59
+ export declare function requestWebPushPermission(options?: WebPushSubscribeOptions): Promise<boolean>;
60
+ /** Sent by the generated `sw.js` when a notification is tapped. */
61
+ export declare const SW_NOTIFICATION_CLICK_MESSAGE = "BURDENOFF_NOTIFICATION_CLICK";
62
+ /** Sent by the generated `sw.js` after the browser rotated the subscription. */
63
+ export declare const SW_PUSH_SUBSCRIPTION_CHANGE_MESSAGE = "BURDENOFF_PUSH_SUBSCRIPTION_CHANGE";
64
+ /**
65
+ * Listen for the messages the generated service worker posts. Idempotent, and
66
+ * installed automatically by `subscribeWebPush()`; call it directly from a
67
+ * shell that wants notification taps routed before any subscribe happens.
68
+ */
69
+ export declare function installWebPushMessageBridge(): void;
70
+ /** Drop the browser subscription (push opt-out). Does not revoke permission. */
71
+ export declare function unsubscribeWebPush(): Promise<boolean>;
72
+ /** Test seam — clears the cached manifest lookup and the bridge guard. */
73
+ export declare function resetWebPushForTests(): void;
74
+ //# sourceMappingURL=web-push.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-push.d.ts","sourceRoot":"","sources":["../../src/shell-native/web-push.ts"],"names":[],"mappings":"AA8CA,mFAAmF;AACnF,eAAO,MAAM,qBAAqB,mBAAmB,CAAC;AAEtD,MAAM,WAAW,qBAAqB;IACpC,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,+DAA+D;AAC/D,wBAAgB,kBAAkB,IAAI,OAAO,CAQ5C;AAqBD;;;GAGG;AACH,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAOtF;AAED,sFAAsF;AACtF,wBAAsB,qBAAqB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAIrF;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,CAOhF;AAID;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,gBAAgB,GAAG,MAAM,CAEnF;AAWD,iEAAiE;AACjE,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAQ/E;AAED,MAAM,WAAW,uBAAuB;IACtC,2CAA2C;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CA+BlC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,OAAO,CAAC,CAclB;AAID,mEAAmE;AACnE,eAAO,MAAM,6BAA6B,iCAAiC,CAAC;AAC5E,gFAAgF;AAChF,eAAO,MAAM,mCAAmC,uCAAuC,CAAC;AAyBxF;;;;GAIG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAKlD;AAED,gFAAgF;AAChF,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC,CAQ3D;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,IAAI,IAAI,CAG3C"}
@@ -0,0 +1,106 @@
1
+ import { navigateDeepLinkPath as e } from "./deep-link.js";
2
+ import { emitPushToken as t } from "./push.js";
3
+ //#region src/shell-native/web-push.ts
4
+ var n = "burdenoff_push";
5
+ function r() {
6
+ return typeof window < "u" && typeof navigator < "u" && "serviceWorker" in navigator && "PushManager" in window && typeof Notification < "u";
7
+ }
8
+ var i = null;
9
+ function a() {
10
+ if (typeof document > "u") return "/manifest.json";
11
+ let e = document.querySelector("link[rel=\"manifest\"]")?.getAttribute("href");
12
+ return e && e.length > 0 ? e : "/manifest.json";
13
+ }
14
+ function o(e) {
15
+ if (!e || typeof e != "object") return null;
16
+ let t = e[n];
17
+ if (!t || typeof t != "object") return null;
18
+ let r = t;
19
+ return typeof r.vapid_public_key == "string" ? r : null;
20
+ }
21
+ async function s() {
22
+ return typeof fetch > "u" ? null : (i ??= fetch(a(), { credentials: "same-origin" }).then((e) => e.ok ? e.json() : null).then((e) => o(e)).catch(() => null), i);
23
+ }
24
+ async function c(e) {
25
+ return e && e.length > 0 ? e : (await s())?.vapid_public_key ?? null;
26
+ }
27
+ function l(e) {
28
+ let t = (e + "=".repeat((4 - e.length % 4) % 4)).replace(/-/g, "+").replace(/_/g, "/"), n = atob(t), r = new Uint8Array(new ArrayBuffer(n.length));
29
+ for (let e = 0; e < n.length; e += 1) r[e] = n.charCodeAt(e);
30
+ return r;
31
+ }
32
+ function u(e) {
33
+ return JSON.stringify(e.toJSON());
34
+ }
35
+ async function d() {
36
+ if (!r()) return null;
37
+ try {
38
+ return await navigator.serviceWorker.ready;
39
+ } catch {
40
+ return null;
41
+ }
42
+ }
43
+ async function f() {
44
+ let e = await d();
45
+ if (!e) return null;
46
+ try {
47
+ return await e.pushManager.getSubscription();
48
+ } catch {
49
+ return null;
50
+ }
51
+ }
52
+ async function p(e = {}) {
53
+ if (!r() || Notification.permission !== "granted") return null;
54
+ let n = await d();
55
+ if (!n) return null;
56
+ y();
57
+ try {
58
+ let r = await n.pushManager.getSubscription();
59
+ if (r) return t(u(r), "web"), r;
60
+ let i = await c(e.vapidPublicKey);
61
+ if (!i) return null;
62
+ let a = await n.pushManager.subscribe({
63
+ userVisibleOnly: !0,
64
+ applicationServerKey: l(i)
65
+ });
66
+ return t(u(a), "web"), a;
67
+ } catch {
68
+ return null;
69
+ }
70
+ }
71
+ async function m(e = {}) {
72
+ if (!r()) return !1;
73
+ try {
74
+ return Notification.permission === "denied" || Notification.permission !== "granted" && await Notification.requestPermission() !== "granted" ? !1 : await p(e) !== null;
75
+ } catch {
76
+ return !1;
77
+ }
78
+ }
79
+ var h = "BURDENOFF_NOTIFICATION_CLICK", g = "BURDENOFF_PUSH_SUBSCRIPTION_CHANGE", _ = !1;
80
+ function v(n) {
81
+ let r = n.data;
82
+ if (!r || typeof r != "object") return;
83
+ let i = r;
84
+ if (i.type === "BURDENOFF_NOTIFICATION_CLICK") {
85
+ typeof i.route == "string" && i.route.startsWith("/") && e(i.route);
86
+ return;
87
+ }
88
+ i.type === "BURDENOFF_PUSH_SUBSCRIPTION_CHANGE" && i.subscription && t(JSON.stringify(i.subscription), "web");
89
+ }
90
+ function y() {
91
+ _ || typeof navigator > "u" || !("serviceWorker" in navigator) || (navigator.serviceWorker.addEventListener("message", v), _ = !0);
92
+ }
93
+ async function b() {
94
+ let e = await f();
95
+ if (!e) return !1;
96
+ try {
97
+ return await e.unsubscribe();
98
+ } catch {
99
+ return !1;
100
+ }
101
+ }
102
+ function x() {
103
+ i = null, _ = !1;
104
+ }
105
+ //#endregion
106
+ export { h as SW_NOTIFICATION_CLICK_MESSAGE, g as SW_PUSH_SUBSCRIPTION_CHANGE_MESSAGE, n as WEB_PUSH_MANIFEST_KEY, s as getWebPushManifestConfig, f as getWebPushSubscription, y as installWebPushMessageBridge, r as isWebPushSupported, m as requestWebPushPermission, x as resetWebPushForTests, c as resolveVapidPublicKey, u as serializeWebPushSubscription, p as subscribeWebPush, b as unsubscribeWebPush, l as urlBase64ToUint8Array };
@@ -18,12 +18,13 @@ import { populateDeviceInfo as R } from "./shell-native/device.js";
18
18
  import { KEYBOARD_HEIGHT_CSS_VAR as z, KEYBOARD_OPEN_CLASS as B, configureKeyboard as V, keyboardHandlers as H } from "./shell-native/keyboard.js";
19
19
  import { NETWORK_STATUS_EVENT as U, getLastNetworkStatus as W, installNetworkListener as G } from "./shell-native/network.js";
20
20
  import { notifyOtaReady as K } from "./shell-native/ota.js";
21
- import { PUSH_TOKEN_EVENT as q, installPushNotifications as J, requestPushPermission as Y } from "./shell-native/push.js";
22
- import { PWA_INSTALLED_EVENT as X, PWA_INSTALL_AVAILABLE_EVENT as Z, PWA_UPDATE_READY_EVENT as Q, installPwa as $, installPwaPrompt as ee, isPwaEligibleHost as te, resetPwaForTests as ne } from "./shell-native/pwa.js";
23
- import { APP_READY_EVENT as re, armSplashSafetyTimer as ie, isAppReady as ae, markAppReady as oe, resetAppReadyForTests as se } from "./shell-native/splash.js";
24
- import { DARK_FAMILY_THEMES as ce, applyStatusBarTheme as le, installStatusBarThemeListener as ue, isDarkThemeName as de, resolveDocumentIsDark as fe, statusBarDetailIsDark as pe } from "./shell-native/system-bars.js";
25
- import { bootNativeShell as me, resetNativeShellBootForTests as he } from "./shell-native/boot.js";
26
- import { defineCapacitorConfig as ge } from "./shell-native/capacitor-config.js";
27
- import { defineWebManifest as _e } from "./shell-native/web-manifest.js";
28
- import { SERVICE_WORKER_TEMPLATE as ve, renderServiceWorker as ye } from "./shell-native/service-worker.js";
29
- export { re as APP_READY_EVENT, ce as DARK_FAMILY_THEMES, _ as DEFAULT_AUTH_INTERCEPT_PREFIXES, z as KEYBOARD_HEIGHT_CSS_VAR, B as KEYBOARD_OPEN_CLASS, t as NATIVE_PREVIEW_QUERY_PARAM, n as NATIVE_PREVIEW_STORAGE_KEY, U as NETWORK_STATUS_EVENT, q as PUSH_TOKEN_EVENT, X as PWA_INSTALLED_EVENT, Z as PWA_INSTALL_AVAILABLE_EVENT, Q as PWA_UPDATE_READY_EVENT, ve as SERVICE_WORKER_TEMPLATE, o as applyNativePlatformClass, r as applyNativePreview, le as applyStatusBarTheme, ie as armSplashSafetyTimer, me as bootNativeShell, N as clearDeepLinkNavigator, p as configureElectronGlobalKey, V as configureKeyboard, b as createDefaultBackButtonHandlers, P as deepLinkUrlToPath, ge as defineCapacitorConfig, _e as defineWebManifest, i as getActiveNativePreview, e as getDesktopBridge, m as getElectronGlobalKey, W as getLastNetworkStatus, h as getLegacyElectronBridge, s as getNativePlatform, D as impactFeedback, x as installBackButtonHandler, F as installDeepLinkHandler, w as installExternalUrlOpener, f as installMobileRuntimeHooks, v as installNativeAuthNavigationIntercept, M as installNativeBridge, G as installNetworkListener, J as installPushNotifications, $ as installPwa, ee as installPwaPrompt, ue as installStatusBarThemeListener, ae as isAppReady, de as isDarkThemeName, g as isDesktopShell, c as isNativePlatform, l as isNativePluginAvailable, u as isNativePreview, te as isPwaEligibleHost, d as isRealNativePlatform, H as keyboardHandlers, oe as markAppReady, I as navigateDeepLinkPath, O as notificationFeedback, K as notifyOtaReady, T as openExternalUrl, R as populateDeviceInfo, L as registerDeepLinkNavigator, ye as renderServiceWorker, Y as requestPushPermission, se as resetAppReadyForTests, he as resetNativeShellBootForTests, ne as resetPwaForTests, fe as resolveDocumentIsDark, a as resolveNativePreview, S as runBackButtonPrecedence, k as selectionFeedback, j as shareContent, C as showNativeActionSheet, y as showNativeConfirm, A as showNativeToast, pe as statusBarDetailIsDark, E as writeClipboardText };
21
+ import { PUSH_TOKEN_EVENT as q, emitPushToken as J, installPushNotifications as Y, requestPushPermission as X } from "./shell-native/push.js";
22
+ import { PWA_INSTALLED_EVENT as Z, PWA_INSTALL_AVAILABLE_EVENT as Q, PWA_UPDATE_READY_EVENT as $, installPwa as ee, installPwaPrompt as te, isPwaEligibleHost as ne, resetPwaForTests as re } from "./shell-native/pwa.js";
23
+ import { APP_READY_EVENT as ie, armSplashSafetyTimer as ae, isAppReady as oe, markAppReady as se, resetAppReadyForTests as ce } from "./shell-native/splash.js";
24
+ import { DARK_FAMILY_THEMES as le, applyStatusBarTheme as ue, installStatusBarThemeListener as de, isDarkThemeName as fe, resolveDocumentIsDark as pe, statusBarDetailIsDark as me } from "./shell-native/system-bars.js";
25
+ import { bootNativeShell as he, resetNativeShellBootForTests as ge } from "./shell-native/boot.js";
26
+ import { SW_NOTIFICATION_CLICK_MESSAGE as _e, SW_PUSH_SUBSCRIPTION_CHANGE_MESSAGE as ve, WEB_PUSH_MANIFEST_KEY as ye, getWebPushManifestConfig as be, getWebPushSubscription as xe, installWebPushMessageBridge as Se, isWebPushSupported as Ce, requestWebPushPermission as we, resetWebPushForTests as Te, resolveVapidPublicKey as Ee, serializeWebPushSubscription as De, subscribeWebPush as Oe, unsubscribeWebPush as ke, urlBase64ToUint8Array as Ae } from "./shell-native/web-push.js";
27
+ import { defineCapacitorConfig as je } from "./shell-native/capacitor-config.js";
28
+ import { defineWebManifest as Me } from "./shell-native/web-manifest.js";
29
+ import { SERVICE_WORKER_TEMPLATE as Ne, renderServiceWorker as Pe } from "./shell-native/service-worker.js";
30
+ export { ie as APP_READY_EVENT, le as DARK_FAMILY_THEMES, _ as DEFAULT_AUTH_INTERCEPT_PREFIXES, z as KEYBOARD_HEIGHT_CSS_VAR, B as KEYBOARD_OPEN_CLASS, t as NATIVE_PREVIEW_QUERY_PARAM, n as NATIVE_PREVIEW_STORAGE_KEY, U as NETWORK_STATUS_EVENT, q as PUSH_TOKEN_EVENT, Z as PWA_INSTALLED_EVENT, Q as PWA_INSTALL_AVAILABLE_EVENT, $ as PWA_UPDATE_READY_EVENT, Ne as SERVICE_WORKER_TEMPLATE, _e as SW_NOTIFICATION_CLICK_MESSAGE, ve as SW_PUSH_SUBSCRIPTION_CHANGE_MESSAGE, ye as WEB_PUSH_MANIFEST_KEY, o as applyNativePlatformClass, r as applyNativePreview, ue as applyStatusBarTheme, ae as armSplashSafetyTimer, he as bootNativeShell, N as clearDeepLinkNavigator, p as configureElectronGlobalKey, V as configureKeyboard, b as createDefaultBackButtonHandlers, P as deepLinkUrlToPath, je as defineCapacitorConfig, Me as defineWebManifest, J as emitPushToken, i as getActiveNativePreview, e as getDesktopBridge, m as getElectronGlobalKey, W as getLastNetworkStatus, h as getLegacyElectronBridge, s as getNativePlatform, be as getWebPushManifestConfig, xe as getWebPushSubscription, D as impactFeedback, x as installBackButtonHandler, F as installDeepLinkHandler, w as installExternalUrlOpener, f as installMobileRuntimeHooks, v as installNativeAuthNavigationIntercept, M as installNativeBridge, G as installNetworkListener, Y as installPushNotifications, ee as installPwa, te as installPwaPrompt, de as installStatusBarThemeListener, Se as installWebPushMessageBridge, oe as isAppReady, fe as isDarkThemeName, g as isDesktopShell, c as isNativePlatform, l as isNativePluginAvailable, u as isNativePreview, ne as isPwaEligibleHost, d as isRealNativePlatform, Ce as isWebPushSupported, H as keyboardHandlers, se as markAppReady, I as navigateDeepLinkPath, O as notificationFeedback, K as notifyOtaReady, T as openExternalUrl, R as populateDeviceInfo, L as registerDeepLinkNavigator, Pe as renderServiceWorker, X as requestPushPermission, we as requestWebPushPermission, ce as resetAppReadyForTests, ge as resetNativeShellBootForTests, re as resetPwaForTests, Te as resetWebPushForTests, pe as resolveDocumentIsDark, a as resolveNativePreview, Ee as resolveVapidPublicKey, S as runBackButtonPrecedence, k as selectionFeedback, De as serializeWebPushSubscription, j as shareContent, C as showNativeActionSheet, y as showNativeConfirm, A as showNativeToast, me as statusBarDetailIsDark, Oe as subscribeWebPush, ke as unsubscribeWebPush, Ae as urlBase64ToUint8Array, E as writeClipboardText };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/fe-libs",
3
- "version": "2026.823.2",
3
+ "version": "2026.825.1",
4
4
  "description": "Burdenoff frontend primitives and domain libraries",
5
5
  "type": "module",
6
6
  "bin": {