@burdenoff/microfe-kadaikodi 2026.1126.1 → 2026.1127.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.
- package/dist/_virtual/_rolldown/runtime.js +12 -0
- package/dist/kadaikodi/components/CourierLocationSharingCard.d.ts +10 -0
- package/dist/kadaikodi/components/CourierLocationSharingCard.js +52 -0
- package/dist/kadaikodi/components/CourierLocationSharingCard.js.map +1 -0
- package/dist/kadaikodi/components/DropoffPinField.d.ts +16 -0
- package/dist/kadaikodi/components/DropoffPinField.js +67 -0
- package/dist/kadaikodi/components/DropoffPinField.js.map +1 -0
- package/dist/kadaikodi/components/LiveTrackingMap.d.ts +27 -0
- package/dist/kadaikodi/components/LiveTrackingMap.js +74 -0
- package/dist/kadaikodi/components/LiveTrackingMap.js.map +1 -0
- package/dist/kadaikodi/hooks/useAppointmentsApi.js +42 -40
- package/dist/kadaikodi/hooks/useAppointmentsApi.js.map +1 -1
- package/dist/kadaikodi/hooks/useCourierLocationSharing.d.ts +24 -0
- package/dist/kadaikodi/hooks/useCourierLocationSharing.js +54 -0
- package/dist/kadaikodi/hooks/useCourierLocationSharing.js.map +1 -0
- package/dist/kadaikodi/hooks/useTrackingApi.d.ts +63 -0
- package/dist/kadaikodi/hooks/useTrackingApi.js +37 -0
- package/dist/kadaikodi/hooks/useTrackingApi.js.map +1 -0
- package/dist/kadaikodi/pages/customer/CheckoutPage.js +222 -213
- package/dist/kadaikodi/pages/customer/CheckoutPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.d.ts +4 -0
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js +274 -252
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/shared.d.ts +0 -13
- package/dist/kadaikodi/pages/customer/shared.js +16 -119
- package/dist/kadaikodi/pages/customer/shared.js.map +1 -1
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.d.ts +3 -2
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +67 -65
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/kadaikodi/utils/deviceGeolocation.d.ts +46 -0
- package/dist/kadaikodi/utils/deviceGeolocation.js +71 -0
- package/dist/kadaikodi/utils/deviceGeolocation.js.map +1 -0
- package/dist/kadaikodi/utils/leaflet.d.ts +8 -0
- package/dist/kadaikodi/utils/leaflet.js +11 -0
- package/dist/kadaikodi/utils/leaflet.js.map +1 -0
- package/dist/node_modules/leaflet/dist/leaflet-src.js +4535 -0
- package/dist/node_modules/leaflet/dist/leaflet-src.js.map +1 -0
- package/package.json +4 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* deviceGeolocation — read the device position for live delivery tracking
|
|
3
|
+
* (BOFF-3962).
|
|
4
|
+
* @module kadaikodi/utils
|
|
5
|
+
*
|
|
6
|
+
* Inside the Capacitor-wrapped app (kadaikodi-app) this uses the native
|
|
7
|
+
* `@capacitor/geolocation` plugin, which owns the OS permission prompt
|
|
8
|
+
* (foreground "while using the app" only — no background tracking). In a
|
|
9
|
+
* plain browser tab it falls back to `navigator.geolocation`. The plugin is
|
|
10
|
+
* imported lazily, mirroring `orderStatusNotifier`, so web builds never load
|
|
11
|
+
* it.
|
|
12
|
+
*/
|
|
13
|
+
export interface DeviceFix {
|
|
14
|
+
latitude: number;
|
|
15
|
+
longitude: number;
|
|
16
|
+
accuracyMeters: number | null;
|
|
17
|
+
headingDegrees: number | null;
|
|
18
|
+
speedMps: number | null;
|
|
19
|
+
/** ISO-8601 device time of the fix. */
|
|
20
|
+
recordedAt: string;
|
|
21
|
+
}
|
|
22
|
+
/** Why a position could not be read. */
|
|
23
|
+
export type GeolocationFailure = 'denied' | 'unavailable' | 'unsupported';
|
|
24
|
+
interface RawCoords {
|
|
25
|
+
latitude: number;
|
|
26
|
+
longitude: number;
|
|
27
|
+
accuracy?: number | null;
|
|
28
|
+
heading?: number | null;
|
|
29
|
+
speed?: number | null;
|
|
30
|
+
}
|
|
31
|
+
/** Normalise a platform position into the shape the tracking API accepts. */
|
|
32
|
+
export declare function toDeviceFix(coords: RawCoords, timestamp: number): DeviceFix;
|
|
33
|
+
/** Map a platform error to a failure kind. */
|
|
34
|
+
export declare function classifyGeolocationError(error: unknown): GeolocationFailure;
|
|
35
|
+
/** A message the courier or customer can act on. */
|
|
36
|
+
export declare function geolocationFailureMessage(failure: GeolocationFailure): string;
|
|
37
|
+
type FixHandler = (fix: DeviceFix) => void;
|
|
38
|
+
type FailureHandler = (failure: GeolocationFailure) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Start watching the device position. Resolves with a function that stops the
|
|
41
|
+
* watch; failures (permission denied, no fix) are reported through `onFailure`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function watchDevicePosition(onFix: FixHandler, onFailure: FailureHandler): Promise<() => void>;
|
|
44
|
+
/** Read the device position once (used for the checkout drop-off pin). */
|
|
45
|
+
export declare function getDevicePosition(): Promise<DeviceFix>;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Capacitor as e } from "../../node_modules/@capacitor/core/dist/index.js";
|
|
2
|
+
// src/kadaikodi/utils/deviceGeolocation.ts
|
|
3
|
+
var t = {
|
|
4
|
+
enableHighAccuracy: !0,
|
|
5
|
+
maximumAge: 5e3,
|
|
6
|
+
timeout: 2e4
|
|
7
|
+
}, n = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 && e <= t ? e : null;
|
|
8
|
+
function r(e, t) {
|
|
9
|
+
return {
|
|
10
|
+
latitude: e.latitude,
|
|
11
|
+
longitude: e.longitude,
|
|
12
|
+
accuracyMeters: n(e.accuracy, 1e4),
|
|
13
|
+
headingDegrees: n(e.heading, 359.999),
|
|
14
|
+
speedMps: n(e.speed, 100),
|
|
15
|
+
recordedAt: new Date(Number.isFinite(t) ? t : Date.now()).toISOString()
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function i(e) {
|
|
19
|
+
if (typeof e == "object" && e && "code" in e && e.code === 1) return "denied";
|
|
20
|
+
let t = e instanceof Error ? e.message : String(e ?? "");
|
|
21
|
+
return /denied|permission/i.test(t) ? "denied" : "unavailable";
|
|
22
|
+
}
|
|
23
|
+
function a(e) {
|
|
24
|
+
switch (e) {
|
|
25
|
+
case "denied": return "Location permission is off. Allow location access for Kadaikodi and try again.";
|
|
26
|
+
case "unsupported": return "This device cannot share its location.";
|
|
27
|
+
default: return "Could not read your location. Check that location services are on.";
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async function o(e, n) {
|
|
31
|
+
let { Geolocation: a } = await import(
|
|
32
|
+
/* @vite-ignore */
|
|
33
|
+
"@capacitor/geolocation"
|
|
34
|
+
), o = await a.checkPermissions();
|
|
35
|
+
if (o.location !== "granted" && (o = await a.requestPermissions({ permissions: ["location"] })), o.location !== "granted") return n("denied"), () => void 0;
|
|
36
|
+
let s = await a.watchPosition(t, (t, a) => {
|
|
37
|
+
a ? n(i(a)) : t && e(r(t.coords, t.timestamp));
|
|
38
|
+
});
|
|
39
|
+
return () => {
|
|
40
|
+
a.clearWatch({ id: s });
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function s(e, n) {
|
|
44
|
+
if (typeof navigator > "u" || !navigator.geolocation) return n("unsupported"), () => void 0;
|
|
45
|
+
let a = navigator.geolocation.watchPosition((t) => e(r(t.coords, t.timestamp)), (e) => n(i(e)), t);
|
|
46
|
+
return () => navigator.geolocation.clearWatch(a);
|
|
47
|
+
}
|
|
48
|
+
async function c(t, n) {
|
|
49
|
+
if (e.isNativePlatform()) try {
|
|
50
|
+
return await o(t, n);
|
|
51
|
+
} catch (e) {
|
|
52
|
+
return n(i(e)), () => void 0;
|
|
53
|
+
}
|
|
54
|
+
return s(t, n);
|
|
55
|
+
}
|
|
56
|
+
async function l() {
|
|
57
|
+
if (e.isNativePlatform()) {
|
|
58
|
+
let { Geolocation: e } = await import(
|
|
59
|
+
/* @vite-ignore */
|
|
60
|
+
"@capacitor/geolocation"
|
|
61
|
+
), n = await e.getCurrentPosition(t);
|
|
62
|
+
return r(n.coords, n.timestamp);
|
|
63
|
+
}
|
|
64
|
+
if (typeof navigator > "u" || !navigator.geolocation) throw Error("unsupported");
|
|
65
|
+
return new Promise((e, n) => {
|
|
66
|
+
navigator.geolocation.getCurrentPosition((t) => e(r(t.coords, t.timestamp)), n, t);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
export { i as classifyGeolocationError, a as geolocationFailureMessage, l as getDevicePosition, r as toDeviceFix, c as watchDevicePosition };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=deviceGeolocation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deviceGeolocation.js","names":["WATCH_OPTIONS","finiteOrNull","value","max","toDeviceFix","coords","timestamp","classifyGeolocationError","error","message","geolocationFailureMessage","failure","watchNative","permission","Geolocation","onFailure","id","position","onFix","watchBrowser","watchDevicePosition","Capacitor","getDevicePosition","resolve","reject"],"sources":["../../../src/kadaikodi/utils/deviceGeolocation.ts"],"sourcesContent":["/**\n * deviceGeolocation — read the device position for live delivery tracking\n * (BOFF-3962).\n * @module kadaikodi/utils\n *\n * Inside the Capacitor-wrapped app (kadaikodi-app) this uses the native\n * `@capacitor/geolocation` plugin, which owns the OS permission prompt\n * (foreground \"while using the app\" only — no background tracking). In a\n * plain browser tab it falls back to `navigator.geolocation`. The plugin is\n * imported lazily, mirroring `orderStatusNotifier`, so web builds never load\n * it.\n */\n\nimport { Capacitor } from '@capacitor/core';\n\nexport interface DeviceFix {\n latitude: number;\n longitude: number;\n accuracyMeters: number | null;\n headingDegrees: number | null;\n speedMps: number | null;\n /** ISO-8601 device time of the fix. */\n recordedAt: string;\n}\n\n/** Why a position could not be read. */\nexport type GeolocationFailure = 'denied' | 'unavailable' | 'unsupported';\n\ninterface RawCoords {\n latitude: number;\n longitude: number;\n accuracy?: number | null;\n heading?: number | null;\n speed?: number | null;\n}\n\nconst WATCH_OPTIONS = { enableHighAccuracy: true, maximumAge: 5_000, timeout: 20_000 } as const;\n\nconst finiteOrNull = (value: number | null | undefined, max: number): number | null =>\n typeof value === 'number' && Number.isFinite(value) && value >= 0 && value <= max ? value : null;\n\n/** Normalise a platform position into the shape the tracking API accepts. */\nexport function toDeviceFix(coords: RawCoords, timestamp: number): DeviceFix {\n return {\n latitude: coords.latitude,\n longitude: coords.longitude,\n accuracyMeters: finiteOrNull(coords.accuracy, 10_000),\n // Browsers report NaN heading while stationary; the API rejects 360+.\n headingDegrees: finiteOrNull(coords.heading, 359.999),\n speedMps: finiteOrNull(coords.speed, 100),\n recordedAt: new Date(Number.isFinite(timestamp) ? timestamp : Date.now()).toISOString(),\n };\n}\n\n/** Map a platform error to a failure kind. */\nexport function classifyGeolocationError(error: unknown): GeolocationFailure {\n // GeolocationPositionError.PERMISSION_DENIED === 1\n if (typeof error === 'object' && error !== null && 'code' in error && error.code === 1) {\n return 'denied';\n }\n const message = error instanceof Error ? error.message : String(error ?? '');\n return /denied|permission/i.test(message) ? 'denied' : 'unavailable';\n}\n\n/** A message the courier or customer can act on. */\nexport function geolocationFailureMessage(failure: GeolocationFailure): string {\n switch (failure) {\n case 'denied':\n return 'Location permission is off. Allow location access for Kadaikodi and try again.';\n case 'unsupported':\n return 'This device cannot share its location.';\n default:\n return 'Could not read your location. Check that location services are on.';\n }\n}\n\ntype FixHandler = (fix: DeviceFix) => void;\ntype FailureHandler = (failure: GeolocationFailure) => void;\n\nasync function watchNative(onFix: FixHandler, onFailure: FailureHandler): Promise<() => void> {\n const { Geolocation } = await import(/* @vite-ignore */ '@capacitor/geolocation');\n let permission = await Geolocation.checkPermissions();\n if (permission.location !== 'granted') {\n permission = await Geolocation.requestPermissions({ permissions: ['location'] });\n }\n if (permission.location !== 'granted') {\n onFailure('denied');\n return () => undefined;\n }\n const id = await Geolocation.watchPosition(WATCH_OPTIONS, (position, error) => {\n if (error) {\n onFailure(classifyGeolocationError(error));\n return;\n }\n if (position) onFix(toDeviceFix(position.coords, position.timestamp));\n });\n return () => {\n void Geolocation.clearWatch({ id });\n };\n}\n\nfunction watchBrowser(onFix: FixHandler, onFailure: FailureHandler): () => void {\n if (typeof navigator === 'undefined' || !navigator.geolocation) {\n onFailure('unsupported');\n return () => undefined;\n }\n const id = navigator.geolocation.watchPosition(\n (position) => onFix(toDeviceFix(position.coords, position.timestamp)),\n (error) => onFailure(classifyGeolocationError(error)),\n WATCH_OPTIONS\n );\n return () => navigator.geolocation.clearWatch(id);\n}\n\n/**\n * Start watching the device position. Resolves with a function that stops the\n * watch; failures (permission denied, no fix) are reported through `onFailure`.\n */\nexport async function watchDevicePosition(\n onFix: FixHandler,\n onFailure: FailureHandler\n): Promise<() => void> {\n if (Capacitor.isNativePlatform()) {\n try {\n return await watchNative(onFix, onFailure);\n } catch (error) {\n onFailure(classifyGeolocationError(error));\n return () => undefined;\n }\n }\n return watchBrowser(onFix, onFailure);\n}\n\n/** Read the device position once (used for the checkout drop-off pin). */\nexport async function getDevicePosition(): Promise<DeviceFix> {\n if (Capacitor.isNativePlatform()) {\n const { Geolocation } = await import(/* @vite-ignore */ '@capacitor/geolocation');\n const position = await Geolocation.getCurrentPosition(WATCH_OPTIONS);\n return toDeviceFix(position.coords, position.timestamp);\n }\n if (typeof navigator === 'undefined' || !navigator.geolocation) {\n throw new Error('unsupported');\n }\n return new Promise<DeviceFix>((resolve, reject) => {\n navigator.geolocation.getCurrentPosition(\n (position) => resolve(toDeviceFix(position.coords, position.timestamp)),\n reject,\n WATCH_OPTIONS\n );\n });\n}\n"],"mappings":";;AAoCA,IAAMA,IAAgB;CAAE,oBAAoB;CAAM,YAAY;CAAO,SAAS;AAAO,GAE/EC,KAAgB,GAAkC,MACtD,OAAOC,KAAU,YAAY,OAAO,SAASA,CAAK,KAAKA,KAAS,KAAKA,KAASC,IAAMD,IAAQ;AAG9F,SAAgBE,EAAY,GAAmB,GAA8B;CAC3E,OAAO;EACL,UAAUC,EAAO;EACjB,WAAWA,EAAO;EAClB,gBAAgBJ,EAAaI,EAAO,UAAU,GAAM;EAEpD,gBAAgBJ,EAAaI,EAAO,SAAS,OAAO;EACpD,UAAUJ,EAAaI,EAAO,OAAO,GAAG;EACxC,YAAY,IAAI,KAAK,OAAO,SAASC,CAAS,IAAIA,IAAY,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY;CACxF;AACF;AAGA,SAAgBC,EAAyB,GAAoC;CAE3E,IAAI,OAAOC,KAAU,YAAYA,KAAkB,UAAUA,KAASA,EAAM,SAAS,GACnF,OAAO;CAET,IAAMC,IAAUD,aAAiB,QAAQA,EAAM,UAAU,OAAOA,KAAS,EAAE;CAC3E,OAAO,qBAAqB,KAAKC,CAAO,IAAI,WAAW;AACzD;AAGA,SAAgBC,EAA0B,GAAqC;CAC7E,QAAQC,GAAR;EACE,KAAK,UACH,OAAO;EACT,KAAK,eACH,OAAO;EACT,SACE,OAAO;CACX;AACF;AAKA,eAAeC,EAAY,GAAmB,GAAgD;CAC5F,IAAM,EAAE,mBAAgB,MAAM;;EAA0B;GACpDC,IAAa,MAAMC,EAAY,iBAAiB;CAIpD,IAHID,EAAW,aAAa,cAC1B,IAAa,MAAMC,EAAY,mBAAmB,EAAE,aAAa,CAAC,UAAU,EAAE,CAAC,IAE7ED,EAAW,aAAa,WAE1B,OADAE,EAAU,QAAQ,SACL,KAAA;CAEf,IAAMC,IAAK,MAAMF,EAAY,cAAcd,IAAgB,GAAU,MAAU;EAC7E,AAAIQ,IACFO,EAAUR,EAAyBC,CAAK,CAAC,IAGvCS,KAAUC,EAAMd,EAAYa,EAAS,QAAQA,EAAS,SAAS,CAAC;CACtE,CAAC;CACD,aAAa;EACX,EAAiB,WAAW,EAAE,MAAG,CAAC;CACpC;AACF;AAEA,SAASE,EAAa,GAAmB,GAAuC;CAC9E,IAAI,OAAO,YAAc,OAAe,CAAC,UAAU,aAEjD,OADAJ,EAAU,aAAa,SACV,KAAA;CAEf,IAAMC,IAAK,UAAU,YAAY,eAC9B,MAAaE,EAAMd,EAAYa,EAAS,QAAQA,EAAS,SAAS,CAAC,IACnE,MAAUF,EAAUR,EAAyBC,CAAK,CAAC,GACpDR,CACF;CACA,aAAa,UAAU,YAAY,WAAWgB,CAAE;AAClD;AAMA,eAAsBI,EACpB,GACA,GACqB;CACrB,IAAIC,EAAU,iBAAiB,GAC7B,IAAI;EACF,OAAO,MAAMT,EAAYM,GAAOH,CAAS;CAC3C,SAASP,GAAO;EAEd,OADAO,EAAUR,EAAyBC,CAAK,CAAC,SAC5B,KAAA;CACf;CAEF,OAAOW,EAAaD,GAAOH,CAAS;AACtC;AAGA,eAAsBO,IAAwC;CAC5D,IAAID,EAAU,iBAAiB,GAAG;EAChC,IAAM,EAAE,mBAAgB,MAAM;;GAA0B;GAClDJ,IAAW,MAAMH,EAAY,mBAAmBd,CAAa;EACnE,OAAOI,EAAYa,EAAS,QAAQA,EAAS,SAAS;CACxD;CACA,IAAI,OAAO,YAAc,OAAe,CAAC,UAAU,aACjD,MAAU,MAAM,aAAa;CAE/B,OAAO,IAAI,SAAoB,GAAS,MAAW;EACjD,UAAU,YAAY,oBACnB,MAAaM,EAAQnB,EAAYa,EAAS,QAAQA,EAAS,SAAS,CAAC,GACtEO,GACAxB,CACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Inject Leaflet's stylesheet once (idempotent). */
|
|
2
|
+
export declare function ensureLeafletCss(): void;
|
|
3
|
+
/**
|
|
4
|
+
* Resolve a theme token (e.g. `--color-accent-primary`) to its current value.
|
|
5
|
+
* Leaflet's SVG paths take a literal colour, not `var(...)`; `currentColor` is
|
|
6
|
+
* the neutral fallback when the token is not defined.
|
|
7
|
+
*/
|
|
8
|
+
export declare function themeColor(token: string): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function e() {
|
|
2
|
+
if (typeof document > "u" || document.getElementById("leaflet-css")) return;
|
|
3
|
+
let e = document.createElement("link");
|
|
4
|
+
e.id = "leaflet-css", e.rel = "stylesheet", e.href = "https://unpkg.com/leaflet@1.9.4/dist/leaflet.css", e.integrity = "sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=", e.crossOrigin = "anonymous", document.head.appendChild(e);
|
|
5
|
+
}
|
|
6
|
+
function t(e) {
|
|
7
|
+
return typeof document > "u" ? "currentColor" : getComputedStyle(document.documentElement).getPropertyValue(e).trim() || "currentColor";
|
|
8
|
+
}
|
|
9
|
+
export { e as ensureLeafletCss, t as themeColor };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=leaflet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leaflet.js","names":["ensureLeafletCss","link","themeColor","token"],"sources":["../../../src/kadaikodi/utils/leaflet.ts"],"sourcesContent":["// Shared Leaflet runtime helpers (BOFF-3962).\n//\n// The MFE library build does not deliver a component's bundled CSS to the host\n// shell (host styles come from its own Tailwind), so Leaflet's stylesheet is\n// loaded from a pinned CDN URL at runtime with Subresource Integrity — the same\n// approach microfe-healthybowl uses for its maps.\n\nconst LEAFLET_CSS = 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.css';\n// SRI for the immutable leaflet@1.9.4/dist/leaflet.css — guards against a CDN compromise.\nconst LEAFLET_CSS_SRI = 'sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=';\n\n/** Inject Leaflet's stylesheet once (idempotent). */\nexport function ensureLeafletCss(): void {\n if (typeof document === 'undefined') return;\n if (document.getElementById('leaflet-css')) return;\n const link = document.createElement('link');\n link.id = 'leaflet-css';\n link.rel = 'stylesheet';\n link.href = LEAFLET_CSS;\n link.integrity = LEAFLET_CSS_SRI;\n link.crossOrigin = 'anonymous';\n document.head.appendChild(link);\n}\n\n/**\n * Resolve a theme token (e.g. `--color-accent-primary`) to its current value.\n * Leaflet's SVG paths take a literal colour, not `var(...)`; `currentColor` is\n * the neutral fallback when the token is not defined.\n */\nexport function themeColor(token: string): string {\n if (typeof document === 'undefined') return 'currentColor';\n const value = getComputedStyle(document.documentElement).getPropertyValue(token).trim();\n return value || 'currentColor';\n}\n"],"mappings":"AAYA,SAAgBA,IAAyB;CAEvC,IADI,OAAO,WAAa,OACpB,SAAS,eAAe,aAAa,GAAG;CAC5C,IAAMC,IAAO,SAAS,cAAc,MAAM;CAM1C,AALA,EAAK,KAAK,eACV,EAAK,MAAM,cACX,EAAK,OAAO,oDACZ,EAAK,YAAY,uDACjB,EAAK,cAAc,aACnB,SAAS,KAAK,YAAYA,CAAI;AAChC;AAOA,SAAgBC,EAAW,GAAuB;CAGhD,OAFI,OAAO,WAAa,MAAoB,iBAC9B,iBAAiB,SAAS,eAAe,CAAC,CAAC,iBAAiBC,CAAK,CAAC,CAAC,KAC1E,KAAS;AAClB"}
|