@yangsaiyam/helper 1.12.5 → 1.12.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/index.cjs +56 -30
  2. package/dist/index.d.cts +23 -1
  3. package/dist/index.d.ts +677 -17
  4. package/dist/index.js +729 -17
  5. package/package.json +1 -1
  6. package/src/index.d.ts +2 -0
  7. package/dist/addressess/index.d.ts +0 -137
  8. package/dist/addressess/index.js +0 -24
  9. package/dist/addressess/index.test.d.ts +0 -1
  10. package/dist/addressess/index.test.js +0 -16
  11. package/dist/assessment-question/index.d.ts +0 -19
  12. package/dist/assessment-question/index.js +0 -22
  13. package/dist/assessment-question/index.test.d.ts +0 -1
  14. package/dist/assessment-question/index.test.js +0 -27
  15. package/dist/career/index.d.ts +0 -132
  16. package/dist/career/index.js +0 -40
  17. package/dist/contact-form/index.d.ts +0 -13
  18. package/dist/contact-form/index.js +0 -13
  19. package/dist/email-history/index.d.ts +0 -17
  20. package/dist/email-history/index.js +0 -6
  21. package/dist/email-template/index.d.ts +0 -13
  22. package/dist/email-template/index.js +0 -5
  23. package/dist/files/index.d.ts +0 -18
  24. package/dist/files/index.js +0 -8
  25. package/dist/job-applications/index.d.ts +0 -33
  26. package/dist/job-applications/index.js +0 -10
  27. package/dist/locale/index.d.ts +0 -9
  28. package/dist/locale/index.js +0 -4
  29. package/dist/roles/index.d.ts +0 -61
  30. package/dist/roles/index.js +0 -170
  31. package/dist/roles/index.test.d.ts +0 -1
  32. package/dist/roles/index.test.js +0 -80
  33. package/dist/routes/index.d.ts +0 -80
  34. package/dist/routes/index.js +0 -106
  35. package/dist/routes/index.test.d.ts +0 -1
  36. package/dist/routes/index.test.js +0 -92
  37. package/dist/shared/helpers.d.ts +0 -5
  38. package/dist/shared/helpers.js +0 -15
  39. package/dist/shared/types.d.ts +0 -5
  40. package/dist/shared/types.js +0 -1
  41. package/dist/time/index.d.ts +0 -73
  42. package/dist/time/index.js +0 -161
  43. package/dist/time/index.test.d.ts +0 -1
  44. package/dist/time/index.test.js +0 -35
  45. package/dist/track/index.d.ts +0 -17
  46. package/dist/track/index.js +0 -14
  47. package/dist/track/index.test.d.ts +0 -1
  48. package/dist/track/index.test.js +0 -7
  49. package/dist/tsconfig.json +0 -6
  50. package/dist/url-prefix/index.d.ts +0 -8
  51. package/dist/url-prefix/index.js +0 -9
  52. package/dist/website/index.d.ts +0 -16
  53. package/dist/website/index.js +0 -17
package/dist/index.js CHANGED
@@ -1,17 +1,729 @@
1
- export * from "./assessment-question/index.js";
2
- export * from "./career/index.js";
3
- export * from "./contact-form/index.js";
4
- export * from "./files/index.js";
5
- export * from "./locale/index.js";
6
- export * from "./roles/index.js";
7
- export * from "./routes/index.js";
8
- export * from "./shared/helpers.js";
9
- export * from "./shared/types.js";
10
- export * from "./time/index.js";
11
- export * from "./track/index.js";
12
- export * from "./url-prefix/index.js";
13
- export * from "./website/index.js";
14
- export * from "./addressess/index.js";
15
- export * from "./job-applications/index.js";
16
- export * from "./email-template/index.js";
17
- export * from "./email-history/index.js";
1
+ // src/assessment-question/index.ts
2
+ var QuestionType = {
3
+ Subjective: 1,
4
+ Objective: 2,
5
+ MultipleChoice: 3
6
+ };
7
+ var ASSESSMENT_QUESTION_TYPE = [
8
+ {
9
+ key: QuestionType.Subjective,
10
+ value: "Subjective",
11
+ i18nKey: "assessmentQuestion.questionType.1"
12
+ },
13
+ {
14
+ key: QuestionType.Objective,
15
+ value: "Objective",
16
+ i18nKey: "assessmentQuestion.questionType.2"
17
+ },
18
+ {
19
+ key: QuestionType.MultipleChoice,
20
+ value: "MultipleChoice",
21
+ i18nKey: "assessmentQuestion.questionType.3"
22
+ }
23
+ ];
24
+
25
+ // src/career/index.ts
26
+ var CAREER_JOB_TYPE = [
27
+ { key: 1, value: "Full-time", i18nKey: "career.jobType.1" },
28
+ { key: 2, value: "Part-time", i18nKey: "career.jobType.2" },
29
+ { key: 3, value: "Contract", i18nKey: "career.jobType.3" },
30
+ { key: 4, value: "Internship", i18nKey: "career.jobType.4" }
31
+ ];
32
+ var CAREER_CATEGORY = [
33
+ { key: 1, value: "Technology", i18nKey: "career.category.1" },
34
+ { key: 2, value: "Design", i18nKey: "career.category.2" },
35
+ { key: 3, value: "Business", i18nKey: "career.category.3" },
36
+ { key: 4, value: "Marketing", i18nKey: "career.category.4" },
37
+ { key: 5, value: "Operations", i18nKey: "career.category.5" },
38
+ { key: 6, value: "Finance", i18nKey: "career.category.6" },
39
+ { key: 7, value: "Human Resources", i18nKey: "career.category.7" },
40
+ { key: 8, value: "Legal", i18nKey: "career.category.8" },
41
+ { key: 9, value: "Customer Support", i18nKey: "career.category.9" },
42
+ { key: 10, value: "Management", i18nKey: "career.category.10" }
43
+ ];
44
+ var CAREER_MODE = [
45
+ { key: 1, value: "On-site", i18nKey: "career.mode.1" },
46
+ { key: 2, value: "Remote", i18nKey: "career.mode.2" },
47
+ { key: 3, value: "Hybrid", i18nKey: "career.mode.3" }
48
+ ];
49
+ var CAREER_LOCATION = [
50
+ { key: 1, value: "KualaLumpur", i18nKey: "career.location.1" },
51
+ { key: 2, value: "Selangor", i18nKey: "career.location.2" },
52
+ { key: 3, value: "Johor", i18nKey: "career.location.3" },
53
+ { key: 4, value: "Penang", i18nKey: "career.location.4" },
54
+ { key: 5, value: "Sabah", i18nKey: "career.location.5" },
55
+ { key: 6, value: "Sarawak", i18nKey: "career.location.6" },
56
+ { key: 7, value: "NegeriSembilan", i18nKey: "career.location.7" },
57
+ { key: 8, value: "Kedah", i18nKey: "career.location.8" },
58
+ { key: 9, value: "Kelantan", i18nKey: "career.location.9" },
59
+ { key: 10, value: "Perak", i18nKey: "career.location.10" },
60
+ { key: 11, value: "Terengganu", i18nKey: "career.location.11" },
61
+ { key: 12, value: "Perlis", i18nKey: "career.location.12" },
62
+ { key: 13, value: "Melaka", i18nKey: "career.location.13" },
63
+ { key: 14, value: "Putrajaya", i18nKey: "career.location.14" },
64
+ { key: 15, value: "Labuan", i18nKey: "career.location.15" }
65
+ ];
66
+
67
+ // src/contact-form/index.ts
68
+ var CONTACT_FORM_ENQUIRY_TYPE = [
69
+ {
70
+ key: 1,
71
+ value: "Software Development",
72
+ i18nKey: "contactForm.enquiryType.1"
73
+ },
74
+ {
75
+ key: 2,
76
+ value: "Advertising Platform",
77
+ i18nKey: "contactForm.enquiryType.2"
78
+ },
79
+ { key: 3, value: "MCN Business", i18nKey: "contactForm.enquiryType.3" }
80
+ ];
81
+
82
+ // src/files/index.ts
83
+ var FILE_STATUS = [
84
+ { key: 1, value: "pending", i18nKey: "files.status.1" },
85
+ { key: 2, value: "submitted", i18nKey: "files.status.2" }
86
+ ];
87
+ var FILE_ORIGIN = [
88
+ { key: 1, value: "job applications", i18nKey: "files.origin.1" },
89
+ { key: 2, value: "submitted", i18nKey: "files.origin.2" }
90
+ ];
91
+
92
+ // src/locale/index.ts
93
+ var LOCALE = [
94
+ { key: 1, value: "en", i18nKey: "locale.en" },
95
+ { key: 2, value: "zh", i18nKey: "locale.zh" }
96
+ ];
97
+
98
+ // src/roles/index.ts
99
+ var ROLE_MAP = {
100
+ 0: "super-admin",
101
+ 1: "admin",
102
+ 2: "staff",
103
+ 3: "hr",
104
+ 32766: "visitor",
105
+ 32767: "none"
106
+ };
107
+ var ROLE = [
108
+ { key: 0, value: "super-admin", i18nKey: "users.roleSuperAdmin" },
109
+ { key: 1, value: "admin", i18nKey: "users.roleAdmin" },
110
+ { key: 2, value: "staff", i18nKey: "users.roleStaff" },
111
+ { key: 3, value: "hr", i18nKey: "users.roleHr" },
112
+ { key: 32766, value: "visitor", i18nKey: "users.roleVisitor" },
113
+ { key: 32767, value: "none", i18nKey: "users.roleNone" }
114
+ ];
115
+ function normalizeRole(role) {
116
+ if (typeof role === "number") {
117
+ return ROLE_MAP[role];
118
+ }
119
+ switch (role) {
120
+ case "super-admin":
121
+ return "super-admin";
122
+ case "admin":
123
+ return "admin";
124
+ case "staff":
125
+ return "staff";
126
+ case "hr":
127
+ return "hr";
128
+ case "visitor":
129
+ return "visitor";
130
+ case "none":
131
+ return "none";
132
+ default:
133
+ return void 0;
134
+ }
135
+ }
136
+ function roleLabelKey(role) {
137
+ switch (normalizeRole(role)) {
138
+ case "super-admin":
139
+ return "users.roleSuperAdmin";
140
+ case "admin":
141
+ return "users.roleAdmin";
142
+ case "hr":
143
+ return "users.roleHr";
144
+ case "staff":
145
+ return "users.roleStaff";
146
+ case "visitor":
147
+ return "users.roleVisitor";
148
+ case "none":
149
+ return "users.roleNone";
150
+ default:
151
+ return "users.roleStaff";
152
+ }
153
+ }
154
+ function roleToId(role) {
155
+ const normalizedRole = normalizeRole(role);
156
+ return ROLE.find((option) => option.value === normalizedRole)?.key;
157
+ }
158
+ var Permission = {
159
+ ALLOWED_EMAILS_READ: "allowed-emails:read",
160
+ ALLOWED_EMAILS_WRITE: "allowed-emails:write",
161
+ USERS_READ: "users:read",
162
+ USERS_WRITE: "users:write",
163
+ USERS_DELETE: "users:delete",
164
+ CAREERS_READ: "careers:read",
165
+ CAREERS_WRITE: "careers:write",
166
+ CAREERS_DELETE: "careers:delete",
167
+ CONTACT_FORM_READ: "contact-form:read",
168
+ CONTACT_FORM_DELETE: "contact-form:delete",
169
+ JOB_APPLICATIONS_READ: "job-applications:read",
170
+ OTP_ATTEMPTS_READ: "otp-attempts:read",
171
+ OTP_ATTEMPTS_WRITE: "otp-attempts:write",
172
+ TWO_FACTOR_AUTH_READ: "two-factor-auth:read",
173
+ TWO_FACTOR_AUTH_WRITE: "two-factor-auth:write",
174
+ VIEWS_READ: "views:read",
175
+ LOGS_READ: "logs:read",
176
+ UTM_RECORDS_READ: "utm-records:read",
177
+ UTM_RECORDS_WRITE: "utm-records:write",
178
+ ORIGIN_READ: "origin:read",
179
+ ORIGIN_WRITE: "origin:write",
180
+ ORIGIN_DELETE: "origin:delete"
181
+ };
182
+ var PERMISSION_I18N_KEY = {
183
+ [Permission.ALLOWED_EMAILS_READ]: "permissions.allowedEmailsRead",
184
+ [Permission.ALLOWED_EMAILS_WRITE]: "permissions.allowedEmailsWrite",
185
+ [Permission.USERS_READ]: "permissions.usersRead",
186
+ [Permission.USERS_WRITE]: "permissions.usersWrite",
187
+ [Permission.USERS_DELETE]: "permissions.usersDelete",
188
+ [Permission.CAREERS_READ]: "permissions.careersRead",
189
+ [Permission.CAREERS_WRITE]: "permissions.careersWrite",
190
+ [Permission.CAREERS_DELETE]: "permissions.careersDelete",
191
+ [Permission.CONTACT_FORM_READ]: "permissions.contactFormRead",
192
+ [Permission.CONTACT_FORM_DELETE]: "permissions.contactFormDelete",
193
+ [Permission.JOB_APPLICATIONS_READ]: "permissions.jobApplicationsRead",
194
+ [Permission.OTP_ATTEMPTS_READ]: "permissions.otpAttemptsRead",
195
+ [Permission.OTP_ATTEMPTS_WRITE]: "permissions.otpAttemptsWrite",
196
+ [Permission.TWO_FACTOR_AUTH_READ]: "permissions.twoFactorAuthRead",
197
+ [Permission.TWO_FACTOR_AUTH_WRITE]: "permissions.twoFactorAuthWrite",
198
+ [Permission.VIEWS_READ]: "permissions.viewsRead",
199
+ [Permission.LOGS_READ]: "permissions.logsRead",
200
+ [Permission.UTM_RECORDS_READ]: "permissions.utmRecordsRead",
201
+ [Permission.UTM_RECORDS_WRITE]: "permissions.utmRecordsWrite",
202
+ [Permission.ORIGIN_READ]: "permissions.originRead",
203
+ [Permission.ORIGIN_WRITE]: "permissions.originWrite",
204
+ [Permission.ORIGIN_DELETE]: "permissions.originDelete"
205
+ };
206
+ var ROLE_PERMISSIONS = {
207
+ "super-admin": [
208
+ Permission.ALLOWED_EMAILS_READ,
209
+ Permission.ALLOWED_EMAILS_WRITE,
210
+ Permission.USERS_READ,
211
+ Permission.USERS_WRITE,
212
+ Permission.USERS_DELETE,
213
+ Permission.CAREERS_READ,
214
+ Permission.CAREERS_WRITE,
215
+ Permission.CAREERS_DELETE,
216
+ Permission.CONTACT_FORM_READ,
217
+ Permission.CONTACT_FORM_DELETE,
218
+ Permission.JOB_APPLICATIONS_READ,
219
+ Permission.OTP_ATTEMPTS_READ,
220
+ Permission.OTP_ATTEMPTS_WRITE,
221
+ Permission.TWO_FACTOR_AUTH_READ,
222
+ Permission.TWO_FACTOR_AUTH_WRITE,
223
+ Permission.VIEWS_READ,
224
+ Permission.LOGS_READ,
225
+ Permission.UTM_RECORDS_READ,
226
+ Permission.UTM_RECORDS_WRITE,
227
+ Permission.ORIGIN_READ,
228
+ Permission.ORIGIN_WRITE,
229
+ Permission.ORIGIN_DELETE
230
+ ],
231
+ admin: [
232
+ Permission.ALLOWED_EMAILS_READ,
233
+ Permission.ALLOWED_EMAILS_WRITE,
234
+ Permission.USERS_READ,
235
+ Permission.CAREERS_READ,
236
+ Permission.CAREERS_WRITE,
237
+ Permission.CAREERS_DELETE,
238
+ Permission.CONTACT_FORM_READ,
239
+ Permission.CONTACT_FORM_DELETE,
240
+ Permission.JOB_APPLICATIONS_READ,
241
+ Permission.VIEWS_READ,
242
+ Permission.LOGS_READ,
243
+ Permission.UTM_RECORDS_READ,
244
+ Permission.UTM_RECORDS_WRITE,
245
+ Permission.ORIGIN_READ,
246
+ Permission.ORIGIN_WRITE,
247
+ Permission.ORIGIN_DELETE
248
+ ],
249
+ hr: [
250
+ Permission.CAREERS_READ,
251
+ Permission.CAREERS_WRITE,
252
+ Permission.CAREERS_DELETE,
253
+ Permission.JOB_APPLICATIONS_READ
254
+ ],
255
+ staff: [Permission.CONTACT_FORM_READ],
256
+ visitor: [],
257
+ none: []
258
+ };
259
+ function hasPermission(role, permission) {
260
+ const normalizedRole = normalizeRole(role);
261
+ if (!normalizedRole) {
262
+ return false;
263
+ }
264
+ return ROLE_PERMISSIONS[normalizedRole].includes(permission);
265
+ }
266
+ function permissionLabelKey(permission) {
267
+ return PERMISSION_I18N_KEY[permission];
268
+ }
269
+
270
+ // src/routes/index.ts
271
+ var ROUTES = [
272
+ {
273
+ key: "home",
274
+ path: "/[locale]",
275
+ path_name: "/",
276
+ path_key: "/",
277
+ i18nKey: "routes.home"
278
+ },
279
+ {
280
+ key: "about",
281
+ path: "/[locale]/about",
282
+ path_name: "/about",
283
+ path_key: "/about",
284
+ i18nKey: "routes.about"
285
+ },
286
+ {
287
+ key: "career",
288
+ path: "/[locale]/career",
289
+ path_name: "/career",
290
+ path_key: "/career",
291
+ i18nKey: "routes.career"
292
+ },
293
+ {
294
+ key: "careerDetail",
295
+ path: "/[locale]/career/[id]",
296
+ path_name: "/career/[id]",
297
+ path_key: "/career/[id]",
298
+ i18nKey: "routes.careerDetail"
299
+ },
300
+ {
301
+ key: "careerApply",
302
+ path: "/[locale]/career/[id]/apply",
303
+ path_name: "/career/[id]/apply",
304
+ path_key: "/career/[id]/apply",
305
+ i18nKey: "routes.careerApply"
306
+ },
307
+ {
308
+ key: "careerAssessment",
309
+ path: "/[locale]/career/[id]/apply/assessment",
310
+ path_name: "/career/[id]/apply/assessment",
311
+ path_key: "/career/[id]/apply/assessment",
312
+ i18nKey: "routes.careerAssessment"
313
+ },
314
+ {
315
+ key: "contact",
316
+ path: "/[locale]/contact",
317
+ path_name: "/contact",
318
+ path_key: "/contact",
319
+ i18nKey: "routes.contact"
320
+ },
321
+ {
322
+ key: "services",
323
+ path: "/[locale]/services",
324
+ path_name: "/services",
325
+ path_key: "/services",
326
+ i18nKey: "routes.services"
327
+ },
328
+ {
329
+ key: "servicesAdvertisingPlatform",
330
+ path: "/[locale]/services/advertising-platform",
331
+ path_name: "/services/advertising-platform",
332
+ path_key: "/services/advertising-platform",
333
+ i18nKey: "routes.servicesAdvertisingPlatform"
334
+ },
335
+ {
336
+ key: "servicesMcnBusiness",
337
+ path: "/[locale]/services/mcn-business",
338
+ path_name: "/services/mcn-business",
339
+ path_key: "/services/mcn-business",
340
+ i18nKey: "routes.servicesMcnBusiness"
341
+ },
342
+ {
343
+ key: "servicesSoftwareDevelopment",
344
+ path: "/[locale]/services/software-development",
345
+ path_name: "/services/software-development",
346
+ path_key: "/services/software-development",
347
+ i18nKey: "routes.servicesSoftwareDevelopment"
348
+ }
349
+ ];
350
+ var ROUTE = Object.fromEntries(
351
+ ROUTES.map((route) => [route.key, route.path])
352
+ );
353
+ function routeLabelKey(route) {
354
+ return ROUTES.find((item) => item.key === route)?.i18nKey ?? "routes.home";
355
+ }
356
+ function routePathKey(route) {
357
+ return ROUTES.find((item) => item.key === route)?.path_key ?? "/";
358
+ }
359
+ function buildRoutePathName(route, params = {}) {
360
+ let pathName = ROUTES.find((item) => item.key === route)?.path_name ?? "/";
361
+ if (pathName.includes("[id]")) {
362
+ if (params.id === void 0 || params.id === null) {
363
+ throw new Error(`Route "${route}" requires an id parameter.`);
364
+ }
365
+ pathName = pathName.replace("[id]", encodeURIComponent(String(params.id)));
366
+ }
367
+ return pathName;
368
+ }
369
+ function buildLocalizedRoute(route, locale, params = {}) {
370
+ let path = ROUTE[route].replace("[locale]", encodeURIComponent(locale));
371
+ if (path.includes("[id]")) {
372
+ if (params.id === void 0 || params.id === null) {
373
+ throw new Error(`Route "${route}" requires an id parameter.`);
374
+ }
375
+ path = path.replace("[id]", encodeURIComponent(String(params.id)));
376
+ }
377
+ return path;
378
+ }
379
+
380
+ // src/shared/helpers.ts
381
+ function getOptionByKey(options, key) {
382
+ if (key === null || key === void 0) {
383
+ return void 0;
384
+ }
385
+ return options.find((option) => option.key === key);
386
+ }
387
+ function getLabelByKey(options, key, fallback = "Unknown") {
388
+ return getOptionByKey(options, key)?.value ?? fallback;
389
+ }
390
+ function getI18nKeyByKey(options, key, fallback = "unknown") {
391
+ return getOptionByKey(options, key)?.i18nKey ?? fallback;
392
+ }
393
+ function toRecord(options) {
394
+ return Object.fromEntries(options.map((option) => [option.key, option.value]));
395
+ }
396
+
397
+ // src/time/index.ts
398
+ import dayjs from "dayjs";
399
+ import timezone from "dayjs/plugin/timezone.js";
400
+ import utc from "dayjs/plugin/utc.js";
401
+ dayjs.extend(utc);
402
+ dayjs.extend(timezone);
403
+ var TIMEZONE = [
404
+ { key: 1, value: "UTC", i18nKey: "time.timezone.utc" },
405
+ {
406
+ key: 2,
407
+ value: "Asia/Kuala_Lumpur",
408
+ i18nKey: "time.timezone.asiaKualaLumpur"
409
+ },
410
+ {
411
+ key: 3,
412
+ value: "Asia/Singapore",
413
+ i18nKey: "time.timezone.asiaSingapore"
414
+ },
415
+ {
416
+ key: 4,
417
+ value: "Asia/Bangkok",
418
+ i18nKey: "time.timezone.asiaBangkok"
419
+ },
420
+ {
421
+ key: 5,
422
+ value: "Asia/Jakarta",
423
+ i18nKey: "time.timezone.asiaJakarta"
424
+ },
425
+ {
426
+ key: 6,
427
+ value: "Asia/Manila",
428
+ i18nKey: "time.timezone.asiaManila"
429
+ },
430
+ {
431
+ key: 7,
432
+ value: "Asia/Hong_Kong",
433
+ i18nKey: "time.timezone.asiaHongKong"
434
+ },
435
+ {
436
+ key: 8,
437
+ value: "Asia/Shanghai",
438
+ i18nKey: "time.timezone.asiaShanghai"
439
+ },
440
+ {
441
+ key: 9,
442
+ value: "Asia/Tokyo",
443
+ i18nKey: "time.timezone.asiaTokyo"
444
+ },
445
+ {
446
+ key: 10,
447
+ value: "Australia/Sydney",
448
+ i18nKey: "time.timezone.australiaSydney"
449
+ },
450
+ {
451
+ key: 11,
452
+ value: "Europe/London",
453
+ i18nKey: "time.timezone.europeLondon"
454
+ },
455
+ {
456
+ key: 12,
457
+ value: "Europe/Berlin",
458
+ i18nKey: "time.timezone.europeBerlin"
459
+ },
460
+ {
461
+ key: 13,
462
+ value: "America/New_York",
463
+ i18nKey: "time.timezone.americaNewYork"
464
+ },
465
+ {
466
+ key: 14,
467
+ value: "America/Chicago",
468
+ i18nKey: "time.timezone.americaChicago"
469
+ },
470
+ {
471
+ key: 15,
472
+ value: "America/Denver",
473
+ i18nKey: "time.timezone.americaDenver"
474
+ },
475
+ {
476
+ key: 16,
477
+ value: "America/Los_Angeles",
478
+ i18nKey: "time.timezone.americaLosAngeles"
479
+ }
480
+ ];
481
+ var TIMEZONE_ALIAS_TO_CANONICAL = {
482
+ utc: "UTC",
483
+ "etc/utc": "UTC",
484
+ "asia/kuala_lumpur": "Asia/Kuala_Lumpur",
485
+ "asia/kuala lumpur": "Asia/Kuala_Lumpur",
486
+ "kuala_lumpur": "Asia/Kuala_Lumpur",
487
+ "kuala lumpur": "Asia/Kuala_Lumpur",
488
+ "asia/singapore": "Asia/Singapore",
489
+ singapore: "Asia/Singapore",
490
+ "asia/bangkok": "Asia/Bangkok",
491
+ bangkok: "Asia/Bangkok",
492
+ "asia/jakarta": "Asia/Jakarta",
493
+ jakarta: "Asia/Jakarta",
494
+ "asia/manila": "Asia/Manila",
495
+ manila: "Asia/Manila",
496
+ "asia/hong_kong": "Asia/Hong_Kong",
497
+ "asia/hong kong": "Asia/Hong_Kong",
498
+ "hong_kong": "Asia/Hong_Kong",
499
+ "hong kong": "Asia/Hong_Kong",
500
+ "asia/shanghai": "Asia/Shanghai",
501
+ shanghai: "Asia/Shanghai",
502
+ "asia/tokyo": "Asia/Tokyo",
503
+ tokyo: "Asia/Tokyo",
504
+ "australia/sydney": "Australia/Sydney",
505
+ sydney: "Australia/Sydney",
506
+ "europe/london": "Europe/London",
507
+ london: "Europe/London",
508
+ "europe/berlin": "Europe/Berlin",
509
+ berlin: "Europe/Berlin",
510
+ "america/new_york": "America/New_York",
511
+ "america/new york": "America/New_York",
512
+ "new_york": "America/New_York",
513
+ "new york": "America/New_York",
514
+ "america/chicago": "America/Chicago",
515
+ chicago: "America/Chicago",
516
+ "america/denver": "America/Denver",
517
+ denver: "America/Denver",
518
+ "america/los_angeles": "America/Los_Angeles",
519
+ "america/los angeles": "America/Los_Angeles",
520
+ "los_angeles": "America/Los_Angeles",
521
+ "los angeles": "America/Los_Angeles"
522
+ };
523
+ var TIMEZONE_I18N_KEY = Object.fromEntries(
524
+ TIMEZONE.map(({ value, i18nKey }) => [value, i18nKey])
525
+ );
526
+ function toTimezoneAlias(timezone2) {
527
+ return timezone2.trim().toLowerCase().replace(/-/g, "_");
528
+ }
529
+ function normalizeTimezone(timezone2) {
530
+ if (!timezone2) {
531
+ return void 0;
532
+ }
533
+ return TIMEZONE_ALIAS_TO_CANONICAL[toTimezoneAlias(timezone2)];
534
+ }
535
+ function timezoneToUtc(timezone2, timestamp = Date.now()) {
536
+ const normalizedTimezone = normalizeTimezone(timezone2);
537
+ if (!normalizedTimezone) {
538
+ return void 0;
539
+ }
540
+ return `UTC${dayjs(timestamp).tz(normalizedTimezone).format("Z")}`;
541
+ }
542
+ var TIMEZONE_CURRENT_UTC_OFFSET = Object.fromEntries(
543
+ TIMEZONE.map(({ value }) => [value, timezoneToUtc(value)])
544
+ );
545
+ var TIMEZONE_TO_UTC = TIMEZONE_CURRENT_UTC_OFFSET;
546
+ function timezoneLabelKey(timezone2) {
547
+ const normalizedTimezone = normalizeTimezone(timezone2);
548
+ if (!normalizedTimezone) {
549
+ return "time.timezone.utc";
550
+ }
551
+ return TIMEZONE_I18N_KEY[normalizedTimezone];
552
+ }
553
+ function convertTimestampToTimezone(timestamp, sourceTimezone, targetTimezone) {
554
+ const normalizedSourceTimezone = normalizeTimezone(sourceTimezone);
555
+ const normalizedTargetTimezone = normalizeTimezone(targetTimezone);
556
+ if (!normalizedSourceTimezone || !normalizedTargetTimezone) {
557
+ return void 0;
558
+ }
559
+ const sourceDateTime = dayjs(timestamp).tz(normalizedSourceTimezone);
560
+ const preservedWallClock = sourceDateTime.format("YYYY-MM-DDTHH:mm:ss.SSS");
561
+ return dayjs.tz(preservedWallClock, normalizedTargetTimezone).valueOf();
562
+ }
563
+
564
+ // src/track/index.ts
565
+ var ORIGIN = [
566
+ {
567
+ key: 0,
568
+ value: "Website",
569
+ i18nKey: "track.origin.0"
570
+ },
571
+ {
572
+ key: 1,
573
+ value: "Linkedin",
574
+ i18nKey: "track.origin.1"
575
+ },
576
+ { key: 2, value: "Jobstreet", i18nKey: "track.origin.2" },
577
+ { key: 3, value: "Maukerja", i18nKey: "track.origin.3" }
578
+ ];
579
+
580
+ // src/website/index.js
581
+ var Website;
582
+ (function(Website3) {
583
+ Website3[Website3["KORRE"] = 1] = "KORRE";
584
+ Website3[Website3["KORRE_LABS"] = 2] = "KORRE_LABS";
585
+ })(Website || (Website = {}));
586
+ var WEBSITES = {
587
+ [Website.KORRE]: {
588
+ id: Website.KORRE,
589
+ name: "Korre Evolution",
590
+ url: "https://public.korre.site/images/korre-evo.png"
591
+ },
592
+ [Website.KORRE_LABS]: {
593
+ id: Website.KORRE_LABS,
594
+ name: "Korre Labs",
595
+ url: "https://public.korre.site/images/korre-labs.png"
596
+ }
597
+ };
598
+
599
+ // src/url-prefix/index.ts
600
+ var URL_PREFIXES = {
601
+ [Website.KORRE]: {
602
+ contact: "https://www.korre.site/contact",
603
+ careerDetail: "https://www.korre.site/career/[id]",
604
+ careerApply: "https://www.korre.site/career/[id]/apply"
605
+ },
606
+ [Website.KORRE_LABS]: {}
607
+ };
608
+
609
+ // src/website/index.ts
610
+ var Website2 = /* @__PURE__ */ ((Website3) => {
611
+ Website3[Website3["KORRE"] = 1] = "KORRE";
612
+ Website3[Website3["KORRE_LABS"] = 2] = "KORRE_LABS";
613
+ return Website3;
614
+ })(Website2 || {});
615
+ var WEBSITES2 = {
616
+ [1 /* KORRE */]: {
617
+ id: 1 /* KORRE */,
618
+ name: "Korre Evolution",
619
+ url: "https://public.korre.site/images/korre-evo.png"
620
+ },
621
+ [2 /* KORRE_LABS */]: {
622
+ id: 2 /* KORRE_LABS */,
623
+ name: "Korre Labs",
624
+ url: "https://public.korre.site/images/korre-labs.png"
625
+ }
626
+ };
627
+
628
+ // src/addressess/index.ts
629
+ var COUNTRY_CODE = [
630
+ { key: 1, value: "MY", i18nKey: "country.code.1" }
631
+ ];
632
+ var STATES = {
633
+ MY: [
634
+ { key: 1, value: "Johor", i18nKey: "malaysia.state.1" },
635
+ { key: 2, value: "Kedah", i18nKey: "malaysia.state.2" },
636
+ { key: 3, value: "Kelantan", i18nKey: "malaysia.state.3" },
637
+ { key: 4, value: "Melaka", i18nKey: "malaysia.state.4" },
638
+ { key: 5, value: "Negeri Sembilan", i18nKey: "malaysia.state.5" },
639
+ { key: 6, value: "Pahang", i18nKey: "malaysia.state.6" },
640
+ { key: 7, value: "Penang", i18nKey: "malaysia.state.7" },
641
+ { key: 8, value: "Perak", i18nKey: "malaysia.state.8" },
642
+ { key: 9, value: "Perlis", i18nKey: "malaysia.state.9" },
643
+ { key: 10, value: "Sabah", i18nKey: "malaysia.state.10" },
644
+ { key: 11, value: "Sarawak", i18nKey: "malaysia.state.11" },
645
+ { key: 12, value: "Selangor", i18nKey: "malaysia.state.12" },
646
+ { key: 13, value: "Terengganu", i18nKey: "malaysia.state.13" },
647
+ { key: 14, value: "Kuala Lumpur", i18nKey: "malaysia.state.14" },
648
+ { key: 15, value: "Labuan", i18nKey: "malaysia.state.15" },
649
+ { key: 16, value: "Putrajaya", i18nKey: "malaysia.state.16" }
650
+ ]
651
+ };
652
+ var MALAYSIA_STATE = STATES.MY;
653
+
654
+ // src/job-applications/index.ts
655
+ var JOB_APPLICATION_STATUS = [
656
+ { key: 0, value: "Pending Review", i18nKey: "jobApplication.status.0" },
657
+ { key: 1, value: "Shortlisted", i18nKey: "jobApplication.status.1" },
658
+ { key: 2, value: "Interview", i18nKey: "jobApplication.status.2" },
659
+ { key: 3, value: "Offered", i18nKey: "jobApplication.status.3" },
660
+ { key: 4, value: "Hired", i18nKey: "jobApplication.status.4" },
661
+ { key: 5, value: "Rejected", i18nKey: "jobApplication.status.5" },
662
+ { key: 6, value: "Withdrawn", i18nKey: "jobApplication.status.6" },
663
+ { key: 7, value: "Ghosted", i18nKey: "jobApplication.status.7" }
664
+ ];
665
+
666
+ // src/email-template/index.ts
667
+ var EMAIL_TEMPLATE_ROLES = [
668
+ { key: 0, value: "Creator", i18nKey: "emailTemplate.role.0" },
669
+ { key: 1, value: "Editor", i18nKey: "emailTemplate.role.1" },
670
+ { key: 2, value: "Viewer", i18nKey: "emailTemplate.role.2" }
671
+ ];
672
+
673
+ // src/email-history/index.ts
674
+ var EMAIL_HISTORY_STATUS = [
675
+ { key: 0, value: "Scheduled", i18nKey: "emailHistory.status.0" },
676
+ { key: 1, value: "Delivering", i18nKey: "emailHistory.status.1" },
677
+ { key: 2, value: "Delivered", i18nKey: "emailHistory.status.2" },
678
+ { key: 3, value: "Failed", i18nKey: "emailHistory.status.3" },
679
+ { key: 4, value: "Canceled", i18nKey: "emailHistory.status.4" }
680
+ ];
681
+ export {
682
+ ASSESSMENT_QUESTION_TYPE,
683
+ CAREER_CATEGORY,
684
+ CAREER_JOB_TYPE,
685
+ CAREER_LOCATION,
686
+ CAREER_MODE,
687
+ CONTACT_FORM_ENQUIRY_TYPE,
688
+ COUNTRY_CODE,
689
+ EMAIL_HISTORY_STATUS,
690
+ EMAIL_TEMPLATE_ROLES,
691
+ FILE_ORIGIN,
692
+ FILE_STATUS,
693
+ JOB_APPLICATION_STATUS,
694
+ LOCALE,
695
+ MALAYSIA_STATE,
696
+ ORIGIN,
697
+ PERMISSION_I18N_KEY,
698
+ Permission,
699
+ QuestionType,
700
+ ROLE,
701
+ ROLE_MAP,
702
+ ROLE_PERMISSIONS,
703
+ ROUTE,
704
+ ROUTES,
705
+ STATES,
706
+ TIMEZONE,
707
+ TIMEZONE_CURRENT_UTC_OFFSET,
708
+ TIMEZONE_TO_UTC,
709
+ URL_PREFIXES,
710
+ WEBSITES2 as WEBSITES,
711
+ Website2 as Website,
712
+ buildLocalizedRoute,
713
+ buildRoutePathName,
714
+ convertTimestampToTimezone,
715
+ getI18nKeyByKey,
716
+ getLabelByKey,
717
+ getOptionByKey,
718
+ hasPermission,
719
+ normalizeRole,
720
+ normalizeTimezone,
721
+ permissionLabelKey,
722
+ roleLabelKey,
723
+ roleToId,
724
+ routeLabelKey,
725
+ routePathKey,
726
+ timezoneLabelKey,
727
+ timezoneToUtc,
728
+ toRecord
729
+ };