generaltranslation 8.2.12 → 8.2.14

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 (222) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/{ApiError-IYfaOR30.mjs → ApiError-0DxxIHLp.mjs} +1 -1
  3. package/dist/{ApiError-CZ45tkW6.cjs.map → ApiError-0DxxIHLp.mjs.map} +1 -1
  4. package/dist/{ApiError-CZ45tkW6.cjs → ApiError-D-IBuHj6.cjs} +1 -1
  5. package/dist/{ApiError-IYfaOR30.mjs.map → ApiError-D-IBuHj6.cjs.map} +1 -1
  6. package/dist/LocaleConfig.d.ts +1 -0
  7. package/dist/LocaleConfig.js +1 -0
  8. package/dist/backwards-compatability/dataConversion.d.ts +23 -0
  9. package/dist/backwards-compatability/dataConversion.js +207 -0
  10. package/dist/backwards-compatability/oldHashJsxChildren.d.ts +23 -0
  11. package/dist/backwards-compatability/oldHashJsxChildren.js +79 -0
  12. package/dist/backwards-compatability/oldTypes.d.ts +21 -0
  13. package/dist/backwards-compatability/oldTypes.js +1 -0
  14. package/dist/backwards-compatability/typeChecking.d.ts +21 -0
  15. package/dist/backwards-compatability/typeChecking.js +61 -0
  16. package/dist/{base64-2fu94Klt.cjs → base64-C6BHySOc.cjs} +17 -1
  17. package/dist/base64-C6BHySOc.cjs.map +1 -0
  18. package/dist/{base64-DH0STixb.mjs → base64-CWITCfhU.mjs} +6 -2
  19. package/dist/base64-CWITCfhU.mjs.map +1 -0
  20. package/dist/core.cjs +9 -8
  21. package/dist/core.d.cts +1 -2
  22. package/dist/core.d.mts +1 -2
  23. package/dist/core.d.ts +1 -0
  24. package/dist/core.js +1 -0
  25. package/dist/core.mjs +2 -2
  26. package/dist/derive/condenseVars.d.ts +7 -0
  27. package/dist/derive/condenseVars.js +30 -0
  28. package/dist/derive/declareVar.d.ts +26 -0
  29. package/dist/derive/declareVar.js +38 -0
  30. package/dist/derive/decodeVars.d.ts +9 -0
  31. package/dist/derive/decodeVars.js +52 -0
  32. package/dist/derive/derive.d.ts +53 -0
  33. package/dist/derive/derive.js +55 -0
  34. package/dist/derive/extractVars.d.ts +9 -0
  35. package/dist/derive/extractVars.js +34 -0
  36. package/dist/derive/index.d.ts +7 -0
  37. package/dist/derive/index.js +7 -0
  38. package/dist/derive/indexVars.d.ts +6 -0
  39. package/dist/derive/indexVars.js +52 -0
  40. package/dist/derive/utils/constants.d.ts +2 -0
  41. package/dist/derive/utils/constants.js +2 -0
  42. package/dist/derive/utils/regex.d.ts +2 -0
  43. package/dist/derive/utils/regex.js +4 -0
  44. package/dist/derive/utils/sanitizeVar.d.ts +12 -0
  45. package/dist/derive/utils/sanitizeVar.js +38 -0
  46. package/dist/derive/utils/traverseHelpers.d.ts +4 -0
  47. package/dist/derive/utils/traverseHelpers.js +22 -0
  48. package/dist/derive/utils/traverseIcu.d.ts +20 -0
  49. package/dist/derive/utils/traverseIcu.js +49 -0
  50. package/dist/derive/utils/types.d.ts +23 -0
  51. package/dist/derive/utils/types.js +1 -0
  52. package/dist/errors/ApiError.d.ts +7 -0
  53. package/dist/errors/ApiError.js +33 -0
  54. package/dist/errors.cjs +1 -1
  55. package/dist/errors.d.ts +1 -0
  56. package/dist/errors.js +1 -0
  57. package/dist/errors.mjs +1 -1
  58. package/dist/id/hashSource.d.ts +25 -0
  59. package/dist/id/hashSource.js +98 -0
  60. package/dist/id/hashTemplate.d.ts +4 -0
  61. package/dist/id/hashTemplate.js +6 -0
  62. package/dist/id/types.d.ts +7 -0
  63. package/dist/id/types.js +1 -0
  64. package/dist/{id-CyiXsQrY.cjs → id-C2orn1MA.cjs} +2 -2
  65. package/dist/{id-CyiXsQrY.cjs.map → id-C2orn1MA.cjs.map} +1 -1
  66. package/dist/{id-DbD7K-HL.mjs → id-DEaFhGqX.mjs} +2 -2
  67. package/dist/{id-DbD7K-HL.mjs.map → id-DEaFhGqX.mjs.map} +1 -1
  68. package/dist/id.cjs +1 -1
  69. package/dist/id.d.cts +1 -1
  70. package/dist/id.d.mts +1 -1
  71. package/dist/id.d.ts +3 -0
  72. package/dist/id.js +3 -0
  73. package/dist/id.mjs +1 -1
  74. package/dist/index.cjs +368 -385
  75. package/dist/index.cjs.map +1 -1
  76. package/dist/index.d.cts +4 -242
  77. package/dist/index.d.mts +4 -242
  78. package/dist/index.d.ts +786 -0
  79. package/dist/index.js +1345 -0
  80. package/dist/index.mjs +215 -352
  81. package/dist/index.mjs.map +1 -1
  82. package/dist/internal.cjs +7 -7
  83. package/dist/internal.cjs.map +1 -1
  84. package/dist/internal.d.cts +7 -6
  85. package/dist/internal.d.mts +7 -6
  86. package/dist/internal.d.ts +19 -0
  87. package/dist/internal.js +17 -0
  88. package/dist/internal.mjs +5 -5
  89. package/dist/internal.mjs.map +1 -1
  90. package/dist/{isVariable-B08mggBy.cjs → isVariable-Ba1gLXdB.cjs} +1 -1
  91. package/dist/{isVariable-B08mggBy.cjs.map → isVariable-Ba1gLXdB.cjs.map} +1 -1
  92. package/dist/{isVariable-CYsKFHvR.mjs → isVariable-fAKEB7gF.mjs} +1 -1
  93. package/dist/{isVariable-CYsKFHvR.mjs.map → isVariable-fAKEB7gF.mjs.map} +1 -1
  94. package/dist/locales/getPluralForm.d.ts +9 -0
  95. package/dist/locales/getPluralForm.js +63 -0
  96. package/dist/logging/errors.d.ts +10 -0
  97. package/dist/logging/errors.js +29 -0
  98. package/dist/logging/logger.d.ts +118 -0
  99. package/dist/logging/logger.js +256 -0
  100. package/dist/projects/getProjectData.d.ts +1 -0
  101. package/dist/projects/getProjectData.js +87 -0
  102. package/dist/settings/plurals.d.ts +3 -0
  103. package/dist/settings/plurals.js +14 -0
  104. package/dist/settings/settings.d.ts +2 -0
  105. package/dist/settings/settings.js +2 -0
  106. package/dist/settings/settingsUrls.d.ts +3 -0
  107. package/dist/settings/settingsUrls.js +3 -0
  108. package/dist/translate/api.d.ts +1 -0
  109. package/dist/translate/api.js +1 -0
  110. package/dist/translate/awaitJobs.d.ts +19 -0
  111. package/dist/translate/awaitJobs.js +112 -0
  112. package/dist/translate/checkJobStatus.d.ts +8 -0
  113. package/dist/translate/checkJobStatus.js +55 -0
  114. package/dist/translate/createBranch.d.ts +10 -0
  115. package/dist/translate/createBranch.js +53 -0
  116. package/dist/translate/createTag.d.ts +19 -0
  117. package/dist/translate/createTag.js +67 -0
  118. package/dist/translate/downloadFileBatch.d.ts +1 -0
  119. package/dist/translate/downloadFileBatch.js +77 -0
  120. package/dist/translate/enqueueFiles.d.ts +8 -0
  121. package/dist/translate/enqueueFiles.js +96 -0
  122. package/dist/translate/getOrphanedFiles.d.ts +8 -0
  123. package/dist/translate/getOrphanedFiles.js +97 -0
  124. package/dist/translate/processFileMoves.d.ts +25 -0
  125. package/dist/translate/processFileMoves.js +90 -0
  126. package/dist/translate/publishFiles.d.ts +17 -0
  127. package/dist/translate/publishFiles.js +56 -0
  128. package/dist/translate/queryBranchData.d.ts +3 -0
  129. package/dist/translate/queryBranchData.js +53 -0
  130. package/dist/translate/queryFileData.d.ts +42 -0
  131. package/dist/translate/queryFileData.js +71 -0
  132. package/dist/translate/querySourceFile.d.ts +1 -0
  133. package/dist/translate/querySourceFile.js +67 -0
  134. package/dist/translate/setupProject.d.ts +11 -0
  135. package/dist/translate/setupProject.js +63 -0
  136. package/dist/translate/submitUserEditDiffs.d.ts +12 -0
  137. package/dist/translate/submitUserEditDiffs.js +68 -0
  138. package/dist/translate/translateMany.d.ts +1 -0
  139. package/dist/translate/translateMany.js +103 -0
  140. package/dist/translate/uploadSourceFiles.d.ts +1 -0
  141. package/dist/translate/uploadSourceFiles.js +87 -0
  142. package/dist/translate/uploadTranslations.d.ts +1 -0
  143. package/dist/translate/uploadTranslations.js +101 -0
  144. package/dist/translate/utils/apiRequest.d.ts +1 -0
  145. package/dist/translate/utils/apiRequest.js +130 -0
  146. package/dist/translate/utils/batch.d.ts +52 -0
  147. package/dist/translate/utils/batch.js +126 -0
  148. package/dist/translate/utils/fetchWithTimeout.d.ts +1 -0
  149. package/dist/translate/utils/fetchWithTimeout.js +93 -0
  150. package/dist/translate/utils/generateRequestHeaders.d.ts +2 -0
  151. package/dist/translate/utils/generateRequestHeaders.js +26 -0
  152. package/dist/translate/utils/handleFetchError.d.ts +1 -0
  153. package/dist/translate/utils/handleFetchError.js +12 -0
  154. package/dist/translate/utils/validateFileFormatTransform.d.ts +16 -0
  155. package/dist/translate/utils/validateFileFormatTransform.js +29 -0
  156. package/dist/translate/utils/validateResponse.d.ts +1 -0
  157. package/dist/translate/utils/validateResponse.js +72 -0
  158. package/dist/{types-V5rqd1WR.d.cts → types-73XFwmhH.d.mts} +39 -115
  159. package/dist/{types-BsGsgJWF.d.mts → types-YrrGRHBP.d.cts} +39 -115
  160. package/dist/types-dir/api/branch.d.ts +10 -0
  161. package/dist/types-dir/api/branch.js +1 -0
  162. package/dist/types-dir/api/checkFileTranslations.d.ts +37 -0
  163. package/dist/types-dir/api/checkFileTranslations.js +1 -0
  164. package/dist/types-dir/api/downloadFile.d.ts +3 -0
  165. package/dist/types-dir/api/downloadFile.js +1 -0
  166. package/dist/types-dir/api/downloadFileBatch.d.ts +35 -0
  167. package/dist/types-dir/api/downloadFileBatch.js +1 -0
  168. package/dist/types-dir/api/enqueueEntries.d.ts +21 -0
  169. package/dist/types-dir/api/enqueueEntries.js +1 -0
  170. package/dist/types-dir/api/enqueueFiles.d.ts +70 -0
  171. package/dist/types-dir/api/enqueueFiles.js +1 -0
  172. package/dist/types-dir/api/entry.d.ts +39 -0
  173. package/dist/types-dir/api/entry.js +1 -0
  174. package/dist/types-dir/api/fetchTranslations.d.ts +12 -0
  175. package/dist/types-dir/api/fetchTranslations.js +1 -0
  176. package/dist/types-dir/api/file.d.ts +57 -0
  177. package/dist/types-dir/api/file.js +1 -0
  178. package/dist/types-dir/api/json.d.ts +5 -0
  179. package/dist/types-dir/api/json.js +1 -0
  180. package/dist/types-dir/api/project.d.ts +7 -0
  181. package/dist/types-dir/api/project.js +1 -0
  182. package/dist/types-dir/api/translate.d.ts +34 -0
  183. package/dist/types-dir/api/translate.js +1 -0
  184. package/dist/types-dir/api/translateMany.d.ts +5 -0
  185. package/dist/types-dir/api/translateMany.js +1 -0
  186. package/dist/types-dir/api/translationStatus.d.ts +9 -0
  187. package/dist/types-dir/api/translationStatus.js +1 -0
  188. package/dist/types-dir/api/uploadFiles.d.ts +44 -0
  189. package/dist/types-dir/api/uploadFiles.js +1 -0
  190. package/dist/types-dir/transformations.d.ts +8 -0
  191. package/dist/types-dir/transformations.js +1 -0
  192. package/dist/types.cjs +7 -16
  193. package/dist/types.d.cts +2 -2
  194. package/dist/types.d.mts +2 -2
  195. package/dist/types.d.ts +127 -0
  196. package/dist/types.js +1 -0
  197. package/dist/types.mjs +1 -15
  198. package/dist/utils/base64.d.ts +2 -0
  199. package/dist/utils/base64.js +28 -0
  200. package/dist/utils/isSupportedFileFormatTransform.d.ts +8 -0
  201. package/dist/utils/isSupportedFileFormatTransform.js +26 -0
  202. package/dist/utils/isVariable.d.ts +2 -0
  203. package/dist/utils/isVariable.js +22 -0
  204. package/dist/utils/minify.d.ts +2 -0
  205. package/dist/utils/minify.js +10 -0
  206. package/dist/utils/stableStringify.d.ts +1 -0
  207. package/dist/utils/stableStringify.js +40 -0
  208. package/package.json +5 -4
  209. package/dist/IntlCache-CAW8tKhd.cjs +0 -212
  210. package/dist/IntlCache-CAW8tKhd.cjs.map +0 -1
  211. package/dist/IntlCache-WZk0rKvj.mjs +0 -195
  212. package/dist/IntlCache-WZk0rKvj.mjs.map +0 -1
  213. package/dist/base64-2fu94Klt.cjs.map +0 -1
  214. package/dist/base64-DH0STixb.mjs.map +0 -1
  215. package/dist/core-7RJsqw6c.mjs +0 -1498
  216. package/dist/core-7RJsqw6c.mjs.map +0 -1
  217. package/dist/core-CGhlXrrK.d.mts +0 -209
  218. package/dist/core-CST4J4WU.cjs +0 -1677
  219. package/dist/core-CST4J4WU.cjs.map +0 -1
  220. package/dist/core-D-E8qhLn.d.cts +0 -209
  221. package/dist/types.cjs.map +0 -1
  222. package/dist/types.mjs.map +0 -1
@@ -0,0 +1,25 @@
1
+ import { JsxChildren } from '../types';
2
+ import { HashMetadata } from './types';
3
+ /**
4
+ * Calculates a unique hash for a given string using SHA-256.
5
+ *
6
+ * First 16 characters of hash, hex encoded.
7
+ *
8
+ * @param {string} string - The string to be hashed.
9
+ * @returns {string} The resulting hash as a hexadecimal string.
10
+ */
11
+ export declare function hashString(string: string): string;
12
+ /**
13
+ * Calculates a unique ID for the given children objects by hashing their sanitized JSON string representation.
14
+ *
15
+ * @param {any} childrenAsObjects - The children objects to be hashed.
16
+ * @param {string} [context] - The context for the children.
17
+ * @param {string} [id] - The ID for the JSX children object.
18
+ * @param {number} [maxChars] - The maxChars limit for the JSX children object.
19
+ * @param {string} [dataFormat] - The data format of the sources.
20
+ * @param {function} [hashFunction] - Custom hash function.
21
+ * @returns {string} - The unique hash of the children.
22
+ */
23
+ export declare function hashSource({ source, context, id, maxChars, dataFormat, }: {
24
+ source: JsxChildren | string;
25
+ } & HashMetadata, hashFunction?: (string: string) => string): string;
@@ -0,0 +1,98 @@
1
+ // Functions provided to other GT libraries
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ import { stableStringify as stringify } from '../utils/stableStringify';
14
+ import { sha256 } from '@noble/hashes/sha2.js';
15
+ import { bytesToHex, utf8ToBytes } from '@noble/hashes/utils.js';
16
+ import isVariable from '../utils/isVariable';
17
+ // ----- FUNCTIONS ----- //
18
+ /**
19
+ * Calculates a unique hash for a given string using SHA-256.
20
+ *
21
+ * First 16 characters of hash, hex encoded.
22
+ *
23
+ * @param {string} string - The string to be hashed.
24
+ * @returns {string} The resulting hash as a hexadecimal string.
25
+ */
26
+ export function hashString(string) {
27
+ return bytesToHex(sha256(utf8ToBytes(string))).slice(0, 16);
28
+ }
29
+ /**
30
+ * Calculates a unique ID for the given children objects by hashing their sanitized JSON string representation.
31
+ *
32
+ * @param {any} childrenAsObjects - The children objects to be hashed.
33
+ * @param {string} [context] - The context for the children.
34
+ * @param {string} [id] - The ID for the JSX children object.
35
+ * @param {number} [maxChars] - The maxChars limit for the JSX children object.
36
+ * @param {string} [dataFormat] - The data format of the sources.
37
+ * @param {function} [hashFunction] - Custom hash function.
38
+ * @returns {string} - The unique hash of the children.
39
+ */
40
+ export function hashSource(_a, hashFunction) {
41
+ var source = _a.source, context = _a.context, id = _a.id, maxChars = _a.maxChars, dataFormat = _a.dataFormat;
42
+ if (hashFunction === void 0) { hashFunction = hashString; }
43
+ var sanitizedSource;
44
+ if (dataFormat === 'JSX') {
45
+ sanitizedSource = sanitizeJsxChildren(source);
46
+ }
47
+ else {
48
+ sanitizedSource = source;
49
+ }
50
+ var sanitizedData = __assign(__assign(__assign(__assign({ source: sanitizedSource }, (id && { id: id })), (context && { context: context })), (maxChars != null && { maxChars: Math.abs(maxChars) })), (dataFormat && { dataFormat: dataFormat }));
51
+ var stringifiedData = stringify(sanitizedData);
52
+ return hashFunction(stringifiedData);
53
+ }
54
+ /**
55
+ * Sanitizes a child object by removing the data-_gt attribute and its branches.
56
+ *
57
+ * @param child - The child object to sanitize.
58
+ * @returns The sanitized child object.
59
+ *
60
+ */
61
+ var sanitizeChild = function (child) {
62
+ if (child && typeof child === 'object') {
63
+ var newChild = {};
64
+ if ('c' in child && child.c) {
65
+ newChild.c = sanitizeJsxChildren(child.c);
66
+ }
67
+ if ('d' in child) {
68
+ var generaltranslation = child === null || child === void 0 ? void 0 : child.d;
69
+ if (generaltranslation === null || generaltranslation === void 0 ? void 0 : generaltranslation.b) {
70
+ // The only thing that prevents sanitizeJsx from being stable is
71
+ // the order of the keys in the branches object.
72
+ // We don't sort them because stable-stringify sorts them anyways
73
+ newChild.b = Object.fromEntries(Object.entries(generaltranslation.b).map(function (_a) {
74
+ var key = _a[0], value = _a[1];
75
+ return [
76
+ key,
77
+ sanitizeJsxChildren(value),
78
+ ];
79
+ }));
80
+ }
81
+ if (generaltranslation === null || generaltranslation === void 0 ? void 0 : generaltranslation.t) {
82
+ newChild.t = generaltranslation.t;
83
+ }
84
+ }
85
+ if (isVariable(child)) {
86
+ return __assign({ k: child.k }, (child.v && {
87
+ v: child.v,
88
+ }));
89
+ }
90
+ return newChild;
91
+ }
92
+ return child;
93
+ };
94
+ function sanitizeJsxChildren(childrenAsObjects) {
95
+ return Array.isArray(childrenAsObjects)
96
+ ? childrenAsObjects.map(sanitizeChild)
97
+ : sanitizeChild(childrenAsObjects);
98
+ }
@@ -0,0 +1,4 @@
1
+ import { hashString } from './hashSource';
2
+ export default function hashTemplate(template: {
3
+ [key: string]: string;
4
+ }, hashFunction?: typeof hashString): string;
@@ -0,0 +1,6 @@
1
+ import { hashString } from './hashSource';
2
+ import { stableStringify as stringify } from '../utils/stableStringify';
3
+ export default function hashTemplate(template, hashFunction) {
4
+ if (hashFunction === void 0) { hashFunction = hashString; }
5
+ return hashFunction(stringify(template));
6
+ }
@@ -0,0 +1,7 @@
1
+ import type { DataFormat } from '@generaltranslation/format/types';
2
+ export type HashMetadata = {
3
+ context?: string;
4
+ id?: string;
5
+ maxChars?: number;
6
+ dataFormat?: DataFormat;
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- const require_isVariable = require("./isVariable-B08mggBy.cjs");
1
+ const require_isVariable = require("./isVariable-Ba1gLXdB.cjs");
2
2
  //#region src/id/hashSource.ts
3
3
  /**
4
4
  * Calculates a unique hash for a given string using SHA-256.
@@ -86,4 +86,4 @@ Object.defineProperty(exports, "hashTemplate", {
86
86
  }
87
87
  });
88
88
 
89
- //# sourceMappingURL=id-CyiXsQrY.cjs.map
89
+ //# sourceMappingURL=id-C2orn1MA.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"id-CyiXsQrY.cjs","names":["bytesToHex","sha256","utf8ToBytes","stringify","isVariable","stringify"],"sources":["../src/id/hashSource.ts","../src/id/hashTemplate.ts"],"sourcesContent":["// Functions provided to other GT libraries\n\nimport { JsxChild, JsxChildren, Variable } from '../types';\nimport { stableStringify as stringify } from '../utils/stableStringify';\nimport { sha256 } from '@noble/hashes/sha2.js';\nimport { bytesToHex, utf8ToBytes } from '@noble/hashes/utils.js';\nimport isVariable from '../utils/isVariable';\nimport { HashMetadata } from './types';\n\n// ----- FUNCTIONS ----- //\n/**\n * Calculates a unique hash for a given string using SHA-256.\n *\n * First 16 characters of hash, hex encoded.\n *\n * @param {string} string - The string to be hashed.\n * @returns {string} The resulting hash as a hexadecimal string.\n */\nexport function hashString(string: string): string {\n return bytesToHex(sha256(utf8ToBytes(string))).slice(0, 16);\n}\n\n/**\n * Calculates a unique ID for the given children objects by hashing their sanitized JSON string representation.\n *\n * @param {any} childrenAsObjects - The children objects to be hashed.\n * @param {string} [context] - The context for the children.\n * @param {string} [id] - The ID for the JSX children object.\n * @param {number} [maxChars] - The maxChars limit for the JSX children object.\n * @param {string} [dataFormat] - The data format of the sources.\n * @param {function} [hashFunction] - Custom hash function.\n * @returns {string} - The unique hash of the children.\n */\nexport function hashSource(\n {\n source,\n context,\n id,\n maxChars,\n dataFormat,\n }: {\n source: JsxChildren | string;\n } & HashMetadata,\n hashFunction: (string: string) => string = hashString\n): string {\n let sanitizedSource: SanitizedChildren | string;\n if (dataFormat === 'JSX') {\n sanitizedSource = sanitizeJsxChildren(source);\n } else {\n sanitizedSource = source as string;\n }\n const sanitizedData: {\n source?: SanitizedChildren;\n } & HashMetadata = {\n source: sanitizedSource,\n ...(id && { id }),\n ...(context && { context }),\n ...(maxChars != null && { maxChars: Math.abs(maxChars) }),\n ...(dataFormat && { dataFormat }),\n };\n const stringifiedData = stringify(sanitizedData);\n return hashFunction(stringifiedData);\n}\n\ntype SanitizedVariable = Omit<Variable, 'i'>;\n\ntype SanitizedElement = {\n b?: {\n [k: string]: SanitizedChildren; // Branches\n };\n c?: SanitizedChildren; // Children\n t?: string; // Branch Transformation\n};\ntype SanitizedChild = SanitizedElement | SanitizedVariable | string;\ntype SanitizedChildren = SanitizedChild | SanitizedChild[];\n\n/**\n * Sanitizes a child object by removing the data-_gt attribute and its branches.\n *\n * @param child - The child object to sanitize.\n * @returns The sanitized child object.\n *\n */\nconst sanitizeChild = (child: JsxChild): SanitizedChild => {\n if (child && typeof child === 'object') {\n const newChild: SanitizedChild = {};\n if ('c' in child && child.c) {\n newChild.c = sanitizeJsxChildren(child.c);\n }\n if ('d' in child) {\n const generaltranslation = child?.d;\n if (generaltranslation?.b) {\n // The only thing that prevents sanitizeJsx from being stable is\n // the order of the keys in the branches object.\n // We don't sort them because stable-stringify sorts them anyways\n newChild.b = Object.fromEntries(\n Object.entries(generaltranslation.b).map(([key, value]) => [\n key,\n sanitizeJsxChildren(value as JsxChildren),\n ])\n );\n }\n if (generaltranslation?.t) {\n newChild.t = generaltranslation.t;\n }\n }\n if (isVariable(child)) {\n return {\n k: child.k,\n ...(child.v && {\n v: child.v,\n }),\n };\n }\n return newChild;\n }\n return child;\n};\n\nfunction sanitizeJsxChildren(\n childrenAsObjects: JsxChildren\n): SanitizedChildren {\n return Array.isArray(childrenAsObjects)\n ? childrenAsObjects.map(sanitizeChild)\n : sanitizeChild(childrenAsObjects);\n}\n","import { hashString } from './hashSource';\nimport { stableStringify as stringify } from '../utils/stableStringify';\n\nexport default function hashTemplate(\n template: {\n [key: string]: string;\n },\n hashFunction = hashString\n): string {\n return hashFunction(stringify(template));\n}\n"],"mappings":";;;;;;;;;;AAkBA,SAAgB,WAAW,QAAwB;AACjD,QAAOA,mBAAAA,WAAWC,mBAAAA,OAAOC,mBAAAA,YAAY,OAAO,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG;;;;;;;;;;;;;AAc7D,SAAgB,WACd,EACE,QACA,SACA,IACA,UACA,cAIF,eAA2C,YACnC;CACR,IAAI;AACJ,KAAI,eAAe,MACjB,mBAAkB,oBAAoB,OAAO;KAE7C,mBAAkB;AAYpB,QAAO,aADiBC,mBAAAA,gBAAU;EANhC,QAAQ;EACR,GAAI,MAAM,EAAE,IAAI;EAChB,GAAI,WAAW,EAAE,SAAS;EAC1B,GAAI,YAAY,QAAQ,EAAE,UAAU,KAAK,IAAI,SAAS,EAAE;EACxD,GAAI,cAAc,EAAE,YAAY;EAEa,CACZ,CAAC;;;;;;;;;AAsBtC,MAAM,iBAAiB,UAAoC;AACzD,KAAI,SAAS,OAAO,UAAU,UAAU;EACtC,MAAM,WAA2B,EAAE;AACnC,MAAI,OAAO,SAAS,MAAM,EACxB,UAAS,IAAI,oBAAoB,MAAM,EAAE;AAE3C,MAAI,OAAO,OAAO;GAChB,MAAM,qBAAqB,OAAO;AAClC,OAAI,oBAAoB,EAItB,UAAS,IAAI,OAAO,YAClB,OAAO,QAAQ,mBAAmB,EAAE,CAAC,KAAK,CAAC,KAAK,WAAW,CACzD,KACA,oBAAoB,MAAqB,CAC1C,CAAC,CACH;AAEH,OAAI,oBAAoB,EACtB,UAAS,IAAI,mBAAmB;;AAGpC,MAAIC,mBAAAA,WAAW,MAAM,CACnB,QAAO;GACL,GAAG,MAAM;GACT,GAAI,MAAM,KAAK,EACb,GAAG,MAAM,GACV;GACF;AAEH,SAAO;;AAET,QAAO;;AAGT,SAAS,oBACP,mBACmB;AACnB,QAAO,MAAM,QAAQ,kBAAkB,GACnC,kBAAkB,IAAI,cAAc,GACpC,cAAc,kBAAkB;;;;ACzHtC,SAAwB,aACtB,UAGA,eAAe,YACP;AACR,QAAO,aAAaC,mBAAAA,gBAAU,SAAS,CAAC"}
1
+ {"version":3,"file":"id-C2orn1MA.cjs","names":["bytesToHex","sha256","utf8ToBytes","stringify","isVariable","stringify"],"sources":["../src/id/hashSource.ts","../src/id/hashTemplate.ts"],"sourcesContent":["// Functions provided to other GT libraries\n\nimport { JsxChild, JsxChildren, Variable } from '../types';\nimport { stableStringify as stringify } from '../utils/stableStringify';\nimport { sha256 } from '@noble/hashes/sha2.js';\nimport { bytesToHex, utf8ToBytes } from '@noble/hashes/utils.js';\nimport isVariable from '../utils/isVariable';\nimport { HashMetadata } from './types';\n\n// ----- FUNCTIONS ----- //\n/**\n * Calculates a unique hash for a given string using SHA-256.\n *\n * First 16 characters of hash, hex encoded.\n *\n * @param {string} string - The string to be hashed.\n * @returns {string} The resulting hash as a hexadecimal string.\n */\nexport function hashString(string: string): string {\n return bytesToHex(sha256(utf8ToBytes(string))).slice(0, 16);\n}\n\n/**\n * Calculates a unique ID for the given children objects by hashing their sanitized JSON string representation.\n *\n * @param {any} childrenAsObjects - The children objects to be hashed.\n * @param {string} [context] - The context for the children.\n * @param {string} [id] - The ID for the JSX children object.\n * @param {number} [maxChars] - The maxChars limit for the JSX children object.\n * @param {string} [dataFormat] - The data format of the sources.\n * @param {function} [hashFunction] - Custom hash function.\n * @returns {string} - The unique hash of the children.\n */\nexport function hashSource(\n {\n source,\n context,\n id,\n maxChars,\n dataFormat,\n }: {\n source: JsxChildren | string;\n } & HashMetadata,\n hashFunction: (string: string) => string = hashString\n): string {\n let sanitizedSource: SanitizedChildren | string;\n if (dataFormat === 'JSX') {\n sanitizedSource = sanitizeJsxChildren(source);\n } else {\n sanitizedSource = source as string;\n }\n const sanitizedData: {\n source?: SanitizedChildren;\n } & HashMetadata = {\n source: sanitizedSource,\n ...(id && { id }),\n ...(context && { context }),\n ...(maxChars != null && { maxChars: Math.abs(maxChars) }),\n ...(dataFormat && { dataFormat }),\n };\n const stringifiedData = stringify(sanitizedData);\n return hashFunction(stringifiedData);\n}\n\ntype SanitizedVariable = Omit<Variable, 'i'>;\n\ntype SanitizedElement = {\n b?: {\n [k: string]: SanitizedChildren; // Branches\n };\n c?: SanitizedChildren; // Children\n t?: string; // Branch Transformation\n};\ntype SanitizedChild = SanitizedElement | SanitizedVariable | string;\ntype SanitizedChildren = SanitizedChild | SanitizedChild[];\n\n/**\n * Sanitizes a child object by removing the data-_gt attribute and its branches.\n *\n * @param child - The child object to sanitize.\n * @returns The sanitized child object.\n *\n */\nconst sanitizeChild = (child: JsxChild): SanitizedChild => {\n if (child && typeof child === 'object') {\n const newChild: SanitizedChild = {};\n if ('c' in child && child.c) {\n newChild.c = sanitizeJsxChildren(child.c);\n }\n if ('d' in child) {\n const generaltranslation = child?.d;\n if (generaltranslation?.b) {\n // The only thing that prevents sanitizeJsx from being stable is\n // the order of the keys in the branches object.\n // We don't sort them because stable-stringify sorts them anyways\n newChild.b = Object.fromEntries(\n Object.entries(generaltranslation.b).map(([key, value]) => [\n key,\n sanitizeJsxChildren(value as JsxChildren),\n ])\n );\n }\n if (generaltranslation?.t) {\n newChild.t = generaltranslation.t;\n }\n }\n if (isVariable(child)) {\n return {\n k: child.k,\n ...(child.v && {\n v: child.v,\n }),\n };\n }\n return newChild;\n }\n return child;\n};\n\nfunction sanitizeJsxChildren(\n childrenAsObjects: JsxChildren\n): SanitizedChildren {\n return Array.isArray(childrenAsObjects)\n ? childrenAsObjects.map(sanitizeChild)\n : sanitizeChild(childrenAsObjects);\n}\n","import { hashString } from './hashSource';\nimport { stableStringify as stringify } from '../utils/stableStringify';\n\nexport default function hashTemplate(\n template: {\n [key: string]: string;\n },\n hashFunction = hashString\n): string {\n return hashFunction(stringify(template));\n}\n"],"mappings":";;;;;;;;;;AAkBA,SAAgB,WAAW,QAAwB;AACjD,QAAOA,mBAAAA,WAAWC,mBAAAA,OAAOC,mBAAAA,YAAY,OAAO,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG;;;;;;;;;;;;;AAc7D,SAAgB,WACd,EACE,QACA,SACA,IACA,UACA,cAIF,eAA2C,YACnC;CACR,IAAI;AACJ,KAAI,eAAe,MACjB,mBAAkB,oBAAoB,OAAO;KAE7C,mBAAkB;AAYpB,QAAO,aADiBC,mBAAAA,gBAAU;EANhC,QAAQ;EACR,GAAI,MAAM,EAAE,IAAI;EAChB,GAAI,WAAW,EAAE,SAAS;EAC1B,GAAI,YAAY,QAAQ,EAAE,UAAU,KAAK,IAAI,SAAS,EAAE;EACxD,GAAI,cAAc,EAAE,YAAY;EAEa,CACZ,CAAC;;;;;;;;;AAsBtC,MAAM,iBAAiB,UAAoC;AACzD,KAAI,SAAS,OAAO,UAAU,UAAU;EACtC,MAAM,WAA2B,EAAE;AACnC,MAAI,OAAO,SAAS,MAAM,EACxB,UAAS,IAAI,oBAAoB,MAAM,EAAE;AAE3C,MAAI,OAAO,OAAO;GAChB,MAAM,qBAAqB,OAAO;AAClC,OAAI,oBAAoB,EAItB,UAAS,IAAI,OAAO,YAClB,OAAO,QAAQ,mBAAmB,EAAE,CAAC,KAAK,CAAC,KAAK,WAAW,CACzD,KACA,oBAAoB,MAAqB,CAC1C,CAAC,CACH;AAEH,OAAI,oBAAoB,EACtB,UAAS,IAAI,mBAAmB;;AAGpC,MAAIC,mBAAAA,WAAW,MAAM,CACnB,QAAO;GACL,GAAG,MAAM;GACT,GAAI,MAAM,KAAK,EACb,GAAG,MAAM,GACV;GACF;AAEH,SAAO;;AAET,QAAO;;AAGT,SAAS,oBACP,mBACmB;AACnB,QAAO,MAAM,QAAQ,kBAAkB,GACnC,kBAAkB,IAAI,cAAc,GACpC,cAAc,kBAAkB;;;;ACzHtC,SAAwB,aACtB,UAGA,eAAe,YACP;AACR,QAAO,aAAaC,mBAAAA,gBAAU,SAAS,CAAC"}
@@ -1,4 +1,4 @@
1
- import { n as stableStringify, t as isVariable } from "./isVariable-CYsKFHvR.mjs";
1
+ import { n as stableStringify, t as isVariable } from "./isVariable-fAKEB7gF.mjs";
2
2
  import { sha256 } from "@noble/hashes/sha2.js";
3
3
  import { bytesToHex, utf8ToBytes } from "@noble/hashes/utils.js";
4
4
  //#region src/id/hashSource.ts
@@ -71,4 +71,4 @@ function hashTemplate(template, hashFunction = hashString) {
71
71
  //#endregion
72
72
  export { hashSource as n, hashString as r, hashTemplate as t };
73
73
 
74
- //# sourceMappingURL=id-DbD7K-HL.mjs.map
74
+ //# sourceMappingURL=id-DEaFhGqX.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"id-DbD7K-HL.mjs","names":["stringify","stringify"],"sources":["../src/id/hashSource.ts","../src/id/hashTemplate.ts"],"sourcesContent":["// Functions provided to other GT libraries\n\nimport { JsxChild, JsxChildren, Variable } from '../types';\nimport { stableStringify as stringify } from '../utils/stableStringify';\nimport { sha256 } from '@noble/hashes/sha2.js';\nimport { bytesToHex, utf8ToBytes } from '@noble/hashes/utils.js';\nimport isVariable from '../utils/isVariable';\nimport { HashMetadata } from './types';\n\n// ----- FUNCTIONS ----- //\n/**\n * Calculates a unique hash for a given string using SHA-256.\n *\n * First 16 characters of hash, hex encoded.\n *\n * @param {string} string - The string to be hashed.\n * @returns {string} The resulting hash as a hexadecimal string.\n */\nexport function hashString(string: string): string {\n return bytesToHex(sha256(utf8ToBytes(string))).slice(0, 16);\n}\n\n/**\n * Calculates a unique ID for the given children objects by hashing their sanitized JSON string representation.\n *\n * @param {any} childrenAsObjects - The children objects to be hashed.\n * @param {string} [context] - The context for the children.\n * @param {string} [id] - The ID for the JSX children object.\n * @param {number} [maxChars] - The maxChars limit for the JSX children object.\n * @param {string} [dataFormat] - The data format of the sources.\n * @param {function} [hashFunction] - Custom hash function.\n * @returns {string} - The unique hash of the children.\n */\nexport function hashSource(\n {\n source,\n context,\n id,\n maxChars,\n dataFormat,\n }: {\n source: JsxChildren | string;\n } & HashMetadata,\n hashFunction: (string: string) => string = hashString\n): string {\n let sanitizedSource: SanitizedChildren | string;\n if (dataFormat === 'JSX') {\n sanitizedSource = sanitizeJsxChildren(source);\n } else {\n sanitizedSource = source as string;\n }\n const sanitizedData: {\n source?: SanitizedChildren;\n } & HashMetadata = {\n source: sanitizedSource,\n ...(id && { id }),\n ...(context && { context }),\n ...(maxChars != null && { maxChars: Math.abs(maxChars) }),\n ...(dataFormat && { dataFormat }),\n };\n const stringifiedData = stringify(sanitizedData);\n return hashFunction(stringifiedData);\n}\n\ntype SanitizedVariable = Omit<Variable, 'i'>;\n\ntype SanitizedElement = {\n b?: {\n [k: string]: SanitizedChildren; // Branches\n };\n c?: SanitizedChildren; // Children\n t?: string; // Branch Transformation\n};\ntype SanitizedChild = SanitizedElement | SanitizedVariable | string;\ntype SanitizedChildren = SanitizedChild | SanitizedChild[];\n\n/**\n * Sanitizes a child object by removing the data-_gt attribute and its branches.\n *\n * @param child - The child object to sanitize.\n * @returns The sanitized child object.\n *\n */\nconst sanitizeChild = (child: JsxChild): SanitizedChild => {\n if (child && typeof child === 'object') {\n const newChild: SanitizedChild = {};\n if ('c' in child && child.c) {\n newChild.c = sanitizeJsxChildren(child.c);\n }\n if ('d' in child) {\n const generaltranslation = child?.d;\n if (generaltranslation?.b) {\n // The only thing that prevents sanitizeJsx from being stable is\n // the order of the keys in the branches object.\n // We don't sort them because stable-stringify sorts them anyways\n newChild.b = Object.fromEntries(\n Object.entries(generaltranslation.b).map(([key, value]) => [\n key,\n sanitizeJsxChildren(value as JsxChildren),\n ])\n );\n }\n if (generaltranslation?.t) {\n newChild.t = generaltranslation.t;\n }\n }\n if (isVariable(child)) {\n return {\n k: child.k,\n ...(child.v && {\n v: child.v,\n }),\n };\n }\n return newChild;\n }\n return child;\n};\n\nfunction sanitizeJsxChildren(\n childrenAsObjects: JsxChildren\n): SanitizedChildren {\n return Array.isArray(childrenAsObjects)\n ? childrenAsObjects.map(sanitizeChild)\n : sanitizeChild(childrenAsObjects);\n}\n","import { hashString } from './hashSource';\nimport { stableStringify as stringify } from '../utils/stableStringify';\n\nexport default function hashTemplate(\n template: {\n [key: string]: string;\n },\n hashFunction = hashString\n): string {\n return hashFunction(stringify(template));\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAgB,WAAW,QAAwB;AACjD,QAAO,WAAW,OAAO,YAAY,OAAO,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG;;;;;;;;;;;;;AAc7D,SAAgB,WACd,EACE,QACA,SACA,IACA,UACA,cAIF,eAA2C,YACnC;CACR,IAAI;AACJ,KAAI,eAAe,MACjB,mBAAkB,oBAAoB,OAAO;KAE7C,mBAAkB;AAYpB,QAAO,aADiBA,gBAAU;EANhC,QAAQ;EACR,GAAI,MAAM,EAAE,IAAI;EAChB,GAAI,WAAW,EAAE,SAAS;EAC1B,GAAI,YAAY,QAAQ,EAAE,UAAU,KAAK,IAAI,SAAS,EAAE;EACxD,GAAI,cAAc,EAAE,YAAY;EAEa,CACZ,CAAC;;;;;;;;;AAsBtC,MAAM,iBAAiB,UAAoC;AACzD,KAAI,SAAS,OAAO,UAAU,UAAU;EACtC,MAAM,WAA2B,EAAE;AACnC,MAAI,OAAO,SAAS,MAAM,EACxB,UAAS,IAAI,oBAAoB,MAAM,EAAE;AAE3C,MAAI,OAAO,OAAO;GAChB,MAAM,qBAAqB,OAAO;AAClC,OAAI,oBAAoB,EAItB,UAAS,IAAI,OAAO,YAClB,OAAO,QAAQ,mBAAmB,EAAE,CAAC,KAAK,CAAC,KAAK,WAAW,CACzD,KACA,oBAAoB,MAAqB,CAC1C,CAAC,CACH;AAEH,OAAI,oBAAoB,EACtB,UAAS,IAAI,mBAAmB;;AAGpC,MAAI,WAAW,MAAM,CACnB,QAAO;GACL,GAAG,MAAM;GACT,GAAI,MAAM,KAAK,EACb,GAAG,MAAM,GACV;GACF;AAEH,SAAO;;AAET,QAAO;;AAGT,SAAS,oBACP,mBACmB;AACnB,QAAO,MAAM,QAAQ,kBAAkB,GACnC,kBAAkB,IAAI,cAAc,GACpC,cAAc,kBAAkB;;;;ACzHtC,SAAwB,aACtB,UAGA,eAAe,YACP;AACR,QAAO,aAAaC,gBAAU,SAAS,CAAC"}
1
+ {"version":3,"file":"id-DEaFhGqX.mjs","names":["stringify","stringify"],"sources":["../src/id/hashSource.ts","../src/id/hashTemplate.ts"],"sourcesContent":["// Functions provided to other GT libraries\n\nimport { JsxChild, JsxChildren, Variable } from '../types';\nimport { stableStringify as stringify } from '../utils/stableStringify';\nimport { sha256 } from '@noble/hashes/sha2.js';\nimport { bytesToHex, utf8ToBytes } from '@noble/hashes/utils.js';\nimport isVariable from '../utils/isVariable';\nimport { HashMetadata } from './types';\n\n// ----- FUNCTIONS ----- //\n/**\n * Calculates a unique hash for a given string using SHA-256.\n *\n * First 16 characters of hash, hex encoded.\n *\n * @param {string} string - The string to be hashed.\n * @returns {string} The resulting hash as a hexadecimal string.\n */\nexport function hashString(string: string): string {\n return bytesToHex(sha256(utf8ToBytes(string))).slice(0, 16);\n}\n\n/**\n * Calculates a unique ID for the given children objects by hashing their sanitized JSON string representation.\n *\n * @param {any} childrenAsObjects - The children objects to be hashed.\n * @param {string} [context] - The context for the children.\n * @param {string} [id] - The ID for the JSX children object.\n * @param {number} [maxChars] - The maxChars limit for the JSX children object.\n * @param {string} [dataFormat] - The data format of the sources.\n * @param {function} [hashFunction] - Custom hash function.\n * @returns {string} - The unique hash of the children.\n */\nexport function hashSource(\n {\n source,\n context,\n id,\n maxChars,\n dataFormat,\n }: {\n source: JsxChildren | string;\n } & HashMetadata,\n hashFunction: (string: string) => string = hashString\n): string {\n let sanitizedSource: SanitizedChildren | string;\n if (dataFormat === 'JSX') {\n sanitizedSource = sanitizeJsxChildren(source);\n } else {\n sanitizedSource = source as string;\n }\n const sanitizedData: {\n source?: SanitizedChildren;\n } & HashMetadata = {\n source: sanitizedSource,\n ...(id && { id }),\n ...(context && { context }),\n ...(maxChars != null && { maxChars: Math.abs(maxChars) }),\n ...(dataFormat && { dataFormat }),\n };\n const stringifiedData = stringify(sanitizedData);\n return hashFunction(stringifiedData);\n}\n\ntype SanitizedVariable = Omit<Variable, 'i'>;\n\ntype SanitizedElement = {\n b?: {\n [k: string]: SanitizedChildren; // Branches\n };\n c?: SanitizedChildren; // Children\n t?: string; // Branch Transformation\n};\ntype SanitizedChild = SanitizedElement | SanitizedVariable | string;\ntype SanitizedChildren = SanitizedChild | SanitizedChild[];\n\n/**\n * Sanitizes a child object by removing the data-_gt attribute and its branches.\n *\n * @param child - The child object to sanitize.\n * @returns The sanitized child object.\n *\n */\nconst sanitizeChild = (child: JsxChild): SanitizedChild => {\n if (child && typeof child === 'object') {\n const newChild: SanitizedChild = {};\n if ('c' in child && child.c) {\n newChild.c = sanitizeJsxChildren(child.c);\n }\n if ('d' in child) {\n const generaltranslation = child?.d;\n if (generaltranslation?.b) {\n // The only thing that prevents sanitizeJsx from being stable is\n // the order of the keys in the branches object.\n // We don't sort them because stable-stringify sorts them anyways\n newChild.b = Object.fromEntries(\n Object.entries(generaltranslation.b).map(([key, value]) => [\n key,\n sanitizeJsxChildren(value as JsxChildren),\n ])\n );\n }\n if (generaltranslation?.t) {\n newChild.t = generaltranslation.t;\n }\n }\n if (isVariable(child)) {\n return {\n k: child.k,\n ...(child.v && {\n v: child.v,\n }),\n };\n }\n return newChild;\n }\n return child;\n};\n\nfunction sanitizeJsxChildren(\n childrenAsObjects: JsxChildren\n): SanitizedChildren {\n return Array.isArray(childrenAsObjects)\n ? childrenAsObjects.map(sanitizeChild)\n : sanitizeChild(childrenAsObjects);\n}\n","import { hashString } from './hashSource';\nimport { stableStringify as stringify } from '../utils/stableStringify';\n\nexport default function hashTemplate(\n template: {\n [key: string]: string;\n },\n hashFunction = hashString\n): string {\n return hashFunction(stringify(template));\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAgB,WAAW,QAAwB;AACjD,QAAO,WAAW,OAAO,YAAY,OAAO,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG;;;;;;;;;;;;;AAc7D,SAAgB,WACd,EACE,QACA,SACA,IACA,UACA,cAIF,eAA2C,YACnC;CACR,IAAI;AACJ,KAAI,eAAe,MACjB,mBAAkB,oBAAoB,OAAO;KAE7C,mBAAkB;AAYpB,QAAO,aADiBA,gBAAU;EANhC,QAAQ;EACR,GAAI,MAAM,EAAE,IAAI;EAChB,GAAI,WAAW,EAAE,SAAS;EAC1B,GAAI,YAAY,QAAQ,EAAE,UAAU,KAAK,IAAI,SAAS,EAAE;EACxD,GAAI,cAAc,EAAE,YAAY;EAEa,CACZ,CAAC;;;;;;;;;AAsBtC,MAAM,iBAAiB,UAAoC;AACzD,KAAI,SAAS,OAAO,UAAU,UAAU;EACtC,MAAM,WAA2B,EAAE;AACnC,MAAI,OAAO,SAAS,MAAM,EACxB,UAAS,IAAI,oBAAoB,MAAM,EAAE;AAE3C,MAAI,OAAO,OAAO;GAChB,MAAM,qBAAqB,OAAO;AAClC,OAAI,oBAAoB,EAItB,UAAS,IAAI,OAAO,YAClB,OAAO,QAAQ,mBAAmB,EAAE,CAAC,KAAK,CAAC,KAAK,WAAW,CACzD,KACA,oBAAoB,MAAqB,CAC1C,CAAC,CACH;AAEH,OAAI,oBAAoB,EACtB,UAAS,IAAI,mBAAmB;;AAGpC,MAAI,WAAW,MAAM,CACnB,QAAO;GACL,GAAG,MAAM;GACT,GAAI,MAAM,KAAK,EACb,GAAG,MAAM,GACV;GACF;AAEH,SAAO;;AAET,QAAO;;AAGT,SAAS,oBACP,mBACmB;AACnB,QAAO,MAAM,QAAQ,kBAAkB,GACnC,kBAAkB,IAAI,cAAc,GACpC,cAAc,kBAAkB;;;;ACzHtC,SAAwB,aACtB,UAGA,eAAe,YACP;AACR,QAAO,aAAaC,gBAAU,SAAS,CAAC"}
package/dist/id.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_id = require("./id-CyiXsQrY.cjs");
2
+ const require_id = require("./id-C2orn1MA.cjs");
3
3
  exports.hashSource = require_id.hashSource;
4
4
  exports.hashString = require_id.hashString;
5
5
  exports.hashTemplate = require_id.hashTemplate;
package/dist/id.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Tt as JsxChildren, ut as HashMetadata } from "./types-V5rqd1WR.cjs";
1
+ import { Nt as HashMetadata, g as JsxChildren } from "./types-YrrGRHBP.cjs";
2
2
 
3
3
  //#region src/id/hashSource.d.ts
4
4
  /**
package/dist/id.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Tt as JsxChildren, ut as HashMetadata } from "./types-BsGsgJWF.mjs";
1
+ import { Nt as HashMetadata, g as JsxChildren } from "./types-73XFwmhH.mjs";
2
2
 
3
3
  //#region src/id/hashSource.d.ts
4
4
  /**
package/dist/id.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { hashSource, hashString } from './id/hashSource';
2
+ import hashTemplate from './id/hashTemplate';
3
+ export { hashSource, hashString, hashTemplate };
package/dist/id.js ADDED
@@ -0,0 +1,3 @@
1
+ import { hashSource, hashString } from './id/hashSource';
2
+ import hashTemplate from './id/hashTemplate';
3
+ export { hashSource, hashString, hashTemplate };
package/dist/id.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as hashSource, r as hashString, t as hashTemplate } from "./id-DbD7K-HL.mjs";
1
+ import { n as hashSource, r as hashString, t as hashTemplate } from "./id-DEaFhGqX.mjs";
2
2
  export { hashSource, hashString, hashTemplate };