popsite-ui 1.0.0
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/App.jsx +95 -0
- package/README.md +92 -0
- package/components/layout/PortalHeader.jsx +18 -0
- package/components/layout/SystemSidebar.jsx +33 -0
- package/components/modules/AnalyticsDashboardModule.jsx +17 -0
- package/components/modules/ChatMessagingModule.jsx +17 -0
- package/components/modules/EcommerceStoreModule.jsx +17 -0
- package/components/modules/EventTicketBookingModule.jsx +17 -0
- package/components/modules/FlightBookingModule.jsx +17 -0
- package/components/modules/FoodOrderingModule.jsx +17 -0
- package/components/modules/HospitalAppointmentModule.jsx +17 -0
- package/components/modules/HotelBookingModule.jsx +17 -0
- package/components/modules/InvoiceBillingModule.jsx +17 -0
- package/components/modules/LibraryManagementModule.jsx +17 -0
- package/components/modules/ModuleContentDeck.jsx +44 -0
- package/components/modules/MovieBookingModule.jsx +17 -0
- package/components/modules/QuizExamModule.jsx +17 -0
- package/components/modules/StudentRegistrationModule.jsx +17 -0
- package/components/modules/SystemModuleRenderer.jsx +19 -0
- package/components/modules/SystemModuleTemplate.jsx +62 -0
- package/components/modules/SystemVisualWidget.jsx +123 -0
- package/components/modules/moduleContentMap.js +238 -0
- package/components/modules/moduleEnhancementsMap.js +439 -0
- package/components/modules/systemModuleMap.js +31 -0
- package/components/system/DynamicSystemForm.jsx +154 -0
- package/components/system/SystemHero.jsx +21 -0
- package/components/system/SystemSummaryCard.jsx +53 -0
- package/data/systems/analyticsDashboard.js +48 -0
- package/data/systems/chatMessaging.js +43 -0
- package/data/systems/ecommerceStore.js +50 -0
- package/data/systems/eventTicketBooking.js +50 -0
- package/data/systems/flightBooking.js +38 -0
- package/data/systems/foodOrdering.js +48 -0
- package/data/systems/hospitalAppointment.js +50 -0
- package/data/systems/hotelBooking.js +38 -0
- package/data/systems/index.js +31 -0
- package/data/systems/invoiceBilling.js +50 -0
- package/data/systems/libraryManagement.js +43 -0
- package/data/systems/movieBooking.js +48 -0
- package/data/systems/quizExam.js +38 -0
- package/data/systems/studentRegistration.js +43 -0
- package/dist/popsite-ui.es.js +4368 -0
- package/dist/popsite-ui.umd.js +60 -0
- package/dist/style.css +1 -0
- package/index.html +13 -0
- package/library/index.js +20 -0
- package/main.jsx +15 -0
- package/package.json +40 -0
- package/src/App.jsx +12 -0
- package/src/components/modules/AnalyticsDashboardModule.jsx +224 -0
- package/src/components/modules/ChatMessagingModule.jsx +294 -0
- package/src/components/modules/EcommerceStoreModule.jsx +405 -0
- package/src/components/modules/EventTicketBookingModule.jsx +253 -0
- package/src/components/modules/FlightBookingModule.jsx +399 -0
- package/src/components/modules/FoodOrderingModule.jsx +316 -0
- package/src/components/modules/HospitalAppointmentModule.jsx +267 -0
- package/src/components/modules/HotelBookingModule.jsx +317 -0
- package/src/components/modules/InvoiceBillingModule.jsx +302 -0
- package/src/components/modules/LandingPageModule.jsx +185 -0
- package/src/components/modules/LibraryManagementModule.jsx +189 -0
- package/src/components/modules/MovieBookingModule.jsx +337 -0
- package/src/components/modules/QuizExamModule.jsx +255 -0
- package/src/components/modules/StudentRegistrationModule.jsx +292 -0
- package/src/components/system/SystemHero.jsx +44 -0
- package/src/components/system/SystemSummaryCard.jsx +29 -0
- package/src/components/system/Toast.jsx +69 -0
- package/src/data/systems/analyticsDashboard.js +32 -0
- package/src/data/systems/chatMessaging.js +59 -0
- package/src/data/systems/ecommerceStore.js +84 -0
- package/src/data/systems/eventBooking.js +33 -0
- package/src/data/systems/flightBooking.js +59 -0
- package/src/data/systems/foodOrdering.js +48 -0
- package/src/data/systems/hospitalAppointment.js +48 -0
- package/src/data/systems/hotelBooking.js +59 -0
- package/src/data/systems/invoiceBilling.js +19 -0
- package/src/data/systems/landingPage.js +29 -0
- package/src/data/systems/libraryManagement.js +17 -0
- package/src/data/systems/movieBooking.js +49 -0
- package/src/data/systems/quizExam.js +31 -0
- package/src/data/systems/studentRegistration.js +9 -0
- package/src/index.js +22 -0
- package/src/main.jsx +10 -0
- package/src/styles.css +296 -0
- package/styles.css +820 -0
- package/utils/systemEngine.js +128 -0
- package/vite.config.js +8 -0
- package/vite.lib.config.js +27 -0
|
@@ -0,0 +1,4368 @@
|
|
|
1
|
+
import et, { useState as p, useEffect as $, useRef as Bt } from "react";
|
|
2
|
+
var De = { exports: {} }, ne = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-jsx-runtime.production.min.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var Qe;
|
|
13
|
+
function Rt() {
|
|
14
|
+
if (Qe) return ne;
|
|
15
|
+
Qe = 1;
|
|
16
|
+
var m = et, o = Symbol.for("react.element"), n = Symbol.for("react.fragment"), j = Object.prototype.hasOwnProperty, u = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, N = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
|
+
function h(A, l, T) {
|
|
18
|
+
var x, k = {}, g = null, W = null;
|
|
19
|
+
T !== void 0 && (g = "" + T), l.key !== void 0 && (g = "" + l.key), l.ref !== void 0 && (W = l.ref);
|
|
20
|
+
for (x in l) j.call(l, x) && !N.hasOwnProperty(x) && (k[x] = l[x]);
|
|
21
|
+
if (A && A.defaultProps) for (x in l = A.defaultProps, l) k[x] === void 0 && (k[x] = l[x]);
|
|
22
|
+
return { $$typeof: o, type: A, key: g, ref: W, props: k, _owner: u.current };
|
|
23
|
+
}
|
|
24
|
+
return ne.Fragment = n, ne.jsx = h, ne.jsxs = h, ne;
|
|
25
|
+
}
|
|
26
|
+
var le = {};
|
|
27
|
+
/**
|
|
28
|
+
* @license React
|
|
29
|
+
* react-jsx-runtime.development.js
|
|
30
|
+
*
|
|
31
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the MIT license found in the
|
|
34
|
+
* LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/
|
|
36
|
+
var Xe;
|
|
37
|
+
function Dt() {
|
|
38
|
+
return Xe || (Xe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
+
var m = et, o = Symbol.for("react.element"), n = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), N = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), A = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), k = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), W = Symbol.for("react.offscreen"), y = Symbol.iterator, C = "@@iterator";
|
|
40
|
+
function B(s) {
|
|
41
|
+
if (s === null || typeof s != "object")
|
|
42
|
+
return null;
|
|
43
|
+
var c = y && s[y] || s[C];
|
|
44
|
+
return typeof c == "function" ? c : null;
|
|
45
|
+
}
|
|
46
|
+
var D = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
|
+
function P(s) {
|
|
48
|
+
{
|
|
49
|
+
for (var c = arguments.length, v = new Array(c > 1 ? c - 1 : 0), E = 1; E < c; E++)
|
|
50
|
+
v[E - 1] = arguments[E];
|
|
51
|
+
S("error", s, v);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function S(s, c, v) {
|
|
55
|
+
{
|
|
56
|
+
var E = D.ReactDebugCurrentFrame, z = E.getStackAddendum();
|
|
57
|
+
z !== "" && (c += "%s", v = v.concat([z]));
|
|
58
|
+
var L = v.map(function(_) {
|
|
59
|
+
return String(_);
|
|
60
|
+
});
|
|
61
|
+
L.unshift("Warning: " + c), Function.prototype.apply.call(console[s], console, L);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
var d = !1, b = !1, M = !1, I = !1, r = !1, t;
|
|
65
|
+
t = Symbol.for("react.module.reference");
|
|
66
|
+
function a(s) {
|
|
67
|
+
return !!(typeof s == "string" || typeof s == "function" || s === j || s === N || r || s === u || s === T || s === x || I || s === W || d || b || M || typeof s == "object" && s !== null && (s.$$typeof === g || s.$$typeof === k || s.$$typeof === h || s.$$typeof === A || s.$$typeof === l || // This needs to include all possible module reference object
|
|
68
|
+
// types supported by any Flight configuration anywhere since
|
|
69
|
+
// we don't know which Flight build this will end up being used
|
|
70
|
+
// with.
|
|
71
|
+
s.$$typeof === t || s.getModuleId !== void 0));
|
|
72
|
+
}
|
|
73
|
+
function i(s, c, v) {
|
|
74
|
+
var E = s.displayName;
|
|
75
|
+
if (E)
|
|
76
|
+
return E;
|
|
77
|
+
var z = c.displayName || c.name || "";
|
|
78
|
+
return z !== "" ? v + "(" + z + ")" : v;
|
|
79
|
+
}
|
|
80
|
+
function f(s) {
|
|
81
|
+
return s.displayName || "Context";
|
|
82
|
+
}
|
|
83
|
+
function F(s) {
|
|
84
|
+
if (s == null)
|
|
85
|
+
return null;
|
|
86
|
+
if (typeof s.tag == "number" && P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof s == "function")
|
|
87
|
+
return s.displayName || s.name || null;
|
|
88
|
+
if (typeof s == "string")
|
|
89
|
+
return s;
|
|
90
|
+
switch (s) {
|
|
91
|
+
case j:
|
|
92
|
+
return "Fragment";
|
|
93
|
+
case n:
|
|
94
|
+
return "Portal";
|
|
95
|
+
case N:
|
|
96
|
+
return "Profiler";
|
|
97
|
+
case u:
|
|
98
|
+
return "StrictMode";
|
|
99
|
+
case T:
|
|
100
|
+
return "Suspense";
|
|
101
|
+
case x:
|
|
102
|
+
return "SuspenseList";
|
|
103
|
+
}
|
|
104
|
+
if (typeof s == "object")
|
|
105
|
+
switch (s.$$typeof) {
|
|
106
|
+
case A:
|
|
107
|
+
var c = s;
|
|
108
|
+
return f(c) + ".Consumer";
|
|
109
|
+
case h:
|
|
110
|
+
var v = s;
|
|
111
|
+
return f(v._context) + ".Provider";
|
|
112
|
+
case l:
|
|
113
|
+
return i(s, s.render, "ForwardRef");
|
|
114
|
+
case k:
|
|
115
|
+
var E = s.displayName || null;
|
|
116
|
+
return E !== null ? E : F(s.type) || "Memo";
|
|
117
|
+
case g: {
|
|
118
|
+
var z = s, L = z._payload, _ = z._init;
|
|
119
|
+
try {
|
|
120
|
+
return F(_(L));
|
|
121
|
+
} catch {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
var w = Object.assign, R = 0, q, oe, de, ce, Ie, Ae, Pe;
|
|
129
|
+
function Ee() {
|
|
130
|
+
}
|
|
131
|
+
Ee.__reactDisabledLog = !0;
|
|
132
|
+
function tt() {
|
|
133
|
+
{
|
|
134
|
+
if (R === 0) {
|
|
135
|
+
q = console.log, oe = console.info, de = console.warn, ce = console.error, Ie = console.group, Ae = console.groupCollapsed, Pe = console.groupEnd;
|
|
136
|
+
var s = {
|
|
137
|
+
configurable: !0,
|
|
138
|
+
enumerable: !0,
|
|
139
|
+
value: Ee,
|
|
140
|
+
writable: !0
|
|
141
|
+
};
|
|
142
|
+
Object.defineProperties(console, {
|
|
143
|
+
info: s,
|
|
144
|
+
log: s,
|
|
145
|
+
warn: s,
|
|
146
|
+
error: s,
|
|
147
|
+
group: s,
|
|
148
|
+
groupCollapsed: s,
|
|
149
|
+
groupEnd: s
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
R++;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function st() {
|
|
156
|
+
{
|
|
157
|
+
if (R--, R === 0) {
|
|
158
|
+
var s = {
|
|
159
|
+
configurable: !0,
|
|
160
|
+
enumerable: !0,
|
|
161
|
+
writable: !0
|
|
162
|
+
};
|
|
163
|
+
Object.defineProperties(console, {
|
|
164
|
+
log: w({}, s, {
|
|
165
|
+
value: q
|
|
166
|
+
}),
|
|
167
|
+
info: w({}, s, {
|
|
168
|
+
value: oe
|
|
169
|
+
}),
|
|
170
|
+
warn: w({}, s, {
|
|
171
|
+
value: de
|
|
172
|
+
}),
|
|
173
|
+
error: w({}, s, {
|
|
174
|
+
value: ce
|
|
175
|
+
}),
|
|
176
|
+
group: w({}, s, {
|
|
177
|
+
value: Ie
|
|
178
|
+
}),
|
|
179
|
+
groupCollapsed: w({}, s, {
|
|
180
|
+
value: Ae
|
|
181
|
+
}),
|
|
182
|
+
groupEnd: w({}, s, {
|
|
183
|
+
value: Pe
|
|
184
|
+
})
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
R < 0 && P("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
var fe = D.ReactCurrentDispatcher, ve;
|
|
191
|
+
function pe(s, c, v) {
|
|
192
|
+
{
|
|
193
|
+
if (ve === void 0)
|
|
194
|
+
try {
|
|
195
|
+
throw Error();
|
|
196
|
+
} catch (z) {
|
|
197
|
+
var E = z.stack.trim().match(/\n( *(at )?)/);
|
|
198
|
+
ve = E && E[1] || "";
|
|
199
|
+
}
|
|
200
|
+
return `
|
|
201
|
+
` + ve + s;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
var be = !1, me;
|
|
205
|
+
{
|
|
206
|
+
var at = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
me = new at();
|
|
208
|
+
}
|
|
209
|
+
function Fe(s, c) {
|
|
210
|
+
if (!s || be)
|
|
211
|
+
return "";
|
|
212
|
+
{
|
|
213
|
+
var v = me.get(s);
|
|
214
|
+
if (v !== void 0)
|
|
215
|
+
return v;
|
|
216
|
+
}
|
|
217
|
+
var E;
|
|
218
|
+
be = !0;
|
|
219
|
+
var z = Error.prepareStackTrace;
|
|
220
|
+
Error.prepareStackTrace = void 0;
|
|
221
|
+
var L;
|
|
222
|
+
L = fe.current, fe.current = null, tt();
|
|
223
|
+
try {
|
|
224
|
+
if (c) {
|
|
225
|
+
var _ = function() {
|
|
226
|
+
throw Error();
|
|
227
|
+
};
|
|
228
|
+
if (Object.defineProperty(_.prototype, "props", {
|
|
229
|
+
set: function() {
|
|
230
|
+
throw Error();
|
|
231
|
+
}
|
|
232
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
233
|
+
try {
|
|
234
|
+
Reflect.construct(_, []);
|
|
235
|
+
} catch (U) {
|
|
236
|
+
E = U;
|
|
237
|
+
}
|
|
238
|
+
Reflect.construct(s, [], _);
|
|
239
|
+
} else {
|
|
240
|
+
try {
|
|
241
|
+
_.call();
|
|
242
|
+
} catch (U) {
|
|
243
|
+
E = U;
|
|
244
|
+
}
|
|
245
|
+
s.call(_.prototype);
|
|
246
|
+
}
|
|
247
|
+
} else {
|
|
248
|
+
try {
|
|
249
|
+
throw Error();
|
|
250
|
+
} catch (U) {
|
|
251
|
+
E = U;
|
|
252
|
+
}
|
|
253
|
+
s();
|
|
254
|
+
}
|
|
255
|
+
} catch (U) {
|
|
256
|
+
if (U && E && typeof U.stack == "string") {
|
|
257
|
+
for (var O = U.stack.split(`
|
|
258
|
+
`), Y = E.stack.split(`
|
|
259
|
+
`), V = O.length - 1, H = Y.length - 1; V >= 1 && H >= 0 && O[V] !== Y[H]; )
|
|
260
|
+
H--;
|
|
261
|
+
for (; V >= 1 && H >= 0; V--, H--)
|
|
262
|
+
if (O[V] !== Y[H]) {
|
|
263
|
+
if (V !== 1 || H !== 1)
|
|
264
|
+
do
|
|
265
|
+
if (V--, H--, H < 0 || O[V] !== Y[H]) {
|
|
266
|
+
var J = `
|
|
267
|
+
` + O[V].replace(" at new ", " at ");
|
|
268
|
+
return s.displayName && J.includes("<anonymous>") && (J = J.replace("<anonymous>", s.displayName)), typeof s == "function" && me.set(s, J), J;
|
|
269
|
+
}
|
|
270
|
+
while (V >= 1 && H >= 0);
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
} finally {
|
|
275
|
+
be = !1, fe.current = L, st(), Error.prepareStackTrace = z;
|
|
276
|
+
}
|
|
277
|
+
var ie = s ? s.displayName || s.name : "", ee = ie ? pe(ie) : "";
|
|
278
|
+
return typeof s == "function" && me.set(s, ee), ee;
|
|
279
|
+
}
|
|
280
|
+
function it(s, c, v) {
|
|
281
|
+
return Fe(s, !1);
|
|
282
|
+
}
|
|
283
|
+
function rt(s) {
|
|
284
|
+
var c = s.prototype;
|
|
285
|
+
return !!(c && c.isReactComponent);
|
|
286
|
+
}
|
|
287
|
+
function he(s, c, v) {
|
|
288
|
+
if (s == null)
|
|
289
|
+
return "";
|
|
290
|
+
if (typeof s == "function")
|
|
291
|
+
return Fe(s, rt(s));
|
|
292
|
+
if (typeof s == "string")
|
|
293
|
+
return pe(s);
|
|
294
|
+
switch (s) {
|
|
295
|
+
case T:
|
|
296
|
+
return pe("Suspense");
|
|
297
|
+
case x:
|
|
298
|
+
return pe("SuspenseList");
|
|
299
|
+
}
|
|
300
|
+
if (typeof s == "object")
|
|
301
|
+
switch (s.$$typeof) {
|
|
302
|
+
case l:
|
|
303
|
+
return it(s.render);
|
|
304
|
+
case k:
|
|
305
|
+
return he(s.type, c, v);
|
|
306
|
+
case g: {
|
|
307
|
+
var E = s, z = E._payload, L = E._init;
|
|
308
|
+
try {
|
|
309
|
+
return he(L(z), c, v);
|
|
310
|
+
} catch {
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return "";
|
|
315
|
+
}
|
|
316
|
+
var re = Object.prototype.hasOwnProperty, We = {}, Me = D.ReactDebugCurrentFrame;
|
|
317
|
+
function xe(s) {
|
|
318
|
+
if (s) {
|
|
319
|
+
var c = s._owner, v = he(s.type, s._source, c ? c.type : null);
|
|
320
|
+
Me.setExtraStackFrame(v);
|
|
321
|
+
} else
|
|
322
|
+
Me.setExtraStackFrame(null);
|
|
323
|
+
}
|
|
324
|
+
function nt(s, c, v, E, z) {
|
|
325
|
+
{
|
|
326
|
+
var L = Function.call.bind(re);
|
|
327
|
+
for (var _ in s)
|
|
328
|
+
if (L(s, _)) {
|
|
329
|
+
var O = void 0;
|
|
330
|
+
try {
|
|
331
|
+
if (typeof s[_] != "function") {
|
|
332
|
+
var Y = Error((E || "React class") + ": " + v + " type `" + _ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof s[_] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
|
+
throw Y.name = "Invariant Violation", Y;
|
|
334
|
+
}
|
|
335
|
+
O = s[_](c, _, E, v, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
|
+
} catch (V) {
|
|
337
|
+
O = V;
|
|
338
|
+
}
|
|
339
|
+
O && !(O instanceof Error) && (xe(z), P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", E || "React class", v, _, typeof O), xe(null)), O instanceof Error && !(O.message in We) && (We[O.message] = !0, xe(z), P("Failed %s type: %s", v, O.message), xe(null));
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
var lt = Array.isArray;
|
|
344
|
+
function je(s) {
|
|
345
|
+
return lt(s);
|
|
346
|
+
}
|
|
347
|
+
function ot(s) {
|
|
348
|
+
{
|
|
349
|
+
var c = typeof Symbol == "function" && Symbol.toStringTag, v = c && s[Symbol.toStringTag] || s.constructor.name || "Object";
|
|
350
|
+
return v;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
function dt(s) {
|
|
354
|
+
try {
|
|
355
|
+
return Oe(s), !1;
|
|
356
|
+
} catch {
|
|
357
|
+
return !0;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function Oe(s) {
|
|
361
|
+
return "" + s;
|
|
362
|
+
}
|
|
363
|
+
function _e(s) {
|
|
364
|
+
if (dt(s))
|
|
365
|
+
return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ot(s)), Oe(s);
|
|
366
|
+
}
|
|
367
|
+
var ze = D.ReactCurrentOwner, ct = {
|
|
368
|
+
key: !0,
|
|
369
|
+
ref: !0,
|
|
370
|
+
__self: !0,
|
|
371
|
+
__source: !0
|
|
372
|
+
}, Le, $e;
|
|
373
|
+
function pt(s) {
|
|
374
|
+
if (re.call(s, "ref")) {
|
|
375
|
+
var c = Object.getOwnPropertyDescriptor(s, "ref").get;
|
|
376
|
+
if (c && c.isReactWarning)
|
|
377
|
+
return !1;
|
|
378
|
+
}
|
|
379
|
+
return s.ref !== void 0;
|
|
380
|
+
}
|
|
381
|
+
function mt(s) {
|
|
382
|
+
if (re.call(s, "key")) {
|
|
383
|
+
var c = Object.getOwnPropertyDescriptor(s, "key").get;
|
|
384
|
+
if (c && c.isReactWarning)
|
|
385
|
+
return !1;
|
|
386
|
+
}
|
|
387
|
+
return s.key !== void 0;
|
|
388
|
+
}
|
|
389
|
+
function ht(s, c) {
|
|
390
|
+
typeof s.ref == "string" && ze.current;
|
|
391
|
+
}
|
|
392
|
+
function xt(s, c) {
|
|
393
|
+
{
|
|
394
|
+
var v = function() {
|
|
395
|
+
Le || (Le = !0, P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", c));
|
|
396
|
+
};
|
|
397
|
+
v.isReactWarning = !0, Object.defineProperty(s, "key", {
|
|
398
|
+
get: v,
|
|
399
|
+
configurable: !0
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
function ut(s, c) {
|
|
404
|
+
{
|
|
405
|
+
var v = function() {
|
|
406
|
+
$e || ($e = !0, P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", c));
|
|
407
|
+
};
|
|
408
|
+
v.isReactWarning = !0, Object.defineProperty(s, "ref", {
|
|
409
|
+
get: v,
|
|
410
|
+
configurable: !0
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
var gt = function(s, c, v, E, z, L, _) {
|
|
415
|
+
var O = {
|
|
416
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
417
|
+
$$typeof: o,
|
|
418
|
+
// Built-in properties that belong on the element
|
|
419
|
+
type: s,
|
|
420
|
+
key: c,
|
|
421
|
+
ref: v,
|
|
422
|
+
props: _,
|
|
423
|
+
// Record the component responsible for creating this element.
|
|
424
|
+
_owner: L
|
|
425
|
+
};
|
|
426
|
+
return O._store = {}, Object.defineProperty(O._store, "validated", {
|
|
427
|
+
configurable: !1,
|
|
428
|
+
enumerable: !1,
|
|
429
|
+
writable: !0,
|
|
430
|
+
value: !1
|
|
431
|
+
}), Object.defineProperty(O, "_self", {
|
|
432
|
+
configurable: !1,
|
|
433
|
+
enumerable: !1,
|
|
434
|
+
writable: !1,
|
|
435
|
+
value: E
|
|
436
|
+
}), Object.defineProperty(O, "_source", {
|
|
437
|
+
configurable: !1,
|
|
438
|
+
enumerable: !1,
|
|
439
|
+
writable: !1,
|
|
440
|
+
value: z
|
|
441
|
+
}), Object.freeze && (Object.freeze(O.props), Object.freeze(O)), O;
|
|
442
|
+
};
|
|
443
|
+
function yt(s, c, v, E, z) {
|
|
444
|
+
{
|
|
445
|
+
var L, _ = {}, O = null, Y = null;
|
|
446
|
+
v !== void 0 && (_e(v), O = "" + v), mt(c) && (_e(c.key), O = "" + c.key), pt(c) && (Y = c.ref, ht(c, z));
|
|
447
|
+
for (L in c)
|
|
448
|
+
re.call(c, L) && !ct.hasOwnProperty(L) && (_[L] = c[L]);
|
|
449
|
+
if (s && s.defaultProps) {
|
|
450
|
+
var V = s.defaultProps;
|
|
451
|
+
for (L in V)
|
|
452
|
+
_[L] === void 0 && (_[L] = V[L]);
|
|
453
|
+
}
|
|
454
|
+
if (O || Y) {
|
|
455
|
+
var H = typeof s == "function" ? s.displayName || s.name || "Unknown" : s;
|
|
456
|
+
O && xt(_, H), Y && ut(_, H);
|
|
457
|
+
}
|
|
458
|
+
return gt(s, O, Y, z, E, ze.current, _);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
var Ne = D.ReactCurrentOwner, qe = D.ReactDebugCurrentFrame;
|
|
462
|
+
function ae(s) {
|
|
463
|
+
if (s) {
|
|
464
|
+
var c = s._owner, v = he(s.type, s._source, c ? c.type : null);
|
|
465
|
+
qe.setExtraStackFrame(v);
|
|
466
|
+
} else
|
|
467
|
+
qe.setExtraStackFrame(null);
|
|
468
|
+
}
|
|
469
|
+
var we;
|
|
470
|
+
we = !1;
|
|
471
|
+
function Ce(s) {
|
|
472
|
+
return typeof s == "object" && s !== null && s.$$typeof === o;
|
|
473
|
+
}
|
|
474
|
+
function Ve() {
|
|
475
|
+
{
|
|
476
|
+
if (Ne.current) {
|
|
477
|
+
var s = F(Ne.current.type);
|
|
478
|
+
if (s)
|
|
479
|
+
return `
|
|
480
|
+
|
|
481
|
+
Check the render method of \`` + s + "`.";
|
|
482
|
+
}
|
|
483
|
+
return "";
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
function kt(s) {
|
|
487
|
+
return "";
|
|
488
|
+
}
|
|
489
|
+
var He = {};
|
|
490
|
+
function ft(s) {
|
|
491
|
+
{
|
|
492
|
+
var c = Ve();
|
|
493
|
+
if (!c) {
|
|
494
|
+
var v = typeof s == "string" ? s : s.displayName || s.name;
|
|
495
|
+
v && (c = `
|
|
496
|
+
|
|
497
|
+
Check the top-level render call using <` + v + ">.");
|
|
498
|
+
}
|
|
499
|
+
return c;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
function Ye(s, c) {
|
|
503
|
+
{
|
|
504
|
+
if (!s._store || s._store.validated || s.key != null)
|
|
505
|
+
return;
|
|
506
|
+
s._store.validated = !0;
|
|
507
|
+
var v = ft(c);
|
|
508
|
+
if (He[v])
|
|
509
|
+
return;
|
|
510
|
+
He[v] = !0;
|
|
511
|
+
var E = "";
|
|
512
|
+
s && s._owner && s._owner !== Ne.current && (E = " It was passed a child from " + F(s._owner.type) + "."), ae(s), P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', v, E), ae(null);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
function Ue(s, c) {
|
|
516
|
+
{
|
|
517
|
+
if (typeof s != "object")
|
|
518
|
+
return;
|
|
519
|
+
if (je(s))
|
|
520
|
+
for (var v = 0; v < s.length; v++) {
|
|
521
|
+
var E = s[v];
|
|
522
|
+
Ce(E) && Ye(E, c);
|
|
523
|
+
}
|
|
524
|
+
else if (Ce(s))
|
|
525
|
+
s._store && (s._store.validated = !0);
|
|
526
|
+
else if (s) {
|
|
527
|
+
var z = B(s);
|
|
528
|
+
if (typeof z == "function" && z !== s.entries)
|
|
529
|
+
for (var L = z.call(s), _; !(_ = L.next()).done; )
|
|
530
|
+
Ce(_.value) && Ye(_.value, c);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
function vt(s) {
|
|
535
|
+
{
|
|
536
|
+
var c = s.type;
|
|
537
|
+
if (c == null || typeof c == "string")
|
|
538
|
+
return;
|
|
539
|
+
var v;
|
|
540
|
+
if (typeof c == "function")
|
|
541
|
+
v = c.propTypes;
|
|
542
|
+
else if (typeof c == "object" && (c.$$typeof === l || // Note: Memo only checks outer props here.
|
|
543
|
+
// Inner props are checked in the reconciler.
|
|
544
|
+
c.$$typeof === k))
|
|
545
|
+
v = c.propTypes;
|
|
546
|
+
else
|
|
547
|
+
return;
|
|
548
|
+
if (v) {
|
|
549
|
+
var E = F(c);
|
|
550
|
+
nt(v, s.props, "prop", E, s);
|
|
551
|
+
} else if (c.PropTypes !== void 0 && !we) {
|
|
552
|
+
we = !0;
|
|
553
|
+
var z = F(c);
|
|
554
|
+
P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", z || "Unknown");
|
|
555
|
+
}
|
|
556
|
+
typeof c.getDefaultProps == "function" && !c.getDefaultProps.isReactClassApproved && P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
function bt(s) {
|
|
560
|
+
{
|
|
561
|
+
for (var c = Object.keys(s.props), v = 0; v < c.length; v++) {
|
|
562
|
+
var E = c[v];
|
|
563
|
+
if (E !== "children" && E !== "key") {
|
|
564
|
+
ae(s), P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", E), ae(null);
|
|
565
|
+
break;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
s.ref !== null && (ae(s), P("Invalid attribute `ref` supplied to `React.Fragment`."), ae(null));
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
var Ge = {};
|
|
572
|
+
function Je(s, c, v, E, z, L) {
|
|
573
|
+
{
|
|
574
|
+
var _ = a(s);
|
|
575
|
+
if (!_) {
|
|
576
|
+
var O = "";
|
|
577
|
+
(s === void 0 || typeof s == "object" && s !== null && Object.keys(s).length === 0) && (O += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
578
|
+
var Y = kt();
|
|
579
|
+
Y ? O += Y : O += Ve();
|
|
580
|
+
var V;
|
|
581
|
+
s === null ? V = "null" : je(s) ? V = "array" : s !== void 0 && s.$$typeof === o ? (V = "<" + (F(s.type) || "Unknown") + " />", O = " Did you accidentally export a JSX literal instead of a component?") : V = typeof s, P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", V, O);
|
|
582
|
+
}
|
|
583
|
+
var H = yt(s, c, v, z, L);
|
|
584
|
+
if (H == null)
|
|
585
|
+
return H;
|
|
586
|
+
if (_) {
|
|
587
|
+
var J = c.children;
|
|
588
|
+
if (J !== void 0)
|
|
589
|
+
if (E)
|
|
590
|
+
if (je(J)) {
|
|
591
|
+
for (var ie = 0; ie < J.length; ie++)
|
|
592
|
+
Ue(J[ie], s);
|
|
593
|
+
Object.freeze && Object.freeze(J);
|
|
594
|
+
} else
|
|
595
|
+
P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
596
|
+
else
|
|
597
|
+
Ue(J, s);
|
|
598
|
+
}
|
|
599
|
+
if (re.call(c, "key")) {
|
|
600
|
+
var ee = F(s), U = Object.keys(c).filter(function(Tt) {
|
|
601
|
+
return Tt !== "key";
|
|
602
|
+
}), Se = U.length > 0 ? "{key: someKey, " + U.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
|
+
if (!Ge[ee + Se]) {
|
|
604
|
+
var St = U.length > 0 ? "{" + U.join(": ..., ") + ": ...}" : "{}";
|
|
605
|
+
P(`A props object containing a "key" prop is being spread into JSX:
|
|
606
|
+
let props = %s;
|
|
607
|
+
<%s {...props} />
|
|
608
|
+
React keys must be passed directly to JSX without using spread:
|
|
609
|
+
let props = %s;
|
|
610
|
+
<%s key={someKey} {...props} />`, Se, ee, St, ee), Ge[ee + Se] = !0;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
return s === j ? bt(H) : vt(H), H;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
function jt(s, c, v) {
|
|
617
|
+
return Je(s, c, v, !0);
|
|
618
|
+
}
|
|
619
|
+
function Nt(s, c, v) {
|
|
620
|
+
return Je(s, c, v, !1);
|
|
621
|
+
}
|
|
622
|
+
var wt = Nt, Ct = jt;
|
|
623
|
+
le.Fragment = j, le.jsx = wt, le.jsxs = Ct;
|
|
624
|
+
}()), le;
|
|
625
|
+
}
|
|
626
|
+
process.env.NODE_ENV === "production" ? De.exports = Rt() : De.exports = Dt();
|
|
627
|
+
var e = De.exports;
|
|
628
|
+
const ue = {
|
|
629
|
+
storeName: "PopSite Originals",
|
|
630
|
+
categories: ["All", "Apparel", "Accessories", "Footwear", "Tech"],
|
|
631
|
+
products: [
|
|
632
|
+
{
|
|
633
|
+
id: "p1",
|
|
634
|
+
name: "Prismatic Hoodie",
|
|
635
|
+
price: 89.99,
|
|
636
|
+
category: "Apparel",
|
|
637
|
+
image: "https://images.unsplash.com/photo-1556821840-3a63f95609a7?auto=format&fit=crop&w=800&q=80",
|
|
638
|
+
description: "Premium cotton hoodie featuring a subtle iridescent logo. Perfect for chilly evenings and casual flexes.",
|
|
639
|
+
sizes: ["S", "M", "L", "XL"],
|
|
640
|
+
colors: ["Black", "Heather Grey", "Lavender"],
|
|
641
|
+
inStock: !0,
|
|
642
|
+
rating: 4.8,
|
|
643
|
+
reviews: 124
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
id: "p2",
|
|
647
|
+
name: "Aerodynamic Runners",
|
|
648
|
+
price: 145,
|
|
649
|
+
category: "Footwear",
|
|
650
|
+
image: "https://images.unsplash.com/photo-1542291026-7eec264c27ff?auto=format&fit=crop&w=800&q=80",
|
|
651
|
+
description: "Ultralight sneakers designed for maximum comfort. Carbon-infused sole brings explosive returns.",
|
|
652
|
+
sizes: ["8", "9", "10", "11", "12"],
|
|
653
|
+
colors: ["Neon Red", "Obsidian"],
|
|
654
|
+
inStock: !0,
|
|
655
|
+
rating: 4.9,
|
|
656
|
+
reviews: 89
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
id: "p3",
|
|
660
|
+
name: "Minimalist Chronograph",
|
|
661
|
+
price: 210,
|
|
662
|
+
category: "Accessories",
|
|
663
|
+
image: "https://images.unsplash.com/photo-1523275335684-37898b6baf30?auto=format&fit=crop&w=800&q=80",
|
|
664
|
+
description: "Matte black stainless steel with a sleek sapphire crystal face. Water resistant to 50 meters.",
|
|
665
|
+
sizes: ["One Size"],
|
|
666
|
+
colors: ["Matte Black"],
|
|
667
|
+
inStock: !1,
|
|
668
|
+
rating: 4.7,
|
|
669
|
+
reviews: 56
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
id: "p4",
|
|
673
|
+
name: "Noise-Cancelling Pods Pro",
|
|
674
|
+
price: 199.99,
|
|
675
|
+
category: "Tech",
|
|
676
|
+
image: "https://images.unsplash.com/photo-1606220588913-b3aecb2ac201?auto=format&fit=crop&w=800&q=80",
|
|
677
|
+
description: "Immersive audio experience with active noise cancellation and 24-hour battery life.",
|
|
678
|
+
sizes: [],
|
|
679
|
+
colors: ["White", "Space Gray"],
|
|
680
|
+
inStock: !0,
|
|
681
|
+
rating: 4.5,
|
|
682
|
+
reviews: 210
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
id: "p5",
|
|
686
|
+
name: "Urban Backpack",
|
|
687
|
+
price: 75,
|
|
688
|
+
category: "Accessories",
|
|
689
|
+
image: "https://images.unsplash.com/photo-1553062407-98eeb64c6a62?auto=format&fit=crop&w=800&q=80",
|
|
690
|
+
description: "Water-resistant commuter backpack with padded laptop sleeve and hidden anti-theft pockets.",
|
|
691
|
+
sizes: ["One Size"],
|
|
692
|
+
colors: ["Charcoal", "Olive Drab"],
|
|
693
|
+
inStock: !0,
|
|
694
|
+
rating: 4.6,
|
|
695
|
+
reviews: 178
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
id: "p6",
|
|
699
|
+
name: "Graphic Tee - The Wave",
|
|
700
|
+
price: 35,
|
|
701
|
+
category: "Apparel",
|
|
702
|
+
image: "https://images.unsplash.com/photo-1521572163474-6864f9cf17ab?auto=format&fit=crop&w=800&q=80",
|
|
703
|
+
description: "Heavyweight boxy organic cotton tee with a retro wave graphic.",
|
|
704
|
+
sizes: ["S", "M", "L"],
|
|
705
|
+
colors: ["White", "Sand"],
|
|
706
|
+
inStock: !0,
|
|
707
|
+
rating: 4.3,
|
|
708
|
+
reviews: 45
|
|
709
|
+
}
|
|
710
|
+
]
|
|
711
|
+
};
|
|
712
|
+
function It({ message: m, type: o = "success", onClose: n, duration: j = 3e3 }) {
|
|
713
|
+
const [u, N] = p(!0);
|
|
714
|
+
return $(() => {
|
|
715
|
+
const h = setTimeout(() => {
|
|
716
|
+
N(!1), setTimeout(() => {
|
|
717
|
+
n && n();
|
|
718
|
+
}, 300);
|
|
719
|
+
}, j);
|
|
720
|
+
return () => clearTimeout(h);
|
|
721
|
+
}, [j, n]), !u && !n ? null : /* @__PURE__ */ e.jsxs("div", { className: `pk-toast ${o} ${u ? "" : "pk-fade-out"}`, style: { opacity: u ? 1 : 0, transition: "opacity 0.3s ease-out" }, children: [
|
|
722
|
+
/* @__PURE__ */ e.jsx("div", { style: { fontSize: "1.25rem" }, children: o === "success" ? "✅" : o === "error" ? "❌" : "ℹ️" }),
|
|
723
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: 1 }, children: [
|
|
724
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-label", style: { margin: 0, textTransform: "capitalize" }, children: o }),
|
|
725
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-sm", style: { margin: 0 }, children: m })
|
|
726
|
+
] }),
|
|
727
|
+
/* @__PURE__ */ e.jsx(
|
|
728
|
+
"button",
|
|
729
|
+
{
|
|
730
|
+
onClick: () => {
|
|
731
|
+
N(!1), n && setTimeout(n, 300);
|
|
732
|
+
},
|
|
733
|
+
style: { background: "none", border: "none", cursor: "pointer", fontSize: "1.25rem", color: "var(--pk-text-muted)" },
|
|
734
|
+
children: "×"
|
|
735
|
+
}
|
|
736
|
+
)
|
|
737
|
+
] });
|
|
738
|
+
}
|
|
739
|
+
function G() {
|
|
740
|
+
const [m, o] = p([]), n = (N, h = "success") => {
|
|
741
|
+
const A = Date.now();
|
|
742
|
+
o((l) => [...l, { id: A, message: N, type: h }]);
|
|
743
|
+
}, j = (N) => {
|
|
744
|
+
o((h) => h.filter((A) => A.id !== N));
|
|
745
|
+
};
|
|
746
|
+
return { showToast: n, ToastContainer: () => /* @__PURE__ */ e.jsx("div", { className: "pk-toast-container", children: m.map((N) => /* @__PURE__ */ e.jsx(
|
|
747
|
+
It,
|
|
748
|
+
{
|
|
749
|
+
message: N.message,
|
|
750
|
+
type: N.type,
|
|
751
|
+
onClose: () => j(N.id)
|
|
752
|
+
},
|
|
753
|
+
N.id
|
|
754
|
+
)) }) };
|
|
755
|
+
}
|
|
756
|
+
function Pt() {
|
|
757
|
+
const [m, o] = p("grid"), [n, j] = p(null), [u, N] = p([]), [h, A] = p(""), [l, T] = p("All"), [x, k] = p(!1), { showToast: g, ToastContainer: W } = G();
|
|
758
|
+
$(() => {
|
|
759
|
+
const t = localStorage.getItem("popsite_cart");
|
|
760
|
+
if (t)
|
|
761
|
+
try {
|
|
762
|
+
N(JSON.parse(t));
|
|
763
|
+
} catch {
|
|
764
|
+
console.error("Failed to parse cart");
|
|
765
|
+
}
|
|
766
|
+
}, []), $(() => {
|
|
767
|
+
localStorage.setItem("popsite_cart", JSON.stringify(u));
|
|
768
|
+
}, [u]);
|
|
769
|
+
const y = (t, a = 1500) => {
|
|
770
|
+
k(!0), setTimeout(() => {
|
|
771
|
+
k(!1), t();
|
|
772
|
+
}, a);
|
|
773
|
+
}, C = (t) => {
|
|
774
|
+
window.scrollTo({ top: 0, behavior: "smooth" }), j({ ...t, selectedSize: t.sizes[0] || null, selectedColor: t.colors[0] || null }), o("details");
|
|
775
|
+
}, B = () => {
|
|
776
|
+
if (!n.inStock) {
|
|
777
|
+
g("Product is currently out of stock", "error");
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
780
|
+
const t = u.findIndex(
|
|
781
|
+
(i) => i.id === n.id && i.selectedSize === n.selectedSize && i.selectedColor === n.selectedColor
|
|
782
|
+
), a = [...u];
|
|
783
|
+
t >= 0 ? a[t].quantity += 1 : a.push({ ...n, quantity: 1 }), N(a), g(`${n.name} added to cart!`, "success");
|
|
784
|
+
}, D = (t) => {
|
|
785
|
+
const a = [...u];
|
|
786
|
+
a.splice(t, 1), N(a), g("Item removed from cart", "info");
|
|
787
|
+
}, P = () => {
|
|
788
|
+
if (u.length === 0) {
|
|
789
|
+
g("Your cart is empty", "error");
|
|
790
|
+
return;
|
|
791
|
+
}
|
|
792
|
+
y(() => {
|
|
793
|
+
o("success"), N([]), g("Order placed successfully!", "success");
|
|
794
|
+
});
|
|
795
|
+
}, S = () => {
|
|
796
|
+
const t = `ID,Name,Category,Price,InStock,Rating
|
|
797
|
+
`, a = ue.products.map(
|
|
798
|
+
(w) => `${w.id},"${w.name}","${w.category}",${w.price},${w.inStock},${w.rating}`
|
|
799
|
+
).join(`
|
|
800
|
+
`), i = new Blob([t + a], { type: "text/csv" }), f = URL.createObjectURL(i), F = document.createElement("a");
|
|
801
|
+
F.href = f, F.download = `products_export_${Date.now()}.csv`, F.click(), g("Catalog exported to CSV", "success");
|
|
802
|
+
}, d = u.reduce((t, a) => t + a.price * a.quantity, 0), b = () => {
|
|
803
|
+
const t = ue.products.filter((a) => {
|
|
804
|
+
const i = a.name.toLowerCase().includes(h.toLowerCase()), f = l === "All" || a.category === l;
|
|
805
|
+
return i && f;
|
|
806
|
+
});
|
|
807
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", children: [
|
|
808
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between pk-items-center", style: { marginBottom: "2rem", flexWrap: "wrap", gap: "1rem" }, children: [
|
|
809
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
810
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-lg", style: { marginBottom: "0.5rem" }, children: ue.storeName }),
|
|
811
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: "Discover premium gear for modern living." })
|
|
812
|
+
] }),
|
|
813
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-items-center", style: { gap: "1rem" }, children: [
|
|
814
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", onClick: S, children: "⬇️ Export CSV" }),
|
|
815
|
+
/* @__PURE__ */ e.jsxs("button", { className: "pk-btn pk-btn-primary", onClick: () => o("checkout"), children: [
|
|
816
|
+
"🛒 Cart (",
|
|
817
|
+
u.length,
|
|
818
|
+
")"
|
|
819
|
+
] })
|
|
820
|
+
] })
|
|
821
|
+
] }),
|
|
822
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-glass", style: { padding: "1.5rem", marginBottom: "2rem", display: "flex", gap: "1rem", flexWrap: "wrap", alignItems: "center" }, children: [
|
|
823
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-input-group", style: { margin: 0, flex: 1, minWidth: "250px" }, children: /* @__PURE__ */ e.jsx(
|
|
824
|
+
"input",
|
|
825
|
+
{
|
|
826
|
+
type: "text",
|
|
827
|
+
className: "pk-input",
|
|
828
|
+
placeholder: "Search products...",
|
|
829
|
+
value: h,
|
|
830
|
+
onChange: (a) => A(a.target.value)
|
|
831
|
+
}
|
|
832
|
+
) }),
|
|
833
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-flex", style: { gap: "0.5rem", overflowX: "auto", paddingBottom: "4px" }, children: ue.categories.map((a) => /* @__PURE__ */ e.jsx(
|
|
834
|
+
"button",
|
|
835
|
+
{
|
|
836
|
+
className: l === a ? "pk-badge" : "pk-btn pk-btn-outline",
|
|
837
|
+
style: l !== a ? { padding: "0.25rem 0.75rem", borderRadius: "var(--pk-radius-full)", border: "1px solid var(--pk-border)" } : { cursor: "pointer" },
|
|
838
|
+
onClick: () => T(a),
|
|
839
|
+
children: a
|
|
840
|
+
},
|
|
841
|
+
a
|
|
842
|
+
)) })
|
|
843
|
+
] }),
|
|
844
|
+
t.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "pk-empty-state", children: [
|
|
845
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-empty-icon", children: "🏜️" }),
|
|
846
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "No products found" }),
|
|
847
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: "Try adjusting your filters or search query." }),
|
|
848
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-secondary", style: { marginTop: "1rem" }, onClick: () => {
|
|
849
|
+
A(""), T("All");
|
|
850
|
+
}, children: "Clear Filters" })
|
|
851
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "pk-grid pk-grid-responsive", children: t.map((a) => /* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-card-interactive", onClick: () => C(a), style: { cursor: "pointer", display: "flex", flexDirection: "column" }, children: [
|
|
852
|
+
/* @__PURE__ */ e.jsxs("div", { style: { height: "250px", width: "100%", overflow: "hidden", backgroundColor: "var(--pk-primary-light)" }, children: [
|
|
853
|
+
/* @__PURE__ */ e.jsx(
|
|
854
|
+
"img",
|
|
855
|
+
{
|
|
856
|
+
src: a.image,
|
|
857
|
+
alt: a.name,
|
|
858
|
+
className: "pk-object-cover pk-w-full pk-h-full",
|
|
859
|
+
style: { transition: "transform 0.5s" },
|
|
860
|
+
onError: (i) => {
|
|
861
|
+
i.target.style.display = "none", i.target.nextSibling.style.display = "flex";
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
),
|
|
865
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "none", width: "100%", height: "100%", background: "linear-gradient(135deg, var(--pk-primary), var(--pk-secondary))", color: "white", alignItems: "center", justifyContent: "center", fontSize: "2rem", fontWeight: "bold" }, children: a.name.substring(0, 2).toUpperCase() })
|
|
866
|
+
] }),
|
|
867
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-body", style: { flex: 1, display: "flex", flexDirection: "column" }, children: [
|
|
868
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between pk-items-center", style: { marginBottom: "0.5rem" }, children: [
|
|
869
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-badge", children: a.category }),
|
|
870
|
+
/* @__PURE__ */ e.jsxs("span", { style: { fontSize: "0.875rem", color: "#f59e0b", fontWeight: 600 }, children: [
|
|
871
|
+
"★ ",
|
|
872
|
+
a.rating
|
|
873
|
+
] })
|
|
874
|
+
] }),
|
|
875
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "0.5rem" }, children: a.name }),
|
|
876
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-text-body", style: { display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden", marginBottom: "1rem", flex: 1 }, children: a.description }),
|
|
877
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between pk-items-center", style: { marginTop: "auto" }, children: [
|
|
878
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-heading-md", style: { color: "var(--pk-primary)" }, children: [
|
|
879
|
+
"$",
|
|
880
|
+
a.price.toFixed(2)
|
|
881
|
+
] }),
|
|
882
|
+
!a.inStock && /* @__PURE__ */ e.jsx("span", { className: "pk-text-sm", style: { color: "var(--pk-danger)" }, children: "Out of Stock" })
|
|
883
|
+
] })
|
|
884
|
+
] })
|
|
885
|
+
] }, a.id)) })
|
|
886
|
+
] });
|
|
887
|
+
}, M = () => {
|
|
888
|
+
if (!n) return null;
|
|
889
|
+
const t = n;
|
|
890
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", children: [
|
|
891
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { marginBottom: "2rem" }, onClick: () => o("grid"), children: "← Back to Catalog" }),
|
|
892
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { display: "flex", flexWrap: "wrap" }, children: [
|
|
893
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: "1 1 400px", height: "500px", backgroundColor: "var(--pk-primary-light)", padding: "2rem" }, children: [
|
|
894
|
+
/* @__PURE__ */ e.jsx(
|
|
895
|
+
"img",
|
|
896
|
+
{
|
|
897
|
+
src: t.image,
|
|
898
|
+
alt: t.name,
|
|
899
|
+
className: "pk-object-cover pk-w-full pk-h-full",
|
|
900
|
+
style: { borderRadius: "var(--pk-radius-lg)", boxShadow: "var(--pk-shadow-lg)" },
|
|
901
|
+
onError: (a) => {
|
|
902
|
+
a.target.style.display = "none", a.target.nextSibling.style.display = "flex";
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
),
|
|
906
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "none", width: "100%", height: "100%", background: "linear-gradient(135deg, var(--pk-primary), var(--pk-secondary))", color: "white", alignItems: "center", justifyContent: "center", fontSize: "4rem", fontWeight: "bold", borderRadius: "var(--pk-radius-lg)", boxShadow: "var(--pk-shadow-lg)" }, children: t.name.substring(0, 2).toUpperCase() })
|
|
907
|
+
] }),
|
|
908
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: "1 1 400px", padding: "3rem" }, children: [
|
|
909
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-items-center", style: { gap: "1rem", marginBottom: "1rem" }, children: [
|
|
910
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-badge", children: t.category }),
|
|
911
|
+
/* @__PURE__ */ e.jsxs("span", { style: { fontSize: "1rem", color: "#f59e0b", fontWeight: 600 }, children: [
|
|
912
|
+
"★ ",
|
|
913
|
+
t.rating,
|
|
914
|
+
" (",
|
|
915
|
+
t.reviews,
|
|
916
|
+
" reviews)"
|
|
917
|
+
] })
|
|
918
|
+
] }),
|
|
919
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", style: { marginBottom: "1rem" }, children: t.name }),
|
|
920
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-heading-lg", style: { color: "var(--pk-primary)", marginBottom: "1.5rem" }, children: [
|
|
921
|
+
"$",
|
|
922
|
+
t.price.toFixed(2)
|
|
923
|
+
] }),
|
|
924
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { fontSize: "1.125rem", marginBottom: "2rem" }, children: t.description }),
|
|
925
|
+
t.sizes && t.sizes.length > 0 && /* @__PURE__ */ e.jsxs("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
926
|
+
/* @__PURE__ */ e.jsx("h4", { className: "pk-label", style: { marginBottom: "0.5rem" }, children: "Select Size" }),
|
|
927
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-flex", style: { gap: "0.5rem", flexWrap: "wrap" }, children: t.sizes.map((a) => /* @__PURE__ */ e.jsx(
|
|
928
|
+
"button",
|
|
929
|
+
{
|
|
930
|
+
className: t.selectedSize === a ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline",
|
|
931
|
+
style: { padding: "0.5rem 1rem" },
|
|
932
|
+
onClick: () => j({ ...t, selectedSize: a }),
|
|
933
|
+
children: a
|
|
934
|
+
},
|
|
935
|
+
a
|
|
936
|
+
)) })
|
|
937
|
+
] }),
|
|
938
|
+
t.colors && t.colors.length > 0 && /* @__PURE__ */ e.jsxs("div", { style: { marginBottom: "2.5rem" }, children: [
|
|
939
|
+
/* @__PURE__ */ e.jsx("h4", { className: "pk-label", style: { marginBottom: "0.5rem" }, children: "Select Color" }),
|
|
940
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-flex", style: { gap: "0.5rem", flexWrap: "wrap" }, children: t.colors.map((a) => /* @__PURE__ */ e.jsx(
|
|
941
|
+
"button",
|
|
942
|
+
{
|
|
943
|
+
className: t.selectedColor === a ? "pk-btn pk-btn-secondary" : "pk-btn pk-btn-outline",
|
|
944
|
+
onClick: () => j({ ...t, selectedColor: a }),
|
|
945
|
+
children: a
|
|
946
|
+
},
|
|
947
|
+
a
|
|
948
|
+
)) })
|
|
949
|
+
] }),
|
|
950
|
+
/* @__PURE__ */ e.jsx(
|
|
951
|
+
"button",
|
|
952
|
+
{
|
|
953
|
+
className: `pk-btn pk-btn-primary pk-w-full ${t.inStock ? "" : "pk-btn-outline"}`,
|
|
954
|
+
style: { fontSize: "1.25rem", padding: "1rem" },
|
|
955
|
+
disabled: !t.inStock,
|
|
956
|
+
onClick: B,
|
|
957
|
+
children: t.inStock ? "🛒 Add to Cart" : "Out of Stock"
|
|
958
|
+
}
|
|
959
|
+
)
|
|
960
|
+
] })
|
|
961
|
+
] })
|
|
962
|
+
] });
|
|
963
|
+
}, I = () => /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", children: [
|
|
964
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between pk-items-center", style: { marginBottom: "2rem" }, children: [
|
|
965
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-lg", children: "Your Cart" }),
|
|
966
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", onClick: () => o("grid"), children: "Keep Shopping" })
|
|
967
|
+
] }),
|
|
968
|
+
u.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "pk-empty-state", children: [
|
|
969
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-empty-icon", children: "🛍️" }),
|
|
970
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "Your cart is empty" }),
|
|
971
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { marginBottom: "2rem" }, children: "Looks like you haven't added anything yet." }),
|
|
972
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", onClick: () => o("grid"), children: "Start Shopping" })
|
|
973
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: "pk-grid", style: { gridTemplateColumns: "minmax(300px, 2fr) minmax(300px, 1fr)" }, children: [
|
|
974
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-flex pk-flex-col pk-gap-4", children: u.map((t, a) => /* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-flex pk-items-center", style: { padding: "1rem", gap: "1.5rem" }, children: [
|
|
975
|
+
/* @__PURE__ */ e.jsx("div", { style: { width: "100px", height: "100px", borderRadius: "var(--pk-radius-md)", overflow: "hidden", background: "var(--pk-primary-light)" }, children: /* @__PURE__ */ e.jsx("img", { src: t.image, alt: t.name, className: "pk-object-cover pk-w-full pk-h-full" }) }),
|
|
976
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: 1 }, children: [
|
|
977
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { fontSize: "1.25rem", marginBottom: "0.25rem" }, children: t.name }),
|
|
978
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-sm", children: [
|
|
979
|
+
t.selectedColor && `Color: ${t.selectedColor}`,
|
|
980
|
+
t.selectedColor && t.selectedSize && " | ",
|
|
981
|
+
t.selectedSize && `Size: ${t.selectedSize}`
|
|
982
|
+
] }),
|
|
983
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-body", style: { fontWeight: 600, marginTop: "0.5rem" }, children: [
|
|
984
|
+
"Qty: ",
|
|
985
|
+
t.quantity
|
|
986
|
+
] })
|
|
987
|
+
] }),
|
|
988
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-flex-col pk-items-center", style: { gap: "1rem", minWidth: "80px", alignItems: "flex-end" }, children: [
|
|
989
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-heading-md", children: [
|
|
990
|
+
"$",
|
|
991
|
+
(t.price * t.quantity).toFixed(2)
|
|
992
|
+
] }),
|
|
993
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { padding: "0.25rem 0.5rem", color: "var(--pk-danger)", border: "none", background: "var(--pk-danger-light)" }, onClick: () => D(a), children: "Remove" })
|
|
994
|
+
] })
|
|
995
|
+
] }, a)) }),
|
|
996
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { position: "sticky", top: "100px" }, children: [
|
|
997
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-card-header", children: /* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "Order Summary" }) }),
|
|
998
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-body pk-flex pk-flex-col pk-gap-4", children: [
|
|
999
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between", children: [
|
|
1000
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-body", children: "Subtotal" }),
|
|
1001
|
+
/* @__PURE__ */ e.jsxs("span", { style: { fontWeight: 600 }, children: [
|
|
1002
|
+
"$",
|
|
1003
|
+
d.toFixed(2)
|
|
1004
|
+
] })
|
|
1005
|
+
] }),
|
|
1006
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between", children: [
|
|
1007
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-body", children: "Shipping" }),
|
|
1008
|
+
/* @__PURE__ */ e.jsx("span", { style: { fontWeight: 600 }, children: "Free" })
|
|
1009
|
+
] }),
|
|
1010
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between", children: [
|
|
1011
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-body", children: "Tax (Estimated)" }),
|
|
1012
|
+
/* @__PURE__ */ e.jsxs("span", { style: { fontWeight: 600 }, children: [
|
|
1013
|
+
"$",
|
|
1014
|
+
(d * 0.08).toFixed(2)
|
|
1015
|
+
] })
|
|
1016
|
+
] }),
|
|
1017
|
+
/* @__PURE__ */ e.jsx("hr", { style: { border: 0, borderTop: "1px solid var(--pk-border)", margin: "0.5rem 0" } }),
|
|
1018
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between pk-items-center", children: [
|
|
1019
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-heading-md", children: "Total" }),
|
|
1020
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-heading-lg", style: { color: "var(--pk-primary)" }, children: [
|
|
1021
|
+
"$",
|
|
1022
|
+
(d * 1.08).toFixed(2)
|
|
1023
|
+
] })
|
|
1024
|
+
] }),
|
|
1025
|
+
/* @__PURE__ */ e.jsx(
|
|
1026
|
+
"button",
|
|
1027
|
+
{
|
|
1028
|
+
className: "pk-btn pk-btn-primary pk-w-full",
|
|
1029
|
+
style: { marginTop: "1rem", fontSize: "1.25rem", padding: "1rem" },
|
|
1030
|
+
onClick: P,
|
|
1031
|
+
children: "Proceed to Payment"
|
|
1032
|
+
}
|
|
1033
|
+
)
|
|
1034
|
+
] })
|
|
1035
|
+
] }) })
|
|
1036
|
+
] })
|
|
1037
|
+
] }), r = () => /* @__PURE__ */ e.jsx("div", { className: "pk-container animate-fade-in", style: { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "60vh" }, children: /* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-text-center", style: { padding: "4rem 2rem", maxWidth: "600px" }, children: [
|
|
1038
|
+
/* @__PURE__ */ e.jsx("div", { style: { fontSize: "5rem", marginBottom: "1rem" }, children: "🎉" }),
|
|
1039
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", style: { marginBottom: "1rem" }, children: "Order Confirmed!" }),
|
|
1040
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { fontSize: "1.25rem", marginBottom: "2rem" }, children: "Thank you for your purchase. We've sent a receipt to your email and your items will ship shortly." }),
|
|
1041
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", onClick: () => o("grid"), children: "Return to Store" })
|
|
1042
|
+
] }) });
|
|
1043
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { position: "relative", minHeight: "100vh", backgroundColor: "var(--pk-bg-main)" }, children: [
|
|
1044
|
+
x && /* @__PURE__ */ e.jsxs("div", { style: { position: "fixed", inset: 0, backgroundColor: "rgba(255,255,255,0.7)", zIndex: 100, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", backdropFilter: "blur(4px)" }, children: [
|
|
1045
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-skeleton", style: { width: "80px", height: "80px", borderRadius: "50%", marginBottom: "1rem" } }),
|
|
1046
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "Processing..." })
|
|
1047
|
+
] }),
|
|
1048
|
+
/* @__PURE__ */ e.jsx("style", { children: `
|
|
1049
|
+
.animate-fade-in { animation: popsiteFadeIn 0.4s ease-out; }
|
|
1050
|
+
@keyframes popsiteFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
|
|
1051
|
+
` }),
|
|
1052
|
+
m === "grid" && b(),
|
|
1053
|
+
m === "details" && M(),
|
|
1054
|
+
m === "checkout" && I(),
|
|
1055
|
+
m === "success" && r(),
|
|
1056
|
+
/* @__PURE__ */ e.jsx(W, {})
|
|
1057
|
+
] });
|
|
1058
|
+
}
|
|
1059
|
+
const te = {
|
|
1060
|
+
cinemaName: "Starlight Cinemas",
|
|
1061
|
+
movies: [
|
|
1062
|
+
{
|
|
1063
|
+
id: "m1",
|
|
1064
|
+
title: "Neon Horizon",
|
|
1065
|
+
genre: "Sci-Fi / Cyberpunk",
|
|
1066
|
+
runtime: "2h 15m",
|
|
1067
|
+
rating: "PG-13",
|
|
1068
|
+
image: "https://images.unsplash.com/photo-1536440136628-849c177e76a1?auto=format&fit=crop&w=800&q=80",
|
|
1069
|
+
synopsis: "In a dystopian cyberpunk future, a rogue hacker discovers a code that could alter reality itself.",
|
|
1070
|
+
showtimes: ["14:00", "17:30", "20:00", "22:45"]
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
id: "m2",
|
|
1074
|
+
title: "The Silent Peak",
|
|
1075
|
+
genre: "Thriller / Mystery",
|
|
1076
|
+
runtime: "1h 50m",
|
|
1077
|
+
rating: "R",
|
|
1078
|
+
image: "https://images.unsplash.com/photo-1478720568477-152d9b164e26?auto=format&fit=crop&w=800&q=80",
|
|
1079
|
+
synopsis: "A group of mountaineers gets trapped during a blizzard, only to realize they are not alone on the mountain.",
|
|
1080
|
+
showtimes: ["15:15", "18:45", "21:30"]
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
id: "m3",
|
|
1084
|
+
title: "Echoes of Eternity",
|
|
1085
|
+
genre: "Romance / Drama",
|
|
1086
|
+
runtime: "2h 05m",
|
|
1087
|
+
rating: "PG",
|
|
1088
|
+
image: "https://images.unsplash.com/photo-1485846234645-a62644f84728?auto=format&fit=crop&w=800&q=80",
|
|
1089
|
+
synopsis: "Two lovers from different centuries communicate through an ancient artifact, fighting time to be together.",
|
|
1090
|
+
showtimes: ["13:00", "16:00", "19:00"]
|
|
1091
|
+
},
|
|
1092
|
+
{
|
|
1093
|
+
id: "m4",
|
|
1094
|
+
title: "Galactic Drift",
|
|
1095
|
+
genre: "Action / Adventure",
|
|
1096
|
+
runtime: "2h 30m",
|
|
1097
|
+
rating: "PG-13",
|
|
1098
|
+
image: "https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=800&q=80",
|
|
1099
|
+
synopsis: "An epic space opera following a band of smugglers trying to outrun a massive intergalactic empire.",
|
|
1100
|
+
showtimes: ["12:00", "16:30", "20:15", "23:00"]
|
|
1101
|
+
}
|
|
1102
|
+
],
|
|
1103
|
+
pricing: {
|
|
1104
|
+
standard: 12,
|
|
1105
|
+
vip: 25
|
|
1106
|
+
}
|
|
1107
|
+
};
|
|
1108
|
+
function Et() {
|
|
1109
|
+
const [m, o] = p("grid"), [n, j] = p(null), [u, N] = p(""), [h, A] = p([]), [l, T] = p([]), [x, k] = p(""), [g, W] = p(!1), { showToast: y, ToastContainer: C } = G();
|
|
1110
|
+
$(() => {
|
|
1111
|
+
const t = localStorage.getItem("popsite_movie_tickets");
|
|
1112
|
+
if (t)
|
|
1113
|
+
try {
|
|
1114
|
+
T(JSON.parse(t));
|
|
1115
|
+
} catch {
|
|
1116
|
+
}
|
|
1117
|
+
}, []), $(() => {
|
|
1118
|
+
l.length > 0 && localStorage.setItem("popsite_movie_tickets", JSON.stringify(l));
|
|
1119
|
+
}, [l]);
|
|
1120
|
+
const B = (t, a = 1500) => {
|
|
1121
|
+
W(!0), setTimeout(() => {
|
|
1122
|
+
W(!1), t();
|
|
1123
|
+
}, a);
|
|
1124
|
+
}, D = (t) => {
|
|
1125
|
+
window.scrollTo({ top: 0, behavior: "smooth" }), j(t), N(""), A([]), o("details");
|
|
1126
|
+
}, P = (t) => {
|
|
1127
|
+
A(
|
|
1128
|
+
(a) => a.includes(t) ? a.filter((i) => i !== t) : [...a, t]
|
|
1129
|
+
);
|
|
1130
|
+
}, S = () => h.reduce((t, a) => {
|
|
1131
|
+
const i = a.startsWith("V");
|
|
1132
|
+
return t + (i ? te.pricing.vip : te.pricing.standard);
|
|
1133
|
+
}, 0), d = () => {
|
|
1134
|
+
if (h.length === 0) {
|
|
1135
|
+
y("Please select at least one seat", "error");
|
|
1136
|
+
return;
|
|
1137
|
+
}
|
|
1138
|
+
B(() => {
|
|
1139
|
+
const t = {
|
|
1140
|
+
id: `TK-${Math.floor(Math.random() * 1e5)}`,
|
|
1141
|
+
movie: n,
|
|
1142
|
+
showtime: u,
|
|
1143
|
+
seats: h,
|
|
1144
|
+
total: S()
|
|
1145
|
+
};
|
|
1146
|
+
T((a) => [...a, t]), y("Payment successful! Enjoy the movie.", "success"), o("ticket");
|
|
1147
|
+
});
|
|
1148
|
+
}, b = () => {
|
|
1149
|
+
const t = te.movies.filter(
|
|
1150
|
+
(a) => a.title.toLowerCase().includes(x.toLowerCase()) || a.genre.toLowerCase().includes(x.toLowerCase())
|
|
1151
|
+
);
|
|
1152
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", children: [
|
|
1153
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between pk-items-center", style: { marginBottom: "2rem" }, children: [
|
|
1154
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1155
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-lg", style: { marginBottom: "0.5rem" }, children: te.cinemaName }),
|
|
1156
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: "Experience the magic of cinema." })
|
|
1157
|
+
] }),
|
|
1158
|
+
/* @__PURE__ */ e.jsxs(
|
|
1159
|
+
"button",
|
|
1160
|
+
{
|
|
1161
|
+
className: "pk-btn pk-btn-outline",
|
|
1162
|
+
onClick: () => {
|
|
1163
|
+
l.length > 0 ? o("ticket") : y("No tickets booked yet.", "info");
|
|
1164
|
+
},
|
|
1165
|
+
children: [
|
|
1166
|
+
"🎫 My Tickets (",
|
|
1167
|
+
l.length,
|
|
1168
|
+
")"
|
|
1169
|
+
]
|
|
1170
|
+
}
|
|
1171
|
+
)
|
|
1172
|
+
] }),
|
|
1173
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-card pk-glass", style: { padding: "1.5rem", marginBottom: "2rem" }, children: /* @__PURE__ */ e.jsx(
|
|
1174
|
+
"input",
|
|
1175
|
+
{
|
|
1176
|
+
type: "text",
|
|
1177
|
+
className: "pk-input pk-w-full",
|
|
1178
|
+
placeholder: "Search movies by title or genre...",
|
|
1179
|
+
value: x,
|
|
1180
|
+
onChange: (a) => k(a.target.value)
|
|
1181
|
+
}
|
|
1182
|
+
) }),
|
|
1183
|
+
t.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "pk-empty-state", children: [
|
|
1184
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-empty-icon", children: "🍿" }),
|
|
1185
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "No movies found" })
|
|
1186
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "pk-grid pk-grid-responsive", children: t.map((a) => /* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-card-interactive", onClick: () => D(a), style: { cursor: "pointer" }, children: [
|
|
1187
|
+
/* @__PURE__ */ e.jsxs("div", { style: { height: "350px", background: "var(--pk-primary-light)" }, children: [
|
|
1188
|
+
/* @__PURE__ */ e.jsx(
|
|
1189
|
+
"img",
|
|
1190
|
+
{
|
|
1191
|
+
src: a.image,
|
|
1192
|
+
alt: a.title,
|
|
1193
|
+
className: "pk-w-full pk-h-full pk-object-cover",
|
|
1194
|
+
onError: (i) => {
|
|
1195
|
+
i.target.style.display = "none", i.target.nextSibling.style.display = "flex";
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
),
|
|
1199
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "none", width: "100%", height: "100%", background: "linear-gradient(135deg, var(--pk-primary), var(--pk-secondary))", color: "white", alignItems: "center", justifyContent: "center", fontSize: "2rem", fontWeight: "bold" }, children: a.title[0] })
|
|
1200
|
+
] }),
|
|
1201
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-body", children: [
|
|
1202
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-badge", style: { marginBottom: "0.5rem", display: "inline-block" }, children: a.rating }),
|
|
1203
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "0.25rem" }, children: a.title }),
|
|
1204
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-sm", style: { marginBottom: "0.5rem" }, children: [
|
|
1205
|
+
a.genre,
|
|
1206
|
+
" • ",
|
|
1207
|
+
a.runtime
|
|
1208
|
+
] })
|
|
1209
|
+
] })
|
|
1210
|
+
] }, a.id)) })
|
|
1211
|
+
] });
|
|
1212
|
+
}, M = () => /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", children: [
|
|
1213
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { marginBottom: "2rem" }, onClick: () => o("grid"), children: "← Back" }),
|
|
1214
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-flex", style: { overflow: "hidden", flexWrap: "wrap" }, children: [
|
|
1215
|
+
/* @__PURE__ */ e.jsx("div", { style: { flex: "1 1 300px", minHeight: "400px" }, children: /* @__PURE__ */ e.jsx("img", { src: n.image, alt: n.title, className: "pk-w-full pk-h-full pk-object-cover" }) }),
|
|
1216
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: "2 1 400px", padding: "3rem" }, children: [
|
|
1217
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-items-center pk-gap-4", style: { marginBottom: "1rem" }, children: [
|
|
1218
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-badge", children: n.rating }),
|
|
1219
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-text-sm", children: [
|
|
1220
|
+
n.genre,
|
|
1221
|
+
" • ",
|
|
1222
|
+
n.runtime
|
|
1223
|
+
] })
|
|
1224
|
+
] }),
|
|
1225
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", style: { marginBottom: "1rem" }, children: n.title }),
|
|
1226
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { fontSize: "1.125rem", marginBottom: "2rem" }, children: n.synopsis }),
|
|
1227
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "1rem" }, children: "Select Showtime" }),
|
|
1228
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-flex", style: { gap: "1rem", flexWrap: "wrap", marginBottom: "2rem" }, children: n.showtimes.map((t) => /* @__PURE__ */ e.jsx(
|
|
1229
|
+
"button",
|
|
1230
|
+
{
|
|
1231
|
+
className: u === t ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline",
|
|
1232
|
+
onClick: () => N(t),
|
|
1233
|
+
children: t
|
|
1234
|
+
},
|
|
1235
|
+
t
|
|
1236
|
+
)) }),
|
|
1237
|
+
/* @__PURE__ */ e.jsx(
|
|
1238
|
+
"button",
|
|
1239
|
+
{
|
|
1240
|
+
className: "pk-btn pk-btn-primary",
|
|
1241
|
+
style: { fontSize: "1.25rem", padding: "1rem 2rem" },
|
|
1242
|
+
disabled: !u,
|
|
1243
|
+
onClick: () => o("selector"),
|
|
1244
|
+
children: "Continue to Seat Selection"
|
|
1245
|
+
}
|
|
1246
|
+
)
|
|
1247
|
+
] })
|
|
1248
|
+
] })
|
|
1249
|
+
] }), I = () => {
|
|
1250
|
+
const t = ["A", "B", "C", "D", "E", "V1", "V2"], a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
1251
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in pk-flex pk-flex-col pk-items-center", children: [
|
|
1252
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-w-full pk-flex pk-justify-between", style: { marginBottom: "2rem" }, children: [
|
|
1253
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", onClick: () => o("details"), children: "← Back" }),
|
|
1254
|
+
/* @__PURE__ */ e.jsxs("h2", { className: "pk-heading-md", children: [
|
|
1255
|
+
n.title,
|
|
1256
|
+
" - ",
|
|
1257
|
+
u
|
|
1258
|
+
] })
|
|
1259
|
+
] }),
|
|
1260
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { padding: "3rem", width: "100%", maxWidth: "800px" }, children: [
|
|
1261
|
+
/* @__PURE__ */ e.jsx("div", { style: { borderBottom: "6px solid var(--pk-primary-light)", paddingBottom: "1rem", textAlign: "center", marginBottom: "3rem", borderRadius: "50% 50% 0 0 / 20px 20px 0 0" }, children: /* @__PURE__ */ e.jsx("span", { className: "pk-text-muted", style: { letterSpacing: "0.5em", textTransform: "uppercase" }, children: "Screen" }) }),
|
|
1262
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-flex pk-flex-col pk-items-center pk-gap-4", children: t.map((i) => /* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-items-center", style: { gap: "0.5rem" }, children: [
|
|
1263
|
+
/* @__PURE__ */ e.jsx("span", { style: { width: "30px", textAlign: "center", fontWeight: "bold", color: "var(--pk-text-muted)" }, children: i }),
|
|
1264
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-flex", style: { gap: "0.5rem" }, children: a.map((f) => {
|
|
1265
|
+
const F = `${i}${f}`, w = h.includes(F), R = i.startsWith("V"), q = (i.charCodeAt(0) + f) % 7 === 0;
|
|
1266
|
+
return /* @__PURE__ */ e.jsx(
|
|
1267
|
+
"button",
|
|
1268
|
+
{
|
|
1269
|
+
disabled: q,
|
|
1270
|
+
style: {
|
|
1271
|
+
width: "40px",
|
|
1272
|
+
height: "40px",
|
|
1273
|
+
borderRadius: "8px 8px 4px 4px",
|
|
1274
|
+
border: "none",
|
|
1275
|
+
cursor: q ? "not-allowed" : "pointer",
|
|
1276
|
+
background: q ? "var(--pk-border)" : w ? "var(--pk-primary)" : R ? "#f59e0b" : "var(--pk-primary-light)",
|
|
1277
|
+
color: w ? "white" : "transparent",
|
|
1278
|
+
transition: "all 0.2s"
|
|
1279
|
+
},
|
|
1280
|
+
onClick: () => P(F),
|
|
1281
|
+
children: w ? "✓" : ""
|
|
1282
|
+
},
|
|
1283
|
+
F
|
|
1284
|
+
);
|
|
1285
|
+
}) }),
|
|
1286
|
+
/* @__PURE__ */ e.jsx("span", { style: { width: "30px" } })
|
|
1287
|
+
] }, i)) }),
|
|
1288
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-center", style: { marginTop: "3rem", gap: "2rem" }, children: [
|
|
1289
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-items-center pk-gap-4", children: [
|
|
1290
|
+
/* @__PURE__ */ e.jsx("div", { style: { width: 20, height: 20, background: "var(--pk-border)", borderRadius: "4px" } }),
|
|
1291
|
+
" Unavailable"
|
|
1292
|
+
] }),
|
|
1293
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-items-center pk-gap-4", style: { gap: "0.5rem" }, children: [
|
|
1294
|
+
/* @__PURE__ */ e.jsx("div", { style: { width: 20, height: 20, background: "var(--pk-primary-light)", borderRadius: "4px" } }),
|
|
1295
|
+
" Standard ($",
|
|
1296
|
+
te.pricing.standard,
|
|
1297
|
+
")"
|
|
1298
|
+
] }),
|
|
1299
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-items-center pk-gap-4", style: { gap: "0.5rem" }, children: [
|
|
1300
|
+
/* @__PURE__ */ e.jsx("div", { style: { width: 20, height: 20, background: "#f59e0b", borderRadius: "4px" } }),
|
|
1301
|
+
" VIP ($",
|
|
1302
|
+
te.pricing.vip,
|
|
1303
|
+
")"
|
|
1304
|
+
] })
|
|
1305
|
+
] })
|
|
1306
|
+
] }),
|
|
1307
|
+
h.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { position: "fixed", bottom: "2rem", width: "calc(100% - 4rem)", maxWidth: "800px", zIndex: 10, padding: "1.5rem", display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
1308
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1309
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-text-sm", children: [
|
|
1310
|
+
"Selected Seats: ",
|
|
1311
|
+
/* @__PURE__ */ e.jsx("span", { style: { fontWeight: 600 }, children: h.join(", ") })
|
|
1312
|
+
] }),
|
|
1313
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-heading-md", style: { color: "var(--pk-primary)" }, children: [
|
|
1314
|
+
"Total: $",
|
|
1315
|
+
S().toFixed(2)
|
|
1316
|
+
] })
|
|
1317
|
+
] }),
|
|
1318
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", style: { padding: "1rem 2rem", fontSize: "1.125rem" }, onClick: d, children: "Pay Now" })
|
|
1319
|
+
] })
|
|
1320
|
+
] });
|
|
1321
|
+
}, r = () => {
|
|
1322
|
+
const t = l[l.length - 1];
|
|
1323
|
+
return t ? /* @__PURE__ */ e.jsx("div", { className: "pk-container animate-fade-in pk-flex pk-justify-center pk-items-center", style: { minHeight: "80vh" }, children: /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { width: "100%", maxWidth: "600px", overflow: "hidden" }, children: [
|
|
1324
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-header", style: { background: "linear-gradient(135deg, var(--pk-primary), var(--pk-secondary))", color: "white", padding: "3rem 2rem", textAlign: "center" }, children: [
|
|
1325
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-lg", style: { marginBottom: "0.5rem" }, children: te.cinemaName }),
|
|
1326
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-body", style: { color: "rgba(255,255,255,0.8)" }, children: [
|
|
1327
|
+
"Admit ",
|
|
1328
|
+
t.seats.length
|
|
1329
|
+
] })
|
|
1330
|
+
] }),
|
|
1331
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-body", style: { padding: "3rem 2rem" }, children: [
|
|
1332
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-xl", style: { marginBottom: "1rem" }, children: t.movie.title }),
|
|
1333
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-grid", style: { gridTemplateColumns: "1fr 1fr", gap: "2rem", marginBottom: "2rem" }, children: [
|
|
1334
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1335
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-label pk-text-muted", children: "Date & Time" }),
|
|
1336
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-heading-md", children: [
|
|
1337
|
+
"Today, ",
|
|
1338
|
+
t.showtime
|
|
1339
|
+
] })
|
|
1340
|
+
] }),
|
|
1341
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1342
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-label pk-text-muted", children: "Seats" }),
|
|
1343
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-heading-md", style: { color: "var(--pk-primary)" }, children: t.seats.join(", ") })
|
|
1344
|
+
] }),
|
|
1345
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1346
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-label pk-text-muted", children: "Screen" }),
|
|
1347
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-heading-md", children: "IMAX 3" })
|
|
1348
|
+
] }),
|
|
1349
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1350
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-label pk-text-muted", children: "Booking ID" }),
|
|
1351
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-heading-md", children: t.id })
|
|
1352
|
+
] })
|
|
1353
|
+
] }),
|
|
1354
|
+
/* @__PURE__ */ e.jsx("div", { style: { borderTop: "2px dashed var(--pk-border)", paddingTop: "2rem", display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ e.jsx("div", { style: { height: "60px", width: "80%", background: "linear-gradient(90deg, black 0%, black 5%, transparent 5%, transparent 10%, black 10%, black 20%, transparent 20%, transparent 25%, black 25%, black 40%, transparent 40%, transparent 45%, black 45%, black 50%, transparent 50%, transparent 60%, black 60%, black 75%, transparent 75%, transparent 80%, black 80%, black 95%, transparent 95%, transparent 100%)" } }) })
|
|
1355
|
+
] }),
|
|
1356
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-footer pk-flex pk-justify-between", children: [
|
|
1357
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", onClick: () => o("grid"), children: "Home" }),
|
|
1358
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-secondary", onClick: () => window.print(), children: "Print Ticket" })
|
|
1359
|
+
] })
|
|
1360
|
+
] }) }) : null;
|
|
1361
|
+
};
|
|
1362
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { position: "relative", minHeight: "100vh" }, children: [
|
|
1363
|
+
g && /* @__PURE__ */ e.jsxs("div", { style: { position: "fixed", inset: 0, backgroundColor: "rgba(255,255,255,0.7)", zIndex: 100, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", backdropFilter: "blur(4px)" }, children: [
|
|
1364
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-skeleton", style: { width: "80px", height: "80px", borderRadius: "50%", marginBottom: "1rem" } }),
|
|
1365
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "Processing..." })
|
|
1366
|
+
] }),
|
|
1367
|
+
m === "grid" && b(),
|
|
1368
|
+
m === "details" && M(),
|
|
1369
|
+
m === "selector" && I(),
|
|
1370
|
+
m === "ticket" && r(),
|
|
1371
|
+
/* @__PURE__ */ e.jsx(C, {})
|
|
1372
|
+
] });
|
|
1373
|
+
}
|
|
1374
|
+
const Z = {
|
|
1375
|
+
currentUser: {
|
|
1376
|
+
id: "me",
|
|
1377
|
+
name: "Alex Designer",
|
|
1378
|
+
avatar: "https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?auto=format&fit=crop&w=150&q=80"
|
|
1379
|
+
},
|
|
1380
|
+
conversations: [
|
|
1381
|
+
{
|
|
1382
|
+
id: "c1",
|
|
1383
|
+
contact: {
|
|
1384
|
+
id: "u1",
|
|
1385
|
+
name: "Sarah Engineering",
|
|
1386
|
+
avatar: "https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&w=150&q=80",
|
|
1387
|
+
status: "online"
|
|
1388
|
+
},
|
|
1389
|
+
messages: [
|
|
1390
|
+
{ id: "m1", senderId: "u1", text: "Hey! Did you get a chance to look at the new PopSite UI designs?", timestamp: "10:05 AM" },
|
|
1391
|
+
{ id: "m2", senderId: "me", text: "Yes! They look absolutely stunning. The glassmorphism is on point.", timestamp: "10:12 AM" },
|
|
1392
|
+
{ id: "m3", senderId: "u1", text: "Awesome! We should deploy the new modules by tomorrow.", timestamp: "10:14 AM" }
|
|
1393
|
+
],
|
|
1394
|
+
unread: 0
|
|
1395
|
+
},
|
|
1396
|
+
{
|
|
1397
|
+
id: "c2",
|
|
1398
|
+
contact: {
|
|
1399
|
+
id: "u2",
|
|
1400
|
+
name: "PopSite AI Assistant",
|
|
1401
|
+
avatar: "https://images.unsplash.com/photo-1531746020798-e6953c6e8e04?auto=format&fit=crop&w=150&q=80",
|
|
1402
|
+
status: "online"
|
|
1403
|
+
},
|
|
1404
|
+
messages: [
|
|
1405
|
+
{ id: "m1", senderId: "u2", text: "Hello! I'm your virtual UI assistant. How can I help you today?", timestamp: "09:00 AM" }
|
|
1406
|
+
],
|
|
1407
|
+
unread: 1
|
|
1408
|
+
},
|
|
1409
|
+
{
|
|
1410
|
+
id: "c3",
|
|
1411
|
+
contact: {
|
|
1412
|
+
id: "u3",
|
|
1413
|
+
name: "Marketing Team",
|
|
1414
|
+
avatar: "https://images.unsplash.com/photo-1522071820081-009f0129c71c?auto=format&fit=crop&w=150&q=80",
|
|
1415
|
+
status: "offline"
|
|
1416
|
+
},
|
|
1417
|
+
messages: [
|
|
1418
|
+
{ id: "m1", senderId: "u3", text: "The new campaign numbers are looking good.", timestamp: "Yesterday" }
|
|
1419
|
+
],
|
|
1420
|
+
unread: 0
|
|
1421
|
+
}
|
|
1422
|
+
],
|
|
1423
|
+
autoReplies: [
|
|
1424
|
+
"That sounds great!",
|
|
1425
|
+
"I completely agree. Let's make it happen.",
|
|
1426
|
+
"Could you clarify that a bit more?",
|
|
1427
|
+
"Fascinating! The possibilities are endless.",
|
|
1428
|
+
"I've updated the system parameters accordingly.",
|
|
1429
|
+
"Let me think about that for a second..."
|
|
1430
|
+
]
|
|
1431
|
+
};
|
|
1432
|
+
function Ft() {
|
|
1433
|
+
var I;
|
|
1434
|
+
const [m, o] = p(Z.conversations), [n, j] = p(((I = Z.conversations[0]) == null ? void 0 : I.id) || null), [u, N] = p(""), [h, A] = p(""), [l, T] = p(!1), [x, k] = p(!1), [g, W] = p(!1), y = Bt(null), { showToast: C, ToastContainer: B } = G(), D = m.find((r) => r.id === n);
|
|
1435
|
+
$(() => {
|
|
1436
|
+
const r = localStorage.getItem("popsite_chats");
|
|
1437
|
+
if (r)
|
|
1438
|
+
try {
|
|
1439
|
+
o(JSON.parse(r));
|
|
1440
|
+
} catch {
|
|
1441
|
+
}
|
|
1442
|
+
}, []), $(() => {
|
|
1443
|
+
localStorage.setItem("popsite_chats", JSON.stringify(m));
|
|
1444
|
+
}, [m]), $(() => {
|
|
1445
|
+
y.current && y.current.scrollIntoView({ behavior: "smooth" });
|
|
1446
|
+
}, [D == null ? void 0 : D.messages, l]);
|
|
1447
|
+
const P = (r, t = 1500) => {
|
|
1448
|
+
W(!0), setTimeout(() => {
|
|
1449
|
+
W(!1), r();
|
|
1450
|
+
}, t);
|
|
1451
|
+
}, S = (r) => {
|
|
1452
|
+
if (r.preventDefault(), !u.trim() || !D) return;
|
|
1453
|
+
const t = {
|
|
1454
|
+
id: `msg-${Date.now()}`,
|
|
1455
|
+
senderId: Z.currentUser.id,
|
|
1456
|
+
text: u.trim(),
|
|
1457
|
+
timestamp: (/* @__PURE__ */ new Date()).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })
|
|
1458
|
+
}, a = m.map(
|
|
1459
|
+
(i) => i.id === n ? { ...i, messages: [...i.messages, t], unread: 0 } : i
|
|
1460
|
+
);
|
|
1461
|
+
o(a), N(""), T(!0), setTimeout(() => {
|
|
1462
|
+
T(!1);
|
|
1463
|
+
const i = Z.autoReplies, f = i[Math.floor(Math.random() * i.length)], F = {
|
|
1464
|
+
id: `msg-bot-${Date.now()}`,
|
|
1465
|
+
senderId: D.contact.id,
|
|
1466
|
+
text: f,
|
|
1467
|
+
timestamp: (/* @__PURE__ */ new Date()).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })
|
|
1468
|
+
};
|
|
1469
|
+
o((w) => w.map(
|
|
1470
|
+
(R) => R.id === n ? { ...R, messages: [...R.messages, F] } : R
|
|
1471
|
+
)), Math.random() > 0.5 && C(`New message from ${D.contact.name}`, "info");
|
|
1472
|
+
}, 2e3);
|
|
1473
|
+
}, d = (r) => {
|
|
1474
|
+
o((t) => t.map((a) => a.id === r ? { ...a, unread: 0 } : a)), j(r), k(!1);
|
|
1475
|
+
}, b = () => {
|
|
1476
|
+
P(() => {
|
|
1477
|
+
C("Profile updated successfully", "success"), k(!1);
|
|
1478
|
+
});
|
|
1479
|
+
}, M = m.filter(
|
|
1480
|
+
(r) => r.contact.name.toLowerCase().includes(h.toLowerCase())
|
|
1481
|
+
);
|
|
1482
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-flex animate-fade-in", style: { height: "100vh", backgroundColor: "var(--pk-bg-main)", overflow: "hidden" }, children: [
|
|
1483
|
+
g && /* @__PURE__ */ e.jsxs("div", { style: { position: "fixed", inset: 0, backgroundColor: "rgba(255,255,255,0.7)", zIndex: 100, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", backdropFilter: "blur(4px)" }, children: [
|
|
1484
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-skeleton", style: { width: "80px", height: "80px", borderRadius: "50%", marginBottom: "1rem" } }),
|
|
1485
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "Processing..." })
|
|
1486
|
+
] }),
|
|
1487
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { width: "350px", height: "100%", borderRadius: 0, borderRight: "1px solid var(--pk-border)", display: "flex", flexDirection: "column", zIndex: 10 }, children: [
|
|
1488
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-header pk-flex pk-justify-between pk-items-center", style: { padding: "1.5rem", background: "var(--pk-bg-glass)", backdropFilter: "blur(10px)" }, children: [
|
|
1489
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-items-center pk-gap-4", style: { cursor: "pointer" }, onClick: () => k(!0), children: [
|
|
1490
|
+
/* @__PURE__ */ e.jsx(
|
|
1491
|
+
"img",
|
|
1492
|
+
{
|
|
1493
|
+
src: Z.currentUser.avatar,
|
|
1494
|
+
alt: "Me",
|
|
1495
|
+
style: { width: "40px", height: "40px", borderRadius: "50%", objectFit: "cover" },
|
|
1496
|
+
onError: (r) => {
|
|
1497
|
+
r.target.style.display = "none", r.target.nextSibling.style.display = "flex";
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
),
|
|
1501
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "none", width: "40px", height: "40px", background: "var(--pk-primary)", color: "white", alignItems: "center", justifyContent: "center", borderRadius: "50%", fontWeight: "bold" }, children: "ME" }),
|
|
1502
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1503
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-label", children: Z.currentUser.name }),
|
|
1504
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-sm", style: { color: "var(--pk-success)" }, children: "● Online" })
|
|
1505
|
+
] })
|
|
1506
|
+
] }),
|
|
1507
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { padding: "0.5rem", borderRadius: "50%" }, children: "+ 💬" })
|
|
1508
|
+
] }),
|
|
1509
|
+
/* @__PURE__ */ e.jsx("div", { style: { padding: "1rem" }, children: /* @__PURE__ */ e.jsx(
|
|
1510
|
+
"input",
|
|
1511
|
+
{
|
|
1512
|
+
type: "text",
|
|
1513
|
+
className: "pk-input pk-w-full",
|
|
1514
|
+
placeholder: "Search conversations...",
|
|
1515
|
+
value: h,
|
|
1516
|
+
onChange: (r) => A(r.target.value)
|
|
1517
|
+
}
|
|
1518
|
+
) }),
|
|
1519
|
+
/* @__PURE__ */ e.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: M.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "pk-empty-state", style: { padding: "2rem", border: "none" }, children: /* @__PURE__ */ e.jsx("div", { className: "pk-text-sm", children: "No chats found." }) }) : M.map((r) => {
|
|
1520
|
+
var t;
|
|
1521
|
+
return /* @__PURE__ */ e.jsxs(
|
|
1522
|
+
"div",
|
|
1523
|
+
{
|
|
1524
|
+
className: `pk-flex pk-items-center pk-gap-4 ${n === r.id ? "pk-bg-glass" : ""}`,
|
|
1525
|
+
style: { padding: "1rem 1.5rem", cursor: "pointer", borderBottom: "1px solid var(--pk-border)", transition: "background 0.2s", background: n === r.id ? "var(--pk-primary-light)" : "transparent" },
|
|
1526
|
+
onClick: () => d(r.id),
|
|
1527
|
+
children: [
|
|
1528
|
+
/* @__PURE__ */ e.jsxs("div", { style: { position: "relative" }, children: [
|
|
1529
|
+
/* @__PURE__ */ e.jsx(
|
|
1530
|
+
"img",
|
|
1531
|
+
{
|
|
1532
|
+
src: r.contact.avatar,
|
|
1533
|
+
alt: "",
|
|
1534
|
+
style: { width: "50px", height: "50px", borderRadius: "50%", objectFit: "cover" },
|
|
1535
|
+
onError: (a) => {
|
|
1536
|
+
a.target.style.display = "none", a.target.nextSibling.style.display = "flex";
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
),
|
|
1540
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "none", width: "50px", height: "50px", background: "var(--pk-secondary)", color: "white", alignItems: "center", justifyContent: "center", borderRadius: "50%", fontWeight: "bold" }, children: r.contact.name[0] }),
|
|
1541
|
+
/* @__PURE__ */ e.jsx("div", { style: { position: "absolute", bottom: 2, right: 2, width: 12, height: 12, borderRadius: "50%", background: r.contact.status === "online" ? "var(--pk-success)" : "var(--pk-text-muted)", border: "2px solid white" } })
|
|
1542
|
+
] }),
|
|
1543
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: 1, overflow: "hidden" }, children: [
|
|
1544
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between pk-items-center", children: [
|
|
1545
|
+
/* @__PURE__ */ e.jsx("h4", { className: "pk-label", style: { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: r.contact.name }),
|
|
1546
|
+
r.messages.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "pk-text-sm", style: { fontSize: "0.75rem" }, children: r.messages[r.messages.length - 1].timestamp })
|
|
1547
|
+
] }),
|
|
1548
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between pk-items-center", children: [
|
|
1549
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-sm", style: { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", fontWeight: r.unread > 0 ? 600 : 400, color: r.unread > 0 ? "var(--pk-text-main)" : "var(--pk-text-muted)" }, children: ((t = r.messages[r.messages.length - 1]) == null ? void 0 : t.text) || "No messages yet." }),
|
|
1550
|
+
r.unread > 0 && /* @__PURE__ */ e.jsx("span", { className: "pk-badge", style: { background: "var(--pk-primary)", color: "white", minWidth: "20px", textAlign: "center" }, children: r.unread })
|
|
1551
|
+
] })
|
|
1552
|
+
] })
|
|
1553
|
+
]
|
|
1554
|
+
},
|
|
1555
|
+
r.id
|
|
1556
|
+
);
|
|
1557
|
+
}) })
|
|
1558
|
+
] }),
|
|
1559
|
+
/* @__PURE__ */ e.jsx("div", { style: { flex: 1, display: "flex", flexDirection: "column", backgroundColor: "var(--pk-bg-main)", position: "relative" }, children: x ? /* @__PURE__ */ e.jsx("div", { className: "pk-container", style: { flex: 1, display: "flex", justifyContent: "center", alignItems: "center" }, children: /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { width: "100%", maxWidth: "500px", padding: "3rem" }, children: [
|
|
1560
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", style: { marginBottom: "2rem", textAlign: "center" }, children: "My Profile" }),
|
|
1561
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-flex pk-justify-center", style: { marginBottom: "2rem" }, children: /* @__PURE__ */ e.jsx("img", { src: Z.currentUser.avatar, alt: "Profile", style: { width: "120px", height: "120px", borderRadius: "50%", boxShadow: "var(--pk-shadow-md)" } }) }),
|
|
1562
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", children: [
|
|
1563
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Display Name" }),
|
|
1564
|
+
/* @__PURE__ */ e.jsx("input", { type: "text", className: "pk-input", defaultValue: Z.currentUser.name })
|
|
1565
|
+
] }),
|
|
1566
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", children: [
|
|
1567
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Status Message" }),
|
|
1568
|
+
/* @__PURE__ */ e.jsx("input", { type: "text", className: "pk-input", defaultValue: "Building great UIs! 💻" })
|
|
1569
|
+
] }),
|
|
1570
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between", style: { marginTop: "2rem" }, children: [
|
|
1571
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", onClick: () => k(!1), children: "Cancel" }),
|
|
1572
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", onClick: b, children: "Save Changes" })
|
|
1573
|
+
] })
|
|
1574
|
+
] }) }) : D ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1575
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { borderRadius: 0, padding: "1rem 2rem", display: "flex", alignItems: "center", gap: "1rem", borderBottom: "1px solid var(--pk-border)", zIndex: 5 }, children: [
|
|
1576
|
+
/* @__PURE__ */ e.jsx("img", { src: D.contact.avatar, alt: "", style: { width: "40px", height: "40px", borderRadius: "50%" } }),
|
|
1577
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1578
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { fontSize: "1.25rem" }, children: D.contact.name }),
|
|
1579
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-sm", children: D.contact.status === "online" ? "Active Now" : "Offline" })
|
|
1580
|
+
] })
|
|
1581
|
+
] }),
|
|
1582
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: 1, padding: "2rem", overflowY: "auto", display: "flex", flexDirection: "column", gap: "1.5rem", background: 'linear-gradient(rgba(248, 250, 252, 0.9), rgba(248, 250, 252, 0.9)), url("https://www.transparenttextures.com/patterns/cubes.png")' }, children: [
|
|
1583
|
+
D.messages.length === 0 && /* @__PURE__ */ e.jsx("div", { className: "pk-empty-state", style: { margin: "auto", border: "none", background: "transparent" }, children: "Say Hello 👋" }),
|
|
1584
|
+
D.messages.map((r) => {
|
|
1585
|
+
const t = r.senderId === Z.currentUser.id;
|
|
1586
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-flex", style: { justifyContent: t ? "flex-end" : "flex-start" }, children: [
|
|
1587
|
+
!t && /* @__PURE__ */ e.jsx("img", { src: D.contact.avatar, alt: "", style: { width: "32px", height: "32px", borderRadius: "50%", marginRight: "0.75rem", alignSelf: "flex-end" } }),
|
|
1588
|
+
/* @__PURE__ */ e.jsxs("div", { style: { maxWidth: "70%" }, children: [
|
|
1589
|
+
/* @__PURE__ */ e.jsx("div", { style: {
|
|
1590
|
+
padding: "1rem 1.25rem",
|
|
1591
|
+
background: t ? "linear-gradient(135deg, var(--pk-primary), var(--pk-primary-hover))" : "var(--pk-bg-card)",
|
|
1592
|
+
color: t ? "white" : "var(--pk-text-main)",
|
|
1593
|
+
borderRadius: t ? "16px 16px 4px 16px" : "16px 16px 16px 4px",
|
|
1594
|
+
boxShadow: "var(--pk-shadow-md)"
|
|
1595
|
+
}, children: r.text }),
|
|
1596
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-text-sm", style: { marginTop: "0.25rem", textAlign: t ? "right" : "left", fontSize: "0.75rem" }, children: r.timestamp })
|
|
1597
|
+
] })
|
|
1598
|
+
] }, r.id);
|
|
1599
|
+
}),
|
|
1600
|
+
l && /* @__PURE__ */ e.jsxs("div", { className: "pk-flex", style: { justifyContent: "flex-start" }, children: [
|
|
1601
|
+
/* @__PURE__ */ e.jsx("img", { src: D.contact.avatar, alt: "", style: { width: "32px", height: "32px", borderRadius: "50%", marginRight: "0.75rem", alignSelf: "flex-end" } }),
|
|
1602
|
+
/* @__PURE__ */ e.jsxs("div", { style: { padding: "1rem", background: "var(--pk-bg-card)", borderRadius: "16px 16px 16px 4px", boxShadow: "var(--pk-shadow-sm)", display: "flex", gap: "4px" }, children: [
|
|
1603
|
+
/* @__PURE__ */ e.jsx("span", { className: "typing-dot" }),
|
|
1604
|
+
/* @__PURE__ */ e.jsx("span", { className: "typing-dot", style: { animationDelay: "0.2s" } }),
|
|
1605
|
+
/* @__PURE__ */ e.jsx("span", { className: "typing-dot", style: { animationDelay: "0.4s" } })
|
|
1606
|
+
] })
|
|
1607
|
+
] }),
|
|
1608
|
+
/* @__PURE__ */ e.jsx("div", { ref: y })
|
|
1609
|
+
] }),
|
|
1610
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-card", style: { borderRadius: 0, padding: "1.5rem", borderTop: "1px solid var(--pk-border)" }, children: /* @__PURE__ */ e.jsxs("form", { onSubmit: S, className: "pk-flex pk-gap-4 pk-items-center", children: [
|
|
1611
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "pk-btn pk-btn-outline", style: { borderRadius: "50%", padding: "0.75rem" }, children: "📎" }),
|
|
1612
|
+
/* @__PURE__ */ e.jsx(
|
|
1613
|
+
"input",
|
|
1614
|
+
{
|
|
1615
|
+
type: "text",
|
|
1616
|
+
className: "pk-input",
|
|
1617
|
+
style: { flex: 1, borderRadius: "var(--pk-radius-full)", padding: "1rem 1.5rem" },
|
|
1618
|
+
placeholder: "Type your message...",
|
|
1619
|
+
value: u,
|
|
1620
|
+
onChange: (r) => N(r.target.value)
|
|
1621
|
+
}
|
|
1622
|
+
),
|
|
1623
|
+
/* @__PURE__ */ e.jsx("button", { type: "submit", className: "pk-btn pk-btn-primary", style: { borderRadius: "50%", padding: "0.75rem", aspectRatio: "1", width: "50px" }, children: "➤" })
|
|
1624
|
+
] }) })
|
|
1625
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "pk-flex pk-items-center pk-justify-center", style: { flex: 1 }, children: /* @__PURE__ */ e.jsxs("div", { className: "pk-empty-state", style: { border: "none", background: "transparent" }, children: [
|
|
1626
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-empty-icon", style: { fontSize: "5rem" }, children: "💬" }),
|
|
1627
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "Welcome to PopSite Messages" }),
|
|
1628
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: "Select a conversation from the sidebar to begin." })
|
|
1629
|
+
] }) }) }),
|
|
1630
|
+
/* @__PURE__ */ e.jsx("style", { children: `
|
|
1631
|
+
.typing-dot { width: 8px; height: 8px; background-color: var(--pk-text-muted); border-radius: 50%; opacity: 0.5; animation: typingBounce 1.4s infinite ease-in-out; }
|
|
1632
|
+
@keyframes typingBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
|
|
1633
|
+
` }),
|
|
1634
|
+
/* @__PURE__ */ e.jsx(B, {})
|
|
1635
|
+
] });
|
|
1636
|
+
}
|
|
1637
|
+
const X = {
|
|
1638
|
+
airlineName: "Skyward Wings",
|
|
1639
|
+
airports: ["JFK (New York)", "LAX (Los Angeles)", "LHR (London)", "HND (Tokyo)", "SYD (Sydney)", "DXB (Dubai)"],
|
|
1640
|
+
flights: [
|
|
1641
|
+
{
|
|
1642
|
+
id: "f1",
|
|
1643
|
+
flightNumber: "SW-402",
|
|
1644
|
+
from: "JFK (New York)",
|
|
1645
|
+
to: "LHR (London)",
|
|
1646
|
+
departureTime: "08:00 AM",
|
|
1647
|
+
arrivalTime: "08:00 PM",
|
|
1648
|
+
duration: "7h 00m",
|
|
1649
|
+
price: 450,
|
|
1650
|
+
businessPrice: 1200,
|
|
1651
|
+
image: "https://images.unsplash.com/photo-1436491865332-7a61a109cc05?auto=format&fit=crop&w=800&q=80"
|
|
1652
|
+
},
|
|
1653
|
+
{
|
|
1654
|
+
id: "f2",
|
|
1655
|
+
flightNumber: "SW-819",
|
|
1656
|
+
from: "LAX (Los Angeles)",
|
|
1657
|
+
to: "HND (Tokyo)",
|
|
1658
|
+
departureTime: "11:30 AM",
|
|
1659
|
+
arrivalTime: "03:15 PM (+1)",
|
|
1660
|
+
duration: "11h 45m",
|
|
1661
|
+
price: 780,
|
|
1662
|
+
businessPrice: 2100,
|
|
1663
|
+
image: "https://images.unsplash.com/photo-1542296332-2e4473faf563?auto=format&fit=crop&w=800&q=80"
|
|
1664
|
+
},
|
|
1665
|
+
{
|
|
1666
|
+
id: "f3",
|
|
1667
|
+
flightNumber: "SW-211",
|
|
1668
|
+
from: "LHR (London)",
|
|
1669
|
+
to: "DXB (Dubai)",
|
|
1670
|
+
departureTime: "10:15 PM",
|
|
1671
|
+
arrivalTime: "08:10 AM (+1)",
|
|
1672
|
+
duration: "6h 55m",
|
|
1673
|
+
price: 320,
|
|
1674
|
+
businessPrice: 850,
|
|
1675
|
+
image: "https://images.unsplash.com/photo-1512453979798-5ea266f8880c?auto=format&fit=crop&w=800&q=80"
|
|
1676
|
+
},
|
|
1677
|
+
{
|
|
1678
|
+
id: "f4",
|
|
1679
|
+
flightNumber: "SW-505",
|
|
1680
|
+
from: "JFK (New York)",
|
|
1681
|
+
to: "LAX (Los Angeles)",
|
|
1682
|
+
departureTime: "06:00 AM",
|
|
1683
|
+
arrivalTime: "09:15 AM",
|
|
1684
|
+
duration: "6h 15m",
|
|
1685
|
+
price: 199,
|
|
1686
|
+
businessPrice: 600,
|
|
1687
|
+
image: "https://images.unsplash.com/photo-1499591934245-40b55745b905?auto=format&fit=crop&w=800&q=80"
|
|
1688
|
+
}
|
|
1689
|
+
],
|
|
1690
|
+
addOns: {
|
|
1691
|
+
checkedBag: 50
|
|
1692
|
+
}
|
|
1693
|
+
};
|
|
1694
|
+
function Wt() {
|
|
1695
|
+
const [m, o] = p("search"), [n, j] = p({
|
|
1696
|
+
from: X.airports[0],
|
|
1697
|
+
to: X.airports[1],
|
|
1698
|
+
date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
1699
|
+
passengers: 1
|
|
1700
|
+
}), [u, N] = p(null), [h, A] = p("economy"), [l, T] = p(0), [x, k] = p({ firstName: "", lastName: "", passport: "" }), [g, W] = p(null), [y, C] = p(!1), { showToast: B, ToastContainer: D } = G();
|
|
1701
|
+
$(() => {
|
|
1702
|
+
const i = localStorage.getItem("popsite_flight");
|
|
1703
|
+
if (i)
|
|
1704
|
+
try {
|
|
1705
|
+
W(JSON.parse(i));
|
|
1706
|
+
} catch {
|
|
1707
|
+
}
|
|
1708
|
+
}, []), $(() => {
|
|
1709
|
+
g && localStorage.setItem("popsite_flight", JSON.stringify(g));
|
|
1710
|
+
}, [g]);
|
|
1711
|
+
const P = (i, f = 1500) => {
|
|
1712
|
+
C(!0), setTimeout(() => {
|
|
1713
|
+
C(!1), i();
|
|
1714
|
+
}, f);
|
|
1715
|
+
}, S = (i) => {
|
|
1716
|
+
if (i.preventDefault(), n.from === n.to) {
|
|
1717
|
+
B("Destination cannot be the same as origin", "error");
|
|
1718
|
+
return;
|
|
1719
|
+
}
|
|
1720
|
+
P(() => {
|
|
1721
|
+
o("results"), B("Flights loaded successfully", "success");
|
|
1722
|
+
});
|
|
1723
|
+
}, d = (i) => {
|
|
1724
|
+
N(i), o("passenger");
|
|
1725
|
+
}, b = () => {
|
|
1726
|
+
if (!u) return 0;
|
|
1727
|
+
const i = h === "business" ? u.businessPrice : u.price, f = l * X.addOns.checkedBag;
|
|
1728
|
+
return i * n.passengers + f;
|
|
1729
|
+
}, M = (i) => {
|
|
1730
|
+
if (i.preventDefault(), !x.firstName || !x.lastName || !x.passport) {
|
|
1731
|
+
B("Please fill out all passenger details", "error");
|
|
1732
|
+
return;
|
|
1733
|
+
}
|
|
1734
|
+
P(() => {
|
|
1735
|
+
const f = {
|
|
1736
|
+
bookingRef: `PNR${Math.random().toString(36).substring(2, 8).toUpperCase()}`,
|
|
1737
|
+
flight: u,
|
|
1738
|
+
seatClass: h,
|
|
1739
|
+
baggage: l,
|
|
1740
|
+
passenger: x,
|
|
1741
|
+
date: n.date,
|
|
1742
|
+
total: b()
|
|
1743
|
+
};
|
|
1744
|
+
W(f), o("pass"), B("Booking confirmed!", "success");
|
|
1745
|
+
}, 2e3);
|
|
1746
|
+
}, I = () => /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", minHeight: "80vh" }, children: [
|
|
1747
|
+
/* @__PURE__ */ e.jsxs("div", { style: { textAlign: "center", marginBottom: "3rem" }, children: [
|
|
1748
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", style: { marginBottom: "1rem" }, children: X.airlineName }),
|
|
1749
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { fontSize: "1.25rem" }, children: "Where will your next adventure take you?" })
|
|
1750
|
+
] }),
|
|
1751
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-card pk-glass", style: { width: "100%", maxWidth: "900px", padding: "3rem" }, children: /* @__PURE__ */ e.jsxs("form", { onSubmit: S, className: "pk-grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(200px, 1fr))", gap: "1.5rem", alignItems: "end" }, children: [
|
|
1752
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", style: { margin: 0 }, children: [
|
|
1753
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "From" }),
|
|
1754
|
+
/* @__PURE__ */ e.jsx(
|
|
1755
|
+
"select",
|
|
1756
|
+
{
|
|
1757
|
+
className: "pk-input",
|
|
1758
|
+
value: n.from,
|
|
1759
|
+
onChange: (i) => j({ ...n, from: i.target.value }),
|
|
1760
|
+
children: X.airports.map((i) => /* @__PURE__ */ e.jsx("option", { value: i, children: i }, i))
|
|
1761
|
+
}
|
|
1762
|
+
)
|
|
1763
|
+
] }),
|
|
1764
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", style: { margin: 0 }, children: [
|
|
1765
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "To" }),
|
|
1766
|
+
/* @__PURE__ */ e.jsx(
|
|
1767
|
+
"select",
|
|
1768
|
+
{
|
|
1769
|
+
className: "pk-input",
|
|
1770
|
+
value: n.to,
|
|
1771
|
+
onChange: (i) => j({ ...n, to: i.target.value }),
|
|
1772
|
+
children: X.airports.map((i) => /* @__PURE__ */ e.jsx("option", { value: i, children: i }, i))
|
|
1773
|
+
}
|
|
1774
|
+
)
|
|
1775
|
+
] }),
|
|
1776
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", style: { margin: 0 }, children: [
|
|
1777
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Departure Date" }),
|
|
1778
|
+
/* @__PURE__ */ e.jsx(
|
|
1779
|
+
"input",
|
|
1780
|
+
{
|
|
1781
|
+
type: "date",
|
|
1782
|
+
className: "pk-input",
|
|
1783
|
+
value: n.date,
|
|
1784
|
+
onChange: (i) => j({ ...n, date: i.target.value })
|
|
1785
|
+
}
|
|
1786
|
+
)
|
|
1787
|
+
] }),
|
|
1788
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", style: { margin: 0 }, children: [
|
|
1789
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Passengers" }),
|
|
1790
|
+
/* @__PURE__ */ e.jsx(
|
|
1791
|
+
"input",
|
|
1792
|
+
{
|
|
1793
|
+
type: "number",
|
|
1794
|
+
min: "1",
|
|
1795
|
+
max: "9",
|
|
1796
|
+
className: "pk-input",
|
|
1797
|
+
value: n.passengers,
|
|
1798
|
+
onChange: (i) => j({ ...n, passengers: parseInt(i.target.value) || 1 })
|
|
1799
|
+
}
|
|
1800
|
+
)
|
|
1801
|
+
] }),
|
|
1802
|
+
/* @__PURE__ */ e.jsx("button", { type: "submit", className: "pk-btn pk-btn-primary", style: { padding: "1.25rem", height: "100%" }, children: "Search Flights" })
|
|
1803
|
+
] }) }),
|
|
1804
|
+
g && /* @__PURE__ */ e.jsxs("button", { className: "pk-btn pk-btn-outline", style: { marginTop: "2rem" }, onClick: () => o("pass"), children: [
|
|
1805
|
+
"View Upcoming Trip (",
|
|
1806
|
+
g.bookingRef,
|
|
1807
|
+
")"
|
|
1808
|
+
] })
|
|
1809
|
+
] }), r = () => {
|
|
1810
|
+
const i = X.flights.filter(
|
|
1811
|
+
(f) => f.from.includes(n.from.split(" ")[0]) || f.to.includes(n.to.split(" ")[0]) || !0
|
|
1812
|
+
// Just return all so demo looks populated
|
|
1813
|
+
);
|
|
1814
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", children: [
|
|
1815
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between pk-items-center", style: { marginBottom: "2rem" }, children: [
|
|
1816
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1817
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", children: "Select Departure Flight" }),
|
|
1818
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-body", children: [
|
|
1819
|
+
n.from,
|
|
1820
|
+
" → ",
|
|
1821
|
+
n.to,
|
|
1822
|
+
" | ",
|
|
1823
|
+
n.date,
|
|
1824
|
+
" | ",
|
|
1825
|
+
n.passengers,
|
|
1826
|
+
" Passenger(s)"
|
|
1827
|
+
] })
|
|
1828
|
+
] }),
|
|
1829
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", onClick: () => o("search"), children: "Edit Search" })
|
|
1830
|
+
] }),
|
|
1831
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-flex pk-flex-col pk-gap-6", children: i.map((f) => /* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-card-interactive", style: { padding: "2rem", display: "flex", flexWrap: "wrap", gap: "2rem", alignItems: "center" }, children: [
|
|
1832
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: "1 1 300px" }, children: [
|
|
1833
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between pk-items-center", style: { marginBottom: "1rem" }, children: [
|
|
1834
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-badge", children: f.flightNumber }),
|
|
1835
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-sm", style: { color: "var(--pk-primary)", fontWeight: 600 }, children: f.duration })
|
|
1836
|
+
] }),
|
|
1837
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between pk-items-center", children: [
|
|
1838
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-text-center", children: [
|
|
1839
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: f.departureTime }),
|
|
1840
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-muted", children: f.from.split(" ")[0] })
|
|
1841
|
+
] }),
|
|
1842
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: 1, margin: "0 1rem", display: "flex", alignItems: "center", justifyItems: "center" }, children: [
|
|
1843
|
+
/* @__PURE__ */ e.jsx("div", { style: { height: "2px", background: "var(--pk-border)", flex: 1 } }),
|
|
1844
|
+
/* @__PURE__ */ e.jsx("span", { style: { margin: "0 1rem", fontSize: "1.5rem", opacity: 0.5 }, children: "✈️" }),
|
|
1845
|
+
/* @__PURE__ */ e.jsx("div", { style: { height: "2px", background: "var(--pk-border)", flex: 1 } })
|
|
1846
|
+
] }),
|
|
1847
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-text-center", children: [
|
|
1848
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: f.arrivalTime }),
|
|
1849
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-muted", children: f.to.split(" ")[0] })
|
|
1850
|
+
] })
|
|
1851
|
+
] })
|
|
1852
|
+
] }),
|
|
1853
|
+
/* @__PURE__ */ e.jsx("div", { style: { width: "1px", background: "var(--pk-border)", height: "100px", alignSelf: "stretch" }, className: "pk-hidden-mobile" }),
|
|
1854
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: "0 0 auto", display: "flex", flexDirection: "column", gap: "1rem", minWidth: "150px" }, children: [
|
|
1855
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-text-center", children: [
|
|
1856
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-sm pk-text-muted", children: "Economy from" }),
|
|
1857
|
+
/* @__PURE__ */ e.jsxs("h3", { className: "pk-heading-lg", style: { color: "var(--pk-secondary)" }, children: [
|
|
1858
|
+
"$",
|
|
1859
|
+
f.price
|
|
1860
|
+
] })
|
|
1861
|
+
] }),
|
|
1862
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", onClick: () => {
|
|
1863
|
+
A("economy"), d(f);
|
|
1864
|
+
}, children: "Select Economy" })
|
|
1865
|
+
] }),
|
|
1866
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: "0 0 auto", display: "flex", flexDirection: "column", gap: "1rem", minWidth: "150px" }, children: [
|
|
1867
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-text-center", children: [
|
|
1868
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-sm pk-text-muted", children: "Business from" }),
|
|
1869
|
+
/* @__PURE__ */ e.jsxs("h3", { className: "pk-heading-lg", style: { color: "var(--pk-primary)" }, children: [
|
|
1870
|
+
"$",
|
|
1871
|
+
f.businessPrice
|
|
1872
|
+
] })
|
|
1873
|
+
] }),
|
|
1874
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", onClick: () => {
|
|
1875
|
+
A("business"), d(f);
|
|
1876
|
+
}, children: "Select Business" })
|
|
1877
|
+
] })
|
|
1878
|
+
] }, f.id)) })
|
|
1879
|
+
] });
|
|
1880
|
+
}, t = () => /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", children: [
|
|
1881
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { marginBottom: "2rem" }, onClick: () => o("results"), children: "← Back to Flights" }),
|
|
1882
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-grid", style: { gridTemplateColumns: "minmax(300px, 2fr) minmax(300px, 1fr)" }, children: [
|
|
1883
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-flex-col pk-gap-6", children: [
|
|
1884
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { padding: "2rem" }, children: [
|
|
1885
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-md", style: { marginBottom: "1.5rem", borderBottom: "1px solid var(--pk-border)", paddingBottom: "0.5rem" }, children: "Primary Passenger" }),
|
|
1886
|
+
/* @__PURE__ */ e.jsxs("form", { onSubmit: M, id: "booking-form", children: [
|
|
1887
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-grid", style: { gridTemplateColumns: "1fr 1fr" }, children: [
|
|
1888
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", children: [
|
|
1889
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "First Name" }),
|
|
1890
|
+
/* @__PURE__ */ e.jsx("input", { type: "text", className: "pk-input", value: x.firstName, onChange: (i) => k({ ...x, firstName: i.target.value }), required: !0 })
|
|
1891
|
+
] }),
|
|
1892
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", children: [
|
|
1893
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Last Name" }),
|
|
1894
|
+
/* @__PURE__ */ e.jsx("input", { type: "text", className: "pk-input", value: x.lastName, onChange: (i) => k({ ...x, lastName: i.target.value }), required: !0 })
|
|
1895
|
+
] })
|
|
1896
|
+
] }),
|
|
1897
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", children: [
|
|
1898
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Passport Number" }),
|
|
1899
|
+
/* @__PURE__ */ e.jsx("input", { type: "text", className: "pk-input", value: x.passport, onChange: (i) => k({ ...x, passport: i.target.value }), required: !0 })
|
|
1900
|
+
] })
|
|
1901
|
+
] })
|
|
1902
|
+
] }),
|
|
1903
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { padding: "2rem" }, children: [
|
|
1904
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-md", style: { marginBottom: "1.5rem", borderBottom: "1px solid var(--pk-border)", paddingBottom: "0.5rem" }, children: "Customize Your Trip" }),
|
|
1905
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-items-center pk-justify-between", style: { padding: "1rem", background: "var(--pk-bg-main)", borderRadius: "var(--pk-radius-md)", marginBottom: "1rem" }, children: [
|
|
1906
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1907
|
+
/* @__PURE__ */ e.jsx("h4", { className: "pk-label", children: "Checked Baggage" }),
|
|
1908
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-sm", children: [
|
|
1909
|
+
"Up to 23kg per bag ($",
|
|
1910
|
+
X.addOns.checkedBag,
|
|
1911
|
+
" each)"
|
|
1912
|
+
] })
|
|
1913
|
+
] }),
|
|
1914
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-items-center pk-gap-4", children: [
|
|
1915
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "pk-btn pk-btn-outline", style: { padding: "0.5rem", borderRadius: "50%", width: 40, height: 40 }, onClick: () => T(Math.max(0, l - 1)), children: "-" }),
|
|
1916
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-heading-md", children: l }),
|
|
1917
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "pk-btn pk-btn-outline", style: { padding: "0.5rem", borderRadius: "50%", width: 40, height: 40 }, onClick: () => T(l + 1), children: "+" })
|
|
1918
|
+
] })
|
|
1919
|
+
] })
|
|
1920
|
+
] })
|
|
1921
|
+
] }),
|
|
1922
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { position: "sticky", top: "100px" }, children: [
|
|
1923
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-header bg-gradient", style: { background: "linear-gradient(135deg, var(--pk-bg-main), var(--pk-primary-light))", padding: "2rem" }, children: [
|
|
1924
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-badge", style: { marginBottom: "1rem", display: "inline-block" }, children: h.toUpperCase() }),
|
|
1925
|
+
/* @__PURE__ */ e.jsxs("h3", { className: "pk-heading-md", children: [
|
|
1926
|
+
u.from.split(" ")[0],
|
|
1927
|
+
" ✈ ",
|
|
1928
|
+
u.to.split(" ")[0]
|
|
1929
|
+
] }),
|
|
1930
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-sm", children: n.date })
|
|
1931
|
+
] }),
|
|
1932
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-body pk-flex pk-flex-col pk-gap-4", children: [
|
|
1933
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between", children: [
|
|
1934
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-body", children: "1x Ticket" }),
|
|
1935
|
+
/* @__PURE__ */ e.jsxs("span", { style: { fontWeight: 600 }, children: [
|
|
1936
|
+
"$",
|
|
1937
|
+
h === "business" ? u.businessPrice : u.price
|
|
1938
|
+
] })
|
|
1939
|
+
] }),
|
|
1940
|
+
l > 0 && /* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between", children: [
|
|
1941
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-text-body", children: [
|
|
1942
|
+
l,
|
|
1943
|
+
"x Checked Bag"
|
|
1944
|
+
] }),
|
|
1945
|
+
/* @__PURE__ */ e.jsxs("span", { style: { fontWeight: 600 }, children: [
|
|
1946
|
+
"$",
|
|
1947
|
+
l * X.addOns.checkedBag
|
|
1948
|
+
] })
|
|
1949
|
+
] }),
|
|
1950
|
+
/* @__PURE__ */ e.jsx("hr", { style: { border: 0, borderTop: "1px solid var(--pk-border)" } }),
|
|
1951
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between pk-items-center", children: [
|
|
1952
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-heading-md", children: "Total" }),
|
|
1953
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-heading-lg", style: { color: "var(--pk-primary)" }, children: [
|
|
1954
|
+
"$",
|
|
1955
|
+
b()
|
|
1956
|
+
] })
|
|
1957
|
+
] }),
|
|
1958
|
+
/* @__PURE__ */ e.jsx("button", { type: "submit", form: "booking-form", className: "pk-btn pk-btn-primary pk-w-full", style: { marginTop: "1rem", padding: "1.25rem" }, children: "Confirm & Pay" })
|
|
1959
|
+
] })
|
|
1960
|
+
] }) })
|
|
1961
|
+
] })
|
|
1962
|
+
] }), a = () => g ? /* @__PURE__ */ e.jsx("div", { className: "pk-container animate-fade-in pk-flex pk-justify-center pk-items-center", style: { minHeight: "80vh" }, children: /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { width: "100%", maxWidth: "400px", overflow: "hidden", boxShadow: "var(--pk-shadow-xl)" }, children: [
|
|
1963
|
+
/* @__PURE__ */ e.jsxs("div", { style: { background: "var(--pk-primary)", color: "white", padding: "2rem", textAlign: "center", position: "relative" }, children: [
|
|
1964
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-md", style: { opacity: 0.9 }, children: X.airlineName }),
|
|
1965
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", style: { margin: "1rem 0" }, children: "BOARDING" }),
|
|
1966
|
+
/* @__PURE__ */ e.jsx("p", { style: { letterSpacing: "2px", opacity: 0.8 }, children: "PASS" }),
|
|
1967
|
+
/* @__PURE__ */ e.jsx("div", { style: { position: "absolute", bottom: "-10px", left: "-10px", width: "20px", height: "20px", background: "var(--pk-bg-main)", borderRadius: "50%" } }),
|
|
1968
|
+
/* @__PURE__ */ e.jsx("div", { style: { position: "absolute", bottom: "-10px", right: "-10px", width: "20px", height: "20px", background: "var(--pk-bg-main)", borderRadius: "50%" } })
|
|
1969
|
+
] }),
|
|
1970
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-body", style: { padding: "2rem", position: "relative" }, children: [
|
|
1971
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between pk-items-center", style: { marginBottom: "2rem", borderBottom: "1px solid var(--pk-border)", paddingBottom: "1rem" }, children: [
|
|
1972
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-text-center", children: [
|
|
1973
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-xl", style: { color: "var(--pk-text-main)" }, children: g.flight.from.split(" ")[0] }),
|
|
1974
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-sm pk-text-muted", children: g.flight.departureTime })
|
|
1975
|
+
] }),
|
|
1976
|
+
/* @__PURE__ */ e.jsx("span", { style: { fontSize: "2rem", color: "var(--pk-primary)" }, children: "✈️" }),
|
|
1977
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-text-center", children: [
|
|
1978
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-xl", style: { color: "var(--pk-text-main)" }, children: g.flight.to.split(" ")[0] }),
|
|
1979
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-sm pk-text-muted", children: g.flight.arrivalTime })
|
|
1980
|
+
] })
|
|
1981
|
+
] }),
|
|
1982
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-grid", style: { gridTemplateColumns: "1fr 1fr", gap: "1.5rem", marginBottom: "2rem" }, children: [
|
|
1983
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1984
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-label pk-text-muted", children: "Passenger" }),
|
|
1985
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-heading-sm", style: { fontWeight: 600 }, children: [
|
|
1986
|
+
g.passenger.firstName,
|
|
1987
|
+
" ",
|
|
1988
|
+
g.passenger.lastName
|
|
1989
|
+
] })
|
|
1990
|
+
] }),
|
|
1991
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1992
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-label pk-text-muted", children: "Flight" }),
|
|
1993
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-heading-sm", style: { fontWeight: 600 }, children: g.flight.flightNumber })
|
|
1994
|
+
] }),
|
|
1995
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1996
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-label pk-text-muted", children: "Date" }),
|
|
1997
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-heading-sm", style: { fontWeight: 600 }, children: g.date })
|
|
1998
|
+
] }),
|
|
1999
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2000
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-label pk-text-muted", children: "Class" }),
|
|
2001
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-heading-sm", style: { fontWeight: 600, textTransform: "capitalize" }, children: g.seatClass })
|
|
2002
|
+
] }),
|
|
2003
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2004
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-label pk-text-muted", children: "Seat" }),
|
|
2005
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-heading-sm", style: { fontWeight: 800, color: "var(--pk-primary)", fontSize: "1.5rem" }, children: "12A" })
|
|
2006
|
+
] }),
|
|
2007
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2008
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-label pk-text-muted", children: "Gate" }),
|
|
2009
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-heading-sm", style: { fontWeight: 800, fontSize: "1.5rem" }, children: "G4" })
|
|
2010
|
+
] })
|
|
2011
|
+
] }),
|
|
2012
|
+
/* @__PURE__ */ e.jsxs("div", { style: { textAlign: "center", marginTop: "2rem" }, children: [
|
|
2013
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "inline-block", padding: "10px", border: "2px solid var(--pk-border)", borderRadius: "12px" }, children: /* @__PURE__ */ e.jsx("div", { style: { width: "120px", height: "120px", background: "repeating-linear-gradient(45deg, #000, #000 10px, transparent 10px, transparent 20px), repeating-linear-gradient(135deg, #000, #000 10px, transparent 10px, transparent 20px)" } }) }),
|
|
2014
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-sm", style: { marginTop: "0.5rem", letterSpacing: "4px", fontFamily: "monospace" }, children: g.bookingRef })
|
|
2015
|
+
] })
|
|
2016
|
+
] }),
|
|
2017
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-card-footer pk-flex pk-justify-center", style: { gap: "1rem", background: "var(--pk-primary-light)" }, children: /* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { background: "white" }, onClick: () => o("search"), children: "New Booking" }) })
|
|
2018
|
+
] }) }) : null;
|
|
2019
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { position: "relative", minHeight: "100vh", backgroundColor: "var(--pk-bg-main)" }, children: [
|
|
2020
|
+
y && /* @__PURE__ */ e.jsxs("div", { style: { position: "fixed", inset: 0, backgroundColor: "rgba(255,255,255,0.7)", zIndex: 100, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", backdropFilter: "blur(4px)" }, children: [
|
|
2021
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-skeleton", style: { width: "80px", height: "80px", borderRadius: "50%", marginBottom: "1rem" } }),
|
|
2022
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "Searching Global Skies..." })
|
|
2023
|
+
] }),
|
|
2024
|
+
m === "search" && I(),
|
|
2025
|
+
m === "results" && r(),
|
|
2026
|
+
m === "passenger" && t(),
|
|
2027
|
+
m === "pass" && a(),
|
|
2028
|
+
/* @__PURE__ */ e.jsx(D, {})
|
|
2029
|
+
] });
|
|
2030
|
+
}
|
|
2031
|
+
const se = {
|
|
2032
|
+
organizationName: "Global Tech Solutions",
|
|
2033
|
+
kpis: {
|
|
2034
|
+
revenue: { value: "$124,500", trend: 12.5 },
|
|
2035
|
+
users: { value: "14,245", trend: 8.2 },
|
|
2036
|
+
conversionRate: { value: "4.8%", trend: -1.2 },
|
|
2037
|
+
bounceRate: { value: "32.1%", trend: -5.4 }
|
|
2038
|
+
},
|
|
2039
|
+
financialReports: [
|
|
2040
|
+
{ id: "RPT-001", period: "Q1 2026", revenue: 124500, expenses: 84e3, net: 40500, status: "Finalized" },
|
|
2041
|
+
{ id: "RPT-002", period: "Q4 2025", revenue: 118e3, expenses: 82e3, net: 36e3, status: "Finalized" },
|
|
2042
|
+
{ id: "RPT-003", period: "Q3 2025", revenue: 105e3, expenses: 76e3, net: 29e3, status: "Finalized" },
|
|
2043
|
+
{ id: "RPT-004", period: "Q2 2025", revenue: 98e3, expenses: 71e3, net: 27e3, status: "Finalized" }
|
|
2044
|
+
],
|
|
2045
|
+
systemLogs: [
|
|
2046
|
+
{ id: "log1", timestamp: "2026-04-08 10:15:00", level: "INFO", message: "User array successfully synchronized.", service: "AuthService" },
|
|
2047
|
+
{ id: "log2", timestamp: "2026-04-08 10:12:45", level: "WARN", message: "API rate limit approaching for endpoint /v2/data.", service: "APIGateway" },
|
|
2048
|
+
{ id: "log3", timestamp: "2026-04-08 10:05:12", level: "ERROR", message: "Database connection timeout after 3000ms.", service: "DBService" },
|
|
2049
|
+
{ id: "log4", timestamp: "2026-04-08 09:45:00", level: "INFO", message: "Daily backup completed successfully.", service: "BackupAgent" },
|
|
2050
|
+
{ id: "log5", timestamp: "2026-04-08 09:30:22", level: "INFO", message: "New deployment v4.5.1 rolled out.", service: "CI/CD" },
|
|
2051
|
+
{ id: "log6", timestamp: "2026-04-08 09:15:00", level: "WARN", message: "High memory trace detected in worker node 4.", service: "ComputeEngine" }
|
|
2052
|
+
],
|
|
2053
|
+
chartData: [
|
|
2054
|
+
{ label: "Mon", value: 30 },
|
|
2055
|
+
{ label: "Tue", value: 45 },
|
|
2056
|
+
{ label: "Wed", value: 25 },
|
|
2057
|
+
{ label: "Thu", value: 60 },
|
|
2058
|
+
{ label: "Fri", value: 85 },
|
|
2059
|
+
{ label: "Sat", value: 40 },
|
|
2060
|
+
{ label: "Sun", value: 50 }
|
|
2061
|
+
]
|
|
2062
|
+
};
|
|
2063
|
+
function ge({ title: m, value: o, icon: n, trend: j, trendLabel: u }) {
|
|
2064
|
+
const N = j && j > 0, h = j && j < 0;
|
|
2065
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-card-interactive", style: { padding: "1.5rem", display: "flex", flexDirection: "column", gap: "1rem" }, children: [
|
|
2066
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-justify-between pk-items-center", children: [
|
|
2067
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-label", style: { color: "var(--pk-text-muted)" }, children: m }),
|
|
2068
|
+
/* @__PURE__ */ e.jsx("span", { style: { fontSize: "1.5rem", opacity: 0.8 }, children: n })
|
|
2069
|
+
] }),
|
|
2070
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2071
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-heading-md", style: { marginBottom: "0.5rem" }, children: o }),
|
|
2072
|
+
j !== void 0 && /* @__PURE__ */ e.jsxs("div", { className: "pk-flex pk-items-center", style: { gap: "0.5rem", fontSize: "0.875rem" }, children: [
|
|
2073
|
+
/* @__PURE__ */ e.jsxs("span", { style: {
|
|
2074
|
+
fontWeight: 600,
|
|
2075
|
+
color: N ? "var(--pk-success)" : h ? "var(--pk-danger)" : "var(--pk-text-muted)"
|
|
2076
|
+
}, children: [
|
|
2077
|
+
N ? "↑" : h ? "↓" : "-",
|
|
2078
|
+
" ",
|
|
2079
|
+
Math.abs(j),
|
|
2080
|
+
"%"
|
|
2081
|
+
] }),
|
|
2082
|
+
/* @__PURE__ */ e.jsx("span", { style: { color: "var(--pk-text-muted)" }, children: u || "vs last month" })
|
|
2083
|
+
] })
|
|
2084
|
+
] })
|
|
2085
|
+
] });
|
|
2086
|
+
}
|
|
2087
|
+
function Mt() {
|
|
2088
|
+
const [m, o] = p("summary"), [n, j] = p(""), [u, N] = p(!1), { showToast: h, ToastContainer: A } = G(), l = (y, C = 1e3) => {
|
|
2089
|
+
N(!0), setTimeout(() => {
|
|
2090
|
+
N(!1), y();
|
|
2091
|
+
}, C);
|
|
2092
|
+
}, T = (y, C) => {
|
|
2093
|
+
l(() => {
|
|
2094
|
+
if (!y || y.length === 0) {
|
|
2095
|
+
h("No data to export", "error");
|
|
2096
|
+
return;
|
|
2097
|
+
}
|
|
2098
|
+
const B = Object.keys(y[0]).join(","), D = y.map(
|
|
2099
|
+
(b) => Object.values(b).map((M) => typeof M == "string" ? `"${M}"` : M).join(",")
|
|
2100
|
+
).join(`
|
|
2101
|
+
`), P = new Blob([`${B}
|
|
2102
|
+
${D}`], { type: "text/csv" }), S = URL.createObjectURL(P), d = document.createElement("a");
|
|
2103
|
+
d.href = S, d.download = `${C}_${Date.now()}.csv`, d.click(), h("Export successful", "success");
|
|
2104
|
+
});
|
|
2105
|
+
}, x = () => /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { marginBottom: "2rem", padding: "1rem", display: "flex", gap: "1rem", overflowX: "auto" }, children: [
|
|
2106
|
+
/* @__PURE__ */ e.jsx(
|
|
2107
|
+
"button",
|
|
2108
|
+
{
|
|
2109
|
+
className: m === "summary" ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline",
|
|
2110
|
+
onClick: () => o("summary"),
|
|
2111
|
+
children: "Executive Summary"
|
|
2112
|
+
}
|
|
2113
|
+
),
|
|
2114
|
+
/* @__PURE__ */ e.jsx(
|
|
2115
|
+
"button",
|
|
2116
|
+
{
|
|
2117
|
+
className: m === "financial" ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline",
|
|
2118
|
+
onClick: () => o("financial"),
|
|
2119
|
+
children: "Financial Reports"
|
|
2120
|
+
}
|
|
2121
|
+
),
|
|
2122
|
+
/* @__PURE__ */ e.jsx(
|
|
2123
|
+
"button",
|
|
2124
|
+
{
|
|
2125
|
+
className: m === "logs" ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline",
|
|
2126
|
+
onClick: () => o("logs"),
|
|
2127
|
+
children: "System Logs"
|
|
2128
|
+
}
|
|
2129
|
+
)
|
|
2130
|
+
] }), k = () => {
|
|
2131
|
+
const y = se.kpis, C = Math.max(...se.chartData.map((B) => B.value));
|
|
2132
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "animate-fade-in", children: [
|
|
2133
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", style: { marginBottom: "2rem" }, children: "Executive Overview" }),
|
|
2134
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(250px, 1fr))", marginBottom: "2rem" }, children: [
|
|
2135
|
+
/* @__PURE__ */ e.jsx(ge, { title: "Total Revenue", value: y.revenue.value, trend: y.revenue.trend, icon: "💰" }),
|
|
2136
|
+
/* @__PURE__ */ e.jsx(ge, { title: "Active Users", value: y.users.value, trend: y.users.trend, icon: "👥" }),
|
|
2137
|
+
/* @__PURE__ */ e.jsx(ge, { title: "Conversion Rate", value: y.conversionRate.value, trend: y.conversionRate.trend, icon: "🔥" }),
|
|
2138
|
+
/* @__PURE__ */ e.jsx(ge, { title: "Bounce Rate", value: y.bounceRate.value, trend: y.bounceRate.trend, icon: "📉" })
|
|
2139
|
+
] }),
|
|
2140
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { padding: "2rem" }, children: [
|
|
2141
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "2rem" }, children: "Weekly Traffic Activity" }),
|
|
2142
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "flex", alignItems: "flex-end", height: "250px", gap: "2%", paddingBottom: "2rem", borderBottom: "1px solid var(--pk-border)" }, children: se.chartData.map((B, D) => {
|
|
2143
|
+
const P = B.value / C * 100;
|
|
2144
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "column", alignItems: "center", height: "100%", justifyContent: "flex-end" }, children: [
|
|
2145
|
+
/* @__PURE__ */ e.jsxs("div", { style: { opacity: 0, transition: "opacity 0.2s", fontSize: "0.75rem", marginBottom: "0.25rem" }, className: "chart-tooltip", children: [
|
|
2146
|
+
B.value,
|
|
2147
|
+
"k"
|
|
2148
|
+
] }),
|
|
2149
|
+
/* @__PURE__ */ e.jsx(
|
|
2150
|
+
"div",
|
|
2151
|
+
{
|
|
2152
|
+
style: {
|
|
2153
|
+
width: "100%",
|
|
2154
|
+
height: `${P}%`,
|
|
2155
|
+
background: "linear-gradient(to top, var(--pk-primary), var(--pk-secondary))",
|
|
2156
|
+
borderRadius: "4px 4px 0 0",
|
|
2157
|
+
transition: "height 1s cubic-bezier(0.1, 0.8, 0.2, 1)"
|
|
2158
|
+
},
|
|
2159
|
+
className: "chart-bar"
|
|
2160
|
+
}
|
|
2161
|
+
),
|
|
2162
|
+
/* @__PURE__ */ e.jsx("span", { style: { marginTop: "1rem", fontSize: "0.875rem", color: "var(--pk-text-muted)" }, children: B.label })
|
|
2163
|
+
] }, D);
|
|
2164
|
+
}) })
|
|
2165
|
+
] }),
|
|
2166
|
+
/* @__PURE__ */ e.jsx("style", { children: `
|
|
2167
|
+
.chart-bar:hover { filter: brightness(1.2); cursor: pointer; }
|
|
2168
|
+
.chart-bar:hover + span { font-weight: bold; color: var(--pk-text-main); }
|
|
2169
|
+
.chart-bar:hover ~ .chart-tooltip, .chart-tooltip:focus { opacity: 1 !important; }
|
|
2170
|
+
` })
|
|
2171
|
+
] });
|
|
2172
|
+
}, g = () => /* @__PURE__ */ e.jsxs("div", { className: "animate-fade-in", children: [
|
|
2173
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "2rem" }, children: [
|
|
2174
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", children: "Financial Reports" }),
|
|
2175
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", onClick: () => T(se.financialReports, "Financial_Report"), children: "⬇️ Export CSV" })
|
|
2176
|
+
] }),
|
|
2177
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-card", style: { overflowX: "auto" }, children: /* @__PURE__ */ e.jsxs("table", { style: { width: "100%", borderCollapse: "collapse", textAlign: "left" }, children: [
|
|
2178
|
+
/* @__PURE__ */ e.jsx("thead", { children: /* @__PURE__ */ e.jsxs("tr", { style: { background: "var(--pk-bg-main)", borderBottom: "1px solid var(--pk-border)" }, children: [
|
|
2179
|
+
/* @__PURE__ */ e.jsx("th", { style: { padding: "1rem 1.5rem", color: "var(--pk-text-muted)", fontWeight: 600 }, children: "Period" }),
|
|
2180
|
+
/* @__PURE__ */ e.jsx("th", { style: { padding: "1rem 1.5rem", color: "var(--pk-text-muted)", fontWeight: 600 }, children: "Revenue" }),
|
|
2181
|
+
/* @__PURE__ */ e.jsx("th", { style: { padding: "1rem 1.5rem", color: "var(--pk-text-muted)", fontWeight: 600 }, children: "Expenses" }),
|
|
2182
|
+
/* @__PURE__ */ e.jsx("th", { style: { padding: "1rem 1.5rem", color: "var(--pk-text-muted)", fontWeight: 600 }, children: "Net Profit" }),
|
|
2183
|
+
/* @__PURE__ */ e.jsx("th", { style: { padding: "1rem 1.5rem", color: "var(--pk-text-muted)", fontWeight: 600 }, children: "Status" })
|
|
2184
|
+
] }) }),
|
|
2185
|
+
/* @__PURE__ */ e.jsx("tbody", { children: se.financialReports.map((y, C) => /* @__PURE__ */ e.jsxs("tr", { style: { borderBottom: "1px solid var(--pk-border)", transition: "background 0.2s" }, children: [
|
|
2186
|
+
/* @__PURE__ */ e.jsx("td", { style: { padding: "1rem 1.5rem", fontWeight: 600 }, children: y.period }),
|
|
2187
|
+
/* @__PURE__ */ e.jsxs("td", { style: { padding: "1rem 1.5rem", color: "var(--pk-success)" }, children: [
|
|
2188
|
+
"+$",
|
|
2189
|
+
y.revenue.toLocaleString()
|
|
2190
|
+
] }),
|
|
2191
|
+
/* @__PURE__ */ e.jsxs("td", { style: { padding: "1rem 1.5rem", color: "var(--pk-danger)" }, children: [
|
|
2192
|
+
"-$",
|
|
2193
|
+
y.expenses.toLocaleString()
|
|
2194
|
+
] }),
|
|
2195
|
+
/* @__PURE__ */ e.jsxs("td", { style: { padding: "1rem 1.5rem", fontWeight: "bold" }, children: [
|
|
2196
|
+
"$",
|
|
2197
|
+
y.net.toLocaleString()
|
|
2198
|
+
] }),
|
|
2199
|
+
/* @__PURE__ */ e.jsx("td", { style: { padding: "1rem 1.5rem" }, children: /* @__PURE__ */ e.jsx("span", { className: "pk-badge", children: y.status }) })
|
|
2200
|
+
] }, C)) })
|
|
2201
|
+
] }) })
|
|
2202
|
+
] }), W = () => {
|
|
2203
|
+
const y = se.systemLogs.filter(
|
|
2204
|
+
(C) => C.message.toLowerCase().includes(n.toLowerCase()) || C.service.toLowerCase().includes(n.toLowerCase())
|
|
2205
|
+
);
|
|
2206
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "animate-fade-in", children: [
|
|
2207
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "2rem", flexWrap: "wrap", gap: "1rem" }, children: [
|
|
2208
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", children: "System Logs" }),
|
|
2209
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: "1rem" }, children: [
|
|
2210
|
+
/* @__PURE__ */ e.jsx(
|
|
2211
|
+
"input",
|
|
2212
|
+
{
|
|
2213
|
+
type: "text",
|
|
2214
|
+
className: "pk-input",
|
|
2215
|
+
placeholder: "Search logs...",
|
|
2216
|
+
value: n,
|
|
2217
|
+
onChange: (C) => j(C.target.value)
|
|
2218
|
+
}
|
|
2219
|
+
),
|
|
2220
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", onClick: () => T(y, "System_Logs"), children: "⬇️ Export" })
|
|
2221
|
+
] })
|
|
2222
|
+
] }),
|
|
2223
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-card", style: { background: "#0f172a", color: "#e2e8f0", padding: "1rem", fontFamily: "monospace", borderRadius: "var(--pk-radius-lg)", overflowX: "auto", maxHeight: "600px", overflowY: "auto" }, children: y.length === 0 ? /* @__PURE__ */ e.jsx("div", { style: { padding: "2rem", textAlign: "center" }, children: "No logs found matching query." }) : y.map((C) => {
|
|
2224
|
+
const B = C.level === "ERROR" ? "#ef4444" : C.level === "WARN" ? "#f59e0b" : "#38bdf8";
|
|
2225
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: "1rem", padding: "0.75rem", borderBottom: "1px solid #1e293b" }, children: [
|
|
2226
|
+
/* @__PURE__ */ e.jsxs("span", { style: { color: "#64748b", whiteSpace: "nowrap" }, children: [
|
|
2227
|
+
"[",
|
|
2228
|
+
C.timestamp,
|
|
2229
|
+
"]"
|
|
2230
|
+
] }),
|
|
2231
|
+
/* @__PURE__ */ e.jsx("span", { style: { color: B, fontWeight: "bold", width: "60px" }, children: C.level }),
|
|
2232
|
+
/* @__PURE__ */ e.jsxs("span", { style: { color: "#cbd5e1", width: "120px" }, children: [
|
|
2233
|
+
"[",
|
|
2234
|
+
C.service,
|
|
2235
|
+
"]"
|
|
2236
|
+
] }),
|
|
2237
|
+
/* @__PURE__ */ e.jsx("span", { style: { flex: 1 }, children: C.message })
|
|
2238
|
+
] }, C.id);
|
|
2239
|
+
}) })
|
|
2240
|
+
] });
|
|
2241
|
+
};
|
|
2242
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-container", style: { minHeight: "100vh" }, children: [
|
|
2243
|
+
u && /* @__PURE__ */ e.jsxs("div", { style: { position: "fixed", inset: 0, backgroundColor: "rgba(255,255,255,0.8)", zIndex: 100, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", backdropFilter: "blur(4px)" }, children: [
|
|
2244
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-skeleton", style: { width: "80px", height: "80px", borderRadius: "50%", marginBottom: "1rem" } }),
|
|
2245
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "Processing Data..." })
|
|
2246
|
+
] }),
|
|
2247
|
+
/* @__PURE__ */ e.jsxs("div", { style: { marginBottom: "2rem" }, children: [
|
|
2248
|
+
/* @__PURE__ */ e.jsxs("h1", { className: "pk-heading-xl", children: [
|
|
2249
|
+
se.organizationName,
|
|
2250
|
+
" Engine"
|
|
2251
|
+
] }),
|
|
2252
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: "Real-time metrics and system health monitoring." })
|
|
2253
|
+
] }),
|
|
2254
|
+
x(),
|
|
2255
|
+
/* @__PURE__ */ e.jsxs("div", { style: { position: "relative", minHeight: "500px" }, children: [
|
|
2256
|
+
m === "summary" && k(),
|
|
2257
|
+
m === "financial" && g(),
|
|
2258
|
+
m === "logs" && W()
|
|
2259
|
+
] }),
|
|
2260
|
+
/* @__PURE__ */ e.jsx(A, {})
|
|
2261
|
+
] });
|
|
2262
|
+
}
|
|
2263
|
+
const K = {
|
|
2264
|
+
companyInfo: {
|
|
2265
|
+
name: "PopSite Agency",
|
|
2266
|
+
address: "123 Creative Blvd, Tech District",
|
|
2267
|
+
email: "billing@popsite.com",
|
|
2268
|
+
taxRate: 8.5
|
|
2269
|
+
},
|
|
2270
|
+
clients: [
|
|
2271
|
+
{ id: "cli_1", name: "Acme Corp", email: "finance@acme.inc", phone: "+1 555-0100" },
|
|
2272
|
+
{ id: "cli_2", name: "Stark Industries", email: "accounts@stark.com", phone: "+1 555-0101" },
|
|
2273
|
+
{ id: "cli_3", name: "Wayne Enterprises", email: "billing@wayne.ent", phone: "+1 555-0102" },
|
|
2274
|
+
{ id: "cli_4", name: "Umbrella Corp", email: "finance@umbrella.com", phone: "+1 555-0103" }
|
|
2275
|
+
],
|
|
2276
|
+
recentInvoices: [
|
|
2277
|
+
{ id: "INV-2026-001", client: "Acme Corp", date: "2026-04-01", amount: 4500, status: "Paid" },
|
|
2278
|
+
{ id: "INV-2026-002", client: "Stark Industries", date: "2026-04-05", amount: 12500, status: "Pending" },
|
|
2279
|
+
{ id: "INV-2026-003", client: "Wayne Enterprises", date: "2026-04-07", amount: 8e3, status: "Overdue" }
|
|
2280
|
+
]
|
|
2281
|
+
};
|
|
2282
|
+
function Ot() {
|
|
2283
|
+
const [m, o] = p("dashboard"), [n, j] = p(K.recentInvoices), [u, N] = p(""), [h, A] = p(""), [l, T] = p(K.companyInfo.taxRate), [x, k] = p([
|
|
2284
|
+
{ id: 1, description: "Website Redesign", qty: 1, rate: 2500 },
|
|
2285
|
+
{ id: 2, description: "Hosting (Annual)", qty: 1, rate: 150 }
|
|
2286
|
+
]), { showToast: g, ToastContainer: W } = G();
|
|
2287
|
+
$(() => {
|
|
2288
|
+
const t = localStorage.getItem("popsite_invoices");
|
|
2289
|
+
if (t)
|
|
2290
|
+
try {
|
|
2291
|
+
j(JSON.parse(t));
|
|
2292
|
+
} catch {
|
|
2293
|
+
}
|
|
2294
|
+
}, []), $(() => {
|
|
2295
|
+
localStorage.setItem("popsite_invoices", JSON.stringify(n));
|
|
2296
|
+
}, [n]);
|
|
2297
|
+
const y = x.reduce((t, a) => t + a.qty * a.rate, 0), C = y * (l / 100), B = y + C, D = () => {
|
|
2298
|
+
k([...x, { id: Date.now(), description: "", qty: 1, rate: 0 }]);
|
|
2299
|
+
}, P = (t) => {
|
|
2300
|
+
k(x.filter((a) => a.id !== t));
|
|
2301
|
+
}, S = (t, a, i) => {
|
|
2302
|
+
k(x.map(
|
|
2303
|
+
(f) => f.id === t ? { ...f, [a]: i } : f
|
|
2304
|
+
));
|
|
2305
|
+
}, d = () => {
|
|
2306
|
+
var a;
|
|
2307
|
+
if (!h) {
|
|
2308
|
+
g("Please select a client", "error");
|
|
2309
|
+
return;
|
|
2310
|
+
}
|
|
2311
|
+
const t = {
|
|
2312
|
+
id: `INV-${(/* @__PURE__ */ new Date()).getFullYear()}-${Math.floor(Math.random() * 1e3)}`,
|
|
2313
|
+
client: ((a = K.clients.find((i) => i.id === h)) == null ? void 0 : a.name) || "Unknown",
|
|
2314
|
+
date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
2315
|
+
amount: B,
|
|
2316
|
+
status: "Pending"
|
|
2317
|
+
};
|
|
2318
|
+
j([t, ...n]), g(`Invoice ${t.id} generated!`, "success"), o("dashboard");
|
|
2319
|
+
}, b = () => /* @__PURE__ */ e.jsxs("div", { className: "pk-card no-print", style: { marginBottom: "2rem", padding: "1rem", display: "flex", gap: "1rem", overflowX: "auto" }, children: [
|
|
2320
|
+
/* @__PURE__ */ e.jsx("button", { className: m === "dashboard" ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline", onClick: () => o("dashboard"), children: "Overview" }),
|
|
2321
|
+
/* @__PURE__ */ e.jsx("button", { className: m === "creator" ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline", onClick: () => o("creator"), children: "Create Invoice" }),
|
|
2322
|
+
/* @__PURE__ */ e.jsx("button", { className: m === "clients" ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline", onClick: () => o("clients"), children: "Client Directory" })
|
|
2323
|
+
] }), M = () => /* @__PURE__ */ e.jsxs("div", { className: "animate-fade-in no-print", children: [
|
|
2324
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "2rem" }, children: [
|
|
2325
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", children: "Recent Invoices" }),
|
|
2326
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", onClick: () => o("creator"), children: "+ New Invoice" })
|
|
2327
|
+
] }),
|
|
2328
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-card", style: { overflowX: "auto" }, children: /* @__PURE__ */ e.jsxs("table", { style: { width: "100%", borderCollapse: "collapse", textAlign: "left" }, children: [
|
|
2329
|
+
/* @__PURE__ */ e.jsx("thead", { children: /* @__PURE__ */ e.jsxs("tr", { style: { background: "var(--pk-bg-main)", borderBottom: "1px solid var(--pk-border)" }, children: [
|
|
2330
|
+
/* @__PURE__ */ e.jsx("th", { style: { padding: "1rem 1.5rem", color: "var(--pk-text-muted)" }, children: "Invoice ID" }),
|
|
2331
|
+
/* @__PURE__ */ e.jsx("th", { style: { padding: "1rem 1.5rem", color: "var(--pk-text-muted)" }, children: "Client" }),
|
|
2332
|
+
/* @__PURE__ */ e.jsx("th", { style: { padding: "1rem 1.5rem", color: "var(--pk-text-muted)" }, children: "Date" }),
|
|
2333
|
+
/* @__PURE__ */ e.jsx("th", { style: { padding: "1rem 1.5rem", color: "var(--pk-text-muted)" }, children: "Amount" }),
|
|
2334
|
+
/* @__PURE__ */ e.jsx("th", { style: { padding: "1rem 1.5rem", color: "var(--pk-text-muted)" }, children: "Status" })
|
|
2335
|
+
] }) }),
|
|
2336
|
+
/* @__PURE__ */ e.jsx("tbody", { children: n.map((t, a) => /* @__PURE__ */ e.jsxs("tr", { style: { borderBottom: "1px solid var(--pk-border)" }, children: [
|
|
2337
|
+
/* @__PURE__ */ e.jsx("td", { style: { padding: "1rem 1.5rem", fontWeight: 600 }, children: t.id }),
|
|
2338
|
+
/* @__PURE__ */ e.jsx("td", { style: { padding: "1rem 1.5rem" }, children: t.client }),
|
|
2339
|
+
/* @__PURE__ */ e.jsx("td", { style: { padding: "1rem 1.5rem" }, children: t.date }),
|
|
2340
|
+
/* @__PURE__ */ e.jsxs("td", { style: { padding: "1rem 1.5rem", fontWeight: "bold" }, children: [
|
|
2341
|
+
"$",
|
|
2342
|
+
t.amount.toLocaleString(void 0, { minimumFractionDigits: 2 })
|
|
2343
|
+
] }),
|
|
2344
|
+
/* @__PURE__ */ e.jsx("td", { style: { padding: "1rem 1.5rem" }, children: /* @__PURE__ */ e.jsx("span", { className: "pk-badge", style: {
|
|
2345
|
+
background: t.status === "Paid" ? "var(--pk-success)" : t.status === "Overdue" ? "var(--pk-danger)" : "var(--pk-warning)",
|
|
2346
|
+
color: "white"
|
|
2347
|
+
}, children: t.status }) })
|
|
2348
|
+
] }, a)) })
|
|
2349
|
+
] }) })
|
|
2350
|
+
] }), I = () => {
|
|
2351
|
+
const t = K.clients.filter((a) => a.name.toLowerCase().includes(u.toLowerCase()));
|
|
2352
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "animate-fade-in no-print", children: [
|
|
2353
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "2rem" }, children: [
|
|
2354
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", children: "Client Directory" }),
|
|
2355
|
+
/* @__PURE__ */ e.jsx(
|
|
2356
|
+
"input",
|
|
2357
|
+
{
|
|
2358
|
+
type: "text",
|
|
2359
|
+
className: "pk-input",
|
|
2360
|
+
placeholder: "Search clients...",
|
|
2361
|
+
value: u,
|
|
2362
|
+
onChange: (a) => N(a.target.value)
|
|
2363
|
+
}
|
|
2364
|
+
)
|
|
2365
|
+
] }),
|
|
2366
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-grid", style: { gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))" }, children: t.map((a) => /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { padding: "1.5rem" }, children: [
|
|
2367
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "1rem" }, children: a.name }),
|
|
2368
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "0.5rem" }, children: [
|
|
2369
|
+
/* @__PURE__ */ e.jsxs("a", { href: `mailto:${a.email}`, className: "pk-text-body", style: { color: "var(--pk-primary)", textDecoration: "none" }, children: [
|
|
2370
|
+
"✉️ ",
|
|
2371
|
+
a.email
|
|
2372
|
+
] }),
|
|
2373
|
+
/* @__PURE__ */ e.jsxs("a", { href: `tel:${a.phone}`, className: "pk-text-body", style: { color: "var(--pk-text-main)", textDecoration: "none" }, children: [
|
|
2374
|
+
"📞 ",
|
|
2375
|
+
a.phone
|
|
2376
|
+
] })
|
|
2377
|
+
] }),
|
|
2378
|
+
/* @__PURE__ */ e.jsx(
|
|
2379
|
+
"button",
|
|
2380
|
+
{
|
|
2381
|
+
className: "pk-btn pk-btn-outline",
|
|
2382
|
+
style: { width: "100%", marginTop: "1.5rem" },
|
|
2383
|
+
onClick: () => {
|
|
2384
|
+
A(a.id), o("creator");
|
|
2385
|
+
},
|
|
2386
|
+
children: "Invoice Client"
|
|
2387
|
+
}
|
|
2388
|
+
)
|
|
2389
|
+
] }, a.id)) })
|
|
2390
|
+
] });
|
|
2391
|
+
}, r = () => {
|
|
2392
|
+
var t, a;
|
|
2393
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "animate-fade-in print-container", style: { background: "white", padding: "2rem", borderRadius: "var(--pk-radius-lg)", boxShadow: "var(--pk-shadow-lg)" }, children: [
|
|
2394
|
+
/* @__PURE__ */ e.jsx("style", { children: `
|
|
2395
|
+
@media print {
|
|
2396
|
+
body * { visibility: hidden; }
|
|
2397
|
+
.print-container, .print-container * { visibility: visible; }
|
|
2398
|
+
.print-container { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; padding: 0; }
|
|
2399
|
+
.no-print { display: none !important; }
|
|
2400
|
+
.pk-container { padding: 0 !important; max-width: 100% !important; margin: 0 !important; }
|
|
2401
|
+
@page { margin: 1cm; }
|
|
2402
|
+
}
|
|
2403
|
+
` }),
|
|
2404
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", marginBottom: "3rem", borderBottom: "2px solid var(--pk-border)", paddingBottom: "2rem" }, children: [
|
|
2405
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2406
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", style: { color: "var(--pk-primary)", marginBottom: "0.5rem" }, children: "INVOICE" }),
|
|
2407
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: "ID: INV-DRAFT" }),
|
|
2408
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-body", children: [
|
|
2409
|
+
"Date: ",
|
|
2410
|
+
(/* @__PURE__ */ new Date()).toISOString().split("T")[0]
|
|
2411
|
+
] })
|
|
2412
|
+
] }),
|
|
2413
|
+
/* @__PURE__ */ e.jsxs("div", { style: { textAlign: "right" }, children: [
|
|
2414
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: K.companyInfo.name }),
|
|
2415
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { whiteSpace: "pre-line" }, children: K.companyInfo.address }),
|
|
2416
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: K.companyInfo.email })
|
|
2417
|
+
] })
|
|
2418
|
+
] }),
|
|
2419
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "flex", justifyContent: "space-between", marginBottom: "3rem" }, children: /* @__PURE__ */ e.jsxs("div", { style: { flex: 1 }, children: [
|
|
2420
|
+
/* @__PURE__ */ e.jsx("h4", { className: "pk-label", style: { marginBottom: "0.5rem", color: "var(--pk-text-muted)" }, children: "Bill To:" }),
|
|
2421
|
+
/* @__PURE__ */ e.jsxs(
|
|
2422
|
+
"select",
|
|
2423
|
+
{
|
|
2424
|
+
className: "pk-input no-print",
|
|
2425
|
+
value: h,
|
|
2426
|
+
onChange: (i) => A(i.target.value),
|
|
2427
|
+
style: { width: "100%", maxWidth: "300px", marginBottom: "0.5rem" },
|
|
2428
|
+
children: [
|
|
2429
|
+
/* @__PURE__ */ e.jsx("option", { value: "", children: "-- Select Client --" }),
|
|
2430
|
+
K.clients.map((i) => /* @__PURE__ */ e.jsx("option", { value: i.id, children: i.name }, i.id))
|
|
2431
|
+
]
|
|
2432
|
+
}
|
|
2433
|
+
),
|
|
2434
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "none", display: h ? "block" : "none" }, children: [
|
|
2435
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: (t = K.clients.find((i) => i.id === h)) == null ? void 0 : t.name }),
|
|
2436
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: (a = K.clients.find((i) => i.id === h)) == null ? void 0 : a.email })
|
|
2437
|
+
] }),
|
|
2438
|
+
!h && /* @__PURE__ */ e.jsx("div", { style: { display: "none" }, children: "_____________" })
|
|
2439
|
+
] }) }),
|
|
2440
|
+
/* @__PURE__ */ e.jsxs("table", { style: { width: "100%", borderCollapse: "collapse", marginBottom: "2rem" }, children: [
|
|
2441
|
+
/* @__PURE__ */ e.jsx("thead", { children: /* @__PURE__ */ e.jsxs("tr", { style: { background: "var(--pk-primary-light)", color: "var(--pk-primary)" }, children: [
|
|
2442
|
+
/* @__PURE__ */ e.jsx("th", { style: { padding: "1rem", textAlign: "left" }, children: "Description" }),
|
|
2443
|
+
/* @__PURE__ */ e.jsx("th", { style: { padding: "1rem", textAlign: "center", width: "100px" }, children: "Qty" }),
|
|
2444
|
+
/* @__PURE__ */ e.jsx("th", { style: { padding: "1rem", textAlign: "right", width: "150px" }, children: "Rate" }),
|
|
2445
|
+
/* @__PURE__ */ e.jsx("th", { style: { padding: "1rem", textAlign: "right", width: "150px" }, children: "Total" }),
|
|
2446
|
+
/* @__PURE__ */ e.jsx("th", { className: "no-print", style: { width: "50px" } })
|
|
2447
|
+
] }) }),
|
|
2448
|
+
/* @__PURE__ */ e.jsx("tbody", { children: x.map((i, f) => /* @__PURE__ */ e.jsxs("tr", { style: { borderBottom: "1px solid var(--pk-border)" }, children: [
|
|
2449
|
+
/* @__PURE__ */ e.jsx("td", { style: { padding: "1rem" }, children: /* @__PURE__ */ e.jsx(
|
|
2450
|
+
"input",
|
|
2451
|
+
{
|
|
2452
|
+
type: "text",
|
|
2453
|
+
className: "pk-input",
|
|
2454
|
+
style: { width: "100%", border: "none", background: "transparent" },
|
|
2455
|
+
value: i.description,
|
|
2456
|
+
onChange: (F) => S(i.id, "description", F.target.value),
|
|
2457
|
+
placeholder: "Item description"
|
|
2458
|
+
}
|
|
2459
|
+
) }),
|
|
2460
|
+
/* @__PURE__ */ e.jsx("td", { style: { padding: "1rem", textAlign: "center" }, children: /* @__PURE__ */ e.jsx(
|
|
2461
|
+
"input",
|
|
2462
|
+
{
|
|
2463
|
+
type: "number",
|
|
2464
|
+
className: "pk-input",
|
|
2465
|
+
style: { width: "60px", textAlign: "center" },
|
|
2466
|
+
value: i.qty,
|
|
2467
|
+
onChange: (F) => S(i.id, "qty", parseFloat(F.target.value) || 0)
|
|
2468
|
+
}
|
|
2469
|
+
) }),
|
|
2470
|
+
/* @__PURE__ */ e.jsx("td", { style: { padding: "1rem", textAlign: "right" }, children: /* @__PURE__ */ e.jsx(
|
|
2471
|
+
"input",
|
|
2472
|
+
{
|
|
2473
|
+
type: "number",
|
|
2474
|
+
className: "pk-input",
|
|
2475
|
+
style: { width: "100px", textAlign: "right" },
|
|
2476
|
+
value: i.rate,
|
|
2477
|
+
onChange: (F) => S(i.id, "rate", parseFloat(F.target.value) || 0)
|
|
2478
|
+
}
|
|
2479
|
+
) }),
|
|
2480
|
+
/* @__PURE__ */ e.jsxs("td", { style: { padding: "1rem", textAlign: "right", fontWeight: 600 }, children: [
|
|
2481
|
+
"$",
|
|
2482
|
+
(i.qty * i.rate).toFixed(2)
|
|
2483
|
+
] }),
|
|
2484
|
+
/* @__PURE__ */ e.jsx("td", { className: "no-print", style: { padding: "1rem", textAlign: "center" }, children: /* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { padding: "0.25rem 0.5rem", color: "var(--pk-danger)", border: "none" }, onClick: () => P(i.id), children: "×" }) })
|
|
2485
|
+
] }, i.id)) })
|
|
2486
|
+
] }),
|
|
2487
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline no-print", onClick: D, style: { marginBottom: "2rem" }, children: "+ Add Line Item" }),
|
|
2488
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ e.jsxs("div", { style: { width: "300px" }, children: [
|
|
2489
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", marginBottom: "1rem" }, children: [
|
|
2490
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-body", children: "Subtotal" }),
|
|
2491
|
+
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
2492
|
+
"$",
|
|
2493
|
+
y.toFixed(2)
|
|
2494
|
+
] })
|
|
2495
|
+
] }),
|
|
2496
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "1rem" }, children: [
|
|
2497
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-body", children: "Tax Rate (%)" }),
|
|
2498
|
+
/* @__PURE__ */ e.jsx("input", { type: "number", className: "pk-input no-print", style: { width: "80px", textAlign: "right" }, value: l, onChange: (i) => T(parseFloat(i.target.value) || 0) }),
|
|
2499
|
+
/* @__PURE__ */ e.jsxs("span", { style: { display: "none" }, children: [
|
|
2500
|
+
l,
|
|
2501
|
+
"%"
|
|
2502
|
+
] })
|
|
2503
|
+
] }),
|
|
2504
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", marginBottom: "1rem", color: "var(--pk-text-muted)" }, children: [
|
|
2505
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-body", children: "Tax Amount" }),
|
|
2506
|
+
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
2507
|
+
"$",
|
|
2508
|
+
C.toFixed(2)
|
|
2509
|
+
] })
|
|
2510
|
+
] }),
|
|
2511
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginTop: "1rem", borderTop: "2px solid var(--pk-border)", paddingTop: "1rem" }, children: [
|
|
2512
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-heading-md", children: "Total Due" }),
|
|
2513
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-heading-lg", style: { color: "var(--pk-primary)" }, children: [
|
|
2514
|
+
"$",
|
|
2515
|
+
B.toFixed(2)
|
|
2516
|
+
] })
|
|
2517
|
+
] })
|
|
2518
|
+
] }) }),
|
|
2519
|
+
/* @__PURE__ */ e.jsxs("div", { className: "no-print", style: { display: "flex", justifyContent: "flex-end", gap: "1rem", marginTop: "3rem" }, children: [
|
|
2520
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-secondary", onClick: () => window.print(), children: "🖨️ Print to PDF" }),
|
|
2521
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", onClick: d, children: "✅ Save Invoice" })
|
|
2522
|
+
] })
|
|
2523
|
+
] });
|
|
2524
|
+
};
|
|
2525
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-container", style: { minHeight: "100vh" }, children: [
|
|
2526
|
+
/* @__PURE__ */ e.jsxs("div", { className: "no-print", style: { marginBottom: "2rem" }, children: [
|
|
2527
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", children: "Billing & Invoicing" }),
|
|
2528
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: "Manage clients and generate dynamic invoices." })
|
|
2529
|
+
] }),
|
|
2530
|
+
b(),
|
|
2531
|
+
/* @__PURE__ */ e.jsxs("div", { style: { position: "relative" }, children: [
|
|
2532
|
+
m === "dashboard" && M(),
|
|
2533
|
+
m === "clients" && I(),
|
|
2534
|
+
m === "creator" && r()
|
|
2535
|
+
] }),
|
|
2536
|
+
/* @__PURE__ */ e.jsx(W, {})
|
|
2537
|
+
] });
|
|
2538
|
+
}
|
|
2539
|
+
const Te = {
|
|
2540
|
+
platformName: "PopBites Delivery",
|
|
2541
|
+
categories: ["All", "Pizza", "Sushi", "Healthy", "Burgers", "Vegan"],
|
|
2542
|
+
restaurants: [
|
|
2543
|
+
{
|
|
2544
|
+
id: "r1",
|
|
2545
|
+
name: "Truffle & Crust",
|
|
2546
|
+
category: "Pizza",
|
|
2547
|
+
rating: 4.8,
|
|
2548
|
+
deliveryTime: "25-40 min",
|
|
2549
|
+
deliveryFee: 2.99,
|
|
2550
|
+
image: "https://images.unsplash.com/photo-1513104890138-7c749659a591?auto=format&fit=crop&w=800&q=80",
|
|
2551
|
+
menu: [
|
|
2552
|
+
{ id: "m1", name: "Margherita Truffle", description: "Fresh mozzarella, truffle oil, basil.", price: 18, dietary: ["Vegetarian"] },
|
|
2553
|
+
{ id: "m2", name: "Spicy Soppressata", description: "Hot honey, chili flakes, cured meats.", price: 21, dietary: [] },
|
|
2554
|
+
{ id: "m3", name: "Garlic Knots", description: "Oven-baked with pesto dip.", price: 6.5, dietary: ["Vegetarian"] }
|
|
2555
|
+
]
|
|
2556
|
+
},
|
|
2557
|
+
{
|
|
2558
|
+
id: "r2",
|
|
2559
|
+
name: "Ocean Zen",
|
|
2560
|
+
category: "Sushi",
|
|
2561
|
+
rating: 4.9,
|
|
2562
|
+
deliveryTime: "30-45 min",
|
|
2563
|
+
deliveryFee: 4.99,
|
|
2564
|
+
image: "https://images.unsplash.com/photo-1579871494447-9811cf80d66c?auto=format&fit=crop&w=800&q=80",
|
|
2565
|
+
menu: [
|
|
2566
|
+
{ id: "m4", name: "Spicy Tuna Roll", description: "Fresh tuna, spicy mayo, crispy tempura bits.", price: 14, dietary: ["Pescatarian", "Gluten-Free"] },
|
|
2567
|
+
{ id: "m5", name: "Dragon Roll", description: "Eel, cucumber, topped with avocado.", price: 16, dietary: [] },
|
|
2568
|
+
{ id: "m6", name: "Edamame", description: "Steamed soybeans with sea salt.", price: 5, dietary: ["Vegan", "Gluten-Free"] }
|
|
2569
|
+
]
|
|
2570
|
+
},
|
|
2571
|
+
{
|
|
2572
|
+
id: "r3",
|
|
2573
|
+
name: "Green Machine",
|
|
2574
|
+
category: "Vegan",
|
|
2575
|
+
rating: 4.6,
|
|
2576
|
+
deliveryTime: "15-25 min",
|
|
2577
|
+
deliveryFee: 1.99,
|
|
2578
|
+
image: "https://images.unsplash.com/photo-1512621776951-a57141f2eefd?auto=format&fit=crop&w=800&q=80",
|
|
2579
|
+
menu: [
|
|
2580
|
+
{ id: "m7", name: "Buddha Bowl", description: "Quinoa, roasted sweet potato, kale, tahini.", price: 15, dietary: ["Vegan", "Gluten-Free"] },
|
|
2581
|
+
{ id: "m8", name: "Beyond Burger", description: "Plant-based patty with vegan cheddar.", price: 16, dietary: ["Vegan"] },
|
|
2582
|
+
{ id: "m9", name: "Acai Smoothie", description: "Mixed berries, banana, oat milk.", price: 8, dietary: ["Vegan", "Gluten-Free"] }
|
|
2583
|
+
]
|
|
2584
|
+
}
|
|
2585
|
+
]
|
|
2586
|
+
};
|
|
2587
|
+
function _t() {
|
|
2588
|
+
const [m, o] = p("directory"), [n, j] = p(null), [u, N] = p("All"), [h, A] = p(""), [l, T] = p([]), [x, k] = p(0), [g, W] = p(null), { showToast: y, ToastContainer: C } = G();
|
|
2589
|
+
$(() => {
|
|
2590
|
+
const I = localStorage.getItem("popsite_food_cart");
|
|
2591
|
+
if (I)
|
|
2592
|
+
try {
|
|
2593
|
+
T(JSON.parse(I));
|
|
2594
|
+
} catch {
|
|
2595
|
+
}
|
|
2596
|
+
}, []), $(() => {
|
|
2597
|
+
localStorage.setItem("popsite_food_cart", JSON.stringify(l));
|
|
2598
|
+
}, [l]);
|
|
2599
|
+
const B = (I) => {
|
|
2600
|
+
const r = l.find((t) => t.item.id === I.id);
|
|
2601
|
+
T(r ? l.map((t) => t.item.id === I.id ? { ...t, qty: t.qty + 1 } : t) : [...l, { item: I, qty: 1 }]), y(`Added ${I.name} to cart`, "success");
|
|
2602
|
+
}, D = (I, r) => {
|
|
2603
|
+
T(l.map((t) => t.item.id === I ? { ...t, qty: Math.max(0, t.qty + r) } : t).filter((t) => t.qty > 0));
|
|
2604
|
+
}, P = () => {
|
|
2605
|
+
if (l.length === 0) return;
|
|
2606
|
+
const I = l.reduce((r, t) => r + t.item.price * t.qty, 0) + n.deliveryFee;
|
|
2607
|
+
W({
|
|
2608
|
+
id: `ORD-${Math.floor(Math.random() * 1e4)}`,
|
|
2609
|
+
restaurant: n,
|
|
2610
|
+
items: [...l],
|
|
2611
|
+
total: I
|
|
2612
|
+
}), T([]), k(0), o("tracker"), y("Order confirmed!", "success"), setTimeout(() => {
|
|
2613
|
+
k(1), y("Your order is out for delivery!", "info"), setTimeout(() => {
|
|
2614
|
+
k(2), y("Your order has arrived. Enjoy!", "success");
|
|
2615
|
+
}, 5e3);
|
|
2616
|
+
}, 4e3);
|
|
2617
|
+
}, S = () => {
|
|
2618
|
+
if (!n) return null;
|
|
2619
|
+
const I = l.reduce((t, a) => t + a.item.price * a.qty, 0), r = I + n.deliveryFee;
|
|
2620
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { position: "sticky", top: "20px", display: "flex", flexDirection: "column", height: "calc(100vh - 40px)" }, children: [
|
|
2621
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-header", style: { paddingBottom: "1rem", borderBottom: "1px solid var(--pk-border)" }, children: [
|
|
2622
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "Your Order" }),
|
|
2623
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-sm", children: n.name })
|
|
2624
|
+
] }),
|
|
2625
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-card-body", style: { flex: 1, overflowY: "auto", padding: "1rem" }, children: l.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "pk-empty-state", style: { padding: "2rem 1rem", border: "none" }, children: [
|
|
2626
|
+
/* @__PURE__ */ e.jsx("div", { style: { fontSize: "3rem", opacity: 0.5, marginBottom: "1rem" }, children: "🛒" }),
|
|
2627
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: "Cart is empty." })
|
|
2628
|
+
] }) : /* @__PURE__ */ e.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "1rem" }, children: l.map((t, a) => /* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
2629
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: 1 }, children: [
|
|
2630
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-label", style: { marginBottom: "0.25rem" }, children: t.item.name }),
|
|
2631
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-sm", children: [
|
|
2632
|
+
"$",
|
|
2633
|
+
(t.item.price * t.qty).toFixed(2)
|
|
2634
|
+
] })
|
|
2635
|
+
] }),
|
|
2636
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem", background: "var(--pk-bg-main)", borderRadius: "var(--pk-radius-full)", padding: "0.25rem" }, children: [
|
|
2637
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { borderRadius: "50%", width: 28, height: 28, padding: 0, display: "flex", alignItems: "center", justifyItems: "center", justifyContent: "center" }, onClick: () => D(t.item.id, -1), children: "-" }),
|
|
2638
|
+
/* @__PURE__ */ e.jsx("span", { style: { width: "20px", textAlign: "center", fontWeight: "bold" }, children: t.qty }),
|
|
2639
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { borderRadius: "50%", width: 28, height: 28, padding: 0, display: "flex", alignItems: "center", justifyItems: "center", justifyContent: "center" }, onClick: () => D(t.item.id, 1), children: "+" })
|
|
2640
|
+
] })
|
|
2641
|
+
] }, a)) }) }),
|
|
2642
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-footer", style: { padding: "1.5rem", background: "var(--pk-bg-main)" }, children: [
|
|
2643
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", marginBottom: "0.5rem" }, children: [
|
|
2644
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-body", children: "Subtotal" }),
|
|
2645
|
+
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
2646
|
+
"$",
|
|
2647
|
+
I.toFixed(2)
|
|
2648
|
+
] })
|
|
2649
|
+
] }),
|
|
2650
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", marginBottom: "1rem" }, children: [
|
|
2651
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-body", children: "Delivery Fee" }),
|
|
2652
|
+
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
2653
|
+
"$",
|
|
2654
|
+
n.deliveryFee.toFixed(2)
|
|
2655
|
+
] })
|
|
2656
|
+
] }),
|
|
2657
|
+
/* @__PURE__ */ e.jsxs(
|
|
2658
|
+
"button",
|
|
2659
|
+
{
|
|
2660
|
+
className: "pk-btn pk-btn-primary",
|
|
2661
|
+
style: { width: "100%", padding: "1rem", fontSize: "1.125rem" },
|
|
2662
|
+
disabled: l.length === 0,
|
|
2663
|
+
onClick: P,
|
|
2664
|
+
children: [
|
|
2665
|
+
"Checkout • $",
|
|
2666
|
+
r.toFixed(2)
|
|
2667
|
+
]
|
|
2668
|
+
}
|
|
2669
|
+
)
|
|
2670
|
+
] })
|
|
2671
|
+
] });
|
|
2672
|
+
}, d = () => {
|
|
2673
|
+
const I = Te.restaurants.filter((r) => {
|
|
2674
|
+
const t = u === "All" || r.category === u, a = r.name.toLowerCase().includes(h.toLowerCase());
|
|
2675
|
+
return t && a;
|
|
2676
|
+
});
|
|
2677
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", children: [
|
|
2678
|
+
/* @__PURE__ */ e.jsxs("div", { style: { marginBottom: "2rem" }, children: [
|
|
2679
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", style: { marginBottom: "0.5rem" }, children: Te.platformName }),
|
|
2680
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: "Cravings delivered to your door." })
|
|
2681
|
+
] }),
|
|
2682
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-glass", style: { padding: "1.5rem", marginBottom: "2rem", display: "flex", flexDirection: "column", gap: "1.5rem" }, children: [
|
|
2683
|
+
/* @__PURE__ */ e.jsx(
|
|
2684
|
+
"input",
|
|
2685
|
+
{
|
|
2686
|
+
type: "text",
|
|
2687
|
+
className: "pk-input",
|
|
2688
|
+
placeholder: "Search restaurants...",
|
|
2689
|
+
style: { width: "100%", maxWidth: "500px" },
|
|
2690
|
+
value: h,
|
|
2691
|
+
onChange: (r) => A(r.target.value)
|
|
2692
|
+
}
|
|
2693
|
+
),
|
|
2694
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "flex", gap: "0.75rem", overflowX: "auto", paddingBottom: "0.5rem" }, children: Te.categories.map((r) => /* @__PURE__ */ e.jsx(
|
|
2695
|
+
"button",
|
|
2696
|
+
{
|
|
2697
|
+
className: u === r ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline",
|
|
2698
|
+
style: { borderRadius: "var(--pk-radius-full)", padding: "0.5rem 1.25rem", whiteSpace: "nowrap" },
|
|
2699
|
+
onClick: () => N(r),
|
|
2700
|
+
children: r
|
|
2701
|
+
},
|
|
2702
|
+
r
|
|
2703
|
+
)) })
|
|
2704
|
+
] }),
|
|
2705
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-grid", style: { gridTemplateColumns: "repeat(auto-fill, minmax(320px, 1fr))" }, children: I.map((r) => /* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-card-interactive", style: { cursor: "pointer", display: "flex", flexDirection: "column" }, onClick: () => {
|
|
2706
|
+
j(r), o("menu");
|
|
2707
|
+
}, children: [
|
|
2708
|
+
/* @__PURE__ */ e.jsxs("div", { style: { height: "200px", width: "100%" }, children: [
|
|
2709
|
+
/* @__PURE__ */ e.jsx("img", { src: r.image, alt: r.name, style: { width: "100%", height: "100%", objectFit: "cover" }, onError: (t) => {
|
|
2710
|
+
t.target.style.display = "none", t.target.nextSibling.style.display = "flex";
|
|
2711
|
+
} }),
|
|
2712
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "none", width: "100%", height: "100%", background: "var(--pk-secondary)", color: "white", alignItems: "center", justifyContent: "center", fontSize: "2rem" }, children: r.name[0] })
|
|
2713
|
+
] }),
|
|
2714
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-body", style: { flex: 1 }, children: [
|
|
2715
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", marginBottom: "0.5rem" }, children: [
|
|
2716
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: r.name }),
|
|
2717
|
+
/* @__PURE__ */ e.jsxs("span", { style: { background: "#f59e0b", color: "white", padding: "0.25rem 0.5rem", borderRadius: "var(--pk-radius-sm)", fontWeight: "bold", fontSize: "0.875rem" }, children: [
|
|
2718
|
+
"★ ",
|
|
2719
|
+
r.rating
|
|
2720
|
+
] })
|
|
2721
|
+
] }),
|
|
2722
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-sm", style: { marginBottom: "1rem" }, children: [
|
|
2723
|
+
r.category,
|
|
2724
|
+
" • ",
|
|
2725
|
+
r.deliveryTime
|
|
2726
|
+
] }),
|
|
2727
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-badge", style: { background: "var(--pk-primary-light)", color: "var(--pk-primary)" }, children: [
|
|
2728
|
+
"Delivery: $",
|
|
2729
|
+
r.deliveryFee
|
|
2730
|
+
] })
|
|
2731
|
+
] })
|
|
2732
|
+
] }, r.id)) })
|
|
2733
|
+
] });
|
|
2734
|
+
}, b = () => /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", style: { display: "flex", gap: "2rem", alignItems: "flex-start" }, children: [
|
|
2735
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "2rem" }, children: [
|
|
2736
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { alignSelf: "flex-start" }, onClick: () => o("directory"), children: "← Back" }),
|
|
2737
|
+
/* @__PURE__ */ e.jsxs("div", { style: { height: "300px", width: "100%", borderRadius: "var(--pk-radius-lg)", overflow: "hidden", position: "relative" }, children: [
|
|
2738
|
+
/* @__PURE__ */ e.jsx("img", { src: n.image, alt: n.name, style: { width: "100%", height: "100%", objectFit: "cover" } }),
|
|
2739
|
+
/* @__PURE__ */ e.jsxs("div", { style: { position: "absolute", bottom: 0, left: 0, width: "100%", padding: "2rem", background: "linear-gradient(transparent, rgba(0,0,0,0.8))", color: "white" }, children: [
|
|
2740
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", style: { marginBottom: "0.5rem" }, children: n.name }),
|
|
2741
|
+
/* @__PURE__ */ e.jsxs("p", { style: { fontSize: "1.125rem", opacity: 0.9 }, children: [
|
|
2742
|
+
n.category,
|
|
2743
|
+
" • ",
|
|
2744
|
+
n.rating,
|
|
2745
|
+
" Rating"
|
|
2746
|
+
] })
|
|
2747
|
+
] })
|
|
2748
|
+
] }),
|
|
2749
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2750
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", style: { marginBottom: "1.5rem" }, children: "Menu" }),
|
|
2751
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-grid", style: { gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))" }, children: n.menu.map((I) => /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { padding: "1.5rem", display: "flex", flexDirection: "column" }, children: [
|
|
2752
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", marginBottom: "0.5rem" }, children: [
|
|
2753
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: I.name }),
|
|
2754
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-heading-md", style: { color: "var(--pk-primary)" }, children: [
|
|
2755
|
+
"$",
|
|
2756
|
+
I.price.toFixed(2)
|
|
2757
|
+
] })
|
|
2758
|
+
] }),
|
|
2759
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { marginBottom: "1rem", flex: 1 }, children: I.description }),
|
|
2760
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "flex", gap: "0.5rem", flexWrap: "wrap", marginBottom: "1.5rem" }, children: I.dietary.map((r) => /* @__PURE__ */ e.jsx("span", { className: "pk-badge", style: { background: "rgba(16, 185, 129, 0.1)", color: "var(--pk-success)" }, children: r }, r)) }),
|
|
2761
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { marginTop: "auto" }, onClick: () => B(I), children: "+ Add to Cart" })
|
|
2762
|
+
] }, I.id)) })
|
|
2763
|
+
] })
|
|
2764
|
+
] }),
|
|
2765
|
+
/* @__PURE__ */ e.jsx("div", { style: { width: "350px", flexShrink: 0 }, className: "pk-hidden-mobile", children: S() })
|
|
2766
|
+
] }), M = () => {
|
|
2767
|
+
if (!g) return null;
|
|
2768
|
+
const I = x === 0 ? 33 : x === 1 ? 66 : 100, r = ["Preparing", "Out for Delivery", "Arrived"];
|
|
2769
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", style: { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "80vh" }, children: [
|
|
2770
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { width: "100%", maxWidth: "600px", overflow: "hidden" }, children: [
|
|
2771
|
+
/* @__PURE__ */ e.jsxs("div", { style: { height: "250px", background: "linear-gradient(135deg, #e2e8f0, #cbd5e1)", position: "relative", overflow: "hidden", display: "flex", alignItems: "center", justifyContent: "center" }, children: [
|
|
2772
|
+
/* @__PURE__ */ e.jsx("div", { style: { position: "absolute", width: "200%", height: "200%", background: "radial-gradient(circle, transparent 20%, rgba(255,255,255,0.4) 20%, rgba(255,255,255,0.4) 80%, transparent 80%, transparent) 0 0, radial-gradient(circle, transparent 20%, rgba(255,255,255,0.4) 20%, rgba(255,255,255,0.4) 80%, transparent 80%, transparent) 50px 50px", backgroundSize: "100px 100px", opacity: 0.5 } }),
|
|
2773
|
+
/* @__PURE__ */ e.jsx("div", { style: { position: "relative", fontSize: "4rem", filter: "drop-shadow(0 10px 10px rgba(0,0,0,0.2))", animation: x === 1 ? "bounce 2s infinite" : "none" }, children: x === 0 ? "🧑🍳" : x === 1 ? "🛵" : "🎉" })
|
|
2774
|
+
] }),
|
|
2775
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-body", style: { padding: "3rem 2rem" }, children: [
|
|
2776
|
+
/* @__PURE__ */ e.jsxs("h2", { className: "pk-heading-xl", style: { textAlign: "center", marginBottom: "1rem" }, children: [
|
|
2777
|
+
"Order ",
|
|
2778
|
+
r[x]
|
|
2779
|
+
] }),
|
|
2780
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-body", style: { textAlign: "center", marginBottom: "3rem" }, children: [
|
|
2781
|
+
g.id,
|
|
2782
|
+
" • ",
|
|
2783
|
+
g.restaurant.name
|
|
2784
|
+
] }),
|
|
2785
|
+
/* @__PURE__ */ e.jsxs("div", { style: { position: "relative", marginBottom: "3rem" }, children: [
|
|
2786
|
+
/* @__PURE__ */ e.jsx("div", { style: { position: "absolute", top: "50%", left: 0, width: "100%", height: "4px", background: "var(--pk-bg-main)", transform: "translateY(-50%)", zIndex: 0 } }),
|
|
2787
|
+
/* @__PURE__ */ e.jsx("div", { style: { position: "absolute", top: "50%", left: 0, width: `${I}%`, height: "4px", background: "var(--pk-primary)", transform: "translateY(-50%)", zIndex: 1, transition: "width 1s cubic-bezier(0.4, 0, 0.2, 1)" } }),
|
|
2788
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "flex", justifyContent: "space-between", position: "relative", zIndex: 2 }, children: [0, 1, 2].map((t) => /* @__PURE__ */ e.jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: "0.5rem", width: "33.33%" }, children: [
|
|
2789
|
+
/* @__PURE__ */ e.jsx("div", { style: {
|
|
2790
|
+
width: "24px",
|
|
2791
|
+
height: "24px",
|
|
2792
|
+
borderRadius: "50%",
|
|
2793
|
+
background: t <= x ? "var(--pk-primary)" : "var(--pk-bg-main)",
|
|
2794
|
+
border: `4px solid ${t <= x ? "var(--pk-primary-light)" : "var(--pk-border)"}`,
|
|
2795
|
+
transition: "all 0.5s"
|
|
2796
|
+
} }),
|
|
2797
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-sm", style: { fontWeight: t === x ? 600 : 400, color: t <= x ? "var(--pk-text-main)" : "var(--pk-text-muted)" }, children: r[t] })
|
|
2798
|
+
] }, t)) })
|
|
2799
|
+
] }),
|
|
2800
|
+
/* @__PURE__ */ e.jsxs("div", { style: { background: "var(--pk-bg-main)", padding: "1.5rem", borderRadius: "var(--pk-radius-md)" }, children: [
|
|
2801
|
+
/* @__PURE__ */ e.jsx("h4", { className: "pk-label", style: { marginBottom: "1rem" }, children: "Order Summary" }),
|
|
2802
|
+
g.items.map((t, a) => /* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", marginBottom: "0.5rem" }, children: [
|
|
2803
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-text-sm", children: [
|
|
2804
|
+
t.qty,
|
|
2805
|
+
"x ",
|
|
2806
|
+
t.item.name
|
|
2807
|
+
] }),
|
|
2808
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-text-sm", children: [
|
|
2809
|
+
"$",
|
|
2810
|
+
(t.item.price * t.qty).toFixed(2)
|
|
2811
|
+
] })
|
|
2812
|
+
] }, a)),
|
|
2813
|
+
/* @__PURE__ */ e.jsxs("div", { style: { borderTop: "1px solid var(--pk-border)", marginTop: "1rem", paddingTop: "1rem", display: "flex", justifyContent: "space-between" }, children: [
|
|
2814
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-heading-md", children: "Total" }),
|
|
2815
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-heading-md", children: [
|
|
2816
|
+
"$",
|
|
2817
|
+
g.total.toFixed(2)
|
|
2818
|
+
] })
|
|
2819
|
+
] })
|
|
2820
|
+
] })
|
|
2821
|
+
] }),
|
|
2822
|
+
x === 2 && /* @__PURE__ */ e.jsx("div", { className: "pk-card-footer", style: { display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", onClick: () => {
|
|
2823
|
+
W(null), o("directory");
|
|
2824
|
+
}, children: "Back to Restaurants" }) })
|
|
2825
|
+
] }),
|
|
2826
|
+
/* @__PURE__ */ e.jsx("style", { children: `
|
|
2827
|
+
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
|
|
2828
|
+
` })
|
|
2829
|
+
] });
|
|
2830
|
+
};
|
|
2831
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { position: "relative", minHeight: "100vh", backgroundColor: "var(--pk-bg-main)" }, children: [
|
|
2832
|
+
m === "directory" && d(),
|
|
2833
|
+
m === "menu" && b(),
|
|
2834
|
+
m === "tracker" && M(),
|
|
2835
|
+
/* @__PURE__ */ e.jsx(C, {})
|
|
2836
|
+
] });
|
|
2837
|
+
}
|
|
2838
|
+
const Ke = {
|
|
2839
|
+
institutionName: "PopSite Academy",
|
|
2840
|
+
subjects: [
|
|
2841
|
+
{
|
|
2842
|
+
id: "sub_1",
|
|
2843
|
+
title: "Advanced React Patterns",
|
|
2844
|
+
duration: 15,
|
|
2845
|
+
// in minutes
|
|
2846
|
+
passingScore: 70,
|
|
2847
|
+
// percentage
|
|
2848
|
+
icon: "⚛️",
|
|
2849
|
+
questions: [
|
|
2850
|
+
{ id: "q1", text: "Which hook should be used to memoize an expensive calculation?", type: "multiple-choice", options: ["useMemo", "useCallback", "useEffect", "useState"], correct: "useMemo" },
|
|
2851
|
+
{ id: "q2", text: "What is the primary purpose of useCallback?", type: "multiple-choice", options: ["Memoizing a value", "Memoizing a function", "Managing side effects", "Accessing DOM nodes"], correct: "Memoizing a function" },
|
|
2852
|
+
{ id: "q3", text: "React components must return a single outer element.", type: "true-false", options: ["True", "False"], correct: "True" },
|
|
2853
|
+
{ id: "q4", text: "Which method is completely forbidden in modern React 'State' arrays to avoid mutation?", type: "multiple-choice", options: ["concat", "filter", "map", "push"], correct: "push" },
|
|
2854
|
+
{ id: "q5", text: "useEffect cleanup functions run BEFORE the component unmounts.", type: "true-false", options: ["True", "False"], correct: "True" }
|
|
2855
|
+
]
|
|
2856
|
+
},
|
|
2857
|
+
{
|
|
2858
|
+
id: "sub_2",
|
|
2859
|
+
title: "Modern CSS Mastery",
|
|
2860
|
+
duration: 10,
|
|
2861
|
+
passingScore: 80,
|
|
2862
|
+
icon: "🎨",
|
|
2863
|
+
questions: [
|
|
2864
|
+
{ id: "q1", text: "What property is used to create glassmorphism?", type: "multiple-choice", options: ["opacity", "backdrop-filter", "background-blend-mode", "filter"], correct: "backdrop-filter" },
|
|
2865
|
+
{ id: "q2", text: "Which display type enables a 2D layout matrix?", type: "multiple-choice", options: ["flex", "block", "grid", "inline-block"], correct: "grid" },
|
|
2866
|
+
{ id: "q3", text: "Variables defined in :root have global scope.", type: "true-false", options: ["True", "False"], correct: "True" }
|
|
2867
|
+
]
|
|
2868
|
+
}
|
|
2869
|
+
]
|
|
2870
|
+
};
|
|
2871
|
+
function zt() {
|
|
2872
|
+
const [m, o] = p("selection"), [n, j] = p(null), [u, N] = p(0), [h, A] = p({}), [l, T] = p(0), [x, k] = p(0), [g, W] = p(!1), [y, C] = p(!1), { showToast: B, ToastContainer: D } = G(), P = (i, f = 1e3) => {
|
|
2873
|
+
C(!0), setTimeout(() => {
|
|
2874
|
+
C(!1), i();
|
|
2875
|
+
}, f);
|
|
2876
|
+
};
|
|
2877
|
+
$(() => {
|
|
2878
|
+
let i;
|
|
2879
|
+
return m === "exam" && l > 0 ? i = setInterval(() => T((f) => f - 1), 1e3) : m === "exam" && l === 0 && S(), () => clearInterval(i);
|
|
2880
|
+
}, [m, l]);
|
|
2881
|
+
const S = () => {
|
|
2882
|
+
B("Time's up! Auto-submitting exam.", "info"), b();
|
|
2883
|
+
}, d = (i) => {
|
|
2884
|
+
P(() => {
|
|
2885
|
+
j(i), A({}), N(0), T(i.duration * 60), o("exam"), B(`Started: ${i.title}`, "success");
|
|
2886
|
+
});
|
|
2887
|
+
}, b = () => {
|
|
2888
|
+
P(() => {
|
|
2889
|
+
let i = 0;
|
|
2890
|
+
n.questions.forEach((F) => {
|
|
2891
|
+
h[F.id] === F.correct && i++;
|
|
2892
|
+
});
|
|
2893
|
+
const f = i / n.questions.length * 100;
|
|
2894
|
+
k(f), W(f >= n.passingScore), o("results"), B("Exam submitted successfully.", "success");
|
|
2895
|
+
}, 2e3);
|
|
2896
|
+
}, M = (i) => {
|
|
2897
|
+
const f = Math.floor(i / 60).toString().padStart(2, "0"), F = (i % 60).toString().padStart(2, "0");
|
|
2898
|
+
return `${f}:${F}`;
|
|
2899
|
+
}, I = (i, f) => {
|
|
2900
|
+
A((F) => ({ ...F, [i]: f }));
|
|
2901
|
+
}, r = () => /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", style: { minHeight: "80vh", display: "flex", flexDirection: "column", justifyContent: "center" }, children: [
|
|
2902
|
+
/* @__PURE__ */ e.jsxs("div", { style: { textAlign: "center", marginBottom: "3rem" }, children: [
|
|
2903
|
+
/* @__PURE__ */ e.jsxs("h1", { className: "pk-heading-xl", style: { marginBottom: "1rem" }, children: [
|
|
2904
|
+
Ke.institutionName,
|
|
2905
|
+
" Portal"
|
|
2906
|
+
] }),
|
|
2907
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { fontSize: "1.25rem" }, children: "Select a subject to begin your assessment." })
|
|
2908
|
+
] }),
|
|
2909
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(300px, 1fr))" }, children: Ke.subjects.map((i) => /* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-card-interactive", style: { padding: "2rem", display: "flex", flexDirection: "column" }, children: [
|
|
2910
|
+
/* @__PURE__ */ e.jsx("div", { style: { fontSize: "3rem", marginBottom: "1rem", opacity: 0.9 }, children: i.icon }),
|
|
2911
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "0.5rem" }, children: i.title }),
|
|
2912
|
+
/* @__PURE__ */ e.jsxs("div", { style: { marginBottom: "2rem", flex: 1, display: "flex", flexDirection: "column", gap: "0.5rem" }, children: [
|
|
2913
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-sm", children: [
|
|
2914
|
+
"⏱️ Duration: ",
|
|
2915
|
+
/* @__PURE__ */ e.jsxs("span", { style: { fontWeight: 600 }, children: [
|
|
2916
|
+
i.duration,
|
|
2917
|
+
" Minutes"
|
|
2918
|
+
] })
|
|
2919
|
+
] }),
|
|
2920
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-sm", children: [
|
|
2921
|
+
"📝 Questions: ",
|
|
2922
|
+
/* @__PURE__ */ e.jsx("span", { style: { fontWeight: 600 }, children: i.questions.length })
|
|
2923
|
+
] }),
|
|
2924
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-sm", children: [
|
|
2925
|
+
"🎯 Passing Score: ",
|
|
2926
|
+
/* @__PURE__ */ e.jsxs("span", { style: { fontWeight: 600 }, children: [
|
|
2927
|
+
i.passingScore,
|
|
2928
|
+
"%"
|
|
2929
|
+
] })
|
|
2930
|
+
] })
|
|
2931
|
+
] }),
|
|
2932
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary pk-w-full", onClick: () => d(i), children: "Start Exam" })
|
|
2933
|
+
] }, i.id)) })
|
|
2934
|
+
] }), t = () => {
|
|
2935
|
+
const i = n.questions[u], f = u === n.questions.length - 1, F = (u + 1) / n.questions.length * 100;
|
|
2936
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", style: { display: "flex", flexDirection: "column", alignItems: "center", paddingTop: "4rem" }, children: [
|
|
2937
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-glass", style: { width: "100%", maxWidth: "800px", display: "flex", justifyContent: "space-between", alignItems: "center", padding: "1.5rem", marginBottom: "2rem", position: "sticky", top: "1rem", zIndex: 10 }, children: [
|
|
2938
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2939
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: n.title }),
|
|
2940
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-sm", children: [
|
|
2941
|
+
"Question ",
|
|
2942
|
+
u + 1,
|
|
2943
|
+
" of ",
|
|
2944
|
+
n.questions.length
|
|
2945
|
+
] })
|
|
2946
|
+
] }),
|
|
2947
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "1rem" }, children: [
|
|
2948
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-sm", children: "Time Remaining:" }),
|
|
2949
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-badge", style: { fontSize: "1.5rem", background: l < 120 ? "var(--pk-danger)" : "var(--pk-primary)", color: "white", padding: "0.5rem 1rem" }, children: M(l) })
|
|
2950
|
+
] })
|
|
2951
|
+
] }),
|
|
2952
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { width: "100%", maxWidth: "800px", padding: "3rem", minHeight: "400px", display: "flex", flexDirection: "column" }, children: [
|
|
2953
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", style: { marginBottom: "2.5rem" }, children: i.text }),
|
|
2954
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "1rem", flex: 1 }, children: i.options.map((w, R) => {
|
|
2955
|
+
const q = h[i.id] === w;
|
|
2956
|
+
return /* @__PURE__ */ e.jsxs(
|
|
2957
|
+
"button",
|
|
2958
|
+
{
|
|
2959
|
+
className: q ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline",
|
|
2960
|
+
style: {
|
|
2961
|
+
justifyContent: "flex-start",
|
|
2962
|
+
padding: "1.5rem",
|
|
2963
|
+
fontSize: "1.125rem",
|
|
2964
|
+
textAlign: "left",
|
|
2965
|
+
border: q ? "2px solid var(--pk-primary)" : "2px solid var(--pk-border)"
|
|
2966
|
+
},
|
|
2967
|
+
onClick: () => I(i.id, w),
|
|
2968
|
+
children: [
|
|
2969
|
+
/* @__PURE__ */ e.jsx("span", { style: {
|
|
2970
|
+
display: "inline-flex",
|
|
2971
|
+
alignItems: "center",
|
|
2972
|
+
justifyContent: "center",
|
|
2973
|
+
width: "24px",
|
|
2974
|
+
height: "24px",
|
|
2975
|
+
borderRadius: "50%",
|
|
2976
|
+
marginRight: "1rem",
|
|
2977
|
+
background: q ? "white" : "transparent",
|
|
2978
|
+
color: q ? "var(--pk-primary)" : "var(--pk-text-muted)",
|
|
2979
|
+
border: q ? "none" : "2px solid var(--pk-border)",
|
|
2980
|
+
fontWeight: "bold",
|
|
2981
|
+
fontSize: "0.875rem"
|
|
2982
|
+
}, children: String.fromCharCode(65 + R) }),
|
|
2983
|
+
w
|
|
2984
|
+
]
|
|
2985
|
+
},
|
|
2986
|
+
R
|
|
2987
|
+
);
|
|
2988
|
+
}) }),
|
|
2989
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginTop: "3rem", paddingTop: "2rem", borderTop: "1px solid var(--pk-border)" }, children: [
|
|
2990
|
+
/* @__PURE__ */ e.jsx(
|
|
2991
|
+
"button",
|
|
2992
|
+
{
|
|
2993
|
+
className: "pk-btn pk-btn-outline",
|
|
2994
|
+
disabled: u === 0,
|
|
2995
|
+
onClick: () => N((w) => w - 1),
|
|
2996
|
+
children: "← Previous"
|
|
2997
|
+
}
|
|
2998
|
+
),
|
|
2999
|
+
/* @__PURE__ */ e.jsx("div", { style: { width: "150px", background: "var(--pk-bg-main)", height: "6px", borderRadius: "3px", position: "relative" }, children: /* @__PURE__ */ e.jsx("div", { style: { position: "absolute", top: 0, left: 0, height: "100%", background: "var(--pk-primary)", borderRadius: "3px", width: `${F}%`, transition: "width 0.3s" } }) }),
|
|
3000
|
+
f ? /* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", onClick: b, children: "Submit Exam ✅" }) : /* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", onClick: () => N((w) => w + 1), children: "Next →" })
|
|
3001
|
+
] })
|
|
3002
|
+
] })
|
|
3003
|
+
] });
|
|
3004
|
+
}, a = () => {
|
|
3005
|
+
const i = 283 - 283 * x / 100, f = g ? "var(--pk-success)" : "var(--pk-danger)";
|
|
3006
|
+
return /* @__PURE__ */ e.jsx("div", { className: "pk-container animate-fade-in", style: { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "80vh" }, children: /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { width: "100%", maxWidth: "600px", textAlign: "center", overflow: "hidden" }, children: [
|
|
3007
|
+
/* @__PURE__ */ e.jsxs("div", { style: { background: g ? "var(--pk-success)" : "var(--pk-danger)", color: "white", padding: "2rem" }, children: [
|
|
3008
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", style: { marginBottom: "0.5rem" }, children: g ? "Congratulations!" : "Exam Failed" }),
|
|
3009
|
+
/* @__PURE__ */ e.jsx("p", { style: { fontSize: "1.25rem", opacity: 0.9 }, children: n.title })
|
|
3010
|
+
] }),
|
|
3011
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-body", style: { padding: "4rem 2rem", display: "flex", flexDirection: "column", alignItems: "center" }, children: [
|
|
3012
|
+
/* @__PURE__ */ e.jsxs("div", { style: { position: "relative", width: "160px", height: "160px", marginBottom: "2rem" }, children: [
|
|
3013
|
+
/* @__PURE__ */ e.jsxs("svg", { viewBox: "0 0 100 100", style: { width: "100%", height: "100%", transform: "rotate(-90deg)" }, children: [
|
|
3014
|
+
/* @__PURE__ */ e.jsx("circle", { cx: "50", cy: "50", r: "45", fill: "none", stroke: "var(--pk-border)", strokeWidth: "8" }),
|
|
3015
|
+
/* @__PURE__ */ e.jsx(
|
|
3016
|
+
"circle",
|
|
3017
|
+
{
|
|
3018
|
+
cx: "50",
|
|
3019
|
+
cy: "50",
|
|
3020
|
+
r: "45",
|
|
3021
|
+
fill: "none",
|
|
3022
|
+
stroke: f,
|
|
3023
|
+
strokeWidth: "8",
|
|
3024
|
+
strokeDasharray: "283",
|
|
3025
|
+
strokeDashoffset: i,
|
|
3026
|
+
strokeLinecap: "round",
|
|
3027
|
+
style: { transition: "stroke-dashoffset 1.5s ease-out" }
|
|
3028
|
+
}
|
|
3029
|
+
)
|
|
3030
|
+
] }),
|
|
3031
|
+
/* @__PURE__ */ e.jsx("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ e.jsxs("span", { className: "pk-heading-lg", style: { lineHeight: 1 }, children: [
|
|
3032
|
+
Math.round(x),
|
|
3033
|
+
"%"
|
|
3034
|
+
] }) })
|
|
3035
|
+
] }),
|
|
3036
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: "3rem", marginBottom: "2rem" }, children: [
|
|
3037
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3038
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-muted pk-label", children: "Passing Score" }),
|
|
3039
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-heading-md", children: [
|
|
3040
|
+
n.passingScore,
|
|
3041
|
+
"%"
|
|
3042
|
+
] })
|
|
3043
|
+
] }),
|
|
3044
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3045
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-muted pk-label", children: "Time Spent" }),
|
|
3046
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-heading-md", children: M(n.duration * 60 - l) })
|
|
3047
|
+
] })
|
|
3048
|
+
] })
|
|
3049
|
+
] }),
|
|
3050
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-card-footer", style: { padding: "1.5rem", display: "flex", justifyContent: "center", gap: "1rem" }, children: /* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", onClick: () => o("selection"), children: "Return to Dashboard" }) })
|
|
3051
|
+
] }) });
|
|
3052
|
+
};
|
|
3053
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { position: "relative", minHeight: "100vh", backgroundColor: "var(--pk-bg-main)" }, children: [
|
|
3054
|
+
y && /* @__PURE__ */ e.jsxs("div", { style: { position: "fixed", inset: 0, backgroundColor: "rgba(255,255,255,0.8)", zIndex: 100, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", backdropFilter: "blur(4px)" }, children: [
|
|
3055
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-skeleton", style: { width: "80px", height: "80px", borderRadius: "50%", marginBottom: "1rem" } }),
|
|
3056
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "Processing..." })
|
|
3057
|
+
] }),
|
|
3058
|
+
m === "selection" && r(),
|
|
3059
|
+
m === "exam" && t(),
|
|
3060
|
+
m === "results" && a(),
|
|
3061
|
+
/* @__PURE__ */ e.jsx(D, {})
|
|
3062
|
+
] });
|
|
3063
|
+
}
|
|
3064
|
+
const ye = {
|
|
3065
|
+
schoolName: "PopSite University",
|
|
3066
|
+
departments: ["Computer Science", "Design", "Business Administration", "Engineering"],
|
|
3067
|
+
enrolledStudents: [
|
|
3068
|
+
{ id: "STU-2026-001", firstName: "Alice", lastName: "Johnson", email: "alice.j@popsite.edu", phone: "555-0101", department: "Computer Science", year: "Freshman", gpa: 3.8 },
|
|
3069
|
+
{ id: "STU-2026-002", firstName: "Bob", lastName: "Smith", email: "bob.s@popsite.edu", phone: "555-0102", department: "Design", year: "Sophomore", gpa: 3.5 },
|
|
3070
|
+
{ id: "STU-2026-003", firstName: "Charlie", lastName: "Brown", email: "charlie.b@popsite.edu", phone: "555-0103", department: "Engineering", year: "Senior", gpa: 3.9 }
|
|
3071
|
+
]
|
|
3072
|
+
};
|
|
3073
|
+
function Lt() {
|
|
3074
|
+
const [m, o] = p("roster"), [n, j] = p(ye.enrolledStudents), [u, N] = p(""), [h, A] = p(1), [l, T] = p({
|
|
3075
|
+
firstName: "",
|
|
3076
|
+
lastName: "",
|
|
3077
|
+
email: "",
|
|
3078
|
+
phone: "",
|
|
3079
|
+
department: "",
|
|
3080
|
+
year: ""
|
|
3081
|
+
}), [x, k] = p(null), { showToast: g, ToastContainer: W } = G();
|
|
3082
|
+
$(() => {
|
|
3083
|
+
const r = localStorage.getItem("popsite_students");
|
|
3084
|
+
if (r)
|
|
3085
|
+
try {
|
|
3086
|
+
j(JSON.parse(r));
|
|
3087
|
+
} catch {
|
|
3088
|
+
}
|
|
3089
|
+
}, []), $(() => {
|
|
3090
|
+
localStorage.setItem("popsite_students", JSON.stringify(n));
|
|
3091
|
+
}, [n]);
|
|
3092
|
+
const y = (r) => /^[0-9\-\+\s\(\)]{7,15}$/.test(r), C = (r) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r), B = () => {
|
|
3093
|
+
if (h === 1) {
|
|
3094
|
+
if (!l.firstName || !l.lastName || !l.email || !l.phone) {
|
|
3095
|
+
g("All fields required", "error");
|
|
3096
|
+
return;
|
|
3097
|
+
}
|
|
3098
|
+
if (!C(l.email)) {
|
|
3099
|
+
g("Invalid email format", "error");
|
|
3100
|
+
return;
|
|
3101
|
+
}
|
|
3102
|
+
if (!y(l.phone)) {
|
|
3103
|
+
g("Invalid phone format", "error");
|
|
3104
|
+
return;
|
|
3105
|
+
}
|
|
3106
|
+
} else if (h === 2 && (!l.department || !l.year)) {
|
|
3107
|
+
g("Please select department and year", "error");
|
|
3108
|
+
return;
|
|
3109
|
+
}
|
|
3110
|
+
A((r) => r + 1);
|
|
3111
|
+
}, D = () => {
|
|
3112
|
+
const r = {
|
|
3113
|
+
...l,
|
|
3114
|
+
id: `STU-2026-${Math.floor(Math.random() * 1e3).toString().padStart(3, "0")}`,
|
|
3115
|
+
gpa: 0
|
|
3116
|
+
};
|
|
3117
|
+
j([...n, r]), g(`${l.firstName} registered successfully!`, "success"), o("roster");
|
|
3118
|
+
}, P = () => {
|
|
3119
|
+
j((r) => r.map((t) => t.id === x.id ? x : t)), g("Profile updated!", "success"), o("roster");
|
|
3120
|
+
}, S = () => {
|
|
3121
|
+
if (n.length === 0) return;
|
|
3122
|
+
const r = Object.keys(n[0]), t = r.join(",") + `
|
|
3123
|
+
` + n.map((F) => r.map((w) => `"${F[w]}"`).join(",")).join(`
|
|
3124
|
+
`), a = new Blob([t], { type: "text/csv" }), i = URL.createObjectURL(a), f = document.createElement("a");
|
|
3125
|
+
f.href = i, f.download = `student_roster_${Date.now()}.csv`, f.click(), g("Roster Exported to CSV", "success");
|
|
3126
|
+
}, d = () => {
|
|
3127
|
+
T({ firstName: "", lastName: "", email: "", phone: "", department: "", year: "" }), A(1), o("wizard");
|
|
3128
|
+
}, b = () => {
|
|
3129
|
+
const r = n.filter(
|
|
3130
|
+
(t) => `${t.firstName} ${t.lastName}`.toLowerCase().includes(u.toLowerCase()) || t.email.toLowerCase().includes(u.toLowerCase())
|
|
3131
|
+
);
|
|
3132
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", children: [
|
|
3133
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", marginBottom: "2rem", flexWrap: "wrap", gap: "1rem" }, children: [
|
|
3134
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3135
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", style: { marginBottom: "0.5rem" }, children: ye.schoolName }),
|
|
3136
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: "Admissions & Roster Management" })
|
|
3137
|
+
] }),
|
|
3138
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: "1rem" }, children: [
|
|
3139
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", onClick: S, children: "⬇️ Export CSV" }),
|
|
3140
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", onClick: d, children: "+ New Admission" })
|
|
3141
|
+
] })
|
|
3142
|
+
] }),
|
|
3143
|
+
/* @__PURE__ */ e.jsx("div", { style: { marginBottom: "2rem" }, children: /* @__PURE__ */ e.jsx("input", { type: "text", className: "pk-input", style: { width: "100%", maxWidth: "400px" }, placeholder: "Search students by name or email...", value: u, onChange: (t) => N(t.target.value) }) }),
|
|
3144
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-grid", style: { gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))" }, children: r.map((t) => /* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-card-interactive", style: { padding: "1.5rem" }, children: [
|
|
3145
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", marginBottom: "1rem" }, children: [
|
|
3146
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-badge", children: t.id }),
|
|
3147
|
+
/* @__PURE__ */ e.jsxs("span", { style: { fontWeight: "bold", color: t.gpa >= 3.5 ? "var(--pk-success)" : "var(--pk-text-main)" }, children: [
|
|
3148
|
+
"GPA: ",
|
|
3149
|
+
t.gpa.toFixed(1)
|
|
3150
|
+
] })
|
|
3151
|
+
] }),
|
|
3152
|
+
/* @__PURE__ */ e.jsxs("h3", { className: "pk-heading-md", style: { marginBottom: "0.25rem" }, children: [
|
|
3153
|
+
t.firstName,
|
|
3154
|
+
" ",
|
|
3155
|
+
t.lastName
|
|
3156
|
+
] }),
|
|
3157
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-sm", style: { color: "var(--pk-primary)", marginBottom: "1rem" }, children: [
|
|
3158
|
+
t.department,
|
|
3159
|
+
" • ",
|
|
3160
|
+
t.year
|
|
3161
|
+
] }),
|
|
3162
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "0.5rem", marginBottom: "1.5rem" }, children: [
|
|
3163
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-text-sm", children: [
|
|
3164
|
+
"📧 ",
|
|
3165
|
+
t.email
|
|
3166
|
+
] }),
|
|
3167
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-text-sm", children: [
|
|
3168
|
+
"📞 ",
|
|
3169
|
+
t.phone
|
|
3170
|
+
] })
|
|
3171
|
+
] }),
|
|
3172
|
+
/* @__PURE__ */ e.jsx(
|
|
3173
|
+
"button",
|
|
3174
|
+
{
|
|
3175
|
+
className: "pk-btn pk-btn-outline pk-w-full",
|
|
3176
|
+
onClick: () => {
|
|
3177
|
+
k(t), o("edit");
|
|
3178
|
+
},
|
|
3179
|
+
children: "Edit Profile"
|
|
3180
|
+
}
|
|
3181
|
+
)
|
|
3182
|
+
] }, t.id)) })
|
|
3183
|
+
] });
|
|
3184
|
+
}, M = () => /* @__PURE__ */ e.jsx("div", { className: "pk-container animate-fade-in", style: { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "80vh" }, children: /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { width: "100%", maxWidth: "600px" }, children: [
|
|
3185
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-header", style: { padding: "2rem", borderBottom: "1px solid var(--pk-border)" }, children: [
|
|
3186
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "1.5rem" }, children: [
|
|
3187
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", children: "Admission Wizard" }),
|
|
3188
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { border: "none" }, onClick: () => o("roster"), children: "✕ Cancel" })
|
|
3189
|
+
] }),
|
|
3190
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", position: "relative" }, children: [
|
|
3191
|
+
/* @__PURE__ */ e.jsx("div", { style: { position: "absolute", top: "50%", left: "0", width: "100%", height: "2px", background: "var(--pk-border)", zIndex: 0, transform: "translateY(-50%)" } }),
|
|
3192
|
+
/* @__PURE__ */ e.jsx("div", { style: { position: "absolute", top: "50%", left: "0", width: `${(h - 1) / 2 * 100}%`, height: "2px", background: "var(--pk-primary)", zIndex: 1, transform: "translateY(-50%)", transition: "width 0.3s" } }),
|
|
3193
|
+
["Personal", "Academic", "Review"].map((r, t) => /* @__PURE__ */ e.jsxs("div", { style: { position: "relative", zIndex: 2, display: "flex", flexDirection: "column", alignItems: "center", width: "40px" }, children: [
|
|
3194
|
+
/* @__PURE__ */ e.jsx("div", { style: { width: "24px", height: "24px", borderRadius: "50%", background: h > t ? "var(--pk-primary)" : "var(--pk-bg-main)", border: `2px solid ${h >= t + 1 ? "var(--pk-primary)" : "var(--pk-border)"}`, color: "white", display: "flex", alignItems: "center", justifyContent: "center", fontSize: "10px" }, children: h > t ? "✓" : t + 1 }),
|
|
3195
|
+
/* @__PURE__ */ e.jsx("span", { style: { position: "absolute", bottom: "-20px", fontSize: "0.75rem", color: h >= t + 1 ? "var(--pk-text-main)" : "var(--pk-text-muted)" }, children: r })
|
|
3196
|
+
] }, t))
|
|
3197
|
+
] })
|
|
3198
|
+
] }),
|
|
3199
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-body", style: { padding: "3rem 2rem" }, children: [
|
|
3200
|
+
h === 1 && /* @__PURE__ */ e.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "1.5rem" }, children: [
|
|
3201
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: "1rem" }, children: [
|
|
3202
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", style: { flex: 1 }, children: [
|
|
3203
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "First Name *" }),
|
|
3204
|
+
/* @__PURE__ */ e.jsx("input", { type: "text", className: "pk-input", value: l.firstName, onChange: (r) => T({ ...l, firstName: r.target.value }) })
|
|
3205
|
+
] }),
|
|
3206
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", style: { flex: 1 }, children: [
|
|
3207
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Last Name *" }),
|
|
3208
|
+
/* @__PURE__ */ e.jsx("input", { type: "text", className: "pk-input", value: l.lastName, onChange: (r) => T({ ...l, lastName: r.target.value }) })
|
|
3209
|
+
] })
|
|
3210
|
+
] }),
|
|
3211
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", children: [
|
|
3212
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Email Address *" }),
|
|
3213
|
+
/* @__PURE__ */ e.jsx("input", { type: "email", className: "pk-input", value: l.email, onChange: (r) => T({ ...l, email: r.target.value }), placeholder: "student@example.com" })
|
|
3214
|
+
] }),
|
|
3215
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", children: [
|
|
3216
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Phone Number *" }),
|
|
3217
|
+
/* @__PURE__ */ e.jsx("input", { type: "tel", className: "pk-input", value: l.phone, onChange: (r) => T({ ...l, phone: r.target.value }), placeholder: "555-0100" })
|
|
3218
|
+
] })
|
|
3219
|
+
] }),
|
|
3220
|
+
h === 2 && /* @__PURE__ */ e.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "1.5rem" }, children: [
|
|
3221
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", children: [
|
|
3222
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Target Department *" }),
|
|
3223
|
+
/* @__PURE__ */ e.jsxs("select", { className: "pk-input", value: l.department, onChange: (r) => T({ ...l, department: r.target.value }), children: [
|
|
3224
|
+
/* @__PURE__ */ e.jsx("option", { value: "", children: "-- Select Department --" }),
|
|
3225
|
+
ye.departments.map((r) => /* @__PURE__ */ e.jsx("option", { value: r, children: r }, r))
|
|
3226
|
+
] })
|
|
3227
|
+
] }),
|
|
3228
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", children: [
|
|
3229
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Entry Year *" }),
|
|
3230
|
+
/* @__PURE__ */ e.jsxs("select", { className: "pk-input", value: l.year, onChange: (r) => T({ ...l, year: r.target.value }), children: [
|
|
3231
|
+
/* @__PURE__ */ e.jsx("option", { value: "", children: "-- Select Level --" }),
|
|
3232
|
+
/* @__PURE__ */ e.jsx("option", { value: "Freshman", children: "Freshman" }),
|
|
3233
|
+
/* @__PURE__ */ e.jsx("option", { value: "Transfer", children: "Transfer" }),
|
|
3234
|
+
/* @__PURE__ */ e.jsx("option", { value: "Graduate", children: "Graduate" })
|
|
3235
|
+
] })
|
|
3236
|
+
] })
|
|
3237
|
+
] }),
|
|
3238
|
+
h === 3 && /* @__PURE__ */ e.jsxs("div", { children: [
|
|
3239
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "1.5rem" }, children: "Review Application" }),
|
|
3240
|
+
/* @__PURE__ */ e.jsx("div", { style: { background: "var(--pk-bg-main)", padding: "1.5rem", borderRadius: "var(--pk-radius-md)" }, children: /* @__PURE__ */ e.jsx("table", { style: { width: "100%", textAlign: "left" }, children: /* @__PURE__ */ e.jsxs("tbody", { children: [
|
|
3241
|
+
/* @__PURE__ */ e.jsxs("tr", { children: [
|
|
3242
|
+
/* @__PURE__ */ e.jsx("td", { style: { padding: "0.5rem", color: "var(--pk-text-muted)" }, children: "Name" }),
|
|
3243
|
+
/* @__PURE__ */ e.jsxs("td", { style: { fontWeight: 600 }, children: [
|
|
3244
|
+
l.firstName,
|
|
3245
|
+
" ",
|
|
3246
|
+
l.lastName
|
|
3247
|
+
] })
|
|
3248
|
+
] }),
|
|
3249
|
+
/* @__PURE__ */ e.jsxs("tr", { children: [
|
|
3250
|
+
/* @__PURE__ */ e.jsx("td", { style: { padding: "0.5rem", color: "var(--pk-text-muted)" }, children: "Email" }),
|
|
3251
|
+
/* @__PURE__ */ e.jsx("td", { style: { fontWeight: 600 }, children: l.email })
|
|
3252
|
+
] }),
|
|
3253
|
+
/* @__PURE__ */ e.jsxs("tr", { children: [
|
|
3254
|
+
/* @__PURE__ */ e.jsx("td", { style: { padding: "0.5rem", color: "var(--pk-text-muted)" }, children: "Phone" }),
|
|
3255
|
+
/* @__PURE__ */ e.jsx("td", { style: { fontWeight: 600 }, children: l.phone })
|
|
3256
|
+
] }),
|
|
3257
|
+
/* @__PURE__ */ e.jsxs("tr", { children: [
|
|
3258
|
+
/* @__PURE__ */ e.jsx("td", { style: { padding: "0.5rem", color: "var(--pk-text-muted)" }, children: "Dept" }),
|
|
3259
|
+
/* @__PURE__ */ e.jsx("td", { style: { fontWeight: 600 }, children: l.department })
|
|
3260
|
+
] }),
|
|
3261
|
+
/* @__PURE__ */ e.jsxs("tr", { children: [
|
|
3262
|
+
/* @__PURE__ */ e.jsx("td", { style: { padding: "0.5rem", color: "var(--pk-text-muted)" }, children: "Year" }),
|
|
3263
|
+
/* @__PURE__ */ e.jsx("td", { style: { fontWeight: 600 }, children: l.year })
|
|
3264
|
+
] })
|
|
3265
|
+
] }) }) })
|
|
3266
|
+
] })
|
|
3267
|
+
] }),
|
|
3268
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-footer", style: { display: "flex", justifyContent: "space-between", padding: "1.5rem 2rem" }, children: [
|
|
3269
|
+
/* @__PURE__ */ e.jsx(
|
|
3270
|
+
"button",
|
|
3271
|
+
{
|
|
3272
|
+
className: "pk-btn pk-btn-outline",
|
|
3273
|
+
style: { visibility: h === 1 ? "hidden" : "visible" },
|
|
3274
|
+
onClick: () => A((r) => r - 1),
|
|
3275
|
+
children: "← Previous"
|
|
3276
|
+
}
|
|
3277
|
+
),
|
|
3278
|
+
h < 3 ? /* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", onClick: B, children: "Next Step →" }) : /* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", style: { background: "var(--pk-success)" }, onClick: D, children: "Confirm Admission ✅" })
|
|
3279
|
+
] })
|
|
3280
|
+
] }) }), I = () => x ? /* @__PURE__ */ e.jsx("div", { className: "pk-container animate-fade-in", style: { display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { width: "100%", maxWidth: "600px", padding: "3rem" }, children: [
|
|
3281
|
+
/* @__PURE__ */ e.jsxs("h2", { className: "pk-heading-lg", style: { marginBottom: "2rem" }, children: [
|
|
3282
|
+
"Edit Profile: ",
|
|
3283
|
+
x.id
|
|
3284
|
+
] }),
|
|
3285
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: "1rem", marginBottom: "1rem" }, children: [
|
|
3286
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", style: { flex: 1 }, children: [
|
|
3287
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "First Name" }),
|
|
3288
|
+
/* @__PURE__ */ e.jsx("input", { type: "text", className: "pk-input", value: x.firstName, onChange: (r) => k({ ...x, firstName: r.target.value }) })
|
|
3289
|
+
] }),
|
|
3290
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", style: { flex: 1 }, children: [
|
|
3291
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Last Name" }),
|
|
3292
|
+
/* @__PURE__ */ e.jsx("input", { type: "text", className: "pk-input", value: x.lastName, onChange: (r) => k({ ...x, lastName: r.target.value }) })
|
|
3293
|
+
] })
|
|
3294
|
+
] }),
|
|
3295
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", style: { marginBottom: "1rem" }, children: [
|
|
3296
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Department" }),
|
|
3297
|
+
/* @__PURE__ */ e.jsx("select", { className: "pk-input", value: x.department, onChange: (r) => k({ ...x, department: r.target.value }), children: ye.departments.map((r) => /* @__PURE__ */ e.jsx("option", { value: r, children: r }, r)) })
|
|
3298
|
+
] }),
|
|
3299
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: "1rem", marginTop: "3rem" }, children: [
|
|
3300
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", onClick: () => o("roster"), children: "Cancel" }),
|
|
3301
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", onClick: P, children: "Save Profile" })
|
|
3302
|
+
] })
|
|
3303
|
+
] }) }) : null;
|
|
3304
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { position: "relative", minHeight: "100vh", backgroundColor: "var(--pk-bg-main)" }, children: [
|
|
3305
|
+
m === "roster" && b(),
|
|
3306
|
+
m === "wizard" && M(),
|
|
3307
|
+
m === "edit" && I(),
|
|
3308
|
+
/* @__PURE__ */ e.jsx(W, {})
|
|
3309
|
+
] });
|
|
3310
|
+
}
|
|
3311
|
+
const ke = {
|
|
3312
|
+
hospitalName: "PopSite Medical Center",
|
|
3313
|
+
specialties: ["All", "Cardiology", "Pediatrics", "Neurology", "Orthopedics", "General Practice"],
|
|
3314
|
+
doctors: [
|
|
3315
|
+
{
|
|
3316
|
+
id: "dr1",
|
|
3317
|
+
name: "Dr. Sarah Chen",
|
|
3318
|
+
specialty: "Cardiology",
|
|
3319
|
+
rating: 4.9,
|
|
3320
|
+
image: "https://images.unsplash.com/photo-1559839734-2b71ea197ec2?auto=format&fit=crop&w=300&q=80",
|
|
3321
|
+
availableTimeSlots: ["09:00 AM", "10:30 AM", "01:00 PM", "03:00 PM"]
|
|
3322
|
+
},
|
|
3323
|
+
{
|
|
3324
|
+
id: "dr2",
|
|
3325
|
+
name: "Dr. James Miller",
|
|
3326
|
+
specialty: "Pediatrics",
|
|
3327
|
+
rating: 4.8,
|
|
3328
|
+
image: "https://images.unsplash.com/photo-1612349317150-e413f6a5b16d?auto=format&fit=crop&w=300&q=80",
|
|
3329
|
+
availableTimeSlots: ["08:30 AM", "09:00 AM", "11:00 AM", "02:15 PM", "04:00 PM"]
|
|
3330
|
+
},
|
|
3331
|
+
{
|
|
3332
|
+
id: "dr3",
|
|
3333
|
+
name: "Dr. Elena Rodriguez",
|
|
3334
|
+
specialty: "Neurology",
|
|
3335
|
+
rating: 4.7,
|
|
3336
|
+
image: "https://images.unsplash.com/photo-1594824432258-297ebce5b326?auto=format&fit=crop&w=300&q=80",
|
|
3337
|
+
availableTimeSlots: ["10:00 AM", "11:30 AM"]
|
|
3338
|
+
},
|
|
3339
|
+
{
|
|
3340
|
+
id: "dr4",
|
|
3341
|
+
name: "Dr. William Foster",
|
|
3342
|
+
specialty: "Orthopedics",
|
|
3343
|
+
rating: 4.9,
|
|
3344
|
+
image: "https://images.unsplash.com/photo-1537368910025-7028a609b183?auto=format&fit=crop&w=300&q=80",
|
|
3345
|
+
availableTimeSlots: ["01:00 PM", "02:30 PM", "04:45 PM"]
|
|
3346
|
+
}
|
|
3347
|
+
],
|
|
3348
|
+
patientHistory: [
|
|
3349
|
+
{
|
|
3350
|
+
id: "APT-882",
|
|
3351
|
+
doctorName: "Dr. Sarah Chen",
|
|
3352
|
+
date: "2025-11-15",
|
|
3353
|
+
time: "10:30 AM",
|
|
3354
|
+
status: "Completed",
|
|
3355
|
+
diagnosis: "Routine checkup. All healthy."
|
|
3356
|
+
}
|
|
3357
|
+
]
|
|
3358
|
+
// Real-time booked slots will go here
|
|
3359
|
+
};
|
|
3360
|
+
function $t() {
|
|
3361
|
+
const [m, o] = p("directory"), [n, j] = p(ke.doctors), [u, N] = p(ke.patientHistory), [h, A] = p(""), [l, T] = p("All"), [x, k] = p(null), [g, W] = p((/* @__PURE__ */ new Date()).toISOString().split("T")[0]), [y, C] = p(!1), { showToast: B, ToastContainer: D } = G();
|
|
3362
|
+
$(() => {
|
|
3363
|
+
const t = localStorage.getItem("popsite_hosp_docs"), a = localStorage.getItem("popsite_hosp_hist");
|
|
3364
|
+
if (t) try {
|
|
3365
|
+
j(JSON.parse(t));
|
|
3366
|
+
} catch {
|
|
3367
|
+
}
|
|
3368
|
+
if (a) try {
|
|
3369
|
+
N(JSON.parse(a));
|
|
3370
|
+
} catch {
|
|
3371
|
+
}
|
|
3372
|
+
}, []), $(() => {
|
|
3373
|
+
localStorage.setItem("popsite_hosp_docs", JSON.stringify(n)), localStorage.setItem("popsite_hosp_hist", JSON.stringify(u));
|
|
3374
|
+
}, [n, u]);
|
|
3375
|
+
const P = (t, a = 1e3) => {
|
|
3376
|
+
C(!0), setTimeout(() => {
|
|
3377
|
+
C(!1), t();
|
|
3378
|
+
}, a);
|
|
3379
|
+
}, S = (t) => {
|
|
3380
|
+
P(() => {
|
|
3381
|
+
const a = {
|
|
3382
|
+
id: `APT-${Math.floor(Math.random() * 1e4)}`,
|
|
3383
|
+
doctorName: x.name,
|
|
3384
|
+
doctorId: x.id,
|
|
3385
|
+
date: g,
|
|
3386
|
+
time: t,
|
|
3387
|
+
status: "Scheduled",
|
|
3388
|
+
diagnosis: "--"
|
|
3389
|
+
};
|
|
3390
|
+
N((i) => [a, ...i]), j((i) => i.map((f) => f.id === x.id ? { ...f, availableTimeSlots: f.availableTimeSlots.filter((F) => F !== t) } : f)), B(`Appointment confirmed for ${t}`, "success"), o("history");
|
|
3391
|
+
}, 1500);
|
|
3392
|
+
}, d = (t) => {
|
|
3393
|
+
P(() => {
|
|
3394
|
+
N((a) => a.map((i) => i.id === t.id ? { ...i, status: "Cancelled" } : i)), j((a) => a.map((i) => {
|
|
3395
|
+
if (i.id === t.doctorId) {
|
|
3396
|
+
const f = [...i.availableTimeSlots, t.time].sort();
|
|
3397
|
+
return { ...i, availableTimeSlots: f };
|
|
3398
|
+
}
|
|
3399
|
+
return i;
|
|
3400
|
+
})), B(`Appointment ${t.id} cancelled successfully`, "info");
|
|
3401
|
+
});
|
|
3402
|
+
}, b = () => /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { marginBottom: "2rem", padding: "1rem", display: "flex", gap: "1rem", overflowX: "auto" }, children: [
|
|
3403
|
+
/* @__PURE__ */ e.jsx("button", { className: m === "directory" ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline", onClick: () => o("directory"), children: "Find a Doctor" }),
|
|
3404
|
+
/* @__PURE__ */ e.jsx("button", { className: m === "history" ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline", onClick: () => o("history"), children: "My Appointments" })
|
|
3405
|
+
] }), M = () => {
|
|
3406
|
+
const t = n.filter((a) => {
|
|
3407
|
+
const i = l === "All" || a.specialty === l, f = a.name.toLowerCase().includes(h.toLowerCase());
|
|
3408
|
+
return i && f;
|
|
3409
|
+
});
|
|
3410
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "animate-fade-in", children: [
|
|
3411
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-glass", style: { padding: "1.5rem", marginBottom: "2rem", display: "flex", flexDirection: "column", gap: "1.5rem" }, children: [
|
|
3412
|
+
/* @__PURE__ */ e.jsx(
|
|
3413
|
+
"input",
|
|
3414
|
+
{
|
|
3415
|
+
type: "text",
|
|
3416
|
+
className: "pk-input",
|
|
3417
|
+
placeholder: "Search doctors by name...",
|
|
3418
|
+
style: { width: "100%", maxWidth: "500px" },
|
|
3419
|
+
value: h,
|
|
3420
|
+
onChange: (a) => A(a.target.value)
|
|
3421
|
+
}
|
|
3422
|
+
),
|
|
3423
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "flex", gap: "0.75rem", overflowX: "auto", paddingBottom: "0.5rem" }, children: ke.specialties.map((a) => /* @__PURE__ */ e.jsx(
|
|
3424
|
+
"button",
|
|
3425
|
+
{
|
|
3426
|
+
className: l === a ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline",
|
|
3427
|
+
style: { borderRadius: "var(--pk-radius-full)", padding: "0.5rem 1.25rem", whiteSpace: "nowrap" },
|
|
3428
|
+
onClick: () => T(a),
|
|
3429
|
+
children: a
|
|
3430
|
+
},
|
|
3431
|
+
a
|
|
3432
|
+
)) })
|
|
3433
|
+
] }),
|
|
3434
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-grid", style: { gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))" }, children: t.map((a) => {
|
|
3435
|
+
var i;
|
|
3436
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-card-interactive", style: { padding: "2rem", display: "flex", flexDirection: "column", alignItems: "center" }, children: [
|
|
3437
|
+
/* @__PURE__ */ e.jsx("img", { src: a.image, alt: a.name, style: { width: "120px", height: "120px", borderRadius: "50%", objectFit: "cover", marginBottom: "1.5rem", boxShadow: "var(--pk-shadow-md)" }, onError: (f) => {
|
|
3438
|
+
f.target.style.display = "none", f.target.nextSibling.style.display = "flex";
|
|
3439
|
+
} }),
|
|
3440
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "none", width: "120px", height: "120px", borderRadius: "50%", background: "var(--pk-primary-light)", color: "var(--pk-primary)", alignItems: "center", justifyContent: "center", fontSize: "2rem", fontWeight: "bold", marginBottom: "1.5rem" }, children: ((i = a.name.split(" ")[1]) == null ? void 0 : i[0]) || "D" }),
|
|
3441
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "0.5rem" }, children: a.name }),
|
|
3442
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-badge", style: { marginBottom: "1rem", background: "var(--pk-bg-main)", color: "var(--pk-text-muted)" }, children: a.specialty }),
|
|
3443
|
+
/* @__PURE__ */ e.jsxs("span", { style: { fontSize: "0.875rem", color: "#f59e0b", fontWeight: 600, marginBottom: "1.5rem" }, children: [
|
|
3444
|
+
"★ ",
|
|
3445
|
+
a.rating,
|
|
3446
|
+
" Rating"
|
|
3447
|
+
] }),
|
|
3448
|
+
/* @__PURE__ */ e.jsx(
|
|
3449
|
+
"button",
|
|
3450
|
+
{
|
|
3451
|
+
className: "pk-btn pk-btn-primary pk-w-full",
|
|
3452
|
+
onClick: () => {
|
|
3453
|
+
k(a), o("booking");
|
|
3454
|
+
},
|
|
3455
|
+
children: "Book Appointment"
|
|
3456
|
+
}
|
|
3457
|
+
)
|
|
3458
|
+
] }, a.id);
|
|
3459
|
+
}) })
|
|
3460
|
+
] });
|
|
3461
|
+
}, I = () => {
|
|
3462
|
+
if (!x) return null;
|
|
3463
|
+
const t = n.find((a) => a.id === x.id);
|
|
3464
|
+
return /* @__PURE__ */ e.jsx("div", { className: "animate-fade-in", style: { display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { width: "100%", maxWidth: "800px", padding: "3rem" }, children: [
|
|
3465
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { marginBottom: "2rem" }, onClick: () => o("directory"), children: "← Back" }),
|
|
3466
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: "2rem", alignItems: "center", marginBottom: "3rem", borderBottom: "1px solid var(--pk-border)", paddingBottom: "2rem" }, children: [
|
|
3467
|
+
/* @__PURE__ */ e.jsx("img", { src: t.image, alt: "", style: { width: "100px", height: "100px", borderRadius: "50%", objectFit: "cover" }, onError: (a) => {
|
|
3468
|
+
a.target.style.display = "none";
|
|
3469
|
+
} }),
|
|
3470
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3471
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", children: t.name }),
|
|
3472
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: t.specialty })
|
|
3473
|
+
] })
|
|
3474
|
+
] }),
|
|
3475
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", style: { marginBottom: "3rem", maxWidth: "300px" }, children: [
|
|
3476
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Select Date: " }),
|
|
3477
|
+
/* @__PURE__ */ e.jsx("input", { type: "date", className: "pk-input", value: g, onChange: (a) => W(a.target.value) })
|
|
3478
|
+
] }),
|
|
3479
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "1.5rem" }, children: "Available Time Slots" }),
|
|
3480
|
+
t.availableTimeSlots.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "pk-empty-state", style: { padding: "2rem", border: "1px solid var(--pk-border)" }, children: [
|
|
3481
|
+
/* @__PURE__ */ e.jsx("h4", { className: "pk-heading-md", children: "Fully Booked" }),
|
|
3482
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: "No remaining slots available for this doctor." })
|
|
3483
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "pk-grid", style: { gridTemplateColumns: "repeat(auto-fill, minmax(150px, 1fr))" }, children: t.availableTimeSlots.map((a) => /* @__PURE__ */ e.jsx(
|
|
3484
|
+
"button",
|
|
3485
|
+
{
|
|
3486
|
+
className: "pk-btn pk-btn-outline",
|
|
3487
|
+
style: { padding: "1rem", fontSize: "1.125rem" },
|
|
3488
|
+
onClick: () => S(a),
|
|
3489
|
+
children: a
|
|
3490
|
+
},
|
|
3491
|
+
a
|
|
3492
|
+
)) })
|
|
3493
|
+
] }) });
|
|
3494
|
+
}, r = () => /* @__PURE__ */ e.jsxs("div", { className: "animate-fade-in", children: [
|
|
3495
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", style: { marginBottom: "2rem" }, children: "Patient History" }),
|
|
3496
|
+
u.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "pk-empty-state", children: [
|
|
3497
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-empty-icon", style: { fontSize: "4rem" }, children: "🏥" }),
|
|
3498
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "No Appointments Found" }),
|
|
3499
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: "You have not scheduled any appointments yet." })
|
|
3500
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "pk-grid pk-flex-col pk-gap-4", children: u.map((t) => /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { padding: "1.5rem", display: "flex", justifyContent: "space-between", alignItems: "center", flexWrap: "wrap", gap: "1rem", borderLeft: t.status === "Cancelled" ? "4px solid var(--pk-danger)" : t.status === "Completed" ? "4px solid var(--pk-success)" : "4px solid var(--pk-primary)" }, children: [
|
|
3501
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3502
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: t.doctorName }),
|
|
3503
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-sm", style: { color: "var(--pk-primary)", fontWeight: 600, marginBottom: "0.5rem" }, children: [
|
|
3504
|
+
t.date,
|
|
3505
|
+
" • ",
|
|
3506
|
+
t.time
|
|
3507
|
+
] }),
|
|
3508
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-sm", children: [
|
|
3509
|
+
"ID: ",
|
|
3510
|
+
t.id
|
|
3511
|
+
] })
|
|
3512
|
+
] }),
|
|
3513
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "flex-end", gap: "0.5rem" }, children: [
|
|
3514
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-badge", style: { background: t.status === "Scheduled" ? "var(--pk-primary-light)" : "var(--pk-bg-main)", color: t.status === "Cancelled" ? "var(--pk-danger)" : "var(--pk-text-main)" }, children: t.status }),
|
|
3515
|
+
t.status === "Scheduled" && /* @__PURE__ */ e.jsx(
|
|
3516
|
+
"button",
|
|
3517
|
+
{
|
|
3518
|
+
className: "pk-btn pk-btn-outline",
|
|
3519
|
+
style: { color: "var(--pk-danger)", border: "none", padding: "0.5rem 1rem" },
|
|
3520
|
+
onClick: () => d(t),
|
|
3521
|
+
children: "Cancel Appointment"
|
|
3522
|
+
}
|
|
3523
|
+
)
|
|
3524
|
+
] })
|
|
3525
|
+
] }, t.id)) })
|
|
3526
|
+
] });
|
|
3527
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-container", style: { minHeight: "100vh" }, children: [
|
|
3528
|
+
y && /* @__PURE__ */ e.jsxs("div", { style: { position: "fixed", inset: 0, backgroundColor: "rgba(255,255,255,0.8)", zIndex: 100, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", backdropFilter: "blur(4px)" }, children: [
|
|
3529
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-skeleton", style: { width: "80px", height: "80px", borderRadius: "50%", marginBottom: "1rem" } }),
|
|
3530
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "Processing..." })
|
|
3531
|
+
] }),
|
|
3532
|
+
/* @__PURE__ */ e.jsxs("div", { style: { marginBottom: "2rem" }, children: [
|
|
3533
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", children: ke.hospitalName }),
|
|
3534
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: "Patient portal and reservation network." })
|
|
3535
|
+
] }),
|
|
3536
|
+
b(),
|
|
3537
|
+
/* @__PURE__ */ e.jsxs("div", { style: { position: "relative" }, children: [
|
|
3538
|
+
m === "directory" && M(),
|
|
3539
|
+
m === "booking" && I(),
|
|
3540
|
+
m === "history" && r()
|
|
3541
|
+
] }),
|
|
3542
|
+
/* @__PURE__ */ e.jsx(D, {})
|
|
3543
|
+
] });
|
|
3544
|
+
}
|
|
3545
|
+
const Q = {
|
|
3546
|
+
hero: {
|
|
3547
|
+
title: "Build Faster, Ship Better.",
|
|
3548
|
+
subtitle: "The ultimate zero-config React component architecture designed for the future of the web.",
|
|
3549
|
+
cta1: "Get Started Free",
|
|
3550
|
+
cta2: "View Documentation"
|
|
3551
|
+
},
|
|
3552
|
+
stats: {
|
|
3553
|
+
users: 15400,
|
|
3554
|
+
deployments: 89e3,
|
|
3555
|
+
uptime: 99.9
|
|
3556
|
+
},
|
|
3557
|
+
features: [
|
|
3558
|
+
{ id: "f1", title: "Zero Configuration", description: "No complex webpack or babel setups. Just import and go.", icon: "⚡" },
|
|
3559
|
+
{ id: "f2", title: "Vanilla CSS Engine", description: "Powered entirely by native CSS variables for maximum portability.", icon: "🎨" },
|
|
3560
|
+
{ id: "f3", title: "State Perseverance", description: "Built-in localStorage binding keeps user sessions active instantly.", icon: "💾" },
|
|
3561
|
+
{ id: "f4", title: "Glassmorphism UI", description: "Premium, frosted-glass aesthetics out of the box.", icon: "🔍" }
|
|
3562
|
+
],
|
|
3563
|
+
testimonials: [
|
|
3564
|
+
{ id: "t1", name: "Sarah Jenkins", role: "Frontend Lead at Acme", avatar: "https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&w=150&q=80", text: "PopSite UI completely changed how we prototype apps. The modules are instantly plug-and-play." },
|
|
3565
|
+
{ id: "t2", name: "David Chen", role: "Fullstack Developer", avatar: "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?auto=format&fit=crop&w=150&q=80", text: "I love the anti-Tailwind philosophy. The pure CSS approach feels so clean and blazing fast." },
|
|
3566
|
+
{ id: "t3", name: "Elena Rostova", role: "Product Designer", avatar: "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?auto=format&fit=crop&w=150&q=80", text: "The default drop shadows and glass effects give it a distinct 2026 enterprise feel. Absolutely stunning." }
|
|
3567
|
+
],
|
|
3568
|
+
pricing: [
|
|
3569
|
+
{ id: "p1", tier: "Hobby", price: "$0", features: ["1 Project", "Basic Modules", "Community Discord"], cta: "Start Free" },
|
|
3570
|
+
{ id: "p2", tier: "Pro", price: "$29/mo", featured: !0, features: ["Unlimited Projects", "All Pro Modules", "Premium Support", "Priority Updates"], cta: "Upgrade to Pro" },
|
|
3571
|
+
{ id: "p3", tier: "Enterprise", price: "Custom", features: ["Dedicated Account Manager", "Custom SLA", "Source Code Access"], cta: "Contact Sales" }
|
|
3572
|
+
]
|
|
3573
|
+
};
|
|
3574
|
+
function qt() {
|
|
3575
|
+
const [m, o] = p("hero"), [n, j] = p(0), [u, N] = p(0);
|
|
3576
|
+
$(() => {
|
|
3577
|
+
if (m !== "hero") return;
|
|
3578
|
+
const k = 2e3, g = 60, W = Q.stats.users / g, y = Q.stats.deployments / g;
|
|
3579
|
+
let C = 0;
|
|
3580
|
+
const B = setInterval(() => {
|
|
3581
|
+
C++, C <= g ? (j(Math.floor(W * C)), N(Math.floor(y * C))) : (j(Q.stats.users), N(Q.stats.deployments), clearInterval(B));
|
|
3582
|
+
}, k / g);
|
|
3583
|
+
return () => clearInterval(B);
|
|
3584
|
+
}, [m]);
|
|
3585
|
+
const h = () => /* @__PURE__ */ e.jsxs("nav", { className: "pk-nav pk-glass", children: [
|
|
3586
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-heading-md pk-gradient-text", style: { cursor: "pointer" }, onClick: () => o("hero"), children: "PopSite" }),
|
|
3587
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: "1.5rem" }, className: "pk-hidden-mobile", children: [
|
|
3588
|
+
/* @__PURE__ */ e.jsx("button", { style: { background: "none", border: "none", cursor: "pointer", fontWeight: 600, color: m === "hero" ? "var(--pk-primary)" : "var(--pk-text-main)" }, onClick: () => o("hero"), children: "Home" }),
|
|
3589
|
+
/* @__PURE__ */ e.jsx("button", { style: { background: "none", border: "none", cursor: "pointer", fontWeight: 600, color: m === "features" ? "var(--pk-primary)" : "var(--pk-text-main)" }, onClick: () => o("features"), children: "Features" }),
|
|
3590
|
+
/* @__PURE__ */ e.jsx("button", { style: { background: "none", border: "none", cursor: "pointer", fontWeight: 600, color: m === "testimonials" ? "var(--pk-primary)" : "var(--pk-text-main)" }, onClick: () => o("testimonials"), children: "Testimonials" }),
|
|
3591
|
+
/* @__PURE__ */ e.jsx("button", { style: { background: "none", border: "none", cursor: "pointer", fontWeight: 600, color: m === "pricing" ? "var(--pk-primary)" : "var(--pk-text-main)" }, onClick: () => o("pricing"), children: "Pricing" })
|
|
3592
|
+
] }),
|
|
3593
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", onClick: () => o("pricing"), children: "Get Started" })
|
|
3594
|
+
] }), A = () => /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", minHeight: "80vh", textAlign: "center" }, children: [
|
|
3595
|
+
/* @__PURE__ */ e.jsx("div", { style: { position: "absolute", top: "20%", left: "10%", width: "150px", height: "150px", background: "radial-gradient(circle, var(--pk-primary), transparent 70%)", opacity: 0.2, filter: "blur(20px)", animation: "floatA 6s infinite ease-in-out" } }),
|
|
3596
|
+
/* @__PURE__ */ e.jsx("div", { style: { position: "absolute", bottom: "20%", right: "10%", width: "250px", height: "250px", background: "radial-gradient(circle, var(--pk-secondary), transparent 70%)", opacity: 0.15, filter: "blur(30px)", animation: "floatB 8s infinite ease-in-out reverse" } }),
|
|
3597
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-badge", style: { marginBottom: "2rem", padding: "0.5rem 1rem", fontSize: "0.875rem" }, children: "✨ v1.0 is now live" }),
|
|
3598
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", style: { fontSize: "4.5rem", marginBottom: "1.5rem", lineHeight: 1.1 }, children: /* @__PURE__ */ e.jsx("span", { className: "pk-gradient-text", children: Q.hero.title }) }),
|
|
3599
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { fontSize: "1.5rem", maxWidth: "800px", marginBottom: "3rem" }, children: Q.hero.subtitle }),
|
|
3600
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: "1rem", marginBottom: "4rem" }, children: [
|
|
3601
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", style: { fontSize: "1.125rem", padding: "1rem 2rem" }, onClick: () => o("pricing"), children: Q.hero.cta1 }),
|
|
3602
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { fontSize: "1.125rem", padding: "1rem 2rem" }, onClick: () => o("features"), children: Q.hero.cta2 })
|
|
3603
|
+
] }),
|
|
3604
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-grid pk-glass", style: { gridTemplateColumns: "repeat(3, 1fr)", gap: "4rem", padding: "2rem 4rem", borderRadius: "var(--pk-radius-lg)", background: "var(--pk-bg-glass)", display: "inline-grid" }, children: [
|
|
3605
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3606
|
+
/* @__PURE__ */ e.jsxs("h2", { className: "pk-heading-lg", style: { color: "var(--pk-primary)" }, children: [
|
|
3607
|
+
n.toLocaleString(),
|
|
3608
|
+
"+"
|
|
3609
|
+
] }),
|
|
3610
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-muted pk-label", children: "Developers" })
|
|
3611
|
+
] }),
|
|
3612
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3613
|
+
/* @__PURE__ */ e.jsxs("h2", { className: "pk-heading-lg", style: { color: "var(--pk-secondary)" }, children: [
|
|
3614
|
+
u.toLocaleString(),
|
|
3615
|
+
"+"
|
|
3616
|
+
] }),
|
|
3617
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-muted pk-label", children: "Deployments" })
|
|
3618
|
+
] }),
|
|
3619
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3620
|
+
/* @__PURE__ */ e.jsxs("h2", { className: "pk-heading-lg", style: { color: "var(--pk-success)" }, children: [
|
|
3621
|
+
Q.stats.uptime,
|
|
3622
|
+
"%"
|
|
3623
|
+
] }),
|
|
3624
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-muted pk-label", children: "Uptime SLA" })
|
|
3625
|
+
] })
|
|
3626
|
+
] }),
|
|
3627
|
+
/* @__PURE__ */ e.jsx("style", { children: `
|
|
3628
|
+
@keyframes floatA { 0%, 100% { transform: translateY(0px) scale(1); } 50% { transform: translateY(-30px) scale(1.1); } }
|
|
3629
|
+
@keyframes floatB { 0%, 100% { transform: translateY(0px) scale(1); } 50% { transform: translateY(40px) scale(0.9); } }
|
|
3630
|
+
` })
|
|
3631
|
+
] }), l = () => /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", style: { padding: "4rem 2rem" }, children: [
|
|
3632
|
+
/* @__PURE__ */ e.jsxs("div", { style: { textAlign: "center", marginBottom: "4rem" }, children: [
|
|
3633
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-xl", style: { marginBottom: "1rem" }, children: "Architected for Speed" }),
|
|
3634
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { fontSize: "1.25rem" }, children: "Everything you need to build scalable interfaces without the bloat." })
|
|
3635
|
+
] }),
|
|
3636
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(350px, 1fr))", gap: "3rem" }, children: Q.features.map((k) => /* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-card-interactive", style: { padding: "3rem 2rem", textAlign: "center", background: "var(--pk-bg-glass)", border: "1px solid rgba(255,255,255,0.4)", backdropFilter: "blur(10px)" }, children: [
|
|
3637
|
+
/* @__PURE__ */ e.jsx("div", { style: { fontSize: "3rem", marginBottom: "1.5rem", filter: "drop-shadow(0 10px 10px rgba(0,0,0,0.1))" }, children: k.icon }),
|
|
3638
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "1rem" }, children: k.title }),
|
|
3639
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: k.description })
|
|
3640
|
+
] }, k.id)) })
|
|
3641
|
+
] }), T = () => /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", style: { padding: "4rem 2rem" }, children: [
|
|
3642
|
+
/* @__PURE__ */ e.jsxs("div", { style: { textAlign: "center", marginBottom: "4rem" }, children: [
|
|
3643
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-xl", style: { marginBottom: "1rem" }, children: "Loved by Engineers" }),
|
|
3644
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { fontSize: "1.25rem" }, children: "Here's what the community is saying." })
|
|
3645
|
+
] }),
|
|
3646
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(300px, 1fr))", gap: "2rem" }, children: Q.testimonials.map((k) => /* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-card-interactive", style: { padding: "2rem", display: "flex", flexDirection: "column", gap: "1.5rem" }, children: [
|
|
3647
|
+
/* @__PURE__ */ e.jsx("div", { style: { color: "#f59e0b", fontSize: "1.5rem", letterSpacing: "4px" }, children: "★★★★★" }),
|
|
3648
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-body", style: { fontSize: "1.125rem", fontStyle: "italic", flex: 1 }, children: [
|
|
3649
|
+
'"',
|
|
3650
|
+
k.text,
|
|
3651
|
+
'"'
|
|
3652
|
+
] }),
|
|
3653
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "1rem" }, children: [
|
|
3654
|
+
/* @__PURE__ */ e.jsx("img", { src: k.avatar, alt: k.name, style: { width: "50px", height: "50px", borderRadius: "50%", objectFit: "cover" } }),
|
|
3655
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3656
|
+
/* @__PURE__ */ e.jsx("h4", { className: "pk-label", children: k.name }),
|
|
3657
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-sm", style: { color: "var(--pk-primary)" }, children: k.role })
|
|
3658
|
+
] })
|
|
3659
|
+
] })
|
|
3660
|
+
] }, k.id)) })
|
|
3661
|
+
] }), x = () => /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", style: { padding: "4rem 2rem" }, children: [
|
|
3662
|
+
/* @__PURE__ */ e.jsxs("div", { style: { textAlign: "center", marginBottom: "4rem" }, children: [
|
|
3663
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-xl", style: { marginBottom: "1rem" }, children: "Simple, transparent pricing" }),
|
|
3664
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { fontSize: "1.25rem" }, children: "No hidden fees. Absolute freedom." })
|
|
3665
|
+
] }),
|
|
3666
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(300px, 1fr))", gap: "2rem", alignItems: "center" }, children: Q.pricing.map((k) => /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { padding: "3rem 2rem", position: "relative", border: k.featured ? "2px solid var(--pk-primary)" : "1px solid var(--pk-border)", transform: k.featured ? "scale(1.05)" : "scale(1)", zIndex: k.featured ? 10 : 1 }, children: [
|
|
3667
|
+
k.featured && /* @__PURE__ */ e.jsx("div", { style: { position: "absolute", top: 0, left: "50%", transform: "translate(-50%, -50%)", background: "var(--pk-primary)", color: "white", padding: "0.25rem 1rem", borderRadius: "var(--pk-radius-full)", fontWeight: 600, fontSize: "0.875rem" }, children: "Most Popular" }),
|
|
3668
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "0.5rem", textAlign: "center" }, children: k.tier }),
|
|
3669
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-heading-xl pk-gradient-text", style: { textAlign: "center", marginBottom: "2rem" }, children: k.price }),
|
|
3670
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "1rem", marginBottom: "3rem" }, children: k.features.map((g) => /* @__PURE__ */ e.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
3671
|
+
/* @__PURE__ */ e.jsx("span", { style: { color: "var(--pk-success)" }, children: "✓" }),
|
|
3672
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-body", children: g })
|
|
3673
|
+
] }, g)) }),
|
|
3674
|
+
/* @__PURE__ */ e.jsx("button", { className: `pk-btn pk-w-full ${k.featured ? "pk-btn-primary" : "pk-btn-outline"}`, style: { padding: "1rem" }, children: k.cta })
|
|
3675
|
+
] }, k.id)) })
|
|
3676
|
+
] });
|
|
3677
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { position: "relative", minHeight: "100vh", backgroundColor: "var(--pk-bg-main)", overflow: "hidden" }, children: [
|
|
3678
|
+
h(),
|
|
3679
|
+
m === "hero" && A(),
|
|
3680
|
+
m === "features" && l(),
|
|
3681
|
+
m === "testimonials" && T(),
|
|
3682
|
+
m === "pricing" && x()
|
|
3683
|
+
] });
|
|
3684
|
+
}
|
|
3685
|
+
const Be = {
|
|
3686
|
+
platformName: "Voyager Lodgings",
|
|
3687
|
+
amenities: ["WiFi", "Pool", "Gym", "Spa", "Restaurant", "Parking"],
|
|
3688
|
+
hotels: [
|
|
3689
|
+
{
|
|
3690
|
+
id: "h1",
|
|
3691
|
+
name: "The Obsidian Resort",
|
|
3692
|
+
destination: "Maldives",
|
|
3693
|
+
rating: 5,
|
|
3694
|
+
pricePerNight: 450,
|
|
3695
|
+
amenities: ["WiFi", "Pool", "Spa", "Restaurant"],
|
|
3696
|
+
image: "https://images.unsplash.com/photo-1566073771259-6a8506099945?auto=format&fit=crop&w=800&q=80",
|
|
3697
|
+
description: "Experience luxury in crystal clear waters. Wake up to ocean views.",
|
|
3698
|
+
gallery: [
|
|
3699
|
+
"https://images.unsplash.com/photo-1582719508461-905c673771fd?auto=format&fit=crop&w=800&q=80",
|
|
3700
|
+
"https://images.unsplash.com/photo-1571896349842-33c89424de2d?auto=format&fit=crop&w=800&q=80"
|
|
3701
|
+
]
|
|
3702
|
+
},
|
|
3703
|
+
{
|
|
3704
|
+
id: "h2",
|
|
3705
|
+
name: "Alpine Retreat",
|
|
3706
|
+
destination: "Swiss Alps",
|
|
3707
|
+
rating: 4,
|
|
3708
|
+
pricePerNight: 280,
|
|
3709
|
+
amenities: ["WiFi", "Gym", "Restaurant", "Parking"],
|
|
3710
|
+
image: "https://images.unsplash.com/photo-1520250497591-112f2f40a3f4?auto=format&fit=crop&w=800&q=80",
|
|
3711
|
+
description: "Cozy cabin living with ski-in, ski-out access and a roaring fireplace.",
|
|
3712
|
+
gallery: [
|
|
3713
|
+
"https://images.unsplash.com/photo-1621293954908-907159247fc8?auto=format&fit=crop&w=800&q=80"
|
|
3714
|
+
]
|
|
3715
|
+
},
|
|
3716
|
+
{
|
|
3717
|
+
id: "h3",
|
|
3718
|
+
name: "Neon Towers Hotel",
|
|
3719
|
+
destination: "Tokyo",
|
|
3720
|
+
rating: 5,
|
|
3721
|
+
pricePerNight: 350,
|
|
3722
|
+
amenities: ["WiFi", "Gym", "Restaurant"],
|
|
3723
|
+
image: "https://images.unsplash.com/photo-1503899036084-c55cdd92da26?auto=format&fit=crop&w=800&q=80",
|
|
3724
|
+
description: "Ultra-modern rooms suspended above the neon-drenched city streets.",
|
|
3725
|
+
gallery: [
|
|
3726
|
+
"https://images.unsplash.com/photo-1518548419970-58e3b4079ab2?auto=format&fit=crop&w=800&q=80"
|
|
3727
|
+
]
|
|
3728
|
+
},
|
|
3729
|
+
{
|
|
3730
|
+
id: "h4",
|
|
3731
|
+
name: "Hacienda Horizon",
|
|
3732
|
+
destination: "Tulum",
|
|
3733
|
+
rating: 3,
|
|
3734
|
+
pricePerNight: 120,
|
|
3735
|
+
amenities: ["WiFi", "Pool", "Parking"],
|
|
3736
|
+
image: "https://images.unsplash.com/photo-1510798831971-661eb04b3739?auto=format&fit=crop&w=800&q=80",
|
|
3737
|
+
description: "Boutique eco-resort nestled deeply in the Mayan jungle.",
|
|
3738
|
+
gallery: [
|
|
3739
|
+
"https://images.unsplash.com/photo-1590073844006-33379778ae09?auto=format&fit=crop&w=800&q=80"
|
|
3740
|
+
]
|
|
3741
|
+
}
|
|
3742
|
+
]
|
|
3743
|
+
};
|
|
3744
|
+
function Vt() {
|
|
3745
|
+
const [m, o] = p("search"), n = (/* @__PURE__ */ new Date()).toISOString().split("T")[0], j = new Date(Date.now() + 864e5 * 3).toISOString().split("T")[0], [u, N] = p(""), [h, A] = p(n), [l, T] = p(j), [x, k] = p(0), [g, W] = p([]), [y, C] = p(null), [B, D] = p(3), [P, S] = p(!1), { showToast: d, ToastContainer: b } = G();
|
|
3746
|
+
$(() => {
|
|
3747
|
+
const w = new Date(h), R = new Date(l), q = Math.ceil((R - w) / (1e3 * 60 * 60 * 24));
|
|
3748
|
+
q > 0 ? D(q) : D(0);
|
|
3749
|
+
}, [h, l]);
|
|
3750
|
+
const M = (w, R = 1500) => {
|
|
3751
|
+
S(!0), setTimeout(() => {
|
|
3752
|
+
S(!1), w();
|
|
3753
|
+
}, R);
|
|
3754
|
+
}, I = (w) => {
|
|
3755
|
+
if (w.preventDefault(), B <= 0) {
|
|
3756
|
+
d("Check-out must be after Check-in", "error");
|
|
3757
|
+
return;
|
|
3758
|
+
}
|
|
3759
|
+
M(() => {
|
|
3760
|
+
o("listing");
|
|
3761
|
+
});
|
|
3762
|
+
}, r = (w) => {
|
|
3763
|
+
g.includes(w) ? W((R) => R.filter((q) => q !== w)) : W((R) => [...R, w]);
|
|
3764
|
+
}, t = () => {
|
|
3765
|
+
M(() => {
|
|
3766
|
+
d(`Success! Your booking for ${y.name} is confirmed.`, "success"), o("search");
|
|
3767
|
+
}, 2e3);
|
|
3768
|
+
}, a = () => /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", style: { minHeight: "80vh", display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center" }, children: [
|
|
3769
|
+
/* @__PURE__ */ e.jsxs("div", { style: { textAlign: "center", marginBottom: "3rem" }, children: [
|
|
3770
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", style: { marginBottom: "1rem" }, children: Be.platformName }),
|
|
3771
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { fontSize: "1.25rem" }, children: "Find your perfect escape anywhere in the world." })
|
|
3772
|
+
] }),
|
|
3773
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-card pk-glass", style: { width: "100%", maxWidth: "800px", padding: "3rem" }, children: /* @__PURE__ */ e.jsxs("form", { onSubmit: I, style: { display: "flex", flexDirection: "column", gap: "1.5rem" }, children: [
|
|
3774
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", children: [
|
|
3775
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Where are you going?" }),
|
|
3776
|
+
/* @__PURE__ */ e.jsx("input", { type: "text", className: "pk-input", placeholder: "e.g. Tokyo, Swiss Alps, Maldives", value: u, onChange: (w) => N(w.target.value), required: !0 })
|
|
3777
|
+
] }),
|
|
3778
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: "1.5rem" }, children: [
|
|
3779
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", style: { flex: 1 }, children: [
|
|
3780
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Check In" }),
|
|
3781
|
+
/* @__PURE__ */ e.jsx("input", { type: "date", className: "pk-input", value: h, onChange: (w) => A(w.target.value), required: !0 })
|
|
3782
|
+
] }),
|
|
3783
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-input-group", style: { flex: 1 }, children: [
|
|
3784
|
+
/* @__PURE__ */ e.jsx("label", { className: "pk-label", children: "Check Out" }),
|
|
3785
|
+
/* @__PURE__ */ e.jsx("input", { type: "date", className: "pk-input", value: l, onChange: (w) => T(w.target.value), required: !0 })
|
|
3786
|
+
] })
|
|
3787
|
+
] }),
|
|
3788
|
+
B > 0 && /* @__PURE__ */ e.jsxs("p", { className: "pk-text-sm pk-text-center", style: { color: "var(--pk-primary)" }, children: [
|
|
3789
|
+
"Duration: ",
|
|
3790
|
+
B,
|
|
3791
|
+
" nights"
|
|
3792
|
+
] }),
|
|
3793
|
+
/* @__PURE__ */ e.jsx("button", { type: "submit", className: "pk-btn pk-btn-primary pk-w-full", style: { padding: "1.25rem", fontSize: "1.125rem", marginTop: "1rem" }, children: "Search Accommodations" })
|
|
3794
|
+
] }) })
|
|
3795
|
+
] }), i = () => {
|
|
3796
|
+
const w = Be.hotels.filter((R) => {
|
|
3797
|
+
const q = !u || R.destination.toLowerCase().includes(u.toLowerCase()), oe = x === 0 || R.rating >= x, de = g.every((ce) => R.amenities.includes(ce));
|
|
3798
|
+
return q && oe && de;
|
|
3799
|
+
});
|
|
3800
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", style: { display: "flex", gap: "2rem", alignItems: "flex-start" }, children: [
|
|
3801
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-hidden-mobile", style: { width: "300px", padding: "1.5rem", flexShrink: 0 }, children: [
|
|
3802
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline pk-w-full", style: { marginBottom: "2rem" }, onClick: () => o("search"), children: "← Modifiy Search" }),
|
|
3803
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "1rem" }, children: "Star Rating" }),
|
|
3804
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "0.5rem", marginBottom: "2rem" }, children: [
|
|
3805
|
+
[5, 4, 3].map((R) => /* @__PURE__ */ e.jsxs("label", { style: { display: "flex", alignItems: "center", gap: "0.5rem", cursor: "pointer" }, children: [
|
|
3806
|
+
/* @__PURE__ */ e.jsx("input", { type: "radio", name: "rating", checked: x === R, onChange: () => k(R), style: { accentColor: "var(--pk-primary)" } }),
|
|
3807
|
+
/* @__PURE__ */ e.jsx("span", { style: { color: "#f59e0b" }, children: "★".repeat(R) }),
|
|
3808
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-muted", children: "& up" })
|
|
3809
|
+
] }, R)),
|
|
3810
|
+
/* @__PURE__ */ e.jsxs("label", { style: { display: "flex", alignItems: "center", gap: "0.5rem", cursor: "pointer", marginTop: "0.5rem" }, children: [
|
|
3811
|
+
/* @__PURE__ */ e.jsx("input", { type: "radio", name: "rating", checked: x === 0, onChange: () => k(0), style: { accentColor: "var(--pk-primary)" } }),
|
|
3812
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-main", children: "Show All" })
|
|
3813
|
+
] })
|
|
3814
|
+
] }),
|
|
3815
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "1rem" }, children: "Amenities" }),
|
|
3816
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "0.5rem" }, children: Be.amenities.map((R) => /* @__PURE__ */ e.jsx(
|
|
3817
|
+
"button",
|
|
3818
|
+
{
|
|
3819
|
+
className: g.includes(R) ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline",
|
|
3820
|
+
style: { padding: "0.25rem 0.5rem", borderRadius: "4px", fontSize: "0.75rem" },
|
|
3821
|
+
onClick: () => r(R),
|
|
3822
|
+
children: R
|
|
3823
|
+
},
|
|
3824
|
+
R
|
|
3825
|
+
)) })
|
|
3826
|
+
] }),
|
|
3827
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "2rem" }, children: [
|
|
3828
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
3829
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", children: u || "All Destinations" }),
|
|
3830
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-text-muted", children: [
|
|
3831
|
+
w.length,
|
|
3832
|
+
" properties found"
|
|
3833
|
+
] })
|
|
3834
|
+
] }),
|
|
3835
|
+
w.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "pk-empty-state", children: [
|
|
3836
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "No properties found" }),
|
|
3837
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: "Try removing some filters." })
|
|
3838
|
+
] }) : w.map((R) => /* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-card-interactive", style: { display: "flex", flexWrap: "wrap", overflow: "hidden" }, children: [
|
|
3839
|
+
/* @__PURE__ */ e.jsx("div", { style: { flex: "1 1 300px", height: "250px" }, children: /* @__PURE__ */ e.jsx("img", { src: R.image, alt: R.name, style: { width: "100%", height: "100%", objectFit: "cover" } }) }),
|
|
3840
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: "2 1 300px", padding: "2rem", display: "flex", flexDirection: "column" }, children: [
|
|
3841
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", marginBottom: "0.5rem" }, children: [
|
|
3842
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3843
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-lg", children: R.name }),
|
|
3844
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-sm", style: { color: "var(--pk-primary)", display: "flex", alignItems: "center", gap: "0.5rem" }, children: [
|
|
3845
|
+
"📍 ",
|
|
3846
|
+
R.destination
|
|
3847
|
+
] })
|
|
3848
|
+
] }),
|
|
3849
|
+
/* @__PURE__ */ e.jsx("span", { style: { background: "#f59e0b", color: "white", padding: "0.25rem 0.5rem", borderRadius: "4px", fontWeight: "bold" }, children: "★".repeat(R.rating) })
|
|
3850
|
+
] }),
|
|
3851
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { margin: "1rem 0", flex: 1 }, children: R.description }),
|
|
3852
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "flex", gap: "0.5rem", flexWrap: "wrap", marginBottom: "1.5rem" }, children: R.amenities.map((q) => /* @__PURE__ */ e.jsx("span", { className: "pk-badge", children: q }, q)) }),
|
|
3853
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-end", borderTop: "1px solid var(--pk-border)", paddingTop: "1rem" }, children: [
|
|
3854
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3855
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-heading-lg", style: { color: "var(--pk-primary)" }, children: [
|
|
3856
|
+
"$",
|
|
3857
|
+
R.pricePerNight
|
|
3858
|
+
] }),
|
|
3859
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-muted", children: " / night" })
|
|
3860
|
+
] }),
|
|
3861
|
+
/* @__PURE__ */ e.jsx(
|
|
3862
|
+
"button",
|
|
3863
|
+
{
|
|
3864
|
+
className: "pk-btn pk-btn-primary",
|
|
3865
|
+
onClick: () => {
|
|
3866
|
+
C(R), o("gallery");
|
|
3867
|
+
},
|
|
3868
|
+
children: "View Deal"
|
|
3869
|
+
}
|
|
3870
|
+
)
|
|
3871
|
+
] })
|
|
3872
|
+
] })
|
|
3873
|
+
] }, R.id))
|
|
3874
|
+
] })
|
|
3875
|
+
] });
|
|
3876
|
+
}, f = () => y ? /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", children: [
|
|
3877
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { marginBottom: "2rem" }, onClick: () => o("listing"), children: "← Back" }),
|
|
3878
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-end", marginBottom: "2rem" }, children: [
|
|
3879
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3880
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", style: { marginBottom: "0.5rem" }, children: y.name }),
|
|
3881
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-body", style: { fontSize: "1.125rem" }, children: [
|
|
3882
|
+
"📍 ",
|
|
3883
|
+
y.destination
|
|
3884
|
+
] })
|
|
3885
|
+
] }),
|
|
3886
|
+
/* @__PURE__ */ e.jsxs("button", { className: "pk-btn pk-btn-primary", style: { padding: "1rem 2rem", fontSize: "1.25rem" }, onClick: () => o("summary"), children: [
|
|
3887
|
+
"Reserve • $",
|
|
3888
|
+
y.pricePerNight * B,
|
|
3889
|
+
" Total"
|
|
3890
|
+
] })
|
|
3891
|
+
] }),
|
|
3892
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", flexWrap: "wrap", gap: "1rem" }, children: [
|
|
3893
|
+
/* @__PURE__ */ e.jsx("div", { style: { flex: "2 1 500px", height: "400px", borderRadius: "var(--pk-radius-lg)", overflow: "hidden" }, children: /* @__PURE__ */ e.jsx("img", { src: y.image, alt: "", style: { width: "100%", height: "100%", objectFit: "cover" } }) }),
|
|
3894
|
+
/* @__PURE__ */ e.jsx("div", { style: { flex: "1 1 300px", display: "flex", flexDirection: "column", gap: "1rem" }, children: y.gallery.map((w, R) => /* @__PURE__ */ e.jsx("div", { style: { flex: 1, height: "192px", borderRadius: "var(--pk-radius-lg)", overflow: "hidden" }, children: /* @__PURE__ */ e.jsx("img", { src: w, alt: "", style: { width: "100%", height: "100%", objectFit: "cover" } }) }, R)) })
|
|
3895
|
+
] }),
|
|
3896
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { marginTop: "2rem", padding: "2rem" }, children: [
|
|
3897
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "1rem" }, children: "About this property" }),
|
|
3898
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: y.description }),
|
|
3899
|
+
/* @__PURE__ */ e.jsx("h4", { className: "pk-label", style: { marginTop: "2rem", marginBottom: "1rem" }, children: "Popular Amenities" }),
|
|
3900
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "flex", gap: "1rem", flexWrap: "wrap" }, children: y.amenities.map((w) => /* @__PURE__ */ e.jsxs("span", { className: "pk-badge", style: { fontSize: "1rem", padding: "0.5rem 1rem" }, children: [
|
|
3901
|
+
"✓ ",
|
|
3902
|
+
w
|
|
3903
|
+
] }, w)) })
|
|
3904
|
+
] })
|
|
3905
|
+
] }) : null, F = () => {
|
|
3906
|
+
if (!y) return null;
|
|
3907
|
+
const w = y.pricePerNight * B;
|
|
3908
|
+
return /* @__PURE__ */ e.jsx("div", { className: "pk-container animate-fade-in", style: { display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { width: "100%", maxWidth: "600px", padding: "3rem" }, children: [
|
|
3909
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "2rem" }, children: [
|
|
3910
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", children: "Review Booking" }),
|
|
3911
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { border: "none" }, onClick: () => o("gallery"), children: "Cancel" })
|
|
3912
|
+
] }),
|
|
3913
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: "1.5rem", marginBottom: "2rem", background: "var(--pk-bg-main)", padding: "1rem", borderRadius: "var(--pk-radius-md)" }, children: [
|
|
3914
|
+
/* @__PURE__ */ e.jsx("img", { src: y.image, alt: "", style: { width: "80px", height: "80px", borderRadius: "var(--pk-radius-sm)", objectFit: "cover" } }),
|
|
3915
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3916
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: y.name }),
|
|
3917
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-sm", style: { color: "var(--pk-primary)" }, children: y.destination })
|
|
3918
|
+
] })
|
|
3919
|
+
] }),
|
|
3920
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: "1rem", marginBottom: "2rem" }, children: [
|
|
3921
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { flex: 1, padding: "1rem", textAlign: "center" }, children: [
|
|
3922
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-label pk-text-muted", children: "Check-In" }),
|
|
3923
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-heading-sm", children: h })
|
|
3924
|
+
] }),
|
|
3925
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { flex: 1, padding: "1rem", textAlign: "center" }, children: [
|
|
3926
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-label pk-text-muted", children: "Check-Out" }),
|
|
3927
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-heading-sm", children: l })
|
|
3928
|
+
] })
|
|
3929
|
+
] }),
|
|
3930
|
+
/* @__PURE__ */ e.jsxs("div", { style: { borderTop: "1px solid var(--pk-border)", borderBottom: "1px solid var(--pk-border)", padding: "1.5rem 0", marginBottom: "2rem" }, children: [
|
|
3931
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "1rem" }, children: "Price Details" }),
|
|
3932
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", marginBottom: "0.5rem" }, children: [
|
|
3933
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-text-body", children: [
|
|
3934
|
+
"$",
|
|
3935
|
+
y.pricePerNight,
|
|
3936
|
+
" x ",
|
|
3937
|
+
B,
|
|
3938
|
+
" nights"
|
|
3939
|
+
] }),
|
|
3940
|
+
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
3941
|
+
"$",
|
|
3942
|
+
w
|
|
3943
|
+
] })
|
|
3944
|
+
] }),
|
|
3945
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", marginBottom: "0.5rem" }, children: [
|
|
3946
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-text-body", children: "Taxes and fees" }),
|
|
3947
|
+
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
3948
|
+
"$",
|
|
3949
|
+
(w * 0.1).toFixed(0)
|
|
3950
|
+
] })
|
|
3951
|
+
] })
|
|
3952
|
+
] }),
|
|
3953
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "2rem" }, children: [
|
|
3954
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-heading-lg", children: "Total (USD)" }),
|
|
3955
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-heading-xl", style: { color: "var(--pk-primary)" }, children: [
|
|
3956
|
+
"$",
|
|
3957
|
+
(w * 1.1).toFixed(0)
|
|
3958
|
+
] })
|
|
3959
|
+
] }),
|
|
3960
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary pk-w-full", style: { padding: "1.25rem", fontSize: "1.125rem" }, onClick: t, children: "Confirm & Pay" })
|
|
3961
|
+
] }) });
|
|
3962
|
+
};
|
|
3963
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { position: "relative", minHeight: "100vh", backgroundColor: "var(--pk-bg-main)" }, children: [
|
|
3964
|
+
P && /* @__PURE__ */ e.jsxs("div", { style: { position: "fixed", inset: 0, backgroundColor: "rgba(255,255,255,0.8)", zIndex: 100, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", backdropFilter: "blur(4px)" }, children: [
|
|
3965
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-skeleton", style: { width: "80px", height: "80px", borderRadius: "50%", marginBottom: "1rem" } }),
|
|
3966
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "Searching Global Availability..." })
|
|
3967
|
+
] }),
|
|
3968
|
+
m === "search" && a(),
|
|
3969
|
+
m === "listing" && i(),
|
|
3970
|
+
m === "gallery" && f(),
|
|
3971
|
+
m === "summary" && F(),
|
|
3972
|
+
/* @__PURE__ */ e.jsx(b, {})
|
|
3973
|
+
] });
|
|
3974
|
+
}
|
|
3975
|
+
const Re = {
|
|
3976
|
+
libraryName: "PopSite Central Library",
|
|
3977
|
+
catalog: [
|
|
3978
|
+
{ id: "b1", title: "The Pragmatic Programmer", author: "David Thomas", cover: "https://images.unsplash.com/photo-1544947950-fa07a98d237f?auto=format&fit=crop&w=400&q=80", genre: "Technology", available: !0 },
|
|
3979
|
+
{ id: "b2", title: "Clean Architecture", author: "Robert C. Martin", cover: "https://images.unsplash.com/photo-1589829085413-56de8ae18c73?auto=format&fit=crop&w=400&q=80", genre: "Technology", available: !0 },
|
|
3980
|
+
{ id: "b3", title: "Dune", author: "Frank Herbert", cover: "https://images.unsplash.com/photo-1616422285623-13ff0162193c?auto=format&fit=crop&w=400&q=80", genre: "Science Fiction", available: !1 },
|
|
3981
|
+
{ id: "b4", title: "The Martian", author: "Andy Weir", cover: "https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=400&q=80", genre: "Science Fiction", available: !0 },
|
|
3982
|
+
{ id: "b5", title: "Thinking, Fast and Slow", author: "Daniel Kahneman", cover: "https://images.unsplash.com/photo-1532012197267-da84d127e765?auto=format&fit=crop&w=400&q=80", genre: "Psychology", available: !0 }
|
|
3983
|
+
],
|
|
3984
|
+
myBooks: [
|
|
3985
|
+
{
|
|
3986
|
+
book: { id: "bX", title: "1984", author: "George Orwell", cover: "https://images.unsplash.com/photo-1541963463532-d68292c34b19?auto=format&fit=crop&w=400&q=80", genre: "Dystopian" },
|
|
3987
|
+
borrowDate: "2026-03-01",
|
|
3988
|
+
dueDate: "2026-03-15"
|
|
3989
|
+
// Purposefully in the past to trigger "Overdue" flag
|
|
3990
|
+
}
|
|
3991
|
+
]
|
|
3992
|
+
};
|
|
3993
|
+
function Ht() {
|
|
3994
|
+
const [m, o] = p("catalog"), [n, j] = p(Re.catalog), [u, N] = p(Re.myBooks), [h, A] = p(""), [l, T] = p(!1), { showToast: x, ToastContainer: k } = G();
|
|
3995
|
+
$(() => {
|
|
3996
|
+
const S = localStorage.getItem("popsite_library_cat"), d = localStorage.getItem("popsite_library_my");
|
|
3997
|
+
if (S) try {
|
|
3998
|
+
j(JSON.parse(S));
|
|
3999
|
+
} catch {
|
|
4000
|
+
}
|
|
4001
|
+
if (d) try {
|
|
4002
|
+
N(JSON.parse(d));
|
|
4003
|
+
} catch {
|
|
4004
|
+
}
|
|
4005
|
+
}, []), $(() => {
|
|
4006
|
+
localStorage.setItem("popsite_library_cat", JSON.stringify(n)), localStorage.setItem("popsite_library_my", JSON.stringify(u));
|
|
4007
|
+
}, [n, u]);
|
|
4008
|
+
const g = (S, d = 800) => {
|
|
4009
|
+
T(!0), setTimeout(() => {
|
|
4010
|
+
T(!1), S();
|
|
4011
|
+
}, d);
|
|
4012
|
+
}, W = (S) => {
|
|
4013
|
+
g(() => {
|
|
4014
|
+
const d = /* @__PURE__ */ new Date();
|
|
4015
|
+
d.setDate(d.getDate() + 14);
|
|
4016
|
+
const b = {
|
|
4017
|
+
book: S,
|
|
4018
|
+
borrowDate: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
4019
|
+
dueDate: d.toISOString().split("T")[0]
|
|
4020
|
+
};
|
|
4021
|
+
N([...u, b]), j(n.map((M) => M.id === S.id ? { ...M, available: !1 } : M)), x(`You have borrowed "${S.title}"`, "success");
|
|
4022
|
+
});
|
|
4023
|
+
}, y = (S) => {
|
|
4024
|
+
g(() => {
|
|
4025
|
+
N(u.filter((b) => b.book.id !== S.book.id));
|
|
4026
|
+
const d = n.find((b) => b.id === S.book.id);
|
|
4027
|
+
j(d ? n.map((b) => b.id === S.book.id ? { ...b, available: !0 } : b) : [...n, { ...S.book, available: !0 }]), x(`Returned "${S.book.title}" successfully`, "info");
|
|
4028
|
+
});
|
|
4029
|
+
}, C = (S) => {
|
|
4030
|
+
const d = new Date(S);
|
|
4031
|
+
return /* @__PURE__ */ new Date() > d;
|
|
4032
|
+
}, B = () => /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { marginBottom: "2rem", padding: "1rem", display: "flex", gap: "1rem" }, children: [
|
|
4033
|
+
/* @__PURE__ */ e.jsx("button", { className: m === "catalog" ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline", onClick: () => o("catalog"), children: "Public Catalog" }),
|
|
4034
|
+
/* @__PURE__ */ e.jsxs("button", { className: m === "dashboard" ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline", onClick: () => o("dashboard"), children: [
|
|
4035
|
+
"My Books (",
|
|
4036
|
+
u.length,
|
|
4037
|
+
")"
|
|
4038
|
+
] })
|
|
4039
|
+
] }), D = () => {
|
|
4040
|
+
const S = n.filter(
|
|
4041
|
+
(d) => d.title.toLowerCase().includes(h.toLowerCase()) || d.author.toLowerCase().includes(h.toLowerCase())
|
|
4042
|
+
);
|
|
4043
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "animate-fade-in", children: [
|
|
4044
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "2rem" }, children: [
|
|
4045
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", children: "Browse Collection" }),
|
|
4046
|
+
/* @__PURE__ */ e.jsx("input", { type: "text", className: "pk-input", placeholder: "Search title or author...", value: h, onChange: (d) => A(d.target.value) })
|
|
4047
|
+
] }),
|
|
4048
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-grid", style: { gridTemplateColumns: "repeat(auto-fill, minmax(220px, 1fr))" }, children: S.map((d) => /* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-card-interactive", style: { display: "flex", flexDirection: "column" }, children: [
|
|
4049
|
+
/* @__PURE__ */ e.jsx("div", { style: { height: "300px", width: "100%" }, children: /* @__PURE__ */ e.jsx("img", { src: d.cover, alt: d.title, style: { width: "100%", height: "100%", objectFit: "cover" }, onError: (b) => {
|
|
4050
|
+
b.target.style.display = "none";
|
|
4051
|
+
} }) }),
|
|
4052
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-body", style: { flex: 1, display: "flex", flexDirection: "column" }, children: [
|
|
4053
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-badge", style: { alignSelf: "flex-start", marginBottom: "0.5rem", background: "var(--pk-bg-main)", color: "var(--pk-text-muted)" }, children: d.genre }),
|
|
4054
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "0.25rem" }, children: d.title }),
|
|
4055
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-sm", style: { marginBottom: "1rem", flex: 1 }, children: d.author }),
|
|
4056
|
+
d.available ? /* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary pk-w-full", onClick: () => W(d), children: "Borrow Book" }) : /* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline pk-w-full", disabled: !0, children: "Currently Rented" })
|
|
4057
|
+
] })
|
|
4058
|
+
] }, d.id)) })
|
|
4059
|
+
] });
|
|
4060
|
+
}, P = () => /* @__PURE__ */ e.jsxs("div", { className: "animate-fade-in", children: [
|
|
4061
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", style: { marginBottom: "2rem" }, children: "My Bookshelf" }),
|
|
4062
|
+
u.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "pk-empty-state", children: [
|
|
4063
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-empty-icon", children: "📚" }),
|
|
4064
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "Your shelf is empty" }),
|
|
4065
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: "Go to the catalog to borrow some books." })
|
|
4066
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "pk-grid pk-flex-col pk-gap-4", children: u.map((S, d) => {
|
|
4067
|
+
const b = C(S.dueDate);
|
|
4068
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { display: "flex", alignItems: "center", gap: "1.5rem", padding: "1rem", borderLeft: b ? "4px solid var(--pk-danger)" : "1px solid var(--pk-border)" }, children: [
|
|
4069
|
+
/* @__PURE__ */ e.jsx("div", { style: { width: "80px", height: "110px", borderRadius: "4px", overflow: "hidden" }, children: /* @__PURE__ */ e.jsx("img", { src: S.book.cover, alt: "", style: { width: "100%", height: "100%", objectFit: "cover" } }) }),
|
|
4070
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: 1 }, children: [
|
|
4071
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "0.25rem" }, children: S.book.title }),
|
|
4072
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-sm", style: { marginBottom: "1rem" }, children: S.book.author }),
|
|
4073
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: "2rem" }, children: [
|
|
4074
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
4075
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-label pk-text-muted", style: { fontSize: "0.75rem" }, children: "Borrowed" }),
|
|
4076
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { fontWeight: 600 }, children: S.borrowDate })
|
|
4077
|
+
] }),
|
|
4078
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
4079
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-label pk-text-muted", style: { fontSize: "0.75rem" }, children: "Due Date" }),
|
|
4080
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { fontWeight: 600, color: b ? "var(--pk-danger)" : "var(--pk-text-main)" }, children: S.dueDate })
|
|
4081
|
+
] }),
|
|
4082
|
+
b && /* @__PURE__ */ e.jsx("div", { style: { alignSelf: "flex-end", background: "var(--pk-danger)", color: "white", padding: "0.1rem 0.5rem", borderRadius: "var(--pk-radius-sm)", fontSize: "0.75rem", fontWeight: "bold" }, children: "OVERDUE" })
|
|
4083
|
+
] })
|
|
4084
|
+
] }),
|
|
4085
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", onClick: () => y(S), children: "Return Book" })
|
|
4086
|
+
] }, d);
|
|
4087
|
+
}) })
|
|
4088
|
+
] });
|
|
4089
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-container", style: { minHeight: "100vh" }, children: [
|
|
4090
|
+
l && /* @__PURE__ */ e.jsxs("div", { style: { position: "fixed", inset: 0, backgroundColor: "rgba(255,255,255,0.7)", zIndex: 100, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", backdropFilter: "blur(4px)" }, children: [
|
|
4091
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-skeleton", style: { width: "80px", height: "80px", borderRadius: "50%", marginBottom: "1rem" } }),
|
|
4092
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "Syncing Library Database..." })
|
|
4093
|
+
] }),
|
|
4094
|
+
/* @__PURE__ */ e.jsxs("div", { style: { marginBottom: "2rem" }, children: [
|
|
4095
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", children: Re.libraryName }),
|
|
4096
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", children: "Your portal to infinite knowledge." })
|
|
4097
|
+
] }),
|
|
4098
|
+
B(),
|
|
4099
|
+
/* @__PURE__ */ e.jsxs("div", { style: { position: "relative" }, children: [
|
|
4100
|
+
m === "catalog" && D(),
|
|
4101
|
+
m === "dashboard" && P()
|
|
4102
|
+
] }),
|
|
4103
|
+
/* @__PURE__ */ e.jsx(k, {})
|
|
4104
|
+
] });
|
|
4105
|
+
}
|
|
4106
|
+
const Ze = {
|
|
4107
|
+
platformName: "PopSite Tickets",
|
|
4108
|
+
upcomingEvents: [
|
|
4109
|
+
{
|
|
4110
|
+
id: "ev1",
|
|
4111
|
+
title: "Global Tech Summit 2026",
|
|
4112
|
+
date: new Date(Date.now() + 864e5 * 5).toISOString(),
|
|
4113
|
+
// 5 days from now
|
|
4114
|
+
location: "San Francisco Convention Center",
|
|
4115
|
+
image: "https://images.unsplash.com/photo-1540575467063-178a50c2df87?auto=format&fit=crop&w=800&q=80",
|
|
4116
|
+
description: "The premier gathering of global tech leaders discussing AI, web architecture, and edge computing.",
|
|
4117
|
+
speakers: ["Dr. Evelyn Stone (AI Lead, Acme)", "Marcus Chen (Founder, WebCorp)"],
|
|
4118
|
+
agenda: ["09:00 - Keynote", "11:30 - The Future of Vanilla CSS", "15:00 - Networking Mixer"],
|
|
4119
|
+
tiers: [
|
|
4120
|
+
{ id: "t1", name: "General Admission", price: 299, capacity: 50 },
|
|
4121
|
+
{ id: "t2", name: "VIP Backstage", price: 899, capacity: 0 }
|
|
4122
|
+
// Sold out mock
|
|
4123
|
+
]
|
|
4124
|
+
},
|
|
4125
|
+
{
|
|
4126
|
+
id: "ev2",
|
|
4127
|
+
title: "Electronic Music Paradise",
|
|
4128
|
+
date: new Date(Date.now() + 864e5 * 12).toISOString(),
|
|
4129
|
+
// 12 days from now
|
|
4130
|
+
location: "Miami Beach Outdoor Arena",
|
|
4131
|
+
image: "https://images.unsplash.com/photo-1470229722913-7c090be5f524?auto=format&fit=crop&w=800&q=80",
|
|
4132
|
+
description: "A 3-day outdoor electronic music festival featuring top global DJs and immersive light shows.",
|
|
4133
|
+
speakers: ["DJ Nova", "The Synthetics"],
|
|
4134
|
+
agenda: ["Day 1 - Opening Ceremony", "Day 2 - Sunset Stage", "Day 3 - Fireworks Finale"],
|
|
4135
|
+
tiers: [
|
|
4136
|
+
{ id: "t3", name: "3-Day Pass", price: 349, capacity: 1500 },
|
|
4137
|
+
{ id: "t4", name: "VIP + Artist Meet", price: 1200, capacity: 15 }
|
|
4138
|
+
]
|
|
4139
|
+
}
|
|
4140
|
+
]
|
|
4141
|
+
};
|
|
4142
|
+
function Yt() {
|
|
4143
|
+
const [m, o] = p("feed"), [n, j] = p(null), [u, N] = p(!1), [h, A] = p(null), [l, T] = p(!1), [x, k] = p([]), { showToast: g, ToastContainer: W } = G();
|
|
4144
|
+
$(() => {
|
|
4145
|
+
const d = localStorage.getItem("popsite_events");
|
|
4146
|
+
if (d)
|
|
4147
|
+
try {
|
|
4148
|
+
k(JSON.parse(d));
|
|
4149
|
+
} catch {
|
|
4150
|
+
}
|
|
4151
|
+
}, []), $(() => {
|
|
4152
|
+
localStorage.setItem("popsite_events", JSON.stringify(x));
|
|
4153
|
+
}, [x]);
|
|
4154
|
+
const y = (d) => {
|
|
4155
|
+
const [b, M] = p({ days: 0, hours: 0, minutes: 0, seconds: 0 });
|
|
4156
|
+
return $(() => {
|
|
4157
|
+
const I = new Date(d).getTime(), r = setInterval(() => {
|
|
4158
|
+
const t = (/* @__PURE__ */ new Date()).getTime(), a = I - t;
|
|
4159
|
+
a <= 0 ? (clearInterval(r), M({ days: 0, hours: 0, minutes: 0, seconds: 0 })) : M({
|
|
4160
|
+
days: Math.floor(a / (1e3 * 60 * 60 * 24)),
|
|
4161
|
+
hours: Math.floor(a % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)),
|
|
4162
|
+
minutes: Math.floor(a % (1e3 * 60 * 60) / (1e3 * 60)),
|
|
4163
|
+
seconds: Math.floor(a % (1e3 * 60) / 1e3)
|
|
4164
|
+
});
|
|
4165
|
+
}, 1e3);
|
|
4166
|
+
return () => clearInterval(r);
|
|
4167
|
+
}, [d]), b;
|
|
4168
|
+
}, C = (d, b = 1500) => {
|
|
4169
|
+
T(!0), setTimeout(() => {
|
|
4170
|
+
T(!1), d();
|
|
4171
|
+
}, b);
|
|
4172
|
+
}, B = () => {
|
|
4173
|
+
C(() => {
|
|
4174
|
+
const d = {
|
|
4175
|
+
eventId: n.id,
|
|
4176
|
+
ticketId: `TKT-${Math.floor(Math.random() * 1e4)}-${Date.now().toString().slice(-4)}`,
|
|
4177
|
+
tier: h
|
|
4178
|
+
};
|
|
4179
|
+
k((b) => [...b, d]), N(!1), A(null), g("Payment successful! Your ticket is secured.", "success");
|
|
4180
|
+
});
|
|
4181
|
+
}, D = () => /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", children: [
|
|
4182
|
+
/* @__PURE__ */ e.jsxs("div", { style: { textAlign: "center", marginBottom: "3rem" }, children: [
|
|
4183
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", style: { marginBottom: "1rem" }, children: Ze.platformName }),
|
|
4184
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { fontSize: "1.25rem" }, children: "Secure your spot at the world's most exclusive events." })
|
|
4185
|
+
] }),
|
|
4186
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-grid pk-flex-col pk-gap-6", children: Ze.upcomingEvents.map((d) => {
|
|
4187
|
+
const b = new Date(d.date);
|
|
4188
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "pk-card pk-card-interactive", style: { display: "flex", flexWrap: "wrap" }, children: [
|
|
4189
|
+
/* @__PURE__ */ e.jsx("div", { style: { flex: "1 1 300px", height: "250px" }, children: /* @__PURE__ */ e.jsx("img", { src: d.image, alt: d.title, style: { width: "100%", height: "100%", objectFit: "cover" } }) }),
|
|
4190
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-card-body", style: { flex: "2 1 400px", display: "flex", flexDirection: "column" }, children: [
|
|
4191
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", marginBottom: "0.5rem" }, children: [
|
|
4192
|
+
/* @__PURE__ */ e.jsx("span", { className: "pk-badge", children: b.toLocaleDateString(void 0, { month: "long", day: "numeric", year: "numeric" }) }),
|
|
4193
|
+
x.find((M) => M.eventId === d.id) && /* @__PURE__ */ e.jsx("span", { style: { color: "var(--pk-success)", fontWeight: "bold" }, children: "✓ Ticket Owned" })
|
|
4194
|
+
] }),
|
|
4195
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", style: { marginBottom: "0.5rem" }, children: d.title }),
|
|
4196
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pk-text-sm pk-text-muted", style: { marginBottom: "1rem" }, children: [
|
|
4197
|
+
"📍 ",
|
|
4198
|
+
d.location
|
|
4199
|
+
] }),
|
|
4200
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { flex: 1 }, children: d.description }),
|
|
4201
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary", style: { alignSelf: "flex-start", marginTop: "1.5rem" }, onClick: () => {
|
|
4202
|
+
j(d), o("details");
|
|
4203
|
+
}, children: "View Details & Tickets" })
|
|
4204
|
+
] })
|
|
4205
|
+
] }, d.id);
|
|
4206
|
+
}) })
|
|
4207
|
+
] }), P = () => n ? /* @__PURE__ */ e.jsxs("div", { className: "pk-container animate-fade-in", children: [
|
|
4208
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { marginBottom: "2rem" }, onClick: () => o("feed"), children: "← Back to Events" }),
|
|
4209
|
+
/* @__PURE__ */ e.jsxs("div", { style: { position: "relative", height: "400px", borderRadius: "var(--pk-radius-lg)", overflow: "hidden", marginBottom: "3rem" }, children: [
|
|
4210
|
+
/* @__PURE__ */ e.jsx("img", { src: n.image, alt: "", style: { width: "100%", height: "100%", objectFit: "cover" } }),
|
|
4211
|
+
/* @__PURE__ */ e.jsxs("div", { style: { position: "absolute", inset: 0, background: "linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.8))", display: "flex", flexDirection: "column", justifyContent: "flex-end", padding: "3rem" }, children: [
|
|
4212
|
+
/* @__PURE__ */ e.jsx("h1", { className: "pk-heading-xl", style: { color: "white", marginBottom: "0.5rem" }, children: n.title }),
|
|
4213
|
+
/* @__PURE__ */ e.jsxs("p", { style: { color: "rgba(255,255,255,0.8)", fontSize: "1.25rem" }, children: [
|
|
4214
|
+
"📍 ",
|
|
4215
|
+
n.location
|
|
4216
|
+
] })
|
|
4217
|
+
] })
|
|
4218
|
+
] }),
|
|
4219
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pk-grid", style: { gridTemplateColumns: "minmax(300px, 2fr) minmax(300px, 1fr)" }, children: [
|
|
4220
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
4221
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", style: { marginBottom: "1.5rem" }, children: "About this Event" }),
|
|
4222
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { fontSize: "1.125rem", marginBottom: "3rem" }, children: n.description }),
|
|
4223
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "1rem" }, children: "Who's Speaking" }),
|
|
4224
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "0.5rem", marginBottom: "3rem" }, children: n.speakers.map((d, b) => /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { padding: "1rem" }, children: [
|
|
4225
|
+
"👤 ",
|
|
4226
|
+
d
|
|
4227
|
+
] }, b)) }),
|
|
4228
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { marginBottom: "1rem" }, children: "Agenda" }),
|
|
4229
|
+
/* @__PURE__ */ e.jsx("div", { style: { borderLeft: "2px solid var(--pk-border)", paddingLeft: "1.5rem", display: "flex", flexDirection: "column", gap: "1rem" }, children: n.agenda.map((d, b) => /* @__PURE__ */ e.jsxs("div", { style: { position: "relative" }, children: [
|
|
4230
|
+
/* @__PURE__ */ e.jsx("div", { style: { position: "absolute", left: "-1.5rem", top: "5px", transform: "translateX(-50%)", width: "12px", height: "12px", borderRadius: "50%", background: "var(--pk-primary)" } }),
|
|
4231
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { fontWeight: 600 }, children: d })
|
|
4232
|
+
] }, b)) })
|
|
4233
|
+
] }),
|
|
4234
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "pk-card", style: { position: "sticky", top: "20px", padding: "2rem" }, children: [
|
|
4235
|
+
/* @__PURE__ */ e.jsx(S, { targetDate: n.date }),
|
|
4236
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-primary pk-w-full", style: { padding: "1.25rem", fontSize: "1.125rem" }, onClick: () => N(!0), children: "Get Tickets" }),
|
|
4237
|
+
x.find((d) => d.eventId === n.id) && /* @__PURE__ */ e.jsx("p", { className: "pk-text-sm pk-text-center", style: { marginTop: "1rem", color: "var(--pk-success)", fontWeight: "bold" }, children: "You have a ticket for this event!" })
|
|
4238
|
+
] }) })
|
|
4239
|
+
] }),
|
|
4240
|
+
u && /* @__PURE__ */ e.jsx("div", { style: { position: "fixed", inset: 0, background: "rgba(0,0,0,0.5)", zIndex: 100, display: "flex", alignItems: "center", justifyContent: "center", backdropFilter: "blur(5px)" }, children: /* @__PURE__ */ e.jsxs("div", { className: "pk-card animate-fade-in", style: { width: "100%", maxWidth: "600px", padding: "2rem" }, children: [
|
|
4241
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", marginBottom: "2rem" }, children: [
|
|
4242
|
+
/* @__PURE__ */ e.jsx("h2", { className: "pk-heading-lg", children: "Select Tier" }),
|
|
4243
|
+
/* @__PURE__ */ e.jsx("button", { className: "pk-btn pk-btn-outline", style: { border: "none" }, onClick: () => N(!1), children: "✕" })
|
|
4244
|
+
] }),
|
|
4245
|
+
/* @__PURE__ */ e.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "1rem", marginBottom: "2rem" }, children: n.tiers.map((d) => {
|
|
4246
|
+
const b = d.capacity <= 0;
|
|
4247
|
+
return /* @__PURE__ */ e.jsxs(
|
|
4248
|
+
"button",
|
|
4249
|
+
{
|
|
4250
|
+
disabled: b,
|
|
4251
|
+
className: (h == null ? void 0 : h.id) === d.id ? "pk-btn pk-btn-primary" : "pk-btn pk-btn-outline",
|
|
4252
|
+
style: { display: "flex", justifyContent: "space-between", alignItems: "center", padding: "1.5rem", textAlign: "left", opacity: b ? 0.5 : 1 },
|
|
4253
|
+
onClick: () => A(d),
|
|
4254
|
+
children: [
|
|
4255
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
4256
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", style: { color: (h == null ? void 0 : h.id) === d.id ? "white" : "var(--pk-text-main)" }, children: d.name }),
|
|
4257
|
+
b ? /* @__PURE__ */ e.jsx("span", { style: { color: "var(--pk-danger)", fontWeight: "bold", fontSize: "0.875rem" }, children: "SOLD OUT" }) : /* @__PURE__ */ e.jsx("span", { style: { fontSize: "0.875rem", opacity: 0.8 }, children: "Available" })
|
|
4258
|
+
] }),
|
|
4259
|
+
/* @__PURE__ */ e.jsxs("span", { className: "pk-heading-lg", style: { color: (h == null ? void 0 : h.id) === d.id ? "white" : "var(--pk-primary)" }, children: [
|
|
4260
|
+
"$",
|
|
4261
|
+
d.price
|
|
4262
|
+
] })
|
|
4263
|
+
]
|
|
4264
|
+
},
|
|
4265
|
+
d.id
|
|
4266
|
+
);
|
|
4267
|
+
}) }),
|
|
4268
|
+
/* @__PURE__ */ e.jsx(
|
|
4269
|
+
"button",
|
|
4270
|
+
{
|
|
4271
|
+
className: "pk-btn pk-btn-primary pk-w-full",
|
|
4272
|
+
style: { padding: "1.25rem" },
|
|
4273
|
+
disabled: !h,
|
|
4274
|
+
onClick: B,
|
|
4275
|
+
children: "Confirm Checkout"
|
|
4276
|
+
}
|
|
4277
|
+
)
|
|
4278
|
+
] }) })
|
|
4279
|
+
] }) : null, S = ({ targetDate: d }) => {
|
|
4280
|
+
const b = y(d);
|
|
4281
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { textAlign: "center", marginBottom: "2rem" }, children: [
|
|
4282
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-muted pk-label", style: { marginBottom: "1rem" }, children: "Event Starts In" }),
|
|
4283
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", gap: "0.5rem" }, children: [
|
|
4284
|
+
/* @__PURE__ */ e.jsxs("div", { style: { background: "var(--pk-bg-main)", padding: "0.75rem", borderRadius: "var(--pk-radius-md)", flex: 1 }, children: [
|
|
4285
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-heading-md", children: b.days }),
|
|
4286
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-text-sm", children: "Days" })
|
|
4287
|
+
] }),
|
|
4288
|
+
/* @__PURE__ */ e.jsxs("div", { style: { background: "var(--pk-bg-main)", padding: "0.75rem", borderRadius: "var(--pk-radius-md)", flex: 1 }, children: [
|
|
4289
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-heading-md", children: b.hours }),
|
|
4290
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-text-sm", children: "Hrs" })
|
|
4291
|
+
] }),
|
|
4292
|
+
/* @__PURE__ */ e.jsxs("div", { style: { background: "var(--pk-bg-main)", padding: "0.75rem", borderRadius: "var(--pk-radius-md)", flex: 1 }, children: [
|
|
4293
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-heading-md", children: b.minutes }),
|
|
4294
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-text-sm", children: "Min" })
|
|
4295
|
+
] }),
|
|
4296
|
+
/* @__PURE__ */ e.jsxs("div", { style: { background: "var(--pk-bg-main)", padding: "0.75rem", borderRadius: "var(--pk-radius-md)", flex: 1 }, children: [
|
|
4297
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-heading-md", children: b.seconds }),
|
|
4298
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-text-sm", children: "Sec" })
|
|
4299
|
+
] })
|
|
4300
|
+
] })
|
|
4301
|
+
] });
|
|
4302
|
+
};
|
|
4303
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { position: "relative", minHeight: "100vh", backgroundColor: "var(--pk-bg-main)" }, children: [
|
|
4304
|
+
l && /* @__PURE__ */ e.jsxs("div", { style: { position: "fixed", inset: 0, backgroundColor: "rgba(255,255,255,0.8)", zIndex: 100, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", backdropFilter: "blur(4px)" }, children: [
|
|
4305
|
+
/* @__PURE__ */ e.jsx("div", { className: "pk-skeleton", style: { width: "80px", height: "80px", borderRadius: "50%", marginBottom: "1rem" } }),
|
|
4306
|
+
/* @__PURE__ */ e.jsx("h3", { className: "pk-heading-md", children: "Processing Reservation..." })
|
|
4307
|
+
] }),
|
|
4308
|
+
m === "feed" && D(),
|
|
4309
|
+
m === "details" && P(),
|
|
4310
|
+
/* @__PURE__ */ e.jsx(W, {})
|
|
4311
|
+
] });
|
|
4312
|
+
}
|
|
4313
|
+
function Ut({ title: m, subtitle: o, bgImage: n, children: j }) {
|
|
4314
|
+
return /* @__PURE__ */ e.jsxs(
|
|
4315
|
+
"div",
|
|
4316
|
+
{
|
|
4317
|
+
className: "pk-card pk-glass",
|
|
4318
|
+
style: {
|
|
4319
|
+
position: "relative",
|
|
4320
|
+
margin: "2rem 0",
|
|
4321
|
+
padding: "4rem 2rem",
|
|
4322
|
+
textAlign: "center",
|
|
4323
|
+
overflow: "hidden",
|
|
4324
|
+
background: n ? `linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.6)), url(${n}) center/cover` : "var(--pk-bg-glass)",
|
|
4325
|
+
color: n ? "white" : "inherit"
|
|
4326
|
+
},
|
|
4327
|
+
children: [
|
|
4328
|
+
/* @__PURE__ */ e.jsxs("div", { style: { position: "relative", zIndex: 10 }, children: [
|
|
4329
|
+
/* @__PURE__ */ e.jsx("h1", { className: n ? "pk-heading-xl" : "pk-heading-xl pk-gradient-text", style: { marginBottom: "1rem" }, children: m }),
|
|
4330
|
+
/* @__PURE__ */ e.jsx("p", { className: "pk-text-body", style: { color: n ? "rgba(255,255,255,0.9)" : "var(--pk-text-muted)", fontSize: "1.25rem", maxWidth: "600px", margin: "0 auto 2rem" }, children: o }),
|
|
4331
|
+
/* @__PURE__ */ e.jsx("div", { children: j })
|
|
4332
|
+
] }),
|
|
4333
|
+
!n && /* @__PURE__ */ e.jsx("div", { style: {
|
|
4334
|
+
position: "absolute",
|
|
4335
|
+
top: "-50%",
|
|
4336
|
+
left: "-10%",
|
|
4337
|
+
width: "500px",
|
|
4338
|
+
height: "500px",
|
|
4339
|
+
background: "radial-gradient(circle, var(--pk-primary-light) 0%, transparent 70%)",
|
|
4340
|
+
opacity: 0.5,
|
|
4341
|
+
zIndex: 0,
|
|
4342
|
+
borderRadius: "50%",
|
|
4343
|
+
pointerEvents: "none"
|
|
4344
|
+
} })
|
|
4345
|
+
]
|
|
4346
|
+
}
|
|
4347
|
+
);
|
|
4348
|
+
}
|
|
4349
|
+
export {
|
|
4350
|
+
Mt as AnalyticsDashboardModule,
|
|
4351
|
+
Ft as ChatMessagingModule,
|
|
4352
|
+
Pt as EcommerceStoreModule,
|
|
4353
|
+
Yt as EventTicketBookingModule,
|
|
4354
|
+
Wt as FlightBookingModule,
|
|
4355
|
+
_t as FoodOrderingModule,
|
|
4356
|
+
$t as HospitalAppointmentModule,
|
|
4357
|
+
Vt as HotelBookingModule,
|
|
4358
|
+
Ot as InvoiceBillingModule,
|
|
4359
|
+
qt as LandingPageModule,
|
|
4360
|
+
Ht as LibraryManagementModule,
|
|
4361
|
+
Et as MovieBookingModule,
|
|
4362
|
+
zt as QuizExamModule,
|
|
4363
|
+
Lt as StudentRegistrationModule,
|
|
4364
|
+
Ut as SystemHero,
|
|
4365
|
+
ge as SystemSummaryCard,
|
|
4366
|
+
It as Toast,
|
|
4367
|
+
G as useToast
|
|
4368
|
+
};
|