@das-fed/upf-utils 6.4.0-dev.283 → 6.4.0-dev.284

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 (87) hide show
  1. package/api-services/es5.js +1427 -1459
  2. package/api-services/index.js +1122 -1150
  3. package/api-services/index.js.gz +0 -0
  4. package/api-services/modules/app-manage/es5.js +1235 -1275
  5. package/api-services/modules/app-manage/index.js +1018 -1059
  6. package/api-services/modules/app-manage/index.js.gz +0 -0
  7. package/api-services/modules/authentication/es5.js +1272 -1309
  8. package/api-services/modules/authentication/index.js +1043 -1080
  9. package/api-services/modules/authentication/index.js.gz +0 -0
  10. package/api-services/modules/bems/es5.js +1241 -1257
  11. package/api-services/modules/bems/index.js +1022 -1027
  12. package/api-services/modules/bems/index.js.gz +0 -0
  13. package/api-services/modules/contract/es5.js +732 -760
  14. package/api-services/modules/contract/index.js +572 -595
  15. package/api-services/modules/contract/index.js.gz +0 -0
  16. package/api-services/modules/duty-manage/es5.js +727 -755
  17. package/api-services/modules/duty-manage/index.js +581 -604
  18. package/api-services/modules/duty-manage/index.js.gz +0 -0
  19. package/api-services/modules/enterpriseright/es5.js +734 -762
  20. package/api-services/modules/enterpriseright/index.js +581 -604
  21. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  22. package/api-services/modules/es5.js +1377 -1418
  23. package/api-services/modules/file/es5.js +1137 -1166
  24. package/api-services/modules/file/index.js +933 -957
  25. package/api-services/modules/file/index.js.gz +0 -0
  26. package/api-services/modules/gateway-edge/es5.js +734 -762
  27. package/api-services/modules/gateway-edge/index.js +581 -604
  28. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  29. package/api-services/modules/index.js +1091 -1133
  30. package/api-services/modules/index.js.gz +0 -0
  31. package/api-services/modules/iot/es5.js +1286 -1302
  32. package/api-services/modules/iot/index.js +1059 -1064
  33. package/api-services/modules/iot/index.js.gz +0 -0
  34. package/api-services/modules/justauth/es5.js +1232 -1272
  35. package/api-services/modules/justauth/index.js +1015 -1056
  36. package/api-services/modules/justauth/index.js.gz +0 -0
  37. package/api-services/modules/knowledge/es5.js +1280 -1296
  38. package/api-services/modules/knowledge/index.js +1063 -1068
  39. package/api-services/modules/knowledge/index.js.gz +0 -0
  40. package/api-services/modules/link/es5.js +734 -762
  41. package/api-services/modules/link/index.js +581 -604
  42. package/api-services/modules/link/index.js.gz +0 -0
  43. package/api-services/modules/permission/es5.js +734 -762
  44. package/api-services/modules/permission/index.js +581 -604
  45. package/api-services/modules/permission/index.js.gz +0 -0
  46. package/api-services/modules/platformManage/es5.js +968 -996
  47. package/api-services/modules/platformManage/index.js +770 -793
  48. package/api-services/modules/platformManage/index.js.gz +0 -0
  49. package/api-services/modules/portal/es5.js +1235 -1275
  50. package/api-services/modules/portal/index.js +1018 -1059
  51. package/api-services/modules/portal/index.js.gz +0 -0
  52. package/api-services/modules/space-manage/es5.js +732 -760
  53. package/api-services/modules/space-manage/index.js +572 -595
  54. package/api-services/modules/space-manage/index.js.gz +0 -0
  55. package/api-services/modules/super-admin/es5.js +1240 -1280
  56. package/api-services/modules/super-admin/index.js +1020 -1061
  57. package/api-services/modules/super-admin/index.js.gz +0 -0
  58. package/api-services/modules/supplier/es5.js +1240 -1280
  59. package/api-services/modules/supplier/index.js +1020 -1061
  60. package/api-services/modules/supplier/index.js.gz +0 -0
  61. package/api-services/modules/supplychain-manage/es5.js +734 -762
  62. package/api-services/modules/supplychain-manage/index.js +581 -604
  63. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  64. package/api-services/modules/systemConfiguration/es5.js +734 -762
  65. package/api-services/modules/systemConfiguration/index.js +581 -604
  66. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  67. package/api-services/modules/tool/es5.js +732 -760
  68. package/api-services/modules/tool/index.js +572 -595
  69. package/api-services/modules/tool/index.js.gz +0 -0
  70. package/api-services/src/create-service/es5.js +732 -760
  71. package/api-services/src/create-service/index.js +580 -603
  72. package/api-services/src/create-service/index.js.gz +0 -0
  73. package/common-info/es5.js +753 -781
  74. package/common-info/getPermissionMethod/es5.js +766 -794
  75. package/common-info/getPermissionMethod/index.js +608 -631
  76. package/common-info/getPermissionMethod/index.js.gz +0 -0
  77. package/common-info/index.js +593 -616
  78. package/common-info/index.js.gz +0 -0
  79. package/common-tools/timezone-format/es5.d.ts +1 -5
  80. package/common-tools/timezone-format/es5.js +270 -290
  81. package/common-tools/timezone-format/index.d.ts +1 -5
  82. package/common-tools/timezone-format/index.js +198 -215
  83. package/common-tools/timezone-format/index.js.gz +0 -0
  84. package/create-api-service/es5.js +731 -759
  85. package/create-api-service/index.js +572 -595
  86. package/create-api-service/index.js.gz +0 -0
  87. package/package.json +3 -3
@@ -1,9 +1,10 @@
1
1
  import f from "dayjs";
2
- import Ze from "dayjs/plugin/utc";
3
- import Ie from "dayjs/plugin/timezone";
2
+ import { ref as Te } from "vue";
3
+ import ge from "dayjs/plugin/utc";
4
+ import Ze from "dayjs/plugin/timezone";
4
5
  import "@das-fed/upf-utils/config";
5
- const ee = "/api/admin/basic-application/sys-info/v1/license/time-zone-packed-data";
6
- function ye() {
6
+ const X = "/api/admin/basic-application/sys-info/v1/license/time-zone-packed-data";
7
+ function Ie() {
7
8
  if (typeof localStorage > "u")
8
9
  return null;
9
10
  try {
@@ -12,18 +13,18 @@ function ye() {
12
13
  return null;
13
14
  }
14
15
  }
15
- function pe() {
16
- const e = ye();
16
+ function ye() {
17
+ const e = Ie();
17
18
  if (!(e == null || e === ""))
18
19
  return e.trim().startsWith("Bearer ") ? e.trim() : `Bearer ${e.trim()}`;
19
20
  }
20
- function te(e = {}) {
21
- const t = e.authorization !== void 0 ? e.authorization === "" || e.authorization == null ? void 0 : e.authorization : pe(), n = { ...e.headers || {} };
21
+ function ee(e = {}) {
22
+ const t = e.authorization !== void 0 ? e.authorization === "" || e.authorization == null ? void 0 : e.authorization : ye(), n = { ...e.headers || {} };
22
23
  if (t != null && t !== "" && (n.Authorization = t), Object.keys(n).length !== 0)
23
24
  return { headers: n };
24
25
  }
25
- let L = null, w = null;
26
- const R = [
26
+ let A = null, w = null;
27
+ const Y = [
27
28
  "utc",
28
29
  "uct",
29
30
  "zulu",
@@ -42,8 +43,8 @@ const R = [
42
43
  "etc/gmt+0",
43
44
  "etc/gmt-0",
44
45
  "etc/greenwich"
45
- ], we = { u: [1 / 0], o: [0] };
46
- function ne(e) {
46
+ ], pe = { u: [1 / 0], o: [0] };
47
+ function te(e) {
47
48
  if (!e || typeof e != "object")
48
49
  throw new Error("Invalid IANA response: expected an object");
49
50
  const t = e;
@@ -56,7 +57,7 @@ function ne(e) {
56
57
  links: Array.isArray(n) ? n : []
57
58
  };
58
59
  }
59
- async function De(e, t) {
60
+ async function we(e, t) {
60
61
  if (typeof fetch != "function")
61
62
  throw new Error("fetch is not available. Pass preloadFromApi options.fetchJson.");
62
63
  const n = await fetch(e, t);
@@ -64,48 +65,48 @@ async function De(e, t) {
64
65
  throw new Error(`IANA request failed: ${n.status} ${n.statusText}`);
65
66
  return n.json();
66
67
  }
67
- function oe(e) {
68
- return w = ne(e), L = Me(w), w;
68
+ function ne(e) {
69
+ return w = te(e), A = Me(w), w;
69
70
  }
70
- function Ee() {
71
+ function De() {
71
72
  return w;
72
73
  }
73
- async function Ae(e = {}) {
74
- const t = e.url ?? ee, n = te({
74
+ async function Ee(e = {}) {
75
+ const t = e.url ?? X, n = ee({
75
76
  authorization: e.authorization,
76
77
  headers: e.headers
77
- }), o = await (e.fetchJson ?? De)(t, n), s = e.parseResponse ? e.parseResponse(o) : ne(o);
78
- return oe(s);
78
+ }), o = await (e.fetchJson ?? we)(t, n), s = e.parseResponse ? e.parseResponse(o) : te(o);
79
+ return ne(s);
79
80
  }
80
81
  function ze() {
81
- L = null, w = null;
82
+ A = null, w = null;
82
83
  }
83
- function H(e) {
84
+ function R(e) {
84
85
  return e > 96 ? e - 87 : e > 64 ? e - 29 : e - 48;
85
86
  }
86
- function Le(e) {
87
+ function Ae(e) {
87
88
  let t = 1, n = 0, r = 0, o = 1;
88
89
  const s = e.split("."), i = s[0], c = s[1] || "";
89
90
  e.charCodeAt(0) === 45 && (t = -1);
90
91
  for (let a = 0; a < i.length; a++) {
91
92
  const u = i.charCodeAt(a);
92
- u !== 45 && (n = 60 * n + H(u));
93
+ u !== 45 && (n = 60 * n + R(u));
93
94
  }
94
95
  for (let a = 0; a < c.length; a++)
95
- o = o / 60, r += H(c.charCodeAt(a)) * o;
96
+ o = o / 60, r += R(c.charCodeAt(a)) * o;
96
97
  return (n + r) * t;
97
98
  }
98
- function k(e) {
99
+ function U(e) {
99
100
  const t = [];
100
101
  for (const n of e)
101
- t.push(Le(n));
102
+ t.push(Ae(n));
102
103
  return t;
103
104
  }
104
- function J(e) {
105
+ function H(e) {
105
106
  const t = e.trim();
106
107
  return t ? t.split(" ") : [];
107
108
  }
108
- function Se(e) {
109
+ function Le(e) {
109
110
  let t = 0;
110
111
  const n = [];
111
112
  for (const r of e)
@@ -118,14 +119,14 @@ function Ce(e, t) {
118
119
  n.push(e[r]);
119
120
  return n;
120
121
  }
121
- function S(e) {
122
+ function L(e) {
122
123
  return typeof e == "string" ? e.trim().toLowerCase() : "";
123
124
  }
124
- function ve(e) {
125
+ function Se(e) {
125
126
  const t = e.split("|");
126
127
  if (t.length < 5)
127
128
  throw new Error("Invalid packed zone format");
128
- const n = S(t[0]), r = k(J(t[2])), o = k(t[3].split("")), s = Se(k(J(t[4]))), i = Ce(r, o);
129
+ const n = L(t[0]), r = U(H(t[2])), o = U(t[3].split("")), s = Le(U(H(t[4]))), i = Ce(r, o);
129
130
  return {
130
131
  name: n,
131
132
  rule: {
@@ -134,15 +135,15 @@ function ve(e) {
134
135
  }
135
136
  };
136
137
  }
137
- function be(e, t, n) {
138
- const r = S(t), o = S(n);
138
+ function ve(e, t, n) {
139
+ const r = L(t), o = L(n);
139
140
  if (!r || !o) return;
140
141
  const s = e[r], i = e[o];
141
142
  s && !i ? e[o] = s : i && !s && (e[r] = i);
142
143
  }
143
- function _e(e) {
144
- const t = R.map((n) => e[n]).find(Boolean) || we;
145
- R.forEach((n) => {
144
+ function be(e) {
145
+ const t = Y.map((n) => e[n]).find(Boolean) || pe;
146
+ Y.forEach((n) => {
146
147
  e[n] || (e[n] = t);
147
148
  });
148
149
  }
@@ -151,25 +152,25 @@ function Me(e) {
151
152
  throw new TypeError("packed iana data must contain zones array");
152
153
  const t = {};
153
154
  for (const r of e.zones) {
154
- const o = ve(r);
155
+ const o = Se(r);
155
156
  t[o.name] = o.rule;
156
157
  }
157
158
  const n = e.links || [];
158
159
  for (const r of n) {
159
160
  const o = r.split("|");
160
- o.length < 2 || be(t, o[0], o[1]);
161
+ o.length < 2 || ve(t, o[0], o[1]);
161
162
  }
162
- return _e(t), t;
163
+ return be(t), t;
163
164
  }
164
- function ke() {
165
- if (!L)
165
+ function _e() {
166
+ if (!A)
166
167
  throw new Error(
167
168
  "IANA data not loaded. Await dayjsTimezoneIanaPlugin.preloadFromApi({ url: ... }) before dayjs.extend(dayjsTimezoneIanaPlugin)."
168
169
  );
169
- return L;
170
+ return A;
170
171
  }
171
- function Oe(e, t, n) {
172
- const r = S(t), o = n[r];
172
+ function ke(e, t, n) {
173
+ const r = L(t), o = n[r];
173
174
  if (o === void 0)
174
175
  throw Error("Unknown Time Zone " + t);
175
176
  const s = o.o, i = o.u, c = i.length - 1;
@@ -192,15 +193,15 @@ const Ue = (e, t, n) => {
192
193
  r = l, i == null || i(l);
193
194
  }, c.guess = () => s ? s() : typeof Intl < "u" && typeof Intl.DateTimeFormat == "function" ? Intl.DateTimeFormat().resolvedOptions().timeZone || r || "UTC" : r || "UTC", n.tz = c, t.prototype.tz = function(l = r, T) {
194
195
  var I;
195
- const Z = l || ((I = c.guess) == null ? void 0 : I.call(c)) || "UTC", z = this.utc().valueOf(), g = Oe(z, Z, ke());
196
+ const Z = l || ((I = c.guess) == null ? void 0 : I.call(c)) || "UTC", z = this.utc().valueOf(), g = ke(z, Z, _e());
196
197
  return this.utcOffset(-g, T);
197
198
  };
198
199
  }, d = Ue;
199
- d.preloadFromApi = Ae;
200
- d.preloadFromData = oe;
201
- d.getCachedPackedData = Ee;
200
+ d.preloadFromApi = Ee;
201
+ d.preloadFromData = ne;
202
+ d.getCachedPackedData = De;
202
203
  d.clearIanaCache = ze;
203
- function Ne(e) {
204
+ function Oe(e) {
204
205
  if (!e || typeof e != "object")
205
206
  throw new Error("Invalid IANA response: expected an object");
206
207
  const t = e;
@@ -213,14 +214,14 @@ function Ne(e) {
213
214
  links: Array.isArray(n) ? n : []
214
215
  };
215
216
  }
216
- function re(e, t) {
217
+ function oe(e, t) {
217
218
  if (!e || typeof e.tz != "object" || typeof e.tz.load != "function")
218
219
  throw new Error("moment.tz.load is missing. Import moment-timezone before calling loadIanaData.");
219
220
  if (!t || !Array.isArray(t.zones))
220
221
  throw new Error("Invalid packed IANA data: zones must be an array");
221
222
  e.tz.load(t);
222
223
  }
223
- async function Fe(e, t) {
224
+ async function Ne(e, t) {
224
225
  if (typeof fetch != "function")
225
226
  throw new Error("fetch is not available. Pass loadIanaFromApi options.fetchJson in Node or polyfill fetch.");
226
227
  const n = await fetch(e, t);
@@ -228,21 +229,21 @@ async function Fe(e, t) {
228
229
  throw new Error(`IANA request failed: ${n.status} ${n.statusText}`);
229
230
  return n.json();
230
231
  }
231
- async function W(e, t, n) {
232
- let r = ee, o = {};
232
+ async function J(e, t, n) {
233
+ let r = X, o = {};
233
234
  typeof t == "string" ? (r = t, o = n ?? {}) : t != null && (o = t);
234
- const s = te({
235
+ const s = ee({
235
236
  authorization: o.authorization,
236
237
  headers: o.headers
237
- }), c = await (o.fetchJson ?? Fe)(r, s), a = o.parseResponse ? o.parseResponse(c) : Ne(c);
238
- return re(e, a), a;
238
+ }), c = await (o.fetchJson ?? Ne)(r, s), a = o.parseResponse ? o.parseResponse(c) : Oe(c);
239
+ return oe(e, a), a;
239
240
  }
241
+ f.extend(ge);
240
242
  f.extend(Ze);
241
- f.extend(Ie);
242
- const p = "zh-CN", Pe = "YYYY.MM.DD HH:mm:ss", b = "YYYY-MM-DD HH:mm:ss", se = "YYYY-MM-DD HH:mm", F = "UTC", P = "timeZone", ae = "timezonechange", je = "__UPF_TIMEZONE_CHANGE__", B = {
243
+ const p = "zh-CN", Fe = "YYYY.MM.DD HH:mm:ss", b = "YYYY-MM-DD HH:mm:ss", re = "YYYY-MM-DD HH:mm", F = "UTC", P = "timeZone", se = "timezonechange", Pe = "__UPF_TIMEZONE_CHANGE__", B = {
243
244
  zh: "夏令时",
244
245
  default: "DST"
245
- }, xe = [
246
+ }, je = [
246
247
  "UTC",
247
248
  "UCT",
248
249
  "Zulu",
@@ -262,34 +263,26 @@ const p = "zh-CN", Pe = "YYYY.MM.DD HH:mm:ss", b = "YYYY-MM-DD HH:mm:ss", se = "
262
263
  "Etc/GMT-0",
263
264
  "Etc/Greenwich"
264
265
  ], y = /* @__PURE__ */ new Set();
265
- var Q, X;
266
- const Ve = (X = (Q = f.tz) == null ? void 0 : Q.guess) == null ? void 0 : X.bind(f.tz);
266
+ var q, Q;
267
+ const xe = (Q = (q = f.tz) == null ? void 0 : q.guess) == null ? void 0 : Q.bind(f.tz);
267
268
  let C = !1;
268
269
  const m = (e) => (e || "").trim(), O = (e) => {
269
270
  const t = m(e);
270
271
  t && y.add(t);
271
- }, $e = () => xe.forEach(O), D = () => typeof window > "u" ? void 0 : window, j = () => {
272
+ }, Ve = () => je.forEach(O), M = () => typeof window > "u" ? void 0 : window, j = () => {
272
273
  try {
273
274
  return typeof sessionStorage > "u" ? "" : m(sessionStorage.getItem(P));
274
275
  } catch {
275
276
  return "";
276
277
  }
277
- }, Ge = (e) => {
278
+ }, $e = (e) => {
278
279
  try {
279
280
  typeof sessionStorage < "u" && sessionStorage.setItem(P, e);
280
281
  } catch {
281
282
  }
282
283
  }, x = () => {
283
284
  var t;
284
- const e = D();
285
- try {
286
- return m((t = e == null ? void 0 : e.__UPF_TIMEZONE_SNAPSHOT__) == null ? void 0 : t.timeZone);
287
- } catch {
288
- return "";
289
- }
290
- }, V = () => {
291
- var t;
292
- const e = D();
285
+ const e = M();
293
286
  if (!(e != null && e.name)) return "";
294
287
  try {
295
288
  const n = (t = JSON.parse(e.name || "{}")) == null ? void 0 : t.parentData;
@@ -297,29 +290,20 @@ const m = (e) => (e || "").trim(), O = (e) => {
297
290
  } catch {
298
291
  return "";
299
292
  }
300
- }, ie = (e, t) => ({
293
+ }, ae = (e, t) => ({
301
294
  timeZone: m(e),
302
295
  source: t,
303
296
  timestamp: Date.now()
304
- });
305
- let U = x() || V() || j();
306
- const ce = {
307
- get value() {
308
- return U;
309
- },
310
- set value(e) {
311
- Be(e, { source: "clientTimeZone.value" });
312
- }
313
- }, N = /* @__PURE__ */ new Set();
314
- let K = !1;
315
- const Ye = () => {
297
+ }), S = Te(j() || x()), N = /* @__PURE__ */ new Set();
298
+ let W = !1;
299
+ const Ge = () => {
316
300
  if (!(typeof Intl > "u" || typeof Intl.DateTimeFormat != "function"))
317
301
  try {
318
302
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
319
303
  } catch {
320
304
  return;
321
305
  }
322
- }, Re = (e) => {
306
+ }, Ye = (e) => {
323
307
  if (!e) return !1;
324
308
  if (typeof Intl > "u" || typeof Intl.DateTimeFormat != "function") return !0;
325
309
  try {
@@ -327,9 +311,9 @@ const Ye = () => {
327
311
  } catch {
328
312
  return !1;
329
313
  }
330
- }, E = (e) => {
314
+ }, D = (e) => {
331
315
  const t = m(e);
332
- return t ? y.size ? y.has(t) : Re(t) : !1;
316
+ return t ? y.size ? y.has(t) : Ye(t) : !1;
333
317
  }, _ = (e) => (y.clear(), e.zones.forEach((t) => {
334
318
  const n = t.split("|")[0];
335
319
  O(n);
@@ -337,61 +321,61 @@ const Ye = () => {
337
321
  t.split("|").forEach((n) => {
338
322
  O(n);
339
323
  });
340
- }), $e(), Array.from(y)), wt = () => Array.from(y), Dt = async (e, t = {}) => {
324
+ }), Ve(), Array.from(y)), pt = () => Array.from(y), wt = async (e, t = {}) => {
341
325
  const n = d.preloadFromData(e), r = _(n);
342
- return C || (f.extend(d), C = !0), $(t.defaultTimeZone), { data: n, knownTimeZones: r };
343
- }, Et = async (e = {}) => {
326
+ return C || (f.extend(d), C = !0), V(t.defaultTimeZone), { data: n, knownTimeZones: r };
327
+ }, Dt = async (e = {}) => {
344
328
  const t = await d.preloadFromApi(e), n = _(t);
345
- return C || (f.extend(d), C = !0), $(e.defaultTimeZone), { data: t, knownTimeZones: n };
346
- }, At = (e, t) => (re(e, t), _(t), t), zt = async (e, t = {}) => {
347
- const { url: n, ...r } = t, o = n ? await W(e, n, r) : await W(e, r);
329
+ return C || (f.extend(d), C = !0), V(e.defaultTimeZone), { data: t, knownTimeZones: n };
330
+ }, Et = (e, t) => (oe(e, t), _(t), t), zt = async (e, t = {}) => {
331
+ const { url: n, ...r } = t, o = n ? await J(e, n, r) : await J(e, r);
348
332
  return _(o), o;
349
- }, He = () => {
333
+ }, Re = () => {
350
334
  var n;
351
- const e = (n = f.tz) == null ? void 0 : n.guess, t = typeof e == "function" ? e : Ve;
335
+ const e = (n = f.tz) == null ? void 0 : n.guess, t = typeof e == "function" ? e : xe;
352
336
  try {
353
337
  return t == null ? void 0 : t();
354
338
  } catch {
355
339
  return;
356
340
  }
357
- }, $ = (e) => {
341
+ }, V = (e) => {
358
342
  var r, o;
359
343
  const t = m(e), n = f.tz;
360
- return t ? E(t) ? ((o = n == null ? void 0 : n.setDefault) == null || o.call(n, t), !0) : !1 : ((r = n == null ? void 0 : n.setDefault) == null || r.call(n, F), !0);
361
- }, Je = (e) => {
344
+ return t ? D(t) ? ((o = n == null ? void 0 : n.setDefault) == null || o.call(n, t), !0) : !1 : ((r = n == null ? void 0 : n.setDefault) == null || r.call(n, F), !0);
345
+ }, He = (e) => {
362
346
  N.forEach((t) => {
363
347
  try {
364
348
  t(e.timeZone, e);
365
349
  } catch {
366
350
  }
367
351
  });
368
- }, We = (e) => {
352
+ }, Je = (e) => {
369
353
  var t;
370
354
  try {
371
- (t = D()) == null || t.dispatchEvent(new CustomEvent(ae, { detail: e }));
355
+ (t = M()) == null || t.dispatchEvent(new CustomEvent(se, { detail: e }));
372
356
  } catch {
373
357
  }
374
- }, G = (e, t = {}) => {
375
- const n = m(e), r = ie(n, t.source), o = U !== n;
376
- o && (U = n);
358
+ }, $ = (e, t = {}) => {
359
+ const n = m(e), r = ae(n, t.source), o = S.value !== n;
360
+ o && (S.value = n);
377
361
  try {
378
- const s = D();
362
+ const s = M();
379
363
  s && (s.__UPF_TIMEZONE_SNAPSHOT__ = r);
380
364
  } catch {
381
365
  }
382
- return t.persist !== !1 && Ge(n), t.syncDefault !== !1 && $(n), t.notify !== !1 && o && Je(r), t.dispatchEvent !== !1 && We(r), n;
383
- }, Be = (e, t = {}) => G(m(e), {
366
+ return t.persist !== !1 && $e(n), t.syncDefault !== !1 && V(n), t.notify !== !1 && o && He(r), t.dispatchEvent !== !1 && Je(r), n;
367
+ }, At = (e, t = {}) => $(m(e), {
384
368
  persist: !0,
385
369
  notify: !0,
386
370
  dispatchEvent: !0,
387
371
  syncDefault: !0,
388
372
  ...t
389
373
  }), Lt = (e = "sync") => {
390
- const t = x() || V() || j();
391
- return t || ce.value ? G(t, { source: e, persist: !1, dispatchEvent: !1 }) : "";
392
- }, St = (e) => (N.add(e), () => N.delete(e)), Ke = (e) => {
374
+ const t = j() || x();
375
+ return t || S.value ? $(t, { source: e, dispatchEvent: !1 }) : "";
376
+ }, Ct = (e) => (N.add(e), () => N.delete(e)), Be = (e) => {
393
377
  var n, r, o, s;
394
- if (typeof e == "string") return ie(e);
378
+ if (typeof e == "string") return ae(e);
395
379
  if (!e || typeof e != "object") return null;
396
380
  const t = "timeZone" in e ? e.timeZone : e != null && e.detail && "timeZone" in e.detail ? e.detail.timeZone : e != null && e.params && "timeZone" in e.params ? e.params.timeZone : void 0;
397
381
  return t == null ? null : {
@@ -399,94 +383,93 @@ const Ye = () => {
399
383
  source: e.source || ((n = e.detail) == null ? void 0 : n.source) || ((r = e.params) == null ? void 0 : r.source),
400
384
  timestamp: Number(e.timestamp || ((o = e.detail) == null ? void 0 : o.timestamp) || ((s = e.params) == null ? void 0 : s.timestamp) || Date.now())
401
385
  };
402
- }, Y = (e, t) => {
403
- const n = Ke(e);
404
- n && G(n.timeZone, {
386
+ }, G = (e, t) => {
387
+ const n = Be(e);
388
+ n && $(n.timeZone, {
405
389
  source: n.source || t,
406
- persist: !1,
407
390
  dispatchEvent: !1
408
391
  });
392
+ }, We = (e) => {
393
+ G(e.detail, "window-event");
394
+ }, Ke = (e) => {
395
+ e.key === P && G({ timeZone: e.newValue || "", source: "storage" }, "storage");
409
396
  }, qe = (e) => {
410
- Y(e.detail, "window-event");
411
- }, Qe = (e) => {
412
- e.key === P && Y({ timeZone: e.newValue || "", source: "storage" }, "storage");
413
- }, Xe = (e) => {
414
397
  const t = e.data;
415
- !t || t.type !== je || Y(t.detail || t, "message");
416
- }, et = () => {
417
- const e = D();
418
- return !e || K ? !1 : (K = !0, e.addEventListener(ae, qe), e.addEventListener("storage", Qe), e.addEventListener("message", Xe), !0);
398
+ !t || t.type !== Pe || G(t.detail || t, "message");
399
+ }, Qe = () => {
400
+ const e = M();
401
+ return !e || W ? !1 : (W = !0, e.addEventListener(se, We), e.addEventListener("storage", Ke), e.addEventListener("message", qe), !0);
419
402
  };
420
- et();
421
- const tt = () => {
422
- const t = m(ce.value) || x() || V() || j() || He() || Ye();
423
- return E(t) ? m(t) : F;
403
+ Qe();
404
+ const Xe = () => {
405
+ const t = m(S.value) || j() || x() || Re() || Ge();
406
+ return D(t) ? m(t) : F;
424
407
  }, h = (e) => {
425
- const t = m(e) || tt();
426
- return E(t) ? t : F;
427
- }, nt = () => {
408
+ const t = m(e) || Xe();
409
+ return D(t) ? t : F;
410
+ }, et = () => {
428
411
  var e;
429
412
  return typeof window < "u" && ((e = window.navigator) != null && e.language) ? window.navigator.language : p;
430
- }, ot = (e, t = []) => {
431
- const r = e || nt() || p, o = r.toLowerCase();
413
+ }, tt = (e, t = []) => {
414
+ const r = e || et() || p, o = r.toLowerCase();
432
415
  if (!t.length)
433
416
  return o === "en" ? "en-US" : o === "zh" || o === "zh-cn" ? p : r;
434
417
  const s = t.find((a) => a.toLowerCase() === o);
435
418
  if (s) return s;
436
419
  const i = o.split("-")[0], c = t.find((a) => a.toLowerCase().split("-")[0] === i);
437
420
  return c || (i === "en" ? t.find((a) => a.toLowerCase().startsWith("en-")) || r : i === "zh" ? t.find((a) => a.toLowerCase().startsWith("zh-")) || p : r);
438
- }, A = (e) => {
421
+ }, E = (e) => {
439
422
  if (f.isDayjs(e)) return e;
440
423
  if (e == null || e === "") return f();
441
424
  const t = f(e);
442
425
  return t.isValid() ? t : f();
443
- }, v = (e) => e == null || e === "", fe = (e) => f.isDayjs(e) ? e : v(e) ? f() : f(e), ue = (e, t = !1) => {
426
+ }, v = (e) => e == null || e === "", ie = (e) => f.isDayjs(e) ? e : v(e) ? f() : f(e), ce = (e, t = !1) => {
444
427
  const n = m(e);
445
428
  return n ? h(n) : t ? h() : "";
446
- }, rt = (e, t) => A(e).tz(h(t)).utcOffset(), st = (e, t, n = se) => A(e).tz(h(t)).format(n), at = (e, t) => fe(e).format(t.format), le = (e, t) => {
447
- const n = t.format || b, r = ue(t.timeZone, t.useClientTimeZone);
448
- if (!r) return at(e, { format: n });
429
+ }, nt = (e, t) => E(e).tz(h(t)).utcOffset(), ot = (e, t, n = re) => E(e).tz(h(t)).format(n), rt = (e, t) => ie(e).format(t.format), fe = (e, t) => {
430
+ const n = t.format || b, r = ce(t.timeZone, t.useClientTimeZone);
431
+ if (!r) return rt(e, { format: n });
449
432
  if (t.inputMode === "local")
450
433
  return v(e) ? f().tz(r).format(n) : f.tz(e, r).format(n);
451
- const o = fe(e);
434
+ const o = ie(e);
452
435
  return o.isValid() ? o.tz(r).format(n) : o.format(n);
453
- }, it = (e) => typeof e == "function", ct = (e, t) => {
436
+ }, st = (e) => typeof e == "function", at = (e, t) => {
454
437
  var a, u;
455
438
  const { moment: n } = t, r = t.format || b;
456
- if (!it(n)) return le(e, { ...t, dateLibrary: "dayjs" });
457
- const o = v(e) ? void 0 : e, s = ue(t.timeZone, t.useClientTimeZone);
439
+ if (!st(n)) return fe(e, { ...t, dateLibrary: "dayjs" });
440
+ const o = v(e) ? void 0 : e, s = ce(t.timeZone, t.useClientTimeZone);
458
441
  if (!s || typeof n.tz != "function") return n(o).format(r);
459
442
  if (t.inputMode === "local")
460
443
  return v(e) ? ((u = (a = n()).tz) == null ? void 0 : u.call(a, s).format(r)) || n().format(r) : n.tz(o, s).format(r);
461
444
  const i = n(o);
462
445
  return (typeof i.tz == "function" ? i.tz(s) : n.tz(o, s)).format(r);
463
- }, ft = (e, t = {}) => {
446
+ }, it = (e, t = {}) => {
464
447
  const n = typeof t == "string" ? { format: t } : t || {}, r = {
465
448
  ...n,
466
449
  format: n.format || b
467
450
  };
468
- return r.dateLibrary === "moment" ? ct(e, r) : le(e, r);
469
- }, Ct = (e, t = b, n = {}) => ft(e, { ...n, format: t }), q = (e) => String(e).padStart(2, "0"), me = (e) => `UTC${e}`, de = (e, t) => {
470
- const n = rt(e, t), r = n >= 0 ? "+" : "-", o = Math.abs(n);
471
- return `UTC${r}${q(Math.floor(o / 60))}:${q(o % 60)}`;
472
- }, ut = (e, t = /* @__PURE__ */ new Date()) => {
451
+ return r.dateLibrary === "moment" ? at(e, r) : fe(e, r);
452
+ }, St = (e, t = b, n = {}) => it(e, { ...n, format: t }), K = (e) => String(e).padStart(2, "0"), ue = (e) => `UTC${e}`, le = (e, t) => {
453
+ const n = nt(e, t), r = n >= 0 ? "+" : "-", o = Math.abs(n);
454
+ return `UTC${r}${K(Math.floor(o / 60))}:${K(o % 60)}`;
455
+ }, ct = (e, t = /* @__PURE__ */ new Date()) => {
473
456
  const n = e.currentUtcOffsetText || e.baseUtcOffsetText;
474
- return n ? `UTC${n}` : de(t, e.timeZoneId);
475
- }, lt = (e, t) => {
457
+ return n ? `UTC${n}` : le(t, e.timeZoneId);
458
+ }, ft = (e, t) => {
476
459
  const n = e.match(/([+-]\d{1,2})(?::?(\d{2}))?/) || [];
477
460
  if (!n[1]) return t;
478
461
  const r = n[1].startsWith("-") ? "-" : "+", o = n[1].replace(/[+-]/, "").padStart(2, "0"), s = n[2] || "00";
479
462
  return `UTC${r}${o}:${s}`;
480
- }, mt = (e, t, n) => {
463
+ }, ut = (e, t, n) => {
481
464
  var o, s;
482
- const r = me(n.format("Z"));
465
+ const r = ue(n.format("Z"));
483
466
  try {
484
467
  const i = Intl.DateTimeFormat.supportedLocalesOf([t])[0] || t, c = (s = (o = new Intl.DateTimeFormat(i, { timeZone: e, timeZoneName: "long" }).formatToParts(n.toDate()).find((a) => a.type === "timeZoneName")) == null ? void 0 : o.value) == null ? void 0 : s.trim();
485
- return c ? /^(gmt|utc)/i.test(c) ? lt(c, r) : c : r;
468
+ return c ? /^(gmt|utc)/i.test(c) ? ft(c, r) : c : r;
486
469
  } catch {
487
470
  return r;
488
471
  }
489
- }, he = (e, t) => {
472
+ }, me = (e, t) => {
490
473
  const n = t.year();
491
474
  return Array.from(
492
475
  new Set(
@@ -496,38 +479,38 @@ const tt = () => {
496
479
  })
497
480
  )
498
481
  );
499
- }, Te = (e, t) => {
482
+ }, de = (e, t) => {
500
483
  const n = h(e);
501
- if (!E(n)) return !1;
502
- const r = A(t).tz(n);
503
- return he(n, r).length > 1;
504
- }, M = (e, t) => {
484
+ if (!D(n)) return !1;
485
+ const r = E(t).tz(n);
486
+ return me(n, r).length > 1;
487
+ }, k = (e, t) => {
505
488
  const n = h(e);
506
- if (!E(n)) return !1;
507
- const r = A(t).tz(n), o = he(n, r);
489
+ if (!D(n)) return !1;
490
+ const r = E(t).tz(n), o = me(n, r);
508
491
  return o.length <= 1 ? !1 : r.utcOffset() === Math.max(...o);
509
- }, vt = (e, t) => M(e, t), ge = (e) => {
492
+ }, vt = (e, t) => k(e, t), he = (e) => {
510
493
  if (e === 1 || e === "1") return !0;
511
494
  if (e === 0 || e === "0") return !1;
512
- }, dt = (e, t) => {
513
- const n = ge(e.dynamicOffsetFlag);
514
- return typeof n == "boolean" ? n : Te(e.timeZoneId, t);
515
- }, ht = (e, t) => {
516
- const n = ge(e.currentDstFlag);
517
- return typeof n == "boolean" ? n : M(e.timeZoneId, t);
495
+ }, lt = (e, t) => {
496
+ const n = he(e.dynamicOffsetFlag);
497
+ return typeof n == "boolean" ? n : de(e.timeZoneId, t);
498
+ }, mt = (e, t) => {
499
+ const n = he(e.currentDstFlag);
500
+ return typeof n == "boolean" ? n : k(e.timeZoneId, t);
518
501
  }, bt = (e, t = /* @__PURE__ */ new Date()) => e.map((n) => {
519
- const r = n.tzShowName || ut(n, t), o = dt(n, t);
502
+ const r = n.tzShowName || ct(n, t), o = lt(n, t);
520
503
  return {
521
504
  value: n.timeZoneId,
522
505
  zoneName: r,
523
506
  label: r,
524
507
  hasDST: o,
525
- isDST: o ? ht(n, t) : !1
508
+ isDST: o ? mt(n, t) : !1
526
509
  };
527
- }), Tt = (e) => {
510
+ }), dt = (e) => {
528
511
  const t = e.toLowerCase().split("-")[0];
529
512
  return B[t] || B.default;
530
- }, gt = (e) => typeof e.showDaylightSavingLabel == "boolean" ? e.showDaylightSavingLabel : e.showDaylightSavingMarker ?? !0, _t = (e, t, n = {}) => {
513
+ }, ht = (e) => typeof e.showDaylightSavingLabel == "boolean" ? e.showDaylightSavingLabel : e.showDaylightSavingMarker ?? !0, Mt = (e, t, n = {}) => {
531
514
  const {
532
515
  showZoneLabel: r = !0,
533
516
  zoneLabel: o,
@@ -535,13 +518,13 @@ const tt = () => {
535
518
  isDST: i,
536
519
  standardTimeLabel: c,
537
520
  daylightSavingLabel: a,
538
- format: u = se
539
- } = n, l = h(t), T = st(e, l, u), Z = typeof s == "boolean" ? s : Te(l, e), g = (typeof i == "boolean" ? i : M(l, e)) ? a : c, I = Z && g ? `[${g}]` : "";
540
- return r ? [T, o || de(e, l), I].filter(Boolean).join(" ") : [T, I].filter(Boolean).join(" ");
541
- }, Mt = (e = {}) => {
542
- const t = ot(e.locale, e.supportedLocales), n = h(e.timeZone), r = A(e.value).tz(n), o = mt(n, t, r), s = me(r.format("Z")), i = M(n, r), c = i ? Tt(t) : "", a = gt(e), u = i && a ? `${o} - ${c}` : o;
521
+ format: u = re
522
+ } = n, l = h(t), T = ot(e, l, u), Z = typeof s == "boolean" ? s : de(l, e), g = (typeof i == "boolean" ? i : k(l, e)) ? a : c, I = Z && g ? `[${g}]` : "";
523
+ return r ? [T, o || le(e, l), I].filter(Boolean).join(" ") : [T, I].filter(Boolean).join(" ");
524
+ }, _t = (e = {}) => {
525
+ const t = tt(e.locale, e.supportedLocales), n = h(e.timeZone), r = E(e.value).tz(n), o = ut(n, t, r), s = ue(r.format("Z")), i = k(n, r), c = i ? dt(t) : "", a = ht(e), u = i && a ? `${o} - ${c}` : o;
543
526
  return {
544
- formattedValue: r.format(e.format || Pe),
527
+ formattedValue: r.format(e.format || Fe),
545
528
  locale: t,
546
529
  timeZone: n,
547
530
  timeZoneName: o,
@@ -553,50 +536,50 @@ const tt = () => {
553
536
  };
554
537
  };
555
538
  export {
556
- ae as TIMEZONE_CHANGE_EVENT,
557
- ee as TIME_ZONE_PACKED_DATA_URL,
558
- je as UPF_TIMEZONE_MESSAGE_TYPE,
559
- Dt as applyDayjsIanaTimeZoneData,
560
- At as applyMomentIanaTimeZoneData,
561
- ne as assertPackedIanaData,
562
- Ne as assertPackedIanaTzData,
563
- te as buildIanaFetchInit,
539
+ se as TIMEZONE_CHANGE_EVENT,
540
+ X as TIME_ZONE_PACKED_DATA_URL,
541
+ Pe as UPF_TIMEZONE_MESSAGE_TYPE,
542
+ wt as applyDayjsIanaTimeZoneData,
543
+ Et as applyMomentIanaTimeZoneData,
544
+ te as assertPackedIanaData,
545
+ Oe as assertPackedIanaTzData,
546
+ ee as buildIanaFetchInit,
564
547
  bt as buildTimeZoneDisplayOptions,
565
548
  ze as clearDayjsIanaCache,
566
- ce as clientTimeZone,
549
+ S as clientTimeZone,
567
550
  Me as createIanaDbFromPackedData,
568
551
  d as dayjsTimezoneIanaPlugin,
569
- _t as formatClientLocalDateTimeLine,
570
- st as formatInTimeZone,
571
- ft as formatLocalDateTime,
572
- de as formatTimeZoneOffsetLabel,
573
- ye as getAccessTokenFromLocalStorage,
574
- Ee as getCachedDayjsPackedIanaData,
575
- tt as getClientTimeZone,
576
- pe as getDefaultIanaAuthorization,
577
- wt as getKnownTimeZoneIds,
578
- Mt as getTimeZoneDisplayInfo,
579
- rt as getZoneUtcOffset,
580
- et as initClientTimeZoneSync,
552
+ Mt as formatClientLocalDateTimeLine,
553
+ ot as formatInTimeZone,
554
+ it as formatLocalDateTime,
555
+ le as formatTimeZoneOffsetLabel,
556
+ Ie as getAccessTokenFromLocalStorage,
557
+ De as getCachedDayjsPackedIanaData,
558
+ Xe as getClientTimeZone,
559
+ ye as getDefaultIanaAuthorization,
560
+ pt as getKnownTimeZoneIds,
561
+ _t as getTimeZoneDisplayInfo,
562
+ nt as getZoneUtcOffset,
563
+ Qe as initClientTimeZoneSync,
581
564
  vt as isDaylightSavingTime,
582
- E as isKnownTimeZone,
583
- Et as loadDayjsIanaTimeZoneData,
584
- re as loadIanaData,
585
- W as loadIanaFromApi,
586
- re as loadMomentIanaData,
587
- W as loadMomentIanaFromApi,
565
+ D as isKnownTimeZone,
566
+ Dt as loadDayjsIanaTimeZoneData,
567
+ oe as loadIanaData,
568
+ J as loadIanaFromApi,
569
+ oe as loadMomentIanaData,
570
+ J as loadMomentIanaFromApi,
588
571
  zt as loadMomentIanaTimeZoneData,
589
- ot as normalizeLocaleCode,
590
- St as onClientTimeZoneChange,
591
- Ae as preloadDayjsIanaFromApi,
592
- oe as preloadDayjsIanaFromData,
572
+ tt as normalizeLocaleCode,
573
+ Ct as onClientTimeZoneChange,
574
+ Ee as preloadDayjsIanaFromApi,
575
+ ne as preloadDayjsIanaFromData,
593
576
  _ as rebuildKnownTimeZoneIds,
594
577
  h as resolveTimeZone,
595
- ut as resolveUtcOffsetFallback,
596
- Be as setClientTimeZone,
597
- $ as setDefaultTimeZone,
578
+ ct as resolveUtcOffsetFallback,
579
+ At as setClientTimeZone,
580
+ V as setDefaultTimeZone,
598
581
  Lt as syncClientTimeZone,
599
- Te as timeZoneHasDST,
600
- M as timeZoneIsDST,
601
- Ct as toLocalDate
582
+ de as timeZoneHasDST,
583
+ k as timeZoneIsDST,
584
+ St as toLocalDate
602
585
  };