@feedmepos/mf-hrm-portal 2.1.1-dev.3 → 2.1.1-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApprovalCodeList-CXJyMKEg.js +757 -0
- package/dist/{AuditLogList-Q4L5Te8O.js → AuditLogList-CXUkbDyT.js} +3 -3
- package/dist/{EmployeeList-GtKmJZbf.js → EmployeeList-BSfUFTcN.js} +4 -4
- package/dist/{GrantUserList-CnLjOi5_.js → GrantUserList-DKP4MBQM.js} +175 -182
- package/dist/Main-CblWfQk_.js +122 -0
- package/dist/{Main-cskEZ3k_.js → Main-CyCfz4ka.js} +9 -9
- package/dist/{Main-DLlpEU3j.js → Main-Cz1pfe2k.js} +5 -5
- package/dist/{PermissionSetList-C2fK2pTz.js → PermissionSetList-BwyblSeE.js} +5 -5
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CMh0DL1_.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BJ-PZ2Nv.js} +599 -599
- package/dist/{RoleList-CcuT1ERb.js → RoleList-CXYgCmHp.js} +6 -6
- package/dist/{TeamMemberList-Dfs2iNdC.js → TeamMemberList-CnLbqaPS.js} +6 -6
- package/dist/{TimesheetList-B1H_6zfP.js → TimesheetList-s_bP5OGA.js} +5 -5
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-DeTpbaRk.js → TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-BCLv-2Re.js} +2 -2
- package/dist/{app-DX-PG6wx.js → app-BP0oihBR.js} +783 -752
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-BJrHE7oz.js → dayjs.min-BTSZLci9.js} +1 -1
- package/dist/{employee-BJcqtqLM.js → employee-BPv1j6T4.js} +3 -3
- package/dist/{iteration-Cfaqt-0s.js → iteration-BNA1cEos.js} +1 -1
- package/dist/{lodash-ClKqCmlZ.js → lodash-DKG9IyB-.js} +1 -1
- package/dist/{role-CR_-nBDY.js → role-BS3LFO8u.js} +1 -1
- package/dist/{rule-BB-3S-2R.js → rule-DaSLVZWm.js} +2 -2
- package/dist/src/stores/approval-code.d.ts +6 -6
- package/dist/src/types/approval-code.d.ts +60 -20
- package/dist/src/views/approval-code/ApprovalCodeList.vue.d.ts +1 -1
- package/dist/src/views/approval-code/components/ApprovalCodeCreatedDialog.vue.d.ts +9 -0
- package/dist/src/views/approval-code/components/ApprovalCodeForm.vue.d.ts +6 -1
- package/dist/src/views/approval-code/locales/index.d.ts +44 -12
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useReportPermissions-ybHA26cJ.js → useReportPermissions-J3-DjopO.js} +3 -3
- package/package.json +1 -1
- package/dist/ApprovalCodeList-BH5sgVMU.js +0 -638
- package/dist/Main-Cn7Dawg4.js +0 -120
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var oa = Object.defineProperty;
|
|
2
2
|
var ia = (e, A, m) => A in e ? oa(e, A, { enumerable: !0, configurable: !0, writable: !0, value: m }) : e[A] = m;
|
|
3
3
|
var ze = (e, A, m) => ia(e, typeof A != "symbol" ? A + "" : A, m);
|
|
4
|
-
import { isRef as ca, ref as he, shallowRef as la, watchEffect as
|
|
4
|
+
import { isRef as ca, ref as he, shallowRef as la, watchEffect as St, computed as jt, h as Xt, defineComponent as Pe, createBlock as Ke, renderSlot as Ut, createCommentVNode as Aa, unref as Ce, openBlock as xe, createElementBlock as Tt, createElementVNode as Me, toDisplayString as Qt, watch as ua, nextTick as ma, onMounted as Wt, onBeforeUnmount as ga, normalizeStyle as da, resolveComponent as Gt, withCtx as pa, createVNode as ba, defineAsyncComponent as fa, readonly as ht } from "vue";
|
|
5
5
|
import { useBreakpoints as ya } from "@feedmepos/ui-library";
|
|
6
6
|
import { useRoute as va, useRouter as ha } from "vue-router";
|
|
7
|
-
import { useCoreStore as
|
|
7
|
+
import { useCoreStore as kt, useI18n as Kt } from "@feedmepos/mf-common";
|
|
8
8
|
const Lt = {
|
|
9
9
|
predefinedRanges: {
|
|
10
10
|
today: "Today",
|
|
@@ -139,7 +139,7 @@ const Lt = {
|
|
|
139
139
|
}, Ba = {
|
|
140
140
|
date: Lt,
|
|
141
141
|
auditLog: Jt
|
|
142
|
-
},
|
|
142
|
+
}, wa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
143
143
|
__proto__: null,
|
|
144
144
|
auditLog: Jt,
|
|
145
145
|
date: Lt,
|
|
@@ -276,14 +276,14 @@ const Lt = {
|
|
|
276
276
|
requestPath: "URL ที่เข้าถึง",
|
|
277
277
|
requestBody: "เนื้อหาคำขอ"
|
|
278
278
|
}
|
|
279
|
-
},
|
|
279
|
+
}, Ma = {
|
|
280
280
|
date: _t,
|
|
281
281
|
auditLog: $t
|
|
282
282
|
}, Ca = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
283
283
|
__proto__: null,
|
|
284
284
|
auditLog: $t,
|
|
285
285
|
date: _t,
|
|
286
|
-
default:
|
|
286
|
+
default: Ma
|
|
287
287
|
}, Symbol.toStringTag, { value: "Module" })), es = {
|
|
288
288
|
predefinedRanges: {
|
|
289
289
|
today: "今天",
|
|
@@ -565,7 +565,7 @@ const Lt = {
|
|
|
565
565
|
date: ss,
|
|
566
566
|
default: Ga
|
|
567
567
|
}, Symbol.toStringTag, { value: "Module" })), Ea = {
|
|
568
|
-
"en-US":
|
|
568
|
+
"en-US": wa,
|
|
569
569
|
"zh-CN": ja,
|
|
570
570
|
"th-TH": Ca,
|
|
571
571
|
"zh-Hant": Ya
|
|
@@ -2603,6 +2603,7 @@ const Lt = {
|
|
|
2603
2603
|
title: "Create Access Code",
|
|
2604
2604
|
section: "Access Code Details",
|
|
2605
2605
|
name: "Name",
|
|
2606
|
+
namePlaceholder: "e.g. Refund, Cashier 1, Jane/John",
|
|
2606
2607
|
nameRequired: "Name is required",
|
|
2607
2608
|
restaurant: "Restaurant",
|
|
2608
2609
|
selectRestaurant: "Select a restaurant",
|
|
@@ -2612,7 +2613,7 @@ const Lt = {
|
|
|
2612
2613
|
discountMaxPercentage: "Max discount %",
|
|
2613
2614
|
discountMaxPercentageInvalid: "Max discount % must be between 1 and 100",
|
|
2614
2615
|
count: "Number of codes",
|
|
2615
|
-
countRange: "Enter a number between 1 and
|
|
2616
|
+
countRange: "Enter a number between 1 and 10"
|
|
2616
2617
|
},
|
|
2617
2618
|
columns: {
|
|
2618
2619
|
passcode: "Code",
|
|
@@ -2633,21 +2634,28 @@ const Lt = {
|
|
|
2633
2634
|
void: "Void item / bill",
|
|
2634
2635
|
refund: "Refund",
|
|
2635
2636
|
discount: "Apply discount",
|
|
2636
|
-
changePrice: "
|
|
2637
|
+
changePrice: "Input Custom Price",
|
|
2637
2638
|
claimDeposit: "Claim Deposit",
|
|
2638
2639
|
payment: "Payment",
|
|
2639
2640
|
resend: "Resend to kitchen",
|
|
2640
2641
|
changePaymentType: "Change payment method",
|
|
2641
2642
|
openDrawer: "Open drawer",
|
|
2642
|
-
openCounter: "Open counter",
|
|
2643
|
-
closeCounter: "Close counter",
|
|
2644
|
-
printReceipt: "Print receipt",
|
|
2645
2643
|
counter: "Open / Close counter"
|
|
2646
2644
|
},
|
|
2647
2645
|
create: {
|
|
2648
2646
|
successMessage: "Access code created: {passcode}",
|
|
2649
2647
|
successMessageBulk: "{count} access codes created"
|
|
2650
2648
|
},
|
|
2649
|
+
created: {
|
|
2650
|
+
title: "Access code created",
|
|
2651
|
+
titleBulk: "{count} access codes created",
|
|
2652
|
+
subtitle: "Share this code with staff. It can be used once.",
|
|
2653
|
+
subtitleBulk: "Share these codes with staff. Each can be used once.",
|
|
2654
|
+
copy: "Copy",
|
|
2655
|
+
copyAll: "Copy all",
|
|
2656
|
+
createAnother: "Create another",
|
|
2657
|
+
done: "Done"
|
|
2658
|
+
},
|
|
2651
2659
|
revoke: {
|
|
2652
2660
|
title: "Revoke Access Code",
|
|
2653
2661
|
message: "Are you sure you want to revoke the code for {name}?",
|
|
@@ -2685,6 +2693,7 @@ const Lt = {
|
|
|
2685
2693
|
title: "สร้างรหัสเข้าใช้งาน",
|
|
2686
2694
|
section: "รายละเอียดรหัสเข้าใช้งาน",
|
|
2687
2695
|
name: "ชื่อ",
|
|
2696
|
+
namePlaceholder: "เช่น คืนเงิน, แคชเชียร์ 1, สมชาย/สมหญิง",
|
|
2688
2697
|
nameRequired: "กรุณากรอกชื่อ",
|
|
2689
2698
|
restaurant: "ร้านอาหาร",
|
|
2690
2699
|
selectRestaurant: "เลือกร้านอาหาร",
|
|
@@ -2694,7 +2703,7 @@ const Lt = {
|
|
|
2694
2703
|
discountMaxPercentage: "เปอร์เซ็นต์ส่วนลดสูงสุด",
|
|
2695
2704
|
discountMaxPercentageInvalid: "เปอร์เซ็นต์ส่วนลดสูงสุดต้องอยู่ระหว่าง 1 ถึง 100",
|
|
2696
2705
|
count: "จำนวนรหัส",
|
|
2697
|
-
countRange: "กรอกตัวเลขระหว่าง 1 ถึง
|
|
2706
|
+
countRange: "กรอกตัวเลขระหว่าง 1 ถึง 10"
|
|
2698
2707
|
},
|
|
2699
2708
|
columns: {
|
|
2700
2709
|
passcode: "รหัส",
|
|
@@ -2715,21 +2724,28 @@ const Lt = {
|
|
|
2715
2724
|
void: "ยกเลิกรายการ / บิล",
|
|
2716
2725
|
refund: "คืนเงิน",
|
|
2717
2726
|
discount: "ใช้ส่วนลด",
|
|
2718
|
-
changePrice: "
|
|
2727
|
+
changePrice: "ระบุราคาเอง",
|
|
2719
2728
|
claimDeposit: "รับเงินมัดจำ",
|
|
2720
2729
|
payment: "ชำระเงิน",
|
|
2721
2730
|
resend: "ส่งเข้าครัวอีกครั้ง",
|
|
2722
2731
|
changePaymentType: "เปลี่ยนวิธีชำระเงิน",
|
|
2723
2732
|
openDrawer: "เปิดลิ้นชักเก็บเงิน",
|
|
2724
|
-
openCounter: "เปิดเคาน์เตอร์",
|
|
2725
|
-
closeCounter: "ปิดเคาน์เตอร์",
|
|
2726
|
-
printReceipt: "พิมพ์ใบเสร็จ",
|
|
2727
2733
|
counter: "เปิด / ปิดเคาน์เตอร์"
|
|
2728
2734
|
},
|
|
2729
2735
|
create: {
|
|
2730
2736
|
successMessage: "สร้างรหัสเข้าใช้งานแล้ว: {passcode}",
|
|
2731
2737
|
successMessageBulk: "สร้างรหัสเข้าใช้งานแล้ว {count} รหัส"
|
|
2732
2738
|
},
|
|
2739
|
+
created: {
|
|
2740
|
+
title: "สร้างรหัสเข้าใช้งานแล้ว",
|
|
2741
|
+
titleBulk: "สร้างรหัสเข้าใช้งานแล้ว {count} รหัส",
|
|
2742
|
+
subtitle: "แชร์รหัสนี้ให้พนักงาน ใช้ได้เพียงครั้งเดียว",
|
|
2743
|
+
subtitleBulk: "แชร์รหัสเหล่านี้ให้พนักงาน แต่ละรหัสใช้ได้เพียงครั้งเดียว",
|
|
2744
|
+
copy: "คัดลอก",
|
|
2745
|
+
copyAll: "คัดลอกทั้งหมด",
|
|
2746
|
+
createAnother: "สร้างอีก",
|
|
2747
|
+
done: "เสร็จสิ้น"
|
|
2748
|
+
},
|
|
2733
2749
|
revoke: {
|
|
2734
2750
|
title: "เพิกถอนรหัสเข้าใช้งาน",
|
|
2735
2751
|
message: "ต้องการเพิกถอนรหัสของ {name} หรือไม่?",
|
|
@@ -2757,7 +2773,7 @@ const Lt = {
|
|
|
2757
2773
|
__proto__: null,
|
|
2758
2774
|
approvalCode: Bs,
|
|
2759
2775
|
default: rn
|
|
2760
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2776
|
+
}, Symbol.toStringTag, { value: "Module" })), ws = {
|
|
2761
2777
|
title: "授权码",
|
|
2762
2778
|
actions: {
|
|
2763
2779
|
create: "创建授权码",
|
|
@@ -2767,6 +2783,7 @@ const Lt = {
|
|
|
2767
2783
|
title: "创建授权码",
|
|
2768
2784
|
section: "授权码信息",
|
|
2769
2785
|
name: "名称",
|
|
2786
|
+
namePlaceholder: "例如:退款、收银员 1、张三/李四",
|
|
2770
2787
|
nameRequired: "请输入名称",
|
|
2771
2788
|
restaurant: "餐厅",
|
|
2772
2789
|
selectRestaurant: "选择餐厅",
|
|
@@ -2776,7 +2793,7 @@ const Lt = {
|
|
|
2776
2793
|
discountMaxPercentage: "最高折扣百分比",
|
|
2777
2794
|
discountMaxPercentageInvalid: "最高折扣百分比须介于 1 到 100 之间",
|
|
2778
2795
|
count: "生成数量",
|
|
2779
|
-
countRange: "请输入 1 到
|
|
2796
|
+
countRange: "请输入 1 到 10 之间的数字"
|
|
2780
2797
|
},
|
|
2781
2798
|
columns: {
|
|
2782
2799
|
passcode: "授权码",
|
|
@@ -2797,21 +2814,28 @@ const Lt = {
|
|
|
2797
2814
|
void: "作废商品 / 账单",
|
|
2798
2815
|
refund: "退款",
|
|
2799
2816
|
discount: "应用折扣",
|
|
2800
|
-
changePrice: "
|
|
2817
|
+
changePrice: "输入自定义价格",
|
|
2801
2818
|
claimDeposit: "领取押金",
|
|
2802
2819
|
payment: "支付",
|
|
2803
2820
|
resend: "重发厨房",
|
|
2804
2821
|
changePaymentType: "更改支付方式",
|
|
2805
2822
|
openDrawer: "打开钱箱",
|
|
2806
|
-
openCounter: "开柜",
|
|
2807
|
-
closeCounter: "关柜",
|
|
2808
|
-
printReceipt: "打印收据",
|
|
2809
2823
|
counter: "开柜 / 关柜"
|
|
2810
2824
|
},
|
|
2811
2825
|
create: {
|
|
2812
2826
|
successMessage: "授权码已创建:{passcode}",
|
|
2813
2827
|
successMessageBulk: "已创建 {count} 个授权码"
|
|
2814
2828
|
},
|
|
2829
|
+
created: {
|
|
2830
|
+
title: "授权码已创建",
|
|
2831
|
+
titleBulk: "已创建 {count} 个授权码",
|
|
2832
|
+
subtitle: "将此授权码分享给员工,仅可使用一次。",
|
|
2833
|
+
subtitleBulk: "将这些授权码分享给员工,每个仅可使用一次。",
|
|
2834
|
+
copy: "复制",
|
|
2835
|
+
copyAll: "全部复制",
|
|
2836
|
+
createAnother: "再创建一个",
|
|
2837
|
+
done: "完成"
|
|
2838
|
+
},
|
|
2815
2839
|
revoke: {
|
|
2816
2840
|
title: "撤销授权码",
|
|
2817
2841
|
message: "确定要撤销 {name} 的授权码吗?",
|
|
@@ -2834,12 +2858,12 @@ const Lt = {
|
|
|
2834
2858
|
copied: "授权码已复制"
|
|
2835
2859
|
}
|
|
2836
2860
|
}, cn = {
|
|
2837
|
-
approvalCode:
|
|
2861
|
+
approvalCode: ws
|
|
2838
2862
|
}, ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2839
2863
|
__proto__: null,
|
|
2840
|
-
approvalCode:
|
|
2864
|
+
approvalCode: ws,
|
|
2841
2865
|
default: cn
|
|
2842
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2866
|
+
}, Symbol.toStringTag, { value: "Module" })), Ms = {
|
|
2843
2867
|
title: "授權碼",
|
|
2844
2868
|
actions: {
|
|
2845
2869
|
create: "建立授權碼",
|
|
@@ -2849,6 +2873,7 @@ const Lt = {
|
|
|
2849
2873
|
title: "建立授權碼",
|
|
2850
2874
|
section: "授權碼資訊",
|
|
2851
2875
|
name: "名稱",
|
|
2876
|
+
namePlaceholder: "例如:退款、收銀員 1、張三/李四",
|
|
2852
2877
|
nameRequired: "請輸入名稱",
|
|
2853
2878
|
restaurant: "餐廳",
|
|
2854
2879
|
selectRestaurant: "選擇餐廳",
|
|
@@ -2858,7 +2883,7 @@ const Lt = {
|
|
|
2858
2883
|
discountMaxPercentage: "最高折扣百分比",
|
|
2859
2884
|
discountMaxPercentageInvalid: "最高折扣百分比須介於 1 到 100 之間",
|
|
2860
2885
|
count: "產生數量",
|
|
2861
|
-
countRange: "請輸入 1 到
|
|
2886
|
+
countRange: "請輸入 1 到 10 之間的數字"
|
|
2862
2887
|
},
|
|
2863
2888
|
columns: {
|
|
2864
2889
|
passcode: "授權碼",
|
|
@@ -2879,21 +2904,28 @@ const Lt = {
|
|
|
2879
2904
|
void: "作廢商品 / 帳單",
|
|
2880
2905
|
refund: "退款",
|
|
2881
2906
|
discount: "套用折扣",
|
|
2882
|
-
changePrice: "
|
|
2907
|
+
changePrice: "輸入自訂價格",
|
|
2883
2908
|
claimDeposit: "領取押金",
|
|
2884
2909
|
payment: "支付",
|
|
2885
2910
|
resend: "重發廚房",
|
|
2886
2911
|
changePaymentType: "更改支付方式",
|
|
2887
2912
|
openDrawer: "打開錢箱",
|
|
2888
|
-
openCounter: "開櫃",
|
|
2889
|
-
closeCounter: "關櫃",
|
|
2890
|
-
printReceipt: "列印收據",
|
|
2891
2913
|
counter: "開櫃 / 關櫃"
|
|
2892
2914
|
},
|
|
2893
2915
|
create: {
|
|
2894
2916
|
successMessage: "授權碼已建立:{passcode}",
|
|
2895
2917
|
successMessageBulk: "已建立 {count} 個授權碼"
|
|
2896
2918
|
},
|
|
2919
|
+
created: {
|
|
2920
|
+
title: "授權碼已建立",
|
|
2921
|
+
titleBulk: "已建立 {count} 個授權碼",
|
|
2922
|
+
subtitle: "將此授權碼分享給員工,僅可使用一次。",
|
|
2923
|
+
subtitleBulk: "將這些授權碼分享給員工,每個僅可使用一次。",
|
|
2924
|
+
copy: "複製",
|
|
2925
|
+
copyAll: "全部複製",
|
|
2926
|
+
createAnother: "再建立一個",
|
|
2927
|
+
done: "完成"
|
|
2928
|
+
},
|
|
2897
2929
|
revoke: {
|
|
2898
2930
|
title: "撤銷授權碼",
|
|
2899
2931
|
message: "確定要撤銷 {name} 的授權碼嗎?",
|
|
@@ -2916,10 +2948,10 @@ const Lt = {
|
|
|
2916
2948
|
copied: "授權碼已複製"
|
|
2917
2949
|
}
|
|
2918
2950
|
}, An = {
|
|
2919
|
-
approvalCode:
|
|
2951
|
+
approvalCode: Ms
|
|
2920
2952
|
}, un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2921
2953
|
__proto__: null,
|
|
2922
|
-
approvalCode:
|
|
2954
|
+
approvalCode: Ms,
|
|
2923
2955
|
default: An
|
|
2924
2956
|
}, Symbol.toStringTag, { value: "Module" })), mn = {
|
|
2925
2957
|
"en-US": nn,
|
|
@@ -2930,7 +2962,7 @@ const Lt = {
|
|
|
2930
2962
|
title: "POS Access",
|
|
2931
2963
|
tabs: {
|
|
2932
2964
|
grants: "Access Grants",
|
|
2933
|
-
grantsDescription: "Grant staff
|
|
2965
|
+
grantsDescription: "Grant staff POS access with a designated role's permissions",
|
|
2934
2966
|
codes: "Access Codes",
|
|
2935
2967
|
codesDescription: "Generate single-use codes to authorize sensitive actions like refunds or voids."
|
|
2936
2968
|
}
|
|
@@ -2944,7 +2976,7 @@ const Lt = {
|
|
|
2944
2976
|
title: "สิทธิ์ POS",
|
|
2945
2977
|
tabs: {
|
|
2946
2978
|
grants: "สิทธิ์ระยะยาว",
|
|
2947
|
-
grantsDescription: "ให้สิทธิ์ POS
|
|
2979
|
+
grantsDescription: "ให้สิทธิ์ POS แก่พนักงานตามสิทธิ์ของบทบาทที่กำหนด",
|
|
2948
2980
|
codes: "รหัสเข้าใช้งาน",
|
|
2949
2981
|
codesDescription: "สร้างรหัสแบบใช้ครั้งเดียวเพื่ออนุมัติการทำงานที่ละเอียดอ่อน เช่น การคืนเงินหรือการยกเลิก"
|
|
2950
2982
|
}
|
|
@@ -2958,7 +2990,7 @@ const Lt = {
|
|
|
2958
2990
|
title: "POS 权限",
|
|
2959
2991
|
tabs: {
|
|
2960
2992
|
grants: "长期授权",
|
|
2961
|
-
grantsDescription: "
|
|
2993
|
+
grantsDescription: "以指定角色的权限授予员工 POS 使用权限",
|
|
2962
2994
|
codes: "授权码",
|
|
2963
2995
|
codesDescription: "生成一次性授权码,用于批准退款、作废等敏感操作。"
|
|
2964
2996
|
}
|
|
@@ -2972,7 +3004,7 @@ const Lt = {
|
|
|
2972
3004
|
title: "POS 權限",
|
|
2973
3005
|
tabs: {
|
|
2974
3006
|
grants: "長期授權",
|
|
2975
|
-
grantsDescription: "
|
|
3007
|
+
grantsDescription: "以指定角色的權限授予員工 POS 使用權限",
|
|
2976
3008
|
codes: "授權碼",
|
|
2977
3009
|
codesDescription: "產生一次性授權碼,用於核准退款、作廢等敏感操作。"
|
|
2978
3010
|
}
|
|
@@ -3002,7 +3034,7 @@ const b = {
|
|
|
3002
3034
|
reports: "Default Report",
|
|
3003
3035
|
customReports: "Custom Report",
|
|
3004
3036
|
miniProgram: "Mini Program"
|
|
3005
|
-
},
|
|
3037
|
+
}, wn = "access-denied", Re = {
|
|
3006
3038
|
Action: t,
|
|
3007
3039
|
Subject: {
|
|
3008
3040
|
Business: o,
|
|
@@ -3672,7 +3704,7 @@ const R = [
|
|
|
3672
3704
|
subject: q.crm,
|
|
3673
3705
|
actions: [t.read]
|
|
3674
3706
|
}
|
|
3675
|
-
], $ = (...e) => e.flat(),
|
|
3707
|
+
], $ = (...e) => e.flat(), Mn = [
|
|
3676
3708
|
...R,
|
|
3677
3709
|
{
|
|
3678
3710
|
label: "User",
|
|
@@ -4000,7 +4032,7 @@ const R = [
|
|
|
4000
4032
|
]
|
|
4001
4033
|
}
|
|
4002
4034
|
], Rn = $(
|
|
4003
|
-
|
|
4035
|
+
Mn,
|
|
4004
4036
|
Cn,
|
|
4005
4037
|
Ps,
|
|
4006
4038
|
xs,
|
|
@@ -4147,7 +4179,7 @@ const K = [
|
|
|
4147
4179
|
subject: G.inventory,
|
|
4148
4180
|
actions: [t.read]
|
|
4149
4181
|
}
|
|
4150
|
-
],
|
|
4182
|
+
], Yt = [
|
|
4151
4183
|
...K,
|
|
4152
4184
|
{
|
|
4153
4185
|
label: "Stock",
|
|
@@ -4197,11 +4229,11 @@ const K = [
|
|
|
4197
4229
|
}
|
|
4198
4230
|
];
|
|
4199
4231
|
[
|
|
4200
|
-
...
|
|
4232
|
+
...Yt,
|
|
4201
4233
|
...ks,
|
|
4202
4234
|
...Ks
|
|
4203
4235
|
];
|
|
4204
|
-
const
|
|
4236
|
+
const Et = [
|
|
4205
4237
|
...K,
|
|
4206
4238
|
{
|
|
4207
4239
|
label: "Closing",
|
|
@@ -4264,7 +4296,7 @@ const Pt = [
|
|
|
4264
4296
|
}
|
|
4265
4297
|
];
|
|
4266
4298
|
[
|
|
4267
|
-
...
|
|
4299
|
+
...Et,
|
|
4268
4300
|
...Ls,
|
|
4269
4301
|
...Js
|
|
4270
4302
|
];
|
|
@@ -4474,14 +4506,14 @@ const Jn = [
|
|
|
4474
4506
|
];
|
|
4475
4507
|
[
|
|
4476
4508
|
...K,
|
|
4477
|
-
...
|
|
4478
|
-
...
|
|
4509
|
+
...Yt,
|
|
4510
|
+
...Et
|
|
4479
4511
|
];
|
|
4480
4512
|
const sr = {
|
|
4481
4513
|
[`set_${o.inventory_stockBalance}`]: {
|
|
4482
4514
|
key: "sys:inventory:stock_balance",
|
|
4483
4515
|
name: "Stock Balance",
|
|
4484
|
-
permissions:
|
|
4516
|
+
permissions: Yt
|
|
4485
4517
|
},
|
|
4486
4518
|
[`set_${o.inventory_stockAdjustment}`]: {
|
|
4487
4519
|
key: "sys:inventory:stock_adjustment",
|
|
@@ -4501,7 +4533,7 @@ const sr = {
|
|
|
4501
4533
|
[`set_${o.inventory_closingHistory}`]: {
|
|
4502
4534
|
key: "sys:inventory:closing_history",
|
|
4503
4535
|
name: "Closing History",
|
|
4504
|
-
permissions:
|
|
4536
|
+
permissions: Et
|
|
4505
4537
|
},
|
|
4506
4538
|
[`set_${o.inventory_closingTemplate}`]: {
|
|
4507
4539
|
key: "sys:inventory:closing_template",
|
|
@@ -4661,7 +4693,7 @@ const ar = {
|
|
|
4661
4693
|
}
|
|
4662
4694
|
};
|
|
4663
4695
|
var sa = /* @__PURE__ */ ((e) => (e.payment_terminals = "payment::terminals", e))(sa || {});
|
|
4664
|
-
const
|
|
4696
|
+
const It = [
|
|
4665
4697
|
{
|
|
4666
4698
|
label: "Payout Account",
|
|
4667
4699
|
subject: o.payment_payoutAccount,
|
|
@@ -4676,12 +4708,12 @@ const Rt = [
|
|
|
4676
4708
|
[`set_${o.payment_transactions}`]: {
|
|
4677
4709
|
key: "sys:payment:transactions",
|
|
4678
4710
|
name: "Payment Transactions Access",
|
|
4679
|
-
permissions:
|
|
4711
|
+
permissions: It
|
|
4680
4712
|
},
|
|
4681
4713
|
[`set_${o.payment_settlements}`]: {
|
|
4682
4714
|
key: "sys:payment:settlements",
|
|
4683
4715
|
name: "Payment Settlements Access",
|
|
4684
|
-
permissions:
|
|
4716
|
+
permissions: It
|
|
4685
4717
|
}
|
|
4686
4718
|
}, rr = {
|
|
4687
4719
|
...Sn,
|
|
@@ -4703,377 +4735,377 @@ function or(e) {
|
|
|
4703
4735
|
}
|
|
4704
4736
|
var aa = { exports: {} };
|
|
4705
4737
|
(function(e, A) {
|
|
4706
|
-
(function(m,
|
|
4707
|
-
e.exports =
|
|
4738
|
+
(function(m, l) {
|
|
4739
|
+
e.exports = l();
|
|
4708
4740
|
})(Ne, function() {
|
|
4709
4741
|
return function(m) {
|
|
4710
|
-
var
|
|
4742
|
+
var l = {};
|
|
4711
4743
|
function a(u) {
|
|
4712
|
-
if (
|
|
4713
|
-
var
|
|
4714
|
-
return m[u].call(
|
|
4744
|
+
if (l[u]) return l[u].exports;
|
|
4745
|
+
var f = l[u] = { i: u, l: !1, exports: {} };
|
|
4746
|
+
return m[u].call(f.exports, f, f.exports, a), f.l = !0, f.exports;
|
|
4715
4747
|
}
|
|
4716
|
-
return a.m = m, a.c =
|
|
4717
|
-
a.o(u,
|
|
4748
|
+
return a.m = m, a.c = l, a.d = function(u, f, y) {
|
|
4749
|
+
a.o(u, f) || Object.defineProperty(u, f, { enumerable: !0, get: y });
|
|
4718
4750
|
}, a.r = function(u) {
|
|
4719
4751
|
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(u, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(u, "__esModule", { value: !0 });
|
|
4720
|
-
}, a.t = function(u,
|
|
4721
|
-
if (1 &
|
|
4722
|
-
var
|
|
4723
|
-
if (a.r(
|
|
4724
|
-
for (var
|
|
4752
|
+
}, a.t = function(u, f) {
|
|
4753
|
+
if (1 & f && (u = a(u)), 8 & f || 4 & f && typeof u == "object" && u && u.__esModule) return u;
|
|
4754
|
+
var y = /* @__PURE__ */ Object.create(null);
|
|
4755
|
+
if (a.r(y), Object.defineProperty(y, "default", { enumerable: !0, value: u }), 2 & f && typeof u != "string")
|
|
4756
|
+
for (var F in u)
|
|
4725
4757
|
a.d(
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
(function(
|
|
4729
|
-
return u[
|
|
4730
|
-
}).bind(null,
|
|
4758
|
+
y,
|
|
4759
|
+
F,
|
|
4760
|
+
(function(P) {
|
|
4761
|
+
return u[P];
|
|
4762
|
+
}).bind(null, F)
|
|
4731
4763
|
);
|
|
4732
|
-
return
|
|
4764
|
+
return y;
|
|
4733
4765
|
}, a.n = function(u) {
|
|
4734
|
-
var
|
|
4766
|
+
var f = u && u.__esModule ? function() {
|
|
4735
4767
|
return u.default;
|
|
4736
4768
|
} : function() {
|
|
4737
4769
|
return u;
|
|
4738
4770
|
};
|
|
4739
|
-
return a.d(
|
|
4740
|
-
}, a.o = function(u,
|
|
4741
|
-
return Object.prototype.hasOwnProperty.call(u,
|
|
4771
|
+
return a.d(f, "a", f), f;
|
|
4772
|
+
}, a.o = function(u, f) {
|
|
4773
|
+
return Object.prototype.hasOwnProperty.call(u, f);
|
|
4742
4774
|
}, a.p = "", a(a.s = 0);
|
|
4743
4775
|
}([
|
|
4744
|
-
function(m,
|
|
4776
|
+
function(m, l, a) {
|
|
4745
4777
|
m.exports = a(1);
|
|
4746
4778
|
},
|
|
4747
|
-
function(m,
|
|
4748
|
-
function u(
|
|
4779
|
+
function(m, l, a) {
|
|
4780
|
+
function u(i) {
|
|
4749
4781
|
return (u = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(g) {
|
|
4750
4782
|
return typeof g;
|
|
4751
4783
|
} : function(g) {
|
|
4752
4784
|
return g && typeof Symbol == "function" && g.constructor === Symbol && g !== Symbol.prototype ? "symbol" : typeof g;
|
|
4753
|
-
})(
|
|
4785
|
+
})(i);
|
|
4754
4786
|
}
|
|
4755
|
-
function
|
|
4756
|
-
var g = "[object " +
|
|
4757
|
-
return function(
|
|
4758
|
-
return Object.prototype.toString.call(
|
|
4787
|
+
function f(i) {
|
|
4788
|
+
var g = "[object " + i + "]";
|
|
4789
|
+
return function(v) {
|
|
4790
|
+
return Object.prototype.toString.call(v) === g;
|
|
4759
4791
|
};
|
|
4760
4792
|
}
|
|
4761
|
-
a.r(
|
|
4793
|
+
a.r(l), a.d(l, "default", function() {
|
|
4762
4794
|
return Ze;
|
|
4763
|
-
}), a.d(
|
|
4795
|
+
}), a.d(l, "compare", function() {
|
|
4764
4796
|
return Fe;
|
|
4765
|
-
}), a.d(
|
|
4797
|
+
}), a.d(l, "comparable", function() {
|
|
4766
4798
|
return Oe;
|
|
4767
4799
|
});
|
|
4768
|
-
var
|
|
4769
|
-
function
|
|
4770
|
-
return
|
|
4800
|
+
var y = f("Array"), F = f("Object"), P = f("Function");
|
|
4801
|
+
function w(i, g) {
|
|
4802
|
+
return P(i.get) ? i.get(g) : i[g];
|
|
4771
4803
|
}
|
|
4772
|
-
function
|
|
4773
|
-
return function(g,
|
|
4774
|
-
if (!
|
|
4775
|
-
for (var B = 0, C =
|
|
4776
|
-
if (
|
|
4804
|
+
function x(i) {
|
|
4805
|
+
return function(g, v) {
|
|
4806
|
+
if (!y(v) || !v.length) return i(g, v);
|
|
4807
|
+
for (var B = 0, C = v.length; B < C; B++)
|
|
4808
|
+
if (i(g, w(v, B))) return !0;
|
|
4777
4809
|
return !1;
|
|
4778
4810
|
};
|
|
4779
4811
|
}
|
|
4780
|
-
function I(
|
|
4781
|
-
return function(g,
|
|
4782
|
-
if (!
|
|
4783
|
-
for (var B = 0, C =
|
|
4784
|
-
if (!
|
|
4812
|
+
function I(i) {
|
|
4813
|
+
return function(g, v) {
|
|
4814
|
+
if (!y(v) || !v.length) return i(g, v);
|
|
4815
|
+
for (var B = 0, C = v.length; B < C; B++)
|
|
4816
|
+
if (!i(g, w(v, B))) return !1;
|
|
4785
4817
|
return !0;
|
|
4786
4818
|
};
|
|
4787
4819
|
}
|
|
4788
|
-
function H(
|
|
4789
|
-
return
|
|
4820
|
+
function H(i, g, v, B) {
|
|
4821
|
+
return i.validate(i.options, g, v, B);
|
|
4790
4822
|
}
|
|
4791
4823
|
var z = {
|
|
4792
|
-
$eq:
|
|
4793
|
-
return
|
|
4824
|
+
$eq: x(function(i, g) {
|
|
4825
|
+
return i(g);
|
|
4794
4826
|
}),
|
|
4795
|
-
$ne: I(function(
|
|
4796
|
-
return
|
|
4827
|
+
$ne: I(function(i, g) {
|
|
4828
|
+
return i(g);
|
|
4797
4829
|
}),
|
|
4798
|
-
$gt:
|
|
4799
|
-
return
|
|
4830
|
+
$gt: x(function(i, g) {
|
|
4831
|
+
return i(g);
|
|
4800
4832
|
}),
|
|
4801
|
-
$gte:
|
|
4802
|
-
return
|
|
4833
|
+
$gte: x(function(i, g) {
|
|
4834
|
+
return i(g);
|
|
4803
4835
|
}),
|
|
4804
|
-
$lt:
|
|
4805
|
-
return
|
|
4836
|
+
$lt: x(function(i, g) {
|
|
4837
|
+
return i(g);
|
|
4806
4838
|
}),
|
|
4807
|
-
$lte:
|
|
4808
|
-
return
|
|
4839
|
+
$lte: x(function(i, g) {
|
|
4840
|
+
return i(g);
|
|
4809
4841
|
}),
|
|
4810
|
-
$mod:
|
|
4811
|
-
return
|
|
4842
|
+
$mod: x(function(i, g) {
|
|
4843
|
+
return i(g);
|
|
4812
4844
|
}),
|
|
4813
|
-
$in: function(
|
|
4814
|
-
return
|
|
4845
|
+
$in: function(i, g) {
|
|
4846
|
+
return i(g);
|
|
4815
4847
|
},
|
|
4816
|
-
$nin: function(
|
|
4817
|
-
return
|
|
4848
|
+
$nin: function(i, g) {
|
|
4849
|
+
return i(g);
|
|
4818
4850
|
},
|
|
4819
|
-
$not: function(
|
|
4820
|
-
return
|
|
4851
|
+
$not: function(i, g, v, B) {
|
|
4852
|
+
return i(g, v, B);
|
|
4821
4853
|
},
|
|
4822
|
-
$type: function(
|
|
4823
|
-
return
|
|
4854
|
+
$type: function(i, g) {
|
|
4855
|
+
return i(g);
|
|
4824
4856
|
},
|
|
4825
|
-
$all: function(
|
|
4826
|
-
return z.$and(
|
|
4857
|
+
$all: function(i, g, v, B) {
|
|
4858
|
+
return z.$and(i, g, v, B);
|
|
4827
4859
|
},
|
|
4828
|
-
$size: function(
|
|
4829
|
-
return !!g &&
|
|
4860
|
+
$size: function(i, g) {
|
|
4861
|
+
return !!g && i === g.length;
|
|
4830
4862
|
},
|
|
4831
|
-
$or: function(
|
|
4832
|
-
for (var C = 0, D =
|
|
4833
|
-
if (H(
|
|
4863
|
+
$or: function(i, g, v, B) {
|
|
4864
|
+
for (var C = 0, D = i.length; C < D; C++)
|
|
4865
|
+
if (H(w(i, C), g, v, B)) return !0;
|
|
4834
4866
|
return !1;
|
|
4835
4867
|
},
|
|
4836
|
-
$nor: function(
|
|
4837
|
-
return !z.$or(
|
|
4868
|
+
$nor: function(i, g, v, B) {
|
|
4869
|
+
return !z.$or(i, g, v, B);
|
|
4838
4870
|
},
|
|
4839
|
-
$and: function(
|
|
4840
|
-
for (var C = 0, D =
|
|
4841
|
-
if (!H(
|
|
4871
|
+
$and: function(i, g, v, B) {
|
|
4872
|
+
for (var C = 0, D = i.length; C < D; C++)
|
|
4873
|
+
if (!H(w(i, C), g, v, B)) return !1;
|
|
4842
4874
|
return !0;
|
|
4843
4875
|
},
|
|
4844
|
-
$regex:
|
|
4845
|
-
return typeof g == "string" &&
|
|
4876
|
+
$regex: x(function(i, g) {
|
|
4877
|
+
return typeof g == "string" && i.test(g);
|
|
4846
4878
|
}),
|
|
4847
|
-
$where: function(
|
|
4848
|
-
return
|
|
4879
|
+
$where: function(i, g, v, B) {
|
|
4880
|
+
return i.call(g, g, v, B);
|
|
4849
4881
|
},
|
|
4850
|
-
$elemMatch: function(
|
|
4851
|
-
return
|
|
4852
|
-
for (var
|
|
4853
|
-
if (
|
|
4882
|
+
$elemMatch: function(i, g, v, B) {
|
|
4883
|
+
return y(g) ? !!~function(C, D) {
|
|
4884
|
+
for (var E = 0; E < C.length; E++)
|
|
4885
|
+
if (w(C, E), H(D, w(C, E))) return E;
|
|
4854
4886
|
return -1;
|
|
4855
|
-
}(g,
|
|
4887
|
+
}(g, i) : H(i, g, v, B);
|
|
4856
4888
|
},
|
|
4857
|
-
$exists: function(
|
|
4858
|
-
return B.hasOwnProperty(
|
|
4889
|
+
$exists: function(i, g, v, B) {
|
|
4890
|
+
return B.hasOwnProperty(v) === i;
|
|
4859
4891
|
}
|
|
4860
4892
|
}, W = {
|
|
4861
|
-
$eq: function(
|
|
4862
|
-
var B =
|
|
4863
|
-
return
|
|
4864
|
-
return typeof D == "string" &&
|
|
4865
|
-
}) :
|
|
4866
|
-
return
|
|
4867
|
-
}) :
|
|
4868
|
-
|
|
4893
|
+
$eq: function(i, g, v) {
|
|
4894
|
+
var B = v.comparable, C = v.compare;
|
|
4895
|
+
return i instanceof RegExp ? x(function(D) {
|
|
4896
|
+
return typeof D == "string" && i.test(D);
|
|
4897
|
+
}) : i instanceof Function ? x(i) : y(i) && !i.length ? x(function(D) {
|
|
4898
|
+
return y(D) && !D.length;
|
|
4899
|
+
}) : x(
|
|
4900
|
+
i === null ? function(D) {
|
|
4869
4901
|
return D == null;
|
|
4870
4902
|
} : function(D) {
|
|
4871
|
-
return C(B(D), B(
|
|
4903
|
+
return C(B(D), B(i)) === 0;
|
|
4872
4904
|
}
|
|
4873
4905
|
);
|
|
4874
4906
|
},
|
|
4875
|
-
$gt: function(
|
|
4876
|
-
var B =
|
|
4907
|
+
$gt: function(i, g, v) {
|
|
4908
|
+
var B = v.comparable, C = v.compare;
|
|
4877
4909
|
return function(D) {
|
|
4878
|
-
return C(B(D), B(
|
|
4910
|
+
return C(B(D), B(i)) > 0;
|
|
4879
4911
|
};
|
|
4880
4912
|
},
|
|
4881
|
-
$gte: function(
|
|
4882
|
-
var B =
|
|
4913
|
+
$gte: function(i, g, v) {
|
|
4914
|
+
var B = v.comparable, C = v.compare;
|
|
4883
4915
|
return function(D) {
|
|
4884
|
-
return C(B(D), B(
|
|
4916
|
+
return C(B(D), B(i)) >= 0;
|
|
4885
4917
|
};
|
|
4886
4918
|
},
|
|
4887
|
-
$lt: function(
|
|
4888
|
-
var B =
|
|
4919
|
+
$lt: function(i, g, v) {
|
|
4920
|
+
var B = v.comparable, C = v.compare;
|
|
4889
4921
|
return function(D) {
|
|
4890
|
-
return C(B(D), B(
|
|
4922
|
+
return C(B(D), B(i)) < 0;
|
|
4891
4923
|
};
|
|
4892
4924
|
},
|
|
4893
|
-
$lte: function(
|
|
4894
|
-
var B =
|
|
4925
|
+
$lte: function(i, g, v) {
|
|
4926
|
+
var B = v.comparable, C = v.compare;
|
|
4895
4927
|
return function(D) {
|
|
4896
|
-
return C(B(D), B(
|
|
4928
|
+
return C(B(D), B(i)) <= 0;
|
|
4897
4929
|
};
|
|
4898
4930
|
},
|
|
4899
|
-
$in: function(
|
|
4900
|
-
var B =
|
|
4931
|
+
$in: function(i, g, v) {
|
|
4932
|
+
var B = v.comparable;
|
|
4901
4933
|
return function(C) {
|
|
4902
4934
|
if (!(C instanceof Array)) {
|
|
4903
4935
|
var D = B(C);
|
|
4904
4936
|
if (D === C && u(C) === "object") {
|
|
4905
|
-
for (
|
|
4906
|
-
if (String(
|
|
4937
|
+
for (V = i.length; V--; )
|
|
4938
|
+
if (String(i[V]) === String(C) && String(C) !== "[object Object]")
|
|
4907
4939
|
return !0;
|
|
4908
4940
|
}
|
|
4909
4941
|
if (D === void 0) {
|
|
4910
|
-
for (
|
|
4942
|
+
for (V = i.length; V--; ) if (i[V] == null) return !0;
|
|
4911
4943
|
}
|
|
4912
|
-
for (
|
|
4913
|
-
var
|
|
4914
|
-
if (
|
|
4944
|
+
for (V = i.length; V--; ) {
|
|
4945
|
+
var E = H(Ve(w(i, V), v), D, V, i);
|
|
4946
|
+
if (E && String(E) !== "[object Object]" && String(D) !== "[object Object]")
|
|
4915
4947
|
return !0;
|
|
4916
4948
|
}
|
|
4917
|
-
return !!~
|
|
4949
|
+
return !!~i.indexOf(D);
|
|
4918
4950
|
}
|
|
4919
|
-
for (var
|
|
4920
|
-
if (~
|
|
4951
|
+
for (var V = C.length; V--; )
|
|
4952
|
+
if (~i.indexOf(B(w(C, V)))) return !0;
|
|
4921
4953
|
return !1;
|
|
4922
4954
|
};
|
|
4923
4955
|
},
|
|
4924
|
-
$nin: function(
|
|
4925
|
-
var B = W.$in(
|
|
4926
|
-
return function(C, D,
|
|
4927
|
-
return !B(C, D,
|
|
4956
|
+
$nin: function(i, g, v) {
|
|
4957
|
+
var B = W.$in(i, g, v);
|
|
4958
|
+
return function(C, D, E, V) {
|
|
4959
|
+
return !B(C, D, E, V);
|
|
4928
4960
|
};
|
|
4929
4961
|
},
|
|
4930
|
-
$mod: function(
|
|
4962
|
+
$mod: function(i) {
|
|
4931
4963
|
return function(g) {
|
|
4932
|
-
return g %
|
|
4964
|
+
return g % i[0] == i[1];
|
|
4933
4965
|
};
|
|
4934
4966
|
},
|
|
4935
|
-
$ne: function(
|
|
4936
|
-
var B = W.$eq(
|
|
4937
|
-
return I(function(C, D,
|
|
4938
|
-
return !B(C, D,
|
|
4967
|
+
$ne: function(i, g, v) {
|
|
4968
|
+
var B = W.$eq(i, g, v);
|
|
4969
|
+
return I(function(C, D, E, V) {
|
|
4970
|
+
return !B(C, D, E, V);
|
|
4939
4971
|
});
|
|
4940
4972
|
},
|
|
4941
|
-
$and: function(
|
|
4942
|
-
return
|
|
4973
|
+
$and: function(i, g, v) {
|
|
4974
|
+
return i.map(ie(v));
|
|
4943
4975
|
},
|
|
4944
|
-
$all: function(
|
|
4945
|
-
return W.$and(
|
|
4976
|
+
$all: function(i, g, v) {
|
|
4977
|
+
return W.$and(i, g, v);
|
|
4946
4978
|
},
|
|
4947
|
-
$or: function(
|
|
4948
|
-
return
|
|
4979
|
+
$or: function(i, g, v) {
|
|
4980
|
+
return i.map(ie(v));
|
|
4949
4981
|
},
|
|
4950
|
-
$nor: function(
|
|
4951
|
-
return
|
|
4982
|
+
$nor: function(i, g, v) {
|
|
4983
|
+
return i.map(ie(v));
|
|
4952
4984
|
},
|
|
4953
|
-
$not: function(
|
|
4954
|
-
var B = ie(
|
|
4955
|
-
return function(C, D,
|
|
4956
|
-
return !H(B, C, D,
|
|
4985
|
+
$not: function(i, g, v) {
|
|
4986
|
+
var B = ie(v)(i);
|
|
4987
|
+
return function(C, D, E) {
|
|
4988
|
+
return !H(B, C, D, E);
|
|
4957
4989
|
};
|
|
4958
4990
|
},
|
|
4959
|
-
$type: function(
|
|
4960
|
-
return function(g,
|
|
4961
|
-
return g != null && (g instanceof
|
|
4991
|
+
$type: function(i) {
|
|
4992
|
+
return function(g, v, B) {
|
|
4993
|
+
return g != null && (g instanceof i || g.constructor == i);
|
|
4962
4994
|
};
|
|
4963
4995
|
},
|
|
4964
|
-
$regex: function(
|
|
4965
|
-
return new RegExp(
|
|
4996
|
+
$regex: function(i, g) {
|
|
4997
|
+
return new RegExp(i, g.$options);
|
|
4966
4998
|
},
|
|
4967
|
-
$where: function(
|
|
4968
|
-
if (typeof
|
|
4999
|
+
$where: function(i) {
|
|
5000
|
+
if (typeof i == "function") return i;
|
|
4969
5001
|
throw new Error(
|
|
4970
5002
|
'In CSP mode, sift does not support strings in "$where" condition'
|
|
4971
5003
|
);
|
|
4972
5004
|
},
|
|
4973
|
-
$elemMatch: function(
|
|
4974
|
-
return ie(
|
|
5005
|
+
$elemMatch: function(i, g, v) {
|
|
5006
|
+
return ie(v)(i);
|
|
4975
5007
|
},
|
|
4976
|
-
$exists: function(
|
|
4977
|
-
return !!
|
|
5008
|
+
$exists: function(i) {
|
|
5009
|
+
return !!i;
|
|
4978
5010
|
}
|
|
4979
5011
|
};
|
|
4980
|
-
function te(
|
|
4981
|
-
return { options:
|
|
5012
|
+
function te(i, g) {
|
|
5013
|
+
return { options: i, validate: g };
|
|
4982
5014
|
}
|
|
4983
|
-
function k(
|
|
4984
|
-
var
|
|
4985
|
-
if (function s(
|
|
4986
|
-
if (p === r.length ||
|
|
4987
|
-
return void j.push([
|
|
4988
|
-
var
|
|
4989
|
-
if (
|
|
4990
|
-
for (var O = 0,
|
|
4991
|
-
else s(
|
|
4992
|
-
}(g,
|
|
4993
|
-
var
|
|
4994
|
-
return H(B,
|
|
5015
|
+
function k(i, g) {
|
|
5016
|
+
var v = i.keyPath, B = i.child, C = i.query, D = [];
|
|
5017
|
+
if (function s(c, r, p, h, j) {
|
|
5018
|
+
if (p === r.length || c == null)
|
|
5019
|
+
return void j.push([c, r[p - 1], h]);
|
|
5020
|
+
var Y = w(r, p);
|
|
5021
|
+
if (y(c) && isNaN(Number(Y)))
|
|
5022
|
+
for (var O = 0, M = c.length; O < M; O++) s(w(c, O), r, p, c, j);
|
|
5023
|
+
else s(w(c, Y), r, p + 1, c, j);
|
|
5024
|
+
}(g, v, 0, g, D), D.length === 1) {
|
|
5025
|
+
var E = D[0];
|
|
5026
|
+
return H(B, E[0], E[1], E[2]);
|
|
4995
5027
|
}
|
|
4996
|
-
for (var
|
|
5028
|
+
for (var V = C && C.$ne !== void 0, Z = V, T = 0; T < D.length; T++) {
|
|
4997
5029
|
var d = D[T], n = H(B, d[0], d[1], d[2]);
|
|
4998
|
-
|
|
5030
|
+
V ? Z &= n : Z |= n;
|
|
4999
5031
|
}
|
|
5000
5032
|
return Z;
|
|
5001
5033
|
}
|
|
5002
|
-
function Je(
|
|
5003
|
-
return te({ keyPath:
|
|
5034
|
+
function Je(i, g, v) {
|
|
5035
|
+
return te({ keyPath: i, child: g, query: v }, k);
|
|
5004
5036
|
}
|
|
5005
|
-
function ie(
|
|
5006
|
-
var g =
|
|
5007
|
-
var
|
|
5008
|
-
return (!
|
|
5009
|
-
}, C = function(
|
|
5010
|
-
|
|
5011
|
-
var
|
|
5012
|
-
for (var Z in
|
|
5013
|
-
var T =
|
|
5037
|
+
function ie(i) {
|
|
5038
|
+
var g = i.comparable, v = i.expressions, B = function(E) {
|
|
5039
|
+
var V;
|
|
5040
|
+
return (!E || !(V = E) || V.constructor !== Object && V.constructor !== Array && V.constructor.toString() !== "function Object() { [native code] }" && V.constructor.toString() !== "function Array() { [native code] }" || V.toJSON) && (E = { $eq: E }), E;
|
|
5041
|
+
}, C = function(E) {
|
|
5042
|
+
E = g(E);
|
|
5043
|
+
var V = [];
|
|
5044
|
+
for (var Z in E) {
|
|
5045
|
+
var T = E[Z];
|
|
5014
5046
|
if (Z !== "$options") {
|
|
5015
|
-
var d = z[Z] ||
|
|
5016
|
-
if (d) W[Z] && (T = W[Z](T,
|
|
5047
|
+
var d = z[Z] || i && v && v[Z];
|
|
5048
|
+
if (d) W[Z] && (T = W[Z](T, E, i)), V.push(te(g(T), d));
|
|
5017
5049
|
else {
|
|
5018
5050
|
if (Z.charCodeAt(0) === 36)
|
|
5019
5051
|
throw new Error("Unknown operation " + Z);
|
|
5020
5052
|
var n = Z.split(".");
|
|
5021
|
-
|
|
5053
|
+
V.push(Je(n, D(T), T));
|
|
5022
5054
|
}
|
|
5023
5055
|
}
|
|
5024
5056
|
}
|
|
5025
|
-
return
|
|
5026
|
-
}, D = function(
|
|
5027
|
-
return
|
|
5028
|
-
if (!
|
|
5029
|
-
for (var d in Z) T.push(d),
|
|
5057
|
+
return V.length === 1 ? V[0] : te(V, z.$and);
|
|
5058
|
+
}, D = function(E) {
|
|
5059
|
+
return E = B(E), function V(Z, T) {
|
|
5060
|
+
if (!F(Z)) return T;
|
|
5061
|
+
for (var d in Z) T.push(d), V(Z[d], T);
|
|
5030
5062
|
return T;
|
|
5031
|
-
}(
|
|
5063
|
+
}(E, []).join(",").search(/[$.]/) === -1 ? te(E, Be) : C(E);
|
|
5032
5064
|
};
|
|
5033
|
-
return function(
|
|
5034
|
-
return C(B(
|
|
5065
|
+
return function(E) {
|
|
5066
|
+
return C(B(E));
|
|
5035
5067
|
};
|
|
5036
5068
|
}
|
|
5037
|
-
function Be(
|
|
5038
|
-
if (Object.prototype.toString.call(
|
|
5069
|
+
function Be(i, g) {
|
|
5070
|
+
if (Object.prototype.toString.call(i) !== Object.prototype.toString.call(g))
|
|
5039
5071
|
return !1;
|
|
5040
|
-
if (
|
|
5041
|
-
if (Object.keys(
|
|
5042
|
-
for (var
|
|
5072
|
+
if (F(i)) {
|
|
5073
|
+
if (Object.keys(i).length !== Object.keys(g).length) return !1;
|
|
5074
|
+
for (var v in i) if (!Be(i[v], g[v])) return !1;
|
|
5043
5075
|
return !0;
|
|
5044
5076
|
}
|
|
5045
|
-
if (
|
|
5046
|
-
if (
|
|
5047
|
-
for (var B = 0, C =
|
|
5048
|
-
if (!Be(
|
|
5077
|
+
if (y(i)) {
|
|
5078
|
+
if (i.length !== g.length) return !1;
|
|
5079
|
+
for (var B = 0, C = i.length; B < C; B++)
|
|
5080
|
+
if (!Be(i[B], g[B])) return !1;
|
|
5049
5081
|
return !0;
|
|
5050
5082
|
}
|
|
5051
|
-
return
|
|
5083
|
+
return i === g;
|
|
5052
5084
|
}
|
|
5053
|
-
function Ve(
|
|
5054
|
-
var
|
|
5055
|
-
return g && g.select && (
|
|
5056
|
-
options:
|
|
5057
|
-
validate: function(B, C, D,
|
|
5058
|
-
return H(B, C && g.select(C), D,
|
|
5085
|
+
function Ve(i, g) {
|
|
5086
|
+
var v = ie(g)(i);
|
|
5087
|
+
return g && g.select && (v = {
|
|
5088
|
+
options: v,
|
|
5089
|
+
validate: function(B, C, D, E) {
|
|
5090
|
+
return H(B, C && g.select(C), D, E);
|
|
5059
5091
|
}
|
|
5060
|
-
}),
|
|
5092
|
+
}), v;
|
|
5061
5093
|
}
|
|
5062
|
-
function Ze(
|
|
5063
|
-
var
|
|
5094
|
+
function Ze(i, g) {
|
|
5095
|
+
var v = Ve(i, g = Object.assign({ compare: Fe, comparable: Oe }, g));
|
|
5064
5096
|
return function(B, C, D) {
|
|
5065
|
-
return H(
|
|
5097
|
+
return H(v, B, C, D);
|
|
5066
5098
|
};
|
|
5067
5099
|
}
|
|
5068
|
-
function Fe(
|
|
5069
|
-
if (Be(
|
|
5070
|
-
if (u(
|
|
5071
|
-
if (
|
|
5072
|
-
if (
|
|
5100
|
+
function Fe(i, g) {
|
|
5101
|
+
if (Be(i, g)) return 0;
|
|
5102
|
+
if (u(i) === u(g)) {
|
|
5103
|
+
if (i > g) return 1;
|
|
5104
|
+
if (i < g) return -1;
|
|
5073
5105
|
}
|
|
5074
5106
|
}
|
|
5075
|
-
function Oe(
|
|
5076
|
-
return
|
|
5107
|
+
function Oe(i) {
|
|
5108
|
+
return i instanceof Date ? i.getTime() : y(i) ? i.map(Oe) : i && typeof i.toJSON == "function" ? i.toJSON() : i;
|
|
5077
5109
|
}
|
|
5078
5110
|
}
|
|
5079
5111
|
]);
|
|
@@ -5083,8 +5115,8 @@ var ir = aa.exports;
|
|
|
5083
5115
|
const cr = /* @__PURE__ */ or(ir);
|
|
5084
5116
|
function lr(e, A) {
|
|
5085
5117
|
for (var m = 0; m < A.length; m++) {
|
|
5086
|
-
var
|
|
5087
|
-
|
|
5118
|
+
var l = A[m];
|
|
5119
|
+
l.enumerable = l.enumerable || !1, l.configurable = !0, "value" in l && (l.writable = !0), Object.defineProperty(e, l.key, l);
|
|
5088
5120
|
}
|
|
5089
5121
|
}
|
|
5090
5122
|
function Ar(e, A, m) {
|
|
@@ -5099,8 +5131,8 @@ function Bt(e) {
|
|
|
5099
5131
|
}, Bt(e);
|
|
5100
5132
|
}
|
|
5101
5133
|
function ke(e, A) {
|
|
5102
|
-
return ke = Object.setPrototypeOf || function(
|
|
5103
|
-
return
|
|
5134
|
+
return ke = Object.setPrototypeOf || function(l, a) {
|
|
5135
|
+
return l.__proto__ = a, l;
|
|
5104
5136
|
}, ke(e, A);
|
|
5105
5137
|
}
|
|
5106
5138
|
function mr() {
|
|
@@ -5114,40 +5146,40 @@ function mr() {
|
|
|
5114
5146
|
}
|
|
5115
5147
|
}
|
|
5116
5148
|
function We(e, A, m) {
|
|
5117
|
-
return mr() ? We = Reflect.construct : We = function(a, u,
|
|
5118
|
-
var
|
|
5119
|
-
|
|
5120
|
-
var
|
|
5121
|
-
return
|
|
5149
|
+
return mr() ? We = Reflect.construct : We = function(a, u, f) {
|
|
5150
|
+
var y = [null];
|
|
5151
|
+
y.push.apply(y, u);
|
|
5152
|
+
var F = Function.bind.apply(a, y), P = new F();
|
|
5153
|
+
return f && ke(P, f.prototype), P;
|
|
5122
5154
|
}, We.apply(null, arguments);
|
|
5123
5155
|
}
|
|
5124
5156
|
function gr(e) {
|
|
5125
5157
|
return Function.toString.call(e).indexOf("[native code]") !== -1;
|
|
5126
5158
|
}
|
|
5127
|
-
function
|
|
5159
|
+
function wt(e) {
|
|
5128
5160
|
var A = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
5129
|
-
return
|
|
5130
|
-
if (
|
|
5131
|
-
if (typeof
|
|
5161
|
+
return wt = function(l) {
|
|
5162
|
+
if (l === null || !gr(l)) return l;
|
|
5163
|
+
if (typeof l != "function")
|
|
5132
5164
|
throw new TypeError("Super expression must either be null or a function");
|
|
5133
5165
|
if (typeof A < "u") {
|
|
5134
|
-
if (A.has(
|
|
5135
|
-
A.set(
|
|
5166
|
+
if (A.has(l)) return A.get(l);
|
|
5167
|
+
A.set(l, a);
|
|
5136
5168
|
}
|
|
5137
5169
|
function a() {
|
|
5138
|
-
return We(
|
|
5170
|
+
return We(l, arguments, Bt(this).constructor);
|
|
5139
5171
|
}
|
|
5140
|
-
return a.prototype = Object.create(
|
|
5172
|
+
return a.prototype = Object.create(l.prototype, {
|
|
5141
5173
|
constructor: {
|
|
5142
5174
|
value: a,
|
|
5143
5175
|
enumerable: !1,
|
|
5144
5176
|
writable: !0,
|
|
5145
5177
|
configurable: !0
|
|
5146
5178
|
}
|
|
5147
|
-
}), ke(a,
|
|
5148
|
-
},
|
|
5179
|
+
}), ke(a, l);
|
|
5180
|
+
}, wt(e);
|
|
5149
5181
|
}
|
|
5150
|
-
function
|
|
5182
|
+
function Rt(e) {
|
|
5151
5183
|
if (e === void 0)
|
|
5152
5184
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
5153
5185
|
return e;
|
|
@@ -5165,32 +5197,32 @@ var na = function(A) {
|
|
|
5165
5197
|
value: a
|
|
5166
5198
|
}), u;
|
|
5167
5199
|
};
|
|
5168
|
-
function A(
|
|
5200
|
+
function A(l, a) {
|
|
5169
5201
|
var u;
|
|
5170
|
-
return a === void 0 && (a = {}), u = e.call(this,
|
|
5202
|
+
return a === void 0 && (a = {}), u = e.call(this, l) || this, u._setMetadata(a), u.message = l || Se(Rt(u)), u._customMessage = null, typeof Error.captureStackTrace == "function" && (u.name = u.constructor.name, Error.captureStackTrace(Rt(u), u.constructor)), u;
|
|
5171
5203
|
}
|
|
5172
5204
|
var m = A.prototype;
|
|
5173
5205
|
return m.setMessage = function(a) {
|
|
5174
5206
|
return this._customMessage = a, this;
|
|
5175
|
-
}, m.throwUnlessCan = function(a, u,
|
|
5207
|
+
}, m.throwUnlessCan = function(a, u, f) {
|
|
5176
5208
|
if (!this.ability)
|
|
5177
5209
|
throw new ReferenceError("Cannot throw FordiddenError without respective ability instance");
|
|
5178
|
-
var
|
|
5179
|
-
if (!(
|
|
5210
|
+
var y = this.ability.relevantRuleFor(a, u, f);
|
|
5211
|
+
if (!(y && !y.inverted)) {
|
|
5180
5212
|
this._setMetadata({
|
|
5181
5213
|
action: a,
|
|
5182
5214
|
subject: u,
|
|
5183
|
-
field:
|
|
5215
|
+
field: f,
|
|
5184
5216
|
subjectName: this.ability.subjectName(u)
|
|
5185
5217
|
});
|
|
5186
|
-
var
|
|
5187
|
-
throw this.message = this._customMessage ||
|
|
5218
|
+
var F = y ? y.reason : "";
|
|
5219
|
+
throw this.message = this._customMessage || F || Se(this), this;
|
|
5188
5220
|
}
|
|
5189
5221
|
}, m._setMetadata = function(a) {
|
|
5190
5222
|
this.subject = a.subject, this.subjectName = a.subjectName, this.action = a.action, this.field = a.field;
|
|
5191
5223
|
}, A;
|
|
5192
|
-
}(
|
|
5193
|
-
function
|
|
5224
|
+
}(wt(Error));
|
|
5225
|
+
function Mt(e) {
|
|
5194
5226
|
return Array.isArray(e) ? e : [e];
|
|
5195
5227
|
}
|
|
5196
5228
|
function pr(e) {
|
|
@@ -5204,21 +5236,21 @@ function br(e) {
|
|
|
5204
5236
|
}
|
|
5205
5237
|
var fr = /[-/\\^$+?.()|[\]{}]/g, yr = /\.?\*+\.?/g, vr = /\*+/, hr = /\./g;
|
|
5206
5238
|
function Br(e, A, m) {
|
|
5207
|
-
var
|
|
5239
|
+
var l = m[0] === "*" || e[0] === "." && e[e.length - 1] === "." ? "+" : "*", a = e.indexOf("**") === -1 ? "[^.]" : ".", u = e.replace(hr, "\\$&").replace(vr, a + l);
|
|
5208
5240
|
return A + e.length === m.length ? "(?:" + u + ")?" : u;
|
|
5209
5241
|
}
|
|
5210
|
-
function
|
|
5242
|
+
function wr(e, A, m) {
|
|
5211
5243
|
return e === "." && (m[A - 1] === "*" || m[A + 1] === "*") ? e : "\\" + e;
|
|
5212
5244
|
}
|
|
5213
|
-
function
|
|
5214
|
-
var A = e.map(function(
|
|
5215
|
-
return
|
|
5245
|
+
function Mr(e) {
|
|
5246
|
+
var A = e.map(function(l) {
|
|
5247
|
+
return l.replace(fr, wr).replace(yr, Br);
|
|
5216
5248
|
}), m = A.length > 1 ? "(?:" + A.join("|") + ")" : A[0];
|
|
5217
5249
|
return new RegExp("^" + m + "$");
|
|
5218
5250
|
}
|
|
5219
5251
|
var Cr = /* @__PURE__ */ function() {
|
|
5220
5252
|
function e(m) {
|
|
5221
|
-
this.actions = m.actions || m.action, this.subject = m.subject, this.fields = !m.fields || m.fields.length === 0 ? void 0 :
|
|
5253
|
+
this.actions = m.actions || m.action, this.subject = m.subject, this.fields = !m.fields || m.fields.length === 0 ? void 0 : Mt(m.fields), Object.defineProperty(this, "_fieldsPattern", {
|
|
5222
5254
|
writable: !0
|
|
5223
5255
|
}), this.inverted = !!m.inverted, this.conditions = m.conditions, Object.defineProperty(this, "_matches", {
|
|
5224
5256
|
writable: !0,
|
|
@@ -5226,119 +5258,119 @@ var Cr = /* @__PURE__ */ function() {
|
|
|
5226
5258
|
}), this.reason = m.reason;
|
|
5227
5259
|
}
|
|
5228
5260
|
var A = e.prototype;
|
|
5229
|
-
return A.matches = function(
|
|
5230
|
-
return this._matches ? typeof
|
|
5231
|
-
}, A.isRelevantFor = function(
|
|
5261
|
+
return A.matches = function(l) {
|
|
5262
|
+
return this._matches ? typeof l == "string" ? !this.inverted : this._matches(l) : !0;
|
|
5263
|
+
}, A.isRelevantFor = function(l, a) {
|
|
5232
5264
|
return this.fields ? a ? this.matchesField(a) : !this.inverted : !0;
|
|
5233
|
-
}, A.matchesField = function(
|
|
5234
|
-
return typeof this._fieldsPattern > "u" && (this._fieldsPattern = this.fields.join("").indexOf("*") === -1 ? null :
|
|
5265
|
+
}, A.matchesField = function(l) {
|
|
5266
|
+
return typeof this._fieldsPattern > "u" && (this._fieldsPattern = this.fields.join("").indexOf("*") === -1 ? null : Mr(this.fields)), this._fieldsPattern === null || l.indexOf("*") !== -1 ? this.fields.indexOf(l) !== -1 : this._fieldsPattern.test(l);
|
|
5235
5267
|
}, e;
|
|
5236
|
-
}(), ee = typeof Symbol < "u" ? Symbol("private") : "__" + Date.now(),
|
|
5268
|
+
}(), ee = typeof Symbol < "u" ? Symbol("private") : "__" + Date.now(), Nt = {
|
|
5237
5269
|
crud: ["create", "read", "update", "delete"]
|
|
5238
5270
|
};
|
|
5239
|
-
function
|
|
5271
|
+
function Zt(e, A) {
|
|
5240
5272
|
return e === A || Array.isArray(A) && A.indexOf(e) !== -1;
|
|
5241
5273
|
}
|
|
5242
5274
|
var Dr = /* @__PURE__ */ function() {
|
|
5243
|
-
e.addAlias = function(
|
|
5244
|
-
if (
|
|
5275
|
+
e.addAlias = function(l, a) {
|
|
5276
|
+
if (l === "manage" || Zt("manage", a))
|
|
5245
5277
|
throw new Error('Cannot add alias for "manage" action because it represents any action');
|
|
5246
|
-
if (
|
|
5247
|
-
throw new Error("Attempt to alias action to itself: " +
|
|
5248
|
-
return
|
|
5278
|
+
if (Zt(l, a))
|
|
5279
|
+
throw new Error("Attempt to alias action to itself: " + l + " -> " + a.toString());
|
|
5280
|
+
return Nt[l] = a, this;
|
|
5249
5281
|
};
|
|
5250
|
-
function e(m,
|
|
5251
|
-
|
|
5252
|
-
value:
|
|
5282
|
+
function e(m, l) {
|
|
5283
|
+
l === void 0 && (l = {}), Object.defineProperty(this, "subjectName", {
|
|
5284
|
+
value: l.subjectName || pr
|
|
5253
5285
|
}), this[ee] = {
|
|
5254
|
-
RuleType:
|
|
5286
|
+
RuleType: l.RuleType || Cr,
|
|
5255
5287
|
originalRules: m || [],
|
|
5256
5288
|
hasPerFieldRules: !1,
|
|
5257
5289
|
indexedRules: /* @__PURE__ */ Object.create(null),
|
|
5258
5290
|
mergedRules: /* @__PURE__ */ Object.create(null),
|
|
5259
5291
|
events: {},
|
|
5260
|
-
aliases: br(
|
|
5292
|
+
aliases: br(Nt)
|
|
5261
5293
|
}, this.update(m);
|
|
5262
5294
|
}
|
|
5263
5295
|
var A = e.prototype;
|
|
5264
|
-
return A.update = function(
|
|
5265
|
-
if (!Array.isArray(
|
|
5296
|
+
return A.update = function(l) {
|
|
5297
|
+
if (!Array.isArray(l))
|
|
5266
5298
|
return this;
|
|
5267
5299
|
var a = {
|
|
5268
|
-
rules:
|
|
5300
|
+
rules: l,
|
|
5269
5301
|
ability: this
|
|
5270
5302
|
};
|
|
5271
|
-
this.emit("update", a), this[ee].originalRules =
|
|
5272
|
-
var u = this.buildIndexFor(
|
|
5303
|
+
this.emit("update", a), this[ee].originalRules = l.slice(0), this[ee].mergedRules = /* @__PURE__ */ Object.create(null);
|
|
5304
|
+
var u = this.buildIndexFor(l);
|
|
5273
5305
|
return this[ee].indexedRules = u.rules, this[ee].hasPerFieldRules = u.hasPerFieldRules, this.emit("updated", a), this;
|
|
5274
|
-
}, A.buildIndexFor = function(
|
|
5275
|
-
for (var a = /* @__PURE__ */ Object.create(null), u = this[ee].RuleType,
|
|
5276
|
-
var
|
|
5277
|
-
|
|
5278
|
-
for (var H = 0; H <
|
|
5279
|
-
var z =
|
|
5306
|
+
}, A.buildIndexFor = function(l) {
|
|
5307
|
+
for (var a = /* @__PURE__ */ Object.create(null), u = this[ee].RuleType, f = !0, y = !1, F = 0; F < l.length; F++) {
|
|
5308
|
+
var P = new u(l[F]), w = this.expandActions(P.actions), x = Mt(P.subject), I = l.length - F - 1;
|
|
5309
|
+
f = !!(f && P.inverted), !y && P.fields && (y = !0);
|
|
5310
|
+
for (var H = 0; H < x.length; H++) {
|
|
5311
|
+
var z = x[H];
|
|
5280
5312
|
a[z] = a[z] || /* @__PURE__ */ Object.create(null);
|
|
5281
|
-
for (var W = 0; W <
|
|
5282
|
-
var te =
|
|
5283
|
-
a[z][te] = a[z][te] || /* @__PURE__ */ Object.create(null), a[z][te][I] =
|
|
5313
|
+
for (var W = 0; W < w.length; W++) {
|
|
5314
|
+
var te = w[W];
|
|
5315
|
+
a[z][te] = a[z][te] || /* @__PURE__ */ Object.create(null), a[z][te][I] = P;
|
|
5284
5316
|
}
|
|
5285
5317
|
}
|
|
5286
5318
|
}
|
|
5287
5319
|
return {
|
|
5288
|
-
isAllInverted:
|
|
5289
|
-
hasPerFieldRules:
|
|
5320
|
+
isAllInverted: f,
|
|
5321
|
+
hasPerFieldRules: y,
|
|
5290
5322
|
rules: a
|
|
5291
5323
|
};
|
|
5292
|
-
}, A.expandActions = function(
|
|
5293
|
-
for (var a = this[ee].aliases, u =
|
|
5294
|
-
var
|
|
5295
|
-
a.hasOwnProperty(
|
|
5324
|
+
}, A.expandActions = function(l) {
|
|
5325
|
+
for (var a = this[ee].aliases, u = Mt(l), f = 0; f < u.length; ) {
|
|
5326
|
+
var y = u[f++];
|
|
5327
|
+
a.hasOwnProperty(y) && (u = u.concat(a[y]));
|
|
5296
5328
|
}
|
|
5297
5329
|
return u;
|
|
5298
|
-
}, A.can = function(
|
|
5330
|
+
}, A.can = function(l, a, u) {
|
|
5299
5331
|
if (u && typeof u != "string")
|
|
5300
5332
|
throw new Error("Ability.can expects 3rd parameter to be a string. See https://stalniy.github.io/casl/abilities/2017/07/21/check-abilities.html#checking-fields for details");
|
|
5301
|
-
var
|
|
5302
|
-
return !!
|
|
5303
|
-
}, A.relevantRuleFor = function(
|
|
5304
|
-
for (var
|
|
5305
|
-
if (y
|
|
5306
|
-
return y
|
|
5333
|
+
var f = this.relevantRuleFor(l, a, u);
|
|
5334
|
+
return !!f && !f.inverted;
|
|
5335
|
+
}, A.relevantRuleFor = function(l, a, u) {
|
|
5336
|
+
for (var f = this.rulesFor(l, a, u), y = 0; y < f.length; y++)
|
|
5337
|
+
if (f[y].matches(a))
|
|
5338
|
+
return f[y];
|
|
5307
5339
|
return null;
|
|
5308
|
-
}, A.possibleRulesFor = function(
|
|
5309
|
-
var u = this.subjectName(a),
|
|
5310
|
-
return y
|
|
5311
|
-
}, A.mergeRulesFor = function(
|
|
5312
|
-
var u = this[ee].indexedRules,
|
|
5313
|
-
var
|
|
5314
|
-
return
|
|
5340
|
+
}, A.possibleRulesFor = function(l, a) {
|
|
5341
|
+
var u = this.subjectName(a), f = this[ee].mergedRules, y = u + "_" + l;
|
|
5342
|
+
return f[y] || (f[y] = this.mergeRulesFor(l, u)), f[y];
|
|
5343
|
+
}, A.mergeRulesFor = function(l, a) {
|
|
5344
|
+
var u = this[ee].indexedRules, f = [a, "all"].reduce(function(y, F) {
|
|
5345
|
+
var P = u[F];
|
|
5346
|
+
return P ? Object.assign(y, P[l], P.manage) : y;
|
|
5315
5347
|
}, []);
|
|
5316
|
-
return
|
|
5317
|
-
}, A.rulesFor = function(
|
|
5318
|
-
var
|
|
5319
|
-
return this[ee].hasPerFieldRules ?
|
|
5320
|
-
return
|
|
5321
|
-
}) :
|
|
5348
|
+
return f.filter(Boolean);
|
|
5349
|
+
}, A.rulesFor = function(l, a, u) {
|
|
5350
|
+
var f = this.possibleRulesFor(l, a);
|
|
5351
|
+
return this[ee].hasPerFieldRules ? f.filter(function(y) {
|
|
5352
|
+
return y.isRelevantFor(a, u);
|
|
5353
|
+
}) : f;
|
|
5322
5354
|
}, A.cannot = function() {
|
|
5323
5355
|
return !this.can.apply(this, arguments);
|
|
5324
5356
|
}, A.throwUnlessCan = function() {
|
|
5325
|
-
var
|
|
5357
|
+
var l;
|
|
5326
5358
|
console.warn(`
|
|
5327
5359
|
Ability.throwUnlessCan is deprecated and will be removed in 4.x version.
|
|
5328
5360
|
Please use "ForbiddenError.from(ability).throwUnlessCan(...)" instead.
|
|
5329
|
-
`.trim()), (
|
|
5330
|
-
}, A.on = function(
|
|
5331
|
-
var u = this[ee].events,
|
|
5332
|
-
return u[
|
|
5333
|
-
if (
|
|
5334
|
-
var
|
|
5335
|
-
u[
|
|
5361
|
+
`.trim()), (l = dr.from(this)).throwUnlessCan.apply(l, arguments);
|
|
5362
|
+
}, A.on = function(l, a) {
|
|
5363
|
+
var u = this[ee].events, f = !0;
|
|
5364
|
+
return u[l] || (u[l] = []), u[l].push(a), function() {
|
|
5365
|
+
if (f) {
|
|
5366
|
+
var y = u[l].indexOf(a);
|
|
5367
|
+
u[l].splice(y, 1), f = !1;
|
|
5336
5368
|
}
|
|
5337
5369
|
};
|
|
5338
|
-
}, A.emit = function(
|
|
5339
|
-
var u = this[ee].events[
|
|
5340
|
-
u && u.slice(0).forEach(function(
|
|
5341
|
-
return
|
|
5370
|
+
}, A.emit = function(l, a) {
|
|
5371
|
+
var u = this[ee].events[l];
|
|
5372
|
+
u && u.slice(0).forEach(function(f) {
|
|
5373
|
+
return f(a);
|
|
5342
5374
|
});
|
|
5343
5375
|
}, Ar(e, [{
|
|
5344
5376
|
key: "rules",
|
|
@@ -5365,96 +5397,96 @@ function Yr(e) {
|
|
|
5365
5397
|
return new Dr(Gr(e));
|
|
5366
5398
|
}
|
|
5367
5399
|
function Er(e, A, m) {
|
|
5368
|
-
const
|
|
5369
|
-
if (
|
|
5370
|
-
const
|
|
5371
|
-
|
|
5372
|
-
u(
|
|
5373
|
-
|
|
5400
|
+
const l = Array.isArray(e) ? e : [e], a = Yr(A), u = (w) => w.subject, f = (w) => a.can(w.action, u(w), w.field) ? !0 : w.coverSubject !== void 0 ? a.can(w.action, w.coverSubject, w.field) : !1, y = l.find((w) => !f(w));
|
|
5401
|
+
if (y) {
|
|
5402
|
+
const w = a.relevantRuleFor(
|
|
5403
|
+
y.action,
|
|
5404
|
+
u(y),
|
|
5405
|
+
y.field
|
|
5374
5406
|
);
|
|
5375
5407
|
return {
|
|
5376
5408
|
granted: !1,
|
|
5377
|
-
decisivePermission:
|
|
5378
|
-
decisiveRule:
|
|
5409
|
+
decisivePermission: y,
|
|
5410
|
+
decisiveRule: w ?? null
|
|
5379
5411
|
};
|
|
5380
5412
|
}
|
|
5381
|
-
const
|
|
5382
|
-
return { granted: !0, decisivePermission:
|
|
5413
|
+
const F = l[0], P = a.relevantRuleFor(F.action, u(F), F.field);
|
|
5414
|
+
return { granted: !0, decisivePermission: F, decisiveRule: P ?? null };
|
|
5383
5415
|
}
|
|
5384
5416
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
5385
5417
|
const Pr = () => {
|
|
5386
5418
|
};
|
|
5387
5419
|
function xr(e, A, m) {
|
|
5388
|
-
let
|
|
5389
|
-
ca(m) ?
|
|
5420
|
+
let l;
|
|
5421
|
+
ca(m) ? l = {
|
|
5390
5422
|
evaluating: m
|
|
5391
|
-
} :
|
|
5423
|
+
} : l = {};
|
|
5392
5424
|
const {
|
|
5393
5425
|
lazy: a = !1,
|
|
5394
5426
|
evaluating: u = void 0,
|
|
5395
|
-
shallow:
|
|
5396
|
-
onError:
|
|
5397
|
-
} =
|
|
5398
|
-
let
|
|
5399
|
-
return
|
|
5400
|
-
if (!
|
|
5427
|
+
shallow: f = !0,
|
|
5428
|
+
onError: y = Pr
|
|
5429
|
+
} = l, F = he(!a), P = f ? la(A) : he(A);
|
|
5430
|
+
let w = 0;
|
|
5431
|
+
return St(async (x) => {
|
|
5432
|
+
if (!F.value)
|
|
5401
5433
|
return;
|
|
5402
|
-
|
|
5403
|
-
const I =
|
|
5434
|
+
w++;
|
|
5435
|
+
const I = w;
|
|
5404
5436
|
let H = !1;
|
|
5405
5437
|
u && Promise.resolve().then(() => {
|
|
5406
5438
|
u.value = !0;
|
|
5407
5439
|
});
|
|
5408
5440
|
try {
|
|
5409
5441
|
const z = await e((W) => {
|
|
5410
|
-
|
|
5442
|
+
x(() => {
|
|
5411
5443
|
u && (u.value = !1), H || W();
|
|
5412
5444
|
});
|
|
5413
5445
|
});
|
|
5414
|
-
I ===
|
|
5446
|
+
I === w && (P.value = z);
|
|
5415
5447
|
} catch (z) {
|
|
5416
|
-
|
|
5448
|
+
y(z);
|
|
5417
5449
|
} finally {
|
|
5418
|
-
u && I ===
|
|
5450
|
+
u && I === w && (u.value = !1), H = !0;
|
|
5419
5451
|
}
|
|
5420
|
-
}), a ? jt(() => (
|
|
5452
|
+
}), a ? jt(() => (F.value = !0, P.value)) : P;
|
|
5421
5453
|
}
|
|
5422
5454
|
async function Vr(e) {
|
|
5423
|
-
const { sessionUser: A, validationManifest: m } = e, { requiredRoles:
|
|
5455
|
+
const { sessionUser: A, validationManifest: m } = e, { requiredRoles: l, requiredCaslPermissions: a, customValidationFunction: u } = m;
|
|
5424
5456
|
if (!A)
|
|
5425
5457
|
return { canAccess: !1 };
|
|
5426
|
-
if (
|
|
5458
|
+
if (l && l.length > 0 && !l.includes(A._role || ""))
|
|
5427
5459
|
return Promise.resolve({
|
|
5428
5460
|
canAccess: !1,
|
|
5429
5461
|
message: "User does not have permission to access"
|
|
5430
5462
|
});
|
|
5431
5463
|
if (a && a.length > 0) {
|
|
5432
|
-
const { granted:
|
|
5433
|
-
if (!
|
|
5464
|
+
const { granted: f } = Er(a, A.permissions);
|
|
5465
|
+
if (!f)
|
|
5434
5466
|
return Promise.resolve({
|
|
5435
5467
|
canAccess: !1,
|
|
5436
5468
|
message: "User does not have permission to access"
|
|
5437
5469
|
});
|
|
5438
5470
|
}
|
|
5439
5471
|
if (u) {
|
|
5440
|
-
const
|
|
5441
|
-
if (!
|
|
5442
|
-
return
|
|
5472
|
+
const f = await u();
|
|
5473
|
+
if (!f.canAccess)
|
|
5474
|
+
return f;
|
|
5443
5475
|
}
|
|
5444
5476
|
return Promise.resolve({ canAccess: !0 });
|
|
5445
5477
|
}
|
|
5446
5478
|
async function Fr(e, A) {
|
|
5447
5479
|
for (const m of e.matched)
|
|
5448
5480
|
if (m.meta.validationManifest) {
|
|
5449
|
-
const
|
|
5481
|
+
const l = await Vr({
|
|
5450
5482
|
sessionUser: A,
|
|
5451
5483
|
validationManifest: m.meta.validationManifest
|
|
5452
5484
|
});
|
|
5453
|
-
if (!
|
|
5485
|
+
if (!l.canAccess)
|
|
5454
5486
|
return {
|
|
5455
5487
|
canAccess: !1,
|
|
5456
|
-
message:
|
|
5457
|
-
redirectTo:
|
|
5488
|
+
message: l.message,
|
|
5489
|
+
redirectTo: wn
|
|
5458
5490
|
};
|
|
5459
5491
|
}
|
|
5460
5492
|
return {
|
|
@@ -5463,7 +5495,7 @@ async function Fr(e, A) {
|
|
|
5463
5495
|
}
|
|
5464
5496
|
var Ct = /* @__PURE__ */ ((e) => (e.Loading = "loading", e.Allowed = "allowed", e.Denied = "denied", e))(Ct || {});
|
|
5465
5497
|
function Or() {
|
|
5466
|
-
const e = va(), { sessionUser: A } =
|
|
5498
|
+
const e = va(), { sessionUser: A } = kt();
|
|
5467
5499
|
return xr(
|
|
5468
5500
|
async () => {
|
|
5469
5501
|
e.matched;
|
|
@@ -5513,17 +5545,17 @@ const qr = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml
|
|
|
5513
5545
|
"th-TH": zr
|
|
5514
5546
|
}
|
|
5515
5547
|
});
|
|
5516
|
-
return (m,
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5548
|
+
return (m, l) => (xe(), Tt("div", Sr, [
|
|
5549
|
+
Me("div", Ur, [
|
|
5550
|
+
Me("div", Tr, [
|
|
5551
|
+
Me("img", {
|
|
5520
5552
|
src: Ce(qr),
|
|
5521
5553
|
class: "w-full h-full"
|
|
5522
5554
|
}, null, 8, Wr)
|
|
5523
5555
|
]),
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5556
|
+
Me("div", null, [
|
|
5557
|
+
Me("h1", kr, Qt(Ce(A)("noPermission.title")), 1),
|
|
5558
|
+
Me("h2", Kr, Qt(Ce(A)("noPermission.subtitle")), 1)
|
|
5527
5559
|
])
|
|
5528
5560
|
])
|
|
5529
5561
|
]));
|
|
@@ -5532,20 +5564,20 @@ const qr = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml
|
|
|
5532
5564
|
__name: "PermissionWrapper",
|
|
5533
5565
|
setup(e) {
|
|
5534
5566
|
const A = Or();
|
|
5535
|
-
return (m,
|
|
5567
|
+
return (m, l) => Ce(A) === Ce(Ct).Denied ? (xe(), Ke(Lr, { key: 0 })) : Ce(A) === Ce(Ct).Allowed ? Ut(m.$slots, "default", { key: 1 }) : Aa("", !0);
|
|
5536
5568
|
}
|
|
5537
5569
|
});
|
|
5538
5570
|
function Le(e) {
|
|
5539
5571
|
return {
|
|
5540
5572
|
inheritAttrs: !1,
|
|
5541
5573
|
setup(A, { attrs: m }) {
|
|
5542
|
-
return () =>
|
|
5574
|
+
return () => Xt(Jr, {}, { default: () => Xt(e, m) });
|
|
5543
5575
|
}
|
|
5544
5576
|
};
|
|
5545
5577
|
}
|
|
5546
5578
|
function _r(e, A) {
|
|
5547
5579
|
const m = he({ top: 0, bottom: 0, left: 0, right: 0 });
|
|
5548
|
-
function
|
|
5580
|
+
function l() {
|
|
5549
5581
|
if (e.value) {
|
|
5550
5582
|
const u = e.value.getBoundingClientRect();
|
|
5551
5583
|
m.value = {
|
|
@@ -5558,40 +5590,40 @@ function _r(e, A) {
|
|
|
5558
5590
|
}
|
|
5559
5591
|
let a = null;
|
|
5560
5592
|
return ua(e, async (u) => {
|
|
5561
|
-
u && (await ma(),
|
|
5562
|
-
}),
|
|
5563
|
-
window.addEventListener("resize",
|
|
5593
|
+
u && (await ma(), l());
|
|
5594
|
+
}), Wt(() => {
|
|
5595
|
+
window.addEventListener("resize", l), a = new ResizeObserver(l), a.observe(document.body);
|
|
5564
5596
|
}), ga(() => {
|
|
5565
|
-
window.removeEventListener("resize",
|
|
5597
|
+
window.removeEventListener("resize", l), a == null || a.disconnect(), a = null;
|
|
5566
5598
|
}), m;
|
|
5567
5599
|
}
|
|
5568
5600
|
const $r = /* @__PURE__ */ Pe({
|
|
5569
5601
|
__name: "FullWrapper",
|
|
5570
5602
|
setup(e) {
|
|
5571
|
-
const A = ya(), m = he(null),
|
|
5572
|
-
var
|
|
5573
|
-
const
|
|
5603
|
+
const A = ya(), m = he(null), l = _r(m), a = jt(() => {
|
|
5604
|
+
var y;
|
|
5605
|
+
const f = A.isAtMost("sm") ? 56 : 0;
|
|
5574
5606
|
return {
|
|
5575
|
-
height: `calc(100dvh - ${((
|
|
5607
|
+
height: `calc(100dvh - ${((y = l.value) == null ? void 0 : y.top) + 24 + f}px)`
|
|
5576
5608
|
};
|
|
5577
5609
|
});
|
|
5578
|
-
return (u,
|
|
5610
|
+
return (u, f) => (xe(), Tt("div", {
|
|
5579
5611
|
ref_key: "wrapper",
|
|
5580
5612
|
ref: m,
|
|
5581
5613
|
style: da(a.value)
|
|
5582
5614
|
}, [
|
|
5583
|
-
|
|
5615
|
+
Ut(u.$slots, "default")
|
|
5584
5616
|
], 4));
|
|
5585
5617
|
}
|
|
5586
5618
|
}), eo = { class: "flex justify-center items-center h-full w-full" }, to = /* @__PURE__ */ Pe({
|
|
5587
5619
|
__name: "PageLoading",
|
|
5588
5620
|
setup(e) {
|
|
5589
5621
|
return (A, m) => {
|
|
5590
|
-
const
|
|
5622
|
+
const l = Gt("FmCircularProgress");
|
|
5591
5623
|
return xe(), Ke($r, null, {
|
|
5592
5624
|
default: pa(() => [
|
|
5593
|
-
|
|
5594
|
-
ba(
|
|
5625
|
+
Me("div", eo, [
|
|
5626
|
+
ba(l, { size: "xl" })
|
|
5595
5627
|
])
|
|
5596
5628
|
]),
|
|
5597
5629
|
_: 1
|
|
@@ -5612,10 +5644,10 @@ const Ue = (e) => ({
|
|
|
5612
5644
|
}
|
|
5613
5645
|
]
|
|
5614
5646
|
}
|
|
5615
|
-
}), so = Le(Ae(() => import("./Main-
|
|
5616
|
-
Ae(() => import("./AuditLogList-
|
|
5617
|
-
), ro = Le(Ae(() => import("./Main-
|
|
5618
|
-
() => import("./PermissionSetList-
|
|
5647
|
+
}), so = Le(Ae(() => import("./Main-CyCfz4ka.js"))), ao = Le(Ae(() => import("./Main-Cz1pfe2k.js"))), no = Le(
|
|
5648
|
+
Ae(() => import("./AuditLogList-CXUkbDyT.js"))
|
|
5649
|
+
), ro = Le(Ae(() => import("./Main-CblWfQk_.js"))), oo = Ae(() => import("./ApprovalCodeList-CXJyMKEg.js")), io = Ae(() => import("./GrantUserList-DKP4MBQM.js")), co = Ae(() => import("./EmployeeList-BSfUFTcN.js")), lo = Ae(() => import("./RoleList-CXYgCmHp.js")), Ao = Ae(() => import("./TimesheetList-s_bP5OGA.js")), uo = Ae(() => import("./TeamMemberList-CnLbqaPS.js")), mo = Ae(
|
|
5650
|
+
() => import("./PermissionSetList-BwyblSeE.js")
|
|
5619
5651
|
), Eo = [
|
|
5620
5652
|
{
|
|
5621
5653
|
path: "/",
|
|
@@ -5707,11 +5739,10 @@ const Ue = (e) => ({
|
|
|
5707
5739
|
__name: "Navigator",
|
|
5708
5740
|
emits: ["close-navigation"],
|
|
5709
5741
|
setup(e, { emit: A }) {
|
|
5710
|
-
const m = A, { t:
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
label: i("hr.employee.title"),
|
|
5742
|
+
const m = A, { t: l } = Kt(), a = ha(), u = jt(() => {
|
|
5743
|
+
const y = [];
|
|
5744
|
+
return y.push({
|
|
5745
|
+
label: l("hr.employee.title"),
|
|
5715
5746
|
value: "employee",
|
|
5716
5747
|
action: () => {
|
|
5717
5748
|
a.push({
|
|
@@ -5719,8 +5750,8 @@ const Ue = (e) => ({
|
|
|
5719
5750
|
query: a.currentRoute.value.query
|
|
5720
5751
|
}), m("close-navigation");
|
|
5721
5752
|
}
|
|
5722
|
-
}),
|
|
5723
|
-
label:
|
|
5753
|
+
}), y.push({
|
|
5754
|
+
label: l("team.title"),
|
|
5724
5755
|
value: "team-member",
|
|
5725
5756
|
action: () => {
|
|
5726
5757
|
a.push({
|
|
@@ -5728,16 +5759,16 @@ const Ue = (e) => ({
|
|
|
5728
5759
|
query: a.currentRoute.value.query
|
|
5729
5760
|
}), m("close-navigation");
|
|
5730
5761
|
}
|
|
5731
|
-
}),
|
|
5732
|
-
label:
|
|
5762
|
+
}), y.push({
|
|
5763
|
+
label: l("auditLog.title"),
|
|
5733
5764
|
value: "audit-log",
|
|
5734
5765
|
action: () => {
|
|
5735
5766
|
a.push({
|
|
5736
5767
|
name: U.AUDIT_LOG
|
|
5737
5768
|
}), m("close-navigation");
|
|
5738
5769
|
}
|
|
5739
|
-
}),
|
|
5740
|
-
label: (
|
|
5770
|
+
}), y.push({
|
|
5771
|
+
label: l("posAccess.title"),
|
|
5741
5772
|
value: "pos-access",
|
|
5742
5773
|
action: () => {
|
|
5743
5774
|
a.push({
|
|
@@ -5745,39 +5776,39 @@ const Ue = (e) => ({
|
|
|
5745
5776
|
query: a.currentRoute.value.query
|
|
5746
5777
|
}), m("close-navigation");
|
|
5747
5778
|
}
|
|
5748
|
-
}),
|
|
5749
|
-
}),
|
|
5750
|
-
return
|
|
5751
|
-
var
|
|
5752
|
-
let
|
|
5753
|
-
switch (
|
|
5779
|
+
}), y;
|
|
5780
|
+
}), f = he();
|
|
5781
|
+
return St(() => {
|
|
5782
|
+
var F;
|
|
5783
|
+
let y = (F = a.currentRoute.value) == null ? void 0 : F.name;
|
|
5784
|
+
switch (y) {
|
|
5754
5785
|
case U.EMPLOYEE:
|
|
5755
5786
|
case U.ROLE:
|
|
5756
5787
|
case U.TIMESHEET:
|
|
5757
|
-
|
|
5788
|
+
y = U.EMPLOYEE;
|
|
5758
5789
|
break;
|
|
5759
5790
|
case U.TEAM_MEMBER:
|
|
5760
5791
|
case U.TEAM_ROLE:
|
|
5761
|
-
|
|
5792
|
+
y = U.TEAM_MEMBER;
|
|
5762
5793
|
break;
|
|
5763
5794
|
case U.AUDIT_LOG:
|
|
5764
|
-
|
|
5795
|
+
y = U.AUDIT_LOG;
|
|
5765
5796
|
break;
|
|
5766
5797
|
case U.APPROVAL_CODE:
|
|
5767
5798
|
case U.POS_GRANT:
|
|
5768
5799
|
case U.POS_ACCESS:
|
|
5769
|
-
|
|
5800
|
+
y = "pos-access";
|
|
5770
5801
|
break;
|
|
5771
5802
|
default:
|
|
5772
|
-
|
|
5803
|
+
y = U.EMPLOYEE;
|
|
5773
5804
|
}
|
|
5774
|
-
|
|
5775
|
-
}), (
|
|
5776
|
-
const
|
|
5777
|
-
return xe(), Ke(
|
|
5778
|
-
modelValue:
|
|
5779
|
-
"onUpdate:modelValue":
|
|
5780
|
-
items:
|
|
5805
|
+
f.value !== y && (f.value = y);
|
|
5806
|
+
}), (y, F) => {
|
|
5807
|
+
const P = Gt("FmCollapsibleTabs");
|
|
5808
|
+
return xe(), Ke(P, {
|
|
5809
|
+
modelValue: f.value,
|
|
5810
|
+
"onUpdate:modelValue": F[0] || (F[0] = (w) => f.value = w),
|
|
5811
|
+
items: u.value,
|
|
5781
5812
|
class: "py-16"
|
|
5782
5813
|
}, null, 8, ["modelValue", "items"]);
|
|
5783
5814
|
};
|
|
@@ -5785,10 +5816,10 @@ const Ue = (e) => ({
|
|
|
5785
5816
|
});
|
|
5786
5817
|
var Dt = { exports: {} };
|
|
5787
5818
|
(function(e, A) {
|
|
5788
|
-
(function(m,
|
|
5789
|
-
|
|
5819
|
+
(function(m, l) {
|
|
5820
|
+
l(A);
|
|
5790
5821
|
})(Ne, function(m) {
|
|
5791
|
-
var
|
|
5822
|
+
var l = { getItemSync: function(d) {
|
|
5792
5823
|
try {
|
|
5793
5824
|
return localStorage.getItem(d) || null;
|
|
5794
5825
|
} catch {
|
|
@@ -5796,160 +5827,160 @@ var Dt = { exports: {} };
|
|
|
5796
5827
|
}
|
|
5797
5828
|
}, getItem: function(d, n) {
|
|
5798
5829
|
var s = this;
|
|
5799
|
-
return new Promise(function(
|
|
5830
|
+
return new Promise(function(c, r) {
|
|
5800
5831
|
try {
|
|
5801
5832
|
var p = s.getItemSync(d);
|
|
5802
|
-
n == null || n(null, p),
|
|
5803
|
-
} catch (
|
|
5804
|
-
n && n(
|
|
5833
|
+
n == null || n(null, p), c(p);
|
|
5834
|
+
} catch (h) {
|
|
5835
|
+
n && n(h, null), r(h);
|
|
5805
5836
|
}
|
|
5806
5837
|
});
|
|
5807
5838
|
}, setItem: function(d, n, s) {
|
|
5808
|
-
return new Promise(function(
|
|
5839
|
+
return new Promise(function(c, r) {
|
|
5809
5840
|
try {
|
|
5810
|
-
localStorage.setItem(d, n), s && s(null, n),
|
|
5841
|
+
localStorage.setItem(d, n), s && s(null, n), c(n);
|
|
5811
5842
|
} catch (p) {
|
|
5812
5843
|
s && s(p, null), r(p);
|
|
5813
5844
|
}
|
|
5814
5845
|
});
|
|
5815
5846
|
} }, a = function() {
|
|
5816
5847
|
return a = Object.assign || function(d) {
|
|
5817
|
-
for (var n, s = 1,
|
|
5848
|
+
for (var n, s = 1, c = arguments.length; s < c; s++) for (var r in n = arguments[s]) Object.prototype.hasOwnProperty.call(n, r) && (d[r] = n[r]);
|
|
5818
5849
|
return d;
|
|
5819
5850
|
}, a.apply(this, arguments);
|
|
5820
5851
|
};
|
|
5821
|
-
function u(d, n, s,
|
|
5852
|
+
function u(d, n, s, c) {
|
|
5822
5853
|
return new (s || (s = Promise))(function(r, p) {
|
|
5823
|
-
function
|
|
5854
|
+
function h(O) {
|
|
5824
5855
|
try {
|
|
5825
|
-
|
|
5826
|
-
} catch (
|
|
5827
|
-
p(
|
|
5856
|
+
Y(c.next(O));
|
|
5857
|
+
} catch (M) {
|
|
5858
|
+
p(M);
|
|
5828
5859
|
}
|
|
5829
5860
|
}
|
|
5830
5861
|
function j(O) {
|
|
5831
5862
|
try {
|
|
5832
|
-
|
|
5833
|
-
} catch (
|
|
5834
|
-
p(
|
|
5863
|
+
Y(c.throw(O));
|
|
5864
|
+
} catch (M) {
|
|
5865
|
+
p(M);
|
|
5835
5866
|
}
|
|
5836
5867
|
}
|
|
5837
|
-
function
|
|
5838
|
-
var
|
|
5839
|
-
O.done ? r(O.value) : (
|
|
5840
|
-
X(
|
|
5841
|
-
})).then(
|
|
5868
|
+
function Y(O) {
|
|
5869
|
+
var M;
|
|
5870
|
+
O.done ? r(O.value) : (M = O.value, M instanceof s ? M : new s(function(X) {
|
|
5871
|
+
X(M);
|
|
5872
|
+
})).then(h, j);
|
|
5842
5873
|
}
|
|
5843
|
-
|
|
5874
|
+
Y((c = c.apply(d, [])).next());
|
|
5844
5875
|
});
|
|
5845
5876
|
}
|
|
5846
|
-
function
|
|
5847
|
-
var s,
|
|
5877
|
+
function f(d, n) {
|
|
5878
|
+
var s, c, r, p, h = { label: 0, sent: function() {
|
|
5848
5879
|
if (1 & r[0]) throw r[1];
|
|
5849
5880
|
return r[1];
|
|
5850
5881
|
}, trys: [], ops: [] };
|
|
5851
5882
|
return p = { next: j(0), throw: j(1), return: j(2) }, typeof Symbol == "function" && (p[Symbol.iterator] = function() {
|
|
5852
5883
|
return this;
|
|
5853
5884
|
}), p;
|
|
5854
|
-
function j(
|
|
5885
|
+
function j(Y) {
|
|
5855
5886
|
return function(O) {
|
|
5856
|
-
return function(
|
|
5887
|
+
return function(M) {
|
|
5857
5888
|
if (s) throw new TypeError("Generator is already executing.");
|
|
5858
|
-
for (;
|
|
5859
|
-
if (s = 1,
|
|
5860
|
-
switch (
|
|
5889
|
+
for (; h; ) try {
|
|
5890
|
+
if (s = 1, c && (r = 2 & M[0] ? c.return : M[0] ? c.throw || ((r = c.return) && r.call(c), 0) : c.next) && !(r = r.call(c, M[1])).done) return r;
|
|
5891
|
+
switch (c = 0, r && (M = [2 & M[0], r.value]), M[0]) {
|
|
5861
5892
|
case 0:
|
|
5862
5893
|
case 1:
|
|
5863
|
-
r =
|
|
5894
|
+
r = M;
|
|
5864
5895
|
break;
|
|
5865
5896
|
case 4:
|
|
5866
|
-
return
|
|
5897
|
+
return h.label++, { value: M[1], done: !1 };
|
|
5867
5898
|
case 5:
|
|
5868
|
-
|
|
5899
|
+
h.label++, c = M[1], M = [0];
|
|
5869
5900
|
continue;
|
|
5870
5901
|
case 7:
|
|
5871
|
-
|
|
5902
|
+
M = h.ops.pop(), h.trys.pop();
|
|
5872
5903
|
continue;
|
|
5873
5904
|
default:
|
|
5874
|
-
if (r =
|
|
5875
|
-
|
|
5905
|
+
if (r = h.trys, !((r = r.length > 0 && r[r.length - 1]) || M[0] !== 6 && M[0] !== 2)) {
|
|
5906
|
+
h = 0;
|
|
5876
5907
|
continue;
|
|
5877
5908
|
}
|
|
5878
|
-
if (
|
|
5879
|
-
|
|
5909
|
+
if (M[0] === 3 && (!r || M[1] > r[0] && M[1] < r[3])) {
|
|
5910
|
+
h.label = M[1];
|
|
5880
5911
|
break;
|
|
5881
5912
|
}
|
|
5882
|
-
if (
|
|
5883
|
-
|
|
5913
|
+
if (M[0] === 6 && h.label < r[1]) {
|
|
5914
|
+
h.label = r[1], r = M;
|
|
5884
5915
|
break;
|
|
5885
5916
|
}
|
|
5886
|
-
if (r &&
|
|
5887
|
-
|
|
5917
|
+
if (r && h.label < r[2]) {
|
|
5918
|
+
h.label = r[2], h.ops.push(M);
|
|
5888
5919
|
break;
|
|
5889
5920
|
}
|
|
5890
|
-
r[2] &&
|
|
5921
|
+
r[2] && h.ops.pop(), h.trys.pop();
|
|
5891
5922
|
continue;
|
|
5892
5923
|
}
|
|
5893
|
-
|
|
5924
|
+
M = n.call(d, h);
|
|
5894
5925
|
} catch (X) {
|
|
5895
|
-
|
|
5926
|
+
M = [6, X], c = 0;
|
|
5896
5927
|
} finally {
|
|
5897
5928
|
s = r = 0;
|
|
5898
5929
|
}
|
|
5899
|
-
if (5 &
|
|
5900
|
-
return { value:
|
|
5901
|
-
}([
|
|
5930
|
+
if (5 & M[0]) throw M[1];
|
|
5931
|
+
return { value: M[0] ? M[1] : void 0, done: !0 };
|
|
5932
|
+
}([Y, O]);
|
|
5902
5933
|
};
|
|
5903
5934
|
}
|
|
5904
5935
|
}
|
|
5905
|
-
function
|
|
5906
|
-
for (var
|
|
5907
|
-
return d.concat(
|
|
5936
|
+
function y(d, n, s) {
|
|
5937
|
+
for (var c, r = 0, p = n.length; r < p; r++) !c && r in n || (c || (c = Array.prototype.slice.call(n, 0, r)), c[r] = n[r]);
|
|
5938
|
+
return d.concat(c || Array.prototype.slice.call(n));
|
|
5908
5939
|
}
|
|
5909
|
-
var
|
|
5940
|
+
var F = function d(n, s) {
|
|
5910
5941
|
if (n === s) return !0;
|
|
5911
5942
|
if (n && s && typeof n == "object" && typeof s == "object") {
|
|
5912
5943
|
if (n.constructor !== s.constructor) return !1;
|
|
5913
|
-
var
|
|
5944
|
+
var c, r, p;
|
|
5914
5945
|
if (Array.isArray(n)) {
|
|
5915
|
-
if ((
|
|
5916
|
-
for (r =
|
|
5946
|
+
if ((c = n.length) != s.length) return !1;
|
|
5947
|
+
for (r = c; r-- != 0; ) if (!d(n[r], s[r])) return !1;
|
|
5917
5948
|
return !0;
|
|
5918
5949
|
}
|
|
5919
5950
|
if (n.constructor === RegExp) return n.source === s.source && n.flags === s.flags;
|
|
5920
5951
|
if (n.valueOf !== Object.prototype.valueOf) return n.valueOf() === s.valueOf();
|
|
5921
5952
|
if (n.toString !== Object.prototype.toString) return n.toString() === s.toString();
|
|
5922
|
-
if ((
|
|
5923
|
-
for (r =
|
|
5924
|
-
for (r =
|
|
5925
|
-
var
|
|
5926
|
-
if (!d(n[
|
|
5953
|
+
if ((c = (p = Object.keys(n)).length) !== Object.keys(s).length) return !1;
|
|
5954
|
+
for (r = c; r-- != 0; ) if (!Object.prototype.hasOwnProperty.call(s, p[r])) return !1;
|
|
5955
|
+
for (r = c; r-- != 0; ) {
|
|
5956
|
+
var h = p[r];
|
|
5957
|
+
if (!d(n[h], s[h])) return !1;
|
|
5927
5958
|
}
|
|
5928
5959
|
return !0;
|
|
5929
5960
|
}
|
|
5930
5961
|
return n != n && s != s;
|
|
5931
5962
|
};
|
|
5932
|
-
function
|
|
5933
|
-
var s = Object.keys(n || {}).filter(function(
|
|
5934
|
-
var r = d == null ? void 0 : d[
|
|
5935
|
-
return !
|
|
5963
|
+
function P(d, n) {
|
|
5964
|
+
var s = Object.keys(n || {}).filter(function(c) {
|
|
5965
|
+
var r = d == null ? void 0 : d[c], p = n == null ? void 0 : n[c];
|
|
5966
|
+
return !F(r, p);
|
|
5936
5967
|
});
|
|
5937
|
-
return Object.keys(d || {}).filter(function(
|
|
5938
|
-
Object.keys(n || {}).includes(
|
|
5968
|
+
return Object.keys(d || {}).filter(function(c) {
|
|
5969
|
+
Object.keys(n || {}).includes(c) || s.push(c);
|
|
5939
5970
|
}), Object.keys(s).length ? s : null;
|
|
5940
5971
|
}
|
|
5941
|
-
var
|
|
5972
|
+
var w, x;
|
|
5942
5973
|
function I(d, n, s) {
|
|
5943
|
-
var
|
|
5944
|
-
typeof s == "number" && (
|
|
5974
|
+
var c = "shortString", r = !0;
|
|
5975
|
+
typeof s == "number" && (c = "javaDouble", r = !1), d[c] = d[c] || {}, d[c][n] = r ? s + "" : s;
|
|
5945
5976
|
}
|
|
5946
5977
|
function H(d) {
|
|
5947
5978
|
return !!d && typeof d == "object" && d.value !== void 0;
|
|
5948
5979
|
}
|
|
5949
5980
|
function z(d) {
|
|
5950
5981
|
return Object.fromEntries(Object.entries(d).map(function(n) {
|
|
5951
|
-
var s = n[0],
|
|
5952
|
-
return [s, H(
|
|
5982
|
+
var s = n[0], c = n[1];
|
|
5983
|
+
return [s, H(c) ? c : { value: c }];
|
|
5953
5984
|
}));
|
|
5954
5985
|
}
|
|
5955
5986
|
function W(d) {
|
|
@@ -5957,17 +5988,17 @@ var Dt = { exports: {} };
|
|
|
5957
5988
|
}
|
|
5958
5989
|
(function(d) {
|
|
5959
5990
|
d.NONE = "NONE", d.DEFAULT_FLAGS = "DEFAULT_FLAGS", d.CACHE = "CACHE", d.SERVER = "SERVER";
|
|
5960
|
-
})(
|
|
5991
|
+
})(w || (w = {}));
|
|
5961
5992
|
var te, k = null, Je = "FLAGSMITH_EVENT", ie = Je, Be = "https://edge.api.flagsmith.com/api/v1/", Ve = "flagsmith_value_", Ze = "flagsmith_enabled_", Fe = "flagsmith_trait_", Oe = function() {
|
|
5962
5993
|
function d(n) {
|
|
5963
5994
|
var s = this;
|
|
5964
5995
|
this._trigger = null, this._triggerLoadingState = null, this.timestamp = null, this.isLoading = !1, this.eventSource = null, this.getFlags = function() {
|
|
5965
|
-
var
|
|
5996
|
+
var c = s, r = c.api, p = c.evaluationContext;
|
|
5966
5997
|
s.log("Get Flags"), s.isLoading = !0, s.loadingState.isFetching || s.setLoadingState(a(a({}, s.loadingState), { isFetching: !0 }));
|
|
5967
|
-
var
|
|
5968
|
-
var O,
|
|
5969
|
-
if (
|
|
5970
|
-
var ue =
|
|
5998
|
+
var h = "".concat(s.getContext().identity), j = function(Y) {
|
|
5999
|
+
var O, M, X, L;
|
|
6000
|
+
if (Y && h === "".concat(s.getContext().identity)) {
|
|
6001
|
+
var ue = Y.flags, se = Y.traits, ce = Y.identifier;
|
|
5971
6002
|
s.isLoading = !1;
|
|
5972
6003
|
var ae = {}, ne = {};
|
|
5973
6004
|
se = se || [], (ue = ue || []).forEach(function(Q) {
|
|
@@ -5975,11 +6006,11 @@ var Dt = { exports: {} };
|
|
|
5975
6006
|
}), se.forEach(function(Q) {
|
|
5976
6007
|
ne[Q.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: Q.transient, value: Q.trait_value };
|
|
5977
6008
|
}), s.oldFlags = a({}, s.flags);
|
|
5978
|
-
var me =
|
|
5979
|
-
if ((ce || Object.keys(ne).length) && (s.evaluationContext.identity = a(a({}, s.evaluationContext.identity), { traits: ne }), ce && (s.evaluationContext.identity.identifier = ce)), s.flags = ae, s.updateStorage(), s._onChange(s.oldFlags, { isFromServer: !0, flagsChanged: me, traitsChanged: qe }, s._loadedState(null,
|
|
6009
|
+
var me = P(s.oldFlags, ae), qe = P((O = s.evaluationContext.identity) === null || O === void 0 ? void 0 : O.traits, ne);
|
|
6010
|
+
if ((ce || Object.keys(ne).length) && (s.evaluationContext.identity = a(a({}, s.evaluationContext.identity), { traits: ne }), ce && (s.evaluationContext.identity.identifier = ce)), s.flags = ae, s.updateStorage(), s._onChange(s.oldFlags, { isFromServer: !0, flagsChanged: me, traitsChanged: qe }, s._loadedState(null, w.SERVER)), s.datadogRum) try {
|
|
5980
6011
|
if (s.datadogRum.trackTraits) {
|
|
5981
6012
|
var He = {};
|
|
5982
|
-
Object.keys(((
|
|
6013
|
+
Object.keys(((M = s.evaluationContext.identity) === null || M === void 0 ? void 0 : M.traits) || {}).map(function(Q) {
|
|
5983
6014
|
He[Fe + Q] = s.getTrait(Q);
|
|
5984
6015
|
});
|
|
5985
6016
|
var De = a(a(a({}, s.datadogRum.client.getUser()), { id: s.datadogRum.client.getUser().id || ((X = s.evaluationContext.identity) === null || X === void 0 ? void 0 : X.identifier) }), He);
|
|
@@ -6000,22 +6031,22 @@ var Dt = { exports: {} };
|
|
|
6000
6031
|
}
|
|
6001
6032
|
}
|
|
6002
6033
|
};
|
|
6003
|
-
return p.identity ? Promise.all([p.identity.traits && Object.keys(p.identity.traits).length || !p.identity.identifier ? s.getJSON(r + "identities/", "POST", JSON.stringify({ identifier: p.identity.identifier, transient: p.identity.transient, traits: Object.entries(p.identity.traits).map(function(
|
|
6004
|
-
var O =
|
|
6005
|
-
return { trait_key: O, trait_value:
|
|
6006
|
-
}).filter(function(
|
|
6007
|
-
return
|
|
6008
|
-
}) })) : s.getJSON(r + "identities/?identifier=" + encodeURIComponent(p.identity.identifier) + (p.identity.transient ? "&transient=true" : ""))]).then(function(
|
|
6009
|
-
return s.evaluationContext.identity = a(a({}, s.evaluationContext.identity), { traits: {} }), j(
|
|
6010
|
-
}).catch(function(
|
|
6011
|
-
var O =
|
|
6012
|
-
return Promise.reject(
|
|
6013
|
-
}) : s.getJSON(r + "flags/").then(function(
|
|
6014
|
-
return j({ flags:
|
|
6034
|
+
return p.identity ? Promise.all([p.identity.traits && Object.keys(p.identity.traits).length || !p.identity.identifier ? s.getJSON(r + "identities/", "POST", JSON.stringify({ identifier: p.identity.identifier, transient: p.identity.transient, traits: Object.entries(p.identity.traits).map(function(Y) {
|
|
6035
|
+
var O = Y[0], M = Y[1];
|
|
6036
|
+
return { trait_key: O, trait_value: M == null ? void 0 : M.value, transient: M == null ? void 0 : M.transient };
|
|
6037
|
+
}).filter(function(Y) {
|
|
6038
|
+
return Y.trait_value !== void 0 || (s.log("Warning - attempted to set an undefined trait value for key", Y.trait_key), !1);
|
|
6039
|
+
}) })) : s.getJSON(r + "identities/?identifier=" + encodeURIComponent(p.identity.identifier) + (p.identity.transient ? "&transient=true" : ""))]).then(function(Y) {
|
|
6040
|
+
return s.evaluationContext.identity = a(a({}, s.evaluationContext.identity), { traits: {} }), j(Y == null ? void 0 : Y[0]);
|
|
6041
|
+
}).catch(function(Y) {
|
|
6042
|
+
var O = Y.message, M = new Error(O);
|
|
6043
|
+
return Promise.reject(M);
|
|
6044
|
+
}) : s.getJSON(r + "flags/").then(function(Y) {
|
|
6045
|
+
return j({ flags: Y, traits: void 0 });
|
|
6015
6046
|
});
|
|
6016
6047
|
}, this.analyticsFlags = function() {
|
|
6017
|
-
var
|
|
6018
|
-
if (s.evaluationEvent && s.evaluationContext.environment && s.evaluationEvent[s.evaluationContext.environment.apiKey]) return s.evaluationEvent && Object.getOwnPropertyNames(s.evaluationEvent).length !== 0 && Object.getOwnPropertyNames(s.evaluationEvent[s.evaluationContext.environment.apiKey]).length !== 0 ? s.getJSON(
|
|
6048
|
+
var c = s.api;
|
|
6049
|
+
if (s.evaluationEvent && s.evaluationContext.environment && s.evaluationEvent[s.evaluationContext.environment.apiKey]) return s.evaluationEvent && Object.getOwnPropertyNames(s.evaluationEvent).length !== 0 && Object.getOwnPropertyNames(s.evaluationEvent[s.evaluationContext.environment.apiKey]).length !== 0 ? s.getJSON(c + "analytics/flags/", "POST", JSON.stringify(s.evaluationEvent[s.evaluationContext.environment.apiKey])).then(function(r) {
|
|
6019
6050
|
if (s.evaluationContext.environment) {
|
|
6020
6051
|
var p = s.getState();
|
|
6021
6052
|
s.evaluationEvent || (s.evaluationEvent = {}), s.evaluationEvent[s.evaluationContext.environment.apiKey] = {}, s.setState(a(a({}, p), { evaluationEvent: s.evaluationEvent })), s.updateEventStorage();
|
|
@@ -6023,56 +6054,56 @@ var Dt = { exports: {} };
|
|
|
6023
6054
|
}).catch(function(r) {
|
|
6024
6055
|
s.log("Exception fetching evaluationEvent", r);
|
|
6025
6056
|
}) : void 0;
|
|
6026
|
-
}, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source:
|
|
6027
|
-
var
|
|
6028
|
-
if (
|
|
6057
|
+
}, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source: w.NONE }, this.canUseStorage = !1, this.analyticsInterval = null, this.api = null, this.cacheFlags = !1, this.ts = null, this.enableAnalytics = !1, this.enableLogs = !1, this.evaluationContext = {}, this.evaluationEvent = null, this.flags = null, this.getFlagInterval = null, this.headers = null, this.initialised = !1, this.oldFlags = null, this.onChange = null, this.onError = null, this.ticks = null, this.timer = null, this.dtrum = null, this.withTraits = null, this.cacheOptions = { ttl: 0, skipAPI: !1, loadStale: !1, storageKey: void 0 }, this.getValue = function(c, r, p) {
|
|
6058
|
+
var h = s.flags && s.flags[c.toLowerCase().replace(/ /g, "_")], j = null;
|
|
6059
|
+
if (h && (j = h.value), r != null && r.skipAnalytics || p || s.evaluateFlag(c, "VALUE"), j === null && (r == null ? void 0 : r.fallback) !== void 0) return r.fallback;
|
|
6029
6060
|
if (r != null && r.json) try {
|
|
6030
|
-
return j === null ? (s.log("Tried to parse null flag as JSON: " +
|
|
6061
|
+
return j === null ? (s.log("Tried to parse null flag as JSON: " + c), null) : JSON.parse(j);
|
|
6031
6062
|
} catch {
|
|
6032
6063
|
return r.fallback;
|
|
6033
6064
|
}
|
|
6034
6065
|
return j;
|
|
6035
|
-
}, this.getTrait = function(
|
|
6066
|
+
}, this.getTrait = function(c) {
|
|
6036
6067
|
var r, p;
|
|
6037
|
-
return ((r = s.evaluationContext.identity) === null || r === void 0 ? void 0 : r.traits) && ((p = s.evaluationContext.identity.traits[
|
|
6068
|
+
return ((r = s.evaluationContext.identity) === null || r === void 0 ? void 0 : r.traits) && ((p = s.evaluationContext.identity.traits[c.toLowerCase().replace(/ /g, "_")]) === null || p === void 0 ? void 0 : p.value);
|
|
6038
6069
|
}, this.getAllTraits = function() {
|
|
6039
|
-
var
|
|
6040
|
-
return Object.fromEntries(Object.entries(((
|
|
6041
|
-
var p = r[0],
|
|
6042
|
-
return [p,
|
|
6070
|
+
var c;
|
|
6071
|
+
return Object.fromEntries(Object.entries(((c = s.evaluationContext.identity) === null || c === void 0 ? void 0 : c.traits) || {}).map(function(r) {
|
|
6072
|
+
var p = r[0], h = r[1];
|
|
6073
|
+
return [p, h == null ? void 0 : h.value];
|
|
6043
6074
|
}));
|
|
6044
|
-
}, this.setContext = function(
|
|
6045
|
-
var r = W(
|
|
6075
|
+
}, this.setContext = function(c) {
|
|
6076
|
+
var r = W(c);
|
|
6046
6077
|
return s.evaluationContext = a(a({}, r), { environment: r.environment || s.evaluationContext.environment }), s.initialised ? s.getFlags() : Promise.resolve();
|
|
6047
6078
|
}, this.getContext = function() {
|
|
6048
6079
|
return s.evaluationContext;
|
|
6049
|
-
}, this.updateContext = function(
|
|
6050
|
-
return s.setContext(a(a({}, s.getContext()),
|
|
6051
|
-
}, this.setTrait = function(
|
|
6080
|
+
}, this.updateContext = function(c) {
|
|
6081
|
+
return s.setContext(a(a({}, s.getContext()), c));
|
|
6082
|
+
}, this.setTrait = function(c, r) {
|
|
6052
6083
|
var p;
|
|
6053
|
-
if (s.api) return s.setContext(a(a({}, s.evaluationContext), { identity: a(a({}, s.evaluationContext.identity), { traits: a(a({}, (p = s.evaluationContext.identity) === null || p === void 0 ? void 0 : p.traits), z(Object.fromEntries([[
|
|
6054
|
-
}, this.setTraits = function(
|
|
6084
|
+
if (s.api) return s.setContext(a(a({}, s.evaluationContext), { identity: a(a({}, s.evaluationContext.identity), { traits: a(a({}, (p = s.evaluationContext.identity) === null || p === void 0 ? void 0 : p.traits), z(Object.fromEntries([[c, r]]))) }) }));
|
|
6085
|
+
}, this.setTraits = function(c) {
|
|
6055
6086
|
var r;
|
|
6056
|
-
if (s.api) return s.setContext(a(a({}, s.evaluationContext), { identity: a(a({}, s.evaluationContext.identity), { traits: a(a({}, (r = s.evaluationContext.identity) === null || r === void 0 ? void 0 : r.traits), Object.fromEntries(Object.entries(
|
|
6057
|
-
var
|
|
6058
|
-
return [
|
|
6087
|
+
if (s.api) return s.setContext(a(a({}, s.evaluationContext), { identity: a(a({}, s.evaluationContext.identity), { traits: a(a({}, (r = s.evaluationContext.identity) === null || r === void 0 ? void 0 : r.traits), Object.fromEntries(Object.entries(c).map(function(p) {
|
|
6088
|
+
var h = p[0], j = p[1];
|
|
6089
|
+
return [h, H(j) ? j : { value: j }];
|
|
6059
6090
|
}))) }) }));
|
|
6060
6091
|
console.error("Attempted to setTraits a user before calling flagsmith.init. Call flagsmith.init first, if you wish to prevent it sending a request for flags, call init with preventFetch:true.");
|
|
6061
|
-
}, this.hasFeature = function(
|
|
6062
|
-
var p = typeof r == "object",
|
|
6063
|
-
return !
|
|
6092
|
+
}, this.hasFeature = function(c, r) {
|
|
6093
|
+
var p = typeof r == "object", h = s.flags && s.flags[c.toLowerCase().replace(/ /g, "_")], j = !1;
|
|
6094
|
+
return !h && p && r.fallback !== void 0 ? j = r == null ? void 0 : r.fallback : h && h.enabled && (j = !0), (p && !r.skipAnalytics || !r) && s.evaluateFlag(c, "ENABLED"), j;
|
|
6064
6095
|
}, this.getStorageKey = function() {
|
|
6065
|
-
var
|
|
6066
|
-
return ((
|
|
6067
|
-
}, this.getJSON = function(
|
|
6068
|
-
var
|
|
6096
|
+
var c, r;
|
|
6097
|
+
return ((c = s.cacheOptions) === null || c === void 0 ? void 0 : c.storageKey) || "FLAGSMITH_DB_" + ((r = s.evaluationContext.environment) === null || r === void 0 ? void 0 : r.apiKey);
|
|
6098
|
+
}, this.getJSON = function(c, r, p) {
|
|
6099
|
+
var h, j = s;
|
|
6069
6100
|
j.evaluationContext;
|
|
6070
|
-
var
|
|
6071
|
-
s.evaluationContext.environment && (O.headers["X-Environment-Key"] = s.evaluationContext.environment.apiKey), r && r !== "GET" && (O.headers["Content-Type"] = "application/json; charset=utf-8"),
|
|
6072
|
-
var
|
|
6073
|
-
return
|
|
6101
|
+
var Y = j.headers, O = { method: r || "GET", body: p, cache: "no-cache", headers: {} };
|
|
6102
|
+
s.evaluationContext.environment && (O.headers["X-Environment-Key"] = s.evaluationContext.environment.apiKey), r && r !== "GET" && (O.headers["Content-Type"] = "application/json; charset=utf-8"), Y && Object.assign(O.headers, Y), x || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
|
|
6103
|
+
var M = "".concat((h = s.evaluationContext.identity) === null || h === void 0 ? void 0 : h.identifier);
|
|
6104
|
+
return x(c, O).then(function(X) {
|
|
6074
6105
|
var L, ue, se = "".concat((L = s.evaluationContext.identity) === null || L === void 0 ? void 0 : L.identifier);
|
|
6075
|
-
if (
|
|
6106
|
+
if (M === se) {
|
|
6076
6107
|
var ce = (ue = X.headers) === null || ue === void 0 ? void 0 : ue.get("x-flagsmith-document-updated-at");
|
|
6077
6108
|
if (ce) try {
|
|
6078
6109
|
var ae = parseFloat(ce);
|
|
@@ -6081,7 +6112,7 @@ var Dt = { exports: {} };
|
|
|
6081
6112
|
} catch (ne) {
|
|
6082
6113
|
s.log(ne, "Failed to parse x-flagsmith-document-updated-at", ce);
|
|
6083
6114
|
}
|
|
6084
|
-
return s.log("Fetch response: " + X.status + " " + (r || "GET") + 0 +
|
|
6115
|
+
return s.log("Fetch response: " + X.status + " " + (r || "GET") + 0 + c), X.text().then(function(ne) {
|
|
6085
6116
|
var me = ne;
|
|
6086
6117
|
try {
|
|
6087
6118
|
me = JSON.parse(ne);
|
|
@@ -6090,48 +6121,48 @@ var Dt = { exports: {} };
|
|
|
6090
6121
|
return !me && X.status && (me = "API Response: ".concat(X.status)), X.status && X.status >= 200 && X.status < 300 ? me : Promise.reject(new Error(me));
|
|
6091
6122
|
});
|
|
6092
6123
|
}
|
|
6093
|
-
s.log("Received response with identity mismatch, ignoring response. Requested: ".concat(
|
|
6124
|
+
s.log("Received response with identity mismatch, ignoring response. Requested: ".concat(M, ", Current: ").concat(se));
|
|
6094
6125
|
});
|
|
6095
|
-
}, this.evaluateFlag = function(
|
|
6096
|
-
if (s.datadogRum && (s.datadogRum.client.addFeatureFlagEvaluation ? r === "VALUE" ? s.datadogRum.client.addFeatureFlagEvaluation(Ve +
|
|
6126
|
+
}, this.evaluateFlag = function(c, r) {
|
|
6127
|
+
if (s.datadogRum && (s.datadogRum.client.addFeatureFlagEvaluation ? r === "VALUE" ? s.datadogRum.client.addFeatureFlagEvaluation(Ve + c, s.getValue(c, {}, !0)) : s.datadogRum.client.addFeatureFlagEvaluation(Ze + c, s.hasFeature(c, !0)) : console.error("Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.")), s.enableAnalytics) {
|
|
6097
6128
|
if (!s.evaluationEvent || !s.evaluationContext.environment) return;
|
|
6098
|
-
s.evaluationEvent[s.evaluationContext.environment.apiKey] || (s.evaluationEvent[s.evaluationContext.environment.apiKey] = {}), s.evaluationEvent[s.evaluationContext.environment.apiKey][
|
|
6129
|
+
s.evaluationEvent[s.evaluationContext.environment.apiKey] || (s.evaluationEvent[s.evaluationContext.environment.apiKey] = {}), s.evaluationEvent[s.evaluationContext.environment.apiKey][c] === void 0 && (s.evaluationEvent[s.evaluationContext.environment.apiKey][c] = 0), s.evaluationEvent[s.evaluationContext.environment.apiKey][c] += 1;
|
|
6099
6130
|
}
|
|
6100
6131
|
s.updateEventStorage();
|
|
6101
|
-
}, this._onChange = function(
|
|
6102
|
-
var
|
|
6103
|
-
s.setLoadingState(p), (
|
|
6104
|
-
},
|
|
6132
|
+
}, this._onChange = function(c, r, p) {
|
|
6133
|
+
var h, j;
|
|
6134
|
+
s.setLoadingState(p), (h = s.onChange) === null || h === void 0 || h.call(s, c, r, s.loadingState), (j = s._trigger) === null || j === void 0 || j.call(s);
|
|
6135
|
+
}, x = n.fetch ? n.fetch : typeof fetch < "u" ? fetch : Ne == null ? void 0 : Ne.fetch, this.canUseStorage = typeof window < "u" || !!n.browserlessStorage, this.log("Constructing flagsmith instance " + n), n.eventSource && (te = n.eventSource), n.AsyncStorage && (k = n.AsyncStorage);
|
|
6105
6136
|
}
|
|
6106
6137
|
return d.prototype.init = function(n) {
|
|
6107
|
-
var s,
|
|
6138
|
+
var s, c, r;
|
|
6108
6139
|
return u(this, void 0, void 0, function() {
|
|
6109
|
-
var p,
|
|
6110
|
-
return
|
|
6140
|
+
var p, h, j, Y, O, M, X, L, ue, se, ce, ae, ne, me, qe, He, De, J, Q, _e, Xe, Pt, je, $e, xt, Vt, et, Ft, tt, Qe, Ge, Ot, _ = this;
|
|
6141
|
+
return f(this, function(le) {
|
|
6111
6142
|
switch (le.label) {
|
|
6112
6143
|
case 0:
|
|
6113
6144
|
p = W(n.evaluationContext || this.evaluationContext), le.label = 1;
|
|
6114
6145
|
case 1:
|
|
6115
|
-
if (le.trys.push([1, 13, , 14]),
|
|
6146
|
+
if (le.trys.push([1, 13, , 14]), h = n.environmentID, j = n.api, Y = j === void 0 ? Be : j, O = n.headers, M = n.onChange, X = n.cacheFlags, L = n.datadogRum, ue = n.onError, se = n.defaultFlags, ce = n.fetch, ae = n.preventFetch, ne = n.enableLogs, me = n.enableDynatrace, qe = n.enableAnalytics, He = n.realtime, De = n.eventSourceUrl, J = De === void 0 ? "https://realtime.flagsmith.com/" : De, Q = n.AsyncStorage, _e = n.identity, Xe = n.traits, Pt = n.state, je = n.cacheOptions, $e = n.angularHttpClient, xt = n._trigger, Vt = n._triggerLoadingState, p.environment = h ? { apiKey: h } : p.environment, !p.environment || !p.environment.apiKey) throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
|
|
6116
6147
|
if (p.identity = _e || Xe ? { identifier: _e, traits: Xe ? Object.fromEntries(Object.entries(Xe).map(function(re) {
|
|
6117
6148
|
return [re[0], { value: re[1] }];
|
|
6118
|
-
})) : {} } : p.identity, this.evaluationContext = p, this.api =
|
|
6149
|
+
})) : {} } : p.identity, this.evaluationContext = p, this.api = Y, this.headers = O, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = M, et = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = xt || this._trigger, this._triggerLoadingState = Vt || this._triggerLoadingState, this.onError = function(re) {
|
|
6119
6150
|
_.setLoadingState(a(a({}, _.loadingState), { isFetching: !1, isLoading: !1, error: re })), ue == null || ue(re);
|
|
6120
|
-
}, this.enableLogs = ne || !1, this.cacheOptions = je ? { skipAPI: !!je.skipAPI, ttl: je.ttl || 0, storageKey: je.storageKey, loadStale: !!je.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), ce && (
|
|
6151
|
+
}, this.enableLogs = ne || !1, this.cacheOptions = je ? { skipAPI: !!je.skipAPI, ttl: je.ttl || 0, storageKey: je.storageKey, loadStale: !!je.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), ce && (x = ce), this.enableAnalytics = qe || !1, this.flags = Object.assign({}, se) || {}, this.datadogRum = L || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = k !== void 0 && !!X, ie = "FLAGSMITH_EVENT_" + p.environment.apiKey, Q && (k = Q), He && typeof window < "u" && this.setupRealtime(J, p.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = a(a({}, this.loadingState), { isLoading: !1, source: w.DEFAULT_FLAGS })), this.setState(Pt), this.log("Initialising with properties", n, this), me && (typeof dtrum > "u" ? console.error("You have attempted to enable dynatrace but dtrum is undefined, please check you have the Dynatrace RUM JavaScript API installed.") : this.dtrum = dtrum), $e && (x = /* @__PURE__ */ function(re) {
|
|
6121
6152
|
return function(ge, de) {
|
|
6122
6153
|
var fe = de.headers, N = de.method, Ye = de.body;
|
|
6123
|
-
return new Promise(function(
|
|
6154
|
+
return new Promise(function(we) {
|
|
6124
6155
|
switch (N) {
|
|
6125
6156
|
case "GET":
|
|
6126
6157
|
return re.get(ge, { headers: fe }).subscribe(function(be) {
|
|
6127
|
-
|
|
6158
|
+
we({ ok: !0, text: function() {
|
|
6128
6159
|
return Promise.resolve(be);
|
|
6129
6160
|
} });
|
|
6130
6161
|
});
|
|
6131
6162
|
case "POST":
|
|
6132
6163
|
case "PUT":
|
|
6133
6164
|
return re.post(ge, Ye, { headers: fe }).subscribe(function(be) {
|
|
6134
|
-
|
|
6165
|
+
we({ ok: !0, text: function() {
|
|
6135
6166
|
return Promise.resolve(be);
|
|
6136
6167
|
} });
|
|
6137
6168
|
});
|
|
@@ -6155,18 +6186,18 @@ var Dt = { exports: {} };
|
|
|
6155
6186
|
}
|
|
6156
6187
|
})), !X) return [3, 9];
|
|
6157
6188
|
if (!k || !this.canUseStorage) return [3, 8];
|
|
6158
|
-
|
|
6189
|
+
Ft = function(re, ge) {
|
|
6159
6190
|
return u(_, void 0, void 0, function() {
|
|
6160
|
-
var de, fe, N, Ye,
|
|
6161
|
-
return
|
|
6191
|
+
var de, fe, N, Ye, we, be, st, qt, at, nt, rt, ot, it, ct, lt, At, ut, mt, gt, dt, pt, bt, ft, yt, Ht = this;
|
|
6192
|
+
return f(this, function(ye) {
|
|
6162
6193
|
switch (ye.label) {
|
|
6163
6194
|
case 0:
|
|
6164
6195
|
if (!ge) return [3, 7];
|
|
6165
6196
|
de = null, fe = null, ye.label = 1;
|
|
6166
6197
|
case 1:
|
|
6167
|
-
return ye.trys.push([1, 5, , 6]), N = JSON.parse(ge), Ye = !1,
|
|
6198
|
+
return ye.trys.push([1, 5, , 6]), N = JSON.parse(ge), Ye = !1, we = !1, N && N.api === this.api && ((nt = (at = N.evaluationContext) === null || at === void 0 ? void 0 : at.environment) === null || nt === void 0 ? void 0 : nt.apiKey) === ((rt = this.evaluationContext.environment) === null || rt === void 0 ? void 0 : rt.apiKey) && (be = !0, this.evaluationContext.identity && ((it = (ot = N.evaluationContext) === null || ot === void 0 ? void 0 : ot.identity) === null || it === void 0 ? void 0 : it.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((lt = (ct = N.evaluationContext) === null || ct === void 0 ? void 0 : ct.identity) === null || lt === void 0 ? void 0 : lt.identifier) + " to " + this.evaluationContext.identity.identifier), be = !1), this.cacheOptions.ttl && (!N.ts || (/* @__PURE__ */ new Date()).valueOf() - N.ts > this.cacheOptions.ttl) && (N.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + N.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - N.ts) + "ms"), be = !1) : N.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + N.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - N.ts) + "ms"), we = !0, be = !0)), be && (Ye = !0, fe = P((At = this.evaluationContext.identity) === null || At === void 0 ? void 0 : At.traits, (mt = (ut = N.evaluationContext) === null || ut === void 0 ? void 0 : ut.identity) === null || mt === void 0 ? void 0 : mt.traits), de = P(this.flags, N.flags), this.setState(a(a({}, N), { evaluationContext: W(a(a({}, N.evaluationContext), { identity: !((gt = N.evaluationContext) === null || gt === void 0) && gt.identity ? a(a({}, (dt = N.evaluationContext) === null || dt === void 0 ? void 0 : dt.identity), { traits: a(a({}, ((bt = (pt = N.evaluationContext) === null || pt === void 0 ? void 0 : pt.identity) === null || bt === void 0 ? void 0 : bt.traits) || {}), Xe || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", N))), Ye ? (st = !ae && (!this.cacheOptions.skipAPI || we), this._onChange(null, { isFromServer: !1, flagsChanged: de, traitsChanged: fe }, this._loadedState(null, w.CACHE, st)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Ye && !we && this.log("Skipping API, using cache"), st && this.getFlags().catch(function(ra) {
|
|
6168
6199
|
var vt;
|
|
6169
|
-
(vt =
|
|
6200
|
+
(vt = Ht.onError) === null || vt === void 0 || vt.call(Ht, ra);
|
|
6170
6201
|
}), [3, 4]) : [3, 2];
|
|
6171
6202
|
case 2:
|
|
6172
6203
|
return ae ? [3, 4] : [4, this.getFlags()];
|
|
@@ -6175,7 +6206,7 @@ var Dt = { exports: {} };
|
|
|
6175
6206
|
case 4:
|
|
6176
6207
|
return [3, 6];
|
|
6177
6208
|
case 5:
|
|
6178
|
-
return
|
|
6209
|
+
return qt = ye.sent(), this.log("Exception fetching cached logs", qt), [3, 6];
|
|
6179
6210
|
case 6:
|
|
6180
6211
|
return [3, 10];
|
|
6181
6212
|
case 7:
|
|
@@ -6183,10 +6214,10 @@ var Dt = { exports: {} };
|
|
|
6183
6214
|
case 8:
|
|
6184
6215
|
return ye.sent(), [3, 10];
|
|
6185
6216
|
case 9:
|
|
6186
|
-
if (se) this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
6217
|
+
if (se) this._onChange(null, { isFromServer: !1, flagsChanged: P({}, this.flags), traitsChanged: P({}, (ft = this.evaluationContext.identity) === null || ft === void 0 ? void 0 : ft.traits) }, this._loadedState(null, w.DEFAULT_FLAGS));
|
|
6187
6218
|
else {
|
|
6188
6219
|
if (!this.flags) throw new Error(et);
|
|
6189
|
-
this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
6220
|
+
this._onChange(null, { isFromServer: !1, flagsChanged: P({}, this.flags), traitsChanged: P({}, (yt = this.evaluationContext.identity) === null || yt === void 0 ? void 0 : yt.traits) }, this._loadedState(null, w.DEFAULT_FLAGS));
|
|
6190
6221
|
}
|
|
6191
6222
|
ye.label = 10;
|
|
6192
6223
|
case 10:
|
|
@@ -6202,7 +6233,7 @@ var Dt = { exports: {} };
|
|
|
6202
6233
|
case 4:
|
|
6203
6234
|
tt = le.sent(), le.label = 5;
|
|
6204
6235
|
case 5:
|
|
6205
|
-
return [4,
|
|
6236
|
+
return [4, Ft(null, tt)];
|
|
6206
6237
|
case 6:
|
|
6207
6238
|
case 7:
|
|
6208
6239
|
return le.sent(), [3, 8];
|
|
@@ -6213,13 +6244,13 @@ var Dt = { exports: {} };
|
|
|
6213
6244
|
case 10:
|
|
6214
6245
|
return le.sent(), [3, 12];
|
|
6215
6246
|
case 11:
|
|
6216
|
-
if (se) this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
6217
|
-
else if (this.flags && (Qe = null, Object.keys(this.flags).length === 0 && (Qe = et), this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
6247
|
+
if (se) this._onChange(null, { isFromServer: !1, flagsChanged: P({}, se), traitsChanged: P({}, (s = p.identity) === null || s === void 0 ? void 0 : s.traits) }, this._loadedState(null, w.DEFAULT_FLAGS));
|
|
6248
|
+
else if (this.flags && (Qe = null, Object.keys(this.flags).length === 0 && (Qe = et), this._onChange(null, { isFromServer: !1, flagsChanged: P({}, this.flags), traitsChanged: P({}, (c = p.identity) === null || c === void 0 ? void 0 : c.traits) }, this._loadedState(Qe, w.DEFAULT_FLAGS)), Qe)) throw new Error(Qe);
|
|
6218
6249
|
le.label = 12;
|
|
6219
6250
|
case 12:
|
|
6220
6251
|
return [3, 14];
|
|
6221
6252
|
case 13:
|
|
6222
|
-
throw Ge = le.sent(), this.log("Error during initialisation ", Ge),
|
|
6253
|
+
throw Ge = le.sent(), this.log("Error during initialisation ", Ge), Ot = Ge instanceof Error ? Ge : new Error("".concat(Ge)), (r = this.onError) === null || r === void 0 || r.call(this, Ot), Ge;
|
|
6223
6254
|
case 14:
|
|
6224
6255
|
return [2];
|
|
6225
6256
|
}
|
|
@@ -6227,10 +6258,10 @@ var Dt = { exports: {} };
|
|
|
6227
6258
|
});
|
|
6228
6259
|
}, d.prototype.getAllFlags = function() {
|
|
6229
6260
|
return this.flags;
|
|
6230
|
-
}, d.prototype.identify = function(n, s,
|
|
6231
|
-
return this.evaluationContext.identity = { identifier: n, transient:
|
|
6232
|
-
var p = r[0],
|
|
6233
|
-
return [p, H(
|
|
6261
|
+
}, d.prototype.identify = function(n, s, c) {
|
|
6262
|
+
return this.evaluationContext.identity = { identifier: n, transient: c, traits: this.evaluationContext.identity && this.evaluationContext.identity.identifier == n ? this.evaluationContext.identity.traits : {} }, this.evaluationContext.identity.identifier = n, this.log("Identify: " + this.evaluationContext.identity.identifier), s && (this.evaluationContext.identity.traits = Object.fromEntries(Object.entries(s).map(function(r) {
|
|
6263
|
+
var p = r[0], h = r[1];
|
|
6264
|
+
return [p, H(h) ? h : { value: h }];
|
|
6234
6265
|
}))), this.initialised ? this.getFlags() : Promise.resolve();
|
|
6235
6266
|
}, d.prototype.getState = function() {
|
|
6236
6267
|
return { api: this.api, flags: this.flags, ts: this.ts, evaluationContext: this.evaluationContext, evaluationEvent: this.evaluationEvent };
|
|
@@ -6242,11 +6273,11 @@ var Dt = { exports: {} };
|
|
|
6242
6273
|
n === void 0 && (n = 1e3), this.getFlagInterval && clearInterval(this.getFlagInterval), this.getFlagInterval = setInterval(this.getFlags, n);
|
|
6243
6274
|
}, d.prototype.stopListening = function() {
|
|
6244
6275
|
this.getFlagInterval && (clearInterval(this.getFlagInterval), this.getFlagInterval = null);
|
|
6245
|
-
}, d.prototype._loadedState = function(n, s,
|
|
6246
|
-
return n === void 0 && (n = null),
|
|
6276
|
+
}, d.prototype._loadedState = function(n, s, c) {
|
|
6277
|
+
return n === void 0 && (n = null), c === void 0 && (c = !1), { error: n, isFetching: c, isLoading: !1, source: s };
|
|
6247
6278
|
}, d.prototype.log = function() {
|
|
6248
6279
|
for (var n = [], s = 0; s < arguments.length; s++) n[s] = arguments[s];
|
|
6249
|
-
this.enableLogs && console.log.apply(this,
|
|
6280
|
+
this.enableLogs && console.log.apply(this, y(["FLAGSMITH:", (/* @__PURE__ */ new Date()).valueOf() - (this.timer || 0), "ms"], n));
|
|
6250
6281
|
}, d.prototype.updateStorage = function() {
|
|
6251
6282
|
if (this.cacheFlags) {
|
|
6252
6283
|
this.ts = (/* @__PURE__ */ new Date()).valueOf();
|
|
@@ -6262,29 +6293,29 @@ var Dt = { exports: {} };
|
|
|
6262
6293
|
}
|
|
6263
6294
|
}, d.prototype.setLoadingState = function(n) {
|
|
6264
6295
|
var s;
|
|
6265
|
-
|
|
6296
|
+
F(n, this.loadingState) || (this.loadingState = a({}, n), this.log("Loading state changed", n), (s = this._triggerLoadingState) === null || s === void 0 || s.call(this));
|
|
6266
6297
|
}, d.prototype.setupRealtime = function(n, s) {
|
|
6267
|
-
var
|
|
6298
|
+
var c = this, r = n + "sse/environments/" + s + "/stream";
|
|
6268
6299
|
te ? this.eventSource || (this.log("Creating event source with url " + r), this.eventSource = new te(r), this.eventSource.addEventListener("environment_updated", function(p) {
|
|
6269
|
-
var
|
|
6300
|
+
var h;
|
|
6270
6301
|
try {
|
|
6271
|
-
|
|
6302
|
+
h = JSON.parse(p.data).updated_at;
|
|
6272
6303
|
} catch (j) {
|
|
6273
|
-
|
|
6304
|
+
c.log("Could not parse sse event", j);
|
|
6274
6305
|
}
|
|
6275
|
-
|
|
6306
|
+
h ? !c.timestamp || h > c.timestamp ? c.isLoading ? c.log("updated_at is new, but flags are loading", p.data, c.timestamp) : (c.log("updated_at is new, fetching flags", p.data, c.timestamp), c.getFlags()) : c.log("updated_at is outdated, skipping get flags", p.data, c.timestamp) : c.log("No updated_at received, fetching flags", p);
|
|
6276
6307
|
})) : this.log("Error, EventSource is undefined");
|
|
6277
6308
|
}, d;
|
|
6278
6309
|
}();
|
|
6279
|
-
function
|
|
6280
|
-
var n = d.fetch, s = d.AsyncStorage,
|
|
6281
|
-
return new Oe({ fetch: n, AsyncStorage: s, eventSource:
|
|
6310
|
+
function i(d) {
|
|
6311
|
+
var n = d.fetch, s = d.AsyncStorage, c = d.eventSource;
|
|
6312
|
+
return new Oe({ fetch: n, AsyncStorage: s, eventSource: c });
|
|
6282
6313
|
}
|
|
6283
|
-
var g,
|
|
6284
|
-
return g = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(s,
|
|
6285
|
-
s.__proto__ =
|
|
6286
|
-
} || function(s,
|
|
6287
|
-
for (var r in
|
|
6314
|
+
var g, v = (g = function(d, n) {
|
|
6315
|
+
return g = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(s, c) {
|
|
6316
|
+
s.__proto__ = c;
|
|
6317
|
+
} || function(s, c) {
|
|
6318
|
+
for (var r in c) Object.prototype.hasOwnProperty.call(c, r) && (s[r] = c[r]);
|
|
6288
6319
|
}, g(d, n);
|
|
6289
6320
|
}, function(d, n) {
|
|
6290
6321
|
if (typeof n != "function" && n !== null) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
|
|
@@ -6293,66 +6324,66 @@ var Dt = { exports: {} };
|
|
|
6293
6324
|
}
|
|
6294
6325
|
g(d, n), d.prototype = n === null ? Object.create(n) : (s.prototype = n.prototype, new s());
|
|
6295
6326
|
}), B = function(d) {
|
|
6296
|
-
var n = typeof Symbol == "function" && Symbol.iterator, s = n && d[n],
|
|
6327
|
+
var n = typeof Symbol == "function" && Symbol.iterator, s = n && d[n], c = 0;
|
|
6297
6328
|
if (s) return s.call(d);
|
|
6298
6329
|
if (d && typeof d.length == "number") return { next: function() {
|
|
6299
|
-
return d &&
|
|
6330
|
+
return d && c >= d.length && (d = void 0), { value: d && d[c++], done: !d };
|
|
6300
6331
|
} };
|
|
6301
6332
|
throw new TypeError(n ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
6302
6333
|
}, C = function(d, n) {
|
|
6303
6334
|
var s = typeof Symbol == "function" && d[Symbol.iterator];
|
|
6304
6335
|
if (!s) return d;
|
|
6305
|
-
var
|
|
6336
|
+
var c, r, p = s.call(d), h = [];
|
|
6306
6337
|
try {
|
|
6307
|
-
for (; (n === void 0 || n-- > 0) && !(
|
|
6338
|
+
for (; (n === void 0 || n-- > 0) && !(c = p.next()).done; ) h.push(c.value);
|
|
6308
6339
|
} catch (j) {
|
|
6309
6340
|
r = { error: j };
|
|
6310
6341
|
} finally {
|
|
6311
6342
|
try {
|
|
6312
|
-
|
|
6343
|
+
c && !c.done && (s = p.return) && s.call(p);
|
|
6313
6344
|
} finally {
|
|
6314
6345
|
if (r) throw r.error;
|
|
6315
6346
|
}
|
|
6316
6347
|
}
|
|
6317
|
-
return
|
|
6348
|
+
return h;
|
|
6318
6349
|
}, D = function(d, n, s) {
|
|
6319
|
-
if (arguments.length === 2) for (var
|
|
6320
|
-
return d.concat(
|
|
6321
|
-
},
|
|
6350
|
+
if (arguments.length === 2) for (var c, r = 0, p = n.length; r < p; r++) !c && r in n || (c || (c = Array.prototype.slice.call(n, 0, r)), c[r] = n[r]);
|
|
6351
|
+
return d.concat(c || Array.prototype.slice.call(n));
|
|
6352
|
+
}, E = function(d) {
|
|
6322
6353
|
function n() {
|
|
6323
6354
|
return d.call(this, `EventSource not available.
|
|
6324
6355
|
Consider loading an EventSource polyfill and making it available globally as EventSource, or passing one in as eventSourceClass to the ReconnectingEventSource constructor.`) || this;
|
|
6325
6356
|
}
|
|
6326
|
-
return
|
|
6327
|
-
}(Error),
|
|
6357
|
+
return v(n, d), n;
|
|
6358
|
+
}(Error), V = function() {
|
|
6328
6359
|
function d(n, s) {
|
|
6329
|
-
var
|
|
6330
|
-
if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration = s != null ? Object.assign({}, s) : void 0, this.withCredentials = !1, this._eventSource = null, this._lastEventId = null, this._timer = null, this._listeners = { open: [], error: [], message: [] }, this.url = n.toString(), this.readyState = this.CONNECTING, this.max_retry_time = 3e3, this.eventSourceClass = globalThis.FlagsmithEventSource, this._configuration != null && (this._configuration.lastEventId && (this._lastEventId = this._configuration.lastEventId, delete this._configuration.lastEventId), this._configuration.max_retry_time && (this.max_retry_time = this._configuration.max_retry_time, delete this._configuration.max_retry_time), this._configuration.eventSourceClass && (this.eventSourceClass = this._configuration.eventSourceClass, delete this._configuration.eventSourceClass)), this.eventSourceClass == null || typeof this.eventSourceClass != "function") throw new
|
|
6360
|
+
var c = this;
|
|
6361
|
+
if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration = s != null ? Object.assign({}, s) : void 0, this.withCredentials = !1, this._eventSource = null, this._lastEventId = null, this._timer = null, this._listeners = { open: [], error: [], message: [] }, this.url = n.toString(), this.readyState = this.CONNECTING, this.max_retry_time = 3e3, this.eventSourceClass = globalThis.FlagsmithEventSource, this._configuration != null && (this._configuration.lastEventId && (this._lastEventId = this._configuration.lastEventId, delete this._configuration.lastEventId), this._configuration.max_retry_time && (this.max_retry_time = this._configuration.max_retry_time, delete this._configuration.max_retry_time), this._configuration.eventSourceClass && (this.eventSourceClass = this._configuration.eventSourceClass, delete this._configuration.eventSourceClass)), this.eventSourceClass == null || typeof this.eventSourceClass != "function") throw new E();
|
|
6331
6362
|
this._onevent_wrapped = function(r) {
|
|
6332
|
-
|
|
6363
|
+
c._onevent(r);
|
|
6333
6364
|
}, this._start();
|
|
6334
6365
|
}
|
|
6335
6366
|
return d.prototype.dispatchEvent = function(n) {
|
|
6336
6367
|
throw new Error("Method not implemented.");
|
|
6337
6368
|
}, d.prototype._start = function() {
|
|
6338
|
-
var n, s,
|
|
6339
|
-
this._lastEventId && (r.indexOf("?") === -1 ? r += "?" : r += "&", r += "lastEventId=" + encodeURIComponent(this._lastEventId)), this._eventSource = new this.eventSourceClass(r, this._configuration), this._eventSource.onopen = function(
|
|
6340
|
-
|
|
6341
|
-
}, this._eventSource.onerror = function(
|
|
6342
|
-
|
|
6343
|
-
}, this._eventSource.onmessage = function(
|
|
6344
|
-
|
|
6369
|
+
var n, s, c = this, r = this.url;
|
|
6370
|
+
this._lastEventId && (r.indexOf("?") === -1 ? r += "?" : r += "&", r += "lastEventId=" + encodeURIComponent(this._lastEventId)), this._eventSource = new this.eventSourceClass(r, this._configuration), this._eventSource.onopen = function(Y) {
|
|
6371
|
+
c._onopen(Y);
|
|
6372
|
+
}, this._eventSource.onerror = function(Y) {
|
|
6373
|
+
c._onerror(Y);
|
|
6374
|
+
}, this._eventSource.onmessage = function(Y) {
|
|
6375
|
+
c.onmessage(Y);
|
|
6345
6376
|
};
|
|
6346
6377
|
try {
|
|
6347
|
-
for (var p = B(Object.keys(this._listeners)),
|
|
6348
|
-
var j =
|
|
6378
|
+
for (var p = B(Object.keys(this._listeners)), h = p.next(); !h.done; h = p.next()) {
|
|
6379
|
+
var j = h.value;
|
|
6349
6380
|
this._eventSource.addEventListener(j, this._onevent_wrapped);
|
|
6350
6381
|
}
|
|
6351
|
-
} catch (
|
|
6352
|
-
n = { error:
|
|
6382
|
+
} catch (Y) {
|
|
6383
|
+
n = { error: Y };
|
|
6353
6384
|
} finally {
|
|
6354
6385
|
try {
|
|
6355
|
-
|
|
6386
|
+
h && !h.done && (s = p.return) && s.call(p);
|
|
6356
6387
|
} finally {
|
|
6357
6388
|
if (n) throw n.error;
|
|
6358
6389
|
}
|
|
@@ -6363,23 +6394,23 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
6363
6394
|
var s = this;
|
|
6364
6395
|
if (this.readyState === 1 && (this.readyState = 0, this.onerror(n)), this._eventSource) {
|
|
6365
6396
|
this._eventSource.close(), this._eventSource = null;
|
|
6366
|
-
var
|
|
6397
|
+
var c = Math.round(this.max_retry_time * Math.random());
|
|
6367
6398
|
this._timer = setTimeout(function() {
|
|
6368
6399
|
return s._start();
|
|
6369
|
-
},
|
|
6400
|
+
}, c);
|
|
6370
6401
|
}
|
|
6371
6402
|
}, d.prototype._onevent = function(n) {
|
|
6372
|
-
var s,
|
|
6403
|
+
var s, c;
|
|
6373
6404
|
n && n.lastEventId && (this._lastEventId = n.lastEventId);
|
|
6374
6405
|
var r = this._listeners[n.type];
|
|
6375
6406
|
if (r != null) try {
|
|
6376
|
-
for (var p = B(D([], C(r), !1)),
|
|
6377
|
-
|
|
6407
|
+
for (var p = B(D([], C(r), !1)), h = p.next(); !h.done; h = p.next())
|
|
6408
|
+
h.value.call(this, n);
|
|
6378
6409
|
} catch (j) {
|
|
6379
6410
|
s = { error: j };
|
|
6380
6411
|
} finally {
|
|
6381
6412
|
try {
|
|
6382
|
-
|
|
6413
|
+
h && !h.done && (c = p.return) && c.call(p);
|
|
6383
6414
|
} finally {
|
|
6384
6415
|
if (s) throw s.error;
|
|
6385
6416
|
}
|
|
@@ -6390,11 +6421,11 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
6390
6421
|
}, d.prototype.onmessage = function(n) {
|
|
6391
6422
|
}, d.prototype.close = function() {
|
|
6392
6423
|
this._timer && (clearTimeout(this._timer), this._timer = null), this._eventSource && (this._eventSource.close(), this._eventSource = null), this.readyState = 2;
|
|
6393
|
-
}, d.prototype.addEventListener = function(n, s,
|
|
6424
|
+
}, d.prototype.addEventListener = function(n, s, c) {
|
|
6394
6425
|
this._listeners[n] == null && (this._listeners[n] = [], this._eventSource != null && this._eventSource.addEventListener(n, this._onevent_wrapped));
|
|
6395
6426
|
var r = this._listeners[n];
|
|
6396
6427
|
r.includes(s) || (this._listeners[n] = D(D([], C(r), !1), [s], !1));
|
|
6397
|
-
}, d.prototype.removeEventListener = function(n, s,
|
|
6428
|
+
}, d.prototype.removeEventListener = function(n, s, c) {
|
|
6398
6429
|
var r = this._listeners[n];
|
|
6399
6430
|
this._listeners[n] = r.filter(function(p) {
|
|
6400
6431
|
return p !== s;
|
|
@@ -6403,40 +6434,40 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
6403
6434
|
}();
|
|
6404
6435
|
globalThis.FlagsmithEventSource = typeof EventSource < "u" ? EventSource : null;
|
|
6405
6436
|
var Z = function(d, n) {
|
|
6406
|
-
return n = n || {}, new Promise(function(s,
|
|
6407
|
-
var r = new XMLHttpRequest(), p = [],
|
|
6437
|
+
return n = n || {}, new Promise(function(s, c) {
|
|
6438
|
+
var r = new XMLHttpRequest(), p = [], h = [], j = {}, Y = function() {
|
|
6408
6439
|
return { ok: (r.status / 100 | 0) == 2, statusText: r.statusText, status: r.status, url: r.responseURL, text: function() {
|
|
6409
6440
|
return Promise.resolve(r.responseText);
|
|
6410
6441
|
}, json: function() {
|
|
6411
6442
|
return Promise.resolve(r.responseText).then(JSON.parse);
|
|
6412
6443
|
}, blob: function() {
|
|
6413
6444
|
return Promise.resolve(new Blob([r.response]));
|
|
6414
|
-
}, clone:
|
|
6445
|
+
}, clone: Y, headers: { keys: function() {
|
|
6415
6446
|
return p;
|
|
6416
6447
|
}, entries: function() {
|
|
6417
|
-
return
|
|
6418
|
-
}, get: function(
|
|
6419
|
-
return j[
|
|
6420
|
-
}, has: function(
|
|
6421
|
-
return
|
|
6448
|
+
return h;
|
|
6449
|
+
}, get: function(M) {
|
|
6450
|
+
return j[M.toLowerCase()];
|
|
6451
|
+
}, has: function(M) {
|
|
6452
|
+
return M.toLowerCase() in j;
|
|
6422
6453
|
} } };
|
|
6423
6454
|
};
|
|
6424
6455
|
for (var O in r.open(n.method || "get", d, !0), r.onload = function() {
|
|
6425
|
-
r.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(
|
|
6426
|
-
p.push(X = X.toLowerCase()),
|
|
6427
|
-
}), s(
|
|
6428
|
-
}, r.onerror =
|
|
6456
|
+
r.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(M, X, L) {
|
|
6457
|
+
p.push(X = X.toLowerCase()), h.push([X, L]), j[X] = j[X] ? j[X] + "," + L : L;
|
|
6458
|
+
}), s(Y());
|
|
6459
|
+
}, r.onerror = c, r.withCredentials = n.credentials == "include", n.headers) r.setRequestHeader(O, n.headers[O]);
|
|
6429
6460
|
r.send(n.body || null);
|
|
6430
6461
|
});
|
|
6431
|
-
}, T =
|
|
6462
|
+
}, T = i({ AsyncStorage: l, fetch: Z, eventSource: V });
|
|
6432
6463
|
typeof window < "u" && (window.flagsmith = T), m.createFlagsmithInstance = function() {
|
|
6433
|
-
return
|
|
6464
|
+
return i({ AsyncStorage: l, fetch: Z, eventSource: V });
|
|
6434
6465
|
}, m.default = T, Object.defineProperty(m, "__esModule", { value: !0 });
|
|
6435
6466
|
});
|
|
6436
6467
|
})(Dt, Dt.exports);
|
|
6437
6468
|
var po = Dt.exports, bo = {
|
|
6438
6469
|
NOT_INITIALIZED: "FeatureFlag not initialized. Call init() first."
|
|
6439
|
-
},
|
|
6470
|
+
}, zt = "business", pe, fo = (pe = class {
|
|
6440
6471
|
constructor() {
|
|
6441
6472
|
ze(this, "flagsmithClient", null);
|
|
6442
6473
|
ze(this, "userContext", null);
|
|
@@ -6452,16 +6483,16 @@ var po = Dt.exports, bo = {
|
|
|
6452
6483
|
if (!this.flagsmithClient)
|
|
6453
6484
|
try {
|
|
6454
6485
|
this.flagsmithClient = po.createFlagsmithInstance();
|
|
6455
|
-
const
|
|
6486
|
+
const l = m.reduce((a, u) => (a[u.feature.name] = u, a), {});
|
|
6456
6487
|
await this.flagsmithClient.init({
|
|
6457
6488
|
environmentID: A.apiKey,
|
|
6458
6489
|
api: (A == null ? void 0 : A.url) ?? "https://feature-flag-proxy.feedme.farm/api/v1/",
|
|
6459
6490
|
enableAnalytics: (A == null ? void 0 : A.enableAnalytics) ?? !0,
|
|
6460
|
-
defaultFlags:
|
|
6491
|
+
defaultFlags: l,
|
|
6461
6492
|
cacheFlags: (A == null ? void 0 : A.cacheFlags) ?? !0
|
|
6462
6493
|
});
|
|
6463
|
-
} catch (
|
|
6464
|
-
throw console.error("Failed to initialize FeatureFlag:",
|
|
6494
|
+
} catch (l) {
|
|
6495
|
+
throw console.error("Failed to initialize FeatureFlag:", l), l;
|
|
6465
6496
|
}
|
|
6466
6497
|
}
|
|
6467
6498
|
async setUser(A) {
|
|
@@ -6482,25 +6513,25 @@ var po = Dt.exports, bo = {
|
|
|
6482
6513
|
async getFlags() {
|
|
6483
6514
|
this.ensureInitialized();
|
|
6484
6515
|
const A = this.flagsmithClient.getAllFlags();
|
|
6485
|
-
return Object.entries(A).map(([m,
|
|
6516
|
+
return Object.entries(A).map(([m, l]) => {
|
|
6486
6517
|
var a;
|
|
6487
6518
|
return {
|
|
6488
6519
|
feature: {
|
|
6489
6520
|
name: m,
|
|
6490
|
-
id: (
|
|
6521
|
+
id: (l == null ? void 0 : l.id) ?? 0
|
|
6491
6522
|
},
|
|
6492
|
-
enabled:
|
|
6493
|
-
value: ((a =
|
|
6523
|
+
enabled: l.enabled,
|
|
6524
|
+
value: ((a = l.value) == null ? void 0 : a.toString()) ?? null
|
|
6494
6525
|
};
|
|
6495
6526
|
});
|
|
6496
6527
|
}
|
|
6497
6528
|
getFlagValue(A, m) {
|
|
6498
6529
|
this.ensureInitialized();
|
|
6499
|
-
const
|
|
6500
|
-
if (
|
|
6530
|
+
const l = this.flagsmithClient.getValue(A);
|
|
6531
|
+
if (l == null)
|
|
6501
6532
|
return null;
|
|
6502
6533
|
try {
|
|
6503
|
-
const a =
|
|
6534
|
+
const a = l.toString();
|
|
6504
6535
|
return m ? m(a) : typeof {} == "number" ? isNaN(Number(a)) ? null : Number(a) : typeof {} == "boolean" ? a.toLowerCase() === "true" : a;
|
|
6505
6536
|
} catch (a) {
|
|
6506
6537
|
return console.error("Error transforming flag value:", a), null;
|
|
@@ -6510,28 +6541,28 @@ var po = Dt.exports, bo = {
|
|
|
6510
6541
|
this.ensureInitialized();
|
|
6511
6542
|
const m = this.flagsmithClient.getValue(A);
|
|
6512
6543
|
if (m == null) return null;
|
|
6513
|
-
const
|
|
6544
|
+
const l = this.flagsmithClient.hasFeature(A);
|
|
6514
6545
|
return {
|
|
6515
6546
|
feature: {
|
|
6516
6547
|
name: A,
|
|
6517
6548
|
id: 0
|
|
6518
6549
|
},
|
|
6519
|
-
enabled:
|
|
6550
|
+
enabled: l,
|
|
6520
6551
|
value: m.toString()
|
|
6521
6552
|
};
|
|
6522
6553
|
}
|
|
6523
|
-
async getUserFlagValue(A, m,
|
|
6524
|
-
var
|
|
6554
|
+
async getUserFlagValue(A, m, l = null, a) {
|
|
6555
|
+
var f;
|
|
6525
6556
|
const u = this.userContext;
|
|
6526
6557
|
try {
|
|
6527
|
-
return await this.setUser(A), this.getFlagValue(m, a) ??
|
|
6528
|
-
} catch (
|
|
6529
|
-
return console.error(`Error getting user flag value for ${m}:`,
|
|
6558
|
+
return await this.setUser(A), this.getFlagValue(m, a) ?? l;
|
|
6559
|
+
} catch (y) {
|
|
6560
|
+
return console.error(`Error getting user flag value for ${m}:`, y), l;
|
|
6530
6561
|
} finally {
|
|
6531
6562
|
try {
|
|
6532
|
-
await ((
|
|
6533
|
-
} catch (
|
|
6534
|
-
console.error("Error during cleanup:",
|
|
6563
|
+
await ((f = this.flagsmithClient) == null ? void 0 : f.logout()), this.userContext = null, u && await this.setUser(u.identifier);
|
|
6564
|
+
} catch (y) {
|
|
6565
|
+
console.error("Error during cleanup:", y);
|
|
6535
6566
|
}
|
|
6536
6567
|
}
|
|
6537
6568
|
}
|
|
@@ -6540,49 +6571,49 @@ var po = Dt.exports, bo = {
|
|
|
6540
6571
|
}
|
|
6541
6572
|
}, ze(pe, "instance"), pe), yo = fo.getInstance(), Ie = he(!1), Te = he([]), Ee = he(null);
|
|
6542
6573
|
function vo(e = yo) {
|
|
6543
|
-
const A = () => Ie.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), m = async (
|
|
6574
|
+
const A = () => Ie.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), m = async (w, x = []) => {
|
|
6544
6575
|
if (Ie.value) {
|
|
6545
6576
|
console.warn("FeatureFlag is already initialized.");
|
|
6546
6577
|
return;
|
|
6547
6578
|
}
|
|
6548
6579
|
try {
|
|
6549
|
-
await e.init(
|
|
6580
|
+
await e.init(w, x), Te.value = await e.getFlags(), Ie.value = !0, Ee.value = null;
|
|
6550
6581
|
} catch (I) {
|
|
6551
6582
|
console.error("Failed to initialize feature flags:", I), Ee.value = I;
|
|
6552
6583
|
}
|
|
6553
|
-
},
|
|
6584
|
+
}, l = async (w) => {
|
|
6554
6585
|
if (A())
|
|
6555
6586
|
try {
|
|
6556
|
-
await e.setUser(
|
|
6557
|
-
} catch (
|
|
6558
|
-
console.error("Failed to set user:",
|
|
6587
|
+
await e.setUser(w), Te.value = await e.getFlags(), Ee.value = null;
|
|
6588
|
+
} catch (x) {
|
|
6589
|
+
console.error("Failed to set user:", x), Ee.value = x;
|
|
6559
6590
|
}
|
|
6560
|
-
}, a = async (
|
|
6591
|
+
}, a = async (w) => l(`${zt}-${w}`), u = (w, x, I = null) => {
|
|
6561
6592
|
if (!A()) return I;
|
|
6562
6593
|
try {
|
|
6563
|
-
return e.getFlagValue(
|
|
6594
|
+
return e.getFlagValue(w, x) ?? I;
|
|
6564
6595
|
} catch (H) {
|
|
6565
|
-
return console.error(`Error getting flag value for ${
|
|
6596
|
+
return console.error(`Error getting flag value for ${w}:`, H), I;
|
|
6566
6597
|
}
|
|
6567
|
-
},
|
|
6568
|
-
if (!A()) return
|
|
6598
|
+
}, f = (w, x) => {
|
|
6599
|
+
if (!A()) return x ?? null;
|
|
6569
6600
|
try {
|
|
6570
|
-
return e.getFlag(
|
|
6601
|
+
return e.getFlag(w) ?? x ?? null;
|
|
6571
6602
|
} catch (I) {
|
|
6572
|
-
return console.error(`Error getting flag for ${
|
|
6603
|
+
return console.error(`Error getting flag for ${w}:`, I), x ?? null;
|
|
6573
6604
|
}
|
|
6574
|
-
},
|
|
6605
|
+
}, y = async (w, x, I = null, H) => {
|
|
6575
6606
|
if (!A()) return I;
|
|
6576
6607
|
try {
|
|
6577
|
-
return await e.getUserFlagValue(
|
|
6608
|
+
return await e.getUserFlagValue(w, x, I, H);
|
|
6578
6609
|
} catch (z) {
|
|
6579
|
-
return console.error(`Error getting user flag value for ${
|
|
6610
|
+
return console.error(`Error getting user flag value for ${x}:`, z), I;
|
|
6580
6611
|
}
|
|
6581
|
-
},
|
|
6612
|
+
}, F = async (w, x, I = null, H) => y(`${zt}-${w}`, x, I, H), P = () => {
|
|
6582
6613
|
try {
|
|
6583
6614
|
e.reset();
|
|
6584
|
-
} catch (
|
|
6585
|
-
console.error("Error resetting feature flags:",
|
|
6615
|
+
} catch (w) {
|
|
6616
|
+
console.error("Error resetting feature flags:", w);
|
|
6586
6617
|
} finally {
|
|
6587
6618
|
Te.value = [], Ie.value = !1, Ee.value = null;
|
|
6588
6619
|
}
|
|
@@ -6592,25 +6623,25 @@ function vo(e = yo) {
|
|
|
6592
6623
|
isInitialized: ht(Ie),
|
|
6593
6624
|
error: ht(Ee),
|
|
6594
6625
|
init: m,
|
|
6595
|
-
setUser:
|
|
6626
|
+
setUser: l,
|
|
6596
6627
|
setBusiness: a,
|
|
6597
6628
|
getFlagValue: u,
|
|
6598
|
-
getFlag:
|
|
6599
|
-
getUserFlagValue:
|
|
6600
|
-
getBusinessFlagValue:
|
|
6601
|
-
reset:
|
|
6629
|
+
getFlag: f,
|
|
6630
|
+
getUserFlagValue: y,
|
|
6631
|
+
getBusinessFlagValue: F,
|
|
6632
|
+
reset: P
|
|
6602
6633
|
};
|
|
6603
6634
|
}
|
|
6604
6635
|
var ho = () => vo();
|
|
6605
6636
|
const Po = /* @__PURE__ */ Pe({
|
|
6606
6637
|
__name: "App",
|
|
6607
6638
|
setup(e) {
|
|
6608
|
-
const A =
|
|
6609
|
-
return
|
|
6639
|
+
const A = kt(), { init: m } = ho();
|
|
6640
|
+
return Wt(async () => {
|
|
6610
6641
|
A.registerSidebarComponent(go), await m({
|
|
6611
6642
|
apiKey: A.namespace.value === "prod" ? "6GhcttsJ9Rj9cTevcdrpin" : "MaGoXrEWuEJNpWgKTqseee"
|
|
6612
6643
|
});
|
|
6613
|
-
}), (
|
|
6644
|
+
}), (l, a) => {
|
|
6614
6645
|
const u = Gt("RouterView");
|
|
6615
6646
|
return xe(), Ke(u);
|
|
6616
6647
|
};
|
|
@@ -6625,11 +6656,11 @@ const Po = /* @__PURE__ */ Pe({
|
|
|
6625
6656
|
Bn
|
|
6626
6657
|
], A = new Set(e.flatMap((m) => Object.keys(m)));
|
|
6627
6658
|
return Array.from(A).reduce(
|
|
6628
|
-
(m,
|
|
6629
|
-
const a =
|
|
6630
|
-
return m[
|
|
6659
|
+
(m, l) => {
|
|
6660
|
+
const a = l;
|
|
6661
|
+
return m[l] = e.reduce((u, f) => ({
|
|
6631
6662
|
...u,
|
|
6632
|
-
...
|
|
6663
|
+
...f[a] || {}
|
|
6633
6664
|
}), {}), m;
|
|
6634
6665
|
},
|
|
6635
6666
|
{}
|