@timardex/cluemart-shared 1.5.807 → 1.5.808
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/{chunk-5HLIY25H.mjs → chunk-4CGXFFCO.mjs} +42 -2
- package/dist/chunk-4CGXFFCO.mjs.map +1 -0
- package/dist/formFields/index.mjs +1 -1
- package/dist/hooks/index.cjs +43 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +7 -2
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +42 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.mjs +40 -0
- package/dist/index.mjs.map +1 -1
- package/dist/utils/index.cjs +42 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +15 -1
- package/dist/utils/index.d.ts +15 -1
- package/dist/utils/index.mjs +5 -1
- package/package.json +1 -1
- package/dist/chunk-5HLIY25H.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -230,6 +230,7 @@ __export(index_exports, {
|
|
|
230
230
|
isPostShareResourceType: () => isPostShareResourceType,
|
|
231
231
|
isRelationShareResourceType: () => isRelationShareResourceType,
|
|
232
232
|
isResourceImageActive: () => isResourceImageActive,
|
|
233
|
+
isValidIrdNumber: () => isValidIrdNumber,
|
|
233
234
|
joinShareDescriptionSections: () => joinShareDescriptionSections,
|
|
234
235
|
joinShareOgDescriptionSections: () => joinShareOgDescriptionSections,
|
|
235
236
|
licenseNiceNames: () => licenseNiceNames,
|
|
@@ -241,6 +242,7 @@ __export(index_exports, {
|
|
|
241
242
|
mapArrayToOptions: () => mapArrayToOptions,
|
|
242
243
|
matchesCategory: () => matchesCategory,
|
|
243
244
|
matchesSelectedDate: () => matchesSelectedDate,
|
|
245
|
+
normalizeIrdNumber: () => normalizeIrdNumber,
|
|
244
246
|
normalizeResourceImage: () => normalizeResourceImage,
|
|
245
247
|
normalizeShareOgDescription: () => normalizeShareOgDescription,
|
|
246
248
|
normalizeShareRouteId: () => normalizeShareRouteId,
|
|
@@ -2835,6 +2837,44 @@ var AFFILIATE_PARTICIPANT_TYPE_LABELS = {
|
|
|
2835
2837
|
["COMPANY" /* COMPANY */]: "Company"
|
|
2836
2838
|
};
|
|
2837
2839
|
|
|
2840
|
+
// src/utils/irdNumber.ts
|
|
2841
|
+
var PRIMARY_WEIGHTS = [3, 2, 7, 6, 5, 4, 3, 2];
|
|
2842
|
+
var SECONDARY_WEIGHTS = [7, 4, 3, 2, 5, 2, 7, 6];
|
|
2843
|
+
var IRD_MIN = 1e7;
|
|
2844
|
+
var IRD_MAX = 2e8;
|
|
2845
|
+
function calculateCheckDigit(baseDigits, weights) {
|
|
2846
|
+
const sum = [...baseDigits].reduce(
|
|
2847
|
+
(acc, digit, index) => acc + Number(digit) * weights[index],
|
|
2848
|
+
0
|
|
2849
|
+
);
|
|
2850
|
+
const remainder = sum % 11;
|
|
2851
|
+
return remainder === 0 ? 0 : 11 - remainder;
|
|
2852
|
+
}
|
|
2853
|
+
function normalizeIrdNumber(value) {
|
|
2854
|
+
return value.replace(/\D/g, "");
|
|
2855
|
+
}
|
|
2856
|
+
function isValidIrdNumber(value) {
|
|
2857
|
+
const digits = normalizeIrdNumber(value);
|
|
2858
|
+
if (!/^\d{8,9}$/.test(digits)) {
|
|
2859
|
+
return false;
|
|
2860
|
+
}
|
|
2861
|
+
const ird = Number(digits);
|
|
2862
|
+
if (ird < IRD_MIN || ird > IRD_MAX) {
|
|
2863
|
+
return false;
|
|
2864
|
+
}
|
|
2865
|
+
const padded = digits.padStart(9, "0");
|
|
2866
|
+
const baseDigits = padded.slice(0, -1);
|
|
2867
|
+
const checkDigit = Number(padded.slice(-1));
|
|
2868
|
+
let calculated = calculateCheckDigit(baseDigits, PRIMARY_WEIGHTS);
|
|
2869
|
+
if (calculated === 10) {
|
|
2870
|
+
calculated = calculateCheckDigit(baseDigits, SECONDARY_WEIGHTS);
|
|
2871
|
+
if (calculated === 10) {
|
|
2872
|
+
return false;
|
|
2873
|
+
}
|
|
2874
|
+
}
|
|
2875
|
+
return calculated === checkDigit;
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2838
2878
|
// src/formFields/vendor/vendorInfo.ts
|
|
2839
2879
|
var vendorElectricity = {
|
|
2840
2880
|
details: {
|
|
@@ -9330,6 +9370,7 @@ var fonts = {
|
|
|
9330
9370
|
isPostShareResourceType,
|
|
9331
9371
|
isRelationShareResourceType,
|
|
9332
9372
|
isResourceImageActive,
|
|
9373
|
+
isValidIrdNumber,
|
|
9333
9374
|
joinShareDescriptionSections,
|
|
9334
9375
|
joinShareOgDescriptionSections,
|
|
9335
9376
|
licenseNiceNames,
|
|
@@ -9341,6 +9382,7 @@ var fonts = {
|
|
|
9341
9382
|
mapArrayToOptions,
|
|
9342
9383
|
matchesCategory,
|
|
9343
9384
|
matchesSelectedDate,
|
|
9385
|
+
normalizeIrdNumber,
|
|
9344
9386
|
normalizeResourceImage,
|
|
9345
9387
|
normalizeShareOgDescription,
|
|
9346
9388
|
normalizeShareRouteId,
|