@intlayer/design-system 4.1.6 → 4.1.8

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 (301) hide show
  1. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +6 -2
  2. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
  3. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts.map +1 -1
  4. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +6 -2
  5. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
  6. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +10 -4
  7. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
  8. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
  9. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +10 -4
  10. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  11. package/dist/hooks/intlayerAPIHooks.cjs +2 -2
  12. package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
  13. package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
  14. package/dist/hooks/intlayerAPIHooks.mjs +2 -2
  15. package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
  16. package/package.json +22 -19
  17. package/dist/CodeBlockShiki-BlmZyrr7.cjs +0 -29
  18. package/dist/CodeBlockShiki-BlmZyrr7.cjs.map +0 -1
  19. package/dist/CodeBlockShiki-CcpV9SVi.js +0 -29
  20. package/dist/CodeBlockShiki-CcpV9SVi.js.map +0 -1
  21. package/dist/CopyButton-Cxu3goRg.cjs +0 -59
  22. package/dist/CopyButton-Cxu3goRg.cjs.map +0 -1
  23. package/dist/CopyButton-DlcDlf6U.js +0 -60
  24. package/dist/CopyButton-DlcDlf6U.js.map +0 -1
  25. package/dist/Form-0D7KBafQ.cjs +0 -311
  26. package/dist/Form-0D7KBafQ.cjs.map +0 -1
  27. package/dist/Form-7BqwvjVI.cjs +0 -320
  28. package/dist/Form-7BqwvjVI.cjs.map +0 -1
  29. package/dist/Form-B2UufQRJ.cjs +0 -319
  30. package/dist/Form-B2UufQRJ.cjs.map +0 -1
  31. package/dist/Form-BB0kpER9.cjs +0 -301
  32. package/dist/Form-BB0kpER9.cjs.map +0 -1
  33. package/dist/Form-BDcoNTLV.cjs +0 -300
  34. package/dist/Form-BDcoNTLV.cjs.map +0 -1
  35. package/dist/Form-BTogr-fp.js +0 -312
  36. package/dist/Form-BTogr-fp.js.map +0 -1
  37. package/dist/Form-BVkkvSKP.js +0 -312
  38. package/dist/Form-BVkkvSKP.js.map +0 -1
  39. package/dist/Form-Be6Uhb5-.js +0 -312
  40. package/dist/Form-Be6Uhb5-.js.map +0 -1
  41. package/dist/Form-BmQQnl-6.js +0 -312
  42. package/dist/Form-BmQQnl-6.js.map +0 -1
  43. package/dist/Form-BoWOdiwq.js +0 -321
  44. package/dist/Form-BoWOdiwq.js.map +0 -1
  45. package/dist/Form-Bp_ubH9I.cjs +0 -311
  46. package/dist/Form-Bp_ubH9I.cjs.map +0 -1
  47. package/dist/Form-BtqRbgLu.cjs +0 -311
  48. package/dist/Form-BtqRbgLu.cjs.map +0 -1
  49. package/dist/Form-COVZyto7.cjs +0 -311
  50. package/dist/Form-COVZyto7.cjs.map +0 -1
  51. package/dist/Form-CVD_3nCD.js +0 -312
  52. package/dist/Form-CVD_3nCD.js.map +0 -1
  53. package/dist/Form-Cfklj1_H.js +0 -320
  54. package/dist/Form-Cfklj1_H.js.map +0 -1
  55. package/dist/Form-ClAAiVNm.cjs +0 -311
  56. package/dist/Form-ClAAiVNm.cjs.map +0 -1
  57. package/dist/Form-DGLgTAdY.js +0 -302
  58. package/dist/Form-DGLgTAdY.js.map +0 -1
  59. package/dist/Form-DhsgC7kB.js +0 -301
  60. package/dist/Form-DhsgC7kB.js.map +0 -1
  61. package/dist/Form-Dv0uHqbL.cjs +0 -320
  62. package/dist/Form-Dv0uHqbL.cjs.map +0 -1
  63. package/dist/Form-OK9zfg6E.js +0 -321
  64. package/dist/Form-OK9zfg6E.js.map +0 -1
  65. package/dist/components/ContentEditor/ContentEditorCode.cjs +0 -78
  66. package/dist/components/ContentEditor/ContentEditorCode.cjs.map +0 -1
  67. package/dist/components/ContentEditor/ContentEditorCode.d.ts +0 -11
  68. package/dist/components/ContentEditor/ContentEditorCode.d.ts.map +0 -1
  69. package/dist/components/ContentEditor/ContentEditorCode.mjs +0 -78
  70. package/dist/components/ContentEditor/ContentEditorCode.mjs.map +0 -1
  71. package/dist/components/DictionaryEditor/useEditedContentStore.cjs +0 -490
  72. package/dist/components/DictionaryEditor/useEditedContentStore.cjs.map +0 -1
  73. package/dist/components/DictionaryEditor/useEditedContentStore.d.ts +0 -28
  74. package/dist/components/DictionaryEditor/useEditedContentStore.d.ts.map +0 -1
  75. package/dist/components/DictionaryEditor/useEditedContentStore.mjs +0 -490
  76. package/dist/components/DictionaryEditor/useEditedContentStore.mjs.map +0 -1
  77. package/dist/components/DictionaryEditor/useEditionPanelStore.cjs +0 -15
  78. package/dist/components/DictionaryEditor/useEditionPanelStore.cjs.map +0 -1
  79. package/dist/components/DictionaryEditor/useEditionPanelStore.d.ts +0 -15
  80. package/dist/components/DictionaryEditor/useEditionPanelStore.d.ts.map +0 -1
  81. package/dist/components/DictionaryEditor/useEditionPanelStore.mjs +0 -15
  82. package/dist/components/DictionaryEditor/useEditionPanelStore.mjs.map +0 -1
  83. package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelector.d.ts +0 -8
  84. package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelector.d.ts.map +0 -1
  85. package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelectorContext.d.ts +0 -13
  86. package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelectorContext.d.ts.map +0 -1
  87. package/dist/components/DictionaryFieldEditor/LocaleSelector/localeSelector.content.d.ts +0 -9
  88. package/dist/components/DictionaryFieldEditor/LocaleSelector/localeSelector.content.d.ts.map +0 -1
  89. package/dist/components/DropDown/types.cjs +0 -2
  90. package/dist/components/DropDown/types.cjs.map +0 -1
  91. package/dist/components/DropDown/types.d.ts +0 -19
  92. package/dist/components/DropDown/types.d.ts.map +0 -1
  93. package/dist/components/DropDown/types.mjs +0 -2
  94. package/dist/components/DropDown/types.mjs.map +0 -1
  95. package/dist/components/IDE/CodeBlock.cjs +0 -54
  96. package/dist/components/IDE/CodeBlock.cjs.map +0 -1
  97. package/dist/components/IDE/CodeBlock.d.ts +0 -12
  98. package/dist/components/IDE/CodeBlock.d.ts.map +0 -1
  99. package/dist/components/IDE/CodeBlock.mjs +0 -54
  100. package/dist/components/IDE/CodeBlock.mjs.map +0 -1
  101. package/dist/components/IDE/CodeBlockLoader.cjs +0 -28
  102. package/dist/components/IDE/CodeBlockLoader.cjs.map +0 -1
  103. package/dist/components/IDE/CodeBlockLoader.d.ts +0 -4
  104. package/dist/components/IDE/CodeBlockLoader.d.ts.map +0 -1
  105. package/dist/components/IDE/CodeBlockLoader.mjs +0 -28
  106. package/dist/components/IDE/CodeBlockLoader.mjs.map +0 -1
  107. package/dist/components/IDE/CodeBlockShiki.d.ts +0 -3
  108. package/dist/components/IDE/CodeBlockShiki.d.ts.map +0 -1
  109. package/dist/components/IDE/CodeRender copy.cjs +0 -141
  110. package/dist/components/IDE/CodeRender copy.cjs.map +0 -1
  111. package/dist/components/IDE/CodeRender copy.d.ts +0 -14
  112. package/dist/components/IDE/CodeRender copy.d.ts.map +0 -1
  113. package/dist/components/IDE/CodeRender copy.mjs +0 -141
  114. package/dist/components/IDE/CodeRender copy.mjs.map +0 -1
  115. package/dist/components/IDE/CodeRender.cjs +0 -49
  116. package/dist/components/IDE/CodeRender.cjs.map +0 -1
  117. package/dist/components/IDE/CodeRender.d.ts +0 -9
  118. package/dist/components/IDE/CodeRender.d.ts.map +0 -1
  119. package/dist/components/IDE/CodeRender.mjs +0 -49
  120. package/dist/components/IDE/CodeRender.mjs.map +0 -1
  121. package/dist/components/IDE/CodeRenderer.cjs +0 -27
  122. package/dist/components/IDE/CodeRenderer.cjs.map +0 -1
  123. package/dist/components/IDE/CodeRenderer.d.ts +0 -5
  124. package/dist/components/IDE/CodeRenderer.d.ts.map +0 -1
  125. package/dist/components/IDE/CodeRenderer.mjs +0 -27
  126. package/dist/components/IDE/CodeRenderer.mjs.map +0 -1
  127. package/dist/components/IDE/EditableCodeBlock.d.ts +0 -9
  128. package/dist/components/IDE/EditableCodeBlock.d.ts.map +0 -1
  129. package/dist/components/LocaleSwitcherContentDropDown/LocaleSelectorContext.d.ts +0 -13
  130. package/dist/components/LocaleSwitcherContentDropDown/LocaleSelectorContext.d.ts.map +0 -1
  131. package/dist/design-system.css +0 -235
  132. package/dist/index-Ai6eeqZH.js +0 -702
  133. package/dist/index-Ai6eeqZH.js.map +0 -1
  134. package/dist/index-B-VAyQ9R.js +0 -673
  135. package/dist/index-B-VAyQ9R.js.map +0 -1
  136. package/dist/index-B1nU1-65.cjs +0 -690
  137. package/dist/index-B1nU1-65.cjs.map +0 -1
  138. package/dist/index-B2UElBcQ.cjs +0 -200
  139. package/dist/index-B2UElBcQ.cjs.map +0 -1
  140. package/dist/index-BIV0x_z2.js +0 -206
  141. package/dist/index-BIV0x_z2.js.map +0 -1
  142. package/dist/index-BIyA5LAs.js +0 -691
  143. package/dist/index-BIyA5LAs.js.map +0 -1
  144. package/dist/index-BMzh1_UJ.js +0 -201
  145. package/dist/index-BMzh1_UJ.js.map +0 -1
  146. package/dist/index-BNH9wXVj.cjs +0 -205
  147. package/dist/index-BNH9wXVj.cjs.map +0 -1
  148. package/dist/index-BbqOa6BU.cjs +0 -701
  149. package/dist/index-BbqOa6BU.cjs.map +0 -1
  150. package/dist/index-BdTa-9zc.js +0 -201
  151. package/dist/index-BdTa-9zc.js.map +0 -1
  152. package/dist/index-BqZwP4Lr.js +0 -691
  153. package/dist/index-BqZwP4Lr.js.map +0 -1
  154. package/dist/index-BtZWYJhL.cjs +0 -200
  155. package/dist/index-BtZWYJhL.cjs.map +0 -1
  156. package/dist/index-Buecpjbh.cjs +0 -690
  157. package/dist/index-Buecpjbh.cjs.map +0 -1
  158. package/dist/index-CDEJjmId.js +0 -694
  159. package/dist/index-CDEJjmId.js.map +0 -1
  160. package/dist/index-CTAyk6RY.cjs +0 -693
  161. package/dist/index-CTAyk6RY.cjs.map +0 -1
  162. package/dist/index-CVC2sfEj.js +0 -693
  163. package/dist/index-CVC2sfEj.js.map +0 -1
  164. package/dist/index-CVz0RdK6.js +0 -691
  165. package/dist/index-CVz0RdK6.js.map +0 -1
  166. package/dist/index-CjF2ksU7.cjs +0 -693
  167. package/dist/index-CjF2ksU7.cjs.map +0 -1
  168. package/dist/index-CuQs5759.cjs +0 -692
  169. package/dist/index-CuQs5759.cjs.map +0 -1
  170. package/dist/index-D69JRZcQ.js +0 -206
  171. package/dist/index-D69JRZcQ.js.map +0 -1
  172. package/dist/index-D9oaKvKC.js +0 -201
  173. package/dist/index-D9oaKvKC.js.map +0 -1
  174. package/dist/index-DFc7og1d.cjs +0 -671
  175. package/dist/index-DFc7og1d.cjs.map +0 -1
  176. package/dist/index-DTCehvKe.cjs +0 -200
  177. package/dist/index-DTCehvKe.cjs.map +0 -1
  178. package/dist/index-D_MDocy7.cjs +0 -690
  179. package/dist/index-D_MDocy7.cjs.map +0 -1
  180. package/dist/index-DcWYZrJW.js +0 -672
  181. package/dist/index-DcWYZrJW.js.map +0 -1
  182. package/dist/index-Djo2Jnua.cjs +0 -693
  183. package/dist/index-Djo2Jnua.cjs.map +0 -1
  184. package/dist/index-LFTthFne.js +0 -694
  185. package/dist/index-LFTthFne.js.map +0 -1
  186. package/dist/index-SOIahRpS.cjs +0 -205
  187. package/dist/index-SOIahRpS.cjs.map +0 -1
  188. package/dist/index-T-TjVQoD.js +0 -671
  189. package/dist/index-T-TjVQoD.js.map +0 -1
  190. package/dist/index-f8_VC6c8.cjs +0 -672
  191. package/dist/index-f8_VC6c8.cjs.map +0 -1
  192. package/dist/index-llGIfxqV.cjs +0 -670
  193. package/dist/index-llGIfxqV.cjs.map +0 -1
  194. package/dist/index-xZoGTokf.js +0 -694
  195. package/dist/index-xZoGTokf.js.map +0 -1
  196. package/dist/jsx-runtime-CL03FswV.cjs +0 -506
  197. package/dist/jsx-runtime-CL03FswV.cjs.map +0 -1
  198. package/dist/jsx-runtime-DaNGiM0W.js +0 -945
  199. package/dist/jsx-runtime-DaNGiM0W.js.map +0 -1
  200. package/dist/jsx-runtime-XHKiWCTo.cjs +0 -944
  201. package/dist/jsx-runtime-XHKiWCTo.cjs.map +0 -1
  202. package/dist/jsx-runtime-kmx34TxC.js +0 -507
  203. package/dist/jsx-runtime-kmx34TxC.js.map +0 -1
  204. package/dist/libs/index.cjs +0 -6
  205. package/dist/libs/index.cjs.map +0 -1
  206. package/dist/libs/index.d.ts +0 -2
  207. package/dist/libs/index.d.ts.map +0 -1
  208. package/dist/libs/index.mjs +0 -6
  209. package/dist/libs/index.mjs.map +0 -1
  210. package/dist/libs/intlayer-api/ai.cjs +0 -64
  211. package/dist/libs/intlayer-api/ai.cjs.map +0 -1
  212. package/dist/libs/intlayer-api/ai.d.ts +0 -18
  213. package/dist/libs/intlayer-api/ai.d.ts.map +0 -1
  214. package/dist/libs/intlayer-api/ai.mjs +0 -64
  215. package/dist/libs/intlayer-api/ai.mjs.map +0 -1
  216. package/dist/libs/intlayer-api/auth.cjs +0 -141
  217. package/dist/libs/intlayer-api/auth.cjs.map +0 -1
  218. package/dist/libs/intlayer-api/auth.d.ts +0 -38
  219. package/dist/libs/intlayer-api/auth.d.ts.map +0 -1
  220. package/dist/libs/intlayer-api/auth.mjs +0 -141
  221. package/dist/libs/intlayer-api/auth.mjs.map +0 -1
  222. package/dist/libs/intlayer-api/dictionary.cjs +0 -78
  223. package/dist/libs/intlayer-api/dictionary.cjs.map +0 -1
  224. package/dist/libs/intlayer-api/dictionary.d.ts +0 -22
  225. package/dist/libs/intlayer-api/dictionary.d.ts.map +0 -1
  226. package/dist/libs/intlayer-api/dictionary.mjs +0 -78
  227. package/dist/libs/intlayer-api/dictionary.mjs.map +0 -1
  228. package/dist/libs/intlayer-api/fetcher.cjs +0 -73
  229. package/dist/libs/intlayer-api/fetcher.cjs.map +0 -1
  230. package/dist/libs/intlayer-api/fetcher.d.ts +0 -70
  231. package/dist/libs/intlayer-api/fetcher.d.ts.map +0 -1
  232. package/dist/libs/intlayer-api/fetcher.mjs +0 -73
  233. package/dist/libs/intlayer-api/fetcher.mjs.map +0 -1
  234. package/dist/libs/intlayer-api/index.cjs +0 -24
  235. package/dist/libs/intlayer-api/index.cjs.map +0 -1
  236. package/dist/libs/intlayer-api/index.d.ts +0 -157
  237. package/dist/libs/intlayer-api/index.d.ts.map +0 -1
  238. package/dist/libs/intlayer-api/index.mjs +0 -24
  239. package/dist/libs/intlayer-api/index.mjs.map +0 -1
  240. package/dist/libs/intlayer-api/organization.cjs +0 -96
  241. package/dist/libs/intlayer-api/organization.cjs.map +0 -1
  242. package/dist/libs/intlayer-api/organization.d.ts +0 -26
  243. package/dist/libs/intlayer-api/organization.d.ts.map +0 -1
  244. package/dist/libs/intlayer-api/organization.mjs +0 -96
  245. package/dist/libs/intlayer-api/organization.mjs.map +0 -1
  246. package/dist/libs/intlayer-api/project.cjs +0 -110
  247. package/dist/libs/intlayer-api/project.cjs.map +0 -1
  248. package/dist/libs/intlayer-api/project.d.ts +0 -28
  249. package/dist/libs/intlayer-api/project.d.ts.map +0 -1
  250. package/dist/libs/intlayer-api/project.mjs +0 -110
  251. package/dist/libs/intlayer-api/project.mjs.map +0 -1
  252. package/dist/libs/intlayer-api/stripe.cjs +0 -31
  253. package/dist/libs/intlayer-api/stripe.cjs.map +0 -1
  254. package/dist/libs/intlayer-api/stripe.d.ts +0 -8
  255. package/dist/libs/intlayer-api/stripe.d.ts.map +0 -1
  256. package/dist/libs/intlayer-api/stripe.mjs +0 -31
  257. package/dist/libs/intlayer-api/stripe.mjs.map +0 -1
  258. package/dist/libs/intlayer-api/tag.cjs +0 -52
  259. package/dist/libs/intlayer-api/tag.cjs.map +0 -1
  260. package/dist/libs/intlayer-api/tag.d.ts +0 -16
  261. package/dist/libs/intlayer-api/tag.d.ts.map +0 -1
  262. package/dist/libs/intlayer-api/tag.mjs +0 -52
  263. package/dist/libs/intlayer-api/tag.mjs.map +0 -1
  264. package/dist/libs/intlayer-api/user.cjs +0 -70
  265. package/dist/libs/intlayer-api/user.cjs.map +0 -1
  266. package/dist/libs/intlayer-api/user.d.ts +0 -22
  267. package/dist/libs/intlayer-api/user.d.ts.map +0 -1
  268. package/dist/libs/intlayer-api/user.mjs +0 -70
  269. package/dist/libs/intlayer-api/user.mjs.map +0 -1
  270. package/dist/navigation-CE0LMHcY.cjs +0 -8538
  271. package/dist/navigation-CE0LMHcY.cjs.map +0 -1
  272. package/dist/navigation-DFabQmdZ.js +0 -914
  273. package/dist/navigation-DFabQmdZ.js.map +0 -1
  274. package/dist/navigation-DRtAVQJF.js +0 -8521
  275. package/dist/navigation-DRtAVQJF.js.map +0 -1
  276. package/dist/navigation-a7EfWhxz.cjs +0 -913
  277. package/dist/navigation-a7EfWhxz.cjs.map +0 -1
  278. package/dist/shallow-lhDIFtEp.cjs +0 -48
  279. package/dist/shallow-lhDIFtEp.cjs.map +0 -1
  280. package/dist/shallow-m9BpCkKh.js +0 -49
  281. package/dist/shallow-m9BpCkKh.js.map +0 -1
  282. package/dist/useGetAllDictionaries-B1sqs2IB.cjs +0 -34
  283. package/dist/useGetAllDictionaries-B1sqs2IB.cjs.map +0 -1
  284. package/dist/useGetAllDictionaries-BbH8vTkY.js +0 -35
  285. package/dist/useGetAllDictionaries-BbH8vTkY.js.map +0 -1
  286. package/dist/useGetAllDictionaries-Bgkytpa2.cjs +0 -34
  287. package/dist/useGetAllDictionaries-Bgkytpa2.cjs.map +0 -1
  288. package/dist/useGetAllDictionaries-D8ma3h41.cjs +0 -33
  289. package/dist/useGetAllDictionaries-D8ma3h41.cjs.map +0 -1
  290. package/dist/useGetAllDictionaries-DHgHEbD5.js +0 -34
  291. package/dist/useGetAllDictionaries-DHgHEbD5.js.map +0 -1
  292. package/dist/useGetAllDictionaries-DUzm0rIa.js +0 -35
  293. package/dist/useGetAllDictionaries-DUzm0rIa.js.map +0 -1
  294. package/dist/utils/dictionary.cjs +0 -158
  295. package/dist/utils/dictionary.cjs.map +0 -1
  296. package/dist/utils/dictionary.d.ts +0 -7
  297. package/dist/utils/dictionary.d.ts.map +0 -1
  298. package/dist/utils/dictionary.mjs +0 -158
  299. package/dist/utils/dictionary.mjs.map +0 -1
  300. /package/dist/components/IDE/{CodeBlockclient.d.ts → CodeBlockClient.d.ts} +0 -0
  301. /package/dist/components/IDE/{CodeBlockclient.d.ts.map → CodeBlockClient.d.ts.map} +0 -0
@@ -1,490 +0,0 @@
1
- import { create } from "zustand";
2
- import { getDictionaryValueByKeyPath, editDictionaryByKeyPath, renameDictionaryValueByKeyPath } from "../../utils/dictionary.mjs";
3
- function createJSONStorage(getStorage, options) {
4
- let storage;
5
- try {
6
- storage = getStorage();
7
- } catch (_e) {
8
- return;
9
- }
10
- const persistStorage = {
11
- getItem: (name) => {
12
- var _a;
13
- const parse = (str2) => {
14
- if (str2 === null) {
15
- return null;
16
- }
17
- return JSON.parse(str2, void 0);
18
- };
19
- const str = (_a = storage.getItem(name)) != null ? _a : null;
20
- if (str instanceof Promise) {
21
- return str.then(parse);
22
- }
23
- return parse(str);
24
- },
25
- setItem: (name, newValue) => storage.setItem(
26
- name,
27
- JSON.stringify(newValue, void 0)
28
- ),
29
- removeItem: (name) => storage.removeItem(name)
30
- };
31
- return persistStorage;
32
- }
33
- const toThenable = (fn) => (input) => {
34
- try {
35
- const result = fn(input);
36
- if (result instanceof Promise) {
37
- return result;
38
- }
39
- return {
40
- then(onFulfilled) {
41
- return toThenable(onFulfilled)(result);
42
- },
43
- catch(_onRejected) {
44
- return this;
45
- }
46
- };
47
- } catch (e) {
48
- return {
49
- then(_onFulfilled) {
50
- return this;
51
- },
52
- catch(onRejected) {
53
- return toThenable(onRejected)(e);
54
- }
55
- };
56
- }
57
- };
58
- const oldImpl = (config, baseOptions) => (set, get, api) => {
59
- let options = {
60
- getStorage: () => localStorage,
61
- serialize: JSON.stringify,
62
- deserialize: JSON.parse,
63
- partialize: (state) => state,
64
- version: 0,
65
- merge: (persistedState, currentState) => ({
66
- ...currentState,
67
- ...persistedState
68
- }),
69
- ...baseOptions
70
- };
71
- let hasHydrated = false;
72
- const hydrationListeners = /* @__PURE__ */ new Set();
73
- const finishHydrationListeners = /* @__PURE__ */ new Set();
74
- let storage;
75
- try {
76
- storage = options.getStorage();
77
- } catch (_e) {
78
- }
79
- if (!storage) {
80
- return config(
81
- (...args) => {
82
- console.warn(
83
- `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`
84
- );
85
- set(...args);
86
- },
87
- get,
88
- api
89
- );
90
- }
91
- const thenableSerialize = toThenable(options.serialize);
92
- const setItem = () => {
93
- const state = options.partialize({ ...get() });
94
- let errorInSync;
95
- const thenable = thenableSerialize({ state, version: options.version }).then(
96
- (serializedValue) => storage.setItem(options.name, serializedValue)
97
- ).catch((e) => {
98
- errorInSync = e;
99
- });
100
- if (errorInSync) {
101
- throw errorInSync;
102
- }
103
- return thenable;
104
- };
105
- const savedSetState = api.setState;
106
- api.setState = (state, replace) => {
107
- savedSetState(state, replace);
108
- void setItem();
109
- };
110
- const configResult = config(
111
- (...args) => {
112
- set(...args);
113
- void setItem();
114
- },
115
- get,
116
- api
117
- );
118
- let stateFromStorage;
119
- const hydrate = () => {
120
- var _a;
121
- if (!storage) return;
122
- hasHydrated = false;
123
- hydrationListeners.forEach((cb) => cb(get()));
124
- const postRehydrationCallback = ((_a = options.onRehydrateStorage) == null ? void 0 : _a.call(options, get())) || void 0;
125
- return toThenable(storage.getItem.bind(storage))(options.name).then((storageValue) => {
126
- if (storageValue) {
127
- return options.deserialize(storageValue);
128
- }
129
- }).then((deserializedStorageValue) => {
130
- if (deserializedStorageValue) {
131
- if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) {
132
- if (options.migrate) {
133
- return options.migrate(
134
- deserializedStorageValue.state,
135
- deserializedStorageValue.version
136
- );
137
- }
138
- console.error(
139
- `State loaded from storage couldn't be migrated since no migrate function was provided`
140
- );
141
- } else {
142
- return deserializedStorageValue.state;
143
- }
144
- }
145
- }).then((migratedState) => {
146
- var _a2;
147
- stateFromStorage = options.merge(
148
- migratedState,
149
- (_a2 = get()) != null ? _a2 : configResult
150
- );
151
- set(stateFromStorage, true);
152
- return setItem();
153
- }).then(() => {
154
- postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);
155
- hasHydrated = true;
156
- finishHydrationListeners.forEach((cb) => cb(stateFromStorage));
157
- }).catch((e) => {
158
- postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);
159
- });
160
- };
161
- api.persist = {
162
- setOptions: (newOptions) => {
163
- options = {
164
- ...options,
165
- ...newOptions
166
- };
167
- if (newOptions.getStorage) {
168
- storage = newOptions.getStorage();
169
- }
170
- },
171
- clearStorage: () => {
172
- storage == null ? void 0 : storage.removeItem(options.name);
173
- },
174
- getOptions: () => options,
175
- rehydrate: () => hydrate(),
176
- hasHydrated: () => hasHydrated,
177
- onHydrate: (cb) => {
178
- hydrationListeners.add(cb);
179
- return () => {
180
- hydrationListeners.delete(cb);
181
- };
182
- },
183
- onFinishHydration: (cb) => {
184
- finishHydrationListeners.add(cb);
185
- return () => {
186
- finishHydrationListeners.delete(cb);
187
- };
188
- }
189
- };
190
- hydrate();
191
- return stateFromStorage || configResult;
192
- };
193
- const newImpl = (config, baseOptions) => (set, get, api) => {
194
- let options = {
195
- storage: createJSONStorage(() => localStorage),
196
- partialize: (state) => state,
197
- version: 0,
198
- merge: (persistedState, currentState) => ({
199
- ...currentState,
200
- ...persistedState
201
- }),
202
- ...baseOptions
203
- };
204
- let hasHydrated = false;
205
- const hydrationListeners = /* @__PURE__ */ new Set();
206
- const finishHydrationListeners = /* @__PURE__ */ new Set();
207
- let storage = options.storage;
208
- if (!storage) {
209
- return config(
210
- (...args) => {
211
- console.warn(
212
- `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`
213
- );
214
- set(...args);
215
- },
216
- get,
217
- api
218
- );
219
- }
220
- const setItem = () => {
221
- const state = options.partialize({ ...get() });
222
- return storage.setItem(options.name, {
223
- state,
224
- version: options.version
225
- });
226
- };
227
- const savedSetState = api.setState;
228
- api.setState = (state, replace) => {
229
- savedSetState(state, replace);
230
- void setItem();
231
- };
232
- const configResult = config(
233
- (...args) => {
234
- set(...args);
235
- void setItem();
236
- },
237
- get,
238
- api
239
- );
240
- api.getInitialState = () => configResult;
241
- let stateFromStorage;
242
- const hydrate = () => {
243
- var _a, _b;
244
- if (!storage) return;
245
- hasHydrated = false;
246
- hydrationListeners.forEach((cb) => {
247
- var _a2;
248
- return cb((_a2 = get()) != null ? _a2 : configResult);
249
- });
250
- const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;
251
- return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {
252
- if (deserializedStorageValue) {
253
- if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) {
254
- if (options.migrate) {
255
- return [
256
- true,
257
- options.migrate(
258
- deserializedStorageValue.state,
259
- deserializedStorageValue.version
260
- )
261
- ];
262
- }
263
- console.error(
264
- `State loaded from storage couldn't be migrated since no migrate function was provided`
265
- );
266
- } else {
267
- return [false, deserializedStorageValue.state];
268
- }
269
- }
270
- return [false, void 0];
271
- }).then((migrationResult) => {
272
- var _a2;
273
- const [migrated, migratedState] = migrationResult;
274
- stateFromStorage = options.merge(
275
- migratedState,
276
- (_a2 = get()) != null ? _a2 : configResult
277
- );
278
- set(stateFromStorage, true);
279
- if (migrated) {
280
- return setItem();
281
- }
282
- }).then(() => {
283
- postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);
284
- stateFromStorage = get();
285
- hasHydrated = true;
286
- finishHydrationListeners.forEach((cb) => cb(stateFromStorage));
287
- }).catch((e) => {
288
- postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);
289
- });
290
- };
291
- api.persist = {
292
- setOptions: (newOptions) => {
293
- options = {
294
- ...options,
295
- ...newOptions
296
- };
297
- if (newOptions.storage) {
298
- storage = newOptions.storage;
299
- }
300
- },
301
- clearStorage: () => {
302
- storage == null ? void 0 : storage.removeItem(options.name);
303
- },
304
- getOptions: () => options,
305
- rehydrate: () => hydrate(),
306
- hasHydrated: () => hasHydrated,
307
- onHydrate: (cb) => {
308
- hydrationListeners.add(cb);
309
- return () => {
310
- hydrationListeners.delete(cb);
311
- };
312
- },
313
- onFinishHydration: (cb) => {
314
- finishHydrationListeners.add(cb);
315
- return () => {
316
- finishHydrationListeners.delete(cb);
317
- };
318
- }
319
- };
320
- if (!options.skipHydration) {
321
- hydrate();
322
- }
323
- return stateFromStorage || configResult;
324
- };
325
- const persistImpl = (config, baseOptions) => {
326
- if ("getStorage" in baseOptions || "serialize" in baseOptions || "deserialize" in baseOptions) {
327
- return oldImpl(config, baseOptions);
328
- }
329
- return newImpl(config, baseOptions);
330
- };
331
- const persist = persistImpl;
332
- const useEditedContentStore = create(
333
- persist(
334
- (set, get) => ({
335
- dictionariesRecord: {},
336
- editedContent: {},
337
- setDictionariesRecord: (dictionariesRecord) => set((state) => ({
338
- dictionariesRecord: {
339
- ...state.dictionariesRecord,
340
- ...dictionariesRecord
341
- }
342
- })),
343
- setEditedContent: (dictionaryKey, newValue) => set((state) => ({
344
- editedContent: {
345
- ...state.editedContent,
346
- [dictionaryKey]: {
347
- ...state.editedContent[dictionaryKey],
348
- content: newValue
349
- }
350
- }
351
- })),
352
- addEditedContent: (dictionaryKey, newValue, keyPath = [], overwrite = true) => set((state) => {
353
- const dictionaryContent = state.editedContent[dictionaryKey]?.content ?? JSON.parse(
354
- JSON.stringify(state.dictionariesRecord[dictionaryKey].content)
355
- );
356
- let newKeyPath = keyPath;
357
- if (!overwrite) {
358
- let isKeyExist = false;
359
- let index = 0;
360
- const otherKeyPath = keyPath.slice(0, -1);
361
- const lastKeyPath = keyPath[keyPath.length - 1];
362
- let finalKey = lastKeyPath.key;
363
- while (!isKeyExist) {
364
- const content = getDictionaryValueByKeyPath(
365
- dictionaryContent,
366
- newKeyPath
367
- );
368
- if (typeof content === "undefined") {
369
- isKeyExist = true;
370
- } else {
371
- index++;
372
- finalKey = index === 0 ? lastKeyPath.key : `${lastKeyPath.key} (${index})`;
373
- newKeyPath = [
374
- ...otherKeyPath,
375
- { ...lastKeyPath, key: finalKey }
376
- ];
377
- }
378
- }
379
- }
380
- const editedContent = editDictionaryByKeyPath(
381
- dictionaryContent,
382
- newKeyPath,
383
- newValue
384
- );
385
- return {
386
- editedContent: {
387
- ...state.editedContent,
388
- [dictionaryKey]: {
389
- ...state.editedContent[dictionaryKey],
390
- content: editedContent
391
- }
392
- }
393
- };
394
- }),
395
- renameEditedContent: (dictionaryKey, newKey, keyPath = []) => {
396
- set((state) => {
397
- const initialDictionaryContent = JSON.parse(
398
- JSON.stringify(state.dictionariesRecord[dictionaryKey].content)
399
- );
400
- const dictionaryContent = state.editedContent[dictionaryKey]?.content ?? initialDictionaryContent;
401
- const contentWithNewField = renameDictionaryValueByKeyPath(
402
- dictionaryContent,
403
- newKey,
404
- keyPath
405
- );
406
- return {
407
- editedContent: {
408
- ...state.editedContent,
409
- [dictionaryKey]: {
410
- ...state.editedContent[dictionaryKey],
411
- content: contentWithNewField
412
- }
413
- }
414
- };
415
- });
416
- },
417
- removeEditedContent: (dictionaryKey, keyPath) => {
418
- set((state) => {
419
- const initialDictionaryContent = JSON.parse(
420
- JSON.stringify(state.dictionariesRecord[dictionaryKey].content)
421
- );
422
- const editedDictionaryContent = state.editedContent[dictionaryKey]?.content ?? initialDictionaryContent;
423
- const initialContent = getDictionaryValueByKeyPath(
424
- initialDictionaryContent,
425
- keyPath
426
- );
427
- const restoredContent = editDictionaryByKeyPath(
428
- editedDictionaryContent,
429
- keyPath,
430
- initialContent
431
- );
432
- return {
433
- editedContent: {
434
- ...state.editedContent,
435
- [dictionaryKey]: {
436
- ...state.editedContent[dictionaryKey],
437
- content: restoredContent
438
- }
439
- }
440
- };
441
- });
442
- },
443
- restoreEditedContent: (dictionaryKey) => {
444
- set((state) => {
445
- const updatedEditedContent = { ...state.editedContent };
446
- delete updatedEditedContent[dictionaryKey];
447
- return {
448
- editedContent: updatedEditedContent
449
- };
450
- });
451
- },
452
- clearEditedDictionaryContent: (dictionaryKey) => {
453
- set((state) => {
454
- const filteredEditedContent = Object.entries(
455
- state.editedContent
456
- ).reduce((acc, [path, content]) => {
457
- if (path === dictionaryKey) {
458
- return acc;
459
- }
460
- return {
461
- ...acc,
462
- [path]: content
463
- };
464
- }, {});
465
- return {
466
- editedContent: filteredEditedContent
467
- };
468
- });
469
- },
470
- clearEditedContent: () => {
471
- set({ editedContent: {} });
472
- },
473
- getEditedContentValue: (dictionaryKey, keyPath) => getDictionaryValueByKeyPath(
474
- get().editedContent[dictionaryKey]?.content ?? {},
475
- keyPath
476
- )
477
- }),
478
- {
479
- name: "edited-content-store",
480
- storage: createJSONStorage(() => sessionStorage)
481
- }
482
- )
483
- );
484
- export {
485
- editDictionaryByKeyPath,
486
- getDictionaryValueByKeyPath,
487
- renameDictionaryValueByKeyPath,
488
- useEditedContentStore
489
- };
490
- //# sourceMappingURL=useEditedContentStore.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEditedContentStore.mjs","sources":["../../../../../../node_modules/.pnpm/zustand@4.5.6_@types+react@18.3.18_immer@9.0.21_react@18.3.1/node_modules/zustand/esm/middleware.mjs","../../../src/components/DictionaryEditor/useEditedContentStore.ts"],"sourcesContent":["const reduxImpl = (reducer, initial) => (set, _get, api) => {\n api.dispatch = (action) => {\n set((state) => reducer(state, action), false, action);\n return action;\n };\n api.dispatchFromDevtools = true;\n return { dispatch: (...a) => api.dispatch(...a), ...initial };\n};\nconst redux = reduxImpl;\n\nconst trackedConnections = /* @__PURE__ */ new Map();\nconst getTrackedConnectionState = (name) => {\n const api = trackedConnections.get(name);\n if (!api) return {};\n return Object.fromEntries(\n Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])\n );\n};\nconst extractConnectionInformation = (store, extensionConnector, options) => {\n if (store === void 0) {\n return {\n type: \"untracked\",\n connection: extensionConnector.connect(options)\n };\n }\n const existingConnection = trackedConnections.get(options.name);\n if (existingConnection) {\n return { type: \"tracked\", store, ...existingConnection };\n }\n const newConnection = {\n connection: extensionConnector.connect(options),\n stores: {}\n };\n trackedConnections.set(options.name, newConnection);\n return { type: \"tracked\", store, ...newConnection };\n};\nconst devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => {\n const { enabled, anonymousActionType, store, ...options } = devtoolsOptions;\n let extensionConnector;\n try {\n extensionConnector = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") && window.__REDUX_DEVTOOLS_EXTENSION__;\n } catch (_e) {\n }\n if (!extensionConnector) {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && enabled) {\n console.warn(\n \"[zustand devtools middleware] Please install/enable Redux devtools extension\"\n );\n }\n return fn(set, get, api);\n }\n const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options);\n let isRecording = true;\n api.setState = (state, replace, nameOrAction) => {\n const r = set(state, replace);\n if (!isRecording) return r;\n const action = nameOrAction === void 0 ? { type: anonymousActionType || \"anonymous\" } : typeof nameOrAction === \"string\" ? { type: nameOrAction } : nameOrAction;\n if (store === void 0) {\n connection == null ? void 0 : connection.send(action, get());\n return r;\n }\n connection == null ? void 0 : connection.send(\n {\n ...action,\n type: `${store}/${action.type}`\n },\n {\n ...getTrackedConnectionState(options.name),\n [store]: api.getState()\n }\n );\n return r;\n };\n const setStateFromDevtools = (...a) => {\n const originalIsRecording = isRecording;\n isRecording = false;\n set(...a);\n isRecording = originalIsRecording;\n };\n const initialState = fn(api.setState, get, api);\n if (connectionInformation.type === \"untracked\") {\n connection == null ? void 0 : connection.init(initialState);\n } else {\n connectionInformation.stores[connectionInformation.store] = api;\n connection == null ? void 0 : connection.init(\n Object.fromEntries(\n Object.entries(connectionInformation.stores).map(([key, store2]) => [\n key,\n key === connectionInformation.store ? initialState : store2.getState()\n ])\n )\n );\n }\n if (api.dispatchFromDevtools && typeof api.dispatch === \"function\") {\n let didWarnAboutReservedActionType = false;\n const originalDispatch = api.dispatch;\n api.dispatch = (...a) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && a[0].type === \"__setState\" && !didWarnAboutReservedActionType) {\n console.warn(\n '[zustand devtools middleware] \"__setState\" action type is reserved to set state from the devtools. Avoid using it.'\n );\n didWarnAboutReservedActionType = true;\n }\n originalDispatch(...a);\n };\n }\n connection.subscribe((message) => {\n var _a;\n switch (message.type) {\n case \"ACTION\":\n if (typeof message.payload !== \"string\") {\n console.error(\n \"[zustand devtools middleware] Unsupported action format\"\n );\n return;\n }\n return parseJsonThen(\n message.payload,\n (action) => {\n if (action.type === \"__setState\") {\n if (store === void 0) {\n setStateFromDevtools(action.state);\n return;\n }\n if (Object.keys(action.state).length !== 1) {\n console.error(\n `\n [zustand devtools middleware] Unsupported __setState action format. \n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n `\n );\n }\n const stateFromDevtools = action.state[store];\n if (stateFromDevtools === void 0 || stateFromDevtools === null) {\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {\n setStateFromDevtools(stateFromDevtools);\n }\n return;\n }\n if (!api.dispatchFromDevtools) return;\n if (typeof api.dispatch !== \"function\") return;\n api.dispatch(action);\n }\n );\n case \"DISPATCH\":\n switch (message.payload.type) {\n case \"RESET\":\n setStateFromDevtools(initialState);\n if (store === void 0) {\n return connection == null ? void 0 : connection.init(api.getState());\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"COMMIT\":\n if (store === void 0) {\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"ROLLBACK\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n setStateFromDevtools(state[store]);\n connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n });\n case \"JUMP_TO_STATE\":\n case \"JUMP_TO_ACTION\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) {\n setStateFromDevtools(state[store]);\n }\n });\n case \"IMPORT_STATE\": {\n const { nextLiftedState } = message.payload;\n const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a.state;\n if (!lastComputedState) return;\n if (store === void 0) {\n setStateFromDevtools(lastComputedState);\n } else {\n setStateFromDevtools(lastComputedState[store]);\n }\n connection == null ? void 0 : connection.send(\n null,\n // FIXME no-any\n nextLiftedState\n );\n return;\n }\n case \"PAUSE_RECORDING\":\n return isRecording = !isRecording;\n }\n return;\n }\n });\n return initialState;\n};\nconst devtools = devtoolsImpl;\nconst parseJsonThen = (stringified, f) => {\n let parsed;\n try {\n parsed = JSON.parse(stringified);\n } catch (e) {\n console.error(\n \"[zustand devtools middleware] Could not parse the received json\",\n e\n );\n }\n if (parsed !== void 0) f(parsed);\n};\n\nconst subscribeWithSelectorImpl = (fn) => (set, get, api) => {\n const origSubscribe = api.subscribe;\n api.subscribe = (selector, optListener, options) => {\n let listener = selector;\n if (optListener) {\n const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;\n let currentSlice = selector(api.getState());\n listener = (state) => {\n const nextSlice = selector(state);\n if (!equalityFn(currentSlice, nextSlice)) {\n const previousSlice = currentSlice;\n optListener(currentSlice = nextSlice, previousSlice);\n }\n };\n if (options == null ? void 0 : options.fireImmediately) {\n optListener(currentSlice, currentSlice);\n }\n }\n return origSubscribe(listener);\n };\n const initialState = fn(set, get, api);\n return initialState;\n};\nconst subscribeWithSelector = subscribeWithSelectorImpl;\n\nconst combine = (initialState, create) => (...a) => Object.assign({}, initialState, create(...a));\n\nfunction createJSONStorage(getStorage, options) {\n let storage;\n try {\n storage = getStorage();\n } catch (_e) {\n return;\n }\n const persistStorage = {\n getItem: (name) => {\n var _a;\n const parse = (str2) => {\n if (str2 === null) {\n return null;\n }\n return JSON.parse(str2, options == null ? void 0 : options.reviver);\n };\n const str = (_a = storage.getItem(name)) != null ? _a : null;\n if (str instanceof Promise) {\n return str.then(parse);\n }\n return parse(str);\n },\n setItem: (name, newValue) => storage.setItem(\n name,\n JSON.stringify(newValue, options == null ? void 0 : options.replacer)\n ),\n removeItem: (name) => storage.removeItem(name)\n };\n return persistStorage;\n}\nconst toThenable = (fn) => (input) => {\n try {\n const result = fn(input);\n if (result instanceof Promise) {\n return result;\n }\n return {\n then(onFulfilled) {\n return toThenable(onFulfilled)(result);\n },\n catch(_onRejected) {\n return this;\n }\n };\n } catch (e) {\n return {\n then(_onFulfilled) {\n return this;\n },\n catch(onRejected) {\n return toThenable(onRejected)(e);\n }\n };\n }\n};\nconst oldImpl = (config, baseOptions) => (set, get, api) => {\n let options = {\n getStorage: () => localStorage,\n serialize: JSON.stringify,\n deserialize: JSON.parse,\n partialize: (state) => state,\n version: 0,\n merge: (persistedState, currentState) => ({\n ...currentState,\n ...persistedState\n }),\n ...baseOptions\n };\n let hasHydrated = false;\n const hydrationListeners = /* @__PURE__ */ new Set();\n const finishHydrationListeners = /* @__PURE__ */ new Set();\n let storage;\n try {\n storage = options.getStorage();\n } catch (_e) {\n }\n if (!storage) {\n return config(\n (...args) => {\n console.warn(\n `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`\n );\n set(...args);\n },\n get,\n api\n );\n }\n const thenableSerialize = toThenable(options.serialize);\n const setItem = () => {\n const state = options.partialize({ ...get() });\n let errorInSync;\n const thenable = thenableSerialize({ state, version: options.version }).then(\n (serializedValue) => storage.setItem(options.name, serializedValue)\n ).catch((e) => {\n errorInSync = e;\n });\n if (errorInSync) {\n throw errorInSync;\n }\n return thenable;\n };\n const savedSetState = api.setState;\n api.setState = (state, replace) => {\n savedSetState(state, replace);\n void setItem();\n };\n const configResult = config(\n (...args) => {\n set(...args);\n void setItem();\n },\n get,\n api\n );\n let stateFromStorage;\n const hydrate = () => {\n var _a;\n if (!storage) return;\n hasHydrated = false;\n hydrationListeners.forEach((cb) => cb(get()));\n const postRehydrationCallback = ((_a = options.onRehydrateStorage) == null ? void 0 : _a.call(options, get())) || void 0;\n return toThenable(storage.getItem.bind(storage))(options.name).then((storageValue) => {\n if (storageValue) {\n return options.deserialize(storageValue);\n }\n }).then((deserializedStorageValue) => {\n if (deserializedStorageValue) {\n if (typeof deserializedStorageValue.version === \"number\" && deserializedStorageValue.version !== options.version) {\n if (options.migrate) {\n return options.migrate(\n deserializedStorageValue.state,\n deserializedStorageValue.version\n );\n }\n console.error(\n `State loaded from storage couldn't be migrated since no migrate function was provided`\n );\n } else {\n return deserializedStorageValue.state;\n }\n }\n }).then((migratedState) => {\n var _a2;\n stateFromStorage = options.merge(\n migratedState,\n (_a2 = get()) != null ? _a2 : configResult\n );\n set(stateFromStorage, true);\n return setItem();\n }).then(() => {\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);\n hasHydrated = true;\n finishHydrationListeners.forEach((cb) => cb(stateFromStorage));\n }).catch((e) => {\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);\n });\n };\n api.persist = {\n setOptions: (newOptions) => {\n options = {\n ...options,\n ...newOptions\n };\n if (newOptions.getStorage) {\n storage = newOptions.getStorage();\n }\n },\n clearStorage: () => {\n storage == null ? void 0 : storage.removeItem(options.name);\n },\n getOptions: () => options,\n rehydrate: () => hydrate(),\n hasHydrated: () => hasHydrated,\n onHydrate: (cb) => {\n hydrationListeners.add(cb);\n return () => {\n hydrationListeners.delete(cb);\n };\n },\n onFinishHydration: (cb) => {\n finishHydrationListeners.add(cb);\n return () => {\n finishHydrationListeners.delete(cb);\n };\n }\n };\n hydrate();\n return stateFromStorage || configResult;\n};\nconst newImpl = (config, baseOptions) => (set, get, api) => {\n let options = {\n storage: createJSONStorage(() => localStorage),\n partialize: (state) => state,\n version: 0,\n merge: (persistedState, currentState) => ({\n ...currentState,\n ...persistedState\n }),\n ...baseOptions\n };\n let hasHydrated = false;\n const hydrationListeners = /* @__PURE__ */ new Set();\n const finishHydrationListeners = /* @__PURE__ */ new Set();\n let storage = options.storage;\n if (!storage) {\n return config(\n (...args) => {\n console.warn(\n `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`\n );\n set(...args);\n },\n get,\n api\n );\n }\n const setItem = () => {\n const state = options.partialize({ ...get() });\n return storage.setItem(options.name, {\n state,\n version: options.version\n });\n };\n const savedSetState = api.setState;\n api.setState = (state, replace) => {\n savedSetState(state, replace);\n void setItem();\n };\n const configResult = config(\n (...args) => {\n set(...args);\n void setItem();\n },\n get,\n api\n );\n api.getInitialState = () => configResult;\n let stateFromStorage;\n const hydrate = () => {\n var _a, _b;\n if (!storage) return;\n hasHydrated = false;\n hydrationListeners.forEach((cb) => {\n var _a2;\n return cb((_a2 = get()) != null ? _a2 : configResult);\n });\n const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;\n return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {\n if (deserializedStorageValue) {\n if (typeof deserializedStorageValue.version === \"number\" && deserializedStorageValue.version !== options.version) {\n if (options.migrate) {\n return [\n true,\n options.migrate(\n deserializedStorageValue.state,\n deserializedStorageValue.version\n )\n ];\n }\n console.error(\n `State loaded from storage couldn't be migrated since no migrate function was provided`\n );\n } else {\n return [false, deserializedStorageValue.state];\n }\n }\n return [false, void 0];\n }).then((migrationResult) => {\n var _a2;\n const [migrated, migratedState] = migrationResult;\n stateFromStorage = options.merge(\n migratedState,\n (_a2 = get()) != null ? _a2 : configResult\n );\n set(stateFromStorage, true);\n if (migrated) {\n return setItem();\n }\n }).then(() => {\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);\n stateFromStorage = get();\n hasHydrated = true;\n finishHydrationListeners.forEach((cb) => cb(stateFromStorage));\n }).catch((e) => {\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);\n });\n };\n api.persist = {\n setOptions: (newOptions) => {\n options = {\n ...options,\n ...newOptions\n };\n if (newOptions.storage) {\n storage = newOptions.storage;\n }\n },\n clearStorage: () => {\n storage == null ? void 0 : storage.removeItem(options.name);\n },\n getOptions: () => options,\n rehydrate: () => hydrate(),\n hasHydrated: () => hasHydrated,\n onHydrate: (cb) => {\n hydrationListeners.add(cb);\n return () => {\n hydrationListeners.delete(cb);\n };\n },\n onFinishHydration: (cb) => {\n finishHydrationListeners.add(cb);\n return () => {\n finishHydrationListeners.delete(cb);\n };\n }\n };\n if (!options.skipHydration) {\n hydrate();\n }\n return stateFromStorage || configResult;\n};\nconst persistImpl = (config, baseOptions) => {\n if (\"getStorage\" in baseOptions || \"serialize\" in baseOptions || \"deserialize\" in baseOptions) {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n console.warn(\n \"[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead.\"\n );\n }\n return oldImpl(config, baseOptions);\n }\n return newImpl(config, baseOptions);\n};\nconst persist = persistImpl;\n\nexport { combine, createJSONStorage, devtools, persist, redux, subscribeWithSelector };\n","import type { Dictionary, DictionaryValue, KeyPath } from '@intlayer/core';\nimport { create } from 'zustand';\nimport { persist, createJSONStorage } from 'zustand/middleware';\nimport {\n editDictionaryByKeyPath,\n getDictionaryValueByKeyPath,\n renameDictionaryValueByKeyPath,\n} from '../../utils/dictionary';\n\nexport {\n editDictionaryByKeyPath,\n getDictionaryValueByKeyPath,\n renameDictionaryValueByKeyPath,\n} from '../../utils/dictionary';\n\nexport type DictionaryContent = Record<Dictionary['key'], Dictionary>;\n\ntype EditedContentStore = {\n dictionariesRecord: DictionaryContent;\n editedContent: DictionaryContent;\n setDictionariesRecord: (\n dictionariesRecord: Record<Dictionary['key'], Dictionary>\n ) => void;\n setEditedContent: (\n dictionaryKey: Dictionary['key'],\n newValue: DictionaryValue\n ) => void;\n addEditedContent: (\n dictionaryKey: Dictionary['key'],\n newValue: DictionaryValue,\n keyPath?: KeyPath[],\n overwrite?: boolean\n ) => void;\n renameEditedContent: (\n dictionaryKey: Dictionary['key'],\n newKey: KeyPath['key'],\n keyPath?: KeyPath[]\n ) => void;\n removeEditedContent: (\n dictionaryKey: Dictionary['key'],\n keyPath: KeyPath[]\n ) => void;\n restoreEditedContent: (dictionaryKey: Dictionary['key']) => void;\n clearEditedDictionaryContent: (dictionaryKey: Dictionary['key']) => void;\n clearEditedContent: () => void;\n getEditedContentValue: (\n dictionaryKey: Dictionary['key'],\n keyPath: KeyPath[]\n ) => DictionaryValue | undefined;\n};\n\nexport const useEditedContentStore = create(\n persist<EditedContentStore>(\n (set, get) => ({\n dictionariesRecord: {},\n editedContent: {},\n setDictionariesRecord: (dictionariesRecord) =>\n set((state) => ({\n dictionariesRecord: {\n ...state.dictionariesRecord,\n ...dictionariesRecord,\n },\n })),\n\n setEditedContent: (dictionaryKey, newValue) =>\n set((state) => ({\n editedContent: {\n ...state.editedContent,\n [dictionaryKey]: {\n ...state.editedContent[dictionaryKey],\n content: newValue,\n },\n },\n })),\n addEditedContent: (\n dictionaryKey,\n newValue,\n keyPath = [],\n overwrite = true\n ) =>\n set((state) => {\n const dictionaryContent =\n state.editedContent[dictionaryKey]?.content ??\n JSON.parse(\n JSON.stringify(state.dictionariesRecord[dictionaryKey].content)\n );\n\n let newKeyPath: KeyPath[] = keyPath;\n\n if (!overwrite) {\n // Check if the key already exists, and increment the key if it does\n\n let isKeyExist = false;\n let index = 0;\n const otherKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n let finalKey = lastKeyPath.key;\n\n while (!isKeyExist) {\n const content = getDictionaryValueByKeyPath(\n dictionaryContent,\n newKeyPath\n );\n\n if (typeof content === 'undefined') {\n isKeyExist = true;\n } else {\n index++;\n finalKey =\n index === 0\n ? lastKeyPath.key\n : `${lastKeyPath.key} (${index})`;\n\n newKeyPath = [\n ...otherKeyPath,\n { ...lastKeyPath, key: finalKey } as KeyPath,\n ];\n }\n }\n }\n\n const editedContent = editDictionaryByKeyPath(\n dictionaryContent,\n newKeyPath,\n newValue\n );\n\n return {\n editedContent: {\n ...state.editedContent,\n [dictionaryKey]: {\n ...state.editedContent[dictionaryKey],\n content: editedContent,\n },\n },\n };\n }),\n renameEditedContent: (dictionaryKey, newKey, keyPath = []) => {\n set((state) => {\n const initialDictionaryContent = JSON.parse(\n JSON.stringify(state.dictionariesRecord[dictionaryKey].content)\n );\n\n const dictionaryContent =\n state.editedContent[dictionaryKey]?.content ??\n initialDictionaryContent;\n\n // Add the new field\n const contentWithNewField = renameDictionaryValueByKeyPath(\n dictionaryContent,\n newKey,\n keyPath\n );\n\n return {\n editedContent: {\n ...state.editedContent,\n [dictionaryKey]: {\n ...state.editedContent[dictionaryKey],\n content: contentWithNewField,\n },\n },\n };\n });\n },\n removeEditedContent: (dictionaryKey, keyPath) => {\n set((state) => {\n const initialDictionaryContent = JSON.parse(\n JSON.stringify(state.dictionariesRecord[dictionaryKey].content)\n );\n\n const editedDictionaryContent =\n state.editedContent[dictionaryKey]?.content ??\n initialDictionaryContent;\n\n const initialContent = getDictionaryValueByKeyPath(\n initialDictionaryContent,\n keyPath\n );\n\n const restoredContent = editDictionaryByKeyPath(\n editedDictionaryContent,\n keyPath,\n initialContent\n );\n\n return {\n editedContent: {\n ...state.editedContent,\n [dictionaryKey]: {\n ...state.editedContent[dictionaryKey],\n content: restoredContent,\n },\n },\n };\n });\n },\n\n restoreEditedContent: (dictionaryKey) => {\n set((state) => {\n const updatedEditedContent = { ...state.editedContent };\n delete updatedEditedContent[dictionaryKey];\n\n return {\n editedContent: updatedEditedContent,\n };\n });\n },\n\n clearEditedDictionaryContent: (dictionaryKey) => {\n set((state) => {\n const filteredEditedContent = Object.entries(\n state.editedContent\n ).reduce((acc, [path, content]) => {\n if (path === dictionaryKey) {\n return acc;\n }\n\n return {\n ...acc,\n [path]: content,\n };\n }, {});\n\n return {\n editedContent: filteredEditedContent,\n };\n });\n },\n\n clearEditedContent: () => {\n set({ editedContent: {} });\n },\n\n getEditedContentValue: (dictionaryKey, keyPath) =>\n getDictionaryValueByKeyPath(\n get().editedContent[dictionaryKey]?.content ?? {},\n keyPath\n ),\n }),\n {\n name: 'edited-content-store',\n storage: createJSONStorage(() => sessionStorage),\n }\n )\n);\n"],"names":[],"mappings":";;AAuPA,SAAS,kBAAkB,YAAY,SAAS;AAC1C,MAAA;AACA,MAAA;AACF,cAAU,WAAW;AAAA,WACd,IAAI;AACX;AAAA,EAAA;AAEF,QAAM,iBAAiB;AAAA,IACrB,SAAS,CAAC,SAAS;AACb,UAAA;AACE,YAAA,QAAQ,CAAC,SAAS;AACtB,YAAI,SAAS,MAAM;AACV,iBAAA;AAAA,QAAA;AAET,eAAO,KAAK,MAAM,MAAwB,MAAwB;AAAA,MACpE;AACA,YAAM,OAAO,KAAK,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK;AACxD,UAAI,eAAe,SAAS;AACnB,eAAA,IAAI,KAAK,KAAK;AAAA,MAAA;AAEvB,aAAO,MAAM,GAAG;AAAA,IAClB;AAAA,IACA,SAAS,CAAC,MAAM,aAAa,QAAQ;AAAA,MACnC;AAAA,MACA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,YACV;AAAA,UACF,GAAG,EAAE;AAEE,iBAAA;AAAA,YACL,eAAe;AAAA,UACjB;AAAA,QAAA,CACD;AAAA,MACH;AAAA,MAEA,oBAAoB,MAAM;AACxB,YAAI,EAAE,eAAe,CAAA,GAAI;AAAA,MAC3B;AAAA,MAEA,uBAAuB,CAAC,eAAe,YACrC;AAAA,QACE,IAAM,EAAA,cAAc,aAAa,GAAG,WAAW,CAAC;AAAA,QAChD;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ;AAAA,MACE,MAAM;AAAA,MACN,SAAS,kBAAkB,MAAM,cAAc;AAAA,IAAA;AAAA,EACjD;AAEJ;","x_google_ignoreList":[0]}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const zustand = require("zustand");
4
- const useEditionPanelStore = zustand.create((set) => ({
5
- focusedContent: null,
6
- setFocusedContent: (content) => set({ focusedContent: content }),
7
- setFocusedContentKeyPath: (keyPath) => set((state) => ({
8
- focusedContent: {
9
- ...state.focusedContent,
10
- keyPath
11
- }
12
- }))
13
- }));
14
- exports.useEditionPanelStore = useEditionPanelStore;
15
- //# sourceMappingURL=useEditionPanelStore.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEditionPanelStore.cjs","sources":["../../../src/components/DictionaryEditor/useEditionPanelStore.ts"],"sourcesContent":["import type { KeyPath } from '@intlayer/core';\nimport { create } from 'zustand';\n\ntype DictionaryPath = string;\ntype FileContent = {\n dictionaryKey: string;\n keyPath?: KeyPath[];\n dictionaryPath?: DictionaryPath;\n};\n\ntype EditionPanelStore = {\n focusedContent: FileContent | null;\n setFocusedContent: (content: FileContent | null) => void;\n setFocusedContentKeyPath: (keyPath: KeyPath[]) => void;\n};\n\nexport const useEditionPanelStore = create<EditionPanelStore>((set) => ({\n focusedContent: null,\n setFocusedContent: (content) => set({ focusedContent: content }),\n setFocusedContentKeyPath: (keyPath) =>\n set((state) => ({\n focusedContent: {\n ...state.focusedContent!,\n keyPath,\n },\n })),\n}));\n"],"names":["create"],"mappings":";;;AAgBa,MAAA,uBAAuBA,QAAAA,OAA0B,CAAC,SAAS;AAAA,EACtE,gBAAgB;AAAA,EAChB,mBAAmB,CAAC,YAAY,IAAI,EAAE,gBAAgB,SAAS;AAAA,EAC/D,0BAA0B,CAAC,YACzB,IAAI,CAAC,WAAW;AAAA,IACd,gBAAgB;AAAA,MACd,GAAG,MAAM;AAAA,MACT;AAAA,IAAA;AAAA,EACF,EACA;AACN,EAAE;;"}
@@ -1,15 +0,0 @@
1
- import { KeyPath } from '@intlayer/core';
2
- type DictionaryPath = string;
3
- type FileContent = {
4
- dictionaryKey: string;
5
- keyPath?: KeyPath[];
6
- dictionaryPath?: DictionaryPath;
7
- };
8
- type EditionPanelStore = {
9
- focusedContent: FileContent | null;
10
- setFocusedContent: (content: FileContent | null) => void;
11
- setFocusedContentKeyPath: (keyPath: KeyPath[]) => void;
12
- };
13
- export declare const useEditionPanelStore: import('zustand').UseBoundStore<import('zustand').StoreApi<EditionPanelStore>>;
14
- export {};
15
- //# sourceMappingURL=useEditionPanelStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEditionPanelStore.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/useEditionPanelStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,KAAK,cAAc,GAAG,MAAM,CAAC;AAC7B,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,cAAc,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,iBAAiB,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACzD,wBAAwB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACxD,CAAC;AAEF,eAAO,MAAM,oBAAoB,gFAU9B,CAAC"}
@@ -1,15 +0,0 @@
1
- import { create } from "zustand";
2
- const useEditionPanelStore = create((set) => ({
3
- focusedContent: null,
4
- setFocusedContent: (content) => set({ focusedContent: content }),
5
- setFocusedContentKeyPath: (keyPath) => set((state) => ({
6
- focusedContent: {
7
- ...state.focusedContent,
8
- keyPath
9
- }
10
- }))
11
- }));
12
- export {
13
- useEditionPanelStore
14
- };
15
- //# sourceMappingURL=useEditionPanelStore.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEditionPanelStore.mjs","sources":["../../../src/components/DictionaryEditor/useEditionPanelStore.ts"],"sourcesContent":["import type { KeyPath } from '@intlayer/core';\nimport { create } from 'zustand';\n\ntype DictionaryPath = string;\ntype FileContent = {\n dictionaryKey: string;\n keyPath?: KeyPath[];\n dictionaryPath?: DictionaryPath;\n};\n\ntype EditionPanelStore = {\n focusedContent: FileContent | null;\n setFocusedContent: (content: FileContent | null) => void;\n setFocusedContentKeyPath: (keyPath: KeyPath[]) => void;\n};\n\nexport const useEditionPanelStore = create<EditionPanelStore>((set) => ({\n focusedContent: null,\n setFocusedContent: (content) => set({ focusedContent: content }),\n setFocusedContentKeyPath: (keyPath) =>\n set((state) => ({\n focusedContent: {\n ...state.focusedContent!,\n keyPath,\n },\n })),\n}));\n"],"names":[],"mappings":";AAgBa,MAAA,uBAAuB,OAA0B,CAAC,SAAS;AAAA,EACtE,gBAAgB;AAAA,EAChB,mBAAmB,CAAC,YAAY,IAAI,EAAE,gBAAgB,SAAS;AAAA,EAC/D,0BAA0B,CAAC,YACzB,IAAI,CAAC,WAAW;AAAA,IACd,gBAAgB;AAAA,MACd,GAAG,MAAM;AAAA,MACT;AAAA,IAAA;AAAA,EACF,EACA;AACN,EAAE;"}
@@ -1,8 +0,0 @@
1
- import { Locales } from 'intlayer';
2
- import { FC } from 'react';
3
- type LocaleSelectorProps = {
4
- availableLocales: Locales[];
5
- };
6
- export declare const LocaleSelector: FC<LocaleSelectorProps>;
7
- export {};
8
- //# sourceMappingURL=LocaleSelector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocaleSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/LocaleSelector/LocaleSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAiC,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAOhC,KAAK,mBAAmB,GAAG;IACzB,gBAAgB,EAAE,OAAO,EAAE,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAkDlD,CAAC"}
@@ -1,13 +0,0 @@
1
- import { Locales } from 'intlayer';
2
- import { PropsWithChildren, FC } from 'react';
3
- type LocaleSelectorContextProps = {
4
- selectedLocales: Locales[];
5
- setSelectedLocales: (locales: Locales[]) => void;
6
- };
7
- export declare const useLocaleSelector: () => LocaleSelectorContextProps;
8
- type LocaleSelectorProviderProps = {
9
- defaultSelectedLocales?: Locales[];
10
- };
11
- export declare const LocaleSelectorProvider: FC<PropsWithChildren<LocaleSelectorProviderProps>>;
12
- export {};
13
- //# sourceMappingURL=LocaleSelectorContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocaleSelectorContext.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/LocaleSelector/LocaleSelectorContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAEL,iBAAiB,EAGjB,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;AAIf,KAAK,0BAA0B,GAAG;IAChC,eAAe,EAAE,OAAO,EAAE,CAAC;IAC3B,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CAClD,CAAC;AAOF,eAAO,MAAM,iBAAiB,kCAA0C,CAAC;AAEzE,KAAK,2BAA2B,GAAG;IACjC,sBAAsB,CAAC,EAAE,OAAO,EAAE,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,EAAE,CACrC,iBAAiB,CAAC,2BAA2B,CAAC,CAiB/C,CAAC"}