@burdenoff/microfe-kadaikodi 2026.1109.1 → 2026.1113.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../components/viz/index.js";
|
|
2
2
|
import { PageLayout as e } from "../../components/PageLayout.js";
|
|
3
3
|
import { useKadaikodi as t } from "../../context/KadaikodiContext.js";
|
|
4
|
-
import { useUpdateWorkerTaskStatus as n, useWorkerClockInOut as r, useWorkerStats as
|
|
4
|
+
import { useUpdateWorkerTaskStatus as n, useWorkerClockInOut as r, useWorkerStats as i, useWorkerTasks as ee } from "../../hooks/useKadaikodiApi.js";
|
|
5
5
|
import { cn as a } from "../../utils/cn.js";
|
|
6
6
|
import { ProgressRing as o } from "../../components/viz/ProgressRing.js";
|
|
7
7
|
import { StatCard as s } from "../../components/viz/StatCard.js";
|
|
@@ -47,7 +47,7 @@ function P(e) {
|
|
|
47
47
|
].filter(Boolean).join(", ");
|
|
48
48
|
}
|
|
49
49
|
var F = () => {
|
|
50
|
-
let { navigateTo: d, currentUser: p } = t(), h = p?.id || "", { data: x = [], isLoading: F } =
|
|
50
|
+
let { navigateTo: d, currentUser: p } = t(), h = p?.id || "", { data: x = [], isLoading: F } = ee(h), { data: I, isLoading: L } = i(h), R = n(), z = r(), [B, V] = u(null), [H, U] = u(!1), [W, G] = u(null), [K, q] = u(null), J = p?.firstName ?? p?.name?.split(" ")[0] ?? "there", Y = async (e, t) => {
|
|
51
51
|
q(null);
|
|
52
52
|
let n = "";
|
|
53
53
|
switch (t) {
|
|
@@ -129,13 +129,18 @@ var F = () => {
|
|
|
129
129
|
})
|
|
130
130
|
}),
|
|
131
131
|
I && /* @__PURE__ */ E("div", {
|
|
132
|
-
className: "grid grid-cols-2 lg:grid-cols-
|
|
132
|
+
className: "grid grid-cols-2 lg:grid-cols-5 gap-3 sm:gap-4",
|
|
133
133
|
children: [
|
|
134
134
|
/* @__PURE__ */ T(s, {
|
|
135
135
|
label: "Today's Earnings",
|
|
136
136
|
value: l(I.todayEarnings, { minimumFractionDigits: 0 }),
|
|
137
137
|
icon: /* @__PURE__ */ T(w, { className: "h-4 w-4" })
|
|
138
138
|
}),
|
|
139
|
+
/* @__PURE__ */ T(s, {
|
|
140
|
+
label: "Lifetime Earnings",
|
|
141
|
+
value: l(I.totalEarnings, { minimumFractionDigits: 0 }),
|
|
142
|
+
icon: /* @__PURE__ */ T(g, { className: "h-4 w-4" })
|
|
143
|
+
}),
|
|
139
144
|
/* @__PURE__ */ T(s, {
|
|
140
145
|
label: "Deliveries",
|
|
141
146
|
value: I.totalDeliveries,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkerDashboard.js","names":["priorityStyles","typeStyles","getTaskIcon","type","Truck","ChefHat","Boxes","Sparkles","ClipboardList","priorityOrder","formatAddress","task","a","WorkerDashboard","useKadaikodi","workerId","currentUser","tasks","isLoadingTasks","useWorkerTasks","stats","isLoadingStats","useWorkerStats","updateTaskStatus","useUpdateWorkerTaskStatus","clockInOut","useWorkerClockInOut","activeTaskId","setActiveTaskId","useState","isClockedIn","setIsClockedIn","clockInTime","setClockInTime","actionError","setActionError","firstName","handleTaskAction","status","action","taskId","handleClockToggle","now","PageLayout","Loader2","currentTask","t","assignedTasks","b","completedTasks","cn","Clock","PagePurpose","StatCard","formatCurrency","Wallet","Star","CheckCircle2","NextSteps","navigateTo","GlassCard","TaskIcon","Package","MapPin","Pause","ChevronRight","pickup","drop","isBusy","IndianRupee","Play","ProgressRing","RatingStars"],"sources":["../../../../src/kadaikodi/pages/worker/WorkerDashboard.tsx"],"sourcesContent":["/**\n * Worker Dashboard Page\n *\n * The signed-in worker's shift command centre, elevated to the delivery-driver\n * concept in kk-worker-01-dashboard: a greeting header with a live Clocked-In /\n * Clock-In pill, a row of KPI StatCards (earnings / deliveries / rating /\n * completion) and delivery-style assigned-task cards with a pickup → drop route\n * and a distance + earnings chip. All data is real (useWorkerStats /\n * useWorkerTasks); clock + task actions are wired to the real mutations.\n *\n * @module kadaikodi/pages/worker\n */\n\nimport { useState } from 'react';\nimport {\n CheckCircle2,\n Star,\n ClipboardList,\n Clock,\n MapPin,\n ChevronRight,\n Package,\n Loader2,\n Pause,\n Play,\n Truck,\n ChefHat,\n Boxes,\n Sparkles,\n IndianRupee,\n Wallet,\n} from 'lucide-react';\nimport { GlassCard, PagePurpose, NextSteps } from '@burdenoff/fe-libs/ui';\nimport { StatCard, ProgressRing, RatingStars } from '../../components/viz';\nimport { PageLayout } from '../../components/PageLayout';\nimport { useKadaikodi } from '../../context/KadaikodiContext';\nimport {\n useWorkerTasks,\n useWorkerStats,\n useUpdateWorkerTaskStatus,\n useWorkerClockInOut,\n} from '../../hooks/useKadaikodiApi';\nimport { cn } from '../../utils/cn';\nimport { formatCurrency } from '../../utils/formatters';\nimport type { WorkerTask } from '../../types';\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\nconst priorityStyles: Record<string, string> = {\n urgent: 'bg-status-error-bg-subtle text-status-error-text',\n high: 'bg-status-error-bg-subtle text-status-error-text',\n medium: 'bg-status-warning-bg-subtle text-status-warning-text',\n low: 'bg-status-success-bg-subtle text-status-success-text',\n};\n\nconst typeStyles: Record<string, string> = {\n delivery: 'bg-accent-primary/12 text-accent-primary',\n pickup: 'bg-status-info-bg-subtle text-status-info-text',\n service: 'bg-status-success-bg-subtle text-status-success-text',\n};\n\nfunction getTaskIcon(type: string) {\n switch (type) {\n case 'delivery':\n return Truck;\n case 'preparation':\n return ChefHat;\n case 'inventory':\n return Boxes;\n case 'cleanup':\n return Sparkles;\n default:\n return ClipboardList;\n }\n}\n\nconst priorityOrder: Record<string, number> = { urgent: 4, high: 3, medium: 2, low: 1 };\n\nfunction formatAddress(task: WorkerTask): string {\n if (!task.deliveryAddress) return task.location ?? '';\n const a = task.deliveryAddress;\n return [a.street, a.area, a.city].filter(Boolean).join(', ');\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport const WorkerDashboard = () => {\n const { navigateTo, currentUser } = useKadaikodi();\n const workerId = currentUser?.id || '';\n\n const { data: tasks = [], isLoading: isLoadingTasks } = useWorkerTasks(workerId);\n const { data: stats, isLoading: isLoadingStats } = useWorkerStats(workerId);\n const updateTaskStatus = useUpdateWorkerTaskStatus();\n const clockInOut = useWorkerClockInOut();\n\n const [activeTaskId, setActiveTaskId] = useState<string | null>(null);\n const [isClockedIn, setIsClockedIn] = useState(false);\n const [clockInTime, setClockInTime] = useState<string | null>(null);\n const [actionError, setActionError] = useState<string | null>(null);\n\n const firstName = currentUser?.firstName ?? currentUser?.name?.split(' ')[0] ?? 'there';\n\n const handleTaskAction = async (taskId: string, action: 'start' | 'complete' | 'pause') => {\n setActionError(null);\n let status = '';\n switch (action) {\n case 'start':\n status = 'IN_PROGRESS';\n setActiveTaskId(taskId);\n break;\n case 'complete':\n status = 'COMPLETED';\n if (activeTaskId === taskId) setActiveTaskId(null);\n break;\n case 'pause':\n status = 'PENDING';\n if (activeTaskId === taskId) setActiveTaskId(null);\n break;\n }\n try {\n await updateTaskStatus.mutateAsync({ taskId, status });\n } catch {\n setActionError('Failed to update task. Please try again.');\n }\n };\n\n const handleClockToggle = async () => {\n setActionError(null);\n const action = isClockedIn ? 'CLOCK_OUT' : 'CLOCK_IN';\n try {\n const result = await clockInOut.mutateAsync({ workerId, action });\n if (result.success) {\n if (isClockedIn) {\n setIsClockedIn(false);\n setClockInTime(null);\n } else {\n const now = new Date().toLocaleTimeString('en-IN', {\n hour: '2-digit',\n minute: '2-digit',\n hour12: true,\n });\n setIsClockedIn(true);\n setClockInTime(now);\n }\n }\n } catch {\n setActionError('Clock action failed. Please try again.');\n }\n };\n\n // Loading state\n if (isLoadingTasks || isLoadingStats) {\n return (\n <PageLayout title={`Hi, ${firstName}`} description=\"Your shift at a glance\">\n <div className=\"flex items-center justify-center py-24\">\n <div className=\"text-center\">\n <Loader2 className=\"h-10 w-10 animate-spin text-text-secondary mx-auto mb-4\" />\n <p className=\"text-sm text-text-secondary\">Loading your dashboard...</p>\n </div>\n </div>\n </PageLayout>\n );\n }\n\n const currentTask = activeTaskId ? tasks.find((t) => t.id === activeTaskId) : null;\n const assignedTasks = tasks\n .filter((t) => t.status !== 'completed')\n .sort((a, b) => (priorityOrder[b.priority] ?? 0) - (priorityOrder[a.priority] ?? 0));\n const completedTasks = tasks.filter((t) => t.status === 'completed');\n\n return (\n <PageLayout\n title={`Hi, ${firstName}`}\n description=\"Your shift at a glance — clock in, then pick up your next delivery.\"\n actions={\n <button\n type=\"button\"\n onClick={handleClockToggle}\n disabled={clockInOut.isPending}\n className={cn(\n 'inline-flex items-center gap-2 rounded-full px-4 py-2 text-sm font-semibold shadow-sm transition-colors disabled:opacity-60',\n isClockedIn\n ? 'bg-status-success-bg-subtle text-status-success-text border border-status-success-text/30'\n : 'bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover'\n )}\n >\n {clockInOut.isPending ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n ) : isClockedIn ? (\n <span className=\"relative flex h-2.5 w-2.5\">\n <span className=\"animate-ping absolute inline-flex h-full w-full rounded-full bg-status-success-text opacity-75\" />\n <span className=\"relative inline-flex rounded-full h-2.5 w-2.5 bg-status-success-text\" />\n </span>\n ) : (\n <Clock className=\"h-4 w-4\" />\n )}\n {isClockedIn ? 'Clocked In' : 'Clock In'}\n </button>\n }\n >\n <div className=\"space-y-6\">\n <PagePurpose>\n Your shift command centre — see today's assigned deliveries at a glance, clock\n in/out, and jump straight into the order you're working on. Clock in first, then\n start your next task below.\n </PagePurpose>\n\n {actionError && (\n <div className=\"rounded-lg border border-status-error-text/20 bg-status-error-bg-subtle p-3\">\n <p className=\"text-xs text-status-error-text\">{actionError}</p>\n </div>\n )}\n\n {/* KPI row — mirrors the mockup's earnings / deliveries / rating / on-time tiles */}\n {stats && (\n <div className=\"grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4\">\n <StatCard\n label=\"Today's Earnings\"\n value={formatCurrency(stats.todayEarnings, { minimumFractionDigits: 0 })}\n icon={<Wallet className=\"h-4 w-4\" />}\n />\n <StatCard\n label=\"Deliveries\"\n value={stats.totalDeliveries}\n icon={<Truck className=\"h-4 w-4\" />}\n />\n <StatCard\n label=\"Rating\"\n value={\n <span className=\"flex items-center gap-1.5\">\n {stats.averageRating.toFixed(1)}\n <Star className=\"h-5 w-5 fill-status-warning-text text-status-warning-text\" />\n </span>\n }\n icon={<Star className=\"h-4 w-4\" />}\n />\n <StatCard\n label=\"Completion\"\n value={`${stats.completionRate}%`}\n icon={<CheckCircle2 className=\"h-4 w-4\" />}\n />\n </div>\n )}\n\n {isClockedIn && clockInTime && (\n <div className=\"flex items-center gap-2 rounded-lg bg-status-success-bg-subtle border border-status-success-text/20 px-3 py-2 w-fit\">\n <span className=\"relative flex h-2 w-2\">\n <span className=\"animate-ping absolute inline-flex h-full w-full rounded-full bg-status-success-text opacity-75\" />\n <span className=\"relative inline-flex rounded-full h-2 w-2 bg-status-success-text\" />\n </span>\n <span className=\"text-xs font-medium text-status-success-text\">\n Working since {clockInTime}\n </span>\n </div>\n )}\n\n <NextSteps\n storageKey=\"kadaikodi-worker-dashboard\"\n steps={[\n {\n id: 'clock-in',\n label: 'Clock in to start your shift',\n description: 'Track your hours and let dispatch know you are available.',\n onClick: () => {\n if (!isClockedIn) handleClockToggle();\n },\n done: isClockedIn,\n },\n {\n id: 'orders',\n label: 'Review assigned orders',\n description: 'See what needs picking up and delivering today.',\n onClick: () => navigateTo('/worker/orders'),\n },\n {\n id: 'schedule',\n label: 'Check your schedule',\n description: 'Know your upcoming shifts and plan ahead.',\n onClick: () => navigateTo('/worker/schedule'),\n },\n ]}\n />\n\n {/* Current Task */}\n {currentTask && (\n <div>\n <h2 className=\"text-base font-semibold text-text-primary mb-3\">Current Task</h2>\n <GlassCard treatment=\"insight\" glow className=\"p-6\">\n <div className=\"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4\">\n <div className=\"flex items-start gap-3 min-w-0\">\n {(() => {\n const TaskIcon = getTaskIcon(currentTask.type);\n return (\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-accent-primary/12 text-accent-primary\">\n <TaskIcon className=\"h-5 w-5\" />\n </div>\n );\n })()}\n <div className=\"min-w-0\">\n <h3 className=\"text-lg font-semibold text-text-primary\">\n {currentTask.title ?? currentTask.description}\n </h3>\n <p className=\"text-sm text-text-secondary mt-1\">{currentTask.description}</p>\n <div className=\"flex flex-wrap items-center gap-3 mt-2 text-sm text-text-secondary\">\n {currentTask.customerName && (\n <span className=\"flex items-center gap-1\">\n <Package className=\"h-3.5 w-3.5\" />\n {currentTask.customerName}\n </span>\n )}\n {formatAddress(currentTask) && (\n <span className=\"flex items-center gap-1\">\n <MapPin className=\"h-3.5 w-3.5\" />\n {formatAddress(currentTask)}\n </span>\n )}\n </div>\n </div>\n </div>\n <div className=\"flex gap-2 shrink-0\">\n <button\n type=\"button\"\n onClick={() => handleTaskAction(currentTask.id, 'complete')}\n className=\"inline-flex items-center gap-1.5 rounded-md bg-status-success-bg-subtle px-3 py-2 text-sm font-medium text-status-success-text transition-colors\"\n >\n <CheckCircle2 className=\"h-4 w-4\" />\n Complete\n </button>\n <button\n type=\"button\"\n onClick={() => handleTaskAction(currentTask.id, 'pause')}\n className=\"inline-flex items-center gap-1.5 rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors\"\n >\n <Pause className=\"h-4 w-4\" />\n Pause\n </button>\n </div>\n </div>\n </GlassCard>\n </div>\n )}\n\n {/* Assigned Tasks — delivery cards matching the mockup */}\n <div>\n <div className=\"flex items-center justify-between mb-3\">\n <h2 className=\"text-base font-semibold text-text-primary\">Assigned Tasks</h2>\n <button\n type=\"button\"\n onClick={() => navigateTo('/worker/orders')}\n className=\"inline-flex items-center gap-1 text-sm font-medium text-accent-primary hover:underline\"\n >\n View all\n <ChevronRight className=\"h-4 w-4\" />\n </button>\n </div>\n\n {assignedTasks.length > 0 ? (\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {assignedTasks.map((task) => {\n const pickup = task.cartName || 'Pickup';\n const drop = formatAddress(task) || task.customerName || 'Drop-off';\n const isBusy = activeTaskId !== null && activeTaskId !== task.id;\n return (\n <GlassCard key={task.id} treatment=\"metric\" className=\"flex flex-col gap-4 p-5\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold capitalize',\n typeStyles[task.type] ?? 'bg-bg-sunken text-text-secondary'\n )}\n >\n {task.type}\n </span>\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize',\n priorityStyles[task.priority] ?? 'bg-bg-sunken text-text-secondary'\n )}\n >\n {task.priority}\n </span>\n </div>\n {task.orderId && (\n <span className=\"text-sm font-bold text-text-primary tabular-nums\">\n #{task.orderId}\n </span>\n )}\n </div>\n\n {task.customerName && (\n <p className=\"-mt-1 text-sm text-text-secondary\">\n Customer:{' '}\n <span className=\"font-medium text-text-primary\">{task.customerName}</span>\n </p>\n )}\n\n {/* Pickup → Drop route */}\n <div className=\"flex items-stretch gap-3\">\n <div className=\"flex flex-col items-center pt-1\">\n <MapPin className=\"h-4 w-4 text-accent-primary shrink-0\" />\n <span className=\"my-1 w-px flex-1 border-l border-dashed border-border-strong\" />\n <MapPin className=\"h-4 w-4 text-status-success-text shrink-0\" />\n </div>\n <div className=\"flex flex-1 flex-col justify-between gap-3 min-w-0\">\n <p className=\"text-sm text-text-primary line-clamp-1\">{pickup}</p>\n <p className=\"text-sm text-text-primary line-clamp-1\">{drop}</p>\n </div>\n <div className=\"flex flex-col items-end justify-center rounded-lg bg-bg-sunken px-3 py-2 text-right shrink-0\">\n {task.distance != null && (\n <span className=\"text-xs text-text-secondary tabular-nums\">\n {task.distance} km\n </span>\n )}\n {task.earnings > 0 && (\n <span className=\"flex items-center text-base font-bold text-text-primary tabular-nums\">\n <IndianRupee className=\"h-3.5 w-3.5\" />\n {formatCurrency(task.earnings, {\n minimumFractionDigits: 0,\n style: 'decimal',\n })}\n </span>\n )}\n </div>\n </div>\n\n <div className=\"flex gap-2\">\n {task.status === 'pending' && (\n <button\n type=\"button\"\n onClick={() => handleTaskAction(task.id, 'start')}\n disabled={isBusy}\n className={cn(\n 'flex-1 inline-flex items-center justify-center gap-1.5 rounded-lg px-4 py-2.5 text-sm font-semibold transition-colors',\n isBusy\n ? 'bg-bg-sunken text-text-muted cursor-not-allowed'\n : 'bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover'\n )}\n >\n <Play className=\"h-4 w-4\" />\n Start\n </button>\n )}\n {task.status === 'in_progress' && (\n <button\n type=\"button\"\n onClick={() => setActiveTaskId(task.id)}\n className=\"flex-1 inline-flex items-center justify-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2.5 text-sm font-semibold text-action-primary-text hover:bg-action-primary-bg-hover transition-colors\"\n >\n <Play className=\"h-4 w-4\" />\n Resume\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => navigateTo(`/worker/task/${task.id}`)}\n className=\"inline-flex items-center justify-center gap-1 rounded-lg border border-border-default bg-bg-surface px-4 py-2.5 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors\"\n >\n Details\n <ChevronRight className=\"h-4 w-4\" />\n </button>\n </div>\n </GlassCard>\n );\n })}\n </div>\n ) : (\n <GlassCard className=\"p-8 text-center\">\n <CheckCircle2 className=\"h-10 w-10 text-status-success-text opacity-50 mx-auto mb-2\" />\n <p className=\"text-sm text-text-secondary\">All tasks completed. Nice work!</p>\n </GlassCard>\n )}\n </div>\n\n {/* Two-up: performance + recent completions */}\n <div className=\"grid grid-cols-1 lg:grid-cols-3 gap-4\">\n <GlassCard treatment=\"insight\" className=\"p-6 flex flex-col items-center text-center\">\n <h2 className=\"text-base font-semibold text-text-primary mb-4 self-start\">\n Completion Rate\n </h2>\n <ProgressRing\n value={stats?.completionRate ?? 0}\n max={100}\n label={`${stats?.completionRate ?? 0}%`}\n caption=\"on-time\"\n />\n <div className=\"mt-4\">\n <RatingStars value={stats?.averageRating ?? 0} showValue size={18} />\n </div>\n </GlassCard>\n\n <GlassCard className=\"p-6 lg:col-span-2\">\n <h2 className=\"text-base font-semibold text-text-primary mb-4\">Recently Completed</h2>\n {completedTasks.length > 0 ? (\n <div className=\"space-y-3\">\n {completedTasks.slice(0, 4).map((task) => {\n const TaskIcon = getTaskIcon(task.type);\n return (\n <div\n key={task.id}\n className=\"flex items-center gap-3 rounded-lg bg-status-success-bg-subtle border border-status-success-text/10 p-3\"\n >\n <div className=\"flex h-8 w-8 items-center justify-center rounded-md bg-status-success-bg-subtle\">\n <TaskIcon className=\"h-4 w-4 text-status-success-text\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium text-text-primary truncate\">\n {task.title ?? task.description}\n </p>\n {task.completedAt && (\n <p className=\"text-xs text-text-secondary\">\n Completed at{' '}\n {new Date(task.completedAt).toLocaleTimeString('en-IN', {\n hour: '2-digit',\n minute: '2-digit',\n hour12: true,\n })}\n </p>\n )}\n </div>\n {task.earnings > 0 && (\n <span className=\"text-sm font-semibold text-text-primary tabular-nums\">\n {formatCurrency(task.earnings, { minimumFractionDigits: 0 })}\n </span>\n )}\n <CheckCircle2 className=\"h-4 w-4 text-status-success-text shrink-0\" />\n </div>\n );\n })}\n </div>\n ) : (\n <p className=\"text-sm text-text-secondary text-center py-8\">\n No completed tasks yet today.\n </p>\n )}\n </GlassCard>\n </div>\n </div>\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AAkDA,IAAMA,IAAyC;CAC7C,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,KAAK;AACP,GAEMC,IAAqC;CACzC,UAAU;CACV,QAAQ;CACR,SAAS;AACX;AAEA,SAASC,EAAY,GAAc;CACjC,QAAQC,GAAR;EACE,KAA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Boxes","Sparkles","ClipboardList","priorityOrder","formatAddress","task","a","WorkerDashboard","useKadaikodi","workerId","currentUser","tasks","isLoadingTasks","useWorkerTasks","stats","isLoadingStats","useWorkerStats","updateTaskStatus","useUpdateWorkerTaskStatus","clockInOut","useWorkerClockInOut","activeTaskId","setActiveTaskId","useState","isClockedIn","setIsClockedIn","clockInTime","setClockInTime","actionError","setActionError","firstName","handleTaskAction","status","action","taskId","handleClockToggle","now","PageLayout","Loader2","currentTask","t","assignedTasks","b","completedTasks","cn","Clock","PagePurpose","StatCard","formatCurrency","Wallet","IndianRupee","Star","CheckCircle2","NextSteps","navigateTo","GlassCard","TaskIcon","Package","MapPin","Pause","ChevronRight","pickup","drop","isBusy","Play","ProgressRing","RatingStars"],"sources":["../../../../src/kadaikodi/pages/worker/WorkerDashboard.tsx"],"sourcesContent":["/**\n * Worker Dashboard Page\n *\n * The signed-in worker's shift command centre, elevated to the delivery-driver\n * concept in kk-worker-01-dashboard: a greeting header with a live Clocked-In /\n * Clock-In pill, a row of KPI StatCards (earnings / deliveries / rating /\n * completion) and delivery-style assigned-task cards with a pickup → drop route\n * and a distance + earnings chip. All data is real (useWorkerStats /\n * useWorkerTasks); clock + task actions are wired to the real mutations.\n *\n * @module kadaikodi/pages/worker\n */\n\nimport { useState } from 'react';\nimport {\n CheckCircle2,\n Star,\n ClipboardList,\n Clock,\n MapPin,\n ChevronRight,\n Package,\n Loader2,\n Pause,\n Play,\n Truck,\n ChefHat,\n Boxes,\n Sparkles,\n IndianRupee,\n Wallet,\n} from 'lucide-react';\nimport { GlassCard, PagePurpose, NextSteps } from '@burdenoff/fe-libs/ui';\nimport { StatCard, ProgressRing, RatingStars } from '../../components/viz';\nimport { PageLayout } from '../../components/PageLayout';\nimport { useKadaikodi } from '../../context/KadaikodiContext';\nimport {\n useWorkerTasks,\n useWorkerStats,\n useUpdateWorkerTaskStatus,\n useWorkerClockInOut,\n} from '../../hooks/useKadaikodiApi';\nimport { cn } from '../../utils/cn';\nimport { formatCurrency } from '../../utils/formatters';\nimport type { WorkerTask } from '../../types';\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\nconst priorityStyles: Record<string, string> = {\n urgent: 'bg-status-error-bg-subtle text-status-error-text',\n high: 'bg-status-error-bg-subtle text-status-error-text',\n medium: 'bg-status-warning-bg-subtle text-status-warning-text',\n low: 'bg-status-success-bg-subtle text-status-success-text',\n};\n\nconst typeStyles: Record<string, string> = {\n delivery: 'bg-accent-primary/12 text-accent-primary',\n pickup: 'bg-status-info-bg-subtle text-status-info-text',\n service: 'bg-status-success-bg-subtle text-status-success-text',\n};\n\nfunction getTaskIcon(type: string) {\n switch (type) {\n case 'delivery':\n return Truck;\n case 'preparation':\n return ChefHat;\n case 'inventory':\n return Boxes;\n case 'cleanup':\n return Sparkles;\n default:\n return ClipboardList;\n }\n}\n\nconst priorityOrder: Record<string, number> = { urgent: 4, high: 3, medium: 2, low: 1 };\n\nfunction formatAddress(task: WorkerTask): string {\n if (!task.deliveryAddress) return task.location ?? '';\n const a = task.deliveryAddress;\n return [a.street, a.area, a.city].filter(Boolean).join(', ');\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport const WorkerDashboard = () => {\n const { navigateTo, currentUser } = useKadaikodi();\n const workerId = currentUser?.id || '';\n\n const { data: tasks = [], isLoading: isLoadingTasks } = useWorkerTasks(workerId);\n const { data: stats, isLoading: isLoadingStats } = useWorkerStats(workerId);\n const updateTaskStatus = useUpdateWorkerTaskStatus();\n const clockInOut = useWorkerClockInOut();\n\n const [activeTaskId, setActiveTaskId] = useState<string | null>(null);\n const [isClockedIn, setIsClockedIn] = useState(false);\n const [clockInTime, setClockInTime] = useState<string | null>(null);\n const [actionError, setActionError] = useState<string | null>(null);\n\n const firstName = currentUser?.firstName ?? currentUser?.name?.split(' ')[0] ?? 'there';\n\n const handleTaskAction = async (taskId: string, action: 'start' | 'complete' | 'pause') => {\n setActionError(null);\n let status = '';\n switch (action) {\n case 'start':\n status = 'IN_PROGRESS';\n setActiveTaskId(taskId);\n break;\n case 'complete':\n status = 'COMPLETED';\n if (activeTaskId === taskId) setActiveTaskId(null);\n break;\n case 'pause':\n status = 'PENDING';\n if (activeTaskId === taskId) setActiveTaskId(null);\n break;\n }\n try {\n await updateTaskStatus.mutateAsync({ taskId, status });\n } catch {\n setActionError('Failed to update task. Please try again.');\n }\n };\n\n const handleClockToggle = async () => {\n setActionError(null);\n const action = isClockedIn ? 'CLOCK_OUT' : 'CLOCK_IN';\n try {\n const result = await clockInOut.mutateAsync({ workerId, action });\n if (result.success) {\n if (isClockedIn) {\n setIsClockedIn(false);\n setClockInTime(null);\n } else {\n const now = new Date().toLocaleTimeString('en-IN', {\n hour: '2-digit',\n minute: '2-digit',\n hour12: true,\n });\n setIsClockedIn(true);\n setClockInTime(now);\n }\n }\n } catch {\n setActionError('Clock action failed. Please try again.');\n }\n };\n\n // Loading state\n if (isLoadingTasks || isLoadingStats) {\n return (\n <PageLayout title={`Hi, ${firstName}`} description=\"Your shift at a glance\">\n <div className=\"flex items-center justify-center py-24\">\n <div className=\"text-center\">\n <Loader2 className=\"h-10 w-10 animate-spin text-text-secondary mx-auto mb-4\" />\n <p className=\"text-sm text-text-secondary\">Loading your dashboard...</p>\n </div>\n </div>\n </PageLayout>\n );\n }\n\n const currentTask = activeTaskId ? tasks.find((t) => t.id === activeTaskId) : null;\n const assignedTasks = tasks\n .filter((t) => t.status !== 'completed')\n .sort((a, b) => (priorityOrder[b.priority] ?? 0) - (priorityOrder[a.priority] ?? 0));\n const completedTasks = tasks.filter((t) => t.status === 'completed');\n\n return (\n <PageLayout\n title={`Hi, ${firstName}`}\n description=\"Your shift at a glance — clock in, then pick up your next delivery.\"\n actions={\n <button\n type=\"button\"\n onClick={handleClockToggle}\n disabled={clockInOut.isPending}\n className={cn(\n 'inline-flex items-center gap-2 rounded-full px-4 py-2 text-sm font-semibold shadow-sm transition-colors disabled:opacity-60',\n isClockedIn\n ? 'bg-status-success-bg-subtle text-status-success-text border border-status-success-text/30'\n : 'bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover'\n )}\n >\n {clockInOut.isPending ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n ) : isClockedIn ? (\n <span className=\"relative flex h-2.5 w-2.5\">\n <span className=\"animate-ping absolute inline-flex h-full w-full rounded-full bg-status-success-text opacity-75\" />\n <span className=\"relative inline-flex rounded-full h-2.5 w-2.5 bg-status-success-text\" />\n </span>\n ) : (\n <Clock className=\"h-4 w-4\" />\n )}\n {isClockedIn ? 'Clocked In' : 'Clock In'}\n </button>\n }\n >\n <div className=\"space-y-6\">\n <PagePurpose>\n Your shift command centre — see today's assigned deliveries at a glance, clock\n in/out, and jump straight into the order you're working on. Clock in first, then\n start your next task below.\n </PagePurpose>\n\n {actionError && (\n <div className=\"rounded-lg border border-status-error-text/20 bg-status-error-bg-subtle p-3\">\n <p className=\"text-xs text-status-error-text\">{actionError}</p>\n </div>\n )}\n\n {/* KPI row — mirrors the mockup's earnings / deliveries / rating / on-time tiles */}\n {stats && (\n <div className=\"grid grid-cols-2 lg:grid-cols-5 gap-3 sm:gap-4\">\n <StatCard\n label=\"Today's Earnings\"\n value={formatCurrency(stats.todayEarnings, { minimumFractionDigits: 0 })}\n icon={<Wallet className=\"h-4 w-4\" />}\n />\n <StatCard\n label=\"Lifetime Earnings\"\n value={formatCurrency(stats.totalEarnings, { minimumFractionDigits: 0 })}\n icon={<IndianRupee className=\"h-4 w-4\" />}\n />\n <StatCard\n label=\"Deliveries\"\n value={stats.totalDeliveries}\n icon={<Truck className=\"h-4 w-4\" />}\n />\n <StatCard\n label=\"Rating\"\n value={\n <span className=\"flex items-center gap-1.5\">\n {stats.averageRating.toFixed(1)}\n <Star className=\"h-5 w-5 fill-status-warning-text text-status-warning-text\" />\n </span>\n }\n icon={<Star className=\"h-4 w-4\" />}\n />\n <StatCard\n label=\"Completion\"\n value={`${stats.completionRate}%`}\n icon={<CheckCircle2 className=\"h-4 w-4\" />}\n />\n </div>\n )}\n\n {isClockedIn && clockInTime && (\n <div className=\"flex items-center gap-2 rounded-lg bg-status-success-bg-subtle border border-status-success-text/20 px-3 py-2 w-fit\">\n <span className=\"relative flex h-2 w-2\">\n <span className=\"animate-ping absolute inline-flex h-full w-full rounded-full bg-status-success-text opacity-75\" />\n <span className=\"relative inline-flex rounded-full h-2 w-2 bg-status-success-text\" />\n </span>\n <span className=\"text-xs font-medium text-status-success-text\">\n Working since {clockInTime}\n </span>\n </div>\n )}\n\n <NextSteps\n storageKey=\"kadaikodi-worker-dashboard\"\n steps={[\n {\n id: 'clock-in',\n label: 'Clock in to start your shift',\n description: 'Track your hours and let dispatch know you are available.',\n onClick: () => {\n if (!isClockedIn) handleClockToggle();\n },\n done: isClockedIn,\n },\n {\n id: 'orders',\n label: 'Review assigned orders',\n description: 'See what needs picking up and delivering today.',\n onClick: () => navigateTo('/worker/orders'),\n },\n {\n id: 'schedule',\n label: 'Check your schedule',\n description: 'Know your upcoming shifts and plan ahead.',\n onClick: () => navigateTo('/worker/schedule'),\n },\n ]}\n />\n\n {/* Current Task */}\n {currentTask && (\n <div>\n <h2 className=\"text-base font-semibold text-text-primary mb-3\">Current Task</h2>\n <GlassCard treatment=\"insight\" glow className=\"p-6\">\n <div className=\"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4\">\n <div className=\"flex items-start gap-3 min-w-0\">\n {(() => {\n const TaskIcon = getTaskIcon(currentTask.type);\n return (\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-accent-primary/12 text-accent-primary\">\n <TaskIcon className=\"h-5 w-5\" />\n </div>\n );\n })()}\n <div className=\"min-w-0\">\n <h3 className=\"text-lg font-semibold text-text-primary\">\n {currentTask.title ?? currentTask.description}\n </h3>\n <p className=\"text-sm text-text-secondary mt-1\">{currentTask.description}</p>\n <div className=\"flex flex-wrap items-center gap-3 mt-2 text-sm text-text-secondary\">\n {currentTask.customerName && (\n <span className=\"flex items-center gap-1\">\n <Package className=\"h-3.5 w-3.5\" />\n {currentTask.customerName}\n </span>\n )}\n {formatAddress(currentTask) && (\n <span className=\"flex items-center gap-1\">\n <MapPin className=\"h-3.5 w-3.5\" />\n {formatAddress(currentTask)}\n </span>\n )}\n </div>\n </div>\n </div>\n <div className=\"flex gap-2 shrink-0\">\n <button\n type=\"button\"\n onClick={() => handleTaskAction(currentTask.id, 'complete')}\n className=\"inline-flex items-center gap-1.5 rounded-md bg-status-success-bg-subtle px-3 py-2 text-sm font-medium text-status-success-text transition-colors\"\n >\n <CheckCircle2 className=\"h-4 w-4\" />\n Complete\n </button>\n <button\n type=\"button\"\n onClick={() => handleTaskAction(currentTask.id, 'pause')}\n className=\"inline-flex items-center gap-1.5 rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors\"\n >\n <Pause className=\"h-4 w-4\" />\n Pause\n </button>\n </div>\n </div>\n </GlassCard>\n </div>\n )}\n\n {/* Assigned Tasks — delivery cards matching the mockup */}\n <div>\n <div className=\"flex items-center justify-between mb-3\">\n <h2 className=\"text-base font-semibold text-text-primary\">Assigned Tasks</h2>\n <button\n type=\"button\"\n onClick={() => navigateTo('/worker/orders')}\n className=\"inline-flex items-center gap-1 text-sm font-medium text-accent-primary hover:underline\"\n >\n View all\n <ChevronRight className=\"h-4 w-4\" />\n </button>\n </div>\n\n {assignedTasks.length > 0 ? (\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {assignedTasks.map((task) => {\n const pickup = task.cartName || 'Pickup';\n const drop = formatAddress(task) || task.customerName || 'Drop-off';\n const isBusy = activeTaskId !== null && activeTaskId !== task.id;\n return (\n <GlassCard key={task.id} treatment=\"metric\" className=\"flex flex-col gap-4 p-5\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold capitalize',\n typeStyles[task.type] ?? 'bg-bg-sunken text-text-secondary'\n )}\n >\n {task.type}\n </span>\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize',\n priorityStyles[task.priority] ?? 'bg-bg-sunken text-text-secondary'\n )}\n >\n {task.priority}\n </span>\n </div>\n {task.orderId && (\n <span className=\"text-sm font-bold text-text-primary tabular-nums\">\n #{task.orderId}\n </span>\n )}\n </div>\n\n {task.customerName && (\n <p className=\"-mt-1 text-sm text-text-secondary\">\n Customer:{' '}\n <span className=\"font-medium text-text-primary\">{task.customerName}</span>\n </p>\n )}\n\n {/* Pickup → Drop route */}\n <div className=\"flex items-stretch gap-3\">\n <div className=\"flex flex-col items-center pt-1\">\n <MapPin className=\"h-4 w-4 text-accent-primary shrink-0\" />\n <span className=\"my-1 w-px flex-1 border-l border-dashed border-border-strong\" />\n <MapPin className=\"h-4 w-4 text-status-success-text shrink-0\" />\n </div>\n <div className=\"flex flex-1 flex-col justify-between gap-3 min-w-0\">\n <p className=\"text-sm text-text-primary line-clamp-1\">{pickup}</p>\n <p className=\"text-sm text-text-primary line-clamp-1\">{drop}</p>\n </div>\n <div className=\"flex flex-col items-end justify-center rounded-lg bg-bg-sunken px-3 py-2 text-right shrink-0\">\n {task.distance != null && (\n <span className=\"text-xs text-text-secondary tabular-nums\">\n {task.distance} km\n </span>\n )}\n {task.earnings > 0 && (\n <span className=\"flex items-center text-base font-bold text-text-primary tabular-nums\">\n <IndianRupee className=\"h-3.5 w-3.5\" />\n {formatCurrency(task.earnings, {\n minimumFractionDigits: 0,\n style: 'decimal',\n })}\n </span>\n )}\n </div>\n </div>\n\n <div className=\"flex gap-2\">\n {task.status === 'pending' && (\n <button\n type=\"button\"\n onClick={() => handleTaskAction(task.id, 'start')}\n disabled={isBusy}\n className={cn(\n 'flex-1 inline-flex items-center justify-center gap-1.5 rounded-lg px-4 py-2.5 text-sm font-semibold transition-colors',\n isBusy\n ? 'bg-bg-sunken text-text-muted cursor-not-allowed'\n : 'bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover'\n )}\n >\n <Play className=\"h-4 w-4\" />\n Start\n </button>\n )}\n {task.status === 'in_progress' && (\n <button\n type=\"button\"\n onClick={() => setActiveTaskId(task.id)}\n className=\"flex-1 inline-flex items-center justify-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2.5 text-sm font-semibold text-action-primary-text hover:bg-action-primary-bg-hover transition-colors\"\n >\n <Play className=\"h-4 w-4\" />\n Resume\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => navigateTo(`/worker/task/${task.id}`)}\n className=\"inline-flex items-center justify-center gap-1 rounded-lg border border-border-default bg-bg-surface px-4 py-2.5 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors\"\n >\n Details\n <ChevronRight className=\"h-4 w-4\" />\n </button>\n </div>\n </GlassCard>\n );\n })}\n </div>\n ) : (\n <GlassCard className=\"p-8 text-center\">\n <CheckCircle2 className=\"h-10 w-10 text-status-success-text opacity-50 mx-auto mb-2\" />\n <p className=\"text-sm text-text-secondary\">All tasks completed. Nice work!</p>\n </GlassCard>\n )}\n </div>\n\n {/* Two-up: performance + recent completions */}\n <div className=\"grid grid-cols-1 lg:grid-cols-3 gap-4\">\n <GlassCard treatment=\"insight\" className=\"p-6 flex flex-col items-center text-center\">\n <h2 className=\"text-base font-semibold text-text-primary mb-4 self-start\">\n Completion Rate\n </h2>\n <ProgressRing\n value={stats?.completionRate ?? 0}\n max={100}\n label={`${stats?.completionRate ?? 0}%`}\n caption=\"on-time\"\n />\n <div className=\"mt-4\">\n <RatingStars value={stats?.averageRating ?? 0} showValue size={18} />\n </div>\n </GlassCard>\n\n <GlassCard className=\"p-6 lg:col-span-2\">\n <h2 className=\"text-base font-semibold text-text-primary mb-4\">Recently Completed</h2>\n {completedTasks.length > 0 ? (\n <div className=\"space-y-3\">\n {completedTasks.slice(0, 4).map((task) => {\n const TaskIcon = getTaskIcon(task.type);\n return (\n <div\n key={task.id}\n className=\"flex items-center gap-3 rounded-lg bg-status-success-bg-subtle border border-status-success-text/10 p-3\"\n >\n <div className=\"flex h-8 w-8 items-center justify-center rounded-md bg-status-success-bg-subtle\">\n <TaskIcon className=\"h-4 w-4 text-status-success-text\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium text-text-primary truncate\">\n {task.title ?? task.description}\n </p>\n {task.completedAt && (\n <p className=\"text-xs text-text-secondary\">\n Completed at{' '}\n {new Date(task.completedAt).toLocaleTimeString('en-IN', {\n hour: '2-digit',\n minute: '2-digit',\n hour12: true,\n })}\n </p>\n )}\n </div>\n {task.earnings > 0 && (\n <span className=\"text-sm font-semibold text-text-primary tabular-nums\">\n {formatCurrency(task.earnings, { minimumFractionDigits: 0 })}\n </span>\n )}\n <CheckCircle2 className=\"h-4 w-4 text-status-success-text shrink-0\" />\n </div>\n );\n })}\n </div>\n ) : (\n <p className=\"text-sm text-text-secondary text-center py-8\">\n No completed tasks yet today.\n </p>\n )}\n </GlassCard>\n </div>\n </div>\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AAkDA,IAAMA,IAAyC;CAC7C,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,KAAK;AACP,GAEMC,IAAqC;CACzC,UAAU;CACV,QAAQ;CACR,SAAS;AACX;AAEA,SAASC,EAAY,GAAc;CACjC,QAAQC,GAAR;EACE,KAAK,YACH,OAAOC;EACT,KAAK,eACH,OAAOC;EACT,KAAK,aACH,OAAOC;EACT,KAAK,WACH,OAAOC;EACT,SACE,OAAOC;CACX;AACF;AAEA,IAAMC,IAAwC;CAAE,QAAQ;CAAG,MAAM;CAAG,QAAQ;CAAG,KAAK;AAAE;AAEtF,SAASC,EAAc,GAA0B;CAC/C,IAAI,CAACC,EAAK,iBAAiB,OAAOA,EAAK,YAAY;CACnD,IAAMC,IAAID,EAAK;CACf,OAAO;EAACC,EAAE;EAAQA,EAAE;EAAMA,EAAE;CAAI,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,IAAI;AAC7D;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AK,WAAU;OACZ,UAAAA,EAAe,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,MAAS;QACxC,IAAMa,IAAW5D,EAAYS,EAAK,IAAI;QACtC,OACE,kBAAC,OAAD;SAEE,WAAU;SAFZ,UAAA;UAIE,kBAAC,OAAD;WAAK,WAAU;WACb,UAAA,kBAACmD,GAAD,EAAU,WAAU,mCAAoC,CAAA;UACrD,CAAA;UACL,kBAAC,OAAD;WAAK,WAAU;WAAf,UAAA,CACE,kBAAC,KAAD;YAAG,WAAU;YACV,UAAAnD,EAAK,SAASA,EAAK;WACnB,CAAA,GACFA,EAAK,eACJ,kBAAC,KAAD;YAAG,WAAU;YAAb,UAAA;aAA2C;aAC5B;aACZ,IAAI,KAAKA,EAAK,WAAW,CAAC,CAAC,mBAAmB,SAAS;cACtD,MAAM;cACN,QAAQ;cACR,QAAQ;aACV,CAAC;YACA;WAEF,CAAA,CAAA;;UACJA,EAAK,WAAW,KACf,kBAAC,QAAD;WAAM,WAAU;WACb,UAAA2C,EAAe3C,EAAK,UAAU,EAAE,uBAAuB,EAAE,CAAC;UACvD,CAAA;UAER,kBAAC+C,GAAD,EAAc,WAAU,4CAA6C,CAAA;SAClE;QA3BE,GAAA/C,EAAK,EA2BP;OAET,CAAC;MACE,CAAA,IAEL,kBAAC,KAAD;OAAG,WAAU;OAA+C,UAAA;MAEzD,CAAA,CAEI;KACR,CAAA,CAAA;;GACF;;CACK,CAAA;AAEhB"}
|
|
@@ -108,7 +108,7 @@ var t = class extends Error {
|
|
|
108
108
|
let n = this.listeners[e];
|
|
109
109
|
if (!n) return;
|
|
110
110
|
let r = n.indexOf(t);
|
|
111
|
-
this.listeners[e].splice(r, 1), this.listeners[e].length || this.removeWindowListener(this.windowListeners[e]);
|
|
111
|
+
r !== -1 && this.listeners[e].splice(r, 1), this.listeners[e].length || this.removeWindowListener(this.windowListeners[e]);
|
|
112
112
|
}
|
|
113
113
|
addWindowListener(e) {
|
|
114
114
|
window.addEventListener(e.windowEventName, e.handler), e.registered = !0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ExceptionCode","\"Unimplemented\"","\"Unavailable\"","CapacitorException","message","code","data","getPlatformId","win","createCapacitor","capCustomPlatform","cap","Plugins","getPlatform","isNativePlatform","isPluginAvailable","registeredPlugins","pluginName","getPluginHeader","h","handleError","err","filePath","registeredPlugin","platform","pluginHeader","jsImplementation","loadPluginImplementation","jsImplementations","\"web\"","createPluginMethod","methodHeader","prop","m","options","callback","impl","createPluginMethodWrapper","remove","wrapper","args","p","fn","addListener","removeListener","addListenerNative","call","callbackId","resolve","proxy","Capacitor","registerPlugin","WebPlugin","firstListener","eventName","listenerFunc","windowListener","listener","listeners","retainUntilConsumed","pluginEventName","event","msg","index","handle","arg","encode","str","decode","CapacitorCookiesPluginWeb","cookies","cookieMap","cookie","key","value","encodedKey","encodedValue","expires","path","domain","error","readBlobAsBase64","reader","base64String","reject","blob","normalizeHttpHeaders","originalKeys","headers","k","acc","buildUrlParams","params","entry","item","shouldEncode","accumulator","buildRequestInit","output","extra","type","form","CapacitorHttpPluginWeb","requestInit","urlParams","url","response","contentType","responseType","SystemBarsStyle","\"Dark\"","\"Light\"","\"Default\"","SystemBarType","\"StatusBar\"","\"NavigationBar\"","SystemBarsPluginWeb"],"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"],"ignoreList":[0],"mappings":";AACA,IAAIA;CACH,SAAU,GAAe;CAetB,AARA,EAAcC,gBAAmB,iBAQjC,EAAcC,cAAiB;AACnC,EAAA,CAAG,AAAkBF,MAAgB,CAAC,CAAE;AACxC,IAAMG,IAAN,cAAiC,MAAM;CACnC,YAAY,GAAS,GAAM,GAAM;EAI7B,AAHA,MAAMC,CAAO,GACb,KAAK,UAAUA,GACf,KAAK,OAAOC,GACZ,KAAK,OAAOC;CAChB;AACJ,GACMC,KAAiB,MAEfC,GAA8C,gBACvC,YAEUA,GAA8C,QAAgD,iBAAyD,SACjK,QAGA,OAITC,KAAmB,MAAQ;CAC7B,IAAMC,IAAoBF,EAAI,2BAA2B,MACnDG,IAAMH,EAAI,aAAa,CAAC,GACxBI,IAAW,EAAI,UAAUD,EAAI,WAAW,CAAC,GACzCE,UACKH,MAAsB,OAAgCH,EAAcC,CAAG,IAA1CE,EAAkB,MAEpDI,UAAyBD,EAAY,MAAM,OAC3CE,KAAqB,MAMvB,GALeC,EAAkB,IAAIC,CACjC,CAAA,EAAuD,UAAU,IAAIJ,EAAY,CAAC,KAIlFK,EAAgBD,CAAU,IAM5BC,KAAmB,MAAsCP,EAAI,eAAuD,MAAM,MAAMQ,EAAE,SAASF,CAAU,GACrJG,KAAe,MAAQZ,EAAI,QAAQ,MAAMa,CAAG,GAC5CL,oBAAoB,IAAI,IAAI;CAmIlC,OAXA,AACIL,EAAI,oBAAkB,MAAaW,GAEvC,EAAI,cAAcT,GAClB,EAAI,cAAcO,GAClB,EAAI,mBAAmBN,GACvB,EAAI,oBAAoBC,GACxB,EAAI,kBA9HoB,GA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ACtF;CAKA,MAAM,OAAO,GAAS;EAClB,OAAO,KAAK,QAAQ,OAAO,OAAO,OAAO,OAAO,CAAC,GAAGA,CAAO,GAAG,EAAE,QAAQ,SAAS,CAAC,CAAC;CACvF;AACJ;AACsBiB,EAAe,iBAAiB,EAClD,WAAW,IAAImD,EAAuB,EAC1C,CAAC;AAMD,IAAIO;CACH,SAAU,GAAiB;CAoBxB,AAdA,EAAgBC,OAAU,QAM1B,EAAgBC,QAAW,SAQ3B,EAAgBC,UAAa;AACjC,EAAA,CAAG,AAAoBH,MAAkB,CAAC,CAAE;AAI5C,IAAII;CACH,SAAU,GAAe;CAYtB,AANA,EAAcC,YAAe,aAM7B,EAAcC,gBAAmB;AACrC,EAAA,CAAG,AAAkBF,MAAgB,CAAC,CAAE;AACxC,IAAMG,IAAN,cAAkChE,EAAU;CACxC,MAAM,WAAW;EACb,KAAK,YAAY,uBAAuB;CAC5C;CACA,MAAM,eAAe;EACjB,KAAK,YAAY,uBAAuB;CAC5C;CACA,MAAM,OAAO;EACT,KAAK,YAAY,uBAAuB;CAC5C;CACA,MAAM,OAAO;EACT,KAAK,YAAY,uBAAuB;CAC5C;AACJ;AACmBD,EAAe,cAAc,EAC5C,WAAW,IAAIiE,EAAoB,EACvC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ExceptionCode","\"Unimplemented\"","\"Unavailable\"","CapacitorException","message","code","data","getPlatformId","win","createCapacitor","capCustomPlatform","cap","Plugins","getPlatform","isNativePlatform","isPluginAvailable","registeredPlugins","pluginName","getPluginHeader","h","handleError","err","filePath","registeredPlugin","platform","pluginHeader","jsImplementation","loadPluginImplementation","jsImplementations","\"web\"","createPluginMethod","methodHeader","prop","m","options","callback","impl","createPluginMethodWrapper","remove","wrapper","args","p","fn","addListener","removeListener","addListenerNative","call","callbackId","resolve","proxy","Capacitor","registerPlugin","WebPlugin","firstListener","eventName","listenerFunc","windowListener","listener","listeners","retainUntilConsumed","pluginEventName","event","msg","index","handle","arg","encode","str","decode","CapacitorCookiesPluginWeb","cookies","cookieMap","cookie","key","value","encodedKey","encodedValue","expires","path","domain","error","readBlobAsBase64","reader","base64String","reject","blob","normalizeHttpHeaders","originalKeys","headers","k","acc","buildUrlParams","params","entry","item","shouldEncode","accumulator","buildRequestInit","output","extra","type","form","CapacitorHttpPluginWeb","requestInit","urlParams","url","response","contentType","responseType","SystemBarsStyle","\"Dark\"","\"Light\"","\"Default\"","SystemBarType","\"StatusBar\"","\"NavigationBar\"","SystemBarsPluginWeb"],"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 if (index !== -1) {\n this.listeners[eventName].splice(index, 1);\n }\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"],"ignoreList":[0],"mappings":";AACA,IAAIA;CACH,SAAU,GAAe;CAetB,AARA,EAAcC,gBAAmB,iBAQjC,EAAcC,cAAiB;AACnC,EAAA,CAAG,AAAkBF,MAAgB,CAAC,CAAE;AACxC,IAAMG,IAAN,cAAiC,MAAM;CACnC,YAAY,GAAS,GAAM,GAAM;EAI7B,AAHA,MAAMC,CAAO,GACb,KAAK,UA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kBF,MAAgB,CAAC,CAAE;AACxC,IAAMG,IAAN,cAAkChE,EAAU;CACxC,MAAM,WAAW;EACb,KAAK,YAAY,uBAAuB;CAC5C;CACA,MAAM,eAAe;EACjB,KAAK,YAAY,uBAAuB;CAC5C;CACA,MAAM,OAAO;EACT,KAAK,YAAY,uBAAuB;CAC5C;CACA,MAAM,OAAO;EACT,KAAK,YAAY,uBAAuB;CAC5C;AACJ;AACmBD,EAAe,cAAc,EAC5C,WAAW,IAAIiE,EAAoB,EACvC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-kadaikodi",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.1113.1",
|
|
4
4
|
"description": "Burdenoff Kadaikodi Microfrontend - Mobile services marketplace platform for connecting service providers with customers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@apollo/client": "^4.3.7",
|
|
56
56
|
"@burdenoff/fe-libs": "2026.1028.16",
|
|
57
|
-
"@capacitor/core": "8.
|
|
58
|
-
"@capacitor/local-notifications": "8.
|
|
57
|
+
"@capacitor/core": "8.6.0",
|
|
58
|
+
"@capacitor/local-notifications": "8.3.1",
|
|
59
59
|
"@tanstack/react-query": "^5.106.1",
|
|
60
60
|
"clsx": "^2.1.1",
|
|
61
61
|
"graphql": "^16.15.0",
|