@feedmepos/mf-hrm-portal 2.4.2-dev → 2.4.2

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 (112) hide show
  1. package/dist/{ApprovalCodeList-DpNF0wL7.js → ApprovalCodeList-DGLPcQcv.js} +15 -14
  2. package/dist/{AuditLogList-D2bUFsuK.js → AuditLogList-ahJwTF7N.js} +12 -12
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-IPkyxwIF.js +438 -0
  4. package/dist/EmployeeList-B18mlY4V.js +776 -0
  5. package/dist/FormItem.vue_vue_type_script_setup_true_lang-Dvo9AiKf.js +45 -0
  6. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  7. package/dist/{GrantUserList-ClliuQ8h.js → GrantUserList-C8BbP99C.js} +16 -15
  8. package/dist/{Main-CBuOW87D.js → Main-BA29_N_p.js} +2280 -2274
  9. package/dist/{Main-DlPdGefL.js → Main-BN3b_yie.js} +5 -5
  10. package/dist/Main-Clux_qKN.js +96 -0
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
  12. package/dist/{PermissionSetList-Dd0fkW0L.js → PermissionSetList-BSOJ8ftd.js} +108 -107
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Hz_rFmbH.js +4181 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-BwuBk683.js +35 -0
  15. package/dist/RoleList-EnfxydGa.js +740 -0
  16. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-yJwTtFyF.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-yIdd8r7y.js} +1 -1
  17. package/dist/{ScheduleGeneralPage-_cqIJY8R.js → ScheduleGeneralPage-CFUqm5-r.js} +2 -2
  18. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-C6M76KUA.js → ScheduleModal.vue_vue_type_script_setup_true_lang-BmPrGRG2.js} +186 -187
  19. package/dist/{SchedulePage-DHkWe1KO.js → SchedulePage-DEFQwipO.js} +16 -16
  20. package/dist/{SchedulePositionPage-5JUJwlJc.js → SchedulePositionPage-CM5NS5-F.js} +3 -3
  21. package/dist/{SelectFilter-DWRvb1Yl.js → SelectFilter-DgjR5o5E.js} +1 -1
  22. package/dist/TeamMemberList-BKvhHLNG.js +1150 -0
  23. package/dist/TimesheetList-EQRMimP7.js +402 -0
  24. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_ffd7f807_lang-Co2GtU1N.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-BumkwWvb.js} +7 -7
  25. package/dist/{app-BA3UHSk0.js → app-Bkc0pF3P.js} +3935 -7718
  26. package/dist/app.js +3 -3
  27. package/dist/{approval-code-BR4FD3sx.js → approval-code-BKMu1GDn.js} +1 -1
  28. package/dist/{dayjs.min-JyaQ6PUU.js → dayjs.min-CkI2q2aC.js} +34 -34
  29. package/dist/employee-BfkxCdPL.js +209 -0
  30. package/dist/{grant-user-DKUZdzrY.js → grant-user-ClN_vTOv.js} +1 -1
  31. package/dist/{index-CkC2sfPK.js → iteration-CsNIceUp.js} +558 -573
  32. package/dist/{lodash-BJMVlo9i.js → lodash-BgraJgCc.js} +1 -1
  33. package/dist/restaurant-CRNgiIa4.js +2685 -0
  34. package/dist/role-CZYSdVn2.js +91 -0
  35. package/dist/rule-_4roLZrG.js +780 -0
  36. package/dist/src/components/CollapsibleWrapper.vue.d.ts +3 -11
  37. package/dist/src/helpers/iteration.d.ts +2 -9
  38. package/dist/src/helpers/permission-set.d.ts +102 -1
  39. package/dist/src/helpers/rule.d.ts +2 -2
  40. package/dist/src/helpers/string.d.ts +1 -10
  41. package/dist/src/router/shared.d.ts +1 -3
  42. package/dist/src/stores/restaurant.d.ts +7 -7
  43. package/dist/src/stores/team.d.ts +0 -30
  44. package/dist/src/types/team.d.ts +1 -17
  45. package/dist/src/views/audit-log/locales/index.d.ts +0 -12
  46. package/dist/src/views/hr/locales/index.d.ts +0 -20
  47. package/dist/src/views/hr/role/RoleForm.vue.d.ts +2 -29
  48. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
  49. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
  50. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
  51. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
  52. package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -11
  53. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +0 -11
  54. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +0 -21
  55. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +0 -11
  56. package/dist/src/views/team/locales/index.d.ts +4 -716
  57. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -48
  58. package/dist/src/views/team/{components/MemberStatusBadge.vue.d.ts → member/MemberInfo.vue.d.ts} +2 -2
  59. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +0 -1
  60. package/dist/string-VNuQNweN.js +15 -0
  61. package/dist/style.css +1 -1
  62. package/dist/tsconfig.app.tsbuildinfo +1 -1
  63. package/dist/{useAppStore-DiGaOhje.js → useAppStore-DYmF1kgk.js} +1 -1
  64. package/dist/{useLoading-DOcoObCD.js → useLoading-C2UKuAxD.js} +1 -1
  65. package/dist/{useReportPermissions-c9KGuXQq.js → useReportPermissions-BiaXRc0p.js} +22 -22
  66. package/package.json +2 -2
  67. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BjEJErcL.js +0 -459
  68. package/dist/EmployeeList-CBYU0R2j.js +0 -896
  69. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DsPLbLwQ.js +0 -90
  70. package/dist/Main-D9MQo2l1.js +0 -101
  71. package/dist/MyPosProfile-IAPSqlBP.js +0 -360
  72. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +0 -126
  73. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CjQCbJRu.js +0 -4212
  74. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DJnIFlKq.js +0 -1797
  75. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-hE2OZwfO.js +0 -547
  76. package/dist/RoleList-zZHpt079.js +0 -274
  77. package/dist/TeamMemberList-C_4f5Djs.js +0 -2082
  78. package/dist/TimesheetList-B3Yx8cwt.js +0 -408
  79. package/dist/employee-n31b7QEp.js +0 -237
  80. package/dist/member-grant-B1V9g0Sb.js +0 -54
  81. package/dist/restaurant-BbSg6yOm.js +0 -49
  82. package/dist/role-iTqgtFqf.js +0 -91
  83. package/dist/rule-BJhti6BZ.js +0 -845
  84. package/dist/src/api/my-pos-profile/index.d.ts +0 -3
  85. package/dist/src/api/sso-provider/index.d.ts +0 -5
  86. package/dist/src/api/staff-invite/index.d.ts +0 -16
  87. package/dist/src/components/form/SegmentedTabs.vue.d.ts +0 -23
  88. package/dist/src/composables/useMenuAccess.d.ts +0 -56
  89. package/dist/src/composables/useSsoProviders.d.ts +0 -19
  90. package/dist/src/composables/useStaffInviteProviders.d.ts +0 -8
  91. package/dist/src/helpers/employee-merge.d.ts +0 -33
  92. package/dist/src/helpers/member-grant.d.ts +0 -36
  93. package/dist/src/helpers/my-pos-profile.d.ts +0 -37
  94. package/dist/src/helpers/pos-assignment-rows.d.ts +0 -28
  95. package/dist/src/helpers/restaurant-lookup.d.ts +0 -19
  96. package/dist/src/helpers/role-merge.d.ts +0 -11
  97. package/dist/src/helpers/staff-invite.d.ts +0 -54
  98. package/dist/src/router/menu-access-guard.d.ts +0 -17
  99. package/dist/src/types/my-pos-profile.d.ts +0 -24
  100. package/dist/src/types/sso-provider.d.ts +0 -10
  101. package/dist/src/types/staff-invite.d.ts +0 -100
  102. package/dist/src/views/hr/timesheet/timesheet-view.d.ts +0 -29
  103. package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +0 -2
  104. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +0 -4
  105. package/dist/src/views/my-pos-profile/locales/index.d.ts +0 -236
  106. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +0 -51
  107. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +0 -44
  108. package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +0 -11
  109. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +0 -35
  110. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +0 -19
  111. package/dist/string-DZQ1uNjn.js +0 -22
  112. package/dist/useSsoProviders-CkhHtzRQ.js +0 -41
@@ -1,4212 +0,0 @@
1
- import { getCurrentInstance as Bt, inject as fr, ref as st, shallowRef as _r, computed as K, watch as Mt, onMounted as Wn, onUnmounted as pr, defineComponent as Re, h as Gn, createVNode as ce, Text as vr, Fragment as De, resolveComponent as Fe, createBlock as Oe, openBlock as z, withCtx as de, createElementVNode as ue, createElementBlock as re, toDisplayString as Le, unref as Y, renderList as Ce, toRef as qt, normalizeStyle as rt, renderSlot as ke, createCommentVNode as Te, normalizeClass as Ne, createTextVNode as hr, useSlots as br, createSlots as tt, mergeModels as en, useModel as gr } from "vue";
2
- import { useI18n as Ke, useCoreStore as Ir } from "@feedmepos/mf-common";
3
- import { useDialog as yr, useBreakpoints as Er } from "@feedmepos/ui-library";
4
- import "@vue/devtools-api";
5
- import { p as Zn, N as Bn, Y as tn, V as Nr, a as Cr, j as Tr, Q as Or, A as Sr, D as Lr, C as kr } from "./rule-BJhti6BZ.js";
6
- import { _ as Yt, a as Ar, b as nn, u as Rr } from "./ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BjEJErcL.js";
7
- import { v as Mr, u as Yn, w as rn, x as sn, h as wr, g as Dr, b as Fr, C as Xn, S as wt, A as nt, k as Ye, q as an } from "./app-BA3UHSk0.js";
8
- import { c as Hn } from "./index-CkC2sfPK.js";
9
- import { r as Pr, s as Jn } from "./string-DZQ1uNjn.js";
10
- import { W as jr } from "./member-grant-B1V9g0Sb.js";
11
- import { u as Ur } from "./role-iTqgtFqf.js";
12
- function St(e, t, n) {
13
- const r = /* @__PURE__ */ new Map();
14
- return e.forEach(
15
- ({ name: s, permissions: a }) => a.forEach(({ conditions: m, actions: d }) => {
16
- var g, N;
17
- const l = JSON.parse(m || "{}");
18
- (g = l[t]) != null && g.$in ? (N = l[t]) == null || N.$in.forEach(
19
- (C) => (r.get(C) ?? r.set(C, /* @__PURE__ */ new Set()).get(C)).add(s)
20
- ) : d[0] === "manage" && n.forEach((C) => {
21
- (r.get(C) ?? r.set(C, /* @__PURE__ */ new Set()).get(C)).add(s);
22
- });
23
- })
24
- ), [...r].map(([s, a]) => ({
25
- id: s,
26
- setNames: [...a]
27
- }));
28
- }
29
- /*!
30
- * shared v10.0.5
31
- * (c) 2024 kazuya kawaguchi
32
- * Released under the MIT License.
33
- */
34
- const on = typeof window < "u", Qe = (e, t = !1) => t ? Symbol.for(e) : Symbol(e), xr = (e, t, n) => Vr({ l: e, k: t, s: n }), Vr = (e) => JSON.stringify(e).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/\u0027/g, "\\u0027"), ge = (e) => typeof e == "number" && isFinite(e), Wr = (e) => Xt(e) === "[object Date]", yt = (e) => Xt(e) === "[object RegExp]", Nt = (e) => q(e) && Object.keys(e).length === 0, Ie = Object.assign, Gr = Object.create, ae = (e = null) => Gr(e);
35
- let ln;
36
- const ze = () => ln || (ln = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : ae());
37
- function cn(e) {
38
- return e.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
39
- }
40
- const Zr = Object.prototype.hasOwnProperty;
41
- function Ae(e, t) {
42
- return Zr.call(e, t);
43
- }
44
- const be = Array.isArray, me = (e) => typeof e == "function", W = (e) => typeof e == "string", pe = (e) => typeof e == "boolean", ee = (e) => e !== null && typeof e == "object", Br = (e) => ee(e) && me(e.then) && me(e.catch), $n = Object.prototype.toString, Xt = (e) => $n.call(e), q = (e) => Xt(e) === "[object Object]", Yr = (e) => e == null ? "" : be(e) || q(e) && e.toString === $n ? JSON.stringify(e, null, 2) : String(e);
45
- function Ht(e, t = "") {
46
- return e.reduce((n, r, s) => s === 0 ? n + r : n + t + r, "");
47
- }
48
- function Xr(e, t) {
49
- typeof console < "u" && (console.warn("[intlify] " + e), t && console.warn(t.stack));
50
- }
51
- const ft = (e) => !ee(e) || be(e);
52
- function It(e, t) {
53
- if (ft(e) || ft(t))
54
- throw new Error("Invalid value");
55
- const n = [{ src: e, des: t }];
56
- for (; n.length; ) {
57
- const { src: r, des: s } = n.pop();
58
- Object.keys(r).forEach((a) => {
59
- a !== "__proto__" && (ee(r[a]) && !ee(s[a]) && (s[a] = Array.isArray(r[a]) ? [] : ae()), ft(s[a]) || ft(r[a]) ? s[a] = r[a] : n.push({ src: r[a], des: s[a] }));
60
- });
61
- }
62
- }
63
- function Hr(e, t, n) {
64
- return { line: e, column: t, offset: n };
65
- }
66
- function Dt(e, t, n) {
67
- return { start: e, end: t };
68
- }
69
- const ne = {
70
- // tokenizer error codes
71
- EXPECTED_TOKEN: 1,
72
- INVALID_TOKEN_IN_PLACEHOLDER: 2,
73
- UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3,
74
- UNKNOWN_ESCAPE_SEQUENCE: 4,
75
- INVALID_UNICODE_ESCAPE_SEQUENCE: 5,
76
- UNBALANCED_CLOSING_BRACE: 6,
77
- UNTERMINATED_CLOSING_BRACE: 7,
78
- EMPTY_PLACEHOLDER: 8,
79
- NOT_ALLOW_NEST_PLACEHOLDER: 9,
80
- INVALID_LINKED_FORMAT: 10,
81
- // parser error codes
82
- MUST_HAVE_MESSAGES_IN_PLURAL: 11,
83
- UNEXPECTED_EMPTY_LINKED_MODIFIER: 12,
84
- UNEXPECTED_EMPTY_LINKED_KEY: 13,
85
- UNEXPECTED_LEXICAL_ANALYSIS: 14
86
- }, Jr = 17;
87
- function Ct(e, t, n = {}) {
88
- const { domain: r, messages: s, args: a } = n, m = e, d = new SyntaxError(String(m));
89
- return d.code = e, t && (d.location = t), d.domain = r, d;
90
- }
91
- function $r(e) {
92
- throw e;
93
- }
94
- const xe = " ", zr = "\r", Ee = `
95
- `, Kr = "\u2028", Qr = "\u2029";
96
- function qr(e) {
97
- const t = e;
98
- let n = 0, r = 1, s = 1, a = 0;
99
- const m = (_) => t[_] === zr && t[_ + 1] === Ee, d = (_) => t[_] === Ee, l = (_) => t[_] === Qr, g = (_) => t[_] === Kr, N = (_) => m(_) || d(_) || l(_) || g(_), C = () => n, T = () => r, j = () => s, D = () => a, L = (_) => m(_) || l(_) || g(_) ? Ee : t[_], P = () => L(n), f = () => L(n + a);
100
- function b() {
101
- return a = 0, N(n) && (r++, s = 0), m(n) && n++, n++, s++, t[n];
102
- }
103
- function A() {
104
- return m(n + a) && a++, a++, t[n + a];
105
- }
106
- function u() {
107
- n = 0, r = 1, s = 1, a = 0;
108
- }
109
- function I(_ = 0) {
110
- a = _;
111
- }
112
- function E() {
113
- const _ = n + a;
114
- for (; _ !== n; )
115
- b();
116
- a = 0;
117
- }
118
- return {
119
- index: C,
120
- line: T,
121
- column: j,
122
- peekOffset: D,
123
- charAt: L,
124
- currentChar: P,
125
- currentPeek: f,
126
- next: b,
127
- peek: A,
128
- reset: u,
129
- resetPeek: I,
130
- skipToPeek: E
131
- };
132
- }
133
- const Be = void 0, es = ".", un = "'", ts = "tokenizer";
134
- function ns(e, t = {}) {
135
- const n = t.location !== !1, r = qr(e), s = () => r.index(), a = () => Hr(r.line(), r.column(), r.index()), m = a(), d = s(), l = {
136
- currentType: 13,
137
- offset: d,
138
- startLoc: m,
139
- endLoc: m,
140
- lastType: 13,
141
- lastOffset: d,
142
- lastStartLoc: m,
143
- lastEndLoc: m,
144
- braceNest: 0,
145
- inLinked: !1,
146
- text: ""
147
- }, g = () => l, { onError: N } = t;
148
- function C(o, i, c, ...h) {
149
- const S = g();
150
- if (i.column += c, i.offset += c, N) {
151
- const M = n ? Dt(S.startLoc, i) : null, p = Ct(o, M, {
152
- domain: ts,
153
- args: h
154
- });
155
- N(p);
156
- }
157
- }
158
- function T(o, i, c) {
159
- o.endLoc = a(), o.currentType = i;
160
- const h = { type: i };
161
- return n && (h.loc = Dt(o.startLoc, o.endLoc)), c != null && (h.value = c), h;
162
- }
163
- const j = (o) => T(
164
- o,
165
- 13
166
- /* TokenTypes.EOF */
167
- );
168
- function D(o, i) {
169
- return o.currentChar() === i ? (o.next(), i) : (C(ne.EXPECTED_TOKEN, a(), 0, i), "");
170
- }
171
- function L(o) {
172
- let i = "";
173
- for (; o.currentPeek() === xe || o.currentPeek() === Ee; )
174
- i += o.currentPeek(), o.peek();
175
- return i;
176
- }
177
- function P(o) {
178
- const i = L(o);
179
- return o.skipToPeek(), i;
180
- }
181
- function f(o) {
182
- if (o === Be)
183
- return !1;
184
- const i = o.charCodeAt(0);
185
- return i >= 97 && i <= 122 || // a-z
186
- i >= 65 && i <= 90 || // A-Z
187
- i === 95;
188
- }
189
- function b(o) {
190
- if (o === Be)
191
- return !1;
192
- const i = o.charCodeAt(0);
193
- return i >= 48 && i <= 57;
194
- }
195
- function A(o, i) {
196
- const { currentType: c } = i;
197
- if (c !== 2)
198
- return !1;
199
- L(o);
200
- const h = f(o.currentPeek());
201
- return o.resetPeek(), h;
202
- }
203
- function u(o, i) {
204
- const { currentType: c } = i;
205
- if (c !== 2)
206
- return !1;
207
- L(o);
208
- const h = o.currentPeek() === "-" ? o.peek() : o.currentPeek(), S = b(h);
209
- return o.resetPeek(), S;
210
- }
211
- function I(o, i) {
212
- const { currentType: c } = i;
213
- if (c !== 2)
214
- return !1;
215
- L(o);
216
- const h = o.currentPeek() === un;
217
- return o.resetPeek(), h;
218
- }
219
- function E(o, i) {
220
- const { currentType: c } = i;
221
- if (c !== 7)
222
- return !1;
223
- L(o);
224
- const h = o.currentPeek() === ".";
225
- return o.resetPeek(), h;
226
- }
227
- function _(o, i) {
228
- const { currentType: c } = i;
229
- if (c !== 8)
230
- return !1;
231
- L(o);
232
- const h = f(o.currentPeek());
233
- return o.resetPeek(), h;
234
- }
235
- function R(o, i) {
236
- const { currentType: c } = i;
237
- if (!(c === 7 || c === 11))
238
- return !1;
239
- L(o);
240
- const h = o.currentPeek() === ":";
241
- return o.resetPeek(), h;
242
- }
243
- function k(o, i) {
244
- const { currentType: c } = i;
245
- if (c !== 9)
246
- return !1;
247
- const h = () => {
248
- const M = o.currentPeek();
249
- return M === "{" ? f(o.peek()) : M === "@" || M === "|" || M === ":" || M === "." || M === xe || !M ? !1 : M === Ee ? (o.peek(), h()) : x(o, !1);
250
- }, S = h();
251
- return o.resetPeek(), S;
252
- }
253
- function $(o) {
254
- L(o);
255
- const i = o.currentPeek() === "|";
256
- return o.resetPeek(), i;
257
- }
258
- function x(o, i = !0) {
259
- const c = (S = !1, M = "") => {
260
- const p = o.currentPeek();
261
- return p === "{" || p === "@" || !p ? S : p === "|" ? !(M === xe || M === Ee) : p === xe ? (o.peek(), c(!0, xe)) : p === Ee ? (o.peek(), c(!0, Ee)) : !0;
262
- }, h = c();
263
- return i && o.resetPeek(), h;
264
- }
265
- function F(o, i) {
266
- const c = o.currentChar();
267
- return c === Be ? Be : i(c) ? (o.next(), c) : null;
268
- }
269
- function y(o) {
270
- const i = o.charCodeAt(0);
271
- return i >= 97 && i <= 122 || // a-z
272
- i >= 65 && i <= 90 || // A-Z
273
- i >= 48 && i <= 57 || // 0-9
274
- i === 95 || // _
275
- i === 36;
276
- }
277
- function w(o) {
278
- return F(o, y);
279
- }
280
- function V(o) {
281
- const i = o.charCodeAt(0);
282
- return i >= 97 && i <= 122 || // a-z
283
- i >= 65 && i <= 90 || // A-Z
284
- i >= 48 && i <= 57 || // 0-9
285
- i === 95 || // _
286
- i === 36 || // $
287
- i === 45;
288
- }
289
- function O(o) {
290
- return F(o, V);
291
- }
292
- function G(o) {
293
- const i = o.charCodeAt(0);
294
- return i >= 48 && i <= 57;
295
- }
296
- function H(o) {
297
- return F(o, G);
298
- }
299
- function U(o) {
300
- const i = o.charCodeAt(0);
301
- return i >= 48 && i <= 57 || // 0-9
302
- i >= 65 && i <= 70 || // A-F
303
- i >= 97 && i <= 102;
304
- }
305
- function J(o) {
306
- return F(o, U);
307
- }
308
- function X(o) {
309
- let i = "", c = "";
310
- for (; i = H(o); )
311
- c += i;
312
- return c;
313
- }
314
- function se(o) {
315
- let i = "";
316
- for (; ; ) {
317
- const c = o.currentChar();
318
- if (c === "{" || c === "}" || c === "@" || c === "|" || !c)
319
- break;
320
- if (c === xe || c === Ee)
321
- if (x(o))
322
- i += c, o.next();
323
- else {
324
- if ($(o))
325
- break;
326
- i += c, o.next();
327
- }
328
- else
329
- i += c, o.next();
330
- }
331
- return i;
332
- }
333
- function Q(o) {
334
- P(o);
335
- let i = "", c = "";
336
- for (; i = O(o); )
337
- c += i;
338
- return o.currentChar() === Be && C(ne.UNTERMINATED_CLOSING_BRACE, a(), 0), c;
339
- }
340
- function fe(o) {
341
- P(o);
342
- let i = "";
343
- return o.currentChar() === "-" ? (o.next(), i += `-${X(o)}`) : i += X(o), o.currentChar() === Be && C(ne.UNTERMINATED_CLOSING_BRACE, a(), 0), i;
344
- }
345
- function ye(o) {
346
- return o !== un && o !== Ee;
347
- }
348
- function ve(o) {
349
- P(o), D(o, "'");
350
- let i = "", c = "";
351
- for (; i = F(o, ye); )
352
- i === "\\" ? c += oe(o) : c += i;
353
- const h = o.currentChar();
354
- return h === Ee || h === Be ? (C(ne.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, a(), 0), h === Ee && (o.next(), D(o, "'")), c) : (D(o, "'"), c);
355
- }
356
- function oe(o) {
357
- const i = o.currentChar();
358
- switch (i) {
359
- case "\\":
360
- case "'":
361
- return o.next(), `\\${i}`;
362
- case "u":
363
- return ie(o, i, 4);
364
- case "U":
365
- return ie(o, i, 6);
366
- default:
367
- return C(ne.UNKNOWN_ESCAPE_SEQUENCE, a(), 0, i), "";
368
- }
369
- }
370
- function ie(o, i, c) {
371
- D(o, i);
372
- let h = "";
373
- for (let S = 0; S < c; S++) {
374
- const M = J(o);
375
- if (!M) {
376
- C(ne.INVALID_UNICODE_ESCAPE_SEQUENCE, a(), 0, `\\${i}${h}${o.currentChar()}`);
377
- break;
378
- }
379
- h += M;
380
- }
381
- return `\\${i}${h}`;
382
- }
383
- function Pe(o) {
384
- return o !== "{" && o !== "}" && o !== xe && o !== Ee;
385
- }
386
- function B(o) {
387
- P(o);
388
- let i = "", c = "";
389
- for (; i = F(o, Pe); )
390
- c += i;
391
- return c;
392
- }
393
- function _e(o) {
394
- let i = "", c = "";
395
- for (; i = w(o); )
396
- c += i;
397
- return c;
398
- }
399
- function $e(o) {
400
- const i = (c) => {
401
- const h = o.currentChar();
402
- return h === "{" || h === "@" || h === "|" || h === "(" || h === ")" || !h || h === xe ? c : (c += h, o.next(), i(c));
403
- };
404
- return i("");
405
- }
406
- function Ge(o) {
407
- P(o);
408
- const i = D(
409
- o,
410
- "|"
411
- /* TokenChars.Pipe */
412
- );
413
- return P(o), i;
414
- }
415
- function je(o, i) {
416
- let c = null;
417
- switch (o.currentChar()) {
418
- case "{":
419
- return i.braceNest >= 1 && C(ne.NOT_ALLOW_NEST_PLACEHOLDER, a(), 0), o.next(), c = T(
420
- i,
421
- 2,
422
- "{"
423
- /* TokenChars.BraceLeft */
424
- ), P(o), i.braceNest++, c;
425
- case "}":
426
- return i.braceNest > 0 && i.currentType === 2 && C(ne.EMPTY_PLACEHOLDER, a(), 0), o.next(), c = T(
427
- i,
428
- 3,
429
- "}"
430
- /* TokenChars.BraceRight */
431
- ), i.braceNest--, i.braceNest > 0 && P(o), i.inLinked && i.braceNest === 0 && (i.inLinked = !1), c;
432
- case "@":
433
- return i.braceNest > 0 && C(ne.UNTERMINATED_CLOSING_BRACE, a(), 0), c = Ue(o, i) || j(i), i.braceNest = 0, c;
434
- default: {
435
- let S = !0, M = !0, p = !0;
436
- if ($(o))
437
- return i.braceNest > 0 && C(ne.UNTERMINATED_CLOSING_BRACE, a(), 0), c = T(i, 1, Ge(o)), i.braceNest = 0, i.inLinked = !1, c;
438
- if (i.braceNest > 0 && (i.currentType === 4 || i.currentType === 5 || i.currentType === 6))
439
- return C(ne.UNTERMINATED_CLOSING_BRACE, a(), 0), i.braceNest = 0, Ze(o, i);
440
- if (S = A(o, i))
441
- return c = T(i, 4, Q(o)), P(o), c;
442
- if (M = u(o, i))
443
- return c = T(i, 5, fe(o)), P(o), c;
444
- if (p = I(o, i))
445
- return c = T(i, 6, ve(o)), P(o), c;
446
- if (!S && !M && !p)
447
- return c = T(i, 12, B(o)), C(ne.INVALID_TOKEN_IN_PLACEHOLDER, a(), 0, c.value), P(o), c;
448
- break;
449
- }
450
- }
451
- return c;
452
- }
453
- function Ue(o, i) {
454
- const { currentType: c } = i;
455
- let h = null;
456
- const S = o.currentChar();
457
- switch ((c === 7 || c === 8 || c === 11 || c === 9) && (S === Ee || S === xe) && C(ne.INVALID_LINKED_FORMAT, a(), 0), S) {
458
- case "@":
459
- return o.next(), h = T(
460
- i,
461
- 7,
462
- "@"
463
- /* TokenChars.LinkedAlias */
464
- ), i.inLinked = !0, h;
465
- case ".":
466
- return P(o), o.next(), T(
467
- i,
468
- 8,
469
- "."
470
- /* TokenChars.LinkedDot */
471
- );
472
- case ":":
473
- return P(o), o.next(), T(
474
- i,
475
- 9,
476
- ":"
477
- /* TokenChars.LinkedDelimiter */
478
- );
479
- default:
480
- return $(o) ? (h = T(i, 1, Ge(o)), i.braceNest = 0, i.inLinked = !1, h) : E(o, i) || R(o, i) ? (P(o), Ue(o, i)) : _(o, i) ? (P(o), T(i, 11, _e(o))) : k(o, i) ? (P(o), S === "{" ? je(o, i) || h : T(i, 10, $e(o))) : (c === 7 && C(ne.INVALID_LINKED_FORMAT, a(), 0), i.braceNest = 0, i.inLinked = !1, Ze(o, i));
481
- }
482
- }
483
- function Ze(o, i) {
484
- let c = {
485
- type: 13
486
- /* TokenTypes.EOF */
487
- };
488
- if (i.braceNest > 0)
489
- return je(o, i) || j(i);
490
- if (i.inLinked)
491
- return Ue(o, i) || j(i);
492
- switch (o.currentChar()) {
493
- case "{":
494
- return je(o, i) || j(i);
495
- case "}":
496
- return C(ne.UNBALANCED_CLOSING_BRACE, a(), 0), o.next(), T(
497
- i,
498
- 3,
499
- "}"
500
- /* TokenChars.BraceRight */
501
- );
502
- case "@":
503
- return Ue(o, i) || j(i);
504
- default: {
505
- if ($(o))
506
- return c = T(i, 1, Ge(o)), i.braceNest = 0, i.inLinked = !1, c;
507
- if (x(o))
508
- return T(i, 0, se(o));
509
- break;
510
- }
511
- }
512
- return c;
513
- }
514
- function qe() {
515
- const { currentType: o, offset: i, startLoc: c, endLoc: h } = l;
516
- return l.lastType = o, l.lastOffset = i, l.lastStartLoc = c, l.lastEndLoc = h, l.offset = s(), l.startLoc = a(), r.currentChar() === Be ? T(
517
- l,
518
- 13
519
- /* TokenTypes.EOF */
520
- ) : Ze(r, l);
521
- }
522
- return {
523
- nextToken: qe,
524
- currentOffset: s,
525
- currentPosition: a,
526
- context: g
527
- };
528
- }
529
- const rs = "parser", ss = /(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;
530
- function as(e, t, n) {
531
- switch (e) {
532
- case "\\\\":
533
- return "\\";
534
- case "\\'":
535
- return "'";
536
- default: {
537
- const r = parseInt(t || n, 16);
538
- return r <= 55295 || r >= 57344 ? String.fromCodePoint(r) : "�";
539
- }
540
- }
541
- }
542
- function os(e = {}) {
543
- const t = e.location !== !1, { onError: n } = e;
544
- function r(f, b, A, u, ...I) {
545
- const E = f.currentPosition();
546
- if (E.offset += u, E.column += u, n) {
547
- const _ = t ? Dt(A, E) : null, R = Ct(b, _, {
548
- domain: rs,
549
- args: I
550
- });
551
- n(R);
552
- }
553
- }
554
- function s(f, b, A) {
555
- const u = { type: f };
556
- return t && (u.start = b, u.end = b, u.loc = { start: A, end: A }), u;
557
- }
558
- function a(f, b, A, u) {
559
- t && (f.end = b, f.loc && (f.loc.end = A));
560
- }
561
- function m(f, b) {
562
- const A = f.context(), u = s(3, A.offset, A.startLoc);
563
- return u.value = b, a(u, f.currentOffset(), f.currentPosition()), u;
564
- }
565
- function d(f, b) {
566
- const A = f.context(), { lastOffset: u, lastStartLoc: I } = A, E = s(5, u, I);
567
- return E.index = parseInt(b, 10), f.nextToken(), a(E, f.currentOffset(), f.currentPosition()), E;
568
- }
569
- function l(f, b) {
570
- const A = f.context(), { lastOffset: u, lastStartLoc: I } = A, E = s(4, u, I);
571
- return E.key = b, f.nextToken(), a(E, f.currentOffset(), f.currentPosition()), E;
572
- }
573
- function g(f, b) {
574
- const A = f.context(), { lastOffset: u, lastStartLoc: I } = A, E = s(9, u, I);
575
- return E.value = b.replace(ss, as), f.nextToken(), a(E, f.currentOffset(), f.currentPosition()), E;
576
- }
577
- function N(f) {
578
- const b = f.nextToken(), A = f.context(), { lastOffset: u, lastStartLoc: I } = A, E = s(8, u, I);
579
- return b.type !== 11 ? (r(f, ne.UNEXPECTED_EMPTY_LINKED_MODIFIER, A.lastStartLoc, 0), E.value = "", a(E, u, I), {
580
- nextConsumeToken: b,
581
- node: E
582
- }) : (b.value == null && r(f, ne.UNEXPECTED_LEXICAL_ANALYSIS, A.lastStartLoc, 0, we(b)), E.value = b.value || "", a(E, f.currentOffset(), f.currentPosition()), {
583
- node: E
584
- });
585
- }
586
- function C(f, b) {
587
- const A = f.context(), u = s(7, A.offset, A.startLoc);
588
- return u.value = b, a(u, f.currentOffset(), f.currentPosition()), u;
589
- }
590
- function T(f) {
591
- const b = f.context(), A = s(6, b.offset, b.startLoc);
592
- let u = f.nextToken();
593
- if (u.type === 8) {
594
- const I = N(f);
595
- A.modifier = I.node, u = I.nextConsumeToken || f.nextToken();
596
- }
597
- switch (u.type !== 9 && r(f, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, we(u)), u = f.nextToken(), u.type === 2 && (u = f.nextToken()), u.type) {
598
- case 10:
599
- u.value == null && r(f, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, we(u)), A.key = C(f, u.value || "");
600
- break;
601
- case 4:
602
- u.value == null && r(f, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, we(u)), A.key = l(f, u.value || "");
603
- break;
604
- case 5:
605
- u.value == null && r(f, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, we(u)), A.key = d(f, u.value || "");
606
- break;
607
- case 6:
608
- u.value == null && r(f, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, we(u)), A.key = g(f, u.value || "");
609
- break;
610
- default: {
611
- r(f, ne.UNEXPECTED_EMPTY_LINKED_KEY, b.lastStartLoc, 0);
612
- const I = f.context(), E = s(7, I.offset, I.startLoc);
613
- return E.value = "", a(E, I.offset, I.startLoc), A.key = E, a(A, I.offset, I.startLoc), {
614
- nextConsumeToken: u,
615
- node: A
616
- };
617
- }
618
- }
619
- return a(A, f.currentOffset(), f.currentPosition()), {
620
- node: A
621
- };
622
- }
623
- function j(f) {
624
- const b = f.context(), A = b.currentType === 1 ? f.currentOffset() : b.offset, u = b.currentType === 1 ? b.endLoc : b.startLoc, I = s(2, A, u);
625
- I.items = [];
626
- let E = null;
627
- do {
628
- const k = E || f.nextToken();
629
- switch (E = null, k.type) {
630
- case 0:
631
- k.value == null && r(f, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, we(k)), I.items.push(m(f, k.value || ""));
632
- break;
633
- case 5:
634
- k.value == null && r(f, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, we(k)), I.items.push(d(f, k.value || ""));
635
- break;
636
- case 4:
637
- k.value == null && r(f, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, we(k)), I.items.push(l(f, k.value || ""));
638
- break;
639
- case 6:
640
- k.value == null && r(f, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, we(k)), I.items.push(g(f, k.value || ""));
641
- break;
642
- case 7: {
643
- const $ = T(f);
644
- I.items.push($.node), E = $.nextConsumeToken || null;
645
- break;
646
- }
647
- }
648
- } while (b.currentType !== 13 && b.currentType !== 1);
649
- const _ = b.currentType === 1 ? b.lastOffset : f.currentOffset(), R = b.currentType === 1 ? b.lastEndLoc : f.currentPosition();
650
- return a(I, _, R), I;
651
- }
652
- function D(f, b, A, u) {
653
- const I = f.context();
654
- let E = u.items.length === 0;
655
- const _ = s(1, b, A);
656
- _.cases = [], _.cases.push(u);
657
- do {
658
- const R = j(f);
659
- E || (E = R.items.length === 0), _.cases.push(R);
660
- } while (I.currentType !== 13);
661
- return E && r(f, ne.MUST_HAVE_MESSAGES_IN_PLURAL, A, 0), a(_, f.currentOffset(), f.currentPosition()), _;
662
- }
663
- function L(f) {
664
- const b = f.context(), { offset: A, startLoc: u } = b, I = j(f);
665
- return b.currentType === 13 ? I : D(f, A, u, I);
666
- }
667
- function P(f) {
668
- const b = ns(f, Ie({}, e)), A = b.context(), u = s(0, A.offset, A.startLoc);
669
- return t && u.loc && (u.loc.source = f), u.body = L(b), e.onCacheKey && (u.cacheKey = e.onCacheKey(f)), A.currentType !== 13 && r(b, ne.UNEXPECTED_LEXICAL_ANALYSIS, A.lastStartLoc, 0, f[A.offset] || ""), a(u, b.currentOffset(), b.currentPosition()), u;
670
- }
671
- return { parse: P };
672
- }
673
- function we(e) {
674
- if (e.type === 13)
675
- return "EOF";
676
- const t = (e.value || "").replace(/\r?\n/gu, "\\n");
677
- return t.length > 10 ? t.slice(0, 9) + "…" : t;
678
- }
679
- function ls(e, t = {}) {
680
- const n = {
681
- ast: e,
682
- helpers: /* @__PURE__ */ new Set()
683
- };
684
- return { context: () => n, helper: (a) => (n.helpers.add(a), a) };
685
- }
686
- function dn(e, t) {
687
- for (let n = 0; n < e.length; n++)
688
- Jt(e[n], t);
689
- }
690
- function Jt(e, t) {
691
- switch (e.type) {
692
- case 1:
693
- dn(e.cases, t), t.helper(
694
- "plural"
695
- /* HelperNameMap.PLURAL */
696
- );
697
- break;
698
- case 2:
699
- dn(e.items, t);
700
- break;
701
- case 6: {
702
- Jt(e.key, t), t.helper(
703
- "linked"
704
- /* HelperNameMap.LINKED */
705
- ), t.helper(
706
- "type"
707
- /* HelperNameMap.TYPE */
708
- );
709
- break;
710
- }
711
- case 5:
712
- t.helper(
713
- "interpolate"
714
- /* HelperNameMap.INTERPOLATE */
715
- ), t.helper(
716
- "list"
717
- /* HelperNameMap.LIST */
718
- );
719
- break;
720
- case 4:
721
- t.helper(
722
- "interpolate"
723
- /* HelperNameMap.INTERPOLATE */
724
- ), t.helper(
725
- "named"
726
- /* HelperNameMap.NAMED */
727
- );
728
- break;
729
- }
730
- }
731
- function is(e, t = {}) {
732
- const n = ls(e);
733
- n.helper(
734
- "normalize"
735
- /* HelperNameMap.NORMALIZE */
736
- ), e.body && Jt(e.body, n);
737
- const r = n.context();
738
- e.helpers = Array.from(r.helpers);
739
- }
740
- function cs(e) {
741
- const t = e.body;
742
- return t.type === 2 ? mn(t) : t.cases.forEach((n) => mn(n)), e;
743
- }
744
- function mn(e) {
745
- if (e.items.length === 1) {
746
- const t = e.items[0];
747
- (t.type === 3 || t.type === 9) && (e.static = t.value, delete t.value);
748
- } else {
749
- const t = [];
750
- for (let n = 0; n < e.items.length; n++) {
751
- const r = e.items[n];
752
- if (!(r.type === 3 || r.type === 9) || r.value == null)
753
- break;
754
- t.push(r.value);
755
- }
756
- if (t.length === e.items.length) {
757
- e.static = Ht(t);
758
- for (let n = 0; n < e.items.length; n++) {
759
- const r = e.items[n];
760
- (r.type === 3 || r.type === 9) && delete r.value;
761
- }
762
- }
763
- }
764
- }
765
- function et(e) {
766
- switch (e.t = e.type, e.type) {
767
- case 0: {
768
- const t = e;
769
- et(t.body), t.b = t.body, delete t.body;
770
- break;
771
- }
772
- case 1: {
773
- const t = e, n = t.cases;
774
- for (let r = 0; r < n.length; r++)
775
- et(n[r]);
776
- t.c = n, delete t.cases;
777
- break;
778
- }
779
- case 2: {
780
- const t = e, n = t.items;
781
- for (let r = 0; r < n.length; r++)
782
- et(n[r]);
783
- t.i = n, delete t.items, t.static && (t.s = t.static, delete t.static);
784
- break;
785
- }
786
- case 3:
787
- case 9:
788
- case 8:
789
- case 7: {
790
- const t = e;
791
- t.value && (t.v = t.value, delete t.value);
792
- break;
793
- }
794
- case 6: {
795
- const t = e;
796
- et(t.key), t.k = t.key, delete t.key, t.modifier && (et(t.modifier), t.m = t.modifier, delete t.modifier);
797
- break;
798
- }
799
- case 5: {
800
- const t = e;
801
- t.i = t.index, delete t.index;
802
- break;
803
- }
804
- case 4: {
805
- const t = e;
806
- t.k = t.key, delete t.key;
807
- break;
808
- }
809
- }
810
- delete e.type;
811
- }
812
- function us(e, t) {
813
- const { filename: n, breakLineCode: r, needIndent: s } = t, a = t.location !== !1, m = {
814
- filename: n,
815
- code: "",
816
- column: 1,
817
- line: 1,
818
- offset: 0,
819
- map: void 0,
820
- breakLineCode: r,
821
- needIndent: s,
822
- indentLevel: 0
823
- };
824
- a && e.loc && (m.source = e.loc.source);
825
- const d = () => m;
826
- function l(L, P) {
827
- m.code += L;
828
- }
829
- function g(L, P = !0) {
830
- const f = P ? r : "";
831
- l(s ? f + " ".repeat(L) : f);
832
- }
833
- function N(L = !0) {
834
- const P = ++m.indentLevel;
835
- L && g(P);
836
- }
837
- function C(L = !0) {
838
- const P = --m.indentLevel;
839
- L && g(P);
840
- }
841
- function T() {
842
- g(m.indentLevel);
843
- }
844
- return {
845
- context: d,
846
- push: l,
847
- indent: N,
848
- deindent: C,
849
- newline: T,
850
- helper: (L) => `_${L}`,
851
- needIndent: () => m.needIndent
852
- };
853
- }
854
- function ds(e, t) {
855
- const { helper: n } = e;
856
- e.push(`${n(
857
- "linked"
858
- /* HelperNameMap.LINKED */
859
- )}(`), at(e, t.key), t.modifier ? (e.push(", "), at(e, t.modifier), e.push(", _type")) : e.push(", undefined, _type"), e.push(")");
860
- }
861
- function ms(e, t) {
862
- const { helper: n, needIndent: r } = e;
863
- e.push(`${n(
864
- "normalize"
865
- /* HelperNameMap.NORMALIZE */
866
- )}([`), e.indent(r());
867
- const s = t.items.length;
868
- for (let a = 0; a < s && (at(e, t.items[a]), a !== s - 1); a++)
869
- e.push(", ");
870
- e.deindent(r()), e.push("])");
871
- }
872
- function fs(e, t) {
873
- const { helper: n, needIndent: r } = e;
874
- if (t.cases.length > 1) {
875
- e.push(`${n(
876
- "plural"
877
- /* HelperNameMap.PLURAL */
878
- )}([`), e.indent(r());
879
- const s = t.cases.length;
880
- for (let a = 0; a < s && (at(e, t.cases[a]), a !== s - 1); a++)
881
- e.push(", ");
882
- e.deindent(r()), e.push("])");
883
- }
884
- }
885
- function _s(e, t) {
886
- t.body ? at(e, t.body) : e.push("null");
887
- }
888
- function at(e, t) {
889
- const { helper: n } = e;
890
- switch (t.type) {
891
- case 0:
892
- _s(e, t);
893
- break;
894
- case 1:
895
- fs(e, t);
896
- break;
897
- case 2:
898
- ms(e, t);
899
- break;
900
- case 6:
901
- ds(e, t);
902
- break;
903
- case 8:
904
- e.push(JSON.stringify(t.value), t);
905
- break;
906
- case 7:
907
- e.push(JSON.stringify(t.value), t);
908
- break;
909
- case 5:
910
- e.push(`${n(
911
- "interpolate"
912
- /* HelperNameMap.INTERPOLATE */
913
- )}(${n(
914
- "list"
915
- /* HelperNameMap.LIST */
916
- )}(${t.index}))`, t);
917
- break;
918
- case 4:
919
- e.push(`${n(
920
- "interpolate"
921
- /* HelperNameMap.INTERPOLATE */
922
- )}(${n(
923
- "named"
924
- /* HelperNameMap.NAMED */
925
- )}(${JSON.stringify(t.key)}))`, t);
926
- break;
927
- case 9:
928
- e.push(JSON.stringify(t.value), t);
929
- break;
930
- case 3:
931
- e.push(JSON.stringify(t.value), t);
932
- break;
933
- }
934
- }
935
- const ps = (e, t = {}) => {
936
- const n = W(t.mode) ? t.mode : "normal", r = W(t.filename) ? t.filename : "message.intl";
937
- t.sourceMap;
938
- const s = t.breakLineCode != null ? t.breakLineCode : n === "arrow" ? ";" : `
939
- `, a = t.needIndent ? t.needIndent : n !== "arrow", m = e.helpers || [], d = us(e, {
940
- filename: r,
941
- breakLineCode: s,
942
- needIndent: a
943
- });
944
- d.push(n === "normal" ? "function __msg__ (ctx) {" : "(ctx) => {"), d.indent(a), m.length > 0 && (d.push(`const { ${Ht(m.map((N) => `${N}: _${N}`), ", ")} } = ctx`), d.newline()), d.push("return "), at(d, e), d.deindent(a), d.push("}"), delete e.helpers;
945
- const { code: l, map: g } = d.context();
946
- return {
947
- ast: e,
948
- code: l,
949
- map: g ? g.toJSON() : void 0
950
- // eslint-disable-line @typescript-eslint/no-explicit-any
951
- };
952
- };
953
- function vs(e, t = {}) {
954
- const n = Ie({}, t), r = !!n.jit, s = !!n.minify, a = n.optimize == null ? !0 : n.optimize, d = os(n).parse(e);
955
- return r ? (a && cs(d), s && et(d), { ast: d, code: "" }) : (is(d, n), ps(d, n));
956
- }
957
- var hs = { env: { NODE_ENV: "production" } };
958
- function bs() {
959
- typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" && (ze().__INTLIFY_PROD_DEVTOOLS__ = !1), typeof __INTLIFY_DROP_MESSAGE_COMPILER__ != "boolean" && (ze().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1);
960
- }
961
- function Lt(e) {
962
- return (n) => gs(n, e);
963
- }
964
- function gs(e, t) {
965
- const n = ys(t);
966
- if (n == null)
967
- throw ct(
968
- 0
969
- /* NodeTypes.Resource */
970
- );
971
- if ($t(n) === 1) {
972
- const a = Ns(n);
973
- return e.plural(a.reduce((m, d) => [
974
- ...m,
975
- fn(e, d)
976
- ], []));
977
- } else
978
- return fn(e, n);
979
- }
980
- const Is = ["b", "body"];
981
- function ys(e) {
982
- return He(e, Is);
983
- }
984
- const Es = ["c", "cases"];
985
- function Ns(e) {
986
- return He(e, Es, []);
987
- }
988
- function fn(e, t) {
989
- const n = Ts(t);
990
- if (n != null)
991
- return e.type === "text" ? n : e.normalize([n]);
992
- {
993
- const r = Ss(t).reduce((s, a) => [...s, Ft(e, a)], []);
994
- return e.normalize(r);
995
- }
996
- }
997
- const Cs = ["s", "static"];
998
- function Ts(e) {
999
- return He(e, Cs);
1000
- }
1001
- const Os = ["i", "items"];
1002
- function Ss(e) {
1003
- return He(e, Os, []);
1004
- }
1005
- function Ft(e, t) {
1006
- const n = $t(t);
1007
- switch (n) {
1008
- case 3:
1009
- return _t(t, n);
1010
- case 9:
1011
- return _t(t, n);
1012
- case 4: {
1013
- const r = t;
1014
- if (Ae(r, "k") && r.k)
1015
- return e.interpolate(e.named(r.k));
1016
- if (Ae(r, "key") && r.key)
1017
- return e.interpolate(e.named(r.key));
1018
- throw ct(n);
1019
- }
1020
- case 5: {
1021
- const r = t;
1022
- if (Ae(r, "i") && ge(r.i))
1023
- return e.interpolate(e.list(r.i));
1024
- if (Ae(r, "index") && ge(r.index))
1025
- return e.interpolate(e.list(r.index));
1026
- throw ct(n);
1027
- }
1028
- case 6: {
1029
- const r = t, s = Rs(r), a = ws(r);
1030
- return e.linked(Ft(e, a), s ? Ft(e, s) : void 0, e.type);
1031
- }
1032
- case 7:
1033
- return _t(t, n);
1034
- case 8:
1035
- return _t(t, n);
1036
- default:
1037
- throw new Error(`unhandled node on format message part: ${n}`);
1038
- }
1039
- }
1040
- const Ls = ["t", "type"];
1041
- function $t(e) {
1042
- return He(e, Ls);
1043
- }
1044
- const ks = ["v", "value"];
1045
- function _t(e, t) {
1046
- const n = He(e, ks);
1047
- if (n)
1048
- return n;
1049
- throw ct(t);
1050
- }
1051
- const As = ["m", "modifier"];
1052
- function Rs(e) {
1053
- return He(e, As);
1054
- }
1055
- const Ms = ["k", "key"];
1056
- function ws(e) {
1057
- const t = He(e, Ms);
1058
- if (t)
1059
- return t;
1060
- throw ct(
1061
- 6
1062
- /* NodeTypes.Linked */
1063
- );
1064
- }
1065
- function He(e, t, n) {
1066
- for (let r = 0; r < t.length; r++) {
1067
- const s = t[r];
1068
- if (Ae(e, s) && e[s] != null)
1069
- return e[s];
1070
- }
1071
- return n;
1072
- }
1073
- function ct(e) {
1074
- return new Error(`unhandled node type: ${e}`);
1075
- }
1076
- const Ds = (e) => e;
1077
- let pt = ae();
1078
- function ot(e) {
1079
- return ee(e) && $t(e) === 0 && (Ae(e, "b") || Ae(e, "body"));
1080
- }
1081
- function Fs(e, t = {}) {
1082
- let n = !1;
1083
- const r = t.onError || $r;
1084
- return t.onError = (s) => {
1085
- n = !0, r(s);
1086
- }, { ...vs(e, t), detectError: n };
1087
- }
1088
- // @__NO_SIDE_EFFECTS__
1089
- function Ps(e, t) {
1090
- if (!__INTLIFY_DROP_MESSAGE_COMPILER__ && W(e)) {
1091
- pe(t.warnHtmlMessage) && t.warnHtmlMessage;
1092
- const r = (t.onCacheKey || Ds)(e), s = pt[r];
1093
- if (s)
1094
- return s;
1095
- const { ast: a, detectError: m } = Fs(e, {
1096
- ...t,
1097
- location: hs.env.NODE_ENV !== "production",
1098
- jit: !0
1099
- }), d = Lt(a);
1100
- return m ? d : pt[r] = d;
1101
- } else {
1102
- const n = e.cacheKey;
1103
- if (n) {
1104
- const r = pt[n];
1105
- return r || (pt[n] = Lt(e));
1106
- } else
1107
- return Lt(e);
1108
- }
1109
- }
1110
- let ut = null;
1111
- function js(e) {
1112
- ut = e;
1113
- }
1114
- function Us(e, t, n) {
1115
- ut && ut.emit("i18n:init", {
1116
- timestamp: Date.now(),
1117
- i18n: e,
1118
- version: t,
1119
- meta: n
1120
- });
1121
- }
1122
- const xs = /* @__PURE__ */ Vs("function:translate");
1123
- function Vs(e) {
1124
- return (t) => ut && ut.emit(e, t);
1125
- }
1126
- const Ve = {
1127
- INVALID_ARGUMENT: Jr,
1128
- // 17
1129
- INVALID_DATE_ARGUMENT: 18,
1130
- INVALID_ISO_DATE_ARGUMENT: 19,
1131
- NOT_SUPPORT_LOCALE_PROMISE_VALUE: 21,
1132
- NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 22,
1133
- NOT_SUPPORT_LOCALE_TYPE: 23
1134
- }, Ws = 24;
1135
- function We(e) {
1136
- return Ct(e, null, void 0);
1137
- }
1138
- function zt(e, t) {
1139
- return t.locale != null ? _n(t.locale) : _n(e.locale);
1140
- }
1141
- let kt;
1142
- function _n(e) {
1143
- if (W(e))
1144
- return e;
1145
- if (me(e)) {
1146
- if (e.resolvedOnce && kt != null)
1147
- return kt;
1148
- if (e.constructor.name === "Function") {
1149
- const t = e();
1150
- if (Br(t))
1151
- throw We(Ve.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
1152
- return kt = t;
1153
- } else
1154
- throw We(Ve.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
1155
- } else
1156
- throw We(Ve.NOT_SUPPORT_LOCALE_TYPE);
1157
- }
1158
- function Gs(e, t, n) {
1159
- return [.../* @__PURE__ */ new Set([
1160
- n,
1161
- ...be(t) ? t : ee(t) ? Object.keys(t) : W(t) ? [t] : [n]
1162
- ])];
1163
- }
1164
- function zn(e, t, n) {
1165
- const r = W(n) ? n : Et, s = e;
1166
- s.__localeChainCache || (s.__localeChainCache = /* @__PURE__ */ new Map());
1167
- let a = s.__localeChainCache.get(r);
1168
- if (!a) {
1169
- a = [];
1170
- let m = [n];
1171
- for (; be(m); )
1172
- m = pn(a, m, t);
1173
- const d = be(t) || !q(t) ? t : t.default ? t.default : null;
1174
- m = W(d) ? [d] : d, be(m) && pn(a, m, !1), s.__localeChainCache.set(r, a);
1175
- }
1176
- return a;
1177
- }
1178
- function pn(e, t, n) {
1179
- let r = !0;
1180
- for (let s = 0; s < t.length && pe(r); s++) {
1181
- const a = t[s];
1182
- W(a) && (r = Zs(e, t[s], n));
1183
- }
1184
- return r;
1185
- }
1186
- function Zs(e, t, n) {
1187
- let r;
1188
- const s = t.split("-");
1189
- do {
1190
- const a = s.join("-");
1191
- r = Bs(e, a, n), s.splice(-1, 1);
1192
- } while (s.length && r === !0);
1193
- return r;
1194
- }
1195
- function Bs(e, t, n) {
1196
- let r = !1;
1197
- if (!e.includes(t) && (r = !0, t)) {
1198
- r = t[t.length - 1] !== "!";
1199
- const s = t.replace(/!/g, "");
1200
- e.push(s), (be(n) || q(n)) && n[s] && (r = n[s]);
1201
- }
1202
- return r;
1203
- }
1204
- const Je = [];
1205
- Je[
1206
- 0
1207
- /* States.BEFORE_PATH */
1208
- ] = {
1209
- w: [
1210
- 0
1211
- /* States.BEFORE_PATH */
1212
- ],
1213
- i: [
1214
- 3,
1215
- 0
1216
- /* Actions.APPEND */
1217
- ],
1218
- "[": [
1219
- 4
1220
- /* States.IN_SUB_PATH */
1221
- ],
1222
- o: [
1223
- 7
1224
- /* States.AFTER_PATH */
1225
- ]
1226
- };
1227
- Je[
1228
- 1
1229
- /* States.IN_PATH */
1230
- ] = {
1231
- w: [
1232
- 1
1233
- /* States.IN_PATH */
1234
- ],
1235
- ".": [
1236
- 2
1237
- /* States.BEFORE_IDENT */
1238
- ],
1239
- "[": [
1240
- 4
1241
- /* States.IN_SUB_PATH */
1242
- ],
1243
- o: [
1244
- 7
1245
- /* States.AFTER_PATH */
1246
- ]
1247
- };
1248
- Je[
1249
- 2
1250
- /* States.BEFORE_IDENT */
1251
- ] = {
1252
- w: [
1253
- 2
1254
- /* States.BEFORE_IDENT */
1255
- ],
1256
- i: [
1257
- 3,
1258
- 0
1259
- /* Actions.APPEND */
1260
- ],
1261
- 0: [
1262
- 3,
1263
- 0
1264
- /* Actions.APPEND */
1265
- ]
1266
- };
1267
- Je[
1268
- 3
1269
- /* States.IN_IDENT */
1270
- ] = {
1271
- i: [
1272
- 3,
1273
- 0
1274
- /* Actions.APPEND */
1275
- ],
1276
- 0: [
1277
- 3,
1278
- 0
1279
- /* Actions.APPEND */
1280
- ],
1281
- w: [
1282
- 1,
1283
- 1
1284
- /* Actions.PUSH */
1285
- ],
1286
- ".": [
1287
- 2,
1288
- 1
1289
- /* Actions.PUSH */
1290
- ],
1291
- "[": [
1292
- 4,
1293
- 1
1294
- /* Actions.PUSH */
1295
- ],
1296
- o: [
1297
- 7,
1298
- 1
1299
- /* Actions.PUSH */
1300
- ]
1301
- };
1302
- Je[
1303
- 4
1304
- /* States.IN_SUB_PATH */
1305
- ] = {
1306
- "'": [
1307
- 5,
1308
- 0
1309
- /* Actions.APPEND */
1310
- ],
1311
- '"': [
1312
- 6,
1313
- 0
1314
- /* Actions.APPEND */
1315
- ],
1316
- "[": [
1317
- 4,
1318
- 2
1319
- /* Actions.INC_SUB_PATH_DEPTH */
1320
- ],
1321
- "]": [
1322
- 1,
1323
- 3
1324
- /* Actions.PUSH_SUB_PATH */
1325
- ],
1326
- o: 8,
1327
- l: [
1328
- 4,
1329
- 0
1330
- /* Actions.APPEND */
1331
- ]
1332
- };
1333
- Je[
1334
- 5
1335
- /* States.IN_SINGLE_QUOTE */
1336
- ] = {
1337
- "'": [
1338
- 4,
1339
- 0
1340
- /* Actions.APPEND */
1341
- ],
1342
- o: 8,
1343
- l: [
1344
- 5,
1345
- 0
1346
- /* Actions.APPEND */
1347
- ]
1348
- };
1349
- Je[
1350
- 6
1351
- /* States.IN_DOUBLE_QUOTE */
1352
- ] = {
1353
- '"': [
1354
- 4,
1355
- 0
1356
- /* Actions.APPEND */
1357
- ],
1358
- o: 8,
1359
- l: [
1360
- 6,
1361
- 0
1362
- /* Actions.APPEND */
1363
- ]
1364
- };
1365
- const Ys = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
1366
- function Xs(e) {
1367
- return Ys.test(e);
1368
- }
1369
- function Hs(e) {
1370
- const t = e.charCodeAt(0), n = e.charCodeAt(e.length - 1);
1371
- return t === n && (t === 34 || t === 39) ? e.slice(1, -1) : e;
1372
- }
1373
- function Js(e) {
1374
- if (e == null)
1375
- return "o";
1376
- switch (e.charCodeAt(0)) {
1377
- case 91:
1378
- case 93:
1379
- case 46:
1380
- case 34:
1381
- case 39:
1382
- return e;
1383
- case 95:
1384
- case 36:
1385
- case 45:
1386
- return "i";
1387
- case 9:
1388
- case 10:
1389
- case 13:
1390
- case 160:
1391
- case 65279:
1392
- case 8232:
1393
- case 8233:
1394
- return "w";
1395
- }
1396
- return "i";
1397
- }
1398
- function $s(e) {
1399
- const t = e.trim();
1400
- return e.charAt(0) === "0" && isNaN(parseInt(e)) ? !1 : Xs(t) ? Hs(t) : "*" + t;
1401
- }
1402
- function zs(e) {
1403
- const t = [];
1404
- let n = -1, r = 0, s = 0, a, m, d, l, g, N, C;
1405
- const T = [];
1406
- T[
1407
- 0
1408
- /* Actions.APPEND */
1409
- ] = () => {
1410
- m === void 0 ? m = d : m += d;
1411
- }, T[
1412
- 1
1413
- /* Actions.PUSH */
1414
- ] = () => {
1415
- m !== void 0 && (t.push(m), m = void 0);
1416
- }, T[
1417
- 2
1418
- /* Actions.INC_SUB_PATH_DEPTH */
1419
- ] = () => {
1420
- T[
1421
- 0
1422
- /* Actions.APPEND */
1423
- ](), s++;
1424
- }, T[
1425
- 3
1426
- /* Actions.PUSH_SUB_PATH */
1427
- ] = () => {
1428
- if (s > 0)
1429
- s--, r = 4, T[
1430
- 0
1431
- /* Actions.APPEND */
1432
- ]();
1433
- else {
1434
- if (s = 0, m === void 0 || (m = $s(m), m === !1))
1435
- return !1;
1436
- T[
1437
- 1
1438
- /* Actions.PUSH */
1439
- ]();
1440
- }
1441
- };
1442
- function j() {
1443
- const D = e[n + 1];
1444
- if (r === 5 && D === "'" || r === 6 && D === '"')
1445
- return n++, d = "\\" + D, T[
1446
- 0
1447
- /* Actions.APPEND */
1448
- ](), !0;
1449
- }
1450
- for (; r !== null; )
1451
- if (n++, a = e[n], !(a === "\\" && j())) {
1452
- if (l = Js(a), C = Je[r], g = C[l] || C.l || 8, g === 8 || (r = g[0], g[1] !== void 0 && (N = T[g[1]], N && (d = a, N() === !1))))
1453
- return;
1454
- if (r === 7)
1455
- return t;
1456
- }
1457
- }
1458
- const vn = /* @__PURE__ */ new Map();
1459
- function Ks(e, t) {
1460
- return ee(e) ? e[t] : null;
1461
- }
1462
- function Qs(e, t) {
1463
- if (!ee(e))
1464
- return null;
1465
- let n = vn.get(t);
1466
- if (n || (n = zs(t), n && vn.set(t, n)), !n)
1467
- return null;
1468
- const r = n.length;
1469
- let s = e, a = 0;
1470
- for (; a < r; ) {
1471
- const m = s[n[a]];
1472
- if (m === void 0 || me(s))
1473
- return null;
1474
- s = m, a++;
1475
- }
1476
- return s;
1477
- }
1478
- const qs = "10.0.5", Tt = -1, Et = "en-US", hn = "", bn = (e) => `${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;
1479
- function ea() {
1480
- return {
1481
- upper: (e, t) => t === "text" && W(e) ? e.toUpperCase() : t === "vnode" && ee(e) && "__v_isVNode" in e ? e.children.toUpperCase() : e,
1482
- lower: (e, t) => t === "text" && W(e) ? e.toLowerCase() : t === "vnode" && ee(e) && "__v_isVNode" in e ? e.children.toLowerCase() : e,
1483
- capitalize: (e, t) => t === "text" && W(e) ? bn(e) : t === "vnode" && ee(e) && "__v_isVNode" in e ? bn(e.children) : e
1484
- };
1485
- }
1486
- let Kn;
1487
- function ta(e) {
1488
- Kn = e;
1489
- }
1490
- let Qn;
1491
- function na(e) {
1492
- Qn = e;
1493
- }
1494
- let qn;
1495
- function ra(e) {
1496
- qn = e;
1497
- }
1498
- let er = null;
1499
- const sa = /* @__NO_SIDE_EFFECTS__ */ (e) => {
1500
- er = e;
1501
- }, aa = /* @__NO_SIDE_EFFECTS__ */ () => er;
1502
- let tr = null;
1503
- const gn = (e) => {
1504
- tr = e;
1505
- }, oa = () => tr;
1506
- let In = 0;
1507
- function la(e = {}) {
1508
- const t = me(e.onWarn) ? e.onWarn : Xr, n = W(e.version) ? e.version : qs, r = W(e.locale) || me(e.locale) ? e.locale : Et, s = me(r) ? Et : r, a = be(e.fallbackLocale) || q(e.fallbackLocale) || W(e.fallbackLocale) || e.fallbackLocale === !1 ? e.fallbackLocale : s, m = q(e.messages) ? e.messages : At(s), d = q(e.datetimeFormats) ? e.datetimeFormats : At(s), l = q(e.numberFormats) ? e.numberFormats : At(s), g = Ie(ae(), e.modifiers, ea()), N = e.pluralRules || ae(), C = me(e.missing) ? e.missing : null, T = pe(e.missingWarn) || yt(e.missingWarn) ? e.missingWarn : !0, j = pe(e.fallbackWarn) || yt(e.fallbackWarn) ? e.fallbackWarn : !0, D = !!e.fallbackFormat, L = !!e.unresolving, P = me(e.postTranslation) ? e.postTranslation : null, f = q(e.processor) ? e.processor : null, b = pe(e.warnHtmlMessage) ? e.warnHtmlMessage : !0, A = !!e.escapeParameter, u = me(e.messageCompiler) ? e.messageCompiler : Kn, I = me(e.messageResolver) ? e.messageResolver : Qn || Ks, E = me(e.localeFallbacker) ? e.localeFallbacker : qn || Gs, _ = ee(e.fallbackContext) ? e.fallbackContext : void 0, R = e, k = ee(R.__datetimeFormatters) ? R.__datetimeFormatters : /* @__PURE__ */ new Map(), $ = ee(R.__numberFormatters) ? R.__numberFormatters : /* @__PURE__ */ new Map(), x = ee(R.__meta) ? R.__meta : {};
1509
- In++;
1510
- const F = {
1511
- version: n,
1512
- cid: In,
1513
- locale: r,
1514
- fallbackLocale: a,
1515
- messages: m,
1516
- modifiers: g,
1517
- pluralRules: N,
1518
- missing: C,
1519
- missingWarn: T,
1520
- fallbackWarn: j,
1521
- fallbackFormat: D,
1522
- unresolving: L,
1523
- postTranslation: P,
1524
- processor: f,
1525
- warnHtmlMessage: b,
1526
- escapeParameter: A,
1527
- messageCompiler: u,
1528
- messageResolver: I,
1529
- localeFallbacker: E,
1530
- fallbackContext: _,
1531
- onWarn: t,
1532
- __meta: x
1533
- };
1534
- return F.datetimeFormats = d, F.numberFormats = l, F.__datetimeFormatters = k, F.__numberFormatters = $, __INTLIFY_PROD_DEVTOOLS__ && Us(F, n, x), F;
1535
- }
1536
- const At = (e) => ({ [e]: ae() });
1537
- function Kt(e, t, n, r, s) {
1538
- const { missing: a, onWarn: m } = e;
1539
- if (a !== null) {
1540
- const d = a(e, n, t, s);
1541
- return W(d) ? d : t;
1542
- } else
1543
- return t;
1544
- }
1545
- function it(e, t, n) {
1546
- const r = e;
1547
- r.__localeChainCache = /* @__PURE__ */ new Map(), e.localeFallbacker(e, n, t);
1548
- }
1549
- function ia(e, t) {
1550
- return e === t ? !1 : e.split("-")[0] === t.split("-")[0];
1551
- }
1552
- function ca(e, t) {
1553
- const n = t.indexOf(e);
1554
- if (n === -1)
1555
- return !1;
1556
- for (let r = n + 1; r < t.length; r++)
1557
- if (ia(e, t[r]))
1558
- return !0;
1559
- return !1;
1560
- }
1561
- function yn(e, ...t) {
1562
- const { datetimeFormats: n, unresolving: r, fallbackLocale: s, onWarn: a, localeFallbacker: m } = e, { __datetimeFormatters: d } = e, [l, g, N, C] = Pt(...t), T = pe(N.missingWarn) ? N.missingWarn : e.missingWarn;
1563
- pe(N.fallbackWarn) ? N.fallbackWarn : e.fallbackWarn;
1564
- const j = !!N.part, D = zt(e, N), L = m(
1565
- e,
1566
- // eslint-disable-line @typescript-eslint/no-explicit-any
1567
- s,
1568
- D
1569
- );
1570
- if (!W(l) || l === "")
1571
- return new Intl.DateTimeFormat(D, C).format(g);
1572
- let P = {}, f, b = null;
1573
- const A = "datetime format";
1574
- for (let E = 0; E < L.length && (f = L[E], P = n[f] || {}, b = P[l], !q(b)); E++)
1575
- Kt(e, l, f, T, A);
1576
- if (!q(b) || !W(f))
1577
- return r ? Tt : l;
1578
- let u = `${f}__${l}`;
1579
- Nt(C) || (u = `${u}__${JSON.stringify(C)}`);
1580
- let I = d.get(u);
1581
- return I || (I = new Intl.DateTimeFormat(f, Ie({}, b, C)), d.set(u, I)), j ? I.formatToParts(g) : I.format(g);
1582
- }
1583
- const nr = [
1584
- "localeMatcher",
1585
- "weekday",
1586
- "era",
1587
- "year",
1588
- "month",
1589
- "day",
1590
- "hour",
1591
- "minute",
1592
- "second",
1593
- "timeZoneName",
1594
- "formatMatcher",
1595
- "hour12",
1596
- "timeZone",
1597
- "dateStyle",
1598
- "timeStyle",
1599
- "calendar",
1600
- "dayPeriod",
1601
- "numberingSystem",
1602
- "hourCycle",
1603
- "fractionalSecondDigits"
1604
- ];
1605
- function Pt(...e) {
1606
- const [t, n, r, s] = e, a = ae();
1607
- let m = ae(), d;
1608
- if (W(t)) {
1609
- const l = t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);
1610
- if (!l)
1611
- throw We(Ve.INVALID_ISO_DATE_ARGUMENT);
1612
- const g = l[3] ? l[3].trim().startsWith("T") ? `${l[1].trim()}${l[3].trim()}` : `${l[1].trim()}T${l[3].trim()}` : l[1].trim();
1613
- d = new Date(g);
1614
- try {
1615
- d.toISOString();
1616
- } catch {
1617
- throw We(Ve.INVALID_ISO_DATE_ARGUMENT);
1618
- }
1619
- } else if (Wr(t)) {
1620
- if (isNaN(t.getTime()))
1621
- throw We(Ve.INVALID_DATE_ARGUMENT);
1622
- d = t;
1623
- } else if (ge(t))
1624
- d = t;
1625
- else
1626
- throw We(Ve.INVALID_ARGUMENT);
1627
- return W(n) ? a.key = n : q(n) && Object.keys(n).forEach((l) => {
1628
- nr.includes(l) ? m[l] = n[l] : a[l] = n[l];
1629
- }), W(r) ? a.locale = r : q(r) && (m = r), q(s) && (m = s), [a.key || "", d, a, m];
1630
- }
1631
- function En(e, t, n) {
1632
- const r = e;
1633
- for (const s in n) {
1634
- const a = `${t}__${s}`;
1635
- r.__datetimeFormatters.has(a) && r.__datetimeFormatters.delete(a);
1636
- }
1637
- }
1638
- function Nn(e, ...t) {
1639
- const { numberFormats: n, unresolving: r, fallbackLocale: s, onWarn: a, localeFallbacker: m } = e, { __numberFormatters: d } = e, [l, g, N, C] = jt(...t), T = pe(N.missingWarn) ? N.missingWarn : e.missingWarn;
1640
- pe(N.fallbackWarn) ? N.fallbackWarn : e.fallbackWarn;
1641
- const j = !!N.part, D = zt(e, N), L = m(
1642
- e,
1643
- // eslint-disable-line @typescript-eslint/no-explicit-any
1644
- s,
1645
- D
1646
- );
1647
- if (!W(l) || l === "")
1648
- return new Intl.NumberFormat(D, C).format(g);
1649
- let P = {}, f, b = null;
1650
- const A = "number format";
1651
- for (let E = 0; E < L.length && (f = L[E], P = n[f] || {}, b = P[l], !q(b)); E++)
1652
- Kt(e, l, f, T, A);
1653
- if (!q(b) || !W(f))
1654
- return r ? Tt : l;
1655
- let u = `${f}__${l}`;
1656
- Nt(C) || (u = `${u}__${JSON.stringify(C)}`);
1657
- let I = d.get(u);
1658
- return I || (I = new Intl.NumberFormat(f, Ie({}, b, C)), d.set(u, I)), j ? I.formatToParts(g) : I.format(g);
1659
- }
1660
- const rr = [
1661
- "localeMatcher",
1662
- "style",
1663
- "currency",
1664
- "currencyDisplay",
1665
- "currencySign",
1666
- "useGrouping",
1667
- "minimumIntegerDigits",
1668
- "minimumFractionDigits",
1669
- "maximumFractionDigits",
1670
- "minimumSignificantDigits",
1671
- "maximumSignificantDigits",
1672
- "compactDisplay",
1673
- "notation",
1674
- "signDisplay",
1675
- "unit",
1676
- "unitDisplay",
1677
- "roundingMode",
1678
- "roundingPriority",
1679
- "roundingIncrement",
1680
- "trailingZeroDisplay"
1681
- ];
1682
- function jt(...e) {
1683
- const [t, n, r, s] = e, a = ae();
1684
- let m = ae();
1685
- if (!ge(t))
1686
- throw We(Ve.INVALID_ARGUMENT);
1687
- const d = t;
1688
- return W(n) ? a.key = n : q(n) && Object.keys(n).forEach((l) => {
1689
- rr.includes(l) ? m[l] = n[l] : a[l] = n[l];
1690
- }), W(r) ? a.locale = r : q(r) && (m = r), q(s) && (m = s), [a.key || "", d, a, m];
1691
- }
1692
- function Cn(e, t, n) {
1693
- const r = e;
1694
- for (const s in n) {
1695
- const a = `${t}__${s}`;
1696
- r.__numberFormatters.has(a) && r.__numberFormatters.delete(a);
1697
- }
1698
- }
1699
- const ua = (e) => e, da = (e) => "", ma = "text", fa = (e) => e.length === 0 ? "" : Ht(e), _a = Yr;
1700
- function Tn(e, t) {
1701
- return e = Math.abs(e), t === 2 ? e ? e > 1 ? 1 : 0 : 1 : e ? Math.min(e, 2) : 0;
1702
- }
1703
- function pa(e) {
1704
- const t = ge(e.pluralIndex) ? e.pluralIndex : -1;
1705
- return e.named && (ge(e.named.count) || ge(e.named.n)) ? ge(e.named.count) ? e.named.count : ge(e.named.n) ? e.named.n : t : t;
1706
- }
1707
- function va(e, t) {
1708
- t.count || (t.count = e), t.n || (t.n = e);
1709
- }
1710
- function ha(e = {}) {
1711
- const t = e.locale, n = pa(e), r = ee(e.pluralRules) && W(t) && me(e.pluralRules[t]) ? e.pluralRules[t] : Tn, s = ee(e.pluralRules) && W(t) && me(e.pluralRules[t]) ? Tn : void 0, a = (f) => f[r(n, f.length, s)], m = e.list || [], d = (f) => m[f], l = e.named || ae();
1712
- ge(e.pluralIndex) && va(n, l);
1713
- const g = (f) => l[f];
1714
- function N(f, b) {
1715
- const A = me(e.messages) ? e.messages(f, !!b) : ee(e.messages) ? e.messages[f] : !1;
1716
- return A || (e.parent ? e.parent.message(f) : da);
1717
- }
1718
- const C = (f) => e.modifiers ? e.modifiers[f] : ua, T = q(e.processor) && me(e.processor.normalize) ? e.processor.normalize : fa, j = q(e.processor) && me(e.processor.interpolate) ? e.processor.interpolate : _a, D = q(e.processor) && W(e.processor.type) ? e.processor.type : ma, P = {
1719
- list: d,
1720
- named: g,
1721
- plural: a,
1722
- linked: (f, ...b) => {
1723
- const [A, u] = b;
1724
- let I = "text", E = "";
1725
- b.length === 1 ? ee(A) ? (E = A.modifier || E, I = A.type || I) : W(A) && (E = A || E) : b.length === 2 && (W(A) && (E = A || E), W(u) && (I = u || I));
1726
- const _ = N(f, !0)(P), R = (
1727
- // The message in vnode resolved with linked are returned as an array by processor.nomalize
1728
- I === "vnode" && be(_) && E ? _[0] : _
1729
- );
1730
- return E ? C(E)(R, I) : R;
1731
- },
1732
- message: N,
1733
- type: D,
1734
- interpolate: j,
1735
- normalize: T,
1736
- values: Ie(ae(), m, l)
1737
- };
1738
- return P;
1739
- }
1740
- const On = () => "", Se = (e) => me(e);
1741
- function Sn(e, ...t) {
1742
- const { fallbackFormat: n, postTranslation: r, unresolving: s, messageCompiler: a, fallbackLocale: m, messages: d } = e, [l, g] = Ut(...t), N = pe(g.missingWarn) ? g.missingWarn : e.missingWarn, C = pe(g.fallbackWarn) ? g.fallbackWarn : e.fallbackWarn, T = pe(g.escapeParameter) ? g.escapeParameter : e.escapeParameter, j = !!g.resolvedMessage, D = W(g.default) || pe(g.default) ? pe(g.default) ? a ? l : () => l : g.default : n ? a ? l : () => l : null, L = n || D != null && (W(D) || me(D)), P = zt(e, g);
1743
- T && ba(g);
1744
- let [f, b, A] = j ? [
1745
- l,
1746
- P,
1747
- d[P] || ae()
1748
- ] : sr(e, l, P, m, C, N), u = f, I = l;
1749
- if (!j && !(W(u) || ot(u) || Se(u)) && L && (u = D, I = u), !j && (!(W(u) || ot(u) || Se(u)) || !W(b)))
1750
- return s ? Tt : l;
1751
- let E = !1;
1752
- const _ = () => {
1753
- E = !0;
1754
- }, R = Se(u) ? u : ar(e, l, b, u, I, _);
1755
- if (E)
1756
- return u;
1757
- const k = ya(e, b, A, g), $ = ha(k), x = ga(e, R, $), F = r ? r(x, l) : x;
1758
- if (__INTLIFY_PROD_DEVTOOLS__) {
1759
- const y = {
1760
- timestamp: Date.now(),
1761
- key: W(l) ? l : Se(u) ? u.key : "",
1762
- locale: b || (Se(u) ? u.locale : ""),
1763
- format: W(u) ? u : Se(u) ? u.source : "",
1764
- message: F
1765
- };
1766
- y.meta = Ie({}, e.__meta, /* @__PURE__ */ aa() || {}), xs(y);
1767
- }
1768
- return F;
1769
- }
1770
- function ba(e) {
1771
- be(e.list) ? e.list = e.list.map((t) => W(t) ? cn(t) : t) : ee(e.named) && Object.keys(e.named).forEach((t) => {
1772
- W(e.named[t]) && (e.named[t] = cn(e.named[t]));
1773
- });
1774
- }
1775
- function sr(e, t, n, r, s, a) {
1776
- const { messages: m, onWarn: d, messageResolver: l, localeFallbacker: g } = e, N = g(e, r, n);
1777
- let C = ae(), T, j = null;
1778
- const D = "translate";
1779
- for (let L = 0; L < N.length && (T = N[L], C = m[T] || ae(), (j = l(C, t)) === null && (j = C[t]), !(W(j) || ot(j) || Se(j))); L++)
1780
- if (!ca(T, N)) {
1781
- const P = Kt(
1782
- e,
1783
- // eslint-disable-line @typescript-eslint/no-explicit-any
1784
- t,
1785
- T,
1786
- a,
1787
- D
1788
- );
1789
- P !== t && (j = P);
1790
- }
1791
- return [j, T, C];
1792
- }
1793
- function ar(e, t, n, r, s, a) {
1794
- const { messageCompiler: m, warnHtmlMessage: d } = e;
1795
- if (Se(r)) {
1796
- const g = r;
1797
- return g.locale = g.locale || n, g.key = g.key || t, g;
1798
- }
1799
- if (m == null) {
1800
- const g = () => r;
1801
- return g.locale = n, g.key = t, g;
1802
- }
1803
- const l = m(r, Ia(e, n, s, r, d, a));
1804
- return l.locale = n, l.key = t, l.source = r, l;
1805
- }
1806
- function ga(e, t, n) {
1807
- return t(n);
1808
- }
1809
- function Ut(...e) {
1810
- const [t, n, r] = e, s = ae();
1811
- if (!W(t) && !ge(t) && !Se(t) && !ot(t))
1812
- throw We(Ve.INVALID_ARGUMENT);
1813
- const a = ge(t) ? String(t) : (Se(t), t);
1814
- return ge(n) ? s.plural = n : W(n) ? s.default = n : q(n) && !Nt(n) ? s.named = n : be(n) && (s.list = n), ge(r) ? s.plural = r : W(r) ? s.default = r : q(r) && Ie(s, r), [a, s];
1815
- }
1816
- function Ia(e, t, n, r, s, a) {
1817
- return {
1818
- locale: t,
1819
- key: n,
1820
- warnHtmlMessage: s,
1821
- onError: (m) => {
1822
- throw a && a(m), m;
1823
- },
1824
- onCacheKey: (m) => xr(t, n, m)
1825
- };
1826
- }
1827
- function ya(e, t, n, r) {
1828
- const { modifiers: s, pluralRules: a, messageResolver: m, fallbackLocale: d, fallbackWarn: l, missingWarn: g, fallbackContext: N } = e, T = {
1829
- locale: t,
1830
- modifiers: s,
1831
- pluralRules: a,
1832
- messages: (j, D) => {
1833
- let L = m(n, j);
1834
- if (L == null && (N || D)) {
1835
- const [, , P] = sr(
1836
- N || e,
1837
- // NOTE: if has fallbackContext, fallback to root, else if use linked, fallback to local context
1838
- j,
1839
- t,
1840
- d,
1841
- l,
1842
- g
1843
- );
1844
- L = m(P, j);
1845
- }
1846
- if (W(L) || ot(L)) {
1847
- let P = !1;
1848
- const b = ar(e, j, t, L, j, () => {
1849
- P = !0;
1850
- });
1851
- return P ? On : b;
1852
- } else return Se(L) ? L : On;
1853
- }
1854
- };
1855
- return e.processor && (T.processor = e.processor), r.list && (T.list = r.list), r.named && (T.named = r.named), ge(r.plural) && (T.pluralIndex = r.plural), T;
1856
- }
1857
- bs();
1858
- var Ea = { env: { GITHUB_STATE: "/home/runner/work/_temp/_runner_file_commands/save_state_b3f69fc8-e2bf-44a4-89a8-9556b12e47eb", DOTNET_NOLOGO: "1", USER: "runner", npm_config_always_auth: "", npm_config_user_agent: "pnpm/10.8.0 npm/? node/v24.22.2 linux x64", CI: "true", USE_BAZEL_FALLBACK_VERSION: "silent:", RUNNER_ENVIRONMENT: "github-hosted", GITHUB_ENV: "/home/runner/work/_temp/_runner_file_commands/set_env_b3f69fc8-e2bf-44a4-89a8-9556b12e47eb", PIPX_HOME: "/opt/pipx", npm_node_execpath: "/opt/hostedtoolcache/node/24.22.2/x64/bin/node", NODE_AUTH_TOKEN: "XXXXX-XXXXX-XXXXX-XXXXX", SHLVL: "1", HCA_CLOUD_PROVIDER: "azure", HOME: "/home/runner", RUNNER_TEMP: "/home/runner/work/_temp", GITHUB_EVENT_PATH: "/home/runner/work/_temp/_github_workflow/event.json", npm_config_save_workspace_protocol: "true", JAVA_HOME_11_X64: "/usr/lib/jvm/temurin-11-jdk-amd64", PIPX_BIN_DIR: "/opt/pipx_bin", GITHUB_REPOSITORY_OWNER: "feedmepos", NODE_OPTIONS: "--max-old-space-size=10240", GRADLE_HOME: "/usr/share/gradle-9.9.1", ANDROID_NDK_LATEST_HOME: "/usr/local/lib/android/sdk/ndk/30.0.16248370", JAVA_HOME_21_X64: "/usr/lib/jvm/temurin-21-jdk-amd64", GITHUB_RETENTION_DAYS: "90", GITHUB_REPOSITORY_OWNER_ID: "54831515", POWERSHELL_DISTRIBUTION_CHANNEL: "GitHub-Actions-Linux", AZURE_EXTENSION_DIR: "/opt/az/azcliextensions", GITHUB_HEAD_REF: "", npm_config_userconfig: "/home/runner/work/_temp/.npmrc", SYSTEMD_EXEC_PID: "2407", ACTIONS_ORCHESTRATION_ID: "444f172d-0a40-4cf3-9eb8-c934ca5fc299.publish.publish.__default", npm_config_engine_strict: "true", GITHUB_GRAPHQL_URL: "https://api.github.com/graphql", JAVA_HOME_25_X64: "/usr/lib/jvm/temurin-25-jdk-amd64", NVM_DIR: "/home/runner/.nvm", npm_config_prefer_workspace_packages: "true", DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1", JAVA_HOME_17_X64: "/usr/lib/jvm/temurin-17-jdk-amd64", ImageVersion: "20261111.196.1", LOGNAME: "runner", RUNNER_OS: "Linux", GITHUB_API_URL: "https://api.github.com", GITHUB_ARTIFACTS: "/home/runner/work/_temp/_runner_file_commands/artifacts_b3f69fc8-e2bf-44a4-89a8-9556b12e47eb", SWIFT_PATH: "/usr/share/swift/usr/bin", CHROMEWEBDRIVER: "/usr/local/share/chromedriver-linux64", JOURNAL_STREAM: "10:15145", GITHUB_WORKFLOW: "Publish hrm-portal", _: "/home/runner/setup-pnpm/node_modules/.bin/pnpm", MEMORY_PRESSURE_WATCH: "/sys/fs/cgroup/system.slice/hosted-compute-agent.service/memory.pressure", GOROOT_1_24_X64: "/opt/hostedtoolcache/go/1.24.13/x64", npm_config_registry: "https://registry.npmjs.org/", ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE: "/opt/actionarchivecache", GOROOT_1_25_X64: "/opt/hostedtoolcache/go/1.25.14/x64", GITHUB_RUN_ID: "44223981202", GITHUB_REF_TYPE: "branch", BOOTSTRAP_HASKELL_NONINTERACTIVE: "1", GITHUB_WORKFLOW_SHA: "7689c15a2e550b40233aafb7ae26e6436f7d0417", GOROOT_1_26_X64: "/opt/hostedtoolcache/go/1.26.11/x64", GITHUB_BASE_REF: "", ImageOS: "ubuntu26", GITHUB_WORKFLOW_REF: "feedmepos/hrm-service/.github/workflows/publish-hrm-portal-trusted.yml@refs/heads/dev", ACTIONS_ID_TOKEN_REQUEST_TOKEN: "eyJhbGciOiJSUzI1NiIsImtpZCI6IjM4ODI2YjE3LTZhMzAtNWY5Yi1iMTY5LThiZWI4MjAyZjcyMyIsInR5cCI6IkpXVCIsIng1dCI6InlrTmFZNHFNX3RhNGsyVGdaT0NFWUxrY1lsQSJ9.eyJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJhYyI6Ilt7XCJTY29wZVwiOlwicmVmcy9oZWFkcy9kZXZcIixcIlBlcm1pc3Npb25cIjozfSx7XCJTY29wZVwiOlwicmVmcy9oZWFkcy9tYWluXCIsXCJQZXJtaXNzaW9uXCI6MX1dIiwiYWNzbCI6IjEwIiwiYXVkIjoidnNvOjZmOTZmYTg5LWI3YmYtNDg3OC1iYWQzLTg5ODAwNjU2NmI2ZSIsImJpbGxpbmdfb3duZXJfaWQiOiJFX2tnRE9BQUpvWVEiLCJleHAiOjE3OTQ5OTEzNDEsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcHJpbWFyeXNpZCI6ImRkZGRkZGRkLWRkZGQtZGRkZC1kZGRkLWRkZGRkZGRkZGRkZCIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL3NpZCI6ImRkZGRkZGRkLWRkZGQtZGRkZC1kZGRkLWRkZGRkZGRkZGRkZCIsImlhdCI6MTc5NDk2OTE0MSwiaXNzIjoiaHR0cHM6Ly90b2tlbi5hY3Rpb25zLmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImpvYl9pZCI6ImIxMGQwMWU5LTFlMzUtNTEwZS1hYzNjLTc5N2I5OWQzZmQ3NyIsImpvYl93b3JrZmxvd19yZWYiOiJmZWVkbWVwb3MvYWN0aW9ucy8uZ2l0aHViL3dvcmtmbG93cy9wdWJsaXNoLW5wbS1naXRodWIueWFtbEByZWZzL2hlYWRzL21haW4iLCJqb2Jfd29ya2Zsb3dfc2hhIjoiZjM0MmQ5OTc2NTQ2NGFlYzg3YTVjYmY0MTdiYWZjZGYyN2U0MjBiNSIsIm5hbWVpZCI6ImRkZGRkZGRkLWRkZGQtZGRkZC1kZGRkLWRkZGRkZGRkZGRkZCIsIm5iZiI6MTc5NDk2ODg0MSwib2lkY19leHRyYSI6IntcImFjdG9yXCI6XCJqdW4tbGVlLWZlZWRtZVwiLFwiYWN0b3JfaWRcIjpcIjIzOTI4Mjg2MlwiLFwiYmFzZV9yZWZcIjpcIlwiLFwiY2hlY2tfcnVuX2lkXCI6XCIxMzQ1MzI1NDk2MzJcIixcImV2ZW50X25hbWVcIjpcIndvcmtmbG93X2Rpc3BhdGNoXCIsXCJoZWFkX3JlZlwiOlwiXCIsXCJqb2Jfd29ya2Zsb3dfcmVmXCI6XCJmZWVkbWVwb3MvYWN0aW9ucy8uZ2l0aHViL3dvcmtmbG93cy9wdWJsaXNoLW5wbS1naXRodWIueWFtbEByZWZzL2hlYWRzL21haW5cIixcImpvYl93b3JrZmxvd19zaGFcIjpcImYzNDJkOTk3NjU0NjRhZWM4N2E1Y2JmNDE3YmFmY2RmMjdlNDIwYjVcIixcInJlZlwiOlwicmVmcy9oZWFkcy9kZXZcIixcInJlZl9wcm90ZWN0ZWRcIjpcImZhbHNlXCIsXCJyZWZfdHlwZVwiOlwiYnJhbmNoXCIsXCJyZXBvc2l0b3J5XCI6XCJmZWVkbWVwb3MvaHJtLXNlcnZpY2VcIixcInJlcG9zaXRvcnlfaWRcIjpcIjExMjQ2NzIyMzVcIixcInJlcG9zaXRvcnlfb3duZXJcIjpcImZlZWRtZXBvc1wiLFwicmVwb3NpdG9yeV9vd25lcl9pZFwiOlwiNTQ4MzE1MTVcIixcInJlcG9zaXRvcnlfdmlzaWJpbGl0eVwiOlwicHJpdmF0ZVwiLFwicnVuX2F0dGVtcHRcIjpcIjFcIixcInJ1bl9pZFwiOlwiNDQyMjM5ODEyMDJcIixcInJ1bl9udW1iZXJcIjpcIjI1MFwiLFwicnVubmVyX2Vudmlyb25tZW50XCI6XCJnaXRodWItaG9zdGVkXCIsXCJzaGFcIjpcIjc2ODljMTVhMmU1NTBiNDAyMzNhYWZiN2FlMjZlNjQzNmY3ZDA0MTdcIixcIndvcmtmbG93XCI6XCJQdWJsaXNoIGhybS1wb3J0YWxcIixcIndvcmtmbG93X3JlZlwiOlwiZmVlZG1lcG9zL2hybS1zZXJ2aWNlLy5naXRodWIvd29ya2Zsb3dzL3B1Ymxpc2gtaHJtLXBvcnRhbC10cnVzdGVkLnltbEByZWZzL2hlYWRzL2RldlwiLFwid29ya2Zsb3dfc2hhXCI6XCI3Njg5YzE1YTJlNTUwYjQwMjMzYWFmYjdhZTI2ZTY0MzZmN2QwNDE3XCJ9Iiwib2lkY19zdWIiOiJyZXBvOmZlZWRtZXBvcy9ocm0tc2VydmljZTpyZWY6cmVmcy9oZWFkcy9kZXYiLCJvcmNoX2lkIjoiNDQ0ZjE3MmQtMGE0MC00Y2YzLTllYjgtYzkzNGNhNWZjMjk5LnB1Ymxpc2gucHVibGlzaC5fX2RlZmF1bHQiLCJvd25lcl9pZCI6IkVfa2dET0FBSm9ZUSIsInBsYW5faWQiOiI0NDRmMTcyZC0wYTQwLTRjZjMtOWViOC1jOTM0Y2E1ZmMyOTkiLCJyZXBvc2l0b3J5X2lkIjoiMTEyNDY3MjIzNSIsInJlcG9zaXRvcnlfb3duZXJfaWQiOiI1NDgzMTUxNSIsInJlcG9zaXRvcnlfdmlzaWJpbGl0eSI6InByaXZhdGUiLCJydW5faWQiOiI0NDIyMzk4MTIwMiIsInJ1bl9udW1iZXIiOiIyNTAiLCJydW5fdHlwZSI6ImZ1bGwiLCJydW5uZXJfaWQiOiIxMDAwMjk2NTM4IiwicnVubmVyX3R5cGUiOiJob3N0ZWQiLCJzY3AiOiJBY3Rpb25zLlJlc3VsdHM6NDQ0ZjE3MmQtMGE0MC00Y2YzLTllYjgtYzkzNGNhNWZjMjk5OmIxMGQwMWU5LTFlMzUtNTEwZS1hYzNjLTc5N2I5OWQzZmQ3NyBBY3Rpb25zLlJ1bm5lcjo0NDRmMTcyZC0wYTQwLTRjZjMtOWViOC1jOTM0Y2E1ZmMyOTk6YjEwZDAxZTktMWUzNS01MTBlLWFjM2MtNzk3Yjk5ZDNmZDc3IEFjdGlvbnMuVXBsb2FkQXJ0aWZhY3RzOjQ0NGYxNzJkLTBhNDAtNGNmMy05ZWI4LWM5MzRjYTVmYzI5OTpiMTBkMDFlOS0xZTM1LTUxMGUtYWMzYy03OTdiOTlkM2ZkNzcgZ2VuZXJhdGVfaWRfdG9rZW46NDQ0ZjE3MmQtMGE0MC00Y2YzLTllYjgtYzkzNGNhNWZjMjk5OmIxMGQwMWU5LTFlMzUtNTEwZS1hYzNjLTc5N2I5OWQzZmQ3NyBBY3Rpb25zLkdlbmVyaWNSZWFkOjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCIsInNoYSI6Ijc2ODljMTVhMmU1NTBiNDAyMzNhYWZiN2FlMjZlNjQzNmY3ZDA0MTciLCJ0cnVzdF90aWVyIjoiMSJ9.IELVKPJoRzP13xq2ryj2cqG73C9aQSM_qCcE2TabPKfcF1JHnP8rarVJIzXP5RIayou8Ana7nxAIccMztuVyWavhsFFf0UzAUhSQ4yUkRRAxI0NHX0NVu5ShmSEcrQTdRaW-lK0g1JgxLQ9QK8cuV8EuYRJTvS-btrYA-Q8hmk0lV0ddeTZJajH7OSULiEX6ojD9CMst8blIfVMrgxFN3tOpBOEE1M6tlEL_2ThGVVGirwgdgFxiNWrFoViHi3BI07TjQzVuV4hmxbbgssnXXyfbWs91YuLCvKOC03Nks6ZIcd55XmMnEMfYfLhJD7chOFKznz4WWSr9gG79Kkntig", GITHUB_ACTION_REPOSITORY: "", ENABLE_RUNNER_TRACING: "true", npm_config_node_gyp: "/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js", PATH: "/home/runner/work/hrm-service/hrm-service/apps/hrm-portal/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules/pnpm/dist/node-gyp-bin:/home/runner/work/hrm-service/hrm-service/node_modules/.bin:/home/runner/work/hrm-service/hrm-service/apps/hrm-portal/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules/pnpm/dist/node-gyp-bin:/home/runner/work/hrm-service/hrm-service/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.bin:/opt/hostedtoolcache/node/24.22.2/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin", ANT_HOME: "/usr/share/ant", DOTNET_MULTILEVEL_LOOKUP: "0", RUNNER_TRACKING_ID: "github_a5bfd30b-2cd3-4511-9a6c-6cee09a03e3e", INVOCATION_ID: "a07bd56580104adbbf1901c4d1890ed8", NPM_CONFIG_USERCONFIG: "/home/runner/work/_temp/.npmrc", RUNNER_TOOL_CACHE: "/opt/hostedtoolcache", NODE: "/opt/hostedtoolcache/node/24.22.2/x64/bin/node", npm_package_name: "@feedmepos/mf-hrm-portal", GITHUB_ACTION: "__run_5", GITHUB_RUN_NUMBER: "250", GITHUB_TRIGGERING_ACTOR: "jun-lee-feedme", RUNNER_ARCH: "X64", XDG_RUNTIME_DIR: "/run/user/1001", AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache", npm_config_frozen_lockfile: "", LANG: "C.UTF-8", VCPKG_INSTALLATION_ROOT: "/usr/local/share/vcpkg", RUNNER_NAME: "GitHub Actions 1000296538", XDG_CONFIG_HOME: "/home/runner/.config", GITHUB_REF_NAME: "dev", GITHUB_REPOSITORY: "feedmepos/hrm-service", npm_lifecycle_script: "vite build --mode fmmf", ANDROID_NDK_ROOT: "/usr/local/lib/android/sdk/ndk/27.3.13750724", GITHUB_ACTION_REF: "", DEBIAN_FRONTEND: "noninteractive", SHELL: "/bin/bash", GITHUB_REPOSITORY_ID: "1124672235", GITHUB_ACTIONS: "true", NODE_PATH: "/home/runner/work/hrm-service/hrm-service/node_modules/.pnpm/vite@5.4.21_@types+node@18.19.130_sass-embedded@1.97.1_sass@1.97.1_terser@5.44.1/node_modules/vite/bin/node_modules:/home/runner/work/hrm-service/hrm-service/node_modules/.pnpm/vite@5.4.21_@types+node@18.19.130_sass-embedded@1.97.1_sass@1.97.1_terser@5.44.1/node_modules/vite/node_modules:/home/runner/work/hrm-service/hrm-service/node_modules/.pnpm/vite@5.4.21_@types+node@18.19.130_sass-embedded@1.97.1_sass@1.97.1_terser@5.44.1/node_modules:/home/runner/work/hrm-service/hrm-service/node_modules/.pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules/pnpm/bin/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules/pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules/pnpm/bin/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules/pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/node_modules", npm_package_version: "2.4.2-dev", npm_config_verify_deps_before_run: "false", npm_lifecycle_event: "build:mf", GITHUB_REF_PROTECTED: "false", GITHUB_WORKSPACE: "/home/runner/work/hrm-service/hrm-service", ACCEPT_EULA: "Y", GITHUB_JOB: "publish", npm_config_overrides: '{"proxy-addr":">=2.0.8 <3","@fastify/busboy":">=3.2.1 <4","@grpc/grpc-js":">=1.14.5 <2","brace-expansion@^2":"^2.1.6","js-yaml@^4":"^4.3.2","source-map-js":"^1.2.2","dompurify":">=3.4.17 <4","undici@^6":">=6.29.1 <7","body-parser@^1":">=1.20.9 <2","multer":">=2.5.0 <3","node-forge":">=1.4.1 <2","follow-redirects@^1.16":">=1.16.2 <2"}', npm_config_package_extensions: '{"@feedmepos/entity":{"dependencies":{"@feedmepos/core":"2.14.52"}}}', GITHUB_SHA: "7689c15a2e550b40233aafb7ae26e6436f7d0417", GITHUB_RUN_ATTEMPT: "1", ACTIONS_RUNNER_RETURN_JOB_RESULT_FOR_HOSTED: "1", GITHUB_REF: "refs/heads/dev", GITHUB_ACTOR: "jun-lee-feedme", ANDROID_SDK_ROOT: "/usr/local/lib/android/sdk", VITE_TARGET_ENV: "dev", GITHUB_PATH: "/home/runner/work/_temp/_runner_file_commands/add_path_b3f69fc8-e2bf-44a4-89a8-9556b12e47eb", JAVA_HOME: "/usr/lib/jvm/temurin-25-jdk-amd64", PWD: "/home/runner/work/hrm-service/hrm-service/apps/hrm-portal", GITHUB_ACTOR_ID: "239282862", RUNNER_WORKSPACE: "/home/runner/work/hrm-service", npm_config_link_workspace_packages: "true", npm_execpath: "/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules/pnpm/bin/pnpm.cjs", HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: "3650", GITHUB_EVENT_NAME: "workflow_dispatch", HOMEBREW_NO_AUTO_UPDATE: "1", ANDROID_HOME: "/usr/local/lib/android/sdk", GITHUB_SERVER_URL: "https://github.com", GECKOWEBDRIVER: "/usr/local/share/gecko_driver", ACTIONS_ID_TOKEN_REQUEST_URL: "https://run-actions-2-azure-eastus.actions.githubusercontent.com/151//idtoken/444f172d-0a40-4cf3-9eb8-c934ca5fc299/b10d01e9-1e35-510e-ac3c-797b99d3fd77?api-version=2.0", GHCUP_INSTALL_BASE_PREFIX: "/usr/local", GITHUB_OUTPUT: "/home/runner/work/_temp/_runner_file_commands/set_output_b3f69fc8-e2bf-44a4-89a8-9556b12e47eb", EDGEWEBDRIVER: "/usr/local/share/edge_driver", PNPM_SCRIPT_SRC_DIR: "/home/runner/work/hrm-service/hrm-service/apps/hrm-portal", npm_command: "run-script", ANDROID_NDK: "/usr/local/lib/android/sdk/ndk/27.3.13750724", GITHUB_ARTIFACTS_LIST: "/home/runner/work/_temp/_runner_file_commands/artifacts_list_b3f69fc8-e2bf-44a4-89a8-9556b12e47eb", SGX_AESM_ADDR: "1", PSModulePath: "/root/.local/share/powershell/Modules:/usr/local/share/powershell/Modules:/opt/microsoft/powershell/7/Modules:/usr/share/az_15.6.1", CHROME_BIN: "/usr/bin/google-chrome", SELENIUM_JAR_PATH: "/usr/share/java/selenium-server.jar", MEMORY_PRESSURE_WRITE: "c29tZSAyMDAwMDAgMjAwMDAwMAA=", PNPM_HOME: "/home/runner/setup-pnpm/node_modules/.bin", ANDROID_NDK_HOME: "/usr/local/lib/android/sdk/ndk/27.3.13750724", GITHUB_STEP_SUMMARY: "/home/runner/work/_temp/_runner_file_commands/step_summary_b3f69fc8-e2bf-44a4-89a8-9556b12e47eb", INIT_CWD: "/home/runner/work/hrm-service/hrm-service/apps/hrm-portal", NODE_ENV: "production" } };
1859
- const Na = "10.0.5";
1860
- function Ca() {
1861
- typeof __VUE_I18N_FULL_INSTALL__ != "boolean" && (ze().__VUE_I18N_FULL_INSTALL__ = !0), typeof __VUE_I18N_LEGACY_API__ != "boolean" && (ze().__VUE_I18N_LEGACY_API__ = !0), typeof __INTLIFY_DROP_MESSAGE_COMPILER__ != "boolean" && (ze().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1), typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" && (ze().__INTLIFY_PROD_DEVTOOLS__ = !1);
1862
- }
1863
- const lt = {
1864
- // composer module errors
1865
- UNEXPECTED_RETURN_TYPE: Ws,
1866
- // 24
1867
- // legacy module errors
1868
- INVALID_ARGUMENT: 25,
1869
- // i18n module errors
1870
- MUST_BE_CALL_SETUP_TOP: 26,
1871
- NOT_INSTALLED: 27,
1872
- NOT_INSTALLED_WITH_PROVIDE: 31,
1873
- // unexpected error
1874
- UNEXPECTED_ERROR: 32
1875
- };
1876
- function dt(e, ...t) {
1877
- return Ct(e, null, void 0);
1878
- }
1879
- const xt = /* @__PURE__ */ Qe("__translateVNode"), Vt = /* @__PURE__ */ Qe("__datetimeParts"), Wt = /* @__PURE__ */ Qe("__numberParts"), Ta = Qe("__setPluralRules"), or = /* @__PURE__ */ Qe("__injectWithOption"), Gt = /* @__PURE__ */ Qe("__dispose");
1880
- function mt(e) {
1881
- if (!ee(e))
1882
- return e;
1883
- for (const t in e)
1884
- if (Ae(e, t))
1885
- if (!t.includes("."))
1886
- ee(e[t]) && mt(e[t]);
1887
- else {
1888
- const n = t.split("."), r = n.length - 1;
1889
- let s = e, a = !1;
1890
- for (let m = 0; m < r; m++) {
1891
- if (n[m] in s || (s[n[m]] = ae()), !ee(s[n[m]])) {
1892
- a = !0;
1893
- break;
1894
- }
1895
- s = s[n[m]];
1896
- }
1897
- a || (s[n[r]] = e[t], delete e[t]), ee(s[n[r]]) && mt(s[n[r]]);
1898
- }
1899
- return e;
1900
- }
1901
- function lr(e, t) {
1902
- const { messages: n, __i18n: r, messageResolver: s, flatJson: a } = t, m = q(n) ? n : be(r) ? ae() : { [e]: ae() };
1903
- if (be(r) && r.forEach((d) => {
1904
- if ("locale" in d && "resource" in d) {
1905
- const { locale: l, resource: g } = d;
1906
- l ? (m[l] = m[l] || ae(), It(g, m[l])) : It(g, m);
1907
- } else
1908
- W(d) && It(JSON.parse(d), m);
1909
- }), s == null && a)
1910
- for (const d in m)
1911
- Ae(m, d) && mt(m[d]);
1912
- return m;
1913
- }
1914
- function ir(e) {
1915
- return e.type;
1916
- }
1917
- function Oa(e, t, n) {
1918
- let r = ee(t.messages) ? t.messages : ae();
1919
- "__i18nGlobal" in n && (r = lr(e.locale.value, {
1920
- messages: r,
1921
- __i18n: n.__i18nGlobal
1922
- }));
1923
- const s = Object.keys(r);
1924
- s.length && s.forEach((a) => {
1925
- e.mergeLocaleMessage(a, r[a]);
1926
- });
1927
- {
1928
- if (ee(t.datetimeFormats)) {
1929
- const a = Object.keys(t.datetimeFormats);
1930
- a.length && a.forEach((m) => {
1931
- e.mergeDateTimeFormat(m, t.datetimeFormats[m]);
1932
- });
1933
- }
1934
- if (ee(t.numberFormats)) {
1935
- const a = Object.keys(t.numberFormats);
1936
- a.length && a.forEach((m) => {
1937
- e.mergeNumberFormat(m, t.numberFormats[m]);
1938
- });
1939
- }
1940
- }
1941
- }
1942
- function Ln(e) {
1943
- return ce(vr, null, e, 0);
1944
- }
1945
- const kn = "__INTLIFY_META__", An = () => [], Sa = () => !1;
1946
- let Rn = 0;
1947
- function Mn(e) {
1948
- return (t, n, r, s) => e(n, r, Bt() || void 0, s);
1949
- }
1950
- const La = /* @__NO_SIDE_EFFECTS__ */ () => {
1951
- const e = Bt();
1952
- let t = null;
1953
- return e && (t = ir(e)[kn]) ? { [kn]: t } : null;
1954
- };
1955
- function ka(e = {}) {
1956
- const { __root: t, __injectWithOption: n } = e, r = t === void 0, s = e.flatJson, a = on ? st : _r;
1957
- let m = pe(e.inheritLocale) ? e.inheritLocale : !0;
1958
- const d = a(
1959
- // prettier-ignore
1960
- t && m ? t.locale.value : W(e.locale) ? e.locale : Et
1961
- ), l = a(
1962
- // prettier-ignore
1963
- t && m ? t.fallbackLocale.value : W(e.fallbackLocale) || be(e.fallbackLocale) || q(e.fallbackLocale) || e.fallbackLocale === !1 ? e.fallbackLocale : d.value
1964
- ), g = a(lr(d.value, e)), N = a(q(e.datetimeFormats) ? e.datetimeFormats : { [d.value]: {} }), C = a(q(e.numberFormats) ? e.numberFormats : { [d.value]: {} });
1965
- let T = t ? t.missingWarn : pe(e.missingWarn) || yt(e.missingWarn) ? e.missingWarn : !0, j = t ? t.fallbackWarn : pe(e.fallbackWarn) || yt(e.fallbackWarn) ? e.fallbackWarn : !0, D = t ? t.fallbackRoot : pe(e.fallbackRoot) ? e.fallbackRoot : !0, L = !!e.fallbackFormat, P = me(e.missing) ? e.missing : null, f = me(e.missing) ? Mn(e.missing) : null, b = me(e.postTranslation) ? e.postTranslation : null, A = t ? t.warnHtmlMessage : pe(e.warnHtmlMessage) ? e.warnHtmlMessage : !0, u = !!e.escapeParameter;
1966
- const I = t ? t.modifiers : q(e.modifiers) ? e.modifiers : {};
1967
- let E = e.pluralRules || t && t.pluralRules, _;
1968
- _ = (() => {
1969
- r && gn(null);
1970
- const p = {
1971
- version: Na,
1972
- locale: d.value,
1973
- fallbackLocale: l.value,
1974
- messages: g.value,
1975
- modifiers: I,
1976
- pluralRules: E,
1977
- missing: f === null ? void 0 : f,
1978
- missingWarn: T,
1979
- fallbackWarn: j,
1980
- fallbackFormat: L,
1981
- unresolving: !0,
1982
- postTranslation: b === null ? void 0 : b,
1983
- warnHtmlMessage: A,
1984
- escapeParameter: u,
1985
- messageResolver: e.messageResolver,
1986
- messageCompiler: e.messageCompiler,
1987
- __meta: { framework: "vue" }
1988
- };
1989
- p.datetimeFormats = N.value, p.numberFormats = C.value, p.__datetimeFormatters = q(_) ? _.__datetimeFormatters : void 0, p.__numberFormatters = q(_) ? _.__numberFormatters : void 0;
1990
- const v = la(p);
1991
- return r && gn(v), v;
1992
- })(), it(_, d.value, l.value);
1993
- function k() {
1994
- return [
1995
- d.value,
1996
- l.value,
1997
- g.value,
1998
- N.value,
1999
- C.value
2000
- ];
2001
- }
2002
- const $ = K({
2003
- get: () => d.value,
2004
- set: (p) => {
2005
- d.value = p, _.locale = d.value;
2006
- }
2007
- }), x = K({
2008
- get: () => l.value,
2009
- set: (p) => {
2010
- l.value = p, _.fallbackLocale = l.value, it(_, d.value, p);
2011
- }
2012
- }), F = K(() => g.value), y = /* @__PURE__ */ K(() => N.value), w = /* @__PURE__ */ K(() => C.value);
2013
- function V() {
2014
- return me(b) ? b : null;
2015
- }
2016
- function O(p) {
2017
- b = p, _.postTranslation = p;
2018
- }
2019
- function G() {
2020
- return P;
2021
- }
2022
- function H(p) {
2023
- p !== null && (f = Mn(p)), P = p, _.missing = f;
2024
- }
2025
- const U = (p, v, Z, te, le, he) => {
2026
- k();
2027
- let Me;
2028
- try {
2029
- Ea.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__, r || (_.fallbackContext = t ? oa() : void 0), Me = p(_);
2030
- } finally {
2031
- __INTLIFY_PROD_DEVTOOLS__, r || (_.fallbackContext = void 0);
2032
- }
2033
- if (Z !== "translate exists" && // for not `te` (e.g `t`)
2034
- ge(Me) && Me === Tt || Z === "translate exists" && !Me) {
2035
- const [mr, bo] = v();
2036
- return t && D ? te(t) : le(mr);
2037
- } else {
2038
- if (he(Me))
2039
- return Me;
2040
- throw dt(lt.UNEXPECTED_RETURN_TYPE);
2041
- }
2042
- };
2043
- function J(...p) {
2044
- return U((v) => Reflect.apply(Sn, null, [v, ...p]), () => Ut(...p), "translate", (v) => Reflect.apply(v.t, v, [...p]), (v) => v, (v) => W(v));
2045
- }
2046
- function X(...p) {
2047
- const [v, Z, te] = p;
2048
- if (te && !ee(te))
2049
- throw dt(lt.INVALID_ARGUMENT);
2050
- return J(v, Z, Ie({ resolvedMessage: !0 }, te || {}));
2051
- }
2052
- function se(...p) {
2053
- return U((v) => Reflect.apply(yn, null, [v, ...p]), () => Pt(...p), "datetime format", (v) => Reflect.apply(v.d, v, [...p]), () => hn, (v) => W(v));
2054
- }
2055
- function Q(...p) {
2056
- return U((v) => Reflect.apply(Nn, null, [v, ...p]), () => jt(...p), "number format", (v) => Reflect.apply(v.n, v, [...p]), () => hn, (v) => W(v));
2057
- }
2058
- function fe(p) {
2059
- return p.map((v) => W(v) || ge(v) || pe(v) ? Ln(String(v)) : v);
2060
- }
2061
- const ve = {
2062
- normalize: fe,
2063
- interpolate: (p) => p,
2064
- type: "vnode"
2065
- };
2066
- function oe(...p) {
2067
- return U((v) => {
2068
- let Z;
2069
- const te = v;
2070
- try {
2071
- te.processor = ve, Z = Reflect.apply(Sn, null, [te, ...p]);
2072
- } finally {
2073
- te.processor = null;
2074
- }
2075
- return Z;
2076
- }, () => Ut(...p), "translate", (v) => v[xt](...p), (v) => [Ln(v)], (v) => be(v));
2077
- }
2078
- function ie(...p) {
2079
- return U((v) => Reflect.apply(Nn, null, [v, ...p]), () => jt(...p), "number format", (v) => v[Wt](...p), An, (v) => W(v) || be(v));
2080
- }
2081
- function Pe(...p) {
2082
- return U((v) => Reflect.apply(yn, null, [v, ...p]), () => Pt(...p), "datetime format", (v) => v[Vt](...p), An, (v) => W(v) || be(v));
2083
- }
2084
- function B(p) {
2085
- E = p, _.pluralRules = E;
2086
- }
2087
- function _e(p, v) {
2088
- return U(() => {
2089
- if (!p)
2090
- return !1;
2091
- const Z = W(v) ? v : d.value, te = je(Z), le = _.messageResolver(te, p);
2092
- return ot(le) || Se(le) || W(le);
2093
- }, () => [p], "translate exists", (Z) => Reflect.apply(Z.te, Z, [p, v]), Sa, (Z) => pe(Z));
2094
- }
2095
- function $e(p) {
2096
- let v = null;
2097
- const Z = zn(_, l.value, d.value);
2098
- for (let te = 0; te < Z.length; te++) {
2099
- const le = g.value[Z[te]] || {}, he = _.messageResolver(le, p);
2100
- if (he != null) {
2101
- v = he;
2102
- break;
2103
- }
2104
- }
2105
- return v;
2106
- }
2107
- function Ge(p) {
2108
- const v = $e(p);
2109
- return v ?? (t ? t.tm(p) || {} : {});
2110
- }
2111
- function je(p) {
2112
- return g.value[p] || {};
2113
- }
2114
- function Ue(p, v) {
2115
- if (s) {
2116
- const Z = { [p]: v };
2117
- for (const te in Z)
2118
- Ae(Z, te) && mt(Z[te]);
2119
- v = Z[p];
2120
- }
2121
- g.value[p] = v, _.messages = g.value;
2122
- }
2123
- function Ze(p, v) {
2124
- g.value[p] = g.value[p] || {};
2125
- const Z = { [p]: v };
2126
- if (s)
2127
- for (const te in Z)
2128
- Ae(Z, te) && mt(Z[te]);
2129
- v = Z[p], It(v, g.value[p]), _.messages = g.value;
2130
- }
2131
- function qe(p) {
2132
- return N.value[p] || {};
2133
- }
2134
- function o(p, v) {
2135
- N.value[p] = v, _.datetimeFormats = N.value, En(_, p, v);
2136
- }
2137
- function i(p, v) {
2138
- N.value[p] = Ie(N.value[p] || {}, v), _.datetimeFormats = N.value, En(_, p, v);
2139
- }
2140
- function c(p) {
2141
- return C.value[p] || {};
2142
- }
2143
- function h(p, v) {
2144
- C.value[p] = v, _.numberFormats = C.value, Cn(_, p, v);
2145
- }
2146
- function S(p, v) {
2147
- C.value[p] = Ie(C.value[p] || {}, v), _.numberFormats = C.value, Cn(_, p, v);
2148
- }
2149
- Rn++, t && on && (Mt(t.locale, (p) => {
2150
- m && (d.value = p, _.locale = p, it(_, d.value, l.value));
2151
- }), Mt(t.fallbackLocale, (p) => {
2152
- m && (l.value = p, _.fallbackLocale = p, it(_, d.value, l.value));
2153
- }));
2154
- const M = {
2155
- id: Rn,
2156
- locale: $,
2157
- fallbackLocale: x,
2158
- get inheritLocale() {
2159
- return m;
2160
- },
2161
- set inheritLocale(p) {
2162
- m = p, p && t && (d.value = t.locale.value, l.value = t.fallbackLocale.value, it(_, d.value, l.value));
2163
- },
2164
- get availableLocales() {
2165
- return Object.keys(g.value).sort();
2166
- },
2167
- messages: F,
2168
- get modifiers() {
2169
- return I;
2170
- },
2171
- get pluralRules() {
2172
- return E || {};
2173
- },
2174
- get isGlobal() {
2175
- return r;
2176
- },
2177
- get missingWarn() {
2178
- return T;
2179
- },
2180
- set missingWarn(p) {
2181
- T = p, _.missingWarn = T;
2182
- },
2183
- get fallbackWarn() {
2184
- return j;
2185
- },
2186
- set fallbackWarn(p) {
2187
- j = p, _.fallbackWarn = j;
2188
- },
2189
- get fallbackRoot() {
2190
- return D;
2191
- },
2192
- set fallbackRoot(p) {
2193
- D = p;
2194
- },
2195
- get fallbackFormat() {
2196
- return L;
2197
- },
2198
- set fallbackFormat(p) {
2199
- L = p, _.fallbackFormat = L;
2200
- },
2201
- get warnHtmlMessage() {
2202
- return A;
2203
- },
2204
- set warnHtmlMessage(p) {
2205
- A = p, _.warnHtmlMessage = p;
2206
- },
2207
- get escapeParameter() {
2208
- return u;
2209
- },
2210
- set escapeParameter(p) {
2211
- u = p, _.escapeParameter = p;
2212
- },
2213
- t: J,
2214
- getLocaleMessage: je,
2215
- setLocaleMessage: Ue,
2216
- mergeLocaleMessage: Ze,
2217
- getPostTranslationHandler: V,
2218
- setPostTranslationHandler: O,
2219
- getMissingHandler: G,
2220
- setMissingHandler: H,
2221
- [Ta]: B
2222
- };
2223
- return M.datetimeFormats = y, M.numberFormats = w, M.rt = X, M.te = _e, M.tm = Ge, M.d = se, M.n = Q, M.getDateTimeFormat = qe, M.setDateTimeFormat = o, M.mergeDateTimeFormat = i, M.getNumberFormat = c, M.setNumberFormat = h, M.mergeNumberFormat = S, M[or] = n, M[xt] = oe, M[Vt] = Pe, M[Wt] = ie, M;
2224
- }
2225
- const Qt = {
2226
- tag: {
2227
- type: [String, Object]
2228
- },
2229
- locale: {
2230
- type: String
2231
- },
2232
- scope: {
2233
- type: String,
2234
- // NOTE: avoid https://github.com/microsoft/rushstack/issues/1050
2235
- validator: (e) => e === "parent" || e === "global",
2236
- default: "parent"
2237
- /* ComponentI18nScope */
2238
- },
2239
- i18n: {
2240
- type: Object
2241
- }
2242
- };
2243
- function Aa({ slots: e }, t) {
2244
- return t.length === 1 && t[0] === "default" ? (e.default ? e.default() : []).reduce((r, s) => [
2245
- ...r,
2246
- // prettier-ignore
2247
- ...s.type === De ? s.children : [s]
2248
- ], []) : t.reduce((n, r) => {
2249
- const s = e[r];
2250
- return s && (n[r] = s()), n;
2251
- }, ae());
2252
- }
2253
- function cr() {
2254
- return De;
2255
- }
2256
- Ie({
2257
- keypath: {
2258
- type: String,
2259
- required: !0
2260
- },
2261
- plural: {
2262
- type: [Number, String],
2263
- validator: (e) => ge(e) || !isNaN(e)
2264
- }
2265
- }, Qt);
2266
- function Ra(e) {
2267
- return be(e) && !W(e[0]);
2268
- }
2269
- function ur(e, t, n, r) {
2270
- const { slots: s, attrs: a } = t;
2271
- return () => {
2272
- const m = { part: !0 };
2273
- let d = ae();
2274
- e.locale && (m.locale = e.locale), W(e.format) ? m.key = e.format : ee(e.format) && (W(e.format.key) && (m.key = e.format.key), d = Object.keys(e.format).reduce((T, j) => n.includes(j) ? Ie(ae(), T, { [j]: e.format[j] }) : T, ae()));
2275
- const l = r(e.value, m, d);
2276
- let g = [m.key];
2277
- be(l) ? g = l.map((T, j) => {
2278
- const D = s[T.type], L = D ? D({ [T.type]: T.value, index: j, parts: l }) : [T.value];
2279
- return Ra(L) && (L[0].key = `${T.type}-${j}`), L;
2280
- }) : W(l) && (g = [l]);
2281
- const N = Ie(ae(), a), C = W(e.tag) || ee(e.tag) ? e.tag : cr();
2282
- return Gn(C, N, g);
2283
- };
2284
- }
2285
- Ie({
2286
- value: {
2287
- type: Number,
2288
- required: !0
2289
- },
2290
- format: {
2291
- type: [String, Object]
2292
- }
2293
- }, Qt);
2294
- Ie({
2295
- value: {
2296
- type: [Number, Date],
2297
- required: !0
2298
- },
2299
- format: {
2300
- type: [String, Object]
2301
- }
2302
- }, Qt);
2303
- const Ma = /* @__PURE__ */ Qe("global-vue-i18n");
2304
- function Ot(e = {}) {
2305
- const t = Bt();
2306
- if (t == null)
2307
- throw dt(lt.MUST_BE_CALL_SETUP_TOP);
2308
- if (!t.isCE && t.appContext.app != null && !t.appContext.app.__VUE_I18N_SYMBOL__)
2309
- throw dt(lt.NOT_INSTALLED);
2310
- const n = wa(t), r = Fa(n), s = ir(t), a = Da(e, s);
2311
- if (a === "global")
2312
- return Oa(r, e, s), r;
2313
- if (a === "parent") {
2314
- let l = Pa(n, t, e.__useComponent);
2315
- return l == null && (l = r), l;
2316
- }
2317
- const m = n;
2318
- let d = m.__getInstance(t);
2319
- if (d == null) {
2320
- const l = Ie({}, e);
2321
- "__i18n" in s && (l.__i18n = s.__i18n), r && (l.__root = r), d = ka(l), m.__composerExtend && (d[Gt] = m.__composerExtend(d)), Ua(m, t, d), m.__setInstance(t, d);
2322
- }
2323
- return d;
2324
- }
2325
- function wa(e) {
2326
- const t = fr(e.isCE ? Ma : e.appContext.app.__VUE_I18N_SYMBOL__);
2327
- if (!t)
2328
- throw dt(e.isCE ? lt.NOT_INSTALLED_WITH_PROVIDE : lt.UNEXPECTED_ERROR);
2329
- return t;
2330
- }
2331
- function Da(e, t) {
2332
- return Nt(e) ? "__i18n" in t ? "local" : "global" : e.useScope ? e.useScope : "local";
2333
- }
2334
- function Fa(e) {
2335
- return e.mode === "composition" ? e.global : e.global.__composer;
2336
- }
2337
- function Pa(e, t, n = !1) {
2338
- let r = null;
2339
- const s = t.root;
2340
- let a = ja(t, n);
2341
- for (; a != null; ) {
2342
- const m = e;
2343
- if (e.mode === "composition")
2344
- r = m.__getInstance(a);
2345
- else if (__VUE_I18N_LEGACY_API__) {
2346
- const d = m.__getInstance(a);
2347
- d != null && (r = d.__composer, n && r && !r[or] && (r = null));
2348
- }
2349
- if (r != null || s === a)
2350
- break;
2351
- a = a.parent;
2352
- }
2353
- return r;
2354
- }
2355
- function ja(e, t = !1) {
2356
- return e == null ? null : t && e.vnode.ctx || e.parent;
2357
- }
2358
- function Ua(e, t, n) {
2359
- Wn(() => {
2360
- }, t), pr(() => {
2361
- const r = n;
2362
- e.__deleteInstance(t);
2363
- const s = r[Gt];
2364
- s && (s(), delete r[Gt]);
2365
- }, t);
2366
- }
2367
- Ca();
2368
- ta(Ps);
2369
- na(Qs);
2370
- ra(zn);
2371
- if (__INTLIFY_PROD_DEVTOOLS__) {
2372
- const e = ze();
2373
- e.__INTLIFY__ = !0, js(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
2374
- }
2375
- const vt = /* @__PURE__ */ Re({
2376
- __name: "InheritPermissionTooltip",
2377
- props: {
2378
- item: {
2379
- type: Object,
2380
- required: !0
2381
- }
2382
- },
2383
- setup(e) {
2384
- const { t } = Ot();
2385
- return (n, r) => {
2386
- const s = Fe("FmIcon"), a = Fe("FmTooltip");
2387
- return z(), Oe(a, {
2388
- variant: "plain",
2389
- placement: "right",
2390
- "z-index": 50
2391
- }, {
2392
- content: de(() => [
2393
- ue("div", null, Le(Y(t)("team.memberForm.permissions.inherited")), 1),
2394
- (z(!0), re(De, null, Ce(e.item.setNames, (m) => (z(), re("div", { key: m }, [
2395
- ue("div", null, "- " + Le(m), 1)
2396
- ]))), 128))
2397
- ]),
2398
- default: de(() => [
2399
- ce(s, {
2400
- name: "admin_panel_settings",
2401
- size: "sm",
2402
- class: "ml-1 text-fm-color-typo-info"
2403
- })
2404
- ]),
2405
- _: 1
2406
- });
2407
- };
2408
- }
2409
- });
2410
- function wn(e, t, n) {
2411
- const r = n.filter((d) => d !== "manage");
2412
- if (r.length === 0) return;
2413
- const s = e.findIndex((d) => d.subject === t && !d.inverted);
2414
- if (s < 0) return;
2415
- const a = new Set(e[s].actions), m = r.every((d) => a.has(d));
2416
- m && !a.has("manage") ? (a.add("manage"), e[s] = {
2417
- ...e[s],
2418
- actions: Array.from(a)
2419
- }) : !m && a.has("manage") && (a.delete("manage"), a.size === 0 ? e.splice(s, 1) : e[s] = {
2420
- ...e[s],
2421
- actions: Array.from(a)
2422
- });
2423
- }
2424
- const Dn = Object.values(wr), xa = {
2425
- read: "View",
2426
- create: "Duplicate",
2427
- update: "Edit"
2428
- };
2429
- function Va(e, t, n, r) {
2430
- const { t: s } = Ke(), { getFlagValue: a, getFlag: m } = Mr(), { isFoodCourt: d } = Yn(), l = K(() => {
2431
- var G;
2432
- const y = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Map();
2433
- for (const H of t.value) {
2434
- const U = H.category;
2435
- if (!U) continue;
2436
- const J = H.subject;
2437
- if (d.value) {
2438
- if (rn.has(J) && !sn.has(J)) continue;
2439
- } else if (sn.has(J) && !rn.has(J))
2440
- continue;
2441
- if (n.value.includes(H.subject) || H.showByFeatureFlag && ((G = m(H.showByFeatureFlag)) == null ? void 0 : G.enabled) === !1 && a(H.showByFeatureFlag) === "true")
2442
- continue;
2443
- y.has(U) || y.set(U, []);
2444
- const X = V.get(J) ?? 0;
2445
- V.set(J, X + 1), y.get(U).push({
2446
- label: s(`permissionSet.permissionLabels.${J}`, H.label),
2447
- value: J,
2448
- optionKey: `${J}::${X}`
2449
- }), w.has(J) || w.set(J, H);
2450
- }
2451
- return [...y.keys()].sort((H, U) => {
2452
- const J = Dn.indexOf(H), X = Dn.indexOf(U);
2453
- return J === -1 && X === -1 ? H.localeCompare(U) : J === -1 ? 1 : X === -1 ? -1 : J - X;
2454
- }).map((H) => {
2455
- const U = y.get(H), J = s(`permissionSet.categoryLabels.${H}`, H), X = /* @__PURE__ */ new Map();
2456
- for (const B of U) {
2457
- const _e = w.get(B.value);
2458
- _e && X.set(B.value, _e.actions);
2459
- }
2460
- const se = U.some((B) => {
2461
- const _e = X.get(B.value);
2462
- return _e && _e.length > 1;
2463
- }), Q = se ? [
2464
- ...new Set(
2465
- U.flatMap((B) => X.get(B.value) ?? []).filter((B) => B !== "manage")
2466
- )
2467
- ] : [], fe = /* @__PURE__ */ new Map();
2468
- for (const B of e.value)
2469
- U.some((_e) => _e.value === B.subject) && !B.inverted && fe.set(B.subject, new Set(B.actions));
2470
- const ye = se ? e.value.filter(
2471
- (B) => U.some((_e) => _e.value === B.subject) && !B.inverted && B.actions.includes("manage")
2472
- ).map((B) => B.subject) : e.value.filter((B) => U.some((_e) => _e.value === B.subject) && !B.inverted).map((B) => B.subject), ve = U.find((B) => {
2473
- var _e;
2474
- return (_e = w.get(B.value)) == null ? void 0 : _e.isCategoryCover;
2475
- }), oe = (ve == null ? void 0 : ve.value) ?? null, ie = oe ? fe.get(oe) ?? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set(), Pe = ie.has("manage");
2476
- return {
2477
- category: H,
2478
- label: J,
2479
- options: U,
2480
- selectedSubjects: ye,
2481
- isMultiAction: se,
2482
- actionColumns: Q,
2483
- permissionActionsMap: X,
2484
- selectedActionsMap: fe,
2485
- coverSubject: oe,
2486
- coverSelectedActions: ie,
2487
- coverCoversAll: Pe
2488
- };
2489
- });
2490
- });
2491
- function g(y, w) {
2492
- const V = l.value.find((Q) => Q.category === y), O = (V == null ? void 0 : V.options) ?? [], G = new Set(O.map((Q) => Q.value)), H = new Set(w), U = /* @__PURE__ */ new Map();
2493
- for (const Q of e.value)
2494
- G.has(Q.subject) && !Q.inverted && U.set(Q.subject, Q.conditions);
2495
- const J = V != null && V.coverSubject ? U.get(V.coverSubject) : void 0, X = /* @__PURE__ */ new Set(), se = t.value.flatMap(
2496
- ({ category: Q, showByFeatureFlag: fe, isCategoryCover: ye, ...ve }) => {
2497
- const oe = ve.subject;
2498
- if (!H.has(oe) || X.has(oe)) return [];
2499
- X.add(oe);
2500
- let ie;
2501
- return U.has(oe) ? ie = U.get(oe) : V != null && V.coverSubject && oe !== V.coverSubject && (ie = J), [
2502
- { ...ve, ...ie !== void 0 && { conditions: ie } }
2503
- ];
2504
- }
2505
- );
2506
- r("update:model-value", [
2507
- ...e.value.filter((Q) => !G.has(Q.subject)),
2508
- ...se
2509
- ]);
2510
- }
2511
- function N(y, w) {
2512
- return D(y, w) || I(y, w);
2513
- }
2514
- function C(y) {
2515
- return y.options.length > 0 && y.options.every((w) => N(y, w.value));
2516
- }
2517
- function T(y) {
2518
- return y.options.length === 0 || C(y) ? !1 : y.options.some(
2519
- (w) => N(y, w.value) || L(y, w.value).length > 0
2520
- );
2521
- }
2522
- function j(y) {
2523
- const w = new Set(y.options.map((O) => O.value)), V = e.value.filter((O) => !w.has(O.subject));
2524
- if (C(y))
2525
- r("update:model-value", V);
2526
- else {
2527
- const O = /* @__PURE__ */ new Map();
2528
- for (const J of e.value)
2529
- w.has(J.subject) && !J.inverted && O.set(J.subject, J.conditions);
2530
- const G = y.coverSubject ? O.get(y.coverSubject) : void 0, H = /* @__PURE__ */ new Set(), U = t.value.flatMap(
2531
- ({ category: J, showByFeatureFlag: X, isCategoryCover: se, ...Q }) => {
2532
- const fe = Q.subject;
2533
- if (!w.has(fe) || H.has(fe)) return [];
2534
- H.add(fe);
2535
- let ye;
2536
- return O.has(fe) ? ye = O.get(fe) : y.coverSubject && fe !== y.coverSubject && (ye = G), [
2537
- { ...Q, ...ye !== void 0 && { conditions: ye } }
2538
- ];
2539
- }
2540
- );
2541
- r("update:model-value", [...V, ...U]);
2542
- }
2543
- }
2544
- function D(y, w) {
2545
- const V = y.selectedActionsMap.get(w);
2546
- return V ? V.has("manage") : !1;
2547
- }
2548
- function L(y, w) {
2549
- const V = y.permissionActionsMap.get(w);
2550
- return V ? V.filter((G) => G !== "manage").filter(
2551
- (G) => u(y, w, G) || E(y, w, G)
2552
- ) : [];
2553
- }
2554
- function P(y, w) {
2555
- return I(y, w) ? !1 : !D(y, w) && L(y, w).length > 0;
2556
- }
2557
- function f(y, w) {
2558
- if (!y.coverSubject || w === y.coverSubject) return;
2559
- const V = e.value.find(
2560
- (O) => !O.inverted && O.subject === y.coverSubject
2561
- );
2562
- return (V == null ? void 0 : V.conditions) || void 0;
2563
- }
2564
- function b(y, w, V) {
2565
- if (V) {
2566
- const O = t.value.find((Q) => Q.subject === w);
2567
- if (!O) return;
2568
- const {
2569
- category: G,
2570
- showByFeatureFlag: H,
2571
- isCategoryCover: U,
2572
- ...J
2573
- } = O, X = f(y, w), se = e.value.filter((Q) => Q.subject !== w);
2574
- se.push({
2575
- ...J,
2576
- ...X !== void 0 && { conditions: X }
2577
- }), r("update:model-value", se);
2578
- } else
2579
- r(
2580
- "update:model-value",
2581
- e.value.filter((O) => O.subject !== w)
2582
- );
2583
- }
2584
- function A(y, w) {
2585
- const V = y.permissionActionsMap.get(w);
2586
- return V ? V.some((O) => O !== "manage") : !1;
2587
- }
2588
- function u(y, w, V) {
2589
- const O = y.selectedActionsMap.get(w);
2590
- return O ? O.has(V) : !1;
2591
- }
2592
- function I(y, w) {
2593
- return !y.coverSubject || w === y.coverSubject ? !1 : y.coverCoversAll;
2594
- }
2595
- function E(y, w, V) {
2596
- return !y.coverSubject || w === y.coverSubject ? !1 : y.coverCoversAll ? !0 : y.coverSelectedActions.has(V);
2597
- }
2598
- function _(y, w, V) {
2599
- const O = y.permissionActionsMap.get(w);
2600
- return O ? O.includes(V) : !1;
2601
- }
2602
- function R(y, w, V) {
2603
- const O = [...e.value], G = O.findIndex((U) => U.subject === y && !U.inverted);
2604
- if (V)
2605
- if (G >= 0) {
2606
- const U = { ...O[G] }, J = new Set(U.actions);
2607
- J.add(w), U.actions = Array.from(J), O[G] = U;
2608
- } else {
2609
- const U = t.value.find((ve) => ve.subject === y);
2610
- if (!U) return;
2611
- const {
2612
- category: J,
2613
- showByFeatureFlag: X,
2614
- isCategoryCover: se,
2615
- ...Q
2616
- } = U, fe = l.value.find(
2617
- (ve) => ve.options.some((oe) => oe.value === y)
2618
- ), ye = fe ? f(fe, y) : void 0;
2619
- O.push({
2620
- ...Q,
2621
- actions: [w],
2622
- ...ye !== void 0 && { conditions: ye }
2623
- });
2624
- }
2625
- else if (G >= 0) {
2626
- const U = { ...O[G] }, J = U.actions.filter((X) => X !== w);
2627
- J.length === 0 ? O.splice(G, 1) : (U.actions = J, O[G] = U);
2628
- }
2629
- const H = t.value.find((U) => U.subject === y);
2630
- H && wn(O, y, H.actions), r("update:model-value", O);
2631
- }
2632
- function k(y, w) {
2633
- const V = y.options.filter(
2634
- (O) => _(y, O.value, w)
2635
- );
2636
- return V.length === 0 ? !1 : V.every(
2637
- (O) => u(y, O.value, w) || E(y, O.value, w)
2638
- );
2639
- }
2640
- function $(y, w) {
2641
- const V = y.options.filter(
2642
- (G) => _(y, G.value, w)
2643
- );
2644
- if (V.length === 0) return !1;
2645
- const O = V.filter(
2646
- (G) => u(y, G.value, w) || E(y, G.value, w)
2647
- ).length;
2648
- return O > 0 && O < V.length;
2649
- }
2650
- function x(y, w, V) {
2651
- const O = [...e.value];
2652
- for (const G of y.options) {
2653
- if (!_(y, G.value, w)) continue;
2654
- const H = G.value, U = O.findIndex(
2655
- (X) => X.subject === H && !X.inverted
2656
- );
2657
- if (V)
2658
- if (U >= 0) {
2659
- const X = { ...O[U] }, se = new Set(X.actions);
2660
- se.add(w), X.actions = Array.from(se), O[U] = X;
2661
- } else {
2662
- const X = t.value.find((oe) => oe.subject === H);
2663
- if (!X) continue;
2664
- const {
2665
- category: se,
2666
- showByFeatureFlag: Q,
2667
- isCategoryCover: fe,
2668
- ...ye
2669
- } = X, ve = f(y, H);
2670
- O.push({
2671
- ...ye,
2672
- actions: [w],
2673
- ...ve !== void 0 && { conditions: ve }
2674
- });
2675
- }
2676
- else if (U >= 0) {
2677
- const X = { ...O[U] }, se = X.actions.filter((Q) => Q !== w);
2678
- se.length === 0 ? O.splice(U, 1) : (X.actions = se, O[U] = X);
2679
- }
2680
- const J = t.value.find((X) => X.subject === H);
2681
- J && wn(O, H, J.actions);
2682
- }
2683
- r("update:model-value", O);
2684
- }
2685
- function F(y) {
2686
- const w = `permissionSet.actionLabels.${y}`, V = xa[y] ?? y.charAt(0).toUpperCase() + y.slice(1);
2687
- return s(w, V);
2688
- }
2689
- return {
2690
- categoryGroups: l,
2691
- toggleCategory: g,
2692
- isAllManageChecked: C,
2693
- isAllManageIndeterminate: T,
2694
- toggleAllManage: j,
2695
- isManageChecked: D,
2696
- isManageIndeterminate: P,
2697
- toggleManage: b,
2698
- hasNonManageActions: A,
2699
- isActionChecked: u,
2700
- isRowFullyCoveredByCover: I,
2701
- isActionCoveredByCover: E,
2702
- permissionDefinesAction: _,
2703
- toggleAction: R,
2704
- isAllActionChecked: k,
2705
- isAllActionIndeterminate: $,
2706
- toggleAllAction: x,
2707
- actionLabel: F
2708
- };
2709
- }
2710
- const Wa = { class: "flex flex-col gap-16" }, Ga = { class: "mt-16" }, Za = { class: "text-center text-sm font-semibold text-fm-color-typo-primary" }, Ba = ["onClick"], Ya = { class: "flex justify-center" }, Xa = { class: "flex items-center min-w-0 gap-8" }, Ha = ["title", "onClick"], Ja = { class: "flex justify-center" }, $a = /* @__PURE__ */ Re({
2711
- __name: "BasePermission",
2712
- props: {
2713
- modelValue: {
2714
- type: Array,
2715
- required: !0
2716
- },
2717
- disable: {
2718
- type: Boolean,
2719
- default: !1
2720
- },
2721
- excludedSubjects: {
2722
- type: Array,
2723
- required: !0
2724
- },
2725
- additionalPermissions: {
2726
- type: Array,
2727
- default: () => []
2728
- },
2729
- /** 'leading': the member sheet's layout, collapsed with the count under each category. */
2730
- layout: {
2731
- type: String,
2732
- default: "trailing"
2733
- }
2734
- },
2735
- emits: ["update:model-value"],
2736
- setup(e, { emit: t }) {
2737
- const n = e, r = t, { t: s } = Ke(), a = K(() => [...Zn, ...n.additionalPermissions]), {
2738
- categoryGroups: m,
2739
- isAllManageChecked: d,
2740
- isAllManageIndeterminate: l,
2741
- toggleAllManage: g,
2742
- isManageChecked: N,
2743
- isManageIndeterminate: C,
2744
- toggleManage: T,
2745
- isActionChecked: j,
2746
- isRowFullyCoveredByCover: D,
2747
- isActionCoveredByCover: L,
2748
- permissionDefinesAction: P,
2749
- toggleAction: f,
2750
- isAllActionChecked: b,
2751
- isAllActionIndeterminate: A,
2752
- toggleAllAction: u,
2753
- actionLabel: I
2754
- } = Va(
2755
- qt(n, "modelValue"),
2756
- a,
2757
- qt(n, "excludedSubjects"),
2758
- (R, k) => r("update:model-value", k)
2759
- );
2760
- function E(R) {
2761
- const k = R.selectedSubjects.length;
2762
- return k === 0 && n.layout !== "leading" ? "" : s("team.memberForm.permissions.allowedCount", { count: k });
2763
- }
2764
- function _(R, k) {
2765
- return N(R, k) || D(R, k) ? !0 : R.actionColumns.some(
2766
- ($) => P(R, k, $) && (j(R, k, $) || L(R, k, $))
2767
- );
2768
- }
2769
- return (R, k) => {
2770
- const $ = Fe("FmCheckbox");
2771
- return z(), re("div", Wa, [
2772
- (z(!0), re(De, null, Ce(Y(m), (x) => (z(), Oe(Yt, {
2773
- key: x.category,
2774
- subtitle: E(x),
2775
- layout: e.layout,
2776
- "initially-collapsed": e.layout === "leading"
2777
- }, {
2778
- title: de(() => [
2779
- ue("p", {
2780
- class: Ne(e.layout === "leading" ? "text-[18px] font-semibold leading-[24px] tracking-[-0.27px]" : "fm-typo-en-title-sm-600")
2781
- }, Le(x.label), 3)
2782
- ]),
2783
- default: de(() => [
2784
- ue("div", Ga, [
2785
- ue("div", {
2786
- class: "grid items-center px-12 py-8",
2787
- style: rt({
2788
- gridTemplateColumns: `minmax(0, 1fr) repeat(${x.actionColumns.length + 1}, 80px)`
2789
- })
2790
- }, [
2791
- k[0] || (k[0] = ue("div", null, null, -1)),
2792
- ue("div", Za, Le(Y(s)("team.memberForm.permissions.columnManage")), 1),
2793
- (z(!0), re(De, null, Ce(x.actionColumns, (F) => (z(), re("div", {
2794
- key: `header-${F}`,
2795
- class: "text-center text-sm font-semibold text-fm-color-typo-primary"
2796
- }, Le(Y(I)(F)), 1))), 128))
2797
- ], 4),
2798
- ue("div", {
2799
- class: "grid items-center bg-fm-color-neutral-gray-100 px-12 py-8",
2800
- style: rt({
2801
- gridTemplateColumns: `minmax(0, 1fr) repeat(${x.actionColumns.length + 1}, 80px)`
2802
- })
2803
- }, [
2804
- ue("div", {
2805
- class: "cursor-pointer font-semibold",
2806
- onClick: (F) => !e.disable && Y(g)(x)
2807
- }, Le(Y(s)("team.labels.all")), 9, Ba),
2808
- ue("div", Ya, [
2809
- ce($, {
2810
- "model-value": Y(d)(x),
2811
- indeterminate: Y(l)(x),
2812
- value: !0,
2813
- disabled: e.disable,
2814
- size: "sm",
2815
- dense: "",
2816
- "onUpdate:modelValue": (F) => Y(g)(x)
2817
- }, null, 8, ["model-value", "indeterminate", "disabled", "onUpdate:modelValue"])
2818
- ]),
2819
- (z(!0), re(De, null, Ce(x.actionColumns, (F) => (z(), re("div", {
2820
- key: `all-${F}`,
2821
- class: "flex justify-center"
2822
- }, [
2823
- ce($, {
2824
- "model-value": Y(b)(x, F),
2825
- indeterminate: Y(A)(x, F),
2826
- value: F,
2827
- disabled: e.disable,
2828
- size: "sm",
2829
- dense: "",
2830
- "onUpdate:modelValue": (y) => Y(u)(x, F, y)
2831
- }, null, 8, ["model-value", "indeterminate", "value", "disabled", "onUpdate:modelValue"])
2832
- ]))), 128))
2833
- ], 4),
2834
- k[1] || (k[1] = ue("div", { class: "h-px bg-fm-color-neutral-gray-200" }, null, -1)),
2835
- (z(!0), re(De, null, Ce(x.options, (F) => (z(), re("div", {
2836
- key: F.optionKey,
2837
- class: "grid items-center rounded px-12 py-8 transition-colors hover:bg-fm-color-neutral-gray-100",
2838
- style: rt({
2839
- gridTemplateColumns: `minmax(0, 1fr) repeat(${x.actionColumns.length + 1}, 80px)`
2840
- })
2841
- }, [
2842
- ue("div", Xa, [
2843
- ue("span", {
2844
- class: "block truncate cursor-pointer",
2845
- title: F.label,
2846
- onClick: (y) => !e.disable && !Y(D)(x, F.value) && Y(T)(x, F.value, !Y(N)(x, F.value))
2847
- }, Le(F.label), 9, Ha),
2848
- ke(R.$slots, `checkbox-${F.value}-append`, {
2849
- option: F,
2850
- isEffectiveSelected: _(x, F.value),
2851
- isCoveredByCover: Y(D)(x, F.value) || x.actionColumns.some((y) => Y(L)(x, F.value, y))
2852
- }),
2853
- ke(R.$slots, `checkbox-${F.value}-icon`, {
2854
- option: F,
2855
- isEffectiveSelected: _(x, F.value),
2856
- isCoveredByCover: Y(D)(x, F.value) || x.actionColumns.some((y) => Y(L)(x, F.value, y))
2857
- })
2858
- ]),
2859
- ue("div", Ja, [
2860
- ce($, {
2861
- "model-value": Y(N)(x, F.value) || Y(D)(x, F.value),
2862
- value: F.value,
2863
- disabled: e.disable || Y(D)(x, F.value),
2864
- indeterminate: Y(C)(x, F.value),
2865
- size: "sm",
2866
- "onUpdate:modelValue": (y) => Y(T)(x, F.value, y)
2867
- }, null, 8, ["model-value", "value", "disabled", "indeterminate", "onUpdate:modelValue"])
2868
- ]),
2869
- (z(!0), re(De, null, Ce(x.actionColumns, (y) => (z(), re("div", {
2870
- key: `${F.optionKey}-${y}`,
2871
- class: "flex justify-center"
2872
- }, [
2873
- Y(P)(x, F.value, y) ? (z(), Oe($, {
2874
- key: 0,
2875
- "model-value": Y(j)(x, F.value, y) || Y(L)(x, F.value, y),
2876
- value: y,
2877
- disabled: e.disable || Y(L)(x, F.value, y),
2878
- size: "sm",
2879
- "onUpdate:modelValue": (w) => Y(f)(F.value, y, w)
2880
- }, null, 8, ["model-value", "value", "disabled", "onUpdate:modelValue"])) : Te("", !0)
2881
- ]))), 128))
2882
- ], 4))), 128))
2883
- ])
2884
- ]),
2885
- _: 2
2886
- }, 1032, ["subtitle", "layout", "initially-collapsed"]))), 128))
2887
- ]);
2888
- };
2889
- }
2890
- }), za = { class: "space-y-16" }, Ka = {
2891
- key: 0,
2892
- class: "flex fm-typo-en-title-sm-600"
2893
- }, Qa = {
2894
- key: 0,
2895
- class: "q-mr-xs text-red col"
2896
- }, qa = { class: "form-input" }, eo = /* @__PURE__ */ Re({
2897
- __name: "AppForm",
2898
- props: {
2899
- title: {
2900
- type: String,
2901
- default: void 0
2902
- },
2903
- required: {
2904
- type: [Boolean, String],
2905
- default: !1
2906
- },
2907
- inline: {
2908
- type: Boolean,
2909
- default: !1
2910
- }
2911
- },
2912
- setup(e) {
2913
- const t = e;
2914
- return (n, r) => (z(), re("div", za, [
2915
- ke(n.$slots, "top", {}, () => [
2916
- t.title ? (z(), re("div", Ka, [
2917
- ue("div", null, [
2918
- t.required ? (z(), re("span", Qa, "*")) : Te("", !0),
2919
- hr(Le(t.title), 1)
2920
- ]),
2921
- ke(n.$slots, "title-right")
2922
- ])) : Te("", !0)
2923
- ]),
2924
- ue("div", qa, [
2925
- ke(n.$slots, "default")
2926
- ])
2927
- ]));
2928
- }
2929
- }), to = { class: "col flex items-center" }, no = {
2930
- key: 1,
2931
- class: "q-pa-sm form-error-message text-error"
2932
- }, dr = /* @__PURE__ */ Re({
2933
- __name: "CheckboxInput",
2934
- props: {
2935
- options: {
2936
- type: Array,
2937
- required: !0
2938
- },
2939
- title: {
2940
- type: String,
2941
- required: !0
2942
- },
2943
- modelValue: {
2944
- type: Array,
2945
- required: !0
2946
- },
2947
- showAllToggle: {
2948
- type: [Boolean, String],
2949
- default: !0
2950
- },
2951
- includeDisabledOptionsWhenSelectAll: {
2952
- type: Boolean,
2953
- default: !1
2954
- },
2955
- disable: {
2956
- type: Boolean,
2957
- default: !1
2958
- },
2959
- min: {
2960
- type: Number,
2961
- default: 0
2962
- },
2963
- max: {
2964
- type: Number,
2965
- default: void 0
2966
- },
2967
- showIntermediate: {
2968
- type: Boolean,
2969
- default: !0
2970
- },
2971
- gutter: {
2972
- type: Number,
2973
- default: void 0
2974
- },
2975
- falsyShowSlot: {
2976
- type: Boolean,
2977
- default: !1
2978
- },
2979
- bottomSlotIndent: {
2980
- type: String,
2981
- default: "36px"
2982
- },
2983
- alignCenter: {
2984
- type: Boolean,
2985
- default: !0
2986
- }
2987
- },
2988
- emits: ["update:model-value"],
2989
- setup(e, { emit: t }) {
2990
- const n = e, r = t, { t: s } = Ke(), a = st(!1), m = br(), d = K(() => n.modelValue.length < n.min ? `Min selection ${n.min}` : n.max !== void 0 && n.modelValue.length > n.max ? `Max selection ${n.max}` : !0), l = `checkbox-${Pr(6)}`, g = K(() => d.value !== !0), N = K(
2991
- () => n.modelValue.filter((L) => n.options.some((P) => P.value === L))
2992
- ), C = K(
2993
- () => typeof n.showAllToggle == "boolean" ? s("team.labels.all") : n.showAllToggle
2994
- ), T = K(() => n.options.length > 0 && n.options.length === N.value.length);
2995
- function j() {
2996
- const L = n.modelValue.filter((P) => !N.value.includes(P));
2997
- if (T.value === !0)
2998
- r("update:model-value", L);
2999
- else {
3000
- const P = n.includeDisabledOptionsWhenSelectAll ? n.options.map((f) => f.value) : n.options.filter((f) => !f.disabled).map((f) => f.value);
3001
- r("update:model-value", [...L, ...P]);
3002
- }
3003
- }
3004
- function D(L, P) {
3005
- let f = Hn(n.modelValue);
3006
- P ? f.every((b) => b !== L) && f.push(L) : f = f.filter((b) => b !== L), r("update:model-value", f);
3007
- }
3008
- return (L, P) => {
3009
- const f = Fe("FmCheckbox");
3010
- return z(), Oe(eo, {
3011
- id: l,
3012
- title: e.title,
3013
- required: !1
3014
- }, {
3015
- top: de(() => [
3016
- ke(L.$slots, "top")
3017
- ]),
3018
- default: de(() => [
3019
- n.showAllToggle ? (z(), Oe(f, {
3020
- key: 0,
3021
- "model-value": T.value,
3022
- disabled: e.disable,
3023
- label: C.value,
3024
- style: rt(`margin-bottom: ${n.gutter}px`),
3025
- size: "sm",
3026
- dense: "",
3027
- value: C.value,
3028
- "onUpdate:modelValue": j
3029
- }, null, 8, ["model-value", "disabled", "label", "style", "value"])) : Te("", !0),
3030
- (z(!0), re(De, null, Ce(e.options, (b, A) => (z(), re("div", {
3031
- key: b.value,
3032
- style: rt(`margin-bottom: ${A < e.options.length - 1 ? n.gutter : 0}px`),
3033
- class: Ne(A < e.options.length - 1 ? "q-mb-sm" : "")
3034
- }, [
3035
- ue("div", {
3036
- class: Ne(["row justify-between", e.alignCenter ? "items-center" : "items-start"])
3037
- }, [
3038
- ue("div", to, [
3039
- ce(f, {
3040
- "model-value": e.modelValue.includes(b.value),
3041
- disabled: e.disable || b.disabled,
3042
- size: "sm",
3043
- label: b.label,
3044
- value: b.label,
3045
- "onUpdate:modelValue": (u) => D(b.value, u)
3046
- }, null, 8, ["model-value", "disabled", "label", "value", "onUpdate:modelValue"]),
3047
- ke(L.$slots, `checkbox-${b.key || b.value}-append`, {
3048
- option: b,
3049
- selected: e.modelValue.includes(b.value)
3050
- })
3051
- ]),
3052
- Y(m)[`checkbox-${b.key || b.value}-end`] && (e.modelValue.includes(b.value) || e.falsyShowSlot) ? (z(), re("div", {
3053
- key: 0,
3054
- class: Ne([{ "q-checkbox disabled": e.disable || b.disabled }, "col"])
3055
- }, [
3056
- ke(L.$slots, `checkbox-${b.key || b.value}-end`, {
3057
- option: b,
3058
- value: e.modelValue.includes(b.value),
3059
- disable: e.disable || b.disabled
3060
- })
3061
- ], 2)) : Te("", !0)
3062
- ], 2),
3063
- Y(m)[`checkbox-${b.key || b.value}-bottom`] && (e.modelValue.includes(b.value) || e.falsyShowSlot) ? (z(), re("div", {
3064
- key: 0,
3065
- class: Ne(["q-mt-sm", { "q-checkbox disabled": e.disable || b.disabled }]),
3066
- style: rt(`margin-left: ${e.bottomSlotIndent}`)
3067
- }, [
3068
- ke(L.$slots, `checkbox-${b.key || b.value}-bottom`, {
3069
- option: b,
3070
- disable: e.disable || b.disabled,
3071
- value: e.modelValue.includes(b.value)
3072
- })
3073
- ], 6)) : Te("", !0)
3074
- ], 6))), 128)),
3075
- a.value && g.value ? (z(), re("div", no, Le(d.value), 1)) : Te("", !0)
3076
- ]),
3077
- _: 3
3078
- }, 8, ["title"]);
3079
- };
3080
- }
3081
- }), ht = "includedFuture", Fn = /* @__PURE__ */ Re({
3082
- __name: "ConditionPermission",
3083
- props: {
3084
- modelValue: {
3085
- type: Array,
3086
- default: null
3087
- },
3088
- options: {
3089
- type: Array,
3090
- required: !0
3091
- },
3092
- disable: {
3093
- type: Boolean,
3094
- default: !1
3095
- },
3096
- context: {
3097
- type: String,
3098
- required: !0
3099
- },
3100
- /** 'leading': the member sheet's layout, with the chosen names under the title. */
3101
- layout: {
3102
- type: String,
3103
- default: "trailing"
3104
- }
3105
- },
3106
- emits: ["update:model-value"],
3107
- setup(e, { emit: t }) {
3108
- const n = e, r = t, { t: s } = Ke(), a = K(() => [
3109
- {
3110
- label: s("team.memberForm.permissions.includedFuture", { context: n.context }),
3111
- value: ht,
3112
- // Can only be selected if all other options are selected
3113
- disabled: !!n.modelValue && n.options.length > n.modelValue.length
3114
- },
3115
- ...n.options.filter(
3116
- (N) => N.label.toLocaleLowerCase().includes(g.value.toLocaleLowerCase())
3117
- )
3118
- ]), m = K(() => n.modelValue ? n.modelValue : [ht, ...n.options.map((N) => N.value)]), d = K(() => {
3119
- if (n.layout === "leading") {
3120
- const C = n.modelValue ? n.options.filter((T) => n.modelValue.includes(T.value)).map((T) => T.label) : null;
3121
- return Jn(C, {
3122
- all: s("team.labels.all"),
3123
- none: s("team.labels.none"),
3124
- more: (T) => s("team.labels.more", { count: T })
3125
- });
3126
- }
3127
- const N = m.value.filter((C) => C !== ht).length;
3128
- return N === 0 ? "" : s("team.memberForm.permissions.allowedCount", { count: N });
3129
- });
3130
- function l(N) {
3131
- const C = N.length === a.value.length;
3132
- r("update:model-value", C ? null : N.filter((T) => T !== ht));
3133
- }
3134
- const g = st("");
3135
- return (N, C) => {
3136
- const T = Fe("fm-search");
3137
- return z(), Oe(Yt, {
3138
- subtitle: d.value,
3139
- layout: e.layout,
3140
- "initially-collapsed": e.layout === "leading"
3141
- }, {
3142
- title: de(() => [
3143
- ue("p", {
3144
- class: Ne(
3145
- e.layout === "leading" ? "text-[18px] font-semibold leading-[24px] tracking-[-0.27px]" : "fm-typo-en-title-sm-600"
3146
- )
3147
- }, Le(Y(s)("team.memberForm.permissions.manageable", { context: e.context })), 3)
3148
- ]),
3149
- default: de(() => [
3150
- e.options.length > 1 ? (z(), Oe(T, {
3151
- key: 0,
3152
- modelValue: g.value,
3153
- "onUpdate:modelValue": C[0] || (C[0] = (j) => g.value = j),
3154
- class: "mt-16",
3155
- placeholder: Y(s)("team.memberForm.permissions.search", { context: e.context })
3156
- }, null, 8, ["modelValue", "placeholder"])) : Te("", !0),
3157
- ce(dr, {
3158
- "model-value": m.value,
3159
- options: a.value,
3160
- "show-intermediate": !1,
3161
- "show-all-toggle": !0,
3162
- disable: e.disable,
3163
- "include-disabled-options-when-select-all": !0,
3164
- title: "",
3165
- class: "mt-16",
3166
- "onUpdate:modelValue": l
3167
- }, tt({ _: 2 }, [
3168
- Ce(a.value, (j) => ({
3169
- name: `checkbox-${j.value}-append`,
3170
- fn: de(({ option: D }) => [
3171
- ke(N.$slots, `checkbox-${j.value}-append`, { option: D })
3172
- ])
3173
- }))
3174
- ]), 1032, ["model-value", "options", "disable"])
3175
- ]),
3176
- _: 3
3177
- }, 8, ["subtitle", "layout", "initially-collapsed"]);
3178
- };
3179
- }
3180
- }), bt = "includedNewRole", ro = /* @__PURE__ */ Re({
3181
- __name: "PosRolePermission",
3182
- props: {
3183
- modelValue: {
3184
- type: Array,
3185
- default: null
3186
- },
3187
- roles: {
3188
- type: Array,
3189
- required: !0
3190
- },
3191
- restaurantIds: {
3192
- type: Array,
3193
- default: null
3194
- },
3195
- disable: {
3196
- type: Boolean,
3197
- default: !1
3198
- },
3199
- /** 'leading': the member sheet's layout, with the chosen roles under the title. */
3200
- layout: {
3201
- type: String,
3202
- default: "trailing"
3203
- }
3204
- },
3205
- emits: ["update:model-value"],
3206
- setup(e, { emit: t }) {
3207
- const n = e, r = t, { t: s } = Ke(), a = K(() => {
3208
- const g = n.restaurantIds;
3209
- return [
3210
- {
3211
- label: s("team.memberForm.permissions.includedNewRole"),
3212
- value: bt,
3213
- disabled: !!n.modelValue && n.roles.length > n.modelValue.length
3214
- },
3215
- ...n.roles.map((N) => ({
3216
- label: N.name,
3217
- value: N._id,
3218
- disabled: !!g && N.restaurants.every(({ id: C }) => !g.includes(C))
3219
- }))
3220
- ];
3221
- }), m = K(() => n.modelValue ? n.modelValue : [bt, ...n.roles.map((g) => g._id)]), d = K(() => {
3222
- if (n.layout === "leading") {
3223
- const N = n.modelValue ? n.roles.filter((C) => n.modelValue.includes(C._id)).map((C) => C.name) : null;
3224
- return Jn(N, {
3225
- all: s("team.labels.all"),
3226
- none: s("team.labels.none"),
3227
- more: (C) => s("team.labels.more", { count: C })
3228
- });
3229
- }
3230
- const g = m.value.filter((N) => N !== bt).length;
3231
- return g === 0 ? "" : s("team.memberForm.permissions.allowedCount", { count: g });
3232
- });
3233
- function l(g) {
3234
- const N = g.length === a.value.length;
3235
- r("update:model-value", N ? null : g.filter((C) => C !== bt));
3236
- }
3237
- return (g, N) => (z(), Oe(Yt, {
3238
- subtitle: d.value,
3239
- layout: e.layout,
3240
- "initially-collapsed": e.layout === "leading"
3241
- }, {
3242
- title: de(() => [
3243
- ue("p", {
3244
- class: Ne(
3245
- e.layout === "leading" ? "text-[18px] font-semibold leading-[24px] tracking-[-0.27px]" : "fm-typo-en-title-sm-600"
3246
- )
3247
- }, Le(Y(s)("team.memberForm.permissions.roles")), 3)
3248
- ]),
3249
- default: de(() => [
3250
- ce(dr, {
3251
- "model-value": m.value,
3252
- options: a.value,
3253
- "show-intermediate": !1,
3254
- "show-all-toggle": !1,
3255
- disable: e.disable,
3256
- title: "",
3257
- class: "mt-16",
3258
- "onUpdate:modelValue": l
3259
- }, tt({ _: 2 }, [
3260
- Ce(a.value, (C) => ({
3261
- name: `checkbox-${C.value}-append`,
3262
- fn: de(({ option: T }) => [
3263
- ke(g.$slots, `checkbox-${C.value}-append`, { option: T })
3264
- ])
3265
- }))
3266
- ]), 1032, ["model-value", "options", "disable"])
3267
- ]),
3268
- _: 3
3269
- }, 8, ["subtitle", "layout", "initially-collapsed"]));
3270
- }
3271
- }), so = {
3272
- key: 0,
3273
- class: "flex flex-col gap-8"
3274
- }, ao = {
3275
- key: 0,
3276
- class: "ml-32",
3277
- style: { "font-size": "12px", "line-height": "16px", color: "#8a8f98", "font-weight": "400" }
3278
- }, oo = {
3279
- key: 0,
3280
- class: "ml-32"
3281
- }, Pn = /* @__PURE__ */ Re({
3282
- __name: "PortalConditionForm",
3283
- props: {
3284
- entry: {},
3285
- builders: {},
3286
- subject: {},
3287
- timeZone: {},
3288
- coverOverride: {},
3289
- inheritModeFor: {},
3290
- formValueFor: {},
3291
- hasChanges: { type: Boolean },
3292
- disable: { type: Boolean, default: !1 },
3293
- fullWidth: { type: Boolean, default: !1 },
3294
- title: { default: "" }
3295
- },
3296
- emits: ["update-inherit-mode", "update-form", "apply"],
3297
- setup(e, { emit: t }) {
3298
- const n = t, { t: r } = Ke();
3299
- return (s, a) => {
3300
- const m = Fe("FmRadio"), d = Fe("FmRadioGroup");
3301
- return z(), Oe(Ar, {
3302
- title: e.title,
3303
- builders: e.builders,
3304
- "form-value-for": e.formValueFor,
3305
- "has-changes": e.hasChanges,
3306
- disable: e.disable,
3307
- "full-width": e.fullWidth,
3308
- onUpdateForm: a[0] || (a[0] = (l) => n("update-form", l)),
3309
- onApply: a[1] || (a[1] = (l) => n("apply"))
3310
- }, {
3311
- section: de(({ builder: l }) => [
3312
- e.coverOverride.shouldShowInheritToggle(e.entry, l) ? (z(), re("div", so, [
3313
- ce(d, {
3314
- "model-value": e.inheritModeFor(l),
3315
- disabled: e.disable,
3316
- "onUpdate:modelValue": (g) => n("update-inherit-mode", { builder: l, mode: g })
3317
- }, {
3318
- default: de(() => [
3319
- ue("div", null, [
3320
- ce(m, {
3321
- value: "inherit",
3322
- label: Y(r)("team.memberForm.permissions.conditionCover.inherit", {
3323
- cover: e.coverOverride.coverLabel(e.subject)
3324
- })
3325
- }, null, 8, ["label"]),
3326
- e.coverOverride.inheritedSummary(e.entry, l, e.timeZone) ? (z(), re("p", ao, " (" + Le(Y(r)(
3327
- e.coverOverride.inheritedSummary(e.entry, l, e.timeZone).labelKey,
3328
- e.coverOverride.inheritedSummary(e.entry, l, e.timeZone).params ?? {}
3329
- )) + ") ", 1)) : Te("", !0)
3330
- ]),
3331
- ce(m, {
3332
- value: "custom",
3333
- label: Y(r)("team.memberForm.permissions.conditionCover.custom")
3334
- }, null, 8, ["label"])
3335
- ]),
3336
- _: 2
3337
- }, 1032, ["model-value", "disabled", "onUpdate:modelValue"]),
3338
- e.inheritModeFor(l) === "custom" ? (z(), re("div", oo, [
3339
- ce(nn, {
3340
- builder: l,
3341
- "model-value": e.formValueFor(l),
3342
- disable: e.disable,
3343
- "onUpdate:modelValue": (g) => n("update-form", { builder: l, form: g })
3344
- }, null, 8, ["builder", "model-value", "disable", "onUpdate:modelValue"])
3345
- ])) : Te("", !0)
3346
- ])) : (z(), Oe(nn, {
3347
- key: 1,
3348
- builder: l,
3349
- "model-value": e.formValueFor(l),
3350
- disable: e.disable,
3351
- "onUpdate:modelValue": (g) => n("update-form", { builder: l, form: g })
3352
- }, null, 8, ["builder", "model-value", "disable", "onUpdate:modelValue"]))
3353
- ]),
3354
- _: 1
3355
- }, 8, ["title", "builders", "form-value-for", "has-changes", "disable", "full-width"]);
3356
- };
3357
- }
3358
- }), lo = {
3359
- async readWarehouses() {
3360
- return Dr(await Fr().get("/warehouses"));
3361
- }
3362
- };
3363
- function jn(e, t) {
3364
- return Bn(e, Xn).some(
3365
- (n) => n.subject === t && !n.inverted && n.actions.includes("manage")
3366
- );
3367
- }
3368
- function Un(e, t) {
3369
- return e.some((n) => n.subject === t && n.inverted) ? e : [...e, { subject: t, actions: ["manage"], inverted: !0 }];
3370
- }
3371
- function xn(e, t, n) {
3372
- const { category: r, showByFeatureFlag: s, isCategoryCover: a, ...m } = e;
3373
- return {
3374
- ...m,
3375
- actions: t,
3376
- ...n !== void 0 && { conditions: n }
3377
- };
3378
- }
3379
- function io(e, t, n, r) {
3380
- const s = new Set(
3381
- e.filter((l) => !l.inverted).map((l) => l.subject)
3382
- ), a = new Set(
3383
- t.filter((l) => !l.inverted).map((l) => l.subject)
3384
- ), m = new Set(
3385
- n.filter((l) => !l.inverted).map((l) => l.subject)
3386
- );
3387
- let d = [...n];
3388
- for (const l of s)
3389
- a.has(l) || (m.has(l) && (d = d.filter((N) => N.subject !== l)), (!m.has(l) || jn(d, l)) && (d = Un(d, l)));
3390
- for (const l of a)
3391
- if (!s.has(l)) {
3392
- const g = d.some((N) => N.subject === l && N.inverted);
3393
- if (d = d.filter((N) => !(N.subject === l && N.inverted)), !g && !m.has(l)) {
3394
- const N = t.find(
3395
- (T) => T.subject === l && !T.inverted
3396
- ), C = r(l);
3397
- C && N && d.push(xn(C, N.actions, N.conditions));
3398
- }
3399
- }
3400
- for (const l of a) {
3401
- if (!s.has(l)) continue;
3402
- const g = e.find((D) => D.subject === l && !D.inverted), N = t.find((D) => D.subject === l && !D.inverted);
3403
- if (!g || !N) continue;
3404
- const C = new Set(g.actions), T = new Set(N.actions);
3405
- if (C.size === T.size && [...C].every((D) => T.has(D)))
3406
- continue;
3407
- const j = d.findIndex((D) => D.subject === l && !D.inverted);
3408
- if (j >= 0)
3409
- d[j] = {
3410
- ...d[j],
3411
- actions: Array.from(T)
3412
- };
3413
- else {
3414
- const D = r(l);
3415
- D && d.push(xn(D, Array.from(T)));
3416
- }
3417
- C.has("manage") && !T.has("manage") && jn(d, l) && (d = Un(d, l)), !C.has("manage") && T.has("manage") && (d = d.filter((D) => !(D.subject === l && D.inverted)));
3418
- }
3419
- return d;
3420
- }
3421
- const co = {
3422
- MY: "Asia/Kuala_Lumpur",
3423
- SG: "Asia/Singapore",
3424
- TH: "Asia/Bangkok",
3425
- ID: "Asia/Jakarta",
3426
- MO: "Asia/Macau",
3427
- BN: "Asia/Brunei",
3428
- PK: "Asia/Karachi",
3429
- MV: "Indian/Maldives",
3430
- VN: "Asia/Ho_Chi_Minh",
3431
- JP: "Asia/Tokyo",
3432
- AU: "Australia/Sydney",
3433
- AE: "Asia/Dubai",
3434
- UK: "Europe/London"
3435
- };
3436
- function uo(e) {
3437
- const t = (e || "").toUpperCase();
3438
- return co[t] ?? Intl.DateTimeFormat().resolvedOptions().timeZone;
3439
- }
3440
- function mo(e, t) {
3441
- return e != null && e.timezone ? e.timezone : e != null && e.timeZone ? e.timeZone : uo((e == null ? void 0 : e.country) ?? t);
3442
- }
3443
- function gt(e, t) {
3444
- return `${e}::${t.builderKey}`;
3445
- }
3446
- function Xe(e) {
3447
- try {
3448
- return e.conditions ? JSON.parse(e.conditions) : void 0;
3449
- } catch {
3450
- return;
3451
- }
3452
- }
3453
- function fo(e, t) {
3454
- return e.find((n) => !n.inverted && n.subject === t);
3455
- }
3456
- function Rt(e, t) {
3457
- const n = new Set(e.actions);
3458
- return n.has(Ye.Action.manage) ? !0 : t.actions.every((r) => n.has(r));
3459
- }
3460
- function Zt(e, t) {
3461
- const n = Xe(e);
3462
- return wt(n, [{ builder: t, formValue: t.fromCondition(void 0) }]);
3463
- }
3464
- function Vn(e, t, n) {
3465
- return {
3466
- ...Zt(e, n),
3467
- ...nt(Xe(t), n)
3468
- };
3469
- }
3470
- function _o(e, t, n) {
3471
- const r = st(/* @__PURE__ */ new Set());
3472
- function s(u) {
3473
- return Nr(u, t.value);
3474
- }
3475
- function a(u) {
3476
- return t.value.find((I) => I.subject === u);
3477
- }
3478
- function m(u) {
3479
- var E;
3480
- const I = s(u);
3481
- return I ? (E = a(I)) == null ? void 0 : E.label : void 0;
3482
- }
3483
- function d(u) {
3484
- return fo(e.value, u);
3485
- }
3486
- function l(u, I) {
3487
- return nt(Xe(u), I);
3488
- }
3489
- function g(u, I) {
3490
- var R;
3491
- if (!(((R = I.appliesToActions) == null ? void 0 : R.call(I, u.actions)) ?? !0)) return !1;
3492
- const E = s(u.subject);
3493
- if (!E) return !1;
3494
- const _ = d(E);
3495
- return _ ? Object.keys(l(_, I)).length > 0 : !1;
3496
- }
3497
- function N(u, I) {
3498
- if (!g(u, I) || r.value.has(gt(u.subject, I))) return "custom";
3499
- if (u.index === null) return "inherit";
3500
- const E = e.value[u.index], _ = s(u.subject), R = _ ? d(_) : void 0;
3501
- if (E && R) {
3502
- const k = nt(Xe(E), I), $ = l(R, I);
3503
- if (JSON.stringify(k) === JSON.stringify($)) return "inherit";
3504
- }
3505
- return "custom";
3506
- }
3507
- function C(u, I, E) {
3508
- if (!I.summarizeForm) return;
3509
- const _ = s(u.subject);
3510
- if (!_) return;
3511
- const R = d(_);
3512
- if (!R) return;
3513
- const k = I.fromCondition(l(R, I));
3514
- return I.summarizeForm(k, { timeZone: E });
3515
- }
3516
- function T(u, I) {
3517
- if (u.index === null) return;
3518
- const E = [...e.value], _ = { ...E[u.index] }, R = Zt(_, I), k = Object.keys(R).length === 0, $ = s(u.subject), x = $ ? d($) : void 0, F = x ? Rt(x, _) : !1;
3519
- if (k && F)
3520
- E.splice(u.index, 1);
3521
- else if (x) {
3522
- const y = Vn(_, x, I);
3523
- Object.keys(y).length === 0 ? delete _.conditions : _.conditions = JSON.stringify(y), E[u.index] = _;
3524
- } else
3525
- k ? delete _.conditions : _.conditions = JSON.stringify(R), E[u.index] = _;
3526
- n(E);
3527
- }
3528
- function j(u, I, E) {
3529
- const _ = gt(u.subject, I);
3530
- if (E === "inherit") {
3531
- const k = new Set(r.value);
3532
- k.delete(_), r.value = k, T(u, I);
3533
- return;
3534
- }
3535
- const R = new Set(r.value);
3536
- R.add(_), r.value = R, u.index === null && b(u, I, I.fromCondition(void 0), {
3537
- forceCreateRule: !0
3538
- });
3539
- }
3540
- function D(u) {
3541
- const I = s(u);
3542
- if (!I) return [];
3543
- const E = d(I);
3544
- return (E == null ? void 0 : E.actions) ?? [];
3545
- }
3546
- function L(u, I) {
3547
- return e.value.filter((E) => {
3548
- if (E.inverted) return !1;
3549
- const _ = E.subject;
3550
- return _ === u || s(_) !== u ? !1 : r.value.has(gt(_, I)) ? !0 : Object.keys(nt(Xe(E), I)).length > 0;
3551
- });
3552
- }
3553
- function P(u, I) {
3554
- const E = `::${I.builderKey}`, _ = new Set(r.value);
3555
- for (const R of _) {
3556
- if (!R.endsWith(E)) continue;
3557
- const k = R.slice(0, -E.length);
3558
- s(k) === u && _.delete(R);
3559
- }
3560
- r.value = _;
3561
- }
3562
- function f(u, I, E) {
3563
- const _ = I.subject;
3564
- return u.reduce((R, k) => {
3565
- if (k.inverted)
3566
- return R.push(k), R;
3567
- const $ = k.subject;
3568
- if ($ === _ || s($) !== _)
3569
- return R.push(k), R;
3570
- if (Rt(I, k) && Object.keys(Zt(k, E)).length === 0)
3571
- return R;
3572
- const F = Vn(k, I, E);
3573
- if (Object.keys(F).length === 0) {
3574
- const { conditions: y, ...w } = k;
3575
- R.push(w);
3576
- } else
3577
- R.push({ ...k, conditions: JSON.stringify(F) });
3578
- return R;
3579
- }, []);
3580
- }
3581
- function b(u, I, E, _ = {}) {
3582
- var V;
3583
- const R = [...e.value];
3584
- let k = u.index;
3585
- const $ = I.toCondition(E), x = Object.keys($).length > 0;
3586
- if (k === null && !x && !_.forceCreateRule) return;
3587
- if (k === null) {
3588
- const O = R.findIndex((G) => !G.inverted && G.subject === u.subject);
3589
- if (O !== -1)
3590
- k = O;
3591
- else {
3592
- const G = t.value.find((se) => se.subject === u.subject);
3593
- if (!G) return;
3594
- const {
3595
- category: H,
3596
- showByFeatureFlag: U,
3597
- isCategoryCover: J,
3598
- ...X
3599
- } = G;
3600
- R.push({
3601
- ...X,
3602
- actions: u.actions.length > 0 ? u.actions : X.actions
3603
- }), k = R.length - 1;
3604
- }
3605
- }
3606
- const F = { ...R[k] };
3607
- F.actions = [
3608
- .../* @__PURE__ */ new Set([...F.actions, ...u.actions])
3609
- ];
3610
- const y = Xe(F), w = wt(y, [{ builder: I, formValue: E }]);
3611
- if (Object.keys(w).length === 0 ? delete F.conditions : F.conditions = JSON.stringify(w), R[k] = F, tn(u.subject, t.value)) {
3612
- const O = L(u.subject, I), G = () => {
3613
- var U;
3614
- P(u.subject, I), n(f(R, F, I)), (U = _.afterCommit) == null || U.call(_);
3615
- }, H = () => {
3616
- var U;
3617
- n(R), (U = _.afterCommit) == null || U.call(_);
3618
- };
3619
- if (O.length === 0) {
3620
- G();
3621
- return;
3622
- }
3623
- _.onOverridesConflict ? _.onOverridesConflict({ override: G, keep: H }) : H();
3624
- return;
3625
- }
3626
- n(R), (V = _.afterCommit) == null || V.call(_);
3627
- }
3628
- function A(u, I, E = {}) {
3629
- if (I.length === 0) return;
3630
- const _ = [...e.value];
3631
- let R = _.findIndex((O) => !O.inverted && O.subject === u.subject), k = R === -1 ? void 0 : { ..._[R] }, $ = Xe(k ?? {}) ?? {};
3632
- for (const O of I) {
3633
- const G = O.mode === "inherit" ? O.builder.fromCondition(void 0) : O.form;
3634
- $ = wt($, [{ builder: O.builder, formValue: G }]);
3635
- }
3636
- const x = I.some((O) => O.mode === "custom");
3637
- if (!k && (Object.keys($).length > 0 || x)) {
3638
- const O = t.value.find((X) => X.subject === u.subject);
3639
- if (!O) return;
3640
- const {
3641
- category: G,
3642
- showByFeatureFlag: H,
3643
- isCategoryCover: U,
3644
- ...J
3645
- } = O;
3646
- k = {
3647
- ...J,
3648
- actions: u.actions.length > 0 ? u.actions : J.actions
3649
- }, _.push(k), R = _.length - 1;
3650
- }
3651
- if (k) {
3652
- const O = s(u.subject), G = O ? d(O) : void 0;
3653
- if (!x && Object.keys($).length === 0 && !!G && Rt(G, k))
3654
- _.splice(R, 1), k = void 0;
3655
- else {
3656
- if (k.actions = [
3657
- .../* @__PURE__ */ new Set([...k.actions, ...u.actions])
3658
- ], G)
3659
- for (const U of I)
3660
- U.mode === "inherit" && ($ = {
3661
- ...$,
3662
- ...nt(Xe(G), U.builder)
3663
- });
3664
- Object.keys($).length === 0 ? delete k.conditions : k.conditions = JSON.stringify($), _[R] = k;
3665
- }
3666
- }
3667
- const F = () => {
3668
- const O = new Set(r.value);
3669
- for (const G of I) {
3670
- const H = gt(u.subject, G.builder);
3671
- G.mode === "custom" ? O.add(H) : O.delete(H);
3672
- }
3673
- r.value = O;
3674
- }, y = (O) => {
3675
- var G;
3676
- F(), n(O), (G = E.afterCommit) == null || G.call(E);
3677
- };
3678
- if (!tn(u.subject, t.value) || !k) {
3679
- y(_);
3680
- return;
3681
- }
3682
- const w = I.map((O) => O.builder).filter((O) => L(u.subject, O).length > 0), V = () => {
3683
- let O = _;
3684
- for (const G of I.map((H) => H.builder))
3685
- P(u.subject, G), O = f(O, k, G);
3686
- y(O);
3687
- };
3688
- if (w.length > 0 && E.onOverridesConflict) {
3689
- E.onOverridesConflict({ override: V, keep: () => y(_) });
3690
- return;
3691
- }
3692
- w.length > 0 ? y(_) : V();
3693
- }
3694
- return {
3695
- getCoverSubject: s,
3696
- coverLabel: m,
3697
- shouldShowInheritToggle: g,
3698
- inheritMode: N,
3699
- setInheritMode: j,
3700
- inheritedSummary: C,
3701
- getEffectiveActions: D,
3702
- updateBuilderCondition: b,
3703
- applyConditionDrafts: A
3704
- };
3705
- }
3706
- const po = { class: "h-[24px] w-[24px] flex items-center justify-center" }, vo = { class: "h-[24px] w-[24px] flex items-center justify-center" }, ho = "condition-form-select-menu", Ao = /* @__PURE__ */ Re({
3707
- __name: "PortalPermissionEditor",
3708
- props: /* @__PURE__ */ en({
3709
- disable: {
3710
- type: Boolean,
3711
- default: !1
3712
- },
3713
- inheritPermissions: {
3714
- type: Array,
3715
- default: () => []
3716
- },
3717
- /**
3718
- * 'all': every section in its own box (permission roles page).
3719
- * 'workplace': only manageable restaurant / warehouse / usable POS roles ("Where they work").
3720
- * 'portal': only the portal permission categories ("Portal access").
3721
- * The member sheet renders the two parts in separate cards over the same rules.
3722
- */
3723
- part: {
3724
- type: String,
3725
- default: "all"
3726
- }
3727
- }, {
3728
- modelValue: { default: () => [] },
3729
- modelModifiers: {}
3730
- }),
3731
- emits: /* @__PURE__ */ en(["permissionChanged"], ["update:modelValue"]),
3732
- setup(e, { emit: t }) {
3733
- const n = gr(e, "modelValue"), r = e, s = K(() => r.part === "all" ? "trailing" : "leading"), a = K(
3734
- () => r.part === "all" ? "p-16 fm-corner-radius-lg border border-fm-color-neutral-gray-200" : ""
3735
- ), m = t, { t: d } = Ke(), l = Ir(), g = yr(), { breakpoints: N } = Er(), C = K(() => N.value.xs || N.value.sm), {
3736
- fetchCustomReportPermissions: T,
3737
- customReportPermissions: j
3738
- } = Cr(), D = K(() => [
3739
- ...Zn,
3740
- ...j.value
3741
- ]), L = K(() => {
3742
- const c = l.currentBusiness.value, h = l.currentCountry.value, S = h instanceof Object ? h.code : h;
3743
- return mo(c, S);
3744
- });
3745
- function P(c) {
3746
- return D.value.find((h) => h.subject === c);
3747
- }
3748
- function f(c, h) {
3749
- return an(c).filter(
3750
- (S) => {
3751
- var M;
3752
- return ((M = S.appliesToActions) == null ? void 0 : M.call(S, h)) ?? !0;
3753
- }
3754
- );
3755
- }
3756
- const b = K(() => {
3757
- const c = D.value.filter((S) => !E.includes(S.subject)).map((S) => S.subject);
3758
- return Tr(
3759
- r.inheritPermissions.map((S) => ({
3760
- ...S,
3761
- permissions: S.permissions.filter((M) => c.includes(M.subject))
3762
- }))
3763
- ).map((S) => ({
3764
- id: S.subject,
3765
- setNames: S.setNames
3766
- }));
3767
- }), A = K(() => {
3768
- const c = r.inheritPermissions.map((h) => ({
3769
- ...h,
3770
- permissions: h.permissions.filter(
3771
- (S) => S.subject === Ye.Subject.Business.inventory_stock
3772
- )
3773
- }));
3774
- return St(
3775
- c,
3776
- "warehouseId",
3777
- R.value.map((h) => h._id)
3778
- );
3779
- }), u = K(() => {
3780
- const c = r.inheritPermissions.map((h) => ({
3781
- ...h,
3782
- permissions: h.permissions.filter(
3783
- (S) => S.subject === Ye.Subject.Restaurant.restaurant
3784
- )
3785
- }));
3786
- return St(
3787
- c,
3788
- "restaurantId",
3789
- F.value.map((h) => h._id)
3790
- );
3791
- }), I = K(() => {
3792
- const c = r.inheritPermissions.map((h) => ({
3793
- ...h,
3794
- permissions: h.permissions.filter((S) => S.subject === Ye.Subject.Business.role)
3795
- }));
3796
- return St(
3797
- c,
3798
- "roleId",
3799
- y.value.map((h) => h._id)
3800
- );
3801
- }), E = [...jr], _ = K(() => {
3802
- var h;
3803
- const c = (h = n.value) == null ? void 0 : h.find(
3804
- (S) => S.subject === Ye.Subject.Business.inventory_stock
3805
- );
3806
- return c ? c.conditions ? JSON.parse(c.conditions).warehouseId.$in : null : [];
3807
- }), R = st([]), k = K(() => R.value.map((c) => ({
3808
- label: c.profile.name,
3809
- value: c._id
3810
- })));
3811
- function $(c) {
3812
- const h = x(n.value, c);
3813
- n.value = h;
3814
- }
3815
- function x(c, h) {
3816
- let S = Hn(
3817
- c.filter((M) => M.subject !== Ye.Subject.Business.inventory_stock)
3818
- );
3819
- if (!h || h.length > 0) {
3820
- const M = {
3821
- actions: [Ye.Action.manage],
3822
- subject: Ye.Subject.Business.inventory_stock
3823
- };
3824
- h && (M.conditions = JSON.stringify({ warehouseId: { $in: h } })), S.push(M);
3825
- }
3826
- return S;
3827
- }
3828
- const { restaurants: F } = l, y = Ur().roles, w = K(() => F.value.map((c) => ({
3829
- label: `${c.profile.code ? c.profile.code + "-" : ""}${c.profile.name}`,
3830
- value: c._id
3831
- }))), V = K(() => F.value.reduce((c, h) => (c[h._id] = y.value.filter((S) => S.restaurants.some((M) => M.id === h._id)).map((S) => S._id), c), {})), O = K(() => Or(n.value));
3832
- function G(c) {
3833
- const h = U(n.value, c);
3834
- n.value = h;
3835
- }
3836
- const H = K(() => Sr(n.value));
3837
- function U(c, h) {
3838
- return Lr(c, h, {
3839
- restaurantRoles: V.value,
3840
- allRoleIds: y.value.map((S) => S._id)
3841
- });
3842
- }
3843
- function J(c) {
3844
- const h = X(n.value, c);
3845
- n.value = h;
3846
- }
3847
- function X(c, h) {
3848
- return kr(c, h);
3849
- }
3850
- const { isFoodCourt: se } = Yn();
3851
- Wn(async () => {
3852
- await Promise.all([
3853
- r.part !== "portal" && !se.value && lo.readWarehouses().then((c) => R.value = c),
3854
- T()
3855
- ]);
3856
- });
3857
- const Q = K(() => Bn(
3858
- n.value,
3859
- Xn
3860
- ).filter((S) => {
3861
- const M = S.source;
3862
- return (M == null ? void 0 : M.type) !== "systemPermissionSet" ? !0 : S.actions.includes("manage");
3863
- }).map((S) => {
3864
- if (S.inverted) return S;
3865
- const M = S.actions;
3866
- if (!M.includes("manage")) return S;
3867
- const p = P(S.subject);
3868
- if (!p) return S;
3869
- const v = p.actions;
3870
- return v.length <= 1 || v.filter((te) => !M.includes(te)).length === 0 ? S : { ...S, actions: [...v] };
3871
- }));
3872
- function fe(c) {
3873
- n.value = io(
3874
- Q.value,
3875
- c,
3876
- n.value,
3877
- P
3878
- );
3879
- }
3880
- const ye = K(() => new Set(
3881
- D.value.filter((c) => an(c.subject).length > 0).map((c) => c.subject)
3882
- )), ve = K(() => {
3883
- const c = /* @__PURE__ */ new Map();
3884
- return Q.value.map((h) => ({
3885
- rule: h,
3886
- index: n.value.findIndex(
3887
- (S) => !S.inverted && S.subject === h.subject
3888
- )
3889
- })).filter(({ rule: h }) => !h.inverted).forEach(({ rule: h, index: S }) => {
3890
- var Z;
3891
- const M = h.actions, p = f(h.subject, M);
3892
- if (p.length === 0) return;
3893
- let v;
3894
- try {
3895
- v = h.conditions ? JSON.parse(h.conditions) : void 0;
3896
- } catch {
3897
- v = void 0;
3898
- }
3899
- c.set(h.subject, {
3900
- index: S >= 0 ? S : null,
3901
- subject: h.subject,
3902
- label: ((Z = P(h.subject)) == null ? void 0 : Z.label) ?? h.subject,
3903
- actions: M,
3904
- // Each builder only ever sees its own slice of the stored condition.
3905
- sections: p.map((te) => ({
3906
- builder: te,
3907
- formValue: te.fromCondition(nt(v, te))
3908
- }))
3909
- });
3910
- }), c;
3911
- }), oe = _o(n, D, (c) => {
3912
- n.value = c;
3913
- }), ie = Rr(n), Pe = st(null);
3914
- function B(c, h) {
3915
- const S = ve.value.get(c);
3916
- if (S) return S;
3917
- const M = oe.getEffectiveActions(c), p = f(c, M);
3918
- if (p.length !== 0)
3919
- return {
3920
- index: null,
3921
- subject: c,
3922
- label: h,
3923
- actions: M,
3924
- sections: p.map((v) => ({
3925
- builder: v,
3926
- formValue: v.fromCondition(void 0)
3927
- }))
3928
- };
3929
- }
3930
- function _e(c, h) {
3931
- const S = ie.getDraft({ subject: c.subject, builderKey: h.builderKey });
3932
- if (S) return S.formValue;
3933
- const M = c.sections.find((p) => p.builder.builderKey === h.builderKey);
3934
- return M == null ? void 0 : M.formValue;
3935
- }
3936
- function $e(c, h) {
3937
- const S = ie.getDraft({ subject: c.subject, builderKey: h.builderKey });
3938
- return S != null && S.inheritMode ? S.inheritMode : oe.inheritMode(c, h);
3939
- }
3940
- function Ge(c, h, S) {
3941
- const M = ie.getDraft({
3942
- subject: c.subject,
3943
- builderKey: h.builderKey
3944
- });
3945
- ie.setDraft(
3946
- { subject: c.subject, builderKey: h.builderKey },
3947
- {
3948
- formValue: S,
3949
- inheritMode: (M == null ? void 0 : M.inheritMode) ?? $e(c, h)
3950
- }
3951
- );
3952
- }
3953
- function je(c, h, S) {
3954
- const M = ie.getDraft({
3955
- subject: c.subject,
3956
- builderKey: h.builderKey
3957
- }), p = c.sections.find((v) => v.builder.builderKey === h.builderKey);
3958
- ie.setDraft(
3959
- { subject: c.subject, builderKey: h.builderKey },
3960
- {
3961
- formValue: (M == null ? void 0 : M.formValue) ?? (p == null ? void 0 : p.formValue),
3962
- inheritMode: S
3963
- }
3964
- );
3965
- }
3966
- function Ue(c) {
3967
- return ie.hasDraftsForSubject(c);
3968
- }
3969
- function Ze(c, h) {
3970
- const S = c.sections.flatMap((M) => {
3971
- const p = ie.getDraft({
3972
- subject: c.subject,
3973
- builderKey: M.builder.builderKey
3974
- });
3975
- return p ? [{ builder: M.builder, form: p.formValue, mode: p.inheritMode ?? "custom" }] : [];
3976
- });
3977
- oe.applyConditionDrafts(c, S, {
3978
- afterCommit: () => {
3979
- ie.clearDraftsForSubject(c.subject), h();
3980
- },
3981
- onOverridesConflict: i(c).onOverridesConflict
3982
- });
3983
- }
3984
- function qe(c) {
3985
- return c.sections.some((h) => oe.shouldShowInheritToggle(c, h.builder) ? oe.inheritMode(c, h.builder) === "custom" : Object.keys(h.builder.toCondition(h.formValue)).length > 0);
3986
- }
3987
- let o = !1;
3988
- function i(c, h = {}) {
3989
- return {
3990
- ...h,
3991
- onOverridesConflict: ({ override: S, keep: M }) => {
3992
- o || (o = !0, g.open({
3993
- title: d("team.memberForm.permissions.conditionCover.confirmTitle"),
3994
- message: d("team.memberForm.permissions.conditionCover.confirmMessage", {
3995
- cover: c.label
3996
- }),
3997
- minWidth: N.value.lg ? 588 : 0,
3998
- zIndex: 200,
3999
- primaryActions: {
4000
- text: d("team.memberForm.permissions.conditionCover.override"),
4001
- close: !1
4002
- },
4003
- secondaryActions: {
4004
- text: d("team.memberForm.permissions.conditionCover.keep"),
4005
- close: !1
4006
- }
4007
- }).onPrimary(() => {
4008
- S(), o = !1, g.close();
4009
- }).onSecondary(() => {
4010
- M(), o = !1, g.close();
4011
- }).onClose(() => {
4012
- o = !1;
4013
- }));
4014
- }
4015
- };
4016
- }
4017
- return Mt(
4018
- n,
4019
- (c) => {
4020
- m("permissionChanged", c);
4021
- },
4022
- { deep: !0 }
4023
- ), (c, h) => {
4024
- const S = Fe("FmIcon"), M = Fe("FmBottomSheet"), p = Fe("FmPopover");
4025
- return z(), re("div", {
4026
- class: Ne(["flex flex-col", e.part === "all" ? "gap-32" : "gap-16"])
4027
- }, [
4028
- e.part !== "workplace" ? (z(), re("div", {
4029
- key: 0,
4030
- class: Ne(a.value)
4031
- }, [
4032
- ce($a, {
4033
- "model-value": Q.value,
4034
- "excluded-subjects": E,
4035
- "additional-permissions": Y(j),
4036
- layout: s.value,
4037
- "onUpdate:modelValue": fe
4038
- }, tt({ _: 2 }, [
4039
- Ce(b.value, (v) => ({
4040
- name: `checkbox-${v.id}-append`,
4041
- fn: de(() => [
4042
- ce(vt, { item: v }, null, 8, ["item"])
4043
- ])
4044
- })),
4045
- Ce(ye.value, (v) => ({
4046
- name: `checkbox-${v}-icon`,
4047
- fn: de(({ option: Z, isEffectiveSelected: te }) => [
4048
- te && B(v, Z.label) ? (z(), re(De, { key: 0 }, [
4049
- C.value ? (z(), Oe(M, {
4050
- key: 0,
4051
- "model-value": Pe.value === v,
4052
- header: Y(d)("team.memberForm.permissions.conditionTitle", {
4053
- context: B(v, Z.label).label
4054
- }),
4055
- "dismiss-away": "",
4056
- "z-index": 100,
4057
- class: "h-5 flex items-center",
4058
- "onUpdate:modelValue": (le) => {
4059
- Pe.value = le ? v : null, le || Y(ie).clearDraftsForSubject(v);
4060
- }
4061
- }, {
4062
- "bottom-sheet-button": de(() => [
4063
- ue("div", po, [
4064
- ce(S, {
4065
- name: "settings",
4066
- size: "sm",
4067
- class: Ne([
4068
- "cursor-pointer transition-colors",
4069
- qe(B(v, Z.label)) ? "text-fm-color-primary-main" : "text-fm-color-neutral-gray-400 hover:text-fm-color-neutral-gray-600"
4070
- ])
4071
- }, null, 8, ["class"])
4072
- ])
4073
- ]),
4074
- default: de(() => [
4075
- ce(Pn, {
4076
- entry: B(v, Z.label),
4077
- builders: B(v, Z.label).sections.map((le) => le.builder),
4078
- subject: v,
4079
- "time-zone": L.value,
4080
- "cover-override": Y(oe),
4081
- "inherit-mode-for": (le) => $e(B(v, Z.label), le),
4082
- "form-value-for": (le) => _e(B(v, Z.label), le),
4083
- "has-changes": Ue(v),
4084
- disable: e.disable,
4085
- "full-width": !0,
4086
- onUpdateInheritMode: ({ builder: le, mode: he }) => je(B(v, Z.label), le, he),
4087
- onUpdateForm: ({ builder: le, form: he }) => Ge(B(v, Z.label), le, he),
4088
- onApply: (le) => Ze(B(v, Z.label), () => Pe.value = null)
4089
- }, null, 8, ["entry", "builders", "subject", "time-zone", "cover-override", "inherit-mode-for", "form-value-for", "has-changes", "disable", "onUpdateInheritMode", "onUpdateForm", "onApply"])
4090
- ]),
4091
- _: 2
4092
- }, 1032, ["model-value", "header", "onUpdate:modelValue"])) : (z(), Oe(p, {
4093
- key: 1,
4094
- disabled: e.disable,
4095
- "z-index": 100,
4096
- "exclude-el-from-click-outside": [ho],
4097
- class: "h-5 flex items-center",
4098
- onPopoverChanged: (le) => {
4099
- le || Y(ie).clearDraftsForSubject(v);
4100
- }
4101
- }, {
4102
- "popover-button": de(() => [
4103
- ue("div", vo, [
4104
- ce(S, {
4105
- name: "settings",
4106
- size: "sm",
4107
- class: Ne([
4108
- "cursor-pointer transition-colors",
4109
- qe(B(v, Z.label)) ? "text-fm-color-primary-main" : "text-fm-color-neutral-gray-400 hover:text-fm-color-neutral-gray-600"
4110
- ])
4111
- }, null, 8, ["class"])
4112
- ])
4113
- ]),
4114
- default: de(({ hide: le }) => [
4115
- ce(Pn, {
4116
- entry: B(v, Z.label),
4117
- builders: B(v, Z.label).sections.map((he) => he.builder),
4118
- subject: v,
4119
- "time-zone": L.value,
4120
- "cover-override": Y(oe),
4121
- title: Y(d)("team.memberForm.permissions.conditionTitle", {
4122
- context: B(v, Z.label).label
4123
- }),
4124
- "inherit-mode-for": (he) => $e(B(v, Z.label), he),
4125
- "form-value-for": (he) => _e(B(v, Z.label), he),
4126
- "has-changes": Ue(v),
4127
- disable: e.disable,
4128
- onUpdateInheritMode: ({ builder: he, mode: Me }) => je(
4129
- B(v, Z.label),
4130
- he,
4131
- Me
4132
- ),
4133
- onUpdateForm: ({ builder: he, form: Me }) => Ge(B(v, Z.label), he, Me),
4134
- onApply: (he) => Ze(B(v, Z.label), le)
4135
- }, null, 8, ["entry", "builders", "subject", "time-zone", "cover-override", "title", "inherit-mode-for", "form-value-for", "has-changes", "disable", "onUpdateInheritMode", "onUpdateForm", "onApply"])
4136
- ]),
4137
- _: 2
4138
- }, 1032, ["disabled", "exclude-el-from-click-outside", "onPopoverChanged"]))
4139
- ], 64)) : (z(), Oe(S, {
4140
- key: 1,
4141
- name: "settings",
4142
- size: "sm",
4143
- class: "invisible"
4144
- }))
4145
- ])
4146
- }))
4147
- ]), 1032, ["model-value", "additional-permissions", "layout"])
4148
- ], 2)) : Te("", !0),
4149
- e.part !== "portal" && !Y(se) ? (z(), re("div", {
4150
- key: 1,
4151
- class: Ne(a.value)
4152
- }, [
4153
- ce(Fn, {
4154
- "model-value": _.value,
4155
- options: k.value,
4156
- context: Y(d)("team.labels.warehouse"),
4157
- layout: s.value,
4158
- "onUpdate:modelValue": $
4159
- }, tt({ _: 2 }, [
4160
- Ce(A.value, (v) => ({
4161
- name: `checkbox-${v.id}-append`,
4162
- fn: de(() => [
4163
- ce(vt, { item: v }, null, 8, ["item"])
4164
- ])
4165
- }))
4166
- ]), 1032, ["model-value", "options", "context", "layout"])
4167
- ], 2)) : Te("", !0),
4168
- e.part !== "portal" && !Y(se) ? (z(), re("div", {
4169
- key: 2,
4170
- class: Ne([a.value, { "order-first": e.part === "workplace" }])
4171
- }, [
4172
- ce(Fn, {
4173
- "model-value": O.value,
4174
- options: w.value,
4175
- context: Y(d)("team.labels.restaurant"),
4176
- layout: s.value,
4177
- "onUpdate:modelValue": G
4178
- }, tt({ _: 2 }, [
4179
- Ce(u.value, (v) => ({
4180
- name: `checkbox-${v.id}-append`,
4181
- fn: de(() => [
4182
- ce(vt, { item: v }, null, 8, ["item"])
4183
- ])
4184
- }))
4185
- ]), 1032, ["model-value", "options", "context", "layout"])
4186
- ], 2)) : Te("", !0),
4187
- e.part !== "portal" && !Y(se) ? (z(), re("div", {
4188
- key: 3,
4189
- class: Ne(a.value)
4190
- }, [
4191
- ce(ro, {
4192
- roles: Y(y),
4193
- "model-value": H.value,
4194
- "restaurant-ids": O.value,
4195
- layout: s.value,
4196
- "onUpdate:modelValue": J
4197
- }, tt({ _: 2 }, [
4198
- Ce(I.value, (v) => ({
4199
- name: `checkbox-${v.id}-append`,
4200
- fn: de(() => [
4201
- ce(vt, { item: v }, null, 8, ["item"])
4202
- ])
4203
- }))
4204
- ]), 1032, ["roles", "model-value", "restaurant-ids", "layout"])
4205
- ], 2)) : Te("", !0)
4206
- ], 2);
4207
- };
4208
- }
4209
- });
4210
- export {
4211
- Ao as _
4212
- };