@theengineerguy/chronos-picker 1.0.2 → 1.0.4

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.
Files changed (33) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +386 -386
  3. package/dist/index.d.ts +1 -4
  4. package/dist/index.esm.js +346 -915
  5. package/dist/index.js +1 -30
  6. package/dist/{components → src/components}/Calendar.d.ts +4 -0
  7. package/dist/src/components/Calendar.d.ts.map +1 -0
  8. package/dist/src/components/DateTimePicker.d.ts.map +1 -0
  9. package/dist/src/components/TimePicker.d.ts.map +1 -0
  10. package/dist/src/components/TimezoneSelector.d.ts.map +1 -0
  11. package/dist/src/index.d.ts +4 -0
  12. package/dist/src/index.d.ts.map +1 -0
  13. package/dist/{types.d.ts → src/types.d.ts} +23 -0
  14. package/dist/src/types.d.ts.map +1 -0
  15. package/dist/{utils → src/utils}/calendar.d.ts +1 -1
  16. package/dist/src/utils/calendar.d.ts.map +1 -0
  17. package/dist/src/utils/timezone.d.ts.map +1 -0
  18. package/dist/style.css +1 -1
  19. package/dist/vite.config.d.ts +3 -0
  20. package/dist/vite.config.d.ts.map +1 -0
  21. package/package.json +61 -60
  22. package/dist/components/Calendar.d.ts.map +0 -1
  23. package/dist/components/DateTimePicker.d.ts.map +0 -1
  24. package/dist/components/TimePicker.d.ts.map +0 -1
  25. package/dist/components/TimezoneSelector.d.ts.map +0 -1
  26. package/dist/index.d.ts.map +0 -1
  27. package/dist/types.d.ts.map +0 -1
  28. package/dist/utils/calendar.d.ts.map +0 -1
  29. package/dist/utils/timezone.d.ts.map +0 -1
  30. /package/dist/{components → src/components}/DateTimePicker.d.ts +0 -0
  31. /package/dist/{components → src/components}/TimePicker.d.ts +0 -0
  32. /package/dist/{components → src/components}/TimezoneSelector.d.ts +0 -0
  33. /package/dist/{utils → src/utils}/timezone.d.ts +0 -0
package/dist/index.esm.js CHANGED
@@ -1,632 +1,7 @@
1
- import Ke, { useMemo as Ee, useState as U, useEffect as ue, useRef as Le, useCallback as Te } from "react";
2
- import { DateTime as Y } from "luxon";
3
- var _e = { exports: {} }, Q = {};
4
- /**
5
- * @license React
6
- * react-jsx-runtime.production.min.js
7
- *
8
- * Copyright (c) Facebook, Inc. and its affiliates.
9
- *
10
- * This source code is licensed under the MIT license found in the
11
- * LICENSE file in the root directory of this source tree.
12
- */
13
- var Ue;
14
- function xr() {
15
- if (Ue) return Q;
16
- Ue = 1;
17
- var o = Ke, l = Symbol.for("react.element"), d = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, b = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, R = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function v(k, y, w) {
19
- var x, O = {}, C = null, E = null;
20
- w !== void 0 && (C = "" + w), y.key !== void 0 && (C = "" + y.key), y.ref !== void 0 && (E = y.ref);
21
- for (x in y) c.call(y, x) && !R.hasOwnProperty(x) && (O[x] = y[x]);
22
- if (k && k.defaultProps) for (x in y = k.defaultProps, y) O[x] === void 0 && (O[x] = y[x]);
23
- return { $$typeof: l, type: k, key: C, ref: E, props: O, _owner: b.current };
24
- }
25
- return Q.Fragment = d, Q.jsx = v, Q.jsxs = v, Q;
26
- }
27
- var ee = {};
28
- /**
29
- * @license React
30
- * react-jsx-runtime.development.js
31
- *
32
- * Copyright (c) Facebook, Inc. and its affiliates.
33
- *
34
- * This source code is licensed under the MIT license found in the
35
- * LICENSE file in the root directory of this source tree.
36
- */
37
- var Ve;
38
- function Er() {
39
- return Ve || (Ve = 1, process.env.NODE_ENV !== "production" && function() {
40
- var o = Ke, l = Symbol.for("react.element"), d = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), v = Symbol.for("react.provider"), k = Symbol.for("react.context"), y = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), O = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), D = Symbol.iterator, F = "@@iterator";
41
- function P(e) {
42
- if (e === null || typeof e != "object")
43
- return null;
44
- var r = D && e[D] || e[F];
45
- return typeof r == "function" ? r : null;
46
- }
47
- var i = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
- function n(e) {
49
- {
50
- for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
51
- t[s - 1] = arguments[s];
52
- T("error", e, t);
53
- }
54
- }
55
- function T(e, r, t) {
56
- {
57
- var s = i.ReactDebugCurrentFrame, h = s.getStackAddendum();
58
- h !== "" && (r += "%s", t = t.concat([h]));
59
- var m = t.map(function(f) {
60
- return String(f);
61
- });
62
- m.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, m);
63
- }
64
- }
65
- var p = !1, G = !1, q = !1, B = !1, Z = !1, X;
66
- X = Symbol.for("react.module.reference");
67
- function fe(e) {
68
- return !!(typeof e == "string" || typeof e == "function" || e === c || e === R || Z || e === b || e === w || e === x || B || e === E || p || G || q || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === O || e.$$typeof === v || e.$$typeof === k || e.$$typeof === y || // This needs to include all possible module reference object
69
- // types supported by any Flight configuration anywhere since
70
- // we don't know which Flight build this will end up being used
71
- // with.
72
- e.$$typeof === X || e.getModuleId !== void 0));
73
- }
74
- function de(e, r, t) {
75
- var s = e.displayName;
76
- if (s)
77
- return s;
78
- var h = r.displayName || r.name || "";
79
- return h !== "" ? t + "(" + h + ")" : t;
80
- }
81
- function re(e) {
82
- return e.displayName || "Context";
83
- }
84
- function $(e) {
85
- if (e == null)
86
- return null;
87
- if (typeof e.tag == "number" && n("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
88
- return e.displayName || e.name || null;
89
- if (typeof e == "string")
90
- return e;
91
- switch (e) {
92
- case c:
93
- return "Fragment";
94
- case d:
95
- return "Portal";
96
- case R:
97
- return "Profiler";
98
- case b:
99
- return "StrictMode";
100
- case w:
101
- return "Suspense";
102
- case x:
103
- return "SuspenseList";
104
- }
105
- if (typeof e == "object")
106
- switch (e.$$typeof) {
107
- case k:
108
- var r = e;
109
- return re(r) + ".Consumer";
110
- case v:
111
- var t = e;
112
- return re(t._context) + ".Provider";
113
- case y:
114
- return de(e, e.render, "ForwardRef");
115
- case O:
116
- var s = e.displayName || null;
117
- return s !== null ? s : $(e.type) || "Memo";
118
- case C: {
119
- var h = e, m = h._payload, f = h._init;
120
- try {
121
- return $(f(m));
122
- } catch {
123
- return null;
124
- }
125
- }
126
- }
127
- return null;
128
- }
129
- var W = Object.assign, V = 0, te, ne, j, g, I, L, ae;
130
- function Re() {
131
- }
132
- Re.__reactDisabledLog = !0;
133
- function Je() {
134
- {
135
- if (V === 0) {
136
- te = console.log, ne = console.info, j = console.warn, g = console.error, I = console.group, L = console.groupCollapsed, ae = console.groupEnd;
137
- var e = {
138
- configurable: !0,
139
- enumerable: !0,
140
- value: Re,
141
- writable: !0
142
- };
143
- Object.defineProperties(console, {
144
- info: e,
145
- log: e,
146
- warn: e,
147
- error: e,
148
- group: e,
149
- groupCollapsed: e,
150
- groupEnd: e
151
- });
152
- }
153
- V++;
154
- }
155
- }
156
- function Ge() {
157
- {
158
- if (V--, V === 0) {
159
- var e = {
160
- configurable: !0,
161
- enumerable: !0,
162
- writable: !0
163
- };
164
- Object.defineProperties(console, {
165
- log: W({}, e, {
166
- value: te
167
- }),
168
- info: W({}, e, {
169
- value: ne
170
- }),
171
- warn: W({}, e, {
172
- value: j
173
- }),
174
- error: W({}, e, {
175
- value: g
176
- }),
177
- group: W({}, e, {
178
- value: I
179
- }),
180
- groupCollapsed: W({}, e, {
181
- value: L
182
- }),
183
- groupEnd: W({}, e, {
184
- value: ae
185
- })
186
- });
187
- }
188
- V < 0 && n("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
- }
190
- }
191
- var he = i.ReactCurrentDispatcher, ve;
192
- function oe(e, r, t) {
193
- {
194
- if (ve === void 0)
195
- try {
196
- throw Error();
197
- } catch (h) {
198
- var s = h.stack.trim().match(/\n( *(at )?)/);
199
- ve = s && s[1] || "";
200
- }
201
- return `
202
- ` + ve + e;
203
- }
204
- }
205
- var pe = !1, se;
206
- {
207
- var qe = typeof WeakMap == "function" ? WeakMap : Map;
208
- se = new qe();
209
- }
210
- function Se(e, r) {
211
- if (!e || pe)
212
- return "";
213
- {
214
- var t = se.get(e);
215
- if (t !== void 0)
216
- return t;
217
- }
218
- var s;
219
- pe = !0;
220
- var h = Error.prepareStackTrace;
221
- Error.prepareStackTrace = void 0;
222
- var m;
223
- m = he.current, he.current = null, Je();
224
- try {
225
- if (r) {
226
- var f = function() {
227
- throw Error();
228
- };
229
- if (Object.defineProperty(f.prototype, "props", {
230
- set: function() {
231
- throw Error();
232
- }
233
- }), typeof Reflect == "object" && Reflect.construct) {
234
- try {
235
- Reflect.construct(f, []);
236
- } catch (N) {
237
- s = N;
238
- }
239
- Reflect.construct(e, [], f);
240
- } else {
241
- try {
242
- f.call();
243
- } catch (N) {
244
- s = N;
245
- }
246
- e.call(f.prototype);
247
- }
248
- } else {
249
- try {
250
- throw Error();
251
- } catch (N) {
252
- s = N;
253
- }
254
- e();
255
- }
256
- } catch (N) {
257
- if (N && s && typeof N.stack == "string") {
258
- for (var u = N.stack.split(`
259
- `), M = s.stack.split(`
260
- `), _ = u.length - 1, S = M.length - 1; _ >= 1 && S >= 0 && u[_] !== M[S]; )
261
- S--;
262
- for (; _ >= 1 && S >= 0; _--, S--)
263
- if (u[_] !== M[S]) {
264
- if (_ !== 1 || S !== 1)
265
- do
266
- if (_--, S--, S < 0 || u[_] !== M[S]) {
267
- var A = `
268
- ` + u[_].replace(" at new ", " at ");
269
- return e.displayName && A.includes("<anonymous>") && (A = A.replace("<anonymous>", e.displayName)), typeof e == "function" && se.set(e, A), A;
270
- }
271
- while (_ >= 1 && S >= 0);
272
- break;
273
- }
274
- }
275
- } finally {
276
- pe = !1, he.current = m, Ge(), Error.prepareStackTrace = h;
277
- }
278
- var J = e ? e.displayName || e.name : "", z = J ? oe(J) : "";
279
- return typeof e == "function" && se.set(e, z), z;
280
- }
281
- function Ze(e, r, t) {
282
- return Se(e, !1);
283
- }
284
- function Xe(e) {
285
- var r = e.prototype;
286
- return !!(r && r.isReactComponent);
287
- }
288
- function ie(e, r, t) {
289
- if (e == null)
290
- return "";
291
- if (typeof e == "function")
292
- return Se(e, Xe(e));
293
- if (typeof e == "string")
294
- return oe(e);
295
- switch (e) {
296
- case w:
297
- return oe("Suspense");
298
- case x:
299
- return oe("SuspenseList");
300
- }
301
- if (typeof e == "object")
302
- switch (e.$$typeof) {
303
- case y:
304
- return Ze(e.render);
305
- case O:
306
- return ie(e.type, r, t);
307
- case C: {
308
- var s = e, h = s._payload, m = s._init;
309
- try {
310
- return ie(m(h), r, t);
311
- } catch {
312
- }
313
- }
314
- }
315
- return "";
316
- }
317
- var H = Object.prototype.hasOwnProperty, ke = {}, we = i.ReactDebugCurrentFrame;
318
- function le(e) {
319
- if (e) {
320
- var r = e._owner, t = ie(e.type, e._source, r ? r.type : null);
321
- we.setExtraStackFrame(t);
322
- } else
323
- we.setExtraStackFrame(null);
324
- }
325
- function He(e, r, t, s, h) {
326
- {
327
- var m = Function.call.bind(H);
328
- for (var f in e)
329
- if (m(e, f)) {
330
- var u = void 0;
331
- try {
332
- if (typeof e[f] != "function") {
333
- var M = Error((s || "React class") + ": " + t + " type `" + f + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[f] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
- throw M.name = "Invariant Violation", M;
335
- }
336
- u = e[f](r, f, s, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
- } catch (_) {
338
- u = _;
339
- }
340
- u && !(u instanceof Error) && (le(h), n("%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).", s || "React class", t, f, typeof u), le(null)), u instanceof Error && !(u.message in ke) && (ke[u.message] = !0, le(h), n("Failed %s type: %s", t, u.message), le(null));
341
- }
342
- }
343
- }
344
- var Qe = Array.isArray;
345
- function me(e) {
346
- return Qe(e);
347
- }
348
- function er(e) {
349
- {
350
- var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
- return t;
352
- }
353
- }
354
- function rr(e) {
355
- try {
356
- return Oe(e), !1;
357
- } catch {
358
- return !0;
359
- }
360
- }
361
- function Oe(e) {
362
- return "" + e;
363
- }
364
- function Ce(e) {
365
- if (rr(e))
366
- return n("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", er(e)), Oe(e);
367
- }
368
- var Pe = i.ReactCurrentOwner, tr = {
369
- key: !0,
370
- ref: !0,
371
- __self: !0,
372
- __source: !0
373
- }, Me, Ne;
374
- function nr(e) {
375
- if (H.call(e, "ref")) {
376
- var r = Object.getOwnPropertyDescriptor(e, "ref").get;
377
- if (r && r.isReactWarning)
378
- return !1;
379
- }
380
- return e.ref !== void 0;
381
- }
382
- function ar(e) {
383
- if (H.call(e, "key")) {
384
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
385
- if (r && r.isReactWarning)
386
- return !1;
387
- }
388
- return e.key !== void 0;
389
- }
390
- function or(e, r) {
391
- typeof e.ref == "string" && Pe.current;
392
- }
393
- function sr(e, r) {
394
- {
395
- var t = function() {
396
- Me || (Me = !0, n("%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)", r));
397
- };
398
- t.isReactWarning = !0, Object.defineProperty(e, "key", {
399
- get: t,
400
- configurable: !0
401
- });
402
- }
403
- }
404
- function ir(e, r) {
405
- {
406
- var t = function() {
407
- Ne || (Ne = !0, n("%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)", r));
408
- };
409
- t.isReactWarning = !0, Object.defineProperty(e, "ref", {
410
- get: t,
411
- configurable: !0
412
- });
413
- }
414
- }
415
- var lr = function(e, r, t, s, h, m, f) {
416
- var u = {
417
- // This tag allows us to uniquely identify this as a React Element
418
- $$typeof: l,
419
- // Built-in properties that belong on the element
420
- type: e,
421
- key: r,
422
- ref: t,
423
- props: f,
424
- // Record the component responsible for creating this element.
425
- _owner: m
426
- };
427
- return u._store = {}, Object.defineProperty(u._store, "validated", {
428
- configurable: !1,
429
- enumerable: !1,
430
- writable: !0,
431
- value: !1
432
- }), Object.defineProperty(u, "_self", {
433
- configurable: !1,
434
- enumerable: !1,
435
- writable: !1,
436
- value: s
437
- }), Object.defineProperty(u, "_source", {
438
- configurable: !1,
439
- enumerable: !1,
440
- writable: !1,
441
- value: h
442
- }), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
443
- };
444
- function cr(e, r, t, s, h) {
445
- {
446
- var m, f = {}, u = null, M = null;
447
- t !== void 0 && (Ce(t), u = "" + t), ar(r) && (Ce(r.key), u = "" + r.key), nr(r) && (M = r.ref, or(r, h));
448
- for (m in r)
449
- H.call(r, m) && !tr.hasOwnProperty(m) && (f[m] = r[m]);
450
- if (e && e.defaultProps) {
451
- var _ = e.defaultProps;
452
- for (m in _)
453
- f[m] === void 0 && (f[m] = _[m]);
454
- }
455
- if (u || M) {
456
- var S = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
- u && sr(f, S), M && ir(f, S);
458
- }
459
- return lr(e, u, M, h, s, Pe.current, f);
460
- }
461
- }
462
- var be = i.ReactCurrentOwner, De = i.ReactDebugCurrentFrame;
463
- function K(e) {
464
- if (e) {
465
- var r = e._owner, t = ie(e.type, e._source, r ? r.type : null);
466
- De.setExtraStackFrame(t);
467
- } else
468
- De.setExtraStackFrame(null);
469
- }
470
- var ye;
471
- ye = !1;
472
- function ge(e) {
473
- return typeof e == "object" && e !== null && e.$$typeof === l;
474
- }
475
- function Ae() {
476
- {
477
- if (be.current) {
478
- var e = $(be.current.type);
479
- if (e)
480
- return `
481
-
482
- Check the render method of \`` + e + "`.";
483
- }
484
- return "";
485
- }
486
- }
487
- function ur(e) {
488
- return "";
489
- }
490
- var $e = {};
491
- function fr(e) {
492
- {
493
- var r = Ae();
494
- if (!r) {
495
- var t = typeof e == "string" ? e : e.displayName || e.name;
496
- t && (r = `
497
-
498
- Check the top-level render call using <` + t + ">.");
499
- }
500
- return r;
501
- }
502
- }
503
- function Ie(e, r) {
504
- {
505
- if (!e._store || e._store.validated || e.key != null)
506
- return;
507
- e._store.validated = !0;
508
- var t = fr(r);
509
- if ($e[t])
510
- return;
511
- $e[t] = !0;
512
- var s = "";
513
- e && e._owner && e._owner !== be.current && (s = " It was passed a child from " + $(e._owner.type) + "."), K(e), n('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, s), K(null);
514
- }
515
- }
516
- function Fe(e, r) {
517
- {
518
- if (typeof e != "object")
519
- return;
520
- if (me(e))
521
- for (var t = 0; t < e.length; t++) {
522
- var s = e[t];
523
- ge(s) && Ie(s, r);
524
- }
525
- else if (ge(e))
526
- e._store && (e._store.validated = !0);
527
- else if (e) {
528
- var h = P(e);
529
- if (typeof h == "function" && h !== e.entries)
530
- for (var m = h.call(e), f; !(f = m.next()).done; )
531
- ge(f.value) && Ie(f.value, r);
532
- }
533
- }
534
- }
535
- function dr(e) {
536
- {
537
- var r = e.type;
538
- if (r == null || typeof r == "string")
539
- return;
540
- var t;
541
- if (typeof r == "function")
542
- t = r.propTypes;
543
- else if (typeof r == "object" && (r.$$typeof === y || // Note: Memo only checks outer props here.
544
- // Inner props are checked in the reconciler.
545
- r.$$typeof === O))
546
- t = r.propTypes;
547
- else
548
- return;
549
- if (t) {
550
- var s = $(r);
551
- He(t, e.props, "prop", s, e);
552
- } else if (r.PropTypes !== void 0 && !ye) {
553
- ye = !0;
554
- var h = $(r);
555
- n("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", h || "Unknown");
556
- }
557
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && n("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
- }
559
- }
560
- function hr(e) {
561
- {
562
- for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
563
- var s = r[t];
564
- if (s !== "children" && s !== "key") {
565
- K(e), n("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), K(null);
566
- break;
567
- }
568
- }
569
- e.ref !== null && (K(e), n("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
570
- }
571
- }
572
- var We = {};
573
- function Ye(e, r, t, s, h, m) {
574
- {
575
- var f = fe(e);
576
- if (!f) {
577
- var u = "";
578
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (u += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
- var M = ur();
580
- M ? u += M : u += Ae();
581
- var _;
582
- e === null ? _ = "null" : me(e) ? _ = "array" : e !== void 0 && e.$$typeof === l ? (_ = "<" + ($(e.type) || "Unknown") + " />", u = " Did you accidentally export a JSX literal instead of a component?") : _ = typeof e, n("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", _, u);
583
- }
584
- var S = cr(e, r, t, h, m);
585
- if (S == null)
586
- return S;
587
- if (f) {
588
- var A = r.children;
589
- if (A !== void 0)
590
- if (s)
591
- if (me(A)) {
592
- for (var J = 0; J < A.length; J++)
593
- Fe(A[J], e);
594
- Object.freeze && Object.freeze(A);
595
- } else
596
- n("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
- else
598
- Fe(A, e);
599
- }
600
- if (H.call(r, "key")) {
601
- var z = $(e), N = Object.keys(r).filter(function(gr) {
602
- return gr !== "key";
603
- }), xe = N.length > 0 ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}";
604
- if (!We[z + xe]) {
605
- var yr = N.length > 0 ? "{" + N.join(": ..., ") + ": ...}" : "{}";
606
- n(`A props object containing a "key" prop is being spread into JSX:
607
- let props = %s;
608
- <%s {...props} />
609
- React keys must be passed directly to JSX without using spread:
610
- let props = %s;
611
- <%s key={someKey} {...props} />`, xe, z, yr, z), We[z + xe] = !0;
612
- }
613
- }
614
- return e === c ? hr(S) : dr(S), S;
615
- }
616
- }
617
- function vr(e, r, t) {
618
- return Ye(e, r, t, !0);
619
- }
620
- function pr(e, r, t) {
621
- return Ye(e, r, t, !1);
622
- }
623
- var mr = pr, br = vr;
624
- ee.Fragment = c, ee.jsx = mr, ee.jsxs = br;
625
- }()), ee;
626
- }
627
- process.env.NODE_ENV === "production" ? _e.exports = xr() : _e.exports = Er();
628
- var a = _e.exports;
629
- const Tr = "Asia/Kolkata", ze = [
1
+ import { jsxs as h, jsx as o } from "react/jsx-runtime";
2
+ import { useMemo as j, useState as x, useEffect as Z, useRef as q, useCallback as _ } from "react";
3
+ import { DateTime as D } from "luxon";
4
+ const he = "Asia/Kolkata", H = [
630
5
  { value: "Asia/Kolkata", label: "India (IST)" },
631
6
  { value: "America/New_York", label: "Eastern Time (ET)" },
632
7
  { value: "America/Chicago", label: "Central Time (CT)" },
@@ -640,172 +15,193 @@ const Tr = "Asia/Kolkata", ze = [
640
15
  { value: "Australia/Sydney", label: "Sydney (AEDT)" },
641
16
  { value: "UTC", label: "UTC" }
642
17
  ];
643
- function ce(o, l) {
644
- return Y.isDateTime(o) ? o.setZone(l) : typeof o == "string" ? Y.fromISO(o, { zone: l }) : Y.fromJSDate(o, { zone: l });
18
+ function I(e, s) {
19
+ return D.isDateTime(e) ? e.setZone(s) : typeof e == "string" ? D.fromISO(e, { zone: s }) : D.fromJSDate(e, { zone: s });
645
20
  }
646
- function je(o) {
647
- return Y.now().setZone(o);
21
+ function U(e) {
22
+ return D.now().setZone(e);
648
23
  }
649
- function Be(o) {
650
- const d = Y.now().setZone(o).offset, c = Math.floor(Math.abs(d) / 60), b = Math.abs(d) % 60;
651
- return `UTC${d >= 0 ? "+" : "-"}${c}${b > 0 ? `:${b.toString().padStart(2, "0")}` : ""}`;
24
+ function Q(e) {
25
+ const r = D.now().setZone(e).offset, a = Math.floor(Math.abs(r) / 60), c = Math.abs(r) % 60;
26
+ return `UTC${r >= 0 ? "+" : "-"}${a}${c > 0 ? `:${c.toString().padStart(2, "0")}` : ""}`;
652
27
  }
653
- function jr(o, l, d, c, b, R) {
654
- const v = Y.fromObject(
655
- { year: o, month: l, day: 1 },
656
- { zone: d }
657
- ), k = v.startOf("week"), w = v.endOf("month").endOf("week"), x = Y.now().setZone(d).startOf("day"), O = [];
658
- let C = [], E = k;
659
- for (; E <= w; ) {
660
- const D = E.month === l, F = E.hasSame(x, "day"), P = c ? E.hasSame(c, "day") : !1;
661
- let i = !1;
662
- b && E < b.startOf("day") && (i = !0), R && E > R.endOf("day") && (i = !0), C.push({
663
- date: E,
664
- isCurrentMonth: D,
665
- isToday: F,
666
- isSelected: P,
667
- isDisabled: i
668
- }), C.length === 7 && (O.push(C), C = []), E = E.plus({ days: 1 });
28
+ function me(e, s, r, a, c, b, d, f) {
29
+ const v = D.fromObject(
30
+ { year: e, month: s, day: 1 },
31
+ { zone: r }
32
+ ), M = v.startOf("week"), P = v.endOf("month").endOf("week"), z = D.now().setZone(r).startOf("day"), A = d != null && f != null, S = d == null ? void 0 : d.startOf("day"), C = f == null ? void 0 : f.endOf("day"), E = [];
33
+ let n = [], l = M;
34
+ for (; l <= P; ) {
35
+ const y = l.month === s, T = l.hasSame(z, "day"), g = l.startOf("day");
36
+ let t = !1, m = !1, i = !1, O = !1;
37
+ A && S && C ? (i = g.hasSame(S, "day"), O = g.hasSame(C, "day"), m = g >= S && g <= C || i || O, t = i || O) : a && (t = l.hasSame(a, "day"));
38
+ let N = !1;
39
+ c && l < c.startOf("day") && (N = !0), b && l > b.endOf("day") && (N = !0), n.push({
40
+ date: l,
41
+ isCurrentMonth: y,
42
+ isToday: T,
43
+ isSelected: t,
44
+ isDisabled: N,
45
+ isInRange: m,
46
+ isRangeStart: i,
47
+ isRangeEnd: O
48
+ }), n.length === 7 && (E.push(n), n = []), l = l.plus({ days: 1 });
669
49
  }
670
- return O;
50
+ return E;
671
51
  }
672
- function _r() {
673
- const o = Y.now().startOf("week"), l = [];
674
- for (let d = 0; d < 7; d++) {
675
- const c = o.plus({ days: d });
676
- l.push(c.toFormat("ccc"));
52
+ function ue() {
53
+ const e = D.now().startOf("week"), s = [];
54
+ for (let r = 0; r < 7; r++) {
55
+ const a = e.plus({ days: r });
56
+ s.push(a.toFormat("ccc"));
677
57
  }
678
- return l;
58
+ return s;
679
59
  }
680
- function Rr() {
681
- const o = [];
682
- for (let l = 1; l <= 12; l++) {
683
- const d = Y.fromObject({ month: l });
684
- o.push(d.toFormat("MMMM"));
60
+ function fe() {
61
+ const e = [];
62
+ for (let s = 1; s <= 12; s++) {
63
+ const r = D.fromObject({ month: s });
64
+ e.push(r.toFormat("MMMM"));
685
65
  }
686
- return o;
66
+ return e;
687
67
  }
688
- const Sr = ({
689
- viewDate: o,
690
- selectedDate: l,
691
- onDateSelect: d,
692
- onViewDateChange: c,
693
- timezone: b,
694
- minDate: R,
695
- maxDate: v
68
+ const pe = ({
69
+ viewDate: e,
70
+ selectedDate: s,
71
+ onDateSelect: r,
72
+ onViewDateChange: a,
73
+ timezone: c,
74
+ minDate: b,
75
+ maxDate: d,
76
+ selectedStart: f,
77
+ selectedEnd: v,
78
+ onRangeSelect: M
696
79
  }) => {
697
- const k = Ee(() => jr(
698
- o.year,
699
- o.month,
80
+ const R = M != null, P = j(() => me(
81
+ e.year,
82
+ e.month,
83
+ c,
84
+ s ?? void 0,
700
85
  b,
701
- l ?? void 0,
702
- R,
703
- v
704
- ), [o, l, b, R, v]), y = Ee(() => _r(), []), w = Ee(() => Rr(), []), x = () => {
705
- c(o.minus({ months: 1 }));
706
- }, O = () => {
707
- c(o.plus({ months: 1 }));
708
- }, C = (n) => {
709
- const T = parseInt(n.target.value, 10);
710
- c(o.set({ month: T }));
711
- }, E = (n) => {
712
- const T = parseInt(n.target.value, 10);
713
- c(o.set({ year: T }));
714
- }, D = (n, T) => {
715
- T || d(n);
716
- }, F = (n, T, p) => {
717
- (n.key === "Enter" || n.key === " ") && (n.preventDefault(), D(T, p));
718
- }, P = o.year, i = Array.from({ length: 21 }, (n, T) => P - 10 + T);
719
- return /* @__PURE__ */ a.jsxs("div", { className: "chronos-calendar", role: "region", "aria-label": "Calendar", children: [
720
- /* @__PURE__ */ a.jsxs("div", { className: "chronos-calendar-header", children: [
721
- /* @__PURE__ */ a.jsx(
86
+ d,
87
+ f ?? void 0,
88
+ v ?? void 0
89
+ ), [e, s, c, b, d, f, v]), z = j(() => ue(), []), A = j(() => fe(), []), S = () => {
90
+ a(e.minus({ months: 1 }));
91
+ }, C = () => {
92
+ a(e.plus({ months: 1 }));
93
+ }, E = (t) => {
94
+ const m = parseInt(t.target.value, 10);
95
+ a(e.set({ month: m }));
96
+ }, n = (t) => {
97
+ const m = parseInt(t.target.value, 10);
98
+ a(e.set({ year: m }));
99
+ }, l = (t, m) => {
100
+ if (!m)
101
+ if (R && M) {
102
+ const i = t.startOf("day");
103
+ if (f == null)
104
+ M(t, t);
105
+ else if (v != null && f.hasSame(v, "day")) {
106
+ const O = f.startOf("day");
107
+ i < O ? M(t, f) : M(f, t);
108
+ } else
109
+ M(t, t);
110
+ } else
111
+ r(t);
112
+ }, y = (t, m, i) => {
113
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), l(m, i));
114
+ }, T = e.year, g = Array.from({ length: 21 }, (t, m) => T - 10 + m);
115
+ return /* @__PURE__ */ h("div", { className: "chronos-calendar", role: "region", "aria-label": "Calendar", children: [
116
+ /* @__PURE__ */ h("div", { className: "chronos-calendar-header", children: [
117
+ /* @__PURE__ */ o(
722
118
  "button",
723
119
  {
724
120
  type: "button",
725
121
  className: "chronos-nav-button",
726
- onClick: x,
122
+ onClick: S,
727
123
  "aria-label": "Previous month",
728
124
  children: "‹"
729
125
  }
730
126
  ),
731
- /* @__PURE__ */ a.jsxs("div", { className: "chronos-month-year-selectors", children: [
732
- /* @__PURE__ */ a.jsx(
127
+ /* @__PURE__ */ h("div", { className: "chronos-month-year-selectors", children: [
128
+ /* @__PURE__ */ o(
733
129
  "select",
734
130
  {
735
131
  className: "chronos-month-select",
736
- value: o.month,
737
- onChange: C,
132
+ value: e.month,
133
+ onChange: E,
738
134
  "aria-label": "Select month",
739
- children: w.map((n, T) => /* @__PURE__ */ a.jsx("option", { value: T + 1, children: n }, T))
135
+ children: A.map((t, m) => /* @__PURE__ */ o("option", { value: m + 1, children: t }, m))
740
136
  }
741
137
  ),
742
- /* @__PURE__ */ a.jsx(
138
+ /* @__PURE__ */ o(
743
139
  "select",
744
140
  {
745
141
  className: "chronos-year-select",
746
- value: o.year,
747
- onChange: E,
142
+ value: e.year,
143
+ onChange: n,
748
144
  "aria-label": "Select year",
749
- children: i.map((n) => /* @__PURE__ */ a.jsx("option", { value: n, children: n }, n))
145
+ children: g.map((t) => /* @__PURE__ */ o("option", { value: t, children: t }, t))
750
146
  }
751
147
  )
752
148
  ] }),
753
- /* @__PURE__ */ a.jsx(
149
+ /* @__PURE__ */ o(
754
150
  "button",
755
151
  {
756
152
  type: "button",
757
153
  className: "chronos-nav-button",
758
- onClick: O,
154
+ onClick: C,
759
155
  "aria-label": "Next month",
760
156
  children: "›"
761
157
  }
762
158
  )
763
159
  ] }),
764
- /* @__PURE__ */ a.jsxs("div", { className: "chronos-calendar-grid", children: [
765
- /* @__PURE__ */ a.jsx("div", { className: "chronos-weekday-row", children: y.map((n) => /* @__PURE__ */ a.jsx("div", { className: "chronos-weekday", children: n }, n)) }),
766
- k.map((n, T) => /* @__PURE__ */ a.jsx("div", { className: "chronos-week-row", children: n.map((p, G) => /* @__PURE__ */ a.jsx(
160
+ /* @__PURE__ */ h("div", { className: "chronos-calendar-grid", children: [
161
+ /* @__PURE__ */ o("div", { className: "chronos-weekday-row", children: z.map((t) => /* @__PURE__ */ o("div", { className: "chronos-weekday", children: t }, t)) }),
162
+ P.map((t, m) => /* @__PURE__ */ o("div", { className: "chronos-week-row", children: t.map((i, O) => /* @__PURE__ */ o(
767
163
  "button",
768
164
  {
769
165
  type: "button",
770
- className: `chronos-day ${p.isSelected ? "selected" : ""} ${p.isToday ? "today" : ""} ${p.isCurrentMonth ? "" : "other-month"} ${p.isDisabled ? "disabled" : ""}`,
771
- onClick: () => D(p.date, p.isDisabled),
772
- onKeyDown: (q) => F(q, p.date, p.isDisabled),
773
- disabled: p.isDisabled,
774
- "aria-label": p.date.toFormat("MMMM d, yyyy"),
775
- "aria-selected": p.isSelected,
776
- "aria-current": p.isToday ? "date" : void 0,
777
- children: p.date.day
166
+ className: `chronos-day ${i.isSelected ? "selected" : ""} ${i.isToday ? "today" : ""} ${i.isCurrentMonth ? "" : "other-month"} ${i.isDisabled ? "disabled" : ""} ${i.isInRange ? "in-range" : ""} ${i.isRangeStart ? "range-start" : ""} ${i.isRangeEnd ? "range-end" : ""}`,
167
+ onClick: () => l(i.date, i.isDisabled),
168
+ onKeyDown: (N) => y(N, i.date, i.isDisabled),
169
+ disabled: i.isDisabled,
170
+ "aria-label": i.date.toFormat("MMMM d, yyyy"),
171
+ "aria-selected": i.isSelected,
172
+ "aria-current": i.isToday ? "date" : void 0,
173
+ children: i.date.day
778
174
  },
779
- G
780
- )) }, T))
175
+ O
176
+ )) }, m))
781
177
  ] })
782
178
  ] });
783
- }, kr = ({
784
- value: o,
785
- onChange: l,
786
- use24Hour: d
179
+ }, ye = ({
180
+ value: e,
181
+ onChange: s,
182
+ use24Hour: r
787
183
  }) => {
788
- const [c, b] = U((o == null ? void 0 : o.hour) ?? 12), [R, v] = U((o == null ? void 0 : o.minute) ?? 0), [k, y] = U(
789
- o && o.hour >= 12 ? "PM" : "AM"
184
+ const [a, c] = x((e == null ? void 0 : e.hour) ?? 12), [b, d] = x((e == null ? void 0 : e.minute) ?? 0), [f, v] = x(
185
+ e && e.hour >= 12 ? "PM" : "AM"
790
186
  );
791
- ue(() => {
792
- o && (b(o.hour), v(o.minute), y(o.hour >= 12 ? "PM" : "AM"));
793
- }, [o]);
794
- const w = (i) => {
795
- b(i);
796
- let n = i;
797
- d || (k === "PM" && i !== 12 ? n = i + 12 : k === "AM" && i === 12 && (n = 0)), l(n, R);
798
- }, x = (i) => {
799
- v(i), l(c, i);
800
- }, O = () => {
801
- const i = k === "AM" ? "PM" : "AM";
802
- y(i);
803
- let n = c;
804
- i === "PM" && c !== 12 ? n = c + 12 : i === "AM" && c === 12 ? n = 0 : i === "AM" && c > 12 && (n = c - 12), l(n, R);
805
- }, C = d ? c : c % 12 || 12, E = d ? 23 : 12, D = d ? 0 : 1, F = Array.from({ length: E - D + 1 }, (i, n) => D + n), P = Array.from({ length: 60 }, (i, n) => n);
806
- return /* @__PURE__ */ a.jsxs("div", { className: "chronos-time-picker", role: "group", "aria-label": "Time picker", children: [
807
- /* @__PURE__ */ a.jsxs("div", { className: "chronos-time-header", children: [
808
- /* @__PURE__ */ a.jsxs(
187
+ Z(() => {
188
+ e && (c(e.hour), d(e.minute), v(e.hour >= 12 ? "PM" : "AM"));
189
+ }, [e]);
190
+ const M = (n) => {
191
+ c(n);
192
+ let l = n;
193
+ r || (f === "PM" && n !== 12 ? l = n + 12 : f === "AM" && n === 12 && (l = 0)), s(l, b);
194
+ }, R = (n) => {
195
+ d(n), s(a, n);
196
+ }, P = () => {
197
+ const n = f === "AM" ? "PM" : "AM";
198
+ v(n);
199
+ let l = a;
200
+ n === "PM" && a !== 12 ? l = a + 12 : n === "AM" && a === 12 ? l = 0 : n === "AM" && a > 12 && (l = a - 12), s(l, b);
201
+ }, z = r ? a : a % 12 || 12, A = r ? 23 : 12, S = r ? 0 : 1, C = Array.from({ length: A - S + 1 }, (n, l) => S + l), E = Array.from({ length: 60 }, (n, l) => l);
202
+ return /* @__PURE__ */ h("div", { className: "chronos-time-picker", role: "group", "aria-label": "Time picker", children: [
203
+ /* @__PURE__ */ h("div", { className: "chronos-time-header", children: [
204
+ /* @__PURE__ */ h(
809
205
  "svg",
810
206
  {
811
207
  className: "chronos-clock-icon",
@@ -815,67 +211,67 @@ const Sr = ({
815
211
  stroke: "currentColor",
816
212
  strokeWidth: "2",
817
213
  children: [
818
- /* @__PURE__ */ a.jsx("circle", { cx: "12", cy: "12", r: "10" }),
819
- /* @__PURE__ */ a.jsx("polyline", { points: "12 6 12 12 16 14" })
214
+ /* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "10" }),
215
+ /* @__PURE__ */ o("polyline", { points: "12 6 12 12 16 14" })
820
216
  ]
821
217
  }
822
218
  ),
823
- /* @__PURE__ */ a.jsx("span", { children: "Time" })
219
+ /* @__PURE__ */ o("span", { children: "Time" })
824
220
  ] }),
825
- /* @__PURE__ */ a.jsxs("div", { className: "chronos-time-controls", children: [
826
- /* @__PURE__ */ a.jsxs("div", { className: "chronos-time-input-group", children: [
827
- /* @__PURE__ */ a.jsx("label", { htmlFor: "chronos-hour-select", className: "chronos-time-label", children: "Hour" }),
828
- /* @__PURE__ */ a.jsx(
221
+ /* @__PURE__ */ h("div", { className: "chronos-time-controls", children: [
222
+ /* @__PURE__ */ h("div", { className: "chronos-time-input-group", children: [
223
+ /* @__PURE__ */ o("label", { htmlFor: "chronos-hour-select", className: "chronos-time-label", children: "Hour" }),
224
+ /* @__PURE__ */ o(
829
225
  "select",
830
226
  {
831
227
  id: "chronos-hour-select",
832
228
  className: "chronos-time-select",
833
- value: C,
834
- onChange: (i) => w(parseInt(i.target.value, 10)),
229
+ value: z,
230
+ onChange: (n) => M(parseInt(n.target.value, 10)),
835
231
  "aria-label": "Select hour",
836
- children: F.map((i) => /* @__PURE__ */ a.jsx("option", { value: i, children: i.toString().padStart(2, "0") }, i))
232
+ children: C.map((n) => /* @__PURE__ */ o("option", { value: n, children: n.toString().padStart(2, "0") }, n))
837
233
  }
838
234
  )
839
235
  ] }),
840
- /* @__PURE__ */ a.jsx("span", { className: "chronos-time-separator", children: ":" }),
841
- /* @__PURE__ */ a.jsxs("div", { className: "chronos-time-input-group", children: [
842
- /* @__PURE__ */ a.jsx("label", { htmlFor: "chronos-minute-select", className: "chronos-time-label", children: "Minute" }),
843
- /* @__PURE__ */ a.jsx(
236
+ /* @__PURE__ */ o("span", { className: "chronos-time-separator", children: ":" }),
237
+ /* @__PURE__ */ h("div", { className: "chronos-time-input-group", children: [
238
+ /* @__PURE__ */ o("label", { htmlFor: "chronos-minute-select", className: "chronos-time-label", children: "Minute" }),
239
+ /* @__PURE__ */ o(
844
240
  "select",
845
241
  {
846
242
  id: "chronos-minute-select",
847
243
  className: "chronos-time-select",
848
- value: R,
849
- onChange: (i) => x(parseInt(i.target.value, 10)),
244
+ value: b,
245
+ onChange: (n) => R(parseInt(n.target.value, 10)),
850
246
  "aria-label": "Select minute",
851
- children: P.map((i) => /* @__PURE__ */ a.jsx("option", { value: i, children: i.toString().padStart(2, "0") }, i))
247
+ children: E.map((n) => /* @__PURE__ */ o("option", { value: n, children: n.toString().padStart(2, "0") }, n))
852
248
  }
853
249
  )
854
250
  ] }),
855
- !d && /* @__PURE__ */ a.jsx(
251
+ !r && /* @__PURE__ */ o(
856
252
  "button",
857
253
  {
858
254
  type: "button",
859
255
  className: "chronos-period-toggle",
860
- onClick: O,
861
- "aria-label": `Switch to ${k === "AM" ? "PM" : "AM"}`,
862
- children: k
256
+ onClick: P,
257
+ "aria-label": `Switch to ${f === "AM" ? "PM" : "AM"}`,
258
+ children: f
863
259
  }
864
260
  )
865
261
  ] })
866
262
  ] });
867
- }, wr = ({
868
- value: o,
869
- onChange: l
263
+ }, Me = ({
264
+ value: e,
265
+ onChange: s
870
266
  }) => {
871
- const [d, c] = U(!1), b = ze.find((v) => v.value === o) || {
872
- label: o
873
- }, R = (v) => {
874
- l(v), c(!1);
267
+ const [r, a] = x(!1), c = H.find((d) => d.value === e) || {
268
+ label: e
269
+ }, b = (d) => {
270
+ s(d), a(!1);
875
271
  };
876
- return /* @__PURE__ */ a.jsxs("div", { className: "chronos-timezone-selector", children: [
877
- /* @__PURE__ */ a.jsxs("div", { className: "chronos-timezone-header", children: [
878
- /* @__PURE__ */ a.jsxs(
272
+ return /* @__PURE__ */ h("div", { className: "chronos-timezone-selector", children: [
273
+ /* @__PURE__ */ h("div", { className: "chronos-timezone-header", children: [
274
+ /* @__PURE__ */ h(
879
275
  "svg",
880
276
  {
881
277
  className: "chronos-globe-icon",
@@ -885,167 +281,187 @@ const Sr = ({
885
281
  stroke: "currentColor",
886
282
  strokeWidth: "2",
887
283
  children: [
888
- /* @__PURE__ */ a.jsx("circle", { cx: "12", cy: "12", r: "10" }),
889
- /* @__PURE__ */ a.jsx("line", { x1: "2", y1: "12", x2: "22", y2: "12" }),
890
- /* @__PURE__ */ a.jsx("path", { d: "M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
284
+ /* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "10" }),
285
+ /* @__PURE__ */ o("line", { x1: "2", y1: "12", x2: "22", y2: "12" }),
286
+ /* @__PURE__ */ o("path", { d: "M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
891
287
  ]
892
288
  }
893
289
  ),
894
- /* @__PURE__ */ a.jsx("span", { children: "Timezone" })
290
+ /* @__PURE__ */ o("span", { children: "Timezone" })
895
291
  ] }),
896
- /* @__PURE__ */ a.jsxs(
292
+ /* @__PURE__ */ h(
897
293
  "button",
898
294
  {
899
295
  type: "button",
900
296
  className: "chronos-timezone-button",
901
- onClick: () => c(!d),
902
- "aria-expanded": d,
297
+ onClick: () => a(!r),
298
+ "aria-expanded": r,
903
299
  "aria-label": "Select timezone",
904
300
  children: [
905
- /* @__PURE__ */ a.jsx("span", { className: "chronos-timezone-label", children: b.label }),
906
- /* @__PURE__ */ a.jsx("span", { className: "chronos-timezone-offset", children: Be(o) }),
907
- /* @__PURE__ */ a.jsx(
301
+ /* @__PURE__ */ o("span", { className: "chronos-timezone-label", children: c.label }),
302
+ /* @__PURE__ */ o("span", { className: "chronos-timezone-offset", children: Q(e) }),
303
+ /* @__PURE__ */ o(
908
304
  "svg",
909
305
  {
910
- className: `chronos-chevron ${d ? "expanded" : ""}`,
306
+ className: `chronos-chevron ${r ? "expanded" : ""}`,
911
307
  xmlns: "http://www.w3.org/2000/svg",
912
308
  viewBox: "0 0 24 24",
913
309
  fill: "none",
914
310
  stroke: "currentColor",
915
311
  strokeWidth: "2",
916
- children: /* @__PURE__ */ a.jsx("polyline", { points: "6 9 12 15 18 9" })
312
+ children: /* @__PURE__ */ o("polyline", { points: "6 9 12 15 18 9" })
917
313
  }
918
314
  )
919
315
  ]
920
316
  }
921
317
  ),
922
- d && /* @__PURE__ */ a.jsx("div", { className: "chronos-timezone-list", role: "listbox", children: ze.map((v) => /* @__PURE__ */ a.jsxs(
318
+ r && /* @__PURE__ */ o("div", { className: "chronos-timezone-list", role: "listbox", children: H.map((d) => /* @__PURE__ */ h(
923
319
  "button",
924
320
  {
925
321
  type: "button",
926
- className: `chronos-timezone-option ${v.value === o ? "selected" : ""}`,
927
- onClick: () => R(v.value),
322
+ className: `chronos-timezone-option ${d.value === e ? "selected" : ""}`,
323
+ onClick: () => b(d.value),
928
324
  role: "option",
929
- "aria-selected": v.value === o,
325
+ "aria-selected": d.value === e,
930
326
  children: [
931
- /* @__PURE__ */ a.jsx("span", { className: "chronos-timezone-option-label", children: v.label }),
932
- /* @__PURE__ */ a.jsx("span", { className: "chronos-timezone-option-offset", children: Be(v.value) })
327
+ /* @__PURE__ */ o("span", { className: "chronos-timezone-option-label", children: d.label }),
328
+ /* @__PURE__ */ o("span", { className: "chronos-timezone-option-offset", children: Q(d.value) })
933
329
  ]
934
330
  },
935
- v.value
331
+ d.value
936
332
  )) })
937
333
  ] });
938
- }, Pr = ({
939
- value: o,
940
- onChange: l,
941
- timezone: d = Tr,
942
- dateFormat: c = "DD",
943
- timeFormat: b = "HH:mm",
944
- minDate: R,
945
- maxDate: v,
946
- placeholder: k = "Select date and time",
947
- disabled: y = !1,
948
- showTime: w = !0,
949
- use24Hour: x = !0,
950
- className: O = "",
951
- ariaLabel: C = "Date and time picker",
952
- showTimezoneSelector: E = !1,
953
- theme: D = "light",
954
- orientation: F = "portrait"
334
+ };
335
+ function X(e, s, r) {
336
+ return {
337
+ iso: e.toISO() || "",
338
+ formatted: e.toFormat(`${s} ${r}`),
339
+ timestamp: e.toMillis(),
340
+ dateTime: e
341
+ };
342
+ }
343
+ const ke = ({
344
+ value: e,
345
+ onChange: s,
346
+ timezone: r = he,
347
+ dateFormat: a = "DD",
348
+ timeFormat: c = "HH:mm",
349
+ minDate: b,
350
+ maxDate: d,
351
+ placeholder: f = "Select date and time",
352
+ disabled: v = !1,
353
+ showTime: M = !0,
354
+ use24Hour: R = !0,
355
+ className: P = "",
356
+ ariaLabel: z = "Date and time picker",
357
+ showTimezoneSelector: A = !1,
358
+ theme: S = "light",
359
+ orientation: C = "portrait",
360
+ selectionMode: E = "single",
361
+ rangeValue: n,
362
+ onRangeChange: l
955
363
  }) => {
956
- const [P, i] = U(!1), [n, T] = U(() => o ? ce(o, d) : null), [p, G] = U(d), [q, B] = U(() => n || je(d)), Z = Le(null), X = Le(null);
957
- ue(() => {
958
- o && T(ce(o, p));
959
- }, [o, p]), ue(() => {
960
- const j = (g) => {
961
- Z.current && !Z.current.contains(g.target) && i(!1);
364
+ const y = E === "range", [T, g] = x(!1), [t, m] = x(() => !y && e ? I(e, r) : null), [i, O] = x(() => y && (n != null && n.start) ? I(n.start, r) : null), [N, Y] = x(() => y && (n != null && n.end) ? I(n.end, r) : null), [k, F] = x(r), [V, W] = x(() => t || i || N || U(r)), K = q(null), G = q(null);
365
+ Z(() => {
366
+ !y && e && m(I(e, k));
367
+ }, [e, k, y]), Z(() => {
368
+ y && (n == null ? void 0 : n.start) != null && (n == null ? void 0 : n.end) != null && (O(I(n.start, k)), Y(I(n.end, k)));
369
+ }, [y, n, k]), Z(() => {
370
+ const p = (u) => {
371
+ K.current && !K.current.contains(u.target) && g(!1);
962
372
  };
963
- if (P)
964
- return document.addEventListener("mousedown", j), () => document.removeEventListener("mousedown", j);
965
- }, [P]), ue(() => {
966
- const j = (g) => {
967
- var I;
968
- g.key === "Escape" && P && (i(!1), (I = X.current) == null || I.focus());
373
+ if (T)
374
+ return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
375
+ }, [T]), Z(() => {
376
+ const p = (u) => {
377
+ var w;
378
+ u.key === "Escape" && T && (g(!1), (w = G.current) == null || w.focus());
969
379
  };
970
- return document.addEventListener("keydown", j), () => document.removeEventListener("keydown", j);
971
- }, [P]);
972
- const fe = Te((j) => {
973
- let g = j;
974
- if (n && (g = j.set({
975
- hour: n.hour,
976
- minute: n.minute,
977
- second: n.second
978
- })), T(g), B(g), w || i(!1), l) {
979
- const I = {
980
- iso: g.toISO() || "",
981
- formatted: g.toFormat(`${c} ${b}`),
982
- timestamp: g.toMillis(),
983
- dateTime: g
380
+ return document.addEventListener("keydown", p), () => document.removeEventListener("keydown", p);
381
+ }, [T]);
382
+ const ee = _((p) => {
383
+ let u = p;
384
+ if (t && (u = p.set({
385
+ hour: t.hour,
386
+ minute: t.minute,
387
+ second: t.second
388
+ })), m(u), W(u), M || g(!1), s) {
389
+ const w = {
390
+ iso: u.toISO() || "",
391
+ formatted: u.toFormat(`${a} ${c}`),
392
+ timestamp: u.toMillis(),
393
+ dateTime: u
984
394
  };
985
- l(I);
986
- }
987
- }, [n, w, l, c, b]), de = Te((j, g) => {
988
- const L = (n || je(p)).set({ hour: j, minute: g, second: 0 });
989
- if (T(L), l) {
990
- const ae = {
991
- iso: L.toISO() || "",
992
- formatted: L.toFormat(`${c} ${b}`),
993
- timestamp: L.toMillis(),
994
- dateTime: L
395
+ s(w);
396
+ }
397
+ }, [t, M, s, a, c]), ne = _((p, u) => {
398
+ const $ = (t || U(k)).set({ hour: p, minute: u, second: 0 });
399
+ if (m($), s) {
400
+ const L = {
401
+ iso: $.toISO() || "",
402
+ formatted: $.toFormat(`${a} ${c}`),
403
+ timestamp: $.toMillis(),
404
+ dateTime: $
995
405
  };
996
- l(ae);
997
- }
998
- }, [n, p, l, c, b]), re = Te((j) => {
999
- if (G(j), n) {
1000
- const g = n.setZone(j);
1001
- if (T(g), B(g), l) {
1002
- const I = {
1003
- iso: g.toISO() || "",
1004
- formatted: g.toFormat(`${c} ${b}`),
1005
- timestamp: g.toMillis(),
1006
- dateTime: g
406
+ s(L);
407
+ }
408
+ }, [t, k, s, a, c]), te = _((p, u) => {
409
+ const w = p.startOf("day"), $ = u.startOf("day"), [L, B] = w <= $ ? [w, $] : [$, w];
410
+ if (O(L), Y(B), W(L), l) {
411
+ const le = X(L, a, c), ce = X(B, a, c), de = Math.max(0, Math.ceil(B.diff(L, "days").days));
412
+ l({ start: le, end: ce, nights: de });
413
+ }
414
+ }, [l, a, c]), oe = _((p) => {
415
+ if (F(p), t) {
416
+ const u = t.setZone(p);
417
+ if (m(u), W(u), s) {
418
+ const w = {
419
+ iso: u.toISO() || "",
420
+ formatted: u.toFormat(`${a} ${c}`),
421
+ timestamp: u.toMillis(),
422
+ dateTime: u
1007
423
  };
1008
- l(I);
424
+ s(w);
1009
425
  }
1010
426
  } else
1011
- B(je(j));
1012
- }, [n, l, c, b]), $ = () => {
1013
- y || i(!P);
1014
- }, W = (j) => {
1015
- (j.key === "Enter" || j.key === " ") && (j.preventDefault(), $());
1016
- }, V = n ? n.toFormat(`${c} ${w ? b : ""}`) : "", te = R ? ce(R, p) : void 0, ne = v ? ce(v, p) : void 0;
1017
- return /* @__PURE__ */ a.jsxs(
427
+ W(U(p));
428
+ }, [t, s, a, c]), J = () => {
429
+ v || g(!T);
430
+ }, se = (p) => {
431
+ (p.key === "Enter" || p.key === " ") && (p.preventDefault(), J());
432
+ }, ae = y ? i && N ? `${i.toFormat("d MMM yyyy")} – ${N.toFormat("d MMM yyyy")}` : "" : t ? t.toFormat(`${a} ${M ? c : ""}`) : "", re = b ? I(b, k) : void 0, ie = d ? I(d, k) : void 0;
433
+ return /* @__PURE__ */ h(
1018
434
  "div",
1019
435
  {
1020
- ref: Z,
1021
- className: `chronos-picker ${O}`,
1022
- "data-disabled": y,
1023
- "data-theme": D,
436
+ ref: K,
437
+ className: `chronos-picker ${P}`,
438
+ "data-disabled": v,
439
+ "data-theme": S,
1024
440
  children: [
1025
- /* @__PURE__ */ a.jsxs(
441
+ /* @__PURE__ */ h(
1026
442
  "div",
1027
443
  {
1028
444
  className: "chronos-input-wrapper",
1029
- onClick: $,
445
+ onClick: J,
1030
446
  children: [
1031
- /* @__PURE__ */ a.jsx(
447
+ /* @__PURE__ */ o(
1032
448
  "input",
1033
449
  {
1034
- ref: X,
450
+ ref: G,
1035
451
  type: "text",
1036
452
  className: "chronos-input",
1037
- value: V,
1038
- placeholder: k,
453
+ value: ae,
454
+ placeholder: f,
1039
455
  readOnly: !0,
1040
- disabled: y,
1041
- onKeyDown: W,
1042
- "aria-label": C,
1043
- "aria-expanded": P,
456
+ disabled: v,
457
+ onKeyDown: se,
458
+ "aria-label": z,
459
+ "aria-expanded": T,
1044
460
  "aria-haspopup": "dialog",
1045
461
  role: "combobox"
1046
462
  }
1047
463
  ),
1048
- /* @__PURE__ */ a.jsxs(
464
+ /* @__PURE__ */ h(
1049
465
  "svg",
1050
466
  {
1051
467
  className: "chronos-calendar-icon",
@@ -1055,51 +471,66 @@ const Sr = ({
1055
471
  stroke: "currentColor",
1056
472
  strokeWidth: "2",
1057
473
  children: [
1058
- /* @__PURE__ */ a.jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
1059
- /* @__PURE__ */ a.jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
1060
- /* @__PURE__ */ a.jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
1061
- /* @__PURE__ */ a.jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
474
+ /* @__PURE__ */ o("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
475
+ /* @__PURE__ */ o("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
476
+ /* @__PURE__ */ o("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
477
+ /* @__PURE__ */ o("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
1062
478
  ]
1063
479
  }
1064
480
  )
1065
481
  ]
1066
482
  }
1067
483
  ),
1068
- P && /* @__PURE__ */ a.jsx(
484
+ T && /* @__PURE__ */ o(
1069
485
  "div",
1070
486
  {
1071
487
  className: "chronos-dropdown",
1072
- "data-orientation": F,
488
+ "data-orientation": C,
489
+ "data-range-mode": y,
1073
490
  role: "dialog",
1074
491
  "aria-label": "Date and time picker dialog",
1075
- children: /* @__PURE__ */ a.jsxs("div", { className: "chronos-dropdown-content", children: [
1076
- /* @__PURE__ */ a.jsx(
1077
- Sr,
492
+ children: /* @__PURE__ */ h("div", { className: "chronos-dropdown-content", children: [
493
+ y && i && N && /* @__PURE__ */ h("div", { className: "chronos-range-summary", children: [
494
+ /* @__PURE__ */ h("div", { className: "chronos-range-nights", children: [
495
+ Math.max(0, Math.ceil(N.diff(i, "days").days)),
496
+ " nights"
497
+ ] }),
498
+ /* @__PURE__ */ h("div", { className: "chronos-range-dates", children: [
499
+ i.toFormat("d MMM yyyy"),
500
+ " – ",
501
+ N.toFormat("d MMM yyyy")
502
+ ] })
503
+ ] }),
504
+ /* @__PURE__ */ o(
505
+ pe,
1078
506
  {
1079
- viewDate: q,
1080
- selectedDate: n,
1081
- onDateSelect: fe,
1082
- onViewDateChange: B,
1083
- timezone: p,
1084
- minDate: te,
1085
- maxDate: ne
507
+ viewDate: V,
508
+ selectedDate: y ? null : t,
509
+ onDateSelect: ee,
510
+ onViewDateChange: W,
511
+ timezone: k,
512
+ minDate: re,
513
+ maxDate: ie,
514
+ selectedStart: y ? i : void 0,
515
+ selectedEnd: y ? N : void 0,
516
+ onRangeSelect: y ? te : void 0
1086
517
  }
1087
518
  ),
1088
- (w || E) && /* @__PURE__ */ a.jsxs("div", { className: "chronos-sidebar", children: [
1089
- w && /* @__PURE__ */ a.jsx(
1090
- kr,
519
+ !y && (M || A) && /* @__PURE__ */ h("div", { className: "chronos-sidebar", children: [
520
+ M && /* @__PURE__ */ o(
521
+ ye,
1091
522
  {
1092
- value: n,
1093
- onChange: de,
1094
- use24Hour: x,
1095
- timezone: p
523
+ value: t,
524
+ onChange: ne,
525
+ use24Hour: R,
526
+ timezone: k
1096
527
  }
1097
528
  ),
1098
- E && /* @__PURE__ */ a.jsx(
1099
- wr,
529
+ A && /* @__PURE__ */ o(
530
+ Me,
1100
531
  {
1101
- value: p,
1102
- onChange: re
532
+ value: k,
533
+ onChange: oe
1103
534
  }
1104
535
  )
1105
536
  ] })
@@ -1111,9 +542,9 @@ const Sr = ({
1111
542
  );
1112
543
  };
1113
544
  export {
1114
- ze as COMMON_TIMEZONES,
1115
- Tr as DEFAULT_TIMEZONE,
1116
- Pr as DateTimePicker,
1117
- ce as convertToTimezone,
1118
- je as nowInTimezone
545
+ H as COMMON_TIMEZONES,
546
+ he as DEFAULT_TIMEZONE,
547
+ ke as DateTimePicker,
548
+ I as convertToTimezone,
549
+ U as nowInTimezone
1119
550
  };