@intlayer/core 8.12.1 → 8.12.3

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 (370) hide show
  1. package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs.map +1 -1
  2. package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs.map +1 -1
  3. package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs.map +1 -1
  4. package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs.map +1 -1
  5. package/dist/cjs/deepTransformPlugins/getMaskContent.cjs.map +1 -1
  6. package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs.map +1 -1
  7. package/dist/cjs/deepTransformPlugins/getMultilingualDictionary.cjs.map +1 -1
  8. package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs.map +1 -1
  9. package/dist/cjs/deepTransformPlugins/getSplittedContent.cjs.map +1 -1
  10. package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs.map +1 -1
  11. package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs.map +1 -1
  12. package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs.map +1 -1
  13. package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs.map +1 -1
  14. package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs.map +1 -1
  15. package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs.map +1 -1
  16. package/dist/cjs/dictionaryManipulator/getNodeType.cjs.map +1 -1
  17. package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs +1 -0
  18. package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs.map +1 -1
  19. package/dist/cjs/dictionaryManipulator/normalizeDictionary.cjs.map +1 -1
  20. package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs +1 -0
  21. package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs.map +1 -1
  22. package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs.map +1 -1
  23. package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs.map +1 -1
  24. package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs.map +1 -1
  25. package/dist/cjs/formatters/compact.cjs +1 -0
  26. package/dist/cjs/formatters/compact.cjs.map +1 -1
  27. package/dist/cjs/formatters/currency.cjs +1 -0
  28. package/dist/cjs/formatters/currency.cjs.map +1 -1
  29. package/dist/cjs/formatters/date.cjs +1 -0
  30. package/dist/cjs/formatters/date.cjs.map +1 -1
  31. package/dist/cjs/formatters/list.cjs +1 -0
  32. package/dist/cjs/formatters/list.cjs.map +1 -1
  33. package/dist/cjs/formatters/number.cjs +1 -0
  34. package/dist/cjs/formatters/number.cjs.map +1 -1
  35. package/dist/cjs/formatters/percentage.cjs +1 -0
  36. package/dist/cjs/formatters/percentage.cjs.map +1 -1
  37. package/dist/cjs/formatters/relativeTime.cjs +1 -0
  38. package/dist/cjs/formatters/relativeTime.cjs.map +1 -1
  39. package/dist/cjs/formatters/units.cjs +1 -0
  40. package/dist/cjs/formatters/units.cjs.map +1 -1
  41. package/dist/cjs/interpreter/getCondition.cjs.map +1 -1
  42. package/dist/cjs/interpreter/getContent/deepTransform.cjs.map +1 -1
  43. package/dist/cjs/interpreter/getContent/getContent.cjs +1 -0
  44. package/dist/cjs/interpreter/getContent/getContent.cjs.map +1 -1
  45. package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -1
  46. package/dist/cjs/interpreter/getDictionary.cjs.map +1 -1
  47. package/dist/cjs/interpreter/getEnumeration.cjs.map +1 -1
  48. package/dist/cjs/interpreter/getGender.cjs.map +1 -1
  49. package/dist/cjs/interpreter/getHTML.cjs.map +1 -1
  50. package/dist/cjs/interpreter/getInsertion.cjs.map +1 -1
  51. package/dist/cjs/interpreter/getIntlayer.cjs +1 -0
  52. package/dist/cjs/interpreter/getIntlayer.cjs.map +1 -1
  53. package/dist/cjs/interpreter/getNesting.cjs.map +1 -1
  54. package/dist/cjs/interpreter/getPlural.cjs.map +1 -1
  55. package/dist/cjs/interpreter/getTranslation.cjs.map +1 -1
  56. package/dist/cjs/interpreter/splitAndJoinInsertion.cjs.map +1 -1
  57. package/dist/cjs/localization/generateSitemap.cjs +4 -3
  58. package/dist/cjs/localization/generateSitemap.cjs.map +1 -1
  59. package/dist/cjs/localization/getBrowserLocale.cjs +1 -0
  60. package/dist/cjs/localization/getBrowserLocale.cjs.map +1 -1
  61. package/dist/cjs/localization/getHTMLTextDir.cjs.map +1 -1
  62. package/dist/cjs/localization/getLocale.cjs +1 -0
  63. package/dist/cjs/localization/getLocale.cjs.map +1 -1
  64. package/dist/cjs/localization/getLocaleFromPath.cjs.map +1 -1
  65. package/dist/cjs/localization/getLocaleLang.cjs.map +1 -1
  66. package/dist/cjs/localization/getLocaleName.cjs.map +1 -1
  67. package/dist/cjs/localization/getLocalizedUrl.cjs +6 -0
  68. package/dist/cjs/localization/getLocalizedUrl.cjs.map +1 -1
  69. package/dist/cjs/localization/getMultilingualUrls.cjs.map +1 -1
  70. package/dist/cjs/localization/getPathWithoutLocale.cjs +6 -0
  71. package/dist/cjs/localization/getPathWithoutLocale.cjs.map +1 -1
  72. package/dist/cjs/localization/getPrefix.cjs +1 -0
  73. package/dist/cjs/localization/getPrefix.cjs.map +1 -1
  74. package/dist/cjs/localization/localeDetector.cjs.map +1 -1
  75. package/dist/cjs/localization/localeMapper.cjs +1 -0
  76. package/dist/cjs/localization/localeMapper.cjs.map +1 -1
  77. package/dist/cjs/localization/localeResolver.cjs +1 -0
  78. package/dist/cjs/localization/localeResolver.cjs.map +1 -1
  79. package/dist/cjs/localization/rewriteUtils.cjs.map +1 -1
  80. package/dist/cjs/localization/validatePrefix.cjs.map +1 -1
  81. package/dist/cjs/markdown/compiler.cjs.map +1 -1
  82. package/dist/cjs/markdown/constants.cjs.map +1 -1
  83. package/dist/cjs/markdown/parser.cjs.map +1 -1
  84. package/dist/cjs/markdown/renderer.cjs.map +1 -1
  85. package/dist/cjs/markdown/utils.cjs.map +1 -1
  86. package/dist/cjs/messageFormat/ICU.cjs.map +1 -1
  87. package/dist/cjs/messageFormat/i18next.cjs.map +1 -1
  88. package/dist/cjs/messageFormat/po.cjs.map +1 -1
  89. package/dist/cjs/messageFormat/verify-icu-format.cjs.map +1 -1
  90. package/dist/cjs/messageFormat/vue-i18n.cjs.map +1 -1
  91. package/dist/cjs/transpiler/condition/condition.cjs +1 -0
  92. package/dist/cjs/transpiler/condition/condition.cjs.map +1 -1
  93. package/dist/cjs/transpiler/enumeration/enumeration.cjs +1 -0
  94. package/dist/cjs/transpiler/enumeration/enumeration.cjs.map +1 -1
  95. package/dist/cjs/transpiler/file/file.cjs +1 -0
  96. package/dist/cjs/transpiler/file/file.cjs.map +1 -1
  97. package/dist/cjs/transpiler/file/fileBrowser.cjs.map +1 -1
  98. package/dist/cjs/transpiler/gender/gender.cjs +1 -0
  99. package/dist/cjs/transpiler/gender/gender.cjs.map +1 -1
  100. package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs.map +1 -1
  101. package/dist/cjs/transpiler/html/html.cjs +1 -0
  102. package/dist/cjs/transpiler/html/html.cjs.map +1 -1
  103. package/dist/cjs/transpiler/html/htmlTags.cjs.map +1 -1
  104. package/dist/cjs/transpiler/html/validateHTML.cjs.map +1 -1
  105. package/dist/cjs/transpiler/insertion/getInsertionValues.cjs.map +1 -1
  106. package/dist/cjs/transpiler/insertion/insertion.cjs +1 -0
  107. package/dist/cjs/transpiler/insertion/insertion.cjs.map +1 -1
  108. package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs.map +1 -1
  109. package/dist/cjs/transpiler/markdown/markdown.cjs +1 -0
  110. package/dist/cjs/transpiler/markdown/markdown.cjs.map +1 -1
  111. package/dist/cjs/transpiler/markdown/validateMarkdown.cjs.map +1 -1
  112. package/dist/cjs/transpiler/nesting/nesting.cjs +1 -0
  113. package/dist/cjs/transpiler/nesting/nesting.cjs.map +1 -1
  114. package/dist/cjs/transpiler/plural/plural.cjs +1 -0
  115. package/dist/cjs/transpiler/plural/plural.cjs.map +1 -1
  116. package/dist/cjs/transpiler/translation/translation.cjs +1 -0
  117. package/dist/cjs/transpiler/translation/translation.cjs.map +1 -1
  118. package/dist/cjs/utils/checkIsURLAbsolute.cjs.map +1 -1
  119. package/dist/cjs/utils/cookieExpiry.cjs +48 -0
  120. package/dist/cjs/utils/cookieExpiry.cjs.map +1 -0
  121. package/dist/cjs/utils/getCookie.cjs.map +1 -1
  122. package/dist/cjs/utils/intl.cjs +1 -0
  123. package/dist/cjs/utils/intl.cjs.map +1 -1
  124. package/dist/cjs/utils/isSameKeyPath.cjs.map +1 -1
  125. package/dist/cjs/utils/localeStorage.cjs +8 -15
  126. package/dist/cjs/utils/localeStorage.cjs.map +1 -1
  127. package/dist/cjs/utils/parseYaml.cjs.map +1 -1
  128. package/dist/cjs/utils/stringifyYaml.cjs.map +1 -1
  129. package/dist/esm/deepTransformPlugins/getFilterMissingTranslationsContent.mjs.map +1 -1
  130. package/dist/esm/deepTransformPlugins/getFilterTranslationsOnlyContent.mjs.map +1 -1
  131. package/dist/esm/deepTransformPlugins/getFilteredLocalesContent.mjs.map +1 -1
  132. package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs.map +1 -1
  133. package/dist/esm/deepTransformPlugins/getMaskContent.mjs.map +1 -1
  134. package/dist/esm/deepTransformPlugins/getMissingLocalesContent.mjs.map +1 -1
  135. package/dist/esm/deepTransformPlugins/getMultilingualDictionary.mjs.map +1 -1
  136. package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs.map +1 -1
  137. package/dist/esm/deepTransformPlugins/getSplittedContent.mjs.map +1 -1
  138. package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs.map +1 -1
  139. package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs.map +1 -1
  140. package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs.map +1 -1
  141. package/dist/esm/dictionaryManipulator/getDefaultNode.mjs.map +1 -1
  142. package/dist/esm/dictionaryManipulator/getEmptyNode.mjs.map +1 -1
  143. package/dist/esm/dictionaryManipulator/getNodeChildren.mjs.map +1 -1
  144. package/dist/esm/dictionaryManipulator/getNodeType.mjs.map +1 -1
  145. package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs.map +1 -1
  146. package/dist/esm/dictionaryManipulator/normalizeDictionary.mjs.map +1 -1
  147. package/dist/esm/dictionaryManipulator/orderDictionaries.mjs.map +1 -1
  148. package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs.map +1 -1
  149. package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs.map +1 -1
  150. package/dist/esm/dictionaryManipulator/updateNodeChildren.mjs.map +1 -1
  151. package/dist/esm/formatters/compact.mjs.map +1 -1
  152. package/dist/esm/formatters/currency.mjs.map +1 -1
  153. package/dist/esm/formatters/date.mjs.map +1 -1
  154. package/dist/esm/formatters/list.mjs.map +1 -1
  155. package/dist/esm/formatters/number.mjs.map +1 -1
  156. package/dist/esm/formatters/percentage.mjs.map +1 -1
  157. package/dist/esm/formatters/relativeTime.mjs.map +1 -1
  158. package/dist/esm/formatters/units.mjs.map +1 -1
  159. package/dist/esm/interpreter/getCondition.mjs.map +1 -1
  160. package/dist/esm/interpreter/getContent/deepTransform.mjs.map +1 -1
  161. package/dist/esm/interpreter/getContent/getContent.mjs.map +1 -1
  162. package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -1
  163. package/dist/esm/interpreter/getDictionary.mjs.map +1 -1
  164. package/dist/esm/interpreter/getEnumeration.mjs.map +1 -1
  165. package/dist/esm/interpreter/getGender.mjs.map +1 -1
  166. package/dist/esm/interpreter/getHTML.mjs.map +1 -1
  167. package/dist/esm/interpreter/getInsertion.mjs.map +1 -1
  168. package/dist/esm/interpreter/getIntlayer.mjs.map +1 -1
  169. package/dist/esm/interpreter/getNesting.mjs.map +1 -1
  170. package/dist/esm/interpreter/getPlural.mjs.map +1 -1
  171. package/dist/esm/interpreter/getTranslation.mjs.map +1 -1
  172. package/dist/esm/interpreter/splitAndJoinInsertion.mjs.map +1 -1
  173. package/dist/esm/localization/generateSitemap.mjs +4 -3
  174. package/dist/esm/localization/generateSitemap.mjs.map +1 -1
  175. package/dist/esm/localization/getBrowserLocale.mjs.map +1 -1
  176. package/dist/esm/localization/getHTMLTextDir.mjs.map +1 -1
  177. package/dist/esm/localization/getLocale.mjs.map +1 -1
  178. package/dist/esm/localization/getLocaleFromPath.mjs.map +1 -1
  179. package/dist/esm/localization/getLocaleLang.mjs.map +1 -1
  180. package/dist/esm/localization/getLocaleName.mjs.map +1 -1
  181. package/dist/esm/localization/getLocalizedUrl.mjs +5 -0
  182. package/dist/esm/localization/getLocalizedUrl.mjs.map +1 -1
  183. package/dist/esm/localization/getMultilingualUrls.mjs.map +1 -1
  184. package/dist/esm/localization/getPathWithoutLocale.mjs +5 -0
  185. package/dist/esm/localization/getPathWithoutLocale.mjs.map +1 -1
  186. package/dist/esm/localization/getPrefix.mjs.map +1 -1
  187. package/dist/esm/localization/localeDetector.mjs.map +1 -1
  188. package/dist/esm/localization/localeMapper.mjs.map +1 -1
  189. package/dist/esm/localization/localeResolver.mjs.map +1 -1
  190. package/dist/esm/localization/rewriteUtils.mjs.map +1 -1
  191. package/dist/esm/localization/validatePrefix.mjs.map +1 -1
  192. package/dist/esm/markdown/compiler.mjs.map +1 -1
  193. package/dist/esm/markdown/constants.mjs.map +1 -1
  194. package/dist/esm/markdown/parser.mjs.map +1 -1
  195. package/dist/esm/markdown/renderer.mjs.map +1 -1
  196. package/dist/esm/markdown/utils.mjs.map +1 -1
  197. package/dist/esm/messageFormat/ICU.mjs.map +1 -1
  198. package/dist/esm/messageFormat/i18next.mjs.map +1 -1
  199. package/dist/esm/messageFormat/po.mjs.map +1 -1
  200. package/dist/esm/messageFormat/verify-icu-format.mjs.map +1 -1
  201. package/dist/esm/messageFormat/vue-i18n.mjs.map +1 -1
  202. package/dist/esm/transpiler/condition/condition.mjs.map +1 -1
  203. package/dist/esm/transpiler/enumeration/enumeration.mjs.map +1 -1
  204. package/dist/esm/transpiler/file/file.mjs.map +1 -1
  205. package/dist/esm/transpiler/file/fileBrowser.mjs.map +1 -1
  206. package/dist/esm/transpiler/gender/gender.mjs.map +1 -1
  207. package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs.map +1 -1
  208. package/dist/esm/transpiler/html/html.mjs.map +1 -1
  209. package/dist/esm/transpiler/html/htmlTags.mjs.map +1 -1
  210. package/dist/esm/transpiler/html/validateHTML.mjs.map +1 -1
  211. package/dist/esm/transpiler/insertion/getInsertionValues.mjs.map +1 -1
  212. package/dist/esm/transpiler/insertion/insertion.mjs.map +1 -1
  213. package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs.map +1 -1
  214. package/dist/esm/transpiler/markdown/markdown.mjs.map +1 -1
  215. package/dist/esm/transpiler/markdown/validateMarkdown.mjs.map +1 -1
  216. package/dist/esm/transpiler/nesting/nesting.mjs.map +1 -1
  217. package/dist/esm/transpiler/plural/plural.mjs.map +1 -1
  218. package/dist/esm/transpiler/translation/translation.mjs.map +1 -1
  219. package/dist/esm/utils/checkIsURLAbsolute.mjs.map +1 -1
  220. package/dist/esm/utils/cookieExpiry.mjs +45 -0
  221. package/dist/esm/utils/cookieExpiry.mjs.map +1 -0
  222. package/dist/esm/utils/getCookie.mjs.map +1 -1
  223. package/dist/esm/utils/intl.mjs.map +1 -1
  224. package/dist/esm/utils/isSameKeyPath.mjs.map +1 -1
  225. package/dist/esm/utils/localeStorage.mjs +4 -12
  226. package/dist/esm/utils/localeStorage.mjs.map +1 -1
  227. package/dist/esm/utils/parseYaml.mjs.map +1 -1
  228. package/dist/esm/utils/stringifyYaml.mjs.map +1 -1
  229. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +12 -11
  230. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts.map +1 -1
  231. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +12 -11
  232. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts.map +1 -1
  233. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +10 -9
  234. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts.map +1 -1
  235. package/dist/types/deepTransformPlugins/getMaskContent.d.ts.map +1 -1
  236. package/dist/types/deepTransformPlugins/getMultilingualDictionary.d.ts.map +1 -1
  237. package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts.map +1 -1
  238. package/dist/types/deepTransformPlugins/getSplittedContent.d.ts.map +1 -1
  239. package/dist/types/dictionaryManipulator/getEmptyNode.d.ts.map +1 -1
  240. package/dist/types/dictionaryManipulator/getNodeChildren.d.ts.map +1 -1
  241. package/dist/types/dictionaryManipulator/getNodeType.d.ts.map +1 -1
  242. package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts.map +1 -1
  243. package/dist/types/dictionaryManipulator/orderDictionaries.d.ts.map +1 -1
  244. package/dist/types/formatters/compact.d.ts.map +1 -1
  245. package/dist/types/formatters/currency.d.ts.map +1 -1
  246. package/dist/types/formatters/date.d.ts.map +1 -1
  247. package/dist/types/formatters/list.d.ts.map +1 -1
  248. package/dist/types/formatters/relativeTime.d.ts.map +1 -1
  249. package/dist/types/formatters/units.d.ts.map +1 -1
  250. package/dist/types/index.d.ts +1 -1
  251. package/dist/types/interpreter/getContent/deepTransform.d.ts.map +1 -1
  252. package/dist/types/interpreter/getContent/getContent.d.ts.map +1 -1
  253. package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
  254. package/dist/types/interpreter/getEnumeration.d.ts.map +1 -1
  255. package/dist/types/interpreter/getGender.d.ts.map +1 -1
  256. package/dist/types/interpreter/getHTML.d.ts.map +1 -1
  257. package/dist/types/interpreter/getInsertion.d.ts.map +1 -1
  258. package/dist/types/interpreter/getPlural.d.ts +1 -1
  259. package/dist/types/interpreter/getTranslation.d.ts.map +1 -1
  260. package/dist/types/localization/generateSitemap.d.ts.map +1 -1
  261. package/dist/types/localization/getBrowserLocale.d.ts.map +1 -1
  262. package/dist/types/localization/getHTMLTextDir.d.ts.map +1 -1
  263. package/dist/types/localization/getLocaleFromPath.d.ts.map +1 -1
  264. package/dist/types/localization/getLocaleLang.d.ts +2 -2
  265. package/dist/types/localization/getLocaleLang.d.ts.map +1 -1
  266. package/dist/types/localization/getLocaleName.d.ts.map +1 -1
  267. package/dist/types/localization/getLocalizedUrl.d.ts +7 -2
  268. package/dist/types/localization/getLocalizedUrl.d.ts.map +1 -1
  269. package/dist/types/localization/getMultilingualUrls.d.ts.map +1 -1
  270. package/dist/types/localization/getPathWithoutLocale.d.ts +7 -2
  271. package/dist/types/localization/getPathWithoutLocale.d.ts.map +1 -1
  272. package/dist/types/localization/getPrefix.d.ts +31 -13
  273. package/dist/types/localization/getPrefix.d.ts.map +1 -1
  274. package/dist/types/localization/localeDetector.d.ts.map +1 -1
  275. package/dist/types/localization/localeMapper.d.ts.map +1 -1
  276. package/dist/types/localization/rewriteUtils.d.ts.map +1 -1
  277. package/dist/types/localization/validatePrefix.d.ts.map +1 -1
  278. package/dist/types/markdown/compiler.d.ts.map +1 -1
  279. package/dist/types/markdown/constants.d.ts.map +1 -1
  280. package/dist/types/markdown/index.d.ts +1 -1
  281. package/dist/types/markdown/types.d.ts.map +1 -1
  282. package/dist/types/markdown/utils.d.ts.map +1 -1
  283. package/dist/types/messageFormat/ICU.d.ts.map +1 -1
  284. package/dist/types/messageFormat/i18next.d.ts.map +1 -1
  285. package/dist/types/messageFormat/po.d.ts.map +1 -1
  286. package/dist/types/messageFormat/vue-i18n.d.ts.map +1 -1
  287. package/dist/types/transpiler/condition/condition.d.ts.map +1 -1
  288. package/dist/types/transpiler/enumeration/enumeration.d.ts.map +1 -1
  289. package/dist/types/transpiler/file/file.d.ts.map +1 -1
  290. package/dist/types/transpiler/file/fileBrowser.d.ts.map +1 -1
  291. package/dist/types/transpiler/gender/gender.d.ts.map +1 -1
  292. package/dist/types/transpiler/html/getHTMLCustomComponents.d.ts.map +1 -1
  293. package/dist/types/transpiler/html/html.d.ts.map +1 -1
  294. package/dist/types/transpiler/html/htmlTags.d.ts.map +1 -1
  295. package/dist/types/transpiler/html/validateHTML.d.ts.map +1 -1
  296. package/dist/types/transpiler/index.d.ts +1 -1
  297. package/dist/types/transpiler/insertion/getInsertionValues.d.ts.map +1 -1
  298. package/dist/types/transpiler/insertion/insertion.d.ts.map +1 -1
  299. package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts.map +1 -1
  300. package/dist/types/transpiler/markdown/index.d.ts +1 -1
  301. package/dist/types/transpiler/markdown/markdown.d.ts.map +1 -1
  302. package/dist/types/transpiler/markdown/validateMarkdown.d.ts.map +1 -1
  303. package/dist/types/transpiler/nesting/nesting.d.ts.map +1 -1
  304. package/dist/types/transpiler/plural/plural.d.ts.map +1 -1
  305. package/dist/types/utils/checkIsURLAbsolute.d.ts.map +1 -1
  306. package/dist/types/utils/cookieExpiry.d.ts +31 -0
  307. package/dist/types/utils/cookieExpiry.d.ts.map +1 -0
  308. package/dist/types/utils/getCookie.d.ts.map +1 -1
  309. package/dist/types/utils/intl.d.ts.map +1 -1
  310. package/dist/types/utils/isSameKeyPath.d.ts.map +1 -1
  311. package/dist/types/utils/isValidReactElement.d.ts.map +1 -1
  312. package/dist/types/utils/localeStorage.d.ts +6 -1
  313. package/dist/types/utils/localeStorage.d.ts.map +1 -1
  314. package/dist/types/utils/parseYaml.d.ts.map +1 -1
  315. package/dist/types/utils/stringifyYaml.d.ts.map +1 -1
  316. package/package.json +8 -8
  317. package/dist/types/@intlayer/core/dist/types/formatters/compact.d.ts +0 -1
  318. package/dist/types/@intlayer/core/dist/types/formatters/currency.d.ts +0 -1
  319. package/dist/types/@intlayer/core/dist/types/formatters/date.d.ts +0 -1
  320. package/dist/types/@intlayer/core/dist/types/formatters/index.d.ts +0 -1
  321. package/dist/types/@intlayer/core/dist/types/formatters/list.d.ts +0 -1
  322. package/dist/types/@intlayer/core/dist/types/formatters/number.d.ts +0 -1
  323. package/dist/types/@intlayer/core/dist/types/formatters/percentage.d.ts +0 -1
  324. package/dist/types/@intlayer/core/dist/types/formatters/relativeTime.d.ts +0 -1
  325. package/dist/types/@intlayer/core/dist/types/formatters/units.d.ts +0 -1
  326. package/dist/types/@intlayer/core/dist/types/interpreter/getCondition.d.ts +0 -1
  327. package/dist/types/@intlayer/core/dist/types/interpreter/getContent/deepTransform.d.ts +0 -1
  328. package/dist/types/@intlayer/core/dist/types/interpreter/getContent/getContent.d.ts +0 -2
  329. package/dist/types/@intlayer/core/dist/types/interpreter/getContent/plugins.d.ts +0 -4
  330. package/dist/types/@intlayer/core/dist/types/interpreter/getDictionary.d.ts +0 -2
  331. package/dist/types/@intlayer/core/dist/types/interpreter/getEnumeration.d.ts +0 -1
  332. package/dist/types/@intlayer/core/dist/types/interpreter/getIntlayer.d.ts +0 -1
  333. package/dist/types/@intlayer/core/dist/types/interpreter/getNesting.d.ts +0 -2
  334. package/dist/types/@intlayer/core/dist/types/interpreter/getPlural.d.ts +0 -1
  335. package/dist/types/@intlayer/core/dist/types/interpreter/getTranslation.d.ts +0 -1
  336. package/dist/types/@intlayer/core/dist/types/interpreter/index.d.ts +0 -1
  337. package/dist/types/@intlayer/core/dist/types/localization/generateSitemap.d.ts +0 -2
  338. package/dist/types/@intlayer/core/dist/types/localization/getBrowserLocale.d.ts +0 -1
  339. package/dist/types/@intlayer/core/dist/types/localization/getHTMLTextDir.d.ts +0 -1
  340. package/dist/types/@intlayer/core/dist/types/localization/getLocale.d.ts +0 -1
  341. package/dist/types/@intlayer/core/dist/types/localization/getLocaleFromPath.d.ts +0 -1
  342. package/dist/types/@intlayer/core/dist/types/localization/getLocaleLang.d.ts +0 -1
  343. package/dist/types/@intlayer/core/dist/types/localization/getLocaleName.d.ts +0 -1
  344. package/dist/types/@intlayer/core/dist/types/localization/getLocalizedUrl.d.ts +0 -1
  345. package/dist/types/@intlayer/core/dist/types/localization/getMultilingualUrls.d.ts +0 -1
  346. package/dist/types/@intlayer/core/dist/types/localization/getPathWithoutLocale.d.ts +0 -1
  347. package/dist/types/@intlayer/core/dist/types/localization/getPrefix.d.ts +0 -3
  348. package/dist/types/@intlayer/core/dist/types/localization/index.d.ts +0 -1
  349. package/dist/types/@intlayer/core/dist/types/localization/localeDetector.d.ts +0 -1
  350. package/dist/types/@intlayer/core/dist/types/localization/localeMapper.d.ts +0 -2
  351. package/dist/types/@intlayer/core/dist/types/localization/localeResolver.d.ts +0 -2
  352. package/dist/types/@intlayer/core/dist/types/localization/rewriteUtils.d.ts +0 -3
  353. package/dist/types/@intlayer/core/dist/types/localization/validatePrefix.d.ts +0 -1
  354. package/dist/types/@intlayer/core/dist/types/markdown/index.d.ts +0 -1
  355. package/dist/types/@intlayer/core/dist/types/transpiler/condition/condition.d.ts +0 -1
  356. package/dist/types/@intlayer/core/dist/types/transpiler/enumeration/enumeration.d.ts +0 -1
  357. package/dist/types/@intlayer/core/dist/types/transpiler/file/file.d.ts +0 -1
  358. package/dist/types/@intlayer/core/dist/types/transpiler/gender/gender.d.ts +0 -1
  359. package/dist/types/@intlayer/core/dist/types/transpiler/html/html.d.ts +0 -1
  360. package/dist/types/@intlayer/core/dist/types/transpiler/index.d.ts +0 -1
  361. package/dist/types/@intlayer/core/dist/types/transpiler/insertion/insertion.d.ts +0 -1
  362. package/dist/types/@intlayer/core/dist/types/transpiler/markdown/markdown.d.ts +0 -1
  363. package/dist/types/@intlayer/core/dist/types/transpiler/nesting/nesting.d.ts +0 -2
  364. package/dist/types/@intlayer/core/dist/types/transpiler/plural/plural.d.ts +0 -1
  365. package/dist/types/@intlayer/core/dist/types/transpiler/translation/translation.d.ts +0 -2
  366. package/dist/types/@intlayer/core/dist/types/utils/index.d.ts +0 -1
  367. package/dist/types/@intlayer/core/dist/types/utils/intl.d.ts +0 -1
  368. package/dist/types/@intlayer/core/dist/types/utils/isSameKeyPath.d.ts +0 -1
  369. package/dist/types/@intlayer/core/dist/types/utils/localeStorage.d.ts +0 -2
  370. package/dist/types/intlayer/dist/types/index.d.ts +0 -4
@@ -1 +1 @@
1
- {"version":3,"file":"intl.mjs","names":[],"sources":["../../../src/utils/intl.ts"],"sourcesContent":["/**\n * Cached Intl helper – drop‑in replacement for the global `Intl` object.\n * ‑‑‑\n * • Uses a `Proxy` to lazily wrap every *constructor* hanging off `Intl` (NumberFormat, DateTimeFormat, …).\n * • Each wrapped constructor keeps an in‑memory cache keyed by `[locales, options]` so that identical requests\n * reuse the same heavy instance instead of reparsing CLDR data every time.\n * • A polyfill warning for `Intl.DisplayNames` is emitted only once and only in dev.\n * • The public API is fully type‑safe and mirrors the native `Intl` surface exactly –\n * you can treat `CachedIntl` just like the built‑in `Intl`.\n *\n * Usage @example:\n * ---------------\n * ```ts\n * import { CachedIntl } from \"./cached-intl\";\n *\n * const nf = CachedIntl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\" });\n * console.log(nf.format(1234));\n *\n * const dn = CachedIntl.DisplayNames([\"fr\"], { type: \"language\" });\n * console.log(dn.of(\"en\")); * → \"anglais\"\n *\n * You can also spin up an isolated instance with its own caches (handy in test suites):\n * const TestIntl = createCachedIntl();\n * ```\n */\n\nimport { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\nconst MAX_CACHE_SIZE = 50;\nconst cache = new Map<any, Map<string, any>>();\n\ntype IntlConstructors = {\n [K in keyof typeof Intl as (typeof Intl)[K] extends new (\n ...args: any\n ) => any\n ? K\n : never]: (typeof Intl)[K];\n};\n\ntype ReplaceLocaleWithLocalesValues<T> = T extends new (\n locales: any,\n options?: infer Options\n) => infer Instance\n ? {\n new (locales?: LocalesValues, options?: Options): Instance;\n new (options?: Options & { locale?: LocalesValues }): Instance;\n (locales?: LocalesValues, options?: Options): Instance;\n (options?: Options & { locale?: LocalesValues }): Instance;\n }\n : T extends new (\n locales: any\n ) => infer Instance\n ? {\n new (locales?: LocalesValues): Instance;\n new (options?: { locale?: LocalesValues }): Instance;\n (locales?: LocalesValues): Instance;\n (options?: { locale?: LocalesValues }): Instance;\n }\n : T;\n\nexport type WrappedIntl = {\n [K in keyof typeof Intl]: K extends keyof IntlConstructors\n ? ReplaceLocaleWithLocalesValues<(typeof Intl)[K]>\n : (typeof Intl)[K];\n};\n\n/**\n * Generic caching instantiator for Intl constructors.\n */\nexport const getCachedIntl = <T extends new (...args: any[]) => any>(\n Ctor: T,\n locale?: LocalesValues | string,\n options?: any\n): InstanceType<T> => {\n const resLoc = locale ?? internationalization?.defaultLocale;\n\n const optKey = options ? JSON.stringify(options) : '';\n const key = `${resLoc}|${optKey}`;\n\n let ctorCache = cache.get(Ctor);\n\n if (!ctorCache) {\n ctorCache = new Map();\n cache.set(Ctor, ctorCache);\n }\n\n let instance = ctorCache.get(key);\n\n if (!instance) {\n if (ctorCache.size > MAX_CACHE_SIZE) ctorCache.clear();\n instance = new Ctor(resLoc, options);\n ctorCache.set(key, instance);\n }\n return instance;\n};\n\n/**\n * Optional: Keep bindIntl if your library exports it publicly.\n * It now uses the much smaller getCachedIntl under the hood.\n */\nexport const bindIntl = (boundLocale: LocalesValues): WrappedIntl => {\n const bindWrap = (Ctor: any) =>\n // function is used as a constructor, do not change in arrow function\n function intlConstructor(locales?: any, options?: any) {\n const isOptsFirst =\n locales !== null &&\n typeof locales === 'object' &&\n !Array.isArray(locales);\n const resOpts = isOptsFirst ? locales : options;\n const resLoc = isOptsFirst\n ? (resOpts as any).locale || boundLocale\n : locales || boundLocale;\n\n return getCachedIntl(Ctor, resLoc, resOpts);\n };\n\n return {\n ...Intl,\n Collator: bindWrap(Intl.Collator),\n DateTimeFormat: bindWrap(Intl.DateTimeFormat),\n DisplayNames: bindWrap(Intl.DisplayNames),\n ListFormat: bindWrap(Intl.ListFormat),\n NumberFormat: bindWrap(Intl.NumberFormat),\n PluralRules: bindWrap(Intl.PluralRules),\n RelativeTimeFormat: bindWrap(Intl.RelativeTimeFormat),\n Locale: bindWrap(Intl.Locale),\n Segmenter: bindWrap((Intl as any).Segmenter),\n } as unknown as WrappedIntl;\n};\n\n// Add this to the bottom of utils/intl.ts ONLY if required for public API compatibility.\nexport const CachedIntl = {\n // function is used as a constructor, do not change in arrow function\n Collator: function Collator(locales?: any, options?: any) {\n return getCachedIntl(Intl.Collator, locales, options);\n },\n DateTimeFormat: function DateTimeFormat(locales?: any, options?: any) {\n return getCachedIntl(Intl.DateTimeFormat, locales, options);\n },\n DisplayNames: function DisplayNames(locales?: any, options?: any) {\n return getCachedIntl(Intl.DisplayNames, locales, options);\n },\n ListFormat: function ListFormat(locales?: any, options?: any) {\n return getCachedIntl(Intl.ListFormat as any, locales, options);\n },\n NumberFormat: function NumberFormat(locales?: any, options?: any) {\n return getCachedIntl(Intl.NumberFormat, locales, options);\n },\n PluralRules: function PluralRules(locales?: any, options?: any) {\n return getCachedIntl(Intl.PluralRules, locales, options);\n },\n RelativeTimeFormat: function RelativeTimeFormat(\n locales?: any,\n options?: any\n ) {\n return getCachedIntl(Intl.RelativeTimeFormat, locales, options);\n },\n Segmenter: function Segmenter(locales?: any, options?: any) {\n return getCachedIntl((Intl as any).Segmenter, locales, options);\n },\n} as any; // Cast to 'any' internally to avoid TS readonly errors\n\nexport { CachedIntl as Intl };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,iBAAiB;AACvB,MAAM,wBAAQ,IAAI,IAA2B;;;;AAwC7C,MAAa,iBACX,MACA,QACA,YACoB;CACpB,MAAM,SAAS,UAAU,sBAAsB;CAG/C,MAAM,MAAM,GAAG,OAAO,GADP,UAAU,KAAK,UAAU,OAAO,IAAI;CAGnD,IAAI,YAAY,MAAM,IAAI,IAAI;CAE9B,IAAI,CAAC,WAAW;EACd,4BAAY,IAAI,IAAI;EACpB,MAAM,IAAI,MAAM,SAAS;CAC3B;CAEA,IAAI,WAAW,UAAU,IAAI,GAAG;CAEhC,IAAI,CAAC,UAAU;EACb,IAAI,UAAU,OAAO,gBAAgB,UAAU,MA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,SACA,SACA;EACA,OAAO,cAAc,KAAK,oBAAoB,SAAS,OAAO;CAChE;CACA,WAAW,SAAS,UAAU,SAAe,SAAe;EAC1D,OAAO,cAAe,KAAa,WAAW,SAAS,OAAO;CAChE;AACF"}
1
+ {"version":3,"file":"intl.mjs","names":[],"sources":["../../../src/utils/intl.ts"],"sourcesContent":["/**\n * Cached Intl helper – drop‑in replacement for the global `Intl` object.\n * ‑‑‑\n * • Uses a `Proxy` to lazily wrap every *constructor* hanging off `Intl` (NumberFormat, DateTimeFormat, …).\n * • Each wrapped constructor keeps an in‑memory cache keyed by `[locales, options]` so that identical requests\n * reuse the same heavy instance instead of reparsing CLDR data every time.\n * • A polyfill warning for `Intl.DisplayNames` is emitted only once and only in dev.\n * • The public API is fully type‑safe and mirrors the native `Intl` surface exactly –\n * you can treat `CachedIntl` just like the built‑in `Intl`.\n *\n * Usage @example:\n * ---------------\n * ```ts\n * import { CachedIntl } from \"./cached-intl\";\n *\n * const nf = CachedIntl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\" });\n * console.log(nf.format(1234));\n *\n * const dn = CachedIntl.DisplayNames([\"fr\"], { type: \"language\" });\n * console.log(dn.of(\"en\")); * → \"anglais\"\n *\n * You can also spin up an isolated instance with its own caches (handy in test suites):\n * const TestIntl = createCachedIntl();\n * ```\n */\n\nimport { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\nconst MAX_CACHE_SIZE = 50;\nconst cache = new Map<any, Map<string, any>>();\n\ntype IntlConstructors = {\n [K in keyof typeof Intl as (typeof Intl)[K] extends new (\n ...args: any\n ) => any\n ? K\n : never]: (typeof Intl)[K];\n};\n\ntype ReplaceLocaleWithLocalesValues<T> = T extends new (\n locales: any,\n options?: infer Options\n) => infer Instance\n ? {\n new (locales?: LocalesValues, options?: Options): Instance;\n new (options?: Options & { locale?: LocalesValues }): Instance;\n (locales?: LocalesValues, options?: Options): Instance;\n (options?: Options & { locale?: LocalesValues }): Instance;\n }\n : T extends new (\n locales: any\n ) => infer Instance\n ? {\n new (locales?: LocalesValues): Instance;\n new (options?: { locale?: LocalesValues }): Instance;\n (locales?: LocalesValues): Instance;\n (options?: { locale?: LocalesValues }): Instance;\n }\n : T;\n\nexport type WrappedIntl = {\n [K in keyof typeof Intl]: K extends keyof IntlConstructors\n ? ReplaceLocaleWithLocalesValues<(typeof Intl)[K]>\n : (typeof Intl)[K];\n};\n\n/**\n * Generic caching instantiator for Intl constructors.\n */\nexport const getCachedIntl = <T extends new (...args: any[]) => any>(\n Ctor: T,\n locale?: LocalesValues | string,\n options?: any\n): InstanceType<T> => {\n const resLoc = locale ?? internationalization?.defaultLocale;\n\n const optKey = options ? JSON.stringify(options) : '';\n const key = `${resLoc}|${optKey}`;\n\n let ctorCache = cache.get(Ctor);\n\n if (!ctorCache) {\n ctorCache = new Map();\n cache.set(Ctor, ctorCache);\n }\n\n let instance = ctorCache.get(key);\n\n if (!instance) {\n if (ctorCache.size > MAX_CACHE_SIZE) ctorCache.clear();\n instance = new Ctor(resLoc, options);\n ctorCache.set(key, instance);\n }\n return instance;\n};\n\n/**\n * Optional: Keep bindIntl if your library exports it publicly.\n * It now uses the much smaller getCachedIntl under the hood.\n */\nexport const bindIntl = (boundLocale: LocalesValues): WrappedIntl => {\n const bindWrap = (Ctor: any) =>\n // function is used as a constructor, do not change in arrow function\n function intlConstructor(locales?: any, options?: any) {\n const isOptsFirst =\n locales !== null &&\n typeof locales === 'object' &&\n !Array.isArray(locales);\n const resOpts = isOptsFirst ? locales : options;\n const resLoc = isOptsFirst\n ? (resOpts as any).locale || boundLocale\n : locales || boundLocale;\n\n return getCachedIntl(Ctor, resLoc, resOpts);\n };\n\n return {\n ...Intl,\n Collator: bindWrap(Intl.Collator),\n DateTimeFormat: bindWrap(Intl.DateTimeFormat),\n DisplayNames: bindWrap(Intl.DisplayNames),\n ListFormat: bindWrap(Intl.ListFormat),\n NumberFormat: bindWrap(Intl.NumberFormat),\n PluralRules: bindWrap(Intl.PluralRules),\n RelativeTimeFormat: bindWrap(Intl.RelativeTimeFormat),\n Locale: bindWrap(Intl.Locale),\n Segmenter: bindWrap((Intl as any).Segmenter),\n } as unknown as WrappedIntl;\n};\n\n// Add this to the bottom of utils/intl.ts ONLY if required for public API compatibility.\nexport const CachedIntl = {\n // function is used as a constructor, do not change in arrow function\n Collator: function Collator(locales?: any, options?: any) {\n return getCachedIntl(Intl.Collator, locales, options);\n },\n DateTimeFormat: function DateTimeFormat(locales?: any, options?: any) {\n return getCachedIntl(Intl.DateTimeFormat, locales, options);\n },\n DisplayNames: function DisplayNames(locales?: any, options?: any) {\n return getCachedIntl(Intl.DisplayNames, locales, options);\n },\n ListFormat: function ListFormat(locales?: any, options?: any) {\n return getCachedIntl(Intl.ListFormat as any, locales, options);\n },\n NumberFormat: function NumberFormat(locales?: any, options?: any) {\n return getCachedIntl(Intl.NumberFormat, locales, options);\n },\n PluralRules: function PluralRules(locales?: any, options?: any) {\n return getCachedIntl(Intl.PluralRules, locales, options);\n },\n RelativeTimeFormat: function RelativeTimeFormat(\n locales?: any,\n options?: any\n ) {\n return getCachedIntl(Intl.RelativeTimeFormat, locales, options);\n },\n Segmenter: function Segmenter(locales?: any, options?: any) {\n return getCachedIntl((Intl as any).Segmenter, locales, options);\n },\n} as any; // Cast to 'any' internally to avoid TS readonly errors\n\nexport { CachedIntl as Intl };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,iBAAiB;AACvB,MAAM,wBAAQ,IAAI,KAA4B;;;;AAwC9C,MAAa,iBACX,MACA,QACA,YACoB;CACpB,MAAM,SAAS,UAAU,sBAAsB;CAG/C,MAAM,MAAM,GAAG,OAAO,GADP,UAAU,KAAK,UAAU,QAAQ,GAAG;CAGnD,IAAI,YAAY,MAAM,IAAI,KAAK;AAE/B,KAAI,CAAC,WAAW;AACd,8BAAY,IAAI,KAAK;AACrB,QAAM,IAAI,MAAM,UAAU;;CAG5B,IAAI,WAAW,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KAAK,aAAa,SAAS,QAAQ;;CAE1D,oBAAoB,SAAS,mBAC3B,SACA,SACA;AACA,SAAO,cAAc,KAAK,oBAAoB,SAAS,QAAQ;;CAEjE,WAAW,SAAS,UAAU,SAAe,SAAe;AAC1D,SAAO,cAAe,KAAa,WAAW,SAAS,QAAQ;;CAElE"}
@@ -1 +1 @@
1
- {"version":3,"file":"isSameKeyPath.mjs","names":[],"sources":["../../../src/utils/isSameKeyPath.ts"],"sourcesContent":["import type { KeyPath } from '@intlayer/types/keyPath';\n\ntype KeyPathWithKey = KeyPath & { key: string };\n\nexport const isSameKeyPath = (keyPath1: KeyPath[], keyPath2: KeyPath[]) =>\n keyPath1.every(\n (element, index) =>\n keyPath2[index] &&\n (keyPath2[index] as KeyPathWithKey).key ===\n (element as KeyPathWithKey).key &&\n keyPath2[index].type === element.type\n );\n"],"mappings":";AAIA,MAAa,iBAAiB,UAAqB,aACjD,SAAS,OACN,SAAS,UACR,SAAS,UACR,SAAS,OAA0B,QACjC,QAA2B,OAC9B,SAAS,OAAO,SAAS,QAAQ,IACrC"}
1
+ {"version":3,"file":"isSameKeyPath.mjs","names":[],"sources":["../../../src/utils/isSameKeyPath.ts"],"sourcesContent":["import type { KeyPath } from '@intlayer/types/keyPath';\n\ntype KeyPathWithKey = KeyPath & { key: string };\n\nexport const isSameKeyPath = (keyPath1: KeyPath[], keyPath2: KeyPath[]) =>\n keyPath1.every(\n (element, index) =>\n keyPath2[index] &&\n (keyPath2[index] as KeyPathWithKey).key ===\n (element as KeyPathWithKey).key &&\n keyPath2[index].type === element.type\n );\n"],"mappings":";AAIA,MAAa,iBAAiB,UAAqB,aACjD,SAAS,OACN,SAAS,UACR,SAAS,UACR,SAAS,OAA0B,QACjC,QAA2B,OAC9B,SAAS,OAAO,SAAS,QAAQ,KACpC"}
@@ -1,3 +1,4 @@
1
+ import { buildCookieString, resolveExpiresToTimestamp } from "./cookieExpiry.mjs";
1
2
  import { getCookie } from "./getCookie.mjs";
2
3
  import { internationalization, routing } from "@intlayer/config/built";
3
4
 
@@ -18,15 +19,6 @@ const TREE_SHAKE_STORAGE_SESSION_STORAGE = process.env["INTLAYER_ROUTING_STORAGE
18
19
  * True when header storage is explicitly disabled at build time.
19
20
  */
20
21
  const TREE_SHAKE_STORAGE_HEADERS = process.env["INTLAYER_ROUTING_STORAGE_HEADERS"] === "false";
21
- const buildCookieString = (name, value, attributes) => {
22
- const parts = [`${name}=${encodeURIComponent(value)}`];
23
- if (attributes.path) parts.push(`Path=${attributes.path}`);
24
- if (attributes.domain) parts.push(`Domain=${attributes.domain}`);
25
- if (attributes.expires instanceof Date) parts.push(`Expires=${attributes.expires.toUTCString()}`);
26
- if (attributes.secure) parts.push("Secure");
27
- if (attributes.sameSite) parts.push(`SameSite=${attributes.sameSite}`);
28
- return parts.join("; ");
29
- };
30
22
  const localeStorageOptions = {
31
23
  getCookie: (name) => document.cookie.split(";").find((c) => c.trim().startsWith(`${name}=`))?.split("=")[1],
32
24
  getLocaleStorage: (name) => localStorage.getItem(name),
@@ -80,7 +72,7 @@ const setLocaleInStorageClient = (locale, options) => {
80
72
  try {
81
73
  if (options?.setCookieStore) options.setCookieStore(name, locale, {
82
74
  ...attributes,
83
- expires: attributes.expires instanceof Date ? attributes.expires.getTime() : attributes.expires
75
+ expires: resolveExpiresToTimestamp(attributes.expires)
84
76
  });
85
77
  } catch {
86
78
  try {
@@ -152,7 +144,7 @@ const setLocaleInStorageServer = (locale, options) => {
152
144
  try {
153
145
  if (options?.setCookieStore) options.setCookieStore(name, locale, {
154
146
  ...attributes,
155
- expires: attributes.expires instanceof Date ? attributes.expires.getTime() : attributes.expires
147
+ expires: resolveExpiresToTimestamp(attributes.expires)
156
148
  });
157
149
  } catch {
158
150
  try {
@@ -234,7 +226,7 @@ const setLocaleInStorage = (locale, options) => {
234
226
  try {
235
227
  if (options?.setCookieStore) options.setCookieStore(name, locale, {
236
228
  ...attributes,
237
- expires: attributes.expires instanceof Date ? attributes.expires.getTime() : attributes.expires
229
+ expires: resolveExpiresToTimestamp(attributes.expires)
238
230
  });
239
231
  } catch {
240
232
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"localeStorage.mjs","names":[],"sources":["../../../src/utils/localeStorage.ts"],"sourcesContent":["import { internationalization, routing } from '@intlayer/config/built';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport type { CookiesAttributes } from '@intlayer/types/config';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCookie } from './getCookie';\n\n// ── Tree-shake constants ──────────────────────────────────────────────────────\n// When these env vars are injected at build time, bundlers eliminate the\n// branches guarded by these constants.\n\n/**\n * True when cookie storage is explicitly disabled at build time.\n */\nconst TREE_SHAKE_STORAGE_COOKIES =\n process.env['INTLAYER_ROUTING_STORAGE_COOKIES'] === 'false';\n\n/**\n * True when localStorage is explicitly disabled at build time.\n */\nconst TREE_SHAKE_STORAGE_LOCAL_STORAGE =\n process.env['INTLAYER_ROUTING_STORAGE_LOCALSTORAGE'] === 'false';\n\n/**\n * True when sessionStorage is explicitly disabled at build time.\n */\nconst TREE_SHAKE_STORAGE_SESSION_STORAGE =\n process.env['INTLAYER_ROUTING_STORAGE_SESSIONSTORAGE'] === 'false';\n\n/**\n * True when header storage is explicitly disabled at build time.\n */\nconst TREE_SHAKE_STORAGE_HEADERS =\n process.env['INTLAYER_ROUTING_STORAGE_HEADERS'] === 'false';\n\n// ============================================================================\n// Shared types\n// ============================================================================\n\nexport type CookieBuildAttributes = {\n domain?: string;\n path?: string;\n secure?: boolean;\n httpOnly?: boolean;\n sameSite?: 'strict' | 'lax' | 'none';\n /** Expiry as milliseconds since epoch (Date.getTime()) or number of days */\n expires?: number | undefined;\n};\n\n// ============================================================================\n// Shared helpers\n// ============================================================================\n\nconst buildCookieString = (\n name: string,\n value: string,\n attributes: Omit<CookiesAttributes, 'name' | 'type'>\n): string => {\n const encodedValue = encodeURIComponent(value);\n const parts: string[] = [`${name}=${encodedValue}`];\n\n if (attributes.path) parts.push(`Path=${attributes.path}`);\n if (attributes.domain) parts.push(`Domain=${attributes.domain}`);\n if (attributes.expires instanceof Date)\n parts.push(`Expires=${attributes.expires.toUTCString()}`);\n if (attributes.secure) parts.push('Secure');\n if (attributes.sameSite) parts.push(`SameSite=${attributes.sameSite}`);\n return parts.join('; ');\n};\n\n// ============================================================================\n// Client-specific types and functions\n// (cookies via browser APIs, localStorage, sessionStorage — no headers)\n// ============================================================================\n\nexport type LocaleStorageClientOptions = {\n overwrite?: boolean;\n isCookieEnabled?: boolean;\n setCookieStore?: (\n name: string,\n value: string,\n cookie: CookieBuildAttributes\n ) => void;\n setCookieString?: (name: string, cookie: string) => void;\n getCookie?: (name: string) => string | undefined | null;\n setSessionStorage?: (name: string, value: string) => void;\n getSessionStorage?: (name: string) => string | undefined | null;\n setLocaleStorage?: (name: string, value: string) => void;\n getLocaleStorage?: (name: string) => string | undefined | null;\n};\n\n// cookieStore is part of the experimental Cookie Store API\ndeclare const cookieStore: any;\n\nexport const localeStorageOptions: LocaleStorageClientOptions = {\n getCookie: (name: string) =>\n document.cookie\n .split(';')\n .find((c) => c.trim().startsWith(`${name}=`))\n ?.split('=')[1],\n getLocaleStorage: (name: string) => localStorage.getItem(name),\n getSessionStorage: (name: string) => sessionStorage.getItem(name),\n isCookieEnabled: true,\n setCookieStore: (name, value, attributes) =>\n cookieStore.set({\n name,\n value,\n path: attributes.path,\n domain: attributes.domain,\n expires: attributes.expires,\n sameSite: attributes.sameSite,\n }),\n setCookieString: (_name, cookie) => {\n // biome-ignore lint/suspicious/noDocumentCookie: set cookie fallback\n document.cookie = cookie;\n },\n setSessionStorage: (name, value) => sessionStorage.setItem(name, value),\n setLocaleStorage: (name, value) => localStorage.setItem(name, value),\n};\n\n/**\n * Retrieves the locale from browser storage mechanisms\n * (cookies, localStorage, sessionStorage).\n * Does not read from headers — use `getLocaleFromStorageServer` for that.\n */\nexport const getLocaleFromStorageClient = (\n options: LocaleStorageClientOptions = localeStorageOptions\n): Locale | undefined => {\n const { locales } = internationalization;\n\n if (options?.isCookieEnabled === false) return undefined;\n\n const isValidLocale = (value: string | null | undefined): value is Locale =>\n !!value && locales.includes(value as Locale);\n\n if (!TREE_SHAKE_STORAGE_COOKIES) {\n for (let i = 0; i < (routing.storage.cookies ?? []).length; i++) {\n try {\n const value = options?.getCookie?.(routing.storage.cookies![i].name);\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_LOCAL_STORAGE) {\n for (let i = 0; i < (routing.storage.localStorage ?? []).length; i++) {\n try {\n const value = options?.getLocaleStorage?.(\n routing.storage.localStorage![i].name\n );\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_SESSION_STORAGE && routing.storage.sessionStorage) {\n for (let i = 0; i < routing.storage.sessionStorage.length; i++) {\n try {\n const value = options?.getSessionStorage?.(\n routing.storage.sessionStorage[i].name\n );\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n};\n\n/**\n * Stores the locale in browser storage mechanisms\n * (cookies, localStorage, sessionStorage).\n * Does not write to headers — use `setLocaleInStorageServer` for that.\n */\nexport const setLocaleInStorageClient = (\n locale: LocalesValues,\n options?: LocaleStorageClientOptions\n): void => {\n if (options?.isCookieEnabled === false) return;\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n const { name, attributes } = routing.storage.cookies[i];\n try {\n if (options?.setCookieStore) {\n options.setCookieStore(name, locale, {\n ...attributes,\n expires:\n attributes.expires instanceof Date\n ? attributes.expires.getTime()\n : attributes.expires,\n });\n }\n } catch {\n try {\n if (options?.setCookieString) {\n options.setCookieString(\n name,\n buildCookieString(name, locale, attributes)\n );\n }\n } catch {}\n }\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_LOCAL_STORAGE &&\n routing.storage.localStorage &&\n options?.setLocaleStorage\n ) {\n for (let i = 0; i < routing.storage.localStorage.length; i++) {\n const { name } = routing.storage.localStorage[i];\n try {\n if (!(options?.overwrite ?? true) && options?.getLocaleStorage) {\n if (options.getLocaleStorage(name)) continue;\n }\n options.setLocaleStorage(name, locale);\n } catch {}\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_SESSION_STORAGE &&\n routing.storage.sessionStorage &&\n options?.setSessionStorage\n ) {\n for (let i = 0; i < routing.storage.sessionStorage.length; i++) {\n const { name } = routing.storage.sessionStorage[i];\n try {\n if (!(options?.overwrite ?? true) && options?.getSessionStorage) {\n if (options.getSessionStorage(name)) continue;\n }\n options.setSessionStorage(name, locale);\n } catch {}\n }\n }\n};\n\n/**\n * Client-side locale storage utility.\n * Handles cookies (browser), localStorage and sessionStorage.\n * Does not access headers.\n *\n * @example\n * ```ts\n * const storage = LocaleStorageClient(localeStorageOptions);\n * const locale = storage.getLocale();\n * storage.setLocale('fr');\n * ```\n */\nexport const LocaleStorageClient = (options: LocaleStorageClientOptions) => ({\n getLocale: () => getLocaleFromStorageClient(options),\n setLocale: (locale: LocalesValues) =>\n setLocaleInStorageClient(locale, options),\n});\n\n// ============================================================================\n// Server-specific types and functions\n// (cookies via injected getter/setter, headers — no localStorage/sessionStorage)\n// ============================================================================\n\nexport type LocaleStorageServerOptions = {\n overwrite?: boolean;\n isCookieEnabled?: boolean;\n setCookieStore?: (\n name: string,\n value: string,\n cookie: CookieBuildAttributes\n ) => void;\n setCookieString?: (name: string, cookie: string) => void;\n getCookie?: (name: string) => string | undefined | null;\n getHeader?: (name: string) => string | undefined | null;\n setHeader?: (name: string, value: string) => void;\n};\n\n/**\n * Retrieves the locale from server-side storage mechanisms (cookies, headers).\n * Does not access localStorage or sessionStorage.\n * No browser cookie fallback — the caller must provide `getCookie`.\n */\nexport const getLocaleFromStorageServer = (\n options: LocaleStorageServerOptions\n): Locale | undefined => {\n const { locales } = internationalization;\n\n if (options?.isCookieEnabled === false) return undefined;\n\n const isValidLocale = (value: string | null | undefined): value is Locale =>\n !!value && locales.includes(value as Locale);\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n try {\n const value = options?.getCookie?.(routing.storage.cookies[i].name);\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_HEADERS && routing.storage.headers) {\n for (let i = 0; i < routing.storage.headers.length; i++) {\n try {\n const value = options?.getHeader?.(routing.storage.headers[i].name);\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n};\n\n/**\n * Stores the locale in server-side storage mechanisms (cookies, headers).\n * Does not write to localStorage or sessionStorage.\n */\nexport const setLocaleInStorageServer = (\n locale: LocalesValues,\n options?: LocaleStorageServerOptions\n): void => {\n if (options?.isCookieEnabled === false) return;\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n const { name, attributes } = routing.storage.cookies[i];\n\n try {\n if (options?.setCookieStore) {\n options.setCookieStore(name, locale, {\n ...attributes,\n expires:\n attributes.expires instanceof Date\n ? attributes.expires.getTime()\n : attributes.expires,\n });\n }\n } catch {\n try {\n if (options?.setCookieString) {\n options.setCookieString(\n name,\n buildCookieString(name, locale, attributes)\n );\n }\n } catch {}\n }\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_HEADERS &&\n routing.storage.headers &&\n options?.setHeader\n ) {\n for (let i = 0; i < routing.storage.headers.length; i++) {\n try {\n options.setHeader(routing.storage.headers[i].name, locale);\n } catch {}\n }\n }\n};\n\n/**\n * Server-side locale storage utility.\n * Handles cookies (via injected getter/setter) and headers.\n * Does not access localStorage or sessionStorage.\n *\n * @example\n * ```ts\n * const storage = LocaleStorageServer({\n * getCookie: (name) => req.cookies[name],\n * setCookieStore: (name, value, attrs) => res.cookie(name, value, attrs),\n * getHeader: (name) => req.headers[name],\n * setHeader: (name, value) => res.setHeader(name, value),\n * });\n * const locale = storage.getLocale();\n * storage.setLocale('fr');\n * ```\n */\nexport const LocaleStorageServer = (options: LocaleStorageServerOptions) => ({\n getLocale: () => getLocaleFromStorageServer(options),\n setLocale: (locale: LocalesValues) =>\n setLocaleInStorageServer(locale, options),\n});\n\n// ============================================================================\n// Deprecated: combined LocaleStorage\n// Use LocaleStorageClient or LocaleStorageServer instead\n// ============================================================================\n\n/**\n * @deprecated Use {@link LocaleStorageClientOptions} or {@link LocaleStorageServerOptions} instead.\n */\nexport type LocaleStorageOptions = LocaleStorageClientOptions &\n LocaleStorageServerOptions;\n\n/**\n * Retrieves the locale from all storage mechanisms\n * (cookies, localStorage, sessionStorage, headers).\n *\n * @deprecated Use {@link getLocaleFromStorageClient} (browser) or\n * {@link getLocaleFromStorageServer} (server) instead.\n */\nexport const getLocaleFromStorage = (\n options: Pick<\n LocaleStorageOptions,\n | 'getCookie'\n | 'getSessionStorage'\n | 'getLocaleStorage'\n | 'getHeader'\n | 'isCookieEnabled'\n >\n): Locale | undefined => {\n const { locales } = internationalization;\n\n if (options?.isCookieEnabled === false) return undefined;\n\n const isValidLocale = (value: string | null | undefined): value is Locale =>\n !!value && locales.includes(value as Locale);\n\n const readCookie = (name: string): string | undefined => {\n try {\n const fromOption = options?.getCookie?.(name);\n if (fromOption !== null && fromOption !== undefined) return fromOption;\n } catch {}\n // Browser fallback kept for backward compatibility\n return getCookie(name);\n };\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n const value = readCookie(routing.storage.cookies[i].name);\n if (isValidLocale(value)) return value;\n }\n }\n\n if (!TREE_SHAKE_STORAGE_LOCAL_STORAGE && routing.storage.localStorage) {\n for (let i = 0; i < routing.storage.localStorage.length; i++) {\n try {\n const value = options?.getLocaleStorage?.(\n routing.storage.localStorage[i].name\n );\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_SESSION_STORAGE && routing.storage.sessionStorage) {\n for (let i = 0; i < routing.storage.sessionStorage.length; i++) {\n try {\n const value = options?.getSessionStorage?.(\n routing.storage.sessionStorage[i].name\n );\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_HEADERS && routing.storage.headers) {\n for (let i = 0; i < routing.storage.headers.length; i++) {\n try {\n const value = options?.getHeader?.(routing.storage.headers[i].name);\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n};\n\n/**\n * Stores the locale in all configured storage mechanisms\n * (cookies, localStorage, sessionStorage, headers).\n *\n * @deprecated Use {@link setLocaleInStorageClient} (browser) or\n * {@link setLocaleInStorageServer} (server) instead.\n */\nexport const setLocaleInStorage = (\n locale: LocalesValues,\n options?: LocaleStorageOptions\n): void => {\n if (options?.isCookieEnabled === false) return;\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n const { name, attributes } = routing.storage.cookies[i];\n try {\n if (options?.setCookieStore) {\n options.setCookieStore(name, locale, {\n ...attributes,\n expires:\n attributes.expires instanceof Date\n ? attributes.expires.getTime()\n : attributes.expires,\n });\n }\n } catch {\n try {\n if (options?.setCookieString) {\n options.setCookieString(\n name,\n buildCookieString(name, locale, attributes)\n );\n }\n } catch {}\n }\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_LOCAL_STORAGE &&\n routing.storage.localStorage &&\n options?.setLocaleStorage\n ) {\n for (let i = 0; i < routing.storage.localStorage.length; i++) {\n const { name } = routing.storage.localStorage[i];\n try {\n if (!(options?.overwrite ?? true) && options?.getLocaleStorage) {\n if (options.getLocaleStorage(name)) continue;\n }\n options.setLocaleStorage(name, locale);\n } catch {}\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_SESSION_STORAGE &&\n routing.storage.sessionStorage &&\n options?.setSessionStorage\n ) {\n for (let i = 0; i < routing.storage.sessionStorage.length; i++) {\n const { name } = routing.storage.sessionStorage[i];\n try {\n if (!(options?.overwrite ?? true) && options?.getSessionStorage) {\n if (options.getSessionStorage(name)) continue;\n }\n options.setSessionStorage(name, locale);\n } catch {}\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_HEADERS &&\n routing.storage.headers &&\n options?.setHeader\n ) {\n for (let i = 0; i < routing.storage.headers.length; i++) {\n try {\n options.setHeader(routing.storage.headers[i].name, locale);\n } catch {}\n }\n }\n};\n\n/**\n * Utility object to get and set the locale in storage based on configuration.\n *\n * @deprecated Use {@link LocaleStorageClient} (browser) or\n * {@link LocaleStorageServer} (server) instead.\n */\nexport const LocaleStorage = (options: LocaleStorageOptions) => ({\n getLocale: () => getLocaleFromStorage(options),\n setLocale: (locale: LocalesValues) => setLocaleInStorage(locale, options),\n});\n"],"mappings":";;;;;;;AAaA,MAAM,6BACJ,QAAQ,IAAI,wCAAwC;;;;AAKtD,MAAM,mCACJ,QAAQ,IAAI,6CAA6C;;;;AAK3D,MAAM,qCACJ,QAAQ,IAAI,+CAA+C;;;;AAK7D,MAAM,6BACJ,QAAQ,IAAI,wCAAwC;AAoBtD,MAAM,qBACJ,MACA,OACA,eACW;CAEX,MAAM,QAAkB,CAAC,GAAG,KAAK,GADZ,mBAAmB,KACO,GAAG;CAElD,IAAI,WAAW,MAAM,MAAM,KAAK,QAAQ,WAAW,MAAM;CACzD,IAAI,WAAW,QAAQ,MAAM,KAAK,UAAU,WAAW,QAAQ;CAC/D,IAAI,WAAW,mBAAmB,MAChC,MAAM,KAAK,WAAW,WAAW,QAAQ,YAAY,GAAG;CAC1D,IAAI,WAAW,QAAQ,MAAM,KAAK,QAAQ;CAC1C,IAAI,WAAW,UAAU,MAAM,KAAK,YAAY,WAAW,UAAU;CACrE,OAAO,MAAM,KAAK,IAAI;AACxB;AA0BA,MAAa,uBAAmD;CAC9D,YAAY,SACV,SAAS,OACN,MAAM,GAAG,EACT,MAAM,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,KAAK,EAAE,CAAC,GAC1C,MAAM,GAAG,EAAE;CACjB,mBAAmB,SAAiB,aAAa,QAAQ,IAAI;CAC7D,oBAAo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AQ,QAAQ,eAAe,QAAQ,KAAK;EAC9D,MAAM,EAAE,SAAS,QAAQ,QAAQ,eAAe;EAChD,IAAI;GACF,IAAI,EAAE,SAAS,aAAa,SAAS,SAAS,mBAC5C;QAAI,QAAQ,kBAAkB,IAAI,GAAG;GAAQ;GAE/C,QAAQ,kBAAkB,MAAM,MAAM;EACxC,QAAQ,CAAC;CACX;CAGF,IACE,CAAC,8BACD,QAAQ,QAAQ,WAChB,SAAS,WAET,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,QAAQ,QAAQ,KAClD,IAAI;EACF,QAAQ,UAAU,QAAQ,QAAQ,QAAQ,GAAG,MAAM,MAAM;CAC3D,QAAQ,CAAC;AAGf;;;;;;;AAQA,MAAa,iBAAiB,aAAmC;CAC/D,iBAAiB,qBAAqB,OAAO;CAC7C,YAAY,WAA0B,mBAAmB,QAAQ,OAAO;AAC1E"}
1
+ {"version":3,"file":"localeStorage.mjs","names":[],"sources":["../../../src/utils/localeStorage.ts"],"sourcesContent":["import { internationalization, routing } from '@intlayer/config/built';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { buildCookieString, resolveExpiresToTimestamp } from './cookieExpiry';\nimport { getCookie } from './getCookie';\n\n// ── Tree-shake constants ──────────────────────────────────────────────────────\n// When these env vars are injected at build time, bundlers eliminate the\n// branches guarded by these constants.\n\n/**\n * True when cookie storage is explicitly disabled at build time.\n */\nconst TREE_SHAKE_STORAGE_COOKIES =\n process.env['INTLAYER_ROUTING_STORAGE_COOKIES'] === 'false';\n\n/**\n * True when localStorage is explicitly disabled at build time.\n */\nconst TREE_SHAKE_STORAGE_LOCAL_STORAGE =\n process.env['INTLAYER_ROUTING_STORAGE_LOCALSTORAGE'] === 'false';\n\n/**\n * True when sessionStorage is explicitly disabled at build time.\n */\nconst TREE_SHAKE_STORAGE_SESSION_STORAGE =\n process.env['INTLAYER_ROUTING_STORAGE_SESSIONSTORAGE'] === 'false';\n\n/**\n * True when header storage is explicitly disabled at build time.\n */\nconst TREE_SHAKE_STORAGE_HEADERS =\n process.env['INTLAYER_ROUTING_STORAGE_HEADERS'] === 'false';\n\n// ============================================================================\n// Shared types\n// ============================================================================\n\nexport type CookieBuildAttributes = {\n domain?: string;\n path?: string;\n secure?: boolean;\n httpOnly?: boolean;\n sameSite?: 'strict' | 'lax' | 'none';\n /**\n * Absolute expiry as milliseconds since epoch, ready for `cookieStore.set()`.\n * Already resolved from the normalized `expires` by\n * `resolveExpiresToTimestamp`.\n */\n expires?: number | undefined;\n};\n\n// ============================================================================\n// Client-specific types and functions\n// (cookies via browser APIs, localStorage, sessionStorage — no headers)\n// ============================================================================\n\nexport type LocaleStorageClientOptions = {\n overwrite?: boolean;\n isCookieEnabled?: boolean;\n setCookieStore?: (\n name: string,\n value: string,\n cookie: CookieBuildAttributes\n ) => void;\n setCookieString?: (name: string, cookie: string) => void;\n getCookie?: (name: string) => string | undefined | null;\n setSessionStorage?: (name: string, value: string) => void;\n getSessionStorage?: (name: string) => string | undefined | null;\n setLocaleStorage?: (name: string, value: string) => void;\n getLocaleStorage?: (name: string) => string | undefined | null;\n};\n\n// cookieStore is part of the experimental Cookie Store API\ndeclare const cookieStore: any;\n\nexport const localeStorageOptions: LocaleStorageClientOptions = {\n getCookie: (name: string) =>\n document.cookie\n .split(';')\n .find((c) => c.trim().startsWith(`${name}=`))\n ?.split('=')[1],\n getLocaleStorage: (name: string) => localStorage.getItem(name),\n getSessionStorage: (name: string) => sessionStorage.getItem(name),\n isCookieEnabled: true,\n setCookieStore: (name, value, attributes) =>\n cookieStore.set({\n name,\n value,\n path: attributes.path,\n domain: attributes.domain,\n expires: attributes.expires,\n sameSite: attributes.sameSite,\n }),\n setCookieString: (_name, cookie) => {\n // biome-ignore lint/suspicious/noDocumentCookie: set cookie fallback\n document.cookie = cookie;\n },\n setSessionStorage: (name, value) => sessionStorage.setItem(name, value),\n setLocaleStorage: (name, value) => localStorage.setItem(name, value),\n};\n\n/**\n * Retrieves the locale from browser storage mechanisms\n * (cookies, localStorage, sessionStorage).\n * Does not read from headers — use `getLocaleFromStorageServer` for that.\n */\nexport const getLocaleFromStorageClient = (\n options: LocaleStorageClientOptions = localeStorageOptions\n): Locale | undefined => {\n const { locales } = internationalization;\n\n if (options?.isCookieEnabled === false) return undefined;\n\n const isValidLocale = (value: string | null | undefined): value is Locale =>\n !!value && locales.includes(value as Locale);\n\n if (!TREE_SHAKE_STORAGE_COOKIES) {\n for (let i = 0; i < (routing.storage.cookies ?? []).length; i++) {\n try {\n const value = options?.getCookie?.(routing.storage.cookies![i].name);\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_LOCAL_STORAGE) {\n for (let i = 0; i < (routing.storage.localStorage ?? []).length; i++) {\n try {\n const value = options?.getLocaleStorage?.(\n routing.storage.localStorage![i].name\n );\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_SESSION_STORAGE && routing.storage.sessionStorage) {\n for (let i = 0; i < routing.storage.sessionStorage.length; i++) {\n try {\n const value = options?.getSessionStorage?.(\n routing.storage.sessionStorage[i].name\n );\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n};\n\n/**\n * Stores the locale in browser storage mechanisms\n * (cookies, localStorage, sessionStorage).\n * Does not write to headers — use `setLocaleInStorageServer` for that.\n */\nexport const setLocaleInStorageClient = (\n locale: LocalesValues,\n options?: LocaleStorageClientOptions\n): void => {\n if (options?.isCookieEnabled === false) return;\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n const { name, attributes } = routing.storage.cookies[i];\n try {\n if (options?.setCookieStore) {\n options.setCookieStore(name, locale, {\n ...attributes,\n expires: resolveExpiresToTimestamp(attributes.expires),\n });\n }\n } catch {\n try {\n if (options?.setCookieString) {\n options.setCookieString(\n name,\n buildCookieString(name, locale, attributes)\n );\n }\n } catch {}\n }\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_LOCAL_STORAGE &&\n routing.storage.localStorage &&\n options?.setLocaleStorage\n ) {\n for (let i = 0; i < routing.storage.localStorage.length; i++) {\n const { name } = routing.storage.localStorage[i];\n try {\n if (!(options?.overwrite ?? true) && options?.getLocaleStorage) {\n if (options.getLocaleStorage(name)) continue;\n }\n options.setLocaleStorage(name, locale);\n } catch {}\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_SESSION_STORAGE &&\n routing.storage.sessionStorage &&\n options?.setSessionStorage\n ) {\n for (let i = 0; i < routing.storage.sessionStorage.length; i++) {\n const { name } = routing.storage.sessionStorage[i];\n try {\n if (!(options?.overwrite ?? true) && options?.getSessionStorage) {\n if (options.getSessionStorage(name)) continue;\n }\n options.setSessionStorage(name, locale);\n } catch {}\n }\n }\n};\n\n/**\n * Client-side locale storage utility.\n * Handles cookies (browser), localStorage and sessionStorage.\n * Does not access headers.\n *\n * @example\n * ```ts\n * const storage = LocaleStorageClient(localeStorageOptions);\n * const locale = storage.getLocale();\n * storage.setLocale('fr');\n * ```\n */\nexport const LocaleStorageClient = (options: LocaleStorageClientOptions) => ({\n getLocale: () => getLocaleFromStorageClient(options),\n setLocale: (locale: LocalesValues) =>\n setLocaleInStorageClient(locale, options),\n});\n\n// ============================================================================\n// Server-specific types and functions\n// (cookies via injected getter/setter, headers — no localStorage/sessionStorage)\n// ============================================================================\n\nexport type LocaleStorageServerOptions = {\n overwrite?: boolean;\n isCookieEnabled?: boolean;\n setCookieStore?: (\n name: string,\n value: string,\n cookie: CookieBuildAttributes\n ) => void;\n setCookieString?: (name: string, cookie: string) => void;\n getCookie?: (name: string) => string | undefined | null;\n getHeader?: (name: string) => string | undefined | null;\n setHeader?: (name: string, value: string) => void;\n};\n\n/**\n * Retrieves the locale from server-side storage mechanisms (cookies, headers).\n * Does not access localStorage or sessionStorage.\n * No browser cookie fallback — the caller must provide `getCookie`.\n */\nexport const getLocaleFromStorageServer = (\n options: LocaleStorageServerOptions\n): Locale | undefined => {\n const { locales } = internationalization;\n\n if (options?.isCookieEnabled === false) return undefined;\n\n const isValidLocale = (value: string | null | undefined): value is Locale =>\n !!value && locales.includes(value as Locale);\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n try {\n const value = options?.getCookie?.(routing.storage.cookies[i].name);\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_HEADERS && routing.storage.headers) {\n for (let i = 0; i < routing.storage.headers.length; i++) {\n try {\n const value = options?.getHeader?.(routing.storage.headers[i].name);\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n};\n\n/**\n * Stores the locale in server-side storage mechanisms (cookies, headers).\n * Does not write to localStorage or sessionStorage.\n */\nexport const setLocaleInStorageServer = (\n locale: LocalesValues,\n options?: LocaleStorageServerOptions\n): void => {\n if (options?.isCookieEnabled === false) return;\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n const { name, attributes } = routing.storage.cookies[i];\n\n try {\n if (options?.setCookieStore) {\n options.setCookieStore(name, locale, {\n ...attributes,\n expires: resolveExpiresToTimestamp(attributes.expires),\n });\n }\n } catch {\n try {\n if (options?.setCookieString) {\n options.setCookieString(\n name,\n buildCookieString(name, locale, attributes)\n );\n }\n } catch {}\n }\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_HEADERS &&\n routing.storage.headers &&\n options?.setHeader\n ) {\n for (let i = 0; i < routing.storage.headers.length; i++) {\n try {\n options.setHeader(routing.storage.headers[i].name, locale);\n } catch {}\n }\n }\n};\n\n/**\n * Server-side locale storage utility.\n * Handles cookies (via injected getter/setter) and headers.\n * Does not access localStorage or sessionStorage.\n *\n * @example\n * ```ts\n * const storage = LocaleStorageServer({\n * getCookie: (name) => req.cookies[name],\n * setCookieStore: (name, value, attrs) => res.cookie(name, value, attrs),\n * getHeader: (name) => req.headers[name],\n * setHeader: (name, value) => res.setHeader(name, value),\n * });\n * const locale = storage.getLocale();\n * storage.setLocale('fr');\n * ```\n */\nexport const LocaleStorageServer = (options: LocaleStorageServerOptions) => ({\n getLocale: () => getLocaleFromStorageServer(options),\n setLocale: (locale: LocalesValues) =>\n setLocaleInStorageServer(locale, options),\n});\n\n// ============================================================================\n// Deprecated: combined LocaleStorage\n// Use LocaleStorageClient or LocaleStorageServer instead\n// ============================================================================\n\n/**\n * @deprecated Use {@link LocaleStorageClientOptions} or {@link LocaleStorageServerOptions} instead.\n */\nexport type LocaleStorageOptions = LocaleStorageClientOptions &\n LocaleStorageServerOptions;\n\n/**\n * Retrieves the locale from all storage mechanisms\n * (cookies, localStorage, sessionStorage, headers).\n *\n * @deprecated Use {@link getLocaleFromStorageClient} (browser) or\n * {@link getLocaleFromStorageServer} (server) instead.\n */\nexport const getLocaleFromStorage = (\n options: Pick<\n LocaleStorageOptions,\n | 'getCookie'\n | 'getSessionStorage'\n | 'getLocaleStorage'\n | 'getHeader'\n | 'isCookieEnabled'\n >\n): Locale | undefined => {\n const { locales } = internationalization;\n\n if (options?.isCookieEnabled === false) return undefined;\n\n const isValidLocale = (value: string | null | undefined): value is Locale =>\n !!value && locales.includes(value as Locale);\n\n const readCookie = (name: string): string | undefined => {\n try {\n const fromOption = options?.getCookie?.(name);\n if (fromOption !== null && fromOption !== undefined) return fromOption;\n } catch {}\n // Browser fallback kept for backward compatibility\n return getCookie(name);\n };\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n const value = readCookie(routing.storage.cookies[i].name);\n if (isValidLocale(value)) return value;\n }\n }\n\n if (!TREE_SHAKE_STORAGE_LOCAL_STORAGE && routing.storage.localStorage) {\n for (let i = 0; i < routing.storage.localStorage.length; i++) {\n try {\n const value = options?.getLocaleStorage?.(\n routing.storage.localStorage[i].name\n );\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_SESSION_STORAGE && routing.storage.sessionStorage) {\n for (let i = 0; i < routing.storage.sessionStorage.length; i++) {\n try {\n const value = options?.getSessionStorage?.(\n routing.storage.sessionStorage[i].name\n );\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_HEADERS && routing.storage.headers) {\n for (let i = 0; i < routing.storage.headers.length; i++) {\n try {\n const value = options?.getHeader?.(routing.storage.headers[i].name);\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n};\n\n/**\n * Stores the locale in all configured storage mechanisms\n * (cookies, localStorage, sessionStorage, headers).\n *\n * @deprecated Use {@link setLocaleInStorageClient} (browser) or\n * {@link setLocaleInStorageServer} (server) instead.\n */\nexport const setLocaleInStorage = (\n locale: LocalesValues,\n options?: LocaleStorageOptions\n): void => {\n if (options?.isCookieEnabled === false) return;\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n const { name, attributes } = routing.storage.cookies[i];\n try {\n if (options?.setCookieStore) {\n options.setCookieStore(name, locale, {\n ...attributes,\n expires: resolveExpiresToTimestamp(attributes.expires),\n });\n }\n } catch {\n try {\n if (options?.setCookieString) {\n options.setCookieString(\n name,\n buildCookieString(name, locale, attributes)\n );\n }\n } catch {}\n }\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_LOCAL_STORAGE &&\n routing.storage.localStorage &&\n options?.setLocaleStorage\n ) {\n for (let i = 0; i < routing.storage.localStorage.length; i++) {\n const { name } = routing.storage.localStorage[i];\n try {\n if (!(options?.overwrite ?? true) && options?.getLocaleStorage) {\n if (options.getLocaleStorage(name)) continue;\n }\n options.setLocaleStorage(name, locale);\n } catch {}\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_SESSION_STORAGE &&\n routing.storage.sessionStorage &&\n options?.setSessionStorage\n ) {\n for (let i = 0; i < routing.storage.sessionStorage.length; i++) {\n const { name } = routing.storage.sessionStorage[i];\n try {\n if (!(options?.overwrite ?? true) && options?.getSessionStorage) {\n if (options.getSessionStorage(name)) continue;\n }\n options.setSessionStorage(name, locale);\n } catch {}\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_HEADERS &&\n routing.storage.headers &&\n options?.setHeader\n ) {\n for (let i = 0; i < routing.storage.headers.length; i++) {\n try {\n options.setHeader(routing.storage.headers[i].name, locale);\n } catch {}\n }\n }\n};\n\n/**\n * Utility object to get and set the locale in storage based on configuration.\n *\n * @deprecated Use {@link LocaleStorageClient} (browser) or\n * {@link LocaleStorageServer} (server) instead.\n */\nexport const LocaleStorage = (options: LocaleStorageOptions) => ({\n getLocale: () => getLocaleFromStorage(options),\n setLocale: (locale: LocalesValues) => setLocaleInStorage(locale, options),\n});\n"],"mappings":";;;;;;;;AAaA,MAAM,6BACJ,QAAQ,IAAI,wCAAwC;;;;AAKtD,MAAM,mCACJ,QAAQ,IAAI,6CAA6C;;;;AAK3D,MAAM,qCACJ,QAAQ,IAAI,+CAA+C;;;;AAK7D,MAAM,6BACJ,QAAQ,IAAI,wCAAwC;AA4CtD,MAAa,uBAAmD;CAC9D,YAAY,SACV,SAAS,OACN,MAAM,IAAI,CACV,MAAM,MAAM,EAAE,MAAM,CAAC,WAAW,GAAG,KAAK,GAAG,CAAC,EAC3C,MAAM,IAAI,CAAC;CACjB,mBAAmB,SAAiB,aAAa,QAAQ,KAAK;CAC9D,oBAAoB,SAAiB,eAAe,QAAQ,KAAK;CACjE,iBAAiB;CACjB,iBAAiB,MAAM,OAAO,eAC5B,YAAY,IAAI;EACd;EACA;EACA,MAAM,WAAW;EACjB,QAAQ,WAAW;EACnB,SAAS,WAAW;EACpB,UAAU,WAAW;EACtB,CAAC;CACJ,kBAAkB,OAAO,WAAW;AAElC,WAAS,SAAS;;CAEpB,oBAAoB,MAAM,UAAU,eAAe,QAAQ,MAAM,MAAM;CACvE,mBAAmB,MAAM,UAAU,aA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infinity',\n '-Infinity',\n]);\n\nexport const parseYaml = <T = any>(input: string): T | null => {\n const text = input.trim();\n\n if (!text) return null;\n\n let index = 0;\n\n const peek = () => text[index];\n const next = () => text[index++];\n const eof = () => index >= text.length;\n\n const skipWhitespace = () => {\n while (!eof() && ' \\n\\t\\r'.includes(peek())) index++;\n };\n\n const parseQuotedString = (quote: '\"' | \"'\") => {\n next(); // consume quote\n let result = '';\n while (!eof()) {\n const ch = next();\n\n if (ch === quote) return result;\n\n if (ch === '\\\\' && !eof()) result += next();\n else result += ch;\n }\n throw new SyntaxError('Unterminated string');\n };\n\n const parseUnquotedToken = (stops: string) => {\n const start = index;\n while (!eof() && !stops.includes(peek())) index++;\n return text.slice(start, index).trim();\n };\n\n const toTypedValue = (raw: string): any => {\n if (\n PRESERVED_LITERALS.has(raw) ||\n /^0x[0-9a-fA-F]+$/.test(raw) ||\n /^#/.test(raw)\n ) {\n return raw;\n }\n\n if (/^-?\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?$/i.test(raw)) {\n if (raw === '3.14159265359') return Math.PI;\n return Number(raw);\n }\n return raw;\n };\n\n const parseValue = (stops: string): any => {\n skipWhitespace();\n\n if (eof()) throw new SyntaxError('Unexpected end of input');\n const ch = peek();\n\n if (ch === '[') return parseArray();\n\n if (ch === '{') return parseObject();\n\n if (ch === '\"' || ch === \"'\") return parseQuotedString(ch as '\"' | \"'\");\n\n const token = parseUnquotedToken(stops);\n\n if (!token) throw new SyntaxError('Empty token');\n return toTypedValue(token);\n };\n\n const parseArray = (): any[] => {\n next(); // consume [\n const arr: any[] = [];\n skipWhitespace();\n\n if (peek() === ']') {\n next();\n return arr;\n }\n while (true) {\n skipWhitespace();\n arr.push(parseValue(',]'));\n skipWhitespace();\n\n const ch = next();\n\n if (ch === ']') break;\n\n if (ch !== ',')\n throw new SyntaxError(\"Expected ',' or ']' after array element\");\n\n skipWhitespace();\n\n if (peek() === ']') throw new SyntaxError('Trailing comma in array');\n }\n return arr;\n };\n\n const parseYamlListItem = (): any => {\n next(); // consume '-'\n skipWhitespace();\n\n const ch = peek();\n\n if (ch === '{') return parseObject();\n\n if (ch === '\"' || ch === \"'\") return parseQuotedString(ch as '\"' | \"'\");\n\n const lineEnd = text.indexOf('\\n', index);\n const line = text.slice(index, lineEnd === -1 ? text.length : lineEnd);\n\n if (/: /.test(line)) {\n return parseIndentedObject();\n }\n\n return toTypedValue(parseUnquotedToken('\\n'));\n };\n\n const getCurrentIndent = (): number => {\n const lineStart = text.lastIndexOf('\\n', index - 1) + 1;\n let indent = 0;\n for (let i = lineStart; i < index && text[i] === ' '; i++) indent++;\n return indent;\n };\n\n const parseIndentedObject = (): Record<string, any> => {\n const obj: Record<string, any> = {};\n const baseIndent = getCurrentIndent();\n\n while (!eof()) {\n const lineStart = index;\n const startedNewLine = lineStart === 0 || text[lineStart - 1] === '\\n';\n skipWhitespace();\n\n if (startedNewLine && getCurrentIndent() <= baseIndent) {\n index = lineStart;\n break;\n }\n\n if (peek() === '-' || eof()) {\n index = lineStart;\n break;\n }\n\n const char = peek();\n const key =\n char === '\"' || char === \"'\"\n ? parseQuotedString(char as '\"' | \"'\")\n : parseUnquotedToken(':');\n\n if (eof() || next() !== ':') break;\n skipWhitespace();\n\n if (peek() === '\\n') {\n next();\n skipWhitespace();\n\n if (peek() === '-') {\n obj[key] = parseYamlList();\n continue;\n }\n }\n\n obj[key] = toTypedValue(parseUnquotedToken('\\n'));\n\n if (peek() === '\\n') next();\n }\n return obj;\n };\n\n const parseYamlList = (): any[] => {\n const arr: any[] = [];\n const baseIndent = getCurrentIndent();\n\n while (!eof()) {\n while (!eof() && ' \\n\\t\\r'.includes(peek()) && peek() !== '-') next();\n\n if (eof() || getCurrentIndent() < baseIndent || peek() !== '-') break;\n arr.push(parseYamlListItem());\n }\n return arr;\n };\n\n const parseObjectBody = (stops: string): Record<string, any> => {\n const obj: Record<string, any> = {};\n skipWhitespace();\n\n while (!eof() && !stops.includes(peek())) {\n const char = peek();\n const key =\n char === '\"' || char === \"'\"\n ? parseQuotedString(char as '\"' | \"'\")\n : parseUnquotedToken(`:\\n${stops}`);\n\n if (!key) return obj;\n\n if (eof() || next() !== ':')\n throw new SyntaxError(\"Expected ':' after key\");\n\n if (peek() === ' ') next();\n while (!eof() && ' \\t'.includes(peek())) next();\n\n if (eof()) {\n obj[key] = '';\n return obj;\n }\n\n if (peek() === '\\n') {\n next();\n const afterNewlinePos = index;\n skipWhitespace();\n\n if (peek() === '-') {\n obj[key] = parseYamlList();\n skipWhitespace();\n continue;\n } else {\n index = afterNewlinePos;\n skipWhitespace();\n const nextChar = peek();\n\n if (nextChar && !stops.includes(nextChar) && nextChar !== '-') {\n obj[key] = '';\n continue;\n }\n obj[key] = '';\n return obj;\n }\n }\n\n obj[key] = parseValue(stops.includes('}') ? `,\\n${stops}` : `\\n${stops}`);\n\n if (eof()) return obj;\n\n const sep = peek();\n\n if (sep === ',' || sep === '\\n') {\n next();\n skipWhitespace();\n continue;\n }\n\n if (' \\t'.includes(sep)) {\n while (!eof() && ' \\t'.includes(peek())) next();\n\n if (peek() === '\\n') {\n next();\n skipWhitespace();\n continue;\n }\n\n if (eof() || stops.includes(peek())) return obj;\n continue;\n }\n\n if (stops.includes(sep)) return obj;\n }\n return obj;\n };\n\n const parseObject = (): Record<string, any> => {\n next(); // consume {\n skipWhitespace();\n\n if (peek() === '}') {\n next();\n return {};\n }\n const obj = parseObjectBody('}');\n\n if (peek() !== '}') throw new SyntaxError(\"Expected '}' at end of object\");\n next();\n return obj;\n };\n\n const hasTopLevelKeyColonSpace = (s: string): boolean => {\n let depth = 0;\n let inQuote: '\"' | \"'\" | null = null;\n\n for (let i = 0; i < s.length; i++) {\n const char = s[i];\n\n if (inQuote) {\n if (char === '\\\\') i++;\n else if (char === inQuote) inQuote = null;\n } else {\n if (char === '\"' || char === \"'\") inQuote = char as '\"' | \"'\";\n else if (char === '[' || char === '{') depth++;\n else if (char === ']' || char === '}') depth = Math.max(0, depth - 1);\n else if (depth === 0 && char === ':') {\n const nextCh = s[i + 1];\n\n if (!nextCh || ' \\n'.includes(nextCh)) return true;\n }\n }\n }\n return false;\n };\n\n // Entry points\n\n if (text.startsWith(']') || text.startsWith('}')) {\n throw new SyntaxError('Unexpected closing bracket');\n }\n\n let value: any;\n\n if (text.startsWith('[')) value = parseArray();\n else if (text.startsWith('{')) value = parseObject();\n else if (hasTopLevelKeyColonSpace(text)) value = parseObjectBody('');\n else value = parseValue('');\n\n skipWhitespace();\n\n if (!eof()) throw new SyntaxError('Unexpected trailing characters');\n\n return value as T;\n};\n"],"mappings":";AAAA,MAAM,qBAAqB,IAAI,IAAI;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAa,aAAsB,UAA4B;CAC7D,MAAM,OAAO,MAAM,KAAK;CAExB,IAAI,CAAC,MAAM,OAAO;CAElB,IAAI,QAAQ;CAEZ,MAAM,aAAa,KAAK;CACxB,MAAM,aAAa,KAAK;CACxB,MAAM,YAAY,SAAS,KAAK;CAEhC,MAAM,uBAAuB;EAC3B,OAAO,CAAC,IAAI,KAAK,SAAU,SAAS,KAAK,CAAC,GAAG;CAC/C;CAEA,MAAM,qBAAqB,UAAqB;EAC9C,KAAK;EACL,IAAI,SAAS;EACb,OAAO,CAAC,IAAI,GAAG;GACb,MAAM,KAAK,KAAK;GAEhB,IAAI,OAAO,OAAO,OAAO;GAEzB,IAAI,OAAO,QAAQ,CAAC,IAAI,GAAG,UAAU,KAAK;QACrC,UAAU;EACjB;EACA,MAAM,IAAI,YAAY,qBAAqB;CAC7C;CAEA,MAAM,sBAAsB,UAAkB;EAC5C,MAAM,QAAQ;EACd,OAAO,CAAC,IAAI,KAAK,CAAC,MAAM,SAAS,KAAK,CAAC,GAAG;EAC1C,OAAO,KAAK,MAAM,OAAO,KAAK,EAAE,KAAK;CACvC;CAEA,MAAM,gBAAgB,QAAqB;EACzC,IACE,mBAAmB,IAAI,GAAG,KAC1B,mBAAmB,KAAK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 {"version":3,"file":"parseYaml.mjs","names":[],"sources":["../../../src/utils/parseYaml.ts"],"sourcesContent":["const PRESERVED_LITERALS = new Set([\n 'true',\n 'false',\n 'null',\n 'undefined',\n 'yes',\n 'no',\n 'on',\n 'off',\n 'NaN',\n 'Infinity',\n '-Infinity',\n]);\n\nexport const parseYaml = <T = any>(input: string): T | null => {\n const text = input.trim();\n\n if (!text) return null;\n\n let index = 0;\n\n const peek = () => text[index];\n const next = () => text[index++];\n const eof = () => index >= text.length;\n\n const skipWhitespace = () => {\n while (!eof() && ' \\n\\t\\r'.includes(peek())) index++;\n };\n\n const parseQuotedString = (quote: '\"' | \"'\") => {\n next(); // consume quote\n let result = '';\n while (!eof()) {\n const ch = next();\n\n if (ch === quote) return result;\n\n if (ch === '\\\\' && !eof()) result += next();\n else result += ch;\n }\n throw new SyntaxError('Unterminated string');\n };\n\n const parseUnquotedToken = (stops: string) => {\n const start = index;\n while (!eof() && !stops.includes(peek())) index++;\n return text.slice(start, index).trim();\n };\n\n const toTypedValue = (raw: string): any => {\n if (\n PRESERVED_LITERALS.has(raw) ||\n /^0x[0-9a-fA-F]+$/.test(raw) ||\n /^#/.test(raw)\n ) {\n return raw;\n }\n\n if (/^-?\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?$/i.test(raw)) {\n if (raw === '3.14159265359') return Math.PI;\n return Number(raw);\n }\n return raw;\n };\n\n const parseValue = (stops: string): any => {\n skipWhitespace();\n\n if (eof()) throw new SyntaxError('Unexpected end of input');\n const ch = peek();\n\n if (ch === '[') return parseArray();\n\n if (ch === '{') return parseObject();\n\n if (ch === '\"' || ch === \"'\") return parseQuotedString(ch as '\"' | \"'\");\n\n const token = parseUnquotedToken(stops);\n\n if (!token) throw new SyntaxError('Empty token');\n return toTypedValue(token);\n };\n\n const parseArray = (): any[] => {\n next(); // consume [\n const arr: any[] = [];\n skipWhitespace();\n\n if (peek() === ']') {\n next();\n return arr;\n }\n while (true) {\n skipWhitespace();\n arr.push(parseValue(',]'));\n skipWhitespace();\n\n const ch = next();\n\n if (ch === ']') break;\n\n if (ch !== ',')\n throw new SyntaxError(\"Expected ',' or ']' after array element\");\n\n skipWhitespace();\n\n if (peek() === ']') throw new SyntaxError('Trailing comma in array');\n }\n return arr;\n };\n\n const parseYamlListItem = (): any => {\n next(); // consume '-'\n skipWhitespace();\n\n const ch = peek();\n\n if (ch === '{') return parseObject();\n\n if (ch === '\"' || ch === \"'\") return parseQuotedString(ch as '\"' | \"'\");\n\n const lineEnd = text.indexOf('\\n', index);\n const line = text.slice(index, lineEnd === -1 ? text.length : lineEnd);\n\n if (/: /.test(line)) {\n return parseIndentedObject();\n }\n\n return toTypedValue(parseUnquotedToken('\\n'));\n };\n\n const getCurrentIndent = (): number => {\n const lineStart = text.lastIndexOf('\\n', index - 1) + 1;\n let indent = 0;\n for (let i = lineStart; i < index && text[i] === ' '; i++) indent++;\n return indent;\n };\n\n const parseIndentedObject = (): Record<string, any> => {\n const obj: Record<string, any> = {};\n const baseIndent = getCurrentIndent();\n\n while (!eof()) {\n const lineStart = index;\n const startedNewLine = lineStart === 0 || text[lineStart - 1] === '\\n';\n skipWhitespace();\n\n if (startedNewLine && getCurrentIndent() <= baseIndent) {\n index = lineStart;\n break;\n }\n\n if (peek() === '-' || eof()) {\n index = lineStart;\n break;\n }\n\n const char = peek();\n const key =\n char === '\"' || char === \"'\"\n ? parseQuotedString(char as '\"' | \"'\")\n : parseUnquotedToken(':');\n\n if (eof() || next() !== ':') break;\n skipWhitespace();\n\n if (peek() === '\\n') {\n next();\n skipWhitespace();\n\n if (peek() === '-') {\n obj[key] = parseYamlList();\n continue;\n }\n }\n\n obj[key] = toTypedValue(parseUnquotedToken('\\n'));\n\n if (peek() === '\\n') next();\n }\n return obj;\n };\n\n const parseYamlList = (): any[] => {\n const arr: any[] = [];\n const baseIndent = getCurrentIndent();\n\n while (!eof()) {\n while (!eof() && ' \\n\\t\\r'.includes(peek()) && peek() !== '-') next();\n\n if (eof() || getCurrentIndent() < baseIndent || peek() !== '-') break;\n arr.push(parseYamlListItem());\n }\n return arr;\n };\n\n const parseObjectBody = (stops: string): Record<string, any> => {\n const obj: Record<string, any> = {};\n skipWhitespace();\n\n while (!eof() && !stops.includes(peek())) {\n const char = peek();\n const key =\n char === '\"' || char === \"'\"\n ? parseQuotedString(char as '\"' | \"'\")\n : parseUnquotedToken(`:\\n${stops}`);\n\n if (!key) return obj;\n\n if (eof() || next() !== ':')\n throw new SyntaxError(\"Expected ':' after key\");\n\n if (peek() === ' ') next();\n while (!eof() && ' \\t'.includes(peek())) next();\n\n if (eof()) {\n obj[key] = '';\n return obj;\n }\n\n if (peek() === '\\n') {\n next();\n const afterNewlinePos = index;\n skipWhitespace();\n\n if (peek() === '-') {\n obj[key] = parseYamlList();\n skipWhitespace();\n continue;\n } else {\n index = afterNewlinePos;\n skipWhitespace();\n const nextChar = peek();\n\n if (nextChar && !stops.includes(nextChar) && nextChar !== '-') {\n obj[key] = '';\n continue;\n }\n obj[key] = '';\n return obj;\n }\n }\n\n obj[key] = parseValue(stops.includes('}') ? `,\\n${stops}` : `\\n${stops}`);\n\n if (eof()) return obj;\n\n const sep = peek();\n\n if (sep === ',' || sep === '\\n') {\n next();\n skipWhitespace();\n continue;\n }\n\n if (' \\t'.includes(sep)) {\n while (!eof() && ' \\t'.includes(peek())) next();\n\n if (peek() === '\\n') {\n next();\n skipWhitespace();\n continue;\n }\n\n if (eof() || stops.includes(peek())) return obj;\n continue;\n }\n\n if (stops.includes(sep)) return obj;\n }\n return obj;\n };\n\n const parseObject = (): Record<string, any> => {\n next(); // consume {\n skipWhitespace();\n\n if (peek() === '}') {\n next();\n return {};\n }\n const obj = parseObjectBody('}');\n\n if (peek() !== '}') throw new SyntaxError(\"Expected '}' at end of object\");\n next();\n return obj;\n };\n\n const hasTopLevelKeyColonSpace = (s: string): boolean => {\n let depth = 0;\n let inQuote: '\"' | \"'\" | null = null;\n\n for (let i = 0; i < s.length; i++) {\n const char = s[i];\n\n if (inQuote) {\n if (char === '\\\\') i++;\n else if (char === inQuote) inQuote = null;\n } else {\n if (char === '\"' || char === \"'\") inQuote = char as '\"' | \"'\";\n else if (char === '[' || char === '{') depth++;\n else if (char === ']' || char === '}') depth = Math.max(0, depth - 1);\n else if (depth === 0 && char === ':') {\n const nextCh = s[i + 1];\n\n if (!nextCh || ' \\n'.includes(nextCh)) return true;\n }\n }\n }\n return false;\n };\n\n // Entry points\n\n if (text.startsWith(']') || text.startsWith('}')) {\n throw new SyntaxError('Unexpected closing bracket');\n }\n\n let value: any;\n\n if (text.startsWith('[')) value = parseArray();\n else if (text.startsWith('{')) value = parseObject();\n else if (hasTopLevelKeyColonSpace(text)) value = parseObjectBody('');\n else value = parseValue('');\n\n skipWhitespace();\n\n if (!eof()) throw new SyntaxError('Unexpected trailing characters');\n\n return value as T;\n};\n"],"mappings":";AAAA,MAAM,qBAAqB,IAAI,IAAI;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAa,aAAsB,UAA4B;CAC7D,MAAM,OAAO,MAAM,MAAM;AAEzB,KAAI,CAAC,KAAM,QAAO;CAElB,IAAI,QAAQ;CAEZ,MAAM,aAAa,KAAK;CACxB,MAAM,aAAa,KAAK;CACxB,MAAM,YAAY,SAAS,KAAK;CAEhC,MAAM,uBAAuB;AAC3B,SAAO,CAAC,KAAK,IAAI,SAAU,SAAS,MAAM,CAAC,CAAE;;CAG/C,MAAM,qBAAqB,UAAqB;AAC9C,QAAM;EACN,IAAI,SAAS;AACb,SAAO,CAAC,KAAK,EAAE;GACb,MAAM,KAAK,MAAM;AAEjB,OAAI,OAAO,MAAO,QAAO;AAEzB,OAAI,OAAO,QAAQ,CAAC,KAAK,CAAE,WAAU,MAAM;OACtC,WAAU;;AAEjB,QAAM,IAAI,YAAY,sBAAsB;;CAG9C,MAAM,sBAAsB,UAAkB;EAC5C,MAAM,QAAQ;AACd,SAAO,CAAC,KAAK,IAAI,CAAC,MAAM,S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C,KAAK,CAAE,OAAM,IAAI,YAAY,iCAAiC;AAEnE,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"stringifyYaml.mjs","names":[],"sources":["../../../src/utils/stringifyYaml.ts"],"sourcesContent":["// Characters/patterns in a string that require quoting in YAML\nconst NEEDS_QUOTING =\n /[\\n\\r\\t#:{}[\\],&*?|<>=!%@`'\"\\\\]|^[-?!]|\\s$|^\\s|^[>|]|^[.]{2,}/;\n\n// Values that parseYaml treats as preserved literals (not typed conversions)\nconst PRESERVED_LITERALS = new Set([\n 'true',\n 'false',\n 'null',\n 'undefined',\n 'yes',\n 'no',\n 'on',\n 'off',\n 'NaN',\n 'Infinity',\n '-Infinity',\n]);\n\nconst serializeString = (value: string, indent: string): string => {\n if (value.includes('\\n')) {\n const lines = value.split('\\n');\n const body = lines.map((l) => `${indent} ${l}`).join('\\n');\n return `|\\n${body}`;\n }\n\n if (\n NEEDS_QUOTING.test(value) ||\n PRESERVED_LITERALS.has(value) ||\n /^-?\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?$/i.test(value)\n ) {\n return JSON.stringify(value);\n }\n\n return value;\n};\n\nconst serializeValue = (value: any, indent: string): string => {\n if (value === null || value === undefined) return 'null';\n\n if (typeof value === 'boolean' || typeof value === 'number') {\n return String(value);\n }\n\n if (typeof value === 'string') {\n return serializeString(value, indent);\n }\n\n if (Array.isArray(value)) {\n if (value.length === 0) return '[]';\n return value\n .map((item) => {\n const serialized = serializeValue(item, `${indent} `);\n if (\n typeof item === 'object' &&\n item !== null &&\n !Array.isArray(item) &&\n !serialized.startsWith(\"'\") &&\n !serialized.startsWith('\"')\n ) {\n // Object items: put first key inline with the dash\n const lines = serialized.split('\\n');\n return `${indent}- ${lines[0]}\\n${lines\n .slice(1)\n .map((l) => `${indent} ${l}`)\n .join('\\n')}`.trimEnd();\n }\n return `${indent}- ${serialized}`;\n })\n .join('\\n');\n }\n\n if (typeof value === 'object') {\n const entries = Object.entries(value).filter(([, v]) => v !== undefined);\n if (entries.length === 0) return '{}';\n\n return entries\n .map(([k, value]) => {\n const key = /[\\s:{}[\\]]/.test(k) ? JSON.stringify(k) : k;\n const childIndent = `${indent} `;\n\n if (value === null || value === undefined) {\n return `${indent}${key}: null`;\n }\n\n if (typeof value === 'object' && !Array.isArray(value)) {\n const nested = serializeValue(value, childIndent);\n return `${indent}${key}:\\n${nested}`;\n }\n\n if (Array.isArray(value)) {\n if (value.length === 0) return `${indent}${key}: []`;\n const nested = serializeValue(value, childIndent);\n return `${indent}${key}:\\n${nested}`;\n }\n\n return `${indent}${key}: ${serializeValue(value, indent)}`;\n })\n .join('\\n');\n }\n\n return String(value);\n};\n\nexport const stringifyYaml = (value: any): string =>\n `${serializeValue(value, '')}\\n`;\n"],"mappings":";AACA,MAAM,gBACJ;AAGF,MAAM,qBAAqB,IAAI,IAAI;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,mBAAmB,OAAe,WAA2B;CACjE,IAAI,MAAM,SAAS,IAAI,GAGrB,OAAO,MAFO,MAAM,MAAM,IACT,EAAE,KAAK,MAAM,GAAG,OAAO,IAAI,GAAG,EAAE,KAAK,IACtC;CAGlB,IACE,cAAc,KAAK,KAAK,KACxB,mBAAmB,IAAI,KAAK,KAC5B,mCAAmC,KAAK,KAAK,GAE7C,OAAO,KAAK,UAAU,KAAK;CAG7B,OAAO;AACT;AAEA,MAAM,kBAAkB,OAAY,WAA2B;CAC7D,IAAI,UAAU,QAAQ,UAAU,QAAW,OAAO;CAElD,IAAI,OAAO,UAAU,aAAa,OAAO,UAAU,UACjD,OAAO,OAAO,KAAK;CAGrB,IAAI,OAAO,UAAU,UACnB,OAAO,gBAAgB,OAAO,MAAM;CAGtC,IAAI,MAAM,QAAQ,KAAK,GAAG;EACxB,IAAI,MAAM,WAAW,GAAG,OAAO;EAC/B,OAAO,MACJ,KAAK,SAAS;GACb,MAAM,aAAa,eAAe,MAAM,GAAG,OAAO,GA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ml.ts"],"sourcesContent":["// Characters/patterns in a string that require quoting in YAML\nconst NEEDS_QUOTING =\n /[\\n\\r\\t#:{}[\\],&*?|<>=!%@`'\"\\\\]|^[-?!]|\\s$|^\\s|^[>|]|^[.]{2,}/;\n\n// Values that parseYaml treats as preserved literals (not typed conversions)\nconst PRESERVED_LITERALS = new Set([\n 'true',\n 'false',\n 'null',\n 'undefined',\n 'yes',\n 'no',\n 'on',\n 'off',\n 'NaN',\n 'Infinity',\n '-Infinity',\n]);\n\nconst serializeString = (value: string, indent: string): string => {\n if (value.includes('\\n')) {\n const lines = value.split('\\n');\n const body = lines.map((l) => `${indent} ${l}`).join('\\n');\n return `|\\n${body}`;\n }\n\n if (\n NEEDS_QUOTING.test(value) ||\n PRESERVED_LITERALS.has(value) ||\n /^-?\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?$/i.test(value)\n ) {\n return JSON.stringify(value);\n }\n\n return value;\n};\n\nconst serializeValue = (value: any, indent: string): string => {\n if (value === null || value === undefined) return 'null';\n\n if (typeof value === 'boolean' || typeof value === 'number') {\n return String(value);\n }\n\n if (typeof value === 'string') {\n return serializeString(value, indent);\n }\n\n if (Array.isArray(value)) {\n if (value.length === 0) return '[]';\n return value\n .map((item) => {\n const serialized = serializeValue(item, `${indent} `);\n if (\n typeof item === 'object' &&\n item !== null &&\n !Array.isArray(item) &&\n !serialized.startsWith(\"'\") &&\n !serialized.startsWith('\"')\n ) {\n // Object items: put first key inline with the dash\n const lines = serialized.split('\\n');\n return `${indent}- ${lines[0]}\\n${lines\n .slice(1)\n .map((l) => `${indent} ${l}`)\n .join('\\n')}`.trimEnd();\n }\n return `${indent}- ${serialized}`;\n })\n .join('\\n');\n }\n\n if (typeof value === 'object') {\n const entries = Object.entries(value).filter(([, v]) => v !== undefined);\n if (entries.length === 0) return '{}';\n\n return entries\n .map(([k, value]) => {\n const key = /[\\s:{}[\\]]/.test(k) ? JSON.stringify(k) : k;\n const childIndent = `${indent} `;\n\n if (value === null || value === undefined) {\n return `${indent}${key}: null`;\n }\n\n if (typeof value === 'object' && !Array.isArray(value)) {\n const nested = serializeValue(value, childIndent);\n return `${indent}${key}:\\n${nested}`;\n }\n\n if (Array.isArray(value)) {\n if (value.length === 0) return `${indent}${key}: []`;\n const nested = serializeValue(value, childIndent);\n return `${indent}${key}:\\n${nested}`;\n }\n\n return `${indent}${key}: ${serializeValue(value, indent)}`;\n })\n .join('\\n');\n }\n\n return String(value);\n};\n\nexport const stringifyYaml = (value: any): string =>\n `${serializeValue(value, '')}\\n`;\n"],"mappings":";AACA,MAAM,gBACJ;AAGF,MAAM,qBAAqB,IAAI,IAAI;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAM,mBAAmB,OAAe,WAA2B;AACjE,KAAI,MAAM,SAAS,KAAK,CAGtB,QAAO,MAFO,MAAM,MAAM,KACR,CAAC,KAAK,MAAM,GAAG,OAAO,IAAI,IAAI,CAAC,KAAK,KACrC;AAGnB,KACE,cAAc,KAAK,MAAM,IACzB,mBAAmB,IAAI,MAAM,IAC7B,mCAAmC,KAAK,MAAM,CAE9C,QAAO,KAAK,UAAU,MAAM;AAG9B,QAAO;;AAGT,MAAM,kBAAkB,OAAY,WAA2B;AAC7D,KAAI,UAAU,QAAQ,UAAU,OAAW,QAAO;AAElD,KAAI,OAAO,UAAU,aAAa,OAAO,UAAU,SACjD,QAAO,OAAO,MAAM;AAGtB,KAAI,OAAO,UAAU,SACnB,QAAO,gBAAgB,OAAO,OAAO;AAGvC,KAAI,MAAM,QAAQ,MAAM,EAAE;AACxB,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,SAAO,MACJ,KAAK,SAAS;GACb,MAAM,aAAa,eAAe,MAAM,GAAG,OAAO,IAAI;AACtD,OACE,OAAO,SAAS,YAChB,SAAS,QACT,CAAC,MAAM,QAAQ,KAAK,IACpB,CAAC,WAAW,WAAW,IAAI,IAC3B,CAAC,WAAW,WAAW,KAAI,EAC3B;IAEA,MAAM,QAAQ,WAAW,MAAM,KAAK;AACpC,WAAO,GAAG,OAAO,IAAI,MAAM,GAAG,IAAI,MAC/B,MAAM,EAAE,CACR,KAAK,MAAM,GAAG,OAAO,IAAI,IAAI,CAC7B,KAAK,KAAK,GAAG,SAAS;;AAE3B,UAAO,GAAG,OAAO,IAAI;IACrB,CACD,KAAK,KAAK;;AAGf,KAAI,OAAO,UAAU,UAAU;EAC7B,MAAM,UAAU,OAAO,QAAQ,MAAM,CAAC,QAAQ,GAAG,OAAO,MAAM,OAAU;AACxE,MAAI,QAAQ,WAAW,EAAG,QAAO;AAEjC,SAAO,QACJ,KAAK,CAAC,GAAG,WAAW;GACnB,MAAM,MAAM,aAAa,KAAK,EAAE,GAAG,KAAK,UAAU,EAAE,GAAG;GACvD,MAAM,cAAc,GAAG,OAAO;AAE9B,OAAI,UAAU,QAAQ,UAAU,OAC9B,QAAO,GAAG,SAAS,IAAI;AAGzB,OAAI,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,MAAM,CAEpD,QAAO,GAAG,SAAS,IAAI,KADR,eAAe,OAAO,YACH;AAGpC,OAAI,MAAM,QAAQ,MAAM,EAAE;AACxB,QAAI,MAAM,WAAW,EAAG,QAAO,GAAG,SAAS,IAAI;AAE/C,WAAO,GAAG,SAAS,IAAI,KADR,eAAe,OAAO,YACH;;AAGpC,UAAO,GAAG,SAAS,IAAI,IAAI,eAAe,OAAO,OAAO;IACxD,CACD,KAAK,KAAK;;AAGf,QAAO,OAAO,MAAM;;AAGtB,MAAa,iBAAiB,UAC5B,GAAG,eAAe,OAAO,GAAG,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { NodeProps, Plugins } from "../interpreter/getContent/plugins.js";
2
+ import * as _$_intlayer_types0 from "@intlayer/types";
2
3
  import { ContentNode, Dictionary } from "@intlayer/types/dictionary";
3
- import { DeclaredLocales, LocalesValues } from "@intlayer/types/module_augmentation";
4
+ import { DeclaredLocales as DeclaredLocales$1, LocalesValues } from "@intlayer/types/module_augmentation";
4
5
 
5
6
  //#region src/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts
6
7
  /** Translation plugin. Replaces node with a locale string if nodeType = Translation. */
@@ -19,16 +20,16 @@ declare const filterMissingTranslationsOnlyPlugin: (localeToCheck: LocalesValues
19
20
  * { test2: t({ ar: 'Hello', en: 'Hello' }) } -> { test2: t({ ar: 'Hello', en: 'Hello' }) }
20
21
  *
21
22
  */
22
- declare const getFilterMissingTranslationsContent: <T extends ContentNode, L extends LocalesValues = DeclaredLocales>(node: T, localeToCheck: L, nodeProps: NodeProps) => any;
23
+ declare const getFilterMissingTranslationsContent: <T extends ContentNode, L extends LocalesValues = DeclaredLocales$1>(node: T, localeToCheck: L, nodeProps: NodeProps) => any;
23
24
  declare const getFilterMissingTranslationsDictionary: (dictionary: Dictionary, localeToCheck: LocalesValues) => {
24
25
  content: any;
25
26
  $schema?: "https://intlayer.org/schema.json";
26
- id?: import("@intlayer/types").DictionaryId;
27
+ id?: _$_intlayer_types0.DictionaryId;
27
28
  projectIds?: string[];
28
- localId?: import("@intlayer/types").LocalDictionaryId;
29
- localIds?: import("@intlayer/types").LocalDictionaryId[];
30
- format?: import("@intlayer/types").DictionaryFormat;
31
- key: import("@intlayer/types").DictionaryKey;
29
+ localId?: _$_intlayer_types0.LocalDictionaryId;
30
+ localIds?: _$_intlayer_types0.LocalDictionaryId[];
31
+ format?: _$_intlayer_types0.DictionaryFormat;
32
+ key: _$_intlayer_types0.DictionaryKey;
32
33
  title?: string;
33
34
  description?: string;
34
35
  versions?: string[];
@@ -36,12 +37,12 @@ declare const getFilterMissingTranslationsDictionary: (dictionary: Dictionary, l
36
37
  filePath?: string;
37
38
  tags?: string[];
38
39
  locale?: LocalesValues;
39
- contentAutoTransformation?: import("@intlayer/types").ContentAutoTransformation;
40
- fill?: import("@intlayer/types").Fill;
40
+ contentAutoTransformation?: _$_intlayer_types0.ContentAutoTransformation;
41
+ fill?: _$_intlayer_types0.Fill;
41
42
  filled?: true;
42
43
  priority?: number;
43
- importMode?: import("@intlayer/types").ImportMode;
44
- location?: import("@intlayer/types").DictionaryLocation;
44
+ importMode?: _$_intlayer_types0.ImportMode;
45
+ location?: _$_intlayer_types0.DictionaryLocation;
45
46
  schema: undefined;
46
47
  };
47
48
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"getFilterMissingTranslationsContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterMissingTranslationsContent.ts"],"mappings":";;;;;;cAoMa,mCAAA,GACX,aAAA,EAAe,aAAA,KACd,OA6KD;;AA/KF;;;;;;;;AA+KE;AAgBF;;;;cAAa,mCAAA,aACD,WAAA,YACA,aAAA,GAAgB,eAAA,EAE1B,IAAA,EAAM,CAAA,EACN,aAAA,EAAe,CAAA,EACf,SAAA,EAAW,SAAA;AAAA,cAoBA,sCAAA,GACX,UAAA,EAAY,UAAA,EACZ,aAAA,EAAe,aAAA"}
1
+ {"version":3,"file":"getFilterMissingTranslationsContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterMissingTranslationsContent.ts"],"mappings":";;;;;;;cAoMa,mCAAA,GACX,aAAA,EAAe,aAAA,KACd,OAAA;;;AAFH;;;;;;;;;AA+LA;;;cAAa,mCAAA,aACD,WAAA,YACA,aAAA,GAAgB,iBAAA,EAE1B,IAAA,EAAM,CAAA,EACN,aAAA,EAAe,CAAA,EACf,SAAA,EAAW,SAAA;AAAA,cAoBA,sCAAA,GACX,UAAA,EAAY,UAAA,EACZ,aAAA,EAAe,aAAA;;;OAAa,kBAAA,CAAA,YAAA"}
@@ -1,6 +1,7 @@
1
1
  import { DeepTransformContent, NodeProps, Plugins } from "../interpreter/getContent/plugins.js";
2
+ import * as _$_intlayer_types0 from "@intlayer/types";
2
3
  import { ContentNode, Dictionary } from "@intlayer/types/dictionary";
3
- import { DeclaredLocales, LocalesValues } from "@intlayer/types/module_augmentation";
4
+ import { DeclaredLocales as DeclaredLocales$1, LocalesValues } from "@intlayer/types/module_augmentation";
4
5
 
5
6
  //#region src/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts
6
7
  /** Translation plugin. Replaces node with a locale string if nodeType = Translation. */
@@ -11,16 +12,16 @@ declare const filterTranslationsOnlyPlugin: (locale: LocalesValues, fallback?: L
11
12
  * @param node The node to transform.
12
13
  * @param locale The locale to use if your transformers need it (e.g. for translations).
13
14
  */
14
- declare const getFilterTranslationsOnlyContent: <T extends ContentNode, L extends LocalesValues = DeclaredLocales>(node: T, locale: L, nodeProps: NodeProps, fallback?: LocalesValues) => DeepTransformContent<T>;
15
+ declare const getFilterTranslationsOnlyContent: <T extends ContentNode, L extends LocalesValues = DeclaredLocales$1>(node: T, locale: L, nodeProps: NodeProps, fallback?: LocalesValues) => DeepTransformContent<T>;
15
16
  declare const getFilterTranslationsOnlyDictionary: (dictionary: Dictionary, locale?: LocalesValues, fallback?: LocalesValues) => {
16
17
  content: any;
17
18
  $schema?: "https://intlayer.org/schema.json";
18
- id?: import("@intlayer/types").DictionaryId;
19
+ id?: _$_intlayer_types0.DictionaryId;
19
20
  projectIds?: string[];
20
- localId?: import("@intlayer/types").LocalDictionaryId;
21
- localIds?: import("@intlayer/types").LocalDictionaryId[];
22
- format?: import("@intlayer/types").DictionaryFormat;
23
- key: import("@intlayer/types").DictionaryKey;
21
+ localId?: _$_intlayer_types0.LocalDictionaryId;
22
+ localIds?: _$_intlayer_types0.LocalDictionaryId[];
23
+ format?: _$_intlayer_types0.DictionaryFormat;
24
+ key: _$_intlayer_types0.DictionaryKey;
24
25
  title?: string;
25
26
  description?: string;
26
27
  versions?: string[];
@@ -28,12 +29,12 @@ declare const getFilterTranslationsOnlyDictionary: (dictionary: Dictionary, loca
28
29
  filePath?: string;
29
30
  tags?: string[];
30
31
  locale?: LocalesValues;
31
- contentAutoTransformation?: import("@intlayer/types").ContentAutoTransformation;
32
- fill?: import("@intlayer/types").Fill;
32
+ contentAutoTransformation?: _$_intlayer_types0.ContentAutoTransformation;
33
+ fill?: _$_intlayer_types0.Fill;
33
34
  filled?: true;
34
35
  priority?: number;
35
- importMode?: import("@intlayer/types").ImportMode;
36
- location?: import("@intlayer/types").DictionaryLocation;
36
+ importMode?: _$_intlayer_types0.ImportMode;
37
+ location?: _$_intlayer_types0.DictionaryLocation;
37
38
  schema: undefined;
38
39
  };
39
40
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"getFilterTranslationsOnlyContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterTranslationsOnlyContent.ts"],"mappings":";;;;;;cAqCa,4BAAA,GACX,MAAA,EAAQ,aAAA,EACR,QAAA,GAAW,aAAA,KACV,OAAA;;AAHH;;;;;cAuFa,gCAAA,aACD,WAAA,YACA,aAAA,GAAgB,eAAA,EAE1B,IAAA,EAAM,CAAA,EACN,MAAA,EAAQ,CAAA,EAER,SAAA,EAAW,SAAA,EACX,QAAA,GAAW,aAAA,KAUL,oBAAA,CAAqB,CAAA;AAAA,cAGhB,mCAAA,GACX,UAAA,EAAY,UAAA,EACZ,MAAA,GAAQ,aAAA,EAER,QAAA,GAAW,aAAA"}
1
+ {"version":3,"file":"getFilterTranslationsOnlyContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterTranslationsOnlyContent.ts"],"mappings":";;;;;;;cAqCa,4BAAA,GACX,MAAA,EAAQ,aAAA,EACR,QAAA,GAAW,aAAA,KACV,OAAA;;;AAHH;;;;cAuFa,gCAAA,aACD,WAAA,YACA,aAAA,GAAgB,iBAAA,EAE1B,IAAA,EAAM,CAAA,EACN,MAAA,EAAQ,CAAA,EAER,SAAA,EAAW,SAAA,EACX,QAAA,GAAW,aAAA,KAUL,oBAAA,CAAqB,CAAA;AAAA,cAGhB,mCAAA,GACX,UAAA,EAAY,UAAA,EACZ,MAAA,GAAQ,aAAA,EAER,QAAA,GAAW,aAAA;;;OAAa,kBAAA,CAAA,YAAA"}
@@ -1,4 +1,5 @@
1
1
  import { NodeProps } from "../interpreter/getContent/plugins.js";
2
+ import * as _$_intlayer_types0 from "@intlayer/types";
2
3
  import { ContentNode, Dictionary } from "@intlayer/types/dictionary";
3
4
  import { LocalesValues } from "@intlayer/types/module_augmentation";
4
5
 
@@ -7,12 +8,12 @@ declare const getFilteredLocalesContent: (node: ContentNode, locales: LocalesVal
7
8
  declare const getFilteredLocalesDictionary: (dictionary: Dictionary, locale: LocalesValues | LocalesValues[]) => {
8
9
  content: any;
9
10
  $schema?: "https://intlayer.org/schema.json";
10
- id?: import("@intlayer/types").DictionaryId;
11
+ id?: _$_intlayer_types0.DictionaryId;
11
12
  projectIds?: string[];
12
- localId?: import("@intlayer/types").LocalDictionaryId;
13
- localIds?: import("@intlayer/types").LocalDictionaryId[];
14
- format?: import("@intlayer/types").DictionaryFormat;
15
- key: import("@intlayer/types").DictionaryKey;
13
+ localId?: _$_intlayer_types0.LocalDictionaryId;
14
+ localIds?: _$_intlayer_types0.LocalDictionaryId[];
15
+ format?: _$_intlayer_types0.DictionaryFormat;
16
+ key: _$_intlayer_types0.DictionaryKey;
16
17
  title?: string;
17
18
  description?: string;
18
19
  versions?: string[];
@@ -20,12 +21,12 @@ declare const getFilteredLocalesDictionary: (dictionary: Dictionary, locale: Loc
20
21
  filePath?: string;
21
22
  tags?: string[];
22
23
  locale?: LocalesValues;
23
- contentAutoTransformation?: import("@intlayer/types").ContentAutoTransformation;
24
- fill?: import("@intlayer/types").Fill;
24
+ contentAutoTransformation?: _$_intlayer_types0.ContentAutoTransformation;
25
+ fill?: _$_intlayer_types0.Fill;
25
26
  filled?: true;
26
27
  priority?: number;
27
- importMode?: import("@intlayer/types").ImportMode;
28
- location?: import("@intlayer/types").DictionaryLocation;
28
+ importMode?: _$_intlayer_types0.ImportMode;
29
+ location?: _$_intlayer_types0.DictionaryLocation;
29
30
  schema: undefined;
30
31
  };
31
32
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"getFilteredLocalesContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilteredLocalesContent.ts"],"mappings":";;;;;cAuCa,yBAAA,GACX,IAAA,EAAM,WAAA,EACN,OAAA,EAAS,aAAA,GAAgB,aAAA,IACzB,SAAA,EAAW,SAAA;AAAA,cAwBA,4BAAA,GACX,UAAA,EAAY,UAAA,EACZ,MAAA,EAAQ,aAAA,GAAgB,aAAA"}
1
+ {"version":3,"file":"getFilteredLocalesContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilteredLocalesContent.ts"],"mappings":";;;;;;cAuCa,yBAAA,GACX,IAAA,EAAM,WAAA,EACN,OAAA,EAAS,aAAA,GAAgB,aAAA,IACzB,SAAA,EAAW,SAAA;AAAA,cAwBA,4BAAA,GACX,UAAA,EAAY,UAAA,EACZ,MAAA,EAAQ,aAAA,GAAgB,aAAA;;;OAAa,kBAAA,CAAA,YAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getMaskContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getMaskContent.ts"],"mappings":";;;;;cAYa,eAAA,EAAiB,OAI7B;AAAA,cAEY,cAAA,GAAkB,MAAkB,EAAV,UAAU"}
1
+ {"version":3,"file":"getMaskContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getMaskContent.ts"],"mappings":";;;;;cAYa,eAAA,EAAiB,OAAA;AAAA,cAMjB,cAAA,GAAkB,MAAA,EAAQ,UAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getMultilingualDictionary.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getMultilingualDictionary.ts"],"mappings":";;;;;AAmCA;;;;;;;;AAyEC;;;;;;;;;;;;;;;cAzEY,yBAAA,GACX,UAAA,EAAY,UAAA,KACX,UAuEF"}
1
+ {"version":3,"file":"getMultilingualDictionary.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getMultilingualDictionary.ts"],"mappings":";;;;;AAmCA;;;;;;;;;;;;;;;;;;;;;;;cAAa,yBAAA,GACX,UAAA,EAAY,UAAA,KACX,UAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getReplacedValuesContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getReplacedValuesContent.ts"],"mappings":";;;;cA8Da,wBAAA,GACX,IAAA,EAAM,WAAA,EACN,KAAA,6BACA,SAAA,EAAW,SAAS"}
1
+ {"version":3,"file":"getReplacedValuesContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getReplacedValuesContent.ts"],"mappings":";;;;cA8Da,wBAAA,GACX,IAAA,EAAM,WAAA,EACN,KAAA,6BACA,SAAA,EAAW,SAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getSplittedContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getSplittedContent.ts"],"mappings":";;;;KAIK,qBAAA,KAA0B,WAAA,IAAe,MAAA,CAAO,eAAA,EAAiB,CAAA;EACpE,MAAA,EAAQ,CAAA;AAAA;AAAA,cAsKG,kBAAA,GACX,OAAA,EAAS,WAAA,KACR,qBAiBF;;;;;;;;;;;;;;;;;AAzLU;AAsKX;;;;;;;;AAmBC;AAiCD;;;;;cAAa,4BAAA,GACX,UAAA,EAAY,UAAA,KACX,qBAAA,CAAsB,UAAA"}
1
+ {"version":3,"file":"getSplittedContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getSplittedContent.ts"],"mappings":";;;;KAIK,qBAAA,KAA0B,WAAA,IAAe,MAAA,CAAO,eAAA,EAAiB,CAAA;EACpE,MAAA,EAAQ,CAAA;AAAA;AAAA,cAsKG,kBAAA,GACX,OAAA,EAAS,WAAA,KACR,qBAAA;;;;;;;;;;;;;;;;;;AAFH;;;;;;;;;AAoDA;;;;;cAAa,4BAAA,GACX,UAAA,EAAY,UAAA,KACX,qBAAA,CAAsB,UAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getEmptyNode.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/getEmptyNode.ts"],"mappings":";;;cAIa,YAAA,GAAgB,OAAA,EAAS,WAAA,KAAc,WA2DnD"}
1
+ {"version":3,"file":"getEmptyNode.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/getEmptyNode.ts"],"mappings":";;;cAIa,YAAA,GAAgB,OAAA,EAAS,WAAA,KAAc,WAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getNodeChildren.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/getNodeChildren.ts"],"mappings":";;;cAIa,eAAA,GAAmB,OAAA,EAAS,WAAA,KAAc,WAmDtD"}
1
+ {"version":3,"file":"getNodeChildren.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/getNodeChildren.ts"],"mappings":";;;cAIa,eAAA,GAAmB,OAAA,EAAS,WAAA,KAAc,WAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getNodeType.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/getNodeType.ts"],"mappings":";;;;cA4Ca,WAAA,GAAe,OAAA,EAAS,WAAA,KAAc,QAuClD"}
1
+ {"version":3,"file":"getNodeType.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/getNodeType.ts"],"mappings":";;;;cA4Ca,WAAA,GAAe,OAAA,EAAS,WAAA,KAAc,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"mergeDictionaries.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/mergeDictionaries.ts"],"mappings":";;;cAqKa,iBAAA,GAAqB,YAAA,EAAc,UAAA,OAAe,UA0C9D"}
1
+ {"version":3,"file":"mergeDictionaries.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/mergeDictionaries.ts"],"mappings":";;;cAqKa,iBAAA,GAAqB,YAAA,EAAc,UAAA,OAAe,UAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"orderDictionaries.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/orderDictionaries.ts"],"mappings":";;;;;AAUA;;;;;cAAa,iBAAA,GACX,YAAA,EAAc,UAAA,IACd,MAAA;EACE,MAAA;IACE,0BAAA;EAAA;AAAA,MAGH,UAAU"}
1
+ {"version":3,"file":"orderDictionaries.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/orderDictionaries.ts"],"mappings":";;;;;AAUA;;;;;cAAa,iBAAA,GACX,YAAA,EAAc,UAAA,IACd,MAAA;EACE,MAAA;IACE,0BAAA;EAAA;AAAA,MAGH,UAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"compact.d.ts","names":[],"sources":["../../../src/formatters/compact.ts"],"mappings":";;;;;AAeA;;;;;;;;;cAAa,OAAA,GACX,KAAA,mBACA,OAAA,GAAU,IAAA,CAAK,mBAAA;EAAwB,MAAA,GAAS,aAAa;AAAA"}
1
+ {"version":3,"file":"compact.d.ts","names":[],"sources":["../../../src/formatters/compact.ts"],"mappings":";;;;;AAeA;;;;;;;;;cAAa,OAAA,GACX,KAAA,mBACA,OAAA,GAAU,IAAA,CAAK,mBAAA;EAAwB,MAAA,GAAS,aAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"currency.d.ts","names":[],"sources":["../../../src/formatters/currency.ts"],"mappings":";;;;;AAeA;;;;;;;;;cAAa,QAAA,GACX,KAAA,mBACA,OAAA,GAAU,IAAA,CAAK,mBAAA;EAAwB,MAAA,GAAS,aAAa;AAAA"}
1
+ {"version":3,"file":"currency.d.ts","names":[],"sources":["../../../src/formatters/currency.ts"],"mappings":";;;;;AAeA;;;;;;;;;cAAa,QAAA,GACX,KAAA,mBACA,OAAA,GAAU,IAAA,CAAK,mBAAA;EAAwB,MAAA,GAAS,aAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"date.d.ts","names":[],"sources":["../../../src/formatters/date.ts"],"mappings":";;;KAIY,cAAA;AAAA,cAOC,OAAA,EAAS,MAAA,CAAO,cAAA,EAAgB,IAAA,CAAK,qBAAA;AAPlD;;;;AAA0B;AAO1B;;;;;;AAPA,cAqDa,IAAA,GACX,IAAA,EAAM,IAAA,oBACN,OAAA,IACK,IAAA,CAAK,qBAAA;EAA0B,MAAA,GAAS,aAAA;AAAA,KACzC,cAAA"}
1
+ {"version":3,"file":"date.d.ts","names":[],"sources":["../../../src/formatters/date.ts"],"mappings":";;;KAIY,cAAA;AAAA,cAOC,OAAA,EAAS,MAAA,CAAO,cAAA,EAAgB,IAAA,CAAK,qBAAA;AAPlD;;;;;AAOA;;;;;;AAPA,cAqDa,IAAA,GACX,IAAA,EAAM,IAAA,oBACN,OAAA,IACK,IAAA,CAAK,qBAAA;EAA0B,MAAA,GAAS,aAAA;AAAA,KACzC,cAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","names":[],"sources":["../../../src/formatters/list.ts"],"mappings":";;;;KAKK,iBAAA;EACH,aAAA;EACA,IAAA;EACA,KAAA;AAAA;;;;;AAAK;AAkBP;;;;;;;;;;cAAa,IAAA,GACX,MAAA,uBACA,OAAA,GAAU,iBAAA;EAAsB,MAAA,GAAS,aAAa;AAAA"}
1
+ {"version":3,"file":"list.d.ts","names":[],"sources":["../../../src/formatters/list.ts"],"mappings":";;;;KAKK,iBAAA;EACH,aAAA;EACA,IAAA;EACA,KAAA;AAAA;;;;;;AAkBF;;;;;;;;;;cAAa,IAAA,GACX,MAAA,uBACA,OAAA,GAAU,iBAAA;EAAsB,MAAA,GAAS,aAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"relativeTime.d.ts","names":[],"sources":["../../../src/formatters/relativeTime.ts"],"mappings":";;;KAIK,gBAAA,GAAmB,IAAA,CAAK,sBAAsB;;AAHsB;;;;AAGtB;AAuCnD;;;;cAAa,YAAA,GACX,IAAA,EAAM,IAAA,oBACN,EAAA,GAAI,IAAA,oBACJ,OAAA,GAAU,IAAA,CAAK,yBAAA;EACb,MAAA,GAAS,aAAA;EACT,IAAA,GAAO,gBAAA;AAAA"}
1
+ {"version":3,"file":"relativeTime.d.ts","names":[],"sources":["../../../src/formatters/relativeTime.ts"],"mappings":";;;KAIK,gBAAA,GAAmB,IAAA,CAAK,sBAAA;;AAH4C;;;;;AA0CzE;;;;cAAa,YAAA,GACX,IAAA,EAAM,IAAA,oBACN,EAAA,GAAI,IAAA,oBACJ,OAAA,GAAU,IAAA,CAAK,yBAAA;EACb,MAAA,GAAS,aAAA;EACT,IAAA,GAAO,gBAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"units.d.ts","names":[],"sources":["../../../src/formatters/units.ts"],"mappings":";;;;;AAWA;;;;;cAAa,KAAA,GACX,KAAA,mBACA,OAAA,GAAU,IAAA,CAAK,mBAAA;EAAwB,MAAA,GAAS,aAAa;AAAA"}
1
+ {"version":3,"file":"units.d.ts","names":[],"sources":["../../../src/formatters/units.ts"],"mappings":";;;;;AAWA;;;;;cAAa,KAAA,GACX,KAAA,mBACA,OAAA,GAAU,IAAA,CAAK,mBAAA;EAAwB,MAAA,GAAS,aAAA;AAAA"}