@burdenoff/microfe-kadaikodi 2026.730.1 → 2026.731.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.
@@ -1,5 +1,35 @@
1
1
  import { ViewMode } from '../types';
2
2
 
3
+ /**
4
+ * A single line item in a customer's in-progress cart for one provider
5
+ * ("cart" in the Kadaikodi domain sense — the merchant, not the shopping
6
+ * basket). Mirrors the shape CartDetailPage builds up as the customer taps
7
+ * through the menu.
8
+ */
9
+ export interface PersistedCartItem {
10
+ id: string;
11
+ productId: string;
12
+ name: string;
13
+ price: number;
14
+ quantity: number;
15
+ specialInstructions?: string;
16
+ }
17
+ /**
18
+ * A lightweight snapshot of an order's last-observed status, cached so the
19
+ * order-tracking page has something honest to show when the device is
20
+ * offline (device-killed/relaunched with no network, or a flaky connection
21
+ * mid-delivery), and so status *changes* can be detected client-side to
22
+ * drive a local order-status notification (see
23
+ * `lib/orderStatusNotifier.ts`) without needing a live push backend.
24
+ */
25
+ export interface OrderStatusSnapshot {
26
+ status: string;
27
+ orderNumber: string;
28
+ cartName: string;
29
+ total: number;
30
+ /** ISO timestamp of when this snapshot was captured on-device. */
31
+ cachedAt: string;
32
+ }
3
33
  interface KadaikodiState {
4
34
  viewMode: ViewMode;
5
35
  activeSection: string;
@@ -8,6 +38,8 @@ interface KadaikodiState {
8
38
  categoryFilter: string;
9
39
  selectedCartId: string | null;
10
40
  selectedOrderId: string | null;
41
+ cartsByProviderId: Record<string, PersistedCartItem[]>;
42
+ lastKnownOrderStatus: Record<string, OrderStatusSnapshot>;
11
43
  setViewMode: (mode: ViewMode) => void;
12
44
  setActiveSection: (section: string) => void;
13
45
  setSearchQuery: (query: string) => void;
@@ -15,6 +47,9 @@ interface KadaikodiState {
15
47
  setSelectedCartId: (cartId: string | null) => void;
16
48
  setSelectedOrderId: (orderId: string | null) => void;
17
49
  toggleSidebar: () => void;
50
+ setCartItems: (providerId: string, items: PersistedCartItem[]) => void;
51
+ clearCart: (providerId: string) => void;
52
+ setLastKnownOrderStatus: (orderId: string, snapshot: OrderStatusSnapshot) => void;
18
53
  reset: () => void;
19
54
  }
20
55
  export declare const useKadaikodiStore: import('zustand').UseBoundStore<Omit<Omit<import('zustand').StoreApi<KadaikodiState>, "setState" | "devtools"> & {
@@ -1 +1 @@
1
- {"version":3,"file":"kadaikodiStore.d.ts","sourceRoot":"","sources":["../../../src/kadaikodi/store/kadaikodiStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAMzC,UAAU,cAAc;IAEtB,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;IAG1B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IAGvB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAG/B,WAAW,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACtC,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACrD,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAsBD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkC7B,CAAC"}
1
+ {"version":3,"file":"kadaikodiStore.d.ts","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IAC9C,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACrD,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IACvE,SAAS,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,uBAAuB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAClF,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAyBD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuD7B,CAAC"}
@@ -9,7 +9,9 @@ var i = {
9
9
  searchQuery: "",
10
10
  categoryFilter: "",
11
11
  selectedCartId: null,
12
- selectedOrderId: null
12
+ selectedOrderId: null,
13
+ cartsByProviderId: {},
14
+ lastKnownOrderStatus: {}
13
15
  }, a = e()(t(n((e) => ({
14
16
  ...i,
15
17
  setViewMode: (t) => e({ viewMode: t }),
@@ -19,6 +21,18 @@ var i = {
19
21
  setCategoryFilter: (t) => e({ categoryFilter: t }),
20
22
  setSelectedCartId: (t) => e({ selectedCartId: t }),
21
23
  setSelectedOrderId: (t) => e({ selectedOrderId: t }),
24
+ setCartItems: (t, n) => e((e) => ({ cartsByProviderId: {
25
+ ...e.cartsByProviderId,
26
+ [t]: n
27
+ } })),
28
+ clearCart: (t) => e((e) => {
29
+ let n = { ...e.cartsByProviderId };
30
+ return delete n[t], { cartsByProviderId: n };
31
+ }),
32
+ setLastKnownOrderStatus: (t, n) => e((e) => ({ lastKnownOrderStatus: {
33
+ ...e.lastKnownOrderStatus,
34
+ [t]: n
35
+ } })),
22
36
  reset: () => e(i)
23
37
  }), {
24
38
  name: "burdenoff-kadaikodi-storage",
@@ -26,7 +40,9 @@ var i = {
26
40
  partialize: (e) => ({
27
41
  viewMode: e.viewMode,
28
42
  sidebarCollapsed: e.sidebarCollapsed,
29
- activeSection: e.activeSection
43
+ activeSection: e.activeSection,
44
+ cartsByProviderId: e.cartsByProviderId,
45
+ lastKnownOrderStatus: e.lastKnownOrderStatus
30
46
  })
31
47
  }), {
32
48
  name: "Kadaikodi Store",
@@ -1 +1 @@
1
- {"version":3,"file":"kadaikodiStore.js","names":[],"sources":["../../../src/kadaikodi/store/kadaikodiStore.ts"],"sourcesContent":["/**\n * Kadaikodi Zustand Store\n * @module kadaikodi/store\n */\n\nimport { create } from 'zustand';\nimport { devtools, persist } from 'zustand/middleware';\nimport { createProfileScopedStorage } from '@burdenoff/fe-libs/shared/utils';\nimport type { ViewMode } from '../types';\n\n// ============================================================================\n// State Interface\n// ============================================================================\n\ninterface KadaikodiState {\n // View state\n viewMode: ViewMode;\n activeSection: string;\n sidebarCollapsed: boolean;\n\n // Search & filters\n searchQuery: string;\n categoryFilter: string;\n\n // Selected entities\n selectedCartId: string | null;\n selectedOrderId: string | null;\n\n // Actions\n setViewMode: (mode: ViewMode) => void;\n setActiveSection: (section: string) => void;\n setSearchQuery: (query: string) => void;\n setCategoryFilter: (category: string) => void;\n setSelectedCartId: (cartId: string | null) => void;\n setSelectedOrderId: (orderId: string | null) => void;\n toggleSidebar: () => void;\n reset: () => void;\n}\n\n// ============================================================================\n// Initial State\n// ============================================================================\n\nconst initialState = {\n viewMode: 'grid' as ViewMode,\n activeSection: 'dashboard',\n sidebarCollapsed: false,\n\n searchQuery: '',\n categoryFilter: '',\n\n selectedCartId: null,\n selectedOrderId: null,\n};\n\n// ============================================================================\n// Store\n// ============================================================================\n\nexport const useKadaikodiStore = create<KadaikodiState>()(\n devtools(\n persist(\n (set) => ({\n ...initialState,\n\n // View actions\n setViewMode: (mode) => set({ viewMode: mode }),\n setActiveSection: (section) => set({ activeSection: section }),\n toggleSidebar: () => set((state) => ({ sidebarCollapsed: !state.sidebarCollapsed })),\n\n // Search & filter actions\n setSearchQuery: (query) => set({ searchQuery: query }),\n setCategoryFilter: (category) => set({ categoryFilter: category }),\n\n // Selection actions\n setSelectedCartId: (cartId) => set({ selectedCartId: cartId }),\n setSelectedOrderId: (orderId) => set({ selectedOrderId: orderId }),\n\n // Reset\n reset: () => set(initialState),\n }),\n {\n name: 'burdenoff-kadaikodi-storage',\n storage: createProfileScopedStorage(),\n partialize: (state) => ({\n viewMode: state.viewMode,\n sidebarCollapsed: state.sidebarCollapsed,\n activeSection: state.activeSection,\n }),\n }\n ),\n { name: 'Kadaikodi Store', enabled: import.meta.env.DEV }\n )\n);\n"],"mappings":";;;;AA2CA,IAAM,IAAe;CACnB,UAAU;CACV,eAAe;CACf,kBAAkB;CAElB,aAAa;CACb,gBAAgB;CAEhB,gBAAgB;CAChB,iBAAiB;CAClB,EAMY,IAAoB,GAAwB,CACvD,EACE,GACG,OAAS;CACR,GAAG;CAGH,cAAc,MAAS,EAAI,EAAE,UAAU,GAAM,CAAC;CAC9C,mBAAmB,MAAY,EAAI,EAAE,eAAe,GAAS,CAAC;CAC9D,qBAAqB,GAAK,OAAW,EAAE,kBAAkB,CAAC,EAAM,kBAAkB,EAAE;CAGpF,iBAAiB,MAAU,EAAI,EAAE,aAAa,GAAO,CAAC;CACtD,oBAAoB,MAAa,EAAI,EAAE,gBAAgB,GAAU,CAAC;CAGlE,oBAAoB,MAAW,EAAI,EAAE,gBAAgB,GAAQ,CAAC;CAC9D,qBAAqB,MAAY,EAAI,EAAE,iBAAiB,GAAS,CAAC;CAGlE,aAAa,EAAI,EAAa;CAC/B,GACD;CACE,MAAM;CACN,SAAS,GAA4B;CACrC,aAAa,OAAW;EACtB,UAAU,EAAM;EAChB,kBAAkB,EAAM;EACxB,eAAe,EAAM;EACtB;CACF,CACF,EACD;CAAE,MAAM;CAAmB,SAAA;CAA8B,CAC1D,CACF"}
1
+ {"version":3,"file":"kadaikodiStore.js","names":[],"sources":["../../../src/kadaikodi/store/kadaikodiStore.ts"],"sourcesContent":["/**\n * Kadaikodi Zustand Store\n * @module kadaikodi/store\n */\n\nimport { create } from 'zustand';\nimport { devtools, persist } from 'zustand/middleware';\nimport { createProfileScopedStorage } from '@burdenoff/fe-libs/shared/utils';\nimport type { ViewMode } from '../types';\n\n// ============================================================================\n// Offline-cached domain types (BOFF-4301)\n// ============================================================================\n\n/**\n * A single line item in a customer's in-progress cart for one provider\n * (\"cart\" in the Kadaikodi domain sense — the merchant, not the shopping\n * basket). Mirrors the shape CartDetailPage builds up as the customer taps\n * through the menu.\n */\nexport interface PersistedCartItem {\n id: string;\n productId: string;\n name: string;\n price: number;\n quantity: number;\n specialInstructions?: string;\n}\n\n/**\n * A lightweight snapshot of an order's last-observed status, cached so the\n * order-tracking page has something honest to show when the device is\n * offline (device-killed/relaunched with no network, or a flaky connection\n * mid-delivery), and so status *changes* can be detected client-side to\n * drive a local order-status notification (see\n * `lib/orderStatusNotifier.ts`) without needing a live push backend.\n */\nexport interface OrderStatusSnapshot {\n status: string;\n orderNumber: string;\n cartName: string;\n total: number;\n /** ISO timestamp of when this snapshot was captured on-device. */\n cachedAt: string;\n}\n\n// ============================================================================\n// State Interface\n// ============================================================================\n\ninterface KadaikodiState {\n // View state\n viewMode: ViewMode;\n activeSection: string;\n sidebarCollapsed: boolean;\n\n // Search & filters\n searchQuery: string;\n categoryFilter: string;\n\n // Selected entities\n selectedCartId: string | null;\n selectedOrderId: string | null;\n\n // Offline-cached consumer state (BOFF-4301) — persisted so the active\n // cart and the last-known status of an order being tracked survive an\n // app kill / reload while offline, not just an in-memory tab session.\n cartsByProviderId: Record<string, PersistedCartItem[]>;\n lastKnownOrderStatus: Record<string, OrderStatusSnapshot>;\n\n // Actions\n setViewMode: (mode: ViewMode) => void;\n setActiveSection: (section: string) => void;\n setSearchQuery: (query: string) => void;\n setCategoryFilter: (category: string) => void;\n setSelectedCartId: (cartId: string | null) => void;\n setSelectedOrderId: (orderId: string | null) => void;\n toggleSidebar: () => void;\n setCartItems: (providerId: string, items: PersistedCartItem[]) => void;\n clearCart: (providerId: string) => void;\n setLastKnownOrderStatus: (orderId: string, snapshot: OrderStatusSnapshot) => void;\n reset: () => void;\n}\n\n// ============================================================================\n// Initial State\n// ============================================================================\n\nconst initialState = {\n viewMode: 'grid' as ViewMode,\n activeSection: 'dashboard',\n sidebarCollapsed: false,\n\n searchQuery: '',\n categoryFilter: '',\n\n selectedCartId: null,\n selectedOrderId: null,\n\n cartsByProviderId: {} as Record<string, PersistedCartItem[]>,\n lastKnownOrderStatus: {} as Record<string, OrderStatusSnapshot>,\n};\n\n// ============================================================================\n// Store\n// ============================================================================\n\nexport const useKadaikodiStore = create<KadaikodiState>()(\n devtools(\n persist(\n (set) => ({\n ...initialState,\n\n // View actions\n setViewMode: (mode) => set({ viewMode: mode }),\n setActiveSection: (section) => set({ activeSection: section }),\n toggleSidebar: () => set((state) => ({ sidebarCollapsed: !state.sidebarCollapsed })),\n\n // Search & filter actions\n setSearchQuery: (query) => set({ searchQuery: query }),\n setCategoryFilter: (category) => set({ categoryFilter: category }),\n\n // Selection actions\n setSelectedCartId: (cartId) => set({ selectedCartId: cartId }),\n setSelectedOrderId: (orderId) => set({ selectedOrderId: orderId }),\n\n // Offline-cached consumer state (BOFF-4301)\n setCartItems: (providerId, items) =>\n set((state) => ({\n cartsByProviderId: { ...state.cartsByProviderId, [providerId]: items },\n })),\n clearCart: (providerId) =>\n set((state) => {\n const next = { ...state.cartsByProviderId };\n delete next[providerId];\n return { cartsByProviderId: next };\n }),\n setLastKnownOrderStatus: (orderId, snapshot) =>\n set((state) => ({\n lastKnownOrderStatus: { ...state.lastKnownOrderStatus, [orderId]: snapshot },\n })),\n\n // Reset\n reset: () => set(initialState),\n }),\n {\n name: 'burdenoff-kadaikodi-storage',\n storage: createProfileScopedStorage(),\n partialize: (state) => ({\n viewMode: state.viewMode,\n sidebarCollapsed: state.sidebarCollapsed,\n activeSection: state.activeSection,\n // BOFF-4301: persisted so the active cart and last-known order\n // status survive an app kill/reload while offline — see\n // PersistedCartItem / OrderStatusSnapshot above.\n cartsByProviderId: state.cartsByProviderId,\n lastKnownOrderStatus: state.lastKnownOrderStatus,\n }),\n }\n ),\n { name: 'Kadaikodi Store', enabled: import.meta.env.DEV }\n )\n);\n"],"mappings":";;;;AAwFA,IAAM,IAAe;CACnB,UAAU;CACV,eAAe;CACf,kBAAkB;CAElB,aAAa;CACb,gBAAgB;CAEhB,gBAAgB;CAChB,iBAAiB;CAEjB,mBAAmB,EAAE;CACrB,sBAAsB,EAAE;CACzB,EAMY,IAAoB,GAAwB,CACvD,EACE,GACG,OAAS;CACR,GAAG;CAGH,cAAc,MAAS,EAAI,EAAE,UAAU,GAAM,CAAC;CAC9C,mBAAmB,MAAY,EAAI,EAAE,eAAe,GAAS,CAAC;CAC9D,qBAAqB,GAAK,OAAW,EAAE,kBAAkB,CAAC,EAAM,kBAAkB,EAAE;CAGpF,iBAAiB,MAAU,EAAI,EAAE,aAAa,GAAO,CAAC;CACtD,oBAAoB,MAAa,EAAI,EAAE,gBAAgB,GAAU,CAAC;CAGlE,oBAAoB,MAAW,EAAI,EAAE,gBAAgB,GAAQ,CAAC;CAC9D,qBAAqB,MAAY,EAAI,EAAE,iBAAiB,GAAS,CAAC;CAGlE,eAAe,GAAY,MACzB,GAAK,OAAW,EACd,mBAAmB;EAAE,GAAG,EAAM;GAAoB,IAAa;EAAO,EACvE,EAAE;CACL,YAAY,MACV,GAAK,MAAU;EACb,IAAM,IAAO,EAAE,GAAG,EAAM,mBAAmB;AAE3C,SADA,OAAO,EAAK,IACL,EAAE,mBAAmB,GAAM;GAClC;CACJ,0BAA0B,GAAS,MACjC,GAAK,OAAW,EACd,sBAAsB;EAAE,GAAG,EAAM;GAAuB,IAAU;EAAU,EAC7E,EAAE;CAGL,aAAa,EAAI,EAAa;CAC/B,GACD;CACE,MAAM;CACN,SAAS,GAA4B;CACrC,aAAa,OAAW;EACtB,UAAU,EAAM;EAChB,kBAAkB,EAAM;EACxB,eAAe,EAAM;EAIrB,mBAAmB,EAAM;EACzB,sBAAsB,EAAM;EAC7B;CACF,CACF,EACD;CAAE,MAAM;CAAmB,SAAA;CAA8B,CAC1D,CACF"}
@@ -5,4 +5,5 @@
5
5
  export { cn } from './cn';
6
6
  export { joinPath } from './navigation';
7
7
  export { formatCurrency, formatDate, formatRelativeTime, formatNumber, formatDistance, formatDuration, } from './formatters';
8
+ export { notifyOrderStatusChange, type OrderStatusChangeNotification } from './orderStatusNotifier';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/kadaikodi/utils/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EACL,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,cAAc,GACf,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/kadaikodi/utils/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EACL,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,uBAAuB,EAAE,KAAK,6BAA6B,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * orderStatusNotifier — schedules an on-device local notification when a
3
+ * tracked order's status changes (BOFF-4301).
4
+ * @module kadaikodi/utils
5
+ *
6
+ * This is deliberately a *local* notification, not a remote push: it works
7
+ * fully offline-to-online-transition today, with zero backend dependency,
8
+ * by comparing the freshly-fetched order against the last status this
9
+ * device observed (cached in the persisted Zustand store — see
10
+ * `../store/kadaikodiStore.ts`). It fires the instant the app itself
11
+ * notices a change (foreground poll or reopen), which covers the common
12
+ * case of a customer with the app open or recently backgrounded.
13
+ *
14
+ * It intentionally does NOT cover status changes that happen while the app
15
+ * is fully killed and there is no process to notice them — that requires a
16
+ * real remote-push pipeline (device token registered with a backend that
17
+ * sends FCM/APNs on order-status transitions). The host app shell
18
+ * (`kadaikodi-app`) wires the Capacitor Push Notifications *capability*
19
+ * (permission + registration + listeners) for exactly that future pipeline
20
+ * — see `kadaikodi-app/src/lib/native/push.ts` — but no backend
21
+ * device-token-registration mutation exists yet, so remote delivery isn't
22
+ * live. Track that as separate follow-up work; this module is the honest,
23
+ * fully-working piece: it does not depend on that backend at all.
24
+ *
25
+ * Capacitor's `@capacitor/local-notifications` plugin is a no-op stub in a
26
+ * plain browser tab (no native bridge), so this is only meaningfully active
27
+ * inside the Capacitor-wrapped mobile app — which is exactly where a push
28
+ * notification would otherwise need to land anyway.
29
+ */
30
+ export interface OrderStatusChangeNotification {
31
+ /** Used to derive a stable notification id so repeat status changes on
32
+ * the same order replace rather than stack duplicate notifications. */
33
+ orderId: string;
34
+ title: string;
35
+ body: string;
36
+ }
37
+ /**
38
+ * Fire a local notification for an order status change. No-op outside a
39
+ * native Capacitor shell (web builds rely on the in-app status banner
40
+ * instead — see OrderTrackingPage's `statusMessage`).
41
+ */
42
+ export declare function notifyOrderStatusChange(input: OrderStatusChangeNotification): Promise<void>;
43
+ //# sourceMappingURL=orderStatusNotifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orderStatusNotifier.d.ts","sourceRoot":"","sources":["../../../src/kadaikodi/utils/orderStatusNotifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,MAAM,WAAW,6BAA6B;IAC5C;2EACuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAeD;;;;GAIG;AACH,wBAAsB,uBAAuB,CAAC,KAAK,EAAE,6BAA6B,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BjG"}
@@ -0,0 +1,28 @@
1
+ import { Capacitor as e } from "../../node_modules/@capacitor/core/dist/index.js";
2
+ //#region src/kadaikodi/utils/orderStatusNotifier.ts
3
+ function t(e) {
4
+ let t = 0;
5
+ for (let n = 0; n < e.length; n++) t = t * 31 + e.charCodeAt(n) | 0;
6
+ return Math.abs(t) || 1;
7
+ }
8
+ async function n(n) {
9
+ if (e.isNativePlatform()) try {
10
+ // @vite-ignore: resolved at native runtime via the Capacitor plugin
11
+ let { LocalNotifications: e } = await import(
12
+ /* @vite-ignore */
13
+ "@capacitor/local-notifications"
14
+ );
15
+ if ((await e.checkPermissions()).display !== "granted" && (await e.requestPermissions()).display !== "granted") return;
16
+ await e.schedule({ notifications: [{
17
+ id: t(n.orderId),
18
+ title: n.title,
19
+ body: n.body
20
+ }] });
21
+ } catch (e) {
22
+ console.error("[Kadaikodi] Failed to schedule order-status notification:", e);
23
+ }
24
+ }
25
+ //#endregion
26
+ export { n as notifyOrderStatusChange };
27
+
28
+ //# sourceMappingURL=orderStatusNotifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orderStatusNotifier.js","names":[],"sources":["../../../src/kadaikodi/utils/orderStatusNotifier.ts"],"sourcesContent":["/**\n * orderStatusNotifier — schedules an on-device local notification when a\n * tracked order's status changes (BOFF-4301).\n * @module kadaikodi/utils\n *\n * This is deliberately a *local* notification, not a remote push: it works\n * fully offline-to-online-transition today, with zero backend dependency,\n * by comparing the freshly-fetched order against the last status this\n * device observed (cached in the persisted Zustand store — see\n * `../store/kadaikodiStore.ts`). It fires the instant the app itself\n * notices a change (foreground poll or reopen), which covers the common\n * case of a customer with the app open or recently backgrounded.\n *\n * It intentionally does NOT cover status changes that happen while the app\n * is fully killed and there is no process to notice them — that requires a\n * real remote-push pipeline (device token registered with a backend that\n * sends FCM/APNs on order-status transitions). The host app shell\n * (`kadaikodi-app`) wires the Capacitor Push Notifications *capability*\n * (permission + registration + listeners) for exactly that future pipeline\n * — see `kadaikodi-app/src/lib/native/push.ts` — but no backend\n * device-token-registration mutation exists yet, so remote delivery isn't\n * live. Track that as separate follow-up work; this module is the honest,\n * fully-working piece: it does not depend on that backend at all.\n *\n * Capacitor's `@capacitor/local-notifications` plugin is a no-op stub in a\n * plain browser tab (no native bridge), so this is only meaningfully active\n * inside the Capacitor-wrapped mobile app — which is exactly where a push\n * notification would otherwise need to land anyway.\n */\n\nimport { Capacitor } from '@capacitor/core';\n\nexport interface OrderStatusChangeNotification {\n /** Used to derive a stable notification id so repeat status changes on\n * the same order replace rather than stack duplicate notifications. */\n orderId: string;\n title: string;\n body: string;\n}\n\n/**\n * Deterministic 31-bit hash of an order id — Capacitor local notifications\n * require a 32-bit integer id, and order ids are opaque database CUIDs/UUIDs.\n */\nfunction hashOrderIdToNotificationId(orderId: string): number {\n let hash = 0;\n for (let i = 0; i < orderId.length; i++) {\n hash = (hash * 31 + orderId.charCodeAt(i)) | 0;\n }\n // Force positive + non-zero (0 is a valid id for some platforms but keep it simple).\n return Math.abs(hash) || 1;\n}\n\n/**\n * Fire a local notification for an order status change. No-op outside a\n * native Capacitor shell (web builds rely on the in-app status banner\n * instead — see OrderTrackingPage's `statusMessage`).\n */\nexport async function notifyOrderStatusChange(input: OrderStatusChangeNotification): Promise<void> {\n if (!Capacitor.isNativePlatform()) return;\n\n try {\n // @vite-ignore: resolved at native runtime via the Capacitor plugin\n // bridge, mirroring the pattern used for @capgo/native-purchases in\n // kadaikodi-app's src/lib/native/iap.ts.\n const { LocalNotifications } = await import(\n /* @vite-ignore */ '@capacitor/local-notifications'\n );\n\n const permission = await LocalNotifications.checkPermissions();\n if (permission.display !== 'granted') {\n const requested = await LocalNotifications.requestPermissions();\n if (requested.display !== 'granted') return;\n }\n\n await LocalNotifications.schedule({\n notifications: [\n {\n id: hashOrderIdToNotificationId(input.orderId),\n title: input.title,\n body: input.body,\n },\n ],\n });\n } catch (err) {\n // Notification failures should never break order tracking.\n console.error('[Kadaikodi] Failed to schedule order-status notification:', err);\n }\n}\n"],"mappings":";;AA4CA,SAAS,EAA4B,GAAyB;CAC5D,IAAI,IAAO;AACX,MAAK,IAAI,IAAI,GAAG,IAAI,EAAQ,QAAQ,IAClC,KAAQ,IAAO,KAAK,EAAQ,WAAW,EAAE,GAAI;AAG/C,QAAO,KAAK,IAAI,EAAK,IAAI;;AAQ3B,eAAsB,EAAwB,GAAqD;AAC5F,OAAU,kBAAkB,CAEjC,KAAI;;EAIF,IAAM,EAAE,0BAAuB,MAAM;;GAChB;;AAIrB,OADmB,MAAM,EAAmB,kBAAkB,EAC/C,YAAY,cACP,MAAM,EAAmB,oBAAoB,EACjD,YAAY,UAAW;AAGvC,QAAM,EAAmB,SAAS,EAChC,eAAe,CACb;GACE,IAAI,EAA4B,EAAM,QAAQ;GAC9C,OAAO,EAAM;GACb,MAAM,EAAM;GACb,CACF,EACF,CAAC;UACK,GAAK;AAEZ,UAAQ,MAAM,6DAA6D,EAAI"}
@@ -0,0 +1,270 @@
1
+ //#region node_modules/@capacitor/core/dist/index.js
2
+ var e;
3
+ (function(e) {
4
+ e.Unimplemented = "UNIMPLEMENTED", e.Unavailable = "UNAVAILABLE";
5
+ })(e ||= {});
6
+ var t = class extends Error {
7
+ constructor(e, t, n) {
8
+ super(e), this.message = e, this.code = t, this.data = n;
9
+ }
10
+ }, n = (e) => e?.androidBridge ? "android" : e?.webkit?.messageHandlers?.bridge ? "ios" : "web", r = (r) => {
11
+ let i = r.CapacitorCustomPlatform || null, a = r.Capacitor || {}, o = a.Plugins = a.Plugins || {}, s = () => i === null ? n(r) : i.name, c = () => s() !== "web", l = (e) => !!(f.get(e)?.platforms.has(s()) || u(e)), u = (e) => a.PluginHeaders?.find((t) => t.name === e), d = (e) => r.console.error(e), f = /* @__PURE__ */ new Map();
12
+ return a.convertFileSrc ||= (e) => e, a.getPlatform = s, a.handleError = d, a.isNativePlatform = c, a.isPluginAvailable = l, a.registerPlugin = (n, r = {}) => {
13
+ let c = f.get(n);
14
+ if (c) return console.warn(`Capacitor plugin "${n}" already registered. Cannot register plugins twice.`), c.proxy;
15
+ let l = s(), d = u(n), p, m = async () => (!p && l in r ? p = p = typeof r[l] == "function" ? await r[l]() : r[l] : i !== null && !p && "web" in r && (p = p = typeof r.web == "function" ? await r.web() : r.web), p), h = (r, i) => {
16
+ if (d) {
17
+ let e = d?.methods.find((e) => i === e.name);
18
+ if (e) return e.rtype === "promise" ? (e) => a.nativePromise(n, i.toString(), e) : (e, t) => a.nativeCallback(n, i.toString(), e, t);
19
+ if (r) return r[i]?.bind(r);
20
+ } else if (r) return r[i]?.bind(r);
21
+ else throw new t(`"${n}" plugin is not implemented on ${l}`, e.Unimplemented);
22
+ }, g = (r) => {
23
+ let i, a = (...a) => {
24
+ let o = m().then((o) => {
25
+ let s = h(o, r);
26
+ if (s) {
27
+ let e = s(...a);
28
+ return i = e?.remove, e;
29
+ } else throw new t(`"${n}.${r}()" is not implemented on ${l}`, e.Unimplemented);
30
+ });
31
+ return r === "addListener" && (o.remove = async () => i()), o;
32
+ };
33
+ return a.toString = () => `${r.toString()}() { [capacitor code] }`, Object.defineProperty(a, "name", {
34
+ value: r,
35
+ writable: !1,
36
+ configurable: !1
37
+ }), a;
38
+ }, _ = g("addListener"), v = g("removeListener"), y = (e, t) => {
39
+ let n = _({ eventName: e }, t), r = async () => {
40
+ v({
41
+ eventName: e,
42
+ callbackId: await n
43
+ }, t);
44
+ }, i = new Promise((e) => n.then(() => e({ remove: r })));
45
+ return i.remove = async () => {
46
+ console.warn("Using addListener() without 'await' is deprecated."), await r();
47
+ }, i;
48
+ }, b = new Proxy({}, { get(e, t) {
49
+ switch (t) {
50
+ case "$$typeof": return;
51
+ case "toJSON": return () => ({});
52
+ case "addListener": return d ? y : _;
53
+ case "removeListener": return v;
54
+ default: return g(t);
55
+ }
56
+ } });
57
+ return o[n] = b, f.set(n, {
58
+ name: n,
59
+ proxy: b,
60
+ platforms: new Set([...Object.keys(r), ...d ? [l] : []])
61
+ }), b;
62
+ }, a.Exception = t, a.DEBUG = !!a.DEBUG, a.isLoggingEnabled = !!a.isLoggingEnabled, a;
63
+ }, i = /* @__PURE__ */ ((e) => e.Capacitor = r(e))(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {}), a = i.registerPlugin, o = class {
64
+ constructor() {
65
+ this.listeners = {}, this.retainedEventArguments = {}, this.windowListeners = {};
66
+ }
67
+ addListener(e, t) {
68
+ let n = !1;
69
+ this.listeners[e] || (this.listeners[e] = [], n = !0), this.listeners[e].push(t);
70
+ let r = this.windowListeners[e];
71
+ return r && !r.registered && this.addWindowListener(r), n && this.sendRetainedArgumentsForEvent(e), Promise.resolve({ remove: async () => this.removeListener(e, t) });
72
+ }
73
+ async removeAllListeners() {
74
+ this.listeners = {};
75
+ for (let e in this.windowListeners) this.removeWindowListener(this.windowListeners[e]);
76
+ this.windowListeners = {};
77
+ }
78
+ notifyListeners(e, t, n) {
79
+ let r = this.listeners[e];
80
+ if (!r) {
81
+ if (n) {
82
+ let n = this.retainedEventArguments[e];
83
+ n ||= [], n.push(t), this.retainedEventArguments[e] = n;
84
+ }
85
+ return;
86
+ }
87
+ r.forEach((e) => e(t));
88
+ }
89
+ hasListeners(e) {
90
+ return !!this.listeners[e]?.length;
91
+ }
92
+ registerWindowListener(e, t) {
93
+ this.windowListeners[t] = {
94
+ registered: !1,
95
+ windowEventName: e,
96
+ pluginEventName: t,
97
+ handler: (e) => {
98
+ this.notifyListeners(t, e);
99
+ }
100
+ };
101
+ }
102
+ unimplemented(t = "not implemented") {
103
+ return new i.Exception(t, e.Unimplemented);
104
+ }
105
+ unavailable(t = "not available") {
106
+ return new i.Exception(t, e.Unavailable);
107
+ }
108
+ async removeListener(e, t) {
109
+ let n = this.listeners[e];
110
+ if (!n) return;
111
+ let r = n.indexOf(t);
112
+ this.listeners[e].splice(r, 1), this.listeners[e].length || this.removeWindowListener(this.windowListeners[e]);
113
+ }
114
+ addWindowListener(e) {
115
+ window.addEventListener(e.windowEventName, e.handler), e.registered = !0;
116
+ }
117
+ removeWindowListener(e) {
118
+ e && (window.removeEventListener(e.windowEventName, e.handler), e.registered = !1);
119
+ }
120
+ sendRetainedArgumentsForEvent(e) {
121
+ let t = this.retainedEventArguments[e];
122
+ t && (delete this.retainedEventArguments[e], t.forEach((t) => {
123
+ this.notifyListeners(e, t);
124
+ }));
125
+ }
126
+ }, s = (e) => encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape), c = (e) => e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent), l = class extends o {
127
+ async getCookies() {
128
+ let e = document.cookie, t = {};
129
+ return e.split(";").forEach((e) => {
130
+ if (e.length <= 0) return;
131
+ let [n, r] = e.replace(/=/, "CAP_COOKIE").split("CAP_COOKIE");
132
+ n = c(n).trim(), r = c(r).trim(), t[n] = r;
133
+ }), t;
134
+ }
135
+ async setCookie(e) {
136
+ try {
137
+ let t = s(e.key), n = s(e.value), r = e.expires ? `; expires=${e.expires.replace("expires=", "")}` : "", i = (e.path || "/").replace("path=", ""), a = e.url != null && e.url.length > 0 ? `domain=${e.url}` : "";
138
+ document.cookie = `${t}=${n || ""}${r}; path=${i}; ${a};`;
139
+ } catch (e) {
140
+ return Promise.reject(e);
141
+ }
142
+ }
143
+ async deleteCookie(e) {
144
+ try {
145
+ document.cookie = `${e.key}=; Max-Age=0`;
146
+ } catch (e) {
147
+ return Promise.reject(e);
148
+ }
149
+ }
150
+ async clearCookies() {
151
+ try {
152
+ let e = document.cookie.split(";") || [];
153
+ for (let t of e) document.cookie = t.replace(/^ +/, "").replace(/=.*/, `=;expires=${(/* @__PURE__ */ new Date()).toUTCString()};path=/`);
154
+ } catch (e) {
155
+ return Promise.reject(e);
156
+ }
157
+ }
158
+ async clearAllCookies() {
159
+ try {
160
+ await this.clearCookies();
161
+ } catch (e) {
162
+ return Promise.reject(e);
163
+ }
164
+ }
165
+ };
166
+ a("CapacitorCookies", { web: () => new l() });
167
+ var u = async (e) => new Promise((t, n) => {
168
+ let r = new FileReader();
169
+ r.onload = () => {
170
+ let e = r.result;
171
+ t(e.indexOf(",") >= 0 ? e.split(",")[1] : e);
172
+ }, r.onerror = (e) => n(e), r.readAsDataURL(e);
173
+ }), d = (e = {}) => {
174
+ let t = Object.keys(e);
175
+ return Object.keys(e).map((e) => e.toLocaleLowerCase()).reduce((n, r, i) => (n[r] = e[t[i]], n), {});
176
+ }, f = (e, t = !0) => e ? Object.entries(e).reduce((e, n) => {
177
+ let [r, i] = n, a, o;
178
+ return Array.isArray(i) ? (o = "", i.forEach((e) => {
179
+ a = t ? encodeURIComponent(e) : e, o += `${r}=${a}&`;
180
+ }), o.slice(0, -1)) : (a = t ? encodeURIComponent(i) : i, o = `${r}=${a}`), `${e}&${o}`;
181
+ }, "").substr(1) : null, p = (e, t = {}) => {
182
+ let n = Object.assign({
183
+ method: e.method || "GET",
184
+ headers: e.headers
185
+ }, t), r = d(e.headers)["content-type"] || "";
186
+ if (typeof e.data == "string") n.body = e.data;
187
+ else if (r.includes("application/x-www-form-urlencoded")) {
188
+ let t = new URLSearchParams();
189
+ for (let [n, r] of Object.entries(e.data || {})) t.set(n, r);
190
+ n.body = t.toString();
191
+ } else if (r.includes("multipart/form-data") || e.data instanceof FormData) {
192
+ let t = new FormData();
193
+ if (e.data instanceof FormData) e.data.forEach((e, n) => {
194
+ t.append(n, e);
195
+ });
196
+ else for (let n of Object.keys(e.data)) t.append(n, e.data[n]);
197
+ n.body = t;
198
+ let r = new Headers(n.headers);
199
+ r.delete("content-type"), n.headers = r;
200
+ } else (r.includes("application/json") || typeof e.data == "object") && (n.body = JSON.stringify(e.data));
201
+ return n;
202
+ }, m = class extends o {
203
+ async request(e) {
204
+ let t = p(e, e.webFetchExtra), n = f(e.params, e.shouldEncodeUrlParams), r = n ? `${e.url}?${n}` : e.url, i = await fetch(r, t), a = i.headers.get("content-type") || "", { responseType: o = "text" } = i.ok ? e : {};
205
+ a.includes("application/json") && (o = "json");
206
+ let s, c;
207
+ switch (o) {
208
+ case "arraybuffer":
209
+ case "blob":
210
+ c = await i.blob(), s = await u(c);
211
+ break;
212
+ case "json":
213
+ s = await i.json();
214
+ break;
215
+ default: s = await i.text();
216
+ }
217
+ let l = {};
218
+ return i.headers.forEach((e, t) => {
219
+ l[t] = e;
220
+ }), {
221
+ data: s,
222
+ headers: l,
223
+ status: i.status,
224
+ url: i.url
225
+ };
226
+ }
227
+ async get(e) {
228
+ return this.request(Object.assign(Object.assign({}, e), { method: "GET" }));
229
+ }
230
+ async post(e) {
231
+ return this.request(Object.assign(Object.assign({}, e), { method: "POST" }));
232
+ }
233
+ async put(e) {
234
+ return this.request(Object.assign(Object.assign({}, e), { method: "PUT" }));
235
+ }
236
+ async patch(e) {
237
+ return this.request(Object.assign(Object.assign({}, e), { method: "PATCH" }));
238
+ }
239
+ async delete(e) {
240
+ return this.request(Object.assign(Object.assign({}, e), { method: "DELETE" }));
241
+ }
242
+ };
243
+ a("CapacitorHttp", { web: () => new m() });
244
+ var h;
245
+ (function(e) {
246
+ e.Dark = "DARK", e.Light = "LIGHT", e.Default = "DEFAULT";
247
+ })(h ||= {});
248
+ var g;
249
+ (function(e) {
250
+ e.StatusBar = "StatusBar", e.NavigationBar = "NavigationBar";
251
+ })(g ||= {});
252
+ var _ = class extends o {
253
+ async setStyle() {
254
+ this.unavailable("not available for web");
255
+ }
256
+ async setAnimation() {
257
+ this.unavailable("not available for web");
258
+ }
259
+ async show() {
260
+ this.unavailable("not available for web");
261
+ }
262
+ async hide() {
263
+ this.unavailable("not available for web");
264
+ }
265
+ };
266
+ a("SystemBars", { web: () => new _() });
267
+ //#endregion
268
+ export { i as Capacitor };
269
+
270
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../node_modules/@capacitor/core/dist/index.js"],"sourcesContent":["/*! Capacitor: https://capacitorjs.com/ - MIT License */\nvar ExceptionCode;\n(function (ExceptionCode) {\n /**\n * API is not implemented.\n *\n * This usually means the API can't be used because it is not implemented for\n * the current platform.\n */\n ExceptionCode[\"Unimplemented\"] = \"UNIMPLEMENTED\";\n /**\n * API is not available.\n *\n * This means the API can't be used right now because:\n * - it is currently missing a prerequisite, such as network connectivity\n * - it requires a particular platform or browser version\n */\n ExceptionCode[\"Unavailable\"] = \"UNAVAILABLE\";\n})(ExceptionCode || (ExceptionCode = {}));\nclass CapacitorException extends Error {\n constructor(message, code, data) {\n super(message);\n this.message = message;\n this.code = code;\n this.data = data;\n }\n}\nconst getPlatformId = (win) => {\n var _a, _b;\n if (win === null || win === void 0 ? void 0 : win.androidBridge) {\n return 'android';\n }\n else if ((_b = (_a = win === null || win === void 0 ? void 0 : win.webkit) === null || _a === void 0 ? void 0 : _a.messageHandlers) === null || _b === void 0 ? void 0 : _b.bridge) {\n return 'ios';\n }\n else {\n return 'web';\n }\n};\n\nconst createCapacitor = (win) => {\n const capCustomPlatform = win.CapacitorCustomPlatform || null;\n const cap = win.Capacitor || {};\n const Plugins = (cap.Plugins = cap.Plugins || {});\n const getPlatform = () => {\n return capCustomPlatform !== null ? capCustomPlatform.name : getPlatformId(win);\n };\n const isNativePlatform = () => getPlatform() !== 'web';\n const isPluginAvailable = (pluginName) => {\n const plugin = registeredPlugins.get(pluginName);\n if (plugin === null || plugin === void 0 ? void 0 : plugin.platforms.has(getPlatform())) {\n // JS implementation available for the current platform.\n return true;\n }\n if (getPluginHeader(pluginName)) {\n // Native implementation available.\n return true;\n }\n return false;\n };\n const getPluginHeader = (pluginName) => { var _a; return (_a = cap.PluginHeaders) === null || _a === void 0 ? void 0 : _a.find((h) => h.name === pluginName); };\n const handleError = (err) => win.console.error(err);\n const registeredPlugins = new Map();\n const registerPlugin = (pluginName, jsImplementations = {}) => {\n const registeredPlugin = registeredPlugins.get(pluginName);\n if (registeredPlugin) {\n console.warn(`Capacitor plugin \"${pluginName}\" already registered. Cannot register plugins twice.`);\n return registeredPlugin.proxy;\n }\n const platform = getPlatform();\n const pluginHeader = getPluginHeader(pluginName);\n let jsImplementation;\n const loadPluginImplementation = async () => {\n if (!jsImplementation && platform in jsImplementations) {\n jsImplementation =\n typeof jsImplementations[platform] === 'function'\n ? (jsImplementation = await jsImplementations[platform]())\n : (jsImplementation = jsImplementations[platform]);\n }\n else if (capCustomPlatform !== null && !jsImplementation && 'web' in jsImplementations) {\n jsImplementation =\n typeof jsImplementations['web'] === 'function'\n ? (jsImplementation = await jsImplementations['web']())\n : (jsImplementation = jsImplementations['web']);\n }\n return jsImplementation;\n };\n const createPluginMethod = (impl, prop) => {\n var _a, _b;\n if (pluginHeader) {\n const methodHeader = pluginHeader === null || pluginHeader === void 0 ? void 0 : pluginHeader.methods.find((m) => prop === m.name);\n if (methodHeader) {\n if (methodHeader.rtype === 'promise') {\n return (options) => cap.nativePromise(pluginName, prop.toString(), options);\n }\n else {\n return (options, callback) => cap.nativeCallback(pluginName, prop.toString(), options, callback);\n }\n }\n else if (impl) {\n return (_a = impl[prop]) === null || _a === void 0 ? void 0 : _a.bind(impl);\n }\n }\n else if (impl) {\n return (_b = impl[prop]) === null || _b === void 0 ? void 0 : _b.bind(impl);\n }\n else {\n throw new CapacitorException(`\"${pluginName}\" plugin is not implemented on ${platform}`, ExceptionCode.Unimplemented);\n }\n };\n const createPluginMethodWrapper = (prop) => {\n let remove;\n const wrapper = (...args) => {\n const p = loadPluginImplementation().then((impl) => {\n const fn = createPluginMethod(impl, prop);\n if (fn) {\n const p = fn(...args);\n remove = p === null || p === void 0 ? void 0 : p.remove;\n return p;\n }\n else {\n throw new CapacitorException(`\"${pluginName}.${prop}()\" is not implemented on ${platform}`, ExceptionCode.Unimplemented);\n }\n });\n if (prop === 'addListener') {\n p.remove = async () => remove();\n }\n return p;\n };\n // Some flair ✨\n wrapper.toString = () => `${prop.toString()}() { [capacitor code] }`;\n Object.defineProperty(wrapper, 'name', {\n value: prop,\n writable: false,\n configurable: false,\n });\n return wrapper;\n };\n const addListener = createPluginMethodWrapper('addListener');\n const removeListener = createPluginMethodWrapper('removeListener');\n const addListenerNative = (eventName, callback) => {\n const call = addListener({ eventName }, callback);\n const remove = async () => {\n const callbackId = await call;\n removeListener({\n eventName,\n callbackId,\n }, callback);\n };\n const p = new Promise((resolve) => call.then(() => resolve({ remove })));\n p.remove = async () => {\n console.warn(`Using addListener() without 'await' is deprecated.`);\n await remove();\n };\n return p;\n };\n const proxy = new Proxy({}, {\n get(_, prop) {\n switch (prop) {\n // https://github.com/facebook/react/issues/20030\n case '$$typeof':\n return undefined;\n case 'toJSON':\n return () => ({});\n case 'addListener':\n return pluginHeader ? addListenerNative : addListener;\n case 'removeListener':\n return removeListener;\n default:\n return createPluginMethodWrapper(prop);\n }\n },\n });\n Plugins[pluginName] = proxy;\n registeredPlugins.set(pluginName, {\n name: pluginName,\n proxy,\n platforms: new Set([...Object.keys(jsImplementations), ...(pluginHeader ? [platform] : [])]),\n });\n return proxy;\n };\n // Add in convertFileSrc for web, it will already be available in native context\n if (!cap.convertFileSrc) {\n cap.convertFileSrc = (filePath) => filePath;\n }\n cap.getPlatform = getPlatform;\n cap.handleError = handleError;\n cap.isNativePlatform = isNativePlatform;\n cap.isPluginAvailable = isPluginAvailable;\n cap.registerPlugin = registerPlugin;\n cap.Exception = CapacitorException;\n cap.DEBUG = !!cap.DEBUG;\n cap.isLoggingEnabled = !!cap.isLoggingEnabled;\n return cap;\n};\nconst initCapacitorGlobal = (win) => (win.Capacitor = createCapacitor(win));\n\nconst Capacitor = /*#__PURE__*/ initCapacitorGlobal(typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {});\nconst registerPlugin = Capacitor.registerPlugin;\n\n/**\n * Base class web plugins should extend.\n */\nclass WebPlugin {\n constructor() {\n this.listeners = {};\n this.retainedEventArguments = {};\n this.windowListeners = {};\n }\n addListener(eventName, listenerFunc) {\n let firstListener = false;\n const listeners = this.listeners[eventName];\n if (!listeners) {\n this.listeners[eventName] = [];\n firstListener = true;\n }\n this.listeners[eventName].push(listenerFunc);\n // If we haven't added a window listener for this event and it requires one,\n // go ahead and add it\n const windowListener = this.windowListeners[eventName];\n if (windowListener && !windowListener.registered) {\n this.addWindowListener(windowListener);\n }\n if (firstListener) {\n this.sendRetainedArgumentsForEvent(eventName);\n }\n const remove = async () => this.removeListener(eventName, listenerFunc);\n const p = Promise.resolve({ remove });\n return p;\n }\n async removeAllListeners() {\n this.listeners = {};\n for (const listener in this.windowListeners) {\n this.removeWindowListener(this.windowListeners[listener]);\n }\n this.windowListeners = {};\n }\n notifyListeners(eventName, data, retainUntilConsumed) {\n const listeners = this.listeners[eventName];\n if (!listeners) {\n if (retainUntilConsumed) {\n let args = this.retainedEventArguments[eventName];\n if (!args) {\n args = [];\n }\n args.push(data);\n this.retainedEventArguments[eventName] = args;\n }\n return;\n }\n listeners.forEach((listener) => listener(data));\n }\n hasListeners(eventName) {\n var _a;\n return !!((_a = this.listeners[eventName]) === null || _a === void 0 ? void 0 : _a.length);\n }\n registerWindowListener(windowEventName, pluginEventName) {\n this.windowListeners[pluginEventName] = {\n registered: false,\n windowEventName,\n pluginEventName,\n handler: (event) => {\n this.notifyListeners(pluginEventName, event);\n },\n };\n }\n unimplemented(msg = 'not implemented') {\n return new Capacitor.Exception(msg, ExceptionCode.Unimplemented);\n }\n unavailable(msg = 'not available') {\n return new Capacitor.Exception(msg, ExceptionCode.Unavailable);\n }\n async removeListener(eventName, listenerFunc) {\n const listeners = this.listeners[eventName];\n if (!listeners) {\n return;\n }\n const index = listeners.indexOf(listenerFunc);\n this.listeners[eventName].splice(index, 1);\n // If there are no more listeners for this type of event,\n // remove the window listener\n if (!this.listeners[eventName].length) {\n this.removeWindowListener(this.windowListeners[eventName]);\n }\n }\n addWindowListener(handle) {\n window.addEventListener(handle.windowEventName, handle.handler);\n handle.registered = true;\n }\n removeWindowListener(handle) {\n if (!handle) {\n return;\n }\n window.removeEventListener(handle.windowEventName, handle.handler);\n handle.registered = false;\n }\n sendRetainedArgumentsForEvent(eventName) {\n const args = this.retainedEventArguments[eventName];\n if (!args) {\n return;\n }\n delete this.retainedEventArguments[eventName];\n args.forEach((arg) => {\n this.notifyListeners(eventName, arg);\n });\n }\n}\n\nconst WebView = /*#__PURE__*/ registerPlugin('WebView');\n/******** END WEB VIEW PLUGIN ********/\n/******** COOKIES PLUGIN ********/\n/**\n * Safely web encode a string value (inspired by js-cookie)\n * @param str The string value to encode\n */\nconst encode = (str) => encodeURIComponent(str)\n .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n .replace(/[()]/g, escape);\n/**\n * Safely web decode a string value (inspired by js-cookie)\n * @param str The string value to decode\n */\nconst decode = (str) => str.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent);\nclass CapacitorCookiesPluginWeb extends WebPlugin {\n async getCookies() {\n const cookies = document.cookie;\n const cookieMap = {};\n cookies.split(';').forEach((cookie) => {\n if (cookie.length <= 0)\n return;\n // Replace first \"=\" with CAP_COOKIE to prevent splitting on additional \"=\"\n let [key, value] = cookie.replace(/=/, 'CAP_COOKIE').split('CAP_COOKIE');\n key = decode(key).trim();\n value = decode(value).trim();\n cookieMap[key] = value;\n });\n return cookieMap;\n }\n async setCookie(options) {\n try {\n // Safely Encoded Key/Value\n const encodedKey = encode(options.key);\n const encodedValue = encode(options.value);\n // Clean & sanitize options\n const expires = options.expires ? `; expires=${options.expires.replace('expires=', '')}` : '';\n const path = (options.path || '/').replace('path=', ''); // Default is \"path=/\"\n const domain = options.url != null && options.url.length > 0 ? `domain=${options.url}` : '';\n document.cookie = `${encodedKey}=${encodedValue || ''}${expires}; path=${path}; ${domain};`;\n }\n catch (error) {\n return Promise.reject(error);\n }\n }\n async deleteCookie(options) {\n try {\n document.cookie = `${options.key}=; Max-Age=0`;\n }\n catch (error) {\n return Promise.reject(error);\n }\n }\n async clearCookies() {\n try {\n const cookies = document.cookie.split(';') || [];\n for (const cookie of cookies) {\n document.cookie = cookie.replace(/^ +/, '').replace(/=.*/, `=;expires=${new Date().toUTCString()};path=/`);\n }\n }\n catch (error) {\n return Promise.reject(error);\n }\n }\n async clearAllCookies() {\n try {\n await this.clearCookies();\n }\n catch (error) {\n return Promise.reject(error);\n }\n }\n}\nconst CapacitorCookies = registerPlugin('CapacitorCookies', {\n web: () => new CapacitorCookiesPluginWeb(),\n});\n// UTILITY FUNCTIONS\n/**\n * Read in a Blob value and return it as a base64 string\n * @param blob The blob value to convert to a base64 string\n */\nconst readBlobAsBase64 = async (blob) => new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n const base64String = reader.result;\n // remove prefix \"data:application/pdf;base64,\"\n resolve(base64String.indexOf(',') >= 0 ? base64String.split(',')[1] : base64String);\n };\n reader.onerror = (error) => reject(error);\n reader.readAsDataURL(blob);\n});\n/**\n * Normalize an HttpHeaders map by lowercasing all of the values\n * @param headers The HttpHeaders object to normalize\n */\nconst normalizeHttpHeaders = (headers = {}) => {\n const originalKeys = Object.keys(headers);\n const loweredKeys = Object.keys(headers).map((k) => k.toLocaleLowerCase());\n const normalized = loweredKeys.reduce((acc, key, index) => {\n acc[key] = headers[originalKeys[index]];\n return acc;\n }, {});\n return normalized;\n};\n/**\n * Builds a string of url parameters that\n * @param params A map of url parameters\n * @param shouldEncode true if you should encodeURIComponent() the values (true by default)\n */\nconst buildUrlParams = (params, shouldEncode = true) => {\n if (!params)\n return null;\n const output = Object.entries(params).reduce((accumulator, entry) => {\n const [key, value] = entry;\n let encodedValue;\n let item;\n if (Array.isArray(value)) {\n item = '';\n value.forEach((str) => {\n encodedValue = shouldEncode ? encodeURIComponent(str) : str;\n item += `${key}=${encodedValue}&`;\n });\n // last character will always be \"&\" so slice it off\n item.slice(0, -1);\n }\n else {\n encodedValue = shouldEncode ? encodeURIComponent(value) : value;\n item = `${key}=${encodedValue}`;\n }\n return `${accumulator}&${item}`;\n }, '');\n // Remove initial \"&\" from the reduce\n return output.substr(1);\n};\n/**\n * Build the RequestInit object based on the options passed into the initial request\n * @param options The Http plugin options\n * @param extra Any extra RequestInit values\n */\nconst buildRequestInit = (options, extra = {}) => {\n const output = Object.assign({ method: options.method || 'GET', headers: options.headers }, extra);\n // Get the content-type\n const headers = normalizeHttpHeaders(options.headers);\n const type = headers['content-type'] || '';\n // If body is already a string, then pass it through as-is.\n if (typeof options.data === 'string') {\n output.body = options.data;\n }\n // Build request initializers based off of content-type\n else if (type.includes('application/x-www-form-urlencoded')) {\n const params = new URLSearchParams();\n for (const [key, value] of Object.entries(options.data || {})) {\n params.set(key, value);\n }\n output.body = params.toString();\n }\n else if (type.includes('multipart/form-data') || options.data instanceof FormData) {\n const form = new FormData();\n if (options.data instanceof FormData) {\n options.data.forEach((value, key) => {\n form.append(key, value);\n });\n }\n else {\n for (const key of Object.keys(options.data)) {\n form.append(key, options.data[key]);\n }\n }\n output.body = form;\n const headers = new Headers(output.headers);\n headers.delete('content-type'); // content-type will be set by `window.fetch` to includy boundary\n output.headers = headers;\n }\n else if (type.includes('application/json') || typeof options.data === 'object') {\n output.body = JSON.stringify(options.data);\n }\n return output;\n};\n// WEB IMPLEMENTATION\nclass CapacitorHttpPluginWeb extends WebPlugin {\n /**\n * Perform an Http request given a set of options\n * @param options Options to build the HTTP request\n */\n async request(options) {\n const requestInit = buildRequestInit(options, options.webFetchExtra);\n const urlParams = buildUrlParams(options.params, options.shouldEncodeUrlParams);\n const url = urlParams ? `${options.url}?${urlParams}` : options.url;\n const response = await fetch(url, requestInit);\n const contentType = response.headers.get('content-type') || '';\n // Default to 'text' responseType so no parsing happens\n let { responseType = 'text' } = response.ok ? options : {};\n // If the response content-type is json, force the response to be json\n if (contentType.includes('application/json')) {\n responseType = 'json';\n }\n let data;\n let blob;\n switch (responseType) {\n case 'arraybuffer':\n case 'blob':\n blob = await response.blob();\n data = await readBlobAsBase64(blob);\n break;\n case 'json':\n data = await response.json();\n break;\n case 'document':\n case 'text':\n default:\n data = await response.text();\n }\n // Convert fetch headers to Capacitor HttpHeaders\n const headers = {};\n response.headers.forEach((value, key) => {\n headers[key] = value;\n });\n return {\n data,\n headers,\n status: response.status,\n url: response.url,\n };\n }\n /**\n * Perform an Http GET request given a set of options\n * @param options Options to build the HTTP request\n */\n async get(options) {\n return this.request(Object.assign(Object.assign({}, options), { method: 'GET' }));\n }\n /**\n * Perform an Http POST request given a set of options\n * @param options Options to build the HTTP request\n */\n async post(options) {\n return this.request(Object.assign(Object.assign({}, options), { method: 'POST' }));\n }\n /**\n * Perform an Http PUT request given a set of options\n * @param options Options to build the HTTP request\n */\n async put(options) {\n return this.request(Object.assign(Object.assign({}, options), { method: 'PUT' }));\n }\n /**\n * Perform an Http PATCH request given a set of options\n * @param options Options to build the HTTP request\n */\n async patch(options) {\n return this.request(Object.assign(Object.assign({}, options), { method: 'PATCH' }));\n }\n /**\n * Perform an Http DELETE request given a set of options\n * @param options Options to build the HTTP request\n */\n async delete(options) {\n return this.request(Object.assign(Object.assign({}, options), { method: 'DELETE' }));\n }\n}\nconst CapacitorHttp = registerPlugin('CapacitorHttp', {\n web: () => new CapacitorHttpPluginWeb(),\n});\n/******** END HTTP PLUGIN ********/\n/******** SYSTEM BARS PLUGIN ********/\n/**\n * Available status bar styles.\n */\nvar SystemBarsStyle;\n(function (SystemBarsStyle) {\n /**\n * Light system bar content on a dark background.\n *\n * @since 8.0.0\n */\n SystemBarsStyle[\"Dark\"] = \"DARK\";\n /**\n * For dark system bar content on a light background.\n *\n * @since 8.0.0\n */\n SystemBarsStyle[\"Light\"] = \"LIGHT\";\n /**\n * The style is based on the device appearance or the underlying content.\n * If the device is using Dark mode, the system bars content will be light.\n * If the device is using Light mode, the system bars content will be dark.\n *\n * @since 8.0.0\n */\n SystemBarsStyle[\"Default\"] = \"DEFAULT\";\n})(SystemBarsStyle || (SystemBarsStyle = {}));\n/**\n * Available system bar types.\n */\nvar SystemBarType;\n(function (SystemBarType) {\n /**\n * The top status bar on both Android and iOS.\n *\n * @since 8.0.0\n */\n SystemBarType[\"StatusBar\"] = \"StatusBar\";\n /**\n * The navigation bar (or gesture bar on iOS) on both Android and iOS.\n *\n * @since 8.0.0\n */\n SystemBarType[\"NavigationBar\"] = \"NavigationBar\";\n})(SystemBarType || (SystemBarType = {}));\nclass SystemBarsPluginWeb extends WebPlugin {\n async setStyle() {\n this.unavailable('not available for web');\n }\n async setAnimation() {\n this.unavailable('not available for web');\n }\n async show() {\n this.unavailable('not available for web');\n }\n async hide() {\n this.unavailable('not available for web');\n }\n}\nconst SystemBars = registerPlugin('SystemBars', {\n web: () => new SystemBarsPluginWeb(),\n});\n/******** END SYSTEM BARS PLUGIN ********/\n\nexport { Capacitor, CapacitorCookies, CapacitorException, CapacitorHttp, ExceptionCode, SystemBarType, SystemBars, SystemBarsStyle, WebPlugin, WebView, buildRequestInit, registerPlugin };\n//# sourceMappingURL=index.js.map\n"],"x_google_ignoreList":[0],"mappings":";AACA,IAAI;CACH,SAAU,GAAe;AAetB,CARA,EAAc,gBAAmB,iBAQjC,EAAc,cAAiB;GAChC,AAAkB,MAAgB,EAAE,CAAE;AACzC,IAAM,IAAN,cAAiC,MAAM;CACnC,YAAY,GAAS,GAAM,GAAM;AAI7B,EAHA,MAAM,EAAQ,EACd,KAAK,UAAU,GACf,KAAK,OAAO,GACZ,KAAK,OAAO;;GAGd,KAAiB,MAEf,GAA8C,gBACvC,YAEU,GAA8C,QAAgD,iBAAyD,SACjK,QAGA,OAIT,KAAmB,MAAQ;CAC7B,IAAM,IAAoB,EAAI,2BAA2B,MACnD,IAAM,EAAI,aAAa,EAAE,EACzB,IAAW,EAAI,UAAU,EAAI,WAAW,EAAE,EAC1C,UACK,MAAsB,OAAgC,EAAc,EAAI,GAA3C,EAA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YAAY,wBAAwB;;CAE7C,MAAM,OAAO;AACT,OAAK,YAAY,wBAAwB;;CAE7C,MAAM,OAAO;AACT,OAAK,YAAY,wBAAwB;;;AAG9B,EAAe,cAAc,EAC5C,WAAW,IAAI,GAAqB,EACvC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-kadaikodi",
3
- "version": "2026.730.1",
3
+ "version": "2026.731.2",
4
4
  "description": "Burdenoff Kadaikodi Microfrontend - Mobile services marketplace platform for connecting service providers with customers",
5
5
  "type": "module",
6
6
  "files": [
@@ -26,15 +26,15 @@
26
26
  "types": "./dist/index.d.ts",
27
27
  "scripts": {
28
28
  "dev": "vite",
29
- "build": "tsc && vite build",
29
+ "build": "tsc && bash scripts/build-limits.sh --gate vite build",
30
30
  "schema:pull": "graphql-codegen --project schema-wspace && graphql-codegen --project schema-global",
31
31
  "codegen": "graphql-codegen --project wspace && graphql-codegen --project global",
32
32
  "codegen:all": "bun run schema:pull && bun run codegen",
33
33
  "lint": "eslint .",
34
34
  "lint:sanity": "if [ \"${CI:-}\" = \"true\" ]; then bun run lint; else bun run lint -- --cache --cache-location .eslintcache; fi",
35
35
  "format": "prettier --write \"src/**/*.{ts,tsx}\"",
36
- "type:check": "tsc --noEmit",
37
- "sanity": "bun run codegen && bun run lint:sanity && bun run format && bun run type:check && bun run build && bun run build-storybook",
36
+ "type:check": "bash scripts/build-limits.sh tsc --noEmit",
37
+ "sanity": "bash scripts/build-limits.sh --gate bash -c 'bun run codegen && bun run lint:sanity && bun run format && bun run type:check && bun run build && bun run build-storybook'",
38
38
  "storybook": "storybook dev -p 6006",
39
39
  "build-storybook": "storybook build",
40
40
  "test:storybook": "test-storybook",
@@ -48,6 +48,8 @@
48
48
  "dependencies": {
49
49
  "@apollo/client": "^4.0.11",
50
50
  "@burdenoff/fe-libs": "2026.713.6",
51
+ "@capacitor/core": "8.3.1",
52
+ "@capacitor/local-notifications": "8.2.1",
51
53
  "@tanstack/react-query": "^5.90.16",
52
54
  "clsx": "^2.1.1",
53
55
  "graphql": "^16.12.0",